@kaitranntt/ccs 7.51.0-dev.4 → 7.51.0-dev.6

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 (44) hide show
  1. package/README.md +1 -1
  2. package/dist/cliproxy/stats-fetcher.d.ts +41 -0
  3. package/dist/cliproxy/stats-fetcher.d.ts.map +1 -1
  4. package/dist/cliproxy/stats-fetcher.js +32 -1
  5. package/dist/cliproxy/stats-fetcher.js.map +1 -1
  6. package/dist/ui/assets/{accounts-Cs_Uohn7.js → accounts-CbGqm04Q.js} +1 -1
  7. package/dist/ui/assets/{alert-dialog-cRwDSggu.js → alert-dialog-zpinTbtF.js} +1 -1
  8. package/dist/ui/assets/{api-C73W2Hb1.js → api-CalCxo_A.js} +1 -1
  9. package/dist/ui/assets/{auth-section-DgF431PH.js → auth-section-BjuUeaLO.js} +1 -1
  10. package/dist/ui/assets/{backups-section-9V2yDu_e.js → backups-section-DNkq5ZUy.js} +1 -1
  11. package/dist/ui/assets/{checkbox-BeoeEcEZ.js → checkbox-Df7G7a1w.js} +1 -1
  12. package/dist/ui/assets/{cliproxy-DAlyh7zw.js → cliproxy-DLwo08Aq.js} +1 -1
  13. package/dist/ui/assets/{cliproxy-control-panel-CE4y4VDk.js → cliproxy-control-panel--SMhq8Fs.js} +1 -1
  14. package/dist/ui/assets/{confirm-dialog-COTT5ztZ.js → confirm-dialog-Dl3qe-0j.js} +1 -1
  15. package/dist/ui/assets/{copilot-Cm5PT0v6.js → copilot-CdJG-Shj.js} +1 -1
  16. package/dist/ui/assets/{cursor-DYhCaKbC.js → cursor-DMH09Hqq.js} +1 -1
  17. package/dist/ui/assets/{droid-eTM2_tVh.js → droid-ufxKKFsV.js} +1 -1
  18. package/dist/ui/assets/{globalenv-section-Dzt_ECFK.js → globalenv-section-CZMJi0Tl.js} +1 -1
  19. package/dist/ui/assets/{health-Bk8Cj2vi.js → health-CU3rjKc6.js} +1 -1
  20. package/dist/ui/assets/{index-BXDW5hxG.js → index-CFOuEr7f.js} +1 -1
  21. package/dist/ui/assets/{index-CKnNRLzv.js → index-CxzNRZhe.js} +1 -1
  22. package/dist/ui/assets/{index-jqDLGaO4.js → index-KBHcxzj5.js} +1 -1
  23. package/dist/ui/assets/index-UzqXH0bn.js +47 -0
  24. package/dist/ui/assets/{index-D1Gx_G_A.js → index-v5UgttWm.js} +1 -1
  25. package/dist/ui/assets/{proxy-status-widget-D-PfDCn1.js → proxy-status-widget-FJrBfPdV.js} +1 -1
  26. package/dist/ui/assets/{separator-CjXUYlSy.js → separator-B8bpSt_-.js} +1 -1
  27. package/dist/ui/assets/{shared-C9EvhZ8u.js → shared-BK-E4ojq.js} +1 -1
  28. package/dist/ui/assets/{switch-DFLN6xA0.js → switch-kyFX8Qe1.js} +1 -1
  29. package/dist/ui/assets/{updates-FcpGeTFg.js → updates-DBinmc39.js} +1 -1
  30. package/dist/ui/index.html +1 -1
  31. package/dist/web-server/usage/aggregator.d.ts +4 -0
  32. package/dist/web-server/usage/aggregator.d.ts.map +1 -1
  33. package/dist/web-server/usage/aggregator.js +24 -1
  34. package/dist/web-server/usage/aggregator.js.map +1 -1
  35. package/dist/web-server/usage/cliproxy-usage-syncer.d.ts +34 -0
  36. package/dist/web-server/usage/cliproxy-usage-syncer.d.ts.map +1 -0
  37. package/dist/web-server/usage/cliproxy-usage-syncer.js +152 -0
  38. package/dist/web-server/usage/cliproxy-usage-syncer.js.map +1 -0
  39. package/dist/web-server/usage/cliproxy-usage-transformer.d.ts +26 -0
  40. package/dist/web-server/usage/cliproxy-usage-transformer.d.ts.map +1 -0
  41. package/dist/web-server/usage/cliproxy-usage-transformer.js +141 -0
  42. package/dist/web-server/usage/cliproxy-usage-transformer.js.map +1 -0
  43. package/package.json +1 -1
  44. package/dist/ui/assets/index-hlYFfpDN.js +0 -47
@@ -1,47 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BXDW5hxG.js","assets/radix-ui-BR1vy4kf.js","assets/react-vendor-CNOkPC89.js","assets/switch-DFLN6xA0.js","assets/icons-kPbuhVdj.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-Dzt_ECFK.js","assets/index-CKnNRLzv.js","assets/index-D1Gx_G_A.js","assets/default-ports-1QQSffYX.js","assets/proxy-status-widget-D-PfDCn1.js","assets/alert-dialog-cRwDSggu.js","assets/auth-section-DgF431PH.js","assets/backups-section-9V2yDu_e.js","assets/index-jqDLGaO4.js","assets/charts-BBPXh0Ar.js","assets/api-C73W2Hb1.js","assets/confirm-dialog-COTT5ztZ.js","assets/separator-CjXUYlSy.js","assets/cliproxy-DAlyh7zw.js","assets/checkbox-BeoeEcEZ.js","assets/cliproxy-control-panel-CE4y4VDk.js","assets/copilot-Cm5PT0v6.js","assets/cursor-DYhCaKbC.js","assets/droid-eTM2_tVh.js","assets/accounts-Cs_Uohn7.js","assets/health-Bk8Cj2vi.js","assets/shared-C9EvhZ8u.js","assets/updates-FcpGeTFg.js"])))=>i.map(i=>d[i]);
2
- import{j as r,S as pr,R as jy,C as Ay,a as Ey,T as My,D as Oy,P as Ty,O as Dy,b as U0,c as H0,d as I0,e as B0,f as q0,A as K0,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 ky,p as Z0,q as Ry,r as _y,s as J0,t as zy,V as eS,L as Ly,u as Py,v as tS,w as nS,x as Uy,y as aS,z as sS,G as iS,B as Hy,E as oS,F as lS,H as Iy,J as rS,K as By,M as qy,N as Ky,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 Md,f as pS,r as S,u as gr,O as md,N as gS,h as Od,L as pd,R as yS,g as xS,i as vS,c as se,B as bS,j as SS,k as zt}from"./react-vendor-CNOkPC89.js";import{Q as CS,u as Et,a as dt,b as pt,c as wS}from"./tanstack-e99Cjjy2.js";import{t as re,T as NS}from"./notifications-B2HqRBj7.js";import{L as Tn,X as vi,P as jS,C as yr,H as AS,a as ES,K as Yy,G as MS,Z as Vy,b as Fy,F as Qy,U as $y,S as OS,A as To,c as TS,d as DS,M as kS,E as xr,e as vr,B as RS,R as Do,W as _S,f as zS,g as LS,h as PS,i as cg,j as ug,k as yi,l as Td,m as lr,n as Wy,o as US,p as HS,q as br,r as Dd,s as Xy,t as ko,u as Sr,v as kd,w as IS,x as BS,y as Cr,z as qS,T as va,D as KS,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 _d,a4 as JS,a5 as eC,a6 as tC,a7 as fg,a8 as nC,a9 as aC}from"./icons-kPbuhVdj.js";import{t as sC,c as iC,a as Nr,e as xo,f as Co,b as oC,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 jC,z as AC,A as EC,B as MC,C as OC,D as TC,E as DC,F as kC,G as RC,H as _C,I as zC,J as LC}from"./utils-CzKF5WmX.js";import{o as hg,s as mg,p as PC,a as UC,$ as HC,b as Zy,c as IC,_ as BC,d as xs,u as qC,e as pg}from"./form-utils-Cn_Uld6y.js";import{H as KC,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 o(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=o(u);fetch(u.href,f)}})();var Vu={exports:{}},vo={},Fu={exports:{}},Qu={};var yg;function GC(){return yg||(yg=1,(function(n){function a(R,W){var ee=R.length;R.push(W);e:for(;0<ee;){var $=ee-1>>>1,ce=R[$];if(0<u(ce,W))R[$]=W,R[ee]=ce,ee=$;else break e}}function o(R){return R.length===0?null:R[0]}function l(R){if(R.length===0)return null;var W=R[0],ee=R.pop();if(ee!==W){R[0]=ee;e:for(var $=0,ce=R.length,fe=ce>>>1;$<fe;){var Ne=2*($+1)-1,V=R[Ne],J=Ne+1,oe=R[J];if(0>u(V,ee))J<ce&&0>u(oe,V)?(R[$]=oe,R[J]=ee,$=J):(R[$]=V,R[Ne]=ee,$=Ne);else if(J<ce&&0>u(oe,ee))R[$]=oe,R[J]=ee,$=J;else break e}}return W}function u(R,W){var ee=R.sortIndex-W.sortIndex;return ee!==0?ee:R.id-W.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,O=!1,D=!1,M=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function U(R){for(var W=o(y);W!==null;){if(W.callback===null)l(y);else if(W.startTime<=R)l(y),W.sortIndex=W.expirationTime,a(p,W);else break;W=o(y)}}function k(R){if(O=!1,U(R),!w)if(o(p)!==null)w=!0,j||(j=!0,te());else{var W=o(y);W!==null&&Ce(k,W.startTime-R)}}var j=!1,L=-1,X=5,F=-1;function Q(){return D?!0:!(n.unstable_now()-F<X)}function ae(){if(D=!1,j){var R=n.unstable_now();F=R;var W=!0;try{e:{w=!1,O&&(O=!1,I(L),L=-1),N=!0;var ee=b;try{t:{for(U(R),x=o(p);x!==null&&!(x.expirationTime>R&&Q());){var $=x.callback;if(typeof $=="function"){x.callback=null,b=x.priorityLevel;var ce=$(x.expirationTime<=R);if(R=n.unstable_now(),typeof ce=="function"){x.callback=ce,U(R),W=!0;break t}x===o(p)&&l(p),U(R)}else l(p);x=o(p)}if(x!==null)W=!0;else{var fe=o(y);fe!==null&&Ce(k,fe.startTime-R),W=!1}}break e}finally{x=null,b=ee,N=!1}W=void 0}}finally{W?te():j=!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,W){L=M(function(){R(n.unstable_now())},W)}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"):X=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 W=3;break;default:W=b}var ee=b;b=W;try{return R()}finally{b=ee}},n.unstable_requestPaint=function(){D=!0},n.unstable_runWithPriority=function(R,W){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var ee=b;b=R;try{return W()}finally{b=ee}},n.unstable_scheduleCallback=function(R,W,ee){var $=n.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?$+ee:$):ee=$,R){case 1:var ce=-1;break;case 2:ce=250;break;case 5:ce=1073741823;break;case 4:ce=1e4;break;default:ce=5e3}return ce=ee+ce,R={id:C++,callback:W,priorityLevel:R,startTime:ee,expirationTime:ce,sortIndex:-1},ee>$?(R.sortIndex=ee,a(y,R),o(p)===null&&R===o(y)&&(O?(I(L),L=-1):O=!0,Ce(k,ee-$))):(R.sortIndex=ce,a(p,R),w||N||(w=!0,j||(j=!0,te()))),R},n.unstable_shouldYield=Q,n.unstable_wrapCallback=function(R){var W=b;return function(){var ee=b;b=W;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 vo;vg=1;var n=YC(),a=Md(),o=pS();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}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,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s: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 s=e,i=t;;){var c=s.return;if(c===null)break;var d=c.alternate;if(d===null){if(i=c.return,i!==null){s=i;continue}break}if(c.child===d.child){for(d=c.child;d;){if(d===s)return p(c),e;if(d===i)return p(c),t;d=d.sibling}throw Error(l(188))}if(s.return!==i.return)s=c,i=d;else{for(var g=!1,v=c.child;v;){if(v===s){g=!0,s=c,i=d;break}if(v===i){g=!0,i=c,s=d;break}v=v.sibling}if(!g){for(v=d.child;v;){if(v===s){g=!0,s=d,i=c;break}if(v===i){g=!0,i=d,s=c;break}v=v.sibling}if(!g)throw Error(l(189))}}if(s.alternate!==i)throw Error(l(190))}if(s.tag!==3)throw Error(l(188));return s.stateNode.current===s?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"),O=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),I=Symbol.for("react.consumer"),B=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),X=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 O:return"Fragment";case M:return"Profiler";case D:return"StrictMode";case k:return"Suspense";case j:return"SuspenseList";case F:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case B:return e.displayName||"Context";case I: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 L:return t=e.displayName||null,t!==null?t:de(e.type)||"Memo";case X: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,W=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},$=[],ce=-1;function fe(e){return{current:e}}function Ne(e){0>ce||(e.current=$[ce],$[ce]=null,ce--)}function V(e,t){ce++,$[ce]=e.current,e.current=t}var J=fe(null),oe=fe(null),ne=fe(null),ie=fe(null);function xe(e,t){switch(V(ne,t),V(oe,e),V(J,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?kp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=kp(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 _e(){Ne(J),Ne(oe),Ne(ne)}function Ke(e){e.memoizedState!==null&&V(ie,e);var t=J.current,s=Rp(t,e.type);t!==s&&(V(oe,e),V(J,s))}function St(e){oe.current===e&&(Ne(J),Ne(oe)),ie.current===e&&(Ne(ie),mo._currentValue=ee)}var Ct,Ye;function nt(e){if(Ct===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);Ct=t&&t[1]||"",Ye=-1<s.stack.indexOf(`
3
- at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
4
- `+Ct+e+Ye}var Ut=!1;function Qt(e,t){if(!e||Ut)return"";Ut=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={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(H){var P=H}Reflect.construct(e,[],Y)}else{try{Y.call()}catch(H){P=H}e.call(Y.prototype)}}else{try{throw Error()}catch(H){P=H}(Y=e())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(H){if(H&&P&&typeof H.stack=="string")return[H.stack,P.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var c=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");c&&c.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=i.DetermineComponentFrameRoot(),g=d[0],v=d[1];if(g&&v){var A=g.split(`
5
- `),z=v.split(`
6
- `);for(c=i=0;i<A.length&&!A[i].includes("DetermineComponentFrameRoot");)i++;for(;c<z.length&&!z[c].includes("DetermineComponentFrameRoot");)c++;if(i===A.length||c===z.length)for(i=A.length-1,c=z.length-1;1<=i&&0<=c&&A[i]!==z[c];)c--;for(;1<=i&&0<=c;i--,c--)if(A[i]!==z[c]){if(i!==1||c!==1)do if(i--,c--,0>c||A[i]!==z[c]){var K=`
7
- `+A[i].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),K}while(1<=i&&0<=c);break}}}finally{Ut=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?nt(s):""}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 Ee(e){try{var t="",s=null;do t+=Gn(e,s),s=e,e=e.return;while(e);return t}catch(i){return`
8
- Error generating stack: `+i.message+`
9
- `+i.stack}}var $t=Object.prototype.hasOwnProperty,Dn=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,kn=n.unstable_NormalPriority,Rn=n.unstable_LowPriority,Es=n.unstable_IdlePriority,Ci=n.log,wi=n.unstable_setDisableYieldValue,Fn=null,Z=null;function Te(e){if(typeof Ci=="function"&&wi(e),Z&&typeof Z.setStrictMode=="function")try{Z.setStrictMode(Fn,e)}catch{}}var ve=Math.clz32?Math.clz32:he,De=Math.log,at=Math.LN2;function he(e){return e>>>=0,e===0?32:31-(De(e)/at|0)|0}var Ae=256,be=262144,ke=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,s){var i=e.pendingLanes;if(i===0)return 0;var c=0,d=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var v=i&134217727;return v!==0?(i=v&~d,i!==0?c=Je(i):(g&=v,g!==0?c=Je(g):s||(s=v&~e,s!==0&&(c=Je(s))))):(v=i&~d,v!==0?c=Je(v):g!==0?c=Je(g):s||(s=i&~e,s!==0&&(c=Je(s)))),c===0?0:t!==0&&t!==c&&(t&d)===0&&(d=c&-c,s=t&-t,d>=s||d===32&&(s&4194048)!==0)?t:c}function _t(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=ke;return ke<<=1,(ke&62914560)===0&&(ke=4194304),e}function Zt(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function wn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ni(e,t,s,i,c,d){var g=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var v=e.entanglements,A=e.expirationTimes,z=e.hiddenUpdates;for(s=g&~s;0<s;){var K=31-ve(s),Y=1<<K;v[K]=0,A[K]=-1;var P=z[K];if(P!==null)for(z[K]=null,K=0;K<P.length;K++){var H=P[K];H!==null&&(H.lane&=-536870913)}s&=~Y}i!==0&&es(e,i,0),d!==0&&c===0&&e.tag!==0&&(e.suspendedLanes|=d&~(g&~t))}function es(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-ve(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|s&261930}function ji(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var i=31-ve(s),c=1<<i;c&t|e[i]&t&&(e[i]|=t),s&=~c}}function dn(e,t){var s=t&-t;return s=(s&42)!==0?1:$n(s),(s&(e.suspendedLanes|t))!==0?0:s}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 Ms(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ai(){var e=W.p;return e!==0?e:(e=window.event,e===void 0?32:ng(e.type))}function Ei(e,t){var s=W.p;try{return W.p=e,t()}finally{W.p=s}}var Ca=Math.random().toString(36).slice(2),Mt="__reactFiber$"+Ca,Ht="__reactProps$"+Ca,Os="__reactContainer$"+Ca,Pr="__reactEvents$"+Ca,Ev="__reactListeners$"+Ca,Mv="__reactHandles$"+Ca,vf="__reactResources$"+Ca,Mi="__reactMarker$"+Ca;function Ur(e){delete e[Mt],delete e[Ht],delete e[Pr],delete e[Ev],delete e[Mv]}function Ts(e){var t=e[Mt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[Os]||s[Mt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=Ip(e);e!==null;){if(s=e[Mt])return s;e=Ip(e)}return t}e=s,s=e.parentNode}return null}function Ds(e){if(e=e[Mt]||e[Os]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Oi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function ks(e){var t=e[vf];return t||(t=e[vf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function jt(e){e[Mi]=!0}var bf=new Set,Sf={};function ts(e,t){Rs(e,t),Rs(e+"Capture",t)}function Rs(e,t){for(Sf[e]=t,e=0;e<t.length;e++)bf.add(t[e])}var Ov=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 Tv(e){return $t.call(wf,e)?!0:$t.call(Cf,e)?!1:Ov.test(e)?wf[e]=!0:(Cf[e]=!0,!1)}function Io(e,t,s){if(Tv(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+s)}}function Bo(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function Wn(e,t,s,i){if(i===null)e.removeAttribute(s);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+i)}}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 Dv(e,t,s){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var c=i.get,d=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return c.call(this)},set:function(g){s=""+g,d.call(this,g)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return s},setValue:function(g){s=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Hr(e){if(!e._valueTracker){var t=Nf(e)?"checked":"value";e._valueTracker=Dv(e,t,""+e[t])}}function jf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),i="";return e&&(i=Nf(e)?e.checked?"true":"false":e.value),e=i,e!==s?(t.setValue(e),!0):!1}function qo(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 kv=/[\n"\\]/g;function hn(e){return e.replace(kv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ir(e,t,s,i,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)):s!=null?Br(e,g,fn(s)):i!=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 Af(e,t,s,i,c,d,g,v){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||s!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){Hr(e);return}s=s!=null?""+fn(s):"",t=t!=null?""+fn(t):s,v||t===e.value||(e.value=t),e.defaultValue=t}i=i??c,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=v?e.checked:!!i,e.defaultChecked=!!i,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),Hr(e)}function Br(e,t,s){t==="number"&&qo(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function _s(e,t,s,i){if(e=e.options,t){t={};for(var c=0;c<s.length;c++)t["$"+s[c]]=!0;for(s=0;s<e.length;s++)c=t.hasOwnProperty("$"+e[s].value),e[s].selected!==c&&(e[s].selected=c),c&&i&&(e[s].defaultSelected=!0)}else{for(s=""+fn(s),t=null,c=0;c<e.length;c++){if(e[c].value===s){e[c].selected=!0,i&&(e[c].defaultSelected=!0);return}t!==null||e[c].disabled||(t=e[c])}t!==null&&(t.selected=!0)}}function Ef(e,t,s){if(t!=null&&(t=""+fn(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+fn(s):""}function Mf(e,t,s,i){if(t==null){if(i!=null){if(s!=null)throw Error(l(92));if(Ce(i)){if(1<i.length)throw Error(l(93));i=i[0]}s=i}s==null&&(s=""),t=s}s=fn(t),e.defaultValue=s,i=e.textContent,i===s&&i!==""&&i!==null&&(e.value=i),Hr(e)}function zs(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.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 Of(e,t,s){var i=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,s):typeof s!="number"||s===0||Rv.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function Tf(e,t,s){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,s!=null){for(var i in s)!s.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var c in t)i=t[c],t.hasOwnProperty(c)&&s[c]!==i&&Of(e,c,i)}else for(var d in t)t.hasOwnProperty(d)&&Of(e,d,t[d])}function qr(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 _v=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"]]),zv=/^[\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 Ko(e){return zv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Xn(){}var Kr=null;function Gr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ls=null,Ps=null;function Df(e){var t=Ds(e);if(t&&(e=t.stateNode)){var s=e[Ht]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ir(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+hn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var i=s[t];if(i!==e&&i.form===e.form){var c=i[Ht]||null;if(!c)throw Error(l(90));Ir(i,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name)}}for(t=0;t<s.length;t++)i=s[t],i.form===e.form&&jf(i)}break e;case"textarea":Ef(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&_s(e,!!s.multiple,t,!1)}}}var Yr=!1;function kf(e,t,s){if(Yr)return e(t,s);Yr=!0;try{var i=e(t);return i}finally{if(Yr=!1,(Ls!==null||Ps!==null)&&(Tl(),Ls&&(t=Ls,e=Ps,Ps=Ls=null,Df(t),e)))for(t=0;t<e.length;t++)Df(e[t])}}function Ti(e,t){var s=e.stateNode;if(s===null)return null;var i=s[Ht]||null;if(i===null)return null;s=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(l(231,t,typeof s));return s}var Zn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vr=!1;if(Zn)try{var Di={};Object.defineProperty(Di,"passive",{get:function(){Vr=!0}}),window.addEventListener("test",Di,Di),window.removeEventListener("test",Di,Di)}catch{Vr=!1}var wa=null,Fr=null,Go=null;function Rf(){if(Go)return Go;var e,t=Fr,s=t.length,i,c="value"in wa?wa.value:wa.textContent,d=c.length;for(e=0;e<s&&t[e]===c[e];e++);var g=s-e;for(i=1;i<=g&&t[s-i]===c[d-i];i++);return Go=c.slice(e,1<i?1-i:void 0)}function Yo(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 Vo(){return!0}function _f(){return!1}function It(e){function t(s,i,c,d,g){this._reactName=s,this._targetInst=c,this.type=i,this.nativeEvent=d,this.target=g,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(s=e[v],this[v]=s?s(d):d[v]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Vo:_f,this.isPropagationStopped=_f,this}return x(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Vo)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Vo)},persist:function(){},isPersistent:Vo}),t}var ns={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fo=It(ns),ki=x({},ns,{view:0,detail:0}),Lv=It(ki),Qr,$r,Ri,Qo=x({},ki,{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!==Ri&&(Ri&&e.type==="mousemove"?(Qr=e.screenX-Ri.screenX,$r=e.screenY-Ri.screenY):$r=Qr=0,Ri=e),Qr)},movementY:function(e){return"movementY"in e?e.movementY:$r}}),zf=It(Qo),Pv=x({},Qo,{dataTransfer:0}),Uv=It(Pv),Hv=x({},ki,{relatedTarget:0}),Wr=It(Hv),Iv=x({},ns,{animationName:0,elapsedTime:0,pseudoElement:0}),Bv=It(Iv),qv=x({},ns,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Kv=It(qv),Gv=x({},ns,{data:0}),Lf=It(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({},ki,{key:function(e){if(e.key){var t=Yv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Yo(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"?Yo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Wv=It($v),Xv=x({},Qo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pf=It(Xv),Zv=x({},ki,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Xr}),Jv=It(Zv),eb=x({},ns,{propertyName:0,elapsedTime:0,pseudoElement:0}),tb=It(eb),nb=x({},Qo,{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=It(nb),sb=x({},ns,{newState:0,oldState:0}),ib=It(sb),ob=[9,13,27,32],Zr=Zn&&"CompositionEvent"in window,_i=null;Zn&&"documentMode"in document&&(_i=document.documentMode);var lb=Zn&&"TextEvent"in window&&!_i,Uf=Zn&&(!Zr||_i&&8<_i&&11>=_i),Hf=" ",If=!1;function Bf(e,t){switch(e){case"keyup":return ob.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function qf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Us=!1;function rb(e,t){switch(e){case"compositionend":return qf(t);case"keypress":return t.which!==32?null:(If=!0,Hf);case"textInput":return e=t.data,e===Hf&&If?null:e;default:return null}}function cb(e,t){if(Us)return e==="compositionend"||!Zr&&Bf(e,t)?(e=Rf(),Go=Fr=wa=null,Us=!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 Kf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ub[e.type]:t==="textarea"}function Gf(e,t,s,i){Ls?Ps?Ps.push(i):Ps=[i]:Ls=i,t=Pl(t,"onChange"),0<t.length&&(s=new Fo("onChange","change",null,s,i),e.push({event:s,listeners:t}))}var zi=null,Li=null;function db(e){Ap(e,0)}function $o(e){var t=Oi(e);if(jf(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(){zi&&(zi.detachEvent("onpropertychange",$f),Li=zi=null)}function $f(e){if(e.propertyName==="value"&&$o(Li)){var t=[];Gf(t,Li,e,Gr(e)),kf(db,t)}}function fb(e,t,s){e==="focusin"?(Qf(),zi=t,Li=s,zi.attachEvent("onpropertychange",$f)):e==="focusout"&&Qf()}function hb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return $o(Li)}function mb(e,t){if(e==="click")return $o(t)}function pb(e,t){if(e==="input"||e==="change")return $o(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 Pi(e,t){if(Jt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),i=Object.keys(t);if(s.length!==i.length)return!1;for(i=0;i<s.length;i++){var c=s[i];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 s=Wf(e);e=0;for(var i;s;){if(s.nodeType===3){if(i=e+s.textContent.length,e<=t&&i>=t)return{node:s,offset:t-e};e=i}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Wf(s)}}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=qo(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=qo(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,Hs=null,nc=null,Ui=null,ac=!1;function eh(e,t,s){var i=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;ac||Hs==null||Hs!==qo(i)||(i=Hs,"selectionStart"in i&&tc(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Ui&&Pi(Ui,i)||(Ui=i,i=Pl(nc,"onSelect"),0<i.length&&(t=new Fo("onSelect","select",null,t,s),e.push({event:t,listeners:i}),t.target=Hs)))}function as(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var Is={animationend:as("Animation","AnimationEnd"),animationiteration:as("Animation","AnimationIteration"),animationstart:as("Animation","AnimationStart"),transitionrun:as("Transition","TransitionRun"),transitionstart:as("Transition","TransitionStart"),transitioncancel:as("Transition","TransitionCancel"),transitionend:as("Transition","TransitionEnd")},sc={},th={};Zn&&(th=document.createElement("div").style,"AnimationEvent"in window||(delete Is.animationend.animation,delete Is.animationiteration.animation,delete Is.animationstart.animation),"TransitionEvent"in window||delete Is.transitionend.transition);function ss(e){if(sc[e])return sc[e];if(!Is[e])return e;var t=Is[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in th)return sc[e]=t[s];return e}var nh=ss("animationend"),ah=ss("animationiteration"),sh=ss("animationstart"),xb=ss("transitionrun"),vb=ss("transitionstart"),bb=ss("transitioncancel"),ih=ss("transitionend"),oh=new Map,ic="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(" ");ic.push("scrollEnd");function Nn(e,t){oh.set(e,t),ts(t,[e])}var Wo=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=[],Bs=0,oc=0;function Xo(){for(var e=Bs,t=oc=Bs=0;t<e;){var s=mn[t];mn[t++]=null;var i=mn[t];mn[t++]=null;var c=mn[t];mn[t++]=null;var d=mn[t];if(mn[t++]=null,i!==null&&c!==null){var g=i.pending;g===null?c.next=c:(c.next=g.next,g.next=c),i.pending=c}d!==0&&lh(s,c,d)}}function Zo(e,t,s,i){mn[Bs++]=e,mn[Bs++]=t,mn[Bs++]=s,mn[Bs++]=i,oc|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function lc(e,t,s,i){return Zo(e,t,s,i),Jo(e)}function is(e,t){return Zo(e,null,null,t),Jo(e)}function lh(e,t,s){e.lanes|=s;var i=e.alternate;i!==null&&(i.lanes|=s);for(var c=!1,d=e.return;d!==null;)d.childLanes|=s,i=d.alternate,i!==null&&(i.childLanes|=s),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(s),e=d.hiddenUpdates,i=e[c],i===null?e[c]=[t]:i.push(t),t.lane=s|536870912),d):null}function Jo(e){if(50<oo)throw oo=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 qs={};function Sb(e,t,s,i){this.tag=e,this.key=s,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=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function en(e,t,s,i){return new Sb(e,t,s,i)}function rc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jn(e,t){var s=e.alternate;return s===null?(s=en(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function rh(e,t){e.flags&=65011714;var s=e.alternate;return s===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=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function el(e,t,s,i,c,d){var g=0;if(i=e,typeof e=="function")rc(e)&&(g=1);else if(typeof e=="string")g=A0(e,s,J.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case F:return e=en(31,s,t,c),e.elementType=F,e.lanes=d,e;case O:return os(s.children,c,d,t);case D:g=8,c|=24;break;case M:return e=en(12,s,t,c|2),e.elementType=M,e.lanes=d,e;case k:return e=en(13,s,t,c),e.elementType=k,e.lanes=d,e;case j:return e=en(19,s,t,c),e.elementType=j,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case B:g=10;break e;case I:g=9;break e;case U:g=11;break e;case L:g=14;break e;case X:g=16,i=null;break e}g=29,s=Error(l(130,e===null?"null":typeof e,"")),i=null}return t=en(g,s,t,c),t.elementType=e,t.type=i,t.lanes=d,t}function os(e,t,s,i){return e=en(7,e,i,t),e.lanes=s,e}function cc(e,t,s){return e=en(6,e,null,t),e.lanes=s,e}function ch(e){var t=en(18,null,null,0);return t.stateNode=e,t}function uc(e,t,s){return t=en(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,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 s=uh.get(e);return s!==void 0?s:(t={value:e,source:t,stack:Ee(t)},uh.set(e,t),t)}return{value:e,source:t,stack:Ee(t)}}var Ks=[],Gs=0,tl=null,Hi=0,gn=[],yn=0,Na=null,_n=1,zn="";function ea(e,t){Ks[Gs++]=Hi,Ks[Gs++]=tl,tl=e,Hi=t}function dh(e,t,s){gn[yn++]=_n,gn[yn++]=zn,gn[yn++]=Na,Na=e;var i=_n;e=zn;var c=32-ve(i)-1;i&=~(1<<c),s+=1;var d=32-ve(t)+c;if(30<d){var g=c-c%5;d=(i&(1<<g)-1).toString(32),i>>=g,c-=g,_n=1<<32-ve(t)+c|s<<c|i,zn=d+e}else _n=1<<d|s<<c|i,zn=e}function dc(e){e.return!==null&&(ea(e,1),dh(e,1,0))}function fc(e){for(;e===tl;)tl=Ks[--Gs],Ks[Gs]=null,Hi=Ks[--Gs],Ks[Gs]=null;for(;e===Na;)Na=gn[--yn],gn[yn]=null,zn=gn[--yn],gn[yn]=null,_n=gn[--yn],gn[yn]=null}function fh(e,t){gn[yn++]=_n,gn[yn++]=zn,gn[yn++]=Na,_n=t.id,zn=t.overflow,Na=e}var Ot=null,et=null,He=!1,ja=null,xn=!1,hc=Error(l(519));function Aa(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ii(pn(t,e)),hc}function hh(e){var t=e.stateNode,s=e.type,i=e.memoizedProps;switch(t[Mt]=e,t[Ht]=i,s){case"dialog":Le("cancel",t),Le("close",t);break;case"iframe":case"object":case"embed":Le("load",t);break;case"video":case"audio":for(s=0;s<ro.length;s++)Le(ro[s],t);break;case"source":Le("error",t);break;case"img":case"image":case"link":Le("error",t),Le("load",t);break;case"details":Le("toggle",t);break;case"input":Le("invalid",t),Af(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Le("invalid",t);break;case"textarea":Le("invalid",t),Mf(t,i.value,i.defaultValue,i.children)}s=i.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||i.suppressHydrationWarning===!0||Tp(t.textContent,s)?(i.popover!=null&&(Le("beforetoggle",t),Le("toggle",t)),i.onScroll!=null&&Le("scroll",t),i.onScrollEnd!=null&&Le("scrollend",t),i.onClick!=null&&(t.onclick=Xn),t=!0):t=!1,t||Aa(e,!0)}function mh(e){for(Ot=e.return;Ot;)switch(Ot.tag){case 5:case 31:case 13:xn=!1;return;case 27:case 3:xn=!0;return;default:Ot=Ot.return}}function Ys(e){if(e!==Ot)return!1;if(!He)return mh(e),He=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||Du(e.type,e.memoizedProps)),s=!s),s&&et&&Aa(e),mh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));et=Hp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));et=Hp(e)}else t===27?(t=et,Ia(e.type)?(e=Lu,Lu=null,et=e):et=t):et=Ot?bn(e.stateNode.nextSibling):null;return!0}function ls(){et=Ot=null,He=!1}function mc(){var e=ja;return e!==null&&(Gt===null?Gt=e:Gt.push.apply(Gt,e),ja=null),e}function Ii(e){ja===null?ja=[e]:ja.push(e)}var pc=fe(null),rs=null,ta=null;function Ea(e,t,s){V(pc,t._currentValue),t._currentValue=s}function na(e){e._currentValue=pc.current,Ne(pc)}function gc(e,t,s){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===s)break;e=e.return}}function yc(e,t,s,i){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 A=0;A<t.length;A++)if(v.context===t[A]){d.lanes|=s,v=d.alternate,v!==null&&(v.lanes|=s),gc(d.return,s,e),i||(g=null);break e}d=v.next}}else if(c.tag===18){if(g=c.return,g===null)throw Error(l(341));g.lanes|=s,d=g.alternate,d!==null&&(d.lanes|=s),gc(g,s,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 Vs(e,t,s,i){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===ie.current){if(g=c.alternate,g===null)throw Error(l(387));g.memoizedState.memoizedState!==c.memoizedState.memoizedState&&(e!==null?e.push(mo):e=[mo])}c=c.return}e!==null&&yc(t,e,s,i),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 cs(e){rs=e,ta=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Tt(e){return ph(rs,e)}function al(e,t){return rs===null&&cs(e),ph(e,t)}function ph(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,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 s}var Cb=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},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 Bi(e){e.refCount--,e.refCount===0&&wb(Nb,function(){e.controller.abort()})}var qi=null,vc=0,Fs=0,Qs=null;function jb(e,t){if(qi===null){var s=qi=[];vc=0,Fs=Cu(),Qs={status:"pending",value:void 0,then:function(i){s.push(i)}}}return vc++,t.then(gh,gh),t}function gh(){if(--vc===0&&qi!==null){Qs!==null&&(Qs.status="fulfilled");var e=qi;qi=null,Fs=0,Qs=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ab(e,t){var s=[],i={status:"pending",value:null,reason:null,then:function(c){s.push(c)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var c=0;c<s.length;c++)(0,s[c])(t)},function(c){for(i.status="rejected",i.reason=c,c=0;c<s.length;c++)(0,s[c])(void 0)}),i}var yh=R.S;R.S=function(e,t){ep=ft(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&jb(e,t),yh!==null&&yh(e,t)};var us=fe(null);function bc(){var e=us.current;return e!==null?e:Ze.pooledCache}function sl(e,t){t===null?V(us,us.current):V(us,t.pool)}function xh(){var e=bc();return e===null?null:{parent:yt._currentValue,pool:e}}var $s=Error(l(460)),Sc=Error(l(474)),il=Error(l(542)),ol={then:function(){}};function vh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function bh(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(Xn,Xn),t=s),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(i){if(t.status==="pending"){var c=t;c.status="fulfilled",c.value=i}},function(i){if(t.status==="pending"){var c=t;c.status="rejected",c.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ch(e),e}throw fs=t,$s}}function ds(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(fs=s,$s):s}}var fs=null;function Sh(){if(fs===null)throw Error(l(459));var e=fs;return fs=null,e}function Ch(e){if(e===$s||e===il)throw Error(l(483))}var Ws=null,Ki=0;function ll(e){var t=Ki;return Ki+=1,Ws===null&&(Ws=[]),bh(Ws,e,t)}function Gi(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(T,E){if(e){var _=T.deletions;_===null?(T.deletions=[E],T.flags|=16):_.push(E)}}function s(T,E){if(!e)return null;for(;E!==null;)t(T,E),E=E.sibling;return null}function i(T){for(var E=new Map;T!==null;)T.key!==null?E.set(T.key,T):E.set(T.index,T),T=T.sibling;return E}function c(T,E){return T=Jn(T,E),T.index=0,T.sibling=null,T}function d(T,E,_){return T.index=_,e?(_=T.alternate,_!==null?(_=_.index,_<E?(T.flags|=67108866,E):_):(T.flags|=67108866,E)):(T.flags|=1048576,E)}function g(T){return e&&T.alternate===null&&(T.flags|=67108866),T}function v(T,E,_,G){return E===null||E.tag!==6?(E=cc(_,T.mode,G),E.return=T,E):(E=c(E,_),E.return=T,E)}function A(T,E,_,G){var pe=_.type;return pe===O?K(T,E,_.props.children,G,_.key):E!==null&&(E.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===X&&ds(pe)===E.type)?(E=c(E,_.props),Gi(E,_),E.return=T,E):(E=el(_.type,_.key,_.props,null,T.mode,G),Gi(E,_),E.return=T,E)}function z(T,E,_,G){return E===null||E.tag!==4||E.stateNode.containerInfo!==_.containerInfo||E.stateNode.implementation!==_.implementation?(E=uc(_,T.mode,G),E.return=T,E):(E=c(E,_.children||[]),E.return=T,E)}function K(T,E,_,G,pe){return E===null||E.tag!==7?(E=os(_,T.mode,G,pe),E.return=T,E):(E=c(E,_),E.return=T,E)}function Y(T,E,_){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return E=cc(""+E,T.mode,_),E.return=T,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case N:return _=el(E.type,E.key,E.props,null,T.mode,_),Gi(_,E),_.return=T,_;case w:return E=uc(E,T.mode,_),E.return=T,E;case X:return E=ds(E),Y(T,E,_)}if(Ce(E)||te(E))return E=os(E,T.mode,_,null),E.return=T,E;if(typeof E.then=="function")return Y(T,ll(E),_);if(E.$$typeof===B)return Y(T,al(T,E),_);rl(T,E)}return null}function P(T,E,_,G){var pe=E!==null?E.key:null;if(typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint")return pe!==null?null:v(T,E,""+_,G);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case N:return _.key===pe?A(T,E,_,G):null;case w:return _.key===pe?z(T,E,_,G):null;case X:return _=ds(_),P(T,E,_,G)}if(Ce(_)||te(_))return pe!==null?null:K(T,E,_,G,null);if(typeof _.then=="function")return P(T,E,ll(_),G);if(_.$$typeof===B)return P(T,E,al(T,_),G);rl(T,_)}return null}function H(T,E,_,G,pe){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return T=T.get(_)||null,v(E,T,""+G,pe);if(typeof G=="object"&&G!==null){switch(G.$$typeof){case N:return T=T.get(G.key===null?_:G.key)||null,A(E,T,G,pe);case w:return T=T.get(G.key===null?_:G.key)||null,z(E,T,G,pe);case X:return G=ds(G),H(T,E,_,G,pe)}if(Ce(G)||te(G))return T=T.get(_)||null,K(E,T,G,pe,null);if(typeof G.then=="function")return H(T,E,_,ll(G),pe);if(G.$$typeof===B)return H(T,E,_,al(E,G),pe);rl(E,G)}return null}function le(T,E,_,G){for(var pe=null,Ie=null,ue=E,Oe=E=0,Ue=null;ue!==null&&Oe<_.length;Oe++){ue.index>Oe?(Ue=ue,ue=null):Ue=ue.sibling;var Be=P(T,ue,_[Oe],G);if(Be===null){ue===null&&(ue=Ue);break}e&&ue&&Be.alternate===null&&t(T,ue),E=d(Be,E,Oe),Ie===null?pe=Be:Ie.sibling=Be,Ie=Be,ue=Ue}if(Oe===_.length)return s(T,ue),He&&ea(T,Oe),pe;if(ue===null){for(;Oe<_.length;Oe++)ue=Y(T,_[Oe],G),ue!==null&&(E=d(ue,E,Oe),Ie===null?pe=ue:Ie.sibling=ue,Ie=ue);return He&&ea(T,Oe),pe}for(ue=i(ue);Oe<_.length;Oe++)Ue=H(ue,T,Oe,_[Oe],G),Ue!==null&&(e&&Ue.alternate!==null&&ue.delete(Ue.key===null?Oe:Ue.key),E=d(Ue,E,Oe),Ie===null?pe=Ue:Ie.sibling=Ue,Ie=Ue);return e&&ue.forEach(function(Ya){return t(T,Ya)}),He&&ea(T,Oe),pe}function Se(T,E,_,G){if(_==null)throw Error(l(151));for(var pe=null,Ie=null,ue=E,Oe=E=0,Ue=null,Be=_.next();ue!==null&&!Be.done;Oe++,Be=_.next()){ue.index>Oe?(Ue=ue,ue=null):Ue=ue.sibling;var Ya=P(T,ue,Be.value,G);if(Ya===null){ue===null&&(ue=Ue);break}e&&ue&&Ya.alternate===null&&t(T,ue),E=d(Ya,E,Oe),Ie===null?pe=Ya:Ie.sibling=Ya,Ie=Ya,ue=Ue}if(Be.done)return s(T,ue),He&&ea(T,Oe),pe;if(ue===null){for(;!Be.done;Oe++,Be=_.next())Be=Y(T,Be.value,G),Be!==null&&(E=d(Be,E,Oe),Ie===null?pe=Be:Ie.sibling=Be,Ie=Be);return He&&ea(T,Oe),pe}for(ue=i(ue);!Be.done;Oe++,Be=_.next())Be=H(ue,T,Oe,Be.value,G),Be!==null&&(e&&Be.alternate!==null&&ue.delete(Be.key===null?Oe:Be.key),E=d(Be,E,Oe),Ie===null?pe=Be:Ie.sibling=Be,Ie=Be);return e&&ue.forEach(function(P0){return t(T,P0)}),He&&ea(T,Oe),pe}function Xe(T,E,_,G){if(typeof _=="object"&&_!==null&&_.type===O&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case N:e:{for(var pe=_.key;E!==null;){if(E.key===pe){if(pe=_.type,pe===O){if(E.tag===7){s(T,E.sibling),G=c(E,_.props.children),G.return=T,T=G;break e}}else if(E.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===X&&ds(pe)===E.type){s(T,E.sibling),G=c(E,_.props),Gi(G,_),G.return=T,T=G;break e}s(T,E);break}else t(T,E);E=E.sibling}_.type===O?(G=os(_.props.children,T.mode,G,_.key),G.return=T,T=G):(G=el(_.type,_.key,_.props,null,T.mode,G),Gi(G,_),G.return=T,T=G)}return g(T);case w:e:{for(pe=_.key;E!==null;){if(E.key===pe)if(E.tag===4&&E.stateNode.containerInfo===_.containerInfo&&E.stateNode.implementation===_.implementation){s(T,E.sibling),G=c(E,_.children||[]),G.return=T,T=G;break e}else{s(T,E);break}else t(T,E);E=E.sibling}G=uc(_,T.mode,G),G.return=T,T=G}return g(T);case X:return _=ds(_),Xe(T,E,_,G)}if(Ce(_))return le(T,E,_,G);if(te(_)){if(pe=te(_),typeof pe!="function")throw Error(l(150));return _=pe.call(_),Se(T,E,_,G)}if(typeof _.then=="function")return Xe(T,E,ll(_),G);if(_.$$typeof===B)return Xe(T,E,al(T,_),G);rl(T,_)}return typeof _=="string"&&_!==""||typeof _=="number"||typeof _=="bigint"?(_=""+_,E!==null&&E.tag===6?(s(T,E.sibling),G=c(E,_),G.return=T,T=G):(s(T,E),G=cc(_,T.mode,G),G.return=T,T=G),g(T)):s(T,E)}return function(T,E,_,G){try{Ki=0;var pe=Xe(T,E,_,G);return Ws=null,pe}catch(ue){if(ue===$s||ue===il)throw ue;var Ie=en(29,ue,null,T.mode);return Ie.lanes=G,Ie.return=T,Ie}finally{}}}var hs=wh(!0),Nh=wh(!1),Ma=!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 Oa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ta(e,t,s){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(Ge&2)!==0){var c=i.pending;return c===null?t.next=t:(t.next=c.next,c.next=t),i.pending=t,t=Jo(e),lh(e,null,s),t}return Zo(e,i,t,s),Jo(e)}function Yi(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,ji(e,s)}}function Nc(e,t){var s=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,s===i)){var c=null,d=null;if(s=s.firstBaseUpdate,s!==null){do{var g={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};d===null?c=d=g:d=d.next=g,s=s.next}while(s!==null);d===null?c=d=t:d=d.next=t}else c=d=t;s={baseState:i.baseState,firstBaseUpdate:c,lastBaseUpdate:d,shared:i.shared,callbacks:i.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var jc=!1;function Vi(){if(jc){var e=Qs;if(e!==null)throw e}}function Fi(e,t,s,i){jc=!1;var c=e.updateQueue;Ma=!1;var d=c.firstBaseUpdate,g=c.lastBaseUpdate,v=c.shared.pending;if(v!==null){c.shared.pending=null;var A=v,z=A.next;A.next=null,g===null?d=z:g.next=z,g=A;var K=e.alternate;K!==null&&(K=K.updateQueue,v=K.lastBaseUpdate,v!==g&&(v===null?K.firstBaseUpdate=z:v.next=z,K.lastBaseUpdate=A))}if(d!==null){var Y=c.baseState;g=0,K=z=A=null,v=d;do{var P=v.lane&-536870913,H=P!==v.lane;if(H?(Pe&P)===P:(i&P)===P){P!==0&&P===Fs&&(jc=!0),K!==null&&(K=K.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var le=e,Se=v;P=t;var Xe=s;switch(Se.tag){case 1:if(le=Se.payload,typeof le=="function"){Y=le.call(Xe,Y,P);break e}Y=le;break e;case 3:le.flags=le.flags&-65537|128;case 0:if(le=Se.payload,P=typeof le=="function"?le.call(Xe,Y,P):le,P==null)break e;Y=x({},Y,P);break e;case 2:Ma=!0}}P=v.callback,P!==null&&(e.flags|=64,H&&(e.flags|=8192),H=c.callbacks,H===null?c.callbacks=[P]:H.push(P))}else H={lane:P,tag:v.tag,payload:v.payload,callback:v.callback,next:null},K===null?(z=K=H,A=Y):K=K.next=H,g|=P;if(v=v.next,v===null){if(v=c.shared.pending,v===null)break;H=v,v=H.next,H.next=null,c.lastBaseUpdate=H,c.shared.pending=null}}while(!0);K===null&&(A=Y),c.baseState=A,c.firstBaseUpdate=z,c.lastBaseUpdate=K,d===null&&(c.shared.lanes=0),za|=g,e.lanes=g,e.memoizedState=Y}}function jh(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function Ah(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)jh(s[e],t)}var Xs=fe(null),cl=fe(0);function Eh(e,t){e=da,V(cl,e),V(Xs,t),da=e|t.baseLanes}function Ac(){V(cl,da),V(Xs,Xs.current)}function Ec(){da=cl.current,Ne(Xs),Ne(cl)}var tn=fe(null),vn=null;function Da(e){var t=e.alternate;V(ht,ht.current&1),V(tn,e),vn===null&&(t===null||Xs.current!==null||t.memoizedState!==null)&&(vn=e)}function Mc(e){V(ht,ht.current),V(tn,e),vn===null&&(vn=e)}function Mh(e){e.tag===22?(V(ht,ht.current),V(tn,e),vn===null&&(vn=e)):ka()}function ka(){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 s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||_u(s)||zu(s)))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,Me=null,$e=null,xt=null,dl=!1,Zs=!1,ms=!1,fl=0,Qi=0,Js=null,Eb=0;function ot(){throw Error(l(321))}function Oc(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!Jt(e[s],t[s]))return!1;return!0}function Tc(e,t,s,i,c,d){return aa=d,Me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,R.H=e===null||e.memoizedState===null?dm:Yc,ms=!1,d=s(i,c),ms=!1,Zs&&(d=Th(t,s,i,c)),Oh(e),d}function Oh(e){R.H=Xi;var t=$e!==null&&$e.next!==null;if(aa=0,xt=$e=Me=null,dl=!1,Qi=0,Js=null,t)throw Error(l(300));e===null||vt||(e=e.dependencies,e!==null&&nl(e)&&(vt=!0))}function Th(e,t,s,i){Me=e;var c=0;do{if(Zs&&(Js=null),Qi=0,Zs=!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(s,i)}while(Zs);return d}function Mb(){var e=R.H,t=e.useState()[0];return t=typeof t.then=="function"?$i(t):t,e=e.useState()[0],($e!==null?$e.memoizedState:null)!==e&&(Me.flags|=1024),t}function Dc(){var e=fl!==0;return fl=0,e}function kc(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}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=Me=null,Zs=!1,Qi=fl=0,Js=null}function Pt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return xt===null?Me.memoizedState=xt=e:xt=xt.next=e,xt}function mt(){if($e===null){var e=Me.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var t=xt===null?Me.memoizedState:xt.next;if(t!==null)xt=t,$e=e;else{if(e===null)throw Me.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?Me.memoizedState=xt=e:xt=xt.next=e}return xt}function hl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $i(e){var t=Qi;return Qi+=1,Js===null&&(Js=[]),e=bh(Js,e,t),t=Me,(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 $i(e);if(e.$$typeof===B)return Tt(e)}throw Error(l(438,String(e)))}function _c(e){var t=null,s=Me.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var i=Me.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(c){return c.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=hl(),Me.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),i=0;i<e;i++)s[i]=Q;return t.index++,s}function sa(e,t){return typeof t=="function"?t(e):t}function pl(e){var t=mt();return zc(t,$e,e)}function zc(e,t,s){var i=e.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=s;var c=e.baseQueue,d=i.pending;if(d!==null){if(c!==null){var g=c.next;c.next=d.next,d.next=g}t.baseQueue=c=d,i.pending=null}if(d=e.baseState,c===null)e.memoizedState=d;else{t=c.next;var v=g=null,A=null,z=t,K=!1;do{var Y=z.lane&-536870913;if(Y!==z.lane?(Pe&Y)===Y:(aa&Y)===Y){var P=z.revertLane;if(P===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),Y===Fs&&(K=!0);else if((aa&P)===P){z=z.next,P===Fs&&(K=!0);continue}else Y={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},A===null?(v=A=Y,g=d):A=A.next=Y,Me.lanes|=P,za|=P;Y=z.action,ms&&s(d,Y),d=z.hasEagerState?z.eagerState:s(d,Y)}else P={lane:Y,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},A===null?(v=A=P,g=d):A=A.next=P,Me.lanes|=Y,za|=Y;z=z.next}while(z!==null&&z!==t);if(A===null?g=d:A.next=v,!Jt(d,e.memoizedState)&&(vt=!0,K&&(s=Qs,s!==null)))throw s;e.memoizedState=d,e.baseState=g,e.baseQueue=A,i.lastRenderedState=d}return c===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Lc(e){var t=mt(),s=t.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=e;var i=s.dispatch,c=s.pending,d=t.memoizedState;if(c!==null){s.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),s.lastRenderedState=d}return[d,i]}function Dh(e,t,s){var i=Me,c=mt(),d=He;if(d){if(s===void 0)throw Error(l(407));s=s()}else s=t();var g=!Jt(($e||c).memoizedState,s);if(g&&(c.memoizedState=s,vt=!0),c=c.queue,Hc(_h.bind(null,i,c,e),[e]),c.getSnapshot!==t||g||xt!==null&&xt.memoizedState.tag&1){if(i.flags|=2048,ei(9,{destroy:void 0},Rh.bind(null,i,c,s,t),null),Ze===null)throw Error(l(349));d||(aa&127)!==0||kh(i,t,s)}return s}function kh(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Me.updateQueue,t===null?(t=hl(),Me.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function Rh(e,t,s,i){t.value=s,t.getSnapshot=i,zh(t)&&Lh(e)}function _h(e,t,s){return s(function(){zh(t)&&Lh(e)})}function zh(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!Jt(e,s)}catch{return!0}}function Lh(e){var t=is(e,2);t!==null&&Yt(t,e,2)}function Pc(e){var t=Pt();if(typeof e=="function"){var s=e;if(e=s(),ms){Te(!0);try{s()}finally{Te(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:e},t}function Ph(e,t,s,i){return e.baseState=s,zc(e,$e,typeof i=="function"?i:sa)}function Ob(e,t,s,i,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?s(!0):d.isTransition=!1,i(d),s=t.pending,s===null?(d.next=t.pending=d,Uh(t,d)):(d.next=s.next,t.pending=s.next=d)}}function Uh(e,t){var s=t.action,i=t.payload,c=e.state;if(t.isTransition){var d=R.T,g={};R.T=g;try{var v=s(c,i),A=R.S;A!==null&&A(g,v),Hh(e,t,v)}catch(z){Uc(e,t,z)}finally{d!==null&&g.types!==null&&(d.types=g.types),R.T=d}}else try{d=s(c,i),Hh(e,t,d)}catch(z){Uc(e,t,z)}}function Hh(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(i){Ih(e,t,i)},function(i){return Uc(e,t,i)}):Ih(e,t,s)}function Ih(e,t,s){t.status="fulfilled",t.value=s,Bh(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,Uh(e,s)))}function Uc(e,t,s){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=s,Bh(t),t=t.next;while(t!==i)}e.action=null}function Bh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function qh(e,t){return t}function Kh(e,t){if(He){var s=Ze.formState;if(s!==null){e:{var i=Me;if(He){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),i=c.data==="F!";break e}}Aa(i)}i=!1}i&&(t=s[0])}}return s=Pt(),s.memoizedState=s.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qh,lastRenderedState:t},s.queue=i,s=rm.bind(null,Me,i),i.dispatch=s,i=Pc(!1),d=Gc.bind(null,Me,!1,i.queue),i=Pt(),c={state:t,dispatch:null,action:e,pending:null},i.queue=c,s=Ob.bind(null,Me,c,d,s),c.dispatch=s,i.memoizedState=e,[t,s,!1]}function Gh(e){var t=mt();return Yh(t,$e,e)}function Yh(e,t,s){if(t=zc(e,t,qh)[0],e=pl(sa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=$i(t)}catch(g){throw g===$s?il:g}else i=t;t=mt();var c=t.queue,d=c.dispatch;return s!==t.memoizedState&&(Me.flags|=2048,ei(9,{destroy:void 0},Tb.bind(null,c,s),null)),[i,d,e]}function Tb(e,t){e.action=t}function Vh(e){var t=mt(),s=$e;if(s!==null)return Yh(t,s,e);mt(),t=t.memoizedState,s=mt();var i=s.queue.dispatch;return s.memoizedState=e,[t,i,!1]}function ei(e,t,s,i){return e={tag:e,create:s,deps:i,inst:t,next:null},t=Me.updateQueue,t===null&&(t=hl(),Me.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(i=s.next,s.next=e,e.next=i,t.lastEffect=e),e}function Fh(){return mt().memoizedState}function gl(e,t,s,i){var c=Pt();Me.flags|=e,c.memoizedState=ei(1|t,{destroy:void 0},s,i===void 0?null:i)}function yl(e,t,s,i){var c=mt();i=i===void 0?null:i;var d=c.memoizedState.inst;$e!==null&&i!==null&&Oc(i,$e.memoizedState.deps)?c.memoizedState=ei(t,d,s,i):(Me.flags|=e,c.memoizedState=ei(1|t,d,s,i))}function Qh(e,t){gl(8390656,8,e,t)}function Hc(e,t){yl(2048,8,e,t)}function Db(e){Me.flags|=4;var t=Me.updateQueue;if(t===null)t=hl(),Me.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function $h(e){var t=mt().memoizedState;return Db({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 s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Jh(e,t,s){s=s!=null?s.concat([e]):null,yl(4,4,Zh.bind(null,t,e),s)}function Ic(){}function em(e,t){var s=mt();t=t===void 0?null:t;var i=s.memoizedState;return t!==null&&Oc(t,i[1])?i[0]:(s.memoizedState=[e,t],e)}function tm(e,t){var s=mt();t=t===void 0?null:t;var i=s.memoizedState;if(t!==null&&Oc(t,i[1]))return i[0];if(i=e(),ms){Te(!0);try{e()}finally{Te(!1)}}return s.memoizedState=[i,t],i}function Bc(e,t,s){return s===void 0||(aa&1073741824)!==0&&(Pe&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=np(),Me.lanes|=e,za|=e,s)}function nm(e,t,s,i){return Jt(s,t)?s:Xs.current!==null?(e=Bc(e,s,i),Jt(e,t)||(vt=!0),e):(aa&42)===0||(aa&1073741824)!==0&&(Pe&261930)===0?(vt=!0,e.memoizedState=s):(e=np(),Me.lanes|=e,za|=e,t)}function am(e,t,s,i,c){var d=W.p;W.p=d!==0&&8>d?d:8;var g=R.T,v={};R.T=v,Gc(e,!1,t,s);try{var A=c(),z=R.S;if(z!==null&&z(v,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var K=Ab(A,i);Wi(e,t,K,on(e))}else Wi(e,t,i,on(e))}catch(Y){Wi(e,t,{then:function(){},status:"rejected",reason:Y},on())}finally{W.p=d,g!==null&&v.types!==null&&(g.types=v.types),R.T=g}}function kb(){}function qc(e,t,s,i){if(e.tag!==5)throw Error(l(476));var c=sm(e).queue;am(e,c,t,ee,s===null?kb:function(){return im(e),s(i)})}function sm(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:sa,lastRenderedState:ee},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function im(e){var t=sm(e);t.next===null&&(t=e.alternate.memoizedState),Wi(e,t.next.queue,{},on())}function Kc(){return Tt(mo)}function om(){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 s=on();e=Oa(s);var i=Ta(t,e,s);i!==null&&(Yt(i,t,s),Yi(i,t,s)),t={cache:xc()},e.payload=t;return}t=t.return}}function _b(e,t,s){var i=on();s={lane:i,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},xl(e)?cm(t,s):(s=lc(e,t,s,i),s!==null&&(Yt(s,e,i),um(s,t,i)))}function rm(e,t,s){var i=on();Wi(e,t,s,i)}function Wi(e,t,s,i){var c={lane:i,revertLane:0,gesture:null,action:s,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,s);if(c.hasEagerState=!0,c.eagerState=v,Jt(v,g))return Zo(e,t,c,0),Ze===null&&Xo(),!1}catch{}finally{}if(s=lc(e,t,c,i),s!==null)return Yt(s,e,i),um(s,t,i),!0}return!1}function Gc(e,t,s,i){if(i={lane:2,revertLane:Cu(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},xl(e)){if(t)throw Error(l(479))}else t=lc(e,s,i,2),t!==null&&Yt(t,e,2)}function xl(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function cm(e,t){Zs=dl=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function um(e,t,s){if((s&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,s|=i,t.lanes=s,ji(e,s)}}var Xi={readContext:Tt,use:ml,useCallback:ot,useContext:ot,useEffect:ot,useImperativeHandle:ot,useLayoutEffect:ot,useInsertionEffect:ot,useMemo:ot,useReducer:ot,useRef:ot,useState:ot,useDebugValue:ot,useDeferredValue:ot,useTransition:ot,useSyncExternalStore:ot,useId:ot,useHostTransitionStatus:ot,useFormState:ot,useActionState:ot,useOptimistic:ot,useMemoCache:ot,useCacheRefresh:ot};Xi.useEffectEvent=ot;var dm={readContext:Tt,use:ml,useCallback:function(e,t){return Pt().memoizedState=[e,t===void 0?null:t],e},useContext:Tt,useEffect:Qh,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,gl(4194308,4,Zh.bind(null,t,e),s)},useLayoutEffect:function(e,t){return gl(4194308,4,e,t)},useInsertionEffect:function(e,t){gl(4,2,e,t)},useMemo:function(e,t){var s=Pt();t=t===void 0?null:t;var i=e();if(ms){Te(!0);try{e()}finally{Te(!1)}}return s.memoizedState=[i,t],i},useReducer:function(e,t,s){var i=Pt();if(s!==void 0){var c=s(t);if(ms){Te(!0);try{s(t)}finally{Te(!1)}}}else c=t;return i.memoizedState=i.baseState=c,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:c},i.queue=e,e=e.dispatch=_b.bind(null,Me,e),[i.memoizedState,e]},useRef:function(e){var t=Pt();return e={current:e},t.memoizedState=e},useState:function(e){e=Pc(e);var t=e.queue,s=rm.bind(null,Me,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:Ic,useDeferredValue:function(e,t){var s=Pt();return Bc(s,e,t)},useTransition:function(){var e=Pc(!1);return e=am.bind(null,Me,e.queue,!0,!1),Pt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var i=Me,c=Pt();if(He){if(s===void 0)throw Error(l(407));s=s()}else{if(s=t(),Ze===null)throw Error(l(349));(Pe&127)!==0||kh(i,t,s)}c.memoizedState=s;var d={value:s,getSnapshot:t};return c.queue=d,Qh(_h.bind(null,i,d,e),[e]),i.flags|=2048,ei(9,{destroy:void 0},Rh.bind(null,i,d,s,t),null),s},useId:function(){var e=Pt(),t=Ze.identifierPrefix;if(He){var s=zn,i=_n;s=(i&~(1<<32-ve(i)-1)).toString(32)+s,t="_"+t+"R_"+s,s=fl++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=Eb++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Kc,useFormState:Kh,useActionState:Kh,useOptimistic:function(e){var t=Pt();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Gc.bind(null,Me,!0,s),s.dispatch=t,[e,t]},useMemoCache:_c,useCacheRefresh:function(){return Pt().memoizedState=Rb.bind(null,Me)},useEffectEvent:function(e){var t=Pt(),s={impl:e};return t.memoizedState=s,function(){if((Ge&2)!==0)throw Error(l(440));return s.impl.apply(void 0,arguments)}}},Yc={readContext:Tt,use:ml,useCallback:em,useContext:Tt,useEffect:Hc,useImperativeHandle:Jh,useInsertionEffect:Wh,useLayoutEffect:Xh,useMemo:tm,useReducer:pl,useRef:Fh,useState:function(){return pl(sa)},useDebugValue:Ic,useDeferredValue:function(e,t){var s=mt();return nm(s,$e.memoizedState,e,t)},useTransition:function(){var e=pl(sa)[0],t=mt().memoizedState;return[typeof e=="boolean"?e:$i(e),t]},useSyncExternalStore:Dh,useId:om,useHostTransitionStatus:Kc,useFormState:Gh,useActionState:Gh,useOptimistic:function(e,t){var s=mt();return Ph(s,$e,e,t)},useMemoCache:_c,useCacheRefresh:lm};Yc.useEffectEvent=$h;var fm={readContext:Tt,use:ml,useCallback:em,useContext:Tt,useEffect:Hc,useImperativeHandle:Jh,useInsertionEffect:Wh,useLayoutEffect:Xh,useMemo:tm,useReducer:Lc,useRef:Fh,useState:function(){return Lc(sa)},useDebugValue:Ic,useDeferredValue:function(e,t){var s=mt();return $e===null?Bc(s,e,t):nm(s,$e.memoizedState,e,t)},useTransition:function(){var e=Lc(sa)[0],t=mt().memoizedState;return[typeof e=="boolean"?e:$i(e),t]},useSyncExternalStore:Dh,useId:om,useHostTransitionStatus:Kc,useFormState:Vh,useActionState:Vh,useOptimistic:function(e,t){var s=mt();return $e!==null?Ph(s,$e,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:_c,useCacheRefresh:lm};fm.useEffectEvent=$h;function Vc(e,t,s,i){t=e.memoizedState,s=s(i,t),s=s==null?t:x({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Fc={enqueueSetState:function(e,t,s){e=e._reactInternals;var i=on(),c=Oa(i);c.payload=t,s!=null&&(c.callback=s),t=Ta(e,c,i),t!==null&&(Yt(t,e,i),Yi(t,e,i))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var i=on(),c=Oa(i);c.tag=1,c.payload=t,s!=null&&(c.callback=s),t=Ta(e,c,i),t!==null&&(Yt(t,e,i),Yi(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=on(),i=Oa(s);i.tag=2,t!=null&&(i.callback=t),t=Ta(e,i,s),t!==null&&(Yt(t,e,s),Yi(t,e,s))}};function hm(e,t,s,i,c,d,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,d,g):t.prototype&&t.prototype.isPureReactComponent?!Pi(s,i)||!Pi(c,d):!0}function mm(e,t,s,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,i),t.state!==e&&Fc.enqueueReplaceState(t,t.state,null)}function ps(e,t){var s=t;if("ref"in t){s={};for(var i in t)i!=="ref"&&(s[i]=t[i])}if(e=e.defaultProps){s===t&&(s=x({},s));for(var c in e)s[c]===void 0&&(s[c]=e[c])}return s}function pm(e){Wo(e)}function gm(e){console.error(e)}function ym(e){Wo(e)}function vl(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function xm(e,t,s){try{var i=e.onCaughtError;i(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(c){setTimeout(function(){throw c})}}function Qc(e,t,s){return s=Oa(s),s.tag=3,s.payload={element:null},s.callback=function(){vl(e,t)},s}function vm(e){return e=Oa(e),e.tag=3,e}function bm(e,t,s,i){var c=s.type.getDerivedStateFromError;if(typeof c=="function"){var d=i.value;e.payload=function(){return c(d)},e.callback=function(){xm(t,s,i)}}var g=s.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){xm(t,s,i),typeof c!="function"&&(La===null?La=new Set([this]):La.add(this));var v=i.stack;this.componentDidCatch(i.value,{componentStack:v!==null?v:""})})}function zb(e,t,s,i,c){if(s.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=s.alternate,t!==null&&Vs(t,s,c,!0),s=tn.current,s!==null){switch(s.tag){case 31:case 13:return vn===null?Dl():s.alternate===null&&lt===0&&(lt=3),s.flags&=-257,s.flags|=65536,s.lanes=c,i===ol?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([i]):t.add(i),vu(e,i,c)),!1;case 22:return s.flags|=65536,i===ol?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([i]):s.add(i)),vu(e,i,c)),!1}throw Error(l(435,s.tag))}return vu(e,i,c),Dl(),!1}if(He)return t=tn.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=c,i!==hc&&(e=Error(l(422),{cause:i}),Ii(pn(e,s)))):(i!==hc&&(t=Error(l(423),{cause:i}),Ii(pn(t,s))),e=e.current.alternate,e.flags|=65536,c&=-c,e.lanes|=c,i=pn(i,s),c=Qc(e.stateNode,i,c),Nc(e,c),lt!==4&&(lt=2)),!1;var d=Error(l(520),{cause:i});if(d=pn(d,s),io===null?io=[d]:io.push(d),lt!==4&&(lt=2),t===null)return!0;i=pn(i,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=c&-c,s.lanes|=e,e=Qc(s.stateNode,i,e),Nc(s,e),!1;case 1:if(t=s.type,d=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(La===null||!La.has(d))))return s.flags|=65536,c&=-c,s.lanes|=c,c=vm(c),bm(c,e,s,i),Nc(s,c),!1}s=s.return}while(s!==null);return!1}var $c=Error(l(461)),vt=!1;function Dt(e,t,s,i){t.child=e===null?Nh(t,null,s,i):hs(t,e.child,s,i)}function Sm(e,t,s,i,c){s=s.render;var d=t.ref;if("ref"in i){var g={};for(var v in i)v!=="ref"&&(g[v]=i[v])}else g=i;return cs(t),i=Tc(e,t,s,g,d,c),v=Dc(),e!==null&&!vt?(kc(e,t,c),ia(e,t,c)):(He&&v&&dc(t),t.flags|=1,Dt(e,t,i,c),t.child)}function Cm(e,t,s,i,c){if(e===null){var d=s.type;return typeof d=="function"&&!rc(d)&&d.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=d,wm(e,t,d,i,c)):(e=el(s.type,null,i,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(s=s.compare,s=s!==null?s:Pi,s(g,i)&&e.ref===t.ref)return ia(e,t,c)}return t.flags|=1,e=Jn(d,i),e.ref=t.ref,e.return=t,t.child=e}function wm(e,t,s,i,c){if(e!==null){var d=e.memoizedProps;if(Pi(d,i)&&e.ref===t.ref)if(vt=!1,t.pendingProps=i=d,au(e,c))(e.flags&131072)!==0&&(vt=!0);else return t.lanes=e.lanes,ia(e,t,c)}return Wc(e,t,s,i,c)}function Nm(e,t,s,i){var c=i.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|s:s,e!==null){for(i=t.child=e.child,c=0;i!==null;)c=c|i.lanes|i.childLanes,i=i.sibling;i=c&~d}else i=0,t.child=null;return jm(e,t,d,s,i)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&sl(t,d!==null?d.cachePool:null),d!==null?Eh(t,d):Ac(),Mh(t);else return i=t.lanes=536870912,jm(e,t,d!==null?d.baseLanes|s:s,s,i)}else d!==null?(sl(t,d.cachePool),Eh(t,d),ka(),t.memoizedState=null):(e!==null&&sl(t,null),Ac(),ka());return Dt(e,t,c,s),t.child}function Zi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function jm(e,t,s,i,c){var d=bc();return d=d===null?null:{parent:yt._currentValue,pool:d},t.memoizedState={baseLanes:s,cachePool:d},e!==null&&sl(t,null),Ac(),Mh(t),e!==null&&Vs(e,t,i,!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 Am(e,t,s){return hs(t,e.child,null,s),e=bl(t,t.pendingProps),e.flags|=2,nn(t),t.memoizedState=null,e}function Lb(e,t,s){var i=t.pendingProps,c=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(He){if(i.mode==="hidden")return e=bl(t,i),t.lanes=536870912,Zi(null,e);if(Mc(t),(e=et)?(e=Up(e,xn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Na!==null?{id:_n,overflow:zn}:null,retryLane:536870912,hydrationErrors:null},s=ch(e),s.return=t,t.child=s,Ot=t,et=null)):e=null,e===null)throw Aa(t);return t.lanes=536870912,null}return bl(t,i)}var d=e.memoizedState;if(d!==null){var g=d.dehydrated;if(Mc(t),c)if(t.flags&256)t.flags&=-257,t=Am(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(vt||Vs(e,t,s,!1),c=(s&e.childLanes)!==0,vt||c){if(i=Ze,i!==null&&(g=dn(i,s),g!==0&&g!==d.retryLane))throw d.retryLane=g,is(e,g),Yt(i,e,g),$c;Dl(),t=Am(e,t,s)}else e=d.treeContext,et=bn(g.nextSibling),Ot=t,He=!0,ja=null,xn=!1,e!==null&&fh(t,e),t=bl(t,i),t.flags|=4096;return t}return e=Jn(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Sl(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(l(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Wc(e,t,s,i,c){return cs(t),s=Tc(e,t,s,i,void 0,c),i=Dc(),e!==null&&!vt?(kc(e,t,c),ia(e,t,c)):(He&&i&&dc(t),t.flags|=1,Dt(e,t,s,c),t.child)}function Em(e,t,s,i,c,d){return cs(t),t.updateQueue=null,s=Th(t,i,s,c),Oh(e),i=Dc(),e!==null&&!vt?(kc(e,t,d),ia(e,t,d)):(He&&i&&dc(t),t.flags|=1,Dt(e,t,s,d),t.child)}function Mm(e,t,s,i,c){if(cs(t),t.stateNode===null){var d=qs,g=s.contextType;typeof g=="object"&&g!==null&&(d=Tt(g)),d=new s(i,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=i,d.state=t.memoizedState,d.refs={},Cc(t),g=s.contextType,d.context=typeof g=="object"&&g!==null?Tt(g):qs,d.state=t.memoizedState,g=s.getDerivedStateFromProps,typeof g=="function"&&(Vc(t,s,g,i),d.state=t.memoizedState),typeof s.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),Fi(t,i,d,c),Vi(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){d=t.stateNode;var v=t.memoizedProps,A=ps(s,v);d.props=A;var z=d.context,K=s.contextType;g=qs,typeof K=="object"&&K!==null&&(g=Tt(K));var Y=s.getDerivedStateFromProps;K=typeof Y=="function"||typeof d.getSnapshotBeforeUpdate=="function",v=t.pendingProps!==v,K||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(v||z!==g)&&mm(t,d,i,g),Ma=!1;var P=t.memoizedState;d.state=P,Fi(t,i,d,c),Vi(),z=t.memoizedState,v||P!==z||Ma?(typeof Y=="function"&&(Vc(t,s,Y,i),z=t.memoizedState),(A=Ma||hm(t,s,A,i,P,z,g))?(K||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=i,t.memoizedState=z),d.props=i,d.state=z,d.context=g,i=A):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{d=t.stateNode,wc(e,t),g=t.memoizedProps,K=ps(s,g),d.props=K,Y=t.pendingProps,P=d.context,z=s.contextType,A=qs,typeof z=="object"&&z!==null&&(A=Tt(z)),v=s.getDerivedStateFromProps,(z=typeof v=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(g!==Y||P!==A)&&mm(t,d,i,A),Ma=!1,P=t.memoizedState,d.state=P,Fi(t,i,d,c),Vi();var H=t.memoizedState;g!==Y||P!==H||Ma||e!==null&&e.dependencies!==null&&nl(e.dependencies)?(typeof v=="function"&&(Vc(t,s,v,i),H=t.memoizedState),(K=Ma||hm(t,s,K,i,P,H,A)||e!==null&&e.dependencies!==null&&nl(e.dependencies))?(z||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(i,H,A),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(i,H,A)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||g===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=H),d.props=i,d.state=H,d.context=A,i=K):(typeof d.componentDidUpdate!="function"||g===e.memoizedProps&&P===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&P===e.memoizedState||(t.flags|=1024),i=!1)}return d=i,Sl(e,t),i=(t.flags&128)!==0,d||i?(d=t.stateNode,s=i&&typeof s.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&i?(t.child=hs(t,e.child,null,c),t.child=hs(t,null,s,c)):Dt(e,t,s,c),t.memoizedState=d.state,e=t.child):e=ia(e,t,c),e}function Om(e,t,s,i){return ls(),t.flags|=256,Dt(e,t,s,i),t.child}var Xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Zc(e){return{baseLanes:e,cachePool:xh()}}function Jc(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=sn),e}function Tm(e,t,s){var i=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(He){if(c?Da(t):ka(),(e=et)?(e=Up(e,xn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Na!==null?{id:_n,overflow:zn}:null,retryLane:536870912,hydrationErrors:null},s=ch(e),s.return=t,t.child=s,Ot=t,et=null)):e=null,e===null)throw Aa(t);return zu(e)?t.lanes=32:t.lanes=536870912,null}var v=i.children;return i=i.fallback,c?(ka(),c=t.mode,v=Cl({mode:"hidden",children:v},c),i=os(i,c,s,null),v.return=t,i.return=t,v.sibling=i,t.child=v,i=t.child,i.memoizedState=Zc(s),i.childLanes=Jc(e,g,s),t.memoizedState=Xc,Zi(null,i)):(Da(t),eu(t,v))}var A=e.memoizedState;if(A!==null&&(v=A.dehydrated,v!==null)){if(d)t.flags&256?(Da(t),t.flags&=-257,t=tu(e,t,s)):t.memoizedState!==null?(ka(),t.child=e.child,t.flags|=128,t=null):(ka(),v=i.fallback,c=t.mode,i=Cl({mode:"visible",children:i.children},c),v=os(v,c,s,null),v.flags|=2,i.return=t,v.return=t,i.sibling=v,t.child=i,hs(t,e.child,null,s),i=t.child,i.memoizedState=Zc(s),i.childLanes=Jc(e,g,s),t.memoizedState=Xc,t=Zi(null,i));else if(Da(t),zu(v)){if(g=v.nextSibling&&v.nextSibling.dataset,g)var z=g.dgst;g=z,i=Error(l(419)),i.stack="",i.digest=g,Ii({value:i,source:null,stack:null}),t=tu(e,t,s)}else if(vt||Vs(e,t,s,!1),g=(s&e.childLanes)!==0,vt||g){if(g=Ze,g!==null&&(i=dn(g,s),i!==0&&i!==A.retryLane))throw A.retryLane=i,is(e,i),Yt(g,e,i),$c;_u(v)||Dl(),t=tu(e,t,s)}else _u(v)?(t.flags|=192,t.child=e.child,t=null):(e=A.treeContext,et=bn(v.nextSibling),Ot=t,He=!0,ja=null,xn=!1,e!==null&&fh(t,e),t=eu(t,i.children),t.flags|=4096);return t}return c?(ka(),v=i.fallback,c=t.mode,A=e.child,z=A.sibling,i=Jn(A,{mode:"hidden",children:i.children}),i.subtreeFlags=A.subtreeFlags&65011712,z!==null?v=Jn(z,v):(v=os(v,c,s,null),v.flags|=2),v.return=t,i.return=t,i.sibling=v,t.child=i,Zi(null,i),i=t.child,v=e.child.memoizedState,v===null?v=Zc(s):(c=v.cachePool,c!==null?(A=yt._currentValue,c=c.parent!==A?{parent:A,pool:A}:c):c=xh(),v={baseLanes:v.baseLanes|s,cachePool:c}),i.memoizedState=v,i.childLanes=Jc(e,g,s),t.memoizedState=Xc,Zi(e.child,i)):(Da(t),s=e.child,e=s.sibling,s=Jn(s,{mode:"visible",children:i.children}),s.return=t,s.sibling=null,e!==null&&(g=t.deletions,g===null?(t.deletions=[e],t.flags|=16):g.push(e)),t.child=s,t.memoizedState=null,s)}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,s){return hs(t,e.child,null,s),e=eu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Dm(e,t,s){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),gc(e.return,t,s)}function nu(e,t,s,i,c,d){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:s,tailMode:c,treeForkCount:d}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=i,g.tail=s,g.tailMode=c,g.treeForkCount=d)}function km(e,t,s){var i=t.pendingProps,c=i.revealOrder,d=i.tail;i=i.children;var g=ht.current,v=(g&2)!==0;if(v?(g=g&1|2,t.flags|=128):g&=1,V(ht,g),Dt(e,t,i,s),i=He?Hi:0,!v&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Dm(e,s,t);else if(e.tag===19)Dm(e,s,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(s=t.child,c=null;s!==null;)e=s.alternate,e!==null&&ul(e)===null&&(c=s),s=s.sibling;s=c,s===null?(c=t.child,t.child=null):(c=s.sibling,s.sibling=null),nu(t,!1,c,s,d,i);break;case"backwards":case"unstable_legacy-backwards":for(s=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=s,s=c,c=e}nu(t,!0,s,null,d,i);break;case"together":nu(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function ia(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),za|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(Vs(e,t,s,!1),(s&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,s=Jn(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=Jn(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function au(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&nl(e)))}function Pb(e,t,s){switch(t.tag){case 3:xe(t,t.stateNode.containerInfo),Ea(t,yt,e.memoizedState.cache),ls();break;case 27:case 5:Ke(t);break;case 4:xe(t,t.stateNode.containerInfo);break;case 10:Ea(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Mc(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(Da(t),t.flags|=128,null):(s&t.child.childLanes)!==0?Tm(e,t,s):(Da(t),e=ia(e,t,s),e!==null?e.sibling:null);Da(t);break;case 19:var c=(e.flags&128)!==0;if(i=(s&t.childLanes)!==0,i||(Vs(e,t,s,!1),i=(s&t.childLanes)!==0),c){if(i)return km(e,t,s);t.flags|=128}if(c=t.memoizedState,c!==null&&(c.rendering=null,c.tail=null,c.lastEffect=null),V(ht,ht.current),i)break;return null;case 22:return t.lanes=0,Nm(e,t,s,t.pendingProps);case 24:Ea(t,yt,e.memoizedState.cache)}return ia(e,t,s)}function Rm(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)vt=!0;else{if(!au(e,s)&&(t.flags&128)===0)return vt=!1,Pb(e,t,s);vt=(e.flags&131072)!==0}else vt=!1,He&&(t.flags&1048576)!==0&&dh(t,Hi,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=ds(t.elementType),t.type=e,typeof e=="function")rc(e)?(i=ps(e,i),t.tag=1,t=Mm(null,t,e,i,s)):(t.tag=0,t=Wc(null,t,e,i,s));else{if(e!=null){var c=e.$$typeof;if(c===U){t.tag=11,t=Sm(null,t,e,i,s);break e}else if(c===L){t.tag=14,t=Cm(null,t,e,i,s);break e}}throw t=de(e)||e,Error(l(306,t,""))}}return t;case 0:return Wc(e,t,t.type,t.pendingProps,s);case 1:return i=t.type,c=ps(i,t.pendingProps),Mm(e,t,i,c,s);case 3:e:{if(xe(t,t.stateNode.containerInfo),e===null)throw Error(l(387));i=t.pendingProps;var d=t.memoizedState;c=d.element,wc(e,t),Fi(t,i,null,s);var g=t.memoizedState;if(i=g.cache,Ea(t,yt,i),i!==d.cache&&yc(t,[yt],s,!0),Vi(),i=g.element,d.isDehydrated)if(d={element:i,isDehydrated:!1,cache:g.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Om(e,t,i,s);break e}else if(i!==c){c=pn(Error(l(424)),t),Ii(c),t=Om(e,t,i,s);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),Ot=t,He=!0,ja=null,xn=!0,s=Nh(t,null,i,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(ls(),i===c){t=ia(e,t,s);break e}Dt(e,t,i,s)}t=t.child}return t;case 26:return Sl(e,t),e===null?(s=Gp(t.type,null,t.pendingProps,null))?t.memoizedState=s:He||(s=t.type,e=t.pendingProps,i=Ul(ne.current).createElement(s),i[Mt]=t,i[Ht]=e,kt(i,s,e),jt(i),t.stateNode=i):t.memoizedState=Gp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ke(t),e===null&&He&&(i=t.stateNode=Bp(t.type,t.pendingProps,ne.current),Ot=t,xn=!0,c=et,Ia(t.type)?(Lu=c,et=bn(i.firstChild)):et=c),Dt(e,t,t.pendingProps.children,s),Sl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&He&&((c=i=et)&&(i=h0(i,t.type,t.pendingProps,xn),i!==null?(t.stateNode=i,Ot=t,et=bn(i.firstChild),xn=!1,c=!0):c=!1),c||Aa(t)),Ke(t),c=t.type,d=t.pendingProps,g=e!==null?e.memoizedProps:null,i=d.children,Du(c,d)?i=null:g!==null&&Du(c,g)&&(t.flags|=32),t.memoizedState!==null&&(c=Tc(e,t,Mb,null,null,s),mo._currentValue=c),Sl(e,t),Dt(e,t,i,s),t.child;case 6:return e===null&&He&&((e=s=et)&&(s=m0(s,t.pendingProps,xn),s!==null?(t.stateNode=s,Ot=t,et=null,e=!0):e=!1),e||Aa(t)),null;case 13:return Tm(e,t,s);case 4:return xe(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=hs(t,null,i,s):Dt(e,t,i,s),t.child;case 11:return Sm(e,t,t.type,t.pendingProps,s);case 7:return Dt(e,t,t.pendingProps,s),t.child;case 8:return Dt(e,t,t.pendingProps.children,s),t.child;case 12:return Dt(e,t,t.pendingProps.children,s),t.child;case 10:return i=t.pendingProps,Ea(t,t.type,i.value),Dt(e,t,i.children,s),t.child;case 9:return c=t.type._context,i=t.pendingProps.children,cs(t),c=Tt(c),i=i(c),t.flags|=1,Dt(e,t,i,s),t.child;case 14:return Cm(e,t,t.type,t.pendingProps,s);case 15:return wm(e,t,t.type,t.pendingProps,s);case 19:return km(e,t,s);case 31:return Lb(e,t,s);case 22:return Nm(e,t,s,t.pendingProps);case 24:return cs(t),i=Tt(yt),e===null?(c=bc(),c===null&&(c=Ze,d=xc(),c.pooledCache=d,d.refCount++,d!==null&&(c.pooledCacheLanes|=s),c=d),t.memoizedState={parent:i,cache:c},Cc(t),Ea(t,yt,c)):((e.lanes&s)!==0&&(wc(e,t),Fi(t,null,null,s),Vi()),c=e.memoizedState,d=t.memoizedState,c.parent!==i?(c={parent:i,cache:i},t.memoizedState=c,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=c),Ea(t,yt,i)):(i=d.cache,Ea(t,yt,i),i!==c.cache&&yc(t,[yt],s,!0))),Dt(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function oa(e){e.flags|=4}function su(e,t,s,i,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(op())e.flags|=8192;else throw fs=ol,Sc}else e.flags&=-16777217}function _m(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!$p(t))if(op())e.flags|=8192;else throw fs=ol,Sc}function wl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Nt():536870912,e.lanes|=t,si|=t)}function Ji(e,t){if(!He)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var i=null;s!==null;)s.alternate!==null&&(i=s),s=s.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,i=0;if(t)for(var c=e.child;c!==null;)s|=c.lanes|c.childLanes,i|=c.subtreeFlags&65011712,i|=c.flags&65011712,c.return=e,c=c.sibling;else for(c=e.child;c!==null;)s|=c.lanes|c.childLanes,i|=c.subtreeFlags,i|=c.flags,c.return=e,c=c.sibling;return e.subtreeFlags|=i,e.childLanes=s,t}function Ub(e,t,s){var i=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 s=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),na(yt),_e(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(Ys(t)?oa(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?(oa(t),d!==null?(tt(t),_m(t,d)):(tt(t),su(t,c,null,i,s))):d?d!==e.memoizedState?(oa(t),tt(t),_m(t,d)):(tt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&oa(t),tt(t),su(t,c,e,i,s)),null;case 27:if(St(t),s=ne.current,c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&oa(t);else{if(!i){if(t.stateNode===null)throw Error(l(166));return tt(t),null}e=J.current,Ys(t)?hh(t):(e=Bp(c,i,s),t.stateNode=e,oa(t))}return tt(t),null;case 5:if(St(t),c=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&oa(t);else{if(!i){if(t.stateNode===null)throw Error(l(166));return tt(t),null}if(d=J.current,Ys(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 i.is=="string"?g.createElement("select",{is:i.is}):g.createElement("select"),i.multiple?d.multiple=!0:i.size&&(d.size=i.size);break;default:d=typeof i.is=="string"?g.createElement(c,{is:i.is}):g.createElement(c)}}d[Mt]=t,d[Ht]=i;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(kt(d,c,i),c){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&oa(t)}}return tt(t),su(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&oa(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(l(166));if(e=ne.current,Ys(t)){if(e=t.stateNode,s=t.memoizedProps,i=null,c=Ot,c!==null)switch(c.tag){case 27:case 5:i=c.memoizedProps}e[Mt]=t,e=!!(e.nodeValue===s||i!==null&&i.suppressHydrationWarning===!0||Tp(e.nodeValue,s)),e||Aa(t,!0)}else e=Ul(e).createTextNode(i),e[Mt]=t,t.stateNode=e}return tt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(i=Ys(t),s!==null){if(e===null){if(!i)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[Mt]=t}else ls(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),e=!1}else s=mc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),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(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(c=Ys(t),i!==null&&i.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[Mt]=t}else ls(),(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=s,t):(s=i!==null,e=e!==null&&e.memoizedState!==null,s&&(i=t.child,c=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(c=i.alternate.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==c&&(i.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),wl(t,t.updateQueue),tt(t),null);case 4:return _e(),e===null&&Au(t.stateNode.containerInfo),tt(t),null;case 10:return na(t.type),tt(t),null;case 19:if(Ne(ht),i=t.memoizedState,i===null)return tt(t),null;if(c=(t.flags&128)!==0,d=i.rendering,d===null)if(c)Ji(i,!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,Ji(i,!1),e=d.updateQueue,t.updateQueue=e,wl(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)rh(s,e),s=s.sibling;return V(ht,ht.current&1|2),He&&ea(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&ft()>Ml&&(t.flags|=128,c=!0,Ji(i,!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),Ji(i,!0),i.tail===null&&i.tailMode==="hidden"&&!d.alternate&&!He)return tt(t),null}else 2*ft()-i.renderingStartTime>Ml&&s!==536870912&&(t.flags|=128,c=!0,Ji(i,!1),t.lanes=4194304);i.isBackwards?(d.sibling=t.child,t.child=d):(e=i.last,e!==null?e.sibling=d:t.child=d,i.last=d)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=ft(),e.sibling=null,s=ht.current,V(ht,c?s&1|2:s&1),He&&ea(t,i.treeForkCount),e):(tt(t),null);case 22:case 23:return nn(t),Ec(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(s&536870912)!==0&&(t.flags&128)===0&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),s=t.updateQueue,s!==null&&wl(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==s&&(t.flags|=2048),e!==null&&Ne(us),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),na(yt),tt(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function Hb(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),_e(),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));ls()}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));ls()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ne(ht),null;case 4:return _e(),null;case 10:return na(t.type),null;case 22:case 23:return nn(t),Ec(),e!==null&&Ne(us),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 zm(e,t){switch(fc(t),t.tag){case 3:na(yt),_e();break;case 26:case 27:case 5:St(t);break;case 4:_e();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),Ec(),e!==null&&Ne(us);break;case 24:na(yt)}}function eo(e,t){try{var s=t.updateQueue,i=s!==null?s.lastEffect:null;if(i!==null){var c=i.next;s=c;do{if((s.tag&e)===e){i=void 0;var d=s.create,g=s.inst;i=d(),g.destroy=i}s=s.next}while(s!==c)}}catch(v){Fe(t,t.return,v)}}function Ra(e,t,s){try{var i=t.updateQueue,c=i!==null?i.lastEffect:null;if(c!==null){var d=c.next;i=d;do{if((i.tag&e)===e){var g=i.inst,v=g.destroy;if(v!==void 0){g.destroy=void 0,c=t;var A=s,z=v;try{z()}catch(K){Fe(c,A,K)}}}i=i.next}while(i!==d)}}catch(K){Fe(t,t.return,K)}}function Lm(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{Ah(t,s)}catch(i){Fe(e,e.return,i)}}}function Pm(e,t,s){s.props=ps(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(i){Fe(e,t,i)}}function to(e,t){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof s=="function"?e.refCleanup=s(i):s.current=i}}catch(c){Fe(e,t,c)}}function Ln(e,t){var s=e.ref,i=e.refCleanup;if(s!==null)if(typeof i=="function")try{i()}catch(c){Fe(e,t,c)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(c){Fe(e,t,c)}else s.current=null}function Um(e){var t=e.type,s=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&i.focus();break e;case"img":s.src?i.src=s.src:s.srcSet&&(i.srcset=s.srcSet)}}catch(c){Fe(e,e.return,c)}}function iu(e,t,s){try{var i=e.stateNode;l0(i,e.type,s,t),i[Ht]=t}catch(c){Fe(e,e.return,c)}}function Hm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ia(e.type)||e.tag===4}function ou(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Hm(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&&Ia(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,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=Xn));else if(i!==4&&(i===27&&Ia(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(lu(e,t,s),e=e.sibling;e!==null;)lu(e,t,s),e=e.sibling}function Nl(e,t,s){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(i!==4&&(i===27&&Ia(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(Nl(e,t,s),e=e.sibling;e!==null;)Nl(e,t,s),e=e.sibling}function Im(e){var t=e.stateNode,s=e.memoizedProps;try{for(var i=e.type,c=t.attributes;c.length;)t.removeAttributeNode(c[0]);kt(t,i,s),t[Mt]=e,t[Ht]=s}catch(d){Fe(e,e.return,d)}}var la=!1,bt=!1,ru=!1,Bm=typeof WeakSet=="function"?WeakSet:Set,At=null;function Ib(e,t){if(e=e.containerInfo,Ou=Yl,e=Jf(e),tc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var i=s.getSelection&&s.getSelection();if(i&&i.rangeCount!==0){s=i.anchorNode;var c=i.anchorOffset,d=i.focusNode;i=i.focusOffset;try{s.nodeType,d.nodeType}catch{s=null;break e}var g=0,v=-1,A=-1,z=0,K=0,Y=e,P=null;t:for(;;){for(var H;Y!==s||c!==0&&Y.nodeType!==3||(v=g+c),Y!==d||i!==0&&Y.nodeType!==3||(A=g+i),Y.nodeType===3&&(g+=Y.nodeValue.length),(H=Y.firstChild)!==null;)P=Y,Y=H;for(;;){if(Y===e)break t;if(P===s&&++z===c&&(v=g),P===d&&++K===i&&(A=g),(H=Y.nextSibling)!==null)break;Y=P,P=Y.parentNode}Y=H}s=v===-1||A===-1?null:{start:v,end:A}}else s=null}s=s||{start:0,end:0}}else s=null;for(Tu={focusedElem:e,selectionRange:s},Yl=!1,At=t;At!==null;)if(t=At,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,At=e;else for(;At!==null;){switch(t=At,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(s=0;s<e.length;s++)c=e[s],c.ref.impl=c.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,s=t,c=d.memoizedProps,d=d.memoizedState,i=s.stateNode;try{var le=ps(s.type,c);e=i.getSnapshotBeforeUpdate(le,d),i.__reactInternalSnapshotBeforeUpdate=e}catch(Se){Fe(s,s.return,Se)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)Ru(e);else if(s===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,At=e;break}At=t.return}}function qm(e,t,s){var i=s.flags;switch(s.tag){case 0:case 11:case 15:ca(e,s),i&4&&eo(5,s);break;case 1:if(ca(e,s),i&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(g){Fe(s,s.return,g)}else{var c=ps(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(c,t,e.__reactInternalSnapshotBeforeUpdate)}catch(g){Fe(s,s.return,g)}}i&64&&Lm(s),i&512&&to(s,s.return);break;case 3:if(ca(e,s),i&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{Ah(e,t)}catch(g){Fe(s,s.return,g)}}break;case 27:t===null&&i&4&&Im(s);case 26:case 5:ca(e,s),t===null&&i&4&&Um(s),i&512&&to(s,s.return);break;case 12:ca(e,s);break;case 31:ca(e,s),i&4&&Ym(e,s);break;case 13:ca(e,s),i&4&&Vm(e,s),i&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=$b.bind(null,s),p0(e,s))));break;case 22:if(i=s.memoizedState!==null||la,!i){t=t!==null&&t.memoizedState!==null||bt,c=la;var d=bt;la=i,(bt=t)&&!d?ua(e,s,(s.subtreeFlags&8772)!==0):ca(e,s),la=c,bt=d}break;case 30:break;default:ca(e,s)}}function Km(e){var t=e.alternate;t!==null&&(e.alternate=null,Km(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 st=null,Bt=!1;function ra(e,t,s){for(s=s.child;s!==null;)Gm(e,t,s),s=s.sibling}function Gm(e,t,s){if(Z&&typeof Z.onCommitFiberUnmount=="function")try{Z.onCommitFiberUnmount(Fn,s)}catch{}switch(s.tag){case 26:bt||Ln(s,t),ra(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:bt||Ln(s,t);var i=st,c=Bt;Ia(s.type)&&(st=s.stateNode,Bt=!1),ra(e,t,s),uo(s.stateNode),st=i,Bt=c;break;case 5:bt||Ln(s,t);case 6:if(i=st,c=Bt,st=null,ra(e,t,s),st=i,Bt=c,st!==null)if(Bt)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(s.stateNode)}catch(d){Fe(s,t,d)}else try{st.removeChild(s.stateNode)}catch(d){Fe(s,t,d)}break;case 18:st!==null&&(Bt?(e=st,Lp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),fi(e)):Lp(st,s.stateNode));break;case 4:i=st,c=Bt,st=s.stateNode.containerInfo,Bt=!0,ra(e,t,s),st=i,Bt=c;break;case 0:case 11:case 14:case 15:Ra(2,s,t),bt||Ra(4,s,t),ra(e,t,s);break;case 1:bt||(Ln(s,t),i=s.stateNode,typeof i.componentWillUnmount=="function"&&Pm(s,t,i)),ra(e,t,s);break;case 21:ra(e,t,s);break;case 22:bt=(i=bt)||s.memoizedState!==null,ra(e,t,s),bt=i;break;default:ra(e,t,s)}}function Ym(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{fi(e)}catch(s){Fe(t,t.return,s)}}}function Vm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{fi(e)}catch(s){Fe(t,t.return,s)}}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 jl(e,t){var s=Bb(e);t.forEach(function(i){if(!s.has(i)){s.add(i);var c=Wb.bind(null,e,i);i.then(c,c)}})}function qt(e,t){var s=t.deletions;if(s!==null)for(var i=0;i<s.length;i++){var c=s[i],d=e,g=t,v=g;e:for(;v!==null;){switch(v.tag){case 27:if(Ia(v.type)){st=v.stateNode,Bt=!1;break e}break;case 5:st=v.stateNode,Bt=!1;break e;case 3:case 4:st=v.stateNode.containerInfo,Bt=!0;break e}v=v.return}if(st===null)throw Error(l(160));Gm(d,g,c),st=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 jn=null;function Fm(e,t){var s=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:qt(t,e),Kt(e),i&4&&(Ra(3,e,e.return),eo(3,e),Ra(5,e,e.return));break;case 1:qt(t,e),Kt(e),i&512&&(bt||s===null||Ln(s,s.return)),i&64&&la&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?i:s.concat(i))));break;case 26:var c=jn;if(qt(t,e),Kt(e),i&512&&(bt||s===null||Ln(s,s.return)),i&4){var d=s!==null?s.memoizedState:null;if(i=e.memoizedState,s===null)if(i===null)if(e.stateNode===null){e:{i=e.type,s=e.memoizedProps,c=c.ownerDocument||c;t:switch(i){case"title":d=c.getElementsByTagName("title")[0],(!d||d[Mi]||d[Mt]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=c.createElement(i),c.head.insertBefore(d,c.querySelector("head > title"))),kt(d,i,s),d[Mt]=e,jt(d),i=d;break e;case"link":var g=Fp("link","href",c).get(i+(s.href||""));if(g){for(var v=0;v<g.length;v++)if(d=g[v],d.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&d.getAttribute("rel")===(s.rel==null?null:s.rel)&&d.getAttribute("title")===(s.title==null?null:s.title)&&d.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){g.splice(v,1);break t}}d=c.createElement(i),kt(d,i,s),c.head.appendChild(d);break;case"meta":if(g=Fp("meta","content",c).get(i+(s.content||""))){for(v=0;v<g.length;v++)if(d=g[v],d.getAttribute("content")===(s.content==null?null:""+s.content)&&d.getAttribute("name")===(s.name==null?null:s.name)&&d.getAttribute("property")===(s.property==null?null:s.property)&&d.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&d.getAttribute("charset")===(s.charSet==null?null:s.charSet)){g.splice(v,1);break t}}d=c.createElement(i),kt(d,i,s),c.head.appendChild(d);break;default:throw Error(l(468,i))}d[Mt]=e,jt(d),i=d}e.stateNode=i}else Qp(c,e.type,e.stateNode);else e.stateNode=Vp(c,i,e.memoizedProps);else d!==i?(d===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):d.count--,i===null?Qp(c,e.type,e.stateNode):Vp(c,i,e.memoizedProps)):i===null&&e.stateNode!==null&&iu(e,e.memoizedProps,s.memoizedProps)}break;case 27:qt(t,e),Kt(e),i&512&&(bt||s===null||Ln(s,s.return)),s!==null&&i&4&&iu(e,e.memoizedProps,s.memoizedProps);break;case 5:if(qt(t,e),Kt(e),i&512&&(bt||s===null||Ln(s,s.return)),e.flags&32){c=e.stateNode;try{zs(c,"")}catch(le){Fe(e,e.return,le)}}i&4&&e.stateNode!=null&&(c=e.memoizedProps,iu(e,c,s!==null?s.memoizedProps:c)),i&1024&&(ru=!0);break;case 6:if(qt(t,e),Kt(e),i&4){if(e.stateNode===null)throw Error(l(162));i=e.memoizedProps,s=e.stateNode;try{s.nodeValue=i}catch(le){Fe(e,e.return,le)}}break;case 3:if(Bl=null,c=jn,jn=Hl(t.containerInfo),qt(t,e),jn=c,Kt(e),i&4&&s!==null&&s.memoizedState.isDehydrated)try{fi(t.containerInfo)}catch(le){Fe(e,e.return,le)}ru&&(ru=!1,Qm(e));break;case 4:i=jn,jn=Hl(e.stateNode.containerInfo),qt(t,e),Kt(e),jn=i;break;case 12:qt(t,e),Kt(e);break;case 31:qt(t,e),Kt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,jl(e,i)));break;case 13:qt(t,e),Kt(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(El=ft()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,jl(e,i)));break;case 22:c=e.memoizedState!==null;var A=s!==null&&s.memoizedState!==null,z=la,K=bt;if(la=z||c,bt=K||A,qt(t,e),bt=K,la=z,Kt(e),i&8192)e:for(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,c&&(s===null||A||la||bt||gs(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){A=s=t;try{if(d=A.stateNode,c)g=d.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{v=A.stateNode;var Y=A.memoizedProps.style,P=Y!=null&&Y.hasOwnProperty("display")?Y.display:null;v.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(le){Fe(A,A.return,le)}}}else if(t.tag===6){if(s===null){A=t;try{A.stateNode.nodeValue=c?"":A.memoizedProps}catch(le){Fe(A,A.return,le)}}}else if(t.tag===18){if(s===null){A=t;try{var H=A.stateNode;c?Pp(H,!0):Pp(A.stateNode,!1)}catch(le){Fe(A,A.return,le)}}}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;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(s=i.retryQueue,s!==null&&(i.retryQueue=null,jl(e,s))));break;case 19:qt(t,e),Kt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,jl(e,i)));break;case 30:break;case 21:break;default:qt(t,e),Kt(e)}}function Kt(e){var t=e.flags;if(t&2){try{for(var s,i=e.return;i!==null;){if(Hm(i)){s=i;break}i=i.return}if(s==null)throw Error(l(160));switch(s.tag){case 27:var c=s.stateNode,d=ou(e);Nl(e,d,c);break;case 5:var g=s.stateNode;s.flags&32&&(zs(g,""),s.flags&=-33);var v=ou(e);Nl(e,v,g);break;case 3:case 4:var A=s.stateNode.containerInfo,z=ou(e);lu(e,z,A);break;default:throw Error(l(161))}}catch(K){Fe(e,e.return,K)}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;)qm(e,t.alternate,t),t=t.sibling}function gs(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),gs(t);break;case 1:Ln(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&Pm(t,t.return,s),gs(t);break;case 27:uo(t.stateNode);case 26:case 5:Ln(t,t.return),gs(t);break;case 22:t.memoizedState===null&&gs(t);break;case 30:gs(t);break;default:gs(t)}e=e.sibling}}function ua(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,c=e,d=t,g=d.flags;switch(d.tag){case 0:case 11:case 15:ua(c,d,s),eo(4,d);break;case 1:if(ua(c,d,s),i=d,c=i.stateNode,typeof c.componentDidMount=="function")try{c.componentDidMount()}catch(z){Fe(i,i.return,z)}if(i=d,c=i.updateQueue,c!==null){var v=i.stateNode;try{var A=c.shared.hiddenCallbacks;if(A!==null)for(c.shared.hiddenCallbacks=null,c=0;c<A.length;c++)jh(A[c],v)}catch(z){Fe(i,i.return,z)}}s&&g&64&&Lm(d),to(d,d.return);break;case 27:Im(d);case 26:case 5:ua(c,d,s),s&&i===null&&g&4&&Um(d),to(d,d.return);break;case 12:ua(c,d,s);break;case 31:ua(c,d,s),s&&g&4&&Ym(c,d);break;case 13:ua(c,d,s),s&&g&4&&Vm(c,d);break;case 22:d.memoizedState===null&&ua(c,d,s),to(d,d.return);break;case 30:break;default:ua(c,d,s)}t=t.sibling}}function cu(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&Bi(s))}function uu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Bi(e))}function An(e,t,s,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)$m(e,t,s,i),t=t.sibling}function $m(e,t,s,i){var c=t.flags;switch(t.tag){case 0:case 11:case 15:An(e,t,s,i),c&2048&&eo(9,t);break;case 1:An(e,t,s,i);break;case 3:An(e,t,s,i),c&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Bi(e)));break;case 12:if(c&2048){An(e,t,s,i),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(A){Fe(t,t.return,A)}}else An(e,t,s,i);break;case 31:An(e,t,s,i);break;case 13:An(e,t,s,i);break;case 23:break;case 22:d=t.stateNode,g=t.alternate,t.memoizedState!==null?d._visibility&2?An(e,t,s,i):no(e,t):d._visibility&2?An(e,t,s,i):(d._visibility|=2,ti(e,t,s,i,(t.subtreeFlags&10256)!==0||!1)),c&2048&&cu(g,t);break;case 24:An(e,t,s,i),c&2048&&uu(t.alternate,t);break;default:An(e,t,s,i)}}function ti(e,t,s,i,c){for(c=c&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,g=t,v=s,A=i,z=g.flags;switch(g.tag){case 0:case 11:case 15:ti(d,g,v,A,c),eo(8,g);break;case 23:break;case 22:var K=g.stateNode;g.memoizedState!==null?K._visibility&2?ti(d,g,v,A,c):no(d,g):(K._visibility|=2,ti(d,g,v,A,c)),c&&z&2048&&cu(g.alternate,g);break;case 24:ti(d,g,v,A,c),c&&z&2048&&uu(g.alternate,g);break;default:ti(d,g,v,A,c)}t=t.sibling}}function no(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,i=t,c=i.flags;switch(i.tag){case 22:no(s,i),c&2048&&cu(i.alternate,i);break;case 24:no(s,i),c&2048&&uu(i.alternate,i);break;default:no(s,i)}t=t.sibling}}var ao=8192;function ni(e,t,s){if(e.subtreeFlags&ao)for(e=e.child;e!==null;)Wm(e,t,s),e=e.sibling}function Wm(e,t,s){switch(e.tag){case 26:ni(e,t,s),e.flags&ao&&e.memoizedState!==null&&E0(s,jn,e.memoizedState,e.memoizedProps);break;case 5:ni(e,t,s);break;case 3:case 4:var i=jn;jn=Hl(e.stateNode.containerInfo),ni(e,t,s),jn=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=ao,ao=16777216,ni(e,t,s),ao=i):ni(e,t,s));break;default:ni(e,t,s)}}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 so(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];At=i,Jm(i,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:so(e),e.flags&2048&&Ra(9,e,e.return);break;case 3:so(e);break;case 12:so(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Al(e)):so(e);break;default:so(e)}}function Al(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var i=t[s];At=i,Jm(i,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),Al(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,Al(t));break;default:Al(t)}e=e.sibling}}function Jm(e,t){for(;At!==null;){var s=At;switch(s.tag){case 0:case 11:case 15:Ra(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var i=s.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Bi(s.memoizedState.cache)}if(i=s.child,i!==null)i.return=s,At=i;else e:for(s=e;At!==null;){i=At;var c=i.sibling,d=i.return;if(Km(i),i===s){At=null;break e}if(c!==null){c.return=d,At=c;break e}At=d}}}var qb={getCacheForType:function(e){var t=Tt(yt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return Tt(yt).controller.signal}},Kb=typeof WeakMap=="function"?WeakMap:Map,Ge=0,Ze=null,ze=null,Pe=0,Ve=0,an=null,_a=!1,ai=!1,du=!1,da=0,lt=0,za=0,ys=0,fu=0,sn=0,si=0,io=null,Gt=null,hu=!1,El=0,ep=0,Ml=1/0,Ol=null,La=null,wt=0,Pa=null,ii=null,fa=0,mu=0,pu=null,tp=null,oo=0,gu=null;function on(){return(Ge&2)!==0&&Pe!==0?Pe&-Pe:R.T!==null?Cu():Ai()}function np(){if(sn===0)if((Pe&536870912)===0||He){var e=be;be<<=1,(be&3932160)===0&&(be=262144),sn=e}else sn=536870912;return e=tn.current,e!==null&&(e.flags|=32),sn}function Yt(e,t,s){(e===Ze&&(Ve===2||Ve===9)||e.cancelPendingCommit!==null)&&(oi(e,0),Ua(e,Pe,sn,!1)),wn(e,s),((Ge&2)===0||e!==Ze)&&(e===Ze&&((Ge&2)===0&&(ys|=s),lt===4&&Ua(e,Pe,sn,!1)),Pn(e))}function ap(e,t,s){if((Ge&6)!==0)throw Error(l(327));var i=!s&&(t&127)===0&&(t&e.expiredLanes)===0||_t(e,t),c=i?Vb(e,t):xu(e,t,!0),d=i;do{if(c===0){ai&&!i&&Ua(e,t,0,!1);break}else{if(s=e.current.alternate,d&&!Gb(s)){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=io;var A=v.current.memoizedState.isDehydrated;if(A&&(oi(v,g).flags|=256),g=xu(v,g,!1),g!==2){if(du&&!A){v.errorRecoveryDisabledLanes|=d,ys|=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){oi(e,0),Ua(e,t,0,!0);break}e:{switch(i=e,d=c,d){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:Ua(i,t,sn,!_a);break e;case 2:Gt=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(c=El+300-ft(),10<c)){if(Ua(i,t,sn,!_a),we(i,0,!0)!==0)break e;fa=t,i.timeoutHandle=_p(sp.bind(null,i,s,Gt,Ol,hu,t,sn,ys,si,_a,d,"Throttled",-0,0),c);break e}sp(i,s,Gt,Ol,hu,t,sn,ys,si,_a,d,null,-0,0)}}break}while(!0);Pn(e)}function sp(e,t,s,i,c,d,g,v,A,z,K,Y,P,H){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 le=(d&62914560)===d?El-ft():(d&4194048)===d?ep-ft():0;if(le=M0(Y,le),le!==null){fa=d,e.cancelPendingCommit=le(fp.bind(null,e,t,d,s,i,c,g,v,A,K,Y,null,P,H)),Ua(e,d,g,!z);return}}fp(e,t,d,s,i,c,g,v,A)}function Gb(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var i=0;i<s.length;i++){var c=s[i],d=c.getSnapshot;c=c.value;try{if(!Jt(d(),c))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;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,s,i){t&=~fu,t&=~ys,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var c=t;0<c;){var d=31-ve(c),g=1<<d;i[d]=-1,c&=~g}s!==0&&es(e,s,t)}function Tl(){return(Ge&6)===0?(lo(0),!1):!0}function yu(){if(ze!==null){if(Ve===0)var e=ze.return;else e=ze,ta=rs=null,Rc(e),Ws=null,Ki=0,e=ze;for(;e!==null;)zm(e.alternate,e),e=e.return;ze=null}}function oi(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,u0(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),fa=0,yu(),Ze=e,ze=s=Jn(e.current,null),Pe=t,Ve=0,an=null,_a=!1,ai=_t(e,t),du=!1,si=sn=fu=ys=za=lt=0,Gt=io=null,hu=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var c=31-ve(i),d=1<<c;t|=e[c],i&=~d}return da=t,Xo(),s}function ip(e,t){Me=null,R.H=Xi,t===$s||t===il?(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,ze===null&&(lt=1,vl(e,pn(t,e.current)))}function op(){var e=tn.current;return e===null?!0:(Pe&4194048)===Pe?vn===null:(Pe&62914560)===Pe||(Pe&536870912)!==0?e===vn:!1}function lp(){var e=R.H;return R.H=Xi,e===null?Xi:e}function rp(){var e=R.A;return R.A=qb,e}function Dl(){lt=4,_a||(Pe&4194048)!==Pe&&tn.current!==null||(ai=!0),(za&134217727)===0&&(ys&134217727)===0||Ze===null||Ua(Ze,Pe,sn,!1)}function xu(e,t,s){var i=Ge;Ge|=2;var c=lp(),d=rp();(Ze!==e||Pe!==t)&&(Ol=null,oi(e,t)),t=!1;var g=lt;e:do try{if(Ve!==0&&ze!==null){var v=ze,A=an;switch(Ve){case 8:yu(),g=6;break e;case 3:case 2:case 9:case 6:tn.current===null&&(t=!0);var z=Ve;if(Ve=0,an=null,li(e,v,A,z),s&&ai){g=0;break e}break;default:z=Ve,Ve=0,an=null,li(e,v,A,z)}}Yb(),g=lt;break}catch(K){ip(e,K)}while(!0);return t&&e.shellSuspendCounter++,ta=rs=null,Ge=i,R.H=c,R.A=d,ze===null&&(Ze=null,Pe=0,Xo()),g}function Yb(){for(;ze!==null;)cp(ze)}function Vb(e,t){var s=Ge;Ge|=2;var i=lp(),c=rp();Ze!==e||Pe!==t?(Ol=null,Ml=ft()+500,oi(e,t)):ai=_t(e,t);e:do try{if(Ve!==0&&ze!==null){t=ze;var d=an;t:switch(Ve){case 1:Ve=0,an=null,li(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),Pn(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,li(e,t,d,7));break;case 5:var g=null;switch(ze.tag){case 26:g=ze.memoizedState;case 5:case 27:var v=ze;if(g?$p(g):v.stateNode.complete){Ve=0,an=null;var A=v.sibling;if(A!==null)ze=A;else{var z=v.return;z!==null?(ze=z,kl(z)):ze=null}break t}}Ve=0,an=null,li(e,t,d,5);break;case 6:Ve=0,an=null,li(e,t,d,6);break;case 8:yu(),lt=6;break e;default:throw Error(l(462))}}Fb();break}catch(K){ip(e,K)}while(!0);return ta=rs=null,R.H=i,R.A=c,Ge=s,ze!==null?0:(Ze=null,Pe=0,Xo(),lt)}function Fb(){for(;ze!==null&&!Sa();)cp(ze)}function cp(e){var t=Rm(e.alternate,e,da);e.memoizedProps=e.pendingProps,t===null?kl(e):ze=t}function up(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=Em(s,t,t.pendingProps,t.type,void 0,Pe);break;case 11:t=Em(s,t,t.pendingProps,t.type.render,t.ref,Pe);break;case 5:Rc(t);default:zm(s,t),t=ze=rh(t,da),t=Rm(s,t,da)}e.memoizedProps=e.pendingProps,t===null?kl(e):ze=t}function li(e,t,s,i){ta=rs=null,Rc(t),Ws=null,Ki=0;var c=t.return;try{if(zb(e,c,t,s,Pe)){lt=1,vl(e,pn(s,e.current)),ze=null;return}}catch(d){if(c!==null)throw ze=c,d;lt=1,vl(e,pn(s,e.current)),ze=null;return}t.flags&32768?(He||i===1?e=!0:ai||(Pe&536870912)!==0?e=!1:(_a=e=!0,(i===2||i===9||i===3||i===6)&&(i=tn.current,i!==null&&i.tag===13&&(i.flags|=16384))),dp(t,e)):kl(t)}function kl(e){var t=e;do{if((t.flags&32768)!==0){dp(t,_a);return}e=t.return;var s=Ub(t.alternate,t,da);if(s!==null){ze=s;return}if(t=t.sibling,t!==null){ze=t;return}ze=t=e}while(t!==null);lt===0&&(lt=5)}function dp(e,t){do{var s=Hb(e.alternate,e);if(s!==null){s.flags&=32767,ze=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){ze=e;return}ze=e=s}while(e!==null);lt=6,ze=null}function fp(e,t,s,i,c,d,g,v,A){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|=oc,Ni(e,s,d,g,v,A),e===Ze&&(ze=Ze=null,Pe=0),ii=t,Pa=e,fa=s,mu=d,pu=c,tp=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Xb(kn,function(){return yp(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=R.T,R.T=null,c=W.p,W.p=2,g=Ge,Ge|=4;try{Ib(e,t,s)}finally{Ge=g,W.p=c,R.T=i}}wt=1,hp(),mp(),pp()}}function hp(){if(wt===1){wt=0;var e=Pa,t=ii,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=R.T,R.T=null;var i=W.p;W.p=2;var c=Ge;Ge|=4;try{Fm(t,e);var d=Tu,g=Jf(e.containerInfo),v=d.focusedElem,A=d.selectionRange;if(g!==v&&v&&v.ownerDocument&&Zf(v.ownerDocument.documentElement,v)){if(A!==null&&tc(v)){var z=A.start,K=A.end;if(K===void 0&&(K=z),"selectionStart"in v)v.selectionStart=z,v.selectionEnd=Math.min(K,v.value.length);else{var Y=v.ownerDocument||document,P=Y&&Y.defaultView||window;if(P.getSelection){var H=P.getSelection(),le=v.textContent.length,Se=Math.min(A.start,le),Xe=A.end===void 0?Se:Math.min(A.end,le);!H.extend&&Se>Xe&&(g=Xe,Xe=Se,Se=g);var T=Xf(v,Se),E=Xf(v,Xe);if(T&&E&&(H.rangeCount!==1||H.anchorNode!==T.node||H.anchorOffset!==T.offset||H.focusNode!==E.node||H.focusOffset!==E.offset)){var _=Y.createRange();_.setStart(T.node,T.offset),H.removeAllRanges(),Se>Xe?(H.addRange(_),H.extend(E.node,E.offset)):(_.setEnd(E.node,E.offset),H.addRange(_))}}}}for(Y=[],H=v;H=H.parentNode;)H.nodeType===1&&Y.push({element:H,left:H.scrollLeft,top:H.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=!!Ou,Tu=Ou=null}finally{Ge=c,W.p=i,R.T=s}}e.current=t,wt=2}}function mp(){if(wt===2){wt=0;var e=Pa,t=ii,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=R.T,R.T=null;var i=W.p;W.p=2;var c=Ge;Ge|=4;try{qm(e,t.alternate,t)}finally{Ge=c,W.p=i,R.T=s}}wt=3}}function pp(){if(wt===4||wt===3){wt=0,Yn();var e=Pa,t=ii,s=fa,i=tp;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?wt=5:(wt=0,ii=Pa=null,gp(e,e.pendingLanes));var c=e.pendingLanes;if(c===0&&(La=null),Ms(s),t=t.stateNode,Z&&typeof Z.onCommitFiberRoot=="function")try{Z.onCommitFiberRoot(Fn,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=R.T,c=W.p,W.p=2,R.T=null;try{for(var d=e.onRecoverableError,g=0;g<i.length;g++){var v=i[g];d(v.value,{componentStack:v.stack})}}finally{R.T=t,W.p=c}}(fa&3)!==0&&Rl(),Pn(e),c=e.pendingLanes,(s&261930)!==0&&(c&42)!==0?e===gu?oo++:(oo=0,gu=e):oo=0,lo(0)}}function gp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Bi(t)))}function Rl(){return hp(),mp(),pp(),yp()}function yp(){if(wt!==5)return!1;var e=Pa,t=mu;mu=0;var s=Ms(fa),i=R.T,c=W.p;try{W.p=32>s?32:s,R.T=null,s=pu,pu=null;var d=Pa,g=fa;if(wt=0,ii=Pa=null,fa=0,(Ge&6)!==0)throw Error(l(331));var v=Ge;if(Ge|=4,Zm(d.current),$m(d,d.current,g,s),Ge=v,lo(0,!1),Z&&typeof Z.onPostCommitFiberRoot=="function")try{Z.onPostCommitFiberRoot(Fn,d)}catch{}return!0}finally{W.p=c,R.T=i,gp(e,t)}}function xp(e,t,s){t=pn(s,t),t=Qc(e.stateNode,t,2),e=Ta(e,t,2),e!==null&&(wn(e,2),Pn(e))}function Fe(e,t,s){if(e.tag===3)xp(e,e,s);else for(;t!==null;){if(t.tag===3){xp(t,e,s);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(La===null||!La.has(i))){e=pn(s,e),s=vm(2),i=Ta(t,s,2),i!==null&&(bm(s,i,t,e),wn(i,2),Pn(i));break}}t=t.return}}function vu(e,t,s){var i=e.pingCache;if(i===null){i=e.pingCache=new Kb;var c=new Set;i.set(t,c)}else c=i.get(t),c===void 0&&(c=new Set,i.set(t,c));c.has(s)||(du=!0,c.add(s),e=Qb.bind(null,e,t,s),t.then(e,e))}function Qb(e,t,s){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Ze===e&&(Pe&s)===s&&(lt===4||lt===3&&(Pe&62914560)===Pe&&300>ft()-El?(Ge&2)===0&&oi(e,0):fu|=s,si===Pe&&(si=0)),Pn(e)}function vp(e,t){t===0&&(t=Nt()),e=is(e,t),e!==null&&(wn(e,t),Pn(e))}function $b(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),vp(e,s)}function Wb(e,t){var s=0;switch(e.tag){case 31:case 13:var i=e.stateNode,c=e.memoizedState;c!==null&&(s=c.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(l(314))}i!==null&&i.delete(t),vp(e,s)}function Xb(e,t){return Dn(e,t)}var _l=null,ri=null,bu=!1,zl=!1,Su=!1,Ha=0;function Pn(e){e!==ri&&e.next===null&&(ri===null?_l=ri=e:ri=ri.next=e),zl=!0,bu||(bu=!0,Jb())}function lo(e,t){if(!Su&&zl){Su=!0;do for(var s=!1,i=_l;i!==null;){if(e!==0){var c=i.pendingLanes;if(c===0)var d=0;else{var g=i.suspendedLanes,v=i.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&&(s=!0,wp(i,d))}else d=Pe,d=we(i,i===Ze?d:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(d&3)===0||_t(i,d)||(s=!0,wp(i,d));i=i.next}while(s);Su=!1}}function Zb(){bp()}function bp(){zl=bu=!1;var e=0;Ha!==0&&c0()&&(e=Ha);for(var t=ft(),s=null,i=_l;i!==null;){var c=i.next,d=Sp(i,t);d===0?(i.next=null,s===null?_l=c:s.next=c,c===null&&(ri=s)):(s=i,(e!==0||(d&3)!==0)&&(zl=!0)),i=c}wt!==0&&wt!==5||lo(e),Ha!==0&&(Ha=0)}function Sp(e,t){for(var s=e.suspendedLanes,i=e.pingedLanes,c=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var g=31-ve(d),v=1<<g,A=c[g];A===-1?((v&s)===0||(v&i)!==0)&&(c[g]=Qn(v,t)):A<=t&&(e.expiredLanes|=v),d&=~v}if(t=Ze,s=Pe,s=we(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,s===0||e===t&&(Ve===2||Ve===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&Wt(i),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||_t(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(i!==null&&Wt(i),Ms(s)){case 2:case 8:s=Ja;break;case 32:s=kn;break;case 268435456:s=Es;break;default:s=kn}return i=Cp.bind(null,e),s=Dn(s,i),e.callbackPriority=t,e.callbackNode=s,t}return i!==null&&i!==null&&Wt(i),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 s=e.callbackNode;if(Rl()&&e.callbackNode!==s)return null;var i=Pe;return i=we(e,e===Ze?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(ap(e,i,t),Sp(e,ft()),e.callbackNode!=null&&e.callbackNode===s?Cp.bind(null,e):null)}function wp(e,t){if(Rl())return null;ap(e,t,!0)}function Jb(){d0(function(){(Ge&6)!==0?Dn(Vn,Zb):bp()})}function Cu(){if(Ha===0){var e=Fs;e===0&&(e=Ae,Ae<<=1,(Ae&261888)===0&&(Ae=256)),Ha=e}return Ha}function Np(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ko(""+e)}function jp(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function e0(e,t,s,i,c){if(t==="submit"&&s&&s.stateNode===c){var d=Np((c[Ht]||null).action),g=i.submitter;g&&(t=(t=g[Ht]||null)?Np(t.formAction):g.getAttribute("formAction"),t!==null&&(d=t,g=null));var v=new Fo("action","action",null,i,c);e.push({event:v,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(Ha!==0){var A=g?jp(c,g):new FormData(c);qc(s,{pending:!0,data:A,method:c.method,action:d},null,A)}}else typeof d=="function"&&(v.preventDefault(),A=g?jp(c,g):new FormData(c),qc(s,{pending:!0,data:A,method:c.method,action:d},d,A))},currentTarget:c}]})}}for(var wu=0;wu<ic.length;wu++){var Nu=ic[wu],t0=Nu.toLowerCase(),n0=Nu[0].toUpperCase()+Nu.slice(1);Nn(t0,"on"+n0)}Nn(nh,"onAnimationEnd"),Nn(ah,"onAnimationIteration"),Nn(sh,"onAnimationStart"),Nn("dblclick","onDoubleClick"),Nn("focusin","onFocus"),Nn("focusout","onBlur"),Nn(xb,"onTransitionRun"),Nn(vb,"onTransitionStart"),Nn(bb,"onTransitionCancel"),Nn(ih,"onTransitionEnd"),Rs("onMouseEnter",["mouseout","mouseover"]),Rs("onMouseLeave",["mouseout","mouseover"]),Rs("onPointerEnter",["pointerout","pointerover"]),Rs("onPointerLeave",["pointerout","pointerover"]),ts("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ts("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ts("onBeforeInput",["compositionend","keypress","textInput","paste"]),ts("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ts("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ts("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ro="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(ro));function Ap(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var i=e[s],c=i.event;i=i.listeners;e:{var d=void 0;if(t)for(var g=i.length-1;0<=g;g--){var v=i[g],A=v.instance,z=v.currentTarget;if(v=v.listener,A!==d&&c.isPropagationStopped())break e;d=v,c.currentTarget=z;try{d(c)}catch(K){Wo(K)}c.currentTarget=null,d=A}else for(g=0;g<i.length;g++){if(v=i[g],A=v.instance,z=v.currentTarget,v=v.listener,A!==d&&c.isPropagationStopped())break e;d=v,c.currentTarget=z;try{d(c)}catch(K){Wo(K)}c.currentTarget=null,d=A}}}}function Le(e,t){var s=t[Pr];s===void 0&&(s=t[Pr]=new Set);var i=e+"__bubble";s.has(i)||(Ep(t,e,2,!1),s.add(i))}function ju(e,t,s){var i=0;t&&(i|=4),Ep(s,e,i,t)}var Ll="_reactListening"+Math.random().toString(36).slice(2);function Au(e){if(!e[Ll]){e[Ll]=!0,bf.forEach(function(s){s!=="selectionchange"&&(a0.has(s)||ju(s,!1,e),ju(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ll]||(t[Ll]=!0,ju("selectionchange",!1,t))}}function Ep(e,t,s,i){switch(ng(t)){case 2:var c=D0;break;case 8:c=k0;break;default:c=Bu}s=c.bind(null,t,s,e),c=void 0,!Vr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(c=!0),i?c!==void 0?e.addEventListener(t,s,{capture:!0,passive:c}):e.addEventListener(t,s,!0):c!==void 0?e.addEventListener(t,s,{passive:c}):e.addEventListener(t,s,!1)}function Eu(e,t,s,i,c){var d=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var g=i.tag;if(g===3||g===4){var v=i.stateNode.containerInfo;if(v===c)break;if(g===4)for(g=i.return;g!==null;){var A=g.tag;if((A===3||A===4)&&g.stateNode.containerInfo===c)return;g=g.return}for(;v!==null;){if(g=Ts(v),g===null)return;if(A=g.tag,A===5||A===6||A===26||A===27){i=d=g;continue e}v=v.parentNode}}i=i.return}kf(function(){var z=d,K=Gr(s),Y=[];e:{var P=oh.get(e);if(P!==void 0){var H=Fo,le=e;switch(e){case"keypress":if(Yo(s)===0)break e;case"keydown":case"keyup":H=Wv;break;case"focusin":le="focus",H=Wr;break;case"focusout":le="blur",H=Wr;break;case"beforeblur":case"afterblur":H=Wr;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":H=zf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":H=Uv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":H=Jv;break;case nh:case ah:case sh:H=Bv;break;case ih:H=tb;break;case"scroll":case"scrollend":H=Lv;break;case"wheel":H=ab;break;case"copy":case"cut":case"paste":H=Kv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":H=Pf;break;case"toggle":case"beforetoggle":H=ib}var Se=(t&4)!==0,Xe=!Se&&(e==="scroll"||e==="scrollend"),T=Se?P!==null?P+"Capture":null:P;Se=[];for(var E=z,_;E!==null;){var G=E;if(_=G.stateNode,G=G.tag,G!==5&&G!==26&&G!==27||_===null||T===null||(G=Ti(E,T),G!=null&&Se.push(co(E,G,_))),Xe)break;E=E.return}0<Se.length&&(P=new H(P,le,null,s,K),Y.push({event:P,listeners:Se}))}}if((t&7)===0){e:{if(P=e==="mouseover"||e==="pointerover",H=e==="mouseout"||e==="pointerout",P&&s!==Kr&&(le=s.relatedTarget||s.fromElement)&&(Ts(le)||le[Os]))break e;if((H||P)&&(P=K.window===K?K:(P=K.ownerDocument)?P.defaultView||P.parentWindow:window,H?(le=s.relatedTarget||s.toElement,H=z,le=le?Ts(le):null,le!==null&&(Xe=f(le),Se=le.tag,le!==Xe||Se!==5&&Se!==27&&Se!==6)&&(le=null)):(H=null,le=z),H!==le)){if(Se=zf,G="onMouseLeave",T="onMouseEnter",E="mouse",(e==="pointerout"||e==="pointerover")&&(Se=Pf,G="onPointerLeave",T="onPointerEnter",E="pointer"),Xe=H==null?P:Oi(H),_=le==null?P:Oi(le),P=new Se(G,E+"leave",H,s,K),P.target=Xe,P.relatedTarget=_,G=null,Ts(K)===z&&(Se=new Se(T,E+"enter",le,s,K),Se.target=_,Se.relatedTarget=Xe,G=Se),Xe=G,H&&le)t:{for(Se=s0,T=H,E=le,_=0,G=T;G;G=Se(G))_++;G=0;for(var pe=E;pe;pe=Se(pe))G++;for(;0<_-G;)T=Se(T),_--;for(;0<G-_;)E=Se(E),G--;for(;_--;){if(T===E||E!==null&&T===E.alternate){Se=T;break t}T=Se(T),E=Se(E)}Se=null}else Se=null;H!==null&&Mp(Y,P,H,Se,!1),le!==null&&Xe!==null&&Mp(Y,Xe,le,Se,!0)}}e:{if(P=z?Oi(z):window,H=P.nodeName&&P.nodeName.toLowerCase(),H==="select"||H==="input"&&P.type==="file")var Ie=Yf;else if(Kf(P))if(Vf)Ie=pb;else{Ie=hb;var ue=fb}else H=P.nodeName,!H||H.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?z&&qr(z.elementType)&&(Ie=Yf):Ie=mb;if(Ie&&(Ie=Ie(e,z))){Gf(Y,Ie,s,K);break e}ue&&ue(e,P,z),e==="focusout"&&z&&P.type==="number"&&z.memoizedProps.value!=null&&Br(P,"number",P.value)}switch(ue=z?Oi(z):window,e){case"focusin":(Kf(ue)||ue.contentEditable==="true")&&(Hs=ue,nc=z,Ui=null);break;case"focusout":Ui=nc=Hs=null;break;case"mousedown":ac=!0;break;case"contextmenu":case"mouseup":case"dragend":ac=!1,eh(Y,s,K);break;case"selectionchange":if(yb)break;case"keydown":case"keyup":eh(Y,s,K)}var Oe;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 Us?Bf(e,s)&&(Ue="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(Ue="onCompositionStart");Ue&&(Uf&&s.locale!=="ko"&&(Us||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&Us&&(Oe=Rf()):(wa=K,Fr="value"in wa?wa.value:wa.textContent,Us=!0)),ue=Pl(z,Ue),0<ue.length&&(Ue=new Lf(Ue,e,null,s,K),Y.push({event:Ue,listeners:ue}),Oe?Ue.data=Oe:(Oe=qf(s),Oe!==null&&(Ue.data=Oe)))),(Oe=lb?rb(e,s):cb(e,s))&&(Ue=Pl(z,"onBeforeInput"),0<Ue.length&&(ue=new Lf("onBeforeInput","beforeinput",null,s,K),Y.push({event:ue,listeners:Ue}),ue.data=Oe)),e0(Y,e,z,s,K)}Ap(Y,t)})}function co(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Pl(e,t){for(var s=t+"Capture",i=[];e!==null;){var c=e,d=c.stateNode;if(c=c.tag,c!==5&&c!==26&&c!==27||d===null||(c=Ti(e,s),c!=null&&i.unshift(co(e,c,d)),c=Ti(e,t),c!=null&&i.push(co(e,c,d))),e.tag===3)return i;e=e.return}return[]}function s0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Mp(e,t,s,i,c){for(var d=t._reactName,g=[];s!==null&&s!==i;){var v=s,A=v.alternate,z=v.stateNode;if(v=v.tag,A!==null&&A===i)break;v!==5&&v!==26&&v!==27||z===null||(A=z,c?(z=Ti(s,d),z!=null&&g.unshift(co(s,z,A))):c||(z=Ti(s,d),z!=null&&g.push(co(s,z,A)))),s=s.return}g.length!==0&&e.push({event:t,listeners:g})}var i0=/\r\n?/g,o0=/\u0000|\uFFFD/g;function Op(e){return(typeof e=="string"?e:""+e).replace(i0,`
10
- `).replace(o0,"")}function Tp(e,t){return t=Op(t),Op(e)===t}function We(e,t,s,i,c,d){switch(s){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||zs(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&zs(e,""+i);break;case"className":Bo(e,"class",i);break;case"tabIndex":Bo(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":Bo(e,s,i);break;case"style":Tf(e,i,d);break;case"data":if(t!=="object"){Bo(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=Ko(""+i),e.setAttribute(s,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(s,"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"&&(s==="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(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(s);break}i=Ko(""+i),e.setAttribute(s,i);break;case"onClick":i!=null&&(e.onclick=Xn);break;case"onScroll":i!=null&&Le("scroll",e);break;case"onScrollEnd":i!=null&&Le("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(l(61));if(s=i.__html,s!=null){if(c.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}s=Ko(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""+i):e.removeAttribute(s);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":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":i===!0?e.setAttribute(s,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(s,i):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(s,i):e.removeAttribute(s);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(s):e.setAttribute(s,i);break;case"popover":Le("beforetoggle",e),Le("toggle",e),Io(e,"popover",i);break;case"xlinkActuate":Wn(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Wn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Wn(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Wn(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Wn(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Wn(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Wn(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":Io(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=_v.get(s)||s,Io(e,s,i))}}function Mu(e,t,s,i,c,d){switch(s){case"style":Tf(e,i,d);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(l(61));if(s=i.__html,s!=null){if(c.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"children":typeof i=="string"?zs(e,i):(typeof i=="number"||typeof i=="bigint")&&zs(e,""+i);break;case"onScroll":i!=null&&Le("scroll",e);break;case"onScrollEnd":i!=null&&Le("scrollend",e);break;case"onClick":i!=null&&(e.onclick=Xn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Sf.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(c=s.endsWith("Capture"),t=s.slice(2,c?s.length-7:void 0),d=e[Ht]||null,d=d!=null?d[s]:null,typeof d=="function"&&e.removeEventListener(t,d,c),typeof i=="function")){typeof d!="function"&&d!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,i,c);break e}s in e?e[s]=i:i===!0?e.setAttribute(s,""):Io(e,s,i)}}}function kt(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Le("error",e),Le("load",e);var i=!1,c=!1,d;for(d in s)if(s.hasOwnProperty(d)){var g=s[d];if(g!=null)switch(d){case"src":i=!0;break;case"srcSet":c=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:We(e,t,d,g,s,null)}}c&&We(e,t,"srcSet",s.srcSet,s,null),i&&We(e,t,"src",s.src,s,null);return;case"input":Le("invalid",e);var v=d=g=c=null,A=null,z=null;for(i in s)if(s.hasOwnProperty(i)){var K=s[i];if(K!=null)switch(i){case"name":c=K;break;case"type":g=K;break;case"checked":A=K;break;case"defaultChecked":z=K;break;case"value":d=K;break;case"defaultValue":v=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(l(137,t));break;default:We(e,t,i,K,s,null)}}Af(e,d,v,A,z,g,c,!1);return;case"select":Le("invalid",e),i=g=d=null;for(c in s)if(s.hasOwnProperty(c)&&(v=s[c],v!=null))switch(c){case"value":d=v;break;case"defaultValue":g=v;break;case"multiple":i=v;default:We(e,t,c,v,s,null)}t=d,s=g,e.multiple=!!i,t!=null?_s(e,!!i,t,!1):s!=null&&_s(e,!!i,s,!0);return;case"textarea":Le("invalid",e),d=c=i=null;for(g in s)if(s.hasOwnProperty(g)&&(v=s[g],v!=null))switch(g){case"value":i=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,s,null)}Mf(e,i,c,d);return;case"option":for(A in s)if(s.hasOwnProperty(A)&&(i=s[A],i!=null))switch(A){case"selected":e.selected=i&&typeof i!="function"&&typeof i!="symbol";break;default:We(e,t,A,i,s,null)}return;case"dialog":Le("beforetoggle",e),Le("toggle",e),Le("cancel",e),Le("close",e);break;case"iframe":case"object":Le("load",e);break;case"video":case"audio":for(i=0;i<ro.length;i++)Le(ro[i],e);break;case"image":Le("error",e),Le("load",e);break;case"details":Le("toggle",e);break;case"embed":case"source":case"link":Le("error",e),Le("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(z in s)if(s.hasOwnProperty(z)&&(i=s[z],i!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:We(e,t,z,i,s,null)}return;default:if(qr(t)){for(K in s)s.hasOwnProperty(K)&&(i=s[K],i!==void 0&&Mu(e,t,K,i,s,void 0));return}}for(v in s)s.hasOwnProperty(v)&&(i=s[v],i!=null&&We(e,t,v,i,s,null))}function l0(e,t,s,i){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,A=null,z=null,K=null;for(H in s){var Y=s[H];if(s.hasOwnProperty(H)&&Y!=null)switch(H){case"checked":break;case"value":break;case"defaultValue":A=Y;default:i.hasOwnProperty(H)||We(e,t,H,null,i,Y)}}for(var P in i){var H=i[P];if(Y=s[P],i.hasOwnProperty(P)&&(H!=null||Y!=null))switch(P){case"type":d=H;break;case"name":c=H;break;case"checked":z=H;break;case"defaultChecked":K=H;break;case"value":g=H;break;case"defaultValue":v=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(l(137,t));break;default:H!==Y&&We(e,t,P,H,i,Y)}}Ir(e,g,v,A,z,K,d,c);return;case"select":H=g=v=P=null;for(d in s)if(A=s[d],s.hasOwnProperty(d)&&A!=null)switch(d){case"value":break;case"multiple":H=A;default:i.hasOwnProperty(d)||We(e,t,d,null,i,A)}for(c in i)if(d=i[c],A=s[c],i.hasOwnProperty(c)&&(d!=null||A!=null))switch(c){case"value":P=d;break;case"defaultValue":v=d;break;case"multiple":g=d;default:d!==A&&We(e,t,c,d,i,A)}t=v,s=g,i=H,P!=null?_s(e,!!s,P,!1):!!i!=!!s&&(t!=null?_s(e,!!s,t,!0):_s(e,!!s,s?[]:"",!1));return;case"textarea":H=P=null;for(v in s)if(c=s[v],s.hasOwnProperty(v)&&c!=null&&!i.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:We(e,t,v,null,i,c)}for(g in i)if(c=i[g],d=s[g],i.hasOwnProperty(g)&&(c!=null||d!=null))switch(g){case"value":P=c;break;case"defaultValue":H=c;break;case"children":break;case"dangerouslySetInnerHTML":if(c!=null)throw Error(l(91));break;default:c!==d&&We(e,t,g,c,i,d)}Ef(e,P,H);return;case"option":for(var le in s)if(P=s[le],s.hasOwnProperty(le)&&P!=null&&!i.hasOwnProperty(le))switch(le){case"selected":e.selected=!1;break;default:We(e,t,le,null,i,P)}for(A in i)if(P=i[A],H=s[A],i.hasOwnProperty(A)&&P!==H&&(P!=null||H!=null))switch(A){case"selected":e.selected=P&&typeof P!="function"&&typeof P!="symbol";break;default:We(e,t,A,P,i,H)}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 s)P=s[Se],s.hasOwnProperty(Se)&&P!=null&&!i.hasOwnProperty(Se)&&We(e,t,Se,null,i,P);for(z in i)if(P=i[z],H=s[z],i.hasOwnProperty(z)&&P!==H&&(P!=null||H!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(l(137,t));break;default:We(e,t,z,P,i,H)}return;default:if(qr(t)){for(var Xe in s)P=s[Xe],s.hasOwnProperty(Xe)&&P!==void 0&&!i.hasOwnProperty(Xe)&&Mu(e,t,Xe,void 0,i,P);for(K in i)P=i[K],H=s[K],!i.hasOwnProperty(K)||P===H||P===void 0&&H===void 0||Mu(e,t,K,P,i,H);return}}for(var T in s)P=s[T],s.hasOwnProperty(T)&&P!=null&&!i.hasOwnProperty(T)&&We(e,t,T,null,i,P);for(Y in i)P=i[Y],H=s[Y],!i.hasOwnProperty(Y)||P===H||P==null&&H==null||We(e,t,Y,P,i,H)}function Dp(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,s=performance.getEntriesByType("resource"),i=0;i<s.length;i++){var c=s[i],d=c.transferSize,g=c.initiatorType,v=c.duration;if(d&&v&&Dp(g)){for(g=0,v=c.responseEnd,i+=1;i<s.length;i++){var A=s[i],z=A.startTime;if(z>v)break;var K=A.transferSize,Y=A.initiatorType;K&&Dp(Y)&&(A=A.responseEnd,g+=K*(A<v?1:(v-z)/(A-z)))}if(--i,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 Ou=null,Tu=null;function Ul(e){return e.nodeType===9?e:e.ownerDocument}function kp(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 Du(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 ku=null;function c0(){var e=window.event;return e&&e.type==="popstate"?e===ku?!1:(ku=e,!0):(ku=null,!1)}var _p=typeof setTimeout=="function"?setTimeout:void 0,u0=typeof clearTimeout=="function"?clearTimeout:void 0,zp=typeof Promise=="function"?Promise:void 0,d0=typeof queueMicrotask=="function"?queueMicrotask:typeof zp<"u"?function(e){return zp.resolve(null).then(e).catch(f0)}:_p;function f0(e){setTimeout(function(){throw e})}function Ia(e){return e==="head"}function Lp(e,t){var s=t,i=0;do{var c=s.nextSibling;if(e.removeChild(s),c&&c.nodeType===8)if(s=c.data,s==="/$"||s==="/&"){if(i===0){e.removeChild(c),fi(t);return}i--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")i++;else if(s==="html")uo(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,uo(s);for(var d=s.firstChild;d;){var g=d.nextSibling,v=d.nodeName;d[Mi]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&d.rel.toLowerCase()==="stylesheet"||s.removeChild(d),d=g}}else s==="body"&&uo(e.ownerDocument.body);s=c}while(s);fi(t)}function Pp(e,t){var s=e;e=0;do{var i=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),i&&i.nodeType===8)if(s=i.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=i}while(s)}function Ru(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Ru(s),Ur(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function h0(e,t,s,i){for(;e.nodeType===1;){var c=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Mi])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,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(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 _u(e){return e.data==="$?"||e.data==="$~"}function zu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function p0(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var i=function(){t(),s.removeEventListener("DOMContentLoaded",i)};s.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}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 Lu=null;function Hp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return bn(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function Ip(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function Bp(e,t,s){switch(t=Ul(s),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 uo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ur(e)}var Sn=new Map,qp=new Set;function Hl(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ha=W.d;W.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=Tl();return e||t}function y0(e){var t=Ds(e);t!==null&&t.tag===5&&t.type==="form"?im(t):ha.r(e)}var ci=typeof document>"u"?null:document;function Kp(e,t,s){var i=ci;if(i&&typeof t=="string"&&t){var c=hn(t);c='link[rel="'+e+'"][href="'+c+'"]',typeof s=="string"&&(c+='[crossorigin="'+s+'"]'),qp.has(c)||(qp.add(c),e={rel:e,crossOrigin:s,href:t},i.querySelector(c)===null&&(t=i.createElement("link"),kt(t,"link",e),jt(t),i.head.appendChild(t)))}}function x0(e){ha.D(e),Kp("dns-prefetch",e,null)}function v0(e,t){ha.C(e,t),Kp("preconnect",e,t)}function b0(e,t,s){ha.L(e,t,s);var i=ci;if(i&&e&&t){var c='link[rel="preload"][as="'+hn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(c+='[imagesrcset="'+hn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(c+='[imagesizes="'+hn(s.imageSizes)+'"]')):c+='[href="'+hn(e)+'"]';var d=c;switch(t){case"style":d=ui(e);break;case"script":d=di(e)}Sn.has(d)||(e=x({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Sn.set(d,e),i.querySelector(c)!==null||t==="style"&&i.querySelector(fo(d))||t==="script"&&i.querySelector(ho(d))||(t=i.createElement("link"),kt(t,"link",e),jt(t),i.head.appendChild(t)))}}function S0(e,t){ha.m(e,t);var s=ci;if(s&&e){var i=t&&typeof t.as=="string"?t.as:"script",c='link[rel="modulepreload"][as="'+hn(i)+'"][href="'+hn(e)+'"]',d=c;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=di(e)}if(!Sn.has(d)&&(e=x({rel:"modulepreload",href:e},t),Sn.set(d,e),s.querySelector(c)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(ho(d)))return}i=s.createElement("link"),kt(i,"link",e),jt(i),s.head.appendChild(i)}}}function C0(e,t,s){ha.S(e,t,s);var i=ci;if(i&&e){var c=ks(i).hoistableStyles,d=ui(e);t=t||"default";var g=c.get(d);if(!g){var v={loading:0,preload:null};if(g=i.querySelector(fo(d)))v.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Sn.get(d))&&Pu(e,s);var A=g=i.createElement("link");jt(A),kt(A,"link",e),A._p=new Promise(function(z,K){A.onload=z,A.onerror=K}),A.addEventListener("load",function(){v.loading|=1}),A.addEventListener("error",function(){v.loading|=2}),v.loading|=4,Il(g,t,i)}g={type:"stylesheet",instance:g,count:1,state:v},c.set(d,g)}}}function w0(e,t){ha.X(e,t);var s=ci;if(s&&e){var i=ks(s).hoistableScripts,c=di(e),d=i.get(c);d||(d=s.querySelector(ho(c)),d||(e=x({src:e,async:!0},t),(t=Sn.get(c))&&Uu(e,t),d=s.createElement("script"),jt(d),kt(d,"link",e),s.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},i.set(c,d))}}function N0(e,t){ha.M(e,t);var s=ci;if(s&&e){var i=ks(s).hoistableScripts,c=di(e),d=i.get(c);d||(d=s.querySelector(ho(c)),d||(e=x({src:e,async:!0,type:"module"},t),(t=Sn.get(c))&&Uu(e,t),d=s.createElement("script"),jt(d),kt(d,"link",e),s.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},i.set(c,d))}}function Gp(e,t,s,i){var c=(c=ne.current)?Hl(c):null;if(!c)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=ui(s.href),s=ks(c).hoistableStyles,i=s.get(t),i||(i={type:"style",instance:null,count:0,state:null},s.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=ui(s.href);var d=ks(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(fo(e)))&&!d._p&&(g.instance=d,g.state.loading=5),Sn.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Sn.set(e,s),d||j0(c,e,s,g.state))),t&&i===null)throw Error(l(528,""));return g}if(t&&i!==null)throw Error(l(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=di(s),s=ks(c).hoistableScripts,i=s.get(t),i||(i={type:"script",instance:null,count:0,state:null},s.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function ui(e){return'href="'+hn(e)+'"'}function fo(e){return'link[rel="stylesheet"]['+e+"]"}function Yp(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function j0(e,t,s,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),kt(t,"link",s),jt(t),e.head.appendChild(t))}function di(e){return'[src="'+hn(e)+'"]'}function ho(e){return"script[async]"+e}function Vp(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+hn(s.href)+'"]');if(i)return t.instance=i,jt(i),i;var c=x({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),jt(i),kt(i,"style",c),Il(i,s.precedence,e),t.instance=i;case"stylesheet":c=ui(s.href);var d=e.querySelector(fo(c));if(d)return t.state.loading|=4,t.instance=d,jt(d),d;i=Yp(s),(c=Sn.get(c))&&Pu(i,c),d=(e.ownerDocument||e).createElement("link"),jt(d);var g=d;return g._p=new Promise(function(v,A){g.onload=v,g.onerror=A}),kt(d,"link",i),t.state.loading|=4,Il(d,s.precedence,e),t.instance=d;case"script":return d=di(s.src),(c=e.querySelector(ho(d)))?(t.instance=c,jt(c),c):(i=s,(c=Sn.get(d))&&(i=x({},s),Uu(i,c)),e=e.ownerDocument||e,c=e.createElement("script"),jt(c),kt(c,"link",i),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&&(i=t.instance,t.state.loading|=4,Il(i,s.precedence,e));return t.instance}function Il(e,t,s){for(var i=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),c=i.length?i[i.length-1]:null,d=c,g=0;g<i.length;g++){var v=i[g];if(v.dataset.precedence===t)d=v;else if(d!==c)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function Pu(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,s){if(Bl===null){var i=new Map,c=Bl=new Map;c.set(s,i)}else c=Bl,i=c.get(s),i||(i=new Map,c.set(s,i));if(i.has(e))return i;for(i.set(e,null),s=s.getElementsByTagName(e),c=0;c<s.length;c++){var d=s[c];if(!(d[Mi]||d[Mt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var g=d.getAttribute(t)||"";g=e+g;var v=i.get(g);v?v.push(d):i.set(g,[d])}}return i}function Qp(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function A0(e,t,s){if(s===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 E0(e,t,s,i){if(s.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var c=ui(i.href),d=t.querySelector(fo(c));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ql.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=d,jt(d);return}d=t.ownerDocument||t,i=Yp(i),(c=Sn.get(c))&&Pu(i,c),d=d.createElement("link"),jt(d);var g=d;g._p=new Promise(function(v,A){g.onload=v,g.onerror=A}),kt(d,"link",i),s.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=ql.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var Hu=0;function M0(e,t){return e.stylesheets&&e.count===0&&Gl(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var i=setTimeout(function(){if(e.stylesheets&&Gl(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&Hu===0&&(Hu=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>Hu?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(c)}}:null}function ql(){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 Kl=null;function Gl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Kl=new Map,t.forEach(O0,e),Kl=null,ql.call(e))}function O0(e,t){if(!(t.state.loading&4)){var s=Kl.get(e);if(s)var i=s.get(null);else{s=new Map,Kl.set(e,s);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")&&(s.set(g.dataset.precedence,g),i=g)}i&&s.set(null,i)}c=t.instance,g=c.getAttribute("data-precedence"),d=s.get(g)||i,d===i&&s.set(null,c),s.set(g,c),this.count++,i=ql.bind(this),c.addEventListener("load",i),c.addEventListener("error",i),d?d.parentNode.insertBefore(c,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(c,e.firstChild)),t.state.loading|=4}}var mo={$$typeof:B,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function T0(e,t,s,i,c,d,g,v,A){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=i,this.onUncaughtError=c,this.onCaughtError=d,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function Wp(e,t,s,i,c,d,g,v,A,z,K,Y){return e=new T0(e,t,s,g,A,z,K,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:i,isDehydrated:s,cache:t},Cc(d),e}function Xp(e){return e?(e=qs,e):qs}function Zp(e,t,s,i,c,d){c=Xp(c),i.context===null?i.context=c:i.pendingContext=c,i=Oa(t),i.payload={element:s},d=d===void 0?null:d,d!==null&&(i.callback=d),s=Ta(e,i,t),s!==null&&(Yt(s,e,t),Yi(s,e,t))}function Jp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function Iu(e,t){Jp(e,t),(e=e.alternate)&&Jp(e,t)}function eg(e){if(e.tag===13||e.tag===31){var t=is(e,67108864);t!==null&&Yt(t,e,67108864),Iu(e,67108864)}}function tg(e){if(e.tag===13||e.tag===31){var t=on();t=$n(t);var s=is(e,t);s!==null&&Yt(s,e,t),Iu(e,t)}}var Yl=!0;function D0(e,t,s,i){var c=R.T;R.T=null;var d=W.p;try{W.p=2,Bu(e,t,s,i)}finally{W.p=d,R.T=c}}function k0(e,t,s,i){var c=R.T;R.T=null;var d=W.p;try{W.p=8,Bu(e,t,s,i)}finally{W.p=d,R.T=c}}function Bu(e,t,s,i){if(Yl){var c=qu(i);if(c===null)Eu(e,t,i,Vl,s),ag(e,i);else if(_0(c,e,t,s,i))i.stopPropagation();else if(ag(e,i),t&4&&-1<R0.indexOf(e)){for(;c!==null;){var d=Ds(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 A=1<<31-ve(g);v.entanglements[1]|=A,g&=~A}Pn(d),(Ge&6)===0&&(Ml=ft()+500,lo(0))}}break;case 31:case 13:v=is(d,2),v!==null&&Yt(v,d,2),Tl(),Iu(d,2)}if(d=qu(i),d===null&&Eu(e,t,i,Vl,s),d===c)break;c=d}c!==null&&i.stopPropagation()}else Eu(e,t,i,null,s)}}function qu(e){return e=Gr(e),Ku(e)}var Vl=null;function Ku(e){if(Vl=null,e=Ts(e),e!==null){var t=f(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=h(t),e!==null)return e;e=null}else if(s===31){if(e=m(t),e!==null)return e;e=null}else if(s===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 kn:case Rn:return 32;case Es:return 268435456;default:return 32}default:return 32}}var Gu=!1,Ba=null,qa=null,Ka=null,po=new Map,go=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":qa=null;break;case"mouseover":case"mouseout":Ka=null;break;case"pointerover":case"pointerout":po.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":go.delete(t.pointerId)}}function yo(e,t,s,i,c,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:s,eventSystemFlags:i,nativeEvent:d,targetContainers:[c]},t!==null&&(t=Ds(t),t!==null&&eg(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,c!==null&&t.indexOf(c)===-1&&t.push(c),e)}function _0(e,t,s,i,c){switch(t){case"focusin":return Ba=yo(Ba,e,t,s,i,c),!0;case"dragenter":return qa=yo(qa,e,t,s,i,c),!0;case"mouseover":return Ka=yo(Ka,e,t,s,i,c),!0;case"pointerover":var d=c.pointerId;return po.set(d,yo(po.get(d)||null,e,t,s,i,c)),!0;case"gotpointercapture":return d=c.pointerId,go.set(d,yo(go.get(d)||null,e,t,s,i,c)),!0}return!1}function sg(e){var t=Ts(e.target);if(t!==null){var s=f(t);if(s!==null){if(t=s.tag,t===13){if(t=h(s),t!==null){e.blockedOn=t,Ei(e.priority,function(){tg(s)});return}}else if(t===31){if(t=m(s),t!==null){e.blockedOn=t,Ei(e.priority,function(){tg(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.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 s=qu(e.nativeEvent);if(s===null){s=e.nativeEvent;var i=new s.constructor(s.type,s);Kr=i,s.target.dispatchEvent(i),Kr=null}else return t=Ds(s),t!==null&&eg(t),e.blockedOn=s,!1;t.shift()}return!0}function ig(e,t,s){Fl(e)&&s.delete(t)}function z0(){Gu=!1,Ba!==null&&Fl(Ba)&&(Ba=null),qa!==null&&Fl(qa)&&(qa=null),Ka!==null&&Fl(Ka)&&(Ka=null),po.forEach(ig),go.forEach(ig)}function Ql(e,t){e.blockedOn===t&&(e.blockedOn=null,Gu||(Gu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,z0)))}var $l=null;function og(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 s=e[t],i=e[t+1],c=e[t+2];if(typeof i!="function"){if(Ku(i||s)===null)continue;break}var d=Ds(s);d!==null&&(e.splice(t,3),t-=3,qc(d,{pending:!0,data:c,method:s.method,action:i},i,c))}}))}function fi(e){function t(A){return Ql(A,e)}Ba!==null&&Ql(Ba,e),qa!==null&&Ql(qa,e),Ka!==null&&Ql(Ka,e),po.forEach(t),go.forEach(t);for(var s=0;s<Ga.length;s++){var i=Ga[s];i.blockedOn===e&&(i.blockedOn=null)}for(;0<Ga.length&&(s=Ga[0],s.blockedOn===null);)sg(s),s.blockedOn===null&&Ga.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(i=0;i<s.length;i+=3){var c=s[i],d=s[i+1],g=c[Ht]||null;if(typeof d=="function")g||og(s);else if(g){var v=null;if(d&&d.hasAttribute("formAction")){if(c=d,g=d[Ht]||null)v=g.formAction;else if(Ku(c)!==null)continue}else v=g.action;typeof v=="function"?s[i+1]=v:(s.splice(i,3),i-=3),og(s)}}}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),i||setTimeout(s,20)}function s(){if(!i&&!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 i=!1,c=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){i=!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 s=t.current,i=on();Zp(s,i,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),Tl(),t[Os]=null}};function Wl(e){this._internalRoot=e}Wl.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ai();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Ga.length&&t!==0&&t<Ga[s].priority;s++);Ga.splice(s,0,e),s===0&&sg(e)}};var rg=a.version;if(rg!=="19.2.1")throw Error(l(527,rg,"19.2.1"));W.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 L0={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(L0),Z=Xl}catch{}}return vo.createRoot=function(e,t){if(!u(e))throw Error(l(299));var s=!1,i="",c=pm,d=gm,g=ym;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(i=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,s,i,null,c,d,g,lg),e[Os]=t.current,Au(e),new Yu(t)},vo.hydrateRoot=function(e,t,s){if(!u(e))throw Error(l(299));var i=!1,c="",d=pm,g=gm,v=ym,A=null;return s!=null&&(s.unstable_strictMode===!0&&(i=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onUncaughtError!==void 0&&(d=s.onUncaughtError),s.onCaughtError!==void 0&&(g=s.onCaughtError),s.onRecoverableError!==void 0&&(v=s.onRecoverableError),s.formState!==void 0&&(A=s.formState)),t=Wp(e,1,!0,t,s??null,i,c,A,d,g,v,lg),t.context=Xp(null),s=t.current,i=on(),i=$n(i),c=Oa(i),c.callback=null,Ta(s,c,i),s=i,t.current.lanes=s,wn(t,s),Pn(t),e[Os]=t.current,Au(e),new Wl(t)},vo.version="19.2.1",vo}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,o,l){let u=Promise.resolve();if(o&&o.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(o.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}}}),je=n=>typeof n=="string",bo=()=>{let n,a;const o=new Promise((l,u)=>{n=l,a=u});return o.resolve=n,o.reject=a,o},Cg=n=>n==null?"":""+n,ZC=(n,a,o)=>{n.forEach(l=>{a[l]&&(o[l]=a[l])})},JC=/###/g,wg=n=>n&&n.indexOf("###")>-1?n.replace(JC,"."):n,Ng=n=>!n||je(n),Eo=(n,a,o)=>{const l=je(a)?a.split("."):a;let u=0;for(;u<l.length-1;){if(Ng(n))return{};const f=wg(l[u]);!n[f]&&o&&(n[f]=new o),Object.prototype.hasOwnProperty.call(n,f)?n=n[f]:n={},++u}return Ng(n)?{}:{obj:n,k:wg(l[u])}},jg=(n,a,o)=>{const{obj:l,k:u}=Eo(n,a,Object);if(l!==void 0||a.length===1){l[u]=o;return}let f=a[a.length-1],h=a.slice(0,a.length-1),m=Eo(n,h,Object);for(;m.obj===void 0&&h.length;)f=`${h[h.length-1]}.${f}`,h=h.slice(0,h.length-1),m=Eo(n,h,Object),m?.obj&&typeof m.obj[`${m.k}.${f}`]<"u"&&(m.obj=void 0);m.obj[`${m.k}.${f}`]=o},ew=(n,a,o,l)=>{const{obj:u,k:f}=Eo(n,a,Object);u[f]=u[f]||[],u[f].push(o)},rr=(n,a)=>{const{obj:o,k:l}=Eo(n,a);if(o&&Object.prototype.hasOwnProperty.call(o,l))return o[l]},tw=(n,a,o)=>{const l=rr(n,o);return l!==void 0?l:rr(a,o)},Jy=(n,a,o)=>{for(const l in a)l!=="__proto__"&&l!=="constructor"&&(l in n?je(n[l])||n[l]instanceof String||je(a[l])||a[l]instanceof String?o&&(n[l]=a[l]):Jy(n[l],a[l],o):n[l]=a[l]);return n},vs=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var nw={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const aw=n=>je(n)?n.replace(/[&<>"'\/]/g,a=>nw[a]):n;class sw{constructor(a){this.capacity=a,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(a){const o=this.regExpMap.get(a);if(o!==void 0)return o;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 iw=[" ",",","?","!",";"],ow=new sw(20),lw=(n,a,o)=>{a=a||"",o=o||"";const l=iw.filter(h=>a.indexOf(h)<0&&o.indexOf(h)<0);if(l.length===0)return!0;const u=ow.getRegExp(`(${l.map(h=>h==="?"?"\\?":h).join("|")})`);let f=!u.test(n);if(!f){const h=n.indexOf(o);h>0&&!u.test(n.substring(0,h))&&(f=!0)}return f},gd=(n,a,o=".")=>{if(!n)return;if(n[a])return Object.prototype.hasOwnProperty.call(n,a)?n[a]:void 0;const l=a.split(o);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+=o),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},Ro=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,o={}){this.init(a,o)}init(a,o={}){this.prefix=o.prefix||"i18next:",this.logger=a||rw,this.options=o,this.debug=o.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,o,l,u){return u&&!this.debug?null:(je(a[0])&&(a[0]=`${l}${this.prefix} ${a[0]}`),this.logger[o](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 In=new cr;class jr{constructor(){this.observers={}}on(a,o){return a.split(" ").forEach(l=>{this.observers[l]||(this.observers[l]=new Map);const u=this.observers[l].get(o)||0;this.observers[l].set(o,u+1)}),this}off(a,o){if(this.observers[a]){if(!o){delete this.observers[a];return}this.observers[a].delete(o)}}emit(a,...o){this.observers[a]&&Array.from(this.observers[a].entries()).forEach(([u,f])=>{for(let h=0;h<f;h++)u(...o)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([u,f])=>{for(let h=0;h<f;h++)u.apply(u,[a,...o])})}}class Ag extends jr{constructor(a,o={ns:["translation"],defaultNS:"translation"}){super(),this.data=a||{},this.options=o,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 o=this.options.ns.indexOf(a);o>-1&&this.options.ns.splice(o,1)}getResource(a,o,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,o],l&&(Array.isArray(l)?m.push(...l):je(l)&&f?m.push(...l.split(f)):m.push(l)));const p=rr(this.data,m);return!p&&!o&&!l&&a.indexOf(".")>-1&&(a=m[0],o=m[1],l=m.slice(2).join(".")),p||!h||!je(l)?p:gd(this.data?.[a]?.[o],l,f)}addResource(a,o,l,u,f={silent:!1}){const h=f.keySeparator!==void 0?f.keySeparator:this.options.keySeparator;let m=[a,o];l&&(m=m.concat(h?l.split(h):l)),a.indexOf(".")>-1&&(m=a.split("."),u=o,o=m[1]),this.addNamespaces(o),jg(this.data,m,u),f.silent||this.emit("added",a,o,l,u)}addResources(a,o,l,u={silent:!1}){for(const f in l)(je(l[f])||Array.isArray(l[f]))&&this.addResource(a,o,f,l[f],{silent:!0});u.silent||this.emit("added",a,o,l)}addResourceBundle(a,o,l,u,f,h={silent:!1,skipCopy:!1}){let m=[a,o];a.indexOf(".")>-1&&(m=a.split("."),u=l,l=o,o=m[1]),this.addNamespaces(o);let p=rr(this.data,m)||{};h.skipCopy||(l=JSON.parse(JSON.stringify(l))),u?Jy(p,l,f):p={...p,...l},jg(this.data,m,p),h.silent||this.emit("added",a,o,l)}removeResourceBundle(a,o){this.hasResourceBundle(a,o)&&delete this.data[a][o],this.removeNamespaces(o),this.emit("removed",a,o)}hasResourceBundle(a,o){return this.getResource(a,o)!==void 0}getResourceBundle(a,o){return o||(o=this.options.defaultNS),this.getResource(a,o)}getDataByLanguage(a){return this.data[a]}hasLanguageSomeTranslations(a){const o=this.getDataByLanguage(a);return!!(o&&Object.keys(o)||[]).find(u=>o[u]&&Object.keys(o[u]).length>0)}toJSON(){return this.data}}var ex={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,a,o,l,u){return n.forEach(f=>{a=this.processors[f]?.process(a,o,l,u)??a}),a}};const tx=Symbol("i18next/PATH_KEY");function cw(){const n=[],a=Object.create(null);let o;return a.get=(l,u)=>(o?.revoke?.(),u===tx?n:(n.push(u),o=Proxy.revocable(l,a),o.proxy)),Proxy.revocable(Object.create(null),a).proxy}function yd(n,a){const{[tx]:o}=n(cw());return o.join(a?.keySeparator??".")}const Eg={},$u=n=>!je(n)&&typeof n!="boolean"&&typeof n!="number";class ur extends jr{constructor(a,o={}){super(),ZC(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],a,this),this.options=o,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=In.create("translator")}changeLanguage(a){a&&(this.language=a)}exists(a,o={interpolation:{}}){const l={...o};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,o){let l=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;l===void 0&&(l=":");const u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let f=o.ns||this.options.defaultNS||[];const h=l&&a.indexOf(l)>-1,m=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!lw(a,l,u);if(h&&!m){const p=a.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:a,namespaces:je(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:je(f)?[f]:f}}translate(a,o,l){let u=typeof o=="object"?{...o}:o;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 O=N?.usedKey||m,D=N?.exactUsedKey||m,M=["[object Number]","[object Function]","[object RegExp]"],I=u.joinArrays!==void 0?u.joinArrays:this.options.joinArrays,B=!this.i18nFormat||this.i18nFormat.handleAsObject,U=u.count!==void 0&&!je(u.count),k=ur.hasDefaultValue(u),j=U?this.pluralResolver.getSuffix(x,u.count,u):"",L=u.ordinal&&U?this.pluralResolver.getSuffix(x,u.count,{ordinal:!1}):"",X=U&&!u.ordinal&&u.count===0,F=X&&u[`defaultValue${this.options.pluralSeparator}zero`]||u[`defaultValue${j}`]||u[`defaultValue${L}`]||u.defaultValue;let Q=w;B&&!w&&k&&(Q=F);const ae=$u(Q),te=Object.prototype.toString.apply(Q);if(B&&Q&&ae&&M.indexOf(te)<0&&!(je(I)&&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(O,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?D:O;for(const R in Q)if(Object.prototype.hasOwnProperty.call(Q,R)){const W=`${Ce}${h}${R}`;k&&!w?de[R]=this.translate(W,{...u,defaultValue:$u(F)?F[R]:void 0,joinArrays:!1,ns:p}):de[R]=this.translate(W,{...u,joinArrays:!1,ns:p}),de[R]===W&&(de[R]=Q[R])}w=de}}else if(B&&je(I)&&Array.isArray(w))w=w.join(I),w&&(w=this.extendTranslation(w,a,u,l));else{let ye=!1,de=!1;!this.isValidLookup(w)&&k&&(ye=!0,w=F),this.isValidLookup(w)||(de=!0,w=m);const R=(u.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&de?void 0:w,W=k&&F!==w&&this.options.updateMissing;if(de||ye||W){if(this.logger.log(W?"updateKey":"missingKey",x,y,m,W?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 $=this.languageUtils.getFallbackCodes(this.options.fallbackLng,u.lng||this.language);if(this.options.saveMissingTo==="fallback"&&$&&$[0])for(let fe=0;fe<$.length;fe++)ee.push($[fe]);else this.options.saveMissingTo==="all"?ee=this.languageUtils.toResolveHierarchy(u.lng||this.language):ee.push(u.lng||this.language);const ce=(fe,Ne,V)=>{const J=k&&V!==w?V:R;this.options.missingKeyHandler?this.options.missingKeyHandler(fe,y,Ne,J,W,u):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(fe,y,Ne,J,W,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);X&&u[`defaultValue${this.options.pluralSeparator}zero`]&&Ne.indexOf(`${this.options.pluralSeparator}zero`)<0&&Ne.push(`${this.options.pluralSeparator}zero`),Ne.forEach(V=>{ce([fe],m+V,u[`defaultValue${V}`]||F)})}):ce(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,o,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=je(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&&!je(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: ${o[0]}`),null):this.translate(...x,o),l)),l.interpolation&&this.interpolator.reset()}const h=l.postProcess||this.options.postProcess,m=je(h)?[h]:h;return a!=null&&m?.length&&l.applyPostProcessor!==!1&&(a=ex.handle(m,a,o,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...u,usedParams:this.getUsedParamsDetails(l)},...l}:l,this)),a}resolve(a,o={}){let l,u,f,h,m;return je(a)&&(a=[a]),a.forEach(p=>{if(this.isValidLookup(l))return;const y=this.extractFromKey(p,o),C=y.key;u=C;let x=y.namespaces;this.options.fallbackNS&&(x=x.concat(this.options.fallbackNS));const b=o.count!==void 0&&!je(o.count),N=b&&!o.ordinal&&o.count===0,w=o.context!==void 0&&(je(o.context)||typeof o.context=="number")&&o.context!=="",O=o.lngs?o.lngs:this.languageUtils.toResolveHierarchy(o.lng||this.language,o.fallbackLng);x.forEach(D=>{this.isValidLookup(l)||(m=D,!Eg[`${O[0]}-${D}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(m)&&(Eg[`${O[0]}-${D}`]=!0,this.logger.warn(`key "${u}" for languages "${O.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!!!")),O.forEach(M=>{if(this.isValidLookup(l))return;h=M;const I=[C];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(I,C,M,D,o);else{let U;b&&(U=this.pluralResolver.getSuffix(M,o.count,o));const k=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(b&&(o.ordinal&&U.indexOf(j)===0&&I.push(C+U.replace(j,this.options.pluralSeparator)),I.push(C+U),N&&I.push(C+k)),w){const L=`${C}${this.options.contextSeparator||"_"}${o.context}`;I.push(L),b&&(o.ordinal&&U.indexOf(j)===0&&I.push(L+U.replace(j,this.options.pluralSeparator)),I.push(L+U),N&&I.push(L+k))}}let B;for(;B=I.pop();)this.isValidLookup(l)||(f=B,l=this.getResource(M,D,B,o))}))})}),{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,o,l,u={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(a,o,l,u):this.resourceStore.getResource(a,o,l,u)}getUsedParamsDetails(a={}){const o=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],l=a.replace&&!je(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 o)delete u[f]}return u}static hasDefaultValue(a){const o="defaultValue";for(const l in a)if(Object.prototype.hasOwnProperty.call(a,l)&&o===l.substring(0,o.length)&&a[l]!==void 0)return!0;return!1}}class Mg{constructor(a){this.options=a,this.supportedLngs=this.options.supportedLngs||!1,this.logger=In.create("languageUtils")}getScriptPartFromCode(a){if(a=Ro(a),!a||a.indexOf("-")<0)return null;const o=a.split("-");return o.length===2||(o.pop(),o[o.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(o.join("-"))}getLanguagePartFromCode(a){if(a=Ro(a),!a||a.indexOf("-")<0)return a;const o=a.split("-");return this.formatLanguageCode(o[0])}formatLanguageCode(a){if(je(a)&&a.indexOf("-")>-1){let o;try{o=Intl.getCanonicalLocales(a)[0]}catch{}return o&&this.options.lowerCaseLng&&(o=o.toLowerCase()),o||(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 o;return a.forEach(l=>{if(o)return;const u=this.formatLanguageCode(l);(!this.options.supportedLngs||this.isSupportedCode(u))&&(o=u)}),!o&&this.options.supportedLngs&&a.forEach(l=>{if(o)return;const u=this.getScriptPartFromCode(l);if(this.isSupportedCode(u))return o=u;const f=this.getLanguagePartFromCode(l);if(this.isSupportedCode(f))return o=f;o=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})}),o||(o=this.getFallbackCodes(this.options.fallbackLng)[0]),o}getFallbackCodes(a,o){if(!a)return[];if(typeof a=="function"&&(a=a(o)),je(a)&&(a=[a]),Array.isArray(a))return a;if(!o)return a.default||[];let l=a[o];return l||(l=a[this.getScriptPartFromCode(o)]),l||(l=a[this.formatLanguageCode(o)]),l||(l=a[this.getLanguagePartFromCode(o)]),l||(l=a.default),l||[]}toResolveHierarchy(a,o){const l=this.getFallbackCodes((o===!1?[]:o)||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 je(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))):je(a)&&f(this.formatLanguageCode(a)),l.forEach(h=>{u.indexOf(h)<0&&f(this.formatLanguageCode(h))}),u}}const Og={zero:0,one:1,two:2,few:3,many:4,other:5},Tg={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class uw{constructor(a,o={}){this.languageUtils=a,this.options=o,this.logger=In.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(a,o={}){const l=Ro(a==="dev"?"en":a),u=o.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!"),Tg;if(!a.match(/-|_/))return Tg;const p=this.languageUtils.getLanguagePartFromCode(a);h=this.getRule(p,o)}return this.pluralRulesCache[f]=h,h}needsPlural(a,o={}){let l=this.getRule(a,o);return l||(l=this.getRule("dev",o)),l?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(a,o,l={}){return this.getSuffixes(a,l).map(u=>`${o}${u}`)}getSuffixes(a,o={}){let l=this.getRule(a,o);return l||(l=this.getRule("dev",o)),l?l.resolvedOptions().pluralCategories.sort((u,f)=>Og[u]-Og[f]).map(u=>`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${u}`):[]}getSuffix(a,o,l={}){const u=this.getRule(a,l);return u?`${this.options.prepend}${l.ordinal?`ordinal${this.options.prepend}`:""}${u.select(o)}`:(this.logger.warn(`no plural rule found for: ${a}`),this.getSuffix("dev",o,l))}}const Dg=(n,a,o,l=".",u=!0)=>{let f=tw(n,a,o);return!f&&u&&je(o)&&(f=gd(n,o,l),f===void 0&&(f=gd(a,o,l))),f},Wu=n=>n.replace(/\$/g,"$$$$");class kg{constructor(a={}){this.logger=In.create("interpolator"),this.options=a,this.format=a?.interpolation?.format||(o=>o),this.init(a)}init(a={}){a.interpolation||(a.interpolation={escapeValue:!0});const{escape:o,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:O,nestingOptionsSeparator:D,maxReplaces:M,alwaysFormat:I}=a.interpolation;this.escape=o!==void 0?o:aw,this.escapeValue=l!==void 0?l:!0,this.useRawValueToEscape=u!==void 0?u:!1,this.prefix=f?vs(f):h||"{{",this.suffix=m?vs(m):p||"}}",this.formatSeparator=y||",",this.unescapePrefix=C?"":x||"-",this.unescapeSuffix=this.unescapePrefix?"":C||"",this.nestingPrefix=b?vs(b):N||vs("$t("),this.nestingSuffix=w?vs(w):O||vs(")"),this.nestingOptionsSeparator=D||",",this.maxReplaces=M||1e3,this.alwaysFormat=I!==void 0?I:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const a=(o,l)=>o?.source===l?(o.lastIndex=0,o):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,o,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=Dg(o,p,N,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(M,void 0,l,{...u,...o,interpolationkey:N}):M}const w=N.split(this.formatSeparator),O=w.shift().trim(),D=w.join(this.formatSeparator).trim();return this.format(Dg(o,p,O,this.options.keySeparator,this.options.ignoreJSONStructure),D,l,{...u,...o,interpolationkey:O})};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 D=C(a,f,u);h=je(D)?D:""}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!je(h)&&!this.useRawValueToEscape&&(h=Cg(h));const O=N.safeValue(h);if(a=a.replace(f[0],O),x?(N.regex.lastIndex+=h.length,N.regex.lastIndex-=f[0].length):N.regex.lastIndex=0,m++,m>=this.maxReplaces)break}}),a}nest(a,o,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(`${vs(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(O){return this.logger.warn(`failed parsing options string in nesting for key ${p}`,O),`${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&&!je(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=o(m.call(this,u[1].trim(),h),h),f&&u[0]===a&&!je(f))return f;je(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 o={};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?o.currency||(o.currency=u.trim()):a==="relativetime"&&u.indexOf(":")<0?o.range||(o.range=u.trim()):u.split(";").forEach(h=>{if(h){const[m,...p]=h.split(":"),y=p.join(":").trim().replace(/^'+|'+$/g,""),C=m.trim();o[C]||(o[C]=y),y==="false"&&(o[C]=!1),y==="true"&&(o[C]=!0),isNaN(y)||(o[C]=parseInt(y,10))}})}return{formatName:a,formatOptions:o}},Rg=n=>{const a={};return(o,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(Ro(l),u),a[h]=m),m(o)}},fw=n=>(a,o,l)=>n(Ro(o),l)(a);class hw{constructor(a={}){this.logger=In.create("formatter"),this.options=a,this.init(a)}init(a,o={interpolation:{}}){this.formatSeparator=o.interpolation.formatSeparator||",";const l=o.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,o){this.formats[a.toLowerCase().trim()]=o}addCached(a,o){this.formats[a.toLowerCase().trim()]=Rg(o)}format(a,o,l,u={}){const f=o.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 jr{constructor(a,o,l,u={}){super(),this.backend=a,this.store=o,this.services=l,this.languageUtils=l.languageUtils,this.options=u,this.logger=In.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,o,l,u){const f={},h={},m={},p={};return a.forEach(y=>{let C=!0;o.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,o,l){const u=a.split("|"),f=u[0],h=u[1];o&&this.emit("failedLoading",f,h,o),!o&&l&&this.store.addResourceBundle(f,h,l,void 0,void 0,{skipCopy:!0}),this.state[a]=o?-1:2,o&&l&&(this.state[a]=0);const m={};this.queue.forEach(p=>{ew(p.loaded,[f],h),mw(p,a),o&&p.errors.push(o),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,o,l,u=0,f=this.retryTimeout,h){if(!a.length)return h(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:a,ns:o,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,o,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,o);y&&typeof y.then=="function"?y.then(C=>m(null,C)).catch(m):m(null,y)}catch(y){m(y)}return}return p(a,o,m)}prepareLoading(a,o,l={},u){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),u&&u();je(a)&&(a=this.languageUtils.toResolveHierarchy(a)),je(o)&&(o=[o]);const f=this.queueLoad(a,o,l,u);if(!f.toLoad.length)return f.pending.length||u(),null;f.toLoad.forEach(h=>{this.loadOne(h)})}load(a,o,l){this.prepareLoading(a,o,{},l)}reload(a,o,l){this.prepareLoading(a,o,{reload:!0},l)}loadOne(a,o=""){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(`${o}loading namespace ${f} for language ${u} failed`,h),!h&&m&&this.logger.log(`${o}loaded namespace ${f} for language ${u}`,m),this.loaded(a,h,m)})}saveMissing(a,o,l,u,f,h={},m=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(o)){this.logger.warn(`did not save key "${l}" as the namespace "${o}" 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,o,l,u,p):C=y(a,o,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,o,l,u,m,p)}!a||!a[0]||this.store.addResource(a[0],o,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]),je(n[1])&&(a.defaultValue=n[1]),je(n[2])&&(a.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const o=n[3]||n[2];Object.keys(o).forEach(l=>{a[l]=o[l]})}return a},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),_g=n=>(je(n.ns)&&(n.ns=[n.ns]),je(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),je(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(o=>{typeof n[o]=="function"&&(n[o]=n[o].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 Mo extends jr{constructor(a={},o){if(super(),this.options=_g(a),this.services={},this.logger=In,this.modules={external:[]},gw(this),o&&!this.isInitialized&&!a.isClone){if(!this.options.initAsync)return this.init(a,o),this;setTimeout(()=>{this.init(a,o)},0)}}init(a={},o){this.isInitializing=!0,typeof a=="function"&&(o=a,a={}),a.defaultNS==null&&a.ns&&(je(a.ns)?a.defaultNS=a.ns:a.ns.indexOf("translation")<0&&(a.defaultNS=a.ns[0]));const l=Xu();this.options={...l,...this.options,..._g(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?In.init(u(this.modules.logger),this.options):In.init(null,this.options);let y;this.modules.formatter?y=this.modules.formatter:y=hw;const C=new Mg(this.options);this.store=new Ag(this.options.resources,this.options);const x=this.services;x.logger=In,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 kg(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,o||(o=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=bo(),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),o(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,o=Zl){let l=o;const u=je(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,o,l){const u=bo();return typeof a=="function"&&(l=a,a=void 0),typeof o=="function"&&(l=o,o=void 0),a||(a=this.languages),o||(o=this.options.ns),l||(l=Zl),this.services.backendConnector.reload(a,o,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 o=0;o<this.languages.length;o++){const l=this.languages[o];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,o){this.isLanguageChangingTo=a;const l=bo();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)),o&&o(m,(...y)=>this.t(...y))},h=m=>{!a&&!m&&this.services.languageDetector&&(m=[]);const p=je(m)?m:m&&m[0],y=this.store.hasLanguageSomeTranslations(p)?p:this.services.languageUtils.getBestMatchFromCodes(je(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,o,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 je(a)?u.lng=a:u.lngs=a,u.ns=o,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,o={}){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=o.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(o.precheck){const m=o.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,o){const l=bo();return this.options.ns?(je(a)&&(a=[a]),a.forEach(u=>{this.options.ns.indexOf(u)<0&&this.options.ns.push(u)}),this.loadResources(u=>{l.resolve(),o&&o(u)}),l):(o&&o(),Promise.resolve())}loadLanguages(a,o){const l=bo();je(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(),o&&o(h)}),l):(o&&o(),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 o=["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 Mg(Xu());return a.toLowerCase().indexOf("-latn")>1?"ltr":o.indexOf(l.getLanguagePartFromCode(a))>-1||a.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(a={},o){const l=new Mo(a,o);return l.createInstance=Mo.createInstance,l}cloneInstance(a={},o=Zl){const l=a.forkResourceStore;l&&delete a.forkResourceStore;const u={...this.options,...a,isClone:!0},f=new Mo(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 Ag(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 kg(y)}return f.translator=new ur(f.services,u),f.translator.on("*",(m,...p)=>{f.emit(m,...p)}),f.init(u,o),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=Mo.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,o,l)=>{const u=[o,{code:a,...l||{}}];if(n?.services?.logger?.forward)return n.services.logger.forward(u,"warn","react-i18next::",!0);Ns(u[0])&&(u[0]=`react-i18next:: ${u[0]}`),n?.services?.logger?.warn?n.services.logger.warn(...u):console?.warn&&console.warn(...u)},zg={},ax=(n,a,o,l)=>{Ns(o)&&zg[o]||(Ns(o)&&(zg[o]=new Date),bw(n,a,o,l))},sx=(n,a)=>()=>{if(n.isInitialized)a();else{const o=()=>{setTimeout(()=>{n.off("initialized",o)},0),a()};n.on("initialized",o)}},xd=(n,a,o)=>{n.loadNamespaces(a,sx(n,o))},Lg=(n,a,o,l)=>{if(Ns(o)&&(o=[o]),n.options.preload&&n.options.preload.indexOf(a)>-1)return xd(n,o,l);o.forEach(u=>{n.options.ns.indexOf(u)<0&&n.options.ns.push(u)}),n.loadLanguages(a,sx(n,l))},Sw=(n,a,o={})=>!a.languages||!a.languages.length?(ax(a,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:a.languages}),!0):a.hasLoadedNamespace(n,{lng:o.lng,precheck:(l,u)=>{if(o.bindI18n&&o.bindI18n.indexOf("languageChanging")>-1&&l.services.backendConnector.backend&&l.isLanguageChangingTo&&!u(l.isLanguageChangingTo,n))return!1}}),Ns=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;":"/"},jw=n=>Nw[n],Aw=n=>n.replace(ww,jw);let vd={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Aw,transDefaultProps:void 0};const Ew=(n={})=>{vd={...vd,...n}},Mw=()=>vd;let ix;const Ow=n=>{ix=n},Tw=()=>ix,Dw={type:"3rdParty",init(n){Ew(n.options.react),Ow(n)}},kw=S.createContext();class Rw{constructor(){this.usedNamespaces={}}addUsedNamespaces(a){a.forEach(o=>{this.usedNamespaces[o]||(this.usedNamespaces[o]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Zu={exports:{}},Ju={};var Pg;function _w(){if(Pg)return Ju;Pg=1;var n=Md();function a(x,b){return x===b&&(x!==0||1/x===1/b)||x!==x&&b!==b}var o=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}}),O=w[0].inst,D=w[1];return f(function(){O.value=N,O.getSnapshot=b,p(O)&&D({inst:O})},[x,N,b]),u(function(){return p(O)&&D({inst:O}),x(function(){p(O)&&D({inst:O})})},[x]),h(N),N}function p(x){var b=x.getSnapshot;x=x.value;try{var N=b();return!o(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 zw(){return Ug||(Ug=1,Zu.exports=_w()),Zu.exports}var Lw=zw();const Pw=(n,a)=>Ns(a)?a:Cw(a)&&Ns(a.defaultValue)?a.defaultValue:Array.isArray(n)?n[n.length-1]:n,Uw={t:Pw,ready:!1},Hw=()=>()=>{},Lt=(n,a={})=>{const{i18n:o}=a,{i18n:l,defaultNS:u}=S.useContext(kw)||{},f=o||l||Tw();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(()=>({...Mw(),...f?.options?.react,...a}),[f,a]),{useSuspense:m,keyPrefix:p}=h,y=u||f?.options?.defaultNS,C=Ns(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 Hw;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(),O=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]),[D,M]=S.useState(0),{t:I,ready:B}=Lw.useSyncExternalStore(N,O,O);S.useEffect(()=>{if(f&&!B&&!m){const F=()=>M(Q=>Q+1);a.lng?Lg(f,a.lng,x,F):xd(f,x,F)}},[f,a.lng,x,B,m,D]);const U=f||{},k=S.useRef(null),j=S.useRef(),L=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},X=S.useMemo(()=>{const F=U,Q=F?.language;let ae=F;F&&(k.current&&k.current.__original===F?j.current!==Q?(ae=L(F),k.current=ae,j.current=Q):ae=k.current:(ae=L(F),k.current=ae,j.current=Q));const te=[I,ae,B];return te.t=I,te.i18n=ae,te.ready=B,te},[I,U,B,U.resolvedLanguage,U.language,U.languages]);if(f&&m&&!B)throw new Promise(F=>{const Q=()=>F();a.lng?Lg(f,a.lng,x,Q):xd(f,x,Q)});return X},ox="ccs-ui-locale",Iw=["en","zh-CN"];function Po(n){return n&&n.toLowerCase().startsWith("zh")?"zh-CN":"en"}function lx(){if(typeof window>"u")return null;try{const n=window.localStorage.getItem(ox);return n?Po(n):null}catch{return null}}function Bw(){const n=lx();return n||(typeof navigator<"u"?Po(navigator.language):"en")}function zd(n){const a=lx();return a||(typeof navigator<"u"?Po(navigator.language):"en")}function qw(n){const a=Po(n);if(typeof window<"u")try{window.localStorage.setItem(ox,a)}catch{}return a}const Kw={en:{translation:{locale:{en:"English","zh-CN":"Simplified Chinese"},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:"349+ models via OpenRouter"},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-5",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"},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",lastChecked:"Last checked {{time}}",notRunning:"Not running",start:"Start",port:"Port {{port}}",sessionCount:"{{count}} session",sessionCount_other:"{{count}} sessions",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":"简体中文"},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 提供 349+ 模型"},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-5",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 配置"},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}} 的版本存在已知问题",lastChecked:"上次检查 {{time}}",notRunning:"未运行",start:"启动",port:"端口 {{port}}",sessionCount:"{{count}} 个会话",sessionCount_other:"{{count}} 个会话",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 内容。"}}}};ct.isInitialized||ct.use(Dw).init({resources:Kw,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:o="vite-ui-theme"}){const[l,u]=S.useState(()=>localStorage.getItem(o)||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(o,y),u(y)},isDark:m};return r.jsx(rx.Provider,{value:p,children:n})}const cx=S.createContext(null),Hg="ccs-privacy-mode";function Vw({children:n}){const[a,o]=S.useState(()=>typeof window<"u"?localStorage.getItem(Hg)==="true":!1);S.useEffect(()=>{localStorage.setItem(Hg,String(a))},[a]);const l=S.useCallback(()=>o(f=>!f),[]),u=S.useMemo(()=>({privacyMode:a,togglePrivacyMode:l}),[a,l]);return r.jsx(cx.Provider,{value:u,children:n})}function Ld(){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 Pd(n,a){const o=await fetch(`${Fw}${n}`,{headers:{"Content-Type":"application/json"},credentials:"include",...a});if(!o.ok){const l=await o.json().catch(()=>({error:"Unknown error"}));throw new Error(l.error||o.statusText)}return o.json()}function Qw(){return Pd("/check")}function $w(n,a){return Pd("/login",{method:"POST",body:JSON.stringify({username:n,password:a})})}function Ww(){return Pd("/logout",{method:"POST"})}const dx=S.createContext(null);function Xw({children:n}){const[a,o]=S.useState(!1),[l,u]=S.useState(!1),[f,h]=S.useState(null),[m,p]=S.useState(!0);S.useEffect(()=>{Qw().then(b=>{o(b.authRequired),u(b.authenticated),h(b.username)}).catch(()=>{o(!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:o}=Ud(),l=gr();return o?r.jsx("div",{className:"flex h-screen items-center justify-center",children:r.jsx(Tn,{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 o=window.matchMedia(`(max-width: ${ed-1}px)`),l=()=>{a(window.innerWidth<ed)};return o.addEventListener("change",l),a(window.innerWidth<ed),()=>o.removeEventListener("change",l)},[]),!!n}const fx=S.createContext(null);function Ar(){const n=S.useContext(fx);if(!n)throw new Error("useSidebar must be used within a SidebarProvider.");return n}function q(...n){return sC(iC(n))}function hx(n){if(!Number.isFinite(n))return"0";const a=Math.max(0,Math.min(100,n));return`${Math.round(a)}`}const Ig=["#f94144","#f3722c","#f8961e","#f9844a","#f9c74f","#90be6d","#43aa8b","#4d908e","#577590","#277da1"],Ft={success:"#15803d",degraded:"#b45309",failed:"#b91c1c"};function eT(n){let a=2166136261;for(let o=0;o<n.length;o++)a^=n.charCodeAt(o),a=Math.imul(a,16777619);return Ig[(a>>>0)%Ig.length]}function bd(n){if(!n)return null;try{const a=new Date(n),o=new Date,l=a.getTime()-o.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 Hd(n){return n.filter(a=>{const o=(a.displayName||a.name||"").toLowerCase();return o.includes("claude")||o.includes("gpt")})}function eN(n){if(n.length===0)return null;const a=Hd(n);if(a.length===0)return 0;const o=a.map(l=>l.percentage).filter(l=>typeof l=="number"&&isFinite(l));return o.length===0?0:Math.min(...o)}function tN(n){if(n.length===0)return null;const a=Hd(n);return a.length===0?null:a.reduce((o,l)=>l.resetTime?o?new Date(l.resetTime)<new Date(o)?l.resetTime:o:l.resetTime:o,null)}const nN=[{name:"claude-opus-4-5-thinking",displayName:"Claude Opus 4.5 (Thinking)"},{name:"claude-sonnet-4-5",displayName:"Claude Sonnet 4.5"},{name:"claude-sonnet-4-5-thinking",displayName:"Claude Sonnet 4.5 (Thinking)"},{name:"gpt-oss-120b",displayName:"GPT-OSS 120B (Medium)"}];function aN(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 sN(n){if(n.length===0)return[];const a=Hd(n),o=[];if(a.length===0)for(const u of nN)o.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=aN(f);o.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 o.sort((u,f)=>{const h=l.indexOf(u.tier)-l.indexOf(f.tier);return h!==0?h:u.displayName.localeCompare(f.displayName)})}function iN(n){const a=new Map;for(const o of n){const l=a.get(o.tier)||[];l.push(o),a.set(o.tier,l)}return a}function Oo(n){const a=(n||"").toLowerCase(),o=a.includes("code review")||a.includes("code_review"),l=a.includes("primary"),u=a.includes("secondary");return o?l?"code-review-5h":u?"code-review-weekly":"code-review":l?"usage-5h":u?"usage-weekly":"unknown"}function oN(n,a){if(Oo(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=>Oo(p.label)==="usage-5h"&&typeof p.resetAfterSeconds=="number"&&isFinite(p.resetAfterSeconds)&&p.resetAfterSeconds>0),f=a.find(p=>Oo(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 lN(n,a=[]){const o=typeof n=="string"?n:n.label,l=typeof n=="string"?{label:o,resetAfterSeconds:null}:{label:o,resetAfterSeconds:n.resetAfterSeconds},u=a.length>0?a:[l];switch(Oo(o)){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=oN(l,u);return f==="5h"?"Code review (5h)":f==="weekly"?"Code review (weekly)":"Code review"}case"unknown":return o}}function Er(n){if(!n||n.length===0)return{fiveHourWindow:null,weeklyWindow:null,codeReviewWindows:[],unknownWindows:[]};let a=null,o=null;const l=[],u=[],f=[];for(const h of n)switch(Oo(h.label)){case"usage-5h":a||(a=h),f.push(h);break;case"usage-weekly":o||(o=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||!o)&&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),o||(o=h.length>1?h[h.length-1]:f.find(m=>m!==a)||null)}return{fiveHourWindow:a,weeklyWindow:o,codeReviewWindows:l,unknownWindows:u}}function rN(n){if(!n||n.length===0)return null;const{fiveHourWindow:a,weeklyWindow:o}=Er(n),l=[a,o].filter((h,m,p)=>!!h&&p.indexOf(h)===m),f=(l.length>0?l:n).map(h=>h.remainingPercent);return Math.min(...f)}function cN(n){if(!n||n.length===0)return null;const{fiveHourWindow:a,weeklyWindow:o}=Er(n),l=[a,o].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 uN(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 o=n.windows.filter(l=>l.rateLimitType!=="overage");return o.length>0?Math.min(...o.map(l=>l.remainingPercent)):null}function dN(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 o=n.windows.filter(l=>l.rateLimitType!=="overage").map(l=>l.resetAt).filter(l=>l!==null);return o.length===0?null:o.sort()[0]}function fN(n){if(!n||n.length===0)return null;const a=n.map(o=>o.remainingPercent);return Math.min(...a)}function hN(n){if(!n||n.length===0)return null;const a=n.map(o=>o.resetTime).filter(o=>o!==null);return a.length===0?null:a.sort()[0]}function mN(n){if(!n)return null;const a=[n.premiumInteractions.percentRemaining,n.chat.percentRemaining,n.completions.percentRemaining].filter(o=>typeof o=="number"&&isFinite(o));return a.length===0?null:Math.min(...a)}function qn(n){return typeof n=="object"&&n!==null}function js(n){return typeof n=="number"&&Number.isFinite(n)}function Id(n){if(!qn(n))return!1;const a=n.models;return typeof n.success=="boolean"&&Array.isArray(a)}function Mr(n){if(!qn(n))return!1;const a=n;return typeof a.success!="boolean"||!Array.isArray(a.windows)||!("planType"in a)?!1:a.windows.every(o=>qn(o)&&typeof o.label=="string"&&js(o.usedPercent)&&js(o.remainingPercent))}function Or(n){if(!qn(n))return!1;const a=n;return typeof a.success!="boolean"||!Array.isArray(a.windows)||"planType"in a?!1:a.windows.every(o=>qn(o)&&typeof o.rateLimitType=="string"&&js(o.remainingPercent)&&typeof o.status=="string")}function Bd(n){if(!qn(n))return!1;const a=n;return typeof a.success!="boolean"||!Array.isArray(a.buckets)?!1:a.buckets.every(o=>qn(o)&&typeof o.id=="string"&&js(o.remainingFraction)&&js(o.remainingPercent)&&Array.isArray(o.modelIds))}function qd(n){if(!qn(n))return!1;const a=n,o=a.snapshots;return typeof a.success!="boolean"||!qn(o)?!1:["premiumInteractions","chat","completions"].every(u=>{const f=o[u];return qn(f)&&js(f.percentRemaining)&&js(f.percentUsed)})}function pN(n,a){if(!a?.success)return null;switch(n.trim().toLowerCase()){case"agy":return Id(a)?eN(a.models):null;case"codex":return Mr(a)?rN(a.windows):null;case"claude":case"anthropic":return Or(a)?uN(a):null;case"gemini":return Bd(a)?fN(a.buckets):null;case"ghcp":case"github-copilot":return qd(a)?mN(a.snapshots):null;default:return null}}function gN(n,a){if(!a?.success)return null;switch(n.trim().toLowerCase()){case"agy":return Id(a)?tN(a.models):null;case"codex":return Mr(a)?cN(a.windows):null;case"claude":case"anthropic":return Or(a)?dN(a):null;case"gemini":return Bd(a)?hN(a.buckets):null;case"ghcp":case"github-copilot":return qd(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:o,asChild:l=!1,...u}){const f=l?pr:"button";return r.jsx(f,{"data-slot":"button",className:q(ar({variant:a,size:o,className:n})),...u})}function Un({className:n,type:a,...o}){return r.jsx("input",{type:a,"data-slot":"input",className:q("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),...o})}function yN({...n}){return r.jsx(jy,{"data-slot":"sheet",...n})}function xN({...n}){return r.jsx(Ty,{"data-slot":"sheet-portal",...n})}function vN({className:n,...a}){return r.jsx(Dy,{"data-slot":"sheet-overlay",className:q("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 bN({className:n,children:a,side:o="right",...l}){return r.jsxs(xN,{children:[r.jsx(vN,{}),r.jsxs(Ay,{"data-slot":"sheet-content",className:q("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",o==="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",o==="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",o==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",o==="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(Ey,{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(vi,{className:"size-4"}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function SN({className:n,...a}){return r.jsx("div",{"data-slot":"sheet-header",className:q("flex flex-col gap-1.5 p-4",n),...a})}function CN({className:n,...a}){return r.jsx(My,{"data-slot":"sheet-title",className:q("text-foreground font-semibold",n),...a})}function wN({className:n,...a}){return r.jsx(Oy,{"data-slot":"sheet-description",className:q("text-muted-foreground text-sm",n),...a})}function qe({className:n,...a}){return r.jsx("div",{"data-slot":"skeleton",className:q("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 Cs({delayDuration:n=0,...a}){return r.jsx(U0,{"data-slot":"tooltip-provider",delayDuration:n,...a})}function $a({...n}){return r.jsx(Cs,{children:r.jsx(H0,{"data-slot":"tooltip",...n})})}function Wa({...n}){return r.jsx(I0,{"data-slot":"tooltip-trigger",...n})}function Xa({className:n,sideOffset:a=0,children:o,...l}){return r.jsx(B0,{children:r.jsxs(q0,{"data-slot":"tooltip-content",sideOffset:a,className:q("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:[o,r.jsx(K0,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const NN="sidebar_state",jN=3600*24*7,AN="16rem",EN="18rem",MN="3rem",ON="b";function TN({defaultOpen:n=!0,open:a,onOpenChange:o,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 I=typeof M=="function"?M(b):M;o?o(I):x(I),document.cookie=`${NN}=${I}; path=/; max-age=${jN}`},[o,b]),w=S.useCallback(()=>m?y(M=>!M):N(M=>!M),[m,N,y]);S.useEffect(()=>{const M=I=>{I.key===ON&&(I.metaKey||I.ctrlKey)&&(I.preventDefault(),w())};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[w]);const O=b?"expanded":"collapsed",D=S.useMemo(()=>({state:O,open:b,setOpen:N,isMobile:m,openMobile:p,setOpenMobile:y,toggleSidebar:w}),[O,b,N,m,p,y,w]);return r.jsx(fx.Provider,{value:D,children:r.jsx(Cs,{delayDuration:0,children:r.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":AN,"--sidebar-width-icon":MN,...u},className:q("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-svh min-h-0 w-full overflow-hidden",l),...h,children:f})})})}function DN({side:n="left",variant:a="sidebar",collapsible:o="offcanvas",className:l,children:u,...f}){const{isMobile:h,state:m,openMobile:p,setOpenMobile:y}=Ar();return o==="none"?r.jsx("div",{"data-slot":"sidebar",className:q("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",l),...f,children:u}):h?r.jsx(yN,{open:p,onOpenChange:y,...f,children:r.jsxs(bN,{"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":EN},side:n,children:[r.jsxs(SN,{className:"sr-only",children:[r.jsx(CN,{children:"Sidebar"}),r.jsx(wN,{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"?o:"","data-variant":a,"data-side":n,"data-slot":"sidebar",children:[r.jsx("div",{"data-slot":"sidebar-gap",className:q("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:q("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 kN({className:n,onClick:a,...o}){const{toggleSidebar:l}=Ar();return r.jsxs(ut,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:q("size-7",n),onClick:u=>{a?.(u),l()},...o,children:[r.jsx(jS,{}),r.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function RN({className:n,...a}){return r.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:q("flex flex-col gap-2 p-2",n),...a})}function _N({className:n,...a}){return r.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:q("flex flex-col gap-2 p-2",n),...a})}function zN({className:n,...a}){return r.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:q("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",n),...a})}function LN({className:n,...a}){return r.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:q("relative flex w-full min-w-0 flex-col p-2",n),...a})}function PN({className:n,asChild:a=!1,...o}){const l=a?pr:"div";return r.jsx(l,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:q("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),...o})}function UN({className:n,...a}){return r.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:q("w-full text-sm",n),...a})}function HN({className:n,...a}){return r.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:q("flex w-full min-w-0 flex-col gap-1 group-data-[collapsible=icon]:items-center",n),...a})}function IN({className:n,...a}){return r.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:q("group/menu-item relative",n),...a})}const BN=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:o="default",size:l="default",tooltip:u,className:f,...h}){const m=n?pr:"button",{isMobile:p,state:y}=Ar(),C=r.jsx(m,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":l,"data-active":a,className:q(BN({variant:o,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:q("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 KN({className:n,...a}){return r.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:q("group/menu-sub-item relative",n),...a})}function GN({asChild:n=!1,size:a="md",isActive:o=!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":o,className:q("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 YN={sm:24,md:32,lg:48};function mx({size:n="md",className:a,showText:o=!0}){const l=YN[n];return r.jsxs("div",{className:q("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"}),o&&r.jsx("span",{className:"font-bold text-lg",children:"CCS Config"})]})}const Jl="/api",px="CONFLICT";class tT extends Error{code=px;constructor(a="Resource modified externally"){super(a),this.name="ApiConflictError"}}function nT(n){return n instanceof Error&&"code"in n&&n.code===px}function wo(n){return n?/^https?:\/\//i.test(n)||n===Jl||n.startsWith(`${Jl}/`)?n:`${Jl}${n.startsWith("/")?n:`/${n}`}`:Jl}async function VN(n){const a=`Request failed (${n.status}${n.statusText?` ${n.statusText}`:""})`,o=await n.text();if(!o)return a;try{const l=JSON.parse(o);return l.error?.trim()?l.error:l.message?.trim()?l.message:a}catch{return o.trim()||a}}async function ge(n,a){const o=await fetch(wo(n),{headers:{"Content-Type":"application/json"},...a});if(!o.ok)throw new Error(await VN(o));if(o.status===204)return;if((o.headers.get("content-type")?.toLowerCase()??"").includes("application/json"))return await o.json();const u=await o.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(wo("/cliproxy/config.yaml"));if(!n.ok)throw new Error("Failed to load config");return n.text()},saveConfigYaml:async n=>{const a=await fetch(wo("/cliproxy/config.yaml"),{method:"PUT",headers:{"Content-Type":"application/yaml"},body:n});if(!a.ok){const o=await a.json().catch(()=>({error:"Failed to save config"}));throw new Error(o.error||"Failed to save config")}},getAuthFiles:()=>ge("/cliproxy/auth-files"),getAuthFile:async n=>{const a=await fetch(wo(`/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(wo(`/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 aT(){return Et({queryKey:["cliproxy"],queryFn:()=>Qe.cliproxy.list()})}function FN(){return Et({queryKey:["cliproxy-auth"],queryFn:()=>Qe.cliproxy.getAuthStatus()})}function sT(){const n=dt();return pt({mutationFn:a=>Qe.cliproxy.create(a),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy"]}),re.success("Variant created successfully")},onError:a=>{re.error(a.message)}})}function iT(){const n=dt();return pt({mutationFn:a=>Qe.cliproxy.delete(a),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy"]}),re.success("Variant deleted successfully")},onError:a=>{re.error(a.message)}})}function oT(){const n=dt();return pt({mutationFn:({provider:a,accountId:o})=>Qe.cliproxy.accounts.setDefault(a,o),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),re.success("Default account updated")},onError:a=>{re.error(a.message)}})}function lT(){const n=dt();return pt({mutationFn:({provider:a,accountId:o})=>Qe.cliproxy.accounts.remove(a,o),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),re.success("Account removed")},onError:a=>{re.error(a.message)}})}function QN(){const n=dt();return pt({mutationFn:({provider:a,accountId:o})=>Qe.cliproxy.accounts.pause(a,o),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),re.success("Account paused")},onError:a=>{re.error(a.message)}})}function $N(){const n=dt();return pt({mutationFn:({provider:a,accountId:o})=>Qe.cliproxy.accounts.resume(a,o),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),re.success("Account resumed")},onError:a=>{re.error(a.message)}})}function rT(){const n=dt();return pt({mutationFn:({provider:a,accountId:o})=>Qe.cliproxy.accounts.solo(a,o),onSuccess:a=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]});const o=a.paused.length;re.success(`Solo mode: paused ${o} other account${o!==1?"s":""}`)},onError:a=>{re.error(a.message)}})}function cT(){const n=dt();return pt({mutationFn:({provider:a,accountIds:o})=>Qe.cliproxy.accounts.bulkPause(a,o),onSuccess:a=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),re.success(`Paused ${a.succeeded.length} account${a.succeeded.length!==1?"s":""}`),a.failed.length>0&&re.warning(`${a.failed.length} account${a.failed.length!==1?"s":""} failed to pause`)},onError:a=>{re.error(a.message)}})}function uT(){const n=dt();return pt({mutationFn:({provider:a,accountIds:o})=>Qe.cliproxy.accounts.bulkResume(a,o),onSuccess:a=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),re.success(`Resumed ${a.succeeded.length} account${a.succeeded.length!==1?"s":""}`),a.failed.length>0&&re.warning(`${a.failed.length} account${a.failed.length!==1?"s":""} failed to resume`)},onError:a=>{re.error(a.message)}})}function dT(){const n=dt();return pt({mutationFn:({provider:a,nickname:o})=>Qe.cliproxy.auth.start(a,o),onSuccess:(a,o)=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),re.success(`Account added for ${o.provider}`)},onError:a=>{re.error(a.message)}})}function fT(){return pt({mutationFn:n=>Qe.cliproxy.auth.cancel(n),onError:n=>{re.error(n.message)}})}function hT(){const n=dt();return pt({mutationFn:()=>Qe.cliproxy.auth.kiroImport(),onSuccess:a=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),a.account?re.success(`Imported Kiro account: ${a.account.email||a.account.id}`):re.success("Kiro token imported")},onError:a=>{re.error(a.message)}})}function mT(){return Et({queryKey:["cliproxy-models"],queryFn:()=>Qe.cliproxy.models()})}function pT(n){return Et({queryKey:["presets",n],queryFn:()=>Qe.presets.list(n),enabled:!!n})}function gT(){const n=dt();return pt({mutationFn:({profile:a,data:o})=>Qe.presets.create(a,o),onSuccess:(a,o)=>{n.invalidateQueries({queryKey:["presets",o.profile]}),re.success(`Preset "${o.data.name}" saved`)},onError:a=>{re.error(a.message)}})}function yT(){const n=dt();return pt({mutationFn:({profile:a,name:o})=>Qe.presets.delete(a,o),onSuccess:(a,o)=>{n.invalidateQueries({queryKey:["presets",o.profile]}),re.success("Preset deleted")},onError:a=>{re.error(a.message)}})}function xT(){return Et({queryKey:["proxy-status"],queryFn:()=>Qe.cliproxy.proxyStatus(),refetchInterval:3e4})}function vT(){const n=dt();return pt({mutationFn:()=>Qe.cliproxy.proxyStart(),onSuccess:a=>{n.invalidateQueries({queryKey:["proxy-status"]}),a.alreadyRunning?re.info("CLIProxy was already running"):a.started?re.success("CLIProxy started successfully"):re.error(a.error||"Failed to start CLIProxy")},onError:a=>{re.error(a.message)}})}function bT(){const n=dt();return pt({mutationFn:()=>Qe.cliproxy.proxyStop(),onSuccess:a=>{n.invalidateQueries({queryKey:["proxy-status"]}),a.stopped?re.success(`CLIProxy stopped${a.sessionCount?` (${a.sessionCount} session(s) disconnected)`:""}`):re.error(a.error||"Failed to stop CLIProxy")},onError:a=>{re.error(a.message)}})}function WN(){return Et({queryKey:["cliproxy-update-check"],queryFn:()=>Qe.cliproxy.updateCheck(),staleTime:300*1e3,refetchInterval:300*1e3,refetchOnWindowFocus:!0})}function ST(){const n=dt();return pt({mutationKey:["update-backend"],mutationFn:({backend:a,force:o=!1})=>Qe.cliproxyServer.updateBackend(a,o),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"]}),re.success("Backend updated")},onError:a=>{a.message.includes("Proxy is running")?re.error("Stop the proxy first to change backend"):re.error(a.message)}})}function CT(){return Et({queryKey:["cliproxy-versions"],queryFn:()=>Qe.cliproxy.versions(),staleTime:300*1e3,refetchOnWindowFocus:!0})}function wT(){const n=dt();return pt({mutationFn:({version:a,force:o})=>Qe.cliproxy.install(a,o),onSuccess:a=>{a.requiresConfirmation||(n.invalidateQueries({queryKey:["cliproxy-versions"]}),n.invalidateQueries({queryKey:["cliproxy-update-check"]}),n.invalidateQueries({queryKey:["proxy-status"]}),a.success?re.success(a.message||`Installed v${a.version}`):re.error(a.error||"Installation failed"))},onError:a=>{re.error(a.message)}})}function NT(){const n=dt();return pt({mutationFn:()=>Qe.cliproxy.restart(),onSuccess:a=>{n.invalidateQueries({queryKey:["proxy-status"]}),a.success?re.success(`Proxy restarted on port ${a.port}`):re.error(a.error||"Restart failed")},onError:a=>{re.error(a.message)}})}const XN=G0,ZN=Y0,JN=V0;function e1(n){return[{title:n("nav.general"),items:[{path:"/",icon:AS,label:n("nav.home")},{path:"/analytics",icon:ES,label:n("nav.analytics")}]},{title:n("nav.identityAccess"),items:[{path:"/providers",icon:Yy,label:n("nav.apiProfiles"),badge:{text:"OpenRouter",icon:"/icons/openrouter.svg"}},{path:"/cliproxy",icon:Vy,label:n("nav.cliproxyPlus"),isCollapsible:!0,children:[{path:"/cliproxy",label:n("nav.cliproxyOverview")},{path:"/cliproxy/control-panel",icon:MS,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:OS,label:n("nav.factoryDroid")}]},{title:n("nav.system"),items:[{path:"/health",icon:To,label:n("nav.health")},{path:"/settings",icon:TS,label:n("nav.settings")}]}]}function t1(){const{t:n}=Lt(),a=gr(),o=Od(),{state:l}=Ar(),{data:u}=WN(),f=e1(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(DN,{collapsible:"icon",children:[r.jsx(RN,{className:"h-12 flex items-center justify-center",children:r.jsx(mx,{size:"sm",showText:l==="expanded"})}),r.jsx(zN,{children:f.map((b,N)=>r.jsxs(LN,{children:[b.title&&r.jsx(PN,{children:b.title}),r.jsx(UN,{children:r.jsx(HN,{children:b.items.map(w=>r.jsx(IN,{children:w.isCollapsible&&w.children?r.jsxs(XN,{defaultOpen:y(w.children)||p(w.path),className:"group/collapsible",children:[r.jsx(ZN,{asChild:!0,children:r.jsxs(Bg,{tooltip:m(w),isActive:y(w.children),onClick:()=>o(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(JN,{children:r.jsx(qN,{children:w.children.map(O=>r.jsx(KN,{children:r.jsx(GN,{asChild:!0,isActive:p(O.path),children:r.jsx(pd,{to:O.path,children:r.jsx("span",{children:O.label})})})},O.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:`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-sidebar-accent-foreground/20 text-sidebar-accent-foreground border border-sidebar-accent-foreground/30":"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:[r.jsx("img",{src:w.badge.icon,alt:"",className:"w-3 h-3"}),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(_N,{className:"p-4 border-t flex items-center justify-center",children:r.jsx(kN,{})})]})}const gx=()=>{const n=S.useContext(rx);if(n===void 0)throw new Error("useTheme must be used within a ThemeProvider");return n};function n1(){const{theme:n,setTheme:a}=gx();return r.jsxs(ut,{variant:"ghost",size:"icon",onClick:()=>a(n==="dark"?"light":"dark"),children:[r.jsx(DS,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),r.jsx(kS,{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 a1(){const{privacyMode:n,togglePrivacyMode:a}=Ld();return r.jsxs($a,{children:[r.jsx(Wa,{asChild:!0,children:r.jsx(ut,{variant:"ghost",size:"icon",onClick:a,className:q("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 s1="https://github.com/kaitranntt/ccs/issues";function i1(){return r.jsx(ut,{variant:"ghost",size:"icon",asChild:!0,title:"Report an issue on GitHub",children:r.jsx("a",{href:s1,target:"_blank",rel:"noopener noreferrer",children:r.jsx(Fy,{className:"w-4 h-4"})})})}const o1="https://docs.ccs.kaitran.ca";function l1(){return r.jsx(ut,{variant:"ghost",size:"icon",asChild:!0,title:"View documentation",children:r.jsx("a",{href:o1,target:"_blank",rel:"noopener noreferrer",children:r.jsx(RS,{className:"w-4 h-4"})})})}function r1(){const[n,a]=S.useState("disconnected"),[o,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"]}),re.info("Configuration updated externally");break;case"settings-changed":f.invalidateQueries({queryKey:["profiles"]}),re.info("Settings file updated");break;case"profiles-changed":f.invalidateQueries({queryKey:["accounts"]}),re.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=O=>{try{const D=JSON.parse(O.data);C(D),window.dispatchEvent(new CustomEvent("ws-message",{detail:D}))}catch{console.log("[WS] Invalid message")}},w.onclose=()=>{if(a("disconnected"),u.current=null,h.current<m){l(!0);const O=Math.min(1e3*Math.pow(2,h.current),3e4);h.current++,console.log(`[WS] Reconnecting in ${O}ms (attempt ${h.current})`),p.current=setTimeout(()=>{y.current()},O)}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:o,connect:x,disconnect:b}),[n,o,x,b])}function c1(){const{status:n,isReconnecting:a}=r1(),l={connected:{icon:zS,color:"text-green-600",label:"Connected",animate:!1},connecting:{icon:Do,color:"text-yellow-500",label:"Connecting...",animate:!0},disconnected:{icon:a?Do:_S,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 u1(){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(LS,{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(vi,{className:"w-4 h-4"})})]})})}const d1="https://claudekit.cc?ref=HMNKXOHN";function f1(){return r.jsxs("a",{href:d1,target:"_blank",rel:"noopener noreferrer",className:q("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:q("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:q("text-xs font-bold text-foreground","group-hover:text-accent-foreground","transition-colors"),children:"ClaudeKit"})]})]})}const h1="https://github.com/sponsors/kaitranntt";function m1(){return r.jsxs("a",{href:h1,target:"_blank",rel:"noopener noreferrer",className:q("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(PS,{className:q("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:q("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 Kd({...n}){return r.jsx(jy,{"data-slot":"dialog",...n})}function p1({...n}){return r.jsx(Ty,{"data-slot":"dialog-portal",...n})}function g1({className:n,...a}){return r.jsx(Dy,{"data-slot":"dialog-overlay",className:q("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:o=!0,...l}){return r.jsxs(p1,{"data-slot":"dialog-portal",children:[r.jsx(g1,{}),r.jsxs(Ay,{"data-slot":"dialog-content",className:q("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,o&&r.jsxs(Ey,{"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(vi,{}),r.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Yd({className:n,...a}){return r.jsx("div",{"data-slot":"dialog-header",className:q("flex flex-col gap-2 text-center sm:text-left",n),...a})}function y1({className:n,...a}){return r.jsx("div",{"data-slot":"dialog-footer",className:q("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",n),...a})}function Vd({className:n,...a}){return r.jsx(My,{"data-slot":"dialog-title",className:q("text-lg leading-none font-semibold",n),...a})}function Fd({className:n,...a}){return r.jsx(Oy,{"data-slot":"dialog-description",className:q("text-muted-foreground text-sm",n),...a})}function x1({open:n,onClose:a,sessionId:o,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(I=>I<=1?(clearInterval(M),O(!0),0):I-1)},1e3);return()=>clearInterval(M)},[n,p]),S.useEffect(()=>{n&&(C(f),b(!1),w(p))},[n,f,p]);const O=async(M=!1)=>{if(!x){b(!0);try{await m(M?"":y),a()}catch(I){console.error("Failed to submit project selection:",I);try{await m("")}catch{}a()}}},D=l.charAt(0).toUpperCase()+l.slice(1);return r.jsx(Kd,{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 ",D," 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:()=>O(!0),disabled:x,children:"Use Default"}),r.jsx(ut,{onClick:()=>O(!1),disabled:x,children:x?r.jsxs(r.Fragment,{children:[r.jsx(Tn,{className:"w-4 h-4 mr-2 animate-spin"}),"Selecting..."]}):r.jsxs(r.Fragment,{children:[r.jsx(yi,{className:"w-4 h-4 mr-2"}),"Confirm Selection"]})})]})]})]})})}const xi={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(xi)),Sd=Object.freeze(["agy","codex","claude","gemini","ghcp"]);new Set(Sd);const v1=Object.freeze([...Sd,...Sd.flatMap(n=>xi[n].aliases),"all"].filter((n,a,o)=>o.indexOf(n)===a));v1.join(", ");new Set(Qd);function b1(n=xi){const a=new Map,o=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 o){l(u,u);for(const f of n[u].aliases)l(f,u)}return a}b1();function S1(n){return Qd.filter(a=>xi[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:xi[n].displayName,description:xi[n].description}]))),C1={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"},qg={textClass:"text-gray-600",letter:"?"},w1={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"}},N1=new Set(["kimi"]);function j1(n){const a=ba(n);if(Za(a))return C1[a]}function jT(n){const a=ba(n);return Za(a)?w1[a]:{...qg,letter:a[0]?.toUpperCase()||qg.letter}}function AT(n){const a=ba(n);return Za(a)&&N1.has(a)}const Wd={gemini:"#4285F4",agy:"#f3722c",codex:"#10a37f",vertex:"#4285F4",iflow:"#f94144",qwen:"#6236FF",kiro:"#4d908e",ghcp:"#43aa8b",claude:"#D97757",kimi:"#FF6B35"},A1={...Object.fromEntries($d.map(n=>[n,yx[n].displayName])),vertex:"Vertex AI"};function Xd(n){const a=ba(n);return a?A1[a]||String(n):"Unknown provider"}function E1(n){const a=ba(n);return Za(a)?yx[a].description:""}const M1=[...S1("device_code")],O1=Object.freeze({ghcp:"GitHub Copilot",kiro:"Kiro (AWS)",qwen:"Qwen Code"}),T1=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 ET(n){const a=ba(n);return Za(a)&&M1.includes(a)}function sr(n){const a=ba(n);return a?Za(a)?O1[a]||Xd(a):String(n):"Unknown provider"}function D1(n){const a=ba(n);return Za(a)&&T1[a]||"Complete the authorization in your browser."}const k1=["ghcp","kiro"];function MT(n){const a=ba(n);return Za(a)&&k1.includes(a)}const OT="aws",Kg=[{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 TT(n){return Kg.find(o=>o.id===n)||Kg[0]}function R1({open:n,onClose:a,sessionId:o,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 I=null;const B=()=>{const U=Math.max(0,Math.floor((h-Date.now())/1e3));C(U),U===0&&I&&(clearInterval(I),I=null)};return B(),I=setInterval(B,1e3),()=>{I&&clearInterval(I)}},[n,h]);const x=S.useCallback(async()=>{try{await navigator.clipboard.writeText(u),p(!0),re.success(ct.t("commonToast.codeCopied")),setTimeout(()=>p(!1),2e3)}catch{re.error(ct.t("commonToast.copyCodeFailed"))}},[u]),b=S.useCallback(()=>{window.open(f,"_blank","noopener,noreferrer")},[f]),N=sr(l),w=D1(l),O=N==="Unknown provider"?"Open verification page":`Open ${N.split(" ")[0]}`,D=I=>{const B=Math.floor(I/60),U=I%60;return`${B}:${U.toString().padStart(2,"0")}`},M=y===0;return r.jsx(Kd,{open:n,onOpenChange:I=>!I&&a(),children:r.jsxs(Gd,{className:"sm:max-w-md","data-session-id":o,children:[r.jsxs(Yd,{children:[r.jsxs(Vd,{className:"flex items-center gap-2",children:[r.jsx(Td,{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 ",D(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(yi,{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"}),O]}),r.jsx(ut,{variant:"outline",onClick:x,className:"w-full",children:m?r.jsxs(r.Fragment,{children:[r.jsx(yi,{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(Tn,{className:"h-4 w-4 animate-spin"}),r.jsx("span",{children:"Waiting for authorization..."})]})]})]})})}function _1({...n}){return r.jsx(F0,{"data-slot":"dropdown-menu",...n})}function z1({...n}){return r.jsx(Q0,{"data-slot":"dropdown-menu-trigger",...n})}function L1({className:n,sideOffset:a=4,...o}){return r.jsx($0,{children:r.jsx(W0,{"data-slot":"dropdown-menu-content",sideOffset:a,className:q("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),...o})})}function P1({className:n,inset:a,variant:o="default",...l}){return r.jsx(X0,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":o,className:q("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 U1(){const{authRequired:n,isAuthenticated:a,username:o,logout:l}=Ud();if(!n||!a)return null;const u=async()=>{await l()};return r.jsxs(_1,{children:[r.jsx(z1,{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:o})]})}),r.jsx(L1,{align:"end",children:r.jsxs(P1,{onClick:u,className:"gap-2 text-destructive",children:[r.jsx(HS,{className:"h-4 w-4"}),"Sign Out"]})})]})}const xx=aS,DT=iS,vx=sS,Zd=S.forwardRef(({className:n,children:a,...o},l)=>r.jsxs(ky,{ref:l,className:q("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),...o,children:[a,r.jsx(Z0,{asChild:!0,children:r.jsx(br,{className:"h-4 w-4 opacity-50"})})]}));Zd.displayName=ky.displayName;const bx=S.forwardRef(({className:n,...a},o)=>r.jsx(Ry,{ref:o,className:q("flex cursor-default items-center justify-center py-1",n),...a,children:r.jsx(Dd,{className:"h-4 w-4"})}));bx.displayName=Ry.displayName;const Sx=S.forwardRef(({className:n,...a},o)=>r.jsx(_y,{ref:o,className:q("flex cursor-default items-center justify-center py-1",n),...a,children:r.jsx(br,{className:"h-4 w-4"})}));Sx.displayName=_y.displayName;const Jd=S.forwardRef(({className:n,children:a,position:o="popper",...l},u)=>r.jsx(J0,{children:r.jsxs(zy,{ref:u,className:q("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",o==="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:o,...l,children:[r.jsx(bx,{}),r.jsx(eS,{className:q("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),r.jsx(Sx,{})]})}));Jd.displayName=zy.displayName;const H1=S.forwardRef(({className:n,...a},o)=>r.jsx(Ly,{ref:o,className:q("px-2 py-1.5 text-sm font-semibold",n),...a}));H1.displayName=Ly.displayName;const dr=S.forwardRef(({className:n,children:a,...o},l)=>r.jsxs(Py,{ref:l,className:q("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),...o,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(yi,{className:"h-4 w-4"})})}),r.jsx(nS,{children:a})]}));dr.displayName=Py.displayName;const I1=S.forwardRef(({className:n,...a},o)=>r.jsx(Uy,{ref:o,className:q("-mx-1 my-1 h-px bg-muted",n),...a}));I1.displayName=Uy.displayName;function B1(){const{t:n,i18n:a}=Lt(),o=Po(a.resolvedLanguage??a.language??"en"),l=u=>{const f=qw(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:o,onValueChange:l,children:[r.jsx(Zd,{className:"h-8 w-[150px]",children:r.jsx(vx,{placeholder:n("layout.languageSwitcher")})}),r.jsx(Jd,{children:Iw.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 o=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:o,onClose:l}),[n.isOpen,n.prompt,o,l])}function K1(n){return typeof n!="string"?"unknown":n.trim().toLowerCase()||"unknown"}function G1(){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=K1(m.provider),y=sr(p);re.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=sr(p.prompt.provider);return re.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=sr(p.prompt.provider);return re.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?(re.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 o=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),re.success("Code copied to clipboard")}catch{re.error("Failed to copy code")}},[n.prompt]);return S.useMemo(()=>({isOpen:n.isOpen,prompt:n.prompt,error:n.error,onClose:o,onOpenUrl:l,onCopyCode:u}),[n.isOpen,n.prompt,n.error,o,l,u])}const Y1="ccs-dashboard:last-route";function V1(n,a="",o=""){try{localStorage.setItem(Y1,`${n}${a}${o}`)}catch{}}function F1(){return r.jsxs("div",{className:"p-6 space-y-4",children:[r.jsx(qe,{className:"h-8 w-48"}),r.jsx(qe,{className:"h-64 w-full"})]})}function Q1(){const n=gr(),{isOpen:a,prompt:o,onSelect:l,onClose:u}=q1(),f=G1();return S.useEffect(()=>{V1(n.pathname,n.search,n.hash)},[n.pathname,n.search,n.hash]),r.jsxs(TN,{children:[r.jsx(t1,{}),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(f1,{}),r.jsx(m1,{})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(c1,{}),r.jsx(B1,{}),r.jsx(l1,{}),r.jsx(i1,{}),r.jsx(a1,{}),r.jsx(n1,{}),r.jsx(U1,{})]})]}),r.jsx("div",{className:"flex-1 overflow-auto min-h-0",children:r.jsx(S.Suspense,{fallback:r.jsx(F1,{}),children:r.jsx(md,{})})}),r.jsx(u1,{})]}),o&&r.jsx(x1,{open:a,onClose:u,sessionId:o.sessionId,provider:o.provider,projects:o.projects,defaultProjectId:o.defaultProjectId,supportsAll:o.supportsAll,onSelect:l}),f.prompt&&r.jsx(R1,{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 $1=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,...o}){return r.jsx("div",{className:q($1({variant:a}),n),...o})}function W1({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 X1=100,Gg=["#3b3c36","#568203","#8d4557","#da9100","#3c6c82","#c96907"];function Z1(n){return Gg[n%Gg.length]}function Cx(n){return n.replace(/@(gmail|yahoo|hotmail|outlook|icloud)\.com$/i,"")}function J1(n){const o=new Date().getTime()-n.getTime(),l=Math.floor(o/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 ej(n){const a=[];return n.forEach(o=>{const l=o.lastUsedAt?new Date(o.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:`${o.id}-${h}-${m}`,timestamp:y,accountEmail:o.email,status:h,latencyMs:h==="success"?50+Math.floor(Math.random()*150):200+Math.floor(Math.random()*4800)})}};u(o.successCount,"success"),u(o.failureCount,"failed")}),a.sort((o,l)=>l.timestamp.getTime()-o.timestamp.getTime())}function tj({containerRef:n,svgRef:a,accounts:o}){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 o.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,O,D,M;switch(N){case"right":w=b.left-f.left,O=b.top+b.height/2-f.top,D=m.right-f.left,M=m.top+m.height/2-f.top;break;case"top":w=b.left+b.width/2-f.left,O=b.bottom-f.top,D=m.left+m.width/2-f.left,M=m.top-f.top;break;case"bottom":w=b.left+b.width/2-f.left,O=b.top-f.top,D=m.left+m.width/2-f.left,M=m.bottom-f.top;break;default:w=b.right-f.left,O=b.top+b.height/2-f.top,D=m.left-f.left,M=m.top+m.height/2-f.top}let I,B,U,k;N==="top"||N==="bottom"?(I=w,B=O+(M-O)*.5,U=D,k=M-(M-O)*.5):(I=w+(D-w)*.5,B=O,U=D-(D-w)*.5,k=M),p.push(`M ${w} ${O} C ${I} ${B}, ${U} ${k}, ${D} ${M}`)}),p}function nj(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 o=Math.ceil(a/4);return{leftAccounts:n.slice(0,o),rightAccounts:n.slice(o,o*2),topAccounts:n.slice(o*2,o*3),bottomAccounts:n.slice(o*3)}}function aj(n){return n>=9?"w-64":n>=5?"w-60":n>=3?"w-56":"w-52"}function sj({storageKey:n,onDrag:a}){const[o,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,O)=>{O.preventDefault(),O.stopPropagation(),O.target.setPointerCapture(O.pointerId);const D=m[w]||{x:0,y:0};u.current={x:O.clientX,y:O.clientY,offsetX:D.x,offsetY:D.y},f.current=!1,l(w)},[m]),x=S.useCallback(w=>{if(!o||!u.current)return;const O=u.current,D=w.clientX-O.x,M=w.clientY-O.y;(Math.abs(D)>3||Math.abs(M)>3)&&(f.current=!0),p(I=>({...I,[o]:{x:O.offsetX+D,y:O.offsetY+M}})),a&&requestAnimationFrame(a)},[o,a]),b=S.useCallback(()=>{l(null),u.current=null},[]);return{dragOffsets:m,draggingId:o,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 ij(n){let a=0,o=0;return Object.values(n).forEach(l=>{a=Math.min(a,l.y),o=Math.max(o,l.y)}),{paddingTop:Math.max(0,-a),paddingBottom:Math.max(0,o),extraHeight:Math.max(0,Math.abs(a),Math.abs(o))*2}}function oj(n){const[a,o]=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){o(u);const h=setTimeout(()=>o(new Set),2e3);return()=>clearTimeout(h)}},[n]),a}function lj({events:n,privacyMode:a}){const{t:o}=Lt();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:o("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(To,{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:o("flowViz.connectionTimeline")})]}),r.jsx("div",{className:q("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:q("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:q("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:J1(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 rj(){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 cj(){const n=await fetch("/api/cliproxy/status");if(!n.ok)throw new Error("Failed to fetch status");return n.json()}function uj(){return Et({queryKey:["cliproxy-status"],queryFn:cj,refetchInterval:1e4,retry:1})}function dj(n=!0){return Et({queryKey:["cliproxy-stats"],queryFn:rj,enabled:n,refetchInterval:5e3,retry:1,staleTime:3e3})}async function fj(){const n=await fetch("/api/cliproxy/error-logs");if(!n.ok){const o=await n.json();throw new Error(o.message||"Failed to fetch error logs")}return(await n.json()).files??[]}async function hj(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 mj(n=!0){return Et({queryKey:["cliproxy-error-logs"],queryFn:fj,enabled:n,refetchInterval:3e4,retry:1,staleTime:1e4})}function pj(n){return Et({queryKey:["cliproxy-error-log-content",n],queryFn:()=>n?hj(n):Promise.resolve(""),enabled:!!n,staleTime:6e4})}const wx=["agy","codex","claude","gemini","ghcp"],gj={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:gj[a]??null:null}async function Yg(n,a){const o=await fetch(`/api/cliproxy/quota/${n}/${encodeURIComponent(a)}`);if(!o.ok){let l="Failed to fetch quota";try{l=(await o.json()).message||l}catch{}throw new Error(l)}return o.json()}async function yj(n){const a=await fetch(`/api/cliproxy/quota/codex/${encodeURIComponent(n)}`);if(!a.ok){let o="Failed to fetch Codex quota";try{o=(await a.json()).message||o}catch{}throw new Error(o)}return a.json()}async function xj(n){const a=await fetch(`/api/cliproxy/quota/claude/${encodeURIComponent(n)}`);if(!a.ok){let o="Failed to fetch Claude quota";try{o=(await a.json()).message||o}catch{}throw new Error(o)}return a.json()}async function vj(n){const a=await fetch(`/api/cliproxy/quota/gemini/${encodeURIComponent(n)}`);if(!a.ok){let o="Failed to fetch Gemini quota";try{o=(await a.json()).message||o}catch{}throw new Error(o)}return a.json()}async function bj(n){const a=await fetch(`/api/cliproxy/quota/ghcp/${encodeURIComponent(n)}`);if(!a.ok){let o="Failed to fetch GitHub Copilot quota";try{o=(await a.json()).message||o}catch{}throw new Error(o)}return a.json()}async function Sj(n,a){const o=Nx(n);if(!o)return Yg(n,a);switch(o){case"codex":return yj(a);case"claude":return xj(a);case"gemini":return vj(a);case"ghcp":return bj(a);default:return Yg(n,a)}}function Cj(n,a,o=!0){const l=Nx(n);return Et({queryKey:["account-quota",l??n,a],queryFn:()=>Sj(l??n,a),enabled:o&&!!l&&!!a,staleTime:6e4,refetchInterval:6e4,refetchOnWindowFocus:!1,refetchOnMount:!1,retry:1})}function wj(n){if(!n)return null;const a=n.split(/[\s_-]+/g).map(o=>o.trim()).filter(o=>o.length>0).map(o=>o.charAt(0).toUpperCase()+o.slice(1));return a.length>0?a.join(" "):n}function Nj(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 jj({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(Id(n)){const o=sN(n.models||[]),l=iN(o),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:q("truncate",y.exhausted&&"text-red-500"),children:y.displayName}),r.jsxs("span",{className:q("font-mono",y.exhausted&&"text-red-500"),children:[y.percentage,"%"]})]},y.name))]},f)}),r.jsx(ir,{resetTime:a})]})}if(Mr(n)){const{fiveHourWindow:o,weeklyWindow:l,codeReviewWindows:u,unknownWindows:f}=Er(n.windows),h=n.coreUsage?.fiveHour?.resetAt??o?.resetAt??null,m=n.coreUsage?.weekly?.resetAt??l?.resetAt??null,p=[o,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:q(y.remainingPercent<20&&"text-red-500"),children:lN(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(Or(n)){const o=[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=[...o,...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:q(m.remainingPercent<20&&"text-red-500"),children:Nj(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(o=>r.jsxs("div",{className:"flex justify-between gap-4",children:[r.jsxs("span",{className:q(o.remainingPercent<20&&"text-red-500"),children:[o.label,o.tokenType?` (${o.tokenType})`:""]}),r.jsxs("span",{className:"font-mono",children:[o.remainingPercent,"%"]})]},o.id)),r.jsx(ir,{resetTime:a})]});if(qd(n)){const o=[{label:"Premium Interactions",snapshot:n.snapshots.premiumInteractions},{label:"Chat",snapshot:n.snapshots.chat},{label:"Completions",snapshot:n.snapshots.completions}],l=n.quotaResetDate??a,u=wj(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]}),o.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:q(m&&"text-red-500"),children:f}),r.jsx("span",{className:q("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(ir,{resetTime:l})]})}return null}function ir({resetTime:n}){return n?r.jsxs("div",{className:"flex items-center gap-1.5 pt-1 border-t border-border/50",children:[r.jsx(ko,{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:o}){const l=!!n||!!a;return!l&&!o?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(ko,{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(ko,{className:"w-3 h-3 text-indigo-400"}),r.jsxs("span",{className:"text-indigo-400 font-medium",children:["Weekly resets ",bd(a)]})]}),!l&&o&&r.jsx(ir,{resetTime:o})]})}function Aj({success:n,failure:a,showDetails:o}){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:q("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:q("grid grid-cols-2 gap-2 overflow-hidden transition-all duration-300 ease-in-out",o?"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:q("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(kd,{className:q("w-2.5 h-2.5",a>0?"text-red-500":"text-muted-foreground")}),r.jsx("span",{className:q("text-[10px] font-mono font-bold",a>0?"text-red-500":"text-muted-foreground"),children:a})]})]})]})}const Ej=["antigravity","anthropic","gemini-cli","copilot","github-copilot"],Mj={left:"border-l-2",right:"border-r-2",top:"border-t-2",bottom:"border-b-2"},Oj={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 Tj(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 Dj({account:n,zone:a,originalIndex:o,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:O}=Lt(),D=Mj[a],M=Tj(a,n.color),I=Oj[a],B=n.provider.toLowerCase(),U=wx.includes(B)||Ej.includes(B),k=B==="codex",j=B==="claude"||B==="anthropic",{data:L,isLoading:X}=Cj(B,n.id,U),F=pN(n.provider,L),Q=gN(n.provider,L),ae=k&&L&&Mr(L)?Er(L.windows):null,te=[{label:"5h",value:ae?.fiveHourWindow?.remainingPercent??null},{label:"Wk",value:ae?.weeklyWindow?.remainingPercent??null}].filter(ee=>ee.value!==null),ye=j&&L&&Or(L)?[{label:"5h",value:L.coreUsage?.fiveHour?.remainingPercent??L.windows.find(ee=>ee.rateLimitType==="five_hour")?.remainingPercent??null},{label:"Wk",value:L.coreUsage?.weekly?.remainingPercent??L.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=k?te:j?ye:[],Ce=F!==null?hx(F):null,R=Ce!==null?Number(Ce):null,W=n.provider==="agy"&&n.tier&&n.tier!=="unknown"&&n.tier!=="free";return r.jsxs("div",{"data-account-index":o,"data-zone":a,onMouseEnter:p,onMouseLeave:y,onPointerDown:C,onPointerMove:x,onPointerUp:b,onPointerCancel:b,className:q("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]",D,"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:q("text-xs font-semibold text-foreground tracking-tight truncate",m&&ux),children:Cx(n.email)}),W&&r.jsx("span",{className:q("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(Cs,{children:r.jsxs($a,{children:[r.jsx(Wa,{asChild:!0,children:r.jsx(ut,{variant:"ghost",size:"icon",className:q("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(Tn,{className:"w-2.5 h-2.5 animate-spin"}):n.paused?r.jsx(IS,{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?O("accountCard.resumeAccount"):O("accountCard.pauseAccount")})]})}),r.jsx(Cr,{className:"w-4 h-4 text-muted-foreground/40 shrink-0"})]}),r.jsx(Aj,{success:n.successCount,failure:n.failureCount,showDetails:h}),U&&r.jsx("div",{className:"mt-2 px-0.5",children:X?r.jsxs("div",{className:"flex items-center gap-1 text-[8px] text-muted-foreground",children:[r.jsx(Tn,{className:"w-2.5 h-2.5 animate-spin"}),r.jsx("span",{children:O("accountCard.quotaLoading")})]}):R!==null?r.jsx(Cs,{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:O("accountCard.quota")}),r.jsxs("span",{className:q("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:q("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(jj,{quota:L,resetTime:Q})})]})}):L?.success?r.jsx("div",{className:"text-[8px] text-muted-foreground/60",children:O("accountCard.quotaUnavailable")}):L?.needsReauth?r.jsx(Cs,{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(Td,{className:"w-2.5 h-2.5"}),r.jsx("span",{children:O("accountCard.reauthNeeded")})]})}),r.jsx(Xa,{side:"top",className:"max-w-[200px]",children:r.jsx("p",{className:"text-xs",children:L.error?.includes("No refresh token")?O("accountCard.removeAndReadd"):L.error||O("accountCard.autoRefreshFailed")})})]})}):L?.error?r.jsx("div",{className:"text-[8px] text-muted-foreground/60 truncate",title:L.error,children:L.error.length>20?`${L.error.slice(0,18)}...`:L.error}):null}),r.jsx("div",{className:q("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",I,l&&"bg-foreground dark:bg-white border-transparent")})]})}function ef({provider:n,className:a,size:o=18,withBackground:l=!1}){const u=n.toLowerCase(),f=j1(n),h=Wd[u]||"#6b7280",m=l?Math.floor(o*.65):o,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:q("shrink-0 rounded-full bg-white border border-border flex items-center justify-center shadow-sm",a),style:{width:o,height:o},children:p});if(f)return r.jsx("img",{src:f,alt:`${n} icon`,width:o,height:o,className:q("shrink-0 rounded-sm object-contain",a)});const y=h;return r.jsx("div",{className:q("shrink-0 rounded-full flex items-center justify-center text-white font-bold",a),style:{width:o,height:o,backgroundColor:y,fontSize:o*.5},children:n.charAt(0).toUpperCase()})}function kj({providerData:n,providerColor:a,totalRequests:o,maxRequests:l,isDragging:u,offset:f,hoveredAccount:h,hasRightAccounts:m,hasTopAccounts:p,hasBottomAccounts:y,onPointerDown:C,onPointerMove:x,onPointerUp:b}){const{t:N}=Lt(),{accounts:w}=n;return r.jsxs("div",{"data-provider-node":!0,onPointerDown:C,onPointerMove:x,onPointerUp:b,onPointerCancel:b,className:q("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:o.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,o/(l*w.length)*100)}%`,backgroundColor:a}})})]})]})}function Rj({paths:n,accounts:a,maxRequests:o,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/o*10),C=l===h,x=l!==null&&l!==h,b=u.has(m.id),N=Z1(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 _j({onBack:n,showDetails:a,onToggleDetails:o,hasCustomPositions:l,onResetPositions:u}){const{t:f}=Lt();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:o,className:q("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(qS,{className:"w-3.5 h-3.5"}),r.jsx("span",{children:f("flowViz.resetLayout")})]})]})]})}function zj({providerData:n,onBack:a,onPauseToggle:o,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}=Ld(),{accounts:N}=n,w=Math.max(...N.map(J=>J.successCount+J.failureCount),1),O=N.reduce((J,oe)=>J+oe.successCount+oe.failureCount,0),D=S.useCallback(()=>{const J=tj({containerRef:u,svgRef:f,accounts:N});J.length>0&&x(J)},[N]),M=`ccs-flow-positions-${n.provider}`,{dragOffsets:I,draggingId:B,handlePointerDown:U,handlePointerMove:k,handlePointerUp:j,getOffset:L,resetPositions:X,hasCustomPositions:F}=sj({storageKey:M,onDrag:D}),Q=ij(I),ae=oj(N),te=S.useMemo(()=>ej(N).slice(0,X1),[N]);S.useEffect(()=>{const J=setTimeout(D,50);return window.addEventListener("resize",D),()=>{clearTimeout(J),window.removeEventListener("resize",D)}},[D]),S.useEffect(()=>{const J=setTimeout(D,10);return()=>clearTimeout(J)},[I,D]),S.useEffect(()=>{const J=Date.now(),oe=350,ne=()=>{D(),Date.now()-J<oe&&requestAnimationFrame(ne)};requestAnimationFrame(ne)},[p,D]);const ye=Wd[n.provider.toLowerCase()]||"#6b7280",de=S.useMemo(()=>nj(N),[N]),{leftAccounts:Ce,rightAccounts:R,topAccounts:W,bottomAccounts:ee}=de,$=R.length>0,ce=W.length>0,fe=ee.length>0,Ne=S.useMemo(()=>aj(N.length),[N.length]),V=(J,oe)=>J.map(ne=>{const ie=N.findIndex(xe=>xe.id===ne.id);return r.jsx(Dj,{account:ne,zone:oe,originalIndex:ie,isHovered:h===ie,isDragging:B===ne.id,offset:L(ne.id),showDetails:p,privacyMode:b,onMouseEnter:()=>m(ie),onMouseLeave:()=>m(null),onPointerDown:xe=>U(ne.id,xe),onPointerMove:k,onPointerUp:j,onPauseToggle:o,isPausingAccount:l},ne.id)});return r.jsxs("div",{className:"flex flex-col",ref:u,children:[r.jsx(_j,{onBack:a,showDetails:p,onToggleDetails:()=>y(!p),hasCustomPositions:F,onResetPositions:X}),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(Rj,{paths:C,accounts:N,maxRequests:w,hoveredAccount:h,pulsingAccounts:ae})}),ce&&r.jsx("div",{className:"flex flex-row gap-3 z-10 justify-center flex-wrap mb-8",children:V(W,"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:q("z-10 flex items-center flex-shrink-0",Ne),children:r.jsx(kj,{providerData:n,providerColor:ye,totalRequests:O,maxRequests:w,isDragging:B==="provider",offset:L("provider"),hoveredAccount:h,hasRightAccounts:$,hasTopAccounts:ce,hasBottomAccounts:fe,onPointerDown:J=>U("provider",J),onPointerMove:k,onPointerUp:j})}),$&&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(lj,{events:te,privacyMode:b})})})]})]})}function Lj(n,a){const o=n+a;return o===0?100:Math.round(n/o*100)}function Pj(n){return n.replace(/@(gmail|yahoo|hotmail|outlook|icloud)\.com$/i,"")}const Fg=["#1e6091","#2d8a6e","#d4a012","#c92a2d","#c45a1a","#6b9c4d","#3d5a73","#cc7614","#3a7371","#7c5fc4"];function Uj(){const{data:n,isLoading:a,error:o}=FN(),{data:l,isLoading:u,dataUpdatedAt:f}=dj(),[h,m]=S.useState("");S.useEffect(()=>{if(!f)return;const O=()=>{const M=Math.floor((Date.now()-f)/1e3);M<60?m(`${M}s ago`):m(`${Math.floor(M/60)}m ago`)};O();const D=setInterval(O,1e3);return()=>clearInterval(D)},[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 O=[],D=new Map;let M=0,I=0,B=0;n.authStatus.forEach(k=>{const j=k.provider;D.has(j)||D.set(j,{success:0,failure:0,accounts:[]});const L=D.get(j);L&&k.accounts?.forEach(X=>{const F=X.email||X.id,Q=p.get(F),ae=Q?.successCount??0,te=Q?.failureCount??0;M+=ae,I+=te,L.success+=ae,L.failure+=te;const ye={id:X.id,email:X.email||X.id,provider:k.provider,displayName:k.displayName,isDefault:X.isDefault,successCount:ae,failureCount:te,lastUsedAt:Q?.lastUsedAt??X.lastUsedAt,color:Fg[B%Fg.length],projectId:X.projectId,paused:X.paused,tier:X.tier};O.push(ye),L.accounts.push(ye),B++})});const U=[];return D.forEach((k,j)=>{k.accounts.length!==0&&U.push({provider:j,displayName:Xd(j),totalRequests:k.success+k.failure,successCount:k.success,failureCount:k.failure,accountCount:k.accounts.length,accounts:k.accounts})}),U.sort((k,j)=>j.totalRequests-k.totalRequests),{accounts:O,totalSuccess:M,totalFailure:I,totalRequests:M+I,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:o??null,timeSinceUpdate:h}}function Hj(){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 Ij({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(kd,{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 Bj({stats:n,isHovered:a,privacyMode:o,onSelect:l,onMouseEnter:u,onMouseLeave:f}){const h=Lj(n.successCount,n.failureCount),m=Wd[n.provider.toLowerCase()]||"#6b7280";return r.jsxs("button",{onClick:l,onMouseEnter:u,onMouseLeave:f,className:q("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:q("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(Ij,{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:q("w-2 h-2 rounded-full",p.paused&&"opacity-50"),style:{backgroundColor:p.color},title:o?"••••••":Pj(p.email)}),y&&r.jsx(Cs,{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:o,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:o})]})]})}const td="auth-monitor-selected-provider";function qj(){const{t:n}=Lt(),{accounts:a,totalSuccess:o,totalFailure:l,totalRequests:u,providerStats:f,overallSuccessRate:h,isLoading:m,error:p,timeSinceUpdate:y}=Uj(),{privacyMode:C}=Ld(),[x,b]=S.useState(()=>typeof window<"u"?localStorage.getItem(td):null),N=k=>{b(k),k?localStorage.setItem(td,k):localStorage.removeItem(td)},w=S.useMemo(()=>x&&f.some(k=>k.provider===x)?x:null,[x,f]),[O,D]=S.useState(null),M=QN(),I=$N(),B=w?f.find(k=>k.provider===w):null,U=(k,j)=>{!w||M.isPending||I.isPending||(j?M.mutate({provider:w,accountId:k}):I.mutate({provider:w,accountId:k}))};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(qe,{className:"h-4 w-32"}),r.jsx(qe,{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(k=>r.jsx(qe,{className:"h-16 flex-1 rounded-lg"},k))}),r.jsx(qe,{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(Hj,{}),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(KS,{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(To,{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:o.toLocaleString(),color:Ft.success}),r.jsx(er,{icon:r.jsx(kd,{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(To,{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(zj,{providerData:B,onBack:()=>N(null),onPauseToggle:U,isPausingAccount:M.isPending||I.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(k=>r.jsx(Bj,{stats:k,isHovered:O===k.provider,privacyMode:C,onSelect:()=>N(k.provider),onMouseEnter:()=>D(k.provider),onMouseLeave:()=>D(null)},k.provider))})]})})]})}const Tr=S.createContext(null);Tr.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,ws=S.useLayoutEffect,Qg=yS.useId,Kj=typeof Qg=="function"?Qg:()=>null;let Gj=0;function nf(n=null){const a=Kj(),o=S.useRef(n||a||null);return o.current===null&&(o.current=""+Gj++),n??o.current}function jx({children:n,className:a="",collapsedSize:o,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",...O}){const D=S.useContext(Tr);if(D===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:M,expandPanel:I,getPanelSize:B,getPanelStyle:U,groupId:k,isPanelCollapsed:j,reevaluatePanelConstraints:L,registerPanel:X,resizePanel:F,unregisterPanel:Q}=D,ae=nf(h),te=S.useRef({callbacks:{onCollapse:y,onExpand:C,onResize:x},constraints:{collapsedSize:o,collapsible:l,defaultSize:u,maxSize:m,minSize:p},id:ae,idIsFromProps:h!==void 0,order:b});S.useRef({didLogMissingDefaultSizeWarning:!1}),ws(()=>{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=o,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)&&L(te.current,R)}),ws(()=>{const de=te.current;return X(de),()=>{Q(de)}},[b,ae,X,Q]),S.useImperativeHandle(f,()=>({collapse:()=>{M(te.current)},expand:de=>{I(te.current,de)},getId(){return ae},getSize(){return B(te.current)},isCollapsed(){return j(te.current)},isExpanded(){return!j(te.current)},resize:de=>{F(te.current,de)}}),[M,I,B,j,ae,F]);const ye=U(te.current,u);return S.createElement(w,{...O,children:n,className:a,id:ae,style:{...ye,...N},[rt.groupId]:k,[rt.panel]:"",[rt.panelCollapsible]:l||void 0,[rt.panelId]:ae,[rt.panelSize]:parseFloat(""+ye.flexGrow).toFixed(1)})}const _o=S.forwardRef((n,a)=>S.createElement(jx,{...n,forwardedRef:a}));jx.displayName="Panel";_o.displayName="forwardRef(Panel)";let Cd=null,or=-1,Va=null;function Yj(n,a,o){const l=(a&Tx)!==0,u=(a&Dx)!==0,f=(a&kx)!==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 Vj(){Va!==null&&(document.head.removeChild(Va),Cd=null,Va=null,or=-1)}function nd(n,a,o){var l,u;const f=Yj(n,a);if(Cd!==f){if(Cd=f,Va===null&&(Va=document.createElement("style"),document.head.appendChild(Va)),or>=0){var h;(h=Va.sheet)===null||h===void 0||h.removeRule(or)}or=(l=(u=Va.sheet)===null||u===void 0?void 0:u.insertRule(`*{cursor: ${f} !important;}`))!==null&&l!==void 0?l:-1}}function Ax(n){return n.type==="keydown"}function Ex(n){return n.type.startsWith("pointer")}function Mx(n){return n.type.startsWith("mouse")}function Dr(n){if(Ex(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(Mx(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function Fj(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function Qj(n,a,o){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 $j(n,a){if(n===a)throw new Error("Cannot compare node with itself");const o={a:Xg(n),b:Xg(a)};let l;for(;o.a.at(-1)===o.b.at(-1);)n=o.a.pop(),a=o.b.pop(),l=n;Re(l,"Stacking order can only be calculated for elements with a common ancestor");const u={a:Wg($g(o.a)),b:Wg($g(o.b))};if(u.a===u.b){const f=l.childNodes,h={a:o.a.at(-1),b:o.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 Wj=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Xj(n){var a;const o=getComputedStyle((a=Ox(n))!==null&&a!==void 0?a:n).display;return o==="flex"||o==="inline-flex"}function Zj(n){const a=getComputedStyle(n);return!!(a.position==="fixed"||a.zIndex!=="auto"&&(a.position!=="static"||Xj(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"||Wj.test(a.willChange)||a.webkitOverflowScrolling==="touch")}function $g(n){let a=n.length;for(;a--;){const o=n[a];if(Re(o,"Missing node"),Zj(o))return o}return null}function Wg(n){return n&&Number(getComputedStyle(n).zIndex)||0}function Xg(n){const a=[];for(;n;)a.push(n),n=Ox(n);return a}function Ox(n){const{parentNode:a}=n;return a&&a instanceof ShadowRoot?a.host:a}const Tx=1,Dx=2,kx=4,Rx=8,Jj=Fj()==="coarse";let On=[],gi=!1,Fa=new Map,kr=new Map;const zo=new Set;function eA(n,a,o,l,u){var f;const{ownerDocument:h}=a,m={direction:o,element:a,hitAreaMargins:l,setResizeHandlerState:u},p=(f=Fa.get(h))!==null&&f!==void 0?f:0;return Fa.set(h,p+1),zo.add(m),fr(),function(){var C;kr.delete(n),zo.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),On.includes(m)){const b=On.indexOf(m);b>=0&&On.splice(b,1),Rr(),u("up",!0,null)}}}function tA(n){const{target:a}=n,{x:o,y:l}=Dr(n);gi=!0,af({target:a,x:o,y:l}),fr(),On.length>0&&(hr("down",n),Rr(),n.preventDefault(),_x(a)||n.stopImmediatePropagation())}function ad(n){const{x:a,y:o}=Dr(n);if(gi&&n.type!=="pointerleave"&&n.buttons===0&&(gi=!1,hr("up",n)),!gi){const{target:l}=n;af({target:l,x:a,y:o})}hr("move",n),Rr(),On.length>0&&n.preventDefault()}function sd(n){const{target:a}=n,{x:o,y:l}=Dr(n);kr.clear(),gi=!1,On.length>0&&(n.preventDefault(),_x(a)||n.stopImmediatePropagation()),hr("up",n),af({target:a,x:o,y:l}),Rr(),fr()}function _x(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:o}){On.splice(0);let l=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(l=n),zo.forEach(u=>{const{element:f,hitAreaMargins:h}=u,m=f.getBoundingClientRect(),{bottom:p,left:y,right:C,top:x}=m,b=Jj?h.coarse:h.fine;if(a>=y-b&&a<=C+b&&o>=x-b&&o<=p+b){if(l!==null&&document.contains(l)&&f!==l&&!f.contains(l)&&!l.contains(f)&&$j(l,f)>0){let w=l,O=!1;for(;w&&!w.contains(f);){if(Qj(w.getBoundingClientRect(),m)){O=!0;break}w=w.parentElement}if(O)return}On.push(u)}})}function id(n,a){kr.set(n,a)}function Rr(){let n=!1,a=!1;On.forEach(l=>{const{direction:u}=l;u==="horizontal"?n=!0:a=!0});let o=0;kr.forEach(l=>{o|=l}),n&&a?nd("intersection",o):n?nd("horizontal",o):a?nd("vertical",o):Vj()}let od;function fr(){var n;(n=od)===null||n===void 0||n.abort(),od=new AbortController;const a={capture:!0,signal:od.signal};zo.size&&(gi?(On.length>0&&Fa.forEach((o,l)=>{const{body:u}=l;o>0&&(u.addEventListener("contextmenu",sd,a),u.addEventListener("pointerleave",ad,a),u.addEventListener("pointermove",ad,a))}),Fa.forEach((o,l)=>{const{body:u}=l;u.addEventListener("pointerup",sd,a),u.addEventListener("pointercancel",sd,a)})):Fa.forEach((o,l)=>{const{body:u}=l;o>0&&(u.addEventListener("pointerdown",tA,a),u.addEventListener("pointermove",ad,a))}))}function hr(n,a){zo.forEach(o=>{const{setResizeHandlerState:l}=o,u=On.includes(o);l(n,u,a)})}function nA(){const[n,a]=S.useState(0);return S.useCallback(()=>a(o=>o+1),[])}function Re(n,a){if(!n)throw console.error(a),Error(a)}function As(n,a,o=tf){return n.toFixed(o)===a.toFixed(o)?0:n>a?1:-1}function pa(n,a,o=tf){return As(n,a,o)===0}function rn(n,a,o){return As(n,a,o)===0}function aA(n,a,o){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,o))return!1}return!0}function pi({panelConstraints:n,panelIndex:a,size:o}){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(As(o,m)<0)if(f){const p=(u+m)/2;As(o,p)<0?o=u:o=m}else o=m;return o=Math.min(h,o),o=parseFloat(o.toFixed(tf)),o}function No({delta:n,initialLayout:a,panelConstraints:o,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=o[x];Re(b,`Panel constraints not found for index ${x}`);const{collapsedSize:N=0,collapsible:w,minSize:O=0}=b;if(w){const D=a[x];if(Re(D!=null,`Previous layout not found for panel index ${x}`),rn(D,N)){const M=O-D;As(M,Math.abs(n))>0&&(n=n<0?0-M:M)}}}{const x=n<0?m:p,b=o[x];Re(b,`No panel constraints found for index ${x}`);const{collapsedSize:N=0,collapsible:w,minSize:O=0}=b;if(w){const D=a[x];if(Re(D!=null,`Previous layout not found for panel index ${x}`),rn(D,O)){const M=D-N;As(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 O=a[b];Re(O!=null,`Previous layout not found for panel index ${b}`);const M=pi({panelConstraints:o,panelIndex:b,size:100})-O;if(N+=M,b+=x,b<0||b>=o.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<o.length;){const N=Math.abs(n)-Math.abs(y),w=a[b];Re(w!=null,`Previous layout not found for panel index ${b}`);const O=w-N,D=pi({panelConstraints:o,panelIndex:b,size:O});if(!rn(w,D)&&(y+=w-D,h[b]=D,y.toFixed(3).localeCompare(Math.abs(n).toFixed(3),void 0,{numeric:!0})>=0))break;n<0?b--:b++}}if(aA(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=pi({panelConstraints:o,panelIndex:x,size:N});if(h[x]=w,!rn(w,N)){let O=N-w,M=n<0?p:m;for(;M>=0&&M<o.length;){const I=h[M];Re(I!=null,`Previous layout not found for panel index ${M}`);const B=I+O,U=pi({panelConstraints:o,panelIndex:M,size:B});if(rn(I,U)||(O-=U-I,h[M]=U),rn(O,0))break;n>0?M--:M++}}}const C=h.reduce((x,b)=>b+x,0);return rn(C,100)?h:u}function sA({layout:n,panelsArray:a,pivotIndices:o}){let l=0,u=100,f=0,h=0;const m=o[0];Re(m!=null,"No pivot index found"),a.forEach((x,b)=>{const{constraints:N}=x,{maxSize:w=100,minSize:O=0}=N;b===m?(l=O,u=w):(f+=O,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 Lo(n,a=document){return Array.from(a.querySelectorAll(`[${rt.resizeHandleId}][data-panel-group-id="${n}"]`))}function zx(n,a,o=document){const u=Lo(n,o).findIndex(f=>f.getAttribute(rt.resizeHandleId)===a);return u??null}function Lx(n,a,o){const l=zx(n,a,o);return l!=null?[l,l+1]:[-1,-1]}function iA(n){return n instanceof HTMLElement?!0:typeof n=="object"&&n!==null&&"tagName"in n&&"getAttribute"in n}function Px(n,a=document){if(iA(a)&&a.dataset.panelGroupId==n)return a;const o=a.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return o||null}function _r(n,a=document){const o=a.querySelector(`[${rt.resizeHandleId}="${n}"]`);return o||null}function oA(n,a,o,l=document){var u,f,h,m;const p=_r(a,l),y=Lo(n,l),C=p?y.indexOf(p):-1,x=(u=(f=o[C])===null||f===void 0?void 0:f.id)!==null&&u!==void 0?u:null,b=(h=(m=o[C+1])===null||m===void 0?void 0:m.id)!==null&&h!==void 0?h:null;return[x,b]}function lA({committedValuesRef:n,eagerValuesRef:a,groupId:o,layout:l,panelDataArray:u,panelGroupElement:f,setLayout:h}){S.useRef({didWarnAboutMissingResizeHandle:!1}),ws(()=>{if(!f)return;const m=Lo(o,f);for(let p=0;p<u.length-1;p++){const{valueMax:y,valueMin:C,valueNow:x}=sA({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")})}},[o,l,u,f]),S.useEffect(()=>{if(!f)return;const m=a.current;Re(m,"Eager values not found");const{panelDataArray:p}=m,y=Px(o,f);Re(y!=null,`No group found for id "${o}"`);const C=Lo(o,f);Re(C,`No resize handles found for group id "${o}"`);const x=C.map(b=>{const N=b.getAttribute(rt.resizeHandleId);Re(N,"Resize handle element has no handle id attribute");const[w,O]=oA(o,N,p,f);if(w==null||O==null)return()=>{};const D=M=>{if(!M.defaultPrevented)switch(M.key){case"Enter":{M.preventDefault();const I=p.findIndex(B=>B.id===w);if(I>=0){const B=p[I];Re(B,`No panel data found for index ${I}`);const U=l[I],{collapsedSize:k=0,collapsible:j,minSize:L=0}=B.constraints;if(U!=null&&j){const X=No({delta:rn(U,k)?L-k:k-U,initialLayout:l,panelConstraints:p.map(F=>F.constraints),pivotIndices:Lx(o,N,f),prevLayout:l,trigger:"keyboard"});l!==X&&h(X)}}break}}};return b.addEventListener("keydown",D),()=>{b.removeEventListener("keydown",D)}});return()=>{x.forEach(b=>b())}},[f,n,a,o,l,u,h])}function Zg(n,a){if(n.length!==a.length)return!1;for(let o=0;o<n.length;o++)if(n[o]!==a[o])return!1;return!0}function Ux(n,a){const o=n==="horizontal",{x:l,y:u}=Dr(a);return o?l:u}function rA(n,a,o,l,u){const f=o==="horizontal",h=_r(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(o,n),C=Px(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 cA(n,a,o,l,u,f){if(Ax(n)){const h=o==="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:rA(n,a,o,l,f)}function uA({panelDataArray:n}){const a=Array(n.length),o=n.map(f=>f.constraints);let l=0,u=100;for(let f=0;f<n.length;f++){const h=o[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=o[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 hi(n,a,o){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=o[p];if(x==null||l!==x){o[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 o=0;o<n.length;o++)if(n[o]!=a[o])return!1;return!0}function dA({defaultSize:n,dragState:a,layout:o,panelData:l,panelIndex:u,precision:f=3}){const h=o[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 fA(n,a=10){let o=null;return(...u)=>{o!==null&&clearTimeout(o),o=setTimeout(()=>{n(...u)},a)}}function Jg(n){try{if(typeof localStorage<"u")n.getItem=a=>localStorage.getItem(a),n.setItem=(a,o)=>{localStorage.setItem(a,o)};else throw new Error("localStorage not supported in this environment")}catch(a){console.error(a),n.getItem=()=>null,n.setItem=()=>{}}}function Hx(n){return`react-resizable-panels:${n}`}function Ix(n){return n.map(a=>{const{constraints:o,id:l,idIsFromProps:u,order:f}=a;return u?l:f?`${f}:${JSON.stringify(o)}`:JSON.stringify(o)}).sort((a,o)=>a.localeCompare(o)).join(",")}function Bx(n,a){try{const o=Hx(n),l=a.getItem(o);if(l){const u=JSON.parse(l);if(typeof u=="object"&&u!=null)return u}}catch{}return null}function hA(n,a,o){var l,u;const f=(l=Bx(n,o))!==null&&l!==void 0?l:{},h=Ix(a);return(u=f[h])!==null&&u!==void 0?u:null}function mA(n,a,o,l,u){var f;const h=Hx(n),m=Ix(a),p=(f=Bx(n,u))!==null&&f!==void 0?f:{};p[m]={expandToSizes:Object.fromEntries(o.entries()),layout:l};try{u.setItem(h,JSON.stringify(p))}catch(y){console.error(y)}}function ey({layout:n,panelConstraints:a}){const o=[...n],l=o.reduce((f,h)=>f+h,0);if(o.length!==a.length)throw Error(`Invalid ${a.length} panel layout: ${o.map(f=>`${f}%`).join(", ")}`);if(!rn(l,100)&&o.length>0)for(let f=0;f<a.length;f++){const h=o[f];Re(h!=null,`No layout data found for index ${f}`);const m=100/l*h;o[f]=m}let u=0;for(let f=0;f<a.length;f++){const h=o[f];Re(h!=null,`No layout data found for index ${f}`);const m=pi({panelConstraints:a,panelIndex:f,size:h});h!=m&&(u+=h-m,o[f]=m)}if(!rn(u,0))for(let f=0;f<a.length;f++){const h=o[f];Re(h!=null,`No layout data found for index ${f}`);const m=h+u,p=pi({panelConstraints:a,panelIndex:f,size:m});if(h!==p&&(u-=p-h,o[f]=p,rn(u,0)))break}return o}const pA=100,jo={getItem:n=>(Jg(jo),jo.getItem(n)),setItem:(n,a)=>{Jg(jo),jo.setItem(n,a)}},ty={};function qx({autoSaveId:n=null,children:a,className:o="",direction:l,forwardedRef:u,id:f=null,onLayout:h=null,keyboardResizeBy:m=null,storage:p=jo,style:y,tagName:C="div",...x}){const b=nf(f),N=S.useRef(null),[w,O]=S.useState(null),[D,M]=S.useState([]),I=nA(),B=S.useRef({}),U=S.useRef(new Map),k=S.useRef(0),j=S.useRef({autoSaveId:n,direction:l,dragState:w,id:b,keyboardResizeBy:m,onLayout:h,storage:p}),L=S.useRef({layout:D,panelDataArray:[],panelDataArrayChanged:!1});S.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),S.useImperativeHandle(u,()=>({getId:()=>j.current.id,getLayout:()=>{const{layout:V}=L.current;return V},setLayout:V=>{const{onLayout:J}=j.current,{layout:oe,panelDataArray:ne}=L.current,ie=ey({layout:V,panelConstraints:ne.map(xe=>xe.constraints)});Zg(oe,ie)||(M(ie),L.current.layout=ie,J&&J(ie),hi(ne,ie,B.current))}}),[]),ws(()=>{j.current.autoSaveId=n,j.current.direction=l,j.current.dragState=w,j.current.id=b,j.current.onLayout=h,j.current.storage=p}),lA({committedValuesRef:j,eagerValuesRef:L,groupId:b,layout:D,panelDataArray:L.current.panelDataArray,setLayout:M,panelGroupElement:N.current}),S.useEffect(()=>{const{panelDataArray:V}=L.current;if(n){if(D.length===0||D.length!==V.length)return;let J=ty[n];J==null&&(J=fA(mA,pA),ty[n]=J);const oe=[...V],ne=new Map(U.current);J(n,oe,ne,D,p)}},[n,D,p]),S.useEffect(()=>{});const X=S.useCallback(V=>{const{onLayout:J}=j.current,{layout:oe,panelDataArray:ne}=L.current;if(V.constraints.collapsible){const ie=ne.map(St=>St.constraints),{collapsedSize:xe=0,panelSize:_e,pivotIndices:Ke}=bs(ne,V,oe);if(Re(_e!=null,`Panel size not found for panel "${V.id}"`),!pa(_e,xe)){U.current.set(V.id,_e);const Ct=mi(ne,V)===ne.length-1?_e-xe:xe-_e,Ye=No({delta:Ct,initialLayout:oe,panelConstraints:ie,pivotIndices:Ke,prevLayout:oe,trigger:"imperative-api"});tr(oe,Ye)||(M(Ye),L.current.layout=Ye,J&&J(Ye),hi(ne,Ye,B.current))}}},[]),F=S.useCallback((V,J)=>{const{onLayout:oe}=j.current,{layout:ne,panelDataArray:ie}=L.current;if(V.constraints.collapsible){const xe=ie.map(nt=>nt.constraints),{collapsedSize:_e=0,panelSize:Ke=0,minSize:St=0,pivotIndices:Ct}=bs(ie,V,ne),Ye=J??St;if(pa(Ke,_e)){const nt=U.current.get(V.id),Ut=nt!=null&&nt>=Ye?nt:Ye,Gn=mi(ie,V)===ie.length-1?Ke-Ut:Ut-Ke,Ee=No({delta:Gn,initialLayout:ne,panelConstraints:xe,pivotIndices:Ct,prevLayout:ne,trigger:"imperative-api"});tr(ne,Ee)||(M(Ee),L.current.layout=Ee,oe&&oe(Ee),hi(ie,Ee,B.current))}}},[]),Q=S.useCallback(V=>{const{layout:J,panelDataArray:oe}=L.current,{panelSize:ne}=bs(oe,V,J);return Re(ne!=null,`Panel size not found for panel "${V.id}"`),ne},[]),ae=S.useCallback((V,J)=>{const{panelDataArray:oe}=L.current,ne=mi(oe,V);return dA({defaultSize:J,dragState:w,layout:D,panelData:oe,panelIndex:ne})},[w,D]),te=S.useCallback(V=>{const{layout:J,panelDataArray:oe}=L.current,{collapsedSize:ne=0,collapsible:ie,panelSize:xe}=bs(oe,V,J);return Re(xe!=null,`Panel size not found for panel "${V.id}"`),ie===!0&&pa(xe,ne)},[]),ye=S.useCallback(V=>{const{layout:J,panelDataArray:oe}=L.current,{collapsedSize:ne=0,collapsible:ie,panelSize:xe}=bs(oe,V,J);return Re(xe!=null,`Panel size not found for panel "${V.id}"`),!ie||As(xe,ne)>0},[]),de=S.useCallback(V=>{const{panelDataArray:J}=L.current;J.push(V),J.sort((oe,ne)=>{const ie=oe.order,xe=ne.order;return ie==null&&xe==null?0:ie==null?-1:xe==null?1:ie-xe}),L.current.panelDataArrayChanged=!0,I()},[I]);ws(()=>{if(L.current.panelDataArrayChanged){L.current.panelDataArrayChanged=!1;const{autoSaveId:V,onLayout:J,storage:oe}=j.current,{layout:ne,panelDataArray:ie}=L.current;let xe=null;if(V){const Ke=hA(V,ie,oe);Ke&&(U.current=new Map(Object.entries(Ke.expandToSizes)),xe=Ke.layout)}xe==null&&(xe=uA({panelDataArray:ie}));const _e=ey({layout:xe,panelConstraints:ie.map(Ke=>Ke.constraints)});Zg(ne,_e)||(M(_e),L.current.layout=_e,J&&J(_e),hi(ie,_e,B.current))}}),ws(()=>{const V=L.current;return()=>{V.layout=[]}},[]);const Ce=S.useCallback(V=>{let J=!1;const oe=N.current;return oe&&window.getComputedStyle(oe,null).getPropertyValue("direction")==="rtl"&&(J=!0),function(ie){ie.preventDefault();const xe=N.current;if(!xe)return()=>null;const{direction:_e,dragState:Ke,id:St,keyboardResizeBy:Ct,onLayout:Ye}=j.current,{layout:nt,panelDataArray:Ut}=L.current,{initialLayout:Qt}=Ke??{},Gn=Lx(St,V,xe);let Ee=cA(ie,V,_e,Ke,Ct,xe);const $t=_e==="horizontal";$t&&J&&(Ee=-Ee);const Dn=Ut.map(Yn=>Yn.constraints),Wt=No({delta:Ee,initialLayout:Qt??nt,panelConstraints:Dn,pivotIndices:Gn,prevLayout:nt,trigger:Ax(ie)?"keyboard":"mouse-or-touch"}),Sa=!tr(nt,Wt);(Ex(ie)||Mx(ie))&&k.current!=Ee&&(k.current=Ee,!Sa&&Ee!==0?$t?id(V,Ee<0?Tx:Dx):id(V,Ee<0?kx:Rx):id(V,0)),Sa&&(M(Wt),L.current.layout=Wt,Ye&&Ye(Wt),hi(Ut,Wt,B.current))}},[]),R=S.useCallback((V,J)=>{const{onLayout:oe}=j.current,{layout:ne,panelDataArray:ie}=L.current,xe=ie.map(nt=>nt.constraints),{panelSize:_e,pivotIndices:Ke}=bs(ie,V,ne);Re(_e!=null,`Panel size not found for panel "${V.id}"`);const Ct=mi(ie,V)===ie.length-1?_e-J:J-_e,Ye=No({delta:Ct,initialLayout:ne,panelConstraints:xe,pivotIndices:Ke,prevLayout:ne,trigger:"imperative-api"});tr(ne,Ye)||(M(Ye),L.current.layout=Ye,oe&&oe(Ye),hi(ie,Ye,B.current))},[]),W=S.useCallback((V,J)=>{const{layout:oe,panelDataArray:ne}=L.current,{collapsedSize:ie=0,collapsible:xe}=J,{collapsedSize:_e=0,collapsible:Ke,maxSize:St=100,minSize:Ct=0}=V.constraints,{panelSize:Ye}=bs(ne,V,oe);Ye!=null&&(xe&&Ke&&pa(Ye,ie)?pa(ie,_e)||R(V,_e):Ye<Ct?R(V,Ct):Ye>St&&R(V,St))},[R]),ee=S.useCallback((V,J)=>{const{direction:oe}=j.current,{layout:ne}=L.current;if(!N.current)return;const ie=_r(V,N.current);Re(ie,`Drag handle element not found for id "${V}"`);const xe=Ux(oe,J);O({dragHandleId:V,dragHandleRect:ie.getBoundingClientRect(),initialCursorPosition:xe,initialLayout:ne})},[]),$=S.useCallback(()=>{O(null)},[]),ce=S.useCallback(V=>{const{panelDataArray:J}=L.current,oe=mi(J,V);oe>=0&&(J.splice(oe,1),delete B.current[V.id],L.current.panelDataArrayChanged=!0,I())},[I]),fe=S.useMemo(()=>({collapsePanel:X,direction:l,dragState:w,expandPanel:F,getPanelSize:Q,getPanelStyle:ae,groupId:b,isPanelCollapsed:te,isPanelExpanded:ye,reevaluatePanelConstraints:W,registerPanel:de,registerResizeHandle:Ce,resizePanel:R,startDragging:ee,stopDragging:$,unregisterPanel:ce,panelGroupElement:N.current}),[X,w,l,F,Q,ae,b,te,ye,W,de,Ce,R,ee,$,ce]),Ne={display:"flex",flexDirection:l==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return S.createElement(Tr.Provider,{value:fe},S.createElement(C,{...x,children:a,className:o,id:f,ref:N,style:{...Ne,...y},[rt.group]:"",[rt.groupDirection]:l,[rt.groupId]:b}))}const sf=S.forwardRef((n,a)=>S.createElement(qx,{...n,forwardedRef:a}));qx.displayName="PanelGroup";sf.displayName="forwardRef(PanelGroup)";function mi(n,a){return n.findIndex(o=>o===a||o.id===a.id)}function bs(n,a,o){const l=mi(n,a),f=l===n.length-1?[l-1,l]:[l,l+1],h=o[l];return{...a.constraints,panelSize:h,pivotIndices:f}}function gA({disabled:n,handleId:a,resizeHandler:o,panelGroupElement:l}){S.useEffect(()=>{if(n||o==null||l==null)return;const u=_r(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(),o(h);break}case"F6":{h.preventDefault();const m=u.getAttribute(rt.groupId);Re(m,`No group element found for id "${m}"`);const p=Lo(m,l),y=zx(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,o])}function of({children:n=null,className:a="",disabled:o=!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 O,D;const M=S.useRef(null),I=S.useRef({onClick:h,onDragging:m,onPointerDown:y,onPointerUp:C});S.useEffect(()=>{I.current.onClick=h,I.current.onDragging=m,I.current.onPointerDown=y,I.current.onPointerUp=C});const B=S.useContext(Tr);if(B===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:U,groupId:k,registerResizeHandle:j,startDragging:L,stopDragging:X,panelGroupElement:F}=B,Q=nf(u),[ae,te]=S.useState("inactive"),[ye,de]=S.useState(!1),[Ce,R]=S.useState(null),W=S.useRef({state:ae});ws(()=>{W.current.state=ae}),S.useEffect(()=>{if(o)R(null);else{const fe=j(Q);R(()=>fe)}},[o,Q,j]);const ee=(O=l?.coarse)!==null&&O!==void 0?O:15,$=(D=l?.fine)!==null&&D!==void 0?D:5;S.useEffect(()=>{if(o||Ce==null)return;const fe=M.current;Re(fe,"Element ref not attached");let Ne=!1;return eA(Q,fe,U,{coarse:ee,fine:$},(J,oe,ne)=>{if(!oe){te("inactive");return}switch(J){case"down":{te("drag"),Ne=!1,Re(ne,'Expected event to be defined for "down" action'),L(Q,ne);const{onDragging:ie,onPointerDown:xe}=I.current;ie?.(!0),xe?.();break}case"move":{const{state:ie}=W.current;Ne=!0,ie!=="drag"&&te("hover"),Re(ne,'Expected event to be defined for "move" action'),Ce(ne);break}case"up":{te("hover"),X();const{onClick:ie,onDragging:xe,onPointerUp:_e}=I.current;xe?.(!1),_e?.(),Ne||ie?.();break}}})},[ee,U,o,$,j,Q,Ce,L,X]),gA({disabled:o,handleId:Q,resizeHandler:Ce,panelGroupElement:F});const ce={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:{...ce,...x},tabIndex:b,[rt.groupDirection]:U,[rt.groupId]:k,[rt.resizeHandle]:"",[rt.resizeHandleActive]:ae==="drag"?"pointer":ye?"keyboard":void 0,[rt.resizeHandleEnabled]:!o,[rt.resizeHandleId]:Q,[rt.resizeHandleState]:ae})}of.displayName="PanelResizeHandle";const bi=S.forwardRef(({className:n,children:a,...o},l)=>r.jsxs(Hy,{ref:l,className:q("relative overflow-hidden",n),...o,children:[r.jsx(oS,{className:"h-full w-full rounded-[inherit]",children:a}),r.jsx(Kx,{}),r.jsx(lS,{})]}));bi.displayName=Hy.displayName;const Kx=S.forwardRef(({className:n,orientation:a="vertical",...o},l)=>r.jsx(Iy,{ref:l,orientation:a,className:q("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),...o,children:r.jsx(rS,{className:"relative flex-1 rounded-full bg-border"})}));Kx.displayName=Iy.displayName;function yA(n){const a={provider:"unknown",endpoint:"unknown",timestamp:new Date,raw:n},o=n.match(/error-api-provider-([^-]+)-/);o&&(a.provider=o[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 xA(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},o=n.split(/^===\s*(.+?)\s*===$/m);let l="";for(let u=0;u<o.length;u++){const f=o[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":vA(f,a);break;case"headers":a.requestHeaders=bA(f);break;case"request_body":a.requestBody=f;break;case"response":SA(f,a);break}}return CA(a),a}function vA(n,a){const o=n.split(`
11
- `);for(const l of o){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 bA(n){const a={},o=n.split(`
12
- `);for(const l of o){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 SA(n,a){const o=n.split(`
13
- `);let l=!1;const u=[];for(const f of o){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(" ")||jA(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 CA(n){const a=n.url.match(/\/api\/provider\/([^/]+)/);a&&(n.provider=a[1]);const o=n.url.match(/\/api\/provider\/[^/]+\/(.+?)(?:\?|$)/);o&&(n.endpoint=o[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"),wA(n),n.statusCode===429&&NA(n)}function wA(n){if(n.requestBody)try{const a=JSON.parse(n.requestBody);typeof a.model=="string"&&(n.model=a.model)}catch{}}function NA(n){if(n.responseBody)try{const a=JSON.parse(n.responseBody),o=wd(a);o!==null&&(n.quotaResetDelay=o);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 o=a.quotaResetDelay;if(typeof o=="number")return o;if(typeof o=="string"){const l=o.match(/^(\d+)s?$/);if(l)return parseInt(l[1],10)}}if("error"in a&&typeof a.error=="object"){const o=wd(a.error);if(o!==null)return o}if("details"in a&&Array.isArray(a.details))for(const o of a.details){const l=wd(o);if(l!==null)return l}return null}function Nd(n){if(typeof n!="object"||n===null)return null;const a=n;for(const o of["quotaResetTimeStamp","quotaResetTimestamp","resetTime","reset_time"])if(o in a&&typeof a[o]=="string")return a[o];if("error"in a&&typeof a.error=="object"){const o=Nd(a.error);if(o)return o}if("details"in a&&Array.isArray(a.details))for(const o of a.details){const l=Nd(o);if(l)return l}return null}function jA(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 AA(n,a){const o=zd(),l=o==="zh-CN",u=Date.now(),f=n*1e3,h=u-f,m=Math.floor(h/1e3),p=Math.floor(m/60),y=Math.floor(p/60),C=Math.floor(y/24);return m<60?l?"刚刚":"just now":p<60?l?`${p} 分钟前`:`${p}m ago`:y<24?l?`${y} 小时前`:`${y}h ago`:C<7?l?`${C} 天前`:`${C}d ago`:new Date(f).toLocaleDateString(o,{month:"short",day:"numeric"})}function EA(n){return n>=500?"text-red-500":n===429?"text-orange-500":n>=400?"text-yellow-500":"text-gray-500"}function MA(n,a){const o=zd()==="zh-CN";return(o?{rate_limit:"限流",auth:"认证错误",not_found:"未找到",server:"服务错误",timeout:"超时",unknown:"错误"}:{rate_limit:"Rate Limited",auth:"Auth Error",not_found:"Not Found",server:"Server Error",timeout:"Timeout",unknown:"Error"})[n]||(o?"错误":"Error")}function OA(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),o=Math.floor(n%3600/60);return o>0?`${a}h ${o}m`:`${a}h`}function TA(n,a){if(!n)return null;const o=zd()==="zh-CN";try{const l=new Date(n),u=new Date,f=l.getTime()-u.getTime();if(f<=0)return o?"现在":"now";const h=Math.floor(f/1e3);if(h<60)return o?`${h}秒`:`${h}s`;if(h<3600){const y=Math.floor(h/60);return o?`${y}分钟`:`${y}m`}const m=Math.floor(h/3600),p=Math.floor(h%3600/60);return o?p>0?`${m}小时 ${p}分钟`:`${m}小时`:p>0?`${m}h ${p}m`:`${m}h`}catch{return null}}function DA(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 kA(n){return n||""}function RA({name:n,size:a,modified:o,isSelected:l,onClick:u,statusCode:f,model:h}){const m=S.useMemo(()=>yA(n),[n]),p=S.useMemo(()=>kA(h),[h]);return r.jsxs("button",{onClick:u,className:q("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:q("shrink-0 text-[10px] font-bold px-1.5 py-0.5 rounded min-w-[32px] text-center",DA(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(ko,{className:"w-2.5 h-2.5"}),r.jsx("span",{children:AA(o)})]})]})]})}function ny({value:n,className:a,variant:o="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(Cs,{children:r.jsxs($a,{children:[r.jsx(Wa,{asChild:!0,children:r.jsxs(ut,{size:l,variant:o,className:q("relative z-10 text-muted-foreground hover:text-foreground",a),onClick:p=>{p.stopPropagation(),m()},children:[f?r.jsx(yi,{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 So({active:n,onClick:a,children:o,icon:l}){return r.jsxs("button",{onClick:a,className:q("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"}),o]})}function Gx({code:n}){const a=EA(n);return r.jsx("span",{className:q("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 _A({parsed:n}){const{t:a}=Lt(),o=OA(n.quotaResetDelay)||TA(n.quotaResetTimestamp),l=a("errorLogs.na");return r.jsx(bi,{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:MA(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"&&o&&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(ko,{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:o})]})]}),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:q("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:q("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 zA({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(bi,{className:"h-full",children:r.jsx("div",{className:"p-4 space-y-1",children:a.map(([o,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:[o,":"]}),r.jsx("span",{className:"break-all",children:l})]},o))})})}function ay({content:n,label:a}){const{t:o}=Lt();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:o(f)})}let l=n,u=!1;try{const f=JSON.parse(n);l=JSON.stringify(f,null,2),u=!0}catch{}return r.jsx(bi,{className:"h-full",children:r.jsx("pre",{className:q("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 LA({content:n}){return r.jsx(bi,{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 PA({name:n,absolutePath:a}){const{t:o}=Lt(),[l,u]=S.useState("overview"),{data:f,isLoading:h,error:m}=pj(n),p=S.useMemo(()=>f?xA(f):null,[f]);return n?h?r.jsxs("div",{className:"flex-1 p-6 space-y-3",children:[r.jsx(qe,{className:"h-5 w-full"}),r.jsx(qe,{className:"h-5 w-3/4"}),r.jsx(qe,{className:"h-5 w-5/6"}),r.jsx(qe,{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:o("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:o("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:o("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(So,{active:l==="overview",onClick:()=>u("overview"),icon:wr,children:o("errorLogs.tabOverview")}),r.jsx(So,{active:l==="headers",onClick:()=>u("headers"),icon:VS,children:o("errorLogs.tabHeaders")}),r.jsx(So,{active:l==="request",onClick:()=>u("request"),icon:FS,children:o("errorLogs.tabRequest")}),r.jsx(So,{active:l==="response",onClick:()=>u("response"),icon:QS,children:o("errorLogs.tabResponse")}),r.jsx(So,{active:l==="raw",onClick:()=>u("raw"),icon:$S,children:o("errorLogs.tabRaw")})]}),r.jsxs("div",{className:"flex-1 overflow-hidden bg-card/30",children:[l==="overview"&&r.jsx(_A,{parsed:p}),l==="headers"&&r.jsx(zA,{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(LA,{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:o("errorLogs.selectLog")})]})})}function UA(){const{t:n}=Lt(),{data:a,isLoading:o}=uj(),{data:l,isLoading:u,error:f}=mj(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=j=>{const L=C.current;if(!L)return;const F=L.getBoundingClientRect().top+window.scrollY,Q=j.pageY-F;m(Math.max(300,Q));const te=window.innerHeight-j.clientY,ye=15;b(),te<50?x.current=setInterval(()=>{window.scrollBy(0,ye)},16):j.clientY<50&&(x.current=setInterval(()=>{window.scrollBy(0,-ye)},16))},k=()=>{y(!1),b(),document.body.style.cursor="default",document.body.style.userSelect="auto"};return document.addEventListener("mousemove",U),document.addEventListener("mouseup",k),document.body.style.cursor="row-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",U),document.removeEventListener("mouseup",k),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]),[O,D]=S.useState(null),M=O??w,I=S.useMemo(()=>!M||!l?void 0:l.find(k=>k.name===M)?.absolutePath,[M,l]);if(o||!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(qe,{className:"h-4 w-32"}),r.jsx(qe,{className:"h-4 w-20"})]}),r.jsx("div",{className:"p-4 space-y-3",children:[1,2,3].map(U=>r.jsx(qe,{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(sf,{direction:"horizontal",children:[r.jsx(_o,{defaultSize:30,minSize:20,maxSize:50,className:"flex flex-col min-w-0",children:r.jsxs(bi,{className:"h-full",children:[r.jsx("div",{className:"divide-y divide-border/50",children:l.slice(0,50).map(U=>r.jsx(RA,{name:U.name,size:U.size,modified:U.modified,isSelected:M===U.name,onClick:()=>D(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(of,{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(_o,{className:"flex flex-col min-w-0 bg-background/50",children:r.jsx(PA,{name:M,absolutePath:I})})]})}),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 HA=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,...o},l)=>r.jsx("div",{ref:l,role:"alert",className:q(HA({variant:a}),n),...o}));lf.displayName="Alert";const Yx=S.forwardRef(({className:n,...a},o)=>r.jsx("h5",{ref:o,className:q("mb-1 font-medium leading-none tracking-tight",n),...a}));Yx.displayName="AlertTitle";const rf=S.forwardRef(({className:n,...a},o)=>r.jsx("div",{ref:o,className:q("text-sm [&_p]:leading-relaxed",n),...a}));rf.displayName="AlertDescription";function IA(){return Et({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 BA(n){const a=n.trim().toLowerCase();return a.startsWith("<!doctype html")||a.startsWith("<html")}function qA(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 o=await n.text(),l=Fx(o);if(!n.ok){const u=Vx(l,a);throw new Error(u)}if(l===null)throw new Error(a);return l}function KA(){return Et({queryKey:["shared","summary"],queryFn:async()=>{const n=await fetch("/api/shared/summary");return Qx(n,"Failed to fetch shared summary")}})}function kT(n){return Et({queryKey:["shared",n],queryFn:async()=>{const a=await fetch(`/api/shared/${n}`);return Qx(a,`Failed to fetch shared ${n}`)}})}function RT(n,a){return Et({queryKey:["shared",n,"content",a],enabled:typeof a=="string"&&a.length>0,queryFn:async()=>{if(!a)throw new Error("Missing shared item path");const o=new URLSearchParams({type:n,path:a}),l=await fetch(`/api/shared/content?${o.toString()}`),u=await l.text(),f=Fx(u);if(!l.ok)throw new Error(Vx(f,`Failed to fetch shared ${n} content`));if(qA(f))return{content:f.content,contentPath:typeof f.contentPath=="string"&&f.contentPath.length>0?f.contentPath:a};if(u.trim().length>0){if(BA(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 GA={ok:"success",warning:"warning",error:"error"},YA={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:o,variant:l="default",onClick:u}){const f=YA[l];return r.jsxs("button",{onClick:u,className:q("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:q("flex items-center justify-center w-9 h-9 rounded-md",f.iconBg),children:r.jsx(o,{className:q("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:q("text-lg font-bold font-mono leading-tight",f.iconColor),children:a})]})]})}function VA(){const{t:n}=Lt(),a=Od(),{data:o,isLoading:l}=IA(),{data:u,isLoading:f}=KA();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(qe,{className:"h-12 w-12 rounded-lg"}),r.jsxs("div",{children:[r.jsx(qe,{className:"h-7 w-[180px] mb-2"}),r.jsx(qe,{className:"h-4 w-[220px]"})]})]}),r.jsx("div",{className:"flex items-center gap-3",children:[1,2,3,4].map(m=>r.jsx(qe,{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(qe,{className:"h-4 w-32"}),r.jsx(qe,{className:"h-4 w-20"})]}),r.jsx("div",{className:"px-4 py-3 border-b",children:r.jsx(qe,{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(qe,{className:"w-2.5 h-2.5 rounded-full"}),r.jsx(qe,{className:"h-4 flex-1"}),r.jsx(qe,{className:"h-1.5 w-24 rounded-full"}),r.jsx(qe,{className:"h-4 w-16"})]},m))]})]});const h=o?.health?GA[o.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(W1,{version:o?.version}),r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx(nr,{title:n("home.profiles"),value:o?.profiles??0,icon:Yy,variant:"accent",onClick:()=>a("/providers")}),r.jsx(nr,{title:n("home.cliproxy"),value:o?.cliproxy??0,icon:Vy,variant:"accent",onClick:()=>a("/cliproxy")}),r.jsx(nr,{title:n("home.accounts"),value:o?.accounts??0,icon:$y,variant:"default",onClick:()=>a("/accounts")}),r.jsx(nr,{title:n("home.health"),value:o?.health?`${o.health.passed}/${o.health.total}`:"-",icon:To,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(qj,{}),r.jsx(UA,{})]})}const $x=cS,cf=S.forwardRef(({className:n,...a},o)=>r.jsx(By,{ref:o,className:q("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},o)=>r.jsx(qy,{ref:o,className:q("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=qy.displayName;const jd=S.forwardRef(({className:n,...a},o)=>r.jsx(Ky,{ref:o,className:q("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),...a}));jd.displayName=Ky.displayName;function ln({className:n,...a}){return r.jsx(uS,{"data-slot":"label",className:q("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",FA=1440*60*1e3,Wx="1";function Ad(n){const a=parseFloat(n);return isNaN(a)||a===0?0:a*1e6}function sy(n){const a=Ad(n);return a===0?"Free":a<.01?"<$0.01":a<1?`$${a.toFixed(2)}`:`$${a.toFixed(a<10?2:0)}`}function QA(n){const a=sy(n.prompt),o=sy(n.completion);return a==="Free"&&o==="Free"?"Free":`${a}/${o}`}function $A(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 WA(n){return{...n,category:$A(n),pricePerMillionPrompt:Ad(n.pricing.prompt),pricePerMillionCompletion:Ad(n.pricing.completion),isFree:n.pricing.prompt==="0"&&n.pricing.completion==="0",isExacto:n.id.includes(":exacto")}}function XA(n,a,o){const l=a.toLowerCase().trim();return n.filter(u=>o?.category&&u.category!==o.category||o?.freeOnly&&!u.isFree||o?.minContext&&u.context_length<o.minContext?!1:l?u.id.toLowerCase().includes(l)||u.name.toLowerCase().includes(l)||u.description?.toLowerCase().includes(l):!0)}function _T(n){return[...n].sort((a,o)=>{if(a.isFree&&!o.isFree)return-1;if(!a.isFree&&o.isFree)return 1;if(!a.isFree&&!o.isFree){if(a.isExacto&&!o.isExacto)return-1;if(!a.isExacto&&o.isExacto)return 1}return a.name.localeCompare(o.name)})}function ZA(){try{const n=localStorage.getItem(uf);if(!n)return null;const a=JSON.parse(n);return a.version!==Wx||Date.now()-a.fetchedAt>FA?null:a.models}catch{return null}}function JA(n){try{localStorage.setItem(uf,JSON.stringify({models:n,fetchedAt:Date.now(),version:Wx}))}catch{}}function eE(){localStorage.removeItem(uf)}function zT(n,a){const[o]=n.split("/");if(!o)return{};const l=a.filter(h=>h.id.startsWith(`${o}/`));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 tE(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}const LT={anthropic:"Anthropic (Claude)",openai:"OpenAI (GPT)",google:"Google (Gemini)",meta:"Meta (Llama)",mistral:"Mistral",opensource:"Open Source",other:"Other"},nE={anthropic:["anthropic/"],openai:["openai/"],google:["google/"],meta:["meta-llama/","meta/"],mistral:["mistralai/"],opensource:["deepseek/","qwen/","cohere/"],other:[]};function aE(n,a=2){const o=[],l=["anthropic","openai","google","meta","mistral","opensource"];for(const u of l){const f=nE[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));o.push(...m.slice(0,a))}return o.sort((u,f)=>(f.created??0)-(u.created??0))}function sE(n){const o=Date.now()/1e3-n;return o<86400?"Today":o<172800?"Yesterday":o<604800?`${Math.floor(o/86400)}d ago`:o<2592e3?`${Math.floor(o/604800)}w ago`:o<31536e3?`${Math.floor(o/2592e3)}mo ago`:`${Math.floor(o/31536e3)}y ago`}const iE="https://openrouter.ai/api/v1/models",Xx=["openrouter-models"],iy=1440*60*1e3;async function oE(){const n=await fetch(iE);if(!n.ok)throw new Error(`Failed to fetch OpenRouter models: ${n.status}`);const o=(await n.json()).data;return JA(o),o}function Zx(){return Et({queryKey:Xx,queryFn:oE,staleTime:iy,gcTime:iy,initialData:()=>ZA()??void 0,refetchOnWindowFocus:!1})}function lE(){const n=Zx(),a=(n.data??[]).map(WA);return{...n,models:a}}function PT(){const n=dt();return()=>(eE(),n.invalidateQueries({queryKey:Xx}))}function UT(){const{data:n,isLoading:a,isError:o}=Zx();return{isReady:!!n&&n.length>0,isLoading:a,isError:o,modelCount:n?.length??0}}function df({profileEnv:n={}}){const[a,o]=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();o(N)}catch{o(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(Dd,{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 rE=S.lazy(()=>gt(()=>Promise.resolve().then(()=>hf),void 0).then(n=>({default:n.CodeEditor})));function HT({rawJsonContent:n,isRawJsonValid:a,rawJsonEdits:o,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(Tn,{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&&o!==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(vi,{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(rE,{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 oy(n,a){try{var o=n()}catch(l){return a(l)}return o&&o.then?o.then(void 0,a):o}function cE(n,a){for(var o={};n.length;){var l=n[0],u=l.code,f=l.message,h=l.path.join(".");if(!o[h])if("unionErrors"in l){var m=l.unionErrors[0].errors[0];o[h]={message:m.message,type:m.code}}else o[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=o[h].types,y=p&&p[l.code];o[h]=Zy(h,a,o,u,y?[].concat(y,l.message):l.message)}n.shift()}return o}function uE(n,a){for(var o={};n.length;){var l=n[0],u=l.code,f=l.message,h=l.path.join(".");if(!o[h])if(l.code==="invalid_union"&&l.errors.length>0){var m=l.errors[0][0];o[h]={message:m.message,type:m.code}}else o[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=o[h].types,y=p&&p[l.code];o[h]=Zy(h,a,o,u,y?[].concat(y,l.message):l.message)}n.shift()}return o}function dE(n,a,o){if(o===void 0&&(o={}),(function(l){return"_def"in l&&typeof l._def=="object"&&"typeName"in l._def})(n))return function(l,u,f){try{return Promise.resolve(oy(function(){return Promise.resolve(n[o.mode==="sync"?"parse":"parseAsync"](l,a)).then(function(h){return f.shouldUseNativeValidation&&hg({},f),{errors:{},values:o.raw?Object.assign({},l):h}})},function(h){if((function(m){return Array.isArray(m?.issues)})(h))return{values:{},errors:mg(cE(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(oy(function(){return Promise.resolve((o.mode==="sync"?PC:UC)(n,l,a)).then(function(h){return f.shouldUseNativeValidation&&hg({},f),{errors:{},values:o.raw?Object.assign({},l):h}})},function(h){if((function(m){return m instanceof HC})(h))return{values:{},errors:mg(uE(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 IT(){return Et({queryKey:["profiles"],queryFn:()=>Qe.profiles.list()})}function fE(){const n=dt();return pt({mutationFn:a=>Qe.profiles.create(a),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),re.success("Profile created successfully")},onError:a=>{re.error(a.message)}})}function BT(){const n=dt();return pt({mutationFn:a=>Qe.profiles.delete(a),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),re.success("Profile deleted successfully")},onError:a=>{re.error(a.message)}})}const hE="https://openrouter.ai/api",Jx=Object.freeze({kimi:"km"}),ev=[{id:"openrouter",name:"OpenRouter",description:"349+ models from OpenAI, Anthropic, Google, Meta",baseUrl:hE,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:"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",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 mE(n){const a=tv(n);return a.extraEnv&&Object.freeze(a.extraEnv),Object.freeze(a)}function pE(n,a){const o=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(o.has(u.id))throw new Error(`Duplicate preset ID detected: "${u.id}"`);o.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),!o.has(f))throw new Error(`Preset alias "${u}" points to unknown target "${f}"`);if(o.has(h))throw new Error(`Preset alias "${u}" collides with canonical preset ID "${h}"`)}}pE(ev,Jx);const gE=Object.freeze(ev.map(mE));function yE(){return gE.map(tv)}function xE(n){const a=n.trim().toLowerCase();return Jx[a]||a}const vE=Object.freeze({ollama:{apiKeyPlaceholder:""}});function bE(n){const a=vE[n.id];return a?{...n,...a}:{...n}}const SE=yE(),ff=Object.freeze(SE.map(bE));function CE(n){return ff.filter(a=>a.category===n)}function ld(n){const a=xE(n);return ff.find(o=>o.id===a)}const wE=IC({name:xs().min(1,"Name is required").regex(/^[a-zA-Z][a-zA-Z0-9._-]*$/,"Must start with letter, only letters/numbers/.-_"),baseUrl:xs().url("Invalid URL format"),apiKey:xs(),model:xs().optional(),opusModel:xs().optional(),sonnetModel:xs().optional(),haikuModel:xs().optional(),target:BC(["claude","droid"])}),NE=["/chat/completions","/v1/messages","/messages","/completions"],ma="custom",rd="openrouter",cd={name:"",baseUrl:"",apiKey:"",model:"",opusModel:"",sonnetModel:"",haikuModel:"",target:"claude"},jE=CE("recommended"),nv=ff.filter(n=>n.category!=="recommended"),AE=new Set(nv.map(n=>n.id));function qT({open:n,onOpenChange:a,onSuccess:o,initialMode:l="openrouter"}){const{t:u}=Lt(),f=fE(),[h,m]=S.useState("basic"),[p,y]=S.useState(null),[C,x]=S.useState(!1),[b,N]=S.useState(rd),[w,O]=S.useState(""),{models:D}=lE(),{register:M,handleSubmit:I,formState:{errors:B},control:U,reset:k,setValue:j}=qC({resolver:dE(wE),defaultValues:cd}),L=pg({control:U,name:"baseUrl"}),X=pg({control:U,name:"target"}),F=S.useCallback($=>{if(!$){k(cd);return}k({...cd,name:$.defaultProfileName,baseUrl:$.baseUrl,model:$.defaultModel,opusModel:$.defaultModel,sonnetModel:$.defaultModel,haikuModel:$.defaultModel})},[k]),Q=S.useMemo(()=>b===ma?null:ld(b)??null,[b]),ae=S.useMemo(()=>w.trim()?[...XA(D,w)].sort((ce,fe)=>(fe.created??0)-(ce.created??0)).slice(0,20):aE(D,2),[D,w]);S.useEffect(()=>{if(n)if(m("basic"),y(null),x(!1),O(""),l==="normal")N(ma),F(null);else{const $=ld(rd);if($){N($.id),F($);return}N(ma),F(null)}},[n,l,F]);const te=$=>{const ce=ld($);if(ce){N(ce.id),F(ce);return}N(ma),F(null)},ye=$=>{j("model",$.id),j("opusModel",$.id),j("sonnetModel",$.id),j("haikuModel",$.id),O($.name),re.success(`Applied "${$.name}" to all model tiers`,{duration:2e3})};S.useEffect(()=>{if(L&&b===ma){const ce=L.toLowerCase();for(const fe of NE)if(ce.endsWith(fe)){const Ne=L.replace(new RegExp(fe+"$","i"),"");y(`URL ends with "${fe}" - Claude appends this automatically. You likely want: ${Ne}`);return}}y(null)},[L,b]);const de=async $=>{if(Q?.requiresApiKey!==!1&&!$.apiKey){re.error(ct.t("commonToast.apiKeyRequired"));return}const ce={...$,apiKey:$.apiKey||""};try{await f.mutateAsync(ce),re.success(`Profile "${ce.name}" created`),o(ce.name),a(!1)}catch(fe){re.error(fe.message||"Failed to create profile")}},Ce=!!B.name||!!B.baseUrl||!!B.apiKey,R=!!B.model||!!B.opusModel||!!B.sonnetModel||!!B.haikuModel,W=b!==ma&&AE.has(b),ee=Q?.id===rd;return r.jsx(Kd,{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:I(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:[jE.map($=>r.jsx(ly,{preset:$,isSelected:b===$.id,onClick:()=>te($.id)},$.id)),r.jsxs("button",{type:"button",onClick:()=>te(ma),className:q("flex items-center gap-2 px-4 py-2 rounded-md border-2 transition-all text-sm font-medium",b===ma||W?"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||W)&&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($=>r.jsx(ly,{preset:$,isSelected:b===$.id,onClick:()=>te($.id)},$.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(jd,{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:X,onValueChange:$=>j("target",$),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:X==="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(jd,{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:$=>O($.target.value),placeholder:"Type to search (e.g., opus, sonnet, gpt-4o)...",onKeyDown:$=>{$.key==="Enter"&&ae.length>0&&($.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($=>r.jsx(EE,{model:$,onClick:()=>ye($),showAge:!w},$.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(y1,{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:q(f.isPending&&"opacity-80"),children:f.isPending?r.jsxs(r.Fragment,{children:[r.jsx(Tn,{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:o}){return r.jsxs("button",{type:"button",onClick:o,className:q("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 EE({model:n,onClick:a,showAge:o}){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:[o&&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:sE(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:QA(n.pricing)}),r.jsx("span",{children:tE(n.context_length)})]})]})}function ME({className:n,...a}){return r.jsx("div",{"data-slot":"card",className:q("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",n),...a})}function OE({className:n,...a}){return r.jsx("div",{"data-slot":"card-header",className:q("@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 TE({className:n,...a}){return r.jsx("div",{"data-slot":"card-title",className:q("leading-none font-semibold",n),...a})}function DE({className:n,...a}){return r.jsx("div",{"data-slot":"card-description",className:q("text-muted-foreground text-sm",n),...a})}function kE({className:n,...a}){return r.jsx("div",{"data-slot":"card-content",className:q("px-6",n),...a})}const RE=["agy","claude","gemini","codex","qwen","kimi","iflow","kiro","ghcp"],KT=RE.map(n=>({id:n,name:Xd(n),description:E1(n)})),_E=["provider","auth","variant","success"];function GT(n){return n==="account"?1:_E.indexOf(n)}const zE=S.forwardRef(({className:n,value:a=0,max:o=100,indicatorClassName:l,...u},f)=>{const h=Math.min(Math.max(a/o*100,0),100);return r.jsx("div",{ref:f,role:"progressbar","aria-valuemin":0,"aria-valuemax":o,"aria-valuenow":a,className:q("relative h-2 w-full overflow-hidden rounded-full bg-secondary",n),...u,children:r.jsx("div",{className:q("h-full transition-all",l||"bg-primary"),style:{width:`${h}%`}})})});zE.displayName="Progress";const LE=S.lazy(()=>gt(()=>Promise.resolve().then(()=>hf),void 0).then(n=>({default:n.CodeEditor})));function YT({rawJsonContent:n,isRawJsonValid:a,rawJsonEdits:o,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(Tn,{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&&o!==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(vi,{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(LE,{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 PE(){if(ry)return Vt;ry=1;var n=Vt&&Vt.__assign||function(){return n=Object.assign||function(k){for(var j,L=1,X=arguments.length;L<X;L++){j=arguments[L];for(var F in j)Object.prototype.hasOwnProperty.call(j,F)&&(k[F]=j[F])}return k},n.apply(this,arguments)},a=Vt&&Vt.__createBinding||(Object.create?(function(k,j,L,X){X===void 0&&(X=L);var F=Object.getOwnPropertyDescriptor(j,L);(!F||("get"in F?!j.__esModule:F.writable||F.configurable))&&(F={enumerable:!0,get:function(){return j[L]}}),Object.defineProperty(k,X,F)}):(function(k,j,L,X){X===void 0&&(X=L),k[X]=j[L]})),o=Vt&&Vt.__setModuleDefault||(Object.create?(function(k,j){Object.defineProperty(k,"default",{enumerable:!0,value:j})}):function(k,j){k.default=j}),l=Vt&&Vt.__importStar||function(k){if(k&&k.__esModule)return k;var j={};if(k!=null)for(var L in k)L!=="default"&&Object.prototype.hasOwnProperty.call(k,L)&&a(j,k,L);return o(j,k),j},u=Vt&&Vt.__rest||function(k,j){var L={};for(var X in k)Object.prototype.hasOwnProperty.call(k,X)&&j.indexOf(X)<0&&(L[X]=k[X]);if(k!=null&&typeof Object.getOwnPropertySymbols=="function")for(var F=0,X=Object.getOwnPropertySymbols(k);F<X.length;F++)j.indexOf(X[F])<0&&Object.prototype.propertyIsEnumerable.call(k,X[F])&&(L[X[F]]=k[X[F]]);return L};Object.defineProperty(Vt,"__esModule",{value:!0});var f=l(Md()),h=89,m=90,p=77,y=57,C=219,x=222,b=192,N=100,w=3e3,O=typeof window<"u"&&"navigator"in window&&/Win/i.test(navigator.platform),D=typeof window<"u"&&"navigator"in window&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),M="npm__react-simple-code-editor__textarea",I=`
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(j,L){var X=j.autoFocus,F=j.disabled,Q=j.form,ae=j.highlight,te=j.ignoreTabKey,ye=te===void 0?!1:te,de=j.insertSpaces,Ce=de===void 0?!0:de,R=j.maxLength,W=j.minLength,ee=j.name,$=j.onBlur,ce=j.onClick,fe=j.onFocus,Ne=j.onKeyDown,V=j.onKeyUp,J=j.onValueChange,oe=j.padding,ne=oe===void 0?0:oe,ie=j.placeholder,xe=j.preClassName,_e=j.readOnly,Ke=j.required,St=j.style,Ct=j.tabSize,Ye=Ct===void 0?2:Ct,nt=j.textareaClassName,Ut=j.textareaId,Qt=j.value,Gn=u(j,["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"]),Ee=f.useRef({stack:[],offset:-1}),$t=f.useRef(null),Dn=f.useState(!0),Wt=Dn[0],Sa=Dn[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,Te){return Z.substring(0,Te).split(`
41
- `)},Vn=f.useCallback(function(Z,Te){var ve,De,at;Te===void 0&&(Te=!1);var he=Ee.current,Ae=he.stack,be=he.offset;if(Ae.length&&be>-1){Ee.current.stack=Ae.slice(0,be+1);var ke=Ee.current.stack.length;if(ke>N){var Je=ke-N;Ee.current.stack=Ae.slice(Je,ke),Ee.current.offset=Math.max(Ee.current.offset-Je,0)}}var we=Date.now();if(Te){var _t=Ee.current.stack[Ee.current.offset];if(_t&&we-_t.timestamp<w){var Qn=/[^a-z0-9]([a-z0-9]+)$/i,Nt=(ve=Xt(_t.value,_t.selectionStart).pop())===null||ve===void 0?void 0:ve.match(Qn),Zt=(De=Xt(Z.value,Z.selectionStart).pop())===null||De===void 0?void 0:De.match(Qn);if(Nt?.[1]&&(!((at=Zt?.[1])===null||at===void 0)&&at.startsWith(Nt[1]))){Ee.current.stack[Ee.current.offset]=n(n({},Z),{timestamp:we});return}}}Ee.current.stack.push(n(n({},Z),{timestamp:we})),Ee.current.offset++},[]),Ja=f.useCallback(function(){var Z=$t.current;if(Z){var Te=Z.value,ve=Z.selectionStart,De=Z.selectionEnd;Vn({value:Te,selectionStart:ve,selectionEnd:De})}},[Vn]),kn=function(Z){var Te=$t.current;Te&&(Te.value=Z.value,Te.selectionStart=Z.selectionStart,Te.selectionEnd=Z.selectionEnd,J?.(Z.value))},Rn=function(Z){var Te=$t.current,ve=Ee.current.stack[Ee.current.offset];ve&&Te&&(Ee.current.stack[Ee.current.offset]=n(n({},ve),{selectionStart:Te.selectionStart,selectionEnd:Te.selectionEnd})),Vn(Z),kn(Z)},Es=function(){var Z=Ee.current,Te=Z.stack,ve=Z.offset,De=Te[ve-1];De&&(kn(De),Ee.current.offset=Math.max(ve-1,0))},Ci=function(){var Z=Ee.current,Te=Z.stack,ve=Z.offset,De=Te[ve+1];De&&(kn(De),Ee.current.offset=Math.min(ve+1,Te.length-1))},wi=function(Z){if(!(Ne&&(Ne(Z),Z.defaultPrevented))){Z.key==="Escape"&&Z.currentTarget.blur();var Te=Z.currentTarget,ve=Te.value,De=Te.selectionStart,at=Te.selectionEnd,he=(Ce?" ":" ").repeat(Ye);if(Z.key==="Tab"&&!ye&&Wt)if(Z.preventDefault(),Z.shiftKey){var Ae=Xt(ve,De),be=Ae.length-1,ke=Xt(ve,at).length-1,Je=ve.split(`
42
- `).map(function($n,Ms){return Ms>=be&&Ms<=ke&&$n.startsWith(he)?$n.substring(he.length):$n}).join(`
43
- `);if(ve!==Je){var we=Ae[be];Rn({value:Je,selectionStart:we?.startsWith(he)?De-he.length:De,selectionEnd:at-(ve.length-Je.length)})}}else if(De!==at){var Ae=Xt(ve,De),_t=Ae.length-1,Qn=Xt(ve,at).length-1,we=Ae[_t];Rn({value:ve.split(`
44
- `).map(function(Ai,Ei){return Ei>=_t&&Ei<=Qn?he+Ai:Ai}).join(`
45
- `),selectionStart:we&&/\S/.test(we)?De+he.length:De,selectionEnd:at+he.length*(Qn-_t+1)})}else{var Nt=De+he.length;Rn({value:ve.substring(0,De)+he+ve.substring(at),selectionStart:Nt,selectionEnd:Nt})}else if(Z.key==="Backspace"){var Zt=De!==at,wn=ve.substring(0,De);if(wn.endsWith(he)&&!Zt){Z.preventDefault();var Nt=De-he.length;Rn({value:ve.substring(0,De-he.length)+ve.substring(at),selectionStart:Nt,selectionEnd:Nt})}}else if(Z.key==="Enter"){if(De===at){var Ni=Xt(ve,De).pop(),es=Ni?.match(/^\s+/);if(es?.[0]){Z.preventDefault();var ji=`
46
- `+es[0],Nt=De+ji.length;Rn({value:ve.substring(0,De)+ji+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=["`","`"]),De!==at&&dn&&(Z.preventDefault(),Rn({value:ve.substring(0,De)+dn[0]+ve.substring(De,at)+dn[1]+ve.substring(at),selectionStart:De,selectionEnd:at+2}))}else(D?Z.metaKey&&Z.keyCode===m:Z.ctrlKey&&Z.keyCode===m)&&!Z.shiftKey&&!Z.altKey?(Z.preventDefault(),Es()):(D?Z.metaKey&&Z.keyCode===m&&Z.shiftKey:O?Z.ctrlKey&&Z.keyCode===h:Z.ctrlKey&&Z.keyCode===m&&Z.shiftKey)&&!Z.altKey?(Z.preventDefault(),Ci()):Z.keyCode===p&&Z.ctrlKey&&(!D||Z.shiftKey)&&(Z.preventDefault(),Sa(function($n){return!$n}))}},Fn=function(Z){var Te=Z.currentTarget,ve=Te.value,De=Te.selectionStart,at=Te.selectionEnd;Vn({value:ve,selectionStart:De,selectionEnd:at},!0),J(ve)};return f.useEffect(function(){Ja()},[Ja]),f.useImperativeHandle(L,function(){return{get session(){return{history:Ee.current}},set session(Z){Ee.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:wi,onClick:ce,onKeyUp:V,onFocus:fe,onBlur:$,disabled:F,form:Q,maxLength:R,minLength:W,name:ee,placeholder:ie,readOnly:_e,required:Ke,autoFocus:X,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"data-gramm":!1}),f.createElement("style",{dangerouslySetInnerHTML:{__html:I}}))}),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 UE=PE();const HE=xS(UE),IE=[/^ANTHROPIC_AUTH_TOKEN$/,/_API_KEY$/,/_AUTH_TOKEN$/,/_SECRET$/,/_SECRET_KEY$/,/^API_KEY$/,/^AUTH_TOKEN$/,/^SECRET$/,/_PASSWORD$/,/^PASSWORD$/,/_CREDENTIAL$/,/_PRIVATE_KEY$/];function BE(n){return IE.some(a=>a.test(n))}function qE(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:o="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(()=>o==="json"?qE(n):{valid:!0},[n,o]),b=S.useCallback(N=>r.jsx(KC,{theme:h?gg.nightOwl:gg.github,code:N,language:o,children:({tokens:w,getLineProps:O,getTokenProps:D})=>{let M=!1;return r.jsx(r.Fragment,{children:w.map((I,B)=>r.jsx("div",{...O({line:I}),className:q(x.line===B+1&&"bg-destructive/20"),children:I.map((U,k)=>{let j=!1;if(U.types.includes("property")){const X=U.content.replace(/['"]/g,"");BE(X)?M=!0:M=!1}else(U.types.includes("string")||U.types.includes("number")||U.types.includes("boolean"))&&M?(j=!0,M=!1):U.types.includes("punctuation")&&U.content!==":"&&U.content!=="["&&U.content!=="{"&&(M=!1);const L=D({token:U});return j&&y&&(L.className=q(L.className,"blur-[3px] select-none opacity-70 transition-all duration-200")),r.jsx("span",{...L},k)})},B))})}}),[h,o,x.line,y]);return r.jsxs("div",{className:q("flex flex-col",u),children:[r.jsxs("div",{className:q("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(HE,{value:n,onValueChange:l?()=>{}:a,highlight:b,padding:12,disabled:l,onFocus:()=>p(!0),onBlur:()=>p(!1),textareaClassName:q("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 ",o.toUpperCase()]}):r.jsxs("span",{className:"flex items-center gap-1 text-destructive",children:[r.jsx(_d,{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"})),KE={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 GE(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 sv=S.createContext(null);function YE({children:n}){const[a,o]=S.useReducer(GE,KE);return r.jsx(sv.Provider,{value:{state:a,dispatch:o},children:n})}function iv(){const n=S.useContext(sv);if(!n)throw new Error("useSettingsContext must be used within a SettingsProvider");return n}function VE(){const{dispatch:n}=iv(),a=S.useCallback(j=>n({type:"SET_WEBSEARCH_CONFIG",payload:j}),[n]),o=S.useCallback(j=>n({type:"SET_WEBSEARCH_STATUS",payload:j}),[n]),l=S.useCallback(j=>n({type:"SET_WEBSEARCH_LOADING",payload:j}),[n]),u=S.useCallback(j=>n({type:"SET_WEBSEARCH_STATUS_LOADING",payload:j}),[n]),f=S.useCallback(j=>n({type:"SET_WEBSEARCH_SAVING",payload:j}),[n]),h=S.useCallback(j=>n({type:"SET_WEBSEARCH_ERROR",payload:j}),[n]),m=S.useCallback(j=>n({type:"SET_WEBSEARCH_SUCCESS",payload:j}),[n]),p=S.useCallback(j=>n({type:"SET_GLOBALENV_CONFIG",payload:j}),[n]),y=S.useCallback(j=>n({type:"SET_GLOBALENV_LOADING",payload:j}),[n]),C=S.useCallback(j=>n({type:"SET_GLOBALENV_SAVING",payload:j}),[n]),x=S.useCallback(j=>n({type:"SET_GLOBALENV_ERROR",payload:j}),[n]),b=S.useCallback(j=>n({type:"SET_GLOBALENV_SUCCESS",payload:j}),[n]),N=S.useCallback(j=>n({type:"SET_PROXY_CONFIG",payload:j}),[n]),w=S.useCallback(j=>n({type:"SET_PROXY_LOADING",payload:j}),[n]),O=S.useCallback(j=>n({type:"SET_PROXY_SAVING",payload:j}),[n]),D=S.useCallback(j=>n({type:"SET_PROXY_ERROR",payload:j}),[n]),M=S.useCallback(j=>n({type:"SET_PROXY_SUCCESS",payload:j}),[n]),I=S.useCallback(j=>n({type:"SET_PROXY_TEST_RESULT",payload:j}),[n]),B=S.useCallback(j=>n({type:"SET_PROXY_TESTING",payload:j}),[n]),U=S.useCallback(j=>n({type:"SET_RAW_CONFIG",payload:j}),[n]),k=S.useCallback(j=>n({type:"SET_RAW_CONFIG_LOADING",payload:j}),[n]);return S.useMemo(()=>({setWebSearchConfig:a,setWebSearchStatus:o,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:O,setProxyError:D,setProxySuccess:M,setProxyTestResult:I,setProxyTesting:B,setRawConfig:U,setRawConfigLoading:k}),[a,o,l,u,f,h,m,p,y,C,x,b,N,w,O,D,M,I,B,U,k])}function FE(){const[n,a]=vS(),o=n.get("tab")?.toLowerCase(),l=o==="globalenv"?"globalenv":o==="proxy"?"proxy":o==="auth"?"auth":o==="thinking"?"thinking":o==="backups"?"backups":"websearch",u=S.useCallback(f=>{a({tab:f},{replace:!0})},[a]);return{activeTab:l,setActiveTab:u}}function QE(){const{state:n}=iv(),a=VE(),[o,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:o,fetchRawConfig:u,copyToClipboard:f}}function cy({activeTab:n,onTabChange:a}){const{t:o}=Lt(),l=[{value:"websearch",label:o("settingsTabs.web"),icon:Xy},{value:"globalenv",label:o("settingsTabs.env"),icon:Rd},{value:"thinking",label:o("settingsTabs.think"),icon:JS},{value:"proxy",label:o("settingsTabs.proxy"),icon:eC},{value:"auth",label:o("settingsTabs.auth"),icon:Td},{value:"backups",label:o("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(qe,{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(qe,{className:"h-5 w-32"}),r.jsx(qe,{className:"h-4 w-48"})]}),r.jsx(qe,{className:"h-6 w-10 rounded-full"})]})}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(qe,{className:"h-5 w-24"}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(qe,{className:"h-20 w-full rounded-lg"}),r.jsx(qe,{className:"h-20 w-full rounded-lg"}),r.jsx(qe,{className:"h-20 w-full rounded-lg"})]})]})]})}function ov(n,a=3,o=1e3){return n().catch(l=>{if(a<=0)throw l;return new Promise(u=>setTimeout(u,o)).then(()=>ov(n,a-1,o*2))})}function Si(n){return S.lazy(()=>ov(n))}const dy=Si(()=>gt(()=>import("./index-BXDW5hxG.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),fy=Si(()=>gt(()=>import("./globalenv-section-Dzt_ECFK.js"),__vite__mapDeps([10,1,2,3,4,5,6,7,8,9]))),hy=Si(()=>gt(()=>import("./index-CKnNRLzv.js"),__vite__mapDeps([11,1,2,3,4,5,6,7,8,9]))),my=Si(()=>gt(()=>import("./index-D1Gx_G_A.js"),__vite__mapDeps([12,1,2,3,13,4,14,15,5,6,7,8,9]))),py=Si(()=>gt(()=>import("./auth-section-DgF431PH.js"),__vite__mapDeps([16,1,2,4,5,6,7,8,9]))),gy=Si(()=>gt(()=>import("./backups-section-9V2yDu_e.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(_d,{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(Do,{className:"w-4 h-4"}),ct.t("settings.reloadPage")]})]})}):this.props.children}}function $E(){const{t:n}=Lt(),{activeTab:a,setActiveTab:o}=FE(),{rawConfig:l,loading:u,copied:f,fetchRawConfig:h,copyToClipboard:m}=QE();S.useEffect(()=>{h()},[h]);const p=y=>{S.startTransition(()=>{o(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(sf,{direction:"horizontal",className:"h-full hidden md:flex",children:[r.jsx(_o,{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(of,{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(_o,{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(yi,{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(Do,{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(Do,{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 WE(){return r.jsx(YE,{children:r.jsx($E,{})})}const XE=Object.freeze(Object.defineProperty({__proto__:null,SettingsPage:WE},Symbol.toStringTag,{value:"Module"})),VT=fS,FT=mS,QT=hS,ZE=S.forwardRef(({className:n,align:a="center",sideOffset:o=4,...l},u)=>r.jsx(dS,{children:r.jsx(Gy,{ref:u,align:a,sideOffset:o,className:q("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})}));ZE.displayName=Gy.displayName;function JE(n,a,o="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:n,timeZoneName:o}).format(a).split(/\s/g).slice(2).join(" ")}const eM={},Ao={};function Ss(n,a){try{const l=(eM[n]||=new Intl.DateTimeFormat("en-US",{timeZone:n,timeZoneName:"longOffset"}).format)(a).split("GMT")[1];return l in Ao?Ao[l]:xy(l,l.split(":"))}catch{if(n in Ao)return Ao[n];const o=n?.match(tM);return o?xy(n,o.slice(1)):NaN}}const tM=/([+-]\d\d):?(\d\d)?/;function xy(n,a){const o=+(a[0]||0),l=+(a[1]||0),u=+(a[2]||0)/60;return Ao[n]=o*60+l>0?o*60+l+u:o*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(Ss(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),Ed(this)):this.setTime(Date.now())}static tz(a,...o){return o.length?new Bn(...o,a):new Bn(Date.now(),a)}withTimeZone(a){return new Bn(+this,a)}getTimezoneOffset(){const a=-Ss(this.timeZone,this);return a>0?Math.floor(a):Math.ceil(a)}setTime(a){return Date.prototype.setTime.apply(this,arguments),Ed(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),nM(this),+this},Bn.prototype[a]=function(){return Date.prototype[a].apply(this,arguments),Ed(this),+this}))});function Ed(n){n.internal.setTime(+n),n.internal.setUTCSeconds(n.internal.getUTCSeconds()-Math.round(-Ss(n.timeZone,n)*60))}function nM(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=Ss(n.timeZone,n),o=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-o;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(-(Ss(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=Ss(n.timeZone,n),N=b>0?Math.floor(b):Math.ceil(b),O=-new Date(+n).getTimezoneOffset()-N,D=N!==o,M=O-p;if(D&&M){Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+M);const I=Ss(n.timeZone,n),B=I>0?Math.floor(I):Math.ceil(I),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,...o){return o.length?new ga(...o,a):new ga(Date.now(),a)}toISOString(){const[a,o,l]=this.tzComponents(),u=`${a}${o}:${l}`;return this.internal.toISOString().slice(0,-1)+u}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[a,o,l,u]=this.internal.toUTCString().split(" ");return`${a?.slice(0,-1)} ${l} ${o} ${u}`}toTimeString(){const a=this.internal.toUTCString().split(" ")[4],[o,l,u]=this.tzComponents();return`${a} GMT${o}${l}${u} (${JE(this.timeZone,this)})`}toLocaleString(a,o){return Date.prototype.toLocaleString.call(this,a,{...o,timeZone:o?.timeZone||this.timeZone})}toLocaleDateString(a,o){return Date.prototype.toLocaleDateString.call(this,a,{...o,timeZone:o?.timeZone||this.timeZone})}toLocaleTimeString(a,o){return Date.prototype.toLocaleTimeString.call(this,a,{...o,timeZone:o?.timeZone||this.timeZone})}tzComponents(){const a=this.getTimezoneOffset(),o=a>0?"-":"+",l=String(Math.floor(Math.abs(a)/60)).padStart(2,"0"),u=String(Math.abs(a)%60).padStart(2,"0");return[o,l,u]}withTimeZone(a){return new ga(+this,a)}[Symbol.for("constructDateFrom")](a){return new ga(+new Date(a),this.timeZone)}}const by=5,aM=4;function sM(n,a){const o=a.startOfMonth(n),l=o.getDay()>0?o.getDay():7,u=a.addDays(n,-l+1),f=a.addDays(u,by*7-1);return a.getMonth(n)===a.getMonth(f)?by:aM}function rv(n,a){const o=a.startOfMonth(n),l=o.getDay();return l===1?o:l===0?a.addDays(o,-6):a.addDays(o,-1*(l-1))}function iM(n,a){const o=rv(n,a),l=sM(n,a);return a.addDays(o,l*7-1)}const cv={...xo,labels:{labelDayButton:(n,a,o,l)=>{let u;l&&typeof l.format=="function"?u=l.format.bind(l):u=(h,m)=>Co(h,m,{locale:xo,...o});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,o)=>{let l;return o&&typeof o.format=="function"?l=o.format.bind(o):l=(u,f)=>Co(u,f,{locale:xo,...a}),l(n,"LLLL yyyy")},labelGridcell:(n,a,o,l)=>{let u;l&&typeof l.format=="function"?u=l.format.bind(l):u=(h,m)=>Co(h,m,{locale:xo,...o});let f=u(n,"PPPP");return a?.today&&(f=`Today, ${f}`),f},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(n,a,o)=>{let l;return o&&typeof o.format=="function"?l=o.format.bind(o):l=(u,f)=>Co(u,f,{locale:xo,...a}),l(n,"cccc")}}};class un{constructor(a,o){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):oC(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):iM(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):Co(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):jC(l,u),this.isSameMonth=(l,u)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(l,u):AC(l,u),this.isSameYear=(l,u)=>this.overrides?.isSameYear?this.overrides.isSameYear(l,u):EC(l,u),this.max=l=>this.overrides?.max?this.overrides.max(l):MC(l),this.min=l=>this.overrides?.min?this.overrides.min(l):OC(l),this.setMonth=(l,u)=>this.overrides?.setMonth?this.overrides.setMonth(l,u):TC(l,u),this.setYear=(l,u)=>this.overrides?.setYear?this.overrides.setYear(l,u):DC(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):kC(l),this.startOfISOWeek=l=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(l):RC(l),this.startOfMonth=l=>this.overrides?.startOfMonth?this.overrides.startOfMonth(l):_C(l),this.startOfWeek=(l,u)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(l,this.options):zC(l,this.options),this.startOfYear=l=>this.overrides?.startOfYear?this.overrides.startOfYear(l):LC(l),this.options={locale:cv,...a},this.overrides=o}getDigitMap(){const{numerals:a="latn"}=this.options,o=new Intl.NumberFormat("en-US",{numberingSystem:a}),l={};for(let u=0;u<10;u++)l[u.toString()]=o.format(u);return l}replaceDigits(a){const o=this.getDigitMap();return a.replace(/\d/g,l=>o[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:o,timeZone:l,numerals:u}=this.options,f=o?.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 Kn=new un;class uv{constructor(a,o,l=Kn){this.date=a,this.displayMonth=o,this.outside=!!(o&&!l.isSameMonth(a,o)),this.dateLib=l,this.isoDate=l.format(a,"yyyy-MM-dd"),this.displayMonthId=l.format(o,"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 oM{constructor(a,o){this.date=a,this.weeks=o}}class lM{constructor(a,o){this.days=o,this.weekNumber=a}}function rM(n){return se.createElement("button",{...n})}function cM(n){return se.createElement("span",{...n})}function uM(n){const{size:a=24,orientation:o="left",className:l}=n;return se.createElement("svg",{className:l,width:a,height:a,viewBox:"0 0 24 24"},o==="up"&&se.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),o==="down"&&se.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),o==="left"&&se.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),o==="right"&&se.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function dM(n){const{day:a,modifiers:o,...l}=n;return se.createElement("td",{...l})}function fM(n){const{day:a,modifiers:o,...l}=n,u=se.useRef(null);return se.useEffect(()=>{o.focused&&u.current?.focus()},[o.focused]),se.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 it;(function(n){n.disabled="disabled",n.hidden="hidden",n.outside="outside",n.focused="focused",n.today="today"})(it||(it={}));var Mn;(function(n){n.range_end="range_end",n.range_middle="range_middle",n.range_start="range_start",n.selected="selected"})(Mn||(Mn={}));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 hM(n){const{options:a,className:o,components:l,classNames:u,...f}=n,h=[u[me.Dropdown],o].join(" "),m=a?.find(({value:p})=>p===f.value);return se.createElement("span",{"data-disabled":f.disabled,className:u[me.DropdownRoot]},se.createElement(l.Select,{className:h,...f},a?.map(({value:p,label:y,disabled:C})=>se.createElement(l.Option,{key:p,value:p,disabled:C},y))),se.createElement("span",{className:u[me.CaptionLabel],"aria-hidden":!0},m?.label,se.createElement(l.Chevron,{orientation:"down",size:18,className:u[me.Chevron]})))}function mM(n){return se.createElement("div",{...n})}function pM(n){return se.createElement("div",{...n})}function gM(n){const{calendarMonth:a,displayIndex:o,...l}=n;return se.createElement("div",{...l},n.children)}function yM(n){const{calendarMonth:a,displayIndex:o,...l}=n;return se.createElement("div",{...l})}function xM(n){return se.createElement("table",{...n})}function vM(n){return se.createElement("div",{...n})}const dv=S.createContext(void 0);function Uo(){const n=S.useContext(dv);if(n===void 0)throw new Error("useDayPicker() must be used within a custom component.");return n}function bM(n){const{components:a}=Uo();return se.createElement(a.Dropdown,{...n})}function SM(n){const{onPreviousClick:a,onNextClick:o,previousMonth:l,nextMonth:u,...f}=n,{components:h,classNames:m,labels:{labelPrevious:p,labelNext:y}}=Uo(),C=S.useCallback(b=>{u&&o?.(b)},[u,o]),x=S.useCallback(b=>{l&&a?.(b)},[l,a]);return se.createElement("nav",{...f},se.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},se.createElement(h.Chevron,{disabled:l?void 0:!0,className:m[me.Chevron],orientation:"left"})),se.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},se.createElement(h.Chevron,{disabled:u?void 0:!0,orientation:"right",className:m[me.Chevron]})))}function CM(n){const{components:a}=Uo();return se.createElement(a.Button,{...n})}function wM(n){return se.createElement("option",{...n})}function NM(n){const{components:a}=Uo();return se.createElement(a.Button,{...n})}function jM(n){const{rootRef:a,...o}=n;return se.createElement("div",{...o,ref:a})}function AM(n){return se.createElement("select",{...n})}function EM(n){const{week:a,...o}=n;return se.createElement("tr",{...o})}function MM(n){return se.createElement("th",{...n})}function OM(n){return se.createElement("thead",{"aria-hidden":!0},se.createElement("tr",{...n}))}function TM(n){const{week:a,...o}=n;return se.createElement("th",{...o})}function DM(n){return se.createElement("th",{...n})}function kM(n){return se.createElement("tbody",{...n})}function RM(n){const{components:a}=Uo();return se.createElement(a.Dropdown,{...n})}const _M=Object.freeze(Object.defineProperty({__proto__:null,Button:rM,CaptionLabel:cM,Chevron:uM,Day:dM,DayButton:fM,Dropdown:hM,DropdownNav:mM,Footer:pM,Month:gM,MonthCaption:yM,MonthGrid:xM,Months:vM,MonthsDropdown:bM,Nav:SM,NextMonthButton:CM,Option:wM,PreviousMonthButton:NM,Root:jM,Select:AM,Week:EM,WeekNumber:TM,WeekNumberHeader:DM,Weekday:MM,Weekdays:OM,Weeks:kM,YearsDropdown:RM},Symbol.toStringTag,{value:"Module"}));function ya(n,a,o=!1,l=Kn){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)>=(o?1:0)&&h(f,a)>=(o?1:0)):!o&&f?m(f,a):!o&&u?m(u,a):!1}function mf(n){return!!(n&&typeof n=="object"&&"before"in n&&"after"in n)}function zr(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,o=Kn){const l=Array.isArray(a)?a:[a],{isSameDay:u,differenceInCalendarDays:f,isAfter:h}=o;return l.some(m=>{if(typeof m=="boolean")return m;if(o.isDate(m))return u(n,m);if(hv(m,o))return m.some(p=>u(n,p));if(zr(m))return ya(m,n,!1,o);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 zM(n,a,o,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:O,isAfter:D}=u,M=o&&N(o),I=l&&O(l),B={[it.focused]:[],[it.outside]:[],[it.disabled]:[],[it.hidden]:[],[it.today]:[]},U={};for(const k of n){const{date:j,displayMonth:L}=k,X=!!(L&&!b(j,L)),F=!!(M&&w(j,M)),Q=!!(I&&D(j,I)),ae=!!(f&&xa(j,f,u)),te=!!(h&&xa(j,h,u))||F||Q||!y&&!p&&X||y&&p===!1&&X,ye=x(j,C);X&&B.outside.push(k),ae&&B.disabled.push(k),te&&B.hidden.push(k),ye&&B.today.push(k),m&&Object.keys(m).forEach(de=>{const Ce=m?.[de];Ce&&xa(j,Ce,u)&&(U[de]?U[de].push(k):U[de]=[k])})}return k=>{const j={[it.focused]:!1,[it.disabled]:!1,[it.hidden]:!1,[it.outside]:!1,[it.today]:!1},L={};for(const X in B){const F=B[X];j[X]=F.some(Q=>Q===k)}for(const X in U)L[X]=U[X].some(F=>F===k);return{...j,...L}}}function LM(n,a,o={}){return Object.entries(n).filter(([,u])=>u===!0).reduce((u,[f])=>(o[f]?u.push(o[f]):a[it[f]]?u.push(a[it[f]]):a[Mn[f]]&&u.push(a[Mn[f]]),u),[a[me.Day]])}function PM(n){return{..._M,...n}}function UM(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(([o,l])=>{o.startsWith("data-")&&(a[o]=l)}),a}function HM(){const n={};for(const a in me)n[me[a]]=`rdp-${me[a]}`;for(const a in it)n[it[a]]=`rdp-${it[a]}`;for(const a in Mn)n[Mn[a]]=`rdp-${Mn[a]}`;for(const a in cn)n[cn[a]]=`rdp-${cn[a]}`;return n}function mv(n,a,o){return(o??new un(a)).formatMonthYear(n)}const IM=mv;function BM(n,a,o){return(o??new un(a)).format(n,"d")}function qM(n,a=Kn){return a.format(n,"LLLL")}function KM(n,a,o){return(o??new un(a)).format(n,"cccccc")}function GM(n,a=Kn){return n<10?a.formatNumber(`0${n.toLocaleString()}`):a.formatNumber(`${n.toLocaleString()}`)}function YM(){return""}function pv(n,a=Kn){return a.format(n,"yyyy")}const VM=pv,FM=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:mv,formatDay:BM,formatMonthCaption:IM,formatMonthDropdown:qM,formatWeekNumber:GM,formatWeekNumberHeader:YM,formatWeekdayName:KM,formatYearCaption:VM,formatYearDropdown:pv},Symbol.toStringTag,{value:"Module"}));function QM(n){return n?.formatMonthCaption&&!n.formatCaption&&(n.formatCaption=n.formatMonthCaption),n?.formatYearCaption&&!n.formatYearDropdown&&(n.formatYearDropdown=n.formatYearCaption),{...FM,...n}}function yf(n,a,o,l){let u=(l??new un(o)).format(n,"PPPP");return a.today&&(u=`Today, ${u}`),a.selected&&(u=`${u}, selected`),u}const $M=yf;function xf(n,a,o){return(o??new un(a)).formatMonthYear(n)}const WM=xf;function gv(n,a,o,l){let u=(l??new un(o)).format(n,"PPPP");return a?.today&&(u=`Today, ${u}`),u}function yv(n){return"Choose the Month"}function xv(){return""}const XM="Go to the Next Month";function vv(n,a){return XM}function bv(n){return"Go to the Previous Month"}function Sv(n,a,o){return(o??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 ZM=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:WM,labelDay:$M,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"})),En=(n,a,o)=>a||(o?typeof o=="function"?o:(...l)=>o:n);function JM(n,a){const o=a.locale?.labels??{};return{...ZM,...n??{},labelDayButton:En(yf,n?.labelDayButton,o.labelDayButton),labelMonthDropdown:En(yv,n?.labelMonthDropdown,o.labelMonthDropdown),labelNext:En(vv,n?.labelNext,o.labelNext),labelPrevious:En(bv,n?.labelPrevious,o.labelPrevious),labelWeekNumber:En(Cv,n?.labelWeekNumber,o.labelWeekNumber),labelYearDropdown:En(Nv,n?.labelYearDropdown,o.labelYearDropdown),labelGrid:En(xf,n?.labelGrid,o.labelGrid),labelGridcell:En(gv,n?.labelGridcell,o.labelGridcell),labelNav:En(xv,n?.labelNav,o.labelNav),labelWeekNumberHeader:En(wv,n?.labelWeekNumberHeader,o.labelWeekNumberHeader),labelWeekday:En(Sv,n?.labelWeekday,o.labelWeekday)}}function eO(n,a,o,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),O=a&&b<f(a)||o&&b>f(o)||!1;return{value:w,label:N,disabled:O}})}function tO(n,a={},o={}){let l={...a?.[me.Day]};return Object.entries(n).filter(([,u])=>u===!0).forEach(([u])=>{l={...l,...o?.[u]}}),l}function nO(n,a,o,l){const u=l??n.today(),f=o?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 aO(n,a,o,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=o.formatYearDropdown(b,l);return{value:p(b),label:N,disabled:!1}})}const Ho=n=>n instanceof HTMLElement?n:null,ud=n=>[...n.querySelectorAll("[data-animated-month]")??[]],sO=n=>Ho(n.querySelector("[data-animated-month]")),dd=n=>Ho(n.querySelector("[data-animated-caption]")),fd=n=>Ho(n.querySelector("[data-animated-weeks]")),iO=n=>Ho(n.querySelector("[data-animated-nav]")),oO=n=>Ho(n.querySelector("[data-animated-weekdays]"));function lO(n,a,{classNames:o,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?o[cn.caption_after_enter]:o[cn.caption_before_enter],N=x?o[cn.weeks_after_enter]:o[cn.weeks_before_enter],w=h.current,O=n.current.cloneNode(!0);if(O instanceof HTMLElement?(ud(O).forEach(B=>{if(!(B instanceof HTMLElement))return;const U=sO(B);U&&B.contains(U)&&B.removeChild(U);const k=dd(B);k&&k.classList.remove(b);const j=fd(B);j&&j.classList.remove(N)}),h.current=O):h.current=null,p.current||C||u)return;const D=w instanceof HTMLElement?ud(w):[],M=ud(n.current);if(M?.every(I=>I instanceof HTMLElement)&&D&&D.every(I=>I instanceof HTMLElement)){p.current=!0,n.current.style.isolation="isolate";const I=iO(n.current);I&&(I.style.zIndex="1"),M.forEach((B,U)=>{const k=D[U];if(!k)return;B.style.position="relative",B.style.overflow="hidden";const j=dd(B);j&&j.classList.add(b);const L=fd(B);L&&L.classList.add(N);const X=()=>{p.current=!1,n.current&&(n.current.style.isolation=""),I&&(I.style.zIndex=""),j&&j.classList.remove(b),L&&L.classList.remove(N),B.style.position="",B.style.overflow="",B.contains(k)&&B.removeChild(k)};k.style.pointerEvents="none",k.style.position="absolute",k.style.overflow="hidden",k.setAttribute("aria-hidden","true");const F=oO(k);F&&(F.style.opacity="0");const Q=dd(k);Q&&(Q.classList.add(x?o[cn.caption_before_exit]:o[cn.caption_after_exit]),Q.addEventListener("animationend",X));const ae=fd(k);ae&&ae.classList.add(x?o[cn.weeks_before_exit]:o[cn.weeks_after_exit]),B.insertBefore(k,B.firstChild)})}})}function rO(n,a,o,l){const u=n[0],f=n[n.length-1],{ISOWeek:h,fixedWeeks:m,broadcastCalendar:p}=o??{},{addDays:y,differenceInCalendarDays:C,differenceInCalendarMonths:x,endOfBroadcastWeek:b,endOfISOWeek:N,endOfMonth:w,endOfWeek:O,isAfter:D,startOfBroadcastWeek:M,startOfISOWeek:I,startOfWeek:B}=l,U=p?M(u,l):h?I(u):B(u),k=p?b(f):h?N(w(f)):O(w(f)),j=a&&(p?b(a):h?N(a):O(a)),L=j&&D(k,j)?j:k,X=C(L,U),F=x(f,u)+1,Q=[];for(let ye=0;ye<=X;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 cO(n){const a=[];return n.reduce((o,l)=>{const u=l.weeks.reduce((f,h)=>f.concat(h.days.slice()),a.slice());return o.concat(u.slice())},a.slice())}function uO(n,a,o,l){const{numberOfMonths:u=1}=o,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,o,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(o&&y(o,p)<m-1){const b=-1*(m-1);p=C(o,b)}return a&&y(p,a)<0&&(p=a),x(p)}function dO(n,a,o,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((O,D)=>{const M=o.broadcastCalendar?x(D,l):o.ISOWeek?b(D):N(D),I=o.broadcastCalendar?f(D):o.ISOWeek?h(m(D)):p(m(D)),B=a.filter(L=>L>=M&&L<=I),U=o.broadcastCalendar?35:42;if(o.fixedWeeks&&B.length<U){const L=a.filter(X=>{const F=U-B.length;return X>I&&X<=u(I,F)});B.push(...L)}const k=B.reduce((L,X)=>{const F=o.ISOWeek?y(X):C(X),Q=L.find(te=>te.weekNumber===F),ae=new uv(X,D,l);return Q?Q.days.push(ae):L.push(new lM(F,[ae])),L},[]),j=new oM(D,k);return O.push(j),O},[]);return o.reverseMonths?w.reverse():w}function fO(n,a){let{startMonth:o,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:O}=n;!o&&w&&(o=w),!o&&b&&(o=a.newDate(b,0,1)),!l&&O&&(l=O),!l&&N&&(l=C(N,11,31));const D=n.captionLayout==="dropdown"||n.captionLayout==="dropdown-years";return o?o=h(o):b?o=C(b,0,1):!o&&D&&(o=u(p(n.today??x(),-100))),l?l=m(l):N?l=C(N,11,31):!l&&D&&(l=y(n.today??x())),[o&&f(o),l&&f(l)]}function hO(n,a,o,l){if(o.disableNavigation)return;const{pagedNavigation:u,numberOfMonths:f=1}=o,{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 mO(n,a,o,l){if(o.disableNavigation)return;const{pagedNavigation:u,numberOfMonths:f}=o,{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 pO(n){const a=[];return n.reduce((o,l)=>o.concat(l.weeks.slice()),a.slice())}function Lr(n,a){const[o,l]=S.useState(n);return[a===void 0?o:a,l]}function gO(n,a){const[o,l]=fO(n,a),{startOfMonth:u,endOfMonth:f}=a,h=Sy(n,o,l,a),[m,p]=Lr(h,n.month?h:void 0);S.useEffect(()=>{const U=Sy(n,o,l,a);p(U)},[n.timeZone]);const{months:y,weeks:C,days:x,previousMonth:b,nextMonth:N}=S.useMemo(()=>{const U=uO(m,l,{numberOfMonths:n.numberOfMonths},a),k=rO(U,n.endMonth?f(n.endMonth):void 0,{ISOWeek:n.ISOWeek,fixedWeeks:n.fixedWeeks,broadcastCalendar:n.broadcastCalendar},a),j=dO(U,k,{broadcastCalendar:n.broadcastCalendar,fixedWeeks:n.fixedWeeks,ISOWeek:n.ISOWeek,reverseMonths:n.reverseMonths},a),L=pO(j),X=cO(j),F=mO(m,o,n,a),Q=hO(m,l,n,a);return{months:j,weeks:L,days:X,previousMonth:F,nextMonth:Q}},[a,m.getTime(),l?.getTime(),o?.getTime(),n.disableNavigation,n.broadcastCalendar,n.endMonth?.getTime(),n.fixedWeeks,n.ISOWeek,n.numberOfMonths,n.pagedNavigation,n.reverseMonths]),{disableNavigation:w,onMonthChange:O}=n,D=U=>C.some(k=>k.days.some(j=>j.isEqualTo(U))),M=U=>{if(w)return;let k=u(U);o&&k<u(o)&&(k=u(o)),l&&k>u(l)&&(k=u(l)),p(k),O?.(k)};return{months:y,weeks:C,days:x,navStart:o,navEnd:l,previousMonth:b,nextMonth:N,goToMonth:M,goToDay:U=>{D(U)||M(U.date)}}}var Hn;(function(n){n[n.Today=0]="Today",n[n.Selected=1]="Selected",n[n.LastFocused=2]="LastFocused",n[n.FocusedModifier=3]="FocusedModifier"})(Hn||(Hn={}));function Cy(n){return!n[it.disabled]&&!n[it.hidden]&&!n[it.outside]}function yO(n,a,o,l){let u,f=-1;for(const h of n){const m=a(h);Cy(m)&&(m[it.focused]&&f<Hn.FocusedModifier?(u=h,f=Hn.FocusedModifier):l?.isEqualTo(h)&&f<Hn.LastFocused?(u=h,f=Hn.LastFocused):o(h.date)&&f<Hn.Selected?(u=h,f=Hn.Selected):m[it.today]&&f<Hn.Today&&(u=h,f=Hn.Today))}return u||(u=n.find(h=>Cy(a(h)))),u}function xO(n,a,o,l,u,f,h){const{ISOWeek:m,broadcastCalendar:p}=f,{addDays:y,addMonths:C,addWeeks:x,addYears:b,endOfBroadcastWeek:N,endOfISOWeek:w,endOfWeek:O,max:D,min:M,startOfBroadcastWeek:I,startOfISOWeek:B,startOfWeek:U}=h;let j={day:y,week:x,month:C,year:b,startOfWeek:L=>p?I(L,h):m?B(L):U(L),endOfWeek:L=>p?N(L):m?w(L):O(L)}[n](o,a==="after"?1:-1);return a==="before"&&l?j=D([l,j]):a==="after"&&u&&(j=M([u,j])),j}function jv(n,a,o,l,u,f,h,m=0){if(m>365)return;const p=xO(n,a,o.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:jv(n,a,b,l,u,f,h,m+1)}function vO(n,a,o,l,u){const{autoFocus:f}=n,[h,m]=S.useState(),p=yO(a.days,o,l||(()=>!1),h),[y,C]=S.useState(f?p:void 0);return{isFocusTarget:O=>!!p?.isEqualTo(O),setFocused:C,focused:y,blur:()=>{m(y),C(void 0)},moveFocus:(O,D)=>{if(!y)return;const M=jv(O,D,y,a.navStart,a.navEnd,n,u);M&&(n.disableNavigation&&!a.days.some(B=>B.isEqualTo(M))||(a.goToDay(M),C(M)))}}}function bO(n,a){const{selected:o,required:l,onSelect:u}=n,[f,h]=Lr(o,u?o:void 0),m=u?o:f,{isSameDay:p}=a,y=N=>m?.some(w=>p(w,N))??!1,{min:C,max:x}=n;return{selected:m,select:(N,w,O)=>{let D=[...m??[]];if(y(N)){if(m?.length===C||l&&m?.length===1)return;D=m?.filter(M=>!p(M,N))}else m?.length===x?D=[N]:D=[...D,N];return u||h(D),u?.(D,N,w,O),D},isSelected:y}}function SO(n,a,o=0,l=0,u=!1,f=Kn){const{from:h,to:m}=a||{},{isSameDay:p,isAfter:y,isBefore:C}=f;let x;if(!h&&!m)x={from:n,to:o>0?void 0:n};else if(h&&!m)p(h,n)?o===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:o>0?void 0:n};else if(p(m,n))x={from:n,to:o>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}:o>1&&b<o&&(x={from:n,to:void 0})}return x}function CO(n,a,o=Kn){const l=Array.isArray(a)?a:[a];let u=n.from;const f=o.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=o.addDays(u,1)}return!1}function wy(n,a,o=Kn){return ya(n,a.from,!1,o)||ya(n,a.to,!1,o)||ya(a,n.from,!1,o)||ya(a,n.to,!1,o)}function wO(n,a,o=Kn){const l=Array.isArray(a)?a:[a];if(l.filter(m=>typeof m!="function").some(m=>typeof m=="boolean"?m:o.isDate(m)?ya(n,m,!1,o):hv(m,o)?m.some(p=>ya(n,p,!1,o)):zr(m)?m.from&&m.to?wy(n,{from:m.from,to:m.to},o):!1:fv(m)?CO(n,m.dayOfWeek,o):mf(m)?o.isAfter(m.before,m.after)?wy(n,{from:o.addDays(m.after,1),to:o.addDays(m.before,-1)},o):xa(n.from,m,o)||xa(n.to,m,o):pf(m)||gf(m)?xa(n.from,m,o)||xa(n.to,m,o):!1))return!0;const h=l.filter(m=>typeof m=="function");if(h.length){let m=n.from;const p=o.differenceInCalendarDays(n.to,n.from);for(let y=0;y<=p;y++){if(h.some(C=>C(m)))return!0;m=o.addDays(m,1)}}return!1}function NO(n,a){const{disabled:o,excludeDisabled:l,selected:u,required:f,onSelect:h}=n,[m,p]=Lr(u,h?u:void 0),y=h?u:m;return{selected:y,select:(b,N,w)=>{const{min:O,max:D}=n,M=b?SO(b,y,O,D,f,a):void 0;return l&&o&&M?.from&&M.to&&wO({from:M.from,to:M.to},o,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 jO(n,a){const{selected:o,required:l,onSelect:u}=n,[f,h]=Lr(o,u?o:void 0),m=u?o: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 AO(n,a){const o=jO(n,a),l=bO(n,a),u=NO(n,a);switch(n.mode){case"single":return o;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(o=>o instanceof Date?Rt(o,a):o):zr(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(o=>Ny(o,a)):Ny(n,a))}function EO(n){let a=n;const o=a.timeZone;if(o&&(a={...n,timeZone:o},a.today&&(a.today=Rt(a.today,o)),a.month&&(a.month=Rt(a.month,o)),a.defaultMonth&&(a.defaultMonth=Rt(a.defaultMonth,o)),a.startMonth&&(a.startMonth=Rt(a.startMonth,o)),a.endMonth&&(a.endMonth=Rt(a.endMonth,o)),a.mode==="single"&&a.selected?a.selected=Rt(a.selected,o):a.mode==="multiple"&&a.selected?a.selected=a.selected?.map(he=>Rt(he,o)):a.mode==="range"&&a.selected&&(a.selected={from:a.selected.from?Rt(a.selected.from,o):a.selected.from,to:a.selected.to?Rt(a.selected.to,o):a.selected.to}),a.disabled!==void 0&&(a.disabled=hd(a.disabled,o)),a.hidden!==void 0&&(a.hidden=hd(a.hidden,o)),a.modifiers)){const he={};Object.keys(a.modifiers).forEach(Ae=>{he[Ae]=hd(a.modifiers?.[Ae],o)}),a.modifiers=he}const{components:l,formatters:u,labels:f,dateLib:h,locale:m,classNames:p}=S.useMemo(()=>{const he={...cv,...a.locale},Ae=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:Ae,components:PM(a.components),formatters:QM(a.formatters),labels:JM(a.labels,Ae.options),locale:he,classNames:{...HM(),...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:O,onDayKeyDown:D,onDayMouseEnter:M,onDayMouseLeave:I,onNextClick:B,onPrevClick:U,showWeekNumber:k,styles:j}=a,{formatCaption:L,formatDay:X,formatMonthDropdown:F,formatWeekNumber:Q,formatWeekNumberHeader:ae,formatWeekdayName:te,formatYearDropdown:ye}=u,de=gO(a,h),{days:Ce,months:R,navStart:W,navEnd:ee,previousMonth:$,nextMonth:ce,goToMonth:fe}=de,Ne=zM(Ce,a,W,ee,h),{isSelected:V,select:J,selected:oe}=AO(a,h)??{},{blur:ne,focused:ie,isFocusTarget:xe,moveFocus:_e,setFocused:Ke}=vO(a,de,Ne,V??(()=>!1),h),{labelDayButton:St,labelGridcell:Ct,labelGrid:Ye,labelMonthDropdown:nt,labelNav:Ut,labelPrevious:Qt,labelNext:Gn,labelWeekday:Ee,labelWeekNumber:$t,labelWeekNumberHeader:Dn,labelYearDropdown:Wt}=f,Sa=S.useMemo(()=>nO(h,a.ISOWeek,a.broadcastCalendar,a.today),[h,a.ISOWeek,a.broadcastCalendar,a.today]),Yn=C!==void 0||w!==void 0,ft=S.useCallback(()=>{$&&(fe($),U?.($))},[$,fe,U]),Xt=S.useCallback(()=>{ce&&(fe(ce),B?.(ce))},[fe,ce,B]),Vn=S.useCallback((he,Ae)=>be=>{be.preventDefault(),be.stopPropagation(),Ke(he),!Ae.disabled&&(J?.(he.date,Ae,be),w?.(he.date,Ae,be))},[J,w,Ke]),Ja=S.useCallback((he,Ae)=>be=>{Ke(he),O?.(he.date,Ae,be)},[O,Ke]),kn=S.useCallback((he,Ae)=>be=>{ne(),N?.(he.date,Ae,be)},[ne,N]),Rn=S.useCallback((he,Ae)=>be=>{const ke={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(ke[be.key]){be.preventDefault(),be.stopPropagation();const[Je,we]=ke[be.key];_e(Je,we)}D?.(he.date,Ae,be)},[_e,D,a.dir]),Es=S.useCallback((he,Ae)=>be=>{M?.(he.date,Ae,be)},[M]),Ci=S.useCallback((he,Ae)=>be=>{I?.(he.date,Ae,be)},[I]),wi=S.useCallback(he=>Ae=>{const be=Number(Ae.target.value),ke=h.setMonth(h.startOfMonth(he),be);fe(ke)},[h,fe]),Fn=S.useCallback(he=>Ae=>{const be=Number(Ae.target.value),ke=h.setYear(h.startOfMonth(he),be);fe(ke)},[h,fe]),{className:Z,style:Te}=S.useMemo(()=>({className:[p[me.Root],a.className].filter(Boolean).join(" "),style:{...j?.[me.Root],...a.style}}),[p,a.className,a.style,j]),ve=UM(a),De=S.useRef(null);lO(De,!!a.animate,{classNames:p,months:R,focused:ie,dateLib:h});const at={dayPickerProps:a,selected:oe,select:J,isSelected:V,months:R,nextMonth:ce,previousMonth:$,goToMonth:fe,getModifiers:Ne,components:l,classNames:p,styles:j,labels:f,formatters:u};return se.createElement(dv.Provider,{value:at},se.createElement(l.Root,{rootRef:a.animate?De:void 0,className:Z,style:Te,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},se.createElement(l.Months,{className:p[me.Months],style:j?.[me.Months]},!a.hideNavigation&&!x&&se.createElement(l.Nav,{"data-animated-nav":a.animate?"true":void 0,className:p[me.Nav],style:j?.[me.Nav],"aria-label":Ut(),onPreviousClick:ft,onNextClick:Xt,previousMonth:$,nextMonth:ce}),R.map((he,Ae)=>se.createElement(l.Month,{"data-animated-month":a.animate?"true":void 0,className:p[me.Month],style:j?.[me.Month],key:Ae,displayIndex:Ae,calendarMonth:he},x==="around"&&!a.hideNavigation&&Ae===0&&se.createElement(l.PreviousMonthButton,{type:"button",className:p[me.PreviousMonthButton],tabIndex:$?void 0:-1,"aria-disabled":$?void 0:!0,"aria-label":Qt($),onClick:ft,"data-animated-button":a.animate?"true":void 0},se.createElement(l.Chevron,{disabled:$?void 0:!0,className:p[me.Chevron],orientation:a.dir==="rtl"?"right":"left"})),se.createElement(l.MonthCaption,{"data-animated-caption":a.animate?"true":void 0,className:p[me.MonthCaption],style:j?.[me.MonthCaption],calendarMonth:he,displayIndex:Ae},y?.startsWith("dropdown")?se.createElement(l.DropdownNav,{className:p[me.Dropdowns],style:j?.[me.Dropdowns]},(()=>{const be=y==="dropdown"||y==="dropdown-months"?se.createElement(l.MonthsDropdown,{key:"month",className:p[me.MonthsDropdown],"aria-label":nt(),classNames:p,components:l,disabled:!!a.disableNavigation,onChange:wi(he.date),options:eO(he.date,W,ee,u,h),style:j?.[me.Dropdown],value:h.getMonth(he.date)}):se.createElement("span",{key:"month"},F(he.date,h)),ke=y==="dropdown"||y==="dropdown-years"?se.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:aO(W,ee,u,h,!!a.reverseYears),style:j?.[me.Dropdown],value:h.getYear(he.date)}):se.createElement("span",{key:"year"},ye(he.date,h));return h.getMonthYearOrder()==="year-first"?[ke,be]:[be,ke]})(),se.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"}},L(he.date,h.options,h))):se.createElement(l.CaptionLabel,{className:p[me.CaptionLabel],role:"status","aria-live":"polite"},L(he.date,h.options,h))),x==="around"&&!a.hideNavigation&&Ae===b-1&&se.createElement(l.NextMonthButton,{type:"button",className:p[me.NextMonthButton],tabIndex:ce?void 0:-1,"aria-disabled":ce?void 0:!0,"aria-label":Gn(ce),onClick:Xt,"data-animated-button":a.animate?"true":void 0},se.createElement(l.Chevron,{disabled:ce?void 0:!0,className:p[me.Chevron],orientation:a.dir==="rtl"?"left":"right"})),Ae===b-1&&x==="after"&&!a.hideNavigation&&se.createElement(l.Nav,{"data-animated-nav":a.animate?"true":void 0,className:p[me.Nav],style:j?.[me.Nav],"aria-label":Ut(),onPreviousClick:ft,onNextClick:Xt,previousMonth:$,nextMonth:ce}),se.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:j?.[me.MonthGrid]},!a.hideWeekdays&&se.createElement(l.Weekdays,{"data-animated-weekdays":a.animate?"true":void 0,className:p[me.Weekdays],style:j?.[me.Weekdays]},k&&se.createElement(l.WeekNumberHeader,{"aria-label":Dn(h.options),className:p[me.WeekNumberHeader],style:j?.[me.WeekNumberHeader],scope:"col"},ae()),Sa.map(be=>se.createElement(l.Weekday,{"aria-label":Ee(be,h.options,h),className:p[me.Weekday],key:String(be),style:j?.[me.Weekday],scope:"col"},te(be,h.options,h)))),se.createElement(l.Weeks,{"data-animated-weeks":a.animate?"true":void 0,className:p[me.Weeks],style:j?.[me.Weeks]},he.weeks.map(be=>se.createElement(l.Week,{className:p[me.Week],key:be.weekNumber,style:j?.[me.Week],week:be},k&&se.createElement(l.WeekNumber,{week:be,style:j?.[me.WeekNumber],"aria-label":$t(be.weekNumber,{locale:m}),className:p[me.WeekNumber],scope:"row",role:"rowheader"},Q(be.weekNumber,h)),be.days.map(ke=>{const{date:Je}=ke,we=Ne(ke);if(we[it.focused]=!we.hidden&&!!ie?.isEqualTo(ke),we[Mn.selected]=V?.(Je)||we.selected,zr(oe)){const{from:Zt,to:wn}=oe;we[Mn.range_start]=!!(Zt&&wn&&h.isSameDay(Je,Zt)),we[Mn.range_end]=!!(Zt&&wn&&h.isSameDay(Je,wn)),we[Mn.range_middle]=ya(oe,Je,!0,h)}const _t=tO(we,j,a.modifiersStyles),Qn=LM(we,p,a.modifiersClassNames),Nt=!Yn&&!we.hidden?Ct(Je,we,h.options,h):void 0;return se.createElement(l.Day,{key:`${ke.isoDate}_${ke.displayMonthId}`,day:ke,modifiers:we,className:Qn.join(" "),style:_t,role:"gridcell","aria-selected":we.selected||void 0,"aria-label":Nt,"data-day":ke.isoDate,"data-month":ke.outside?ke.dateMonthId:void 0,"data-selected":we.selected||void 0,"data-disabled":we.disabled||void 0,"data-hidden":we.hidden||void 0,"data-outside":ke.outside||void 0,"data-focused":we.focused||void 0,"data-today":we.today||void 0},!we.hidden&&Yn?se.createElement(l.DayButton,{className:p[me.DayButton],style:j?.[me.DayButton],type:"button",day:ke,modifiers:we,disabled:!we.focused&&we.disabled||void 0,"aria-disabled":we.focused&&we.disabled||void 0,tabIndex:xe(ke)?0:-1,"aria-label":St(Je,we,h.options,h),onClick:Vn(ke,we),onBlur:kn(ke,we),onFocus:Ja(ke,we),onKeyDown:Rn(ke,we),onMouseEnter:Es(ke,we),onMouseLeave:Ci(ke,we)},X(Je,h.options,h)):!we.hidden&&X(ke.date,h.options,h))})))))))),a.footer&&se.createElement(l.Footer,{className:p[me.Footer],style:j?.[me.Footer],role:"status","aria-live":"polite"},a.footer)))}function MO({className:n,classNames:a,showOutsideDays:o=!0,...l}){return r.jsx(EO,{showOutsideDays:o,className:q("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:q(ar({variant:"ghost"}),"h-7 w-7 bg-transparent p-0 opacity-70 hover:opacity-100 hover:bg-accent rounded-md"),button_next:q(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:q("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:q(ar({variant:"ghost"}),"h-8 w-8 p-0 font-normal rounded-full text-xs","aria-selected:opacity-100"),range_start:q("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:q("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:q("aria-selected:bg-accent aria-selected:text-accent-foreground","aria-selected:rounded-none"),selected:q("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"?Dd:br;return r.jsx(m,{className:q("h-4 w-4",f),...h})}},...l})}MO.displayName="Calendar";const OO=S.lazy(()=>gt(()=>Promise.resolve().then(()=>hf),void 0).then(n=>({default:n.CodeEditor})));function $T({rawJsonContent:n,isRawJsonValid:a,rawJsonEdits:o,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(Tn,{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&&o!==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(vi,{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(OO,{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 WT={target:"Target CLI",cliproxy:"CLIProxy Provider","api-profiles":"API Profile",websearch:"WebSearch"},XT=[{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"]}],TO=[{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."}],DO=new Map(TO.map(n=>[n.id,n]));function ZT(n){return n.entryIds.map(a=>DO.get(a)).filter(a=>!!a)}function JT(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 kO(){const{t:n}=Lt(),[a,o]=S.useState(""),[l,u]=S.useState(""),[f,h]=S.useState(null),[m,p]=S.useState(!1),{login:y,authRequired:C,isAuthenticated:x}=Ud(),b=Od(),w=gr().state?.from?.pathname||"/";if(S.useEffect(()=>{(x||!C)&&b(w,{replace:!0})},[x,C,b,w]),x||!C)return null;const O=async D=>{D.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(ME,{className:"w-full max-w-sm",children:[r.jsxs(OE,{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(TE,{className:"text-2xl",children:n("auth.dashboardTitle")}),r.jsx(DE,{children:n("auth.loginDescription")})]}),r.jsx(kE,{children:r.jsxs("form",{onSubmit:O,className:"space-y-4",children:[f&&r.jsxs(lf,{variant:"destructive",children:[r.jsx(_d,{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:D=>o(D.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:D=>u(D.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(Tn,{className:"mr-2 h-4 w-4 animate-spin"}),n("auth.signingIn")]}):n("auth.signIn")})]})})]})})}const RO=S.lazy(()=>gt(()=>import("./index-jqDLGaO4.js"),__vite__mapDeps([18,1,2,4,5,7,19,6,8,9])).then(n=>({default:n.AnalyticsPage}))),_O=S.lazy(()=>gt(()=>import("./api-C73W2Hb1.js"),__vite__mapDeps([20,1,2,5,21,15,6,4,22,7,8,9])).then(n=>({default:n.ApiPage}))),zO=S.lazy(()=>gt(()=>import("./cliproxy-DAlyh7zw.js"),__vite__mapDeps([23,1,2,5,13,6,4,14,15,24,21,22,3,7,8,9])).then(n=>({default:n.CliproxyPage}))),LO=S.lazy(()=>gt(()=>import("./cliproxy-control-panel-CE4y4VDk.js"),__vite__mapDeps([25,1,2,5,13,4,6,7,8,9])).then(n=>({default:n.CliproxyControlPanelPage}))),PO=S.lazy(()=>gt(()=>import("./copilot-Cm5PT0v6.js"),__vite__mapDeps([26,1,2,5,21,15,4,22,3,6,7,8,9])).then(n=>({default:n.CopilotPage}))),UO=S.lazy(()=>gt(()=>import("./cursor-DYhCaKbC.js"),__vite__mapDeps([27,1,2,6,5,13,3,22,4,7,8,9])).then(n=>({default:n.CursorPage}))),HO=S.lazy(()=>gt(()=>import("./droid-eTM2_tVh.js"),__vite__mapDeps([28,1,2,6,5,4,22,7,8,9])).then(n=>({default:n.DroidPage}))),IO=S.lazy(()=>gt(()=>import("./accounts-Cs_Uohn7.js"),__vite__mapDeps([29,1,2,5,15,6,4,24,7,8,9])).then(n=>({default:n.AccountsPage}))),BO=S.lazy(()=>gt(()=>Promise.resolve().then(()=>XE),void 0).then(n=>({default:n.SettingsPage}))),qO=S.lazy(()=>gt(()=>import("./health-Bk8Cj2vi.js"),__vite__mapDeps([30,1,2,5,6,4,7,8,9])).then(n=>({default:n.HealthPage}))),KO=S.lazy(()=>gt(()=>import("./shared-C9EvhZ8u.js"),__vite__mapDeps([31,1,2,4,5,6,7,8,9])).then(n=>({default:n.SharedPage}))),GO=S.lazy(()=>gt(()=>import("./updates-FcpGeTFg.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(Tn,{className:"h-8 w-8 animate-spin text-muted-foreground"})})}function YO(){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(zt,{path:"/login",element:r.jsx(kO,{})}),r.jsx(zt,{element:r.jsx(Zw,{}),children:r.jsxs(zt,{element:r.jsx(Q1,{}),children:[r.jsx(zt,{path:"/",element:r.jsx(VA,{})}),r.jsx(zt,{path:"/analytics",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(RO,{})})}),r.jsx(zt,{path:"/updates",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(GO,{})})}),r.jsx(zt,{path:"/providers",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(_O,{})})}),r.jsx(zt,{path:"/cliproxy",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(zO,{})})}),r.jsx(zt,{path:"/cliproxy/control-panel",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(LO,{})})}),r.jsx(zt,{path:"/copilot",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(PO,{})})}),r.jsx(zt,{path:"/cursor",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(UO,{})})}),r.jsx(zt,{path:"/droid",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(HO,{})})}),r.jsx(zt,{path:"/accounts",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(IO,{})})}),r.jsx(zt,{path:"/settings",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(BO,{})})}),r.jsx(zt,{path:"/health",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(qO,{})})}),r.jsx(zt,{path:"/shared",element:r.jsx(S.Suspense,{fallback:r.jsx(Cn,{}),children:r.jsx(KO,{})})})]})})]}),r.jsx(NS,{position:"top-right"})]})})})})})}const Av=document.getElementById("root");if(!Av)throw new Error("Root element not found. Failed to mount React application.");QC.createRoot(Av).render(r.jsx(S.StrictMode,{children:r.jsx(YO,{})}));export{IT as $,XA as A,Qa as B,ME as C,aE as D,_T as E,LT as F,QA as G,tE as H,Un as I,sE as J,zT as K,ln as L,XN as M,ZN as N,JN as O,ux as P,$x as Q,cf as R,qe as S,$a as T,mr as U,jd as V,ct as W,HT as X,Qe as Y,UT as Z,DE as _,Lt as a,av as a$,BT as a0,Zx as a1,qT as a2,FN as a3,sT as a4,dT as a5,fT as a6,Kd as a7,Gd as a8,Yd as a9,_1 as aA,z1 as aB,L1 as aC,P1 as aD,hx as aE,jj as aF,wx as aG,mT as aH,pT as aI,gT as aJ,yT as aK,YT as aL,aT as aM,WN as aN,oT as aO,lT as aP,QN as aQ,$N as aR,rT as aS,cT as aT,uT as aU,iT as aV,Xd as aW,wo as aX,tT as aY,nT as aZ,$T as a_,Vd as aa,Fd as ab,KT as ac,_E as ad,GT as ae,Za as af,ET as ag,zE as ah,OT as ai,hT as aj,MT as ak,TT as al,Kg as am,DT as an,H1 as ao,y1 as ap,jT as aq,j1 as ar,AT as as,Cj as at,pN as au,gN as av,Mr as aw,Er as ax,Or as ay,Cs as az,kE as b,sf as b0,_o as b1,of as b2,KA as b3,kT as b4,RT as b5,lf as b6,Yx as b7,rf as b8,JT as b9,WT as ba,XT as bb,ZT as bc,iv as bd,VE as be,QE as bf,ST as bg,xT as bh,ax as bi,Tw as bj,Mw as bk,yd as bl,Ns as bm,bw as bn,Cw as bo,Aw as bp,kw as bq,CT as br,vT as bs,bT as bt,NT as bu,wT as bv,ar as bw,q as c,ut as d,VT as e,FT as f,ZE as g,MO as h,eT as i,OE as j,TE as k,uj as l,dj as m,bi as n,QT as o,Wa as p,Xa as q,xx as r,Zd as s,vx as t,Ld as u,Jd as v,dr as w,ny as x,lE as y,PT as z};