@kaitranntt/ccs 7.9.0-dev.1 → 7.9.0

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 (46) hide show
  1. package/dist/cliproxy/index.d.ts +0 -2
  2. package/dist/cliproxy/index.d.ts.map +1 -1
  3. package/dist/cliproxy/index.js +1 -3
  4. package/dist/cliproxy/index.js.map +1 -1
  5. package/dist/cliproxy/stats-fetcher.d.ts +0 -4
  6. package/dist/cliproxy/stats-fetcher.d.ts.map +1 -1
  7. package/dist/cliproxy/stats-fetcher.js.map +1 -1
  8. package/dist/ui/assets/accounts-CZms_PBW.js +1 -0
  9. package/dist/ui/assets/{alert-dialog-zpnBn2CA.js → alert-dialog-sKmXLtjs.js} +1 -1
  10. package/dist/ui/assets/api-TANgowVA.js +1 -0
  11. package/dist/ui/assets/auth-section-Ddg5Cdd6.js +1 -0
  12. package/dist/ui/assets/{card-dTUi3LxW.js → card-CfgEo_Fi.js} +1 -1
  13. package/dist/ui/assets/cliproxy-BpCuX751.js +3 -0
  14. package/dist/ui/assets/cliproxy-control-panel-Cp0Tweyl.js +1 -0
  15. package/dist/ui/assets/{confirm-dialog-ByfOsjk9.js → confirm-dialog-Dut98zdb.js} +1 -1
  16. package/dist/ui/assets/{copilot-BQscualu.js → copilot-DvOZJmtw.js} +3 -3
  17. package/dist/ui/assets/globalenv-section-DlnizwvB.js +1 -0
  18. package/dist/ui/assets/{health-DTRd-dXk.js → health-D1M4owiM.js} +1 -1
  19. package/dist/ui/assets/icons-CMYcel9O.js +1 -0
  20. package/dist/ui/assets/index-BCBypoXT.js +1 -0
  21. package/dist/ui/assets/index-BXkzlgVE.js +1 -0
  22. package/dist/ui/assets/{index-Bfwze8tN.js → index-Bdp0Hpgh.js} +1 -1
  23. package/dist/ui/assets/index-D-LYJymx.js +47 -0
  24. package/dist/ui/assets/index-DQAJ1wqP.css +1 -0
  25. package/dist/ui/assets/{shared-BgDSyHKz.js → shared-Dgmje0CZ.js} +1 -1
  26. package/dist/ui/assets/{switch-B0PXGFIv.js → switch-MkSHHW1_.js} +1 -1
  27. package/dist/ui/index.html +3 -3
  28. package/dist/web-server/routes/cliproxy-stats-routes.d.ts.map +1 -1
  29. package/dist/web-server/routes/cliproxy-stats-routes.js +5 -89
  30. package/dist/web-server/routes/cliproxy-stats-routes.js.map +1 -1
  31. package/package.json +1 -1
  32. package/dist/cliproxy/quota-fetcher.d.ts +0 -46
  33. package/dist/cliproxy/quota-fetcher.d.ts.map +0 -1
  34. package/dist/cliproxy/quota-fetcher.js +0 -406
  35. package/dist/cliproxy/quota-fetcher.js.map +0 -1
  36. package/dist/ui/assets/accounts-CmzZXhfc.js +0 -1
  37. package/dist/ui/assets/api-DFbZVPK4.js +0 -1
  38. package/dist/ui/assets/auth-section-YgJ7Cv--.js +0 -1
  39. package/dist/ui/assets/cliproxy-CsqKCFzj.js +0 -3
  40. package/dist/ui/assets/cliproxy-control-panel-BRCh_7b3.js +0 -1
  41. package/dist/ui/assets/globalenv-section-BEpPTvKo.js +0 -1
  42. package/dist/ui/assets/icons-CwFZAiDB.js +0 -1
  43. package/dist/ui/assets/index-BLoAjpcw.js +0 -1
  44. package/dist/ui/assets/index-CEZrgkam.js +0 -1
  45. package/dist/ui/assets/index-QeBLfRj8.js +0 -47
  46. package/dist/ui/assets/index-oS2cgEFl.css +0 -1
@@ -0,0 +1,47 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BXkzlgVE.js","assets/radix-ui-uXQB-q0u.js","assets/react-vendor-B_CU-WTZ.js","assets/switch-MkSHHW1_.js","assets/icons-CMYcel9O.js","assets/tanstack-Coed0rqz.js","assets/notifications-dJQY2-U6.js","assets/utils-CzKF5WmX.js","assets/form-utils-kUVlZZAO.js","assets/code-highlight-DKN39ySy.js","assets/globalenv-section-DlnizwvB.js","assets/index-BCBypoXT.js","assets/auth-section-Ddg5Cdd6.js","assets/index-Bdp0Hpgh.js","assets/card-CfgEo_Fi.js","assets/charts-CJC4bH8P.js","assets/api-TANgowVA.js","assets/confirm-dialog-Dut98zdb.js","assets/alert-dialog-sKmXLtjs.js","assets/cliproxy-BpCuX751.js","assets/cliproxy-control-panel-Cp0Tweyl.js","assets/copilot-DvOZJmtw.js","assets/accounts-CZms_PBW.js","assets/health-D1M4owiM.js","assets/shared-Dgmje0CZ.js"])))=>i.map(i=>d[i]);
2
+ import{j as o,S as Bo,R as kp,C as Rp,a as Up,T as Bp,D as Hp,P as qp,O as Lp,b as zx,c as Tx,d as Ox,e as Ax,f as Dx,A as _x,g as kx,h as Rx,i as Ux,k as Yp,V as Bx,l as Hx,m as Gp,n as qx,L as Kp,o as Vp,p as Qp,q as Lx,r as Yx,s as Xp,I as Gx,t as Zp,u as Wp,v as Kx,w as Jp,x as Vx,y as $p,z as Fp,B as Qx,E as Xx,F as Ip,G as Zx,H as Wx,J as Jx,K as $x,M as Pp,N as Fx,Q as Ix,U as Px}from"./radix-ui-uXQB-q0u.js";import{e as eg,f as e0,r as x,u as t0,L as wc,O as n0,R as a0,h as l0,g as s0,i as i0,c as P,B as o0,j as r0,k as Sn}from"./react-vendor-B_CU-WTZ.js";import{Q as u0,u as Gt,a as Ot,b as gn,c as c0}from"./tanstack-Coed0rqz.js";import{t as Ce,T as d0}from"./notifications-dJQY2-U6.js";import{t as f0,c as m0,a as Ho,e as Fs,f as ei,b as h0,d as p0,g as g0,h as y0,i as v0,j as x0,k as b0,l as S0,m as N0,n as j0,o as C0,p as E0,q as w0,r as M0,s as z0,u as T0,v as O0,w as A0,x as D0,y as _0,z as k0,A as R0,B as U0,C as B0,D as H0,E as q0,F as L0,G as Y0,H as G0,I as K0,J as V0}from"./utils-CzKF5WmX.js";import{X as ui,P as Q0,H as X0,C as Z0,K as tg,G as W0,Z as ng,a as ag,F as lg,U as sg,A as si,S as J0,b as qo,c as $0,M as F0,E as Lo,d as Yo,B as I0,W as P0,e as Xh,f as eb,g as tb,h as Zh,i as Wh,L as ci,j as es,k as ig,l as _o,m as og,n as Go,o as Ac,p as Ko,R as nb,q as ab,r as lb,s as rg,I as Vo,T as sb,t as ib,u as ob,v as rb,w as Dc,x as ub,y as cb,z as _c,D as Qo,J as kc,N as Jh,O as db,Q as fb,V as mb,Y as hb,_ as $h,$ as Fh,a0 as pb}from"./icons-CMYcel9O.js";import{o as Ih,s as Ph,p as gb,a as yb,$ as vb,b as ug,c as xb,d as ll,u as bb,e as Sb}from"./form-utils-kUVlZZAO.js";import{H as Nb,t as ep}from"./code-highlight-DKN39ySy.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))c(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const h of m.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function r(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function c(d){if(d.ep)return;d.ep=!0;const m=r(d);fetch(d.href,m)}})();var fc={exports:{}},Is={},mc={exports:{}},hc={};var tp;function jb(){return tp||(tp=1,(function(l){function s(z,Z){var ae=z.length;z.push(Z);e:for(;0<ae;){var ye=ae-1>>>1,ve=z[ye];if(0<d(ve,Z))z[ye]=Z,z[ae]=ve,ae=ye;else break e}}function r(z){return z.length===0?null:z[0]}function c(z){if(z.length===0)return null;var Z=z[0],ae=z.pop();if(ae!==Z){z[0]=ae;e:for(var ye=0,ve=z.length,Oe=ve>>>1;ye<Oe;){var ce=2*(ye+1)-1,X=z[ce],F=ce+1,le=z[F];if(0>d(X,ae))F<ve&&0>d(le,X)?(z[ye]=le,z[F]=ae,ye=F):(z[ye]=X,z[ce]=ae,ye=ce);else if(F<ve&&0>d(le,ae))z[ye]=le,z[F]=ae,ye=F;else break e}}return Z}function d(z,Z){var ae=z.sortIndex-Z.sortIndex;return ae!==0?ae:z.id-Z.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;l.unstable_now=function(){return m.now()}}else{var h=Date,p=h.now();l.unstable_now=function(){return h.now()-p}}var y=[],S=[],w=1,v=null,b=3,_=!1,A=!1,R=!1,B=!1,M=typeof setTimeout=="function"?setTimeout:null,Y=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function Q(z){for(var Z=r(S);Z!==null;){if(Z.callback===null)c(S);else if(Z.startTime<=z)c(S),Z.sortIndex=Z.expirationTime,s(y,Z);else break;Z=r(S)}}function k(z){if(R=!1,Q(z),!A)if(r(y)!==null)A=!0,j||(j=!0,oe());else{var Z=r(S);Z!==null&&$(k,Z.startTime-z)}}var j=!1,q=-1,J=5,ee=-1;function de(){return B?!0:!(l.unstable_now()-ee<J)}function xe(){if(B=!1,j){var z=l.unstable_now();ee=z;var Z=!0;try{e:{A=!1,R&&(R=!1,Y(q),q=-1),_=!0;var ae=b;try{t:{for(Q(z),v=r(y);v!==null&&!(v.expirationTime>z&&de());){var ye=v.callback;if(typeof ye=="function"){v.callback=null,b=v.priorityLevel;var ve=ye(v.expirationTime<=z);if(z=l.unstable_now(),typeof ve=="function"){v.callback=ve,Q(z),Z=!0;break t}v===r(y)&&c(y),Q(z)}else c(y);v=r(y)}if(v!==null)Z=!0;else{var Oe=r(S);Oe!==null&&$(k,Oe.startTime-z),Z=!1}}break e}finally{v=null,b=ae,_=!1}Z=void 0}}finally{Z?oe():j=!1}}}var oe;if(typeof G=="function")oe=function(){G(xe)};else if(typeof MessageChannel<"u"){var Ye=new MessageChannel,Se=Ye.port2;Ye.port1.onmessage=xe,oe=function(){Se.postMessage(null)}}else oe=function(){M(xe,0)};function $(z,Z){q=M(function(){z(l.unstable_now())},Z)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(z){z.callback=null},l.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):J=0<z?Math.floor(1e3/z):5},l.unstable_getCurrentPriorityLevel=function(){return b},l.unstable_next=function(z){switch(b){case 1:case 2:case 3:var Z=3;break;default:Z=b}var ae=b;b=Z;try{return z()}finally{b=ae}},l.unstable_requestPaint=function(){B=!0},l.unstable_runWithPriority=function(z,Z){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var ae=b;b=z;try{return Z()}finally{b=ae}},l.unstable_scheduleCallback=function(z,Z,ae){var ye=l.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?ye+ae:ye):ae=ye,z){case 1:var ve=-1;break;case 2:ve=250;break;case 5:ve=1073741823;break;case 4:ve=1e4;break;default:ve=5e3}return ve=ae+ve,z={id:w++,callback:Z,priorityLevel:z,startTime:ae,expirationTime:ve,sortIndex:-1},ae>ye?(z.sortIndex=ae,s(S,z),r(y)===null&&z===r(S)&&(R?(Y(q),q=-1):R=!0,$(k,ae-ye))):(z.sortIndex=ve,s(y,z),A||_||(A=!0,j||(j=!0,oe()))),z},l.unstable_shouldYield=de,l.unstable_wrapCallback=function(z){var Z=b;return function(){var ae=b;b=Z;try{return z.apply(this,arguments)}finally{b=ae}}}})(hc)),hc}var np;function Cb(){return np||(np=1,mc.exports=jb()),mc.exports}var ap;function Eb(){if(ap)return Is;ap=1;var l=Cb(),s=eg(),r=e0();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}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 d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n: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 p(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 y(e){if(m(e)!==e)throw Error(c(188))}function S(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,a=t;;){var i=n.return;if(i===null)break;var u=i.alternate;if(u===null){if(a=i.return,a!==null){n=a;continue}break}if(i.child===u.child){for(u=i.child;u;){if(u===n)return y(i),e;if(u===a)return y(i),t;u=u.sibling}throw Error(c(188))}if(n.return!==a.return)n=i,a=u;else{for(var f=!1,g=i.child;g;){if(g===n){f=!0,n=i,a=u;break}if(g===a){f=!0,a=i,n=u;break}g=g.sibling}if(!f){for(g=u.child;g;){if(g===n){f=!0,n=u,a=i;break}if(g===a){f=!0,a=u,n=i;break}g=g.sibling}if(!f)throw Error(c(189))}}if(n.alternate!==a)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function w(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=w(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,b=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),Y=Symbol.for("react.consumer"),G=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),de=Symbol.for("react.memo_cache_sentinel"),xe=Symbol.iterator;function oe(e){return e===null||typeof e!="object"?null:(e=xe&&e[xe]||e["@@iterator"],typeof e=="function"?e:null)}var Ye=Symbol.for("react.client.reference");function Se(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 R:return"Fragment";case M:return"Profiler";case B:return"StrictMode";case k:return"Suspense";case j:return"SuspenseList";case ee:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case G:return e.displayName||"Context";case Y:return(e._context.displayName||"Context")+".Consumer";case Q:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case q:return t=e.displayName||null,t!==null?t:Se(e.type)||"Memo";case J:t=e._payload,e=e._init;try{return Se(e(t))}catch{}}return null}var $=Array.isArray,z=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},ye=[],ve=-1;function Oe(e){return{current:e}}function ce(e){0>ve||(e.current=ye[ve],ye[ve]=null,ve--)}function X(e,t){ve++,ye[ve]=e.current,e.current=t}var F=Oe(null),le=Oe(null),I=Oe(null),ne=Oe(null);function ge(e,t){switch(X(I,t),X(le,e),X(F,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ph(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ph(t),e=gh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ce(F),X(F,e)}function Ae(){ce(F),ce(le),ce(I)}function Ge(e){e.memoizedState!==null&&X(ne,e);var t=F.current,n=gh(t,e.type);t!==n&&(X(le,e),X(F,n))}function ht(e){le.current===e&&(ce(F),ce(le)),ne.current===e&&(ce(ne),Zs._currentValue=ae)}var pt,Ve;function et(e){if(pt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);pt=t&&t[1]||"",Ve=-1<n.stack.indexOf(`
3
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
4
+ `+pt+e+Ve}var Dt=!1;function Kt(e,t){if(!e||Dt)return"";Dt=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var K=function(){throw Error()};if(Object.defineProperty(K.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(K,[])}catch(U){var D=U}Reflect.construct(e,[],K)}else{try{K.call()}catch(U){D=U}e.call(K.prototype)}}else{try{throw Error()}catch(U){D=U}(K=e())&&typeof K.catch=="function"&&K.catch(function(){})}}catch(U){if(U&&D&&typeof U.stack=="string")return[U.stack,D.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),f=u[0],g=u[1];if(f&&g){var N=f.split(`
5
+ `),O=g.split(`
6
+ `);for(i=a=0;a<N.length&&!N[a].includes("DetermineComponentFrameRoot");)a++;for(;i<O.length&&!O[i].includes("DetermineComponentFrameRoot");)i++;if(a===N.length||i===O.length)for(a=N.length-1,i=O.length-1;1<=a&&0<=i&&N[a]!==O[i];)i--;for(;1<=a&&0<=i;a--,i--)if(N[a]!==O[i]){if(a!==1||i!==1)do if(a--,i--,0>i||N[a]!==O[i]){var H=`
7
+ `+N[a].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),H}while(1<=a&&0<=i);break}}}finally{Dt=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?et(n):""}function Un(e,t){switch(e.tag){case 26:case 27:case 5:return et(e.type);case 16:return et("Lazy");case 13:return e.child!==t&&t!==null?et("Suspense Fallback"):et("Suspense");case 19:return et("SuspenseList");case 0:case 15:return Kt(e.type,!1);case 11:return Kt(e.type.render,!1);case 1:return Kt(e.type,!0);case 31:return et("Activity");default:return""}}function Ne(e){try{var t="",n=null;do t+=Un(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
8
+ Error generating stack: `+a.message+`
9
+ `+a.stack}}var Vt=Object.prototype.hasOwnProperty,En=l.unstable_scheduleCallback,Qt=l.unstable_cancelCallback,ca=l.unstable_shouldYield,Bn=l.unstable_requestPaint,ot=l.unstable_now,Xt=l.unstable_getCurrentPriorityLevel,Hn=l.unstable_ImmediatePriority,qa=l.unstable_UserBlockingPriority,wn=l.unstable_NormalPriority,Mn=l.unstable_LowPriority,cl=l.unstable_IdlePriority,ns=l.log,as=l.unstable_setDisableYieldValue,qn=null,W=null;function we(e){if(typeof ns=="function"&&as(e),W&&typeof W.setStrictMode=="function")try{W.setStrictMode(qn,e)}catch{}}var fe=Math.clz32?Math.clz32:ie,Me=Math.log,tt=Math.LN2;function ie(e){return e>>>=0,e===0?32:31-(Me(e)/tt|0)|0}var be=256,me=262144,ze=4194304;function Fe(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 pe(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var i=0,u=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var g=a&134217727;return g!==0?(a=g&~u,a!==0?i=Fe(a):(f&=g,f!==0?i=Fe(f):n||(n=g&~e,n!==0&&(i=Fe(n))))):(g=a&~u,g!==0?i=Fe(g):f!==0?i=Fe(f):n||(n=a&~e,n!==0&&(i=Fe(n)))),i===0?0:t!==0&&t!==i&&(t&u)===0&&(u=i&-i,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:i}function zt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ln(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 vt(){var e=ze;return ze<<=1,(ze&62914560)===0&&(ze=4194304),e}function Zt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ls(e,t,n,a,i,u){var f=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var g=e.entanglements,N=e.expirationTimes,O=e.hiddenUpdates;for(n=f&~n;0<n;){var H=31-fe(n),K=1<<H;g[H]=0,N[H]=-1;var D=O[H];if(D!==null)for(O[H]=null,H=0;H<D.length;H++){var U=D[H];U!==null&&(U.lane&=-536870913)}n&=~K}a!==0&&La(e,a,0),u!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=u&~(f&~t))}function La(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-fe(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function ss(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-fe(n),i=1<<a;i&t|e[a]&t&&(e[a]|=t),n&=~i}}function ln(e,t){var n=t&-t;return n=(n&42)!==0?1:Yn(n),(n&(e.suspendedLanes|t))!==0?0:n}function Yn(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 dl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function is(){var e=Z.p;return e!==0?e:(e=window.event,e===void 0?32:qh(e.type))}function os(e,t){var n=Z.p;try{return Z.p=e,t()}finally{Z.p=n}}var da=Math.random().toString(36).slice(2),Nt="__reactFiber$"+da,_t="__reactProps$"+da,fl="__reactContainer$"+da,ar="__reactEvents$"+da,yy="__reactListeners$"+da,vy="__reactHandles$"+da,td="__reactResources$"+da,rs="__reactMarker$"+da;function lr(e){delete e[Nt],delete e[_t],delete e[ar],delete e[yy],delete e[vy]}function ml(e){var t=e[Nt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[fl]||n[Nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=jh(e);e!==null;){if(n=e[Nt])return n;e=jh(e)}return t}e=n,n=e.parentNode}return null}function hl(e){if(e=e[Nt]||e[fl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function us(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function pl(e){var t=e[td];return t||(t=e[td]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function xt(e){e[rs]=!0}var nd=new Set,ad={};function Ya(e,t){gl(e,t),gl(e+"Capture",t)}function gl(e,t){for(ad[e]=t,e=0;e<t.length;e++)nd.add(t[e])}var xy=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]*$"),ld={},sd={};function by(e){return Vt.call(sd,e)?!0:Vt.call(ld,e)?!1:xy.test(e)?sd[e]=!0:(ld[e]=!0,!1)}function mi(e,t,n){if(by(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function hi(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Gn(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}function sn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function id(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Sy(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var i=a.get,u=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(f){n=""+f,u.call(this,f)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(f){n=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function sr(e){if(!e._valueTracker){var t=id(e)?"checked":"value";e._valueTracker=Sy(e,t,""+e[t])}}function od(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=id(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function pi(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 Ny=/[\n"\\]/g;function on(e){return e.replace(Ny,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ir(e,t,n,a,i,u,f,g){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+sn(t)):e.value!==""+sn(t)&&(e.value=""+sn(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?or(e,f,sn(t)):n!=null?or(e,f,sn(n)):a!=null&&e.removeAttribute("value"),i==null&&u!=null&&(e.defaultChecked=!!u),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+sn(g):e.removeAttribute("name")}function rd(e,t,n,a,i,u,f,g){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||n!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){sr(e);return}n=n!=null?""+sn(n):"",t=t!=null?""+sn(t):n,g||t===e.value||(e.value=t),e.defaultValue=t}a=a??i,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=g?e.checked:!!a,e.defaultChecked=!!a,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),sr(e)}function or(e,t,n){t==="number"&&pi(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function yl(e,t,n,a){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&a&&(e[n].defaultSelected=!0)}else{for(n=""+sn(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,a&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function ud(e,t,n){if(t!=null&&(t=""+sn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+sn(n):""}function cd(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(c(92));if($(a)){if(1<a.length)throw Error(c(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=sn(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),sr(e)}function vl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var jy=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 dd(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||jy.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function fd(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var i in t)a=t[i],t.hasOwnProperty(i)&&n[i]!==a&&dd(e,i,a)}else for(var u in t)t.hasOwnProperty(u)&&dd(e,u,t[u])}function rr(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 Cy=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"]]),Ey=/^[\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 gi(e){return Ey.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Kn(){}var ur=null;function cr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xl=null,bl=null;function md(e){var t=hl(e);if(t&&(e=t.stateNode)){var n=e[_t]||null;e:switch(e=t.stateNode,t.type){case"input":if(ir(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+on(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var i=a[_t]||null;if(!i)throw Error(c(90));ir(a,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&od(a)}break e;case"textarea":ud(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&yl(e,!!n.multiple,t,!1)}}}var dr=!1;function hd(e,t,n){if(dr)return e(t,n);dr=!0;try{var a=e(t);return a}finally{if(dr=!1,(xl!==null||bl!==null)&&(ao(),xl&&(t=xl,e=bl,bl=xl=null,md(t),e)))for(t=0;t<e.length;t++)md(e[t])}}function cs(e,t){var n=e.stateNode;if(n===null)return null;var a=n[_t]||null;if(a===null)return null;n=a[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":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var Vn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fr=!1;if(Vn)try{var ds={};Object.defineProperty(ds,"passive",{get:function(){fr=!0}}),window.addEventListener("test",ds,ds),window.removeEventListener("test",ds,ds)}catch{fr=!1}var fa=null,mr=null,yi=null;function pd(){if(yi)return yi;var e,t=mr,n=t.length,a,i="value"in fa?fa.value:fa.textContent,u=i.length;for(e=0;e<n&&t[e]===i[e];e++);var f=n-e;for(a=1;a<=f&&t[n-a]===i[u-a];a++);return yi=i.slice(e,1<a?1-a:void 0)}function vi(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 xi(){return!0}function gd(){return!1}function kt(e){function t(n,a,i,u,f){this._reactName=n,this._targetInst=i,this.type=a,this.nativeEvent=u,this.target=f,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(n=e[g],this[g]=n?n(u):u[g]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?xi:gd,this.isPropagationStopped=gd,this}return v(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=xi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=xi)},persist:function(){},isPersistent:xi}),t}var Ga={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bi=kt(Ga),fs=v({},Ga,{view:0,detail:0}),wy=kt(fs),hr,pr,ms,Si=v({},fs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yr,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!==ms&&(ms&&e.type==="mousemove"?(hr=e.screenX-ms.screenX,pr=e.screenY-ms.screenY):pr=hr=0,ms=e),hr)},movementY:function(e){return"movementY"in e?e.movementY:pr}}),yd=kt(Si),My=v({},Si,{dataTransfer:0}),zy=kt(My),Ty=v({},fs,{relatedTarget:0}),gr=kt(Ty),Oy=v({},Ga,{animationName:0,elapsedTime:0,pseudoElement:0}),Ay=kt(Oy),Dy=v({},Ga,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_y=kt(Dy),ky=v({},Ga,{data:0}),vd=kt(ky),Ry={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Uy={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"},By={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=By[e])?!!t[e]:!1}function yr(){return Hy}var qy=v({},fs,{key:function(e){if(e.key){var t=Ry[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=vi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Uy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yr,charCode:function(e){return e.type==="keypress"?vi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?vi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ly=kt(qy),Yy=v({},Si,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xd=kt(Yy),Gy=v({},fs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yr}),Ky=kt(Gy),Vy=v({},Ga,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qy=kt(Vy),Xy=v({},Si,{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}),Zy=kt(Xy),Wy=v({},Ga,{newState:0,oldState:0}),Jy=kt(Wy),$y=[9,13,27,32],vr=Vn&&"CompositionEvent"in window,hs=null;Vn&&"documentMode"in document&&(hs=document.documentMode);var Fy=Vn&&"TextEvent"in window&&!hs,bd=Vn&&(!vr||hs&&8<hs&&11>=hs),Sd=" ",Nd=!1;function jd(e,t){switch(e){case"keyup":return $y.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Sl=!1;function Iy(e,t){switch(e){case"compositionend":return Cd(t);case"keypress":return t.which!==32?null:(Nd=!0,Sd);case"textInput":return e=t.data,e===Sd&&Nd?null:e;default:return null}}function Py(e,t){if(Sl)return e==="compositionend"||!vr&&jd(e,t)?(e=pd(),yi=mr=fa=null,Sl=!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 bd&&t.locale!=="ko"?null:t.data;default:return null}}var ev={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 Ed(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ev[e.type]:t==="textarea"}function wd(e,t,n,a){xl?bl?bl.push(a):bl=[a]:xl=a,t=co(t,"onChange"),0<t.length&&(n=new bi("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var ps=null,gs=null;function tv(e){uh(e,0)}function Ni(e){var t=us(e);if(od(t))return e}function Md(e,t){if(e==="change")return t}var zd=!1;if(Vn){var xr;if(Vn){var br="oninput"in document;if(!br){var Td=document.createElement("div");Td.setAttribute("oninput","return;"),br=typeof Td.oninput=="function"}xr=br}else xr=!1;zd=xr&&(!document.documentMode||9<document.documentMode)}function Od(){ps&&(ps.detachEvent("onpropertychange",Ad),gs=ps=null)}function Ad(e){if(e.propertyName==="value"&&Ni(gs)){var t=[];wd(t,gs,e,cr(e)),hd(tv,t)}}function nv(e,t,n){e==="focusin"?(Od(),ps=t,gs=n,ps.attachEvent("onpropertychange",Ad)):e==="focusout"&&Od()}function av(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ni(gs)}function lv(e,t){if(e==="click")return Ni(t)}function sv(e,t){if(e==="input"||e==="change")return Ni(t)}function iv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Wt=typeof Object.is=="function"?Object.is:iv;function ys(e,t){if(Wt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var i=n[a];if(!Vt.call(t,i)||!Wt(e[i],t[i]))return!1}return!0}function Dd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function _d(e,t){var n=Dd(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Dd(n)}}function kd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=pi(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=pi(e.document)}return t}function Sr(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 ov=Vn&&"documentMode"in document&&11>=document.documentMode,Nl=null,Nr=null,vs=null,jr=!1;function Ud(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jr||Nl==null||Nl!==pi(a)||(a=Nl,"selectionStart"in a&&Sr(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),vs&&ys(vs,a)||(vs=a,a=co(Nr,"onSelect"),0<a.length&&(t=new bi("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Nl)))}function Ka(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var jl={animationend:Ka("Animation","AnimationEnd"),animationiteration:Ka("Animation","AnimationIteration"),animationstart:Ka("Animation","AnimationStart"),transitionrun:Ka("Transition","TransitionRun"),transitionstart:Ka("Transition","TransitionStart"),transitioncancel:Ka("Transition","TransitionCancel"),transitionend:Ka("Transition","TransitionEnd")},Cr={},Bd={};Vn&&(Bd=document.createElement("div").style,"AnimationEvent"in window||(delete jl.animationend.animation,delete jl.animationiteration.animation,delete jl.animationstart.animation),"TransitionEvent"in window||delete jl.transitionend.transition);function Va(e){if(Cr[e])return Cr[e];if(!jl[e])return e;var t=jl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Bd)return Cr[e]=t[n];return e}var Hd=Va("animationend"),qd=Va("animationiteration"),Ld=Va("animationstart"),rv=Va("transitionrun"),uv=Va("transitionstart"),cv=Va("transitioncancel"),Yd=Va("transitionend"),Gd=new Map,Er="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(" ");Er.push("scrollEnd");function vn(e,t){Gd.set(e,t),Ya(t,[e])}var ji=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)},rn=[],Cl=0,wr=0;function Ci(){for(var e=Cl,t=wr=Cl=0;t<e;){var n=rn[t];rn[t++]=null;var a=rn[t];rn[t++]=null;var i=rn[t];rn[t++]=null;var u=rn[t];if(rn[t++]=null,a!==null&&i!==null){var f=a.pending;f===null?i.next=i:(i.next=f.next,f.next=i),a.pending=i}u!==0&&Kd(n,i,u)}}function Ei(e,t,n,a){rn[Cl++]=e,rn[Cl++]=t,rn[Cl++]=n,rn[Cl++]=a,wr|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Mr(e,t,n,a){return Ei(e,t,n,a),wi(e)}function Qa(e,t){return Ei(e,null,null,t),wi(e)}function Kd(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var i=!1,u=e.return;u!==null;)u.childLanes|=n,a=u.alternate,a!==null&&(a.childLanes|=n),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(i=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,i&&t!==null&&(i=31-fe(n),e=u.hiddenUpdates,a=e[i],a===null?e[i]=[t]:a.push(t),t.lane=n|536870912),u):null}function wi(e){if(50<Ls)throw Ls=0,Uu=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var El={};function dv(e,t,n,a){this.tag=e,this.key=n,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=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jt(e,t,n,a){return new dv(e,t,n,a)}function zr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Qn(e,t){var n=e.alternate;return n===null?(n=Jt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Vd(e,t){e.flags&=65011714;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Mi(e,t,n,a,i,u){var f=0;if(a=e,typeof e=="function")zr(e)&&(f=1);else if(typeof e=="string")f=gx(e,n,F.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ee:return e=Jt(31,n,t,i),e.elementType=ee,e.lanes=u,e;case R:return Xa(n.children,i,u,t);case B:f=8,i|=24;break;case M:return e=Jt(12,n,t,i|2),e.elementType=M,e.lanes=u,e;case k:return e=Jt(13,n,t,i),e.elementType=k,e.lanes=u,e;case j:return e=Jt(19,n,t,i),e.elementType=j,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G:f=10;break e;case Y:f=9;break e;case Q:f=11;break e;case q:f=14;break e;case J:f=16,a=null;break e}f=29,n=Error(c(130,e===null?"null":typeof e,"")),a=null}return t=Jt(f,n,t,i),t.elementType=e,t.type=a,t.lanes=u,t}function Xa(e,t,n,a){return e=Jt(7,e,a,t),e.lanes=n,e}function Tr(e,t,n){return e=Jt(6,e,null,t),e.lanes=n,e}function Qd(e){var t=Jt(18,null,null,0);return t.stateNode=e,t}function Or(e,t,n){return t=Jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Xd=new WeakMap;function un(e,t){if(typeof e=="object"&&e!==null){var n=Xd.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Ne(t)},Xd.set(e,t),t)}return{value:e,source:t,stack:Ne(t)}}var wl=[],Ml=0,zi=null,xs=0,cn=[],dn=0,ma=null,zn=1,Tn="";function Xn(e,t){wl[Ml++]=xs,wl[Ml++]=zi,zi=e,xs=t}function Zd(e,t,n){cn[dn++]=zn,cn[dn++]=Tn,cn[dn++]=ma,ma=e;var a=zn;e=Tn;var i=32-fe(a)-1;a&=~(1<<i),n+=1;var u=32-fe(t)+i;if(30<u){var f=i-i%5;u=(a&(1<<f)-1).toString(32),a>>=f,i-=f,zn=1<<32-fe(t)+i|n<<i|a,Tn=u+e}else zn=1<<u|n<<i|a,Tn=e}function Ar(e){e.return!==null&&(Xn(e,1),Zd(e,1,0))}function Dr(e){for(;e===zi;)zi=wl[--Ml],wl[Ml]=null,xs=wl[--Ml],wl[Ml]=null;for(;e===ma;)ma=cn[--dn],cn[dn]=null,Tn=cn[--dn],cn[dn]=null,zn=cn[--dn],cn[dn]=null}function Wd(e,t){cn[dn++]=zn,cn[dn++]=Tn,cn[dn++]=ma,zn=t.id,Tn=t.overflow,ma=e}var jt=null,Ie=null,Be=!1,ha=null,fn=!1,_r=Error(c(519));function pa(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw bs(un(t,e)),_r}function Jd(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Nt]=e,t[_t]=a,n){case"dialog":ke("cancel",t),ke("close",t);break;case"iframe":case"object":case"embed":ke("load",t);break;case"video":case"audio":for(n=0;n<Gs.length;n++)ke(Gs[n],t);break;case"source":ke("error",t);break;case"img":case"image":case"link":ke("error",t),ke("load",t);break;case"details":ke("toggle",t);break;case"input":ke("invalid",t),rd(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":ke("invalid",t);break;case"textarea":ke("invalid",t),cd(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||mh(t.textContent,n)?(a.popover!=null&&(ke("beforetoggle",t),ke("toggle",t)),a.onScroll!=null&&ke("scroll",t),a.onScrollEnd!=null&&ke("scrollend",t),a.onClick!=null&&(t.onclick=Kn),t=!0):t=!1,t||pa(e,!0)}function $d(e){for(jt=e.return;jt;)switch(jt.tag){case 5:case 31:case 13:fn=!1;return;case 27:case 3:fn=!0;return;default:jt=jt.return}}function zl(e){if(e!==jt)return!1;if(!Be)return $d(e),Be=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Fu(e.type,e.memoizedProps)),n=!n),n&&Ie&&pa(e),$d(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Ie=Nh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Ie=Nh(e)}else t===27?(t=Ie,Ta(e.type)?(e=nc,nc=null,Ie=e):Ie=t):Ie=jt?hn(e.stateNode.nextSibling):null;return!0}function Za(){Ie=jt=null,Be=!1}function kr(){var e=ha;return e!==null&&(Ht===null?Ht=e:Ht.push.apply(Ht,e),ha=null),e}function bs(e){ha===null?ha=[e]:ha.push(e)}var Rr=Oe(null),Wa=null,Zn=null;function ga(e,t,n){X(Rr,t._currentValue),t._currentValue=n}function Wn(e){e._currentValue=Rr.current,ce(Rr)}function Ur(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function Br(e,t,n,a){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var u=i.dependencies;if(u!==null){var f=i.child;u=u.firstContext;e:for(;u!==null;){var g=u;u=i;for(var N=0;N<t.length;N++)if(g.context===t[N]){u.lanes|=n,g=u.alternate,g!==null&&(g.lanes|=n),Ur(u.return,n,e),a||(f=null);break e}u=g.next}}else if(i.tag===18){if(f=i.return,f===null)throw Error(c(341));f.lanes|=n,u=f.alternate,u!==null&&(u.lanes|=n),Ur(f,n,e),f=null}else f=i.child;if(f!==null)f.return=i;else for(f=i;f!==null;){if(f===e){f=null;break}if(i=f.sibling,i!==null){i.return=f.return,f=i;break}f=f.return}i=f}}function Tl(e,t,n,a){e=null;for(var i=t,u=!1;i!==null;){if(!u){if((i.flags&524288)!==0)u=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var f=i.alternate;if(f===null)throw Error(c(387));if(f=f.memoizedProps,f!==null){var g=i.type;Wt(i.pendingProps.value,f.value)||(e!==null?e.push(g):e=[g])}}else if(i===ne.current){if(f=i.alternate,f===null)throw Error(c(387));f.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Zs):e=[Zs])}i=i.return}e!==null&&Br(t,e,n,a),t.flags|=262144}function Ti(e){for(e=e.firstContext;e!==null;){if(!Wt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ja(e){Wa=e,Zn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ct(e){return Fd(Wa,e)}function Oi(e,t){return Wa===null&&Ja(e),Fd(e,t)}function Fd(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Zn===null){if(e===null)throw Error(c(308));Zn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Zn=Zn.next=t;return n}var fv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},mv=l.unstable_scheduleCallback,hv=l.unstable_NormalPriority,ct={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hr(){return{controller:new fv,data:new Map,refCount:0}}function Ss(e){e.refCount--,e.refCount===0&&mv(hv,function(){e.controller.abort()})}var Ns=null,qr=0,Ol=0,Al=null;function pv(e,t){if(Ns===null){var n=Ns=[];qr=0,Ol=Gu(),Al={status:"pending",value:void 0,then:function(a){n.push(a)}}}return qr++,t.then(Id,Id),t}function Id(){if(--qr===0&&Ns!==null){Al!==null&&(Al.status="fulfilled");var e=Ns;Ns=null,Ol=0,Al=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function gv(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(a.status="rejected",a.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),a}var Pd=z.S;z.S=function(e,t){Bm=ot(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&pv(e,t),Pd!==null&&Pd(e,t)};var $a=Oe(null);function Lr(){var e=$a.current;return e!==null?e:$e.pooledCache}function Ai(e,t){t===null?X($a,$a.current):X($a,t.pool)}function ef(){var e=Lr();return e===null?null:{parent:ct._currentValue,pool:e}}var Dl=Error(c(460)),Yr=Error(c(474)),Di=Error(c(542)),_i={then:function(){}};function tf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function nf(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Kn,Kn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,lf(e),e;default:if(typeof t.status=="string")t.then(Kn,Kn);else{if(e=$e,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=a}},function(a){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,lf(e),e}throw Ia=t,Dl}}function Fa(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ia=n,Dl):n}}var Ia=null;function af(){if(Ia===null)throw Error(c(459));var e=Ia;return Ia=null,e}function lf(e){if(e===Dl||e===Di)throw Error(c(483))}var _l=null,js=0;function ki(e){var t=js;return js+=1,_l===null&&(_l=[]),nf(_l,e,t)}function Cs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ri(e,t){throw t.$$typeof===b?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function sf(e){function t(E,C){if(e){var T=E.deletions;T===null?(E.deletions=[C],E.flags|=16):T.push(C)}}function n(E,C){if(!e)return null;for(;C!==null;)t(E,C),C=C.sibling;return null}function a(E){for(var C=new Map;E!==null;)E.key!==null?C.set(E.key,E):C.set(E.index,E),E=E.sibling;return C}function i(E,C){return E=Qn(E,C),E.index=0,E.sibling=null,E}function u(E,C,T){return E.index=T,e?(T=E.alternate,T!==null?(T=T.index,T<C?(E.flags|=67108866,C):T):(E.flags|=67108866,C)):(E.flags|=1048576,C)}function f(E){return e&&E.alternate===null&&(E.flags|=67108866),E}function g(E,C,T,L){return C===null||C.tag!==6?(C=Tr(T,E.mode,L),C.return=E,C):(C=i(C,T),C.return=E,C)}function N(E,C,T,L){var ue=T.type;return ue===R?H(E,C,T.props.children,L,T.key):C!==null&&(C.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===J&&Fa(ue)===C.type)?(C=i(C,T.props),Cs(C,T),C.return=E,C):(C=Mi(T.type,T.key,T.props,null,E.mode,L),Cs(C,T),C.return=E,C)}function O(E,C,T,L){return C===null||C.tag!==4||C.stateNode.containerInfo!==T.containerInfo||C.stateNode.implementation!==T.implementation?(C=Or(T,E.mode,L),C.return=E,C):(C=i(C,T.children||[]),C.return=E,C)}function H(E,C,T,L,ue){return C===null||C.tag!==7?(C=Xa(T,E.mode,L,ue),C.return=E,C):(C=i(C,T),C.return=E,C)}function K(E,C,T){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return C=Tr(""+C,E.mode,T),C.return=E,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case _:return T=Mi(C.type,C.key,C.props,null,E.mode,T),Cs(T,C),T.return=E,T;case A:return C=Or(C,E.mode,T),C.return=E,C;case J:return C=Fa(C),K(E,C,T)}if($(C)||oe(C))return C=Xa(C,E.mode,T,null),C.return=E,C;if(typeof C.then=="function")return K(E,ki(C),T);if(C.$$typeof===G)return K(E,Oi(E,C),T);Ri(E,C)}return null}function D(E,C,T,L){var ue=C!==null?C.key:null;if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return ue!==null?null:g(E,C,""+T,L);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case _:return T.key===ue?N(E,C,T,L):null;case A:return T.key===ue?O(E,C,T,L):null;case J:return T=Fa(T),D(E,C,T,L)}if($(T)||oe(T))return ue!==null?null:H(E,C,T,L,null);if(typeof T.then=="function")return D(E,C,ki(T),L);if(T.$$typeof===G)return D(E,C,Oi(E,T),L);Ri(E,T)}return null}function U(E,C,T,L,ue){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return E=E.get(T)||null,g(C,E,""+L,ue);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case _:return E=E.get(L.key===null?T:L.key)||null,N(C,E,L,ue);case A:return E=E.get(L.key===null?T:L.key)||null,O(C,E,L,ue);case J:return L=Fa(L),U(E,C,T,L,ue)}if($(L)||oe(L))return E=E.get(T)||null,H(C,E,L,ue,null);if(typeof L.then=="function")return U(E,C,T,ki(L),ue);if(L.$$typeof===G)return U(E,C,T,Oi(C,L),ue);Ri(C,L)}return null}function te(E,C,T,L){for(var ue=null,He=null,se=C,Ee=C=0,Ue=null;se!==null&&Ee<T.length;Ee++){se.index>Ee?(Ue=se,se=null):Ue=se.sibling;var qe=D(E,se,T[Ee],L);if(qe===null){se===null&&(se=Ue);break}e&&se&&qe.alternate===null&&t(E,se),C=u(qe,C,Ee),He===null?ue=qe:He.sibling=qe,He=qe,se=Ue}if(Ee===T.length)return n(E,se),Be&&Xn(E,Ee),ue;if(se===null){for(;Ee<T.length;Ee++)se=K(E,T[Ee],L),se!==null&&(C=u(se,C,Ee),He===null?ue=se:He.sibling=se,He=se);return Be&&Xn(E,Ee),ue}for(se=a(se);Ee<T.length;Ee++)Ue=U(se,E,Ee,T[Ee],L),Ue!==null&&(e&&Ue.alternate!==null&&se.delete(Ue.key===null?Ee:Ue.key),C=u(Ue,C,Ee),He===null?ue=Ue:He.sibling=Ue,He=Ue);return e&&se.forEach(function(ka){return t(E,ka)}),Be&&Xn(E,Ee),ue}function he(E,C,T,L){if(T==null)throw Error(c(151));for(var ue=null,He=null,se=C,Ee=C=0,Ue=null,qe=T.next();se!==null&&!qe.done;Ee++,qe=T.next()){se.index>Ee?(Ue=se,se=null):Ue=se.sibling;var ka=D(E,se,qe.value,L);if(ka===null){se===null&&(se=Ue);break}e&&se&&ka.alternate===null&&t(E,se),C=u(ka,C,Ee),He===null?ue=ka:He.sibling=ka,He=ka,se=Ue}if(qe.done)return n(E,se),Be&&Xn(E,Ee),ue;if(se===null){for(;!qe.done;Ee++,qe=T.next())qe=K(E,qe.value,L),qe!==null&&(C=u(qe,C,Ee),He===null?ue=qe:He.sibling=qe,He=qe);return Be&&Xn(E,Ee),ue}for(se=a(se);!qe.done;Ee++,qe=T.next())qe=U(se,E,Ee,qe.value,L),qe!==null&&(e&&qe.alternate!==null&&se.delete(qe.key===null?Ee:qe.key),C=u(qe,C,Ee),He===null?ue=qe:He.sibling=qe,He=qe);return e&&se.forEach(function(Mx){return t(E,Mx)}),Be&&Xn(E,Ee),ue}function Je(E,C,T,L){if(typeof T=="object"&&T!==null&&T.type===R&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case _:e:{for(var ue=T.key;C!==null;){if(C.key===ue){if(ue=T.type,ue===R){if(C.tag===7){n(E,C.sibling),L=i(C,T.props.children),L.return=E,E=L;break e}}else if(C.elementType===ue||typeof ue=="object"&&ue!==null&&ue.$$typeof===J&&Fa(ue)===C.type){n(E,C.sibling),L=i(C,T.props),Cs(L,T),L.return=E,E=L;break e}n(E,C);break}else t(E,C);C=C.sibling}T.type===R?(L=Xa(T.props.children,E.mode,L,T.key),L.return=E,E=L):(L=Mi(T.type,T.key,T.props,null,E.mode,L),Cs(L,T),L.return=E,E=L)}return f(E);case A:e:{for(ue=T.key;C!==null;){if(C.key===ue)if(C.tag===4&&C.stateNode.containerInfo===T.containerInfo&&C.stateNode.implementation===T.implementation){n(E,C.sibling),L=i(C,T.children||[]),L.return=E,E=L;break e}else{n(E,C);break}else t(E,C);C=C.sibling}L=Or(T,E.mode,L),L.return=E,E=L}return f(E);case J:return T=Fa(T),Je(E,C,T,L)}if($(T))return te(E,C,T,L);if(oe(T)){if(ue=oe(T),typeof ue!="function")throw Error(c(150));return T=ue.call(T),he(E,C,T,L)}if(typeof T.then=="function")return Je(E,C,ki(T),L);if(T.$$typeof===G)return Je(E,C,Oi(E,T),L);Ri(E,T)}return typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint"?(T=""+T,C!==null&&C.tag===6?(n(E,C.sibling),L=i(C,T),L.return=E,E=L):(n(E,C),L=Tr(T,E.mode,L),L.return=E,E=L),f(E)):n(E,C)}return function(E,C,T,L){try{js=0;var ue=Je(E,C,T,L);return _l=null,ue}catch(se){if(se===Dl||se===Di)throw se;var He=Jt(29,se,null,E.mode);return He.lanes=L,He.return=E,He}finally{}}}var Pa=sf(!0),of=sf(!1),ya=!1;function Gr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kr(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 va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xa(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Ke&2)!==0){var i=a.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),a.pending=t,t=wi(e),Kd(e,null,n),t}return Ei(e,a,t,n),wi(e)}function Es(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,ss(e,n)}}function Vr(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var i=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var f={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?i=u=f:u=u.next=f,n=n.next}while(n!==null);u===null?i=u=t:u=u.next=t}else i=u=t;n={baseState:a.baseState,firstBaseUpdate:i,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Qr=!1;function ws(){if(Qr){var e=Al;if(e!==null)throw e}}function Ms(e,t,n,a){Qr=!1;var i=e.updateQueue;ya=!1;var u=i.firstBaseUpdate,f=i.lastBaseUpdate,g=i.shared.pending;if(g!==null){i.shared.pending=null;var N=g,O=N.next;N.next=null,f===null?u=O:f.next=O,f=N;var H=e.alternate;H!==null&&(H=H.updateQueue,g=H.lastBaseUpdate,g!==f&&(g===null?H.firstBaseUpdate=O:g.next=O,H.lastBaseUpdate=N))}if(u!==null){var K=i.baseState;f=0,H=O=N=null,g=u;do{var D=g.lane&-536870913,U=D!==g.lane;if(U?(Re&D)===D:(a&D)===D){D!==0&&D===Ol&&(Qr=!0),H!==null&&(H=H.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var te=e,he=g;D=t;var Je=n;switch(he.tag){case 1:if(te=he.payload,typeof te=="function"){K=te.call(Je,K,D);break e}K=te;break e;case 3:te.flags=te.flags&-65537|128;case 0:if(te=he.payload,D=typeof te=="function"?te.call(Je,K,D):te,D==null)break e;K=v({},K,D);break e;case 2:ya=!0}}D=g.callback,D!==null&&(e.flags|=64,U&&(e.flags|=8192),U=i.callbacks,U===null?i.callbacks=[D]:U.push(D))}else U={lane:D,tag:g.tag,payload:g.payload,callback:g.callback,next:null},H===null?(O=H=U,N=K):H=H.next=U,f|=D;if(g=g.next,g===null){if(g=i.shared.pending,g===null)break;U=g,g=U.next,U.next=null,i.lastBaseUpdate=U,i.shared.pending=null}}while(!0);H===null&&(N=K),i.baseState=N,i.firstBaseUpdate=O,i.lastBaseUpdate=H,u===null&&(i.shared.lanes=0),Ca|=f,e.lanes=f,e.memoizedState=K}}function rf(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function uf(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)rf(n[e],t)}var kl=Oe(null),Ui=Oe(0);function cf(e,t){e=aa,X(Ui,e),X(kl,t),aa=e|t.baseLanes}function Xr(){X(Ui,aa),X(kl,kl.current)}function Zr(){aa=Ui.current,ce(kl),ce(Ui)}var $t=Oe(null),mn=null;function ba(e){var t=e.alternate;X(rt,rt.current&1),X($t,e),mn===null&&(t===null||kl.current!==null||t.memoizedState!==null)&&(mn=e)}function Wr(e){X(rt,rt.current),X($t,e),mn===null&&(mn=e)}function df(e){e.tag===22?(X(rt,rt.current),X($t,e),mn===null&&(mn=e)):Sa()}function Sa(){X(rt,rt.current),X($t,$t.current)}function Ft(e){ce($t),mn===e&&(mn=null),ce(rt)}var rt=Oe(0);function Bi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ec(n)||tc(n)))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 Jn=0,je=null,Ze=null,dt=null,Hi=!1,Rl=!1,el=!1,qi=0,zs=0,Ul=null,yv=0;function lt(){throw Error(c(321))}function Jr(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Wt(e[n],t[n]))return!1;return!0}function $r(e,t,n,a,i,u){return Jn=u,je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,z.H=e===null||e.memoizedState===null?Wf:du,el=!1,u=n(a,i),el=!1,Rl&&(u=mf(t,n,a,i)),ff(e),u}function ff(e){z.H=As;var t=Ze!==null&&Ze.next!==null;if(Jn=0,dt=Ze=je=null,Hi=!1,zs=0,Ul=null,t)throw Error(c(300));e===null||ft||(e=e.dependencies,e!==null&&Ti(e)&&(ft=!0))}function mf(e,t,n,a){je=e;var i=0;do{if(Rl&&(Ul=null),zs=0,Rl=!1,25<=i)throw Error(c(301));if(i+=1,dt=Ze=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}z.H=Jf,u=t(n,a)}while(Rl);return u}function vv(){var e=z.H,t=e.useState()[0];return t=typeof t.then=="function"?Ts(t):t,e=e.useState()[0],(Ze!==null?Ze.memoizedState:null)!==e&&(je.flags|=1024),t}function Fr(){var e=qi!==0;return qi=0,e}function Ir(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Pr(e){if(Hi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Hi=!1}Jn=0,dt=Ze=je=null,Rl=!1,zs=qi=0,Ul=null}function Tt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?je.memoizedState=dt=e:dt=dt.next=e,dt}function ut(){if(Ze===null){var e=je.alternate;e=e!==null?e.memoizedState:null}else e=Ze.next;var t=dt===null?je.memoizedState:dt.next;if(t!==null)dt=t,Ze=e;else{if(e===null)throw je.alternate===null?Error(c(467)):Error(c(310));Ze=e,e={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},dt===null?je.memoizedState=dt=e:dt=dt.next=e}return dt}function Li(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ts(e){var t=zs;return zs+=1,Ul===null&&(Ul=[]),e=nf(Ul,e,t),t=je,(dt===null?t.memoizedState:dt.next)===null&&(t=t.alternate,z.H=t===null||t.memoizedState===null?Wf:du),e}function Yi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ts(e);if(e.$$typeof===G)return Ct(e)}throw Error(c(438,String(e)))}function eu(e){var t=null,n=je.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=je.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Li(),je.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=de;return t.index++,n}function $n(e,t){return typeof t=="function"?t(e):t}function Gi(e){var t=ut();return tu(t,Ze,e)}function tu(e,t,n){var a=e.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=n;var i=e.baseQueue,u=a.pending;if(u!==null){if(i!==null){var f=i.next;i.next=u.next,u.next=f}t.baseQueue=i=u,a.pending=null}if(u=e.baseState,i===null)e.memoizedState=u;else{t=i.next;var g=f=null,N=null,O=t,H=!1;do{var K=O.lane&-536870913;if(K!==O.lane?(Re&K)===K:(Jn&K)===K){var D=O.revertLane;if(D===0)N!==null&&(N=N.next={lane:0,revertLane:0,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null}),K===Ol&&(H=!0);else if((Jn&D)===D){O=O.next,D===Ol&&(H=!0);continue}else K={lane:0,revertLane:O.revertLane,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},N===null?(g=N=K,f=u):N=N.next=K,je.lanes|=D,Ca|=D;K=O.action,el&&n(u,K),u=O.hasEagerState?O.eagerState:n(u,K)}else D={lane:K,revertLane:O.revertLane,gesture:O.gesture,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},N===null?(g=N=D,f=u):N=N.next=D,je.lanes|=K,Ca|=K;O=O.next}while(O!==null&&O!==t);if(N===null?f=u:N.next=g,!Wt(u,e.memoizedState)&&(ft=!0,H&&(n=Al,n!==null)))throw n;e.memoizedState=u,e.baseState=f,e.baseQueue=N,a.lastRenderedState=u}return i===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function nu(e){var t=ut(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var a=n.dispatch,i=n.pending,u=t.memoizedState;if(i!==null){n.pending=null;var f=i=i.next;do u=e(u,f.action),f=f.next;while(f!==i);Wt(u,t.memoizedState)||(ft=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,a]}function hf(e,t,n){var a=je,i=ut(),u=Be;if(u){if(n===void 0)throw Error(c(407));n=n()}else n=t();var f=!Wt((Ze||i).memoizedState,n);if(f&&(i.memoizedState=n,ft=!0),i=i.queue,su(yf.bind(null,a,i,e),[e]),i.getSnapshot!==t||f||dt!==null&&dt.memoizedState.tag&1){if(a.flags|=2048,Bl(9,{destroy:void 0},gf.bind(null,a,i,n,t),null),$e===null)throw Error(c(349));u||(Jn&127)!==0||pf(a,t,n)}return n}function pf(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=je.updateQueue,t===null?(t=Li(),je.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function gf(e,t,n,a){t.value=n,t.getSnapshot=a,vf(t)&&xf(e)}function yf(e,t,n){return n(function(){vf(t)&&xf(e)})}function vf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Wt(e,n)}catch{return!0}}function xf(e){var t=Qa(e,2);t!==null&&qt(t,e,2)}function au(e){var t=Tt();if(typeof e=="function"){var n=e;if(e=n(),el){we(!0);try{n()}finally{we(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$n,lastRenderedState:e},t}function bf(e,t,n,a){return e.baseState=n,tu(e,Ze,typeof a=="function"?a:$n)}function xv(e,t,n,a,i){if(Qi(e))throw Error(c(485));if(e=t.action,e!==null){var u={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){u.listeners.push(f)}};z.T!==null?n(!0):u.isTransition=!1,a(u),n=t.pending,n===null?(u.next=t.pending=u,Sf(t,u)):(u.next=n.next,t.pending=n.next=u)}}function Sf(e,t){var n=t.action,a=t.payload,i=e.state;if(t.isTransition){var u=z.T,f={};z.T=f;try{var g=n(i,a),N=z.S;N!==null&&N(f,g),Nf(e,t,g)}catch(O){lu(e,t,O)}finally{u!==null&&f.types!==null&&(u.types=f.types),z.T=u}}else try{u=n(i,a),Nf(e,t,u)}catch(O){lu(e,t,O)}}function Nf(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){jf(e,t,a)},function(a){return lu(e,t,a)}):jf(e,t,n)}function jf(e,t,n){t.status="fulfilled",t.value=n,Cf(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Sf(e,n)))}function lu(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Cf(t),t=t.next;while(t!==a)}e.action=null}function Cf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ef(e,t){return t}function wf(e,t){if(Be){var n=$e.formState;if(n!==null){e:{var a=je;if(Be){if(Ie){t:{for(var i=Ie,u=fn;i.nodeType!==8;){if(!u){i=null;break t}if(i=hn(i.nextSibling),i===null){i=null;break t}}u=i.data,i=u==="F!"||u==="F"?i:null}if(i){Ie=hn(i.nextSibling),a=i.data==="F!";break e}}pa(a)}a=!1}a&&(t=n[0])}}return n=Tt(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ef,lastRenderedState:t},n.queue=a,n=Qf.bind(null,je,a),a.dispatch=n,a=au(!1),u=cu.bind(null,je,!1,a.queue),a=Tt(),i={state:t,dispatch:null,action:e,pending:null},a.queue=i,n=xv.bind(null,je,i,u,n),i.dispatch=n,a.memoizedState=e,[t,n,!1]}function Mf(e){var t=ut();return zf(t,Ze,e)}function zf(e,t,n){if(t=tu(e,t,Ef)[0],e=Gi($n)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Ts(t)}catch(f){throw f===Dl?Di:f}else a=t;t=ut();var i=t.queue,u=i.dispatch;return n!==t.memoizedState&&(je.flags|=2048,Bl(9,{destroy:void 0},bv.bind(null,i,n),null)),[a,u,e]}function bv(e,t){e.action=t}function Tf(e){var t=ut(),n=Ze;if(n!==null)return zf(t,n,e);ut(),t=t.memoizedState,n=ut();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Bl(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=je.updateQueue,t===null&&(t=Li(),je.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function Of(){return ut().memoizedState}function Ki(e,t,n,a){var i=Tt();je.flags|=e,i.memoizedState=Bl(1|t,{destroy:void 0},n,a===void 0?null:a)}function Vi(e,t,n,a){var i=ut();a=a===void 0?null:a;var u=i.memoizedState.inst;Ze!==null&&a!==null&&Jr(a,Ze.memoizedState.deps)?i.memoizedState=Bl(t,u,n,a):(je.flags|=e,i.memoizedState=Bl(1|t,u,n,a))}function Af(e,t){Ki(8390656,8,e,t)}function su(e,t){Vi(2048,8,e,t)}function Sv(e){je.flags|=4;var t=je.updateQueue;if(t===null)t=Li(),je.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Df(e){var t=ut().memoizedState;return Sv({ref:t,nextImpl:e}),function(){if((Ke&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function _f(e,t){return Vi(4,2,e,t)}function kf(e,t){return Vi(4,4,e,t)}function Rf(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Uf(e,t,n){n=n!=null?n.concat([e]):null,Vi(4,4,Rf.bind(null,t,e),n)}function iu(){}function Bf(e,t){var n=ut();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Jr(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function Hf(e,t){var n=ut();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Jr(t,a[1]))return a[0];if(a=e(),el){we(!0);try{e()}finally{we(!1)}}return n.memoizedState=[a,t],a}function ou(e,t,n){return n===void 0||(Jn&1073741824)!==0&&(Re&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=qm(),je.lanes|=e,Ca|=e,n)}function qf(e,t,n,a){return Wt(n,t)?n:kl.current!==null?(e=ou(e,n,a),Wt(e,t)||(ft=!0),e):(Jn&42)===0||(Jn&1073741824)!==0&&(Re&261930)===0?(ft=!0,e.memoizedState=n):(e=qm(),je.lanes|=e,Ca|=e,t)}function Lf(e,t,n,a,i){var u=Z.p;Z.p=u!==0&&8>u?u:8;var f=z.T,g={};z.T=g,cu(e,!1,t,n);try{var N=i(),O=z.S;if(O!==null&&O(g,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var H=gv(N,a);Os(e,t,H,en(e))}else Os(e,t,a,en(e))}catch(K){Os(e,t,{then:function(){},status:"rejected",reason:K},en())}finally{Z.p=u,f!==null&&g.types!==null&&(f.types=g.types),z.T=f}}function Nv(){}function ru(e,t,n,a){if(e.tag!==5)throw Error(c(476));var i=Yf(e).queue;Lf(e,i,t,ae,n===null?Nv:function(){return Gf(e),n(a)})}function Yf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$n,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$n,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Gf(e){var t=Yf(e);t.next===null&&(t=e.alternate.memoizedState),Os(e,t.next.queue,{},en())}function uu(){return Ct(Zs)}function Kf(){return ut().memoizedState}function Vf(){return ut().memoizedState}function jv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=en();e=va(n);var a=xa(t,e,n);a!==null&&(qt(a,t,n),Es(a,t,n)),t={cache:Hr()},e.payload=t;return}t=t.return}}function Cv(e,t,n){var a=en();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Qi(e)?Xf(t,n):(n=Mr(e,t,n,a),n!==null&&(qt(n,e,a),Zf(n,t,a)))}function Qf(e,t,n){var a=en();Os(e,t,n,a)}function Os(e,t,n,a){var i={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Qi(e))Xf(t,i);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var f=t.lastRenderedState,g=u(f,n);if(i.hasEagerState=!0,i.eagerState=g,Wt(g,f))return Ei(e,t,i,0),$e===null&&Ci(),!1}catch{}finally{}if(n=Mr(e,t,i,a),n!==null)return qt(n,e,a),Zf(n,t,a),!0}return!1}function cu(e,t,n,a){if(a={lane:2,revertLane:Gu(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Qi(e)){if(t)throw Error(c(479))}else t=Mr(e,n,a,2),t!==null&&qt(t,e,2)}function Qi(e){var t=e.alternate;return e===je||t!==null&&t===je}function Xf(e,t){Rl=Hi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Zf(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,ss(e,n)}}var As={readContext:Ct,use:Yi,useCallback:lt,useContext:lt,useEffect:lt,useImperativeHandle:lt,useLayoutEffect:lt,useInsertionEffect:lt,useMemo:lt,useReducer:lt,useRef:lt,useState:lt,useDebugValue:lt,useDeferredValue:lt,useTransition:lt,useSyncExternalStore:lt,useId:lt,useHostTransitionStatus:lt,useFormState:lt,useActionState:lt,useOptimistic:lt,useMemoCache:lt,useCacheRefresh:lt};As.useEffectEvent=lt;var Wf={readContext:Ct,use:Yi,useCallback:function(e,t){return Tt().memoizedState=[e,t===void 0?null:t],e},useContext:Ct,useEffect:Af,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ki(4194308,4,Rf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ki(4194308,4,e,t)},useInsertionEffect:function(e,t){Ki(4,2,e,t)},useMemo:function(e,t){var n=Tt();t=t===void 0?null:t;var a=e();if(el){we(!0);try{e()}finally{we(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Tt();if(n!==void 0){var i=n(t);if(el){we(!0);try{n(t)}finally{we(!1)}}}else i=t;return a.memoizedState=a.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},a.queue=e,e=e.dispatch=Cv.bind(null,je,e),[a.memoizedState,e]},useRef:function(e){var t=Tt();return e={current:e},t.memoizedState=e},useState:function(e){e=au(e);var t=e.queue,n=Qf.bind(null,je,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:iu,useDeferredValue:function(e,t){var n=Tt();return ou(n,e,t)},useTransition:function(){var e=au(!1);return e=Lf.bind(null,je,e.queue,!0,!1),Tt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=je,i=Tt();if(Be){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),$e===null)throw Error(c(349));(Re&127)!==0||pf(a,t,n)}i.memoizedState=n;var u={value:n,getSnapshot:t};return i.queue=u,Af(yf.bind(null,a,u,e),[e]),a.flags|=2048,Bl(9,{destroy:void 0},gf.bind(null,a,u,n,t),null),n},useId:function(){var e=Tt(),t=$e.identifierPrefix;if(Be){var n=Tn,a=zn;n=(a&~(1<<32-fe(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=qi++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=yv++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:uu,useFormState:wf,useActionState:wf,useOptimistic:function(e){var t=Tt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=cu.bind(null,je,!0,n),n.dispatch=t,[e,t]},useMemoCache:eu,useCacheRefresh:function(){return Tt().memoizedState=jv.bind(null,je)},useEffectEvent:function(e){var t=Tt(),n={impl:e};return t.memoizedState=n,function(){if((Ke&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},du={readContext:Ct,use:Yi,useCallback:Bf,useContext:Ct,useEffect:su,useImperativeHandle:Uf,useInsertionEffect:_f,useLayoutEffect:kf,useMemo:Hf,useReducer:Gi,useRef:Of,useState:function(){return Gi($n)},useDebugValue:iu,useDeferredValue:function(e,t){var n=ut();return qf(n,Ze.memoizedState,e,t)},useTransition:function(){var e=Gi($n)[0],t=ut().memoizedState;return[typeof e=="boolean"?e:Ts(e),t]},useSyncExternalStore:hf,useId:Kf,useHostTransitionStatus:uu,useFormState:Mf,useActionState:Mf,useOptimistic:function(e,t){var n=ut();return bf(n,Ze,e,t)},useMemoCache:eu,useCacheRefresh:Vf};du.useEffectEvent=Df;var Jf={readContext:Ct,use:Yi,useCallback:Bf,useContext:Ct,useEffect:su,useImperativeHandle:Uf,useInsertionEffect:_f,useLayoutEffect:kf,useMemo:Hf,useReducer:nu,useRef:Of,useState:function(){return nu($n)},useDebugValue:iu,useDeferredValue:function(e,t){var n=ut();return Ze===null?ou(n,e,t):qf(n,Ze.memoizedState,e,t)},useTransition:function(){var e=nu($n)[0],t=ut().memoizedState;return[typeof e=="boolean"?e:Ts(e),t]},useSyncExternalStore:hf,useId:Kf,useHostTransitionStatus:uu,useFormState:Tf,useActionState:Tf,useOptimistic:function(e,t){var n=ut();return Ze!==null?bf(n,Ze,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:eu,useCacheRefresh:Vf};Jf.useEffectEvent=Df;function fu(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:v({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var mu={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=en(),i=va(a);i.payload=t,n!=null&&(i.callback=n),t=xa(e,i,a),t!==null&&(qt(t,e,a),Es(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=en(),i=va(a);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=xa(e,i,a),t!==null&&(qt(t,e,a),Es(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=en(),a=va(n);a.tag=2,t!=null&&(a.callback=t),t=xa(e,a,n),t!==null&&(qt(t,e,n),Es(t,e,n))}};function $f(e,t,n,a,i,u,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,u,f):t.prototype&&t.prototype.isPureReactComponent?!ys(n,a)||!ys(i,u):!0}function Ff(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&mu.enqueueReplaceState(t,t.state,null)}function tl(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=v({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function If(e){ji(e)}function Pf(e){console.error(e)}function em(e){ji(e)}function Xi(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function tm(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function hu(e,t,n){return n=va(n),n.tag=3,n.payload={element:null},n.callback=function(){Xi(e,t)},n}function nm(e){return e=va(e),e.tag=3,e}function am(e,t,n,a){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var u=a.value;e.payload=function(){return i(u)},e.callback=function(){tm(t,n,a)}}var f=n.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){tm(t,n,a),typeof i!="function"&&(Ea===null?Ea=new Set([this]):Ea.add(this));var g=a.stack;this.componentDidCatch(a.value,{componentStack:g!==null?g:""})})}function Ev(e,t,n,a,i){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&Tl(t,n,i,!0),n=$t.current,n!==null){switch(n.tag){case 31:case 13:return mn===null?lo():n.alternate===null&&st===0&&(st=3),n.flags&=-257,n.flags|=65536,n.lanes=i,a===_i?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),qu(e,a,i)),!1;case 22:return n.flags|=65536,a===_i?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),qu(e,a,i)),!1}throw Error(c(435,n.tag))}return qu(e,a,i),lo(),!1}if(Be)return t=$t.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,a!==_r&&(e=Error(c(422),{cause:a}),bs(un(e,n)))):(a!==_r&&(t=Error(c(423),{cause:a}),bs(un(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,a=un(a,n),i=hu(e.stateNode,a,i),Vr(e,i),st!==4&&(st=2)),!1;var u=Error(c(520),{cause:a});if(u=un(u,n),qs===null?qs=[u]:qs.push(u),st!==4&&(st=2),t===null)return!0;a=un(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=hu(n.stateNode,a,e),Vr(n,e),!1;case 1:if(t=n.type,u=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Ea===null||!Ea.has(u))))return n.flags|=65536,i&=-i,n.lanes|=i,i=nm(i),am(i,e,n,a),Vr(n,i),!1}n=n.return}while(n!==null);return!1}var pu=Error(c(461)),ft=!1;function Et(e,t,n,a){t.child=e===null?of(t,null,n,a):Pa(t,e.child,n,a)}function lm(e,t,n,a,i){n=n.render;var u=t.ref;if("ref"in a){var f={};for(var g in a)g!=="ref"&&(f[g]=a[g])}else f=a;return Ja(t),a=$r(e,t,n,f,u,i),g=Fr(),e!==null&&!ft?(Ir(e,t,i),Fn(e,t,i)):(Be&&g&&Ar(t),t.flags|=1,Et(e,t,a,i),t.child)}function sm(e,t,n,a,i){if(e===null){var u=n.type;return typeof u=="function"&&!zr(u)&&u.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=u,im(e,t,u,a,i)):(e=Mi(n.type,null,a,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!ju(e,i)){var f=u.memoizedProps;if(n=n.compare,n=n!==null?n:ys,n(f,a)&&e.ref===t.ref)return Fn(e,t,i)}return t.flags|=1,e=Qn(u,a),e.ref=t.ref,e.return=t,t.child=e}function im(e,t,n,a,i){if(e!==null){var u=e.memoizedProps;if(ys(u,a)&&e.ref===t.ref)if(ft=!1,t.pendingProps=a=u,ju(e,i))(e.flags&131072)!==0&&(ft=!0);else return t.lanes=e.lanes,Fn(e,t,i)}return gu(e,t,n,a,i)}function om(e,t,n,a){var i=a.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|n:n,e!==null){for(a=t.child=e.child,i=0;a!==null;)i=i|a.lanes|a.childLanes,a=a.sibling;a=i&~u}else a=0,t.child=null;return rm(e,t,u,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ai(t,u!==null?u.cachePool:null),u!==null?cf(t,u):Xr(),df(t);else return a=t.lanes=536870912,rm(e,t,u!==null?u.baseLanes|n:n,n,a)}else u!==null?(Ai(t,u.cachePool),cf(t,u),Sa(),t.memoizedState=null):(e!==null&&Ai(t,null),Xr(),Sa());return Et(e,t,i,n),t.child}function Ds(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function rm(e,t,n,a,i){var u=Lr();return u=u===null?null:{parent:ct._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&Ai(t,null),Xr(),df(t),e!==null&&Tl(e,t,a,!0),t.childLanes=i,null}function Zi(e,t){return t=Ji({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function um(e,t,n){return Pa(t,e.child,null,n),e=Zi(t,t.pendingProps),e.flags|=2,Ft(t),t.memoizedState=null,e}function wv(e,t,n){var a=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Be){if(a.mode==="hidden")return e=Zi(t,a),t.lanes=536870912,Ds(null,e);if(Wr(t),(e=Ie)?(e=Sh(e,fn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ma!==null?{id:zn,overflow:Tn}:null,retryLane:536870912,hydrationErrors:null},n=Qd(e),n.return=t,t.child=n,jt=t,Ie=null)):e=null,e===null)throw pa(t);return t.lanes=536870912,null}return Zi(t,a)}var u=e.memoizedState;if(u!==null){var f=u.dehydrated;if(Wr(t),i)if(t.flags&256)t.flags&=-257,t=um(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(ft||Tl(e,t,n,!1),i=(n&e.childLanes)!==0,ft||i){if(a=$e,a!==null&&(f=ln(a,n),f!==0&&f!==u.retryLane))throw u.retryLane=f,Qa(e,f),qt(a,e,f),pu;lo(),t=um(e,t,n)}else e=u.treeContext,Ie=hn(f.nextSibling),jt=t,Be=!0,ha=null,fn=!1,e!==null&&Wd(t,e),t=Zi(t,a),t.flags|=4096;return t}return e=Qn(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Wi(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function gu(e,t,n,a,i){return Ja(t),n=$r(e,t,n,a,void 0,i),a=Fr(),e!==null&&!ft?(Ir(e,t,i),Fn(e,t,i)):(Be&&a&&Ar(t),t.flags|=1,Et(e,t,n,i),t.child)}function cm(e,t,n,a,i,u){return Ja(t),t.updateQueue=null,n=mf(t,a,n,i),ff(e),a=Fr(),e!==null&&!ft?(Ir(e,t,u),Fn(e,t,u)):(Be&&a&&Ar(t),t.flags|=1,Et(e,t,n,u),t.child)}function dm(e,t,n,a,i){if(Ja(t),t.stateNode===null){var u=El,f=n.contextType;typeof f=="object"&&f!==null&&(u=Ct(f)),u=new n(a,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=mu,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=a,u.state=t.memoizedState,u.refs={},Gr(t),f=n.contextType,u.context=typeof f=="object"&&f!==null?Ct(f):El,u.state=t.memoizedState,f=n.getDerivedStateFromProps,typeof f=="function"&&(fu(t,n,f,a),u.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(f=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),f!==u.state&&mu.enqueueReplaceState(u,u.state,null),Ms(t,a,u,i),ws(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){u=t.stateNode;var g=t.memoizedProps,N=tl(n,g);u.props=N;var O=u.context,H=n.contextType;f=El,typeof H=="object"&&H!==null&&(f=Ct(H));var K=n.getDerivedStateFromProps;H=typeof K=="function"||typeof u.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,H||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(g||O!==f)&&Ff(t,u,a,f),ya=!1;var D=t.memoizedState;u.state=D,Ms(t,a,u,i),ws(),O=t.memoizedState,g||D!==O||ya?(typeof K=="function"&&(fu(t,n,K,a),O=t.memoizedState),(N=ya||$f(t,n,N,a,D,O,f))?(H||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=O),u.props=a,u.state=O,u.context=f,a=N):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{u=t.stateNode,Kr(e,t),f=t.memoizedProps,H=tl(n,f),u.props=H,K=t.pendingProps,D=u.context,O=n.contextType,N=El,typeof O=="object"&&O!==null&&(N=Ct(O)),g=n.getDerivedStateFromProps,(O=typeof g=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(f!==K||D!==N)&&Ff(t,u,a,N),ya=!1,D=t.memoizedState,u.state=D,Ms(t,a,u,i),ws();var U=t.memoizedState;f!==K||D!==U||ya||e!==null&&e.dependencies!==null&&Ti(e.dependencies)?(typeof g=="function"&&(fu(t,n,g,a),U=t.memoizedState),(H=ya||$f(t,n,H,a,D,U,N)||e!==null&&e.dependencies!==null&&Ti(e.dependencies))?(O||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(a,U,N),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(a,U,N)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=U),u.props=a,u.state=U,u.context=N,a=H):(typeof u.componentDidUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),a=!1)}return u=a,Wi(e,t),a=(t.flags&128)!==0,u||a?(u=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&a?(t.child=Pa(t,e.child,null,i),t.child=Pa(t,null,n,i)):Et(e,t,n,i),t.memoizedState=u.state,e=t.child):e=Fn(e,t,i),e}function fm(e,t,n,a){return Za(),t.flags|=256,Et(e,t,n,a),t.child}var yu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vu(e){return{baseLanes:e,cachePool:ef()}}function xu(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Pt),e}function mm(e,t,n){var a=t.pendingProps,i=!1,u=(t.flags&128)!==0,f;if((f=u)||(f=e!==null&&e.memoizedState===null?!1:(rt.current&2)!==0),f&&(i=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(Be){if(i?ba(t):Sa(),(e=Ie)?(e=Sh(e,fn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ma!==null?{id:zn,overflow:Tn}:null,retryLane:536870912,hydrationErrors:null},n=Qd(e),n.return=t,t.child=n,jt=t,Ie=null)):e=null,e===null)throw pa(t);return tc(e)?t.lanes=32:t.lanes=536870912,null}var g=a.children;return a=a.fallback,i?(Sa(),i=t.mode,g=Ji({mode:"hidden",children:g},i),a=Xa(a,i,n,null),g.return=t,a.return=t,g.sibling=a,t.child=g,a=t.child,a.memoizedState=vu(n),a.childLanes=xu(e,f,n),t.memoizedState=yu,Ds(null,a)):(ba(t),bu(t,g))}var N=e.memoizedState;if(N!==null&&(g=N.dehydrated,g!==null)){if(u)t.flags&256?(ba(t),t.flags&=-257,t=Su(e,t,n)):t.memoizedState!==null?(Sa(),t.child=e.child,t.flags|=128,t=null):(Sa(),g=a.fallback,i=t.mode,a=Ji({mode:"visible",children:a.children},i),g=Xa(g,i,n,null),g.flags|=2,a.return=t,g.return=t,a.sibling=g,t.child=a,Pa(t,e.child,null,n),a=t.child,a.memoizedState=vu(n),a.childLanes=xu(e,f,n),t.memoizedState=yu,t=Ds(null,a));else if(ba(t),tc(g)){if(f=g.nextSibling&&g.nextSibling.dataset,f)var O=f.dgst;f=O,a=Error(c(419)),a.stack="",a.digest=f,bs({value:a,source:null,stack:null}),t=Su(e,t,n)}else if(ft||Tl(e,t,n,!1),f=(n&e.childLanes)!==0,ft||f){if(f=$e,f!==null&&(a=ln(f,n),a!==0&&a!==N.retryLane))throw N.retryLane=a,Qa(e,a),qt(f,e,a),pu;ec(g)||lo(),t=Su(e,t,n)}else ec(g)?(t.flags|=192,t.child=e.child,t=null):(e=N.treeContext,Ie=hn(g.nextSibling),jt=t,Be=!0,ha=null,fn=!1,e!==null&&Wd(t,e),t=bu(t,a.children),t.flags|=4096);return t}return i?(Sa(),g=a.fallback,i=t.mode,N=e.child,O=N.sibling,a=Qn(N,{mode:"hidden",children:a.children}),a.subtreeFlags=N.subtreeFlags&65011712,O!==null?g=Qn(O,g):(g=Xa(g,i,n,null),g.flags|=2),g.return=t,a.return=t,a.sibling=g,t.child=a,Ds(null,a),a=t.child,g=e.child.memoizedState,g===null?g=vu(n):(i=g.cachePool,i!==null?(N=ct._currentValue,i=i.parent!==N?{parent:N,pool:N}:i):i=ef(),g={baseLanes:g.baseLanes|n,cachePool:i}),a.memoizedState=g,a.childLanes=xu(e,f,n),t.memoizedState=yu,Ds(e.child,a)):(ba(t),n=e.child,e=n.sibling,n=Qn(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=n,t.memoizedState=null,n)}function bu(e,t){return t=Ji({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ji(e,t){return e=Jt(22,e,null,t),e.lanes=0,e}function Su(e,t,n){return Pa(t,e.child,null,n),e=bu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function hm(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Ur(e.return,t,n)}function Nu(e,t,n,a,i,u){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:i,treeForkCount:u}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=a,f.tail=n,f.tailMode=i,f.treeForkCount=u)}function pm(e,t,n){var a=t.pendingProps,i=a.revealOrder,u=a.tail;a=a.children;var f=rt.current,g=(f&2)!==0;if(g?(f=f&1|2,t.flags|=128):f&=1,X(rt,f),Et(e,t,a,n),a=Be?xs:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&hm(e,n,t);else if(e.tag===19)hm(e,n,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(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Bi(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Nu(t,!1,i,n,u,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Bi(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Nu(t,!0,n,null,u,a);break;case"together":Nu(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Fn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ca|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Tl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,n=Qn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Qn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ju(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ti(e)))}function Mv(e,t,n){switch(t.tag){case 3:ge(t,t.stateNode.containerInfo),ga(t,ct,e.memoizedState.cache),Za();break;case 27:case 5:Ge(t);break;case 4:ge(t,t.stateNode.containerInfo);break;case 10:ga(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Wr(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(ba(t),t.flags|=128,null):(n&t.child.childLanes)!==0?mm(e,t,n):(ba(t),e=Fn(e,t,n),e!==null?e.sibling:null);ba(t);break;case 19:var i=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(Tl(e,t,n,!1),a=(n&t.childLanes)!==0),i){if(a)return pm(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),X(rt,rt.current),a)break;return null;case 22:return t.lanes=0,om(e,t,n,t.pendingProps);case 24:ga(t,ct,e.memoizedState.cache)}return Fn(e,t,n)}function gm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ft=!0;else{if(!ju(e,n)&&(t.flags&128)===0)return ft=!1,Mv(e,t,n);ft=(e.flags&131072)!==0}else ft=!1,Be&&(t.flags&1048576)!==0&&Zd(t,xs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Fa(t.elementType),t.type=e,typeof e=="function")zr(e)?(a=tl(e,a),t.tag=1,t=dm(null,t,e,a,n)):(t.tag=0,t=gu(null,t,e,a,n));else{if(e!=null){var i=e.$$typeof;if(i===Q){t.tag=11,t=lm(null,t,e,a,n);break e}else if(i===q){t.tag=14,t=sm(null,t,e,a,n);break e}}throw t=Se(e)||e,Error(c(306,t,""))}}return t;case 0:return gu(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,i=tl(a,t.pendingProps),dm(e,t,a,i,n);case 3:e:{if(ge(t,t.stateNode.containerInfo),e===null)throw Error(c(387));a=t.pendingProps;var u=t.memoizedState;i=u.element,Kr(e,t),Ms(t,a,null,n);var f=t.memoizedState;if(a=f.cache,ga(t,ct,a),a!==u.cache&&Br(t,[ct],n,!0),ws(),a=f.element,u.isDehydrated)if(u={element:a,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=fm(e,t,a,n);break e}else if(a!==i){i=un(Error(c(424)),t),bs(i),t=fm(e,t,a,n);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(Ie=hn(e.firstChild),jt=t,Be=!0,ha=null,fn=!0,n=of(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Za(),a===i){t=Fn(e,t,n);break e}Et(e,t,a,n)}t=t.child}return t;case 26:return Wi(e,t),e===null?(n=Mh(t.type,null,t.pendingProps,null))?t.memoizedState=n:Be||(n=t.type,e=t.pendingProps,a=fo(I.current).createElement(n),a[Nt]=t,a[_t]=e,wt(a,n,e),xt(a),t.stateNode=a):t.memoizedState=Mh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ge(t),e===null&&Be&&(a=t.stateNode=Ch(t.type,t.pendingProps,I.current),jt=t,fn=!0,i=Ie,Ta(t.type)?(nc=i,Ie=hn(a.firstChild)):Ie=i),Et(e,t,t.pendingProps.children,n),Wi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Be&&((i=a=Ie)&&(a=ax(a,t.type,t.pendingProps,fn),a!==null?(t.stateNode=a,jt=t,Ie=hn(a.firstChild),fn=!1,i=!0):i=!1),i||pa(t)),Ge(t),i=t.type,u=t.pendingProps,f=e!==null?e.memoizedProps:null,a=u.children,Fu(i,u)?a=null:f!==null&&Fu(i,f)&&(t.flags|=32),t.memoizedState!==null&&(i=$r(e,t,vv,null,null,n),Zs._currentValue=i),Wi(e,t),Et(e,t,a,n),t.child;case 6:return e===null&&Be&&((e=n=Ie)&&(n=lx(n,t.pendingProps,fn),n!==null?(t.stateNode=n,jt=t,Ie=null,e=!0):e=!1),e||pa(t)),null;case 13:return mm(e,t,n);case 4:return ge(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Pa(t,null,a,n):Et(e,t,a,n),t.child;case 11:return lm(e,t,t.type,t.pendingProps,n);case 7:return Et(e,t,t.pendingProps,n),t.child;case 8:return Et(e,t,t.pendingProps.children,n),t.child;case 12:return Et(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,ga(t,t.type,a.value),Et(e,t,a.children,n),t.child;case 9:return i=t.type._context,a=t.pendingProps.children,Ja(t),i=Ct(i),a=a(i),t.flags|=1,Et(e,t,a,n),t.child;case 14:return sm(e,t,t.type,t.pendingProps,n);case 15:return im(e,t,t.type,t.pendingProps,n);case 19:return pm(e,t,n);case 31:return wv(e,t,n);case 22:return om(e,t,n,t.pendingProps);case 24:return Ja(t),a=Ct(ct),e===null?(i=Lr(),i===null&&(i=$e,u=Hr(),i.pooledCache=u,u.refCount++,u!==null&&(i.pooledCacheLanes|=n),i=u),t.memoizedState={parent:a,cache:i},Gr(t),ga(t,ct,i)):((e.lanes&n)!==0&&(Kr(e,t),Ms(t,null,null,n),ws()),i=e.memoizedState,u=t.memoizedState,i.parent!==a?(i={parent:a,cache:a},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),ga(t,ct,a)):(a=u.cache,ga(t,ct,a),a!==i.cache&&Br(t,[ct],n,!0))),Et(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function In(e){e.flags|=4}function Cu(e,t,n,a,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Km())e.flags|=8192;else throw Ia=_i,Yr}else e.flags&=-16777217}function ym(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Dh(t))if(Km())e.flags|=8192;else throw Ia=_i,Yr}function $i(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?vt():536870912,e.lanes|=t,Yl|=t)}function _s(e,t){if(!Be)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Pe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,a|=i.subtreeFlags&65011712,a|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,a|=i.subtreeFlags,a|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function zv(e,t,n){var a=t.pendingProps;switch(Dr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pe(t),null;case 1:return Pe(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Wn(ct),Ae(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(zl(t)?In(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,kr())),Pe(t),null;case 26:var i=t.type,u=t.memoizedState;return e===null?(In(t),u!==null?(Pe(t),ym(t,u)):(Pe(t),Cu(t,i,null,a,n))):u?u!==e.memoizedState?(In(t),Pe(t),ym(t,u)):(Pe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&In(t),Pe(t),Cu(t,i,e,a,n)),null;case 27:if(ht(t),n=I.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&In(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Pe(t),null}e=F.current,zl(t)?Jd(t):(e=Ch(i,a,n),t.stateNode=e,In(t))}return Pe(t),null;case 5:if(ht(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&In(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Pe(t),null}if(u=F.current,zl(t))Jd(t);else{var f=fo(I.current);switch(u){case 1:u=f.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:u=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":u=f.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":u=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":u=f.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?f.createElement("select",{is:a.is}):f.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?f.createElement(i,{is:a.is}):f.createElement(i)}}u[Nt]=t,u[_t]=a;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)u.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=u;e:switch(wt(u,i,a),i){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&In(t)}}return Pe(t),Cu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&In(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(c(166));if(e=I.current,zl(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,i=jt,i!==null)switch(i.tag){case 27:case 5:a=i.memoizedProps}e[Nt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||mh(e.nodeValue,n)),e||pa(t,!0)}else e=fo(e).createTextNode(a),e[Nt]=t,t.stateNode=e}return Pe(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=zl(t),n!==null){if(e===null){if(!a)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Nt]=t}else Za(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Pe(t),e=!1}else n=kr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ft(t),t):(Ft(t),null);if((t.flags&128)!==0)throw Error(c(558))}return Pe(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=zl(t),a!==null&&a.dehydrated!==null){if(e===null){if(!i)throw Error(c(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(c(317));i[Nt]=t}else Za(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Pe(t),i=!1}else i=kr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Ft(t),t):(Ft(t),null)}return Ft(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,i=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(i=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==i&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),$i(t,t.updateQueue),Pe(t),null);case 4:return Ae(),e===null&&Xu(t.stateNode.containerInfo),Pe(t),null;case 10:return Wn(t.type),Pe(t),null;case 19:if(ce(rt),a=t.memoizedState,a===null)return Pe(t),null;if(i=(t.flags&128)!==0,u=a.rendering,u===null)if(i)_s(a,!1);else{if(st!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=Bi(e),u!==null){for(t.flags|=128,_s(a,!1),e=u.updateQueue,t.updateQueue=e,$i(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Vd(n,e),n=n.sibling;return X(rt,rt.current&1|2),Be&&Xn(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&ot()>to&&(t.flags|=128,i=!0,_s(a,!1),t.lanes=4194304)}else{if(!i)if(e=Bi(u),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,$i(t,e),_s(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!Be)return Pe(t),null}else 2*ot()-a.renderingStartTime>to&&n!==536870912&&(t.flags|=128,i=!0,_s(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(e=a.last,e!==null?e.sibling=u:t.child=u,a.last=u)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ot(),e.sibling=null,n=rt.current,X(rt,i?n&1|2:n&1),Be&&Xn(t,a.treeForkCount),e):(Pe(t),null);case 22:case 23:return Ft(t),Zr(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Pe(t),t.subtreeFlags&6&&(t.flags|=8192)):Pe(t),n=t.updateQueue,n!==null&&$i(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&ce($a),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Wn(ct),Pe(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function Tv(e,t){switch(Dr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wn(ct),Ae(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ht(t),null;case 31:if(t.memoizedState!==null){if(Ft(t),t.alternate===null)throw Error(c(340));Za()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ft(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Za()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ce(rt),null;case 4:return Ae(),null;case 10:return Wn(t.type),null;case 22:case 23:return Ft(t),Zr(),e!==null&&ce($a),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Wn(ct),null;case 25:return null;default:return null}}function vm(e,t){switch(Dr(t),t.tag){case 3:Wn(ct),Ae();break;case 26:case 27:case 5:ht(t);break;case 4:Ae();break;case 31:t.memoizedState!==null&&Ft(t);break;case 13:Ft(t);break;case 19:ce(rt);break;case 10:Wn(t.type);break;case 22:case 23:Ft(t),Zr(),e!==null&&ce($a);break;case 24:Wn(ct)}}function ks(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var i=a.next;n=i;do{if((n.tag&e)===e){a=void 0;var u=n.create,f=n.inst;a=u(),f.destroy=a}n=n.next}while(n!==i)}}catch(g){Xe(t,t.return,g)}}function Na(e,t,n){try{var a=t.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var u=i.next;a=u;do{if((a.tag&e)===e){var f=a.inst,g=f.destroy;if(g!==void 0){f.destroy=void 0,i=t;var N=n,O=g;try{O()}catch(H){Xe(i,N,H)}}}a=a.next}while(a!==u)}}catch(H){Xe(t,t.return,H)}}function xm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{uf(t,n)}catch(a){Xe(e,e.return,a)}}}function bm(e,t,n){n.props=tl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Xe(e,t,a)}}function Rs(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(i){Xe(e,t,i)}}function On(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(i){Xe(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Xe(e,t,i)}else n.current=null}function Sm(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(i){Xe(e,e.return,i)}}function Eu(e,t,n){try{var a=e.stateNode;Fv(a,e.type,n,t),a[_t]=t}catch(i){Xe(e,e.return,i)}}function Nm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ta(e.type)||e.tag===4}function wu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Nm(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&&Ta(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 Mu(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Kn));else if(a!==4&&(a===27&&Ta(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Mu(e,t,n),e=e.sibling;e!==null;)Mu(e,t,n),e=e.sibling}function Fi(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&Ta(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Fi(e,t,n),e=e.sibling;e!==null;)Fi(e,t,n),e=e.sibling}function jm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);wt(t,a,n),t[Nt]=e,t[_t]=n}catch(u){Xe(e,e.return,u)}}var Pn=!1,mt=!1,zu=!1,Cm=typeof WeakSet=="function"?WeakSet:Set,bt=null;function Ov(e,t){if(e=e.containerInfo,Ju=xo,e=Rd(e),Sr(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var i=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var f=0,g=-1,N=-1,O=0,H=0,K=e,D=null;t:for(;;){for(var U;K!==n||i!==0&&K.nodeType!==3||(g=f+i),K!==u||a!==0&&K.nodeType!==3||(N=f+a),K.nodeType===3&&(f+=K.nodeValue.length),(U=K.firstChild)!==null;)D=K,K=U;for(;;){if(K===e)break t;if(D===n&&++O===i&&(g=f),D===u&&++H===a&&(N=f),(U=K.nextSibling)!==null)break;K=D,D=K.parentNode}K=U}n=g===-1||N===-1?null:{start:g,end:N}}else n=null}n=n||{start:0,end:0}}else n=null;for($u={focusedElem:e,selectionRange:n},xo=!1,bt=t;bt!==null;)if(t=bt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,bt=e;else for(;bt!==null;){switch(t=bt,u=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(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,n=t,i=u.memoizedProps,u=u.memoizedState,a=n.stateNode;try{var te=tl(n.type,i);e=a.getSnapshotBeforeUpdate(te,u),a.__reactInternalSnapshotBeforeUpdate=e}catch(he){Xe(n,n.return,he)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Pu(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Pu(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(c(163))}if(e=t.sibling,e!==null){e.return=t.return,bt=e;break}bt=t.return}}function Em(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:ta(e,n),a&4&&ks(5,n);break;case 1:if(ta(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(f){Xe(n,n.return,f)}else{var i=tl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){Xe(n,n.return,f)}}a&64&&xm(n),a&512&&Rs(n,n.return);break;case 3:if(ta(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{uf(e,t)}catch(f){Xe(n,n.return,f)}}break;case 27:t===null&&a&4&&jm(n);case 26:case 5:ta(e,n),t===null&&a&4&&Sm(n),a&512&&Rs(n,n.return);break;case 12:ta(e,n);break;case 31:ta(e,n),a&4&&zm(e,n);break;case 13:ta(e,n),a&4&&Tm(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=qv.bind(null,n),sx(e,n))));break;case 22:if(a=n.memoizedState!==null||Pn,!a){t=t!==null&&t.memoizedState!==null||mt,i=Pn;var u=mt;Pn=a,(mt=t)&&!u?na(e,n,(n.subtreeFlags&8772)!==0):ta(e,n),Pn=i,mt=u}break;case 30:break;default:ta(e,n)}}function wm(e){var t=e.alternate;t!==null&&(e.alternate=null,wm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&lr(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 nt=null,Rt=!1;function ea(e,t,n){for(n=n.child;n!==null;)Mm(e,t,n),n=n.sibling}function Mm(e,t,n){if(W&&typeof W.onCommitFiberUnmount=="function")try{W.onCommitFiberUnmount(qn,n)}catch{}switch(n.tag){case 26:mt||On(n,t),ea(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:mt||On(n,t);var a=nt,i=Rt;Ta(n.type)&&(nt=n.stateNode,Rt=!1),ea(e,t,n),Vs(n.stateNode),nt=a,Rt=i;break;case 5:mt||On(n,t);case 6:if(a=nt,i=Rt,nt=null,ea(e,t,n),nt=a,Rt=i,nt!==null)if(Rt)try{(nt.nodeType===9?nt.body:nt.nodeName==="HTML"?nt.ownerDocument.body:nt).removeChild(n.stateNode)}catch(u){Xe(n,t,u)}else try{nt.removeChild(n.stateNode)}catch(u){Xe(n,t,u)}break;case 18:nt!==null&&(Rt?(e=nt,xh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Jl(e)):xh(nt,n.stateNode));break;case 4:a=nt,i=Rt,nt=n.stateNode.containerInfo,Rt=!0,ea(e,t,n),nt=a,Rt=i;break;case 0:case 11:case 14:case 15:Na(2,n,t),mt||Na(4,n,t),ea(e,t,n);break;case 1:mt||(On(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&bm(n,t,a)),ea(e,t,n);break;case 21:ea(e,t,n);break;case 22:mt=(a=mt)||n.memoizedState!==null,ea(e,t,n),mt=a;break;default:ea(e,t,n)}}function zm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Jl(e)}catch(n){Xe(t,t.return,n)}}}function Tm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Jl(e)}catch(n){Xe(t,t.return,n)}}function Av(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Cm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Cm),t;default:throw Error(c(435,e.tag))}}function Ii(e,t){var n=Av(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var i=Lv.bind(null,e,a);a.then(i,i)}})}function Ut(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var i=n[a],u=e,f=t,g=f;e:for(;g!==null;){switch(g.tag){case 27:if(Ta(g.type)){nt=g.stateNode,Rt=!1;break e}break;case 5:nt=g.stateNode,Rt=!1;break e;case 3:case 4:nt=g.stateNode.containerInfo,Rt=!0;break e}g=g.return}if(nt===null)throw Error(c(160));Mm(u,f,i),nt=null,Rt=!1,u=i.alternate,u!==null&&(u.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Om(t,e),t=t.sibling}var xn=null;function Om(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ut(t,e),Bt(e),a&4&&(Na(3,e,e.return),ks(3,e),Na(5,e,e.return));break;case 1:Ut(t,e),Bt(e),a&512&&(mt||n===null||On(n,n.return)),a&64&&Pn&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var i=xn;if(Ut(t,e),Bt(e),a&512&&(mt||n===null||On(n,n.return)),a&4){var u=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(a){case"title":u=i.getElementsByTagName("title")[0],(!u||u[rs]||u[Nt]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=i.createElement(a),i.head.insertBefore(u,i.querySelector("head > title"))),wt(u,a,n),u[Nt]=e,xt(u),a=u;break e;case"link":var f=Oh("link","href",i).get(a+(n.href||""));if(f){for(var g=0;g<f.length;g++)if(u=f[g],u.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&u.getAttribute("rel")===(n.rel==null?null:n.rel)&&u.getAttribute("title")===(n.title==null?null:n.title)&&u.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){f.splice(g,1);break t}}u=i.createElement(a),wt(u,a,n),i.head.appendChild(u);break;case"meta":if(f=Oh("meta","content",i).get(a+(n.content||""))){for(g=0;g<f.length;g++)if(u=f[g],u.getAttribute("content")===(n.content==null?null:""+n.content)&&u.getAttribute("name")===(n.name==null?null:n.name)&&u.getAttribute("property")===(n.property==null?null:n.property)&&u.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&u.getAttribute("charset")===(n.charSet==null?null:n.charSet)){f.splice(g,1);break t}}u=i.createElement(a),wt(u,a,n),i.head.appendChild(u);break;default:throw Error(c(468,a))}u[Nt]=e,xt(u),a=u}e.stateNode=a}else Ah(i,e.type,e.stateNode);else e.stateNode=Th(i,a,e.memoizedProps);else u!==a?(u===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):u.count--,a===null?Ah(i,e.type,e.stateNode):Th(i,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Eu(e,e.memoizedProps,n.memoizedProps)}break;case 27:Ut(t,e),Bt(e),a&512&&(mt||n===null||On(n,n.return)),n!==null&&a&4&&Eu(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Ut(t,e),Bt(e),a&512&&(mt||n===null||On(n,n.return)),e.flags&32){i=e.stateNode;try{vl(i,"")}catch(te){Xe(e,e.return,te)}}a&4&&e.stateNode!=null&&(i=e.memoizedProps,Eu(e,i,n!==null?n.memoizedProps:i)),a&1024&&(zu=!0);break;case 6:if(Ut(t,e),Bt(e),a&4){if(e.stateNode===null)throw Error(c(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(te){Xe(e,e.return,te)}}break;case 3:if(po=null,i=xn,xn=mo(t.containerInfo),Ut(t,e),xn=i,Bt(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{Jl(t.containerInfo)}catch(te){Xe(e,e.return,te)}zu&&(zu=!1,Am(e));break;case 4:a=xn,xn=mo(e.stateNode.containerInfo),Ut(t,e),Bt(e),xn=a;break;case 12:Ut(t,e),Bt(e);break;case 31:Ut(t,e),Bt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Ii(e,a)));break;case 13:Ut(t,e),Bt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(eo=ot()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Ii(e,a)));break;case 22:i=e.memoizedState!==null;var N=n!==null&&n.memoizedState!==null,O=Pn,H=mt;if(Pn=O||i,mt=H||N,Ut(t,e),mt=H,Pn=O,Bt(e),a&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||N||Pn||mt||nl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){N=n=t;try{if(u=N.stateNode,i)f=u.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{g=N.stateNode;var K=N.memoizedProps.style,D=K!=null&&K.hasOwnProperty("display")?K.display:null;g.style.display=D==null||typeof D=="boolean"?"":(""+D).trim()}}catch(te){Xe(N,N.return,te)}}}else if(t.tag===6){if(n===null){N=t;try{N.stateNode.nodeValue=i?"":N.memoizedProps}catch(te){Xe(N,N.return,te)}}}else if(t.tag===18){if(n===null){N=t;try{var U=N.stateNode;i?bh(U,!0):bh(N.stateNode,!1)}catch(te){Xe(N,N.return,te)}}}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;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,Ii(e,n))));break;case 19:Ut(t,e),Bt(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Ii(e,a)));break;case 30:break;case 21:break;default:Ut(t,e),Bt(e)}}function Bt(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(Nm(a)){n=a;break}a=a.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var i=n.stateNode,u=wu(e);Fi(e,u,i);break;case 5:var f=n.stateNode;n.flags&32&&(vl(f,""),n.flags&=-33);var g=wu(e);Fi(e,g,f);break;case 3:case 4:var N=n.stateNode.containerInfo,O=wu(e);Mu(e,O,N);break;default:throw Error(c(161))}}catch(H){Xe(e,e.return,H)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Am(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Am(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ta(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Em(e,t.alternate,t),t=t.sibling}function nl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Na(4,t,t.return),nl(t);break;case 1:On(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&bm(t,t.return,n),nl(t);break;case 27:Vs(t.stateNode);case 26:case 5:On(t,t.return),nl(t);break;case 22:t.memoizedState===null&&nl(t);break;case 30:nl(t);break;default:nl(t)}e=e.sibling}}function na(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,i=e,u=t,f=u.flags;switch(u.tag){case 0:case 11:case 15:na(i,u,n),ks(4,u);break;case 1:if(na(i,u,n),a=u,i=a.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(O){Xe(a,a.return,O)}if(a=u,i=a.updateQueue,i!==null){var g=a.stateNode;try{var N=i.shared.hiddenCallbacks;if(N!==null)for(i.shared.hiddenCallbacks=null,i=0;i<N.length;i++)rf(N[i],g)}catch(O){Xe(a,a.return,O)}}n&&f&64&&xm(u),Rs(u,u.return);break;case 27:jm(u);case 26:case 5:na(i,u,n),n&&a===null&&f&4&&Sm(u),Rs(u,u.return);break;case 12:na(i,u,n);break;case 31:na(i,u,n),n&&f&4&&zm(i,u);break;case 13:na(i,u,n),n&&f&4&&Tm(i,u);break;case 22:u.memoizedState===null&&na(i,u,n),Rs(u,u.return);break;case 30:break;default:na(i,u,n)}t=t.sibling}}function Tu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ss(n))}function Ou(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ss(e))}function bn(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Dm(e,t,n,a),t=t.sibling}function Dm(e,t,n,a){var i=t.flags;switch(t.tag){case 0:case 11:case 15:bn(e,t,n,a),i&2048&&ks(9,t);break;case 1:bn(e,t,n,a);break;case 3:bn(e,t,n,a),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ss(e)));break;case 12:if(i&2048){bn(e,t,n,a),e=t.stateNode;try{var u=t.memoizedProps,f=u.id,g=u.onPostCommit;typeof g=="function"&&g(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(N){Xe(t,t.return,N)}}else bn(e,t,n,a);break;case 31:bn(e,t,n,a);break;case 13:bn(e,t,n,a);break;case 23:break;case 22:u=t.stateNode,f=t.alternate,t.memoizedState!==null?u._visibility&2?bn(e,t,n,a):Us(e,t):u._visibility&2?bn(e,t,n,a):(u._visibility|=2,Hl(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),i&2048&&Tu(f,t);break;case 24:bn(e,t,n,a),i&2048&&Ou(t.alternate,t);break;default:bn(e,t,n,a)}}function Hl(e,t,n,a,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,f=t,g=n,N=a,O=f.flags;switch(f.tag){case 0:case 11:case 15:Hl(u,f,g,N,i),ks(8,f);break;case 23:break;case 22:var H=f.stateNode;f.memoizedState!==null?H._visibility&2?Hl(u,f,g,N,i):Us(u,f):(H._visibility|=2,Hl(u,f,g,N,i)),i&&O&2048&&Tu(f.alternate,f);break;case 24:Hl(u,f,g,N,i),i&&O&2048&&Ou(f.alternate,f);break;default:Hl(u,f,g,N,i)}t=t.sibling}}function Us(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,i=a.flags;switch(a.tag){case 22:Us(n,a),i&2048&&Tu(a.alternate,a);break;case 24:Us(n,a),i&2048&&Ou(a.alternate,a);break;default:Us(n,a)}t=t.sibling}}var Bs=8192;function ql(e,t,n){if(e.subtreeFlags&Bs)for(e=e.child;e!==null;)_m(e,t,n),e=e.sibling}function _m(e,t,n){switch(e.tag){case 26:ql(e,t,n),e.flags&Bs&&e.memoizedState!==null&&yx(n,xn,e.memoizedState,e.memoizedProps);break;case 5:ql(e,t,n);break;case 3:case 4:var a=xn;xn=mo(e.stateNode.containerInfo),ql(e,t,n),xn=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Bs,Bs=16777216,ql(e,t,n),Bs=a):ql(e,t,n));break;default:ql(e,t,n)}}function km(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 Hs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];bt=a,Um(a,e)}km(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Rm(e),e=e.sibling}function Rm(e){switch(e.tag){case 0:case 11:case 15:Hs(e),e.flags&2048&&Na(9,e,e.return);break;case 3:Hs(e);break;case 12:Hs(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Pi(e)):Hs(e);break;default:Hs(e)}}function Pi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];bt=a,Um(a,e)}km(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Na(8,t,t.return),Pi(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Pi(t));break;default:Pi(t)}e=e.sibling}}function Um(e,t){for(;bt!==null;){var n=bt;switch(n.tag){case 0:case 11:case 15:Na(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Ss(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,bt=a;else e:for(n=e;bt!==null;){a=bt;var i=a.sibling,u=a.return;if(wm(a),a===n){bt=null;break e}if(i!==null){i.return=u,bt=i;break e}bt=u}}}var Dv={getCacheForType:function(e){var t=Ct(ct),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ct(ct).controller.signal}},_v=typeof WeakMap=="function"?WeakMap:Map,Ke=0,$e=null,_e=null,Re=0,Qe=0,It=null,ja=!1,Ll=!1,Au=!1,aa=0,st=0,Ca=0,al=0,Du=0,Pt=0,Yl=0,qs=null,Ht=null,_u=!1,eo=0,Bm=0,to=1/0,no=null,Ea=null,gt=0,wa=null,Gl=null,la=0,ku=0,Ru=null,Hm=null,Ls=0,Uu=null;function en(){return(Ke&2)!==0&&Re!==0?Re&-Re:z.T!==null?Gu():is()}function qm(){if(Pt===0)if((Re&536870912)===0||Be){var e=me;me<<=1,(me&3932160)===0&&(me=262144),Pt=e}else Pt=536870912;return e=$t.current,e!==null&&(e.flags|=32),Pt}function qt(e,t,n){(e===$e&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)&&(Kl(e,0),Ma(e,Re,Pt,!1)),yn(e,n),((Ke&2)===0||e!==$e)&&(e===$e&&((Ke&2)===0&&(al|=n),st===4&&Ma(e,Re,Pt,!1)),An(e))}function Lm(e,t,n){if((Ke&6)!==0)throw Error(c(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||zt(e,t),i=a?Uv(e,t):Hu(e,t,!0),u=a;do{if(i===0){Ll&&!a&&Ma(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!kv(n)){i=Hu(e,t,!1),u=!1;continue}if(i===2){if(u=t,e.errorRecoveryDisabledLanes&u)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var g=e;i=qs;var N=g.current.memoizedState.isDehydrated;if(N&&(Kl(g,f).flags|=256),f=Hu(g,f,!1),f!==2){if(Au&&!N){g.errorRecoveryDisabledLanes|=u,al|=u,i=4;break e}u=Ht,Ht=i,u!==null&&(Ht===null?Ht=u:Ht.push.apply(Ht,u))}i=f}if(u=!1,i!==2)continue}}if(i===1){Kl(e,0),Ma(e,t,0,!0);break}e:{switch(a=e,u=i,u){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Ma(a,t,Pt,!ja);break e;case 2:Ht=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(i=eo+300-ot(),10<i)){if(Ma(a,t,Pt,!ja),pe(a,0,!0)!==0)break e;la=t,a.timeoutHandle=yh(Ym.bind(null,a,n,Ht,no,_u,t,Pt,al,Yl,ja,u,"Throttled",-0,0),i);break e}Ym(a,n,Ht,no,_u,t,Pt,al,Yl,ja,u,null,-0,0)}}break}while(!0);An(e)}function Ym(e,t,n,a,i,u,f,g,N,O,H,K,D,U){if(e.timeoutHandle=-1,K=t.subtreeFlags,K&8192||(K&16785408)===16785408){K={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Kn},_m(t,u,K);var te=(u&62914560)===u?eo-ot():(u&4194048)===u?Bm-ot():0;if(te=vx(K,te),te!==null){la=u,e.cancelPendingCommit=te(Jm.bind(null,e,t,u,n,a,i,f,g,N,H,K,null,D,U)),Ma(e,u,f,!O);return}}Jm(e,t,u,n,a,i,f,g,N)}function kv(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var i=n[a],u=i.getSnapshot;i=i.value;try{if(!Wt(u(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 Ma(e,t,n,a){t&=~Du,t&=~al,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var i=t;0<i;){var u=31-fe(i),f=1<<u;a[u]=-1,i&=~f}n!==0&&La(e,n,t)}function ao(){return(Ke&6)===0?(Ys(0),!1):!0}function Bu(){if(_e!==null){if(Qe===0)var e=_e.return;else e=_e,Zn=Wa=null,Pr(e),_l=null,js=0,e=_e;for(;e!==null;)vm(e.alternate,e),e=e.return;_e=null}}function Kl(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,ex(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),la=0,Bu(),$e=e,_e=n=Qn(e.current,null),Re=t,Qe=0,It=null,ja=!1,Ll=zt(e,t),Au=!1,Yl=Pt=Du=al=Ca=st=0,Ht=qs=null,_u=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var i=31-fe(a),u=1<<i;t|=e[i],a&=~u}return aa=t,Ci(),n}function Gm(e,t){je=null,z.H=As,t===Dl||t===Di?(t=af(),Qe=3):t===Yr?(t=af(),Qe=4):Qe=t===pu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,It=t,_e===null&&(st=1,Xi(e,un(t,e.current)))}function Km(){var e=$t.current;return e===null?!0:(Re&4194048)===Re?mn===null:(Re&62914560)===Re||(Re&536870912)!==0?e===mn:!1}function Vm(){var e=z.H;return z.H=As,e===null?As:e}function Qm(){var e=z.A;return z.A=Dv,e}function lo(){st=4,ja||(Re&4194048)!==Re&&$t.current!==null||(Ll=!0),(Ca&134217727)===0&&(al&134217727)===0||$e===null||Ma($e,Re,Pt,!1)}function Hu(e,t,n){var a=Ke;Ke|=2;var i=Vm(),u=Qm();($e!==e||Re!==t)&&(no=null,Kl(e,t)),t=!1;var f=st;e:do try{if(Qe!==0&&_e!==null){var g=_e,N=It;switch(Qe){case 8:Bu(),f=6;break e;case 3:case 2:case 9:case 6:$t.current===null&&(t=!0);var O=Qe;if(Qe=0,It=null,Vl(e,g,N,O),n&&Ll){f=0;break e}break;default:O=Qe,Qe=0,It=null,Vl(e,g,N,O)}}Rv(),f=st;break}catch(H){Gm(e,H)}while(!0);return t&&e.shellSuspendCounter++,Zn=Wa=null,Ke=a,z.H=i,z.A=u,_e===null&&($e=null,Re=0,Ci()),f}function Rv(){for(;_e!==null;)Xm(_e)}function Uv(e,t){var n=Ke;Ke|=2;var a=Vm(),i=Qm();$e!==e||Re!==t?(no=null,to=ot()+500,Kl(e,t)):Ll=zt(e,t);e:do try{if(Qe!==0&&_e!==null){t=_e;var u=It;t:switch(Qe){case 1:Qe=0,It=null,Vl(e,t,u,1);break;case 2:case 9:if(tf(u)){Qe=0,It=null,Zm(t);break}t=function(){Qe!==2&&Qe!==9||$e!==e||(Qe=7),An(e)},u.then(t,t);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:tf(u)?(Qe=0,It=null,Zm(t)):(Qe=0,It=null,Vl(e,t,u,7));break;case 5:var f=null;switch(_e.tag){case 26:f=_e.memoizedState;case 5:case 27:var g=_e;if(f?Dh(f):g.stateNode.complete){Qe=0,It=null;var N=g.sibling;if(N!==null)_e=N;else{var O=g.return;O!==null?(_e=O,so(O)):_e=null}break t}}Qe=0,It=null,Vl(e,t,u,5);break;case 6:Qe=0,It=null,Vl(e,t,u,6);break;case 8:Bu(),st=6;break e;default:throw Error(c(462))}}Bv();break}catch(H){Gm(e,H)}while(!0);return Zn=Wa=null,z.H=a,z.A=i,Ke=n,_e!==null?0:($e=null,Re=0,Ci(),st)}function Bv(){for(;_e!==null&&!ca();)Xm(_e)}function Xm(e){var t=gm(e.alternate,e,aa);e.memoizedProps=e.pendingProps,t===null?so(e):_e=t}function Zm(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=cm(n,t,t.pendingProps,t.type,void 0,Re);break;case 11:t=cm(n,t,t.pendingProps,t.type.render,t.ref,Re);break;case 5:Pr(t);default:vm(n,t),t=_e=Vd(t,aa),t=gm(n,t,aa)}e.memoizedProps=e.pendingProps,t===null?so(e):_e=t}function Vl(e,t,n,a){Zn=Wa=null,Pr(t),_l=null,js=0;var i=t.return;try{if(Ev(e,i,t,n,Re)){st=1,Xi(e,un(n,e.current)),_e=null;return}}catch(u){if(i!==null)throw _e=i,u;st=1,Xi(e,un(n,e.current)),_e=null;return}t.flags&32768?(Be||a===1?e=!0:Ll||(Re&536870912)!==0?e=!1:(ja=e=!0,(a===2||a===9||a===3||a===6)&&(a=$t.current,a!==null&&a.tag===13&&(a.flags|=16384))),Wm(t,e)):so(t)}function so(e){var t=e;do{if((t.flags&32768)!==0){Wm(t,ja);return}e=t.return;var n=zv(t.alternate,t,aa);if(n!==null){_e=n;return}if(t=t.sibling,t!==null){_e=t;return}_e=t=e}while(t!==null);st===0&&(st=5)}function Wm(e,t){do{var n=Tv(e.alternate,e);if(n!==null){n.flags&=32767,_e=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){_e=e;return}_e=e=n}while(e!==null);st=6,_e=null}function Jm(e,t,n,a,i,u,f,g,N){e.cancelPendingCommit=null;do io();while(gt!==0);if((Ke&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(u=t.lanes|t.childLanes,u|=wr,ls(e,n,u,f,g,N),e===$e&&(_e=$e=null,Re=0),Gl=t,wa=e,la=n,ku=u,Ru=i,Hm=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Yv(wn,function(){return eh(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=z.T,z.T=null,i=Z.p,Z.p=2,f=Ke,Ke|=4;try{Ov(e,t,n)}finally{Ke=f,Z.p=i,z.T=a}}gt=1,$m(),Fm(),Im()}}function $m(){if(gt===1){gt=0;var e=wa,t=Gl,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=z.T,z.T=null;var a=Z.p;Z.p=2;var i=Ke;Ke|=4;try{Om(t,e);var u=$u,f=Rd(e.containerInfo),g=u.focusedElem,N=u.selectionRange;if(f!==g&&g&&g.ownerDocument&&kd(g.ownerDocument.documentElement,g)){if(N!==null&&Sr(g)){var O=N.start,H=N.end;if(H===void 0&&(H=O),"selectionStart"in g)g.selectionStart=O,g.selectionEnd=Math.min(H,g.value.length);else{var K=g.ownerDocument||document,D=K&&K.defaultView||window;if(D.getSelection){var U=D.getSelection(),te=g.textContent.length,he=Math.min(N.start,te),Je=N.end===void 0?he:Math.min(N.end,te);!U.extend&&he>Je&&(f=Je,Je=he,he=f);var E=_d(g,he),C=_d(g,Je);if(E&&C&&(U.rangeCount!==1||U.anchorNode!==E.node||U.anchorOffset!==E.offset||U.focusNode!==C.node||U.focusOffset!==C.offset)){var T=K.createRange();T.setStart(E.node,E.offset),U.removeAllRanges(),he>Je?(U.addRange(T),U.extend(C.node,C.offset)):(T.setEnd(C.node,C.offset),U.addRange(T))}}}}for(K=[],U=g;U=U.parentNode;)U.nodeType===1&&K.push({element:U,left:U.scrollLeft,top:U.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<K.length;g++){var L=K[g];L.element.scrollLeft=L.left,L.element.scrollTop=L.top}}xo=!!Ju,$u=Ju=null}finally{Ke=i,Z.p=a,z.T=n}}e.current=t,gt=2}}function Fm(){if(gt===2){gt=0;var e=wa,t=Gl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=z.T,z.T=null;var a=Z.p;Z.p=2;var i=Ke;Ke|=4;try{Em(e,t.alternate,t)}finally{Ke=i,Z.p=a,z.T=n}}gt=3}}function Im(){if(gt===4||gt===3){gt=0,Bn();var e=wa,t=Gl,n=la,a=Hm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?gt=5:(gt=0,Gl=wa=null,Pm(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Ea=null),dl(n),t=t.stateNode,W&&typeof W.onCommitFiberRoot=="function")try{W.onCommitFiberRoot(qn,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=z.T,i=Z.p,Z.p=2,z.T=null;try{for(var u=e.onRecoverableError,f=0;f<a.length;f++){var g=a[f];u(g.value,{componentStack:g.stack})}}finally{z.T=t,Z.p=i}}(la&3)!==0&&io(),An(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===Uu?Ls++:(Ls=0,Uu=e):Ls=0,Ys(0)}}function Pm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ss(t)))}function io(){return $m(),Fm(),Im(),eh()}function eh(){if(gt!==5)return!1;var e=wa,t=ku;ku=0;var n=dl(la),a=z.T,i=Z.p;try{Z.p=32>n?32:n,z.T=null,n=Ru,Ru=null;var u=wa,f=la;if(gt=0,Gl=wa=null,la=0,(Ke&6)!==0)throw Error(c(331));var g=Ke;if(Ke|=4,Rm(u.current),Dm(u,u.current,f,n),Ke=g,Ys(0,!1),W&&typeof W.onPostCommitFiberRoot=="function")try{W.onPostCommitFiberRoot(qn,u)}catch{}return!0}finally{Z.p=i,z.T=a,Pm(e,t)}}function th(e,t,n){t=un(n,t),t=hu(e.stateNode,t,2),e=xa(e,t,2),e!==null&&(yn(e,2),An(e))}function Xe(e,t,n){if(e.tag===3)th(e,e,n);else for(;t!==null;){if(t.tag===3){th(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Ea===null||!Ea.has(a))){e=un(n,e),n=nm(2),a=xa(t,n,2),a!==null&&(am(n,a,t,e),yn(a,2),An(a));break}}t=t.return}}function qu(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new _v;var i=new Set;a.set(t,i)}else i=a.get(t),i===void 0&&(i=new Set,a.set(t,i));i.has(n)||(Au=!0,i.add(n),e=Hv.bind(null,e,t,n),t.then(e,e))}function Hv(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,$e===e&&(Re&n)===n&&(st===4||st===3&&(Re&62914560)===Re&&300>ot()-eo?(Ke&2)===0&&Kl(e,0):Du|=n,Yl===Re&&(Yl=0)),An(e)}function nh(e,t){t===0&&(t=vt()),e=Qa(e,t),e!==null&&(yn(e,t),An(e))}function qv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),nh(e,n)}function Lv(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(c(314))}a!==null&&a.delete(t),nh(e,n)}function Yv(e,t){return En(e,t)}var oo=null,Ql=null,Lu=!1,ro=!1,Yu=!1,za=0;function An(e){e!==Ql&&e.next===null&&(Ql===null?oo=Ql=e:Ql=Ql.next=e),ro=!0,Lu||(Lu=!0,Kv())}function Ys(e,t){if(!Yu&&ro){Yu=!0;do for(var n=!1,a=oo;a!==null;){if(e!==0){var i=a.pendingLanes;if(i===0)var u=0;else{var f=a.suspendedLanes,g=a.pingedLanes;u=(1<<31-fe(42|e)+1)-1,u&=i&~(f&~g),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,ih(a,u))}else u=Re,u=pe(a,a===$e?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||zt(a,u)||(n=!0,ih(a,u));a=a.next}while(n);Yu=!1}}function Gv(){ah()}function ah(){ro=Lu=!1;var e=0;za!==0&&Pv()&&(e=za);for(var t=ot(),n=null,a=oo;a!==null;){var i=a.next,u=lh(a,t);u===0?(a.next=null,n===null?oo=i:n.next=i,i===null&&(Ql=n)):(n=a,(e!==0||(u&3)!==0)&&(ro=!0)),a=i}gt!==0&&gt!==5||Ys(e),za!==0&&(za=0)}function lh(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,i=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var f=31-fe(u),g=1<<f,N=i[f];N===-1?((g&n)===0||(g&a)!==0)&&(i[f]=Ln(g,t)):N<=t&&(e.expiredLanes|=g),u&=~g}if(t=$e,n=Re,n=pe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Qt(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||zt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&Qt(a),dl(n)){case 2:case 8:n=qa;break;case 32:n=wn;break;case 268435456:n=cl;break;default:n=wn}return a=sh.bind(null,e),n=En(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&Qt(a),e.callbackPriority=2,e.callbackNode=null,2}function sh(e,t){if(gt!==0&&gt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(io()&&e.callbackNode!==n)return null;var a=Re;return a=pe(e,e===$e?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Lm(e,a,t),lh(e,ot()),e.callbackNode!=null&&e.callbackNode===n?sh.bind(null,e):null)}function ih(e,t){if(io())return null;Lm(e,t,!0)}function Kv(){tx(function(){(Ke&6)!==0?En(Hn,Gv):ah()})}function Gu(){if(za===0){var e=Ol;e===0&&(e=be,be<<=1,(be&261888)===0&&(be=256)),za=e}return za}function oh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:gi(""+e)}function rh(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Vv(e,t,n,a,i){if(t==="submit"&&n&&n.stateNode===i){var u=oh((i[_t]||null).action),f=a.submitter;f&&(t=(t=f[_t]||null)?oh(t.formAction):f.getAttribute("formAction"),t!==null&&(u=t,f=null));var g=new bi("action","action",null,a,i);e.push({event:g,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(za!==0){var N=f?rh(i,f):new FormData(i);ru(n,{pending:!0,data:N,method:i.method,action:u},null,N)}}else typeof u=="function"&&(g.preventDefault(),N=f?rh(i,f):new FormData(i),ru(n,{pending:!0,data:N,method:i.method,action:u},u,N))},currentTarget:i}]})}}for(var Ku=0;Ku<Er.length;Ku++){var Vu=Er[Ku],Qv=Vu.toLowerCase(),Xv=Vu[0].toUpperCase()+Vu.slice(1);vn(Qv,"on"+Xv)}vn(Hd,"onAnimationEnd"),vn(qd,"onAnimationIteration"),vn(Ld,"onAnimationStart"),vn("dblclick","onDoubleClick"),vn("focusin","onFocus"),vn("focusout","onBlur"),vn(rv,"onTransitionRun"),vn(uv,"onTransitionStart"),vn(cv,"onTransitionCancel"),vn(Yd,"onTransitionEnd"),gl("onMouseEnter",["mouseout","mouseover"]),gl("onMouseLeave",["mouseout","mouseover"]),gl("onPointerEnter",["pointerout","pointerover"]),gl("onPointerLeave",["pointerout","pointerover"]),Ya("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ya("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ya("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ya("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ya("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ya("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Gs="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(" "),Zv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Gs));function uh(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],i=a.event;a=a.listeners;e:{var u=void 0;if(t)for(var f=a.length-1;0<=f;f--){var g=a[f],N=g.instance,O=g.currentTarget;if(g=g.listener,N!==u&&i.isPropagationStopped())break e;u=g,i.currentTarget=O;try{u(i)}catch(H){ji(H)}i.currentTarget=null,u=N}else for(f=0;f<a.length;f++){if(g=a[f],N=g.instance,O=g.currentTarget,g=g.listener,N!==u&&i.isPropagationStopped())break e;u=g,i.currentTarget=O;try{u(i)}catch(H){ji(H)}i.currentTarget=null,u=N}}}}function ke(e,t){var n=t[ar];n===void 0&&(n=t[ar]=new Set);var a=e+"__bubble";n.has(a)||(ch(t,e,2,!1),n.add(a))}function Qu(e,t,n){var a=0;t&&(a|=4),ch(n,e,a,t)}var uo="_reactListening"+Math.random().toString(36).slice(2);function Xu(e){if(!e[uo]){e[uo]=!0,nd.forEach(function(n){n!=="selectionchange"&&(Zv.has(n)||Qu(n,!1,e),Qu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[uo]||(t[uo]=!0,Qu("selectionchange",!1,t))}}function ch(e,t,n,a){switch(qh(t)){case 2:var i=Sx;break;case 8:i=Nx;break;default:i=oc}n=i.bind(null,t,n,e),i=void 0,!fr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),a?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Zu(e,t,n,a,i){var u=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var f=a.tag;if(f===3||f===4){var g=a.stateNode.containerInfo;if(g===i)break;if(f===4)for(f=a.return;f!==null;){var N=f.tag;if((N===3||N===4)&&f.stateNode.containerInfo===i)return;f=f.return}for(;g!==null;){if(f=ml(g),f===null)return;if(N=f.tag,N===5||N===6||N===26||N===27){a=u=f;continue e}g=g.parentNode}}a=a.return}hd(function(){var O=u,H=cr(n),K=[];e:{var D=Gd.get(e);if(D!==void 0){var U=bi,te=e;switch(e){case"keypress":if(vi(n)===0)break e;case"keydown":case"keyup":U=Ly;break;case"focusin":te="focus",U=gr;break;case"focusout":te="blur",U=gr;break;case"beforeblur":case"afterblur":U=gr;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":U=yd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":U=zy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":U=Ky;break;case Hd:case qd:case Ld:U=Ay;break;case Yd:U=Qy;break;case"scroll":case"scrollend":U=wy;break;case"wheel":U=Zy;break;case"copy":case"cut":case"paste":U=_y;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":U=xd;break;case"toggle":case"beforetoggle":U=Jy}var he=(t&4)!==0,Je=!he&&(e==="scroll"||e==="scrollend"),E=he?D!==null?D+"Capture":null:D;he=[];for(var C=O,T;C!==null;){var L=C;if(T=L.stateNode,L=L.tag,L!==5&&L!==26&&L!==27||T===null||E===null||(L=cs(C,E),L!=null&&he.push(Ks(C,L,T))),Je)break;C=C.return}0<he.length&&(D=new U(D,te,null,n,H),K.push({event:D,listeners:he}))}}if((t&7)===0){e:{if(D=e==="mouseover"||e==="pointerover",U=e==="mouseout"||e==="pointerout",D&&n!==ur&&(te=n.relatedTarget||n.fromElement)&&(ml(te)||te[fl]))break e;if((U||D)&&(D=H.window===H?H:(D=H.ownerDocument)?D.defaultView||D.parentWindow:window,U?(te=n.relatedTarget||n.toElement,U=O,te=te?ml(te):null,te!==null&&(Je=m(te),he=te.tag,te!==Je||he!==5&&he!==27&&he!==6)&&(te=null)):(U=null,te=O),U!==te)){if(he=yd,L="onMouseLeave",E="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(he=xd,L="onPointerLeave",E="onPointerEnter",C="pointer"),Je=U==null?D:us(U),T=te==null?D:us(te),D=new he(L,C+"leave",U,n,H),D.target=Je,D.relatedTarget=T,L=null,ml(H)===O&&(he=new he(E,C+"enter",te,n,H),he.target=T,he.relatedTarget=Je,L=he),Je=L,U&&te)t:{for(he=Wv,E=U,C=te,T=0,L=E;L;L=he(L))T++;L=0;for(var ue=C;ue;ue=he(ue))L++;for(;0<T-L;)E=he(E),T--;for(;0<L-T;)C=he(C),L--;for(;T--;){if(E===C||C!==null&&E===C.alternate){he=E;break t}E=he(E),C=he(C)}he=null}else he=null;U!==null&&dh(K,D,U,he,!1),te!==null&&Je!==null&&dh(K,Je,te,he,!0)}}e:{if(D=O?us(O):window,U=D.nodeName&&D.nodeName.toLowerCase(),U==="select"||U==="input"&&D.type==="file")var He=Md;else if(Ed(D))if(zd)He=sv;else{He=av;var se=nv}else U=D.nodeName,!U||U.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?O&&rr(O.elementType)&&(He=Md):He=lv;if(He&&(He=He(e,O))){wd(K,He,n,H);break e}se&&se(e,D,O),e==="focusout"&&O&&D.type==="number"&&O.memoizedProps.value!=null&&or(D,"number",D.value)}switch(se=O?us(O):window,e){case"focusin":(Ed(se)||se.contentEditable==="true")&&(Nl=se,Nr=O,vs=null);break;case"focusout":vs=Nr=Nl=null;break;case"mousedown":jr=!0;break;case"contextmenu":case"mouseup":case"dragend":jr=!1,Ud(K,n,H);break;case"selectionchange":if(ov)break;case"keydown":case"keyup":Ud(K,n,H)}var Ee;if(vr)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 Sl?jd(e,n)&&(Ue="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Ue="onCompositionStart");Ue&&(bd&&n.locale!=="ko"&&(Sl||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&Sl&&(Ee=pd()):(fa=H,mr="value"in fa?fa.value:fa.textContent,Sl=!0)),se=co(O,Ue),0<se.length&&(Ue=new vd(Ue,e,null,n,H),K.push({event:Ue,listeners:se}),Ee?Ue.data=Ee:(Ee=Cd(n),Ee!==null&&(Ue.data=Ee)))),(Ee=Fy?Iy(e,n):Py(e,n))&&(Ue=co(O,"onBeforeInput"),0<Ue.length&&(se=new vd("onBeforeInput","beforeinput",null,n,H),K.push({event:se,listeners:Ue}),se.data=Ee)),Vv(K,e,O,n,H)}uh(K,t)})}function Ks(e,t,n){return{instance:e,listener:t,currentTarget:n}}function co(e,t){for(var n=t+"Capture",a=[];e!==null;){var i=e,u=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||u===null||(i=cs(e,n),i!=null&&a.unshift(Ks(e,i,u)),i=cs(e,t),i!=null&&a.push(Ks(e,i,u))),e.tag===3)return a;e=e.return}return[]}function Wv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function dh(e,t,n,a,i){for(var u=t._reactName,f=[];n!==null&&n!==a;){var g=n,N=g.alternate,O=g.stateNode;if(g=g.tag,N!==null&&N===a)break;g!==5&&g!==26&&g!==27||O===null||(N=O,i?(O=cs(n,u),O!=null&&f.unshift(Ks(n,O,N))):i||(O=cs(n,u),O!=null&&f.push(Ks(n,O,N)))),n=n.return}f.length!==0&&e.push({event:t,listeners:f})}var Jv=/\r\n?/g,$v=/\u0000|\uFFFD/g;function fh(e){return(typeof e=="string"?e:""+e).replace(Jv,`
10
+ `).replace($v,"")}function mh(e,t){return t=fh(t),fh(e)===t}function We(e,t,n,a,i,u){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||vl(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&vl(e,""+a);break;case"className":hi(e,"class",a);break;case"tabIndex":hi(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":hi(e,n,a);break;case"style":fd(e,a,u);break;case"data":if(t!=="object"){hi(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=gi(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"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 u=="function"&&(n==="formAction"?(t!=="input"&&We(e,t,"name",i.name,i,null),We(e,t,"formEncType",i.formEncType,i,null),We(e,t,"formMethod",i.formMethod,i,null),We(e,t,"formTarget",i.formTarget,i,null)):(We(e,t,"encType",i.encType,i,null),We(e,t,"method",i.method,i,null),We(e,t,"target",i.target,i,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=gi(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=Kn);break;case"onScroll":a!=null&&ke("scroll",e);break;case"onScrollEnd":a!=null&&ke("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(n=a.__html,n!=null){if(i.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=gi(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);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":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":ke("beforetoggle",e),ke("toggle",e),mi(e,"popover",a);break;case"xlinkActuate":Gn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Gn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Gn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Gn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Gn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Gn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":mi(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=Cy.get(n)||n,mi(e,n,a))}}function Wu(e,t,n,a,i,u){switch(n){case"style":fd(e,a,u);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(n=a.__html,n!=null){if(i.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof a=="string"?vl(e,a):(typeof a=="number"||typeof a=="bigint")&&vl(e,""+a);break;case"onScroll":a!=null&&ke("scroll",e);break;case"onScrollEnd":a!=null&&ke("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Kn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ad.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),u=e[_t]||null,u=u!=null?u[n]:null,typeof u=="function"&&e.removeEventListener(t,u,i),typeof a=="function")){typeof u!="function"&&u!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,i);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):mi(e,n,a)}}}function wt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ke("error",e),ke("load",e);var a=!1,i=!1,u;for(u in n)if(n.hasOwnProperty(u)){var f=n[u];if(f!=null)switch(u){case"src":a=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:We(e,t,u,f,n,null)}}i&&We(e,t,"srcSet",n.srcSet,n,null),a&&We(e,t,"src",n.src,n,null);return;case"input":ke("invalid",e);var g=u=f=i=null,N=null,O=null;for(a in n)if(n.hasOwnProperty(a)){var H=n[a];if(H!=null)switch(a){case"name":i=H;break;case"type":f=H;break;case"checked":N=H;break;case"defaultChecked":O=H;break;case"value":u=H;break;case"defaultValue":g=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(c(137,t));break;default:We(e,t,a,H,n,null)}}rd(e,u,g,N,O,f,i,!1);return;case"select":ke("invalid",e),a=f=u=null;for(i in n)if(n.hasOwnProperty(i)&&(g=n[i],g!=null))switch(i){case"value":u=g;break;case"defaultValue":f=g;break;case"multiple":a=g;default:We(e,t,i,g,n,null)}t=u,n=f,e.multiple=!!a,t!=null?yl(e,!!a,t,!1):n!=null&&yl(e,!!a,n,!0);return;case"textarea":ke("invalid",e),u=i=a=null;for(f in n)if(n.hasOwnProperty(f)&&(g=n[f],g!=null))switch(f){case"value":a=g;break;case"defaultValue":i=g;break;case"children":u=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(c(91));break;default:We(e,t,f,g,n,null)}cd(e,a,i,u);return;case"option":for(N in n)if(n.hasOwnProperty(N)&&(a=n[N],a!=null))switch(N){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:We(e,t,N,a,n,null)}return;case"dialog":ke("beforetoggle",e),ke("toggle",e),ke("cancel",e),ke("close",e);break;case"iframe":case"object":ke("load",e);break;case"video":case"audio":for(a=0;a<Gs.length;a++)ke(Gs[a],e);break;case"image":ke("error",e),ke("load",e);break;case"details":ke("toggle",e);break;case"embed":case"source":case"link":ke("error",e),ke("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(O in n)if(n.hasOwnProperty(O)&&(a=n[O],a!=null))switch(O){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:We(e,t,O,a,n,null)}return;default:if(rr(t)){for(H in n)n.hasOwnProperty(H)&&(a=n[H],a!==void 0&&Wu(e,t,H,a,n,void 0));return}}for(g in n)n.hasOwnProperty(g)&&(a=n[g],a!=null&&We(e,t,g,a,n,null))}function Fv(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,u=null,f=null,g=null,N=null,O=null,H=null;for(U in n){var K=n[U];if(n.hasOwnProperty(U)&&K!=null)switch(U){case"checked":break;case"value":break;case"defaultValue":N=K;default:a.hasOwnProperty(U)||We(e,t,U,null,a,K)}}for(var D in a){var U=a[D];if(K=n[D],a.hasOwnProperty(D)&&(U!=null||K!=null))switch(D){case"type":u=U;break;case"name":i=U;break;case"checked":O=U;break;case"defaultChecked":H=U;break;case"value":f=U;break;case"defaultValue":g=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(c(137,t));break;default:U!==K&&We(e,t,D,U,a,K)}}ir(e,f,g,N,O,H,u,i);return;case"select":U=f=g=D=null;for(u in n)if(N=n[u],n.hasOwnProperty(u)&&N!=null)switch(u){case"value":break;case"multiple":U=N;default:a.hasOwnProperty(u)||We(e,t,u,null,a,N)}for(i in a)if(u=a[i],N=n[i],a.hasOwnProperty(i)&&(u!=null||N!=null))switch(i){case"value":D=u;break;case"defaultValue":g=u;break;case"multiple":f=u;default:u!==N&&We(e,t,i,u,a,N)}t=g,n=f,a=U,D!=null?yl(e,!!n,D,!1):!!a!=!!n&&(t!=null?yl(e,!!n,t,!0):yl(e,!!n,n?[]:"",!1));return;case"textarea":U=D=null;for(g in n)if(i=n[g],n.hasOwnProperty(g)&&i!=null&&!a.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:We(e,t,g,null,a,i)}for(f in a)if(i=a[f],u=n[f],a.hasOwnProperty(f)&&(i!=null||u!=null))switch(f){case"value":D=i;break;case"defaultValue":U=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(c(91));break;default:i!==u&&We(e,t,f,i,a,u)}ud(e,D,U);return;case"option":for(var te in n)if(D=n[te],n.hasOwnProperty(te)&&D!=null&&!a.hasOwnProperty(te))switch(te){case"selected":e.selected=!1;break;default:We(e,t,te,null,a,D)}for(N in a)if(D=a[N],U=n[N],a.hasOwnProperty(N)&&D!==U&&(D!=null||U!=null))switch(N){case"selected":e.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:We(e,t,N,D,a,U)}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 he in n)D=n[he],n.hasOwnProperty(he)&&D!=null&&!a.hasOwnProperty(he)&&We(e,t,he,null,a,D);for(O in a)if(D=a[O],U=n[O],a.hasOwnProperty(O)&&D!==U&&(D!=null||U!=null))switch(O){case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(c(137,t));break;default:We(e,t,O,D,a,U)}return;default:if(rr(t)){for(var Je in n)D=n[Je],n.hasOwnProperty(Je)&&D!==void 0&&!a.hasOwnProperty(Je)&&Wu(e,t,Je,void 0,a,D);for(H in a)D=a[H],U=n[H],!a.hasOwnProperty(H)||D===U||D===void 0&&U===void 0||Wu(e,t,H,D,a,U);return}}for(var E in n)D=n[E],n.hasOwnProperty(E)&&D!=null&&!a.hasOwnProperty(E)&&We(e,t,E,null,a,D);for(K in a)D=a[K],U=n[K],!a.hasOwnProperty(K)||D===U||D==null&&U==null||We(e,t,K,D,a,U)}function hh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Iv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var i=n[a],u=i.transferSize,f=i.initiatorType,g=i.duration;if(u&&g&&hh(f)){for(f=0,g=i.responseEnd,a+=1;a<n.length;a++){var N=n[a],O=N.startTime;if(O>g)break;var H=N.transferSize,K=N.initiatorType;H&&hh(K)&&(N=N.responseEnd,f+=H*(N<g?1:(g-O)/(N-O)))}if(--a,t+=8*(u+f)/(i.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 Ju=null,$u=null;function fo(e){return e.nodeType===9?e:e.ownerDocument}function ph(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 gh(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 Fu(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 Iu=null;function Pv(){var e=window.event;return e&&e.type==="popstate"?e===Iu?!1:(Iu=e,!0):(Iu=null,!1)}var yh=typeof setTimeout=="function"?setTimeout:void 0,ex=typeof clearTimeout=="function"?clearTimeout:void 0,vh=typeof Promise=="function"?Promise:void 0,tx=typeof queueMicrotask=="function"?queueMicrotask:typeof vh<"u"?function(e){return vh.resolve(null).then(e).catch(nx)}:yh;function nx(e){setTimeout(function(){throw e})}function Ta(e){return e==="head"}function xh(e,t){var n=t,a=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(i),Jl(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")Vs(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Vs(n);for(var u=n.firstChild;u;){var f=u.nextSibling,g=u.nodeName;u[rs]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=f}}else n==="body"&&Vs(e.ownerDocument.body);n=i}while(n);Jl(t)}function bh(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function Pu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Pu(n),lr(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function ax(e,t,n,a){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[rs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=hn(e.nextSibling),e===null)break}return null}function lx(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=hn(e.nextSibling),e===null))return null;return e}function Sh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=hn(e.nextSibling),e===null))return null;return e}function ec(e){return e.data==="$?"||e.data==="$~"}function tc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function sx(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function hn(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 nc=null;function Nh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return hn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function jh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Ch(e,t,n){switch(t=fo(n),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Vs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);lr(e)}var pn=new Map,Eh=new Set;function mo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var sa=Z.d;Z.d={f:ix,r:ox,D:rx,C:ux,L:cx,m:dx,X:mx,S:fx,M:hx};function ix(){var e=sa.f(),t=ao();return e||t}function ox(e){var t=hl(e);t!==null&&t.tag===5&&t.type==="form"?Gf(t):sa.r(e)}var Xl=typeof document>"u"?null:document;function wh(e,t,n){var a=Xl;if(a&&typeof t=="string"&&t){var i=on(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),Eh.has(i)||(Eh.add(i),e={rel:e,crossOrigin:n,href:t},a.querySelector(i)===null&&(t=a.createElement("link"),wt(t,"link",e),xt(t),a.head.appendChild(t)))}}function rx(e){sa.D(e),wh("dns-prefetch",e,null)}function ux(e,t){sa.C(e,t),wh("preconnect",e,t)}function cx(e,t,n){sa.L(e,t,n);var a=Xl;if(a&&e&&t){var i='link[rel="preload"][as="'+on(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+on(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+on(n.imageSizes)+'"]')):i+='[href="'+on(e)+'"]';var u=i;switch(t){case"style":u=Zl(e);break;case"script":u=Wl(e)}pn.has(u)||(e=v({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),pn.set(u,e),a.querySelector(i)!==null||t==="style"&&a.querySelector(Qs(u))||t==="script"&&a.querySelector(Xs(u))||(t=a.createElement("link"),wt(t,"link",e),xt(t),a.head.appendChild(t)))}}function dx(e,t){sa.m(e,t);var n=Xl;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+on(a)+'"][href="'+on(e)+'"]',u=i;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Wl(e)}if(!pn.has(u)&&(e=v({rel:"modulepreload",href:e},t),pn.set(u,e),n.querySelector(i)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Xs(u)))return}a=n.createElement("link"),wt(a,"link",e),xt(a),n.head.appendChild(a)}}}function fx(e,t,n){sa.S(e,t,n);var a=Xl;if(a&&e){var i=pl(a).hoistableStyles,u=Zl(e);t=t||"default";var f=i.get(u);if(!f){var g={loading:0,preload:null};if(f=a.querySelector(Qs(u)))g.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},n),(n=pn.get(u))&&ac(e,n);var N=f=a.createElement("link");xt(N),wt(N,"link",e),N._p=new Promise(function(O,H){N.onload=O,N.onerror=H}),N.addEventListener("load",function(){g.loading|=1}),N.addEventListener("error",function(){g.loading|=2}),g.loading|=4,ho(f,t,a)}f={type:"stylesheet",instance:f,count:1,state:g},i.set(u,f)}}}function mx(e,t){sa.X(e,t);var n=Xl;if(n&&e){var a=pl(n).hoistableScripts,i=Wl(e),u=a.get(i);u||(u=n.querySelector(Xs(i)),u||(e=v({src:e,async:!0},t),(t=pn.get(i))&&lc(e,t),u=n.createElement("script"),xt(u),wt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(i,u))}}function hx(e,t){sa.M(e,t);var n=Xl;if(n&&e){var a=pl(n).hoistableScripts,i=Wl(e),u=a.get(i);u||(u=n.querySelector(Xs(i)),u||(e=v({src:e,async:!0,type:"module"},t),(t=pn.get(i))&&lc(e,t),u=n.createElement("script"),xt(u),wt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(i,u))}}function Mh(e,t,n,a){var i=(i=I.current)?mo(i):null;if(!i)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Zl(n.href),n=pl(i).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Zl(n.href);var u=pl(i).hoistableStyles,f=u.get(e);if(f||(i=i.ownerDocument||i,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,f),(u=i.querySelector(Qs(e)))&&!u._p&&(f.instance=u,f.state.loading=5),pn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},pn.set(e,n),u||px(i,e,n,f.state))),t&&a===null)throw Error(c(528,""));return f}if(t&&a!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Wl(n),n=pl(i).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Zl(e){return'href="'+on(e)+'"'}function Qs(e){return'link[rel="stylesheet"]['+e+"]"}function zh(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function px(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),wt(t,"link",n),xt(t),e.head.appendChild(t))}function Wl(e){return'[src="'+on(e)+'"]'}function Xs(e){return"script[async]"+e}function Th(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+on(n.href)+'"]');if(a)return t.instance=a,xt(a),a;var i=v({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),xt(a),wt(a,"style",i),ho(a,n.precedence,e),t.instance=a;case"stylesheet":i=Zl(n.href);var u=e.querySelector(Qs(i));if(u)return t.state.loading|=4,t.instance=u,xt(u),u;a=zh(n),(i=pn.get(i))&&ac(a,i),u=(e.ownerDocument||e).createElement("link"),xt(u);var f=u;return f._p=new Promise(function(g,N){f.onload=g,f.onerror=N}),wt(u,"link",a),t.state.loading|=4,ho(u,n.precedence,e),t.instance=u;case"script":return u=Wl(n.src),(i=e.querySelector(Xs(u)))?(t.instance=i,xt(i),i):(a=n,(i=pn.get(u))&&(a=v({},n),lc(a,i)),e=e.ownerDocument||e,i=e.createElement("script"),xt(i),wt(i,"link",a),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,ho(a,n.precedence,e));return t.instance}function ho(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=a.length?a[a.length-1]:null,u=i,f=0;f<a.length;f++){var g=a[f];if(g.dataset.precedence===t)u=g;else if(u!==i)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function ac(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function lc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var po=null;function Oh(e,t,n){if(po===null){var a=new Map,i=po=new Map;i.set(n,a)}else i=po,a=i.get(n),a||(a=new Map,i.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var u=n[i];if(!(u[rs]||u[Nt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var f=u.getAttribute(t)||"";f=e+f;var g=a.get(f);g?g.push(u):a.set(f,[u])}}return a}function Ah(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function gx(e,t,n){if(n===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 Dh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function yx(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=Zl(a.href),u=t.querySelector(Qs(i));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=go.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,xt(u);return}u=t.ownerDocument||t,a=zh(a),(i=pn.get(i))&&ac(a,i),u=u.createElement("link"),xt(u);var f=u;f._p=new Promise(function(g,N){f.onload=g,f.onerror=N}),wt(u,"link",a),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=go.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var sc=0;function vx(e,t){return e.stylesheets&&e.count===0&&vo(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&vo(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&sc===0&&(sc=62500*Iv());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&vo(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>sc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(i)}}:null}function go(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var yo=null;function vo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,yo=new Map,t.forEach(xx,e),yo=null,go.call(e))}function xx(e,t){if(!(t.state.loading&4)){var n=yo.get(e);if(n)var a=n.get(null);else{n=new Map,yo.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<i.length;u++){var f=i[u];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(n.set(f.dataset.precedence,f),a=f)}a&&n.set(null,a)}i=t.instance,f=i.getAttribute("data-precedence"),u=n.get(f)||a,u===a&&n.set(null,i),n.set(f,i),this.count++,a=go.bind(this),i.addEventListener("load",a),i.addEventListener("error",a),u?u.parentNode.insertBefore(i,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Zs={$$typeof:G,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function bx(e,t,n,a,i,u,f,g,N){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=a,this.onUncaughtError=i,this.onCaughtError=u,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function _h(e,t,n,a,i,u,f,g,N,O,H,K){return e=new bx(e,t,n,f,N,O,H,K,g),t=1,u===!0&&(t|=24),u=Jt(3,null,null,t),e.current=u,u.stateNode=e,t=Hr(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:a,isDehydrated:n,cache:t},Gr(u),e}function kh(e){return e?(e=El,e):El}function Rh(e,t,n,a,i,u){i=kh(i),a.context===null?a.context=i:a.pendingContext=i,a=va(t),a.payload={element:n},u=u===void 0?null:u,u!==null&&(a.callback=u),n=xa(e,a,t),n!==null&&(qt(n,e,t),Es(n,e,t))}function Uh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ic(e,t){Uh(e,t),(e=e.alternate)&&Uh(e,t)}function Bh(e){if(e.tag===13||e.tag===31){var t=Qa(e,67108864);t!==null&&qt(t,e,67108864),ic(e,67108864)}}function Hh(e){if(e.tag===13||e.tag===31){var t=en();t=Yn(t);var n=Qa(e,t);n!==null&&qt(n,e,t),ic(e,t)}}var xo=!0;function Sx(e,t,n,a){var i=z.T;z.T=null;var u=Z.p;try{Z.p=2,oc(e,t,n,a)}finally{Z.p=u,z.T=i}}function Nx(e,t,n,a){var i=z.T;z.T=null;var u=Z.p;try{Z.p=8,oc(e,t,n,a)}finally{Z.p=u,z.T=i}}function oc(e,t,n,a){if(xo){var i=rc(a);if(i===null)Zu(e,t,a,bo,n),Lh(e,a);else if(Cx(i,e,t,n,a))a.stopPropagation();else if(Lh(e,a),t&4&&-1<jx.indexOf(e)){for(;i!==null;){var u=hl(i);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var f=Fe(u.pendingLanes);if(f!==0){var g=u;for(g.pendingLanes|=2,g.entangledLanes|=2;f;){var N=1<<31-fe(f);g.entanglements[1]|=N,f&=~N}An(u),(Ke&6)===0&&(to=ot()+500,Ys(0))}}break;case 31:case 13:g=Qa(u,2),g!==null&&qt(g,u,2),ao(),ic(u,2)}if(u=rc(a),u===null&&Zu(e,t,a,bo,n),u===i)break;i=u}i!==null&&a.stopPropagation()}else Zu(e,t,a,null,n)}}function rc(e){return e=cr(e),uc(e)}var bo=null;function uc(e){if(bo=null,e=ml(e),e!==null){var t=m(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=p(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return bo=e,null}function qh(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 Hn:return 2;case qa:return 8;case wn:case Mn:return 32;case cl:return 268435456;default:return 32}default:return 32}}var cc=!1,Oa=null,Aa=null,Da=null,Ws=new Map,Js=new Map,_a=[],jx="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 Lh(e,t){switch(e){case"focusin":case"focusout":Oa=null;break;case"dragenter":case"dragleave":Aa=null;break;case"mouseover":case"mouseout":Da=null;break;case"pointerover":case"pointerout":Ws.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Js.delete(t.pointerId)}}function $s(e,t,n,a,i,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:u,targetContainers:[i]},t!==null&&(t=hl(t),t!==null&&Bh(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Cx(e,t,n,a,i){switch(t){case"focusin":return Oa=$s(Oa,e,t,n,a,i),!0;case"dragenter":return Aa=$s(Aa,e,t,n,a,i),!0;case"mouseover":return Da=$s(Da,e,t,n,a,i),!0;case"pointerover":var u=i.pointerId;return Ws.set(u,$s(Ws.get(u)||null,e,t,n,a,i)),!0;case"gotpointercapture":return u=i.pointerId,Js.set(u,$s(Js.get(u)||null,e,t,n,a,i)),!0}return!1}function Yh(e){var t=ml(e.target);if(t!==null){var n=m(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,os(e.priority,function(){Hh(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,os(e.priority,function(){Hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function So(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=rc(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);ur=a,n.target.dispatchEvent(a),ur=null}else return t=hl(n),t!==null&&Bh(t),e.blockedOn=n,!1;t.shift()}return!0}function Gh(e,t,n){So(e)&&n.delete(t)}function Ex(){cc=!1,Oa!==null&&So(Oa)&&(Oa=null),Aa!==null&&So(Aa)&&(Aa=null),Da!==null&&So(Da)&&(Da=null),Ws.forEach(Gh),Js.forEach(Gh)}function No(e,t){e.blockedOn===t&&(e.blockedOn=null,cc||(cc=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,Ex)))}var jo=null;function Kh(e){jo!==e&&(jo=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){jo===e&&(jo=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],i=e[t+2];if(typeof a!="function"){if(uc(a||n)===null)continue;break}var u=hl(n);u!==null&&(e.splice(t,3),t-=3,ru(u,{pending:!0,data:i,method:n.method,action:a},a,i))}}))}function Jl(e){function t(N){return No(N,e)}Oa!==null&&No(Oa,e),Aa!==null&&No(Aa,e),Da!==null&&No(Da,e),Ws.forEach(t),Js.forEach(t);for(var n=0;n<_a.length;n++){var a=_a[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<_a.length&&(n=_a[0],n.blockedOn===null);)Yh(n),n.blockedOn===null&&_a.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var i=n[a],u=n[a+1],f=i[_t]||null;if(typeof u=="function")f||Kh(n);else if(f){var g=null;if(u&&u.hasAttribute("formAction")){if(i=u,f=u[_t]||null)g=f.formAction;else if(uc(i)!==null)continue}else g=f.action;typeof g=="function"?n[a+1]=g:(n.splice(a,3),a-=3),Kh(n)}}}function Vh(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(f){return i=f})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function dc(e){this._internalRoot=e}Co.prototype.render=dc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,a=en();Rh(n,a,e,t,null,null)},Co.prototype.unmount=dc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Rh(e.current,2,null,e,null,null),ao(),t[fl]=null}};function Co(e){this._internalRoot=e}Co.prototype.unstable_scheduleHydration=function(e){if(e){var t=is();e={blockedOn:null,target:e,priority:t};for(var n=0;n<_a.length&&t!==0&&t<_a[n].priority;n++);_a.splice(n,0,e),n===0&&Yh(e)}};var Qh=s.version;if(Qh!=="19.2.1")throw Error(c(527,Qh,"19.2.1"));Z.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=S(t),e=e!==null?w(e):null,e=e===null?null:e.stateNode,e};var wx={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Eo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Eo.isDisabled&&Eo.supportsFiber)try{qn=Eo.inject(wx),W=Eo}catch{}}return Is.createRoot=function(e,t){if(!d(e))throw Error(c(299));var n=!1,a="",i=If,u=Pf,f=em;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=_h(e,1,!1,null,null,n,a,null,i,u,f,Vh),e[fl]=t.current,Xu(e),new dc(t)},Is.hydrateRoot=function(e,t,n){if(!d(e))throw Error(c(299));var a=!1,i="",u=If,f=Pf,g=em,N=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(g=n.onRecoverableError),n.formState!==void 0&&(N=n.formState)),t=_h(e,1,!0,t,n??null,a,i,N,u,f,g,Vh),t.context=kh(null),n=t.current,a=en(),a=Yn(a),i=va(a),i.callback=null,xa(n,i,a),n=a,t.current.lanes=n,yn(t,n),An(t),e[fl]=t.current,Xu(e),new Co(t)},Is.version="19.2.1",Is}var lp;function wb(){if(lp)return fc.exports;lp=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),fc.exports=Eb(),fc.exports}var Mb=wb();const zb="modulepreload",Tb=function(l){return"/"+l},sp={},At=function(s,r,c){let d=Promise.resolve();if(r&&r.length>0){let y=function(S){return Promise.all(S.map(w=>Promise.resolve(w).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),p=h?.nonce||h?.getAttribute("nonce");d=y(r.map(S=>{if(S=Tb(S),S in sp)return;sp[S]=!0;const w=S.endsWith(".css"),v=w?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${S}"]${v}`))return;const b=document.createElement("link");if(b.rel=w?"stylesheet":zb,w||(b.as="script"),b.crossOrigin="",b.href=S,p&&b.setAttribute("nonce",p),document.head.appendChild(b),w)return new Promise((_,A)=>{b.addEventListener("load",_),b.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${S}`)))})}))}function m(h){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=h,window.dispatchEvent(p),!p.defaultPrevented)throw h}return d.then(h=>{for(const p of h||[])p.status==="rejected"&&m(p.reason);return s().catch(m)})},Ob=new u0({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1,retry:1},mutations:{retry:!1}}}),Ab={theme:"system",setTheme:()=>null,isDark:!1},cg=x.createContext(Ab);function Db({children:l,defaultTheme:s="system",storageKey:r="vite-ui-theme"}){const[c,d]=x.useState(()=>localStorage.getItem(r)||s),[m,h]=x.useState(()=>typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches:!1);x.useEffect(()=>{const S=window.matchMedia("(prefers-color-scheme: dark)"),w=v=>{h(v.matches)};return S.addEventListener("change",w),()=>S.removeEventListener("change",w)},[]);const p=c==="dark"||c==="system"&&m;x.useEffect(()=>{const S=window.document.documentElement;S.classList.remove("light","dark"),S.classList.add(p?"dark":"light")},[p]);const y={theme:c,setTheme:S=>{localStorage.setItem(r,S),d(S)},isDark:p};return o.jsx(cg.Provider,{value:y,children:l})}const dg=x.createContext(null),ip="ccs-privacy-mode";function _b({children:l}){const[s,r]=x.useState(()=>typeof window<"u"?localStorage.getItem(ip)==="true":!1);x.useEffect(()=>{localStorage.setItem(ip,String(s))},[s]);const c=x.useCallback(()=>r(m=>!m),[]),d=x.useMemo(()=>({privacyMode:s,togglePrivacyMode:c}),[s,c]);return o.jsx(dg.Provider,{value:d,children:l})}function Rc(){const l=x.useContext(dg);if(!l)throw new Error("usePrivacy must be used within a PrivacyProvider");return l}const fg="blur-[4px] select-none hover:blur-none transition-all duration-200",pc=768;function kb(){const[l,s]=x.useState(void 0);return x.useEffect(()=>{const r=window.matchMedia(`(max-width: ${pc-1}px)`),c=()=>{s(window.innerWidth<pc)};return r.addEventListener("change",c),s(window.innerWidth<pc),()=>r.removeEventListener("change",c)},[]),!!l}const mg=x.createContext(null);function Xo(){const l=x.useContext(mg);if(!l)throw new Error("useSidebar must be used within a SidebarProvider.");return l}function V(...l){return f0(m0(l))}const op=["#f94144","#f3722c","#f8961e","#f9844a","#f9c74f","#90be6d","#43aa8b","#4d908e","#577590","#277da1"],Yt={success:"#15803d",degraded:"#b45309",failed:"#b91c1c"};function hC(l){let s=2166136261;for(let r=0;r<l.length;r++)s^=l.charCodeAt(r),s=Math.imul(s,16777619);return op[(s>>>0)%op.length]}const Oo=Ho("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 St({className:l,variant:s,size:r,asChild:c=!1,...d}){const m=c?Bo:"button";return o.jsx(m,{"data-slot":"button",className:V(Oo({variant:s,size:r,className:l})),...d})}function Ra({className:l,type:s,...r}){return o.jsx("input",{type:s,"data-slot":"input",className:V("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",l),...r})}function Rb({...l}){return o.jsx(kp,{"data-slot":"sheet",...l})}function Ub({...l}){return o.jsx(qp,{"data-slot":"sheet-portal",...l})}function Bb({className:l,...s}){return o.jsx(Lp,{"data-slot":"sheet-overlay",className:V("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",l),...s})}function Hb({className:l,children:s,side:r="right",...c}){return o.jsxs(Ub,{children:[o.jsx(Bb,{}),o.jsxs(Rp,{"data-slot":"sheet-content",className:V("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",r==="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",r==="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",r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",l),...c,children:[s,o.jsxs(Up,{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:[o.jsx(ui,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function qb({className:l,...s}){return o.jsx("div",{"data-slot":"sheet-header",className:V("flex flex-col gap-1.5 p-4",l),...s})}function Lb({className:l,...s}){return o.jsx(Bp,{"data-slot":"sheet-title",className:V("text-foreground font-semibold",l),...s})}function Yb({className:l,...s}){return o.jsx(Hp,{"data-slot":"sheet-description",className:V("text-muted-foreground text-sm",l),...s})}function Le({className:l,...s}){return o.jsx("div",{"data-slot":"skeleton",className:V("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",l),...s})}function Uc({delayDuration:l=0,...s}){return o.jsx(zx,{"data-slot":"tooltip-provider",delayDuration:l,...s})}function Zo({...l}){return o.jsx(Uc,{children:o.jsx(Tx,{"data-slot":"tooltip",...l})})}function Wo({...l}){return o.jsx(Ox,{"data-slot":"tooltip-trigger",...l})}function Jo({className:l,sideOffset:s=0,children:r,...c}){return o.jsx(Ax,{children:o.jsxs(Dx,{"data-slot":"tooltip-content",sideOffset:s,className:V("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",l),...c,children:[r,o.jsx(_x,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const Gb="sidebar_state",Kb=3600*24*7,Vb="16rem",Qb="18rem",Xb="3rem",Zb="b";function Wb({defaultOpen:l=!0,open:s,onOpenChange:r,className:c,style:d,children:m,...h}){const p=kb(),[y,S]=x.useState(!1),[w,v]=x.useState(l),b=s??w,_=x.useCallback(M=>{const Y=typeof M=="function"?M(b):M;r?r(Y):v(Y),document.cookie=`${Gb}=${Y}; path=/; max-age=${Kb}`},[r,b]),A=x.useCallback(()=>p?S(M=>!M):_(M=>!M),[p,_,S]);x.useEffect(()=>{const M=Y=>{Y.key===Zb&&(Y.metaKey||Y.ctrlKey)&&(Y.preventDefault(),A())};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[A]);const R=b?"expanded":"collapsed",B=x.useMemo(()=>({state:R,open:b,setOpen:_,isMobile:p,openMobile:y,setOpenMobile:S,toggleSidebar:A}),[R,b,_,p,y,S,A]);return o.jsx(mg.Provider,{value:B,children:o.jsx(Uc,{delayDuration:0,children:o.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Vb,"--sidebar-width-icon":Xb,...d},className:V("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",c),...h,children:m})})})}function Jb({side:l="left",variant:s="sidebar",collapsible:r="offcanvas",className:c,children:d,...m}){const{isMobile:h,state:p,openMobile:y,setOpenMobile:S}=Xo();return r==="none"?o.jsx("div",{"data-slot":"sidebar",className:V("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",c),...m,children:d}):h?o.jsx(Rb,{open:y,onOpenChange:S,...m,children:o.jsxs(Hb,{"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":Qb},side:l,children:[o.jsxs(qb,{className:"sr-only",children:[o.jsx(Lb,{children:"Sidebar"}),o.jsx(Yb,{children:"Displays the mobile sidebar."})]}),o.jsx("div",{className:"flex h-full w-full flex-col",children:d})]})}):o.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":p,"data-collapsible":p==="collapsed"?r:"","data-variant":s,"data-side":l,"data-slot":"sidebar",children:[o.jsx("div",{"data-slot":"sidebar-gap",className:V("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",s==="floating"||s==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),o.jsx("div",{"data-slot":"sidebar-container",className:V("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",l==="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)]",s==="floating"||s==="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",c),...m,children:o.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:d})})]})}function $b({className:l,onClick:s,...r}){const{toggleSidebar:c}=Xo();return o.jsxs(St,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:V("size-7",l),onClick:d=>{s?.(d),c()},...r,children:[o.jsx(Q0,{}),o.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Fb({className:l,...s}){return o.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:V("flex flex-col gap-2 p-2",l),...s})}function Ib({className:l,...s}){return o.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:V("flex flex-col gap-2 p-2",l),...s})}function Pb({className:l,...s}){return o.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:V("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",l),...s})}function eS({className:l,...s}){return o.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:V("relative flex w-full min-w-0 flex-col p-2",l),...s})}function tS({className:l,asChild:s=!1,...r}){const c=s?Bo:"div";return o.jsx(c,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:V("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",l),...r})}function nS({className:l,...s}){return o.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:V("w-full text-sm",l),...s})}function aS({className:l,...s}){return o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:V("flex w-full min-w-0 flex-col gap-1 group-data-[collapsible=icon]:items-center",l),...s})}function rp({className:l,...s}){return o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:V("group/menu-item relative",l),...s})}const lS=Ho("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 up({asChild:l=!1,isActive:s=!1,variant:r="default",size:c="default",tooltip:d,className:m,...h}){const p=l?Bo:"button",{isMobile:y,state:S}=Xo(),w=o.jsx(p,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":c,"data-active":s,className:V(lS({variant:r,size:c}),m),...h});return d?(typeof d=="string"&&(d={children:d}),o.jsxs(Zo,{children:[o.jsx(Wo,{asChild:!0,children:w}),o.jsx(Jo,{side:"right",align:"center",hidden:S!=="collapsed"||y,...d})]})):w}function sS({className:l,...s}){return o.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:V("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",l),...s})}function iS({className:l,...s}){return o.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:V("group/menu-sub-item relative",l),...s})}function oS({asChild:l=!1,size:s="md",isActive:r=!1,className:c,...d}){const m=l?Bo:"a";return o.jsx(m,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":s,"data-active":r,className:V("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",s==="sm"&&"text-xs",s==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",c),...d})}const rS={sm:24,md:32,lg:48};function hg({size:l="md",className:s,showText:r=!0}){const c=rS[l];return o.jsxs("div",{className:V("flex items-center gap-2",s),children:[o.jsx("img",{src:"/logo/ccs-logo-256.png",alt:"CCS Logo",width:c,height:c,className:"rounded"}),r&&o.jsx("span",{className:"font-bold text-lg",children:"CCS Config"})]})}const uS=kx,cS=Rx,dS=Ux,fS=[{title:"General",items:[{path:"/",icon:X0,label:"Home"},{path:"/analytics",icon:Z0,label:"Analytics"}]},{title:"Identity & Access",items:[{path:"/providers",icon:tg,label:"API Profiles",badge:{text:"OpenRouter",icon:"/icons/openrouter.svg"}},{path:"/cliproxy",icon:ng,label:"CLIProxy Plus",isCollapsible:!0,children:[{path:"/cliproxy",label:"Overview"},{path:"/cliproxy/control-panel",icon:W0,label:"Control Panel"}]},{path:"/copilot",icon:ag,label:"GitHub Copilot"},{path:"/accounts",icon:sg,label:"Accounts",isCollapsible:!0,children:[{path:"/accounts",label:"All Accounts"},{path:"/shared",icon:lg,label:"Shared Data"}]}]},{title:"System",items:[{path:"/health",icon:si,label:"Health"},{path:"/settings",icon:J0,label:"Settings"}]}];function mS(){const l=t0(),{state:s}=Xo(),r=d=>l.pathname===d,c=d=>d.some(m=>r(m.path)||l.pathname.startsWith(m.path+"/"));return o.jsxs(Jb,{collapsible:"icon",children:[o.jsx(Fb,{className:"h-12 flex items-center justify-center",children:o.jsx(hg,{size:"sm",showText:s==="expanded"})}),o.jsx(Pb,{children:fS.map((d,m)=>o.jsxs(eS,{children:[d.title&&o.jsx(tS,{children:d.title}),o.jsx(nS,{children:o.jsx(aS,{children:d.items.map(h=>o.jsx(rp,{children:h.isCollapsible&&h.children?o.jsx(uS,{defaultOpen:c(h.children)||r(h.path),className:"group/collapsible",children:o.jsxs(rp,{children:[o.jsx(cS,{asChild:!0,children:o.jsxs(up,{tooltip:h.label,children:[h.icon&&o.jsx(h.icon,{className:"w-4 h-4"}),o.jsx("span",{className:"group-data-[collapsible=icon]:hidden",children:h.label}),o.jsx(qo,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90 group-data-[collapsible=icon]:hidden"})]})}),o.jsx(dS,{children:o.jsx(sS,{children:h.children.map(p=>o.jsx(iS,{children:o.jsx(oS,{asChild:!0,isActive:r(p.path),children:o.jsx(wc,{to:p.path,children:o.jsx("span",{children:p.label})})})},p.path))})})]})}):o.jsx(up,{asChild:!0,isActive:r(h.path),tooltip:h.label,children:o.jsxs(wc,{to:h.path,children:[h.icon&&o.jsx(h.icon,{className:"w-4 h-4"}),o.jsx("span",{className:"group-data-[collapsible=icon]:hidden flex-1",children:h.label}),h.badge&&o.jsxs(Zo,{children:[o.jsx(Wo,{asChild:!0,children:o.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 ${r(h.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:[o.jsx("img",{src:h.badge.icon,alt:"",className:"w-3 h-3"}),o.jsx("span",{className:"hidden sm:inline",children:h.badge.text})]})}),o.jsx(Jo,{side:"right",children:o.jsx("p",{children:"349+ models via OpenRouter"})})]})]})})},h.path))})})]},d.title||m))}),o.jsx(Ib,{className:"p-4 border-t flex items-center justify-center",children:o.jsx($b,{})})]})}const pg=()=>{const l=x.useContext(cg);if(l===void 0)throw new Error("useTheme must be used within a ThemeProvider");return l};function hS(){const{theme:l,setTheme:s}=pg();return o.jsxs(St,{variant:"ghost",size:"icon",onClick:()=>s(l==="dark"?"light":"dark"),children:[o.jsx($0,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),o.jsx(F0,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),o.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}function pS(){const{privacyMode:l,togglePrivacyMode:s}=Rc();return o.jsxs(Zo,{children:[o.jsx(Wo,{asChild:!0,children:o.jsx(St,{variant:"ghost",size:"icon",onClick:s,className:V("h-8 w-8 transition-colors",l&&"text-amber-600 hover:text-amber-700 dark:text-amber-400"),children:l?o.jsx(Lo,{className:"h-4 w-4"}):o.jsx(Yo,{className:"h-4 w-4"})})}),o.jsx(Jo,{children:o.jsx("p",{children:l?"Privacy mode ON - Click to show data":"Privacy mode OFF - Click to hide data"})})]})}const gS="https://github.com/kaitranntt/ccs/issues";function yS(){return o.jsx(St,{variant:"ghost",size:"icon",asChild:!0,title:"Report an issue on GitHub",children:o.jsx("a",{href:gS,target:"_blank",rel:"noopener noreferrer",children:o.jsx(ag,{className:"w-4 h-4"})})})}const vS="https://docs.ccs.kaitran.ca";function xS(){return o.jsx(St,{variant:"ghost",size:"icon",asChild:!0,title:"View documentation",children:o.jsx("a",{href:vS,target:"_blank",rel:"noopener noreferrer",children:o.jsx(I0,{className:"w-4 h-4"})})})}function bS(){const[l,s]=x.useState("disconnected"),r=x.useRef(null),c=Gt(),d=x.useRef(0),m=5,h=x.useRef(null),p=x.useRef(()=>{}),y=x.useCallback(v=>{switch(v.type){case"connected":console.log("[WS] Server acknowledged connection");break;case"config-changed":c.invalidateQueries({queryKey:["profiles"]}),c.invalidateQueries({queryKey:["cliproxy"]}),Ce.info("Configuration updated externally");break;case"settings-changed":c.invalidateQueries({queryKey:["profiles"]}),Ce.info("Settings file updated");break;case"profiles-changed":c.invalidateQueries({queryKey:["accounts"]}),Ce.info("Accounts updated");break;case"proxy-status-changed":c.invalidateQueries({queryKey:["proxy-status"]});break;case"pong":break;default:console.log(`[WS] Unknown message: ${v.type}`)}},[c]),S=x.useCallback(()=>{if(r.current?.readyState===WebSocket.OPEN)return;s("connecting");const v=new WebSocket(`ws://${window.location.host}`);r.current=v,v.onopen=()=>{s("connected"),d.current=0,console.log("[WS] Connected")},v.onmessage=b=>{try{const _=JSON.parse(b.data);y(_),window.dispatchEvent(new CustomEvent("ws-message",{detail:_}))}catch{console.log("[WS] Invalid message")}},v.onclose=()=>{if(s("disconnected"),r.current=null,d.current<m){const b=Math.min(1e3*Math.pow(2,d.current),3e4);d.current++,console.log(`[WS] Reconnecting in ${b}ms (attempt ${d.current})`),h.current=setTimeout(()=>{p.current()},b)}},v.onerror=()=>{console.log("[WS] Connection error")}},[y]);p.current=S;const w=x.useCallback(()=>{d.current=m,h.current&&(clearTimeout(h.current),h.current=null),r.current?.close()},[]);return x.useEffect(()=>(p.current(),()=>w()),[]),x.useEffect(()=>{const v=setInterval(()=>{r.current?.readyState===WebSocket.OPEN&&r.current.send(JSON.stringify({type:"ping"}))},3e4);return()=>clearInterval(v)},[]),x.useMemo(()=>({status:l,connect:S,disconnect:w}),[l,S,w])}function SS(){const{status:l}=bS(),r={connected:{icon:Xh,color:"text-green-600",label:"Connected"},connecting:{icon:Xh,color:"text-yellow-500",label:"Connecting..."},disconnected:{icon:P0,color:"text-red-500",label:"Disconnected"}}[l],c=r.icon;return o.jsxs("div",{className:`flex items-center gap-1 text-sm ${r.color}`,children:[o.jsx(c,{className:"w-4 h-4"}),o.jsx("span",{className:"hidden sm:inline",children:r.label})]})}function NS(){const[l,s]=x.useState(!1);return l?null:o.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:o.jsxs("div",{className:"flex items-center justify-center gap-4",children:[o.jsxs("div",{className:"flex items-center gap-2 text-sm text-yellow-800 dark:text-yellow-200",children:[o.jsx(eb,{className:"w-4 h-4 flex-shrink-0"}),o.jsx("span",{className:"hidden sm:inline",children:"This dashboard runs locally. All data stays on your machine."}),o.jsx("span",{className:"sm:hidden",children:"Local dashboard - data stays on your device."})]}),o.jsx("button",{onClick:()=>s(!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:o.jsx(ui,{className:"w-4 h-4"})})]})})}const jS="https://claudekit.cc?ref=HMNKXOHN";function CS(){return o.jsxs("a",{href:jS,target:"_blank",rel:"noopener noreferrer",className:V("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:[o.jsx("img",{src:"/logos/claudekit-logo.png",alt:"ClaudeKit",className:"w-5 h-5"}),o.jsxs("span",{className:"flex items-baseline gap-1.5 whitespace-nowrap",children:[o.jsx("span",{className:V("text-[10px] font-medium uppercase tracking-wide","text-muted-foreground group-hover:text-accent-foreground/80","transition-colors"),children:"Powered by"}),o.jsx("span",{className:V("text-xs font-bold text-foreground","group-hover:text-accent-foreground","transition-colors"),children:"ClaudeKit"})]})]})}const ES="https://github.com/sponsors/kaitranntt";function wS(){return o.jsxs("a",{href:ES,target:"_blank",rel:"noopener noreferrer",className:V("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:[o.jsx(tb,{className:V("w-4 h-4 text-pink-500","group-hover:text-white group-hover:fill-white","group-hover:animate-pulse","transition-colors")}),o.jsx("span",{className:V("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 Bc({...l}){return o.jsx(kp,{"data-slot":"dialog",...l})}function MS({...l}){return o.jsx(qp,{"data-slot":"dialog-portal",...l})}function zS({className:l,...s}){return o.jsx(Lp,{"data-slot":"dialog-overlay",className:V("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",l),...s})}function Hc({className:l,children:s,showCloseButton:r=!0,...c}){return o.jsxs(MS,{"data-slot":"dialog-portal",children:[o.jsx(zS,{}),o.jsxs(Rp,{"data-slot":"dialog-content",className:V("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",l),...c,children:[s,r&&o.jsxs(Up,{"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:[o.jsx(ui,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function qc({className:l,...s}){return o.jsx("div",{"data-slot":"dialog-header",className:V("flex flex-col gap-2 text-center sm:text-left",l),...s})}function TS({className:l,...s}){return o.jsx("div",{"data-slot":"dialog-footer",className:V("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",l),...s})}function Lc({className:l,...s}){return o.jsx(Bp,{"data-slot":"dialog-title",className:V("text-lg leading-none font-semibold",l),...s})}function Yc({className:l,...s}){return o.jsx(Hp,{"data-slot":"dialog-description",className:V("text-muted-foreground text-sm",l),...s})}function OS({open:l,onClose:s,sessionId:r,provider:c,projects:d,defaultProjectId:m,supportsAll:h,onSelect:p,timeoutSeconds:y=30}){const[S,w]=x.useState(m),[v,b]=x.useState(!1),[_,A]=x.useState(y);x.useEffect(()=>{if(!l){A(y);return}const M=setInterval(()=>{A(Y=>Y<=1?(clearInterval(M),R(!0),0):Y-1)},1e3);return()=>clearInterval(M)},[l,y]),x.useEffect(()=>{l&&(w(m),b(!1),A(y))},[l,m,y]);const R=async(M=!1)=>{if(!v){b(!0);try{await p(M?"":S),s()}catch(Y){console.error("Failed to submit project selection:",Y);try{await p("")}catch{}s()}}},B=c.charAt(0).toUpperCase()+c.slice(1);return o.jsx(Bc,{open:l,onOpenChange:M=>!M&&!v&&s(),children:o.jsxs(Hc,{className:"sm:max-w-lg",children:[o.jsxs(qc,{children:[o.jsxs(Lc,{className:"flex items-center gap-2",children:[o.jsx(lg,{className:"w-5 h-5"}),"Select Google Cloud Project"]}),o.jsxs(Yc,{children:["Choose which project to use for ",B," authentication.",_>0&&o.jsxs("span",{className:"text-muted-foreground ml-1",children:["(Auto-selecting default in ",_,"s)"]})]})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsxs("div",{className:"space-y-2",children:[d.map(M=>o.jsxs("div",{className:`flex items-center space-x-3 p-3 rounded-lg border cursor-pointer transition-colors ${S===M.id?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>!v&&w(M.id),children:[S===M.id?o.jsx(Zh,{className:"w-5 h-5 text-primary"}):o.jsx(Wh,{className:"w-5 h-5 text-muted-foreground"}),o.jsxs("div",{className:"flex-1",children:[o.jsx("div",{className:"font-medium",children:M.name}),o.jsx("div",{className:"text-sm text-muted-foreground font-mono",children:M.id})]}),M.id===m&&o.jsx("span",{className:"text-xs px-2 py-1 bg-secondary rounded",children:"Default"})]},M.id)),h&&o.jsxs("div",{className:`flex items-center space-x-3 p-3 rounded-lg border cursor-pointer transition-colors ${S==="ALL"?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>!v&&w("ALL"),children:[S==="ALL"?o.jsx(Zh,{className:"w-5 h-5 text-primary"}):o.jsx(Wh,{className:"w-5 h-5 text-muted-foreground"}),o.jsxs("div",{className:"flex-1",children:[o.jsx("div",{className:"font-medium",children:"All Projects"}),o.jsxs("div",{className:"text-sm text-muted-foreground",children:["Onboard all ",d.length," listed projects"]})]})]})]}),o.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[o.jsx(St,{variant:"ghost",onClick:()=>R(!0),disabled:v,children:"Use Default"}),o.jsx(St,{onClick:()=>R(!1),disabled:v,children:v?o.jsxs(o.Fragment,{children:[o.jsx(ci,{className:"w-4 h-4 mr-2 animate-spin"}),"Selecting..."]}):o.jsxs(o.Fragment,{children:[o.jsx(es,{className:"w-4 h-4 mr-2"}),"Confirm Selection"]})})]})]})]})})}const AS={ghcp:"GitHub Copilot",qwen:"Qwen Code"},DS={ghcp:"Sign in with your GitHub account that has Copilot access.",qwen:"Sign in with your Qwen account to authorize access."};function _S({open:l,onClose:s,sessionId:r,provider:c,userCode:d,verificationUrl:m,expiresAt:h}){const[p,y]=x.useState(!1),[S,w]=x.useState(null);x.useEffect(()=>{if(!l)return;let M=null;const Y=()=>{const G=Math.max(0,Math.floor((h-Date.now())/1e3));w(G),G===0&&M&&(clearInterval(M),M=null)};return Y(),M=setInterval(Y,1e3),()=>{M&&clearInterval(M)}},[l,h]);const v=x.useCallback(async()=>{try{await navigator.clipboard.writeText(d),y(!0),Ce.success("Code copied to clipboard"),setTimeout(()=>y(!1),2e3)}catch{Ce.error("Failed to copy code")}},[d]),b=x.useCallback(()=>{window.open(m,"_blank","noopener,noreferrer")},[m]),_=AS[c]||c,A=DS[c]||"Complete the authorization in your browser.",R=M=>{const Y=Math.floor(M/60),G=M%60;return`${Y}:${G.toString().padStart(2,"0")}`},B=S===0;return o.jsx(Bc,{open:l,onOpenChange:M=>!M&&s(),children:o.jsxs(Hc,{className:"sm:max-w-md","data-session-id":r,children:[o.jsxs(qc,{children:[o.jsxs(Lc,{className:"flex items-center gap-2",children:[o.jsx(ig,{className:"w-5 h-5"}),"Authorize ",_]}),o.jsxs(Yc,{children:["Enter the code below at the authorization page.",S!==null&&S>0&&o.jsxs("span",{className:"text-muted-foreground ml-1",children:["(Expires in ",R(S),")"]}),B&&o.jsx("span",{className:"text-destructive ml-1 font-medium",children:"(Code expired)"})]})]}),o.jsxs("div",{className:"space-y-6 py-4",children:[o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:"bg-muted rounded-lg p-6 text-center",children:o.jsx("div",{className:"text-4xl font-mono font-bold tracking-[0.3em] text-foreground select-all",children:d})}),o.jsx(St,{variant:"outline",size:"icon",className:"absolute top-2 right-2",onClick:v,"aria-label":p?"Code copied":"Copy verification code",children:p?o.jsx(es,{className:"h-4 w-4 text-green-500"}):o.jsx(_o,{className:"h-4 w-4"})})]}),o.jsx("div",{className:"text-sm text-muted-foreground text-center",children:o.jsx("p",{children:A})}),o.jsxs("div",{className:"flex flex-col gap-3",children:[o.jsxs(St,{onClick:b,className:"w-full",children:[o.jsx(og,{className:"w-4 h-4 mr-2"}),"Open ",_.split(" ")[0]]}),o.jsx(St,{variant:"outline",onClick:v,className:"w-full",children:p?o.jsxs(o.Fragment,{children:[o.jsx(es,{className:"w-4 h-4 mr-2 text-green-500"}),"Copied!"]}):o.jsxs(o.Fragment,{children:[o.jsx(_o,{className:"w-4 h-4 mr-2"}),"Copy Code"]})})]}),o.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[o.jsx(ci,{className:"h-4 w-4 animate-spin"}),o.jsx("span",{children:"Waiting for authorization..."})]})]})]})})}function kS(){const[l,s]=x.useState({isOpen:!1,prompt:null});x.useEffect(()=>{const d=m=>{const h=m.detail;h.type==="projectSelectionRequired"?(console.log("[ProjectSelection] Received prompt:",h.sessionId),s({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),s(p=>p.prompt?.sessionId===h.sessionId?{isOpen:!1,prompt:null}:p)):h.type==="projectSelectionSubmitted"&&(console.log("[ProjectSelection] Submitted:",h.sessionId),s(p=>p.prompt?.sessionId===h.sessionId?{isOpen:!1,prompt:null}:p))};return window.addEventListener("ws-message",d),()=>{window.removeEventListener("ws-message",d)}},[]);const r=x.useCallback(async d=>{if(!l.prompt)return;if(!(await fetch(`/api/cliproxy/auth/project-selection/${l.prompt.sessionId}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({selectedId:d})})).ok)throw new Error("Failed to submit project selection")},[l.prompt]),c=x.useCallback(()=>{s({isOpen:!1,prompt:null})},[]);return x.useMemo(()=>({isOpen:l.isOpen,prompt:l.prompt,onSelect:r,onClose:c}),[l.isOpen,l.prompt,r,c])}const gc={ghcp:"GitHub Copilot",qwen:"Qwen Code"};function RS(){const[l,s]=x.useState({isOpen:!1,prompt:null,error:null});x.useEffect(()=>{const m=h=>{const p=h.detail;if(p.type==="deviceCodeReceived"){console.log("[DeviceCode] Received prompt:",p.sessionId);const y=gc[p.provider]||p.provider;Ce.info(`${y} authorization required`),s({isOpen:!0,prompt:{sessionId:p.sessionId,provider:p.provider,userCode:p.userCode,verificationUrl:p.verificationUrl,expiresAt:p.expiresAt},error:null})}else p.type==="deviceCodeCompleted"?(console.log("[DeviceCode] Auth completed:",p.sessionId),s(y=>{if(y.prompt&&y.prompt.sessionId===p.sessionId){const S=gc[y.prompt.provider]||y.prompt.provider;return Ce.success(`${S} authentication successful!`),{isOpen:!1,prompt:null,error:null}}return y})):p.type==="deviceCodeFailed"?(console.log("[DeviceCode] Auth failed:",p.sessionId,p.error),s(y=>{if(y.prompt&&y.prompt.sessionId===p.sessionId){const S=gc[y.prompt.provider]||y.prompt.provider;return Ce.error(`${S} authentication failed`),{isOpen:!1,prompt:null,error:p.error}}return y})):p.type==="deviceCodeExpired"&&(console.log("[DeviceCode] Code expired:",p.sessionId),s(y=>y.prompt?.sessionId===p.sessionId?(Ce.error("Device code expired. Please try again."),{isOpen:!1,prompt:null,error:"Device code expired"}):y))};return window.addEventListener("ws-message",m),()=>{window.removeEventListener("ws-message",m)}},[]);const r=x.useCallback(()=>{s({isOpen:!1,prompt:null,error:null})},[]),c=x.useCallback(()=>{l.prompt?.verificationUrl&&window.open(l.prompt.verificationUrl,"_blank","noopener,noreferrer")},[l.prompt]),d=x.useCallback(async()=>{if(l.prompt?.userCode)try{await navigator.clipboard.writeText(l.prompt.userCode),Ce.success("Code copied to clipboard")}catch{Ce.error("Failed to copy code")}},[l.prompt]);return x.useMemo(()=>({isOpen:l.isOpen,prompt:l.prompt,error:l.error,onClose:r,onOpenUrl:c,onCopyCode:d}),[l.isOpen,l.prompt,l.error,r,c,d])}function US(){return o.jsxs("div",{className:"p-6 space-y-4",children:[o.jsx(Le,{className:"h-8 w-48"}),o.jsx(Le,{className:"h-64 w-full"})]})}function BS(){const{isOpen:l,prompt:s,onSelect:r,onClose:c}=kS(),d=RS();return o.jsxs(Wb,{children:[o.jsx(mS,{}),o.jsxs("main",{className:"flex-1 flex flex-col min-h-0 overflow-hidden bg-background",children:[o.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:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(CS,{}),o.jsx(wS,{})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(SS,{}),o.jsx(xS,{}),o.jsx(yS,{}),o.jsx(pS,{}),o.jsx(hS,{})]})]}),o.jsx("div",{className:"flex-1 overflow-auto min-h-0",children:o.jsx(x.Suspense,{fallback:o.jsx(US,{}),children:o.jsx(n0,{})})}),o.jsx(NS,{})]}),s&&o.jsx(OS,{open:l,onClose:c,sessionId:s.sessionId,provider:s.provider,projects:s.projects,defaultProjectId:s.defaultProjectId,supportsAll:s.supportsAll,onSelect:r}),d.prompt&&o.jsx(_S,{open:d.isOpen,onClose:d.onClose,sessionId:d.prompt.sessionId,provider:d.prompt.provider,userCode:d.prompt.userCode,verificationUrl:d.prompt.verificationUrl,expiresAt:d.prompt.expiresAt})]})}const HS=Ho("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 Ha({className:l,variant:s,...r}){return o.jsx("div",{className:V(HS({variant:s}),l),...r})}function qS({version:l="5.0.0"}){return o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(hg,{size:"lg",showText:!1}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("h1",{className:"text-2xl font-bold",children:"CCS Config"}),o.jsxs(Ha,{variant:"outline",className:"font-mono text-xs",children:["v",l]})]}),o.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Claude Code Switch Dashboard"})]})]})}const LS={gemini:"/assets/providers/gemini-color.svg",agy:"/assets/providers/agy.png",codex:"/assets/providers/openai.svg",qwen:"/assets/providers/qwen-color.svg",kiro:"/assets/providers/kiro.png",ghcp:"/assets/providers/copilot.svg"},ko={gemini:"#4285F4",agy:"#f3722c",codex:"#10a37f",vertex:"#4285F4",iflow:"#f94144",qwen:"#6236FF",kiro:"#4d908e",ghcp:"#43aa8b"},YS={gemini:"Gemini",agy:"Antigravity",codex:"Codex",vertex:"Vertex AI",iflow:"iFlow",qwen:"Qwen",kiro:"Kiro (AWS)",ghcp:"GitHub Copilot (OAuth)"};function GS(l){return YS[l.toLowerCase()]||l}const KS=100,cp=["#3b3c36","#568203","#8d4557","#da9100","#3c6c82","#c96907"];function VS(l){return cp[l%cp.length]}function gg(l){return l.replace(/@(gmail|yahoo|hotmail|outlook|icloud)\.com$/i,"")}function QS(l){const r=new Date().getTime()-l.getTime(),c=Math.floor(r/6e4);if(c<1)return"now";if(c<60)return`${c}m`;const d=Math.floor(c/60);return d<24?`${d}h`:`${Math.floor(d/24)}d`}function XS(l){const s=[];return l.forEach(r=>{const c=r.lastUsedAt?new Date(r.lastUsedAt):new Date,d=(m,h)=>{for(let p=0;p<m;p++){const y=Math.floor(Math.random()*24*60*60*1e3*(p/(m||1))),S=new Date(c.getTime()-y),w=Math.floor((Math.random()-.5)*10*60*1e3);S.setTime(S.getTime()+w);const v=new Date;S>v&&S.setTime(v.getTime()),s.push({id:`${r.id}-${h}-${p}`,timestamp:S,accountEmail:r.email,status:h,latencyMs:h==="success"?50+Math.floor(Math.random()*150):200+Math.floor(Math.random()*4800)})}};d(r.successCount,"success"),d(r.failureCount,"failed")}),s.sort((r,c)=>c.timestamp.getTime()-r.timestamp.getTime())}function ZS({containerRef:l,svgRef:s,accounts:r}){if(!l.current||!s.current)return[];const c=l.current,m=s.current.getBoundingClientRect(),h=c.querySelector("[data-provider-node]");if(!h)return[];const p=h.getBoundingClientRect(),y=[];return r.forEach((S,w)=>{const v=c.querySelector(`[data-account-index="${w}"]`);if(!v)return;const b=v.getBoundingClientRect(),_=v.getAttribute("data-zone")||"left";let A,R,B,M;switch(_){case"right":A=b.left-m.left,R=b.top+b.height/2-m.top,B=p.right-m.left,M=p.top+p.height/2-m.top;break;case"top":A=b.left+b.width/2-m.left,R=b.bottom-m.top,B=p.left+p.width/2-m.left,M=p.top-m.top;break;case"bottom":A=b.left+b.width/2-m.left,R=b.top-m.top,B=p.left+p.width/2-m.left,M=p.bottom-m.top;break;default:A=b.right-m.left,R=b.top+b.height/2-m.top,B=p.left-m.left,M=p.top+p.height/2-m.top}let Y,G,Q,k;_==="top"||_==="bottom"?(Y=A,G=R+(M-R)*.5,Q=B,k=M-(M-R)*.5):(Y=A+(B-A)*.5,G=R,Q=B-(B-A)*.5,k=M),y.push(`M ${A} ${R} C ${Y} ${G}, ${Q} ${k}, ${B} ${M}`)}),y}function WS(l){const s=l.length;if(s<=2)return{leftAccounts:l,rightAccounts:[],topAccounts:[],bottomAccounts:[]};if(s<=4){const c=Math.ceil(s/2);return{leftAccounts:l.slice(0,c),rightAccounts:l.slice(c),topAccounts:[],bottomAccounts:[]}}if(s<=8){const c=Math.ceil(s/3);return{leftAccounts:l.slice(0,c),rightAccounts:l.slice(c,c*2),topAccounts:l.slice(c*2),bottomAccounts:[]}}const r=Math.ceil(s/4);return{leftAccounts:l.slice(0,r),rightAccounts:l.slice(r,r*2),topAccounts:l.slice(r*2,r*3),bottomAccounts:l.slice(r*3)}}function JS(l){return l>=9?"w-64":l>=5?"w-60":l>=3?"w-56":"w-52"}function $S({storageKey:l,onDrag:s}){const[r,c]=x.useState(null),d=x.useRef(null),m=x.useRef(!1),h=x.useCallback(()=>{try{const A=localStorage.getItem(l);if(A)return JSON.parse(A)}catch{}return{}},[l]),[p,y]=x.useState(()=>h());x.useEffect(()=>{Object.keys(p).length>0&&localStorage.setItem(l,JSON.stringify(p))},[p,l]);const S=x.useCallback(()=>{y({}),localStorage.removeItem(l)},[l]),w=x.useCallback((A,R)=>{R.preventDefault(),R.stopPropagation(),R.target.setPointerCapture(R.pointerId);const B=p[A]||{x:0,y:0};d.current={x:R.clientX,y:R.clientY,offsetX:B.x,offsetY:B.y},m.current=!1,c(A)},[p]),v=x.useCallback(A=>{if(!r||!d.current)return;const R=d.current,B=A.clientX-R.x,M=A.clientY-R.y;(Math.abs(B)>3||Math.abs(M)>3)&&(m.current=!0),y(Y=>({...Y,[r]:{x:R.offsetX+B,y:R.offsetY+M}})),s&&requestAnimationFrame(s)},[r,s]),b=x.useCallback(()=>{c(null),d.current=null},[]);return{dragOffsets:p,draggingId:r,didDragRef:m,handlePointerDown:w,handlePointerMove:v,handlePointerUp:b,getOffset:A=>p[A]||{x:0,y:0},resetPositions:S,hasCustomPositions:Object.keys(p).length>0}}function FS(l){let s=0,r=0;return Object.values(l).forEach(c=>{s=Math.min(s,c.y),r=Math.max(r,c.y)}),{paddingTop:Math.max(0,-s),paddingBottom:Math.max(0,r),extraHeight:Math.max(0,Math.abs(s),Math.abs(r))*2}}function IS(l){const[s,r]=x.useState(new Set),c=x.useRef({});return x.useEffect(()=>{const d=new Set,m={};if(l.forEach(h=>{const p=h.successCount+h.failureCount;m[h.id]=p;const y=c.current[h.id];y!==void 0&&p>y&&d.add(h.id)}),c.current=m,d.size>0){r(d);const h=setTimeout(()=>r(new Set),2e3);return()=>clearTimeout(h)}},[l]),s}function PS({events:l,privacyMode:s}){return l.length===0?o.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:o.jsx("div",{className:"text-xs text-muted-foreground font-mono",children:"No recent connections"})}):o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3 px-2",children:[o.jsx(si,{className:"w-3.5 h-3.5 text-muted-foreground"}),o.jsx("span",{className:"text-[10px] text-muted-foreground font-medium uppercase tracking-wider",children:"Connection Timeline"})]}),o.jsx("div",{className:V("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:o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:"absolute left-[7px] top-2 bottom-2 w-px bg-border/50 dark:bg-white/[0.08]"}),o.jsx("div",{className:"space-y-3",children:l.map(r=>{const c=r.status==="success"?Yt.success:r.status==="failed"?Yt.failed:Yt.degraded;return o.jsxs("div",{className:"relative flex items-start gap-3 pl-1",children:[o.jsx("div",{className:V("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:c}}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx("span",{className:V("text-[10px] font-mono text-foreground truncate",s&&fg),children:gg(r.accountEmail)}),o.jsx("span",{className:"text-[9px] text-muted-foreground font-mono flex-shrink-0",children:QS(r.timestamp)})]}),o.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[o.jsx("span",{className:"text-[9px] font-medium uppercase",style:{color:c},children:r.status}),r.latencyMs&&o.jsxs("span",{className:"text-[9px] text-muted-foreground font-mono",children:[r.latencyMs,"ms"]})]})]})]},r.id)})})]})})]})}function e1({success:l,failure:s,showDetails:r}){const c=l+s,d=c>0?l/c*100:100;return o.jsxs("div",{className:"mt-2 space-y-2",children:[o.jsxs("div",{className:"flex items-end justify-between px-0.5",children:[o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:"text-[8px] text-muted-foreground/70 uppercase font-bold tracking-tight",children:"Success Rate"}),o.jsxs("span",{className:V("text-sm font-mono font-bold leading-none mt-0.5",d===100?"text-emerald-600 dark:text-emerald-400":d>=90?"text-amber-500":"text-red-500"),children:[Math.round(d),"%"]})]}),o.jsxs("div",{className:"flex flex-col items-end",children:[o.jsx("span",{className:"text-[8px] text-muted-foreground/70 uppercase font-bold tracking-tight",children:"Volume"}),o.jsx("span",{className:"text-xs font-mono font-medium text-foreground/80 leading-none mt-0.5",children:c.toLocaleString()})]})]}),o.jsxs("div",{className:V("grid grid-cols-2 gap-2 overflow-hidden transition-all duration-300 ease-in-out",r?"max-h-20 opacity-100 mt-2":"max-h-0 opacity-0 mt-0"),children:[o.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:[o.jsx(Go,{className:"w-2.5 h-2.5 text-emerald-600 dark:text-emerald-400"}),o.jsx("span",{className:"text-[10px] font-mono font-bold text-emerald-600 dark:text-emerald-400",children:l})]}),o.jsxs("div",{className:V("flex items-center gap-1.5 px-1.5 py-1 rounded-md border",s>0?"bg-red-500/5 dark:bg-red-500/10 border-red-500/20":"bg-muted/10 border-transparent opacity-40"),children:[o.jsx(Ac,{className:V("w-2.5 h-2.5",s>0?"text-red-500":"text-muted-foreground")}),o.jsx("span",{className:V("text-[10px] font-mono font-bold",s>0?"text-red-500":"text-muted-foreground"),children:s})]})]})]})}const t1={left:"border-l-2",right:"border-r-2",top:"border-t-2",bottom:"border-b-2"},n1={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 a1(l,s){switch(l){case"left":return{borderLeftColor:s};case"right":return{borderRightColor:s};case"top":return{borderTopColor:s};case"bottom":return{borderBottomColor:s}}}function l1({account:l,zone:s,originalIndex:r,isHovered:c,isDragging:d,offset:m,showDetails:h,privacyMode:p,onMouseEnter:y,onMouseLeave:S,onPointerDown:w,onPointerMove:v,onPointerUp:b}){const _=t1[s],A=a1(s,l.color),R=n1[s];return o.jsxs("div",{"data-account-index":r,"data-zone":s,onMouseEnter:y,onMouseLeave:S,onPointerDown:w,onPointerMove:v,onPointerUp:b,onPointerCancel:b,className:V("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]",_,"select-none touch-none",c&&"bg-muted/50 dark:bg-zinc-800/60",d&&"cursor-grabbing shadow-xl scale-105 z-50"),style:{...A,transform:`translate(${m.x}px, ${m.y}px)${d?" scale(1.05)":""}`},children:[o.jsx(Ko,{className:"absolute top-2 right-2 w-4 h-4 text-muted-foreground/40"}),o.jsx("div",{className:"flex justify-between items-start mb-1 mr-4",children:o.jsx("span",{className:V("text-xs font-semibold text-foreground tracking-tight truncate max-w-[100px]",p&&fg),children:gg(l.email)})}),o.jsx(e1,{success:l.successCount,failure:l.failureCount,showDetails:h}),o.jsx("div",{className:V("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",R,c&&"bg-foreground dark:bg-white border-transparent")})]})}function Gc({provider:l,className:s,size:r=18,withBackground:c=!1}){const d=l.toLowerCase(),m=LS[d],h=c?Math.floor(r*.65):r,p=m?o.jsx("img",{src:m,alt:`${l} icon`,width:h,height:h,className:"shrink-0 object-contain"}):o.jsx("span",{className:"font-bold",style:{color:ko[d]||"#6b7280",fontSize:h*.6},children:l.charAt(0).toUpperCase()});if(c)return o.jsx("div",{className:V("shrink-0 rounded-full bg-white border border-border flex items-center justify-center shadow-sm",s),style:{width:r,height:r},children:p});if(m)return o.jsx("img",{src:m,alt:`${l} icon`,width:r,height:r,className:V("shrink-0 rounded-sm object-contain",s)});const y=ko[d]||"#6b7280";return o.jsx("div",{className:V("shrink-0 rounded-full flex items-center justify-center text-white font-bold",s),style:{width:r,height:r,backgroundColor:y,fontSize:r*.5},children:l.charAt(0).toUpperCase()})}function s1({providerData:l,providerColor:s,totalRequests:r,maxRequests:c,isDragging:d,offset:m,hoveredAccount:h,hasRightAccounts:p,hasTopAccounts:y,hasBottomAccounts:S,onPointerDown:w,onPointerMove:v,onPointerUp:b}){const{accounts:_}=l;return o.jsxs("div",{"data-provider-node":!0,onPointerDown:w,onPointerMove:v,onPointerUp:b,onPointerCancel:b,className:V("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]",!d&&"animate-subtle-float animate-border-glow","select-none touch-none",h!==null&&"scale-[1.02]",d&&"cursor-grabbing shadow-2xl scale-105 z-50"),style:{"--glow-color":`${s}60`,borderColor:h!==null?`${s}80`:void 0,transform:`translate(${m.x}px, ${m.y}px)${d?" scale(1.05)":""}`},children:[o.jsx(Ko,{className:"absolute top-2 right-2 w-4 h-4 text-muted-foreground/40"}),o.jsx("div",{className:"absolute inset-0 rounded-xl animate-glow-pulse pointer-events-none",style:{"--glow-color":`${s}30`}}),o.jsx("div",{className:"absolute top-1/2 -left-1.5 w-3 h-3 rounded-full transform -translate-y-1/2",style:{backgroundColor:s,boxShadow:"0 0 0 4px var(--background)"}}),p&&o.jsx("div",{className:"absolute top-1/2 -right-1.5 w-3 h-3 rounded-full transform -translate-y-1/2",style:{backgroundColor:s,boxShadow:"0 0 0 4px var(--background)"}}),y&&o.jsx("div",{className:"absolute left-1/2 -top-1.5 w-3 h-3 rounded-full transform -translate-x-1/2",style:{backgroundColor:s,boxShadow:"0 0 0 4px var(--background)"}}),S&&o.jsx("div",{className:"absolute left-1/2 -bottom-1.5 w-3 h-3 rounded-full transform -translate-x-1/2",style:{backgroundColor:s,boxShadow:"0 0 0 4px var(--background)"}}),o.jsxs("div",{className:"flex items-center gap-3 mb-4 relative z-10",children:[o.jsx("div",{className:"animate-icon-breathe",children:o.jsx(Gc,{provider:l.provider,size:36,withBackground:!0})}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-sm font-semibold text-foreground tracking-tight",children:l.displayName}),o.jsx("p",{className:"text-[10px] text-muted-foreground font-medium uppercase",children:"Provider"})]})]}),o.jsxs("div",{className:"space-y-2 relative z-10",children:[o.jsxs("div",{className:"flex justify-between items-center text-xs",children:[o.jsx("span",{className:"text-muted-foreground",children:"Total Requests"}),o.jsx("span",{className:"text-foreground font-mono",children:r.toLocaleString()})]}),o.jsxs("div",{className:"flex justify-between items-center text-xs",children:[o.jsx("span",{className:"text-muted-foreground",children:"Accounts"}),o.jsx("span",{className:"text-foreground font-mono",children:_.length})]}),o.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full mt-2 overflow-hidden",children:o.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.min(100,r/(c*_.length)*100)}%`,backgroundColor:s}})})]})]})}function i1({paths:l,accounts:s,maxRequests:r,hoveredAccount:c,pulsingAccounts:d}){return o.jsxs(o.Fragment,{children:[o.jsx("defs",{children:o.jsxs("filter",{id:"flow-glow",x:"-20%",y:"-20%",width:"140%",height:"140%",filterUnits:"userSpaceOnUse",children:[o.jsx("feGaussianBlur",{stdDeviation:"3",result:"blur"}),o.jsx("feComposite",{in:"SourceGraphic",in2:"blur",operator:"over"})]})}),l.map((m,h)=>{const p=s[h];if(!p)return null;const y=p.successCount+p.failureCount,S=Math.max(2,y/r*10),w=c===h,v=c!==null&&c!==h,b=d.has(p.id),_=VS(h);return o.jsxs("g",{children:[o.jsx("path",{d:m,fill:"none",stroke:_,strokeWidth:S,strokeOpacity:w?.8:v?.15:.4,strokeLinecap:"round",filter:w?"url(#flow-glow)":void 0,className:"transition-all duration-300"}),b&&o.jsxs(o.Fragment,{children:[o.jsx("path",{d:m,fill:"none",stroke:p.color,strokeWidth:S*2,strokeLinecap:"round",filter:"url(#flow-glow)",className:"animate-request-pulse"}),o.jsx("circle",{r:6,fill:p.color,filter:"url(#flow-glow)",style:{offsetPath:`path('${m}')`,offsetDistance:"0%",animation:"travel-dot 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards"}})]})]},h)})]})}function o1({onBack:l,showDetails:s,onToggleDetails:r,hasCustomPositions:c,onResetPositions:d}){return o.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5",children:[l?o.jsxs("button",{onClick:l,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:[o.jsx(qo,{className:"w-3.5 h-3.5 rotate-180 transition-transform group-hover:-translate-x-0.5"}),o.jsx("span",{children:"Back to providers"})]}):o.jsx("div",{}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("button",{onClick:r,className:V("flex items-center gap-1.5 text-xs font-medium transition-all duration-200 px-3 py-1.5 rounded-md border shadow-sm",s?"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:[s?o.jsx(Lo,{className:"w-3.5 h-3.5"}):o.jsx(Yo,{className:"w-3.5 h-3.5"}),o.jsx("span",{children:s?"Hide Details":"Show Details"})]}),c&&o.jsxs("button",{onClick:d,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:[o.jsx(nb,{className:"w-3.5 h-3.5"}),o.jsx("span",{children:"Reset layout"})]})]})]})}function r1({providerData:l,onBack:s}){const r=x.useRef(null),c=x.useRef(null),[d,m]=x.useState(null),[h,p]=x.useState(!1),[y,S]=x.useState([]),{privacyMode:w}=Rc(),{accounts:v}=l,b=Math.max(...v.map(ce=>ce.successCount+ce.failureCount),1),_=v.reduce((ce,X)=>ce+X.successCount+X.failureCount,0),A=x.useCallback(()=>{const ce=ZS({containerRef:r,svgRef:c,accounts:v});ce.length>0&&S(ce)},[v]),R=`ccs-flow-positions-${l.provider}`,{dragOffsets:B,draggingId:M,handlePointerDown:Y,handlePointerMove:G,handlePointerUp:Q,getOffset:k,resetPositions:j,hasCustomPositions:q}=$S({storageKey:R,onDrag:A}),J=FS(B),ee=IS(v),de=x.useMemo(()=>XS(v).slice(0,KS),[v]);x.useEffect(()=>{const ce=setTimeout(A,50);return window.addEventListener("resize",A),()=>{clearTimeout(ce),window.removeEventListener("resize",A)}},[A]),x.useEffect(()=>{const ce=setTimeout(A,10);return()=>clearTimeout(ce)},[B,A]),x.useEffect(()=>{const ce=Date.now(),X=350,F=()=>{A(),Date.now()-ce<X&&requestAnimationFrame(F)};requestAnimationFrame(F)},[h,A]);const xe=ko[l.provider.toLowerCase()]||"#6b7280",oe=x.useMemo(()=>WS(v),[v]),{leftAccounts:Ye,rightAccounts:Se,topAccounts:$,bottomAccounts:z}=oe,Z=Se.length>0,ae=$.length>0,ye=z.length>0,ve=x.useMemo(()=>JS(v.length),[v.length]),Oe=(ce,X)=>ce.map(F=>{const le=v.findIndex(I=>I.id===F.id);return o.jsx(l1,{account:F,zone:X,originalIndex:le,isHovered:d===le,isDragging:M===F.id,offset:k(F.id),showDetails:h,privacyMode:w,onMouseEnter:()=>m(le),onMouseLeave:()=>m(null),onPointerDown:I=>Y(F.id,I),onPointerMove:G,onPointerUp:Q},F.id)});return o.jsxs("div",{className:"flex flex-col",ref:r,children:[o.jsx(o1,{onBack:s,showDetails:h,onToggleDetails:()=>p(!h),hasCustomPositions:q,onResetPositions:j}),o.jsxs("div",{className:"min-h-[320px] flex gap-4 px-4 py-6 self-stretch items-stretch transition-all duration-200",children:[o.jsxs("div",{className:"relative flex-1 flex flex-col items-stretch justify-center px-4",style:{paddingTop:`${24+J.paddingTop}px`,paddingBottom:`${24+J.paddingBottom}px`,minHeight:`${320+J.extraHeight}px`},children:[o.jsx("svg",{ref:c,className:"absolute inset-0 w-full h-full pointer-events-none z-0 overflow-visible",children:o.jsx(i1,{paths:y,accounts:v,maxRequests:b,hoveredAccount:d,pulsingAccounts:ee})}),ae&&o.jsx("div",{className:"flex flex-row gap-3 z-10 justify-center flex-wrap mb-8",children:Oe($,"top")}),o.jsxs("div",{className:"flex items-center justify-between gap-8 flex-1",children:[o.jsx("div",{className:"flex flex-col gap-3 z-10 w-48 justify-center flex-shrink-0",children:Oe(Ye,"left")}),o.jsx("div",{className:V("z-10 flex items-center flex-shrink-0",ve),children:o.jsx(s1,{providerData:l,providerColor:xe,totalRequests:_,maxRequests:b,isDragging:M==="provider",offset:k("provider"),hoveredAccount:d,hasRightAccounts:Z,hasTopAccounts:ae,hasBottomAccounts:ye,onPointerDown:ce=>Y("provider",ce),onPointerMove:G,onPointerUp:Q})}),Z&&o.jsx("div",{className:"flex flex-col gap-3 z-10 w-48 justify-center flex-shrink-0",children:Oe(Se,"right")})]}),ye&&o.jsx("div",{className:"flex flex-row gap-3 z-10 justify-center flex-wrap mt-8",children:Oe(z,"bottom")})]}),o.jsx("div",{className:"w-56 flex-shrink-0 self-stretch relative",children:o.jsx("div",{className:"absolute inset-0",children:o.jsx(PS,{events:de,privacyMode:w})})})]})]})}const ti="/api";async function De(l,s){const r=await fetch(`${ti}${l}`,{headers:{"Content-Type":"application/json"},...s});if(!r.ok){const c=await r.json().catch(()=>({error:"Unknown error"}));throw new Error(c.error||r.statusText)}return r.json()}const yt={profiles:{list:()=>De("/profiles"),create:l=>De("/profiles",{method:"POST",body:JSON.stringify(l)}),update:(l,s)=>De(`/profiles/${l}`,{method:"PUT",body:JSON.stringify(s)}),delete:l=>De(`/profiles/${l}`,{method:"DELETE"})},cliproxy:{list:()=>De("/cliproxy"),getAuthStatus:()=>De("/cliproxy/auth"),create:l=>De("/cliproxy",{method:"POST",body:JSON.stringify(l)}),update:(l,s)=>De(`/cliproxy/${l}`,{method:"PUT",body:JSON.stringify(s)}),delete:l=>De(`/cliproxy/${l}`,{method:"DELETE"}),proxyStatus:()=>De("/cliproxy/proxy-status"),proxyStart:()=>De("/cliproxy/proxy-start",{method:"POST"}),proxyStop:()=>De("/cliproxy/proxy-stop",{method:"POST"}),updateCheck:()=>De("/cliproxy/update-check"),stats:()=>De("/cliproxy/usage"),models:()=>De("/cliproxy/models"),updateModel:(l,s)=>De(`/cliproxy/models/${l}`,{method:"PUT",body:JSON.stringify({model:s})}),getConfigYaml:async()=>{const l=await fetch(`${ti}/cliproxy/config.yaml`);if(!l.ok)throw new Error("Failed to load config");return l.text()},saveConfigYaml:async l=>{const s=await fetch(`${ti}/cliproxy/config.yaml`,{method:"PUT",headers:{"Content-Type":"application/yaml"},body:l});if(!s.ok){const r=await s.json().catch(()=>({error:"Failed to save config"}));throw new Error(r.error||"Failed to save config")}},getAuthFiles:()=>De("/cliproxy/auth-files"),getAuthFile:async l=>{const s=await fetch(`${ti}/cliproxy/auth-files/download?name=${encodeURIComponent(l)}`);if(!s.ok)throw new Error("Failed to load auth file");return s.text()},accounts:{list:()=>De("/cliproxy/auth/accounts"),listByProvider:l=>De(`/cliproxy/auth/accounts/${l}`),setDefault:(l,s)=>De(`/cliproxy/auth/accounts/${l}/default`,{method:"POST",body:JSON.stringify({accountId:s})}),remove:(l,s)=>De(`/cliproxy/auth/accounts/${l}/${s}`,{method:"DELETE"})},auth:{start:(l,s)=>De(`/cliproxy/auth/${l}/start`,{method:"POST",body:JSON.stringify({nickname:s})}),kiroImport:()=>De("/cliproxy/auth/kiro/import",{method:"POST"})},errorLogs:{list:()=>De("/cliproxy/error-logs"),getContent:async l=>{const s=await fetch(`${ti}/cliproxy/error-logs/${encodeURIComponent(l)}`);if(!s.ok)throw new Error("Failed to load error log");return s.text()}}},accounts:{list:()=>De("/accounts"),setDefault:l=>De("/accounts/default",{method:"POST",body:JSON.stringify({name:l})}),resetDefault:()=>De("/accounts/reset-default",{method:"DELETE"}),delete:l=>De(`/accounts/${l}`,{method:"DELETE"})},config:{format:()=>De("/config/format"),get:()=>De("/config"),update:l=>De("/config",{method:"PUT",body:JSON.stringify(l)}),migrate:(l=!1)=>De(`/config/migrate?dryRun=${l}`,{method:"POST"}),rollback:l=>De("/config/rollback",{method:"POST",body:JSON.stringify({backupPath:l})})},presets:{list:l=>De(`/settings/${l}/presets`),create:(l,s)=>De(`/settings/${l}/presets`,{method:"POST",body:JSON.stringify(s)}),delete:(l,s)=>De(`/settings/${l}/presets/${encodeURIComponent(s)}`,{method:"DELETE"})},cliproxyServer:{get:()=>De("/cliproxy-server"),update:l=>De("/cliproxy-server",{method:"PUT",body:JSON.stringify(l)}),test:l=>De("/cliproxy-server/test",{method:"POST",body:JSON.stringify(l)})}};function pC(){return Ot({queryKey:["cliproxy"],queryFn:()=>yt.cliproxy.list()})}function u1(){return Ot({queryKey:["cliproxy-auth"],queryFn:()=>yt.cliproxy.getAuthStatus()})}function gC(){const l=Gt();return gn({mutationFn:s=>yt.cliproxy.create(s),onSuccess:()=>{l.invalidateQueries({queryKey:["cliproxy"]}),Ce.success("Variant created successfully")},onError:s=>{Ce.error(s.message)}})}function yC(){const l=Gt();return gn({mutationFn:s=>yt.cliproxy.delete(s),onSuccess:()=>{l.invalidateQueries({queryKey:["cliproxy"]}),Ce.success("Variant deleted successfully")},onError:s=>{Ce.error(s.message)}})}function vC(){const l=Gt();return gn({mutationFn:({provider:s,accountId:r})=>yt.cliproxy.accounts.setDefault(s,r),onSuccess:()=>{l.invalidateQueries({queryKey:["cliproxy-accounts"]}),l.invalidateQueries({queryKey:["cliproxy-auth"]}),Ce.success("Default account updated")},onError:s=>{Ce.error(s.message)}})}function xC(){const l=Gt();return gn({mutationFn:({provider:s,accountId:r})=>yt.cliproxy.accounts.remove(s,r),onSuccess:()=>{l.invalidateQueries({queryKey:["cliproxy-accounts"]}),l.invalidateQueries({queryKey:["cliproxy-auth"]}),Ce.success("Account removed")},onError:s=>{Ce.error(s.message)}})}function bC(){const l=Gt();return gn({mutationFn:({provider:s,nickname:r})=>yt.cliproxy.auth.start(s,r),onSuccess:(s,r)=>{l.invalidateQueries({queryKey:["cliproxy-accounts"]}),l.invalidateQueries({queryKey:["cliproxy-auth"]}),Ce.success(`Account added for ${r.provider}`)},onError:s=>{Ce.error(s.message)}})}function SC(){const l=Gt();return gn({mutationFn:()=>yt.cliproxy.auth.kiroImport(),onSuccess:s=>{l.invalidateQueries({queryKey:["cliproxy-accounts"]}),l.invalidateQueries({queryKey:["cliproxy-auth"]}),s.account?Ce.success(`Imported Kiro account: ${s.account.email||s.account.id}`):Ce.success("Kiro token imported")},onError:s=>{Ce.error(s.message)}})}function NC(){return Ot({queryKey:["cliproxy-models"],queryFn:()=>yt.cliproxy.models()})}function jC(l){return Ot({queryKey:["presets",l],queryFn:()=>yt.presets.list(l),enabled:!!l})}function CC(){const l=Gt();return gn({mutationFn:({profile:s,data:r})=>yt.presets.create(s,r),onSuccess:(s,r)=>{l.invalidateQueries({queryKey:["presets",r.profile]}),Ce.success(`Preset "${r.data.name}" saved`)},onError:s=>{Ce.error(s.message)}})}function EC(){const l=Gt();return gn({mutationFn:({profile:s,name:r})=>yt.presets.delete(s,r),onSuccess:(s,r)=>{l.invalidateQueries({queryKey:["presets",r.profile]}),Ce.success("Preset deleted")},onError:s=>{Ce.error(s.message)}})}function wC(){return Ot({queryKey:["proxy-status"],queryFn:()=>yt.cliproxy.proxyStatus(),refetchInterval:3e4})}function MC(){const l=Gt();return gn({mutationFn:()=>yt.cliproxy.proxyStart(),onSuccess:s=>{l.invalidateQueries({queryKey:["proxy-status"]}),s.alreadyRunning?Ce.info("CLIProxy was already running"):s.started?Ce.success("CLIProxy started successfully"):Ce.error(s.error||"Failed to start CLIProxy")},onError:s=>{Ce.error(s.message)}})}function zC(){const l=Gt();return gn({mutationFn:()=>yt.cliproxy.proxyStop(),onSuccess:s=>{l.invalidateQueries({queryKey:["proxy-status"]}),s.stopped?Ce.success(`CLIProxy stopped${s.sessionCount?` (${s.sessionCount} session(s) disconnected)`:""}`):Ce.error(s.error||"Failed to stop CLIProxy")},onError:s=>{Ce.error(s.message)}})}function TC(){return Ot({queryKey:["cliproxy-update-check"],queryFn:()=>yt.cliproxy.updateCheck(),staleTime:3600*1e3,refetchInterval:3600*1e3,refetchOnWindowFocus:!1})}async function c1(){const l=await fetch("/api/cliproxy/stats");if(!l.ok){const s=await l.json();throw new Error(s.message||"Failed to fetch stats")}return l.json()}async function d1(){const l=await fetch("/api/cliproxy/status");if(!l.ok)throw new Error("Failed to fetch status");return l.json()}function f1(){return Ot({queryKey:["cliproxy-status"],queryFn:d1,refetchInterval:1e4,retry:1})}function m1(l=!0){return Ot({queryKey:["cliproxy-stats"],queryFn:c1,enabled:l,refetchInterval:5e3,retry:1,staleTime:3e3})}async function h1(){const l=await fetch("/api/cliproxy/error-logs");if(!l.ok){const r=await l.json();throw new Error(r.message||"Failed to fetch error logs")}return(await l.json()).files??[]}async function p1(l){const s=await fetch(`/api/cliproxy/error-logs/${encodeURIComponent(l)}`);if(!s.ok)throw new Error("Failed to fetch error log content");return s.text()}function g1(l=!0){return Ot({queryKey:["cliproxy-error-logs"],queryFn:h1,enabled:l,refetchInterval:3e4,retry:1,staleTime:1e4})}function y1(l){return Ot({queryKey:["cliproxy-error-log-content",l],queryFn:()=>l?p1(l):Promise.resolve(""),enabled:!!l,staleTime:6e4})}function v1(l,s){const r=l+s;return r===0?100:Math.round(l/r*100)}function x1(l){return l.replace(/@(gmail|yahoo|hotmail|outlook|icloud)\.com$/i,"")}const dp=["#1e6091","#2d8a6e","#d4a012","#c92a2d","#c45a1a","#6b9c4d","#3d5a73","#cc7614","#3a7371","#7c5fc4"];function b1(){const{data:l,isLoading:s,error:r}=u1(),{data:c,isLoading:d,dataUpdatedAt:m}=m1(),[h,p]=x.useState("");x.useEffect(()=>{if(!m)return;const R=()=>{const M=Math.floor((Date.now()-m)/1e3);M<60?p(`${M}s ago`):p(`${Math.floor(M/60)}m ago`)};R();const B=setInterval(R,1e3);return()=>clearInterval(B)},[m]);const y=x.useMemo(()=>c?.accountStats?new Map(Object.entries(c.accountStats)):new Map,[c?.accountStats]),{accounts:S,totalSuccess:w,totalFailure:v,totalRequests:b,providerStats:_}=x.useMemo(()=>{if(!l?.authStatus)return{accounts:[],totalSuccess:0,totalFailure:0,totalRequests:0,providerStats:[]};const R=[],B=new Map;let M=0,Y=0,G=0;l.authStatus.forEach(k=>{const j=k.provider;B.has(j)||B.set(j,{success:0,failure:0,accounts:[]});const q=B.get(j);q&&k.accounts?.forEach(J=>{const ee=J.email||J.id,de=y.get(ee),xe=de?.successCount??0,oe=de?.failureCount??0;M+=xe,Y+=oe,q.success+=xe,q.failure+=oe;const Ye={id:J.id,email:J.email||J.id,provider:k.provider,displayName:k.displayName,isDefault:J.isDefault,successCount:xe,failureCount:oe,lastUsedAt:de?.lastUsedAt??J.lastUsedAt,color:dp[G%dp.length]};R.push(Ye),q.accounts.push(Ye),G++})});const Q=[];return B.forEach((k,j)=>{k.accounts.length!==0&&Q.push({provider:j,displayName:GS(j),totalRequests:k.success+k.failure,successCount:k.success,failureCount:k.failure,accountCount:k.accounts.length,accounts:k.accounts})}),Q.sort((k,j)=>j.totalRequests-k.totalRequests),{accounts:R,totalSuccess:M,totalFailure:Y,totalRequests:M+Y,providerStats:Q}},[l?.authStatus,y]),A=b>0?Math.round(w/b*100):100;return{accounts:S,totalSuccess:w,totalFailure:v,totalRequests:b,providerStats:_,overallSuccessRate:A,isLoading:s||d,error:r??null,timeSinceUpdate:h}}function S1(){return o.jsxs("div",{className:"relative flex items-center justify-center w-5 h-5",children:[o.jsx("div",{className:"absolute w-4 h-4 rounded-full animate-ping opacity-20",style:{backgroundColor:Yt.success}}),o.jsx("div",{className:"absolute w-3 h-3 rounded-full animate-pulse opacity-40",style:{backgroundColor:Yt.success}}),o.jsx("div",{className:"relative w-2 h-2 rounded-full z-10",style:{backgroundColor:Yt.success}})]})}function N1({success:l,failure:s}){return l===0&&s===0?o.jsx("span",{className:"text-[9px] text-muted-foreground/50 font-mono",children:"no activity"}):o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("div",{className:"flex items-center gap-0.5",children:[o.jsx(Go,{className:"w-3 h-3 text-emerald-700 dark:text-emerald-500"}),o.jsx("span",{className:"text-[10px] font-mono font-medium text-emerald-700 dark:text-emerald-500",children:l.toLocaleString()})]}),s>0&&o.jsxs("div",{className:"flex items-center gap-0.5",children:[o.jsx(Ac,{className:"w-3 h-3 text-red-700 dark:text-red-500"}),o.jsx("span",{className:"text-[10px] font-mono font-medium text-red-700 dark:text-red-500",children:s.toLocaleString()})]})]})}function j1({stats:l,isHovered:s,privacyMode:r,onSelect:c,onMouseEnter:d,onMouseLeave:m}){const h=v1(l.successCount,l.failureCount),p=ko[l.provider.toLowerCase()]||"#6b7280";return o.jsxs("button",{onClick:c,onMouseEnter:d,onMouseLeave:m,className:V("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",s&&"ring-1"),style:{borderColor:s?p:void 0,"--ring-color":p},children:[o.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[o.jsx(Gc,{provider:l.provider,size:36,withBackground:!0}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-sm font-semibold text-foreground tracking-tight",children:l.displayName}),o.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[l.accountCount," account",l.accountCount!==1?"s":""]})]}),o.jsx(qo,{className:V("w-4 h-4 ml-auto text-muted-foreground transition-all",s?"opacity-100 translate-x-0":"opacity-0 -translate-x-2")})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex justify-between items-center text-xs",children:[o.jsx("span",{className:"text-muted-foreground",children:"Stats"}),o.jsx(N1,{success:l.successCount,failure:l.failureCount})]}),o.jsxs("div",{className:"flex justify-between text-xs",children:[o.jsx("span",{className:"text-muted-foreground",children:"Success Rate"}),o.jsxs("span",{className:"font-mono font-semibold",style:{color:h===100?Yt.success:h>=95?Yt.degraded:Yt.failed},children:[h,"%"]})]}),o.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full overflow-hidden",children:o.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${h}%`,backgroundColor:p}})})]}),o.jsxs("div",{className:"flex gap-1 mt-3",children:[l.accounts.slice(0,5).map(y=>o.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:y.color},title:r?"••••••":x1(y.email)},y.id)),l.accounts.length>5&&o.jsxs("span",{className:"text-[10px] text-muted-foreground ml-1",children:["+",l.accounts.length-5]})]})]})}function wo({icon:l,label:s,value:r,color:c}){return o.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:[o.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center",style:{backgroundColor:c?`${c}15`:"var(--muted)",color:c||"var(--muted-foreground)"},children:l}),o.jsxs("div",{children:[o.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:s}),o.jsx("div",{className:"text-lg font-semibold font-mono leading-tight",style:{color:c||"var(--foreground)"},children:r})]})]})}function C1(){const{accounts:l,totalSuccess:s,totalFailure:r,totalRequests:c,providerStats:d,overallSuccessRate:m,isLoading:h,error:p,timeSinceUpdate:y}=b1(),{privacyMode:S}=Rc(),[w,v]=x.useState(null),[b,_]=x.useState(null),A=w?d.find(R=>R.provider===w):null;return h?o.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:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[o.jsx(Le,{className:"h-4 w-32"}),o.jsx(Le,{className:"h-4 w-20"})]}),o.jsxs("div",{className:"p-4 space-y-4",children:[o.jsx("div",{className:"flex gap-3",children:[1,2,3,4].map(R=>o.jsx(Le,{className:"h-16 flex-1 rounded-lg"},R))}),o.jsx(Le,{className:"h-48 w-full rounded-lg"})]})]}):p||l.length===0?null:o.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:[o.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:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(S1,{}),o.jsx("span",{className:"text-xs font-semibold tracking-tight text-foreground",children:"LIVE"}),o.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Account Monitor"})]}),o.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-muted-foreground",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(ab,{className:"w-3 h-3 animate-pulse"}),o.jsxs("span",{children:["Updated ",y||"now"]})]}),o.jsx("span",{className:"text-muted-foreground/50",children:"|"}),o.jsxs("span",{children:[l.length," accounts"]}),o.jsxs("span",{className:"font-mono",children:[c.toLocaleString()," req"]})]})]}),o.jsxs("div",{className:"grid grid-cols-4 gap-3 p-4 border-b border-border bg-muted/20 dark:bg-zinc-900/30",children:[o.jsx(wo,{icon:o.jsx(si,{className:"w-4 h-4"}),label:"Accounts",value:l.length,color:"var(--accent)"}),o.jsx(wo,{icon:o.jsx(Go,{className:"w-4 h-4"}),label:"Success",value:s.toLocaleString(),color:Yt.success}),o.jsx(wo,{icon:o.jsx(Ac,{className:"w-4 h-4"}),label:"Failed",value:r.toLocaleString(),color:r>0?Yt.failed:void 0}),o.jsx(wo,{icon:o.jsx(si,{className:"w-4 h-4"}),label:"Success Rate",value:`${m}%`,color:m===100?Yt.success:m>=95?Yt.degraded:Yt.failed})]}),o.jsx("div",{className:"relative overflow-hidden",children:A?o.jsx(r1,{providerData:A,onBack:()=>v(null)}):o.jsxs("div",{className:"p-6",children:[o.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-widest mb-4",children:"Request Distribution by Provider"}),o.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-4",children:d.map(R=>o.jsx(j1,{stats:R,isHovered:b===R.provider,privacyMode:S,onSelect:()=>v(R.provider),onMouseEnter:()=>_(R.provider),onMouseLeave:()=>_(null)},R.provider))})]})})]})}const $o=x.createContext(null);$o.displayName="PanelGroupContext";const it={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"},Kc=10,rl=x.useLayoutEffect,fp=a0.useId,E1=typeof fp=="function"?fp:()=>null;let w1=0;function Vc(l=null){const s=E1(),r=x.useRef(l||s||null);return r.current===null&&(r.current=""+w1++),l??r.current}function yg({children:l,className:s="",collapsedSize:r,collapsible:c,defaultSize:d,forwardedRef:m,id:h,maxSize:p,minSize:y,onCollapse:S,onExpand:w,onResize:v,order:b,style:_,tagName:A="div",...R}){const B=x.useContext($o);if(B===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:M,expandPanel:Y,getPanelSize:G,getPanelStyle:Q,groupId:k,isPanelCollapsed:j,reevaluatePanelConstraints:q,registerPanel:J,resizePanel:ee,unregisterPanel:de}=B,xe=Vc(h),oe=x.useRef({callbacks:{onCollapse:S,onExpand:w,onResize:v},constraints:{collapsedSize:r,collapsible:c,defaultSize:d,maxSize:p,minSize:y},id:xe,idIsFromProps:h!==void 0,order:b});x.useRef({didLogMissingDefaultSizeWarning:!1}),rl(()=>{const{callbacks:Se,constraints:$}=oe.current,z={...$};oe.current.id=xe,oe.current.idIsFromProps=h!==void 0,oe.current.order=b,Se.onCollapse=S,Se.onExpand=w,Se.onResize=v,$.collapsedSize=r,$.collapsible=c,$.defaultSize=d,$.maxSize=p,$.minSize=y,(z.collapsedSize!==$.collapsedSize||z.collapsible!==$.collapsible||z.maxSize!==$.maxSize||z.minSize!==$.minSize)&&q(oe.current,z)}),rl(()=>{const Se=oe.current;return J(Se),()=>{de(Se)}},[b,xe,J,de]),x.useImperativeHandle(m,()=>({collapse:()=>{M(oe.current)},expand:Se=>{Y(oe.current,Se)},getId(){return xe},getSize(){return G(oe.current)},isCollapsed(){return j(oe.current)},isExpanded(){return!j(oe.current)},resize:Se=>{ee(oe.current,Se)}}),[M,Y,G,j,xe,ee]);const Ye=Q(oe.current,d);return x.createElement(A,{...R,children:l,className:s,id:xe,style:{...Ye,..._},[it.groupId]:k,[it.panel]:"",[it.panelCollapsible]:c||void 0,[it.panelId]:xe,[it.panelSize]:parseFloat(""+Ye.flexGrow).toFixed(1)})}const ii=x.forwardRef((l,s)=>x.createElement(yg,{...l,forwardedRef:s}));yg.displayName="Panel";ii.displayName="forwardRef(Panel)";let Mc=null,Ao=-1,Ua=null;function M1(l,s,r){const c=(s&Ng)!==0,d=(s&jg)!==0,m=(s&Cg)!==0,h=(s&Eg)!==0;if(s){if(c)return m?"se-resize":h?"ne-resize":"e-resize";if(d)return m?"sw-resize":h?"nw-resize":"w-resize";if(m)return"s-resize";if(h)return"n-resize"}switch(l){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function z1(){Ua!==null&&(document.head.removeChild(Ua),Mc=null,Ua=null,Ao=-1)}function yc(l,s,r){var c,d;const m=M1(l,s);if(Mc!==m){if(Mc=m,Ua===null&&(Ua=document.createElement("style"),document.head.appendChild(Ua)),Ao>=0){var h;(h=Ua.sheet)===null||h===void 0||h.removeRule(Ao)}Ao=(c=(d=Ua.sheet)===null||d===void 0?void 0:d.insertRule(`*{cursor: ${m} !important;}`))!==null&&c!==void 0?c:-1}}function vg(l){return l.type==="keydown"}function xg(l){return l.type.startsWith("pointer")}function bg(l){return l.type.startsWith("mouse")}function Fo(l){if(xg(l)){if(l.isPrimary)return{x:l.clientX,y:l.clientY}}else if(bg(l))return{x:l.clientX,y:l.clientY};return{x:1/0,y:1/0}}function T1(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function O1(l,s,r){return l.x<s.x+s.width&&l.x+l.width>s.x&&l.y<s.y+s.height&&l.y+l.height>s.y}function A1(l,s){if(l===s)throw new Error("Cannot compare node with itself");const r={a:pp(l),b:pp(s)};let c;for(;r.a.at(-1)===r.b.at(-1);)l=r.a.pop(),s=r.b.pop(),c=l;Te(c,"Stacking order can only be calculated for elements with a common ancestor");const d={a:hp(mp(r.a)),b:hp(mp(r.b))};if(d.a===d.b){const m=c.childNodes,h={a:r.a.at(-1),b:r.b.at(-1)};let p=m.length;for(;p--;){const y=m[p];if(y===h.a)return 1;if(y===h.b)return-1}}return Math.sign(d.a-d.b)}const D1=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function _1(l){var s;const r=getComputedStyle((s=Sg(l))!==null&&s!==void 0?s:l).display;return r==="flex"||r==="inline-flex"}function k1(l){const s=getComputedStyle(l);return!!(s.position==="fixed"||s.zIndex!=="auto"&&(s.position!=="static"||_1(l))||+s.opacity<1||"transform"in s&&s.transform!=="none"||"webkitTransform"in s&&s.webkitTransform!=="none"||"mixBlendMode"in s&&s.mixBlendMode!=="normal"||"filter"in s&&s.filter!=="none"||"webkitFilter"in s&&s.webkitFilter!=="none"||"isolation"in s&&s.isolation==="isolate"||D1.test(s.willChange)||s.webkitOverflowScrolling==="touch")}function mp(l){let s=l.length;for(;s--;){const r=l[s];if(Te(r,"Missing node"),k1(r))return r}return null}function hp(l){return l&&Number(getComputedStyle(l).zIndex)||0}function pp(l){const s=[];for(;l;)s.push(l),l=Sg(l);return s}function Sg(l){const{parentNode:s}=l;return s&&s instanceof ShadowRoot?s.host:s}const Ng=1,jg=2,Cg=4,Eg=8,R1=T1()==="coarse";let Cn=[],Pl=!1,Ba=new Map,Io=new Map;const oi=new Set;function U1(l,s,r,c,d){var m;const{ownerDocument:h}=s,p={direction:r,element:s,hitAreaMargins:c,setResizeHandlerState:d},y=(m=Ba.get(h))!==null&&m!==void 0?m:0;return Ba.set(h,y+1),oi.add(p),Ro(),function(){var w;Io.delete(l),oi.delete(p);const v=(w=Ba.get(h))!==null&&w!==void 0?w:1;if(Ba.set(h,v-1),Ro(),v===1&&Ba.delete(h),Cn.includes(p)){const b=Cn.indexOf(p);b>=0&&Cn.splice(b,1),Po(),d("up",!0,null)}}}function B1(l){const{target:s}=l,{x:r,y:c}=Fo(l);Pl=!0,Qc({target:s,x:r,y:c}),Ro(),Cn.length>0&&(Uo("down",l),Po(),l.preventDefault(),wg(s)||l.stopImmediatePropagation())}function vc(l){const{x:s,y:r}=Fo(l);if(Pl&&l.type!=="pointerleave"&&l.buttons===0&&(Pl=!1,Uo("up",l)),!Pl){const{target:c}=l;Qc({target:c,x:s,y:r})}Uo("move",l),Po(),Cn.length>0&&l.preventDefault()}function xc(l){const{target:s}=l,{x:r,y:c}=Fo(l);Io.clear(),Pl=!1,Cn.length>0&&(l.preventDefault(),wg(s)||l.stopImmediatePropagation()),Uo("up",l),Qc({target:s,x:r,y:c}),Po(),Ro()}function wg(l){let s=l;for(;s;){if(s.hasAttribute(it.resizeHandle))return!0;s=s.parentElement}return!1}function Qc({target:l,x:s,y:r}){Cn.splice(0);let c=null;(l instanceof HTMLElement||l instanceof SVGElement)&&(c=l),oi.forEach(d=>{const{element:m,hitAreaMargins:h}=d,p=m.getBoundingClientRect(),{bottom:y,left:S,right:w,top:v}=p,b=R1?h.coarse:h.fine;if(s>=S-b&&s<=w+b&&r>=v-b&&r<=y+b){if(c!==null&&document.contains(c)&&m!==c&&!m.contains(c)&&!c.contains(m)&&A1(c,m)>0){let A=c,R=!1;for(;A&&!A.contains(m);){if(O1(A.getBoundingClientRect(),p)){R=!0;break}A=A.parentElement}if(R)return}Cn.push(d)}})}function bc(l,s){Io.set(l,s)}function Po(){let l=!1,s=!1;Cn.forEach(c=>{const{direction:d}=c;d==="horizontal"?l=!0:s=!0});let r=0;Io.forEach(c=>{r|=c}),l&&s?yc("intersection",r):l?yc("horizontal",r):s?yc("vertical",r):z1()}let Sc;function Ro(){var l;(l=Sc)===null||l===void 0||l.abort(),Sc=new AbortController;const s={capture:!0,signal:Sc.signal};oi.size&&(Pl?(Cn.length>0&&Ba.forEach((r,c)=>{const{body:d}=c;r>0&&(d.addEventListener("contextmenu",xc,s),d.addEventListener("pointerleave",vc,s),d.addEventListener("pointermove",vc,s))}),Ba.forEach((r,c)=>{const{body:d}=c;d.addEventListener("pointerup",xc,s),d.addEventListener("pointercancel",xc,s)})):Ba.forEach((r,c)=>{const{body:d}=c;r>0&&(d.addEventListener("pointerdown",B1,s),d.addEventListener("pointermove",vc,s))}))}function Uo(l,s){oi.forEach(r=>{const{setResizeHandlerState:c}=r,d=Cn.includes(r);c(l,d,s)})}function H1(){const[l,s]=x.useState(0);return x.useCallback(()=>s(r=>r+1),[])}function Te(l,s){if(!l)throw console.error(s),Error(s)}function ul(l,s,r=Kc){return l.toFixed(r)===s.toFixed(r)?0:l>s?1:-1}function ia(l,s,r=Kc){return ul(l,s,r)===0}function tn(l,s,r){return ul(l,s,r)===0}function q1(l,s,r){if(l.length!==s.length)return!1;for(let c=0;c<l.length;c++){const d=l[c],m=s[c];if(!tn(d,m,r))return!1}return!0}function Il({panelConstraints:l,panelIndex:s,size:r}){const c=l[s];Te(c!=null,`Panel constraints not found for index ${s}`);let{collapsedSize:d=0,collapsible:m,maxSize:h=100,minSize:p=0}=c;if(ul(r,p)<0)if(m){const y=(d+p)/2;ul(r,y)<0?r=d:r=p}else r=p;return r=Math.min(h,r),r=parseFloat(r.toFixed(Kc)),r}function ni({delta:l,initialLayout:s,panelConstraints:r,pivotIndices:c,prevLayout:d,trigger:m}){if(tn(l,0))return s;const h=[...s],[p,y]=c;Te(p!=null,"Invalid first pivot index"),Te(y!=null,"Invalid second pivot index");let S=0;if(m==="keyboard"){{const v=l<0?y:p,b=r[v];Te(b,`Panel constraints not found for index ${v}`);const{collapsedSize:_=0,collapsible:A,minSize:R=0}=b;if(A){const B=s[v];if(Te(B!=null,`Previous layout not found for panel index ${v}`),tn(B,_)){const M=R-B;ul(M,Math.abs(l))>0&&(l=l<0?0-M:M)}}}{const v=l<0?p:y,b=r[v];Te(b,`No panel constraints found for index ${v}`);const{collapsedSize:_=0,collapsible:A,minSize:R=0}=b;if(A){const B=s[v];if(Te(B!=null,`Previous layout not found for panel index ${v}`),tn(B,R)){const M=B-_;ul(M,Math.abs(l))>0&&(l=l<0?0-M:M)}}}}{const v=l<0?1:-1;let b=l<0?y:p,_=0;for(;;){const R=s[b];Te(R!=null,`Previous layout not found for panel index ${b}`);const M=Il({panelConstraints:r,panelIndex:b,size:100})-R;if(_+=M,b+=v,b<0||b>=r.length)break}const A=Math.min(Math.abs(l),Math.abs(_));l=l<0?0-A:A}{let b=l<0?p:y;for(;b>=0&&b<r.length;){const _=Math.abs(l)-Math.abs(S),A=s[b];Te(A!=null,`Previous layout not found for panel index ${b}`);const R=A-_,B=Il({panelConstraints:r,panelIndex:b,size:R});if(!tn(A,B)&&(S+=A-B,h[b]=B,S.toFixed(3).localeCompare(Math.abs(l).toFixed(3),void 0,{numeric:!0})>=0))break;l<0?b--:b++}}if(q1(d,h))return d;{const v=l<0?y:p,b=s[v];Te(b!=null,`Previous layout not found for panel index ${v}`);const _=b+S,A=Il({panelConstraints:r,panelIndex:v,size:_});if(h[v]=A,!tn(A,_)){let R=_-A,M=l<0?y:p;for(;M>=0&&M<r.length;){const Y=h[M];Te(Y!=null,`Previous layout not found for panel index ${M}`);const G=Y+R,Q=Il({panelConstraints:r,panelIndex:M,size:G});if(tn(Y,Q)||(R-=Q-Y,h[M]=Q),tn(R,0))break;l>0?M--:M++}}}const w=h.reduce((v,b)=>b+v,0);return tn(w,100)?h:d}function L1({layout:l,panelsArray:s,pivotIndices:r}){let c=0,d=100,m=0,h=0;const p=r[0];Te(p!=null,"No pivot index found"),s.forEach((v,b)=>{const{constraints:_}=v,{maxSize:A=100,minSize:R=0}=_;b===p?(c=R,d=A):(m+=R,h+=A)});const y=Math.min(d,100-m),S=Math.max(c,100-h),w=l[p];return{valueMax:y,valueMin:S,valueNow:w}}function ri(l,s=document){return Array.from(s.querySelectorAll(`[${it.resizeHandleId}][data-panel-group-id="${l}"]`))}function Mg(l,s,r=document){const d=ri(l,r).findIndex(m=>m.getAttribute(it.resizeHandleId)===s);return d??null}function zg(l,s,r){const c=Mg(l,s,r);return c!=null?[c,c+1]:[-1,-1]}function Y1(l){return l instanceof HTMLElement?!0:typeof l=="object"&&l!==null&&"tagName"in l&&"getAttribute"in l}function Tg(l,s=document){if(Y1(s)&&s.dataset.panelGroupId==l)return s;const r=s.querySelector(`[data-panel-group][data-panel-group-id="${l}"]`);return r||null}function er(l,s=document){const r=s.querySelector(`[${it.resizeHandleId}="${l}"]`);return r||null}function G1(l,s,r,c=document){var d,m,h,p;const y=er(s,c),S=ri(l,c),w=y?S.indexOf(y):-1,v=(d=(m=r[w])===null||m===void 0?void 0:m.id)!==null&&d!==void 0?d:null,b=(h=(p=r[w+1])===null||p===void 0?void 0:p.id)!==null&&h!==void 0?h:null;return[v,b]}function K1({committedValuesRef:l,eagerValuesRef:s,groupId:r,layout:c,panelDataArray:d,panelGroupElement:m,setLayout:h}){x.useRef({didWarnAboutMissingResizeHandle:!1}),rl(()=>{if(!m)return;const p=ri(r,m);for(let y=0;y<d.length-1;y++){const{valueMax:S,valueMin:w,valueNow:v}=L1({layout:c,panelsArray:d,pivotIndices:[y,y+1]}),b=p[y];if(b!=null){const _=d[y];Te(_,`No panel data found for index "${y}"`),b.setAttribute("aria-controls",_.id),b.setAttribute("aria-valuemax",""+Math.round(S)),b.setAttribute("aria-valuemin",""+Math.round(w)),b.setAttribute("aria-valuenow",v!=null?""+Math.round(v):"")}}return()=>{p.forEach((y,S)=>{y.removeAttribute("aria-controls"),y.removeAttribute("aria-valuemax"),y.removeAttribute("aria-valuemin"),y.removeAttribute("aria-valuenow")})}},[r,c,d,m]),x.useEffect(()=>{if(!m)return;const p=s.current;Te(p,"Eager values not found");const{panelDataArray:y}=p,S=Tg(r,m);Te(S!=null,`No group found for id "${r}"`);const w=ri(r,m);Te(w,`No resize handles found for group id "${r}"`);const v=w.map(b=>{const _=b.getAttribute(it.resizeHandleId);Te(_,"Resize handle element has no handle id attribute");const[A,R]=G1(r,_,y,m);if(A==null||R==null)return()=>{};const B=M=>{if(!M.defaultPrevented)switch(M.key){case"Enter":{M.preventDefault();const Y=y.findIndex(G=>G.id===A);if(Y>=0){const G=y[Y];Te(G,`No panel data found for index ${Y}`);const Q=c[Y],{collapsedSize:k=0,collapsible:j,minSize:q=0}=G.constraints;if(Q!=null&&j){const J=ni({delta:tn(Q,k)?q-k:k-Q,initialLayout:c,panelConstraints:y.map(ee=>ee.constraints),pivotIndices:zg(r,_,m),prevLayout:c,trigger:"keyboard"});c!==J&&h(J)}}break}}};return b.addEventListener("keydown",B),()=>{b.removeEventListener("keydown",B)}});return()=>{v.forEach(b=>b())}},[m,l,s,r,c,d,h])}function gp(l,s){if(l.length!==s.length)return!1;for(let r=0;r<l.length;r++)if(l[r]!==s[r])return!1;return!0}function Og(l,s){const r=l==="horizontal",{x:c,y:d}=Fo(s);return r?c:d}function V1(l,s,r,c,d){const m=r==="horizontal",h=er(s,d);Te(h,`No resize handle element found for id "${s}"`);const p=h.getAttribute(it.groupId);Te(p,"Resize handle element has no group id attribute");let{initialCursorPosition:y}=c;const S=Og(r,l),w=Tg(p,d);Te(w,`No group element found for id "${p}"`);const v=w.getBoundingClientRect(),b=m?v.width:v.height;return(S-y)/b*100}function Q1(l,s,r,c,d,m){if(vg(l)){const h=r==="horizontal";let p=0;l.shiftKey?p=100:d!=null?p=d:p=10;let y=0;switch(l.key){case"ArrowDown":y=h?0:p;break;case"ArrowLeft":y=h?-p:0;break;case"ArrowRight":y=h?p:0;break;case"ArrowUp":y=h?0:-p;break;case"End":y=100;break;case"Home":y=-100;break}return y}else return c==null?0:V1(l,s,r,c,m)}function X1({panelDataArray:l}){const s=Array(l.length),r=l.map(m=>m.constraints);let c=0,d=100;for(let m=0;m<l.length;m++){const h=r[m];Te(h,`Panel constraints not found for index ${m}`);const{defaultSize:p}=h;p!=null&&(c++,s[m]=p,d-=p)}for(let m=0;m<l.length;m++){const h=r[m];Te(h,`Panel constraints not found for index ${m}`);const{defaultSize:p}=h;if(p!=null)continue;const y=l.length-c,S=d/y;c++,s[m]=S,d-=S}return s}function $l(l,s,r){s.forEach((c,d)=>{const m=l[d];Te(m,`Panel data not found for index ${d}`);const{callbacks:h,constraints:p,id:y}=m,{collapsedSize:S=0,collapsible:w}=p,v=r[y];if(v==null||c!==v){r[y]=c;const{onCollapse:b,onExpand:_,onResize:A}=h;A&&A(c,v),w&&(b||_)&&(_&&(v==null||ia(v,S))&&!ia(c,S)&&_(),b&&(v==null||!ia(v,S))&&ia(c,S)&&b())}})}function Mo(l,s){if(l.length!==s.length)return!1;for(let r=0;r<l.length;r++)if(l[r]!=s[r])return!1;return!0}function Z1({defaultSize:l,dragState:s,layout:r,panelData:c,panelIndex:d,precision:m=3}){const h=r[d];let p;return h==null?p=l!=null?l.toFixed(m):"1":c.length===1?p="1":p=h.toFixed(m),{flexBasis:0,flexGrow:p,flexShrink:1,overflow:"hidden",pointerEvents:s!==null?"none":void 0}}function W1(l,s=10){let r=null;return(...d)=>{r!==null&&clearTimeout(r),r=setTimeout(()=>{l(...d)},s)}}function yp(l){try{if(typeof localStorage<"u")l.getItem=s=>localStorage.getItem(s),l.setItem=(s,r)=>{localStorage.setItem(s,r)};else throw new Error("localStorage not supported in this environment")}catch(s){console.error(s),l.getItem=()=>null,l.setItem=()=>{}}}function Ag(l){return`react-resizable-panels:${l}`}function Dg(l){return l.map(s=>{const{constraints:r,id:c,idIsFromProps:d,order:m}=s;return d?c:m?`${m}:${JSON.stringify(r)}`:JSON.stringify(r)}).sort((s,r)=>s.localeCompare(r)).join(",")}function _g(l,s){try{const r=Ag(l),c=s.getItem(r);if(c){const d=JSON.parse(c);if(typeof d=="object"&&d!=null)return d}}catch{}return null}function J1(l,s,r){var c,d;const m=(c=_g(l,r))!==null&&c!==void 0?c:{},h=Dg(s);return(d=m[h])!==null&&d!==void 0?d:null}function $1(l,s,r,c,d){var m;const h=Ag(l),p=Dg(s),y=(m=_g(l,d))!==null&&m!==void 0?m:{};y[p]={expandToSizes:Object.fromEntries(r.entries()),layout:c};try{d.setItem(h,JSON.stringify(y))}catch(S){console.error(S)}}function vp({layout:l,panelConstraints:s}){const r=[...l],c=r.reduce((m,h)=>m+h,0);if(r.length!==s.length)throw Error(`Invalid ${s.length} panel layout: ${r.map(m=>`${m}%`).join(", ")}`);if(!tn(c,100)&&r.length>0)for(let m=0;m<s.length;m++){const h=r[m];Te(h!=null,`No layout data found for index ${m}`);const p=100/c*h;r[m]=p}let d=0;for(let m=0;m<s.length;m++){const h=r[m];Te(h!=null,`No layout data found for index ${m}`);const p=Il({panelConstraints:s,panelIndex:m,size:h});h!=p&&(d+=h-p,r[m]=p)}if(!tn(d,0))for(let m=0;m<s.length;m++){const h=r[m];Te(h!=null,`No layout data found for index ${m}`);const p=h+d,y=Il({panelConstraints:s,panelIndex:m,size:p});if(h!==y&&(d-=y-h,r[m]=y,tn(d,0)))break}return r}const F1=100,ai={getItem:l=>(yp(ai),ai.getItem(l)),setItem:(l,s)=>{yp(ai),ai.setItem(l,s)}},xp={};function kg({autoSaveId:l=null,children:s,className:r="",direction:c,forwardedRef:d,id:m=null,onLayout:h=null,keyboardResizeBy:p=null,storage:y=ai,style:S,tagName:w="div",...v}){const b=Vc(m),_=x.useRef(null),[A,R]=x.useState(null),[B,M]=x.useState([]),Y=H1(),G=x.useRef({}),Q=x.useRef(new Map),k=x.useRef(0),j=x.useRef({autoSaveId:l,direction:c,dragState:A,id:b,keyboardResizeBy:p,onLayout:h,storage:y}),q=x.useRef({layout:B,panelDataArray:[],panelDataArrayChanged:!1});x.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),x.useImperativeHandle(d,()=>({getId:()=>j.current.id,getLayout:()=>{const{layout:X}=q.current;return X},setLayout:X=>{const{onLayout:F}=j.current,{layout:le,panelDataArray:I}=q.current,ne=vp({layout:X,panelConstraints:I.map(ge=>ge.constraints)});gp(le,ne)||(M(ne),q.current.layout=ne,F&&F(ne),$l(I,ne,G.current))}}),[]),rl(()=>{j.current.autoSaveId=l,j.current.direction=c,j.current.dragState=A,j.current.id=b,j.current.onLayout=h,j.current.storage=y}),K1({committedValuesRef:j,eagerValuesRef:q,groupId:b,layout:B,panelDataArray:q.current.panelDataArray,setLayout:M,panelGroupElement:_.current}),x.useEffect(()=>{const{panelDataArray:X}=q.current;if(l){if(B.length===0||B.length!==X.length)return;let F=xp[l];F==null&&(F=W1($1,F1),xp[l]=F);const le=[...X],I=new Map(Q.current);F(l,le,I,B,y)}},[l,B,y]),x.useEffect(()=>{});const J=x.useCallback(X=>{const{onLayout:F}=j.current,{layout:le,panelDataArray:I}=q.current;if(X.constraints.collapsible){const ne=I.map(ht=>ht.constraints),{collapsedSize:ge=0,panelSize:Ae,pivotIndices:Ge}=sl(I,X,le);if(Te(Ae!=null,`Panel size not found for panel "${X.id}"`),!ia(Ae,ge)){Q.current.set(X.id,Ae);const pt=Fl(I,X)===I.length-1?Ae-ge:ge-Ae,Ve=ni({delta:pt,initialLayout:le,panelConstraints:ne,pivotIndices:Ge,prevLayout:le,trigger:"imperative-api"});Mo(le,Ve)||(M(Ve),q.current.layout=Ve,F&&F(Ve),$l(I,Ve,G.current))}}},[]),ee=x.useCallback((X,F)=>{const{onLayout:le}=j.current,{layout:I,panelDataArray:ne}=q.current;if(X.constraints.collapsible){const ge=ne.map(et=>et.constraints),{collapsedSize:Ae=0,panelSize:Ge=0,minSize:ht=0,pivotIndices:pt}=sl(ne,X,I),Ve=F??ht;if(ia(Ge,Ae)){const et=Q.current.get(X.id),Dt=et!=null&&et>=Ve?et:Ve,Un=Fl(ne,X)===ne.length-1?Ge-Dt:Dt-Ge,Ne=ni({delta:Un,initialLayout:I,panelConstraints:ge,pivotIndices:pt,prevLayout:I,trigger:"imperative-api"});Mo(I,Ne)||(M(Ne),q.current.layout=Ne,le&&le(Ne),$l(ne,Ne,G.current))}}},[]),de=x.useCallback(X=>{const{layout:F,panelDataArray:le}=q.current,{panelSize:I}=sl(le,X,F);return Te(I!=null,`Panel size not found for panel "${X.id}"`),I},[]),xe=x.useCallback((X,F)=>{const{panelDataArray:le}=q.current,I=Fl(le,X);return Z1({defaultSize:F,dragState:A,layout:B,panelData:le,panelIndex:I})},[A,B]),oe=x.useCallback(X=>{const{layout:F,panelDataArray:le}=q.current,{collapsedSize:I=0,collapsible:ne,panelSize:ge}=sl(le,X,F);return Te(ge!=null,`Panel size not found for panel "${X.id}"`),ne===!0&&ia(ge,I)},[]),Ye=x.useCallback(X=>{const{layout:F,panelDataArray:le}=q.current,{collapsedSize:I=0,collapsible:ne,panelSize:ge}=sl(le,X,F);return Te(ge!=null,`Panel size not found for panel "${X.id}"`),!ne||ul(ge,I)>0},[]),Se=x.useCallback(X=>{const{panelDataArray:F}=q.current;F.push(X),F.sort((le,I)=>{const ne=le.order,ge=I.order;return ne==null&&ge==null?0:ne==null?-1:ge==null?1:ne-ge}),q.current.panelDataArrayChanged=!0,Y()},[Y]);rl(()=>{if(q.current.panelDataArrayChanged){q.current.panelDataArrayChanged=!1;const{autoSaveId:X,onLayout:F,storage:le}=j.current,{layout:I,panelDataArray:ne}=q.current;let ge=null;if(X){const Ge=J1(X,ne,le);Ge&&(Q.current=new Map(Object.entries(Ge.expandToSizes)),ge=Ge.layout)}ge==null&&(ge=X1({panelDataArray:ne}));const Ae=vp({layout:ge,panelConstraints:ne.map(Ge=>Ge.constraints)});gp(I,Ae)||(M(Ae),q.current.layout=Ae,F&&F(Ae),$l(ne,Ae,G.current))}}),rl(()=>{const X=q.current;return()=>{X.layout=[]}},[]);const $=x.useCallback(X=>{let F=!1;const le=_.current;return le&&window.getComputedStyle(le,null).getPropertyValue("direction")==="rtl"&&(F=!0),function(ne){ne.preventDefault();const ge=_.current;if(!ge)return()=>null;const{direction:Ae,dragState:Ge,id:ht,keyboardResizeBy:pt,onLayout:Ve}=j.current,{layout:et,panelDataArray:Dt}=q.current,{initialLayout:Kt}=Ge??{},Un=zg(ht,X,ge);let Ne=Q1(ne,X,Ae,Ge,pt,ge);const Vt=Ae==="horizontal";Vt&&F&&(Ne=-Ne);const En=Dt.map(Bn=>Bn.constraints),Qt=ni({delta:Ne,initialLayout:Kt??et,panelConstraints:En,pivotIndices:Un,prevLayout:et,trigger:vg(ne)?"keyboard":"mouse-or-touch"}),ca=!Mo(et,Qt);(xg(ne)||bg(ne))&&k.current!=Ne&&(k.current=Ne,!ca&&Ne!==0?Vt?bc(X,Ne<0?Ng:jg):bc(X,Ne<0?Cg:Eg):bc(X,0)),ca&&(M(Qt),q.current.layout=Qt,Ve&&Ve(Qt),$l(Dt,Qt,G.current))}},[]),z=x.useCallback((X,F)=>{const{onLayout:le}=j.current,{layout:I,panelDataArray:ne}=q.current,ge=ne.map(et=>et.constraints),{panelSize:Ae,pivotIndices:Ge}=sl(ne,X,I);Te(Ae!=null,`Panel size not found for panel "${X.id}"`);const pt=Fl(ne,X)===ne.length-1?Ae-F:F-Ae,Ve=ni({delta:pt,initialLayout:I,panelConstraints:ge,pivotIndices:Ge,prevLayout:I,trigger:"imperative-api"});Mo(I,Ve)||(M(Ve),q.current.layout=Ve,le&&le(Ve),$l(ne,Ve,G.current))},[]),Z=x.useCallback((X,F)=>{const{layout:le,panelDataArray:I}=q.current,{collapsedSize:ne=0,collapsible:ge}=F,{collapsedSize:Ae=0,collapsible:Ge,maxSize:ht=100,minSize:pt=0}=X.constraints,{panelSize:Ve}=sl(I,X,le);Ve!=null&&(ge&&Ge&&ia(Ve,ne)?ia(ne,Ae)||z(X,Ae):Ve<pt?z(X,pt):Ve>ht&&z(X,ht))},[z]),ae=x.useCallback((X,F)=>{const{direction:le}=j.current,{layout:I}=q.current;if(!_.current)return;const ne=er(X,_.current);Te(ne,`Drag handle element not found for id "${X}"`);const ge=Og(le,F);R({dragHandleId:X,dragHandleRect:ne.getBoundingClientRect(),initialCursorPosition:ge,initialLayout:I})},[]),ye=x.useCallback(()=>{R(null)},[]),ve=x.useCallback(X=>{const{panelDataArray:F}=q.current,le=Fl(F,X);le>=0&&(F.splice(le,1),delete G.current[X.id],q.current.panelDataArrayChanged=!0,Y())},[Y]),Oe=x.useMemo(()=>({collapsePanel:J,direction:c,dragState:A,expandPanel:ee,getPanelSize:de,getPanelStyle:xe,groupId:b,isPanelCollapsed:oe,isPanelExpanded:Ye,reevaluatePanelConstraints:Z,registerPanel:Se,registerResizeHandle:$,resizePanel:z,startDragging:ae,stopDragging:ye,unregisterPanel:ve,panelGroupElement:_.current}),[J,A,c,ee,de,xe,b,oe,Ye,Z,Se,$,z,ae,ye,ve]),ce={display:"flex",flexDirection:c==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return x.createElement($o.Provider,{value:Oe},x.createElement(w,{...v,children:s,className:r,id:m,ref:_,style:{...ce,...S},[it.group]:"",[it.groupDirection]:c,[it.groupId]:b}))}const Xc=x.forwardRef((l,s)=>x.createElement(kg,{...l,forwardedRef:s}));kg.displayName="PanelGroup";Xc.displayName="forwardRef(PanelGroup)";function Fl(l,s){return l.findIndex(r=>r===s||r.id===s.id)}function sl(l,s,r){const c=Fl(l,s),m=c===l.length-1?[c-1,c]:[c,c+1],h=r[c];return{...s.constraints,panelSize:h,pivotIndices:m}}function I1({disabled:l,handleId:s,resizeHandler:r,panelGroupElement:c}){x.useEffect(()=>{if(l||r==null||c==null)return;const d=er(s,c);if(d==null)return;const m=h=>{if(!h.defaultPrevented)switch(h.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{h.preventDefault(),r(h);break}case"F6":{h.preventDefault();const p=d.getAttribute(it.groupId);Te(p,`No group element found for id "${p}"`);const y=ri(p,c),S=Mg(p,s,c);Te(S!==null,`No resize element found for id "${s}"`);const w=h.shiftKey?S>0?S-1:y.length-1:S+1<y.length?S+1:0;y[w].focus();break}}};return d.addEventListener("keydown",m),()=>{d.removeEventListener("keydown",m)}},[c,l,s,r])}function Zc({children:l=null,className:s="",disabled:r=!1,hitAreaMargins:c,id:d,onBlur:m,onClick:h,onDragging:p,onFocus:y,onPointerDown:S,onPointerUp:w,style:v={},tabIndex:b=0,tagName:_="div",...A}){var R,B;const M=x.useRef(null),Y=x.useRef({onClick:h,onDragging:p,onPointerDown:S,onPointerUp:w});x.useEffect(()=>{Y.current.onClick=h,Y.current.onDragging=p,Y.current.onPointerDown=S,Y.current.onPointerUp=w});const G=x.useContext($o);if(G===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:Q,groupId:k,registerResizeHandle:j,startDragging:q,stopDragging:J,panelGroupElement:ee}=G,de=Vc(d),[xe,oe]=x.useState("inactive"),[Ye,Se]=x.useState(!1),[$,z]=x.useState(null),Z=x.useRef({state:xe});rl(()=>{Z.current.state=xe}),x.useEffect(()=>{if(r)z(null);else{const Oe=j(de);z(()=>Oe)}},[r,de,j]);const ae=(R=c?.coarse)!==null&&R!==void 0?R:15,ye=(B=c?.fine)!==null&&B!==void 0?B:5;x.useEffect(()=>{if(r||$==null)return;const Oe=M.current;Te(Oe,"Element ref not attached");let ce=!1;return U1(de,Oe,Q,{coarse:ae,fine:ye},(F,le,I)=>{if(!le){oe("inactive");return}switch(F){case"down":{oe("drag"),ce=!1,Te(I,'Expected event to be defined for "down" action'),q(de,I);const{onDragging:ne,onPointerDown:ge}=Y.current;ne?.(!0),ge?.();break}case"move":{const{state:ne}=Z.current;ce=!0,ne!=="drag"&&oe("hover"),Te(I,'Expected event to be defined for "move" action'),$(I);break}case"up":{oe("hover"),J();const{onClick:ne,onDragging:ge,onPointerUp:Ae}=Y.current;ge?.(!1),Ae?.(),ce||ne?.();break}}})},[ae,Q,r,ye,j,de,$,q,J]),I1({disabled:r,handleId:de,resizeHandler:$,panelGroupElement:ee});const ve={touchAction:"none",userSelect:"none"};return x.createElement(_,{...A,children:l,className:s,id:d,onBlur:()=>{Se(!1),m?.()},onFocus:()=>{Se(!0),y?.()},ref:M,role:"separator",style:{...ve,...v},tabIndex:b,[it.groupDirection]:Q,[it.groupId]:k,[it.resizeHandle]:"",[it.resizeHandleActive]:xe==="drag"?"pointer":Ye?"keyboard":void 0,[it.resizeHandleEnabled]:!r,[it.resizeHandleId]:de,[it.resizeHandleState]:xe})}Zc.displayName="PanelResizeHandle";const ts=x.forwardRef(({className:l,children:s,...r},c)=>o.jsxs(Yp,{ref:c,className:V("relative overflow-hidden",l),...r,children:[o.jsx(Bx,{className:"h-full w-full rounded-[inherit]",children:s}),o.jsx(Rg,{}),o.jsx(Hx,{})]}));ts.displayName=Yp.displayName;const Rg=x.forwardRef(({className:l,orientation:s="vertical",...r},c)=>o.jsx(Gp,{ref:c,orientation:s,className:V("flex touch-none select-none transition-colors",s==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",l),...r,children:o.jsx(qx,{className:"relative flex-1 rounded-full bg-border"})}));Rg.displayName=Gp.displayName;function P1(l){const s={provider:"unknown",endpoint:"unknown",timestamp:new Date,raw:l},r=l.match(/error-api-provider-([^-]+)-/);r&&(s.provider=r[1]);const c=l.match(/-api-([a-z_]+(?:-[a-z_]+)*)-\d{4}-\d{2}-\d{2}T/i);c&&(s.endpoint=c[1].replace(/-/g,"/"));const d=l.match(/(\d{4}-\d{2}-\d{2}T\d{6})/);if(d){const m=d[1],h=`${m.slice(0,10)}T${m.slice(11,13)}:${m.slice(13,15)}:${m.slice(15,17)}`;s.timestamp=new Date(h)}return s}function eN(l){const s={version:"",url:"",method:"",timestamp:"",statusCode:0,statusText:"",requestHeaders:{},requestBody:"",responseHeaders:{},responseBody:"",provider:"",endpoint:"",isClientError:!1,isServerError:!1,errorType:"unknown"},r=l.split(/^===\s*(.+?)\s*===$/m);let c="";for(let d=0;d<r.length;d++){const m=r[d].trim();if(m==="REQUEST INFO"){c="request_info";continue}else if(m==="HEADERS"){c="headers";continue}else if(m==="REQUEST BODY"){c="request_body";continue}else if(m==="RESPONSE"){c="response";continue}switch(c){case"request_info":tN(m,s);break;case"headers":s.requestHeaders=nN(m);break;case"request_body":s.requestBody=m;break;case"response":aN(m,s);break}}return lN(s),s}function tN(l,s){const r=l.split(`
11
+ `);for(const c of r){const[d,...m]=c.split(":"),h=m.join(":").trim();switch(d?.trim()?.toLowerCase()){case"version":s.version=h;break;case"url":s.url=h;break;case"method":s.method=h;break;case"timestamp":s.timestamp=h;break}}}function nN(l){const s={},r=l.split(`
12
+ `);for(const c of r){const d=c.indexOf(":");if(d>0){const m=c.slice(0,d).trim(),h=c.slice(d+1).trim();m&&(s[m]=h)}}return s}function aN(l,s){const r=l.split(`
13
+ `);let c=!1;const d=[];for(const m of r){if(m.startsWith("Status:")){const p=m.replace("Status:","").trim().split(/\s+/);s.statusCode=parseInt(p[0],10)||0,s.statusText=p.slice(1).join(" ")||sN(s.statusCode);continue}if(m.trim()===""&&!c){c=!0;continue}if(c)d.push(m);else{const h=m.indexOf(":");if(h>0){const p=m.slice(0,h).trim(),y=m.slice(h+1).trim();p&&(s.responseHeaders[p]=y)}}}s.responseBody=d.join(`
14
+ `).trim()}function lN(l){const s=l.url.match(/\/api\/provider\/([^/]+)/);s&&(l.provider=s[1]);const r=l.url.match(/\/api\/provider\/[^/]+\/api\/(.+)/);r&&(l.endpoint=r[1]),l.isClientError=l.statusCode>=400&&l.statusCode<500,l.isServerError=l.statusCode>=500,l.statusCode===429?l.errorType="rate_limit":l.statusCode===401||l.statusCode===403?l.errorType="auth":l.statusCode===404?l.errorType="not_found":l.statusCode>=500?l.errorType="server":(l.statusCode===408||l.statusCode===504)&&(l.errorType="timeout")}function sN(l){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"}[l]||""}function iN(l){const s=Date.now(),r=l*1e3,c=s-r,d=Math.floor(c/1e3),m=Math.floor(d/60),h=Math.floor(m/60),p=Math.floor(h/24);return d<60?"just now":m<60?`${m}m ago`:h<24?`${h}h ago`:p<7?`${p}d ago`:new Date(r).toLocaleDateString("en-US",{month:"short",day:"numeric"})}function oN(l){return l<1024?`${l} B`:l<1024*1024?`${(l/1024).toFixed(1)} KB`:`${(l/(1024*1024)).toFixed(1)} MB`}function rN(l){return l>=500?"text-red-500":l===429?"text-orange-500":l>=400?"text-yellow-500":"text-gray-500"}function uN(l){return{rate_limit:"Rate Limited",auth:"Auth Error",not_found:"Not Found",server:"Server Error",timeout:"Timeout",unknown:"Error"}[l]||"Error"}function cN({name:l,size:s,modified:r,isSelected:c,onClick:d}){const m=x.useMemo(()=>P1(l),[l]);return o.jsxs("button",{onClick:d,className:V("w-full px-3 py-2.5 flex items-start gap-3 text-left transition-colors","hover:bg-muted/40 border-l-[3px]",c?"bg-muted/50 border-l-amber-500":"border-l-transparent"),children:[o.jsx(Gc,{provider:m.provider,size:24,withBackground:!0,className:"shrink-0 mt-0.5"}),o.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[o.jsxs("div",{className:"flex flex-col gap-0.5",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx("span",{className:"text-xs font-semibold text-foreground truncate",children:m.provider}),o.jsx("span",{className:V("text-[9px] px-1 rounded border",c?"bg-amber-500/10 text-amber-600 border-amber-500/20":"bg-muted border-border text-muted-foreground"),children:"LOG"})]}),o.jsx("span",{className:"text-[11px] text-muted-foreground truncate font-medium",title:m.endpoint,children:m.endpoint})]}),o.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-muted-foreground/80 mt-1",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(lb,{className:"w-3 h-3"}),iN(r)]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(rg,{className:"w-3 h-3"}),oN(s)]})]})]})]})}function bp({value:l,className:s,variant:r="outline",size:c="icon",label:d="Copy to clipboard"}){const[m,h]=x.useState(!1),p=()=>{navigator.clipboard.writeText(l),h(!0),setTimeout(()=>h(!1),2e3)};return o.jsx(Uc,{children:o.jsxs(Zo,{children:[o.jsx(Wo,{asChild:!0,children:o.jsxs(St,{size:c,variant:r,className:V("relative z-10 text-muted-foreground hover:text-foreground",s),onClick:y=>{y.stopPropagation(),p()},children:[m?o.jsx(es,{className:"h-3.5 w-3.5 text-green-500"}):o.jsx(_o,{className:"h-3.5 w-3.5"}),o.jsx("span",{className:"sr-only",children:d})]})}),o.jsx(Jo,{children:o.jsx("p",{children:m?"Copied!":d})})]})})}function Ps({active:l,onClick:s,children:r,icon:c}){return o.jsxs("button",{onClick:s,className:V("px-2.5 py-1.5 text-xs font-medium rounded transition-colors flex items-center gap-1.5",l?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:[c&&o.jsx(c,{className:"w-3.5 h-3.5"}),r]})}function Ug({code:l}){const s=rN(l);return o.jsx("span",{className:V("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",s),children:l})}function dN({parsed:l}){return o.jsxs("div",{className:"p-4 space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Ug,{code:l.statusCode}),o.jsx("span",{className:"text-sm font-medium",children:l.statusText}),o.jsx("span",{className:"text-xs text-muted-foreground px-2 py-0.5 rounded bg-muted/50",children:uN(l.errorType)})]}),o.jsxs("div",{className:"grid grid-cols-4 gap-3 text-xs",children:[o.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[o.jsx("div",{className:"text-muted-foreground mb-1",children:"Method"}),o.jsx("div",{className:"font-medium",children:l.method||"N/A"})]}),o.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[o.jsx("div",{className:"text-muted-foreground mb-1",children:"Provider"}),o.jsx("div",{className:"font-medium",children:l.provider||"N/A"})]}),o.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[o.jsx("div",{className:"text-muted-foreground mb-1",children:"Version"}),o.jsx("div",{className:"font-medium",children:l.version||"N/A"})]}),o.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[o.jsx("div",{className:"text-muted-foreground mb-1",children:"Endpoint"}),o.jsx("div",{className:"font-medium truncate",title:l.endpoint,children:l.endpoint||"N/A"})]})]}),o.jsxs("div",{className:"text-xs",children:[o.jsx("div",{className:"text-muted-foreground mb-1.5",children:"URL"}),o.jsx("div",{className:"font-mono p-2.5 rounded bg-muted/30 border border-border/50 break-all leading-relaxed",children:l.url||"N/A"})]}),o.jsxs("div",{className:"text-xs",children:[o.jsx("div",{className:"text-muted-foreground mb-1.5",children:"Timestamp"}),o.jsx("div",{className:"font-mono",children:l.timestamp||"N/A"})]}),l.errorType!=="unknown"&&o.jsxs("div",{className:"flex items-start gap-3 p-3 rounded bg-blue-500/10 border border-blue-500/20 text-xs",children:[o.jsx(Vo,{className:"w-4 h-4 mt-0.5 text-blue-500 shrink-0"}),o.jsxs("div",{className:"text-blue-500/90 leading-relaxed",children:[l.errorType==="rate_limit"&&"Rate limited. Consider using multiple accounts or reducing request frequency.",l.errorType==="auth"&&"Authentication failed. Check credentials or re-authenticate with the provider.",l.errorType==="not_found"&&"Endpoint not found. This endpoint may not exist on this provider.",l.errorType==="server"&&"Server error from upstream. Retry or check provider status.",l.errorType==="timeout"&&"Request timed out. Check network or increase timeout settings."]})]})]})}function fN({headers:l}){const s=Object.entries(l);return s.length===0?o.jsx("div",{className:"p-4 text-xs text-muted-foreground",children:"No headers available"}):o.jsx(ts,{className:"h-full",children:o.jsx("div",{className:"p-4 space-y-1",children:s.map(([r,c])=>o.jsxs("div",{className:"flex gap-3 text-xs font-mono py-1.5 border-b border-border/30 last:border-0",children:[o.jsxs("span",{className:"text-muted-foreground shrink-0 min-w-[140px]",children:[r,":"]}),o.jsx("span",{className:"break-all",children:c})]},r))})})}function Sp({content:l,label:s}){if(!l||l.trim()==="")return o.jsxs("div",{className:"p-4 text-xs text-muted-foreground",children:["No ",s.toLowerCase()," body"]});let r=l,c=!1;try{const d=JSON.parse(l);r=JSON.stringify(d,null,2),c=!0}catch{}return o.jsx(ts,{className:"h-full",children:o.jsx("pre",{className:V("p-4 text-xs font-mono whitespace-pre-wrap break-all leading-relaxed",c?"text-emerald-700 dark:text-green-400":"text-zinc-700 dark:text-muted-foreground"),children:r})})}function mN({content:l}){return o.jsx(ts,{className:"h-full",children:o.jsx("pre",{className:"p-4 text-xs font-mono text-zinc-700 dark:text-muted-foreground whitespace-pre-wrap break-all leading-relaxed",children:l})})}function hN({name:l,absolutePath:s}){const[r,c]=x.useState("overview"),{data:d,isLoading:m,error:h}=y1(l),p=x.useMemo(()=>d?eN(d):null,[d]);return l?m?o.jsxs("div",{className:"flex-1 p-6 space-y-3",children:[o.jsx(Le,{className:"h-5 w-full"}),o.jsx(Le,{className:"h-5 w-3/4"}),o.jsx(Le,{className:"h-5 w-5/6"}),o.jsx(Le,{className:"h-5 w-2/3"})]}):h||!d||!p?o.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:o.jsx("p",{className:"text-sm",children:"Failed to load log content"})}):o.jsxs("div",{className:"flex-1 flex flex-col min-w-0 h-full",children:[o.jsxs("div",{className:"px-4 py-3 border-b border-border bg-muted/30 flex items-center justify-between gap-3 shrink-0",children:[o.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[o.jsx(Ug,{code:p.statusCode}),o.jsxs("span",{className:"text-xs font-semibold truncate text-foreground",children:[p.provider,"/",p.endpoint||"unknown"]}),l&&o.jsx(bp,{value:s||l,label:"Copy absolute path",size:"icon-sm",className:"ml-1 text-muted-foreground hover:text-foreground opacity-50 hover:opacity-100 transition-opacity"})]}),o.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[d&&o.jsx(bp,{value:d,label:"Copy raw log content",variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-foreground"}),o.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})]})]}),o.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:[o.jsx(Ps,{active:r==="overview",onClick:()=>c("overview"),icon:Vo,children:"Overview"}),o.jsx(Ps,{active:r==="headers",onClick:()=>c("headers"),icon:ib,children:"Headers"}),o.jsx(Ps,{active:r==="request",onClick:()=>c("request"),icon:ob,children:"Request"}),o.jsx(Ps,{active:r==="response",onClick:()=>c("response"),icon:rb,children:"Response"}),o.jsx(Ps,{active:r==="raw",onClick:()=>c("raw"),icon:rg,children:"Raw"})]}),o.jsxs("div",{className:"flex-1 overflow-hidden bg-card/30",children:[r==="overview"&&o.jsx(dN,{parsed:p}),r==="headers"&&o.jsx(fN,{headers:p.requestHeaders}),r==="request"&&o.jsx(Sp,{content:p.requestBody,label:"Request"}),r==="response"&&o.jsx(Sp,{content:p.responseBody,label:"Response"}),r==="raw"&&o.jsx(mN,{content:d})]})]}):o.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:o.jsxs("div",{className:"text-center space-y-3",children:[o.jsx(sb,{className:"w-10 h-10 mx-auto opacity-40"}),o.jsx("p",{className:"text-sm",children:"Select a log to view details"})]})})}function pN(){const{data:l,isLoading:s}=f1(),{data:r,isLoading:c,error:d}=g1(l?.running??!1),[m,h]=x.useState(500),[p,y]=x.useState(!1),S=x.useRef(null),w=x.useRef(null),v=()=>{w.current&&(clearInterval(w.current),w.current=null)};x.useEffect(()=>{if(!p)return;const G=k=>{const j=S.current;if(!j)return;const J=j.getBoundingClientRect().top+window.scrollY,ee=k.pageY-J;h(Math.max(300,ee));const xe=window.innerHeight-k.clientY,oe=15;v(),xe<50?w.current=setInterval(()=>{window.scrollBy(0,oe)},16):k.clientY<50&&(w.current=setInterval(()=>{window.scrollBy(0,-oe)},16))},Q=()=>{y(!1),v(),document.body.style.cursor="default",document.body.style.userSelect="auto"};return document.addEventListener("mousemove",G),document.addEventListener("mouseup",Q),document.body.style.cursor="row-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",Q),document.body.style.cursor="default",document.body.style.userSelect="auto",v()}},[p]);const b=G=>{G.preventDefault(),y(!0)},_=x.useMemo(()=>r?.[0]?.name??null,[r]),[A,R]=x.useState(null),B=A??_,M=x.useMemo(()=>!B||!r?void 0:r.find(Q=>Q.name===B)?.absolutePath,[B,r]);if(s||!l?.running)return null;if(c)return o.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:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[o.jsx(Le,{className:"h-4 w-32"}),o.jsx(Le,{className:"h-4 w-20"})]}),o.jsx("div",{className:"p-4 space-y-3",children:[1,2,3].map(G=>o.jsx(Le,{className:"h-12 w-full rounded-lg"},G))})]});if(!r||r.length===0)return null;const Y=r.length;return o.jsxs("div",{ref:S,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:m},children:[o.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:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(Dc,{className:"w-4 h-4 text-amber-500"}),o.jsx("span",{className:"text-sm font-semibold tracking-tight",children:"Error Logs"}),o.jsxs("span",{className:"text-xs text-muted-foreground ml-1",children:[Y," failed request",Y!==1?"s":""]})]}),o.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[o.jsx(ub,{className:"w-3.5 h-3.5"}),o.jsx("span",{children:"CLIProxy Diagnostics"})]})]}),o.jsx("div",{className:"flex-1 min-h-0",children:o.jsxs(Xc,{direction:"horizontal",children:[o.jsx(ii,{defaultSize:30,minSize:20,maxSize:50,className:"flex flex-col min-w-0",children:o.jsxs(ts,{className:"h-full",children:[o.jsx("div",{className:"divide-y divide-border/50",children:r.slice(0,50).map(G=>o.jsx(cN,{name:G.name,size:G.size,modified:G.modified,isSelected:B===G.name,onClick:()=>R(G.name)},G.name))}),r.length>50&&o.jsxs("div",{className:"px-3 py-3 text-center text-[10px] text-muted-foreground border-t border-border/50",children:["Showing 50 of ",r.length," logs"]})]})}),o.jsxs(Zc,{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:[o.jsx("div",{className:"w-[1px] h-full bg-border group-hover:bg-primary/50 transition-colors"}),o.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:o.jsx(Ko,{className:"h-4 w-4 text-muted-foreground"})})]}),o.jsx(ii,{className:"flex flex-col min-w-0 bg-background/50",children:o.jsx(hN,{name:B,absolutePath:M})})]})}),d?o.jsx("div",{className:"px-4 py-2 border-t border-border text-xs text-destructive bg-destructive/5 shrink-0",children:d.message}):o.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:b,children:o.jsx(cb,{className:"w-8 h-3 text-border group-hover:text-primary/50 transition-colors"})})]})}const gN=Ho("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"}}),Bg=x.forwardRef(({className:l,variant:s,...r},c)=>o.jsx("div",{ref:c,role:"alert",className:V(gN({variant:s}),l),...r}));Bg.displayName="Alert";const Hg=x.forwardRef(({className:l,...s},r)=>o.jsx("h5",{ref:r,className:V("mb-1 font-medium leading-none tracking-tight",l),...s}));Hg.displayName="AlertTitle";const qg=x.forwardRef(({className:l,...s},r)=>o.jsx("div",{ref:r,className:V("text-sm [&_p]:leading-relaxed",l),...s}));qg.displayName="AlertDescription";function yN(){return Ot({queryKey:["overview"],queryFn:async()=>(await fetch("/api/overview")).json()})}function vN(){return Ot({queryKey:["shared","summary"],queryFn:async()=>(await fetch("/api/shared/summary")).json()})}function OC(l){return Ot({queryKey:["shared",l],queryFn:async()=>(await fetch(`/api/shared/${l}`)).json()})}const xN={ok:"success",warning:"warning",error:"error"},bN={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 zo({title:l,value:s,icon:r,variant:c="default",onClick:d}){const m=bN[c];return o.jsxs("button",{onClick:d,className:V("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:[o.jsx("div",{className:V("flex items-center justify-center w-9 h-9 rounded-md",m.iconBg),children:o.jsx(r,{className:V("w-4 h-4",m.iconColor)})}),o.jsxs("div",{className:"text-left",children:[o.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:l}),o.jsx("p",{className:V("text-lg font-bold font-mono leading-tight",m.iconColor),children:s})]})]})}function SN(){const l=l0(),{data:s,isLoading:r}=yN(),{data:c,isLoading:d}=vN();if(r||d)return o.jsxs("div",{className:"p-6 space-y-6",children:[o.jsxs("div",{className:"rounded-xl border p-6 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(Le,{className:"h-12 w-12 rounded-lg"}),o.jsxs("div",{children:[o.jsx(Le,{className:"h-7 w-[180px] mb-2"}),o.jsx(Le,{className:"h-4 w-[220px]"})]})]}),o.jsx("div",{className:"flex items-center gap-3",children:[1,2,3,4].map(h=>o.jsx(Le,{className:"h-14 w-28 rounded-lg"},h))})]}),o.jsxs("div",{className:"border rounded-xl overflow-hidden",children:[o.jsxs("div",{className:"px-4 py-2.5 border-b flex items-center justify-between",children:[o.jsx(Le,{className:"h-4 w-32"}),o.jsx(Le,{className:"h-4 w-20"})]}),o.jsx("div",{className:"px-4 py-3 border-b",children:o.jsx(Le,{className:"h-2 w-full rounded-full"})}),[1,2,3].map(h=>o.jsxs("div",{className:"px-4 py-2.5 flex items-center gap-3 border-b last:border-b-0",children:[o.jsx(Le,{className:"w-2.5 h-2.5 rounded-full"}),o.jsx(Le,{className:"h-4 flex-1"}),o.jsx(Le,{className:"h-1.5 w-24 rounded-full"}),o.jsx(Le,{className:"h-4 w-16"})]},h))]})]});const m=s?.health?xN[s.health.status]:void 0;return o.jsxs("div",{className:"p-6 space-y-6",children:[o.jsxs("div",{className:"relative overflow-hidden rounded-xl border bg-gradient-to-br from-background via-background to-muted/30",children:[o.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",children:o.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0)",backgroundSize:"24px 24px"}})}),o.jsxs("div",{className:"relative p-6 flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4",children:[o.jsx(qS,{version:s?.version}),o.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[o.jsx(zo,{title:"Profiles",value:s?.profiles??0,icon:tg,variant:"accent",onClick:()=>l("/providers")}),o.jsx(zo,{title:"CLIProxy",value:s?.cliproxy??0,icon:ng,variant:"accent",onClick:()=>l("/cliproxy")}),o.jsx(zo,{title:"Accounts",value:s?.accounts??0,icon:sg,variant:"default",onClick:()=>l("/accounts")}),o.jsx(zo,{title:"Health",value:s?.health?`${s.health.passed}/${s.health.total}`:"-",icon:si,variant:m,onClick:()=>l("/health")})]})]})]}),c?.symlinkStatus&&!c.symlinkStatus.valid&&o.jsxs(Bg,{variant:"warning",children:[o.jsx(Dc,{className:"h-4 w-4"}),o.jsx(Hg,{children:"Configuration Required"}),o.jsx(qg,{children:c.symlinkStatus.message})]}),o.jsx(C1,{}),o.jsx(pN,{})]})}const Lg=Lx,Wc=x.forwardRef(({className:l,...s},r)=>o.jsx(Kp,{ref:r,className:V("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",l),...s}));Wc.displayName=Kp.displayName;const il=x.forwardRef(({className:l,...s},r)=>o.jsx(Vp,{ref:r,className:V("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",l),...s}));il.displayName=Vp.displayName;const zc=x.forwardRef(({className:l,...s},r)=>o.jsx(Qp,{ref:r,className:V("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",l),...s}));zc.displayName=Qp.displayName;function Dn({className:l,...s}){return o.jsx(Yx,{"data-slot":"label",className:V("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",l),...s})}const Jc="ccs:openrouter-models",NN=1440*60*1e3,Yg="1";function Tc(l){const s=parseFloat(l);return isNaN(s)||s===0?0:s*1e6}function Np(l){const s=Tc(l);return s===0?"Free":s<.01?"<$0.01":s<1?`$${s.toFixed(2)}`:`$${s.toFixed(s<10?2:0)}`}function jN(l){const s=Np(l.prompt),r=Np(l.completion);return s==="Free"&&r==="Free"?"Free":`${s}/${r}`}function CN(l){const s=l.id.toLowerCase();return s.startsWith("anthropic/")?"anthropic":s.startsWith("openai/")?"openai":s.startsWith("google/")?"google":s.startsWith("meta-llama/")||s.startsWith("meta/")?"meta":s.startsWith("mistralai/")?"mistral":s.includes(":free")||s.includes("qwen")||s.includes("deepseek")?"opensource":"other"}function EN(l){return{...l,category:CN(l),pricePerMillionPrompt:Tc(l.pricing.prompt),pricePerMillionCompletion:Tc(l.pricing.completion),isFree:l.pricing.prompt==="0"&&l.pricing.completion==="0",isExacto:l.id.includes(":exacto")}}function wN(l,s,r){const c=s.toLowerCase().trim();return l.filter(d=>r?.category&&d.category!==r.category||r?.freeOnly&&!d.isFree||r?.minContext&&d.context_length<r.minContext?!1:c?d.id.toLowerCase().includes(c)||d.name.toLowerCase().includes(c)||d.description?.toLowerCase().includes(c):!0)}function AC(l){return[...l].sort((s,r)=>{if(s.isFree&&!r.isFree)return-1;if(!s.isFree&&r.isFree)return 1;if(!s.isFree&&!r.isFree){if(s.isExacto&&!r.isExacto)return-1;if(!s.isExacto&&r.isExacto)return 1}return s.name.localeCompare(r.name)})}function MN(){try{const l=localStorage.getItem(Jc);if(!l)return null;const s=JSON.parse(l);return s.version!==Yg||Date.now()-s.fetchedAt>NN?null:s.models}catch{return null}}function zN(l){try{localStorage.setItem(Jc,JSON.stringify({models:l,fetchedAt:Date.now(),version:Yg}))}catch{}}function TN(){localStorage.removeItem(Jc)}function DC(l,s){const[r]=l.split("/");if(!r)return{};const c=s.filter(h=>h.id.startsWith(`${r}/`));if(c.length===0)return{};const d=[...c].sort((h,p)=>p.pricePerMillionPrompt-h.pricePerMillionPrompt),m=Math.ceil(d.length/3);return{opus:d[0]?.id,sonnet:d[Math.min(m,d.length-1)]?.id,haiku:d[d.length-1]?.id}}function ON(l){return l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${Math.round(l/1e3)}K`:String(l)}const _C={anthropic:"Anthropic (Claude)",openai:"OpenAI (GPT)",google:"Google (Gemini)",meta:"Meta (Llama)",mistral:"Mistral",opensource:"Open Source",other:"Other"},AN={anthropic:["anthropic/"],openai:["openai/"],google:["google/"],meta:["meta-llama/","meta/"],mistral:["mistralai/"],opensource:["deepseek/","qwen/","cohere/"],other:[]};function DN(l,s=2){const r=[],c=["anthropic","openai","google","meta","mistral","opensource"];for(const d of c){const m=AN[d];if(m.length===0)continue;const p=[...l.filter(y=>m.some(S=>y.id.toLowerCase().startsWith(S)))].sort((y,S)=>(S.created??0)-(y.created??0));r.push(...p.slice(0,s))}return r.sort((d,m)=>(m.created??0)-(d.created??0))}function _N(l){const r=Date.now()/1e3-l;return r<86400?"Today":r<172800?"Yesterday":r<604800?`${Math.floor(r/86400)}d ago`:r<2592e3?`${Math.floor(r/604800)}w ago`:r<31536e3?`${Math.floor(r/2592e3)}mo ago`:`${Math.floor(r/31536e3)}y ago`}const kN="https://openrouter.ai/api/v1/models",Gg=["openrouter-models"],jp=1440*60*1e3;async function RN(){const l=await fetch(kN);if(!l.ok)throw new Error(`Failed to fetch OpenRouter models: ${l.status}`);const r=(await l.json()).data;return zN(r),r}function Kg(){return Ot({queryKey:Gg,queryFn:RN,staleTime:jp,gcTime:jp,initialData:()=>MN()??void 0,refetchOnWindowFocus:!1})}function UN(){const l=Kg(),s=(l.data??[]).map(EN);return{...l,models:s}}function kC(){const l=Gt();return()=>(TN(),l.invalidateQueries({queryKey:Gg}))}function RC(){const{data:l,isLoading:s,isError:r}=Kg();return{isReady:!!l&&l.length>0,isLoading:s,isError:r,modelCount:l?.length??0}}function Vg({profileEnv:l={}}){const[s,r]=x.useState(null),[c,d]=x.useState(!0),[m,h]=x.useState(!1);x.useEffect(()=>{p()},[]);const p=async()=>{try{d(!0);const b=await fetch("/api/global-env");if(!b.ok)throw new Error("Failed to load");const _=await b.json();r(_)}catch{r(null)}finally{d(!1)}};if(c||!s?.enabled)return null;const y=s.env||{},S=Object.keys(y);if(S.length===0)return null;const w=S.filter(b=>!(b in l)),v=S.filter(b=>b in l);return o.jsxs("div",{className:"border-t bg-muted/20",children:[o.jsxs("button",{onClick:()=>h(!m),className:"w-full px-4 py-2 flex items-center gap-2 hover:bg-muted/30 transition-colors",children:[o.jsx(Vo,{className:"w-4 h-4 text-blue-500"}),o.jsxs("span",{className:"text-xs text-muted-foreground flex-1 text-left",children:[o.jsx("span",{className:"font-medium text-foreground",children:w.length})," global env var",w.length!==1?"s":""," will be injected at runtime",v.length>0&&o.jsxs("span",{className:"text-amber-600 dark:text-amber-400 ml-1",children:["(",v.length," overridden by profile)"]})]}),m?o.jsx(_c,{className:"w-4 h-4 text-muted-foreground"}):o.jsx(Qo,{className:"w-4 h-4 text-muted-foreground"})]}),m&&o.jsxs("div",{className:"px-4 pb-3 space-y-2",children:[w.length>0&&o.jsx("div",{className:"space-y-1",children:w.map(b=>o.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:[o.jsx("span",{className:"text-green-500",children:"+"}),o.jsxs("span",{className:"truncate",children:[b,"=",y[b]]})]},b))}),v.length>0&&o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:"Skipped (profile already defines):"}),v.map(b=>o.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:[o.jsx("span",{className:"text-amber-500",children:"~"}),o.jsx("span",{className:"truncate",children:b})]},b))]}),o.jsx("div",{className:"pt-2 border-t border-border/50",children:o.jsx(St,{variant:"ghost",size:"sm",asChild:!0,className:"h-7 text-xs gap-1.5 -ml-2",children:o.jsxs(wc,{to:"/settings?tab=globalenv",children:[o.jsx(kc,{className:"w-3.5 h-3.5"}),"Configure in Settings",o.jsx(og,{className:"w-3 h-3 opacity-50"})]})})})]})]})}const BN=x.lazy(()=>At(()=>Promise.resolve().then(()=>Wg),void 0).then(l=>({default:l.CodeEditor})));function UC({rawJsonContent:l,isRawJsonValid:s,rawJsonEdits:r,settings:c,onChange:d}){return o.jsx(x.Suspense,{fallback:o.jsxs("div",{className:"flex items-center justify-center h-full",children:[o.jsx(ci,{className:"w-6 h-6 animate-spin text-muted-foreground"}),o.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading editor..."})]}),children:o.jsxs("div",{className:"h-full flex flex-col",children:[!s&&r!==null&&o.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:[o.jsx(ui,{className:"w-4 h-4"}),"Invalid JSON syntax"]}),o.jsx("div",{className:"flex-1 overflow-hidden px-6 pb-4 pt-4",children:o.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:o.jsx(BN,{value:l,onChange:d,language:"json",minHeight:"100%"})})}),o.jsx("div",{className:"mx-6 mb-4",children:o.jsx("div",{className:"border rounded-md overflow-hidden",children:o.jsx(Vg,{profileEnv:c?.env})})})]})})}function Cp(l,s){try{var r=l()}catch(c){return s(c)}return r&&r.then?r.then(void 0,s):r}function HN(l,s){for(var r={};l.length;){var c=l[0],d=c.code,m=c.message,h=c.path.join(".");if(!r[h])if("unionErrors"in c){var p=c.unionErrors[0].errors[0];r[h]={message:p.message,type:p.code}}else r[h]={message:m,type:d};if("unionErrors"in c&&c.unionErrors.forEach(function(w){return w.errors.forEach(function(v){return l.push(v)})}),s){var y=r[h].types,S=y&&y[c.code];r[h]=ug(h,s,r,d,S?[].concat(S,c.message):c.message)}l.shift()}return r}function qN(l,s){for(var r={};l.length;){var c=l[0],d=c.code,m=c.message,h=c.path.join(".");if(!r[h])if(c.code==="invalid_union"&&c.errors.length>0){var p=c.errors[0][0];r[h]={message:p.message,type:p.code}}else r[h]={message:m,type:d};if(c.code==="invalid_union"&&c.errors.forEach(function(w){return w.forEach(function(v){return l.push(v)})}),s){var y=r[h].types,S=y&&y[c.code];r[h]=ug(h,s,r,d,S?[].concat(S,c.message):c.message)}l.shift()}return r}function LN(l,s,r){if(r===void 0&&(r={}),(function(c){return"_def"in c&&typeof c._def=="object"&&"typeName"in c._def})(l))return function(c,d,m){try{return Promise.resolve(Cp(function(){return Promise.resolve(l[r.mode==="sync"?"parse":"parseAsync"](c,s)).then(function(h){return m.shouldUseNativeValidation&&Ih({},m),{errors:{},values:r.raw?Object.assign({},c):h}})},function(h){if((function(p){return Array.isArray(p?.issues)})(h))return{values:{},errors:Ph(HN(h.errors,!m.shouldUseNativeValidation&&m.criteriaMode==="all"),m)};throw h}))}catch(h){return Promise.reject(h)}};if((function(c){return"_zod"in c&&typeof c._zod=="object"})(l))return function(c,d,m){try{return Promise.resolve(Cp(function(){return Promise.resolve((r.mode==="sync"?gb:yb)(l,c,s)).then(function(h){return m.shouldUseNativeValidation&&Ih({},m),{errors:{},values:r.raw?Object.assign({},c):h}})},function(h){if((function(p){return p instanceof vb})(h))return{values:{},errors:Ph(qN(h.issues,!m.shouldUseNativeValidation&&m.criteriaMode==="all"),m)};throw h}))}catch(h){return Promise.reject(h)}};throw new Error("Invalid input: not a Zod schema")}function BC(){return Ot({queryKey:["profiles"],queryFn:()=>yt.profiles.list()})}function YN(){const l=Gt();return gn({mutationFn:s=>yt.profiles.create(s),onSuccess:()=>{l.invalidateQueries({queryKey:["profiles"]}),Ce.success("Profile created successfully")},onError:s=>{Ce.error(s.message)}})}function HC(){const l=Gt();return gn({mutationFn:s=>yt.profiles.delete(s),onSuccess:()=>{l.invalidateQueries({queryKey:["profiles"]}),Ce.success("Profile deleted successfully")},onError:s=>{Ce.error(s.message)}})}const GN="https://openrouter.ai/api",Do=[{id:"openrouter",name:"OpenRouter",description:"349+ models from OpenAI, Anthropic, Google, Meta",baseUrl:GN,defaultProfileName:"openrouter",badge:"349+ models",featured:!0,icon:"/icons/openrouter.svg",defaultModel:"anthropic/claude-opus-4.5",requiresApiKey:!0,apiKeyPlaceholder:"sk-or-...",apiKeyHint:"Get your API key at openrouter.ai/keys",category:"recommended"},{id:"glm",name:"GLM",description:"Claude via Z.AI",baseUrl:"https://api.z.ai/api/anthropic",defaultProfileName:"glm",badge:"Z.AI",defaultModel:"glm-4.7",requiresApiKey:!0,apiKeyPlaceholder:"ghp_...",apiKeyHint:"Get your API key from Z.AI",category:"alternative"},{id:"glmt",name:"GLMT",description:"GLM with Thinking mode support",baseUrl:"https://api.z.ai/api/coding/paas/v4/chat/completions",defaultProfileName:"glmt",badge:"Thinking",defaultModel:"glm-4.7",requiresApiKey:!0,apiKeyPlaceholder:"ghp_...",apiKeyHint:"Same API key as GLM",category:"alternative"},{id:"kimi",name:"Kimi",description:"Moonshot AI - Fast reasoning model",baseUrl:"https://api.kimi.com/coding/",defaultProfileName:"kimi",badge:"Reasoning",defaultModel:"kimi-k2-thinking-turbo",requiresApiKey:!0,apiKeyPlaceholder:"sk-...",apiKeyHint:"Get your API key from Moonshot AI",category:"alternative"},{id:"foundry",name:"Azure Foundry",description:"Claude via Microsoft Azure AI Foundry",baseUrl:"https://<your-resource>.services.ai.azure.com/api/anthropic",defaultProfileName:"foundry",badge:"Azure",defaultModel:"claude-sonnet-4-5",requiresApiKey:!0,apiKeyPlaceholder:"YOUR_AZURE_API_KEY",apiKeyHint:"Create resource at ai.azure.com, get API key from Keys tab",category:"alternative"},{id:"minimax",name:"Minimax",description:"M2.1/M2.1-lightning/M2 - multilang coding (1M context)",baseUrl:"https://api.minimax.io/anthropic",defaultProfileName:"minimax",badge:"1M context",defaultModel:"MiniMax-M2.1",requiresApiKey:!0,apiKeyPlaceholder:"YOUR_MINIMAX_API_KEY",apiKeyHint:"Get your API key at platform.minimax.io",category:"alternative"},{id:"deepseek",name:"DeepSeek",description:"V3.2 and R1 reasoning model (128K context)",baseUrl:"https://api.deepseek.com/anthropic",defaultProfileName:"deepseek",badge:"Reasoning",defaultModel:"deepseek-chat",requiresApiKey:!0,apiKeyPlaceholder:"sk-...",apiKeyHint:"Get your API key at platform.deepseek.com",category:"alternative"},{id:"qwen",name:"Qwen",description:"Alibaba Cloud - qwen3-coder-plus (256K context)",baseUrl:"https://dashscope-intl.aliyuncs.com/apps/anthropic",defaultProfileName:"qwen",badge:"Alibaba",defaultModel:"qwen3-coder-plus",requiresApiKey:!0,apiKeyPlaceholder:"sk-...",apiKeyHint:"Get your API key from Alibaba Cloud Model Studio",category:"alternative"}];function To(l){return Do.filter(s=>s.category===l)}const KN=xb({name:ll().min(1,"Name is required").regex(/^[a-zA-Z][a-zA-Z0-9._-]*$/,"Must start with letter, only letters/numbers/.-_"),baseUrl:ll().url("Invalid URL format"),apiKey:ll().min(1,"API key is required"),model:ll().optional(),opusModel:ll().optional(),sonnetModel:ll().optional(),haikuModel:ll().optional()}),VN=["/chat/completions","/v1/messages","/messages","/completions"];function qC({open:l,onOpenChange:s,onSuccess:r,initialMode:c="openrouter"}){const d=YN(),[m,h]=x.useState("basic"),[p,y]=x.useState(null),[S,w]=x.useState(!1),[v,b]=x.useState("openrouter"),[_,A]=x.useState(""),{models:R}=UN(),{register:B,handleSubmit:M,formState:{errors:Y},control:G,reset:Q,setValue:k}=bb({resolver:LN(KN),defaultValues:{name:"",baseUrl:"",apiKey:"",model:"",opusModel:"",sonnetModel:"",haikuModel:""}}),j=Sb({control:G,name:"baseUrl"}),q=x.useMemo(()=>!v||v==="custom"?null:Do.find($=>$.id===v),[v]),J=x.useMemo(()=>_.trim()?[...wN(R,_)].sort((z,Z)=>(Z.created??0)-(z.created??0)).slice(0,20):DN(R,2),[R,_]);x.useEffect(()=>{if(l)if(Q(),h("basic"),y(null),w(!1),A(""),c==="normal")b("custom"),setTimeout(()=>{k("name",""),k("baseUrl","")},0);else{b("openrouter");const $=Do.find(z=>z.id==="openrouter");$&&setTimeout(()=>{k("name",$.defaultProfileName),k("baseUrl",$.baseUrl)},0)}},[l,Q,k,c]);const ee=$=>{b($);const z=Do.find(Z=>Z.id===$);z?(k("name",z.defaultProfileName),k("baseUrl",z.baseUrl),z.defaultModel&&(k("model",z.defaultModel),k("opusModel",z.defaultModel),k("sonnetModel",z.defaultModel),k("haikuModel",z.defaultModel))):(k("name",""),k("baseUrl",""),k("model",""))},de=$=>{k("model",$.id),k("opusModel",$.id),k("sonnetModel",$.id),k("haikuModel",$.id),A($.name),Ce.success(`Applied "${$.name}" to all model tiers`,{duration:2e3})};x.useEffect(()=>{if(j&&v==="custom"){const z=j.toLowerCase();for(const Z of VN)if(z.endsWith(Z)){const ae=j.replace(new RegExp(Z+"$","i"),"");y(`URL ends with "${Z}" - Claude appends this automatically. You likely want: ${ae}`);return}}y(null)},[j,v]);const xe=async $=>{const z={...$};try{await d.mutateAsync(z),Ce.success(`Profile "${z.name}" created`),r(z.name),s(!1)}catch(Z){Ce.error(Z.message||"Failed to create profile")}},oe=!!Y.name||!!Y.baseUrl||!!Y.apiKey,Ye=!!Y.model||!!Y.opusModel||!!Y.sonnetModel||!!Y.haikuModel,Se=v==="openrouter";return o.jsx(Bc,{open:l,onOpenChange:s,children:o.jsxs(Hc,{className:"sm:max-w-[700px] p-0 gap-0 overflow-hidden max-h-[90vh]",children:[o.jsxs(qc,{className:"p-6 pb-4 border-b",children:[o.jsxs(Lc,{className:"flex items-center gap-2",children:[o.jsx(Jh,{className:"w-5 h-5 text-primary"}),"Create API Profile"]}),o.jsx(Yc,{children:"Choose a provider or configure a custom API endpoint."})]}),o.jsxs("form",{onSubmit:M(xe),className:"flex flex-col overflow-hidden",children:[o.jsxs("div",{className:"px-6 py-3 border-b bg-muted/30 space-y-2",children:[o.jsxs("div",{children:[o.jsx(Dn,{className:"text-xs text-muted-foreground mb-1.5 block",children:"Provider"}),o.jsxs("div",{className:"flex gap-2",children:[To("recommended").map($=>o.jsx(Ep,{preset:$,isSelected:v===$.id,onClick:()=>ee($.id)},$.id)),o.jsxs("button",{type:"button",onClick:()=>ee("custom"),className:V("flex items-center gap-2 px-4 py-2 rounded-md border-2 transition-all text-sm font-medium",v==="custom"||To("alternative").some($=>$.id===v)?"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:[o.jsx(kc,{className:"w-4 h-4"}),o.jsx("span",{children:"Custom"})]})]})]}),(v==="custom"||To("alternative").some($=>$.id===v))&&o.jsxs("div",{className:"pt-3 mt-2 border-t border-dashed border-muted-foreground/30",children:[o.jsx(Dn,{className:"text-xs font-medium text-foreground/70 mb-2 block",children:"Quick Templates"}),o.jsx("div",{className:"flex gap-2 flex-wrap",children:To("alternative").map($=>o.jsx(Ep,{preset:$,isSelected:v===$.id,onClick:()=>ee($.id)},$.id))})]})]}),o.jsxs(Lg,{value:m,onValueChange:h,className:"flex flex-col flex-1 overflow-hidden",children:[o.jsx("div",{className:"px-6 pt-4",children:o.jsxs(Wc,{className:"grid w-full grid-cols-2",children:[o.jsxs(il,{value:"basic",className:"relative",children:["Basic Information",oe&&o.jsx("span",{className:"absolute top-1 right-2 w-2 h-2 rounded-full bg-destructive animate-pulse"})]}),o.jsxs(il,{value:"models",className:"relative",children:["Model Configuration",Ye&&o.jsx("span",{className:"absolute top-1 right-2 w-2 h-2 rounded-full bg-destructive animate-pulse"})]})]})}),o.jsxs(ts,{className:"flex-1",children:[o.jsxs(zc,{value:"basic",className:"p-6 space-y-4 mt-0",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs(Dn,{htmlFor:"name",children:["Profile Name ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsx(Ra,{id:"name",...B("name"),placeholder:"my-api",className:"font-mono"}),Y.name?o.jsx("p",{className:"text-xs text-destructive",children:Y.name.message}):o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Used in CLI:"," ",o.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:'ccs my-api "prompt"'})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs(Dn,{htmlFor:"baseUrl",children:["API Base URL ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsx(Ra,{id:"baseUrl",...B("baseUrl"),placeholder:"https://api.example.com/v1"}),Y.baseUrl?o.jsx("p",{className:"text-xs text-destructive",children:Y.baseUrl.message}):p?o.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:[o.jsx(Dc,{className:"w-4 h-4 shrink-0 mt-0.5"}),o.jsx("span",{children:p})]}):q?o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Pre-filled from ",q.name,". You can customize if needed."]}):o.jsx("p",{className:"text-xs text-muted-foreground",children:"The endpoint that accepts OpenAI-compatible and Anthropic requests"})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs(Dn,{htmlFor:"apiKey",children:["API Key ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsxs("div",{className:"relative",children:[o.jsx(Ra,{id:"apiKey",type:S?"text":"password",...B("apiKey"),placeholder:q?.apiKeyPlaceholder??"sk-...",className:"pr-10"}),o.jsx(St,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-9 w-9 text-muted-foreground hover:text-foreground",onClick:()=>w(!S),tabIndex:-1,children:S?o.jsx(Lo,{className:"h-4 w-4"}):o.jsx(Yo,{className:"h-4 w-4"})})]}),Y.apiKey?o.jsx("p",{className:"text-xs text-destructive",children:Y.apiKey.message}):q?.apiKeyHint&&o.jsx("p",{className:"text-xs text-muted-foreground",children:q.apiKeyHint})]})]}),o.jsxs(zc,{value:"models",className:"p-6 mt-0 space-y-4",children:[o.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:[o.jsx(Vo,{className:"w-5 h-5 shrink-0 mt-0.5"}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium mb-1",children:"Model Mapping"}),o.jsx("p",{className:"text-xs opacity-90",children:"Map Claude Code tiers (Opus/Sonnet/Haiku) to models supported by your provider."})]})]}),Se&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(Dn,{children:"Search Models"}),o.jsx(Ra,{value:_,onChange:$=>A($.target.value),placeholder:"Type to search (e.g., opus, sonnet, gpt-4o)...",onKeyDown:$=>{$.key==="Enter"&&J.length>0&&($.preventDefault(),de(J[0]))}}),o.jsx("div",{className:"border rounded-md max-h-48 overflow-y-auto",children:J.length===0?o.jsx("p",{className:"text-sm text-muted-foreground p-3 text-center",children:_?`No models found for "${_}"`:"Loading models..."}):o.jsxs("div",{className:"p-1",children:[!_&&o.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 text-xs text-muted-foreground",children:[o.jsx(db,{className:"w-3 h-3 text-accent"}),o.jsx("span",{children:"Newest Models"})]}),J.map($=>o.jsx(QN,{model:$,onClick:()=>de($),showAge:!_},$.id))]})})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs(Dn,{htmlFor:"model",children:["Default Model",o.jsx(Ha,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"ANTHROPIC_MODEL"})]}),o.jsx(Ra,{id:"model",...B("model"),placeholder:q?.defaultModel??"claude-sonnet-4",className:"font-mono text-sm"})]}),o.jsxs("div",{className:"grid gap-3 pt-2 border-t",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs(Dn,{htmlFor:"sonnetModel",className:"text-sm",children:["Sonnet Mapping",o.jsx(Ha,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_SONNET"})]}),o.jsx(Ra,{id:"sonnetModel",...B("sonnetModel"),placeholder:"e.g. gpt-4o, claude-sonnet-4",className:"font-mono text-sm h-9"})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs(Dn,{htmlFor:"opusModel",className:"text-sm",children:["Opus Mapping",o.jsx(Ha,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_OPUS"})]}),o.jsx(Ra,{id:"opusModel",...B("opusModel"),placeholder:"e.g. o1, claude-opus-4.5",className:"font-mono text-sm h-9"})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs(Dn,{htmlFor:"haikuModel",className:"text-sm",children:["Haiku Mapping",o.jsx(Ha,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_HAIKU"})]}),o.jsx(Ra,{id:"haikuModel",...B("haikuModel"),placeholder:"e.g. gpt-4o-mini, claude-3.5-haiku",className:"font-mono text-sm h-9"})]})]})]})]})]}),o.jsxs(TS,{className:"p-6 pt-4 border-t bg-muted/10",children:[o.jsx(St,{type:"button",variant:"outline",onClick:()=>s(!1),children:"Cancel"}),o.jsx(St,{type:"submit",disabled:d.isPending,className:V(d.isPending&&"opacity-80"),children:d.isPending?o.jsxs(o.Fragment,{children:[o.jsx(ci,{className:"w-4 h-4 mr-2 animate-spin"}),"Creating..."]}):o.jsxs(o.Fragment,{children:[o.jsx(Jh,{className:"w-4 h-4 mr-2"}),"Create Profile"]})})]})]})]})]})})}function Ep({preset:l,isSelected:s,onClick:r}){return o.jsxs("button",{type:"button",onClick:r,className:V("flex items-center gap-2 px-3 py-2 rounded-md border transition-all text-sm",s?l.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:[l.icon?o.jsx("img",{src:l.icon,alt:"",className:"w-4 h-4"}):o.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:l.name.charAt(0)}),o.jsx("span",{className:"font-medium",children:l.name}),l.badge&&o.jsx(Ha,{variant:"secondary",className:"text-[10px] px-1.5 py-0 ml-0.5 bg-muted-foreground/10 text-muted-foreground",children:l.badge})]})}function QN({model:l,onClick:s,showAge:r}){return o.jsxs("button",{type:"button",onClick:s,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:[o.jsx("span",{className:"flex-1 truncate",children:l.name}),o.jsxs("span",{className:"text-muted-foreground group-hover:text-accent-foreground/80 ml-2 flex items-center gap-2 text-xs",children:[r&&l.created&&o.jsx(Ha,{variant:"outline",className:"text-[10px] text-accent group-hover:text-accent-foreground/80 group-hover:border-accent-foreground/30",children:_N(l.created)}),l.isFree?o.jsx(Ha,{variant:"secondary",className:"text-xs group-hover:bg-accent-foreground/20 group-hover:text-accent-foreground",children:"Free"}):o.jsx("span",{children:jN(l.pricing)}),o.jsx("span",{children:ON(l.context_length)})]})]})}const LC=Zx,YC=Jx,GC=Wx,XN=x.forwardRef(({className:l,children:s,...r},c)=>o.jsxs(Xp,{ref:c,className:V("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",l),...r,children:[s,o.jsx(Gx,{asChild:!0,children:o.jsx(Qo,{className:"h-4 w-4 opacity-50"})})]}));XN.displayName=Xp.displayName;const Qg=x.forwardRef(({className:l,...s},r)=>o.jsx(Zp,{ref:r,className:V("flex cursor-default items-center justify-center py-1",l),...s,children:o.jsx(_c,{className:"h-4 w-4"})}));Qg.displayName=Zp.displayName;const Xg=x.forwardRef(({className:l,...s},r)=>o.jsx(Wp,{ref:r,className:V("flex cursor-default items-center justify-center py-1",l),...s,children:o.jsx(Qo,{className:"h-4 w-4"})}));Xg.displayName=Wp.displayName;const ZN=x.forwardRef(({className:l,children:s,position:r="popper",...c},d)=>o.jsx(Kx,{children:o.jsxs(Jp,{ref:d,className:V("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",r==="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",l),position:r,...c,children:[o.jsx(Qg,{}),o.jsx(Vx,{className:V("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),o.jsx(Xg,{})]})}));ZN.displayName=Jp.displayName;const WN=x.forwardRef(({className:l,...s},r)=>o.jsx($p,{ref:r,className:V("px-2 py-1.5 text-sm font-semibold",l),...s}));WN.displayName=$p.displayName;const JN=x.forwardRef(({className:l,children:s,...r},c)=>o.jsxs(Fp,{ref:c,className:V("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",l),...r,children:[o.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Qx,{children:o.jsx(es,{className:"h-4 w-4"})})}),o.jsx(Xx,{children:s})]}));JN.displayName=Fp.displayName;const $N=x.forwardRef(({className:l,...s},r)=>o.jsx(Ip,{ref:r,className:V("-mx-1 my-1 h-px bg-muted",l),...s}));$N.displayName=Ip.displayName;const FN=x.lazy(()=>At(()=>Promise.resolve().then(()=>Wg),void 0).then(l=>({default:l.CodeEditor})));function KC({rawJsonContent:l,isRawJsonValid:s,rawJsonEdits:r,onRawJsonChange:c,profileEnv:d}){return o.jsx(x.Suspense,{fallback:o.jsxs("div",{className:"flex items-center justify-center h-full",children:[o.jsx(ci,{className:"w-6 h-6 animate-spin text-muted-foreground"}),o.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading editor..."})]}),children:o.jsxs("div",{className:"h-full flex flex-col",children:[!s&&r!==null&&o.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:[o.jsx(ui,{className:"w-4 h-4"}),"Invalid JSON syntax"]}),o.jsx("div",{className:"flex-1 overflow-hidden px-6 pb-4 pt-4",children:o.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:o.jsx(FN,{value:l,onChange:c,language:"json",minHeight:"100%"})})}),o.jsx("div",{className:"mx-6 mb-4",children:o.jsx("div",{className:"border rounded-md overflow-hidden",children:o.jsx(Vg,{profileEnv:d})})})]})})}var Lt={},wp;function IN(){if(wp)return Lt;wp=1;var l=Lt&&Lt.__assign||function(){return l=Object.assign||function(k){for(var j,q=1,J=arguments.length;q<J;q++){j=arguments[q];for(var ee in j)Object.prototype.hasOwnProperty.call(j,ee)&&(k[ee]=j[ee])}return k},l.apply(this,arguments)},s=Lt&&Lt.__createBinding||(Object.create?(function(k,j,q,J){J===void 0&&(J=q);var ee=Object.getOwnPropertyDescriptor(j,q);(!ee||("get"in ee?!j.__esModule:ee.writable||ee.configurable))&&(ee={enumerable:!0,get:function(){return j[q]}}),Object.defineProperty(k,J,ee)}):(function(k,j,q,J){J===void 0&&(J=q),k[J]=j[q]})),r=Lt&&Lt.__setModuleDefault||(Object.create?(function(k,j){Object.defineProperty(k,"default",{enumerable:!0,value:j})}):function(k,j){k.default=j}),c=Lt&&Lt.__importStar||function(k){if(k&&k.__esModule)return k;var j={};if(k!=null)for(var q in k)q!=="default"&&Object.prototype.hasOwnProperty.call(k,q)&&s(j,k,q);return r(j,k),j},d=Lt&&Lt.__rest||function(k,j){var q={};for(var J in k)Object.prototype.hasOwnProperty.call(k,J)&&j.indexOf(J)<0&&(q[J]=k[J]);if(k!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ee=0,J=Object.getOwnPropertySymbols(k);ee<J.length;ee++)j.indexOf(J[ee])<0&&Object.prototype.propertyIsEnumerable.call(k,J[ee])&&(q[J[ee]]=k[J[ee]]);return q};Object.defineProperty(Lt,"__esModule",{value:!0});var m=c(eg()),h=89,p=90,y=77,S=57,w=219,v=222,b=192,_=100,A=3e3,R=typeof window<"u"&&"navigator"in window&&/Win/i.test(navigator.platform),B=typeof window<"u"&&"navigator"in window&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),M="npm__react-simple-code-editor__textarea",Y=`
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
+ `),G=m.forwardRef(function(j,q){var J=j.autoFocus,ee=j.disabled,de=j.form,xe=j.highlight,oe=j.ignoreTabKey,Ye=oe===void 0?!1:oe,Se=j.insertSpaces,$=Se===void 0?!0:Se,z=j.maxLength,Z=j.minLength,ae=j.name,ye=j.onBlur,ve=j.onClick,Oe=j.onFocus,ce=j.onKeyDown,X=j.onKeyUp,F=j.onValueChange,le=j.padding,I=le===void 0?0:le,ne=j.placeholder,ge=j.preClassName,Ae=j.readOnly,Ge=j.required,ht=j.style,pt=j.tabSize,Ve=pt===void 0?2:pt,et=j.textareaClassName,Dt=j.textareaId,Kt=j.value,Un=d(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"]),Ne=m.useRef({stack:[],offset:-1}),Vt=m.useRef(null),En=m.useState(!0),Qt=En[0],ca=En[1],Bn={paddingTop:typeof I=="object"?I.top:I,paddingRight:typeof I=="object"?I.right:I,paddingBottom:typeof I=="object"?I.bottom:I,paddingLeft:typeof I=="object"?I.left:I},ot=xe(Kt),Xt=function(W,we){return W.substring(0,we).split(`
41
+ `)},Hn=m.useCallback(function(W,we){var fe,Me,tt;we===void 0&&(we=!1);var ie=Ne.current,be=ie.stack,me=ie.offset;if(be.length&&me>-1){Ne.current.stack=be.slice(0,me+1);var ze=Ne.current.stack.length;if(ze>_){var Fe=ze-_;Ne.current.stack=be.slice(Fe,ze),Ne.current.offset=Math.max(Ne.current.offset-Fe,0)}}var pe=Date.now();if(we){var zt=Ne.current.stack[Ne.current.offset];if(zt&&pe-zt.timestamp<A){var Ln=/[^a-z0-9]([a-z0-9]+)$/i,vt=(fe=Xt(zt.value,zt.selectionStart).pop())===null||fe===void 0?void 0:fe.match(Ln),Zt=(Me=Xt(W.value,W.selectionStart).pop())===null||Me===void 0?void 0:Me.match(Ln);if(vt?.[1]&&(!((tt=Zt?.[1])===null||tt===void 0)&&tt.startsWith(vt[1]))){Ne.current.stack[Ne.current.offset]=l(l({},W),{timestamp:pe});return}}}Ne.current.stack.push(l(l({},W),{timestamp:pe})),Ne.current.offset++},[]),qa=m.useCallback(function(){var W=Vt.current;if(W){var we=W.value,fe=W.selectionStart,Me=W.selectionEnd;Hn({value:we,selectionStart:fe,selectionEnd:Me})}},[Hn]),wn=function(W){var we=Vt.current;we&&(we.value=W.value,we.selectionStart=W.selectionStart,we.selectionEnd=W.selectionEnd,F?.(W.value))},Mn=function(W){var we=Vt.current,fe=Ne.current.stack[Ne.current.offset];fe&&we&&(Ne.current.stack[Ne.current.offset]=l(l({},fe),{selectionStart:we.selectionStart,selectionEnd:we.selectionEnd})),Hn(W),wn(W)},cl=function(){var W=Ne.current,we=W.stack,fe=W.offset,Me=we[fe-1];Me&&(wn(Me),Ne.current.offset=Math.max(fe-1,0))},ns=function(){var W=Ne.current,we=W.stack,fe=W.offset,Me=we[fe+1];Me&&(wn(Me),Ne.current.offset=Math.min(fe+1,we.length-1))},as=function(W){if(!(ce&&(ce(W),W.defaultPrevented))){W.key==="Escape"&&W.currentTarget.blur();var we=W.currentTarget,fe=we.value,Me=we.selectionStart,tt=we.selectionEnd,ie=($?" ":" ").repeat(Ve);if(W.key==="Tab"&&!Ye&&Qt)if(W.preventDefault(),W.shiftKey){var be=Xt(fe,Me),me=be.length-1,ze=Xt(fe,tt).length-1,Fe=fe.split(`
42
+ `).map(function(Yn,dl){return dl>=me&&dl<=ze&&Yn.startsWith(ie)?Yn.substring(ie.length):Yn}).join(`
43
+ `);if(fe!==Fe){var pe=be[me];Mn({value:Fe,selectionStart:pe?.startsWith(ie)?Me-ie.length:Me,selectionEnd:tt-(fe.length-Fe.length)})}}else if(Me!==tt){var be=Xt(fe,Me),zt=be.length-1,Ln=Xt(fe,tt).length-1,pe=be[zt];Mn({value:fe.split(`
44
+ `).map(function(is,os){return os>=zt&&os<=Ln?ie+is:is}).join(`
45
+ `),selectionStart:pe&&/\S/.test(pe)?Me+ie.length:Me,selectionEnd:tt+ie.length*(Ln-zt+1)})}else{var vt=Me+ie.length;Mn({value:fe.substring(0,Me)+ie+fe.substring(tt),selectionStart:vt,selectionEnd:vt})}else if(W.key==="Backspace"){var Zt=Me!==tt,yn=fe.substring(0,Me);if(yn.endsWith(ie)&&!Zt){W.preventDefault();var vt=Me-ie.length;Mn({value:fe.substring(0,Me-ie.length)+fe.substring(tt),selectionStart:vt,selectionEnd:vt})}}else if(W.key==="Enter"){if(Me===tt){var ls=Xt(fe,Me).pop(),La=ls?.match(/^\s+/);if(La?.[0]){W.preventDefault();var ss=`
46
+ `+La[0],vt=Me+ss.length;Mn({value:fe.substring(0,Me)+ss+fe.substring(tt),selectionStart:vt,selectionEnd:vt})}}}else if(W.keyCode===S||W.keyCode===w||W.keyCode===v||W.keyCode===b){var ln=void 0;W.keyCode===S&&W.shiftKey?ln=["(",")"]:W.keyCode===w?W.shiftKey?ln=["{","}"]:ln=["[","]"]:W.keyCode===v?W.shiftKey?ln=['"','"']:ln=["'","'"]:W.keyCode===b&&!W.shiftKey&&(ln=["`","`"]),Me!==tt&&ln&&(W.preventDefault(),Mn({value:fe.substring(0,Me)+ln[0]+fe.substring(Me,tt)+ln[1]+fe.substring(tt),selectionStart:Me,selectionEnd:tt+2}))}else(B?W.metaKey&&W.keyCode===p:W.ctrlKey&&W.keyCode===p)&&!W.shiftKey&&!W.altKey?(W.preventDefault(),cl()):(B?W.metaKey&&W.keyCode===p&&W.shiftKey:R?W.ctrlKey&&W.keyCode===h:W.ctrlKey&&W.keyCode===p&&W.shiftKey)&&!W.altKey?(W.preventDefault(),ns()):W.keyCode===y&&W.ctrlKey&&(!B||W.shiftKey)&&(W.preventDefault(),ca(function(Yn){return!Yn}))}},qn=function(W){var we=W.currentTarget,fe=we.value,Me=we.selectionStart,tt=we.selectionEnd;Hn({value:fe,selectionStart:Me,selectionEnd:tt},!0),F(fe)};return m.useEffect(function(){qa()},[qa]),m.useImperativeHandle(q,function(){return{get session(){return{history:Ne.current}},set session(W){Ne.current=W.history}}},[]),m.createElement("div",l({},Un,{style:l(l({},Q.container),ht)}),m.createElement("pre",l({className:ge,"aria-hidden":"true",style:l(l(l({},Q.editor),Q.highlight),Bn)},typeof ot=="string"?{dangerouslySetInnerHTML:{__html:ot+"<br />"}}:{children:ot})),m.createElement("textarea",{ref:function(W){return Vt.current=W},style:l(l(l({},Q.editor),Q.textarea),Bn),className:M+(et?" ".concat(et):""),id:Dt,value:Kt,onChange:qn,onKeyDown:as,onClick:ve,onKeyUp:X,onFocus:Oe,onBlur:ye,disabled:ee,form:de,maxLength:z,minLength:Z,name:ae,placeholder:ne,readOnly:Ae,required:Ge,autoFocus:J,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"data-gramm":!1}),m.createElement("style",{dangerouslySetInnerHTML:{__html:Y}}))}),Q={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 Lt.default=G,Lt}var PN=IN();const ej=s0(PN),tj=[/^ANTHROPIC_AUTH_TOKEN$/,/_API_KEY$/,/_AUTH_TOKEN$/,/_SECRET$/,/_SECRET_KEY$/,/^API_KEY$/,/^AUTH_TOKEN$/,/^SECRET$/,/_PASSWORD$/,/^PASSWORD$/,/_CREDENTIAL$/,/_PRIVATE_KEY$/];function nj(l){return tj.some(s=>s.test(l))}function aj(l){if(!l.trim())return{valid:!0};try{return JSON.parse(l),{valid:!0}}catch(s){const c=s.message,d=c.match(/position (\d+)/);if(d){const m=parseInt(d[1],10),h=l.substring(0,m).split(`
47
+ `);return{valid:!1,error:c,line:h.length}}return{valid:!1,error:c}}}function Zg({value:l,onChange:s,language:r="json",readonly:c=!1,className:d,minHeight:m="300px"}){const{isDark:h}=pg(),[p,y]=x.useState(!1),[S,w]=x.useState(!0),v=x.useMemo(()=>r==="json"?aj(l):{valid:!0},[l,r]),b=x.useCallback(_=>o.jsx(Nb,{theme:h?ep.nightOwl:ep.github,code:_,language:r,children:({tokens:A,getLineProps:R,getTokenProps:B})=>{let M=!1;return o.jsx(o.Fragment,{children:A.map((Y,G)=>o.jsx("div",{...R({line:Y}),className:V(v.line===G+1&&"bg-destructive/20"),children:Y.map((Q,k)=>{let j=!1;if(Q.types.includes("property")){const J=Q.content.replace(/['"]/g,"");nj(J)?M=!0:M=!1}else(Q.types.includes("string")||Q.types.includes("number")||Q.types.includes("boolean"))&&M?(j=!0,M=!1):Q.types.includes("punctuation")&&Q.content!==":"&&Q.content!=="["&&Q.content!=="{"&&(M=!1);const q=B({token:Q});return j&&S&&(q.className=V(q.className,"blur-[3px] select-none opacity-70 transition-all duration-200")),o.jsx("span",{...q},k)})},G))})}}),[h,r,v.line,S]);return o.jsxs("div",{className:V("flex flex-col",d),children:[o.jsxs("div",{className:V("relative rounded-md border overflow-hidden","bg-muted/30",p&&"ring-2 ring-ring ring-offset-2 ring-offset-background",c&&"opacity-70 cursor-not-allowed",!v.valid&&"border-destructive"),style:{minHeight:m},children:[o.jsx(ej,{value:l,onValueChange:c?()=>{}:s,highlight:b,padding:12,disabled:c,onFocus:()=>y(!0),onBlur:()=>y(!1),textareaClassName:V("focus:outline-none font-mono text-sm",c&&"cursor-not-allowed"),preClassName:"font-mono text-sm",style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:"0.875rem",minHeight:m}},h?"dark-editor":"light-editor"),o.jsx("div",{className:"absolute top-2 right-2 z-10 opacity-50 hover:opacity-100 transition-opacity",children:o.jsx(St,{variant:"ghost",size:"icon",className:"h-6 w-6 bg-background/50 hover:bg-background border shadow-sm rounded-full",onClick:()=>w(!S),title:S?"Reveal sensitive values":"Mask sensitive values",children:S?o.jsx(Yo,{className:"h-3 w-3"}):o.jsx(Lo,{className:"h-3 w-3"})})})]}),o.jsxs("div",{className:"flex items-center gap-2 mt-2 text-xs",children:[v.valid?o.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[o.jsx(Go,{className:"w-3 h-3 text-green-500"}),"Valid ",r.toUpperCase()]}):o.jsxs("span",{className:"flex items-center gap-1 text-destructive",children:[o.jsx(fb,{className:"w-3 h-3"}),v.error,v.line&&` (line ${v.line})`]}),c&&o.jsx("span",{className:"ml-auto text-muted-foreground",children:"(Read-only)"})]})]})}const Wg=Object.freeze(Object.defineProperty({__proto__:null,CodeEditor:Zg},Symbol.toStringTag,{value:"Module"})),lj={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 sj(l,s){switch(s.type){case"SET_WEBSEARCH_CONFIG":return{...l,webSearchConfig:s.payload};case"SET_WEBSEARCH_STATUS":return{...l,webSearchStatus:s.payload};case"SET_WEBSEARCH_LOADING":return{...l,webSearchLoading:s.payload};case"SET_WEBSEARCH_STATUS_LOADING":return{...l,webSearchStatusLoading:s.payload};case"SET_WEBSEARCH_SAVING":return{...l,webSearchSaving:s.payload};case"SET_WEBSEARCH_ERROR":return{...l,webSearchError:s.payload};case"SET_WEBSEARCH_SUCCESS":return{...l,webSearchSuccess:s.payload};case"SET_GLOBALENV_CONFIG":return{...l,globalEnvConfig:s.payload};case"SET_GLOBALENV_LOADING":return{...l,globalEnvLoading:s.payload};case"SET_GLOBALENV_SAVING":return{...l,globalEnvSaving:s.payload};case"SET_GLOBALENV_ERROR":return{...l,globalEnvError:s.payload};case"SET_GLOBALENV_SUCCESS":return{...l,globalEnvSuccess:s.payload};case"SET_PROXY_CONFIG":return{...l,proxyConfig:s.payload};case"SET_PROXY_LOADING":return{...l,proxyLoading:s.payload};case"SET_PROXY_SAVING":return{...l,proxySaving:s.payload};case"SET_PROXY_ERROR":return{...l,proxyError:s.payload};case"SET_PROXY_SUCCESS":return{...l,proxySuccess:s.payload};case"SET_PROXY_TEST_RESULT":return{...l,proxyTestResult:s.payload};case"SET_PROXY_TESTING":return{...l,proxyTesting:s.payload};case"SET_RAW_CONFIG":return{...l,rawConfig:s.payload};case"SET_RAW_CONFIG_LOADING":return{...l,rawConfigLoading:s.payload};default:return l}}const Jg=x.createContext(null);function ij({children:l}){const[s,r]=x.useReducer(sj,lj);return o.jsx(Jg.Provider,{value:{state:s,dispatch:r},children:l})}function $g(){const l=x.useContext(Jg);if(!l)throw new Error("useSettingsContext must be used within a SettingsProvider");return l}function oj(){const{dispatch:l}=$g(),s=x.useCallback(j=>l({type:"SET_WEBSEARCH_CONFIG",payload:j}),[l]),r=x.useCallback(j=>l({type:"SET_WEBSEARCH_STATUS",payload:j}),[l]),c=x.useCallback(j=>l({type:"SET_WEBSEARCH_LOADING",payload:j}),[l]),d=x.useCallback(j=>l({type:"SET_WEBSEARCH_STATUS_LOADING",payload:j}),[l]),m=x.useCallback(j=>l({type:"SET_WEBSEARCH_SAVING",payload:j}),[l]),h=x.useCallback(j=>l({type:"SET_WEBSEARCH_ERROR",payload:j}),[l]),p=x.useCallback(j=>l({type:"SET_WEBSEARCH_SUCCESS",payload:j}),[l]),y=x.useCallback(j=>l({type:"SET_GLOBALENV_CONFIG",payload:j}),[l]),S=x.useCallback(j=>l({type:"SET_GLOBALENV_LOADING",payload:j}),[l]),w=x.useCallback(j=>l({type:"SET_GLOBALENV_SAVING",payload:j}),[l]),v=x.useCallback(j=>l({type:"SET_GLOBALENV_ERROR",payload:j}),[l]),b=x.useCallback(j=>l({type:"SET_GLOBALENV_SUCCESS",payload:j}),[l]),_=x.useCallback(j=>l({type:"SET_PROXY_CONFIG",payload:j}),[l]),A=x.useCallback(j=>l({type:"SET_PROXY_LOADING",payload:j}),[l]),R=x.useCallback(j=>l({type:"SET_PROXY_SAVING",payload:j}),[l]),B=x.useCallback(j=>l({type:"SET_PROXY_ERROR",payload:j}),[l]),M=x.useCallback(j=>l({type:"SET_PROXY_SUCCESS",payload:j}),[l]),Y=x.useCallback(j=>l({type:"SET_PROXY_TEST_RESULT",payload:j}),[l]),G=x.useCallback(j=>l({type:"SET_PROXY_TESTING",payload:j}),[l]),Q=x.useCallback(j=>l({type:"SET_RAW_CONFIG",payload:j}),[l]),k=x.useCallback(j=>l({type:"SET_RAW_CONFIG_LOADING",payload:j}),[l]);return x.useMemo(()=>({setWebSearchConfig:s,setWebSearchStatus:r,setWebSearchLoading:c,setWebSearchStatusLoading:d,setWebSearchSaving:m,setWebSearchError:h,setWebSearchSuccess:p,setGlobalEnvConfig:y,setGlobalEnvLoading:S,setGlobalEnvSaving:w,setGlobalEnvError:v,setGlobalEnvSuccess:b,setProxyConfig:_,setProxyLoading:A,setProxySaving:R,setProxyError:B,setProxySuccess:M,setProxyTestResult:Y,setProxyTesting:G,setRawConfig:Q,setRawConfigLoading:k}),[s,r,c,d,m,h,p,y,S,w,v,b,_,A,R,B,M,Y,G,Q,k])}function rj(){const[l,s]=i0(),r=l.get("tab"),c=r==="globalenv"?"globalenv":r==="proxy"?"proxy":r==="auth"?"auth":"websearch",d=x.useCallback(m=>{s({tab:m},{replace:!0})},[s]);return{activeTab:c,setActiveTab:d}}function uj(){const{state:l}=$g(),s=oj(),[r,c]=x.useState(!1),d=x.useCallback(async()=>{try{s.setRawConfigLoading(!0);const h=await fetch("/api/config/raw");if(!h.ok){s.setRawConfig(null);return}const p=await h.text();s.setRawConfig(p)}catch{s.setRawConfig(null)}finally{s.setRawConfigLoading(!1)}},[s]),m=x.useCallback(async()=>{if(l.rawConfig)try{await navigator.clipboard.writeText(l.rawConfig),c(!0),setTimeout(()=>c(!1),2e3)}catch{}},[l.rawConfig]);return{rawConfig:l.rawConfig,loading:l.rawConfigLoading,copied:r,fetchRawConfig:d,copyToClipboard:m}}function cj({activeTab:l,onTabChange:s}){return o.jsx(Lg,{value:l,onValueChange:r=>s(r),children:o.jsxs(Wc,{className:"w-full",children:[o.jsxs(il,{value:"websearch",className:"flex-1 gap-2",children:[o.jsx(mb,{className:"w-4 h-4"}),"WebSearch"]}),o.jsxs(il,{value:"globalenv",className:"flex-1 gap-2",children:[o.jsx(kc,{className:"w-4 h-4"}),"Global Env"]}),o.jsxs(il,{value:"proxy",className:"flex-1 gap-2",children:[o.jsx(hb,{className:"w-4 h-4"}),"Proxy"]}),o.jsxs(il,{value:"auth",className:"flex-1 gap-2",children:[o.jsx(ig,{className:"w-4 h-4"}),"Auth"]})]})})}function dj(){return o.jsxs("div",{className:"flex-1 p-5 space-y-6",children:[o.jsx(Le,{className:"h-4 w-2/3"}),o.jsx("div",{className:"p-4 rounded-lg border",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Le,{className:"h-5 w-32"}),o.jsx(Le,{className:"h-4 w-48"})]}),o.jsx(Le,{className:"h-6 w-10 rounded-full"})]})}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(Le,{className:"h-5 w-24"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Le,{className:"h-20 w-full rounded-lg"}),o.jsx(Le,{className:"h-20 w-full rounded-lg"}),o.jsx(Le,{className:"h-20 w-full rounded-lg"})]})]})]})}const fj=x.lazy(()=>At(()=>import("./index-BXkzlgVE.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),mj=x.lazy(()=>At(()=>import("./globalenv-section-DlnizwvB.js"),__vite__mapDeps([10,1,2,3,4,5,6,7,8,9]))),hj=x.lazy(()=>At(()=>import("./index-BCBypoXT.js"),__vite__mapDeps([11,1,2,3,4,5,6,7,8,9]))),pj=x.lazy(()=>At(()=>import("./auth-section-Ddg5Cdd6.js"),__vite__mapDeps([12,1,2,4,5,6,7,8,9])));function gj(){const{activeTab:l,setActiveTab:s}=rj(),{rawConfig:r,loading:c,copied:d,fetchRawConfig:m,copyToClipboard:h}=uj();x.useEffect(()=>{m()},[m]);const p=y=>{x.startTransition(()=>{s(y)})};return o.jsx("div",{className:"h-[calc(100vh-100px)]",children:o.jsxs(Xc,{direction:"horizontal",className:"h-full",children:[o.jsx(ii,{defaultSize:40,minSize:30,maxSize:55,children:o.jsxs("div",{className:"h-full border-r flex flex-col bg-muted/30 relative",children:[o.jsx("div",{className:"p-5 border-b bg-background",children:o.jsx(cj,{activeTab:l,onTabChange:p})}),o.jsxs(x.Suspense,{fallback:o.jsx(dj,{}),children:[l==="websearch"&&o.jsx(fj,{}),l==="globalenv"&&o.jsx(mj,{}),l==="proxy"&&o.jsx(hj,{}),l==="auth"&&o.jsx(pj,{})]})]})}),o.jsx(Zc,{className:"w-2 bg-border hover:bg-primary/20 transition-colors cursor-col-resize flex items-center justify-center group",children:o.jsx(Ko,{className:"w-3 h-3 text-muted-foreground group-hover:text-primary"})}),o.jsx(ii,{defaultSize:60,minSize:35,children:o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsxs("div",{className:"p-4 border-b bg-background flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx($h,{className:"w-5 h-5 text-primary"}),o.jsxs("div",{children:[o.jsx("h2",{className:"font-semibold",children:"config.yaml"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"~/.ccs/config.yaml"})]})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(St,{variant:"outline",size:"sm",onClick:h,disabled:!r,children:d?o.jsxs(o.Fragment,{children:[o.jsx(es,{className:"w-4 h-4 mr-1"}),"Copied"]}):o.jsxs(o.Fragment,{children:[o.jsx(_o,{className:"w-4 h-4 mr-1"}),"Copy"]})}),o.jsx(St,{variant:"outline",size:"sm",onClick:m,disabled:c,children:o.jsx(Fh,{className:`w-4 h-4 ${c?"animate-spin":""}`})})]})]}),o.jsx("div",{className:"flex-1 overflow-auto",children:c?o.jsxs("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[o.jsx(Fh,{className:"w-5 h-5 animate-spin mr-2"}),"Loading..."]}):r?o.jsx(Zg,{value:r,onChange:()=>{},language:"yaml",readonly:!0,minHeight:"auto",className:"min-h-full"}):o.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:o.jsxs("div",{className:"text-center",children:[o.jsx($h,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),o.jsx("p",{children:"Config file not found"}),o.jsx("code",{className:"text-sm bg-muted px-2 py-1 rounded mt-2 inline-block",children:"ccs migrate"})]})})})]})})]})})}function yj(){return o.jsx(ij,{children:o.jsx(gj,{})})}const vj=Object.freeze(Object.defineProperty({__proto__:null,SettingsPage:yj},Symbol.toStringTag,{value:"Module"})),VC=Fx,QC=Px,XC=Ix,xj=x.forwardRef(({className:l,align:s="center",sideOffset:r=4,...c},d)=>o.jsx($x,{children:o.jsx(Pp,{ref:d,align:s,sideOffset:r,className:V("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",l),...c})}));xj.displayName=Pp.displayName;function bj(l,s,r="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:l,timeZoneName:r}).format(s).split(/\s/g).slice(2).join(" ")}const Sj={},li={};function ol(l,s){try{const c=(Sj[l]||=new Intl.DateTimeFormat("en-US",{timeZone:l,timeZoneName:"longOffset"}).format)(s).split("GMT")[1];return c in li?li[c]:Mp(c,c.split(":"))}catch{if(l in li)return li[l];const r=l?.match(Nj);return r?Mp(l,r.slice(1)):NaN}}const Nj=/([+-]\d\d):?(\d\d)?/;function Mp(l,s){const r=+(s[0]||0),c=+(s[1]||0),d=+(s[2]||0)/60;return li[l]=r*60+c>0?r*60+c+d:r*60-c-d}class kn extends Date{constructor(...s){super(),s.length>1&&typeof s[s.length-1]=="string"&&(this.timeZone=s.pop()),this.internal=new Date,isNaN(ol(this.timeZone,this))?this.setTime(NaN):s.length?typeof s[0]=="number"&&(s.length===1||s.length===2&&typeof s[1]!="number")?this.setTime(s[0]):typeof s[0]=="string"?this.setTime(+new Date(s[0])):s[0]instanceof Date?this.setTime(+s[0]):(this.setTime(+new Date(...s)),Fg(this),Oc(this)):this.setTime(Date.now())}static tz(s,...r){return r.length?new kn(...r,s):new kn(Date.now(),s)}withTimeZone(s){return new kn(+this,s)}getTimezoneOffset(){const s=-ol(this.timeZone,this);return s>0?Math.floor(s):Math.ceil(s)}setTime(s){return Date.prototype.setTime.apply(this,arguments),Oc(this),+this}[Symbol.for("constructDateFrom")](s){return new kn(+new Date(s),this.timeZone)}}const zp=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(l=>{if(!zp.test(l))return;const s=l.replace(zp,"$1UTC");kn.prototype[s]&&(l.startsWith("get")?kn.prototype[l]=function(){return this.internal[s]()}:(kn.prototype[l]=function(){return Date.prototype[s].apply(this.internal,arguments),jj(this),+this},kn.prototype[s]=function(){return Date.prototype[s].apply(this,arguments),Oc(this),+this}))});function Oc(l){l.internal.setTime(+l),l.internal.setUTCSeconds(l.internal.getUTCSeconds()-Math.round(-ol(l.timeZone,l)*60))}function jj(l){Date.prototype.setFullYear.call(l,l.internal.getUTCFullYear(),l.internal.getUTCMonth(),l.internal.getUTCDate()),Date.prototype.setHours.call(l,l.internal.getUTCHours(),l.internal.getUTCMinutes(),l.internal.getUTCSeconds(),l.internal.getUTCMilliseconds()),Fg(l)}function Fg(l){const s=ol(l.timeZone,l),r=s>0?Math.floor(s):Math.ceil(s),c=new Date(+l);c.setUTCHours(c.getUTCHours()-1);const d=-new Date(+l).getTimezoneOffset(),m=-new Date(+c).getTimezoneOffset(),h=d-m,p=Date.prototype.getHours.apply(l)!==l.internal.getUTCHours();h&&p&&l.internal.setUTCMinutes(l.internal.getUTCMinutes()+h);const y=d-r;y&&Date.prototype.setUTCMinutes.call(l,Date.prototype.getUTCMinutes.call(l)+y);const S=new Date(+l);S.setUTCSeconds(0);const w=d>0?S.getSeconds():(S.getSeconds()-60)%60,v=Math.round(-(ol(l.timeZone,l)*60))%60;(v||w)&&(l.internal.setUTCSeconds(l.internal.getUTCSeconds()+v),Date.prototype.setUTCSeconds.call(l,Date.prototype.getUTCSeconds.call(l)+v+w));const b=ol(l.timeZone,l),_=b>0?Math.floor(b):Math.ceil(b),R=-new Date(+l).getTimezoneOffset()-_,B=_!==r,M=R-y;if(B&&M){Date.prototype.setUTCMinutes.call(l,Date.prototype.getUTCMinutes.call(l)+M);const Y=ol(l.timeZone,l),G=Y>0?Math.floor(Y):Math.ceil(Y),Q=_-G;Q&&(l.internal.setUTCMinutes(l.internal.getUTCMinutes()+Q),Date.prototype.setUTCMinutes.call(l,Date.prototype.getUTCMinutes.call(l)+Q))}}class oa extends kn{static tz(s,...r){return r.length?new oa(...r,s):new oa(Date.now(),s)}toISOString(){const[s,r,c]=this.tzComponents(),d=`${s}${r}:${c}`;return this.internal.toISOString().slice(0,-1)+d}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[s,r,c,d]=this.internal.toUTCString().split(" ");return`${s?.slice(0,-1)} ${c} ${r} ${d}`}toTimeString(){const s=this.internal.toUTCString().split(" ")[4],[r,c,d]=this.tzComponents();return`${s} GMT${r}${c}${d} (${bj(this.timeZone,this)})`}toLocaleString(s,r){return Date.prototype.toLocaleString.call(this,s,{...r,timeZone:r?.timeZone||this.timeZone})}toLocaleDateString(s,r){return Date.prototype.toLocaleDateString.call(this,s,{...r,timeZone:r?.timeZone||this.timeZone})}toLocaleTimeString(s,r){return Date.prototype.toLocaleTimeString.call(this,s,{...r,timeZone:r?.timeZone||this.timeZone})}tzComponents(){const s=this.getTimezoneOffset(),r=s>0?"-":"+",c=String(Math.floor(Math.abs(s)/60)).padStart(2,"0"),d=String(Math.abs(s)%60).padStart(2,"0");return[r,c,d]}withTimeZone(s){return new oa(+this,s)}[Symbol.for("constructDateFrom")](s){return new oa(+new Date(s),this.timeZone)}}const Tp=5,Cj=4;function Ej(l,s){const r=s.startOfMonth(l),c=r.getDay()>0?r.getDay():7,d=s.addDays(l,-c+1),m=s.addDays(d,Tp*7-1);return s.getMonth(l)===s.getMonth(m)?Tp:Cj}function Ig(l,s){const r=s.startOfMonth(l),c=r.getDay();return c===1?r:c===0?s.addDays(r,-6):s.addDays(r,-1*(c-1))}function wj(l,s){const r=Ig(l,s),c=Ej(l,s);return s.addDays(r,c*7-1)}const Pg={...Fs,labels:{labelDayButton:(l,s,r,c)=>{let d;c&&typeof c.format=="function"?d=c.format.bind(c):d=(h,p)=>ei(h,p,{locale:Fs,...r});let m=d(l,"PPPP");return s.today&&(m=`Today, ${m}`),s.selected&&(m=`${m}, selected`),m},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:l=>`Week ${l}`,labelYearDropdown:"Choose the Year",labelGrid:(l,s,r)=>{let c;return r&&typeof r.format=="function"?c=r.format.bind(r):c=(d,m)=>ei(d,m,{locale:Fs,...s}),c(l,"LLLL yyyy")},labelGridcell:(l,s,r,c)=>{let d;c&&typeof c.format=="function"?d=c.format.bind(c):d=(h,p)=>ei(h,p,{locale:Fs,...r});let m=d(l,"PPPP");return s?.today&&(m=`Today, ${m}`),m},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(l,s,r)=>{let c;return r&&typeof r.format=="function"?c=r.format.bind(r):c=(d,m)=>ei(d,m,{locale:Fs,...s}),c(l,"cccc")}}};class an{constructor(s,r){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?oa.tz(this.options.timeZone):new this.Date,this.newDate=(c,d,m)=>this.overrides?.newDate?this.overrides.newDate(c,d,m):this.options.timeZone?new oa(c,d,m,this.options.timeZone):new Date(c,d,m),this.addDays=(c,d)=>this.overrides?.addDays?this.overrides.addDays(c,d):h0(c,d),this.addMonths=(c,d)=>this.overrides?.addMonths?this.overrides.addMonths(c,d):p0(c,d),this.addWeeks=(c,d)=>this.overrides?.addWeeks?this.overrides.addWeeks(c,d):g0(c,d),this.addYears=(c,d)=>this.overrides?.addYears?this.overrides.addYears(c,d):y0(c,d),this.differenceInCalendarDays=(c,d)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(c,d):v0(c,d),this.differenceInCalendarMonths=(c,d)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(c,d):x0(c,d),this.eachMonthOfInterval=c=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(c):b0(c),this.eachYearOfInterval=c=>{const d=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(c):S0(c),m=new Set(d.map(p=>this.getYear(p)));if(m.size===d.length)return d;const h=[];return m.forEach(p=>{h.push(new Date(p,0,1))}),h},this.endOfBroadcastWeek=c=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(c):wj(c,this),this.endOfISOWeek=c=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(c):N0(c),this.endOfMonth=c=>this.overrides?.endOfMonth?this.overrides.endOfMonth(c):j0(c),this.endOfWeek=(c,d)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(c,d):C0(c,this.options),this.endOfYear=c=>this.overrides?.endOfYear?this.overrides.endOfYear(c):E0(c),this.format=(c,d,m)=>{const h=this.overrides?.format?this.overrides.format(c,d,this.options):ei(c,d,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(h):h},this.getISOWeek=c=>this.overrides?.getISOWeek?this.overrides.getISOWeek(c):w0(c),this.getMonth=(c,d)=>this.overrides?.getMonth?this.overrides.getMonth(c,this.options):M0(c,this.options),this.getYear=(c,d)=>this.overrides?.getYear?this.overrides.getYear(c,this.options):z0(c,this.options),this.getWeek=(c,d)=>this.overrides?.getWeek?this.overrides.getWeek(c,this.options):T0(c,this.options),this.isAfter=(c,d)=>this.overrides?.isAfter?this.overrides.isAfter(c,d):O0(c,d),this.isBefore=(c,d)=>this.overrides?.isBefore?this.overrides.isBefore(c,d):A0(c,d),this.isDate=c=>this.overrides?.isDate?this.overrides.isDate(c):D0(c),this.isSameDay=(c,d)=>this.overrides?.isSameDay?this.overrides.isSameDay(c,d):_0(c,d),this.isSameMonth=(c,d)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(c,d):k0(c,d),this.isSameYear=(c,d)=>this.overrides?.isSameYear?this.overrides.isSameYear(c,d):R0(c,d),this.max=c=>this.overrides?.max?this.overrides.max(c):U0(c),this.min=c=>this.overrides?.min?this.overrides.min(c):B0(c),this.setMonth=(c,d)=>this.overrides?.setMonth?this.overrides.setMonth(c,d):H0(c,d),this.setYear=(c,d)=>this.overrides?.setYear?this.overrides.setYear(c,d):q0(c,d),this.startOfBroadcastWeek=(c,d)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(c,this):Ig(c,this),this.startOfDay=c=>this.overrides?.startOfDay?this.overrides.startOfDay(c):L0(c),this.startOfISOWeek=c=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(c):Y0(c),this.startOfMonth=c=>this.overrides?.startOfMonth?this.overrides.startOfMonth(c):G0(c),this.startOfWeek=(c,d)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(c,this.options):K0(c,this.options),this.startOfYear=c=>this.overrides?.startOfYear?this.overrides.startOfYear(c):V0(c),this.options={locale:Pg,...s},this.overrides=r}getDigitMap(){const{numerals:s="latn"}=this.options,r=new Intl.NumberFormat("en-US",{numberingSystem:s}),c={};for(let d=0;d<10;d++)c[d.toString()]=r.format(d);return c}replaceDigits(s){const r=this.getDigitMap();return s.replace(/\d/g,c=>r[c]||c)}formatNumber(s){return this.replaceDigits(s.toString())}getMonthYearOrder(){const s=this.options.locale?.code;return s&&an.yearFirstLocales.has(s)?"year-first":"month-first"}formatMonthYear(s){const{locale:r,timeZone:c,numerals:d}=this.options,m=r?.code;if(m&&an.yearFirstLocales.has(m))try{return new Intl.DateTimeFormat(m,{month:"long",year:"numeric",timeZone:c,numberingSystem:d}).format(s)}catch{}const h=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(s,h)}}an.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 Rn=new an;class ey{constructor(s,r,c=Rn){this.date=s,this.displayMonth=r,this.outside=!!(r&&!c.isSameMonth(s,r)),this.dateLib=c,this.isoDate=c.format(s,"yyyy-MM-dd"),this.displayMonthId=c.format(r,"yyyy-MM"),this.dateMonthId=c.format(s,"yyyy-MM")}isEqualTo(s){return this.dateLib.isSameDay(s.date,this.date)&&this.dateLib.isSameMonth(s.displayMonth,this.displayMonth)}}class Mj{constructor(s,r){this.date=s,this.weeks=r}}class zj{constructor(s,r){this.days=r,this.weekNumber=s}}function Tj(l){return P.createElement("button",{...l})}function Oj(l){return P.createElement("span",{...l})}function Aj(l){const{size:s=24,orientation:r="left",className:c}=l;return P.createElement("svg",{className:c,width:s,height:s,viewBox:"0 0 24 24"},r==="up"&&P.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),r==="down"&&P.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),r==="left"&&P.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),r==="right"&&P.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function Dj(l){const{day:s,modifiers:r,...c}=l;return P.createElement("td",{...c})}function _j(l){const{day:s,modifiers:r,...c}=l,d=P.useRef(null);return P.useEffect(()=>{r.focused&&d.current?.focus()},[r.focused]),P.createElement("button",{ref:d,...c})}var re;(function(l){l.Root="root",l.Chevron="chevron",l.Day="day",l.DayButton="day_button",l.CaptionLabel="caption_label",l.Dropdowns="dropdowns",l.Dropdown="dropdown",l.DropdownRoot="dropdown_root",l.Footer="footer",l.MonthGrid="month_grid",l.MonthCaption="month_caption",l.MonthsDropdown="months_dropdown",l.Month="month",l.Months="months",l.Nav="nav",l.NextMonthButton="button_next",l.PreviousMonthButton="button_previous",l.Week="week",l.Weeks="weeks",l.Weekday="weekday",l.Weekdays="weekdays",l.WeekNumber="week_number",l.WeekNumberHeader="week_number_header",l.YearsDropdown="years_dropdown"})(re||(re={}));var at;(function(l){l.disabled="disabled",l.hidden="hidden",l.outside="outside",l.focused="focused",l.today="today"})(at||(at={}));var jn;(function(l){l.range_end="range_end",l.range_middle="range_middle",l.range_start="range_start",l.selected="selected"})(jn||(jn={}));var nn;(function(l){l.weeks_before_enter="weeks_before_enter",l.weeks_before_exit="weeks_before_exit",l.weeks_after_enter="weeks_after_enter",l.weeks_after_exit="weeks_after_exit",l.caption_after_enter="caption_after_enter",l.caption_after_exit="caption_after_exit",l.caption_before_enter="caption_before_enter",l.caption_before_exit="caption_before_exit"})(nn||(nn={}));function kj(l){const{options:s,className:r,components:c,classNames:d,...m}=l,h=[d[re.Dropdown],r].join(" "),p=s?.find(({value:y})=>y===m.value);return P.createElement("span",{"data-disabled":m.disabled,className:d[re.DropdownRoot]},P.createElement(c.Select,{className:h,...m},s?.map(({value:y,label:S,disabled:w})=>P.createElement(c.Option,{key:y,value:y,disabled:w},S))),P.createElement("span",{className:d[re.CaptionLabel],"aria-hidden":!0},p?.label,P.createElement(c.Chevron,{orientation:"down",size:18,className:d[re.Chevron]})))}function Rj(l){return P.createElement("div",{...l})}function Uj(l){return P.createElement("div",{...l})}function Bj(l){const{calendarMonth:s,displayIndex:r,...c}=l;return P.createElement("div",{...c},l.children)}function Hj(l){const{calendarMonth:s,displayIndex:r,...c}=l;return P.createElement("div",{...c})}function qj(l){return P.createElement("table",{...l})}function Lj(l){return P.createElement("div",{...l})}const ty=x.createContext(void 0);function di(){const l=x.useContext(ty);if(l===void 0)throw new Error("useDayPicker() must be used within a custom component.");return l}function Yj(l){const{components:s}=di();return P.createElement(s.Dropdown,{...l})}function Gj(l){const{onPreviousClick:s,onNextClick:r,previousMonth:c,nextMonth:d,...m}=l,{components:h,classNames:p,labels:{labelPrevious:y,labelNext:S}}=di(),w=x.useCallback(b=>{d&&r?.(b)},[d,r]),v=x.useCallback(b=>{c&&s?.(b)},[c,s]);return P.createElement("nav",{...m},P.createElement(h.PreviousMonthButton,{type:"button",className:p[re.PreviousMonthButton],tabIndex:c?void 0:-1,"aria-disabled":c?void 0:!0,"aria-label":y(c),onClick:v},P.createElement(h.Chevron,{disabled:c?void 0:!0,className:p[re.Chevron],orientation:"left"})),P.createElement(h.NextMonthButton,{type:"button",className:p[re.NextMonthButton],tabIndex:d?void 0:-1,"aria-disabled":d?void 0:!0,"aria-label":S(d),onClick:w},P.createElement(h.Chevron,{disabled:d?void 0:!0,orientation:"right",className:p[re.Chevron]})))}function Kj(l){const{components:s}=di();return P.createElement(s.Button,{...l})}function Vj(l){return P.createElement("option",{...l})}function Qj(l){const{components:s}=di();return P.createElement(s.Button,{...l})}function Xj(l){const{rootRef:s,...r}=l;return P.createElement("div",{...r,ref:s})}function Zj(l){return P.createElement("select",{...l})}function Wj(l){const{week:s,...r}=l;return P.createElement("tr",{...r})}function Jj(l){return P.createElement("th",{...l})}function $j(l){return P.createElement("thead",{"aria-hidden":!0},P.createElement("tr",{...l}))}function Fj(l){const{week:s,...r}=l;return P.createElement("th",{...r})}function Ij(l){return P.createElement("th",{...l})}function Pj(l){return P.createElement("tbody",{...l})}function e2(l){const{components:s}=di();return P.createElement(s.Dropdown,{...l})}const t2=Object.freeze(Object.defineProperty({__proto__:null,Button:Tj,CaptionLabel:Oj,Chevron:Aj,Day:Dj,DayButton:_j,Dropdown:kj,DropdownNav:Rj,Footer:Uj,Month:Bj,MonthCaption:Hj,MonthGrid:qj,Months:Lj,MonthsDropdown:Yj,Nav:Gj,NextMonthButton:Kj,Option:Vj,PreviousMonthButton:Qj,Root:Xj,Select:Zj,Week:Wj,WeekNumber:Fj,WeekNumberHeader:Ij,Weekday:Jj,Weekdays:$j,Weeks:Pj,YearsDropdown:e2},Symbol.toStringTag,{value:"Module"}));function ra(l,s,r=!1,c=Rn){let{from:d,to:m}=l;const{differenceInCalendarDays:h,isSameDay:p}=c;return d&&m?(h(m,d)<0&&([d,m]=[m,d]),h(s,d)>=(r?1:0)&&h(m,s)>=(r?1:0)):!r&&m?p(m,s):!r&&d?p(d,s):!1}function $c(l){return!!(l&&typeof l=="object"&&"before"in l&&"after"in l)}function tr(l){return!!(l&&typeof l=="object"&&"from"in l)}function Fc(l){return!!(l&&typeof l=="object"&&"after"in l)}function Ic(l){return!!(l&&typeof l=="object"&&"before"in l)}function ny(l){return!!(l&&typeof l=="object"&&"dayOfWeek"in l)}function ay(l,s){return Array.isArray(l)&&l.every(s.isDate)}function ua(l,s,r=Rn){const c=Array.isArray(s)?s:[s],{isSameDay:d,differenceInCalendarDays:m,isAfter:h}=r;return c.some(p=>{if(typeof p=="boolean")return p;if(r.isDate(p))return d(l,p);if(ay(p,r))return p.some(y=>d(l,y));if(tr(p))return ra(p,l,!1,r);if(ny(p))return Array.isArray(p.dayOfWeek)?p.dayOfWeek.includes(l.getDay()):p.dayOfWeek===l.getDay();if($c(p)){const y=m(p.before,l),S=m(p.after,l),w=y>0,v=S<0;return h(p.before,p.after)?v&&w:w||v}return Fc(p)?m(l,p.after)>0:Ic(p)?m(p.before,l)>0:typeof p=="function"?p(l):!1})}function n2(l,s,r,c,d){const{disabled:m,hidden:h,modifiers:p,showOutsideDays:y,broadcastCalendar:S,today:w=d.today()}=s,{isSameDay:v,isSameMonth:b,startOfMonth:_,isBefore:A,endOfMonth:R,isAfter:B}=d,M=r&&_(r),Y=c&&R(c),G={[at.focused]:[],[at.outside]:[],[at.disabled]:[],[at.hidden]:[],[at.today]:[]},Q={};for(const k of l){const{date:j,displayMonth:q}=k,J=!!(q&&!b(j,q)),ee=!!(M&&A(j,M)),de=!!(Y&&B(j,Y)),xe=!!(m&&ua(j,m,d)),oe=!!(h&&ua(j,h,d))||ee||de||!S&&!y&&J||S&&y===!1&&J,Ye=v(j,w);J&&G.outside.push(k),xe&&G.disabled.push(k),oe&&G.hidden.push(k),Ye&&G.today.push(k),p&&Object.keys(p).forEach(Se=>{const $=p?.[Se];$&&ua(j,$,d)&&(Q[Se]?Q[Se].push(k):Q[Se]=[k])})}return k=>{const j={[at.focused]:!1,[at.disabled]:!1,[at.hidden]:!1,[at.outside]:!1,[at.today]:!1},q={};for(const J in G){const ee=G[J];j[J]=ee.some(de=>de===k)}for(const J in Q)q[J]=Q[J].some(ee=>ee===k);return{...j,...q}}}function a2(l,s,r={}){return Object.entries(l).filter(([,d])=>d===!0).reduce((d,[m])=>(r[m]?d.push(r[m]):s[at[m]]?d.push(s[at[m]]):s[jn[m]]&&d.push(s[jn[m]]),d),[s[re.Day]])}function l2(l){return{...t2,...l}}function s2(l){const s={"data-mode":l.mode??void 0,"data-required":"required"in l?l.required:void 0,"data-multiple-months":l.numberOfMonths&&l.numberOfMonths>1||void 0,"data-week-numbers":l.showWeekNumber||void 0,"data-broadcast-calendar":l.broadcastCalendar||void 0,"data-nav-layout":l.navLayout||void 0};return Object.entries(l).forEach(([r,c])=>{r.startsWith("data-")&&(s[r]=c)}),s}function i2(){const l={};for(const s in re)l[re[s]]=`rdp-${re[s]}`;for(const s in at)l[at[s]]=`rdp-${at[s]}`;for(const s in jn)l[jn[s]]=`rdp-${jn[s]}`;for(const s in nn)l[nn[s]]=`rdp-${nn[s]}`;return l}function ly(l,s,r){return(r??new an(s)).formatMonthYear(l)}const o2=ly;function r2(l,s,r){return(r??new an(s)).format(l,"d")}function u2(l,s=Rn){return s.format(l,"LLLL")}function c2(l,s,r){return(r??new an(s)).format(l,"cccccc")}function d2(l,s=Rn){return l<10?s.formatNumber(`0${l.toLocaleString()}`):s.formatNumber(`${l.toLocaleString()}`)}function f2(){return""}function sy(l,s=Rn){return s.format(l,"yyyy")}const m2=sy,h2=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:ly,formatDay:r2,formatMonthCaption:o2,formatMonthDropdown:u2,formatWeekNumber:d2,formatWeekNumberHeader:f2,formatWeekdayName:c2,formatYearCaption:m2,formatYearDropdown:sy},Symbol.toStringTag,{value:"Module"}));function p2(l){return l?.formatMonthCaption&&!l.formatCaption&&(l.formatCaption=l.formatMonthCaption),l?.formatYearCaption&&!l.formatYearDropdown&&(l.formatYearDropdown=l.formatYearCaption),{...h2,...l}}function Pc(l,s,r,c){let d=(c??new an(r)).format(l,"PPPP");return s.today&&(d=`Today, ${d}`),s.selected&&(d=`${d}, selected`),d}const g2=Pc;function ed(l,s,r){return(r??new an(s)).formatMonthYear(l)}const y2=ed;function iy(l,s,r,c){let d=(c??new an(r)).format(l,"PPPP");return s?.today&&(d=`Today, ${d}`),d}function oy(l){return"Choose the Month"}function ry(){return""}const v2="Go to the Next Month";function uy(l,s){return v2}function cy(l){return"Go to the Previous Month"}function dy(l,s,r){return(r??new an(s)).format(l,"cccc")}function fy(l,s){return`Week ${l}`}function my(l){return"Week Number"}function hy(l){return"Choose the Year"}const x2=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:y2,labelDay:g2,labelDayButton:Pc,labelGrid:ed,labelGridcell:iy,labelMonthDropdown:oy,labelNav:ry,labelNext:uy,labelPrevious:cy,labelWeekNumber:fy,labelWeekNumberHeader:my,labelWeekday:dy,labelYearDropdown:hy},Symbol.toStringTag,{value:"Module"})),Nn=(l,s,r)=>s||(r?typeof r=="function"?r:(...c)=>r:l);function b2(l,s){const r=s.locale?.labels??{};return{...x2,...l??{},labelDayButton:Nn(Pc,l?.labelDayButton,r.labelDayButton),labelMonthDropdown:Nn(oy,l?.labelMonthDropdown,r.labelMonthDropdown),labelNext:Nn(uy,l?.labelNext,r.labelNext),labelPrevious:Nn(cy,l?.labelPrevious,r.labelPrevious),labelWeekNumber:Nn(fy,l?.labelWeekNumber,r.labelWeekNumber),labelYearDropdown:Nn(hy,l?.labelYearDropdown,r.labelYearDropdown),labelGrid:Nn(ed,l?.labelGrid,r.labelGrid),labelGridcell:Nn(iy,l?.labelGridcell,r.labelGridcell),labelNav:Nn(ry,l?.labelNav,r.labelNav),labelWeekNumberHeader:Nn(my,l?.labelWeekNumberHeader,r.labelWeekNumberHeader),labelWeekday:Nn(dy,l?.labelWeekday,r.labelWeekday)}}function S2(l,s,r,c,d){const{startOfMonth:m,startOfYear:h,endOfYear:p,eachMonthOfInterval:y,getMonth:S}=d;return y({start:h(l),end:p(l)}).map(b=>{const _=c.formatMonthDropdown(b,d),A=S(b),R=s&&b<m(s)||r&&b>m(r)||!1;return{value:A,label:_,disabled:R}})}function N2(l,s={},r={}){let c={...s?.[re.Day]};return Object.entries(l).filter(([,d])=>d===!0).forEach(([d])=>{c={...c,...r?.[d]}}),c}function j2(l,s,r,c){const d=c??l.today(),m=r?l.startOfBroadcastWeek(d,l):s?l.startOfISOWeek(d):l.startOfWeek(d),h=[];for(let p=0;p<7;p++){const y=l.addDays(m,p);h.push(y)}return h}function C2(l,s,r,c,d=!1){if(!l||!s)return;const{startOfYear:m,endOfYear:h,eachYearOfInterval:p,getYear:y}=c,S=m(l),w=h(s),v=p({start:S,end:w});return d&&v.reverse(),v.map(b=>{const _=r.formatYearDropdown(b,c);return{value:y(b),label:_,disabled:!1}})}const fi=l=>l instanceof HTMLElement?l:null,Nc=l=>[...l.querySelectorAll("[data-animated-month]")??[]],E2=l=>fi(l.querySelector("[data-animated-month]")),jc=l=>fi(l.querySelector("[data-animated-caption]")),Cc=l=>fi(l.querySelector("[data-animated-weeks]")),w2=l=>fi(l.querySelector("[data-animated-nav]")),M2=l=>fi(l.querySelector("[data-animated-weekdays]"));function z2(l,s,{classNames:r,months:c,focused:d,dateLib:m}){const h=x.useRef(null),p=x.useRef(c),y=x.useRef(!1);x.useLayoutEffect(()=>{const S=p.current;if(p.current=c,!s||!l.current||!(l.current instanceof HTMLElement)||c.length===0||S.length===0||c.length!==S.length)return;const w=m.isSameMonth(c[0].date,S[0].date),v=m.isAfter(c[0].date,S[0].date),b=v?r[nn.caption_after_enter]:r[nn.caption_before_enter],_=v?r[nn.weeks_after_enter]:r[nn.weeks_before_enter],A=h.current,R=l.current.cloneNode(!0);if(R instanceof HTMLElement?(Nc(R).forEach(G=>{if(!(G instanceof HTMLElement))return;const Q=E2(G);Q&&G.contains(Q)&&G.removeChild(Q);const k=jc(G);k&&k.classList.remove(b);const j=Cc(G);j&&j.classList.remove(_)}),h.current=R):h.current=null,y.current||w||d)return;const B=A instanceof HTMLElement?Nc(A):[],M=Nc(l.current);if(M?.every(Y=>Y instanceof HTMLElement)&&B&&B.every(Y=>Y instanceof HTMLElement)){y.current=!0,l.current.style.isolation="isolate";const Y=w2(l.current);Y&&(Y.style.zIndex="1"),M.forEach((G,Q)=>{const k=B[Q];if(!k)return;G.style.position="relative",G.style.overflow="hidden";const j=jc(G);j&&j.classList.add(b);const q=Cc(G);q&&q.classList.add(_);const J=()=>{y.current=!1,l.current&&(l.current.style.isolation=""),Y&&(Y.style.zIndex=""),j&&j.classList.remove(b),q&&q.classList.remove(_),G.style.position="",G.style.overflow="",G.contains(k)&&G.removeChild(k)};k.style.pointerEvents="none",k.style.position="absolute",k.style.overflow="hidden",k.setAttribute("aria-hidden","true");const ee=M2(k);ee&&(ee.style.opacity="0");const de=jc(k);de&&(de.classList.add(v?r[nn.caption_before_exit]:r[nn.caption_after_exit]),de.addEventListener("animationend",J));const xe=Cc(k);xe&&xe.classList.add(v?r[nn.weeks_before_exit]:r[nn.weeks_after_exit]),G.insertBefore(k,G.firstChild)})}})}function T2(l,s,r,c){const d=l[0],m=l[l.length-1],{ISOWeek:h,fixedWeeks:p,broadcastCalendar:y}=r??{},{addDays:S,differenceInCalendarDays:w,differenceInCalendarMonths:v,endOfBroadcastWeek:b,endOfISOWeek:_,endOfMonth:A,endOfWeek:R,isAfter:B,startOfBroadcastWeek:M,startOfISOWeek:Y,startOfWeek:G}=c,Q=y?M(d,c):h?Y(d):G(d),k=y?b(m):h?_(A(m)):R(A(m)),j=s&&(y?b(s):h?_(s):R(s)),q=j&&B(k,j)?j:k,J=w(q,Q),ee=v(m,d)+1,de=[];for(let Ye=0;Ye<=J;Ye++){const Se=S(Q,Ye);de.push(Se)}const oe=(y?35:42)*ee;if(p&&de.length<oe){const Ye=oe-de.length;for(let Se=0;Se<Ye;Se++){const $=S(de[de.length-1],1);de.push($)}}return de}function O2(l){const s=[];return l.reduce((r,c)=>{const d=c.weeks.reduce((m,h)=>m.concat(h.days.slice()),s.slice());return r.concat(d.slice())},s.slice())}function A2(l,s,r,c){const{numberOfMonths:d=1}=r,m=[];for(let h=0;h<d;h++){const p=c.addMonths(l,h);if(s&&p>s)break;m.push(p)}return m}function Op(l,s,r,c){const{month:d,defaultMonth:m,today:h=c.today(),numberOfMonths:p=1}=l;let y=d||m||h;const{differenceInCalendarMonths:S,addMonths:w,startOfMonth:v}=c;if(r&&S(r,y)<p-1){const b=-1*(p-1);y=w(r,b)}return s&&S(y,s)<0&&(y=s),v(y)}function D2(l,s,r,c){const{addDays:d,endOfBroadcastWeek:m,endOfISOWeek:h,endOfMonth:p,endOfWeek:y,getISOWeek:S,getWeek:w,startOfBroadcastWeek:v,startOfISOWeek:b,startOfWeek:_}=c,A=l.reduce((R,B)=>{const M=r.broadcastCalendar?v(B,c):r.ISOWeek?b(B):_(B),Y=r.broadcastCalendar?m(B):r.ISOWeek?h(p(B)):y(p(B)),G=s.filter(q=>q>=M&&q<=Y),Q=r.broadcastCalendar?35:42;if(r.fixedWeeks&&G.length<Q){const q=s.filter(J=>{const ee=Q-G.length;return J>Y&&J<=d(Y,ee)});G.push(...q)}const k=G.reduce((q,J)=>{const ee=r.ISOWeek?S(J):w(J),de=q.find(oe=>oe.weekNumber===ee),xe=new ey(J,B,c);return de?de.days.push(xe):q.push(new zj(ee,[xe])),q},[]),j=new Mj(B,k);return R.push(j),R},[]);return r.reverseMonths?A.reverse():A}function _2(l,s){let{startMonth:r,endMonth:c}=l;const{startOfYear:d,startOfDay:m,startOfMonth:h,endOfMonth:p,addYears:y,endOfYear:S,newDate:w,today:v}=s,{fromYear:b,toYear:_,fromMonth:A,toMonth:R}=l;!r&&A&&(r=A),!r&&b&&(r=s.newDate(b,0,1)),!c&&R&&(c=R),!c&&_&&(c=w(_,11,31));const B=l.captionLayout==="dropdown"||l.captionLayout==="dropdown-years";return r?r=h(r):b?r=w(b,0,1):!r&&B&&(r=d(y(l.today??v(),-100))),c?c=p(c):_?c=w(_,11,31):!c&&B&&(c=S(l.today??v())),[r&&m(r),c&&m(c)]}function k2(l,s,r,c){if(r.disableNavigation)return;const{pagedNavigation:d,numberOfMonths:m=1}=r,{startOfMonth:h,addMonths:p,differenceInCalendarMonths:y}=c,S=d?m:1,w=h(l);if(!s)return p(w,S);if(!(y(s,l)<m))return p(w,S)}function R2(l,s,r,c){if(r.disableNavigation)return;const{pagedNavigation:d,numberOfMonths:m}=r,{startOfMonth:h,addMonths:p,differenceInCalendarMonths:y}=c,S=d?m??1:1,w=h(l);if(!s)return p(w,-S);if(!(y(w,s)<=0))return p(w,-S)}function U2(l){const s=[];return l.reduce((r,c)=>r.concat(c.weeks.slice()),s.slice())}function nr(l,s){const[r,c]=x.useState(l);return[s===void 0?r:s,c]}function B2(l,s){const[r,c]=_2(l,s),{startOfMonth:d,endOfMonth:m}=s,h=Op(l,r,c,s),[p,y]=nr(h,l.month?h:void 0);x.useEffect(()=>{const Q=Op(l,r,c,s);y(Q)},[l.timeZone]);const{months:S,weeks:w,days:v,previousMonth:b,nextMonth:_}=x.useMemo(()=>{const Q=A2(p,c,{numberOfMonths:l.numberOfMonths},s),k=T2(Q,l.endMonth?m(l.endMonth):void 0,{ISOWeek:l.ISOWeek,fixedWeeks:l.fixedWeeks,broadcastCalendar:l.broadcastCalendar},s),j=D2(Q,k,{broadcastCalendar:l.broadcastCalendar,fixedWeeks:l.fixedWeeks,ISOWeek:l.ISOWeek,reverseMonths:l.reverseMonths},s),q=U2(j),J=O2(j),ee=R2(p,r,l,s),de=k2(p,c,l,s);return{months:j,weeks:q,days:J,previousMonth:ee,nextMonth:de}},[s,p.getTime(),c?.getTime(),r?.getTime(),l.disableNavigation,l.broadcastCalendar,l.endMonth?.getTime(),l.fixedWeeks,l.ISOWeek,l.numberOfMonths,l.pagedNavigation,l.reverseMonths]),{disableNavigation:A,onMonthChange:R}=l,B=Q=>w.some(k=>k.days.some(j=>j.isEqualTo(Q))),M=Q=>{if(A)return;let k=d(Q);r&&k<d(r)&&(k=d(r)),c&&k>d(c)&&(k=d(c)),y(k),R?.(k)};return{months:S,weeks:w,days:v,navStart:r,navEnd:c,previousMonth:b,nextMonth:_,goToMonth:M,goToDay:Q=>{B(Q)||M(Q.date)}}}var _n;(function(l){l[l.Today=0]="Today",l[l.Selected=1]="Selected",l[l.LastFocused=2]="LastFocused",l[l.FocusedModifier=3]="FocusedModifier"})(_n||(_n={}));function Ap(l){return!l[at.disabled]&&!l[at.hidden]&&!l[at.outside]}function H2(l,s,r,c){let d,m=-1;for(const h of l){const p=s(h);Ap(p)&&(p[at.focused]&&m<_n.FocusedModifier?(d=h,m=_n.FocusedModifier):c?.isEqualTo(h)&&m<_n.LastFocused?(d=h,m=_n.LastFocused):r(h.date)&&m<_n.Selected?(d=h,m=_n.Selected):p[at.today]&&m<_n.Today&&(d=h,m=_n.Today))}return d||(d=l.find(h=>Ap(s(h)))),d}function q2(l,s,r,c,d,m,h){const{ISOWeek:p,broadcastCalendar:y}=m,{addDays:S,addMonths:w,addWeeks:v,addYears:b,endOfBroadcastWeek:_,endOfISOWeek:A,endOfWeek:R,max:B,min:M,startOfBroadcastWeek:Y,startOfISOWeek:G,startOfWeek:Q}=h;let j={day:S,week:v,month:w,year:b,startOfWeek:q=>y?Y(q,h):p?G(q):Q(q),endOfWeek:q=>y?_(q):p?A(q):R(q)}[l](r,s==="after"?1:-1);return s==="before"&&c?j=B([c,j]):s==="after"&&d&&(j=M([d,j])),j}function py(l,s,r,c,d,m,h,p=0){if(p>365)return;const y=q2(l,s,r.date,c,d,m,h),S=!!(m.disabled&&ua(y,m.disabled,h)),w=!!(m.hidden&&ua(y,m.hidden,h)),v=y,b=new ey(y,v,h);return!S&&!w?b:py(l,s,b,c,d,m,h,p+1)}function L2(l,s,r,c,d){const{autoFocus:m}=l,[h,p]=x.useState(),y=H2(s.days,r,c||(()=>!1),h),[S,w]=x.useState(m?y:void 0);return{isFocusTarget:R=>!!y?.isEqualTo(R),setFocused:w,focused:S,blur:()=>{p(S),w(void 0)},moveFocus:(R,B)=>{if(!S)return;const M=py(R,B,S,s.navStart,s.navEnd,l,d);M&&(l.disableNavigation&&!s.days.some(G=>G.isEqualTo(M))||(s.goToDay(M),w(M)))}}}function Y2(l,s){const{selected:r,required:c,onSelect:d}=l,[m,h]=nr(r,d?r:void 0),p=d?r:m,{isSameDay:y}=s,S=_=>p?.some(A=>y(A,_))??!1,{min:w,max:v}=l;return{selected:p,select:(_,A,R)=>{let B=[...p??[]];if(S(_)){if(p?.length===w||c&&p?.length===1)return;B=p?.filter(M=>!y(M,_))}else p?.length===v?B=[_]:B=[...B,_];return d||h(B),d?.(B,_,A,R),B},isSelected:S}}function G2(l,s,r=0,c=0,d=!1,m=Rn){const{from:h,to:p}=s||{},{isSameDay:y,isAfter:S,isBefore:w}=m;let v;if(!h&&!p)v={from:l,to:r>0?void 0:l};else if(h&&!p)y(h,l)?r===0?v={from:h,to:l}:d?v={from:h,to:void 0}:v=void 0:w(l,h)?v={from:l,to:h}:v={from:h,to:l};else if(h&&p)if(y(h,l)&&y(p,l))d?v={from:h,to:p}:v=void 0;else if(y(h,l))v={from:h,to:r>0?void 0:l};else if(y(p,l))v={from:l,to:r>0?void 0:l};else if(w(l,h))v={from:l,to:p};else if(S(l,h))v={from:h,to:l};else if(S(l,p))v={from:h,to:l};else throw new Error("Invalid range");if(v?.from&&v?.to){const b=m.differenceInCalendarDays(v.to,v.from);c>0&&b>c?v={from:l,to:void 0}:r>1&&b<r&&(v={from:l,to:void 0})}return v}function K2(l,s,r=Rn){const c=Array.isArray(s)?s:[s];let d=l.from;const m=r.differenceInCalendarDays(l.to,l.from),h=Math.min(m,6);for(let p=0;p<=h;p++){if(c.includes(d.getDay()))return!0;d=r.addDays(d,1)}return!1}function Dp(l,s,r=Rn){return ra(l,s.from,!1,r)||ra(l,s.to,!1,r)||ra(s,l.from,!1,r)||ra(s,l.to,!1,r)}function V2(l,s,r=Rn){const c=Array.isArray(s)?s:[s];if(c.filter(p=>typeof p!="function").some(p=>typeof p=="boolean"?p:r.isDate(p)?ra(l,p,!1,r):ay(p,r)?p.some(y=>ra(l,y,!1,r)):tr(p)?p.from&&p.to?Dp(l,{from:p.from,to:p.to},r):!1:ny(p)?K2(l,p.dayOfWeek,r):$c(p)?r.isAfter(p.before,p.after)?Dp(l,{from:r.addDays(p.after,1),to:r.addDays(p.before,-1)},r):ua(l.from,p,r)||ua(l.to,p,r):Fc(p)||Ic(p)?ua(l.from,p,r)||ua(l.to,p,r):!1))return!0;const h=c.filter(p=>typeof p=="function");if(h.length){let p=l.from;const y=r.differenceInCalendarDays(l.to,l.from);for(let S=0;S<=y;S++){if(h.some(w=>w(p)))return!0;p=r.addDays(p,1)}}return!1}function Q2(l,s){const{disabled:r,excludeDisabled:c,selected:d,required:m,onSelect:h}=l,[p,y]=nr(d,h?d:void 0),S=h?d:p;return{selected:S,select:(b,_,A)=>{const{min:R,max:B}=l,M=b?G2(b,S,R,B,m,s):void 0;return c&&r&&M?.from&&M.to&&V2({from:M.from,to:M.to},r,s)&&(M.from=b,M.to=void 0),h||y(M),h?.(M,b,_,A),M},isSelected:b=>S&&ra(S,b,!1,s)}}function X2(l,s){const{selected:r,required:c,onSelect:d}=l,[m,h]=nr(r,d?r:void 0),p=d?r:m,{isSameDay:y}=s;return{selected:p,select:(v,b,_)=>{let A=v;return!c&&p&&p&&y(v,p)&&(A=void 0),d||h(A),d?.(A,v,b,_),A},isSelected:v=>p?y(p,v):!1}}function Z2(l,s){const r=X2(l,s),c=Y2(l,s),d=Q2(l,s);switch(l.mode){case"single":return r;case"multiple":return c;case"range":return d;default:return}}function Mt(l,s){return l instanceof oa&&l.timeZone===s?l:new oa(l,s)}function _p(l,s){return typeof l=="boolean"||typeof l=="function"?l:l instanceof Date?Mt(l,s):Array.isArray(l)?l.map(r=>r instanceof Date?Mt(r,s):r):tr(l)?{...l,from:l.from?Mt(l.from,s):l.from,to:l.to?Mt(l.to,s):l.to}:$c(l)?{before:Mt(l.before,s),after:Mt(l.after,s)}:Fc(l)?{after:Mt(l.after,s)}:Ic(l)?{before:Mt(l.before,s)}:l}function Ec(l,s){return l&&(Array.isArray(l)?l.map(r=>_p(r,s)):_p(l,s))}function W2(l){let s=l;const r=s.timeZone;if(r&&(s={...l,timeZone:r},s.today&&(s.today=Mt(s.today,r)),s.month&&(s.month=Mt(s.month,r)),s.defaultMonth&&(s.defaultMonth=Mt(s.defaultMonth,r)),s.startMonth&&(s.startMonth=Mt(s.startMonth,r)),s.endMonth&&(s.endMonth=Mt(s.endMonth,r)),s.mode==="single"&&s.selected?s.selected=Mt(s.selected,r):s.mode==="multiple"&&s.selected?s.selected=s.selected?.map(ie=>Mt(ie,r)):s.mode==="range"&&s.selected&&(s.selected={from:s.selected.from?Mt(s.selected.from,r):s.selected.from,to:s.selected.to?Mt(s.selected.to,r):s.selected.to}),s.disabled!==void 0&&(s.disabled=Ec(s.disabled,r)),s.hidden!==void 0&&(s.hidden=Ec(s.hidden,r)),s.modifiers)){const ie={};Object.keys(s.modifiers).forEach(be=>{ie[be]=Ec(s.modifiers?.[be],r)}),s.modifiers=ie}const{components:c,formatters:d,labels:m,dateLib:h,locale:p,classNames:y}=x.useMemo(()=>{const ie={...Pg,...s.locale},be=new an({locale:ie,weekStartsOn:s.broadcastCalendar?1:s.weekStartsOn,firstWeekContainsDate:s.firstWeekContainsDate,useAdditionalWeekYearTokens:s.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:s.useAdditionalDayOfYearTokens,timeZone:s.timeZone,numerals:s.numerals},s.dateLib);return{dateLib:be,components:l2(s.components),formatters:p2(s.formatters),labels:b2(s.labels,be.options),locale:ie,classNames:{...i2(),...s.classNames}}},[s.locale,s.broadcastCalendar,s.weekStartsOn,s.firstWeekContainsDate,s.useAdditionalWeekYearTokens,s.useAdditionalDayOfYearTokens,s.timeZone,s.numerals,s.dateLib,s.components,s.formatters,s.labels,s.classNames]);s.today||(s={...s,today:h.today()});const{captionLayout:S,mode:w,navLayout:v,numberOfMonths:b=1,onDayBlur:_,onDayClick:A,onDayFocus:R,onDayKeyDown:B,onDayMouseEnter:M,onDayMouseLeave:Y,onNextClick:G,onPrevClick:Q,showWeekNumber:k,styles:j}=s,{formatCaption:q,formatDay:J,formatMonthDropdown:ee,formatWeekNumber:de,formatWeekNumberHeader:xe,formatWeekdayName:oe,formatYearDropdown:Ye}=d,Se=B2(s,h),{days:$,months:z,navStart:Z,navEnd:ae,previousMonth:ye,nextMonth:ve,goToMonth:Oe}=Se,ce=n2($,s,Z,ae,h),{isSelected:X,select:F,selected:le}=Z2(s,h)??{},{blur:I,focused:ne,isFocusTarget:ge,moveFocus:Ae,setFocused:Ge}=L2(s,Se,ce,X??(()=>!1),h),{labelDayButton:ht,labelGridcell:pt,labelGrid:Ve,labelMonthDropdown:et,labelNav:Dt,labelPrevious:Kt,labelNext:Un,labelWeekday:Ne,labelWeekNumber:Vt,labelWeekNumberHeader:En,labelYearDropdown:Qt}=m,ca=x.useMemo(()=>j2(h,s.ISOWeek,s.broadcastCalendar,s.today),[h,s.ISOWeek,s.broadcastCalendar,s.today]),Bn=w!==void 0||A!==void 0,ot=x.useCallback(()=>{ye&&(Oe(ye),Q?.(ye))},[ye,Oe,Q]),Xt=x.useCallback(()=>{ve&&(Oe(ve),G?.(ve))},[Oe,ve,G]),Hn=x.useCallback((ie,be)=>me=>{me.preventDefault(),me.stopPropagation(),Ge(ie),!be.disabled&&(F?.(ie.date,be,me),A?.(ie.date,be,me))},[F,A,Ge]),qa=x.useCallback((ie,be)=>me=>{Ge(ie),R?.(ie.date,be,me)},[R,Ge]),wn=x.useCallback((ie,be)=>me=>{I(),_?.(ie.date,be,me)},[I,_]),Mn=x.useCallback((ie,be)=>me=>{const ze={ArrowLeft:[me.shiftKey?"month":"day",s.dir==="rtl"?"after":"before"],ArrowRight:[me.shiftKey?"month":"day",s.dir==="rtl"?"before":"after"],ArrowDown:[me.shiftKey?"year":"week","after"],ArrowUp:[me.shiftKey?"year":"week","before"],PageUp:[me.shiftKey?"year":"month","before"],PageDown:[me.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(ze[me.key]){me.preventDefault(),me.stopPropagation();const[Fe,pe]=ze[me.key];Ae(Fe,pe)}B?.(ie.date,be,me)},[Ae,B,s.dir]),cl=x.useCallback((ie,be)=>me=>{M?.(ie.date,be,me)},[M]),ns=x.useCallback((ie,be)=>me=>{Y?.(ie.date,be,me)},[Y]),as=x.useCallback(ie=>be=>{const me=Number(be.target.value),ze=h.setMonth(h.startOfMonth(ie),me);Oe(ze)},[h,Oe]),qn=x.useCallback(ie=>be=>{const me=Number(be.target.value),ze=h.setYear(h.startOfMonth(ie),me);Oe(ze)},[h,Oe]),{className:W,style:we}=x.useMemo(()=>({className:[y[re.Root],s.className].filter(Boolean).join(" "),style:{...j?.[re.Root],...s.style}}),[y,s.className,s.style,j]),fe=s2(s),Me=x.useRef(null);z2(Me,!!s.animate,{classNames:y,months:z,focused:ne,dateLib:h});const tt={dayPickerProps:s,selected:le,select:F,isSelected:X,months:z,nextMonth:ve,previousMonth:ye,goToMonth:Oe,getModifiers:ce,components:c,classNames:y,styles:j,labels:m,formatters:d};return P.createElement(ty.Provider,{value:tt},P.createElement(c.Root,{rootRef:s.animate?Me:void 0,className:W,style:we,dir:s.dir,id:s.id,lang:s.lang,nonce:s.nonce,title:s.title,role:s.role,"aria-label":s["aria-label"],"aria-labelledby":s["aria-labelledby"],...fe},P.createElement(c.Months,{className:y[re.Months],style:j?.[re.Months]},!s.hideNavigation&&!v&&P.createElement(c.Nav,{"data-animated-nav":s.animate?"true":void 0,className:y[re.Nav],style:j?.[re.Nav],"aria-label":Dt(),onPreviousClick:ot,onNextClick:Xt,previousMonth:ye,nextMonth:ve}),z.map((ie,be)=>P.createElement(c.Month,{"data-animated-month":s.animate?"true":void 0,className:y[re.Month],style:j?.[re.Month],key:be,displayIndex:be,calendarMonth:ie},v==="around"&&!s.hideNavigation&&be===0&&P.createElement(c.PreviousMonthButton,{type:"button",className:y[re.PreviousMonthButton],tabIndex:ye?void 0:-1,"aria-disabled":ye?void 0:!0,"aria-label":Kt(ye),onClick:ot,"data-animated-button":s.animate?"true":void 0},P.createElement(c.Chevron,{disabled:ye?void 0:!0,className:y[re.Chevron],orientation:s.dir==="rtl"?"right":"left"})),P.createElement(c.MonthCaption,{"data-animated-caption":s.animate?"true":void 0,className:y[re.MonthCaption],style:j?.[re.MonthCaption],calendarMonth:ie,displayIndex:be},S?.startsWith("dropdown")?P.createElement(c.DropdownNav,{className:y[re.Dropdowns],style:j?.[re.Dropdowns]},(()=>{const me=S==="dropdown"||S==="dropdown-months"?P.createElement(c.MonthsDropdown,{key:"month",className:y[re.MonthsDropdown],"aria-label":et(),classNames:y,components:c,disabled:!!s.disableNavigation,onChange:as(ie.date),options:S2(ie.date,Z,ae,d,h),style:j?.[re.Dropdown],value:h.getMonth(ie.date)}):P.createElement("span",{key:"month"},ee(ie.date,h)),ze=S==="dropdown"||S==="dropdown-years"?P.createElement(c.YearsDropdown,{key:"year",className:y[re.YearsDropdown],"aria-label":Qt(h.options),classNames:y,components:c,disabled:!!s.disableNavigation,onChange:qn(ie.date),options:C2(Z,ae,d,h,!!s.reverseYears),style:j?.[re.Dropdown],value:h.getYear(ie.date)}):P.createElement("span",{key:"year"},Ye(ie.date,h));return h.getMonthYearOrder()==="year-first"?[ze,me]:[me,ze]})(),P.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"}},q(ie.date,h.options,h))):P.createElement(c.CaptionLabel,{className:y[re.CaptionLabel],role:"status","aria-live":"polite"},q(ie.date,h.options,h))),v==="around"&&!s.hideNavigation&&be===b-1&&P.createElement(c.NextMonthButton,{type:"button",className:y[re.NextMonthButton],tabIndex:ve?void 0:-1,"aria-disabled":ve?void 0:!0,"aria-label":Un(ve),onClick:Xt,"data-animated-button":s.animate?"true":void 0},P.createElement(c.Chevron,{disabled:ve?void 0:!0,className:y[re.Chevron],orientation:s.dir==="rtl"?"left":"right"})),be===b-1&&v==="after"&&!s.hideNavigation&&P.createElement(c.Nav,{"data-animated-nav":s.animate?"true":void 0,className:y[re.Nav],style:j?.[re.Nav],"aria-label":Dt(),onPreviousClick:ot,onNextClick:Xt,previousMonth:ye,nextMonth:ve}),P.createElement(c.MonthGrid,{role:"grid","aria-multiselectable":w==="multiple"||w==="range","aria-label":Ve(ie.date,h.options,h)||void 0,className:y[re.MonthGrid],style:j?.[re.MonthGrid]},!s.hideWeekdays&&P.createElement(c.Weekdays,{"data-animated-weekdays":s.animate?"true":void 0,className:y[re.Weekdays],style:j?.[re.Weekdays]},k&&P.createElement(c.WeekNumberHeader,{"aria-label":En(h.options),className:y[re.WeekNumberHeader],style:j?.[re.WeekNumberHeader],scope:"col"},xe()),ca.map(me=>P.createElement(c.Weekday,{"aria-label":Ne(me,h.options,h),className:y[re.Weekday],key:String(me),style:j?.[re.Weekday],scope:"col"},oe(me,h.options,h)))),P.createElement(c.Weeks,{"data-animated-weeks":s.animate?"true":void 0,className:y[re.Weeks],style:j?.[re.Weeks]},ie.weeks.map(me=>P.createElement(c.Week,{className:y[re.Week],key:me.weekNumber,style:j?.[re.Week],week:me},k&&P.createElement(c.WeekNumber,{week:me,style:j?.[re.WeekNumber],"aria-label":Vt(me.weekNumber,{locale:p}),className:y[re.WeekNumber],scope:"row",role:"rowheader"},de(me.weekNumber,h)),me.days.map(ze=>{const{date:Fe}=ze,pe=ce(ze);if(pe[at.focused]=!pe.hidden&&!!ne?.isEqualTo(ze),pe[jn.selected]=X?.(Fe)||pe.selected,tr(le)){const{from:Zt,to:yn}=le;pe[jn.range_start]=!!(Zt&&yn&&h.isSameDay(Fe,Zt)),pe[jn.range_end]=!!(Zt&&yn&&h.isSameDay(Fe,yn)),pe[jn.range_middle]=ra(le,Fe,!0,h)}const zt=N2(pe,j,s.modifiersStyles),Ln=a2(pe,y,s.modifiersClassNames),vt=!Bn&&!pe.hidden?pt(Fe,pe,h.options,h):void 0;return P.createElement(c.Day,{key:`${ze.isoDate}_${ze.displayMonthId}`,day:ze,modifiers:pe,className:Ln.join(" "),style:zt,role:"gridcell","aria-selected":pe.selected||void 0,"aria-label":vt,"data-day":ze.isoDate,"data-month":ze.outside?ze.dateMonthId:void 0,"data-selected":pe.selected||void 0,"data-disabled":pe.disabled||void 0,"data-hidden":pe.hidden||void 0,"data-outside":ze.outside||void 0,"data-focused":pe.focused||void 0,"data-today":pe.today||void 0},!pe.hidden&&Bn?P.createElement(c.DayButton,{className:y[re.DayButton],style:j?.[re.DayButton],type:"button",day:ze,modifiers:pe,disabled:!pe.focused&&pe.disabled||void 0,"aria-disabled":pe.focused&&pe.disabled||void 0,tabIndex:ge(ze)?0:-1,"aria-label":ht(Fe,pe,h.options,h),onClick:Hn(ze,pe),onBlur:wn(ze,pe),onFocus:qa(ze,pe),onKeyDown:Mn(ze,pe),onMouseEnter:cl(ze,pe),onMouseLeave:ns(ze,pe)},J(Fe,h.options,h)):!pe.hidden&&J(ze.date,h.options,h))})))))))),s.footer&&P.createElement(c.Footer,{className:y[re.Footer],style:j?.[re.Footer],role:"status","aria-live":"polite"},s.footer)))}function J2({className:l,classNames:s,showOutsideDays:r=!0,...c}){return o.jsx(W2,{showOutsideDays:r,className:V("p-2",l),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:V(Oo({variant:"ghost"}),"h-7 w-7 bg-transparent p-0 opacity-70 hover:opacity-100 hover:bg-accent rounded-md"),button_next:V(Oo({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:V("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:V(Oo({variant:"ghost"}),"h-8 w-8 p-0 font-normal rounded-full text-xs","aria-selected:opacity-100"),range_start:V("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:V("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:V("aria-selected:bg-accent aria-selected:text-accent-foreground","aria-selected:rounded-none"),selected:V("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",...s},components:{Chevron:({orientation:d,className:m,...h})=>{const p=d==="left"?pb:d==="right"?qo:d==="up"?_c:Qo;return o.jsx(p,{className:V("h-4 w-4",m),...h})}},...c})}J2.displayName="Calendar";const $2=x.lazy(()=>At(()=>import("./index-Bdp0Hpgh.js"),__vite__mapDeps([13,1,2,14,4,5,7,15,6,8,9])).then(l=>({default:l.AnalyticsPage}))),F2=x.lazy(()=>At(()=>import("./api-TANgowVA.js"),__vite__mapDeps([16,1,2,5,17,18,6,4,14,7,8,9])).then(l=>({default:l.ApiPage}))),I2=x.lazy(()=>At(()=>import("./cliproxy-BpCuX751.js"),__vite__mapDeps([19,1,2,5,6,4,14,17,18,3,7,8,9])).then(l=>({default:l.CliproxyPage}))),P2=x.lazy(()=>At(()=>import("./cliproxy-control-panel-Cp0Tweyl.js"),__vite__mapDeps([20,1,2,5,4,6,7,8,9])).then(l=>({default:l.CliproxyControlPanelPage}))),eC=x.lazy(()=>At(()=>import("./copilot-DvOZJmtw.js"),__vite__mapDeps([21,1,2,5,17,18,4,3,6,7,8,9])).then(l=>({default:l.CopilotPage}))),tC=x.lazy(()=>At(()=>import("./accounts-CZms_PBW.js"),__vite__mapDeps([22,1,2,5,18,6,4,7,8,9])).then(l=>({default:l.AccountsPage}))),nC=x.lazy(()=>At(()=>Promise.resolve().then(()=>vj),void 0).then(l=>({default:l.SettingsPage}))),aC=x.lazy(()=>At(()=>import("./health-D1M4owiM.js"),__vite__mapDeps([23,1,2,5,6,4,7,8,9])).then(l=>({default:l.HealthPage}))),lC=x.lazy(()=>At(()=>import("./shared-Dgmje0CZ.js"),__vite__mapDeps([24,1,2,14,4,5,6,7,8,9])).then(l=>({default:l.SharedPage})));function sC(){return o.jsx(c0,{client:Ob,children:o.jsx(Db,{defaultTheme:"system",storageKey:"vite-ui-theme",children:o.jsx(_b,{children:o.jsxs(o0,{children:[o.jsx(r0,{children:o.jsxs(Sn,{element:o.jsx(BS,{}),children:[o.jsx(Sn,{path:"/",element:o.jsx(SN,{})}),o.jsx(Sn,{path:"/analytics",element:o.jsx($2,{})}),o.jsx(Sn,{path:"/providers",element:o.jsx(F2,{})}),o.jsx(Sn,{path:"/cliproxy",element:o.jsx(I2,{})}),o.jsx(Sn,{path:"/cliproxy/control-panel",element:o.jsx(P2,{})}),o.jsx(Sn,{path:"/copilot",element:o.jsx(eC,{})}),o.jsx(Sn,{path:"/accounts",element:o.jsx(tC,{})}),o.jsx(Sn,{path:"/settings",element:o.jsx(nC,{})}),o.jsx(Sn,{path:"/health",element:o.jsx(aC,{})}),o.jsx(Sn,{path:"/shared",element:o.jsx(lC,{})})]})}),o.jsx(d0,{position:"top-right"})]})})})})}const gy=document.getElementById("root");if(!gy)throw new Error("Root element not found. Failed to mount React application.");Mb.createRoot(gy).render(o.jsx(x.StrictMode,{children:o.jsx(sC,{})}));export{Hc as $,dS as A,Ha as B,J2 as C,Lg as D,Wc as E,il as F,zc as G,RC as H,Ra as I,BC as J,HC as K,Dn as L,Kg as M,qC as N,LC as O,fg as P,XN as Q,UC as R,Le as S,Zo as T,GC as U,ZN as V,JN as W,u1 as X,gC as Y,bC as Z,Bc as _,St as a,qc as a0,Lc as a1,Yc as a2,SC as a3,YC as a4,WN as a5,TS as a6,yt as a7,NC as a8,jC as a9,CC as aa,EC as ab,KC as ac,wC as ad,TC as ae,MC as af,zC as ag,pC as ah,vC as ai,xC as aj,yC as ak,Vg as al,At as am,Oo as an,vN as ao,OC as ap,Bg as aq,Hg as ar,qg as as,$g as at,oj as au,uj as av,Wg as aw,VC as b,V as c,QC as d,xj as e,f1 as f,hC as g,m1 as h,ts as i,XC as j,Wo as k,Jo as l,bp as m,UN as n,kC as o,DN as p,AC as q,_C as r,wN as s,jN as t,Rc as u,ON as v,_N as w,DC as x,uS as y,cS as z};