shin / src /free_claude_code /api /admin_static /assets /admin-BAhHW7XP.js
shinmentakezo07
feat: theme dashboard charts and expose admin UI on HF Spaces
8bdd0d7
Raw
History Blame Contribute Delete
371 kB
import{r as Av,a as Tv,b as S,c as Tp,R as Hi,d as hu,e as pu,A as Ep,f as ms,P as Ev,T as zp,g as zv,C as _v,h as Mv,X as Ov,Y as kv}from"./recharts-DxKpixTe.js";import{u as Rv,i as Dv,a as Uv,b as Lv,c as Hv,d as Bv,e as qv,f as Gv}from"./echarts-CXqmOJiP.js";(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const m of document.querySelectorAll('link[rel="modulepreload"]'))c(m);new MutationObserver(m=>{for(const f of m)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function r(m){const f={};return m.integrity&&(f.integrity=m.integrity),m.referrerPolicy&&(f.referrerPolicy=m.referrerPolicy),m.crossOrigin==="use-credentials"?f.credentials="include":m.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function c(m){if(m.ep)return;m.ep=!0;const f=r(m);fetch(m.href,f)}})();var Gr={exports:{}},Ei={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Gh;function Vv(){if(Gh)return Ei;Gh=1;var a=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function r(c,m,f){var h=null;if(f!==void 0&&(h=""+f),m.key!==void 0&&(h=""+m.key),"key"in m){f={};for(var p in m)p!=="key"&&(f[p]=m[p])}else f=m;return m=f.ref,{$$typeof:a,type:c,key:h,ref:m!==void 0?m:null,props:f}}return Ei.Fragment=o,Ei.jsx=r,Ei.jsxs=r,Ei}var Vh;function Yv(){return Vh||(Vh=1,Gr.exports=Vv()),Gr.exports}var u=Yv(),Vr={exports:{}},zi={},Yr={exports:{}},Xr={};/**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Yh;function Xv(){return Yh||(Yh=1,(function(a){function o(A,D){var H=A.length;A.push(D);e:for(;0<H;){var P=H-1>>>1,se=A[P];if(0<m(se,D))A[P]=D,A[H]=se,H=P;else break e}}function r(A){return A.length===0?null:A[0]}function c(A){if(A.length===0)return null;var D=A[0],H=A.pop();if(H!==D){A[0]=H;e:for(var P=0,se=A.length,je=se>>>1;P<je;){var ze=2*(P+1)-1,pe=A[ze],He=ze+1,st=A[He];if(0>m(pe,H))He<se&&0>m(st,pe)?(A[P]=st,A[He]=H,P=He):(A[P]=pe,A[ze]=H,P=ze);else if(He<se&&0>m(st,H))A[P]=st,A[He]=H,P=He;else break e}}return D}function m(A,D){var H=A.sortIndex-D.sortIndex;return H!==0?H:A.id-D.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;a.unstable_now=function(){return f.now()}}else{var h=Date,p=h.now();a.unstable_now=function(){return h.now()-p}}var y=[],v=[],j=1,b=null,x=3,C=!1,w=!1,E=!1,O=!1,k=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,q=typeof setImmediate<"u"?setImmediate:null;function Z(A){for(var D=r(v);D!==null;){if(D.callback===null)c(v);else if(D.startTime<=A)c(v),D.sortIndex=D.expirationTime,o(y,D);else break;D=r(v)}}function V(A){if(E=!1,Z(A),!w)if(r(y)!==null)w=!0,z||(z=!0,$());else{var D=r(v);D!==null&&J(V,D.startTime-A)}}var z=!1,Q=-1,W=5,ne=-1;function le(){return O?!0:!(a.unstable_now()-ne<W)}function re(){if(O=!1,z){var A=a.unstable_now();ne=A;var D=!0;try{e:{w=!1,E&&(E=!1,B(Q),Q=-1),C=!0;var H=x;try{t:{for(Z(A),b=r(y);b!==null&&!(b.expirationTime>A&&le());){var P=b.callback;if(typeof P=="function"){b.callback=null,x=b.priorityLevel;var se=P(b.expirationTime<=A);if(A=a.unstable_now(),typeof se=="function"){b.callback=se,Z(A),D=!0;break t}b===r(y)&&c(y),Z(A)}else c(y);b=r(y)}if(b!==null)D=!0;else{var je=r(v);je!==null&&J(V,je.startTime-A),D=!1}}break e}finally{b=null,x=H,C=!1}D=void 0}}finally{D?$():z=!1}}}var $;if(typeof q=="function")$=function(){q(re)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,ie=F.port2;F.port1.onmessage=re,$=function(){ie.postMessage(null)}}else $=function(){k(re,0)};function J(A,D){Q=k(function(){A(a.unstable_now())},D)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(A){A.callback=null},a.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<A?Math.floor(1e3/A):5},a.unstable_getCurrentPriorityLevel=function(){return x},a.unstable_next=function(A){switch(x){case 1:case 2:case 3:var D=3;break;default:D=x}var H=x;x=D;try{return A()}finally{x=H}},a.unstable_requestPaint=function(){O=!0},a.unstable_runWithPriority=function(A,D){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var H=x;x=A;try{return D()}finally{x=H}},a.unstable_scheduleCallback=function(A,D,H){var P=a.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?P+H:P):H=P,A){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=H+se,A={id:j++,callback:D,priorityLevel:A,startTime:H,expirationTime:se,sortIndex:-1},H>P?(A.sortIndex=H,o(v,A),r(y)===null&&A===r(v)&&(E?(B(Q),Q=-1):E=!0,J(V,H-P))):(A.sortIndex=se,o(y,A),w||C||(w=!0,z||(z=!0,$()))),A},a.unstable_shouldYield=le,a.unstable_wrapCallback=function(A){var D=x;return function(){var H=x;x=D;try{return A.apply(this,arguments)}finally{x=H}}}})(Xr)),Xr}var Xh;function Qv(){return Xh||(Xh=1,Yr.exports=Xv()),Yr.exports}/**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Qh;function Zv(){if(Qh)return zi;Qh=1;var a=Qv(),o=Av(),r=Tv();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 m(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(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(f(e)!==e)throw Error(c(188))}function v(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,l=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(l=i.return,l!==null){n=l;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return y(i),e;if(s===l)return y(i),t;s=s.sibling}throw Error(c(188))}if(n.return!==l.return)n=i,l=s;else{for(var d=!1,g=i.child;g;){if(g===n){d=!0,n=i,l=s;break}if(g===l){d=!0,l=i,n=s;break}g=g.sibling}if(!d){for(g=s.child;g;){if(g===n){d=!0,n=s,l=i;break}if(g===l){d=!0,l=s,n=i;break}g=g.sibling}if(!d)throw Error(c(189))}}if(n.alternate!==l)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function j(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=j(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,x=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),q=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),le=Symbol.for("react.memo_cache_sentinel"),re=Symbol.iterator;function $(e){return e===null||typeof e!="object"?null:(e=re&&e[re]||e["@@iterator"],typeof e=="function"?e:null)}var F=Symbol.for("react.client.reference");function ie(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===F?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case k:return"Profiler";case O:return"StrictMode";case V:return"Suspense";case z:return"SuspenseList";case ne:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case q:return e.displayName||"Context";case B:return(e._context.displayName||"Context")+".Consumer";case Z: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:ie(e.type)||"Memo";case W:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}var J=Array.isArray,A=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},P=[],se=-1;function je(e){return{current:e}}function ze(e){0>se||(e.current=P[se],P[se]=null,se--)}function pe(e,t){se++,P[se]=e.current,e.current=t}var He=je(null),st=je(null),zt=je(null),Rn=je(null);function Wt(e,t){switch(pe(zt,t),pe(st,e),pe(He,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?uh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=uh(t),e=fh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ze(He),pe(He,e)}function Yt(){ze(He),ze(st),ze(zt)}function K(e){e.memoizedState!==null&&pe(Rn,e);var t=He.current,n=fh(t,e.type);t!==n&&(pe(st,e),pe(He,n))}function I(e){st.current===e&&(ze(He),ze(st)),Rn.current===e&&(ze(Rn),Ni._currentValue=H)}var ee,ue;function Be(e){if(ee===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ee=t&&t[1]||"",ue=-1<n.stack.indexOf(`
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
`+ee+e+ue}var Dn=!1;function hl(e,t){if(!e||Dn)return"";Dn=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var X=function(){throw Error()};if(Object.defineProperty(X.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(X,[])}catch(L){var U=L}Reflect.construct(e,[],X)}else{try{X.call()}catch(L){U=L}e.call(X.prototype)}}else{try{throw Error()}catch(L){U=L}(X=e())&&typeof X.catch=="function"&&X.catch(function(){})}}catch(L){if(L&&U&&typeof L.stack=="string")return[L.stack,U.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var s=l.DetermineComponentFrameRoot(),d=s[0],g=s[1];if(d&&g){var N=d.split(`
`),R=g.split(`
`);for(i=l=0;l<N.length&&!N[l].includes("DetermineComponentFrameRoot");)l++;for(;i<R.length&&!R[i].includes("DetermineComponentFrameRoot");)i++;if(l===N.length||i===R.length)for(l=N.length-1,i=R.length-1;1<=l&&0<=i&&N[l]!==R[i];)i--;for(;1<=l&&0<=i;l--,i--)if(N[l]!==R[i]){if(l!==1||i!==1)do if(l--,i--,0>i||N[l]!==R[i]){var G=`
`+N[l].replace(" at new "," at ");return e.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",e.displayName)),G}while(1<=l&&0<=i);break}}}finally{Dn=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?Be(n):""}function Xi(e,t){switch(e.tag){case 26:case 27:case 5:return Be(e.type);case 16:return Be("Lazy");case 13:return e.child!==t&&t!==null?Be("Suspense Fallback"):Be("Suspense");case 19:return Be("SuspenseList");case 0:case 15:return hl(e.type,!1);case 11:return hl(e.type.render,!1);case 1:return hl(e.type,!0);case 31:return Be("Activity");default:return""}}function Qi(e){try{var t="",n=null;do t+=Xi(e,n),n=e,e=e.return;while(e);return t}catch(l){return`
Error generating stack: `+l.message+`
`+l.stack}}var ka=Object.prototype.hasOwnProperty,Ra=a.unstable_scheduleCallback,Da=a.unstable_cancelCallback,Bl=a.unstable_shouldYield,iy=a.unstable_requestPaint,gt=a.unstable_now,oy=a.unstable_getCurrentPriorityLevel,Gu=a.unstable_ImmediatePriority,Vu=a.unstable_UserBlockingPriority,Zi=a.unstable_NormalPriority,sy=a.unstable_LowPriority,Yu=a.unstable_IdlePriority,cy=a.log,ry=a.unstable_setDisableYieldValue,Ua=null,yt=null;function Un(e){if(typeof cy=="function"&&ry(e),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(Ua,e)}catch{}}var vt=Math.clz32?Math.clz32:dy,uy=Math.log,fy=Math.LN2;function dy(e){return e>>>=0,e===0?32:31-(uy(e)/fy|0)|0}var Ki=256,$i=262144,Ji=4194304;function pl(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 Wi(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var i=0,s=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var g=l&134217727;return g!==0?(l=g&~s,l!==0?i=pl(l):(d&=g,d!==0?i=pl(d):n||(n=g&~e,n!==0&&(i=pl(n))))):(g=l&~s,g!==0?i=pl(g):d!==0?i=pl(d):n||(n=l&~e,n!==0&&(i=pl(n)))),i===0?0:t!==0&&t!==i&&(t&s)===0&&(s=i&-i,n=t&-t,s>=n||s===32&&(n&4194048)!==0)?t:i}function La(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function my(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 Xu(){var e=Ji;return Ji<<=1,(Ji&62914560)===0&&(Ji=4194304),e}function zs(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ha(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function hy(e,t,n,l,i,s){var d=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,R=e.hiddenUpdates;for(n=d&~n;0<n;){var G=31-vt(n),X=1<<G;g[G]=0,N[G]=-1;var U=R[G];if(U!==null)for(R[G]=null,G=0;G<U.length;G++){var L=U[G];L!==null&&(L.lane&=-536870913)}n&=~X}l!==0&&Qu(e,l,0),s!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=s&~(d&~t))}function Qu(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-vt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function Zu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-vt(n),i=1<<l;i&t|e[l]&t&&(e[l]|=t),n&=~i}}function Ku(e,t){var n=t&-t;return n=(n&42)!==0?1:_s(n),(n&(e.suspendedLanes|t))!==0?0:n}function _s(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ms(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function $u(){var e=D.p;return e!==0?e:(e=window.event,e===void 0?32:Rh(e.type))}function Ju(e,t){var n=D.p;try{return D.p=e,t()}finally{D.p=n}}var Ln=Math.random().toString(36).slice(2),Ie="__reactFiber$"+Ln,ct="__reactProps$"+Ln,ql="__reactContainer$"+Ln,Os="__reactEvents$"+Ln,py="__reactListeners$"+Ln,gy="__reactHandles$"+Ln,Wu="__reactResources$"+Ln,Ba="__reactMarker$"+Ln;function ks(e){delete e[Ie],delete e[ct],delete e[Os],delete e[py],delete e[gy]}function Gl(e){var t=e[Ie];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ql]||n[Ie]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vh(e);e!==null;){if(n=e[Ie])return n;e=vh(e)}return t}e=n,n=e.parentNode}return null}function Vl(e){if(e=e[Ie]||e[ql]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function qa(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function Yl(e){var t=e[Wu];return t||(t=e[Wu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function We(e){e[Ba]=!0}var Fu=new Set,Pu={};function gl(e,t){Xl(e,t),Xl(e+"Capture",t)}function Xl(e,t){for(Pu[e]=t,e=0;e<t.length;e++)Fu.add(t[e])}var yy=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]*$"),Iu={},ef={};function vy(e){return ka.call(ef,e)?!0:ka.call(Iu,e)?!1:yy.test(e)?ef[e]=!0:(Iu[e]=!0,!1)}function Fi(e,t,n){if(vy(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function Pi(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 an(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+l)}}function _t(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function xy(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var i=l.get,s=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(d){n=""+d,s.call(this,d)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(d){n=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Rs(e){if(!e._valueTracker){var t=tf(e)?"checked":"value";e._valueTracker=xy(e,t,""+e[t])}}function nf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=tf(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function Ii(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 by=/[\n"\\]/g;function Mt(e){return e.replace(by,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ds(e,t,n,l,i,s,d,g){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+_t(t)):e.value!==""+_t(t)&&(e.value=""+_t(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?Us(e,d,_t(t)):n!=null?Us(e,d,_t(n)):l!=null&&e.removeAttribute("value"),i==null&&s!=null&&(e.defaultChecked=!!s),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+_t(g):e.removeAttribute("name")}function lf(e,t,n,l,i,s,d,g){if(s!=null&&typeof s!="function"&&typeof s!="symbol"&&typeof s!="boolean"&&(e.type=s),t!=null||n!=null){if(!(s!=="submit"&&s!=="reset"||t!=null)){Rs(e);return}n=n!=null?""+_t(n):"",t=t!=null?""+_t(t):n,g||t===e.value||(e.value=t),e.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=g?e.checked:!!l,e.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Rs(e)}function Us(e,t,n){t==="number"&&Ii(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ql(e,t,n,l){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&&l&&(e[n].defaultSelected=!0)}else{for(n=""+_t(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,l&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function af(e,t,n){if(t!=null&&(t=""+_t(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+_t(n):""}function of(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(c(92));if(J(l)){if(1<l.length)throw Error(c(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=_t(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),Rs(e)}function Zl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Sy=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 sf(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||Sy.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function cf(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var i in t)l=t[i],t.hasOwnProperty(i)&&n[i]!==l&&sf(e,i,l)}else for(var s in t)t.hasOwnProperty(s)&&sf(e,s,t[s])}function Ls(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 jy=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"]]),wy=/^[\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 eo(e){return wy.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function on(){}var Hs=null;function Bs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Kl=null,$l=null;function rf(e){var t=Vl(e);if(t&&(e=t.stateNode)){var n=e[ct]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ds(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="'+Mt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var i=l[ct]||null;if(!i)throw Error(c(90));Ds(l,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&nf(l)}break e;case"textarea":af(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Ql(e,!!n.multiple,t,!1)}}}var qs=!1;function uf(e,t,n){if(qs)return e(t,n);qs=!0;try{var l=e(t);return l}finally{if(qs=!1,(Kl!==null||$l!==null)&&(Vo(),Kl&&(t=Kl,e=$l,$l=Kl=null,rf(t),e)))for(t=0;t<e.length;t++)rf(e[t])}}function Ga(e,t){var n=e.stateNode;if(n===null)return null;var l=n[ct]||null;if(l===null)return null;n=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var sn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Gs=!1;if(sn)try{var Va={};Object.defineProperty(Va,"passive",{get:function(){Gs=!0}}),window.addEventListener("test",Va,Va),window.removeEventListener("test",Va,Va)}catch{Gs=!1}var Hn=null,Vs=null,to=null;function ff(){if(to)return to;var e,t=Vs,n=t.length,l,i="value"in Hn?Hn.value:Hn.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var d=n-e;for(l=1;l<=d&&t[n-l]===i[s-l];l++);return to=i.slice(e,1<l?1-l:void 0)}function no(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 lo(){return!0}function df(){return!1}function rt(e){function t(n,l,i,s,d){this._reactName=n,this._targetInst=i,this.type=l,this.nativeEvent=s,this.target=d,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(n=e[g],this[g]=n?n(s):s[g]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?lo:df,this.isPropagationStopped=df,this}return b(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=lo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=lo)},persist:function(){},isPersistent:lo}),t}var yl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ao=rt(yl),Ya=b({},yl,{view:0,detail:0}),Ny=rt(Ya),Ys,Xs,Xa,io=b({},Ya,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zs,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!==Xa&&(Xa&&e.type==="mousemove"?(Ys=e.screenX-Xa.screenX,Xs=e.screenY-Xa.screenY):Xs=Ys=0,Xa=e),Ys)},movementY:function(e){return"movementY"in e?e.movementY:Xs}}),mf=rt(io),Cy=b({},io,{dataTransfer:0}),Ay=rt(Cy),Ty=b({},Ya,{relatedTarget:0}),Qs=rt(Ty),Ey=b({},yl,{animationName:0,elapsedTime:0,pseudoElement:0}),zy=rt(Ey),_y=b({},yl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),My=rt(_y),Oy=b({},yl,{data:0}),hf=rt(Oy),ky={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ry={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"},Dy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Uy(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Dy[e])?!!t[e]:!1}function Zs(){return Uy}var Ly=b({},Ya,{key:function(e){if(e.key){var t=ky[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=no(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ry[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zs,charCode:function(e){return e.type==="keypress"?no(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?no(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Hy=rt(Ly),By=b({},io,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),pf=rt(By),qy=b({},Ya,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zs}),Gy=rt(qy),Vy=b({},yl,{propertyName:0,elapsedTime:0,pseudoElement:0}),Yy=rt(Vy),Xy=b({},io,{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}),Qy=rt(Xy),Zy=b({},yl,{newState:0,oldState:0}),Ky=rt(Zy),$y=[9,13,27,32],Ks=sn&&"CompositionEvent"in window,Qa=null;sn&&"documentMode"in document&&(Qa=document.documentMode);var Jy=sn&&"TextEvent"in window&&!Qa,gf=sn&&(!Ks||Qa&&8<Qa&&11>=Qa),yf=" ",vf=!1;function xf(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 bf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jl=!1;function Wy(e,t){switch(e){case"compositionend":return bf(t);case"keypress":return t.which!==32?null:(vf=!0,yf);case"textInput":return e=t.data,e===yf&&vf?null:e;default:return null}}function Fy(e,t){if(Jl)return e==="compositionend"||!Ks&&xf(e,t)?(e=ff(),to=Vs=Hn=null,Jl=!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 gf&&t.locale!=="ko"?null:t.data;default:return null}}var Py={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 Sf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Py[e.type]:t==="textarea"}function jf(e,t,n,l){Kl?$l?$l.push(l):$l=[l]:Kl=l,t=Jo(t,"onChange"),0<t.length&&(n=new ao("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var Za=null,Ka=null;function Iy(e){ah(e,0)}function oo(e){var t=qa(e);if(nf(t))return e}function wf(e,t){if(e==="change")return t}var Nf=!1;if(sn){var $s;if(sn){var Js="oninput"in document;if(!Js){var Cf=document.createElement("div");Cf.setAttribute("oninput","return;"),Js=typeof Cf.oninput=="function"}$s=Js}else $s=!1;Nf=$s&&(!document.documentMode||9<document.documentMode)}function Af(){Za&&(Za.detachEvent("onpropertychange",Tf),Ka=Za=null)}function Tf(e){if(e.propertyName==="value"&&oo(Ka)){var t=[];jf(t,Ka,e,Bs(e)),uf(Iy,t)}}function e0(e,t,n){e==="focusin"?(Af(),Za=t,Ka=n,Za.attachEvent("onpropertychange",Tf)):e==="focusout"&&Af()}function t0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return oo(Ka)}function n0(e,t){if(e==="click")return oo(t)}function l0(e,t){if(e==="input"||e==="change")return oo(t)}function a0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var xt=typeof Object.is=="function"?Object.is:a0;function $a(e,t){if(xt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var i=n[l];if(!ka.call(t,i)||!xt(e[i],t[i]))return!1}return!0}function Ef(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function zf(e,t){var n=Ef(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Ef(n)}}function _f(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_f(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ii(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=Ii(e.document)}return t}function Ws(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 i0=sn&&"documentMode"in document&&11>=document.documentMode,Wl=null,Fs=null,Ja=null,Ps=!1;function Of(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ps||Wl==null||Wl!==Ii(l)||(l=Wl,"selectionStart"in l&&Ws(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ja&&$a(Ja,l)||(Ja=l,l=Jo(Fs,"onSelect"),0<l.length&&(t=new ao("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=Wl)))}function vl(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Fl={animationend:vl("Animation","AnimationEnd"),animationiteration:vl("Animation","AnimationIteration"),animationstart:vl("Animation","AnimationStart"),transitionrun:vl("Transition","TransitionRun"),transitionstart:vl("Transition","TransitionStart"),transitioncancel:vl("Transition","TransitionCancel"),transitionend:vl("Transition","TransitionEnd")},Is={},kf={};sn&&(kf=document.createElement("div").style,"AnimationEvent"in window||(delete Fl.animationend.animation,delete Fl.animationiteration.animation,delete Fl.animationstart.animation),"TransitionEvent"in window||delete Fl.transitionend.transition);function xl(e){if(Is[e])return Is[e];if(!Fl[e])return e;var t=Fl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in kf)return Is[e]=t[n];return e}var Rf=xl("animationend"),Df=xl("animationiteration"),Uf=xl("animationstart"),o0=xl("transitionrun"),s0=xl("transitionstart"),c0=xl("transitioncancel"),Lf=xl("transitionend"),Hf=new Map,ec="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(" ");ec.push("scrollEnd");function Xt(e,t){Hf.set(e,t),gl(t,[e])}var so=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)},Ot=[],Pl=0,tc=0;function co(){for(var e=Pl,t=tc=Pl=0;t<e;){var n=Ot[t];Ot[t++]=null;var l=Ot[t];Ot[t++]=null;var i=Ot[t];Ot[t++]=null;var s=Ot[t];if(Ot[t++]=null,l!==null&&i!==null){var d=l.pending;d===null?i.next=i:(i.next=d.next,d.next=i),l.pending=i}s!==0&&Bf(n,i,s)}}function ro(e,t,n,l){Ot[Pl++]=e,Ot[Pl++]=t,Ot[Pl++]=n,Ot[Pl++]=l,tc|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function nc(e,t,n,l){return ro(e,t,n,l),uo(e)}function bl(e,t){return ro(e,null,null,t),uo(e)}function Bf(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var i=!1,s=e.return;s!==null;)s.childLanes|=n,l=s.alternate,l!==null&&(l.childLanes|=n),s.tag===22&&(e=s.stateNode,e===null||e._visibility&1||(i=!0)),e=s,s=s.return;return e.tag===3?(s=e.stateNode,i&&t!==null&&(i=31-vt(n),e=s.hiddenUpdates,l=e[i],l===null?e[i]=[t]:l.push(t),t.lane=n|536870912),s):null}function uo(e){if(50<yi)throw yi=0,fr=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Il={};function r0(e,t,n,l){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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bt(e,t,n,l){return new r0(e,t,n,l)}function lc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function cn(e,t){var n=e.alternate;return n===null?(n=bt(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 qf(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 fo(e,t,n,l,i,s){var d=0;if(l=e,typeof e=="function")lc(e)&&(d=1);else if(typeof e=="string")d=hv(e,n,He.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ne:return e=bt(31,n,t,i),e.elementType=ne,e.lanes=s,e;case E:return Sl(n.children,i,s,t);case O:d=8,i|=24;break;case k:return e=bt(12,n,t,i|2),e.elementType=k,e.lanes=s,e;case V:return e=bt(13,n,t,i),e.elementType=V,e.lanes=s,e;case z:return e=bt(19,n,t,i),e.elementType=z,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case q:d=10;break e;case B:d=9;break e;case Z:d=11;break e;case Q:d=14;break e;case W:d=16,l=null;break e}d=29,n=Error(c(130,e===null?"null":typeof e,"")),l=null}return t=bt(d,n,t,i),t.elementType=e,t.type=l,t.lanes=s,t}function Sl(e,t,n,l){return e=bt(7,e,l,t),e.lanes=n,e}function ac(e,t,n){return e=bt(6,e,null,t),e.lanes=n,e}function Gf(e){var t=bt(18,null,null,0);return t.stateNode=e,t}function ic(e,t,n){return t=bt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Vf=new WeakMap;function kt(e,t){if(typeof e=="object"&&e!==null){var n=Vf.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Qi(t)},Vf.set(e,t),t)}return{value:e,source:t,stack:Qi(t)}}var ea=[],ta=0,mo=null,Wa=0,Rt=[],Dt=0,Bn=null,Ft=1,Pt="";function rn(e,t){ea[ta++]=Wa,ea[ta++]=mo,mo=e,Wa=t}function Yf(e,t,n){Rt[Dt++]=Ft,Rt[Dt++]=Pt,Rt[Dt++]=Bn,Bn=e;var l=Ft;e=Pt;var i=32-vt(l)-1;l&=~(1<<i),n+=1;var s=32-vt(t)+i;if(30<s){var d=i-i%5;s=(l&(1<<d)-1).toString(32),l>>=d,i-=d,Ft=1<<32-vt(t)+i|n<<i|l,Pt=s+e}else Ft=1<<s|n<<i|l,Pt=e}function oc(e){e.return!==null&&(rn(e,1),Yf(e,1,0))}function sc(e){for(;e===mo;)mo=ea[--ta],ea[ta]=null,Wa=ea[--ta],ea[ta]=null;for(;e===Bn;)Bn=Rt[--Dt],Rt[Dt]=null,Pt=Rt[--Dt],Rt[Dt]=null,Ft=Rt[--Dt],Rt[Dt]=null}function Xf(e,t){Rt[Dt++]=Ft,Rt[Dt++]=Pt,Rt[Dt++]=Bn,Ft=t.id,Pt=t.overflow,Bn=e}var et=null,Re=null,Se=!1,qn=null,Ut=!1,cc=Error(c(519));function Gn(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Fa(kt(t,e)),cc}function Qf(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[Ie]=e,t[ct]=l,n){case"dialog":ve("cancel",t),ve("close",t);break;case"iframe":case"object":case"embed":ve("load",t);break;case"video":case"audio":for(n=0;n<xi.length;n++)ve(xi[n],t);break;case"source":ve("error",t);break;case"img":case"image":case"link":ve("error",t),ve("load",t);break;case"details":ve("toggle",t);break;case"input":ve("invalid",t),lf(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":ve("invalid",t);break;case"textarea":ve("invalid",t),of(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||ch(t.textContent,n)?(l.popover!=null&&(ve("beforetoggle",t),ve("toggle",t)),l.onScroll!=null&&ve("scroll",t),l.onScrollEnd!=null&&ve("scrollend",t),l.onClick!=null&&(t.onclick=on),t=!0):t=!1,t||Gn(e,!0)}function Zf(e){for(et=e.return;et;)switch(et.tag){case 5:case 31:case 13:Ut=!1;return;case 27:case 3:Ut=!0;return;default:et=et.return}}function na(e){if(e!==et)return!1;if(!Se)return Zf(e),Se=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Ar(e.type,e.memoizedProps)),n=!n),n&&Re&&Gn(e),Zf(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Re=yh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Re=yh(e)}else t===27?(t=Re,tl(e.type)?(e=Mr,Mr=null,Re=e):Re=t):Re=et?Ht(e.stateNode.nextSibling):null;return!0}function jl(){Re=et=null,Se=!1}function rc(){var e=qn;return e!==null&&(mt===null?mt=e:mt.push.apply(mt,e),qn=null),e}function Fa(e){qn===null?qn=[e]:qn.push(e)}var uc=je(null),wl=null,un=null;function Vn(e,t,n){pe(uc,t._currentValue),t._currentValue=n}function fn(e){e._currentValue=uc.current,ze(uc)}function fc(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function dc(e,t,n,l){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var s=i.dependencies;if(s!==null){var d=i.child;s=s.firstContext;e:for(;s!==null;){var g=s;s=i;for(var N=0;N<t.length;N++)if(g.context===t[N]){s.lanes|=n,g=s.alternate,g!==null&&(g.lanes|=n),fc(s.return,n,e),l||(d=null);break e}s=g.next}}else if(i.tag===18){if(d=i.return,d===null)throw Error(c(341));d.lanes|=n,s=d.alternate,s!==null&&(s.lanes|=n),fc(d,n,e),d=null}else d=i.child;if(d!==null)d.return=i;else for(d=i;d!==null;){if(d===e){d=null;break}if(i=d.sibling,i!==null){i.return=d.return,d=i;break}d=d.return}i=d}}function la(e,t,n,l){e=null;for(var i=t,s=!1;i!==null;){if(!s){if((i.flags&524288)!==0)s=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var d=i.alternate;if(d===null)throw Error(c(387));if(d=d.memoizedProps,d!==null){var g=i.type;xt(i.pendingProps.value,d.value)||(e!==null?e.push(g):e=[g])}}else if(i===Rn.current){if(d=i.alternate,d===null)throw Error(c(387));d.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Ni):e=[Ni])}i=i.return}e!==null&&dc(t,e,n,l),t.flags|=262144}function ho(e){for(e=e.firstContext;e!==null;){if(!xt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Nl(e){wl=e,un=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function tt(e){return Kf(wl,e)}function po(e,t){return wl===null&&Nl(e),Kf(e,t)}function Kf(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},un===null){if(e===null)throw Error(c(308));un=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else un=un.next=t;return n}var u0=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},f0=a.unstable_scheduleCallback,d0=a.unstable_NormalPriority,Xe={$$typeof:q,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mc(){return{controller:new u0,data:new Map,refCount:0}}function Pa(e){e.refCount--,e.refCount===0&&f0(d0,function(){e.controller.abort()})}var Ia=null,hc=0,aa=0,ia=null;function m0(e,t){if(Ia===null){var n=Ia=[];hc=0,aa=yr(),ia={status:"pending",value:void 0,then:function(l){n.push(l)}}}return hc++,t.then($f,$f),t}function $f(){if(--hc===0&&Ia!==null){ia!==null&&(ia.status="fulfilled");var e=Ia;Ia=null,aa=0,ia=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function h0(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(l.status="rejected",l.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),l}var Jf=A.S;A.S=function(e,t){Om=gt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&m0(e,t),Jf!==null&&Jf(e,t)};var Cl=je(null);function pc(){var e=Cl.current;return e!==null?e:ke.pooledCache}function go(e,t){t===null?pe(Cl,Cl.current):pe(Cl,t.pool)}function Wf(){var e=pc();return e===null?null:{parent:Xe._currentValue,pool:e}}var oa=Error(c(460)),gc=Error(c(474)),yo=Error(c(542)),vo={then:function(){}};function Ff(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Pf(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(on,on),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ed(e),e;default:if(typeof t.status=="string")t.then(on,on);else{if(e=ke,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=l}},function(l){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ed(e),e}throw Tl=t,oa}}function Al(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Tl=n,oa):n}}var Tl=null;function If(){if(Tl===null)throw Error(c(459));var e=Tl;return Tl=null,e}function ed(e){if(e===oa||e===yo)throw Error(c(483))}var sa=null,ei=0;function xo(e){var t=ei;return ei+=1,sa===null&&(sa=[]),Pf(sa,e,t)}function ti(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function bo(e,t){throw t.$$typeof===x?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function td(e){function t(_,T){if(e){var M=_.deletions;M===null?(_.deletions=[T],_.flags|=16):M.push(T)}}function n(_,T){if(!e)return null;for(;T!==null;)t(_,T),T=T.sibling;return null}function l(_){for(var T=new Map;_!==null;)_.key!==null?T.set(_.key,_):T.set(_.index,_),_=_.sibling;return T}function i(_,T){return _=cn(_,T),_.index=0,_.sibling=null,_}function s(_,T,M){return _.index=M,e?(M=_.alternate,M!==null?(M=M.index,M<T?(_.flags|=67108866,T):M):(_.flags|=67108866,T)):(_.flags|=1048576,T)}function d(_){return e&&_.alternate===null&&(_.flags|=67108866),_}function g(_,T,M,Y){return T===null||T.tag!==6?(T=ac(M,_.mode,Y),T.return=_,T):(T=i(T,M),T.return=_,T)}function N(_,T,M,Y){var oe=M.type;return oe===E?G(_,T,M.props.children,Y,M.key):T!==null&&(T.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===W&&Al(oe)===T.type)?(T=i(T,M.props),ti(T,M),T.return=_,T):(T=fo(M.type,M.key,M.props,null,_.mode,Y),ti(T,M),T.return=_,T)}function R(_,T,M,Y){return T===null||T.tag!==4||T.stateNode.containerInfo!==M.containerInfo||T.stateNode.implementation!==M.implementation?(T=ic(M,_.mode,Y),T.return=_,T):(T=i(T,M.children||[]),T.return=_,T)}function G(_,T,M,Y,oe){return T===null||T.tag!==7?(T=Sl(M,_.mode,Y,oe),T.return=_,T):(T=i(T,M),T.return=_,T)}function X(_,T,M){if(typeof T=="string"&&T!==""||typeof T=="number"||typeof T=="bigint")return T=ac(""+T,_.mode,M),T.return=_,T;if(typeof T=="object"&&T!==null){switch(T.$$typeof){case C:return M=fo(T.type,T.key,T.props,null,_.mode,M),ti(M,T),M.return=_,M;case w:return T=ic(T,_.mode,M),T.return=_,T;case W:return T=Al(T),X(_,T,M)}if(J(T)||$(T))return T=Sl(T,_.mode,M,null),T.return=_,T;if(typeof T.then=="function")return X(_,xo(T),M);if(T.$$typeof===q)return X(_,po(_,T),M);bo(_,T)}return null}function U(_,T,M,Y){var oe=T!==null?T.key:null;if(typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint")return oe!==null?null:g(_,T,""+M,Y);if(typeof M=="object"&&M!==null){switch(M.$$typeof){case C:return M.key===oe?N(_,T,M,Y):null;case w:return M.key===oe?R(_,T,M,Y):null;case W:return M=Al(M),U(_,T,M,Y)}if(J(M)||$(M))return oe!==null?null:G(_,T,M,Y,null);if(typeof M.then=="function")return U(_,T,xo(M),Y);if(M.$$typeof===q)return U(_,T,po(_,M),Y);bo(_,M)}return null}function L(_,T,M,Y,oe){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return _=_.get(M)||null,g(T,_,""+Y,oe);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case C:return _=_.get(Y.key===null?M:Y.key)||null,N(T,_,Y,oe);case w:return _=_.get(Y.key===null?M:Y.key)||null,R(T,_,Y,oe);case W:return Y=Al(Y),L(_,T,M,Y,oe)}if(J(Y)||$(Y))return _=_.get(M)||null,G(T,_,Y,oe,null);if(typeof Y.then=="function")return L(_,T,M,xo(Y),oe);if(Y.$$typeof===q)return L(_,T,M,po(T,Y),oe);bo(T,Y)}return null}function te(_,T,M,Y){for(var oe=null,we=null,ae=T,me=T=0,be=null;ae!==null&&me<M.length;me++){ae.index>me?(be=ae,ae=null):be=ae.sibling;var Ne=U(_,ae,M[me],Y);if(Ne===null){ae===null&&(ae=be);break}e&&ae&&Ne.alternate===null&&t(_,ae),T=s(Ne,T,me),we===null?oe=Ne:we.sibling=Ne,we=Ne,ae=be}if(me===M.length)return n(_,ae),Se&&rn(_,me),oe;if(ae===null){for(;me<M.length;me++)ae=X(_,M[me],Y),ae!==null&&(T=s(ae,T,me),we===null?oe=ae:we.sibling=ae,we=ae);return Se&&rn(_,me),oe}for(ae=l(ae);me<M.length;me++)be=L(ae,_,me,M[me],Y),be!==null&&(e&&be.alternate!==null&&ae.delete(be.key===null?me:be.key),T=s(be,T,me),we===null?oe=be:we.sibling=be,we=be);return e&&ae.forEach(function(ol){return t(_,ol)}),Se&&rn(_,me),oe}function ce(_,T,M,Y){if(M==null)throw Error(c(151));for(var oe=null,we=null,ae=T,me=T=0,be=null,Ne=M.next();ae!==null&&!Ne.done;me++,Ne=M.next()){ae.index>me?(be=ae,ae=null):be=ae.sibling;var ol=U(_,ae,Ne.value,Y);if(ol===null){ae===null&&(ae=be);break}e&&ae&&ol.alternate===null&&t(_,ae),T=s(ol,T,me),we===null?oe=ol:we.sibling=ol,we=ol,ae=be}if(Ne.done)return n(_,ae),Se&&rn(_,me),oe;if(ae===null){for(;!Ne.done;me++,Ne=M.next())Ne=X(_,Ne.value,Y),Ne!==null&&(T=s(Ne,T,me),we===null?oe=Ne:we.sibling=Ne,we=Ne);return Se&&rn(_,me),oe}for(ae=l(ae);!Ne.done;me++,Ne=M.next())Ne=L(ae,_,me,Ne.value,Y),Ne!==null&&(e&&Ne.alternate!==null&&ae.delete(Ne.key===null?me:Ne.key),T=s(Ne,T,me),we===null?oe=Ne:we.sibling=Ne,we=Ne);return e&&ae.forEach(function(Cv){return t(_,Cv)}),Se&&rn(_,me),oe}function Oe(_,T,M,Y){if(typeof M=="object"&&M!==null&&M.type===E&&M.key===null&&(M=M.props.children),typeof M=="object"&&M!==null){switch(M.$$typeof){case C:e:{for(var oe=M.key;T!==null;){if(T.key===oe){if(oe=M.type,oe===E){if(T.tag===7){n(_,T.sibling),Y=i(T,M.props.children),Y.return=_,_=Y;break e}}else if(T.elementType===oe||typeof oe=="object"&&oe!==null&&oe.$$typeof===W&&Al(oe)===T.type){n(_,T.sibling),Y=i(T,M.props),ti(Y,M),Y.return=_,_=Y;break e}n(_,T);break}else t(_,T);T=T.sibling}M.type===E?(Y=Sl(M.props.children,_.mode,Y,M.key),Y.return=_,_=Y):(Y=fo(M.type,M.key,M.props,null,_.mode,Y),ti(Y,M),Y.return=_,_=Y)}return d(_);case w:e:{for(oe=M.key;T!==null;){if(T.key===oe)if(T.tag===4&&T.stateNode.containerInfo===M.containerInfo&&T.stateNode.implementation===M.implementation){n(_,T.sibling),Y=i(T,M.children||[]),Y.return=_,_=Y;break e}else{n(_,T);break}else t(_,T);T=T.sibling}Y=ic(M,_.mode,Y),Y.return=_,_=Y}return d(_);case W:return M=Al(M),Oe(_,T,M,Y)}if(J(M))return te(_,T,M,Y);if($(M)){if(oe=$(M),typeof oe!="function")throw Error(c(150));return M=oe.call(M),ce(_,T,M,Y)}if(typeof M.then=="function")return Oe(_,T,xo(M),Y);if(M.$$typeof===q)return Oe(_,T,po(_,M),Y);bo(_,M)}return typeof M=="string"&&M!==""||typeof M=="number"||typeof M=="bigint"?(M=""+M,T!==null&&T.tag===6?(n(_,T.sibling),Y=i(T,M),Y.return=_,_=Y):(n(_,T),Y=ac(M,_.mode,Y),Y.return=_,_=Y),d(_)):n(_,T)}return function(_,T,M,Y){try{ei=0;var oe=Oe(_,T,M,Y);return sa=null,oe}catch(ae){if(ae===oa||ae===yo)throw ae;var we=bt(29,ae,null,_.mode);return we.lanes=Y,we.return=_,we}finally{}}}var El=td(!0),nd=td(!1),Yn=!1;function yc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vc(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 Xn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Qn(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Ae&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=uo(e),Bf(e,null,n),t}return ro(e,l,t,n),uo(e)}function ni(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Zu(e,n)}}function xc(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var d={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};s===null?i=s=d:s=s.next=d,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var bc=!1;function li(){if(bc){var e=ia;if(e!==null)throw e}}function ai(e,t,n,l){bc=!1;var i=e.updateQueue;Yn=!1;var s=i.firstBaseUpdate,d=i.lastBaseUpdate,g=i.shared.pending;if(g!==null){i.shared.pending=null;var N=g,R=N.next;N.next=null,d===null?s=R:d.next=R,d=N;var G=e.alternate;G!==null&&(G=G.updateQueue,g=G.lastBaseUpdate,g!==d&&(g===null?G.firstBaseUpdate=R:g.next=R,G.lastBaseUpdate=N))}if(s!==null){var X=i.baseState;d=0,G=R=N=null,g=s;do{var U=g.lane&-536870913,L=U!==g.lane;if(L?(xe&U)===U:(l&U)===U){U!==0&&U===aa&&(bc=!0),G!==null&&(G=G.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var te=e,ce=g;U=t;var Oe=n;switch(ce.tag){case 1:if(te=ce.payload,typeof te=="function"){X=te.call(Oe,X,U);break e}X=te;break e;case 3:te.flags=te.flags&-65537|128;case 0:if(te=ce.payload,U=typeof te=="function"?te.call(Oe,X,U):te,U==null)break e;X=b({},X,U);break e;case 2:Yn=!0}}U=g.callback,U!==null&&(e.flags|=64,L&&(e.flags|=8192),L=i.callbacks,L===null?i.callbacks=[U]:L.push(U))}else L={lane:U,tag:g.tag,payload:g.payload,callback:g.callback,next:null},G===null?(R=G=L,N=X):G=G.next=L,d|=U;if(g=g.next,g===null){if(g=i.shared.pending,g===null)break;L=g,g=L.next,L.next=null,i.lastBaseUpdate=L,i.shared.pending=null}}while(!0);G===null&&(N=X),i.baseState=N,i.firstBaseUpdate=R,i.lastBaseUpdate=G,s===null&&(i.shared.lanes=0),Wn|=d,e.lanes=d,e.memoizedState=X}}function ld(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function ad(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)ld(n[e],t)}var ca=je(null),So=je(0);function id(e,t){e=bn,pe(So,e),pe(ca,t),bn=e|t.baseLanes}function Sc(){pe(So,bn),pe(ca,ca.current)}function jc(){bn=So.current,ze(ca),ze(So)}var St=je(null),Lt=null;function Zn(e){var t=e.alternate;pe(Ve,Ve.current&1),pe(St,e),Lt===null&&(t===null||ca.current!==null||t.memoizedState!==null)&&(Lt=e)}function wc(e){pe(Ve,Ve.current),pe(St,e),Lt===null&&(Lt=e)}function od(e){e.tag===22?(pe(Ve,Ve.current),pe(St,e),Lt===null&&(Lt=e)):Kn()}function Kn(){pe(Ve,Ve.current),pe(St,St.current)}function jt(e){ze(St),Lt===e&&(Lt=null),ze(Ve)}var Ve=je(0);function jo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||zr(n)||_r(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 dn=0,de=null,_e=null,Qe=null,wo=!1,ra=!1,zl=!1,No=0,ii=0,ua=null,p0=0;function qe(){throw Error(c(321))}function Nc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!xt(e[n],t[n]))return!1;return!0}function Cc(e,t,n,l,i,s){return dn=s,de=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?Yd:qc,zl=!1,s=n(l,i),zl=!1,ra&&(s=cd(t,n,l,i)),sd(e),s}function sd(e){A.H=ci;var t=_e!==null&&_e.next!==null;if(dn=0,Qe=_e=de=null,wo=!1,ii=0,ua=null,t)throw Error(c(300));e===null||Ze||(e=e.dependencies,e!==null&&ho(e)&&(Ze=!0))}function cd(e,t,n,l){de=e;var i=0;do{if(ra&&(ua=null),ii=0,ra=!1,25<=i)throw Error(c(301));if(i+=1,Qe=_e=null,e.updateQueue!=null){var s=e.updateQueue;s.lastEffect=null,s.events=null,s.stores=null,s.memoCache!=null&&(s.memoCache.index=0)}A.H=Xd,s=t(n,l)}while(ra);return s}function g0(){var e=A.H,t=e.useState()[0];return t=typeof t.then=="function"?oi(t):t,e=e.useState()[0],(_e!==null?_e.memoizedState:null)!==e&&(de.flags|=1024),t}function Ac(){var e=No!==0;return No=0,e}function Tc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ec(e){if(wo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}wo=!1}dn=0,Qe=_e=de=null,ra=!1,ii=No=0,ua=null}function ot(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qe===null?de.memoizedState=Qe=e:Qe=Qe.next=e,Qe}function Ye(){if(_e===null){var e=de.alternate;e=e!==null?e.memoizedState:null}else e=_e.next;var t=Qe===null?de.memoizedState:Qe.next;if(t!==null)Qe=t,_e=e;else{if(e===null)throw de.alternate===null?Error(c(467)):Error(c(310));_e=e,e={memoizedState:_e.memoizedState,baseState:_e.baseState,baseQueue:_e.baseQueue,queue:_e.queue,next:null},Qe===null?de.memoizedState=Qe=e:Qe=Qe.next=e}return Qe}function Co(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function oi(e){var t=ii;return ii+=1,ua===null&&(ua=[]),e=Pf(ua,e,t),t=de,(Qe===null?t.memoizedState:Qe.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?Yd:qc),e}function Ao(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return oi(e);if(e.$$typeof===q)return tt(e)}throw Error(c(438,String(e)))}function zc(e){var t=null,n=de.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=de.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Co(),de.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=le;return t.index++,n}function mn(e,t){return typeof t=="function"?t(e):t}function To(e){var t=Ye();return _c(t,_e,e)}function _c(e,t,n){var l=e.queue;if(l===null)throw Error(c(311));l.lastRenderedReducer=n;var i=e.baseQueue,s=l.pending;if(s!==null){if(i!==null){var d=i.next;i.next=s.next,s.next=d}t.baseQueue=i=s,l.pending=null}if(s=e.baseState,i===null)e.memoizedState=s;else{t=i.next;var g=d=null,N=null,R=t,G=!1;do{var X=R.lane&-536870913;if(X!==R.lane?(xe&X)===X:(dn&X)===X){var U=R.revertLane;if(U===0)N!==null&&(N=N.next={lane:0,revertLane:0,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null}),X===aa&&(G=!0);else if((dn&U)===U){R=R.next,U===aa&&(G=!0);continue}else X={lane:0,revertLane:R.revertLane,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},N===null?(g=N=X,d=s):N=N.next=X,de.lanes|=U,Wn|=U;X=R.action,zl&&n(s,X),s=R.hasEagerState?R.eagerState:n(s,X)}else U={lane:X,revertLane:R.revertLane,gesture:R.gesture,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},N===null?(g=N=U,d=s):N=N.next=U,de.lanes|=X,Wn|=X;R=R.next}while(R!==null&&R!==t);if(N===null?d=s:N.next=g,!xt(s,e.memoizedState)&&(Ze=!0,G&&(n=ia,n!==null)))throw n;e.memoizedState=s,e.baseState=d,e.baseQueue=N,l.lastRenderedState=s}return i===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Mc(e){var t=Ye(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var l=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var d=i=i.next;do s=e(s,d.action),d=d.next;while(d!==i);xt(s,t.memoizedState)||(Ze=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,l]}function rd(e,t,n){var l=de,i=Ye(),s=Se;if(s){if(n===void 0)throw Error(c(407));n=n()}else n=t();var d=!xt((_e||i).memoizedState,n);if(d&&(i.memoizedState=n,Ze=!0),i=i.queue,Rc(dd.bind(null,l,i,e),[e]),i.getSnapshot!==t||d||Qe!==null&&Qe.memoizedState.tag&1){if(l.flags|=2048,fa(9,{destroy:void 0},fd.bind(null,l,i,n,t),null),ke===null)throw Error(c(349));s||(dn&127)!==0||ud(l,t,n)}return n}function ud(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=de.updateQueue,t===null?(t=Co(),de.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function fd(e,t,n,l){t.value=n,t.getSnapshot=l,md(t)&&hd(e)}function dd(e,t,n){return n(function(){md(t)&&hd(e)})}function md(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!xt(e,n)}catch{return!0}}function hd(e){var t=bl(e,2);t!==null&&ht(t,e,2)}function Oc(e){var t=ot();if(typeof e=="function"){var n=e;if(e=n(),zl){Un(!0);try{n()}finally{Un(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mn,lastRenderedState:e},t}function pd(e,t,n,l){return e.baseState=n,_c(e,_e,typeof l=="function"?l:mn)}function y0(e,t,n,l,i){if(_o(e))throw Error(c(485));if(e=t.action,e!==null){var s={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){s.listeners.push(d)}};A.T!==null?n(!0):s.isTransition=!1,l(s),n=t.pending,n===null?(s.next=t.pending=s,gd(t,s)):(s.next=n.next,t.pending=n.next=s)}}function gd(e,t){var n=t.action,l=t.payload,i=e.state;if(t.isTransition){var s=A.T,d={};A.T=d;try{var g=n(i,l),N=A.S;N!==null&&N(d,g),yd(e,t,g)}catch(R){kc(e,t,R)}finally{s!==null&&d.types!==null&&(s.types=d.types),A.T=s}}else try{s=n(i,l),yd(e,t,s)}catch(R){kc(e,t,R)}}function yd(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){vd(e,t,l)},function(l){return kc(e,t,l)}):vd(e,t,n)}function vd(e,t,n){t.status="fulfilled",t.value=n,xd(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,gd(e,n)))}function kc(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,xd(t),t=t.next;while(t!==l)}e.action=null}function xd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function bd(e,t){return t}function Sd(e,t){if(Se){var n=ke.formState;if(n!==null){e:{var l=de;if(Se){if(Re){t:{for(var i=Re,s=Ut;i.nodeType!==8;){if(!s){i=null;break t}if(i=Ht(i.nextSibling),i===null){i=null;break t}}s=i.data,i=s==="F!"||s==="F"?i:null}if(i){Re=Ht(i.nextSibling),l=i.data==="F!";break e}}Gn(l)}l=!1}l&&(t=n[0])}}return n=ot(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bd,lastRenderedState:t},n.queue=l,n=qd.bind(null,de,l),l.dispatch=n,l=Oc(!1),s=Bc.bind(null,de,!1,l.queue),l=ot(),i={state:t,dispatch:null,action:e,pending:null},l.queue=i,n=y0.bind(null,de,i,s,n),i.dispatch=n,l.memoizedState=e,[t,n,!1]}function jd(e){var t=Ye();return wd(t,_e,e)}function wd(e,t,n){if(t=_c(e,t,bd)[0],e=To(mn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=oi(t)}catch(d){throw d===oa?yo:d}else l=t;t=Ye();var i=t.queue,s=i.dispatch;return n!==t.memoizedState&&(de.flags|=2048,fa(9,{destroy:void 0},v0.bind(null,i,n),null)),[l,s,e]}function v0(e,t){e.action=t}function Nd(e){var t=Ye(),n=_e;if(n!==null)return wd(t,n,e);Ye(),t=t.memoizedState,n=Ye();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function fa(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=de.updateQueue,t===null&&(t=Co(),de.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function Cd(){return Ye().memoizedState}function Eo(e,t,n,l){var i=ot();de.flags|=e,i.memoizedState=fa(1|t,{destroy:void 0},n,l===void 0?null:l)}function zo(e,t,n,l){var i=Ye();l=l===void 0?null:l;var s=i.memoizedState.inst;_e!==null&&l!==null&&Nc(l,_e.memoizedState.deps)?i.memoizedState=fa(t,s,n,l):(de.flags|=e,i.memoizedState=fa(1|t,s,n,l))}function Ad(e,t){Eo(8390656,8,e,t)}function Rc(e,t){zo(2048,8,e,t)}function x0(e){de.flags|=4;var t=de.updateQueue;if(t===null)t=Co(),de.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Td(e){var t=Ye().memoizedState;return x0({ref:t,nextImpl:e}),function(){if((Ae&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function Ed(e,t){return zo(4,2,e,t)}function zd(e,t){return zo(4,4,e,t)}function _d(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 Md(e,t,n){n=n!=null?n.concat([e]):null,zo(4,4,_d.bind(null,t,e),n)}function Dc(){}function Od(e,t){var n=Ye();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&Nc(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function kd(e,t){var n=Ye();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&Nc(t,l[1]))return l[0];if(l=e(),zl){Un(!0);try{e()}finally{Un(!1)}}return n.memoizedState=[l,t],l}function Uc(e,t,n){return n===void 0||(dn&1073741824)!==0&&(xe&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Rm(),de.lanes|=e,Wn|=e,n)}function Rd(e,t,n,l){return xt(n,t)?n:ca.current!==null?(e=Uc(e,n,l),xt(e,t)||(Ze=!0),e):(dn&42)===0||(dn&1073741824)!==0&&(xe&261930)===0?(Ze=!0,e.memoizedState=n):(e=Rm(),de.lanes|=e,Wn|=e,t)}function Dd(e,t,n,l,i){var s=D.p;D.p=s!==0&&8>s?s:8;var d=A.T,g={};A.T=g,Bc(e,!1,t,n);try{var N=i(),R=A.S;if(R!==null&&R(g,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var G=h0(N,l);si(e,t,G,Ct(e))}else si(e,t,l,Ct(e))}catch(X){si(e,t,{then:function(){},status:"rejected",reason:X},Ct())}finally{D.p=s,d!==null&&g.types!==null&&(d.types=g.types),A.T=d}}function b0(){}function Lc(e,t,n,l){if(e.tag!==5)throw Error(c(476));var i=Ud(e).queue;Dd(e,i,t,H,n===null?b0:function(){return Ld(e),n(l)})}function Ud(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mn,lastRenderedState:H},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mn,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ld(e){var t=Ud(e);t.next===null&&(t=e.alternate.memoizedState),si(e,t.next.queue,{},Ct())}function Hc(){return tt(Ni)}function Hd(){return Ye().memoizedState}function Bd(){return Ye().memoizedState}function S0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Ct();e=Xn(n);var l=Qn(t,e,n);l!==null&&(ht(l,t,n),ni(l,t,n)),t={cache:mc()},e.payload=t;return}t=t.return}}function j0(e,t,n){var l=Ct();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},_o(e)?Gd(t,n):(n=nc(e,t,n,l),n!==null&&(ht(n,e,l),Vd(n,t,l)))}function qd(e,t,n){var l=Ct();si(e,t,n,l)}function si(e,t,n,l){var i={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(_o(e))Gd(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var d=t.lastRenderedState,g=s(d,n);if(i.hasEagerState=!0,i.eagerState=g,xt(g,d))return ro(e,t,i,0),ke===null&&co(),!1}catch{}finally{}if(n=nc(e,t,i,l),n!==null)return ht(n,e,l),Vd(n,t,l),!0}return!1}function Bc(e,t,n,l){if(l={lane:2,revertLane:yr(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},_o(e)){if(t)throw Error(c(479))}else t=nc(e,n,l,2),t!==null&&ht(t,e,2)}function _o(e){var t=e.alternate;return e===de||t!==null&&t===de}function Gd(e,t){ra=wo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Vd(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Zu(e,n)}}var ci={readContext:tt,use:Ao,useCallback:qe,useContext:qe,useEffect:qe,useImperativeHandle:qe,useLayoutEffect:qe,useInsertionEffect:qe,useMemo:qe,useReducer:qe,useRef:qe,useState:qe,useDebugValue:qe,useDeferredValue:qe,useTransition:qe,useSyncExternalStore:qe,useId:qe,useHostTransitionStatus:qe,useFormState:qe,useActionState:qe,useOptimistic:qe,useMemoCache:qe,useCacheRefresh:qe};ci.useEffectEvent=qe;var Yd={readContext:tt,use:Ao,useCallback:function(e,t){return ot().memoizedState=[e,t===void 0?null:t],e},useContext:tt,useEffect:Ad,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Eo(4194308,4,_d.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Eo(4194308,4,e,t)},useInsertionEffect:function(e,t){Eo(4,2,e,t)},useMemo:function(e,t){var n=ot();t=t===void 0?null:t;var l=e();if(zl){Un(!0);try{e()}finally{Un(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=ot();if(n!==void 0){var i=n(t);if(zl){Un(!0);try{n(t)}finally{Un(!1)}}}else i=t;return l.memoizedState=l.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},l.queue=e,e=e.dispatch=j0.bind(null,de,e),[l.memoizedState,e]},useRef:function(e){var t=ot();return e={current:e},t.memoizedState=e},useState:function(e){e=Oc(e);var t=e.queue,n=qd.bind(null,de,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Dc,useDeferredValue:function(e,t){var n=ot();return Uc(n,e,t)},useTransition:function(){var e=Oc(!1);return e=Dd.bind(null,de,e.queue,!0,!1),ot().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=de,i=ot();if(Se){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),ke===null)throw Error(c(349));(xe&127)!==0||ud(l,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,Ad(dd.bind(null,l,s,e),[e]),l.flags|=2048,fa(9,{destroy:void 0},fd.bind(null,l,s,n,t),null),n},useId:function(){var e=ot(),t=ke.identifierPrefix;if(Se){var n=Pt,l=Ft;n=(l&~(1<<32-vt(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=No++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=p0++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Hc,useFormState:Sd,useActionState:Sd,useOptimistic:function(e){var t=ot();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Bc.bind(null,de,!0,n),n.dispatch=t,[e,t]},useMemoCache:zc,useCacheRefresh:function(){return ot().memoizedState=S0.bind(null,de)},useEffectEvent:function(e){var t=ot(),n={impl:e};return t.memoizedState=n,function(){if((Ae&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},qc={readContext:tt,use:Ao,useCallback:Od,useContext:tt,useEffect:Rc,useImperativeHandle:Md,useInsertionEffect:Ed,useLayoutEffect:zd,useMemo:kd,useReducer:To,useRef:Cd,useState:function(){return To(mn)},useDebugValue:Dc,useDeferredValue:function(e,t){var n=Ye();return Rd(n,_e.memoizedState,e,t)},useTransition:function(){var e=To(mn)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:oi(e),t]},useSyncExternalStore:rd,useId:Hd,useHostTransitionStatus:Hc,useFormState:jd,useActionState:jd,useOptimistic:function(e,t){var n=Ye();return pd(n,_e,e,t)},useMemoCache:zc,useCacheRefresh:Bd};qc.useEffectEvent=Td;var Xd={readContext:tt,use:Ao,useCallback:Od,useContext:tt,useEffect:Rc,useImperativeHandle:Md,useInsertionEffect:Ed,useLayoutEffect:zd,useMemo:kd,useReducer:Mc,useRef:Cd,useState:function(){return Mc(mn)},useDebugValue:Dc,useDeferredValue:function(e,t){var n=Ye();return _e===null?Uc(n,e,t):Rd(n,_e.memoizedState,e,t)},useTransition:function(){var e=Mc(mn)[0],t=Ye().memoizedState;return[typeof e=="boolean"?e:oi(e),t]},useSyncExternalStore:rd,useId:Hd,useHostTransitionStatus:Hc,useFormState:Nd,useActionState:Nd,useOptimistic:function(e,t){var n=Ye();return _e!==null?pd(n,_e,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:zc,useCacheRefresh:Bd};Xd.useEffectEvent=Td;function Gc(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:b({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vc={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=Ct(),i=Xn(l);i.payload=t,n!=null&&(i.callback=n),t=Qn(e,i,l),t!==null&&(ht(t,e,l),ni(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=Ct(),i=Xn(l);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Qn(e,i,l),t!==null&&(ht(t,e,l),ni(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Ct(),l=Xn(n);l.tag=2,t!=null&&(l.callback=t),t=Qn(e,l,n),t!==null&&(ht(t,e,n),ni(t,e,n))}};function Qd(e,t,n,l,i,s,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,s,d):t.prototype&&t.prototype.isPureReactComponent?!$a(n,l)||!$a(i,s):!0}function Zd(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&Vc.enqueueReplaceState(t,t.state,null)}function _l(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=b({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function Kd(e){so(e)}function $d(e){console.error(e)}function Jd(e){so(e)}function Mo(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Wd(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function Yc(e,t,n){return n=Xn(n),n.tag=3,n.payload={element:null},n.callback=function(){Mo(e,t)},n}function Fd(e){return e=Xn(e),e.tag=3,e}function Pd(e,t,n,l){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var s=l.value;e.payload=function(){return i(s)},e.callback=function(){Wd(t,n,l)}}var d=n.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){Wd(t,n,l),typeof i!="function"&&(Fn===null?Fn=new Set([this]):Fn.add(this));var g=l.stack;this.componentDidCatch(l.value,{componentStack:g!==null?g:""})})}function w0(e,t,n,l,i){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&la(t,n,i,!0),n=St.current,n!==null){switch(n.tag){case 31:case 13:return Lt===null?Yo():n.alternate===null&&Ge===0&&(Ge=3),n.flags&=-257,n.flags|=65536,n.lanes=i,l===vo?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),hr(e,l,i)),!1;case 22:return n.flags|=65536,l===vo?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),hr(e,l,i)),!1}throw Error(c(435,n.tag))}return hr(e,l,i),Yo(),!1}if(Se)return t=St.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,l!==cc&&(e=Error(c(422),{cause:l}),Fa(kt(e,n)))):(l!==cc&&(t=Error(c(423),{cause:l}),Fa(kt(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,l=kt(l,n),i=Yc(e.stateNode,l,i),xc(e,i),Ge!==4&&(Ge=2)),!1;var s=Error(c(520),{cause:l});if(s=kt(s,n),gi===null?gi=[s]:gi.push(s),Ge!==4&&(Ge=2),t===null)return!0;l=kt(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Yc(n.stateNode,l,e),xc(n,e),!1;case 1:if(t=n.type,s=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||s!==null&&typeof s.componentDidCatch=="function"&&(Fn===null||!Fn.has(s))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Fd(i),Pd(i,e,n,l),xc(n,i),!1}n=n.return}while(n!==null);return!1}var Xc=Error(c(461)),Ze=!1;function nt(e,t,n,l){t.child=e===null?nd(t,null,n,l):El(t,e.child,n,l)}function Id(e,t,n,l,i){n=n.render;var s=t.ref;if("ref"in l){var d={};for(var g in l)g!=="ref"&&(d[g]=l[g])}else d=l;return Nl(t),l=Cc(e,t,n,d,s,i),g=Ac(),e!==null&&!Ze?(Tc(e,t,i),hn(e,t,i)):(Se&&g&&oc(t),t.flags|=1,nt(e,t,l,i),t.child)}function em(e,t,n,l,i){if(e===null){var s=n.type;return typeof s=="function"&&!lc(s)&&s.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=s,tm(e,t,s,l,i)):(e=fo(n.type,null,l,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!Pc(e,i)){var d=s.memoizedProps;if(n=n.compare,n=n!==null?n:$a,n(d,l)&&e.ref===t.ref)return hn(e,t,i)}return t.flags|=1,e=cn(s,l),e.ref=t.ref,e.return=t,t.child=e}function tm(e,t,n,l,i){if(e!==null){var s=e.memoizedProps;if($a(s,l)&&e.ref===t.ref)if(Ze=!1,t.pendingProps=l=s,Pc(e,i))(e.flags&131072)!==0&&(Ze=!0);else return t.lanes=e.lanes,hn(e,t,i)}return Qc(e,t,n,l,i)}function nm(e,t,n,l){var i=l.children,s=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(s=s!==null?s.baseLanes|n:n,e!==null){for(l=t.child=e.child,i=0;l!==null;)i=i|l.lanes|l.childLanes,l=l.sibling;l=i&~s}else l=0,t.child=null;return lm(e,t,s,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&go(t,s!==null?s.cachePool:null),s!==null?id(t,s):Sc(),od(t);else return l=t.lanes=536870912,lm(e,t,s!==null?s.baseLanes|n:n,n,l)}else s!==null?(go(t,s.cachePool),id(t,s),Kn(),t.memoizedState=null):(e!==null&&go(t,null),Sc(),Kn());return nt(e,t,i,n),t.child}function ri(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function lm(e,t,n,l,i){var s=pc();return s=s===null?null:{parent:Xe._currentValue,pool:s},t.memoizedState={baseLanes:n,cachePool:s},e!==null&&go(t,null),Sc(),od(t),e!==null&&la(e,t,l,!0),t.childLanes=i,null}function Oo(e,t){return t=Ro({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function am(e,t,n){return El(t,e.child,null,n),e=Oo(t,t.pendingProps),e.flags|=2,jt(t),t.memoizedState=null,e}function N0(e,t,n){var l=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Se){if(l.mode==="hidden")return e=Oo(t,l),t.lanes=536870912,ri(null,e);if(wc(t),(e=Re)?(e=gh(e,Ut),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Bn!==null?{id:Ft,overflow:Pt}:null,retryLane:536870912,hydrationErrors:null},n=Gf(e),n.return=t,t.child=n,et=t,Re=null)):e=null,e===null)throw Gn(t);return t.lanes=536870912,null}return Oo(t,l)}var s=e.memoizedState;if(s!==null){var d=s.dehydrated;if(wc(t),i)if(t.flags&256)t.flags&=-257,t=am(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Ze||la(e,t,n,!1),i=(n&e.childLanes)!==0,Ze||i){if(l=ke,l!==null&&(d=Ku(l,n),d!==0&&d!==s.retryLane))throw s.retryLane=d,bl(e,d),ht(l,e,d),Xc;Yo(),t=am(e,t,n)}else e=s.treeContext,Re=Ht(d.nextSibling),et=t,Se=!0,qn=null,Ut=!1,e!==null&&Xf(t,e),t=Oo(t,l),t.flags|=4096;return t}return e=cn(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ko(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 Qc(e,t,n,l,i){return Nl(t),n=Cc(e,t,n,l,void 0,i),l=Ac(),e!==null&&!Ze?(Tc(e,t,i),hn(e,t,i)):(Se&&l&&oc(t),t.flags|=1,nt(e,t,n,i),t.child)}function im(e,t,n,l,i,s){return Nl(t),t.updateQueue=null,n=cd(t,l,n,i),sd(e),l=Ac(),e!==null&&!Ze?(Tc(e,t,s),hn(e,t,s)):(Se&&l&&oc(t),t.flags|=1,nt(e,t,n,s),t.child)}function om(e,t,n,l,i){if(Nl(t),t.stateNode===null){var s=Il,d=n.contextType;typeof d=="object"&&d!==null&&(s=tt(d)),s=new n(l,s),t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=Vc,t.stateNode=s,s._reactInternals=t,s=t.stateNode,s.props=l,s.state=t.memoizedState,s.refs={},yc(t),d=n.contextType,s.context=typeof d=="object"&&d!==null?tt(d):Il,s.state=t.memoizedState,d=n.getDerivedStateFromProps,typeof d=="function"&&(Gc(t,n,d,l),s.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(d=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),d!==s.state&&Vc.enqueueReplaceState(s,s.state,null),ai(t,l,s,i),li(),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){s=t.stateNode;var g=t.memoizedProps,N=_l(n,g);s.props=N;var R=s.context,G=n.contextType;d=Il,typeof G=="object"&&G!==null&&(d=tt(G));var X=n.getDerivedStateFromProps;G=typeof X=="function"||typeof s.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,G||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(g||R!==d)&&Zd(t,s,l,d),Yn=!1;var U=t.memoizedState;s.state=U,ai(t,l,s,i),li(),R=t.memoizedState,g||U!==R||Yn?(typeof X=="function"&&(Gc(t,n,X,l),R=t.memoizedState),(N=Yn||Qd(t,n,N,l,U,R,d))?(G||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=R),s.props=l,s.state=R,s.context=d,l=N):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{s=t.stateNode,vc(e,t),d=t.memoizedProps,G=_l(n,d),s.props=G,X=t.pendingProps,U=s.context,R=n.contextType,N=Il,typeof R=="object"&&R!==null&&(N=tt(R)),g=n.getDerivedStateFromProps,(R=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(d!==X||U!==N)&&Zd(t,s,l,N),Yn=!1,U=t.memoizedState,s.state=U,ai(t,l,s,i),li();var L=t.memoizedState;d!==X||U!==L||Yn||e!==null&&e.dependencies!==null&&ho(e.dependencies)?(typeof g=="function"&&(Gc(t,n,g,l),L=t.memoizedState),(G=Yn||Qd(t,n,G,l,U,L,N)||e!==null&&e.dependencies!==null&&ho(e.dependencies))?(R||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(l,L,N),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(l,L,N)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||d===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=L),s.props=l,s.state=L,s.context=N,l=G):(typeof s.componentDidUpdate!="function"||d===e.memoizedProps&&U===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&U===e.memoizedState||(t.flags|=1024),l=!1)}return s=l,ko(e,t),l=(t.flags&128)!==0,s||l?(s=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:s.render(),t.flags|=1,e!==null&&l?(t.child=El(t,e.child,null,i),t.child=El(t,null,n,i)):nt(e,t,n,i),t.memoizedState=s.state,e=t.child):e=hn(e,t,i),e}function sm(e,t,n,l){return jl(),t.flags|=256,nt(e,t,n,l),t.child}var Zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kc(e){return{baseLanes:e,cachePool:Wf()}}function $c(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Nt),e}function cm(e,t,n){var l=t.pendingProps,i=!1,s=(t.flags&128)!==0,d;if((d=s)||(d=e!==null&&e.memoizedState===null?!1:(Ve.current&2)!==0),d&&(i=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(Se){if(i?Zn(t):Kn(),(e=Re)?(e=gh(e,Ut),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Bn!==null?{id:Ft,overflow:Pt}:null,retryLane:536870912,hydrationErrors:null},n=Gf(e),n.return=t,t.child=n,et=t,Re=null)):e=null,e===null)throw Gn(t);return _r(e)?t.lanes=32:t.lanes=536870912,null}var g=l.children;return l=l.fallback,i?(Kn(),i=t.mode,g=Ro({mode:"hidden",children:g},i),l=Sl(l,i,n,null),g.return=t,l.return=t,g.sibling=l,t.child=g,l=t.child,l.memoizedState=Kc(n),l.childLanes=$c(e,d,n),t.memoizedState=Zc,ri(null,l)):(Zn(t),Jc(t,g))}var N=e.memoizedState;if(N!==null&&(g=N.dehydrated,g!==null)){if(s)t.flags&256?(Zn(t),t.flags&=-257,t=Wc(e,t,n)):t.memoizedState!==null?(Kn(),t.child=e.child,t.flags|=128,t=null):(Kn(),g=l.fallback,i=t.mode,l=Ro({mode:"visible",children:l.children},i),g=Sl(g,i,n,null),g.flags|=2,l.return=t,g.return=t,l.sibling=g,t.child=l,El(t,e.child,null,n),l=t.child,l.memoizedState=Kc(n),l.childLanes=$c(e,d,n),t.memoizedState=Zc,t=ri(null,l));else if(Zn(t),_r(g)){if(d=g.nextSibling&&g.nextSibling.dataset,d)var R=d.dgst;d=R,l=Error(c(419)),l.stack="",l.digest=d,Fa({value:l,source:null,stack:null}),t=Wc(e,t,n)}else if(Ze||la(e,t,n,!1),d=(n&e.childLanes)!==0,Ze||d){if(d=ke,d!==null&&(l=Ku(d,n),l!==0&&l!==N.retryLane))throw N.retryLane=l,bl(e,l),ht(d,e,l),Xc;zr(g)||Yo(),t=Wc(e,t,n)}else zr(g)?(t.flags|=192,t.child=e.child,t=null):(e=N.treeContext,Re=Ht(g.nextSibling),et=t,Se=!0,qn=null,Ut=!1,e!==null&&Xf(t,e),t=Jc(t,l.children),t.flags|=4096);return t}return i?(Kn(),g=l.fallback,i=t.mode,N=e.child,R=N.sibling,l=cn(N,{mode:"hidden",children:l.children}),l.subtreeFlags=N.subtreeFlags&65011712,R!==null?g=cn(R,g):(g=Sl(g,i,n,null),g.flags|=2),g.return=t,l.return=t,l.sibling=g,t.child=l,ri(null,l),l=t.child,g=e.child.memoizedState,g===null?g=Kc(n):(i=g.cachePool,i!==null?(N=Xe._currentValue,i=i.parent!==N?{parent:N,pool:N}:i):i=Wf(),g={baseLanes:g.baseLanes|n,cachePool:i}),l.memoizedState=g,l.childLanes=$c(e,d,n),t.memoizedState=Zc,ri(e.child,l)):(Zn(t),n=e.child,e=n.sibling,n=cn(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=n,t.memoizedState=null,n)}function Jc(e,t){return t=Ro({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ro(e,t){return e=bt(22,e,null,t),e.lanes=0,e}function Wc(e,t,n){return El(t,e.child,null,n),e=Jc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function rm(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),fc(e.return,t,n)}function Fc(e,t,n,l,i,s){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:i,treeForkCount:s}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=n,d.tailMode=i,d.treeForkCount=s)}function um(e,t,n){var l=t.pendingProps,i=l.revealOrder,s=l.tail;l=l.children;var d=Ve.current,g=(d&2)!==0;if(g?(d=d&1|2,t.flags|=128):d&=1,pe(Ve,d),nt(e,t,l,n),l=Se?Wa:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&rm(e,n,t);else if(e.tag===19)rm(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&&jo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Fc(t,!1,i,n,s,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&jo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Fc(t,!0,n,null,s,l);break;case"together":Fc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function hn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Wn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(la(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=cn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=cn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Pc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ho(e)))}function C0(e,t,n){switch(t.tag){case 3:Wt(t,t.stateNode.containerInfo),Vn(t,Xe,e.memoizedState.cache),jl();break;case 27:case 5:K(t);break;case 4:Wt(t,t.stateNode.containerInfo);break;case 10:Vn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,wc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Zn(t),t.flags|=128,null):(n&t.child.childLanes)!==0?cm(e,t,n):(Zn(t),e=hn(e,t,n),e!==null?e.sibling:null);Zn(t);break;case 19:var i=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(la(e,t,n,!1),l=(n&t.childLanes)!==0),i){if(l)return um(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),pe(Ve,Ve.current),l)break;return null;case 22:return t.lanes=0,nm(e,t,n,t.pendingProps);case 24:Vn(t,Xe,e.memoizedState.cache)}return hn(e,t,n)}function fm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ze=!0;else{if(!Pc(e,n)&&(t.flags&128)===0)return Ze=!1,C0(e,t,n);Ze=(e.flags&131072)!==0}else Ze=!1,Se&&(t.flags&1048576)!==0&&Yf(t,Wa,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Al(t.elementType),t.type=e,typeof e=="function")lc(e)?(l=_l(e,l),t.tag=1,t=om(null,t,e,l,n)):(t.tag=0,t=Qc(null,t,e,l,n));else{if(e!=null){var i=e.$$typeof;if(i===Z){t.tag=11,t=Id(null,t,e,l,n);break e}else if(i===Q){t.tag=14,t=em(null,t,e,l,n);break e}}throw t=ie(e)||e,Error(c(306,t,""))}}return t;case 0:return Qc(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,i=_l(l,t.pendingProps),om(e,t,l,i,n);case 3:e:{if(Wt(t,t.stateNode.containerInfo),e===null)throw Error(c(387));l=t.pendingProps;var s=t.memoizedState;i=s.element,vc(e,t),ai(t,l,null,n);var d=t.memoizedState;if(l=d.cache,Vn(t,Xe,l),l!==s.cache&&dc(t,[Xe],n,!0),li(),l=d.element,s.isDehydrated)if(s={element:l,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){t=sm(e,t,l,n);break e}else if(l!==i){i=kt(Error(c(424)),t),Fa(i),t=sm(e,t,l,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(Re=Ht(e.firstChild),et=t,Se=!0,qn=null,Ut=!0,n=nd(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(jl(),l===i){t=hn(e,t,n);break e}nt(e,t,l,n)}t=t.child}return t;case 26:return ko(e,t),e===null?(n=jh(t.type,null,t.pendingProps,null))?t.memoizedState=n:Se||(n=t.type,e=t.pendingProps,l=Wo(zt.current).createElement(n),l[Ie]=t,l[ct]=e,lt(l,n,e),We(l),t.stateNode=l):t.memoizedState=jh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return K(t),e===null&&Se&&(l=t.stateNode=xh(t.type,t.pendingProps,zt.current),et=t,Ut=!0,i=Re,tl(t.type)?(Mr=i,Re=Ht(l.firstChild)):Re=i),nt(e,t,t.pendingProps.children,n),ko(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Se&&((i=l=Re)&&(l=tv(l,t.type,t.pendingProps,Ut),l!==null?(t.stateNode=l,et=t,Re=Ht(l.firstChild),Ut=!1,i=!0):i=!1),i||Gn(t)),K(t),i=t.type,s=t.pendingProps,d=e!==null?e.memoizedProps:null,l=s.children,Ar(i,s)?l=null:d!==null&&Ar(i,d)&&(t.flags|=32),t.memoizedState!==null&&(i=Cc(e,t,g0,null,null,n),Ni._currentValue=i),ko(e,t),nt(e,t,l,n),t.child;case 6:return e===null&&Se&&((e=n=Re)&&(n=nv(n,t.pendingProps,Ut),n!==null?(t.stateNode=n,et=t,Re=null,e=!0):e=!1),e||Gn(t)),null;case 13:return cm(e,t,n);case 4:return Wt(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=El(t,null,l,n):nt(e,t,l,n),t.child;case 11:return Id(e,t,t.type,t.pendingProps,n);case 7:return nt(e,t,t.pendingProps,n),t.child;case 8:return nt(e,t,t.pendingProps.children,n),t.child;case 12:return nt(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,Vn(t,t.type,l.value),nt(e,t,l.children,n),t.child;case 9:return i=t.type._context,l=t.pendingProps.children,Nl(t),i=tt(i),l=l(i),t.flags|=1,nt(e,t,l,n),t.child;case 14:return em(e,t,t.type,t.pendingProps,n);case 15:return tm(e,t,t.type,t.pendingProps,n);case 19:return um(e,t,n);case 31:return N0(e,t,n);case 22:return nm(e,t,n,t.pendingProps);case 24:return Nl(t),l=tt(Xe),e===null?(i=pc(),i===null&&(i=ke,s=mc(),i.pooledCache=s,s.refCount++,s!==null&&(i.pooledCacheLanes|=n),i=s),t.memoizedState={parent:l,cache:i},yc(t),Vn(t,Xe,i)):((e.lanes&n)!==0&&(vc(e,t),ai(t,null,null,n),li()),i=e.memoizedState,s=t.memoizedState,i.parent!==l?(i={parent:l,cache:l},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Vn(t,Xe,l)):(l=s.cache,Vn(t,Xe,l),l!==i.cache&&dc(t,[Xe],n,!0))),nt(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function pn(e){e.flags|=4}function Ic(e,t,n,l,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(Hm())e.flags|=8192;else throw Tl=vo,gc}else e.flags&=-16777217}function dm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Th(t))if(Hm())e.flags|=8192;else throw Tl=vo,gc}function Do(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Xu():536870912,e.lanes|=t,pa|=t)}function ui(e,t){if(!Se)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 l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function De(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags&65011712,l|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,l|=i.subtreeFlags,l|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function A0(e,t,n){var l=t.pendingProps;switch(sc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return De(t),null;case 1:return De(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),fn(Xe),Yt(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(na(t)?pn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,rc())),De(t),null;case 26:var i=t.type,s=t.memoizedState;return e===null?(pn(t),s!==null?(De(t),dm(t,s)):(De(t),Ic(t,i,null,l,n))):s?s!==e.memoizedState?(pn(t),De(t),dm(t,s)):(De(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&pn(t),De(t),Ic(t,i,e,l,n)),null;case 27:if(I(t),n=zt.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&pn(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return De(t),null}e=He.current,na(t)?Qf(t):(e=xh(i,l,n),t.stateNode=e,pn(t))}return De(t),null;case 5:if(I(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&pn(t);else{if(!l){if(t.stateNode===null)throw Error(c(166));return De(t),null}if(s=He.current,na(t))Qf(t);else{var d=Wo(zt.current);switch(s){case 1:s=d.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:s=d.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":s=d.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":s=d.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":s=d.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild);break;case"select":s=typeof l.is=="string"?d.createElement("select",{is:l.is}):d.createElement("select"),l.multiple?s.multiple=!0:l.size&&(s.size=l.size);break;default:s=typeof l.is=="string"?d.createElement(i,{is:l.is}):d.createElement(i)}}s[Ie]=t,s[ct]=l;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)s.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=s;e:switch(lt(s,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&pn(t)}}return De(t),Ic(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&pn(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(c(166));if(e=zt.current,na(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,i=et,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[Ie]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||ch(e.nodeValue,n)),e||Gn(t,!0)}else e=Wo(e).createTextNode(l),e[Ie]=t,t.stateNode=e}return De(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=na(t),n!==null){if(e===null){if(!l)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Ie]=t}else jl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;De(t),e=!1}else n=rc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(jt(t),t):(jt(t),null);if((t.flags&128)!==0)throw Error(c(558))}return De(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=na(t),l!==null&&l.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[Ie]=t}else jl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;De(t),i=!1}else i=rc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(jt(t),t):(jt(t),null)}return jt(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==i&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Do(t,t.updateQueue),De(t),null);case 4:return Yt(),e===null&&Sr(t.stateNode.containerInfo),De(t),null;case 10:return fn(t.type),De(t),null;case 19:if(ze(Ve),l=t.memoizedState,l===null)return De(t),null;if(i=(t.flags&128)!==0,s=l.rendering,s===null)if(i)ui(l,!1);else{if(Ge!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=jo(e),s!==null){for(t.flags|=128,ui(l,!1),e=s.updateQueue,t.updateQueue=e,Do(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)qf(n,e),n=n.sibling;return pe(Ve,Ve.current&1|2),Se&&rn(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&gt()>qo&&(t.flags|=128,i=!0,ui(l,!1),t.lanes=4194304)}else{if(!i)if(e=jo(s),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Do(t,e),ui(l,!0),l.tail===null&&l.tailMode==="hidden"&&!s.alternate&&!Se)return De(t),null}else 2*gt()-l.renderingStartTime>qo&&n!==536870912&&(t.flags|=128,i=!0,ui(l,!1),t.lanes=4194304);l.isBackwards?(s.sibling=t.child,t.child=s):(e=l.last,e!==null?e.sibling=s:t.child=s,l.last=s)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=gt(),e.sibling=null,n=Ve.current,pe(Ve,i?n&1|2:n&1),Se&&rn(t,l.treeForkCount),e):(De(t),null);case 22:case 23:return jt(t),jc(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(De(t),t.subtreeFlags&6&&(t.flags|=8192)):De(t),n=t.updateQueue,n!==null&&Do(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&ze(Cl),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),fn(Xe),De(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function T0(e,t){switch(sc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fn(Xe),Yt(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return I(t),null;case 31:if(t.memoizedState!==null){if(jt(t),t.alternate===null)throw Error(c(340));jl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(jt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));jl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ze(Ve),null;case 4:return Yt(),null;case 10:return fn(t.type),null;case 22:case 23:return jt(t),jc(),e!==null&&ze(Cl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return fn(Xe),null;case 25:return null;default:return null}}function mm(e,t){switch(sc(t),t.tag){case 3:fn(Xe),Yt();break;case 26:case 27:case 5:I(t);break;case 4:Yt();break;case 31:t.memoizedState!==null&&jt(t);break;case 13:jt(t);break;case 19:ze(Ve);break;case 10:fn(t.type);break;case 22:case 23:jt(t),jc(),e!==null&&ze(Cl);break;case 24:fn(Xe)}}function fi(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var i=l.next;n=i;do{if((n.tag&e)===e){l=void 0;var s=n.create,d=n.inst;l=s(),d.destroy=l}n=n.next}while(n!==i)}}catch(g){Ee(t,t.return,g)}}function $n(e,t,n){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var s=i.next;l=s;do{if((l.tag&e)===e){var d=l.inst,g=d.destroy;if(g!==void 0){d.destroy=void 0,i=t;var N=n,R=g;try{R()}catch(G){Ee(i,N,G)}}}l=l.next}while(l!==s)}}catch(G){Ee(t,t.return,G)}}function hm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ad(t,n)}catch(l){Ee(e,e.return,l)}}}function pm(e,t,n){n.props=_l(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){Ee(e,t,l)}}function di(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(i){Ee(e,t,i)}}function It(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(i){Ee(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){Ee(e,t,i)}else n.current=null}function gm(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(i){Ee(e,e.return,i)}}function er(e,t,n){try{var l=e.stateNode;J0(l,e.type,n,t),l[ct]=t}catch(i){Ee(e,e.return,i)}}function ym(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&tl(e.type)||e.tag===4}function tr(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ym(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&&tl(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 nr(e,t,n){var l=e.tag;if(l===5||l===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=on));else if(l!==4&&(l===27&&tl(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(nr(e,t,n),e=e.sibling;e!==null;)nr(e,t,n),e=e.sibling}function Uo(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&tl(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Uo(e,t,n),e=e.sibling;e!==null;)Uo(e,t,n),e=e.sibling}function vm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);lt(t,l,n),t[Ie]=e,t[ct]=n}catch(s){Ee(e,e.return,s)}}var gn=!1,Ke=!1,lr=!1,xm=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function E0(e,t){if(e=e.containerInfo,Nr=ls,e=Mf(e),Ws(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var i=l.anchorOffset,s=l.focusNode;l=l.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var d=0,g=-1,N=-1,R=0,G=0,X=e,U=null;t:for(;;){for(var L;X!==n||i!==0&&X.nodeType!==3||(g=d+i),X!==s||l!==0&&X.nodeType!==3||(N=d+l),X.nodeType===3&&(d+=X.nodeValue.length),(L=X.firstChild)!==null;)U=X,X=L;for(;;){if(X===e)break t;if(U===n&&++R===i&&(g=d),U===s&&++G===l&&(N=d),(L=X.nextSibling)!==null)break;X=U,U=X.parentNode}X=L}n=g===-1||N===-1?null:{start:g,end:N}}else n=null}n=n||{start:0,end:0}}else n=null;for(Cr={focusedElem:e,selectionRange:n},ls=!1,Fe=t;Fe!==null;)if(t=Fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Fe=e;else for(;Fe!==null;){switch(t=Fe,s=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&&s!==null){e=void 0,n=t,i=s.memoizedProps,s=s.memoizedState,l=n.stateNode;try{var te=_l(n.type,i);e=l.getSnapshotBeforeUpdate(te,s),l.__reactInternalSnapshotBeforeUpdate=e}catch(ce){Ee(n,n.return,ce)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Er(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Er(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,Fe=e;break}Fe=t.return}}function bm(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:vn(e,n),l&4&&fi(5,n);break;case 1:if(vn(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(d){Ee(n,n.return,d)}else{var i=_l(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){Ee(n,n.return,d)}}l&64&&hm(n),l&512&&di(n,n.return);break;case 3:if(vn(e,n),l&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{ad(e,t)}catch(d){Ee(n,n.return,d)}}break;case 27:t===null&&l&4&&vm(n);case 26:case 5:vn(e,n),t===null&&l&4&&gm(n),l&512&&di(n,n.return);break;case 12:vn(e,n);break;case 31:vn(e,n),l&4&&wm(e,n);break;case 13:vn(e,n),l&4&&Nm(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=L0.bind(null,n),lv(e,n))));break;case 22:if(l=n.memoizedState!==null||gn,!l){t=t!==null&&t.memoizedState!==null||Ke,i=gn;var s=Ke;gn=l,(Ke=t)&&!s?xn(e,n,(n.subtreeFlags&8772)!==0):vn(e,n),gn=i,Ke=s}break;case 30:break;default:vn(e,n)}}function Sm(e){var t=e.alternate;t!==null&&(e.alternate=null,Sm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ks(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 Le=null,ut=!1;function yn(e,t,n){for(n=n.child;n!==null;)jm(e,t,n),n=n.sibling}function jm(e,t,n){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(Ua,n)}catch{}switch(n.tag){case 26:Ke||It(n,t),yn(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ke||It(n,t);var l=Le,i=ut;tl(n.type)&&(Le=n.stateNode,ut=!1),yn(e,t,n),Si(n.stateNode),Le=l,ut=i;break;case 5:Ke||It(n,t);case 6:if(l=Le,i=ut,Le=null,yn(e,t,n),Le=l,ut=i,Le!==null)if(ut)try{(Le.nodeType===9?Le.body:Le.nodeName==="HTML"?Le.ownerDocument.body:Le).removeChild(n.stateNode)}catch(s){Ee(n,t,s)}else try{Le.removeChild(n.stateNode)}catch(s){Ee(n,t,s)}break;case 18:Le!==null&&(ut?(e=Le,hh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),wa(e)):hh(Le,n.stateNode));break;case 4:l=Le,i=ut,Le=n.stateNode.containerInfo,ut=!0,yn(e,t,n),Le=l,ut=i;break;case 0:case 11:case 14:case 15:$n(2,n,t),Ke||$n(4,n,t),yn(e,t,n);break;case 1:Ke||(It(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&pm(n,t,l)),yn(e,t,n);break;case 21:yn(e,t,n);break;case 22:Ke=(l=Ke)||n.memoizedState!==null,yn(e,t,n),Ke=l;break;default:yn(e,t,n)}}function wm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{wa(e)}catch(n){Ee(t,t.return,n)}}}function Nm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{wa(e)}catch(n){Ee(t,t.return,n)}}function z0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new xm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new xm),t;default:throw Error(c(435,e.tag))}}function Lo(e,t){var n=z0(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var i=H0.bind(null,e,l);l.then(i,i)}})}function ft(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var i=n[l],s=e,d=t,g=d;e:for(;g!==null;){switch(g.tag){case 27:if(tl(g.type)){Le=g.stateNode,ut=!1;break e}break;case 5:Le=g.stateNode,ut=!1;break e;case 3:case 4:Le=g.stateNode.containerInfo,ut=!0;break e}g=g.return}if(Le===null)throw Error(c(160));jm(s,d,i),Le=null,ut=!1,s=i.alternate,s!==null&&(s.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Cm(t,e),t=t.sibling}var Qt=null;function Cm(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ft(t,e),dt(e),l&4&&($n(3,e,e.return),fi(3,e),$n(5,e,e.return));break;case 1:ft(t,e),dt(e),l&512&&(Ke||n===null||It(n,n.return)),l&64&&gn&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var i=Qt;if(ft(t,e),dt(e),l&512&&(Ke||n===null||It(n,n.return)),l&4){var s=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(l){case"title":s=i.getElementsByTagName("title")[0],(!s||s[Ba]||s[Ie]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=i.createElement(l),i.head.insertBefore(s,i.querySelector("head > title"))),lt(s,l,n),s[Ie]=e,We(s),l=s;break e;case"link":var d=Ch("link","href",i).get(l+(n.href||""));if(d){for(var g=0;g<d.length;g++)if(s=d[g],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){d.splice(g,1);break t}}s=i.createElement(l),lt(s,l,n),i.head.appendChild(s);break;case"meta":if(d=Ch("meta","content",i).get(l+(n.content||""))){for(g=0;g<d.length;g++)if(s=d[g],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){d.splice(g,1);break t}}s=i.createElement(l),lt(s,l,n),i.head.appendChild(s);break;default:throw Error(c(468,l))}s[Ie]=e,We(s),l=s}e.stateNode=l}else Ah(i,e.type,e.stateNode);else e.stateNode=Nh(i,l,e.memoizedProps);else s!==l?(s===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):s.count--,l===null?Ah(i,e.type,e.stateNode):Nh(i,l,e.memoizedProps)):l===null&&e.stateNode!==null&&er(e,e.memoizedProps,n.memoizedProps)}break;case 27:ft(t,e),dt(e),l&512&&(Ke||n===null||It(n,n.return)),n!==null&&l&4&&er(e,e.memoizedProps,n.memoizedProps);break;case 5:if(ft(t,e),dt(e),l&512&&(Ke||n===null||It(n,n.return)),e.flags&32){i=e.stateNode;try{Zl(i,"")}catch(te){Ee(e,e.return,te)}}l&4&&e.stateNode!=null&&(i=e.memoizedProps,er(e,i,n!==null?n.memoizedProps:i)),l&1024&&(lr=!0);break;case 6:if(ft(t,e),dt(e),l&4){if(e.stateNode===null)throw Error(c(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(te){Ee(e,e.return,te)}}break;case 3:if(Io=null,i=Qt,Qt=Fo(t.containerInfo),ft(t,e),Qt=i,dt(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{wa(t.containerInfo)}catch(te){Ee(e,e.return,te)}lr&&(lr=!1,Am(e));break;case 4:l=Qt,Qt=Fo(e.stateNode.containerInfo),ft(t,e),dt(e),Qt=l;break;case 12:ft(t,e),dt(e);break;case 31:ft(t,e),dt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Lo(e,l)));break;case 13:ft(t,e),dt(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Bo=gt()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Lo(e,l)));break;case 22:i=e.memoizedState!==null;var N=n!==null&&n.memoizedState!==null,R=gn,G=Ke;if(gn=R||i,Ke=G||N,ft(t,e),Ke=G,gn=R,dt(e),l&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||N||gn||Ke||Ml(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){N=n=t;try{if(s=N.stateNode,i)d=s.style,typeof d.setProperty=="function"?d.setProperty("display","none","important"):d.display="none";else{g=N.stateNode;var X=N.memoizedProps.style,U=X!=null&&X.hasOwnProperty("display")?X.display:null;g.style.display=U==null||typeof U=="boolean"?"":(""+U).trim()}}catch(te){Ee(N,N.return,te)}}}else if(t.tag===6){if(n===null){N=t;try{N.stateNode.nodeValue=i?"":N.memoizedProps}catch(te){Ee(N,N.return,te)}}}else if(t.tag===18){if(n===null){N=t;try{var L=N.stateNode;i?ph(L,!0):ph(N.stateNode,!1)}catch(te){Ee(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}l&4&&(l=e.updateQueue,l!==null&&(n=l.retryQueue,n!==null&&(l.retryQueue=null,Lo(e,n))));break;case 19:ft(t,e),dt(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Lo(e,l)));break;case 30:break;case 21:break;default:ft(t,e),dt(e)}}function dt(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(ym(l)){n=l;break}l=l.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var i=n.stateNode,s=tr(e);Uo(e,s,i);break;case 5:var d=n.stateNode;n.flags&32&&(Zl(d,""),n.flags&=-33);var g=tr(e);Uo(e,g,d);break;case 3:case 4:var N=n.stateNode.containerInfo,R=tr(e);nr(e,R,N);break;default:throw Error(c(161))}}catch(G){Ee(e,e.return,G)}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 vn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)bm(e,t.alternate,t),t=t.sibling}function Ml(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:$n(4,t,t.return),Ml(t);break;case 1:It(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&pm(t,t.return,n),Ml(t);break;case 27:Si(t.stateNode);case 26:case 5:It(t,t.return),Ml(t);break;case 22:t.memoizedState===null&&Ml(t);break;case 30:Ml(t);break;default:Ml(t)}e=e.sibling}}function xn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,i=e,s=t,d=s.flags;switch(s.tag){case 0:case 11:case 15:xn(i,s,n),fi(4,s);break;case 1:if(xn(i,s,n),l=s,i=l.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(R){Ee(l,l.return,R)}if(l=s,i=l.updateQueue,i!==null){var g=l.stateNode;try{var N=i.shared.hiddenCallbacks;if(N!==null)for(i.shared.hiddenCallbacks=null,i=0;i<N.length;i++)ld(N[i],g)}catch(R){Ee(l,l.return,R)}}n&&d&64&&hm(s),di(s,s.return);break;case 27:vm(s);case 26:case 5:xn(i,s,n),n&&l===null&&d&4&&gm(s),di(s,s.return);break;case 12:xn(i,s,n);break;case 31:xn(i,s,n),n&&d&4&&wm(i,s);break;case 13:xn(i,s,n),n&&d&4&&Nm(i,s);break;case 22:s.memoizedState===null&&xn(i,s,n),di(s,s.return);break;case 30:break;default:xn(i,s,n)}t=t.sibling}}function ar(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&&Pa(n))}function ir(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Pa(e))}function Zt(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Tm(e,t,n,l),t=t.sibling}function Tm(e,t,n,l){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Zt(e,t,n,l),i&2048&&fi(9,t);break;case 1:Zt(e,t,n,l);break;case 3:Zt(e,t,n,l),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Pa(e)));break;case 12:if(i&2048){Zt(e,t,n,l),e=t.stateNode;try{var s=t.memoizedProps,d=s.id,g=s.onPostCommit;typeof g=="function"&&g(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(N){Ee(t,t.return,N)}}else Zt(e,t,n,l);break;case 31:Zt(e,t,n,l);break;case 13:Zt(e,t,n,l);break;case 23:break;case 22:s=t.stateNode,d=t.alternate,t.memoizedState!==null?s._visibility&2?Zt(e,t,n,l):mi(e,t):s._visibility&2?Zt(e,t,n,l):(s._visibility|=2,da(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),i&2048&&ar(d,t);break;case 24:Zt(e,t,n,l),i&2048&&ir(t.alternate,t);break;default:Zt(e,t,n,l)}}function da(e,t,n,l,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var s=e,d=t,g=n,N=l,R=d.flags;switch(d.tag){case 0:case 11:case 15:da(s,d,g,N,i),fi(8,d);break;case 23:break;case 22:var G=d.stateNode;d.memoizedState!==null?G._visibility&2?da(s,d,g,N,i):mi(s,d):(G._visibility|=2,da(s,d,g,N,i)),i&&R&2048&&ar(d.alternate,d);break;case 24:da(s,d,g,N,i),i&&R&2048&&ir(d.alternate,d);break;default:da(s,d,g,N,i)}t=t.sibling}}function mi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,i=l.flags;switch(l.tag){case 22:mi(n,l),i&2048&&ar(l.alternate,l);break;case 24:mi(n,l),i&2048&&ir(l.alternate,l);break;default:mi(n,l)}t=t.sibling}}var hi=8192;function ma(e,t,n){if(e.subtreeFlags&hi)for(e=e.child;e!==null;)Em(e,t,n),e=e.sibling}function Em(e,t,n){switch(e.tag){case 26:ma(e,t,n),e.flags&hi&&e.memoizedState!==null&&pv(n,Qt,e.memoizedState,e.memoizedProps);break;case 5:ma(e,t,n);break;case 3:case 4:var l=Qt;Qt=Fo(e.stateNode.containerInfo),ma(e,t,n),Qt=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=hi,hi=16777216,ma(e,t,n),hi=l):ma(e,t,n));break;default:ma(e,t,n)}}function zm(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 pi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Fe=l,Mm(l,e)}zm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)_m(e),e=e.sibling}function _m(e){switch(e.tag){case 0:case 11:case 15:pi(e),e.flags&2048&&$n(9,e,e.return);break;case 3:pi(e);break;case 12:pi(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ho(e)):pi(e);break;default:pi(e)}}function Ho(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Fe=l,Mm(l,e)}zm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:$n(8,t,t.return),Ho(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ho(t));break;default:Ho(t)}e=e.sibling}}function Mm(e,t){for(;Fe!==null;){var n=Fe;switch(n.tag){case 0:case 11:case 15:$n(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Pa(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Fe=l;else e:for(n=e;Fe!==null;){l=Fe;var i=l.sibling,s=l.return;if(Sm(l),l===n){Fe=null;break e}if(i!==null){i.return=s,Fe=i;break e}Fe=s}}}var _0={getCacheForType:function(e){var t=tt(Xe),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return tt(Xe).controller.signal}},M0=typeof WeakMap=="function"?WeakMap:Map,Ae=0,ke=null,ye=null,xe=0,Te=0,wt=null,Jn=!1,ha=!1,or=!1,bn=0,Ge=0,Wn=0,Ol=0,sr=0,Nt=0,pa=0,gi=null,mt=null,cr=!1,Bo=0,Om=0,qo=1/0,Go=null,Fn=null,$e=0,Pn=null,ga=null,Sn=0,rr=0,ur=null,km=null,yi=0,fr=null;function Ct(){return(Ae&2)!==0&&xe!==0?xe&-xe:A.T!==null?yr():$u()}function Rm(){if(Nt===0)if((xe&536870912)===0||Se){var e=$i;$i<<=1,($i&3932160)===0&&($i=262144),Nt=e}else Nt=536870912;return e=St.current,e!==null&&(e.flags|=32),Nt}function ht(e,t,n){(e===ke&&(Te===2||Te===9)||e.cancelPendingCommit!==null)&&(ya(e,0),In(e,xe,Nt,!1)),Ha(e,n),((Ae&2)===0||e!==ke)&&(e===ke&&((Ae&2)===0&&(Ol|=n),Ge===4&&In(e,xe,Nt,!1)),en(e))}function Dm(e,t,n){if((Ae&6)!==0)throw Error(c(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||La(e,t),i=l?R0(e,t):mr(e,t,!0),s=l;do{if(i===0){ha&&!l&&In(e,t,0,!1);break}else{if(n=e.current.alternate,s&&!O0(n)){i=mr(e,t,!1),s=!1;continue}if(i===2){if(s=t,e.errorRecoveryDisabledLanes&s)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var g=e;i=gi;var N=g.current.memoizedState.isDehydrated;if(N&&(ya(g,d).flags|=256),d=mr(g,d,!1),d!==2){if(or&&!N){g.errorRecoveryDisabledLanes|=s,Ol|=s,i=4;break e}s=mt,mt=i,s!==null&&(mt===null?mt=s:mt.push.apply(mt,s))}i=d}if(s=!1,i!==2)continue}}if(i===1){ya(e,0),In(e,t,0,!0);break}e:{switch(l=e,s=i,s){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:In(l,t,Nt,!Jn);break e;case 2:mt=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(i=Bo+300-gt(),10<i)){if(In(l,t,Nt,!Jn),Wi(l,0,!0)!==0)break e;Sn=t,l.timeoutHandle=dh(Um.bind(null,l,n,mt,Go,cr,t,Nt,Ol,pa,Jn,s,"Throttled",-0,0),i);break e}Um(l,n,mt,Go,cr,t,Nt,Ol,pa,Jn,s,null,-0,0)}}break}while(!0);en(e)}function Um(e,t,n,l,i,s,d,g,N,R,G,X,U,L){if(e.timeoutHandle=-1,X=t.subtreeFlags,X&8192||(X&16785408)===16785408){X={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:on},Em(t,s,X);var te=(s&62914560)===s?Bo-gt():(s&4194048)===s?Om-gt():0;if(te=gv(X,te),te!==null){Sn=s,e.cancelPendingCommit=te(Xm.bind(null,e,t,s,n,l,i,d,g,N,G,X,null,U,L)),In(e,s,d,!R);return}}Xm(e,t,s,n,l,i,d,g,N)}function O0(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 l=0;l<n.length;l++){var i=n[l],s=i.getSnapshot;i=i.value;try{if(!xt(s(),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 In(e,t,n,l){t&=~sr,t&=~Ol,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var i=t;0<i;){var s=31-vt(i),d=1<<s;l[s]=-1,i&=~d}n!==0&&Qu(e,n,t)}function Vo(){return(Ae&6)===0?(vi(0),!1):!0}function dr(){if(ye!==null){if(Te===0)var e=ye.return;else e=ye,un=wl=null,Ec(e),sa=null,ei=0,e=ye;for(;e!==null;)mm(e.alternate,e),e=e.return;ye=null}}function ya(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,P0(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Sn=0,dr(),ke=e,ye=n=cn(e.current,null),xe=t,Te=0,wt=null,Jn=!1,ha=La(e,t),or=!1,pa=Nt=sr=Ol=Wn=Ge=0,mt=gi=null,cr=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var i=31-vt(l),s=1<<i;t|=e[i],l&=~s}return bn=t,co(),n}function Lm(e,t){de=null,A.H=ci,t===oa||t===yo?(t=If(),Te=3):t===gc?(t=If(),Te=4):Te=t===Xc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,wt=t,ye===null&&(Ge=1,Mo(e,kt(t,e.current)))}function Hm(){var e=St.current;return e===null?!0:(xe&4194048)===xe?Lt===null:(xe&62914560)===xe||(xe&536870912)!==0?e===Lt:!1}function Bm(){var e=A.H;return A.H=ci,e===null?ci:e}function qm(){var e=A.A;return A.A=_0,e}function Yo(){Ge=4,Jn||(xe&4194048)!==xe&&St.current!==null||(ha=!0),(Wn&134217727)===0&&(Ol&134217727)===0||ke===null||In(ke,xe,Nt,!1)}function mr(e,t,n){var l=Ae;Ae|=2;var i=Bm(),s=qm();(ke!==e||xe!==t)&&(Go=null,ya(e,t)),t=!1;var d=Ge;e:do try{if(Te!==0&&ye!==null){var g=ye,N=wt;switch(Te){case 8:dr(),d=6;break e;case 3:case 2:case 9:case 6:St.current===null&&(t=!0);var R=Te;if(Te=0,wt=null,va(e,g,N,R),n&&ha){d=0;break e}break;default:R=Te,Te=0,wt=null,va(e,g,N,R)}}k0(),d=Ge;break}catch(G){Lm(e,G)}while(!0);return t&&e.shellSuspendCounter++,un=wl=null,Ae=l,A.H=i,A.A=s,ye===null&&(ke=null,xe=0,co()),d}function k0(){for(;ye!==null;)Gm(ye)}function R0(e,t){var n=Ae;Ae|=2;var l=Bm(),i=qm();ke!==e||xe!==t?(Go=null,qo=gt()+500,ya(e,t)):ha=La(e,t);e:do try{if(Te!==0&&ye!==null){t=ye;var s=wt;t:switch(Te){case 1:Te=0,wt=null,va(e,t,s,1);break;case 2:case 9:if(Ff(s)){Te=0,wt=null,Vm(t);break}t=function(){Te!==2&&Te!==9||ke!==e||(Te=7),en(e)},s.then(t,t);break e;case 3:Te=7;break e;case 4:Te=5;break e;case 7:Ff(s)?(Te=0,wt=null,Vm(t)):(Te=0,wt=null,va(e,t,s,7));break;case 5:var d=null;switch(ye.tag){case 26:d=ye.memoizedState;case 5:case 27:var g=ye;if(d?Th(d):g.stateNode.complete){Te=0,wt=null;var N=g.sibling;if(N!==null)ye=N;else{var R=g.return;R!==null?(ye=R,Xo(R)):ye=null}break t}}Te=0,wt=null,va(e,t,s,5);break;case 6:Te=0,wt=null,va(e,t,s,6);break;case 8:dr(),Ge=6;break e;default:throw Error(c(462))}}D0();break}catch(G){Lm(e,G)}while(!0);return un=wl=null,A.H=l,A.A=i,Ae=n,ye!==null?0:(ke=null,xe=0,co(),Ge)}function D0(){for(;ye!==null&&!Bl();)Gm(ye)}function Gm(e){var t=fm(e.alternate,e,bn);e.memoizedProps=e.pendingProps,t===null?Xo(e):ye=t}function Vm(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=im(n,t,t.pendingProps,t.type,void 0,xe);break;case 11:t=im(n,t,t.pendingProps,t.type.render,t.ref,xe);break;case 5:Ec(t);default:mm(n,t),t=ye=qf(t,bn),t=fm(n,t,bn)}e.memoizedProps=e.pendingProps,t===null?Xo(e):ye=t}function va(e,t,n,l){un=wl=null,Ec(t),sa=null,ei=0;var i=t.return;try{if(w0(e,i,t,n,xe)){Ge=1,Mo(e,kt(n,e.current)),ye=null;return}}catch(s){if(i!==null)throw ye=i,s;Ge=1,Mo(e,kt(n,e.current)),ye=null;return}t.flags&32768?(Se||l===1?e=!0:ha||(xe&536870912)!==0?e=!1:(Jn=e=!0,(l===2||l===9||l===3||l===6)&&(l=St.current,l!==null&&l.tag===13&&(l.flags|=16384))),Ym(t,e)):Xo(t)}function Xo(e){var t=e;do{if((t.flags&32768)!==0){Ym(t,Jn);return}e=t.return;var n=A0(t.alternate,t,bn);if(n!==null){ye=n;return}if(t=t.sibling,t!==null){ye=t;return}ye=t=e}while(t!==null);Ge===0&&(Ge=5)}function Ym(e,t){do{var n=T0(e.alternate,e);if(n!==null){n.flags&=32767,ye=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ye=e;return}ye=e=n}while(e!==null);Ge=6,ye=null}function Xm(e,t,n,l,i,s,d,g,N){e.cancelPendingCommit=null;do Qo();while($e!==0);if((Ae&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(s=t.lanes|t.childLanes,s|=tc,hy(e,n,s,d,g,N),e===ke&&(ye=ke=null,xe=0),ga=t,Pn=e,Sn=n,rr=s,ur=i,km=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,B0(Zi,function(){return Jm(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=A.T,A.T=null,i=D.p,D.p=2,d=Ae,Ae|=4;try{E0(e,t,n)}finally{Ae=d,D.p=i,A.T=l}}$e=1,Qm(),Zm(),Km()}}function Qm(){if($e===1){$e=0;var e=Pn,t=ga,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=A.T,A.T=null;var l=D.p;D.p=2;var i=Ae;Ae|=4;try{Cm(t,e);var s=Cr,d=Mf(e.containerInfo),g=s.focusedElem,N=s.selectionRange;if(d!==g&&g&&g.ownerDocument&&_f(g.ownerDocument.documentElement,g)){if(N!==null&&Ws(g)){var R=N.start,G=N.end;if(G===void 0&&(G=R),"selectionStart"in g)g.selectionStart=R,g.selectionEnd=Math.min(G,g.value.length);else{var X=g.ownerDocument||document,U=X&&X.defaultView||window;if(U.getSelection){var L=U.getSelection(),te=g.textContent.length,ce=Math.min(N.start,te),Oe=N.end===void 0?ce:Math.min(N.end,te);!L.extend&&ce>Oe&&(d=Oe,Oe=ce,ce=d);var _=zf(g,ce),T=zf(g,Oe);if(_&&T&&(L.rangeCount!==1||L.anchorNode!==_.node||L.anchorOffset!==_.offset||L.focusNode!==T.node||L.focusOffset!==T.offset)){var M=X.createRange();M.setStart(_.node,_.offset),L.removeAllRanges(),ce>Oe?(L.addRange(M),L.extend(T.node,T.offset)):(M.setEnd(T.node,T.offset),L.addRange(M))}}}}for(X=[],L=g;L=L.parentNode;)L.nodeType===1&&X.push({element:L,left:L.scrollLeft,top:L.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<X.length;g++){var Y=X[g];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}ls=!!Nr,Cr=Nr=null}finally{Ae=i,D.p=l,A.T=n}}e.current=t,$e=2}}function Zm(){if($e===2){$e=0;var e=Pn,t=ga,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=A.T,A.T=null;var l=D.p;D.p=2;var i=Ae;Ae|=4;try{bm(e,t.alternate,t)}finally{Ae=i,D.p=l,A.T=n}}$e=3}}function Km(){if($e===4||$e===3){$e=0,iy();var e=Pn,t=ga,n=Sn,l=km;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?$e=5:($e=0,ga=Pn=null,$m(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Fn=null),Ms(n),t=t.stateNode,yt&&typeof yt.onCommitFiberRoot=="function")try{yt.onCommitFiberRoot(Ua,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=A.T,i=D.p,D.p=2,A.T=null;try{for(var s=e.onRecoverableError,d=0;d<l.length;d++){var g=l[d];s(g.value,{componentStack:g.stack})}}finally{A.T=t,D.p=i}}(Sn&3)!==0&&Qo(),en(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===fr?yi++:(yi=0,fr=e):yi=0,vi(0)}}function $m(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Pa(t)))}function Qo(){return Qm(),Zm(),Km(),Jm()}function Jm(){if($e!==5)return!1;var e=Pn,t=rr;rr=0;var n=Ms(Sn),l=A.T,i=D.p;try{D.p=32>n?32:n,A.T=null,n=ur,ur=null;var s=Pn,d=Sn;if($e=0,ga=Pn=null,Sn=0,(Ae&6)!==0)throw Error(c(331));var g=Ae;if(Ae|=4,_m(s.current),Tm(s,s.current,d,n),Ae=g,vi(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(Ua,s)}catch{}return!0}finally{D.p=i,A.T=l,$m(e,t)}}function Wm(e,t,n){t=kt(n,t),t=Yc(e.stateNode,t,2),e=Qn(e,t,2),e!==null&&(Ha(e,2),en(e))}function Ee(e,t,n){if(e.tag===3)Wm(e,e,n);else for(;t!==null;){if(t.tag===3){Wm(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Fn===null||!Fn.has(l))){e=kt(n,e),n=Fd(2),l=Qn(t,n,2),l!==null&&(Pd(n,l,t,e),Ha(l,2),en(l));break}}t=t.return}}function hr(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new M0;var i=new Set;l.set(t,i)}else i=l.get(t),i===void 0&&(i=new Set,l.set(t,i));i.has(n)||(or=!0,i.add(n),e=U0.bind(null,e,t,n),t.then(e,e))}function U0(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ke===e&&(xe&n)===n&&(Ge===4||Ge===3&&(xe&62914560)===xe&&300>gt()-Bo?(Ae&2)===0&&ya(e,0):sr|=n,pa===xe&&(pa=0)),en(e)}function Fm(e,t){t===0&&(t=Xu()),e=bl(e,t),e!==null&&(Ha(e,t),en(e))}function L0(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Fm(e,n)}function H0(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(c(314))}l!==null&&l.delete(t),Fm(e,n)}function B0(e,t){return Ra(e,t)}var Zo=null,xa=null,pr=!1,Ko=!1,gr=!1,el=0;function en(e){e!==xa&&e.next===null&&(xa===null?Zo=xa=e:xa=xa.next=e),Ko=!0,pr||(pr=!0,G0())}function vi(e,t){if(!gr&&Ko){gr=!0;do for(var n=!1,l=Zo;l!==null;){if(e!==0){var i=l.pendingLanes;if(i===0)var s=0;else{var d=l.suspendedLanes,g=l.pingedLanes;s=(1<<31-vt(42|e)+1)-1,s&=i&~(d&~g),s=s&201326741?s&201326741|1:s?s|2:0}s!==0&&(n=!0,th(l,s))}else s=xe,s=Wi(l,l===ke?s:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(s&3)===0||La(l,s)||(n=!0,th(l,s));l=l.next}while(n);gr=!1}}function q0(){Pm()}function Pm(){Ko=pr=!1;var e=0;el!==0&&F0()&&(e=el);for(var t=gt(),n=null,l=Zo;l!==null;){var i=l.next,s=Im(l,t);s===0?(l.next=null,n===null?Zo=i:n.next=i,i===null&&(xa=n)):(n=l,(e!==0||(s&3)!==0)&&(Ko=!0)),l=i}$e!==0&&$e!==5||vi(e),el!==0&&(el=0)}function Im(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes&-62914561;0<s;){var d=31-vt(s),g=1<<d,N=i[d];N===-1?((g&n)===0||(g&l)!==0)&&(i[d]=my(g,t)):N<=t&&(e.expiredLanes|=g),s&=~g}if(t=ke,n=xe,n=Wi(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(Te===2||Te===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Da(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||La(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&Da(l),Ms(n)){case 2:case 8:n=Vu;break;case 32:n=Zi;break;case 268435456:n=Yu;break;default:n=Zi}return l=eh.bind(null,e),n=Ra(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&Da(l),e.callbackPriority=2,e.callbackNode=null,2}function eh(e,t){if($e!==0&&$e!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Qo()&&e.callbackNode!==n)return null;var l=xe;return l=Wi(e,e===ke?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Dm(e,l,t),Im(e,gt()),e.callbackNode!=null&&e.callbackNode===n?eh.bind(null,e):null)}function th(e,t){if(Qo())return null;Dm(e,t,!0)}function G0(){I0(function(){(Ae&6)!==0?Ra(Gu,q0):Pm()})}function yr(){if(el===0){var e=aa;e===0&&(e=Ki,Ki<<=1,(Ki&261888)===0&&(Ki=256)),el=e}return el}function nh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:eo(""+e)}function lh(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 V0(e,t,n,l,i){if(t==="submit"&&n&&n.stateNode===i){var s=nh((i[ct]||null).action),d=l.submitter;d&&(t=(t=d[ct]||null)?nh(t.formAction):d.getAttribute("formAction"),t!==null&&(s=t,d=null));var g=new ao("action","action",null,l,i);e.push({event:g,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(el!==0){var N=d?lh(i,d):new FormData(i);Lc(n,{pending:!0,data:N,method:i.method,action:s},null,N)}}else typeof s=="function"&&(g.preventDefault(),N=d?lh(i,d):new FormData(i),Lc(n,{pending:!0,data:N,method:i.method,action:s},s,N))},currentTarget:i}]})}}for(var vr=0;vr<ec.length;vr++){var xr=ec[vr],Y0=xr.toLowerCase(),X0=xr[0].toUpperCase()+xr.slice(1);Xt(Y0,"on"+X0)}Xt(Rf,"onAnimationEnd"),Xt(Df,"onAnimationIteration"),Xt(Uf,"onAnimationStart"),Xt("dblclick","onDoubleClick"),Xt("focusin","onFocus"),Xt("focusout","onBlur"),Xt(o0,"onTransitionRun"),Xt(s0,"onTransitionStart"),Xt(c0,"onTransitionCancel"),Xt(Lf,"onTransitionEnd"),Xl("onMouseEnter",["mouseout","mouseover"]),Xl("onMouseLeave",["mouseout","mouseover"]),Xl("onPointerEnter",["pointerout","pointerover"]),Xl("onPointerLeave",["pointerout","pointerover"]),gl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),gl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),gl("onBeforeInput",["compositionend","keypress","textInput","paste"]),gl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),gl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),gl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xi="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(" "),Q0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xi));function ah(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],i=l.event;l=l.listeners;e:{var s=void 0;if(t)for(var d=l.length-1;0<=d;d--){var g=l[d],N=g.instance,R=g.currentTarget;if(g=g.listener,N!==s&&i.isPropagationStopped())break e;s=g,i.currentTarget=R;try{s(i)}catch(G){so(G)}i.currentTarget=null,s=N}else for(d=0;d<l.length;d++){if(g=l[d],N=g.instance,R=g.currentTarget,g=g.listener,N!==s&&i.isPropagationStopped())break e;s=g,i.currentTarget=R;try{s(i)}catch(G){so(G)}i.currentTarget=null,s=N}}}}function ve(e,t){var n=t[Os];n===void 0&&(n=t[Os]=new Set);var l=e+"__bubble";n.has(l)||(ih(t,e,2,!1),n.add(l))}function br(e,t,n){var l=0;t&&(l|=4),ih(n,e,l,t)}var $o="_reactListening"+Math.random().toString(36).slice(2);function Sr(e){if(!e[$o]){e[$o]=!0,Fu.forEach(function(n){n!=="selectionchange"&&(Q0.has(n)||br(n,!1,e),br(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$o]||(t[$o]=!0,br("selectionchange",!1,t))}}function ih(e,t,n,l){switch(Rh(t)){case 2:var i=xv;break;case 8:i=bv;break;default:i=Ur}n=i.bind(null,t,n,e),i=void 0,!Gs||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),l?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 jr(e,t,n,l,i){var s=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var d=l.tag;if(d===3||d===4){var g=l.stateNode.containerInfo;if(g===i)break;if(d===4)for(d=l.return;d!==null;){var N=d.tag;if((N===3||N===4)&&d.stateNode.containerInfo===i)return;d=d.return}for(;g!==null;){if(d=Gl(g),d===null)return;if(N=d.tag,N===5||N===6||N===26||N===27){l=s=d;continue e}g=g.parentNode}}l=l.return}uf(function(){var R=s,G=Bs(n),X=[];e:{var U=Hf.get(e);if(U!==void 0){var L=ao,te=e;switch(e){case"keypress":if(no(n)===0)break e;case"keydown":case"keyup":L=Hy;break;case"focusin":te="focus",L=Qs;break;case"focusout":te="blur",L=Qs;break;case"beforeblur":case"afterblur":L=Qs;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":L=mf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":L=Ay;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":L=Gy;break;case Rf:case Df:case Uf:L=zy;break;case Lf:L=Yy;break;case"scroll":case"scrollend":L=Ny;break;case"wheel":L=Qy;break;case"copy":case"cut":case"paste":L=My;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":L=pf;break;case"toggle":case"beforetoggle":L=Ky}var ce=(t&4)!==0,Oe=!ce&&(e==="scroll"||e==="scrollend"),_=ce?U!==null?U+"Capture":null:U;ce=[];for(var T=R,M;T!==null;){var Y=T;if(M=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||M===null||_===null||(Y=Ga(T,_),Y!=null&&ce.push(bi(T,Y,M))),Oe)break;T=T.return}0<ce.length&&(U=new L(U,te,null,n,G),X.push({event:U,listeners:ce}))}}if((t&7)===0){e:{if(U=e==="mouseover"||e==="pointerover",L=e==="mouseout"||e==="pointerout",U&&n!==Hs&&(te=n.relatedTarget||n.fromElement)&&(Gl(te)||te[ql]))break e;if((L||U)&&(U=G.window===G?G:(U=G.ownerDocument)?U.defaultView||U.parentWindow:window,L?(te=n.relatedTarget||n.toElement,L=R,te=te?Gl(te):null,te!==null&&(Oe=f(te),ce=te.tag,te!==Oe||ce!==5&&ce!==27&&ce!==6)&&(te=null)):(L=null,te=R),L!==te)){if(ce=mf,Y="onMouseLeave",_="onMouseEnter",T="mouse",(e==="pointerout"||e==="pointerover")&&(ce=pf,Y="onPointerLeave",_="onPointerEnter",T="pointer"),Oe=L==null?U:qa(L),M=te==null?U:qa(te),U=new ce(Y,T+"leave",L,n,G),U.target=Oe,U.relatedTarget=M,Y=null,Gl(G)===R&&(ce=new ce(_,T+"enter",te,n,G),ce.target=M,ce.relatedTarget=Oe,Y=ce),Oe=Y,L&&te)t:{for(ce=Z0,_=L,T=te,M=0,Y=_;Y;Y=ce(Y))M++;Y=0;for(var oe=T;oe;oe=ce(oe))Y++;for(;0<M-Y;)_=ce(_),M--;for(;0<Y-M;)T=ce(T),Y--;for(;M--;){if(_===T||T!==null&&_===T.alternate){ce=_;break t}_=ce(_),T=ce(T)}ce=null}else ce=null;L!==null&&oh(X,U,L,ce,!1),te!==null&&Oe!==null&&oh(X,Oe,te,ce,!0)}}e:{if(U=R?qa(R):window,L=U.nodeName&&U.nodeName.toLowerCase(),L==="select"||L==="input"&&U.type==="file")var we=wf;else if(Sf(U))if(Nf)we=l0;else{we=t0;var ae=e0}else L=U.nodeName,!L||L.toLowerCase()!=="input"||U.type!=="checkbox"&&U.type!=="radio"?R&&Ls(R.elementType)&&(we=wf):we=n0;if(we&&(we=we(e,R))){jf(X,we,n,G);break e}ae&&ae(e,U,R),e==="focusout"&&R&&U.type==="number"&&R.memoizedProps.value!=null&&Us(U,"number",U.value)}switch(ae=R?qa(R):window,e){case"focusin":(Sf(ae)||ae.contentEditable==="true")&&(Wl=ae,Fs=R,Ja=null);break;case"focusout":Ja=Fs=Wl=null;break;case"mousedown":Ps=!0;break;case"contextmenu":case"mouseup":case"dragend":Ps=!1,Of(X,n,G);break;case"selectionchange":if(i0)break;case"keydown":case"keyup":Of(X,n,G)}var me;if(Ks)e:{switch(e){case"compositionstart":var be="onCompositionStart";break e;case"compositionend":be="onCompositionEnd";break e;case"compositionupdate":be="onCompositionUpdate";break e}be=void 0}else Jl?xf(e,n)&&(be="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(be="onCompositionStart");be&&(gf&&n.locale!=="ko"&&(Jl||be!=="onCompositionStart"?be==="onCompositionEnd"&&Jl&&(me=ff()):(Hn=G,Vs="value"in Hn?Hn.value:Hn.textContent,Jl=!0)),ae=Jo(R,be),0<ae.length&&(be=new hf(be,e,null,n,G),X.push({event:be,listeners:ae}),me?be.data=me:(me=bf(n),me!==null&&(be.data=me)))),(me=Jy?Wy(e,n):Fy(e,n))&&(be=Jo(R,"onBeforeInput"),0<be.length&&(ae=new hf("onBeforeInput","beforeinput",null,n,G),X.push({event:ae,listeners:be}),ae.data=me)),V0(X,e,R,n,G)}ah(X,t)})}function bi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Jo(e,t){for(var n=t+"Capture",l=[];e!==null;){var i=e,s=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||s===null||(i=Ga(e,n),i!=null&&l.unshift(bi(e,i,s)),i=Ga(e,t),i!=null&&l.push(bi(e,i,s))),e.tag===3)return l;e=e.return}return[]}function Z0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function oh(e,t,n,l,i){for(var s=t._reactName,d=[];n!==null&&n!==l;){var g=n,N=g.alternate,R=g.stateNode;if(g=g.tag,N!==null&&N===l)break;g!==5&&g!==26&&g!==27||R===null||(N=R,i?(R=Ga(n,s),R!=null&&d.unshift(bi(n,R,N))):i||(R=Ga(n,s),R!=null&&d.push(bi(n,R,N)))),n=n.return}d.length!==0&&e.push({event:t,listeners:d})}var K0=/\r\n?/g,$0=/\u0000|\uFFFD/g;function sh(e){return(typeof e=="string"?e:""+e).replace(K0,`
`).replace($0,"")}function ch(e,t){return t=sh(t),sh(e)===t}function Me(e,t,n,l,i,s){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||Zl(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&Zl(e,""+l);break;case"className":Pi(e,"class",l);break;case"tabIndex":Pi(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Pi(e,n,l);break;case"style":cf(e,l,s);break;case"data":if(t!=="object"){Pi(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=eo(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="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 s=="function"&&(n==="formAction"?(t!=="input"&&Me(e,t,"name",i.name,i,null),Me(e,t,"formEncType",i.formEncType,i,null),Me(e,t,"formMethod",i.formMethod,i,null),Me(e,t,"formTarget",i.formTarget,i,null)):(Me(e,t,"encType",i.encType,i,null),Me(e,t,"method",i.method,i,null),Me(e,t,"target",i.target,i,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=eo(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=on);break;case"onScroll":l!=null&&ve("scroll",e);break;case"onScrollEnd":l!=null&&ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=eo(""+l),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":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""+l):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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":ve("beforetoggle",e),ve("toggle",e),Fi(e,"popover",l);break;case"xlinkActuate":an(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":an(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":an(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":an(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":an(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":an(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":an(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":an(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":an(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Fi(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=jy.get(n)||n,Fi(e,n,l))}}function wr(e,t,n,l,i,s){switch(n){case"style":cf(e,l,s);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(c(61));if(n=l.__html,n!=null){if(i.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof l=="string"?Zl(e,l):(typeof l=="number"||typeof l=="bigint")&&Zl(e,""+l);break;case"onScroll":l!=null&&ve("scroll",e);break;case"onScrollEnd":l!=null&&ve("scrollend",e);break;case"onClick":l!=null&&(e.onclick=on);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Pu.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),s=e[ct]||null,s=s!=null?s[n]:null,typeof s=="function"&&e.removeEventListener(t,s,i),typeof l=="function")){typeof s!="function"&&s!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,i);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):Fi(e,n,l)}}}function lt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ve("error",e),ve("load",e);var l=!1,i=!1,s;for(s in n)if(n.hasOwnProperty(s)){var d=n[s];if(d!=null)switch(s){case"src":l=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Me(e,t,s,d,n,null)}}i&&Me(e,t,"srcSet",n.srcSet,n,null),l&&Me(e,t,"src",n.src,n,null);return;case"input":ve("invalid",e);var g=s=d=i=null,N=null,R=null;for(l in n)if(n.hasOwnProperty(l)){var G=n[l];if(G!=null)switch(l){case"name":i=G;break;case"type":d=G;break;case"checked":N=G;break;case"defaultChecked":R=G;break;case"value":s=G;break;case"defaultValue":g=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(c(137,t));break;default:Me(e,t,l,G,n,null)}}lf(e,s,g,N,R,d,i,!1);return;case"select":ve("invalid",e),l=d=s=null;for(i in n)if(n.hasOwnProperty(i)&&(g=n[i],g!=null))switch(i){case"value":s=g;break;case"defaultValue":d=g;break;case"multiple":l=g;default:Me(e,t,i,g,n,null)}t=s,n=d,e.multiple=!!l,t!=null?Ql(e,!!l,t,!1):n!=null&&Ql(e,!!l,n,!0);return;case"textarea":ve("invalid",e),s=i=l=null;for(d in n)if(n.hasOwnProperty(d)&&(g=n[d],g!=null))switch(d){case"value":l=g;break;case"defaultValue":i=g;break;case"children":s=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(c(91));break;default:Me(e,t,d,g,n,null)}of(e,l,i,s);return;case"option":for(N in n)if(n.hasOwnProperty(N)&&(l=n[N],l!=null))switch(N){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Me(e,t,N,l,n,null)}return;case"dialog":ve("beforetoggle",e),ve("toggle",e),ve("cancel",e),ve("close",e);break;case"iframe":case"object":ve("load",e);break;case"video":case"audio":for(l=0;l<xi.length;l++)ve(xi[l],e);break;case"image":ve("error",e),ve("load",e);break;case"details":ve("toggle",e);break;case"embed":case"source":case"link":ve("error",e),ve("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(R in n)if(n.hasOwnProperty(R)&&(l=n[R],l!=null))switch(R){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:Me(e,t,R,l,n,null)}return;default:if(Ls(t)){for(G in n)n.hasOwnProperty(G)&&(l=n[G],l!==void 0&&wr(e,t,G,l,n,void 0));return}}for(g in n)n.hasOwnProperty(g)&&(l=n[g],l!=null&&Me(e,t,g,l,n,null))}function J0(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,s=null,d=null,g=null,N=null,R=null,G=null;for(L in n){var X=n[L];if(n.hasOwnProperty(L)&&X!=null)switch(L){case"checked":break;case"value":break;case"defaultValue":N=X;default:l.hasOwnProperty(L)||Me(e,t,L,null,l,X)}}for(var U in l){var L=l[U];if(X=n[U],l.hasOwnProperty(U)&&(L!=null||X!=null))switch(U){case"type":s=L;break;case"name":i=L;break;case"checked":R=L;break;case"defaultChecked":G=L;break;case"value":d=L;break;case"defaultValue":g=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(c(137,t));break;default:L!==X&&Me(e,t,U,L,l,X)}}Ds(e,d,g,N,R,G,s,i);return;case"select":L=d=g=U=null;for(s in n)if(N=n[s],n.hasOwnProperty(s)&&N!=null)switch(s){case"value":break;case"multiple":L=N;default:l.hasOwnProperty(s)||Me(e,t,s,null,l,N)}for(i in l)if(s=l[i],N=n[i],l.hasOwnProperty(i)&&(s!=null||N!=null))switch(i){case"value":U=s;break;case"defaultValue":g=s;break;case"multiple":d=s;default:s!==N&&Me(e,t,i,s,l,N)}t=g,n=d,l=L,U!=null?Ql(e,!!n,U,!1):!!l!=!!n&&(t!=null?Ql(e,!!n,t,!0):Ql(e,!!n,n?[]:"",!1));return;case"textarea":L=U=null;for(g in n)if(i=n[g],n.hasOwnProperty(g)&&i!=null&&!l.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:Me(e,t,g,null,l,i)}for(d in l)if(i=l[d],s=n[d],l.hasOwnProperty(d)&&(i!=null||s!=null))switch(d){case"value":U=i;break;case"defaultValue":L=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(c(91));break;default:i!==s&&Me(e,t,d,i,l,s)}af(e,U,L);return;case"option":for(var te in n)if(U=n[te],n.hasOwnProperty(te)&&U!=null&&!l.hasOwnProperty(te))switch(te){case"selected":e.selected=!1;break;default:Me(e,t,te,null,l,U)}for(N in l)if(U=l[N],L=n[N],l.hasOwnProperty(N)&&U!==L&&(U!=null||L!=null))switch(N){case"selected":e.selected=U&&typeof U!="function"&&typeof U!="symbol";break;default:Me(e,t,N,U,l,L)}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 ce in n)U=n[ce],n.hasOwnProperty(ce)&&U!=null&&!l.hasOwnProperty(ce)&&Me(e,t,ce,null,l,U);for(R in l)if(U=l[R],L=n[R],l.hasOwnProperty(R)&&U!==L&&(U!=null||L!=null))switch(R){case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(c(137,t));break;default:Me(e,t,R,U,l,L)}return;default:if(Ls(t)){for(var Oe in n)U=n[Oe],n.hasOwnProperty(Oe)&&U!==void 0&&!l.hasOwnProperty(Oe)&&wr(e,t,Oe,void 0,l,U);for(G in l)U=l[G],L=n[G],!l.hasOwnProperty(G)||U===L||U===void 0&&L===void 0||wr(e,t,G,U,l,L);return}}for(var _ in n)U=n[_],n.hasOwnProperty(_)&&U!=null&&!l.hasOwnProperty(_)&&Me(e,t,_,null,l,U);for(X in l)U=l[X],L=n[X],!l.hasOwnProperty(X)||U===L||U==null&&L==null||Me(e,t,X,U,l,L)}function rh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function W0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var i=n[l],s=i.transferSize,d=i.initiatorType,g=i.duration;if(s&&g&&rh(d)){for(d=0,g=i.responseEnd,l+=1;l<n.length;l++){var N=n[l],R=N.startTime;if(R>g)break;var G=N.transferSize,X=N.initiatorType;G&&rh(X)&&(N=N.responseEnd,d+=G*(N<g?1:(g-R)/(N-R)))}if(--l,t+=8*(s+d)/(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 Nr=null,Cr=null;function Wo(e){return e.nodeType===9?e:e.ownerDocument}function uh(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 fh(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 Ar(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 Tr=null;function F0(){var e=window.event;return e&&e.type==="popstate"?e===Tr?!1:(Tr=e,!0):(Tr=null,!1)}var dh=typeof setTimeout=="function"?setTimeout:void 0,P0=typeof clearTimeout=="function"?clearTimeout:void 0,mh=typeof Promise=="function"?Promise:void 0,I0=typeof queueMicrotask=="function"?queueMicrotask:typeof mh<"u"?function(e){return mh.resolve(null).then(e).catch(ev)}:dh;function ev(e){setTimeout(function(){throw e})}function tl(e){return e==="head"}function hh(e,t){var n=t,l=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(i),wa(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")Si(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Si(n);for(var s=n.firstChild;s;){var d=s.nextSibling,g=s.nodeName;s[Ba]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&s.rel.toLowerCase()==="stylesheet"||n.removeChild(s),s=d}}else n==="body"&&Si(e.ownerDocument.body);n=i}while(n);wa(t)}function ph(e,t){var n=e;e=0;do{var l=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||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function Er(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":Er(n),ks(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function tv(e,t,n,l){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Ba])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(s=e.getAttribute("rel"),s==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(s!==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(s=e.getAttribute("src"),(s!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&s&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var s=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===s)return e}else return e;if(e=Ht(e.nextSibling),e===null)break}return null}function nv(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Ht(e.nextSibling),e===null))return null;return e}function gh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ht(e.nextSibling),e===null))return null;return e}function zr(e){return e.data==="$?"||e.data==="$~"}function _r(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function lv(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Ht(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 Mr=null;function yh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Ht(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function vh(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 xh(e,t,n){switch(t=Wo(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 Si(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ks(e)}var Bt=new Map,bh=new Set;function Fo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var jn=D.d;D.d={f:av,r:iv,D:ov,C:sv,L:cv,m:rv,X:fv,S:uv,M:dv};function av(){var e=jn.f(),t=Vo();return e||t}function iv(e){var t=Vl(e);t!==null&&t.tag===5&&t.type==="form"?Ld(t):jn.r(e)}var ba=typeof document>"u"?null:document;function Sh(e,t,n){var l=ba;if(l&&typeof t=="string"&&t){var i=Mt(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),bh.has(i)||(bh.add(i),e={rel:e,crossOrigin:n,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),lt(t,"link",e),We(t),l.head.appendChild(t)))}}function ov(e){jn.D(e),Sh("dns-prefetch",e,null)}function sv(e,t){jn.C(e,t),Sh("preconnect",e,t)}function cv(e,t,n){jn.L(e,t,n);var l=ba;if(l&&e&&t){var i='link[rel="preload"][as="'+Mt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+Mt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+Mt(n.imageSizes)+'"]')):i+='[href="'+Mt(e)+'"]';var s=i;switch(t){case"style":s=Sa(e);break;case"script":s=ja(e)}Bt.has(s)||(e=b({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Bt.set(s,e),l.querySelector(i)!==null||t==="style"&&l.querySelector(ji(s))||t==="script"&&l.querySelector(wi(s))||(t=l.createElement("link"),lt(t,"link",e),We(t),l.head.appendChild(t)))}}function rv(e,t){jn.m(e,t);var n=ba;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Mt(l)+'"][href="'+Mt(e)+'"]',s=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":s=ja(e)}if(!Bt.has(s)&&(e=b({rel:"modulepreload",href:e},t),Bt.set(s,e),n.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(wi(s)))return}l=n.createElement("link"),lt(l,"link",e),We(l),n.head.appendChild(l)}}}function uv(e,t,n){jn.S(e,t,n);var l=ba;if(l&&e){var i=Yl(l).hoistableStyles,s=Sa(e);t=t||"default";var d=i.get(s);if(!d){var g={loading:0,preload:null};if(d=l.querySelector(ji(s)))g.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Bt.get(s))&&Or(e,n);var N=d=l.createElement("link");We(N),lt(N,"link",e),N._p=new Promise(function(R,G){N.onload=R,N.onerror=G}),N.addEventListener("load",function(){g.loading|=1}),N.addEventListener("error",function(){g.loading|=2}),g.loading|=4,Po(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:g},i.set(s,d)}}}function fv(e,t){jn.X(e,t);var n=ba;if(n&&e){var l=Yl(n).hoistableScripts,i=ja(e),s=l.get(i);s||(s=n.querySelector(wi(i)),s||(e=b({src:e,async:!0},t),(t=Bt.get(i))&&kr(e,t),s=n.createElement("script"),We(s),lt(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(i,s))}}function dv(e,t){jn.M(e,t);var n=ba;if(n&&e){var l=Yl(n).hoistableScripts,i=ja(e),s=l.get(i);s||(s=n.querySelector(wi(i)),s||(e=b({src:e,async:!0,type:"module"},t),(t=Bt.get(i))&&kr(e,t),s=n.createElement("script"),We(s),lt(s,"link",e),n.head.appendChild(s)),s={type:"script",instance:s,count:1,state:null},l.set(i,s))}}function jh(e,t,n,l){var i=(i=zt.current)?Fo(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=Sa(n.href),n=Yl(i).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Sa(n.href);var s=Yl(i).hoistableStyles,d=s.get(e);if(d||(i=i.ownerDocument||i,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},s.set(e,d),(s=i.querySelector(ji(e)))&&!s._p&&(d.instance=s,d.state.loading=5),Bt.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},Bt.set(e,n),s||mv(i,e,n,d.state))),t&&l===null)throw Error(c(528,""));return d}if(t&&l!==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=ja(n),n=Yl(i).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Sa(e){return'href="'+Mt(e)+'"'}function ji(e){return'link[rel="stylesheet"]['+e+"]"}function wh(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function mv(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),lt(t,"link",n),We(t),e.head.appendChild(t))}function ja(e){return'[src="'+Mt(e)+'"]'}function wi(e){return"script[async]"+e}function Nh(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Mt(n.href)+'"]');if(l)return t.instance=l,We(l),l;var i=b({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),We(l),lt(l,"style",i),Po(l,n.precedence,e),t.instance=l;case"stylesheet":i=Sa(n.href);var s=e.querySelector(ji(i));if(s)return t.state.loading|=4,t.instance=s,We(s),s;l=wh(n),(i=Bt.get(i))&&Or(l,i),s=(e.ownerDocument||e).createElement("link"),We(s);var d=s;return d._p=new Promise(function(g,N){d.onload=g,d.onerror=N}),lt(s,"link",l),t.state.loading|=4,Po(s,n.precedence,e),t.instance=s;case"script":return s=ja(n.src),(i=e.querySelector(wi(s)))?(t.instance=i,We(i),i):(l=n,(i=Bt.get(s))&&(l=b({},n),kr(l,i)),e=e.ownerDocument||e,i=e.createElement("script"),We(i),lt(i,"link",l),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&&(l=t.instance,t.state.loading|=4,Po(l,n.precedence,e));return t.instance}function Po(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,s=i,d=0;d<l.length;d++){var g=l[d];if(g.dataset.precedence===t)s=g;else if(s!==i)break}s?s.parentNode.insertBefore(e,s.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Or(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function kr(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Io=null;function Ch(e,t,n){if(Io===null){var l=new Map,i=Io=new Map;i.set(n,l)}else i=Io,l=i.get(n),l||(l=new Map,i.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var s=n[i];if(!(s[Ba]||s[Ie]||e==="link"&&s.getAttribute("rel")==="stylesheet")&&s.namespaceURI!=="http://www.w3.org/2000/svg"){var d=s.getAttribute(t)||"";d=e+d;var g=l.get(d);g?g.push(s):l.set(d,[s])}}return l}function Ah(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function hv(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 Th(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function pv(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=Sa(l.href),s=t.querySelector(ji(i));if(s){t=s._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=es.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=s,We(s);return}s=t.ownerDocument||t,l=wh(l),(i=Bt.get(i))&&Or(l,i),s=s.createElement("link"),We(s);var d=s;d._p=new Promise(function(g,N){d.onload=g,d.onerror=N}),lt(s,"link",l),n.instance=s}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=es.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Rr=0;function gv(e,t){return e.stylesheets&&e.count===0&&ns(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&ns(e,e.stylesheets),e.unsuspend){var s=e.unsuspend;e.unsuspend=null,s()}},6e4+t);0<e.imgBytes&&Rr===0&&(Rr=62500*W0());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ns(e,e.stylesheets),e.unsuspend)){var s=e.unsuspend;e.unsuspend=null,s()}},(e.imgBytes>Rr?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function es(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ns(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ts=null;function ns(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ts=new Map,t.forEach(yv,e),ts=null,es.call(e))}function yv(e,t){if(!(t.state.loading&4)){var n=ts.get(e);if(n)var l=n.get(null);else{n=new Map,ts.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),s=0;s<i.length;s++){var d=i[s];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(n.set(d.dataset.precedence,d),l=d)}l&&n.set(null,l)}i=t.instance,d=i.getAttribute("data-precedence"),s=n.get(d)||l,s===l&&n.set(null,i),n.set(d,i),this.count++,l=es.bind(this),i.addEventListener("load",l),i.addEventListener("error",l),s?s.parentNode.insertBefore(i,s.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Ni={$$typeof:q,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function vv(e,t,n,l,i,s,d,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=zs(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zs(0),this.hiddenUpdates=zs(null),this.identifierPrefix=l,this.onUncaughtError=i,this.onCaughtError=s,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function Eh(e,t,n,l,i,s,d,g,N,R,G,X){return e=new vv(e,t,n,d,N,R,G,X,g),t=1,s===!0&&(t|=24),s=bt(3,null,null,t),e.current=s,s.stateNode=e,t=mc(),t.refCount++,e.pooledCache=t,t.refCount++,s.memoizedState={element:l,isDehydrated:n,cache:t},yc(s),e}function zh(e){return e?(e=Il,e):Il}function _h(e,t,n,l,i,s){i=zh(i),l.context===null?l.context=i:l.pendingContext=i,l=Xn(t),l.payload={element:n},s=s===void 0?null:s,s!==null&&(l.callback=s),n=Qn(e,l,t),n!==null&&(ht(n,e,t),ni(n,e,t))}function Mh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Dr(e,t){Mh(e,t),(e=e.alternate)&&Mh(e,t)}function Oh(e){if(e.tag===13||e.tag===31){var t=bl(e,67108864);t!==null&&ht(t,e,67108864),Dr(e,67108864)}}function kh(e){if(e.tag===13||e.tag===31){var t=Ct();t=_s(t);var n=bl(e,t);n!==null&&ht(n,e,t),Dr(e,t)}}var ls=!0;function xv(e,t,n,l){var i=A.T;A.T=null;var s=D.p;try{D.p=2,Ur(e,t,n,l)}finally{D.p=s,A.T=i}}function bv(e,t,n,l){var i=A.T;A.T=null;var s=D.p;try{D.p=8,Ur(e,t,n,l)}finally{D.p=s,A.T=i}}function Ur(e,t,n,l){if(ls){var i=Lr(l);if(i===null)jr(e,t,l,as,n),Dh(e,l);else if(jv(i,e,t,n,l))l.stopPropagation();else if(Dh(e,l),t&4&&-1<Sv.indexOf(e)){for(;i!==null;){var s=Vl(i);if(s!==null)switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var d=pl(s.pendingLanes);if(d!==0){var g=s;for(g.pendingLanes|=2,g.entangledLanes|=2;d;){var N=1<<31-vt(d);g.entanglements[1]|=N,d&=~N}en(s),(Ae&6)===0&&(qo=gt()+500,vi(0))}}break;case 31:case 13:g=bl(s,2),g!==null&&ht(g,s,2),Vo(),Dr(s,2)}if(s=Lr(l),s===null&&jr(e,t,l,as,n),s===i)break;i=s}i!==null&&l.stopPropagation()}else jr(e,t,l,null,n)}}function Lr(e){return e=Bs(e),Hr(e)}var as=null;function Hr(e){if(as=null,e=Gl(e),e!==null){var t=f(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 as=e,null}function Rh(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(oy()){case Gu:return 2;case Vu:return 8;case Zi:case sy:return 32;case Yu:return 268435456;default:return 32}default:return 32}}var Br=!1,nl=null,ll=null,al=null,Ci=new Map,Ai=new Map,il=[],Sv="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 Dh(e,t){switch(e){case"focusin":case"focusout":nl=null;break;case"dragenter":case"dragleave":ll=null;break;case"mouseover":case"mouseout":al=null;break;case"pointerover":case"pointerout":Ci.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ai.delete(t.pointerId)}}function Ti(e,t,n,l,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Vl(t),t!==null&&Oh(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function jv(e,t,n,l,i){switch(t){case"focusin":return nl=Ti(nl,e,t,n,l,i),!0;case"dragenter":return ll=Ti(ll,e,t,n,l,i),!0;case"mouseover":return al=Ti(al,e,t,n,l,i),!0;case"pointerover":var s=i.pointerId;return Ci.set(s,Ti(Ci.get(s)||null,e,t,n,l,i)),!0;case"gotpointercapture":return s=i.pointerId,Ai.set(s,Ti(Ai.get(s)||null,e,t,n,l,i)),!0}return!1}function Uh(e){var t=Gl(e.target);if(t!==null){var n=f(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,Ju(e.priority,function(){kh(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,Ju(e.priority,function(){kh(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 is(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Lr(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);Hs=l,n.target.dispatchEvent(l),Hs=null}else return t=Vl(n),t!==null&&Oh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){is(e)&&n.delete(t)}function wv(){Br=!1,nl!==null&&is(nl)&&(nl=null),ll!==null&&is(ll)&&(ll=null),al!==null&&is(al)&&(al=null),Ci.forEach(Lh),Ai.forEach(Lh)}function os(e,t){e.blockedOn===t&&(e.blockedOn=null,Br||(Br=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,wv)))}var ss=null;function Hh(e){ss!==e&&(ss=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){ss===e&&(ss=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],i=e[t+2];if(typeof l!="function"){if(Hr(l||n)===null)continue;break}var s=Vl(n);s!==null&&(e.splice(t,3),t-=3,Lc(s,{pending:!0,data:i,method:n.method,action:l},l,i))}}))}function wa(e){function t(N){return os(N,e)}nl!==null&&os(nl,e),ll!==null&&os(ll,e),al!==null&&os(al,e),Ci.forEach(t),Ai.forEach(t);for(var n=0;n<il.length;n++){var l=il[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<il.length&&(n=il[0],n.blockedOn===null);)Uh(n),n.blockedOn===null&&il.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var i=n[l],s=n[l+1],d=i[ct]||null;if(typeof s=="function")d||Hh(n);else if(d){var g=null;if(s&&s.hasAttribute("formAction")){if(i=s,d=s[ct]||null)g=d.formAction;else if(Hr(i)!==null)continue}else g=d.action;typeof g=="function"?n[l+1]=g:(n.splice(l,3),l-=3),Hh(n)}}}function Bh(){function e(s){s.canIntercept&&s.info==="react-transition"&&s.intercept({handler:function(){return new Promise(function(d){return i=d})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var s=navigation.currentEntry;s&&s.url!=null&&navigation.navigate(s.url,{state:s.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function qr(e){this._internalRoot=e}cs.prototype.render=qr.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,l=Ct();_h(n,l,e,t,null,null)},cs.prototype.unmount=qr.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_h(e.current,2,null,e,null,null),Vo(),t[ql]=null}};function cs(e){this._internalRoot=e}cs.prototype.unstable_scheduleHydration=function(e){if(e){var t=$u();e={blockedOn:null,target:e,priority:t};for(var n=0;n<il.length&&t!==0&&t<il[n].priority;n++);il.splice(n,0,e),n===0&&Uh(e)}};var qh=o.version;if(qh!=="19.2.8")throw Error(c(527,qh,"19.2.8"));D.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=v(t),e=e!==null?j(e):null,e=e===null?null:e.stateNode,e};var Nv={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rs.isDisabled&&rs.supportsFiber)try{Ua=rs.inject(Nv),yt=rs}catch{}}return zi.createRoot=function(e,t){if(!m(e))throw Error(c(299));var n=!1,l="",i=Kd,s=$d,d=Jd;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Eh(e,1,!1,null,null,n,l,null,i,s,d,Bh),e[ql]=t.current,Sr(e),new qr(t)},zi.hydrateRoot=function(e,t,n){if(!m(e))throw Error(c(299));var l=!1,i="",s=Kd,d=$d,g=Jd,N=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(s=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(g=n.onRecoverableError),n.formState!==void 0&&(N=n.formState)),t=Eh(e,1,!0,t,n??null,l,i,N,s,d,g,Bh),t.context=zh(null),n=t.current,l=Ct(),l=_s(l),i=Xn(l),i.callback=null,Qn(n,i,l),n=l,t.current.lanes=n,Ha(t,n),en(t),e[ql]=t.current,Sr(e),new cs(t)},zi.version="19.2.8",zi}var Zh;function Kv(){if(Zh)return Vr.exports;Zh=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(o){console.error(o)}}return a(),Vr.exports=Zv(),Vr.exports}var $v=Kv();/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Jv=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_p=(...a)=>a.filter((o,r,c)=>!!o&&o.trim()!==""&&c.indexOf(o)===r).join(" ").trim();/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var Wv={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Fv=S.forwardRef(({color:a="currentColor",size:o=24,strokeWidth:r=2,absoluteStrokeWidth:c,className:m="",children:f,iconNode:h,...p},y)=>S.createElement("svg",{ref:y,...Wv,width:o,height:o,stroke:a,strokeWidth:c?Number(r)*24/Number(o):r,className:_p("lucide",m),...p},[...h.map(([v,j])=>S.createElement(v,j)),...Array.isArray(f)?f:[f]]));/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fe=(a,o)=>{const r=S.forwardRef(({className:c,...m},f)=>S.createElement(Fv,{ref:f,iconNode:o,className:_p(`lucide-${Jv(a)}`,c),...m}));return r.displayName=`${a}`,r};/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const eu=fe("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Pv=fe("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Iv=fe("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ex=fe("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Mp=fe("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const tu=fe("Cable",[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gu=fe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Op=fe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const tx=fe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const kp=fe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const nx=fe("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const yu=fe("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vu=fe("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lx=fe("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ax=fe("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ix=fe("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ox=fe("FileCog",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m3.2 12.9-.9-.4",key:"1i3dj5"}],["path",{d:"m3.2 15.1-.9.4",key:"1fvgj0"}],["path",{d:"M4.677 21.5a2 2 0 0 0 1.313.5H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v2.5",key:"1yo3oz"}],["path",{d:"m4.9 11.2-.4-.9",key:"otmhb9"}],["path",{d:"m4.9 16.8-.4.9",key:"1b8z07"}],["path",{d:"m7.5 10.3-.4.9",key:"11k65u"}],["path",{d:"m7.5 17.7-.4-.9",key:"431x55"}],["path",{d:"m9.7 12.5-.9.4",key:"87sjan"}],["path",{d:"m9.7 15.5-.9-.4",key:"khqm91"}],["circle",{cx:"6",cy:"14",r:"3",key:"a1xfv6"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xu=fe("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const sx=fe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const cx=fe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const rx=fe("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ux=fe("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Rp=fe("ListChecks",[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Dp=fe("ListPlus",[["path",{d:"M11 12H3",key:"51ecnj"}],["path",{d:"M16 6H3",key:"1wxfjs"}],["path",{d:"M16 18H3",key:"12xzn7"}],["path",{d:"M18 9v6",key:"1twb98"}],["path",{d:"M21 12h-6",key:"bt1uis"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const nu=fe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fx=fe("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Up=fe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const dx=fe("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mx=fe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const hx=fe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const px=fe("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Kh=fe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ki=fe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gx=fe("Repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ri=fe("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const yx=fe("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vx=fe("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const $h=fe("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xx=fe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const bx=fe("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Jh=fe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const bu=fe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Lp=fe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Sx=fe("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);class jx extends Error{}async function Gt(a,o={}){const r=await fetch(a,{headers:{"Content-Type":"application/json",...o.headers||{}},...o,cache:"no-store"});if(!r.ok){let c="";try{const m=await r.json();c=typeof m.detail=="string"?m.detail:""}catch{}throw new jx(c||`${r.status} ${r.statusText}`)}return r.json()}function wx(){return Gt("/admin/api/config")}function Wh(a){return Gt("/admin/api/config/validate",{method:"POST",body:JSON.stringify({values:a})})}function Nx(a){return Gt("/admin/api/config/apply",{method:"POST",body:JSON.stringify({values:a})})}async function Cx(){return Gt("/admin/api/providers/local-status")}function Fh(a){return Gt(`/admin/api/providers/${a}/test`,{method:"POST",body:"{}"})}function Ph(a){return Gt(`/admin/api/providers/${a}/auth`)}function Ax(a,o){return Gt(`/admin/api/providers/${a}/auth/login`,{method:"POST",body:JSON.stringify({mode:o})})}function Tx(a){return Gt(`/admin/api/providers/${a}/auth/cancel`,{method:"POST"})}function Ex(a){return Gt(`/admin/api/providers/${a}/auth`,{method:"DELETE"})}function Ih(a=!1){return Gt(a?"/admin/api/models/refresh":"/admin/api/models",{method:a?"POST":"GET"})}function zx(a){return Gt(`/admin/api/pools/${encodeURIComponent(a)}`)}function _x(){return Gt("/admin/api/usage")}const Su="-",Mx=a=>{const o=kx(a),{conflictingClassGroups:r,conflictingClassGroupModifiers:c}=a;return{getClassGroupId:h=>{const p=h.split(Su);return p[0]===""&&p.length!==1&&p.shift(),Hp(p,o)||Ox(h)},getConflictingClassGroupIds:(h,p)=>{const y=r[h]||[];return p&&c[h]?[...y,...c[h]]:y}}},Hp=(a,o)=>{var h;if(a.length===0)return o.classGroupId;const r=a[0],c=o.nextPart.get(r),m=c?Hp(a.slice(1),c):void 0;if(m)return m;if(o.validators.length===0)return;const f=a.join(Su);return(h=o.validators.find(({validator:p})=>p(f)))==null?void 0:h.classGroupId},ep=/^\[(.+)\]$/,Ox=a=>{if(ep.test(a)){const o=ep.exec(a)[1],r=o==null?void 0:o.substring(0,o.indexOf(":"));if(r)return"arbitrary.."+r}},kx=a=>{const{theme:o,prefix:r}=a,c={nextPart:new Map,validators:[]};return Dx(Object.entries(a.classGroups),r).forEach(([f,h])=>{lu(h,c,f,o)}),c},lu=(a,o,r,c)=>{a.forEach(m=>{if(typeof m=="string"){const f=m===""?o:tp(o,m);f.classGroupId=r;return}if(typeof m=="function"){if(Rx(m)){lu(m(c),o,r,c);return}o.validators.push({validator:m,classGroupId:r});return}Object.entries(m).forEach(([f,h])=>{lu(h,tp(o,f),r,c)})})},tp=(a,o)=>{let r=a;return o.split(Su).forEach(c=>{r.nextPart.has(c)||r.nextPart.set(c,{nextPart:new Map,validators:[]}),r=r.nextPart.get(c)}),r},Rx=a=>a.isThemeGetter,Dx=(a,o)=>o?a.map(([r,c])=>{const m=c.map(f=>typeof f=="string"?o+f:typeof f=="object"?Object.fromEntries(Object.entries(f).map(([h,p])=>[o+h,p])):f);return[r,m]}):a,Ux=a=>{if(a<1)return{get:()=>{},set:()=>{}};let o=0,r=new Map,c=new Map;const m=(f,h)=>{r.set(f,h),o++,o>a&&(o=0,c=r,r=new Map)};return{get(f){let h=r.get(f);if(h!==void 0)return h;if((h=c.get(f))!==void 0)return m(f,h),h},set(f,h){r.has(f)?r.set(f,h):m(f,h)}}},Bp="!",Lx=a=>{const{separator:o,experimentalParseClassName:r}=a,c=o.length===1,m=o[0],f=o.length,h=p=>{const y=[];let v=0,j=0,b;for(let O=0;O<p.length;O++){let k=p[O];if(v===0){if(k===m&&(c||p.slice(O,O+f)===o)){y.push(p.slice(j,O)),j=O+f;continue}if(k==="/"){b=O;continue}}k==="["?v++:k==="]"&&v--}const x=y.length===0?p:p.substring(j),C=x.startsWith(Bp),w=C?x.substring(1):x,E=b&&b>j?b-j:void 0;return{modifiers:y,hasImportantModifier:C,baseClassName:w,maybePostfixModifierPosition:E}};return r?p=>r({className:p,parseClassName:h}):h},Hx=a=>{if(a.length<=1)return a;const o=[];let r=[];return a.forEach(c=>{c[0]==="["?(o.push(...r.sort(),c),r=[]):r.push(c)}),o.push(...r.sort()),o},Bx=a=>({cache:Ux(a.cacheSize),parseClassName:Lx(a),...Mx(a)}),qx=/\s+/,Gx=(a,o)=>{const{parseClassName:r,getClassGroupId:c,getConflictingClassGroupIds:m}=o,f=[],h=a.trim().split(qx);let p="";for(let y=h.length-1;y>=0;y-=1){const v=h[y],{modifiers:j,hasImportantModifier:b,baseClassName:x,maybePostfixModifierPosition:C}=r(v);let w=!!C,E=c(w?x.substring(0,C):x);if(!E){if(!w){p=v+(p.length>0?" "+p:p);continue}if(E=c(x),!E){p=v+(p.length>0?" "+p:p);continue}w=!1}const O=Hx(j).join(":"),k=b?O+Bp:O,B=k+E;if(f.includes(B))continue;f.push(B);const q=m(E,w);for(let Z=0;Z<q.length;++Z){const V=q[Z];f.push(k+V)}p=v+(p.length>0?" "+p:p)}return p};function Vx(){let a=0,o,r,c="";for(;a<arguments.length;)(o=arguments[a++])&&(r=qp(o))&&(c&&(c+=" "),c+=r);return c}const qp=a=>{if(typeof a=="string")return a;let o,r="";for(let c=0;c<a.length;c++)a[c]&&(o=qp(a[c]))&&(r&&(r+=" "),r+=o);return r};function Yx(a,...o){let r,c,m,f=h;function h(y){const v=o.reduce((j,b)=>b(j),a());return r=Bx(v),c=r.cache.get,m=r.cache.set,f=p,p(y)}function p(y){const v=c(y);if(v)return v;const j=Gx(y,r);return m(y,j),j}return function(){return f(Vx.apply(null,arguments))}}const Ue=a=>{const o=r=>r[a]||[];return o.isThemeGetter=!0,o},Gp=/^\[(?:([a-z-]+):)?(.+)\]$/i,Xx=/^\d+\/\d+$/,Qx=new Set(["px","full","screen"]),Zx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Kx=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,$x=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Jx=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Wx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wn=a=>Ta(a)||Qx.has(a)||Xx.test(a),sl=a=>za(a,"length",a1),Ta=a=>!!a&&!Number.isNaN(Number(a)),Qr=a=>za(a,"number",Ta),_i=a=>!!a&&Number.isInteger(Number(a)),Fx=a=>a.endsWith("%")&&Ta(a.slice(0,-1)),he=a=>Gp.test(a),cl=a=>Zx.test(a),Px=new Set(["length","size","percentage"]),Ix=a=>za(a,Px,Vp),e1=a=>za(a,"position",Vp),t1=new Set(["image","url"]),n1=a=>za(a,t1,o1),l1=a=>za(a,"",i1),Mi=()=>!0,za=(a,o,r)=>{const c=Gp.exec(a);return c?c[1]?typeof o=="string"?c[1]===o:o.has(c[1]):r(c[2]):!1},a1=a=>Kx.test(a)&&!$x.test(a),Vp=()=>!1,i1=a=>Jx.test(a),o1=a=>Wx.test(a),s1=()=>{const a=Ue("colors"),o=Ue("spacing"),r=Ue("blur"),c=Ue("brightness"),m=Ue("borderColor"),f=Ue("borderRadius"),h=Ue("borderSpacing"),p=Ue("borderWidth"),y=Ue("contrast"),v=Ue("grayscale"),j=Ue("hueRotate"),b=Ue("invert"),x=Ue("gap"),C=Ue("gradientColorStops"),w=Ue("gradientColorStopPositions"),E=Ue("inset"),O=Ue("margin"),k=Ue("opacity"),B=Ue("padding"),q=Ue("saturate"),Z=Ue("scale"),V=Ue("sepia"),z=Ue("skew"),Q=Ue("space"),W=Ue("translate"),ne=()=>["auto","contain","none"],le=()=>["auto","hidden","clip","visible","scroll"],re=()=>["auto",he,o],$=()=>[he,o],F=()=>["",wn,sl],ie=()=>["auto",Ta,he],J=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],A=()=>["solid","dashed","dotted","double","none"],D=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],H=()=>["start","end","center","between","around","evenly","stretch"],P=()=>["","0",he],se=()=>["auto","avoid","all","avoid-page","page","left","right","column"],je=()=>[Ta,he];return{cacheSize:500,separator:":",theme:{colors:[Mi],spacing:[wn,sl],blur:["none","",cl,he],brightness:je(),borderColor:[a],borderRadius:["none","","full",cl,he],borderSpacing:$(),borderWidth:F(),contrast:je(),grayscale:P(),hueRotate:je(),invert:P(),gap:$(),gradientColorStops:[a],gradientColorStopPositions:[Fx,sl],inset:re(),margin:re(),opacity:je(),padding:$(),saturate:je(),scale:je(),sepia:P(),skew:je(),space:$(),translate:$()},classGroups:{aspect:[{aspect:["auto","square","video",he]}],container:["container"],columns:[{columns:[cl]}],"break-after":[{"break-after":se()}],"break-before":[{"break-before":se()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...J(),he]}],overflow:[{overflow:le()}],"overflow-x":[{"overflow-x":le()}],"overflow-y":[{"overflow-y":le()}],overscroll:[{overscroll:ne()}],"overscroll-x":[{"overscroll-x":ne()}],"overscroll-y":[{"overscroll-y":ne()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[E]}],"inset-x":[{"inset-x":[E]}],"inset-y":[{"inset-y":[E]}],start:[{start:[E]}],end:[{end:[E]}],top:[{top:[E]}],right:[{right:[E]}],bottom:[{bottom:[E]}],left:[{left:[E]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",_i,he]}],basis:[{basis:re()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",he]}],grow:[{grow:P()}],shrink:[{shrink:P()}],order:[{order:["first","last","none",_i,he]}],"grid-cols":[{"grid-cols":[Mi]}],"col-start-end":[{col:["auto",{span:["full",_i,he]},he]}],"col-start":[{"col-start":ie()}],"col-end":[{"col-end":ie()}],"grid-rows":[{"grid-rows":[Mi]}],"row-start-end":[{row:["auto",{span:[_i,he]},he]}],"row-start":[{"row-start":ie()}],"row-end":[{"row-end":ie()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",he]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",he]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...H()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...H(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...H(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[B]}],px:[{px:[B]}],py:[{py:[B]}],ps:[{ps:[B]}],pe:[{pe:[B]}],pt:[{pt:[B]}],pr:[{pr:[B]}],pb:[{pb:[B]}],pl:[{pl:[B]}],m:[{m:[O]}],mx:[{mx:[O]}],my:[{my:[O]}],ms:[{ms:[O]}],me:[{me:[O]}],mt:[{mt:[O]}],mr:[{mr:[O]}],mb:[{mb:[O]}],ml:[{ml:[O]}],"space-x":[{"space-x":[Q]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Q]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",he,o]}],"min-w":[{"min-w":[he,o,"min","max","fit"]}],"max-w":[{"max-w":[he,o,"none","full","min","max","fit","prose",{screen:[cl]},cl]}],h:[{h:[he,o,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[he,o,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[he,o,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[he,o,"auto","min","max","fit"]}],"font-size":[{text:["base",cl,sl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Qr]}],"font-family":[{font:[Mi]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",he]}],"line-clamp":[{"line-clamp":["none",Ta,Qr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",wn,he]}],"list-image":[{"list-image":["none",he]}],"list-style-type":[{list:["none","disc","decimal",he]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[a]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[a]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...A(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",wn,sl]}],"underline-offset":[{"underline-offset":["auto",wn,he]}],"text-decoration-color":[{decoration:[a]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:$()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...J(),e1]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ix]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},n1]}],"bg-color":[{bg:[a]}],"gradient-from-pos":[{from:[w]}],"gradient-via-pos":[{via:[w]}],"gradient-to-pos":[{to:[w]}],"gradient-from":[{from:[C]}],"gradient-via":[{via:[C]}],"gradient-to":[{to:[C]}],rounded:[{rounded:[f]}],"rounded-s":[{"rounded-s":[f]}],"rounded-e":[{"rounded-e":[f]}],"rounded-t":[{"rounded-t":[f]}],"rounded-r":[{"rounded-r":[f]}],"rounded-b":[{"rounded-b":[f]}],"rounded-l":[{"rounded-l":[f]}],"rounded-ss":[{"rounded-ss":[f]}],"rounded-se":[{"rounded-se":[f]}],"rounded-ee":[{"rounded-ee":[f]}],"rounded-es":[{"rounded-es":[f]}],"rounded-tl":[{"rounded-tl":[f]}],"rounded-tr":[{"rounded-tr":[f]}],"rounded-br":[{"rounded-br":[f]}],"rounded-bl":[{"rounded-bl":[f]}],"border-w":[{border:[p]}],"border-w-x":[{"border-x":[p]}],"border-w-y":[{"border-y":[p]}],"border-w-s":[{"border-s":[p]}],"border-w-e":[{"border-e":[p]}],"border-w-t":[{"border-t":[p]}],"border-w-r":[{"border-r":[p]}],"border-w-b":[{"border-b":[p]}],"border-w-l":[{"border-l":[p]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...A(),"hidden"]}],"divide-x":[{"divide-x":[p]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[p]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:A()}],"border-color":[{border:[m]}],"border-color-x":[{"border-x":[m]}],"border-color-y":[{"border-y":[m]}],"border-color-s":[{"border-s":[m]}],"border-color-e":[{"border-e":[m]}],"border-color-t":[{"border-t":[m]}],"border-color-r":[{"border-r":[m]}],"border-color-b":[{"border-b":[m]}],"border-color-l":[{"border-l":[m]}],"divide-color":[{divide:[m]}],"outline-style":[{outline:["",...A()]}],"outline-offset":[{"outline-offset":[wn,he]}],"outline-w":[{outline:[wn,sl]}],"outline-color":[{outline:[a]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[a]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[wn,sl]}],"ring-offset-color":[{"ring-offset":[a]}],shadow:[{shadow:["","inner","none",cl,l1]}],"shadow-color":[{shadow:[Mi]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...D(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":D()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[c]}],contrast:[{contrast:[y]}],"drop-shadow":[{"drop-shadow":["","none",cl,he]}],grayscale:[{grayscale:[v]}],"hue-rotate":[{"hue-rotate":[j]}],invert:[{invert:[b]}],saturate:[{saturate:[q]}],sepia:[{sepia:[V]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[c]}],"backdrop-contrast":[{"backdrop-contrast":[y]}],"backdrop-grayscale":[{"backdrop-grayscale":[v]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[j]}],"backdrop-invert":[{"backdrop-invert":[b]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[q]}],"backdrop-sepia":[{"backdrop-sepia":[V]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[h]}],"border-spacing-x":[{"border-spacing-x":[h]}],"border-spacing-y":[{"border-spacing-y":[h]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",he]}],duration:[{duration:je()}],ease:[{ease:["linear","in","out","in-out",he]}],delay:[{delay:je()}],animate:[{animate:["none","spin","ping","pulse","bounce",he]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[Z]}],"scale-x":[{"scale-x":[Z]}],"scale-y":[{"scale-y":[Z]}],rotate:[{rotate:[_i,he]}],"translate-x":[{"translate-x":[W]}],"translate-y":[{"translate-y":[W]}],"skew-x":[{"skew-x":[z]}],"skew-y":[{"skew-y":[z]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",he]}],accent:[{accent:["auto",a]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he]}],"caret-color":[{caret:[a]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":$()}],"scroll-mx":[{"scroll-mx":$()}],"scroll-my":[{"scroll-my":$()}],"scroll-ms":[{"scroll-ms":$()}],"scroll-me":[{"scroll-me":$()}],"scroll-mt":[{"scroll-mt":$()}],"scroll-mr":[{"scroll-mr":$()}],"scroll-mb":[{"scroll-mb":$()}],"scroll-ml":[{"scroll-ml":$()}],"scroll-p":[{"scroll-p":$()}],"scroll-px":[{"scroll-px":$()}],"scroll-py":[{"scroll-py":$()}],"scroll-ps":[{"scroll-ps":$()}],"scroll-pe":[{"scroll-pe":$()}],"scroll-pt":[{"scroll-pt":$()}],"scroll-pr":[{"scroll-pr":$()}],"scroll-pb":[{"scroll-pb":$()}],"scroll-pl":[{"scroll-pl":$()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he]}],fill:[{fill:[a,"none"]}],"stroke-w":[{stroke:[wn,sl,Qr]}],stroke:[{stroke:[a,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},c1=Yx(s1);function ge(...a){return c1(Tp(a))}const np=a=>typeof a=="boolean"?`${a}`:a===0?"0":a,lp=Tp,Yp=(a,o)=>r=>{var c;if((o==null?void 0:o.variants)==null)return lp(a,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:m,defaultVariants:f}=o,h=Object.keys(m).map(v=>{const j=r==null?void 0:r[v],b=f==null?void 0:f[v];if(j===null)return null;const x=np(j)||np(b);return m[v][x]}),p=r&&Object.entries(r).reduce((v,j)=>{let[b,x]=j;return x===void 0||(v[b]=x),v},{}),y=o==null||(c=o.compoundVariants)===null||c===void 0?void 0:c.reduce((v,j)=>{let{class:b,className:x,...C}=j;return Object.entries(C).every(w=>{let[E,O]=w;return Array.isArray(O)?O.includes({...f,...p}[E]):{...f,...p}[E]===O})?[...v,b,x]:v},[]);return lp(a,h,y,r==null?void 0:r.class,r==null?void 0:r.className)},r1=Yp("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",ok:"border-transparent bg-emerald-100 text-emerald-800",warn:"border-transparent bg-amber-100 text-amber-800",error:"border-transparent bg-red-100 text-red-800",neutral:"border-transparent bg-muted text-muted-foreground",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function at({className:a,variant:o,...r}){return u.jsx("span",{"data-slot":"badge",className:ge(r1({variant:o}),a),...r})}var u1=Object.defineProperty,ju=(a,o)=>u1(a,"name",{value:o,configurable:!0});function au(a,o){if(typeof a=="function")return a(o);a!=null&&(a.current=o)}ju(au,"setRef");function Xp(...a){return o=>{let r=!1;const c=a.map(m=>{const f=au(m,o);return!r&&typeof f=="function"&&(r=!0),f});if(r)return()=>{for(let m=0;m<c.length;m++){const f=c[m];typeof f=="function"?f():au(a[m],null)}}}}ju(Xp,"composeRefs");function On(...a){return S.useCallback(Xp(...a),a)}ju(On,"useComposedRefs");var f1=Object.defineProperty,Jt=(a,o)=>f1(a,"name",{value:o,configurable:!0});function wu(a){const o=S.forwardRef((r,c)=>{let{children:m,...f}=r,h=null,p=!1;const y=[];iu(m)&&typeof us=="function"&&(m=us(m._payload)),S.Children.forEach(m,x=>{var C;if(Jp(x)){p=!0;const w=x;let E="child"in w.props?w.props.child:w.props.children;iu(E)&&typeof us=="function"&&(E=us(E._payload)),h=m1(w,E),y.push((C=h==null?void 0:h.props)==null?void 0:C.children)}else y.push(x)}),h?h=S.cloneElement(h,void 0,y):!p&&S.Children.count(m)===1&&S.isValidElement(m)&&(h=m);const v=h?$p(h):void 0,j=On(c,v);if(!h){if(m||m===0)throw new Error(p?g1(a):p1(a));return m}const b=Kp(f,h.props??{});return h.type!==S.Fragment&&(b.ref=c?j:v),S.cloneElement(h,b)});return o.displayName=`${a}.Slot`,o}Jt(wu,"createSlot");var d1=wu("Slot"),Qp=Symbol.for("radix.slottable");function Zp(a){const o=Jt(r=>"child"in r?r.children(r.child):r.children,"Slottable");return o.displayName=`${a}.Slottable`,o.__radixId=Qp,o}Jt(Zp,"createSlottable");var m1=Jt((a,o)=>{if("child"in a.props){const r=a.props.child;return S.isValidElement(r)?S.cloneElement(r,void 0,a.props.children(r.props.children)):null}return S.isValidElement(o)?o:null},"getSlottableElementFromSlottable");function Kp(a,o){const r={...o};for(const c in o){const m=a[c],f=o[c];/^on[A-Z]/.test(c)?m&&f?r[c]=(...p)=>{const y=f(...p);return m(...p),y}:m&&(r[c]=m):c==="style"?r[c]={...m,...f}:c==="className"&&(r[c]=[m,f].filter(Boolean).join(" "))}return{...a,...r}}Jt(Kp,"mergeProps");function $p(a){var c,m;let o=(c=Object.getOwnPropertyDescriptor(a.props,"ref"))==null?void 0:c.get,r=o&&"isReactWarning"in o&&o.isReactWarning;return r?a.ref:(o=(m=Object.getOwnPropertyDescriptor(a,"ref"))==null?void 0:m.get,r=o&&"isReactWarning"in o&&o.isReactWarning,r?a.props.ref:a.props.ref||a.ref)}Jt($p,"getElementRef");function Jp(a){return S.isValidElement(a)&&typeof a.type=="function"&&"__radixId"in a.type&&a.type.__radixId===Qp}Jt(Jp,"isSlottable");var h1=Symbol.for("react.lazy");function iu(a){return a!=null&&typeof a=="object"&&"$$typeof"in a&&a.$$typeof===h1&&"_payload"in a&&Wp(a._payload)}Jt(iu,"isLazyComponent");function Wp(a){return typeof a=="object"&&a!==null&&"then"in a}Jt(Wp,"isPromiseLike");var p1=Jt(a=>`${a} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),g1=Jt(a=>`${a} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),us=Hi[" use ".trim().toString()];const y1=Yp("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}});function Ce({className:a,variant:o,size:r,asChild:c=!1,...m}){const f=c?d1:"button";return u.jsx(f,{"data-slot":"button",className:ge(y1({variant:o,size:r,className:a})),...m})}function v1(a){switch(a){case"error":return u.jsx(vu,{className:"size-4 shrink-0 text-destructive"});case"warn":return u.jsx(bu,{className:"size-4 shrink-0 text-amber-600"});case"ok":return u.jsx(yu,{className:"size-4 shrink-0 text-emerald-600"});default:return null}}function x1({configPath:a,dirtyCount:o,message:r,applying:c,onValidate:m,onApply:f}){return u.jsxs("footer",{className:"sticky bottom-0 z-30 flex flex-wrap items-center gap-x-4 gap-y-2 border-t bg-background/90 px-4 py-3 backdrop-blur-md md:px-6",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[u.jsxs(at,{variant:o===0?"outline":"warn",className:ge("shrink-0 gap-1.5",o===0&&"text-muted-foreground"),children:[o===0?u.jsx(yu,{className:"size-3.5 text-emerald-500"}):u.jsx(nx,{className:"size-3.5"}),o===0?"No changes":`${o} unsaved change${o===1?"":"s"}`]}),u.jsx("span",{className:"hidden min-w-0 truncate font-mono text-xs text-muted-foreground lg:inline",children:a})]}),u.jsxs("div",{className:ge("flex min-w-0 flex-1 items-center gap-2 text-sm",(r==null?void 0:r.kind)==="error"&&"text-destructive",(r==null?void 0:r.kind)==="warn"&&"text-amber-600",(r==null?void 0:r.kind)==="ok"&&"text-emerald-600"),role:(r==null?void 0:r.kind)==="error"?"alert":void 0,"aria-live":"polite",children:[v1(r==null?void 0:r.kind),u.jsx("span",{className:"truncate",children:(r==null?void 0:r.text)??""})]}),u.jsxs("div",{className:"flex shrink-0 gap-2",children:[u.jsxs(Ce,{variant:"secondary",onClick:m,disabled:c,children:[u.jsx(yx,{}),"Validate"]}),u.jsxs(Ce,{onClick:f,disabled:o===0||c,children:[c?u.jsx(nu,{className:"animate-spin"}):u.jsx(hx,{}),c?"Applying...":"Apply"]})]})]})}var b1=Object.defineProperty,qt=(a,o)=>b1(a,"name",{value:o,configurable:!0});function S1(a,o){const r=S.createContext(o);r.displayName=a+"Context";const c=qt(f=>{const{children:h,...p}=f,y=S.useMemo(()=>p,Object.values(p));return u.jsx(r.Provider,{value:y,children:h})},"Provider");c.displayName=a+"Provider";function m(f,h={}){const{optional:p=!1}=h,y=S.useContext(r);if(y)return y;if(o!==void 0)return o;if(!p)throw new Error(`\`${f}\` must be used within \`${a}\``)}return qt(m,"useContext"),[c,m]}qt(S1,"createContext");function Ss(a,o=[]){let r=[];function c(f,h){const p=S.createContext(h);p.displayName=f+"Context";const y=r.length;r=[...r,h];const v=qt(b=>{var k;const{scope:x,children:C,...w}=b,E=((k=x==null?void 0:x[a])==null?void 0:k[y])||p,O=S.useMemo(()=>w,Object.values(w));return u.jsx(E.Provider,{value:O,children:C})},"Provider");v.displayName=f+"Provider";function j(b,x,C={}){var k;const{optional:w=!1}=C,E=((k=x==null?void 0:x[a])==null?void 0:k[y])||p,O=S.useContext(E);if(O)return O;if(h!==void 0)return h;if(!w)throw new Error(`\`${b}\` must be used within \`${f}\``)}return qt(j,"useContext"),[v,j]}qt(c,"createContext");const m=qt(()=>{const f=r.map(h=>S.createContext(h));return qt(function(p){const y=(p==null?void 0:p[a])||f;return S.useMemo(()=>({[`__scope${a}`]:{...p,[a]:y}}),[p,y])},"useScope")},"createScope");return m.scopeName=a,[c,Fp(m,...o)]}qt(Ss,"createContextScope");function Fp(...a){const o=a[0];if(a.length===1)return o;const r=qt(()=>{const c=a.map(m=>({useScope:m(),scopeName:m.scopeName}));return qt(function(f){const h=c.reduce((p,{useScope:y,scopeName:v})=>{const b=y(f)[`__scope${v}`];return{...p,...b}},{});return S.useMemo(()=>({[`__scope${o.scopeName}`]:h}),[h])},"useComposedScopes")},"createScope");return r.scopeName=o.scopeName,r}qt(Fp,"composeContextScopes");var j1=Object.defineProperty,_a=(a,o)=>j1(a,"name",{value:o,configurable:!0}),Pp=!!(typeof window<"u"&&window.document&&window.document.createElement);function Et(a,o,{checkForDefaultPrevented:r=!0}={}){return _a(function(m){if(a==null||a(m),r===!1||!m||!m.defaultPrevented)return o==null?void 0:o(m)},"handleEvent")}_a(Et,"composeEventHandlers");function w1(a){var o;if(!Pp)throw new Error("Cannot access window outside of the DOM");return((o=a==null?void 0:a.ownerDocument)==null?void 0:o.defaultView)??window}_a(w1,"getOwnerWindow");function ou(a){if(!Pp)throw new Error("Cannot access document outside of the DOM");return(a==null?void 0:a.ownerDocument)??document}_a(ou,"getOwnerDocument");function Ip(a,o=!1){const{activeElement:r}=ou(a);if(!(r!=null&&r.nodeName))return null;if(eg(r)&&r.contentDocument)return Ip(r.contentDocument.body,o);if(o){const c=r.getAttribute("aria-activedescendant");if(c){const m=ou(r).getElementById(c);if(m)return m}}return r}_a(Ip,"getActiveElement");function eg(a){return a.tagName==="IFRAME"}_a(eg,"isFrame");var $t=globalThis!=null&&globalThis.document?S.useLayoutEffect:()=>{},N1=Object.defineProperty,C1=(a,o)=>N1(a,"name",{value:o,configurable:!0}),ap=Hi[" useEffectEvent ".trim().toString()],ip=Hi[" useInsertionEffect ".trim().toString()];function tg(a){if(typeof ap=="function")return ap(a);const o=S.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof ip=="function"?ip(()=>{o.current=a}):$t(()=>{o.current=a}),S.useMemo(()=>((...r)=>{var c;return(c=o.current)==null?void 0:c.call(o,...r)}),[])}C1(tg,"useEffectEvent");var A1=Object.defineProperty,Bi=(a,o)=>A1(a,"name",{value:o,configurable:!0}),T1=Hi[" useInsertionEffect ".trim().toString()]||$t;function Nu({prop:a,defaultProp:o,onChange:r=Bi(()=>{},"onChange"),caller:c}){const[m,f,h]=ng({defaultProp:o,onChange:r}),p=a!==void 0,y=p?a:m,v=S.useCallback(j=>{var b;if(p){const x=lg(j)?j(a):j;x!==a&&((b=h.current)==null||b.call(h,x))}else f(j)},[p,a,f,h]);return[y,v]}Bi(Nu,"useControllableState");function ng({defaultProp:a,onChange:o}){const[r,c]=S.useState(a),m=S.useRef(r),f=S.useRef(o);return T1(()=>{f.current=o},[o]),S.useEffect(()=>{var h;m.current!==r&&((h=f.current)==null||h.call(f,r),m.current=r)},[r,m]),[r,c,f]}Bi(ng,"useUncontrolledState");function lg(a){return typeof a=="function"}Bi(lg,"isFunction");var op=Symbol("RADIX:SYNC_STATE");function E1(a,o,r,c){const{prop:m,defaultProp:f,onChange:h,caller:p}=o,y=m!==void 0,v=tg(h),j=[{...r,state:f}];c&&j.push(c);const[b,x]=S.useReducer((O,k)=>{if(k.type===op)return{...O,state:k.state};const B=a(O,k);return y&&!Object.is(B.state,O.state)&&v(B.state),B},...j),C=b.state,w=S.useRef(C);S.useEffect(()=>{w.current!==C&&(w.current=C,y||v(C))},[C,w,y]);const E=S.useMemo(()=>m!==void 0?{...b,state:m}:b,[b,m]);return S.useEffect(()=>{y&&!Object.is(m,b.state)&&x({type:op,state:m})},[m,b.state,y]),[E,x]}Bi(E1,"useControllableStateReducer");var z1=Object.defineProperty,_1=(a,o)=>z1(a,"name",{value:o,configurable:!0});function Cu(a){const[o,r]=S.useState(void 0);return $t(()=>{if(a){r({width:a.offsetWidth,height:a.offsetHeight});const c=new ResizeObserver(m=>{if(!Array.isArray(m)||!m.length)return;const f=m[0];let h,p;if("borderBoxSize"in f){const y=f.borderBoxSize,v=Array.isArray(y)?y[0]:y;h=v.inlineSize,p=v.blockSize}else h=a.offsetWidth,p=a.offsetHeight;r({width:h,height:p})});return c.observe(a,{box:"border-box"}),()=>c.unobserve(a)}else r(void 0)},[a]),o}_1(Cu,"useSize");var M1=Object.defineProperty,zn=(a,o)=>M1(a,"name",{value:o,configurable:!0});function ag(a,o){return S.useReducer((r,c)=>o[r][c]??r,a)}zn(ag,"useStateMachine");var Au=zn(a=>{const{present:o,children:r}=a,c=ig(o),m=typeof r=="function"?r({present:c.isPresent}):S.Children.only(r),f=og(c.ref,sg(m));return typeof r=="function"||c.isPresent?S.cloneElement(m,{ref:f}):null},"Presence");function ig(a){const[o,r]=S.useState(),c=S.useRef(null),m=S.useRef(a),f=S.useRef("none"),h=S.useRef(void 0),p=a?"mounted":"unmounted",[y,v]=ag(p,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{y==="mounted"?(f.current=h.current??Aa(c.current),h.current=void 0):f.current="none"},[y]),$t(()=>{const j=c.current,b=m.current;if(b!==a){const C=f.current,w=Aa(j);a?(h.current=w,v("MOUNT")):w==="none"||(j==null?void 0:j.display)==="none"?v("UNMOUNT"):v(b&&C!==w?"ANIMATION_OUT":"UNMOUNT"),m.current=a}},[a,v]),$t(()=>{if(o){let j;const b=o.ownerDocument.defaultView??window,x=zn(w=>{const O=Aa(c.current).includes(CSS.escape(w.animationName));if(w.target===o&&O&&(v("ANIMATION_END"),!m.current)){const k=o.style.animationFillMode;o.style.animationFillMode="forwards",j=b.setTimeout(()=>{o.style.animationFillMode==="forwards"&&(o.style.animationFillMode=k)})}},"handleAnimationEnd"),C=zn(w=>{w.target===o&&(f.current=Aa(c.current))},"handleAnimationStart");return o.addEventListener("animationstart",C),o.addEventListener("animationcancel",x),o.addEventListener("animationend",x),()=>{b.clearTimeout(j),o.removeEventListener("animationstart",C),o.removeEventListener("animationcancel",x),o.removeEventListener("animationend",x)}}else v("ANIMATION_END")},[o,v]),{isPresent:["mounted","unmountSuspended"].includes(y),ref:S.useCallback(j=>{if(j){const b=getComputedStyle(j);c.current=b,h.current=Aa(b)}else c.current=null;r(j)},[])}}zn(ig,"usePresence");function su(a,o){if(typeof a=="function")return a(o);a!=null&&(a.current=o)}zn(su,"setRef");function og(...a){const o=S.useRef(a);return o.current=a,S.useCallback(r=>{const c=o.current;let m=!1;const f=c.map(h=>{const p=su(h,r);return!m&&typeof p=="function"&&(m=!0),p});if(m)return()=>{for(let h=0;h<f.length;h++){const p=f[h];typeof p=="function"?p():su(c[h],null)}}},[])}zn(og,"useStableComposedRefs");function Aa(a){return(a==null?void 0:a.animationName)||"none"}zn(Aa,"getAnimationName");function sg(a){var c,m;let o=(c=Object.getOwnPropertyDescriptor(a.props,"ref"))==null?void 0:c.get,r=o&&"isReactWarning"in o&&o.isReactWarning;return r?a.ref:(o=(m=Object.getOwnPropertyDescriptor(a,"ref"))==null?void 0:m.get,r=o&&"isReactWarning"in o&&o.isReactWarning,r?a.props.ref:a.props.ref||a.ref)}zn(sg,"getElementRef");var O1=Object.defineProperty,k1=(a,o)=>O1(a,"name",{value:o,configurable:!0}),R1=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Vt=R1.reduce((a,o)=>{const r=wu(`Primitive.${o}`),c=S.forwardRef((m,f)=>{const{asChild:h,...p}=m,y=h?r:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(y,{...p,ref:f})});return c.displayName=`Primitive.${o}`,{...a,[o]:c}},{});function cg(a,o){a&&hu.flushSync(()=>a.dispatchEvent(o))}k1(cg,"dispatchDiscreteCustomEvent");var D1=Object.defineProperty,_n=(a,o)=>D1(a,"name",{value:o,configurable:!0}),Tu="Checkbox",[U1,G3]=Ss(Tu),[L1,Eu]=U1(Tu);function rg(a){const{__scopeCheckbox:o,checked:r,children:c,defaultChecked:m,disabled:f,form:h,name:p,onCheckedChange:y,required:v,value:j="on",internal_do_not_use_render:b}=a,[x,C]=Nu({prop:r,defaultProp:m??!1,onChange:y,caller:Tu}),[w,E]=S.useState(null),[O,k]=S.useState(null),B=S.useRef(!1),[q,Z]=S.useReducer(Q=>Q+1,0),V=w?!!h||!!w.closest("form"):!0,z={checked:x,disabled:f,setChecked:C,control:w,setControl:E,name:p,form:h,value:j,hasConsumerStoppedPropagationRef:B,userInteractionCount:q,onUserInteraction:Z,required:v,defaultChecked:Cn(m)?!1:m,isFormControl:V,bubbleInput:O,setBubbleInput:k};return u.jsx(L1,{scope:o,...z,children:ug(b)?b(z):c})}_n(rg,"CheckboxProvider");var H1="CheckboxTrigger",B1=S.forwardRef(_n(function({__scopeCheckbox:o,onKeyDown:r,onClick:c,...m},f){const{control:h,value:p,disabled:y,checked:v,required:j,setControl:b,setChecked:x,hasConsumerStoppedPropagationRef:C,onUserInteraction:w,isFormControl:E,bubbleInput:O}=Eu(H1,o),k=On(f,b),B=S.useRef(v);return S.useEffect(()=>{const q=h==null?void 0:h.form;if(q){const Z=_n(()=>x(B.current),"reset");return q.addEventListener("reset",Z),()=>q.removeEventListener("reset",Z)}},[h,x]),u.jsx(Vt.button,{type:"button",role:"checkbox","aria-checked":Cn(v)?"mixed":v,"aria-required":j,"data-state":zu(v),"data-disabled":y?"":void 0,disabled:y,value:p,...m,ref:k,onKeyDown:Et(r,q=>{q.key==="Enter"&&q.preventDefault()}),onClick:Et(c,q=>{w(),x(Z=>Cn(Z)?!0:!Z),O&&E&&(C.current=q.isPropagationStopped(),C.current||q.stopPropagation())})})},"CheckboxTrigger")),q1=S.forwardRef(_n(function(o,r){const{__scopeCheckbox:c,name:m,checked:f,defaultChecked:h,required:p,disabled:y,value:v,onCheckedChange:j,form:b,...x}=o;return u.jsx(rg,{__scopeCheckbox:c,checked:f,defaultChecked:h,disabled:y,required:p,onCheckedChange:j,name:m,form:b,value:v,internal_do_not_use_render:({isFormControl:C})=>u.jsxs(u.Fragment,{children:[u.jsx(B1,{...x,ref:r,__scopeCheckbox:c}),C&&u.jsx(X1,{__scopeCheckbox:c})]})})},"Checkbox")),G1="CheckboxIndicator",V1=S.forwardRef(_n(function(o,r){const{__scopeCheckbox:c,forceMount:m,...f}=o,h=Eu(G1,c);return u.jsx(Au,{present:m||Cn(h.checked)||h.checked===!0,children:u.jsx(Vt.span,{"data-state":zu(h.checked),"data-disabled":h.disabled?"":void 0,...f,ref:r,style:{pointerEvents:"none",...o.style}})})},"CheckboxIndicator")),Y1="CheckboxBubbleInput",X1=S.forwardRef(_n(function({__scopeCheckbox:o,onClick:r,...c},m){const{control:f,hasConsumerStoppedPropagationRef:h,userInteractionCount:p,checked:y,defaultChecked:v,required:j,disabled:b,name:x,value:C,form:w,bubbleInput:E,setBubbleInput:O}=Eu(Y1,o),k=On(m,O),B=Cu(f),q=S.useRef(!1),Z=S.useRef(y),V=S.useRef(p);S.useEffect(()=>{const Q=E;if(!Q)return;const W=window.HTMLInputElement.prototype,le=Object.getOwnPropertyDescriptor(W,"checked").set,re=p!==V.current;V.current=p;const $=Z.current!==y;Z.current=y;const F=!(re&&h.current);if($&&le){q.current=!re;const ie=new Event("click",{bubbles:F});Q.indeterminate=Cn(y),le.call(Q,Cn(y)?!1:y),Q.dispatchEvent(ie),q.current=!1}},[E,y,h,p]);const z=S.useRef(Cn(y)?!1:y);return u.jsx(Vt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:v??z.current,required:j,disabled:b,name:x,value:C,form:w,...c,tabIndex:-1,ref:k,onClick:Et(r,Q=>{q.current&&Q.stopPropagation()}),style:{...c.style,...B,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function ug(a){return typeof a=="function"}_n(ug,"isFunction");function Cn(a){return a==="indeterminate"}_n(Cn,"isIndeterminate");function zu(a){return Cn(a)?"indeterminate":a?"checked":"unchecked"}_n(zu,"getState");function fg({className:a,...o}){return u.jsx(q1,{"data-slot":"checkbox",className:ge("peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50",a),...o,children:u.jsx(V1,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current",children:u.jsx(gu,{className:"size-3.5"})})})}function rl({className:a,type:o,...r}){return u.jsx("input",{type:o,"data-slot":"input",className:ge("flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-colors outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",a),...r})}var Q1=Object.defineProperty,Z1=(a,o)=>Q1(a,"name",{value:o,configurable:!0}),K1=S.forwardRef(Z1(function(o,r){return u.jsx(Vt.label,{...o,ref:r,onMouseDown:c=>{var f;c.target.closest("button, input, select, textarea")||((f=o.onMouseDown)==null||f.call(o,c),!c.defaultPrevented&&c.detail>1&&c.preventDefault())}})},"Label")),$1=K1;function hs({className:a,...o}){return u.jsx($1,{"data-slot":"label",className:ge("flex items-center gap-2 text-sm leading-none font-medium select-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50",a),...o})}function J1({className:a,...o}){return u.jsx("select",{"data-slot":"select",className:ge("flex h-9 w-full min-w-0 items-center rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-xs transition-colors outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50",a),...o})}function W1({className:a,...o}){return u.jsx("textarea",{"data-slot":"textarea",className:ge("flex min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-xs transition-colors outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",a),...o})}const F1=(a,o)=>a==="optional_model"?["None",...o]:o;function P1(a){let o=0;for(let r=0;r<a.length;r++)o=o*31+a.charCodeAt(r)|0;return o}function I1(a,o){const r=o.trim().toLowerCase();return r?a.filter(c=>c.toLowerCase().includes(r)):a}function eb({value:a,fieldType:o,models:r,onChange:c,onCommit:m,disabled:f=!1,id:h}){const[p,y]=S.useState(!1),[v,j]=S.useState(""),[b,x]=S.useState(-1),C=S.useRef(null),w=S.useRef(null),E=S.useRef(null),O=`model-options-${h??P1(o)}`,k=S.useMemo(()=>F1(o,r),[o,r]),B=S.useMemo(()=>I1(k,v),[k,v]),Z=p||v!==""?v:a,V=o==="optional_model"&&(!a||a==="None")?"None":a,z=v.trim(),Q=k.includes(z),W=p&&z!==""&&!Q,ne=!f&&a!==""&&V!=="None",le=J=>{var A;y(!1),x(-1),J&&j(""),(A=C.current)==null||A.removeAttribute("aria-activedescendant")},re=J=>{var A;c(J),m==null||m(J),j(""),le(!1),(A=C.current)==null||A.focus()},$=()=>{if(!z)return;const J=k.find(A=>A===z);re(J??z)},F=J=>{if(J.key==="ArrowDown"||J.key==="ArrowUp")if(J.preventDefault(),p){const A=B.length;if(A===0)return;x(D=>(D+(J.key==="ArrowDown"?1:-1)+A)%A)}else y(!0),J.key==="ArrowUp"&&x(B.length-1);else if(p&&J.key==="Home")J.preventDefault(),x(0);else if(p&&J.key==="End")J.preventDefault(),x(B.length-1);else if(J.key==="Enter"){J.preventDefault();const A=p&&b>=0&&b<B.length?B[b]:void 0;A?re(A):$()}else p&&J.key==="Escape"?(J.preventDefault(),le(!0)):p&&J.key==="Tab"&&le(!1)};S.useEffect(()=>{if(!p)return;const J=A=>{var H;const D=A.target;D&&!((H=w.current)!=null&&H.contains(D))&&le(!0)};return document.addEventListener("pointerdown",J),()=>document.removeEventListener("pointerdown",J)},[p]),S.useEffect(()=>{var A;if(!p||b<0)return;const J=(A=E.current)==null?void 0:A.querySelector(`[data-index="${b}"]`);J==null||J.scrollIntoView({block:"nearest"})},[p,b]);const ie=p&&b>=0&&b<B.length?`${O}-option-${b}`:void 0;return u.jsxs("div",{ref:w,className:"relative",children:[u.jsxs("div",{className:"relative",children:[u.jsx("input",{ref:C,id:h,type:"text",role:"combobox","aria-autocomplete":"list","aria-haspopup":"listbox","aria-expanded":p,"aria-controls":O,"aria-activedescendant":ie,className:ge("flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-colors outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",ne?"pr-16":"pr-9"),value:Z,disabled:f,placeholder:o==="optional_model"?"None":"Search or type a model id",autoComplete:"off",onClick:()=>{p||(j(""),x(-1)),y(!0)},onInput:J=>{const A=J.target.value;p||y(!0),j(A),x(-1)},onKeyDown:F,onBlur:()=>{if(v.trim()&&v!==a){const A=k.find(D=>D===v)??v;c(A),m==null||m(A)}else o==="optional_model"&&!a.trim()&&(c("None"),m==null||m("None"));j(""),le(!1)}}),ne?u.jsx("button",{type:"button",tabIndex:-1,"aria-label":"Clear model",title:"Clear model",className:"absolute inset-y-0 right-8 flex w-7 items-center justify-center text-muted-foreground transition-colors hover:text-foreground disabled:pointer-events-none disabled:opacity-50",onMouseDown:J=>J.preventDefault(),onClick:()=>{var A;const J=o==="optional_model"?"None":"";c(J),m==null||m(J),j(""),(A=C.current)==null||A.focus()},children:u.jsx(Lp,{className:"size-4"})}):null,u.jsx("button",{type:"button",tabIndex:-1,"aria-label":p?"Close model list":"Open model list","aria-expanded":p,"aria-controls":O,className:"absolute inset-y-0 right-0 flex w-8 items-center justify-center rounded-r-md text-muted-foreground transition-colors hover:text-foreground disabled:pointer-events-none disabled:opacity-50",onMouseDown:J=>J.preventDefault(),onClick:()=>{var J;if(p){le(!0);return}j(""),x(-1),y(!0),(J=C.current)==null||J.focus()},children:u.jsx(Op,{className:ge("size-4 transition-transform duration-200",p&&"rotate-180")})})]}),p?u.jsxs("div",{ref:E,id:O,role:"listbox","aria-label":"Model options",className:"absolute z-20 mt-1 max-h-64 w-full overflow-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-lg animate-in fade-in-0 zoom-in-95",onMouseDown:J=>J.preventDefault(),onMouseMove:J=>{const A=J.target.closest('[role="option"]');A&&x(B.indexOf(A.dataset.value??""))},children:[W?u.jsxs("div",{role:"option","aria-selected":"false",className:"mb-1 flex cursor-pointer items-center gap-2 rounded-sm border-b px-2 py-1.5 text-sm text-primary",onMouseDown:J=>J.preventDefault(),onClick:()=>$(),children:[u.jsx(lx,{className:"size-3.5 shrink-0"}),u.jsxs("span",{className:"min-w-0 flex-1 truncate",children:['Use "',z,'"']})]}):null,B.length===0?u.jsx("div",{className:"px-2 py-2 text-sm text-muted-foreground",children:W?"Press Enter to use this model id.":r.length?"No matching models. Type a model id and press Enter.":"No discovered models. Type a model id and press Enter, or refresh models."}):B.map((J,A)=>{const D=J===V;return u.jsxs("div",{id:`${O}-option-${A}`,role:"option","data-value":J,"data-index":A,"aria-selected":D||A===b,className:ge("relative flex w-full cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors",A===b&&"bg-accent text-accent-foreground",D&&"font-medium text-foreground"),onClick:()=>re(J),children:[u.jsx(gu,{className:ge("size-4 shrink-0",D?"text-primary opacity-100":"opacity-0")}),u.jsx("span",{className:"min-w-0 flex-1 truncate",children:J})]},J)})]}):null]})}const dg=/^__fcc_key_(\d+)__$/,sp="********";function tb(a){return"●".repeat(Math.min(24,Math.max(12,a.length)))}function nb(a){const o=dg.exec(a);return o?Number(o[1]):-1}function lb({value:a,locked:o,keyCount:r,fieldKey:c,disabled:m=!1,onChange:f,onMessage:h}){const[p,y]=S.useState(()=>(a||"").split(",").filter(Boolean).map(V=>({token:V}))),[v,j]=S.useState(""),[b,x]=S.useState(null),[C,w]=S.useState(null),E=V=>{y(V),f(V.map(z=>z.token||z.raw||"").join(","))},O=()=>{const V=v.trim();if(V){if(V.includes(",")){h("API keys cannot contain commas.","error");return}if(dg.test(V)){h("This key format is reserved; enter a real API key.","error");return}E([...p,{token:null,raw:V}]),j("")}},k=async V=>{if(b===null)try{const z=await zx(c);x(z.keys)}catch(z){h(z instanceof Error?z.message:String(z),"error");return}w(z=>z===V?null:V)},B=(V,z)=>{if(C!==z)return V.token?sp:tb(V.raw??"");if(V.token){const Q=nb(V.token);return b&&Q>=0&&Q<b.length?b[Q]:sp}return V.raw??""},q=(V,z)=>{E(p.map((Q,W)=>W!==V?Q:Q.token?{token:null,raw:z}:{...Q,raw:z}))},Z=r===0?"Add one or more API keys. Multiple keys rotate round-robin with failover.":r===1?"One key configured. Add extra keys for round-robin and failover.":"Multiple keys are used in rotation. Add extra keys for round-robin and failover.";return u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsx("div",{className:"flex flex-col gap-1.5",children:p.map((V,z)=>u.jsxs("div",{className:"flex items-center gap-2 rounded-md border bg-card px-2.5 py-1.5",children:[C===z?u.jsx(rl,{type:"text",autoComplete:"off",value:B(V,z),disabled:o||m,onChange:Q=>q(z,Q.target.value),onBlur:()=>w(null),className:"h-8 flex-1 font-mono text-xs"}):u.jsx("span",{className:"min-w-0 flex-1 break-all font-mono text-xs text-muted-foreground",children:B(V,z)}),u.jsx(Ce,{type:"button",variant:"ghost",size:"sm",disabled:o||m,"aria-label":C===z?"Hide API key":"Show API key",onClick:()=>void k(z),children:C===z?"Hide":"Show"}),u.jsx(Ce,{type:"button",variant:"ghost",size:"sm",disabled:o||m,"aria-label":"Remove API key",onClick:()=>E(p.filter((Q,W)=>W!==z)),children:"Remove"})]},z))}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(rl,{type:"password",autoComplete:"off",placeholder:"Add API key",value:v,disabled:o||m,onChange:V=>j(V.target.value),onKeyDown:V=>{V.key==="Enter"&&(V.preventDefault(),O())},className:ge(o&&"opacity-50")}),u.jsx(Ce,{type:"button",variant:"secondary",disabled:o||m,onClick:O,children:"Add"})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:Z})]})}function ab({field:a,value:o,modelOptions:r,onValueChange:c,onMessage:m}){if(a.pool_supported)return u.jsx(lb,{value:o,locked:a.locked,keyCount:a.key_count??0,fieldKey:a.key,onChange:f=>c(a.key,f),onMessage:m});switch(a.type){case"boolean":return u.jsx(fg,{id:`field-${a.key}`,checked:o==="true",disabled:a.locked,onCheckedChange:f=>c(a.key,f===!0?"true":"false")});case"select":return u.jsx(J1,{id:`field-${a.key}`,value:o,disabled:a.locked,onChange:f=>c(a.key,f.target.value),children:a.options.map(f=>u.jsx("option",{value:f.value,children:f.label},f.value))});case"textarea":return u.jsx(W1,{id:`field-${a.key}`,value:o,disabled:a.locked,onChange:f=>c(a.key,f.target.value)});case"model":case"optional_model":return u.jsx(eb,{id:`field-${a.key}`,value:o,fieldType:a.type,models:r,disabled:a.locked,onChange:f=>c(a.key,f)});case"secret":return u.jsx(ib,{field:a,value:o,onValueChange:c});default:return u.jsx(rl,{id:`field-${a.key}`,type:a.type==="number"?"number":"text",value:o,disabled:a.locked,onChange:f=>c(a.key,f.target.value)})}}function ib({field:a,value:o,onValueChange:r}){const[c,m]=S.useState(!1);return u.jsxs("div",{className:"relative",children:[u.jsx(rl,{id:`field-${a.key}`,type:c?"text":"password",value:o,disabled:a.locked,placeholder:a.configured?"Configured - enter a new value to replace":"Not configured",autoComplete:"off",onChange:f=>r(a.key,f.target.value)}),u.jsx("button",{type:"button",className:"absolute inset-y-0 right-2 flex items-center text-xs text-muted-foreground","aria-label":c?"Hide API key":"Show API key",onMouseDown:f=>{f.preventDefault(),m(h=>!h)},children:c?"Hide":"Show"})]})}function ob({field:a,value:o,modelOptions:r,onValueChange:c,onMessage:m,className:f}){const h=sb(a);return u.jsxs("div",{className:ge("flex flex-col gap-2.5 rounded-lg border bg-card/40 p-4 transition-colors hover:border-border/80",f),"data-key":a.key,children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx(hs,{htmlFor:a.type==="boolean"?void 0:`field-${a.key}`,children:u.jsx("span",{className:"text-sm font-medium",children:a.label})}),h?u.jsx(at,{variant:"outline",className:"gap-1 px-1.5 py-0 text-[10px] font-medium text-muted-foreground",children:h}):null]}),u.jsx(ab,{field:a,value:o,modelOptions:r,onValueChange:c,onMessage:m}),a.description?u.jsxs("p",{className:"flex items-start gap-1.5 text-xs text-muted-foreground",children:[u.jsx(cx,{className:"mt-0.5 size-3.5 shrink-0 opacity-70"}),u.jsx("span",{children:a.description})]}):null]})}function sb(a){const o={default:"default",template:"template",repo_env:"repo .env",explicit_env_file:"FCC_ENV_FILE",process:"process env"},r=[],c=Object.prototype.hasOwnProperty.call(o,a.source)?o[a.source]:a.source;return c&&r.push(c),a.locked&&r.push("locked"),r.join(" ")}function Kt({className:a,...o}){return u.jsx("div",{"data-slot":"card",className:ge("card-hover flex flex-col gap-6 rounded-xl border bg-card text-card-foreground shadow-sm",a),...o})}function Nn({className:a,...o}){return u.jsx("div",{"data-slot":"card-content",className:ge("px-6",a),...o})}const cb={providers:Ri,runtime:xu,models:Mp,reasoning:ux,web_tools:sx,messaging:Up,voice:dx};function rb({config:a,values:o,onValuesChange:r,modelOptions:c,onRefreshModels:m,focusedView:f}){const h=ul.find(v=>v.id===f)??ul[0],p=new Set(h.sections),y=S.useMemo(()=>a.sections.filter(v=>p.has(v.id)).map(v=>({section:v,fields:a.fields.filter(j=>j.section===v.id)})).filter(v=>v.fields.length>0),[a,p]);return u.jsx(u.Fragment,{children:y.map(({section:v,fields:j})=>u.jsx(ub,{section:v,fields:j,values:o,onValuesChange:r,modelOptions:c,onRefreshModels:m},v.id))})}function ub({section:a,fields:o,values:r,onValuesChange:c,modelOptions:m,onRefreshModels:f}){const h=o.some(w=>w.advanced),[p,y]=S.useState(!1),[v,j]=S.useState(!1),b=a.id==="models",x=cb[a.id]??Ri,C=w=>o.filter(E=>!E.advanced||w).map((E,O)=>u.jsx(ob,{field:E,value:r[E.key]??"",modelOptions:m,onValueChange:(k,B)=>c({...r,[k]:B}),onMessage:()=>{},className:ge(b&&O===0&&"md:col-span-2")},E.key));return u.jsx(Kt,{className:"gap-0 overflow-hidden",children:u.jsxs(Nn,{className:"flex flex-col gap-4 px-5 py-4 md:px-6",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[u.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:u.jsx(x,{className:"size-4.5"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("h3",{className:"text-base font-semibold tracking-tight leading-tight",children:a.label}),a.description?u.jsx("p",{className:"text-sm text-muted-foreground",children:a.description}):null]})]}),b?u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[m.length>0?u.jsxs(at,{variant:"secondary",className:"gap-1.5 font-normal",children:[u.jsx(Mp,{className:"size-3.5"}),m.length," model",m.length===1?"":"s"]}):null,u.jsxs(Ce,{variant:"secondary",size:"sm",disabled:v,onClick:()=>{j(!0),f("__refresh_models__",()=>j(!1))},children:[u.jsx(ki,{className:v?"animate-spin":void 0}),v?"Refreshing":"Refresh models"]})]}):null]}),u.jsx("div",{className:ge("grid gap-3",b&&"md:grid-cols-2"),children:C(p)}),h?u.jsx(Ce,{type:"button",variant:"ghost",size:"sm",className:"self-start text-muted-foreground",onClick:()=>y(w=>!w),children:p?"Hide advanced":"Show advanced"}):null]})})}function mg(a){return["configured","reachable","running","connected"].includes(a??"")?"bg-emerald-500":["missing_key","missing_config","missing_url","unknown","connecting"].includes(a??"")?"bg-amber-500":["offline","error"].includes(a??"")?"bg-red-500":"bg-muted-foreground/50"}const Zr="OPENAI_COMPATIBLE_INSTANCES";function cp(a){if(!a)return[];try{const o=JSON.parse(a);return Array.isArray(o)?o.filter(r=>r!==null&&typeof r=="object"):[]}catch{return[]}}function Oi(a){return`openai_compatible_${a+1}`}function fb(a,o,r){const c=r[a];if(c)return{status:c.status,label:c.label,baseUrl:c.base_url??""};const m=o.provider_status.find(f=>f.provider_id===a);return{status:(m==null?void 0:m.status)??"unknown",label:(m==null?void 0:m.label)??"Not configured",baseUrl:(m==null?void 0:m.base_url)??""}}function db({index:a,instance:o,status:r,locked:c,testing:m,fetching:f,models:h,selected:p,currentDefault:y,onPatch:v,onRemove:j,onTest:b,onFetch:x,onClearModels:C,onAddModels:w,onToggleModel:E,onUseModel:O}){const k=Oi(a),B=!c&&!!o.base_url.trim(),[q,Z]=S.useState(""),V=()=>{const z=q.split(",").map(Q=>Q.trim()).filter(Boolean);z.length!==0&&(w(z),Z(""))};return u.jsx(Kt,{className:"overflow-hidden",children:u.jsxs(Nn,{className:"flex flex-col gap-4 py-4",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:"flex size-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-sm font-bold text-primary ring-1 ring-primary/20",children:a+1}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("h4",{className:"text-base font-semibold leading-tight",children:["Endpoint ",a+1]}),u.jsxs("p",{className:"font-mono text-xs text-muted-foreground",children:[k,"/<model>"]})]})]}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsxs(at,{variant:ay(r.status),className:"gap-1.5",children:[u.jsx("span",{className:ge("size-1.5 rounded-full",mg(r.status))}),r.label]}),u.jsx(Ce,{type:"button",variant:"ghost",size:"icon",disabled:c,"aria-label":`Remove endpoint ${a+1}`,title:"Remove endpoint",onClick:j,children:u.jsx(Jh,{})})]})]}),u.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx(hs,{htmlFor:`${k}-base-url`,children:"Base URL"}),u.jsx(rl,{id:`${k}-base-url`,type:"text",placeholder:"https://your-gateway.example/v1",value:o.base_url,disabled:c,onChange:z=>v({base_url:z.target.value})})]}),u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx(hs,{htmlFor:`${k}-api-keys`,children:"API keys"}),u.jsx(rl,{id:`${k}-api-keys`,type:"text",autoComplete:"off",placeholder:"key1, key2",value:o.api_keys,disabled:c,onChange:z=>v({api_keys:z.target.value})}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Comma-separated keys rotate round-robin with failover. Leave empty for keyless local servers."})]})]}),u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx(hs,{htmlFor:`${k}-proxy`,children:"Proxy (optional)"}),u.jsx(rl,{id:`${k}-proxy`,type:"text",placeholder:"http://proxy:8080",value:o.proxy,disabled:c,onChange:z=>v({proxy:z.target.value})})]}),u.jsxs("div",{className:"flex flex-col gap-2 rounded-md border bg-muted/30 p-3",children:[u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("p",{className:"flex items-center gap-1.5 text-sm font-medium",children:[u.jsx(Rp,{className:"size-4 text-muted-foreground"}),h.length===0?"No model ids yet":`${h.length} model id${h.length===1?"":"s"}`]}),p.length>0?u.jsxs(at,{variant:"outline",className:"gap-1 px-1.5 py-0 text-[10px]",children:[u.jsx(gu,{className:"size-3"}),p.length," selected"]}):null]}),h.length>0?u.jsxs(Ce,{type:"button",variant:"ghost",size:"sm",disabled:c,onClick:C,children:[u.jsx(Jh,{}),"Clear"]}):null]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(rl,{id:`${k}-model-id`,type:"text",autoComplete:"off",placeholder:"Add model id, comma-separated (gpt-4o, deepseek-v3, …)",value:q,disabled:c,onChange:z=>Z(z.target.value),onKeyDown:z=>{z.key==="Enter"&&(z.preventDefault(),V())}}),u.jsxs(Ce,{type:"button",variant:"secondary",size:"sm",disabled:c||!q.trim(),onClick:V,children:[u.jsx(Dp,{}),"Add"]})]}),h.length>0?u.jsx("div",{className:"grid max-h-56 gap-1 overflow-auto",children:h.map(z=>{const Q=z===y||`${k}/${z}`===y;return u.jsxs("div",{className:ge("flex items-center gap-2 rounded-md border px-2.5 py-1.5 transition-colors hover:border-border",Q?"border-emerald-200 bg-emerald-50/70 dark:border-emerald-500/30 dark:bg-emerald-500/10":"border-transparent bg-card"),children:[u.jsx(fg,{id:`${k}-model-${z}`,checked:p.includes(z),disabled:c,"aria-label":`Apply model ${z}`,title:p.includes(z)?"Applied to this endpoint":"Select to apply this model",onCheckedChange:()=>E(z)}),u.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5",children:[Q?u.jsx($h,{className:"size-3.5 shrink-0 fill-amber-400 text-amber-500"}):null,u.jsx("span",{className:"truncate font-mono text-xs",children:z}),Q?u.jsx(at,{variant:"ok",className:"px-1.5 py-0 text-[10px]",children:"default"}):null]}),u.jsxs(Ce,{type:"button",variant:"ghost",size:"sm",disabled:c,onClick:()=>O(z),children:[u.jsx($h,{className:"size-3.5"}),"Use as default"]})]},z)})}):u.jsxs("p",{className:"text-xs text-muted-foreground",children:["Add model ids manually, or use ",u.jsx("strong",{children:"Fetch models"})," below to pull them from GET ","{base}","/models."]})]}),u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border bg-muted/30 px-3 py-2",children:[u.jsxs("p",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[u.jsx(tu,{className:"size-3.5"}),r.baseUrl?`Resolves to ${r.baseUrl}`:"Not checked yet"]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs(Ce,{type:"button",variant:"secondary",size:"sm",disabled:!B||f,onClick:x,title:"Fetch model ids from GET {base}/models (uses the saved config, Apply first)",children:[f?u.jsx(nu,{className:"animate-spin"}):u.jsx(ki,{}),f?"Fetching…":"Fetch models"]}),u.jsxs(Ce,{type:"button",variant:"secondary",size:"sm",disabled:!B||m,onClick:b,children:[m?u.jsx(nu,{className:"animate-spin"}):u.jsx(tu,{}),m?"Testing…":"Test connection"]})]})]})]})})}function mb({config:a,values:o,onValuesChange:r,localStatus:c,onTestProvider:m,onFetchModels:f,onAddModels:h,onMessage:p}){const y=a.fields.find(A=>A.key===Zr),v=o[Zr]??(y==null?void 0:y.value)??"[]",[j,b]=S.useState(()=>cp(v)),[x,C]=S.useState(null),[w,E]=S.useState(null),[O,k]=S.useState({});S.useEffect(()=>{b(cp(v))},[v]);const B=A=>{b(A),r({...o,[Zr]:JSON.stringify(A)})},q=(A,D)=>{B(j.map((H,P)=>P===A?{...H,...D}:H))},Z=()=>{B([...j,{base_url:"",api_keys:"",proxy:""}])},V=A=>{B(j.filter((D,H)=>H!==A))},z=async A=>{const D=Oi(A);E(D);try{const H=await f(D);if(H.length===0){p(`No models found at ${D}.`,"warn");return}k(P=>({...P,[D]:[...new Set([...P[D]??[],...H])]})),p(`Fetched ${H.length} models from ${D}.`,"ok")}finally{E(null)}},Q=(A,D)=>{var se;const H=Oi(A);k(je=>({...je,[H]:[...new Set([...je[H]??[],...D])]}));const P=((se=j[A])==null?void 0:se.models)??[];q(A,{models:[...new Set([...P,...D])]}),h(H,D),p(`Added ${D.length} model id${D.length===1?"":"s"} to ${H}. Apply to save.`,"ok")},W=(A,D)=>{var P;const H=((P=j[A])==null?void 0:P.models)??[];q(A,H.includes(D)?{models:H.filter(se=>se!==D)}:{models:[...H,D]})},ne=(A,D)=>{var P;r({...o,MODEL:D});const H=((P=j[A])==null?void 0:P.models)??[];H.includes(D)||q(A,{models:[...H,D]}),p(`Default model set to ${D}. Apply to save.`,"ok")};if(!y)return u.jsx("p",{className:"text-sm text-muted-foreground",children:"OpenAI-Compatible endpoint management is unavailable in this config."});const le=o.OPENAI_COMPATIBLE_BASE_URL??"",re=o.OPENAI_COMPATIBLE_API_KEY??"",$=A=>{var H;const D=Oi(A);return[...new Set([...((H=j[A])==null?void 0:H.models)??[],...O[D]??[]])]},F=A=>{var D;return(((D=j[A])==null?void 0:D.api_keys)??"").split(",").filter(H=>H.trim()).length},ie=j.reduce((A,D,H)=>A+$(H).length,0),J=(()=>{const A=new Map;return j.forEach((D,H)=>{$(H).forEach(P=>{A.set(P,[...A.get(P)??[],H])})}),[...A.entries()].filter(([,D])=>D.length>1).sort(([D],[H])=>D.localeCompare(H))})();return u.jsxs("section",{className:"space-y-4",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-semibold tracking-tight",children:"Endpoints"}),u.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["Add any OpenAI-compatible server (vLLM, LM Studio, Ollama, Together, or your own gateway). Each endpoint becomes a numbered provider:"," ",u.jsx("code",{children:"openai_compatible_1/<model>"}),","," ",u.jsx("code",{children:"openai_compatible_2/<model>"}),", … The prefix is optional — a model id also works bare (",u.jsx("code",{children:"MODEL=deepseek"}),") and resolves to whichever endpoint advertises it; when the same id exists on several endpoints, requests rotate round-robin across providers and key pools. Add as many model ids as you want per endpoint, comma-separated, or use ",u.jsx("strong",{children:"Fetch models"})," to pull them from the endpoint's ",u.jsx("code",{children:"/models"})," route. Tick the models you want applied — selected ids are saved with the endpoint on"," ",u.jsx("strong",{children:"Apply"})," and appear in the Model Config dropdowns after a reload."]}),u.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[u.jsxs(at,{variant:"outline",className:"gap-1.5",children:[u.jsx(Ri,{className:"size-3.5 text-muted-foreground"}),j.length," endpoint",j.length===1?"":"s"]}),u.jsxs(at,{variant:"outline",className:"gap-1.5",children:[u.jsx(Rp,{className:"size-3.5 text-muted-foreground"}),ie," model id",ie===1?"":"s"]})]})]}),J.length>0?u.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 p-4 dark:border-amber-500/30 dark:bg-amber-500/10",children:[u.jsxs("p",{className:"flex items-center gap-2 text-sm font-medium text-amber-800 dark:text-amber-300",children:[u.jsx(gx,{className:"size-4 shrink-0"}),"Model ids shared across endpoints rotate round-robin"]}),u.jsx("ul",{className:"mt-2 space-y-1.5 text-sm text-amber-800/90 dark:text-amber-200/90",children:J.map(([A,D])=>u.jsxs("li",{children:[u.jsx("code",{className:"rounded bg-amber-100 px-1 py-0.5 font-mono text-xs dark:bg-amber-500/15",children:A})," ","is served by"," ",D.map(H=>`Endpoint ${H+1} (${F(H)} key${F(H)===1?"":"s"})`).join(", ")," ","— requests cycle across providers and key pools."]},A))})]}):null,j.length===0&&le.trim()?u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 rounded-lg border border-amber-200 bg-amber-50 p-4",children:[u.jsxs("p",{className:"text-sm text-amber-800",children:["You already have the legacy ",u.jsx("code",{children:"OPENAI_COMPATIBLE_BASE_URL"})," ","endpoint configured. Import it as endpoint 1, or keep it and add more endpoints below."]}),u.jsxs(Ce,{type:"button",variant:"secondary",size:"sm",onClick:()=>B([{base_url:le,api_keys:re,proxy:""}]),children:[u.jsx(Dp,{}),"Import as endpoint 1"]})]}):null,j.length===0?u.jsx(Kt,{className:"border-dashed",children:u.jsxs(Nn,{className:"flex flex-col items-center gap-3 py-12 text-center",children:[u.jsx("span",{className:"flex size-12 items-center justify-center rounded-full bg-primary/10",children:u.jsx(Ri,{className:"size-6 text-primary"})}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"No endpoints yet. Add your first OpenAI-compatible endpoint."}),u.jsxs(Ce,{type:"button",onClick:Z,children:[u.jsx(Kh,{}),"Add endpoint"]})]})}):u.jsxs("div",{className:"grid gap-4",children:[j.map((A,D)=>{const H=Oi(D);return u.jsx(db,{index:D,instance:A,status:fb(H,a,c),locked:y.locked,testing:x===H,fetching:w===H,models:$(D),selected:A.models??[],currentDefault:o.MODEL??"",onPatch:P=>q(D,P),onRemove:()=>V(D),onTest:()=>{C(H),m(H,()=>C(null))},onFetch:()=>void z(D),onClearModels:()=>{k(P=>({...P,[H]:[]})),q(D,{models:[]})},onAddModels:P=>Q(D,P),onToggleModel:P=>W(D,P),onUseModel:P=>ne(D,P)},H)}),u.jsxs(Ce,{type:"button",variant:"outline",className:"w-full border-dashed",onClick:Z,children:[u.jsx(Kh,{}),"Add endpoint"]})]})]})}function hb({provider:a,state:o,onTest:r}){const[c,m]=S.useState(!1),f=a.kind==="local",h=f?o.baseUrl||(o.baseUrl!==void 0?"No local URL enabled":""):a.configuration||"",p=f?"Test":"Refresh models",y=f?ax:tu;return u.jsxs(Kt,{className:"flex flex-row items-center justify-between gap-3 p-4 transition-shadow hover:shadow-md",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[u.jsx("span",{className:ge("flex size-10 shrink-0 items-center justify-center rounded-lg",f?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"),children:u.jsx(y,{className:"size-4.5"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("strong",{className:"truncate text-sm",children:a.display_name||a.provider_id}),u.jsx(hg,{status:o.status,label:o.label})]}),u.jsx("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:h})]})]}),u.jsxs(Ce,{variant:"secondary",size:"sm",className:"shrink-0",disabled:c,onClick:()=>{m(!0),r(a.provider_id,()=>m(!1))},children:[c?u.jsx(ki,{className:"animate-spin"}):u.jsx(y,{className:"size-4"}),c?f?"Testing":"Refreshing":p]})]})}function pb({provider:a,status:o,loading:r,onStartLogin:c,onCancelLogin:m,onDisconnect:f,onCopyDeviceCode:h}){const p=o.connected===!0,y=o.state==="connecting",v=o.authorization_url||o.verification_url;return u.jsxs(Kt,{className:"flex flex-col gap-3 p-4 transition-shadow hover:shadow-md",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{className:ge("flex size-10 shrink-0 items-center justify-center rounded-lg",p?"bg-emerald-500/10 text-emerald-600":y?"bg-amber-500/10 text-amber-600":"bg-muted text-muted-foreground"),children:u.jsx(rx,{className:"size-4.5"})}),u.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[u.jsx("strong",{className:"truncate text-sm",children:a.display_name||a.provider_id}),u.jsx(hg,{status:o.state,label:o.label})]})]}),u.jsx("p",{className:"text-xs text-muted-foreground",children:gb(o)}),u.jsx("div",{className:"flex flex-wrap gap-2",children:y?u.jsxs(u.Fragment,{children:[v?u.jsx(Ce,{variant:"default",size:"sm",onClick:()=>window.open(v,"_blank","noopener"),children:"Open sign-in"}):null,o.mode==="device"&&o.user_code?u.jsx(Ce,{variant:"secondary",size:"sm",onClick:()=>h(o.user_code),children:"Copy code"}):null,u.jsx(Ce,{variant:"secondary",size:"sm",onClick:()=>m(a.provider_id),children:"Cancel"})]}):p?u.jsxs(u.Fragment,{children:[u.jsx(Ce,{variant:"secondary",size:"sm",onClick:()=>c(a.provider_id,"browser"),children:"Reconnect"}),u.jsx(Ce,{variant:"secondary",size:"sm",onClick:()=>f(a.provider_id),children:"Disconnect"})]}):u.jsxs(u.Fragment,{children:[u.jsx(Ce,{variant:"default",size:"sm",disabled:r,onClick:()=>c(a.provider_id,"browser"),children:"Connect"}),u.jsx(Ce,{variant:"secondary",size:"sm",disabled:r,onClick:()=>c(a.provider_id,"device"),children:"Use device code"})]})})]})}function hg({status:a,label:o}){const r=a==="connecting";return u.jsxs(at,{variant:ay(a),className:"gap-1.5",children:[u.jsx("span",{className:ge("size-1.5 rounded-full",mg(a),r&&"animate-pulse")}),o]})}function gb(a){if(a.connected){const o=a.email||"ChatGPT subscription connected",r=Number.isInteger(a.model_count)?` ${a.model_count} model${a.model_count===1?"":"s"} available.`:"",c=a.message?` ${a.message}`:"";return`${o}.${r}${c} Restart your agent to refresh its model picker.`}return a.mode==="device"&&a.user_code?`Enter code ${a.user_code} at ${a.verification_url}`:a.state==="connecting"?"Finish signing in, then return to this page.":a.message||"Connect a ChatGPT account to discover subscription models."}function yb({config:a,localStatus:o,connectedStatus:r,connectedLoading:c,onTestProvider:m,onRefreshModels:f,onStartLogin:h,onCancelLogin:p,onDisconnect:y,onCopyDeviceCode:v}){const j=a.provider_status.filter(w=>w.kind==="connected_account"),b=a.provider_status.filter(w=>w.kind!=="connected_account"),x=w=>{const E=o[w.provider_id],O=a.provider_status.find(k=>k.provider_id===w.provider_id);return E?{status:E.status,label:E.label,baseUrl:E.status_code!==void 0?`${E.base_url} returned HTTP ${E.status_code}`:E.base_url}:{status:(O==null?void 0:O.status)??"unknown",label:(O==null?void 0:O.label)??"Not checked",baseUrl:(O==null?void 0:O.base_url)??""}},C=w=>r[w.provider_id]??{state:"disconnected",connected:!1,label:"Not connected"};return u.jsxs(u.Fragment,{children:[j.length>0&&u.jsxs("section",{className:"space-y-4","aria-label":"Connected accounts",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-semibold tracking-tight",children:"Connected accounts"}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"Use an existing subscription without storing credentials in .env."})]}),u.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:j.map(w=>u.jsx(pb,{provider:w,status:C(w),loading:c[w.provider_id]===!0,onStartLogin:h,onCancelLogin:p,onDisconnect:y,onCopyDeviceCode:v},w.provider_id))})]}),u.jsxs("section",{className:"space-y-4","aria-label":"Provider status",children:[u.jsx("h3",{className:"text-lg font-semibold tracking-tight",children:"Providers"}),u.jsx("div",{className:"grid gap-4 md:grid-cols-2",children:b.map(w=>u.jsx(hb,{provider:w,state:x(w),onTest:(E,O)=>{w.kind==="local"?m(E,O):f(E,O)}},w.provider_id))})]})]})}var vb=Object.defineProperty,pg=(a,o)=>vb(a,"name",{value:o,configurable:!0}),rp="horizontal",xb=["horizontal","vertical"],bb=S.forwardRef(pg(function(o,r){const{decorative:c,orientation:m=rp,...f}=o,h=gg(m)?m:rp,y=c?{role:"none"}:{"aria-orientation":h==="vertical"?h:void 0,role:"separator"};return u.jsx(Vt.div,{"data-orientation":h,...y,...f,ref:r})},"Separator"));function gg(a){return xb.includes(a)}pg(gg,"isValidOrientation");var Sb=bb;function jb({className:a,orientation:o="horizontal",decorative:r=!0,...c}){return u.jsx(Sb,{"data-slot":"separator",decorative:r,orientation:o,className:ge("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",a),...c})}var wb=Object.defineProperty,Nb=(a,o)=>wb(a,"name",{value:o,configurable:!0});function qi(a){const o=S.useRef(a);return S.useEffect(()=>{o.current=a}),S.useMemo(()=>((...r)=>{var c;return(c=o.current)==null?void 0:c.call(o,...r)}),[])}Nb(qi,"useCallbackRef");var Cb=Object.defineProperty,Pe=(a,o)=>Cb(a,"name",{value:o,configurable:!0}),cu="dismissableLayer.update",Ab="dismissableLayer.pointerDownOutside",Tb="dismissableLayer.focusOutside",up,yg=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Eb=S.forwardRef(Pe(function(o,r){const{disableOutsidePointerEvents:c=!1,deferPointerDownOutside:m=!1,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:p,onInteractOutside:y,onDismiss:v,...j}=o,b=S.useContext(yg),[x,C]=S.useState(null),w=(x==null?void 0:x.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,E]=S.useState({}),O=On(r,C),k=Array.from(b.layers),[B]=[...b.layersWithOutsidePointerEventsDisabled].slice(-1),q=B?k.indexOf(B):-1,Z=x?k.indexOf(x):-1,V=b.layersWithOutsidePointerEventsDisabled.size>0,z=Z>=q,Q=S.useRef(!1),W=vg($=>{h==null||h($),y==null||y($),$.defaultPrevented||v==null||v()},{ownerDocument:w,deferPointerDownOutside:m,isDeferredPointerDownOutsideRef:Q,dismissableSurfaces:b.dismissableSurfaces,shouldHandlePointerDownOutside:S.useCallback($=>{if(!($ instanceof Node))return!1;const F=[...b.branches].some(ie=>ie.contains($));return z&&!F},[b.branches,z])}),ne=xg($=>{if(m&&Q.current)return;const F=$.target;[...b.branches].some(J=>J.contains(F))||(p==null||p($),y==null||y($),$.defaultPrevented||v==null||v())},w),le=x?Z===k.length-1:!1,re=qi($=>{$.key==="Escape"&&(f==null||f($),!$.defaultPrevented&&v&&($.preventDefault(),v()))});return S.useEffect(()=>{if(le)return w.addEventListener("keydown",re,{capture:!0}),()=>w.removeEventListener("keydown",re,{capture:!0})},[w,le,re]),S.useEffect(()=>{if(x)return c&&(b.layersWithOutsidePointerEventsDisabled.size===0&&(up=w.body.style.pointerEvents,w.body.style.pointerEvents="none"),b.layersWithOutsidePointerEventsDisabled.add(x)),b.layers.add(x),ru(),()=>{c&&(b.layersWithOutsidePointerEventsDisabled.delete(x),b.layersWithOutsidePointerEventsDisabled.size===0&&(w.body.style.pointerEvents=up))}},[x,w,c,b]),S.useEffect(()=>()=>{x&&(b.layers.delete(x),b.layersWithOutsidePointerEventsDisabled.delete(x),ru())},[x,b]),S.useEffect(()=>{const $=Pe(()=>E({}),"handleUpdate");return document.addEventListener(cu,$),()=>document.removeEventListener(cu,$)},[]),u.jsx(Vt.div,{...j,ref:O,style:{pointerEvents:V?z?"auto":"none":void 0,...o.style},onFocusCapture:Et(o.onFocusCapture,ne.onFocusCapture),onBlurCapture:Et(o.onBlurCapture,ne.onBlurCapture),onPointerDownCapture:Et(o.onPointerDownCapture,W.onPointerDownCapture)})},"DismissableLayer"));function zb(){const a=S.useContext(yg),[o,r]=S.useState(null);return S.useEffect(()=>{if(o)return a.dismissableSurfaces.add(o),()=>{a.dismissableSurfaces.delete(o)}},[o,a.dismissableSurfaces]),r}Pe(zb,"useDismissableLayerSurface");var _b=Pe(()=>!0,"IS_TRUE");function vg(a,o){const{ownerDocument:r=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:c=!1,isDeferredPointerDownOutsideRef:m,dismissableSurfaces:f,shouldHandlePointerDownOutside:h=_b}=o,p=qi(a),y=S.useRef(!1),v=S.useRef(!1),j=S.useRef(new Map),b=S.useRef(()=>{});return S.useEffect(()=>{function x(){v.current=!1,m.current=!1,j.current.clear()}Pe(x,"resetOutsideInteraction");function C(){return Array.from(j.current.values()).some(Boolean)}Pe(C,"isOutsideInteractionIntercepted");function w(q){if(!v.current)return;const Z=q.target;Z instanceof Node&&[...f].some(z=>z.contains(Z))||j.current.set(q.type,!0),q.type==="click"&&window.setTimeout(()=>{v.current&&b.current()},0)}Pe(w,"handleInteractionCapture");function E(q){v.current&&j.current.set(q.type,!1)}Pe(E,"handleInteractionBubble");const O=Pe(q=>{if(q.target&&!y.current){let Z=function(){r.removeEventListener("click",b.current);const z=C();x(),z||_u(Ab,p,V,{discrete:!0})};if(Pe(Z,"handleAndDispatchPointerDownOutsideEvent"),!h(q.target)){r.removeEventListener("click",b.current),x(),y.current=!1;return}const V={originalEvent:q};v.current=!0,m.current=c&&q.button===0,j.current.clear(),!c||q.button!==0?Z():(r.removeEventListener("click",b.current),b.current=Z,r.addEventListener("click",b.current,{once:!0}))}else r.removeEventListener("click",b.current),x();y.current=!1},"handlePointerDown"),k=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const q of k)r.addEventListener(q,w,!0),r.addEventListener(q,E);const B=window.setTimeout(()=>{r.addEventListener("pointerdown",O)},0);return()=>{window.clearTimeout(B),r.removeEventListener("pointerdown",O),r.removeEventListener("click",b.current);for(const q of k)r.removeEventListener(q,w,!0),r.removeEventListener(q,E)}},[r,p,c,m,f,h]),{onPointerDownCapture:Pe(()=>y.current=!0,"onPointerDownCapture")}}Pe(vg,"usePointerDownOutside");function xg(a,o=globalThis==null?void 0:globalThis.document){const r=qi(a),c=S.useRef(!1);return S.useEffect(()=>{const m=Pe(f=>{f.target&&!c.current&&_u(Tb,r,{originalEvent:f},{discrete:!1})},"handleFocus");return o.addEventListener("focusin",m),()=>o.removeEventListener("focusin",m)},[o,r]),{onFocusCapture:Pe(()=>c.current=!0,"onFocusCapture"),onBlurCapture:Pe(()=>c.current=!1,"onBlurCapture")}}Pe(xg,"useFocusOutside");function ru(){const a=new CustomEvent(cu);document.dispatchEvent(a)}Pe(ru,"dispatchUpdate");function _u(a,o,r,{discrete:c}){const m=r.originalEvent.target,f=new CustomEvent(a,{bubbles:!1,cancelable:!0,detail:r});o&&m.addEventListener(a,o,{once:!0}),c?cg(m,f):m.dispatchEvent(f)}Pe(_u,"handleAndDispatchCustomEvent");var Mb=Object.defineProperty,Ob=(a,o)=>Mb(a,"name",{value:o,configurable:!0}),kb=Hi[" useId ".trim().toString()]||(()=>{}),Rb=0;function bg(a){const[o,r]=S.useState(kb());return $t(()=>{a||r(c=>c??String(Rb++))},[a]),a||(o?`radix-${o}`:"")}Ob(bg,"useId");const Db=["top","right","bottom","left"],fl=Math.min,An=Math.max,ys=Math.round,fs=Math.floor,Tn=a=>({x:a,y:a}),Ub={left:"right",right:"left",bottom:"top",top:"bottom"};function Sg(a,o,r){return An(a,fl(o,r))}function Mn(a,o){return typeof a=="function"?a(o):a}function dl(a){return a.split("-")[0]}function Ma(a){return a.split("-")[1]}function Mu(a){return a==="x"?"y":"x"}function Ou(a){return a==="y"?"height":"width"}function tn(a){const o=a[0];return o==="t"||o==="b"?"y":"x"}function ku(a){return Mu(tn(a))}function Lb(a,o,r){r===void 0&&(r=!1);const c=Ma(a),m=ku(a),f=Ou(m);let h=m==="x"?c===(r?"end":"start")?"right":"left":c==="start"?"bottom":"top";return o.reference[f]>o.floating[f]&&(h=vs(h)),[h,vs(h)]}function Hb(a){const o=vs(a);return[uu(a),o,uu(o)]}function uu(a){return a.includes("start")?a.replace("start","end"):a.replace("end","start")}const fp=["left","right"],dp=["right","left"],Bb=["top","bottom"],qb=["bottom","top"];function Gb(a,o,r){switch(a){case"top":case"bottom":return r?o?dp:fp:o?fp:dp;case"left":case"right":return o?Bb:qb;default:return[]}}function Vb(a,o,r,c){const m=Ma(a);let f=Gb(dl(a),r==="start",c);return m&&(f=f.map(h=>h+"-"+m),o&&(f=f.concat(f.map(uu)))),f}function vs(a){const o=dl(a);return Ub[o]+a.slice(o.length)}function Yb(a){var o,r,c,m;return{top:(o=a.top)!=null?o:0,right:(r=a.right)!=null?r:0,bottom:(c=a.bottom)!=null?c:0,left:(m=a.left)!=null?m:0}}function jg(a){return typeof a!="number"?Yb(a):{top:a,right:a,bottom:a,left:a}}function xs(a){const{x:o,y:r,width:c,height:m}=a;return{width:c,height:m,top:r,left:o,right:o+c,bottom:r+m,x:o,y:r}}function mp(a,o,r){let{reference:c,floating:m}=a;const f=tn(o),h=ku(o),p=Ou(h),y=dl(o),v=f==="y",j=c.x+c.width/2-m.width/2,b=c.y+c.height/2-m.height/2,x=c[p]/2-m[p]/2;let C;switch(y){case"top":C={x:j,y:c.y-m.height};break;case"bottom":C={x:j,y:c.y+c.height};break;case"right":C={x:c.x+c.width,y:b};break;case"left":C={x:c.x-m.width,y:b};break;default:C={x:c.x,y:c.y}}const w=Ma(o);return w&&(C[h]+=x*(w==="end"?1:-1)*(r&&v?-1:1)),C}async function Xb(a,o){var r;o===void 0&&(o={});const{x:c,y:m,platform:f,rects:h,elements:p,strategy:y}=a,{boundary:v="clippingAncestors",rootBoundary:j="viewport",elementContext:b="floating",altBoundary:x=!1,padding:C=0}=Mn(o,a),w=jg(C),O=p[x?b==="floating"?"reference":"floating":b],k=xs(await f.getClippingRect({element:(r=await(f.isElement==null?void 0:f.isElement(O)))==null||r?O:O.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(p.floating)),boundary:v,rootBoundary:j,strategy:y})),B=b==="floating"?{x:c,y:m,width:h.floating.width,height:h.floating.height}:h.reference,q=await(f.getOffsetParent==null?void 0:f.getOffsetParent(p.floating)),Z=await(f.isElement==null?void 0:f.isElement(q))&&await(f.getScale==null?void 0:f.getScale(q))||{x:1,y:1},V=xs(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:B,offsetParent:q,strategy:y}):B);return{top:(k.top-V.top+w.top)/Z.y,bottom:(V.bottom-k.bottom+w.bottom)/Z.y,left:(k.left-V.left+w.left)/Z.x,right:(V.right-k.right+w.right)/Z.x}}const Qb=50,Zb=async(a,o,r)=>{const{placement:c="bottom",strategy:m="absolute",middleware:f=[],platform:h}=r,p=h.detectOverflow?h:{...h,detectOverflow:Xb},y=await(h.isRTL==null?void 0:h.isRTL(o));let v=await h.getElementRects({reference:a,floating:o,strategy:m}),{x:j,y:b}=mp(v,c,y),x=c,C=0;const w={};for(let E=0;E<f.length;E++){const O=f[E];if(!O)continue;const{name:k,fn:B}=O,{x:q,y:Z,data:V,reset:z}=await B({x:j,y:b,initialPlacement:c,placement:x,strategy:m,middlewareData:w,rects:v,platform:p,elements:{reference:a,floating:o}});j=q??j,b=Z??b,w[k]={...w[k],...V},z&&C<Qb&&(C++,typeof z=="object"&&(z.placement&&(x=z.placement),z.rects&&(v=z.rects===!0?await h.getElementRects({reference:a,floating:o,strategy:m}):z.rects),{x:j,y:b}=mp(v,x,y)),E=-1)}return{x:j,y:b,placement:x,strategy:m,middlewareData:w}},Kb=a=>({name:"arrow",options:a,async fn(o){const{x:r,y:c,placement:m,rects:f,platform:h,elements:p,middlewareData:y}=o,{element:v,padding:j=0}=Mn(a,o)||{};if(v==null)return{};const b=jg(j),x={x:r,y:c},C=ku(m),w=Ou(C),E=await h.getDimensions(v),O=C==="y",k=O?"top":"left",B=O?"bottom":"right",q=O?"clientHeight":"clientWidth",Z=f.reference[w]+f.reference[C]-x[C]-f.floating[w],V=x[C]-f.reference[C],z=await(h.getOffsetParent==null?void 0:h.getOffsetParent(v));let Q=z?z[q]:0;(!Q||!await(h.isElement==null?void 0:h.isElement(z)))&&(Q=p.floating[q]||f.floating[w]);const W=Z/2-V/2,ne=Q/2-E[w]/2-1,le=fl(b[k],ne),re=fl(b[B],ne),$=Q-E[w]-re,F=Q/2-E[w]/2+W,ie=Sg(le,F,$),J=!y.arrow&&Ma(m)!=null&&F!==ie&&f.reference[w]/2-(F<le?le:re)-E[w]/2<0,A=J?F<le?F-le:F-$:0;return{[C]:x[C]+A,data:{[C]:ie,centerOffset:F-ie-A,...J&&{alignmentOffset:A}},reset:J}}}),$b=function(a){return a===void 0&&(a={}),{name:"flip",options:a,async fn(o){var r,c;const{placement:m,middlewareData:f,rects:h,initialPlacement:p,platform:y,elements:v}=o,{mainAxis:j=!0,crossAxis:b=!0,fallbackPlacements:x,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:E=!0,...O}=Mn(a,o);if((r=f.arrow)!=null&&r.alignmentOffset)return{};const k=dl(m),B=tn(p),q=dl(p)===p,Z=await(y.isRTL==null?void 0:y.isRTL(v.floating)),V=x||(q||!E?[vs(p)]:Hb(p)),z=w!=="none";!x&&z&&V.push(...Vb(p,E,w,Z));const Q=[p,...V],W=await y.detectOverflow(o,O),ne=[];let le=((c=f.flip)==null?void 0:c.overflows)||[];if(j&&ne.push(W[k]),b){const ie=Lb(m,h,Z);ne.push(W[ie[0]],W[ie[1]])}if(le=[...le,{placement:m,overflows:ne}],!ne.every(ie=>ie<=0)){var re,$;const ie=(((re=f.flip)==null?void 0:re.index)||0)+1,J=Q[ie];if(J&&(!(b==="alignment"?B!==tn(J):!1)||le.every(H=>tn(H.placement)===B?H.overflows[0]>0:!0)))return{data:{index:ie,overflows:le},reset:{placement:J}};let A=($=le.filter(D=>D.overflows[0]<=0).sort((D,H)=>D.overflows[1]-H.overflows[1])[0])==null?void 0:$.placement;if(!A)switch(C){case"bestFit":{var F;const D=(F=le.filter(H=>{if(z){const P=tn(H.placement);return P===B||P==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(P=>P>0).reduce((P,se)=>P+se,0)]).sort((H,P)=>H[1]-P[1])[0])==null?void 0:F[0];D&&(A=D);break}case"initialPlacement":A=p;break}if(m!==A)return{reset:{placement:A}}}return{}}}};function hp(a,o){return{top:a.top-o.height,right:a.right-o.width,bottom:a.bottom-o.height,left:a.left-o.width}}function pp(a){return Db.some(o=>a[o]>=0)}const Jb=function(a){return a===void 0&&(a={}),{name:"hide",options:a,async fn(o){const{rects:r,platform:c}=o,{strategy:m="referenceHidden",...f}=Mn(a,o);switch(m){case"referenceHidden":{const h=await c.detectOverflow(o,{...f,elementContext:"reference"}),p=hp(h,r.reference);return{data:{referenceHiddenOffsets:p,referenceHidden:pp(p)}}}case"escaped":{const h=await c.detectOverflow(o,{...f,altBoundary:!0}),p=hp(h,r.floating);return{data:{escapedOffsets:p,escaped:pp(p)}}}default:return{}}}}},wg=new Set(["left","top"]);async function Wb(a,o){const{placement:r,platform:c,elements:m}=a,f=await(c.isRTL==null?void 0:c.isRTL(m.floating)),h=dl(r),p=Ma(r),y=tn(r)==="y",v=wg.has(h)?-1:1,j=f&&y?-1:1,b=Mn(o,a);let{mainAxis:x,crossAxis:C,alignmentAxis:w}=typeof b=="number"?{mainAxis:b,crossAxis:0,alignmentAxis:null}:{mainAxis:b.mainAxis||0,crossAxis:b.crossAxis||0,alignmentAxis:b.alignmentAxis};return p&&typeof w=="number"&&(C=p==="end"?w*-1:w),y?{x:C*j,y:x*v}:{x:x*v,y:C*j}}const Fb=function(a){return a===void 0&&(a=0),{name:"offset",options:a,async fn(o){var r,c;const{x:m,y:f,placement:h,middlewareData:p}=o,y=await Wb(o,a);return h===((r=p.offset)==null?void 0:r.placement)&&(c=p.arrow)!=null&&c.alignmentOffset?{}:{x:m+y.x,y:f+y.y,data:{...y,placement:h}}}}},Pb=function(a){return a===void 0&&(a={}),{name:"shift",options:a,async fn(o){const{x:r,y:c,placement:m,platform:f}=o,{mainAxis:h=!0,crossAxis:p=!1,limiter:y={fn:B=>{let{x:q,y:Z}=B;return{x:q,y:Z}}},...v}=Mn(a,o),j={x:r,y:c},b=await f.detectOverflow(o,v),x=tn(m),C=Mu(x);let w=j[C],E=j[x];const O=(B,q)=>Sg(q+b[B==="y"?"top":"left"],q,q-b[B==="y"?"bottom":"right"]);h&&(w=O(C,w)),p&&(E=O(x,E));const k=y.fn({...o,[C]:w,[x]:E});return{...k,data:{x:k.x-r,y:k.y-c,enabled:{[C]:h,[x]:p}}}}}},Ib=function(a){return a===void 0&&(a={}),{options:a,fn(o){var r,c;const{x:m,y:f,placement:h,rects:p,middlewareData:y}=o,{offset:v=0,mainAxis:j=!0,crossAxis:b=!0}=Mn(a,o),x={x:m,y:f},C=tn(h),w=Mu(C);let E=x[w],O=x[C];const k=Mn(v,o),B=typeof k=="number"?{mainAxis:k,crossAxis:0}:{mainAxis:(r=k.mainAxis)!=null?r:0,crossAxis:(c=k.crossAxis)!=null?c:0};if(j){const V=w==="y"?"height":"width",z=p.reference[w]-p.floating[V]+B.mainAxis,Q=p.reference[w]+p.reference[V]-B.mainAxis;E<z?E=z:E>Q&&(E=Q)}if(b){var q,Z;const V=w==="y"?"width":"height",z=wg.has(dl(h)),Q=p.reference[C]-p.floating[V]+(z&&((q=y.offset)==null?void 0:q[C])||0)+(z?0:B.crossAxis),W=p.reference[C]+p.reference[V]+(z?0:((Z=y.offset)==null?void 0:Z[C])||0)-(z?B.crossAxis:0);O<Q?O=Q:O>W&&(O=W)}return{[w]:E,[C]:O}}}},e2=function(a){return a===void 0&&(a={}),{name:"size",options:a,async fn(o){const{placement:r,rects:c,platform:m,elements:f}=o,{apply:h=()=>{},...p}=Mn(a,o),y=await m.detectOverflow(o,p),v=dl(r),j=Ma(r),b=tn(r)==="y",{width:x,height:C}=c.floating;let w,E;v==="top"||v==="bottom"?(w=v,E=j===(await(m.isRTL==null?void 0:m.isRTL(f.floating))?"start":"end")?"left":"right"):(E=v,w=j==="end"?"top":"bottom");const O=C-y.top-y.bottom,k=x-y.left-y.right,B=fl(C-y[w],O),q=fl(x-y[E],k),Z=o.middlewareData.shift,V=!Z;let z=B,Q=q;Z!=null&&Z.enabled.x&&(Q=k),Z!=null&&Z.enabled.y&&(z=O),V&&!j&&(b?Q=x-2*An(y.left,y.right):z=C-2*An(y.top,y.bottom)),await h({...o,availableWidth:Q,availableHeight:z});const W=await m.getDimensions(f.floating);return x!==W.width||C!==W.height?{reset:{rects:!0}}:{}}}};function js(){return typeof window<"u"}function Oa(a){return Ng(a)?(a.nodeName||"").toLowerCase():"#document"}function pt(a){var o;return(a==null||(o=a.ownerDocument)==null?void 0:o.defaultView)||window}function kn(a){var o;return(o=(Ng(a)?a.ownerDocument:a.document)||window.document)==null?void 0:o.documentElement}function Ng(a){return js()?a instanceof Node||a instanceof pt(a).Node:!1}function nn(a){return js()?a instanceof Element||a instanceof pt(a).Element:!1}function ml(a){return js()?a instanceof HTMLElement||a instanceof pt(a).HTMLElement:!1}function gp(a){return!js()||typeof ShadowRoot>"u"?!1:a instanceof ShadowRoot||a instanceof pt(a).ShadowRoot}function ws(a){const{overflow:o,overflowX:r,overflowY:c,display:m}=ln(a);return/auto|scroll|overlay|hidden|clip/.test(o+c+r)&&m!=="inline"&&m!=="contents"}function t2(a){return/^(table|td|th)$/.test(Oa(a))}function Ns(a){try{if(a.matches(":popover-open"))return!0}catch{}try{return a.matches(":modal")}catch{return!1}}const n2=/transform|translate|scale|rotate|perspective|filter/,l2=/paint|layout|strict|content/,kl=a=>!!a&&a!=="none";let Kr;function Ru(a){const o=nn(a)?ln(a):a;return kl(o.transform)||kl(o.translate)||kl(o.scale)||kl(o.rotate)||kl(o.perspective)||!Du()&&(kl(o.backdropFilter)||kl(o.filter))||n2.test(o.willChange||"")||l2.test(o.contain||"")}function a2(a){let o=Ll(a);for(;ml(o)&&!Di(o);){if(Ru(o))return o;if(Ns(o))return null;o=Ll(o)}return null}function Du(){return Kr==null&&(Kr=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Kr}function Di(a){return/^(html|body|#document)$/.test(Oa(a))}function ln(a){return pt(a).getComputedStyle(a)}function Cs(a){return nn(a)?{scrollLeft:a.scrollLeft,scrollTop:a.scrollTop}:{scrollLeft:a.scrollX,scrollTop:a.scrollY}}function Ll(a){if(Oa(a)==="html")return a;const o=a.assignedSlot||a.parentNode||gp(a)&&a.host||kn(a);return gp(o)?o.host:o}function Cg(a){const o=Ll(a);return Di(o)?(a.ownerDocument||a).body:ml(o)&&ws(o)?o:Cg(o)}function Ui(a,o,r){var c;o===void 0&&(o=[]),r===void 0&&(r=!0);const m=Cg(a),f=m===((c=a.ownerDocument)==null?void 0:c.body),h=pt(m);if(f){const p=fu(h);return o.concat(h,h.visualViewport||[],ws(m)?m:[],p&&r?Ui(p):[])}else return o.concat(m,Ui(m,[],r))}function fu(a){return a.parent&&Object.getPrototypeOf(a.parent)?a.frameElement:null}function Ag(a){const o=ln(a);let r=parseFloat(o.width)||0,c=parseFloat(o.height)||0;const m=ml(a),f=m?a.offsetWidth:r,h=m?a.offsetHeight:c,p=ys(r)!==f||ys(c)!==h;return p&&(r=f,c=h),{width:r,height:c,$:p}}function Uu(a){return nn(a)?a:a.contextElement}function Ea(a){const o=Uu(a);if(!ml(o))return Tn(1);const r=o.getBoundingClientRect(),{width:c,height:m,$:f}=Ag(o);let h=(f?ys(r.width):r.width)/c,p=(f?ys(r.height):r.height)/m;return(!h||!Number.isFinite(h))&&(h=1),(!p||!Number.isFinite(p))&&(p=1),{x:h,y:p}}const i2=Tn(0);function Tg(a){const o=pt(a);return!Du()||!o.visualViewport?i2:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function o2(a,o,r){return o===void 0&&(o=!1),!!r&&o&&r===pt(a)}function Hl(a,o,r,c){o===void 0&&(o=!1),r===void 0&&(r=!1);const m=a.getBoundingClientRect(),f=Uu(a);let h=Tn(1);o&&(c?nn(c)&&(h=Ea(c)):h=Ea(a));const p=o2(f,r,c)?Tg(f):Tn(0);let y=(m.left+p.x)/h.x,v=(m.top+p.y)/h.y,j=m.width/h.x,b=m.height/h.y;if(f&&c){const x=pt(f),C=nn(c)?pt(c):c;let w=x,E=fu(w);for(;E&&C!==w;){const O=Ea(E),k=E.getBoundingClientRect(),B=ln(E),q=k.left+(E.clientLeft+parseFloat(B.paddingLeft))*O.x,Z=k.top+(E.clientTop+parseFloat(B.paddingTop))*O.y;y*=O.x,v*=O.y,j*=O.x,b*=O.y,y+=q,v+=Z,w=pt(E),E=fu(w)}}return xs({width:j,height:b,x:y,y:v})}function As(a,o){const r=Cs(a).scrollLeft;return o?o.left+r:Hl(kn(a)).left+r}function Eg(a,o){const r=a.getBoundingClientRect(),c=r.left+o.scrollLeft-As(a,r),m=r.top+o.scrollTop;return{x:c,y:m}}function s2(a){let{elements:o,rect:r,offsetParent:c,strategy:m}=a;const f=m==="fixed",h=kn(c),p=o?Ns(o.floating):!1;if(c===h||p&&f)return r;let y={scrollLeft:0,scrollTop:0},v=Tn(1);const j=Tn(0),b=ml(c);if((b||!f)&&((Oa(c)!=="body"||ws(h))&&(y=Cs(c)),b)){const C=Hl(c);v=Ea(c),j.x=C.x+c.clientLeft,j.y=C.y+c.clientTop}const x=h&&!b&&!f?Eg(h,y):Tn(0);return{width:r.width*v.x,height:r.height*v.y,x:r.x*v.x-y.scrollLeft*v.x+j.x+x.x,y:r.y*v.y-y.scrollTop*v.y+j.y+x.y}}function c2(a){return a.getClientRects?Array.from(a.getClientRects()):[]}function r2(a){const o=Cs(a),r=a.ownerDocument.body,c=An(a.scrollWidth,a.clientWidth,r.scrollWidth,r.clientWidth),m=An(a.scrollHeight,a.clientHeight,r.scrollHeight,r.clientHeight);let f=-o.scrollLeft+As(a);const h=-o.scrollTop;return ln(r).direction==="rtl"&&(f+=An(a.clientWidth,r.clientWidth)-c),{width:c,height:m,x:f,y:h}}const u2=25;function f2(a,o,r){r===void 0&&(r="viewport");const c=r==="layoutViewport",m=pt(a),f=kn(a),h=m.visualViewport;let p=f.clientWidth,y=f.clientHeight,v=0,j=0;if(h){const x=!Du()||o==="fixed";c?x||(v=-h.offsetLeft,j=-h.offsetTop):(p=h.width,y=h.height,x&&(v=h.offsetLeft,j=h.offsetTop))}if(As(f)<=0){const x=f.ownerDocument,C=x.body,w=getComputedStyle(C),E=x.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,O=Math.abs(f.clientWidth-C.clientWidth-E),k=getComputedStyle(f).scrollbarGutter==="stable both-edges"?O/2:O;k<=u2&&(p-=k)}return{width:p,height:y,x:v,y:j}}function d2(a,o){const r=Hl(a,!0,o==="fixed"),c=r.top+a.clientTop,m=r.left+a.clientLeft,f=Ea(a),h=a.clientWidth*f.x,p=a.clientHeight*f.y,y=m*f.x,v=c*f.y;return{width:h,height:p,x:y,y:v}}function yp(a,o,r){let c;if(o==="viewport"||o==="layoutViewport")c=f2(a,r,o);else if(o==="document")c=r2(kn(a));else if(nn(o))c=d2(o,r);else{const m=Tg(a);c={x:o.x-m.x,y:o.y-m.y,width:o.width,height:o.height}}return xs(c)}function m2(a,o){const r=o.get(a);if(r)return r;let c=Ui(a,[],!1).filter(p=>nn(p)&&Oa(p)!=="body"),m=null;const f=ln(a).position==="fixed";let h=f?Ll(a):a;for(;nn(h)&&!Di(h);){const p=ln(h),y=Ru(h),v=m?m.position:f?"fixed":"";!y&&(v==="fixed"||v==="absolute"&&p.position==="static")?c=c.filter(b=>b!==h):m=p,h=Ll(h)}return o.set(a,c),c}function h2(a){let{element:o,boundary:r,rootBoundary:c,strategy:m}=a;const h=[...r==="clippingAncestors"?Ns(o)?[]:m2(o,this._c):[].concat(r),c],p=yp(o,h[0],m);let y=p.top,v=p.right,j=p.bottom,b=p.left;for(let x=1;x<h.length;x++){const C=yp(o,h[x],m);y=An(C.top,y),v=fl(C.right,v),j=fl(C.bottom,j),b=An(C.left,b)}return{width:v-b,height:j-y,x:b,y}}function p2(a){const{width:o,height:r}=Ag(a);return{width:o,height:r}}function g2(a,o,r){const c=ml(o),m=kn(o),f=r==="fixed",h=Hl(a,!0,f,o);let p={scrollLeft:0,scrollTop:0};const y=Tn(0);if((c||!f)&&((Oa(o)!=="body"||ws(m))&&(p=Cs(o)),c)){const x=Hl(o,!0,f,o);y.x=x.x+o.clientLeft,y.y=x.y+o.clientTop}!c&&m&&(y.x=As(m));const v=m&&!c&&!f?Eg(m,p):Tn(0),j=h.left+p.scrollLeft-y.x-v.x,b=h.top+p.scrollTop-y.y-v.y;return{x:j,y:b,width:h.width,height:h.height}}function $r(a){return ln(a).position==="static"}function vp(a,o){if(!ml(a)||ln(a).position==="fixed")return null;if(o)return o(a);let r=a.offsetParent;return kn(a)===r&&(r=r.ownerDocument.body),r}function zg(a,o){const r=pt(a);if(Ns(a))return r;if(!ml(a)){let m=Ll(a);for(;m&&!Di(m);){if(nn(m)&&!$r(m))return m;m=Ll(m)}return r}let c=vp(a,o);for(;c&&t2(c)&&$r(c);)c=vp(c,o);return c&&Di(c)&&$r(c)&&!Ru(c)?r:c||a2(a)||r}const y2=async function(a){const o=this.getOffsetParent||zg,r=this.getDimensions,c=await r(a.floating);return{reference:g2(a.reference,await o(a.floating),a.strategy),floating:{x:0,y:0,width:c.width,height:c.height}}};function v2(a){return ln(a).direction==="rtl"}const x2={convertOffsetParentRelativeRectToViewportRelativeRect:s2,getDocumentElement:kn,getClippingRect:h2,getOffsetParent:zg,getElementRects:y2,getClientRects:c2,getDimensions:p2,getScale:Ea,isElement:nn,isRTL:v2};function _g(a,o){return a.x===o.x&&a.y===o.y&&a.width===o.width&&a.height===o.height}function b2(a,o,r){let c=null,m;const f=kn(a);function h(){var j;clearTimeout(m),(j=c)==null||j.disconnect(),c=null}function p(j,b){j===void 0&&(j=!1),b===void 0&&(b=1),h();const x=a.getBoundingClientRect(),{left:C,top:w,width:E,height:O}=x;if(j||o(),!E||!O)return;const k=fs(w),B=fs(f.clientWidth-(C+E)),q=fs(f.clientHeight-(w+O)),Z=fs(C),z={rootMargin:-k+"px "+-B+"px "+-q+"px "+-Z+"px",threshold:An(0,fl(1,b))||1};let Q=!0;function W(ne){const le=ne[0].intersectionRatio;if(!_g(x,a.getBoundingClientRect()))return p();if(le!==b){if(!Q)return p();le?p(!1,le):m=setTimeout(()=>{p(!1,1e-7)},1e3)}Q=!1}try{c=new IntersectionObserver(W,{...z,root:f.ownerDocument})}catch{c=new IntersectionObserver(W,z)}c.observe(a)}const y=pt(a),v=()=>p(r);return y.addEventListener("resize",v),p(!0),()=>{y.removeEventListener("resize",v),h()}}function S2(a,o,r,c){c===void 0&&(c={});const{ancestorScroll:m=!0,ancestorResize:f=!0,elementResize:h=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:y=!1}=c,v=Uu(a),j=m||f?[...v?Ui(v):[],...o?Ui(o):[]]:[];j.forEach(k=>{m&&k.addEventListener("scroll",r),f&&k.addEventListener("resize",r)});const b=v&&p?b2(v,r,f):null;let x=-1,C=null;h&&(C=new ResizeObserver(k=>{let[B]=k;B&&B.target===v&&C&&o&&(C.unobserve(o),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var q;(q=C)==null||q.observe(o)})),r()}),v&&!y&&C.observe(v),o&&C.observe(o));let w,E=y?Hl(a):null;y&&O();function O(){const k=Hl(a);E&&!_g(E,k)&&r(),E=k,w=requestAnimationFrame(O)}return r(),()=>{var k;j.forEach(B=>{m&&B.removeEventListener("scroll",r),f&&B.removeEventListener("resize",r)}),b==null||b(),(k=C)==null||k.disconnect(),C=null,y&&cancelAnimationFrame(w)}}const j2=Fb,w2=Pb,N2=$b,C2=e2,A2=Jb,xp=Kb,T2=Ib,E2=(a,o,r)=>{const c=new Map,m=r??{},f={...x2,...m.platform,_c:c};return Zb(a,o,{...m,platform:f})};var z2=typeof document<"u",_2=function(){},ps=z2?S.useLayoutEffect:_2;function bs(a,o){if(a===o)return!0;if(typeof a!=typeof o)return!1;if(typeof a=="function"&&a.toString()===o.toString())return!0;let r,c,m;if(a&&o&&typeof a=="object"){if(Array.isArray(a)){if(r=a.length,r!==o.length)return!1;for(c=r;c--!==0;)if(!bs(a[c],o[c]))return!1;return!0}if(m=Object.keys(a),r=m.length,r!==Object.keys(o).length)return!1;for(c=r;c--!==0;)if(!{}.hasOwnProperty.call(o,m[c]))return!1;for(c=r;c--!==0;){const f=m[c];if(!(f==="_owner"&&a.$$typeof)&&!bs(a[f],o[f]))return!1}return!0}return a!==a&&o!==o}function Mg(a){return typeof window>"u"?1:(a.ownerDocument.defaultView||window).devicePixelRatio||1}function bp(a,o){const r=Mg(a);return Math.round(o*r)/r}function Jr(a){const o=S.useRef(a);return ps(()=>{o.current=a}),o}function M2(a){a===void 0&&(a={});const{placement:o="bottom",strategy:r="absolute",middleware:c=[],platform:m,elements:{reference:f,floating:h}={},transform:p=!0,whileElementsMounted:y,open:v}=a,[j,b]=S.useState({x:0,y:0,strategy:r,placement:o,middlewareData:{},isPositioned:!1}),[x,C]=S.useState(c);bs(x,c)||C(c);const[w,E]=S.useState(null),[O,k]=S.useState(null),B=S.useCallback(H=>{H!==z.current&&(z.current=H,E(H))},[]),q=S.useCallback(H=>{H!==Q.current&&(Q.current=H,k(H))},[]),Z=f||w,V=h||O,z=S.useRef(null),Q=S.useRef(null),W=S.useRef(j),ne=y!=null,le=Jr(y),re=Jr(m),$=Jr(v),F=S.useCallback(()=>{if(!z.current||!Q.current)return;const H={placement:o,strategy:r,middleware:x};re.current&&(H.platform=re.current),E2(z.current,Q.current,H).then(P=>{const se={...P,isPositioned:$.current!==!1};ie.current&&!bs(W.current,se)&&(W.current=se,hu.flushSync(()=>{b(se)}))})},[x,o,r,re,$]);ps(()=>{v===!1&&W.current.isPositioned&&(W.current.isPositioned=!1,b(H=>({...H,isPositioned:!1})))},[v]);const ie=S.useRef(!1);ps(()=>(ie.current=!0,()=>{ie.current=!1}),[]),ps(()=>{if(Z&&(z.current=Z),V&&(Q.current=V),Z&&V){if(le.current)return le.current(Z,V,F);F()}},[Z,V,F,le,ne]);const J=S.useMemo(()=>({reference:z,floating:Q,setReference:B,setFloating:q}),[B,q]),A=S.useMemo(()=>({reference:Z,floating:V}),[Z,V]),D=S.useMemo(()=>{const H={position:r,left:0,top:0};if(!A.floating)return H;const P=bp(A.floating,j.x),se=bp(A.floating,j.y);return p?{...H,transform:"translate("+P+"px, "+se+"px)",...Mg(A.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:P,top:se}},[r,p,A.floating,j.x,j.y]);return S.useMemo(()=>({...j,update:F,refs:J,elements:A,floatingStyles:D}),[j,F,J,A,D])}const O2=a=>{function o(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:a,fn(r){const{element:c,padding:m}=typeof a=="function"?a(r):a;return c&&o(c)?c.current!=null?xp({element:c.current,padding:m}).fn(r):{}:c?xp({element:c,padding:m}).fn(r):{}}}},k2=(a,o)=>{const r=j2(a);return{name:r.name,fn:r.fn,options:[a,o]}},R2=(a,o)=>{const r=w2(a);return{name:r.name,fn:r.fn,options:[a,o]}},D2=(a,o)=>({fn:T2(a).fn,options:[a,o]}),U2=(a,o)=>{const r=N2(a);return{name:r.name,fn:r.fn,options:[a,o]}},L2=(a,o)=>{const r=C2(a);return{name:r.name,fn:r.fn,options:[a,o]}},H2=(a,o)=>{const r=A2(a);return{name:r.name,fn:r.fn,options:[a,o]}},B2=(a,o)=>{const r=O2(a);return{name:r.name,fn:r.fn,options:[a,o]}};var q2=Object.defineProperty,G2=(a,o)=>q2(a,"name",{value:o,configurable:!0}),V2=S.forwardRef(G2(function(o,r){const{children:c,width:m=10,height:f=5,...h}=o;return u.jsx(Vt.svg,{...h,ref:r,width:m,height:f,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:o.asChild?c:u.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),Y2=V2,X2=Object.defineProperty,En=(a,o)=>X2(a,"name",{value:o,configurable:!0}),Og="Popper",[kg,Rg]=Ss(Og),[Q2,Dg]=kg(Og),Z2=En(a=>{const{__scopePopper:o,children:r}=a,[c,m]=S.useState(null),[f,h]=S.useState(void 0);return u.jsx(Q2,{scope:o,anchor:c,onAnchorChange:m,placementState:f,setPlacementState:h,children:r})},"Popper"),K2="PopperAnchor",$2=S.forwardRef(En(function(o,r){const{__scopePopper:c,virtualRef:m,...f}=o,h=Dg(K2,c),p=S.useRef(null),y=h.onAnchorChange,v=S.useCallback(E=>{p.current=E,E&&y(E)},[y]),j=On(r,v),b=S.useRef(null);S.useEffect(()=>{if(!m)return;const E=b.current;b.current=m.current,E!==b.current&&y(b.current)});const x=h.placementState&&Ts(h.placementState),C=x==null?void 0:x[0],w=x==null?void 0:x[1];return m?null:u.jsx(Vt.div,{"data-radix-popper-side":C,"data-radix-popper-align":w,...f,ref:j})},"PopperAnchor")),Ug="PopperContent",[J2,W2]=kg(Ug),F2=S.forwardRef(En(function(o,r){var Yt,K,I,ee,ue,Be,Dn;const{__scopePopper:c,side:m="bottom",sideOffset:f=0,align:h="center",alignOffset:p=0,arrowPadding:y=0,avoidCollisions:v=!0,collisionBoundary:j=[],collisionPadding:b=0,sticky:x="partial",hideWhenDetached:C=!1,updatePositionStrategy:w="optimized",onPlaced:E,...O}=o,k=Dg(Ug,c),[B,q]=S.useState(null),Z=On(r,q),[V,z]=S.useState(null),Q=Cu(V),W=(Q==null?void 0:Q.width)??0,ne=(Q==null?void 0:Q.height)??0,le=m+(h!=="center"?"-"+h:""),re=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},$=Array.isArray(j)?j:[j],F=$.length>0,ie={padding:re,boundary:$.filter(Lg),altBoundary:F},{refs:J,floatingStyles:A,placement:D,isPositioned:H,middlewareData:P}=M2({strategy:"fixed",placement:le,whileElementsMounted:En((...hl)=>S2(...hl,{animationFrame:w==="always"}),"whileElementsMounted"),elements:{reference:k.anchor},middleware:[k2({mainAxis:f+ne,alignmentAxis:p}),v&&R2({mainAxis:!0,crossAxis:!1,limiter:x==="partial"?D2():void 0,...ie}),v&&U2({...ie}),L2({...ie,apply:En(({elements:hl,rects:Xi,availableWidth:Qi,availableHeight:ka})=>{const{width:Ra,height:Da}=Xi.reference,Bl=hl.floating.style;Bl.setProperty("--radix-popper-available-width",`${Qi}px`),Bl.setProperty("--radix-popper-available-height",`${ka}px`),Bl.setProperty("--radix-popper-anchor-width",`${Ra}px`),Bl.setProperty("--radix-popper-anchor-height",`${Da}px`)},"apply")}),V&&B2({element:V,padding:y}),tS({arrowWidth:W,arrowHeight:ne}),C&&H2({strategy:"referenceHidden",...ie,boundary:F?ie.boundary:void 0})]}),se=k.setPlacementState;$t(()=>(se(D),()=>{se(void 0)}),[D,se]);const[je,ze]=Ts(D),pe=qi(E);$t(()=>{H&&(pe==null||pe())},[H,pe]);const He=(Yt=P.arrow)==null?void 0:Yt.x,st=(K=P.arrow)==null?void 0:K.y,zt=((I=P.arrow)==null?void 0:I.centerOffset)!==0,[Rn,Wt]=S.useState();return $t(()=>{B&&Wt(window.getComputedStyle(B).zIndex)},[B]),u.jsx("div",{ref:J.setFloating,"data-radix-popper-content-wrapper":"",style:{...A,transform:H?A.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Rn,"--radix-popper-transform-origin":[(ee=P.transformOrigin)==null?void 0:ee.x,(ue=P.transformOrigin)==null?void 0:ue.y].join(" "),...((Be=P.hide)==null?void 0:Be.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:o.dir,children:u.jsx(J2,{scope:c,placedSide:je,placedAlign:ze,onArrowChange:z,arrowX:He,arrowY:st,shouldHideArrow:zt,children:u.jsx(Vt.div,{"data-side":je,"data-align":ze,...O,ref:Z,style:{...O.style,animation:H?(Dn=O.style)==null?void 0:Dn.animation:"none"}})})})},"PopperContent")),P2="PopperArrow",I2={top:"bottom",right:"left",bottom:"top",left:"right"},eS=S.forwardRef(En(function(o,r){const{__scopePopper:c,...m}=o,f=W2(P2,c),h=I2[f.placedSide];return u.jsx("span",{ref:f.onArrowChange,style:{position:"absolute",left:f.arrowX,top:f.arrowY,[h]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[f.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[f.placedSide],visibility:f.shouldHideArrow?"hidden":void 0},children:u.jsx(Y2,{...m,ref:r,style:{...m.style,display:"block"}})})},"PopperArrow"));function Lg(a){return a!==null}En(Lg,"isNotNull");var tS=En(a=>({name:"transformOrigin",options:a,fn(o){var O,k,B;const{placement:r,rects:c,middlewareData:m}=o,h=((O=m.arrow)==null?void 0:O.centerOffset)!==0,p=h?0:a.arrowWidth,y=h?0:a.arrowHeight,[v,j]=Ts(r),b={start:"0%",center:"50%",end:"100%"}[j],x=(((k=m.arrow)==null?void 0:k.x)??0)+p/2,C=(((B=m.arrow)==null?void 0:B.y)??0)+y/2;let w="",E="";return v==="bottom"?(w=h?b:`${x}px`,E=`${-y}px`):v==="top"?(w=h?b:`${x}px`,E=`${c.floating.height+y}px`):v==="right"?(w=`${-y}px`,E=h?b:`${C}px`):v==="left"&&(w=`${c.floating.width+y}px`,E=h?b:`${C}px`),{data:{x:w,y:E}}}}),"transformOrigin");function Ts(a){const[o,r="center"]=a.split("-");return[o,r]}En(Ts,"getSideAndAlignFromPlacement");var nS=Z2,lS=$2,aS=F2,iS=eS,oS=Object.defineProperty,sS=(a,o)=>oS(a,"name",{value:o,configurable:!0}),cS=S.forwardRef(sS(function(o,r){var y;const{container:c,...m}=o,[f,h]=S.useState(!1);$t(()=>h(!0),[]);const p=c||f&&((y=globalThis==null?void 0:globalThis.document)==null?void 0:y.body);return p?hu.createPortal(u.jsx(Vt.div,{...m,ref:r}),p):null},"Portal")),rS=Object.defineProperty,uS=(a,o)=>rS(a,"name",{value:o,configurable:!0}),fS=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),dS=S.forwardRef(uS(function(o,r){return u.jsx(Vt.span,{...o,ref:r,style:{...fS,...o.style}})},"VisuallyHidden")),mS=dS,hS=Object.defineProperty,Je=(a,o)=>hS(a,"name",{value:o,configurable:!0}),[Lu,V3]=Ss("Tooltip",[Rg]),Es=Rg(),pS="TooltipProvider",gS=700,du="tooltip.open",[yS,Hu]=Lu(pS),vS=Je(a=>{const{__scopeTooltip:o,delayDuration:r=gS,skipDelayDuration:c=300,disableHoverableContent:m=!1,children:f}=a,h=S.useRef(!0),p=S.useRef(!1),y=S.useRef(0);return S.useEffect(()=>{const v=y.current;return()=>window.clearTimeout(v)},[]),u.jsx(yS,{scope:o,isOpenDelayedRef:h,delayDuration:r,onOpen:S.useCallback(()=>{c<=0||(window.clearTimeout(y.current),h.current=!1)},[c]),onClose:S.useCallback(()=>{c<=0||(window.clearTimeout(y.current),y.current=window.setTimeout(()=>h.current=!0,c))},[c]),isPointerInTransitRef:p,onPointerInTransitChange:S.useCallback(v=>{p.current=v},[]),disableHoverableContent:m,children:f})},"TooltipProvider"),mu="Tooltip",[xS,Gi]=Lu(mu),bS=Je(a=>{const{__scopeTooltip:o,children:r,open:c,defaultOpen:m,onOpenChange:f,disableHoverableContent:h,delayDuration:p}=a,y=Hu(mu,a.__scopeTooltip),v=Es(o),[j,b]=S.useState(null),[x,C]=S.useState(void 0),w=bg(),E=S.useRef(0),O=h??y.disableHoverableContent,k=p??y.delayDuration,B=S.useRef(!1),[q,Z]=Nu({prop:c,defaultProp:m??!1,onChange:Je(le=>{le?(y.onOpen(),document.dispatchEvent(new CustomEvent(du))):y.onClose(),f==null||f(le)},"onChange"),caller:mu}),V=S.useMemo(()=>q?B.current?"delayed-open":"instant-open":"closed",[q]),z=S.useCallback(()=>{window.clearTimeout(E.current),E.current=0,B.current=!1,Z(!0)},[Z]),Q=S.useCallback(()=>{window.clearTimeout(E.current),E.current=0,Z(!1)},[Z]),W=S.useCallback(()=>{window.clearTimeout(E.current),E.current=window.setTimeout(()=>{B.current=!0,Z(!0),E.current=0},k)},[k,Z]);S.useEffect(()=>()=>{E.current&&(window.clearTimeout(E.current),E.current=0)},[]);const ne=x??w;return u.jsx(nS,{...v,children:u.jsx(xS,{scope:o,contentId:ne,setContentId:C,open:q,stateAttribute:V,trigger:j,onTriggerChange:b,onTriggerEnter:S.useCallback(()=>{y.isOpenDelayedRef.current?W():z()},[y.isOpenDelayedRef,W,z]),onTriggerLeave:S.useCallback(()=>{O?Q():(window.clearTimeout(E.current),E.current=0)},[Q,O]),onOpen:z,onClose:Q,disableHoverableContent:O,children:r})})},"Tooltip"),Sp="TooltipTrigger",SS=S.forwardRef(Je(function(o,r){const{__scopeTooltip:c,...m}=o,f=Gi(Sp,c),h=Hu(Sp,c),p=Es(c),y=S.useRef(null),v=On(r,y,f.onTriggerChange),j=S.useRef(!1),b=S.useRef(!1),x=S.useCallback(()=>j.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",x),[x]),u.jsx(lS,{asChild:!0,...p,children:u.jsx(Vt.button,{"aria-describedby":f.open?f.contentId:void 0,"data-state":f.stateAttribute,...m,ref:v,onPointerMove:Et(o.onPointerMove,C=>{C.pointerType!=="touch"&&!b.current&&!h.isPointerInTransitRef.current&&(f.onTriggerEnter(),b.current=!0)}),onPointerLeave:Et(o.onPointerLeave,()=>{f.onTriggerLeave(),b.current=!1}),onPointerDown:Et(o.onPointerDown,()=>{f.open&&f.onClose(),j.current=!0,document.addEventListener("pointerup",x,{once:!0})}),onFocus:Et(o.onFocus,()=>{j.current||f.onOpen()}),onBlur:Et(o.onBlur,f.onClose),onClick:Et(o.onClick,f.onClose)})})},"TooltipTrigger")),Hg="TooltipPortal",[jS,wS]=Lu(Hg,{forceMount:void 0}),NS=Je(a=>{const{__scopeTooltip:o,forceMount:r,children:c,container:m}=a,f=Gi(Hg,o);return u.jsx(jS,{scope:o,forceMount:r,children:u.jsx(Au,{present:r||f.open,children:u.jsx(cS,{asChild:!0,container:m,children:c})})})},"TooltipPortal"),Li="TooltipContent",CS=S.forwardRef(Je(function(o,r){const c=wS(Li,o.__scopeTooltip),{forceMount:m=c.forceMount,side:f="top",...h}=o,p=Gi(Li,o.__scopeTooltip);return u.jsx(Au,{present:m||p.open,children:p.disableHoverableContent?u.jsx(Bg,{side:f,...h,ref:r}):u.jsx(AS,{side:f,...h,ref:r})})},"TooltipContent")),AS=S.forwardRef(Je(function(o,r){const c=Gi(Li,o.__scopeTooltip),m=Hu(Li,o.__scopeTooltip),f=S.useRef(null),h=On(r,f),[p,y]=S.useState(null),{trigger:v,onClose:j}=c,b=f.current,{onPointerInTransitChange:x}=m,C=S.useCallback(()=>{y(null),x(!1)},[x]),w=S.useCallback((E,O)=>{const k=E.currentTarget,B={x:E.clientX,y:E.clientY},q=qg(B,k.getBoundingClientRect()),Z=Gg(B,q),V=Vg(O.getBoundingClientRect()),z=Xg([...Z,...V]);y(z),x(!0)},[x]);return S.useEffect(()=>()=>C(),[C]),S.useEffect(()=>{if(v&&b){const E=Je(k=>w(k,b),"handleTriggerLeave"),O=Je(k=>w(k,v),"handleContentLeave");return v.addEventListener("pointerleave",E),b.addEventListener("pointerleave",O),()=>{v.removeEventListener("pointerleave",E),b.removeEventListener("pointerleave",O)}}},[v,b,w,C]),S.useEffect(()=>{if(p){const E=Je(O=>{const k=O.target,B={x:O.clientX,y:O.clientY},q=(v==null?void 0:v.contains(k))||(b==null?void 0:b.contains(k)),Z=!Yg(B,p);q?C():Z&&(C(),j())},"handleTrackPointerGrace");return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[v,b,p,j,C]),u.jsx(Bg,{...o,ref:h})},"TooltipContentHoverable")),TS=Zp("TooltipContent"),Bg=S.forwardRef(Je(function(o,r){const{__scopeTooltip:c,children:m,"aria-label":f,id:h,onEscapeKeyDown:p,onPointerDownOutside:y,...v}=o,j=Gi(Li,c),b=Es(c),{onClose:x}=j;S.useEffect(()=>(document.addEventListener(du,x),()=>document.removeEventListener(du,x)),[x]),S.useEffect(()=>{if(j.trigger){const w=Je(E=>{E.target instanceof Node&&E.target.contains(j.trigger)&&x()},"handleScroll");return window.addEventListener("scroll",w,{capture:!0}),()=>window.removeEventListener("scroll",w,{capture:!0})}},[j.trigger,x]);const{setContentId:C}=j;return $t(()=>(C(h),()=>{C(void 0)}),[h,C]),u.jsx(Eb,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:p,onPointerDownOutside:y,onFocusOutside:w=>w.preventDefault(),onDismiss:x,children:u.jsxs(aS,{"data-state":j.stateAttribute,role:f?void 0:"tooltip",id:f?void 0:j.contentId,...b,...v,ref:r,style:{...v.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(TS,{children:m}),f?u.jsx(mS,{id:j.contentId,role:"tooltip",children:f}):null]})})},"TooltipContentImpl")),ES=S.forwardRef(Je(function(o,r){const{__scopeTooltip:c,...m}=o,f=Es(c);return u.jsx(iS,{...f,...m,ref:r})},"TooltipArrow"));function qg(a,o){const r=Math.abs(o.top-a.y),c=Math.abs(o.bottom-a.y),m=Math.abs(o.right-a.x),f=Math.abs(o.left-a.x);switch(Math.min(r,c,m,f)){case f:return"left";case m:return"right";case r:return"top";case c:return"bottom";default:throw new Error("unreachable")}}Je(qg,"getExitSideFromRect");function Gg(a,o,r=5){const c=[];switch(o){case"top":c.push({x:a.x-r,y:a.y+r},{x:a.x+r,y:a.y+r});break;case"bottom":c.push({x:a.x-r,y:a.y-r},{x:a.x+r,y:a.y-r});break;case"left":c.push({x:a.x+r,y:a.y-r},{x:a.x+r,y:a.y+r});break;case"right":c.push({x:a.x-r,y:a.y-r},{x:a.x-r,y:a.y+r});break}return c}Je(Gg,"getPaddedExitPoints");function Vg(a){const{top:o,right:r,bottom:c,left:m}=a;return[{x:m,y:o},{x:r,y:o},{x:r,y:c},{x:m,y:c}]}Je(Vg,"getPointsFromRect");function Yg(a,o){const{x:r,y:c}=a;let m=!1;for(let f=0,h=o.length-1;f<o.length;h=f++){const p=o[f],y=o[h],v=p.x,j=p.y,b=y.x,x=y.y;j>c!=x>c&&r<(b-v)*(c-j)/(x-j)+v&&(m=!m)}return m}Je(Yg,"isPointInPolygon");function Xg(a){const o=a.slice();return o.sort((r,c)=>r.x<c.x?-1:r.x>c.x?1:r.y<c.y?-1:r.y>c.y?1:0),Qg(o)}Je(Xg,"getHull");function Qg(a){if(a.length<=1)return a.slice();const o=[];for(let c=0;c<a.length;c++){const m=a[c];for(;o.length>=2;){const f=o[o.length-1],h=o[o.length-2];if((f.x-h.x)*(m.y-h.y)>=(f.y-h.y)*(m.x-h.x))o.pop();else break}o.push(m)}o.pop();const r=[];for(let c=a.length-1;c>=0;c--){const m=a[c];for(;r.length>=2;){const f=r[r.length-1],h=r[r.length-2];if((f.x-h.x)*(m.y-h.y)>=(f.y-h.y)*(m.x-h.x))r.pop();else break}r.push(m)}return r.pop(),o.length===1&&r.length===1&&o[0].x===r[0].x&&o[0].y===r[0].y?o:o.concat(r)}Je(Qg,"getHullPresorted");var zS=vS,_S=bS,MS=SS,OS=NS,kS=CS,RS=ES;function DS({delayDuration:a=0,...o}){return u.jsx(zS,{"data-slot":"tooltip-provider",delayDuration:a,...o})}function Zg({...a}){return u.jsx(DS,{children:u.jsx(_S,{"data-slot":"tooltip",...a})})}function Kg({...a}){return u.jsx(MS,{"data-slot":"tooltip-trigger",...a})}function $g({className:a,sideOffset:o=6,children:r,...c}){return u.jsx(OS,{children:u.jsxs(kS,{"data-slot":"tooltip-content",sideOffset:o,className:ge("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",a),...c,children:[r,u.jsx(RS,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function jp({config:a,activeView:o,onSelectView:r,onNavigate:c,className:m}){return u.jsxs("aside",{className:ge("flex w-64 shrink-0 flex-col overflow-y-auto border-r bg-sidebar text-sidebar-foreground",m),children:[u.jsxs("div",{className:"flex items-center gap-3 px-5 py-5",children:[u.jsx("div",{className:"flex size-10 shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-primary to-primary/60 text-primary-foreground shadow-sm ring-1 ring-border/40",children:u.jsx(Iv,{className:"size-5"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("h1",{className:"truncate text-sm leading-tight font-semibold tracking-tight",children:"Free Claude Code"}),u.jsx("p",{className:"text-xs text-muted-foreground",children:"Server Control"})]})]}),u.jsx("div",{className:"px-5 pt-1 pb-2 text-[10px] font-semibold tracking-wider text-muted-foreground uppercase",children:"Configuration"}),u.jsx("nav",{className:"flex flex-col gap-1 px-3","aria-label":"Admin views",children:ul.map(f=>{const h=f.id===o,p=f.icon;return u.jsxs(Zg,{children:[u.jsx(Kg,{asChild:!0,children:u.jsxs("button",{type:"button",className:ge("flex items-center gap-3 rounded-md px-3 py-2 text-left text-sm font-medium transition-colors",h?"bg-accent text-accent-foreground shadow-sm ring-1 ring-primary/20":"text-muted-foreground hover:bg-accent/50 hover:text-foreground"),"aria-current":h?"page":void 0,onClick:()=>{r(f.id),c==null||c()},children:[u.jsx(p,{className:ge("size-4 shrink-0",h?"text-primary":"text-muted-foreground")}),f.label]})}),u.jsx($g,{side:"right",children:f.description})]},f.id)})}),u.jsxs("div",{className:"mt-auto space-y-2 px-5 py-4",children:[u.jsx(jb,{}),u.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[u.jsx(ox,{className:"size-3.5 shrink-0"}),"Managed config"]}),u.jsx("p",{className:"break-all rounded-md bg-muted/40 px-2.5 py-2 font-mono text-[11px] leading-relaxed text-muted-foreground/80",children:a.paths.managed})]})]})}const Wr=60,Jg=[{key:"15m",label:"15m",seconds:900},{key:"1h",label:"1h",seconds:3600},{key:"6h",label:"6h",seconds:360*60},{key:"24h",label:"24h",seconds:1440*60},{key:"all",label:"All",seconds:null}],US=["#2a78d6","#eb6834","#1baf7a","#eda100","#e87ba4","#008300","#4a3aa7","#e34948"],LS=["#3987e5","#d95926","#199e70","#c98500","#d55181","#008300","#9085e9","#e66767"];function Bu(a){return a?LS:US}const HS={input:"#2a78d6",output:"#eb6834",cacheRead:"#1baf7a",cacheWrite:"#eda100",reasoning:"#e87ba4"},BS={input:"#3987e5",output:"#d95926",cacheRead:"#199e70",cacheWrite:"#c98500",reasoning:"#d55181"};function Ul(a,o){return(o?BS:HS)[a]}const Dl={success:"#0ca30c",error:"#d03b3b",cancelled:"#fab219"},qS=["#86b6ef","#6da7ec","#3987e5","#1c5cab"],GS=["#5598e7","#2a78d6","#256abf","#184f95"],VS="#f0efec",YS="#383835",XS="#2a78d6",QS="#5598e7",ZS="#1c5cab",ds=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],KS=Array.from({length:24},(a,o)=>String(o).padStart(2,"0"));function $S(a,o,r){const c=Jg.find(m=>m.key===o);return!c||c.seconds===null?a:a.filter(m=>m.timestamp>=r-c.seconds)}function JS(a){return a<=300?10:a<=1800?30:a<=7200?60:a<=720*60?300:a<=2880*60?900:3600}function WS(a,o){const r=new Date(a*1e3);return o<60?r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}):o<3600?r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):r.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function FS(a,o){if(a.length===0)return[];let r=Number.POSITIVE_INFINITY,c=0;for(const j of a)j.timestamp<r&&(r=j.timestamp),j.timestamp>c&&(c=j.timestamp);const m=Math.max(o-r,c-r,1);let f=JS(m);for(;m/f>180;)f*=2;const h=Math.floor(r/f)*f,p=Math.max(Math.floor(o/f)*f,h),y=[],v=new Map;for(let j=h;j<=p;j+=f){const b={start:j,label:WS(j,f),count:0,success:0,error:0,cancelled:0,tokens:0,successTokens:0,errorTokens:0,cancelledTokens:0,cacheReadTokens:0,cacheWriteTokens:0,reasoningTokens:0,latencySum:0,latencyCount:0,bucketSeconds:f};y.push(b),v.set(j,b)}for(const j of a){const b=v.get(Math.floor(j.timestamp/f)*f);if(!b)continue;const x=j.input_tokens+j.output_tokens;b.count+=1,b.tokens+=x,b.cacheReadTokens+=j.cache_read_tokens,b.cacheWriteTokens+=j.cache_creation_tokens,b.reasoningTokens+=j.reasoning_tokens,b.latencySum+=j.duration_ms,b.latencyCount+=1,j.status==="success"?(b.success+=1,b.successTokens+=x):j.status==="error"?(b.error+=1,b.errorTokens+=x):(b.cancelled+=1,b.cancelledTokens+=x)}return y}function PS(a,o){let r=0,c=0,m=0,f=0,h=0,p=0,y=0,v=0,j=0,b=0,x=0;const C=o-Wr;for(const w of a)r+=1,c+=w.input_tokens,m+=w.output_tokens,f+=w.cache_read_tokens,h+=w.cache_creation_tokens,p+=w.reasoning_tokens,j+=w.duration_ms,w.status==="error"?y+=1:w.status==="cancelled"&&(v+=1),w.timestamp>=C&&(b+=w.input_tokens,x+=w.output_tokens);return{requests:r,inputTokens:c,outputTokens:m,cacheReadTokens:f,cacheWriteTokens:h,reasoningTokens:p,errors:y,cancelled:v,tpm:(b+x)/Wr*60,tps:x/Wr,avgLatencyMs:r>0?j/r:0,errorRate:r>0?y/r:0}}function IS(a,o){return[{name:"Input",value:a.inputTokens,color:Ul("input",o)},{name:"Output",value:a.outputTokens,color:Ul("output",o)},{name:"Cache read",value:a.cacheReadTokens,color:Ul("cacheRead",o)},{name:"Cache write",value:a.cacheWriteTokens,color:Ul("cacheWrite",o)},{name:"Reasoning",value:a.reasoningTokens,color:Ul("reasoning",o)}].filter(r=>r.value>0)}function Wg(a,o,r){const c=new Map;for(const m of a){const f=o(m)||"(unknown)",h=c.get(f)??{name:f,tokens:0,requests:0,errors:0};h.tokens+=m.input_tokens+m.output_tokens,h.requests+=1,m.status==="error"&&(h.errors+=1),c.set(f,h)}return[...c.values()].sort((m,f)=>f.tokens-m.tokens).slice(0,r)}function e3(a,o=6){return Wg(a,r=>r.gateway_model||r.provider_model||"(no model)",o)}function t3(a,o=6){return Wg(a,r=>r.provider,o)}const wp=5,Np=4;function n3(a){const o=new Map,r=new Map,c=new Map;for(const x of a){const C=x.wire_api||"unknown",w=x.gateway_model||x.provider_model||"(no model)",E=x.provider||"(unknown)";o.set(C,(o.get(C)??0)+1),r.set(w,(r.get(w)??0)+1),c.set(E,(c.get(E)??0)+1)}const m=[...r.entries()].sort((x,C)=>C[1]-x[1]).slice(0,wp),f=[...c.entries()].sort((x,C)=>C[1]-x[1]).slice(0,Np),h=x=>m.some(([C])=>C===x)?`gw:${x}`:"gw:Other",p=x=>f.some(([C])=>C===x)?`pv:${x}`:"pv:Other",y=new Map,v=(x,C)=>{const w=`${x}\0${C}`;y.set(w,(y.get(w)??0)+1)};for(const x of a){const C=x.wire_api||"unknown",w=x.gateway_model||x.provider_model||"(no model)",E=x.provider||"(unknown)";v(C,h(w)),v(h(w),p(E))}const j=[];for(const x of o.keys())j.push({name:x,display:x,category:0});for(const[x]of m)j.push({name:`gw:${x}`,display:x,category:1});r.size>wp&&j.push({name:"gw:Other",display:"Other models",category:1});for(const[x]of f)j.push({name:`pv:${x}`,display:x,category:2});c.size>Np&&j.push({name:"pv:Other",display:"Other providers",category:2});const b=[...y.entries()].map(([x,C])=>{const[w,E]=x.split("\0");return{source:w,target:E,value:C}}).sort((x,C)=>C.value-x.value);return{nodes:j,links:b}}function l3(a){const o=new Map;for(const c of a){const m=new Date(c.timestamp*1e3),f=(m.getDay()+6)%7,h=m.getHours(),p=f*24+h,y=o.get(p)??{hour:h,day:f,count:0,tokens:0,latencySum:0,latencyCount:0};y.count+=1,y.tokens+=c.input_tokens+c.output_tokens,y.latencySum+=c.duration_ms,y.latencyCount+=1,o.set(p,y)}const r=[];for(let c=0;c<7;c+=1)for(let m=0;m<24;m+=1)r.push(o.get(c*24+m)??{hour:m,day:c,count:0,tokens:0,latencySum:0,latencyCount:0});return r}function it(a){return a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(1)}k`:String(a)}function qu(a){return a>=1e3?`${(a/1e3).toFixed(1)}s`:`${a}ms`}function a3(a){return a<=0?"0%":`${(a*100).toFixed(1)}%`}function i3(a){return new Date(a*1e3).toLocaleString()}function o3(a){return new Date(a*1e3).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}Rv([Uv,Lv,Hv,Bv,qv,Gv]);function Fg({option:a,className:o,ariaLabel:r}){const c=S.useRef(null),m=S.useRef(null);return S.useEffect(()=>{const f=c.current;if(!f)return;const h=Dv(f);m.current=h;const p=new ResizeObserver(()=>h.resize());return p.observe(f),()=>{p.disconnect(),h.dispose(),m.current=null}},[]),S.useEffect(()=>{var f;(f=m.current)==null||f.setOption(a,{notMerge:!0})},[a]),u.jsx("div",{ref:c,role:"img","aria-label":r,className:o})}function Vi({title:a,subtitle:o,actions:r,children:c,className:m,contentClassName:f}){return u.jsxs(Kt,{className:ge("gap-0 overflow-hidden",m),children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border/80 px-5 py-3",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h4",{className:"text-sm font-semibold tracking-tight",children:a}),o?u.jsx("p",{className:"mt-0.5 truncate text-xs text-muted-foreground",children:o}):null]}),r]}),u.jsx(Nn,{className:ge("px-4 py-4",f),children:c})]})}function Pg({active:a,label:o,payload:r,formatter:c}){return!a||!r||r.length===0?null:u.jsxs("div",{className:"rounded-md border bg-popover px-3 py-2 text-xs shadow-lg",children:[o!==void 0&&o!==""?u.jsx("p",{className:"mb-1 font-medium text-popover-foreground",children:o}):null,u.jsx("div",{className:"space-y-0.5",children:r.map((m,f)=>{var j;const h=String(m.name??""),p=Number(m.value??0),y=m.color??((j=m.payload)==null?void 0:j.color)??"var(--ring)",v=c?c(p,h):String(p);return u.jsxs("p",{className:"flex items-center justify-between gap-4 text-muted-foreground",children:[u.jsxs("span",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:y}}),h]}),u.jsx("span",{className:"font-mono text-popover-foreground",children:v})]},`${h}-${f}`)})})]})}function Cp(){return document.documentElement.classList.contains("dark")?"dark":"light"}function Yi(){const[a,o]=S.useState(Cp);return S.useEffect(()=>{const r=new MutationObserver(()=>o(Cp()));return r.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},[]),a}function Ig(a){const o=a==="dark";return{text:o?"#f5f5f4":"#292524",muted:o?"#a8a29e":"#78716c",grid:o?"#292524":"#e7e5e4",card:o?"#1c1917":"#ffffff"}}const s3=[{key:"requests",label:"Requests"},{key:"tokens",label:"Tokens"}];function Rl(a,o){return o==="tokens"?a.tokens:a.count}function Na(a,o){return o==="tokens"?it(a):String(a)}function Fr(a){return String(a).padStart(2,"0")}function c3(a){const o=Number(a);return Number.isNaN(o)||o%6!==0?"":o===0?"12a":o===12?"12p":o<12?`${o}a`:`${o-12}p`}function Ca({label:a,children:o}){return u.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-md border bg-muted/40 px-2 py-1 font-mono text-[11px] text-muted-foreground",children:[u.jsx("span",{className:"font-sans font-medium text-foreground",children:a}),o]})}function r3({records:a}){const o=Yi(),r=o==="dark",[c,m]=S.useState("requests"),f=S.useMemo(()=>l3(a),[a]),h=Ig(o),p=r?GS:qS,y=r?YS:VS,v=S.useMemo(()=>{const x=Array.from({length:7},()=>0),C=Array.from({length:24},()=>0),w=Array.from({length:7},()=>0),E=Array.from({length:24},()=>0);for(const z of f)x[z.day]+=z.count,C[z.hour]+=z.count,w[z.day]+=z.tokens,E[z.hour]+=z.tokens;const O=z=>z.reduce((Q,W,ne)=>W>z[Q]?ne:Q,0),k=f.reduce((z,Q)=>z===null||Rl(Q,c)>Rl(z,c)?Q:z,null),B=f.map(z=>Rl(z,c)).sort((z,Q)=>z-Q),q=B.reduce((z,Q)=>z+Q,0),Z=B[Math.floor((B.length-1)/2)]??0,V=B[Math.ceil((B.length-1)/2)]??0;return{peak:k,busiestDay:O(x),busiestHour:O(C),dayValues:c==="tokens"?w:x,hourValues:c==="tokens"?E:C,activeHours:B.filter(z=>z>0).length,avgPerHour:B.length>0?q/B.length:0,medianPerHour:(Z+V)/2}},[f,c]),j=S.useMemo(()=>{const x=Math.max(1,...f.map(W=>Rl(W,c))),C=Math.max(1,Math.ceil(x/4)),w=Math.max(1,Math.ceil(x/2)),E=Math.max(1,Math.ceil(x*3/4)),O=W=>W<=0?y:W<=C?p[0]:W<=w?p[1]:W<=E?p[2]:p[3],k=r?QS:XS,B=r?["rgba(255, 255, 255, 0.02)","rgba(255, 255, 255, 0.05)"]:["rgba(0, 0, 0, 0.02)","rgba(0, 0, 0, 0.045)"],q=new Map(f.map(W=>[`${W.day}-${W.hour}`,W])),Z=v.peak,V=f.reduce((W,ne)=>W+Rl(ne,c),0),z=f.map(W=>{const ne=Rl(W,c),le=ne>0&&ne===x&&W===Z;return{value:[W.hour,W.day,ne],...le?{itemStyle:{borderColor:k,borderWidth:2.5}}:{},label:ne>0?{color:r||ne>w?"#ffffff":ZS}:{show:!1}}}),Q=(W,ne)=>`<div style="display:flex;justify-content:space-between;gap:16px"><span style="color:${h.muted}">${W}</span><span style="color:${h.text};font-family:ui-monospace,monospace">${ne}</span></div>`;return{tooltip:{position:"top",confine:!0,extraCssText:"border-radius:8px;box-shadow:0 4px 12px rgba(0,0,0,0.18);padding:8px 10px",backgroundColor:h.card,borderColor:h.grid,textStyle:{color:h.text,fontSize:12},formatter:W=>{var se;const ne=(se=W.data)==null?void 0:se.value;if(!ne)return"";const[le,re,$]=ne,F=q.get(`${re}-${le}`),ie=ds[re]??"",J=`<span style="display:inline-block;width:8px;height:8px;border-radius:2px;background:${O($)};margin-right:6px;vertical-align:middle"></span>`,A=`<div style="font-weight:600;margin-bottom:4px;padding-bottom:4px;border-bottom:1px solid ${h.grid}">${J}${ie} · ${Fr(le)}:00</div>`;if(!F||F.count===0)return`${A}<div style="color:${h.muted}">No requests</div>`;const D=x>0?Math.round($/x*100):0,H=V>0?Math.round($/V*100):0,P=F.latencyCount>0?F.latencySum/F.latencyCount:0;return A+Q("Requests",String(F.count))+Q("Tokens",it(F.tokens))+Q("Share of peak",`${D}%`)+Q("Share of week",`${H}%`)+Q("Avg latency",qu(P))}},grid:{left:50,right:16,top:10,bottom:8},xAxis:{type:"category",data:KS,splitArea:{show:!0,interval:0,color:B},axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:h.muted,fontSize:10,interval:0,formatter:c3}},yAxis:{type:"category",data:[...ds],splitArea:{show:!0,color:B},axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:h.muted,fontSize:10,formatter:W=>W==="Sat"||W==="Sun"?`{wk|${W}}`:W,rich:{wk:{color:h.text,fontWeight:600}}}},visualMap:{show:!1,seriesIndex:0,min:0,max:x,pieces:[{lte:0,color:y},{gt:0,lte:C,color:p[0]},{gt:C,lte:w,color:p[1]},{gt:w,lte:E,color:p[2]},{gt:E,color:p[3]}]},series:[{type:"heatmap",data:z,label:{show:!0,fontSize:9,fontWeight:600,color:"#ffffff",formatter:W=>{const ne=W.value,le=(ne==null?void 0:ne[2])??0;return le>0?Na(le,c):""}},itemStyle:{borderColor:h.card,borderWidth:2,borderRadius:3},markArea:{silent:!0,itemStyle:{color:r?"rgba(255,255,255,0.045)":"rgba(0,0,0,0.035)"},data:[[{yAxis:"Sat"},{yAxis:"Sun"}]]},emphasis:{itemStyle:{shadowBlur:10,shadowColor:"rgba(0, 0, 0, 0.35)",borderColor:h.text,borderWidth:1.5}}}]}},[f,o,c,h,v,p]),b=f.reduce((x,C)=>x+C.count,0);return u.jsxs(Vi,{title:"Usage heatmap",subtitle:c==="requests"?"Request count by hour and weekday":"Token volume by hour and weekday",className:"h-full",actions:u.jsx("div",{className:"flex items-center gap-1 rounded-lg border bg-muted/40 p-0.5",role:"group","aria-label":"Heatmap metric",children:s3.map(x=>u.jsx("button",{type:"button",className:ge("rounded-md px-2 py-1 text-xs font-medium transition-colors",c===x.key?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>m(x.key),children:x.label},x.key))}),contentClassName:"pt-2",children:[u.jsx(Fg,{option:j,className:"h-60 w-full",ariaLabel:`Usage heatmap of ${c} by hour of day and day of week`}),u.jsxs("div",{className:"mt-1.5 flex items-center justify-center gap-1.5 text-[10px] text-muted-foreground",children:[u.jsx("span",{className:"mr-0.5",children:"Less"}),[y,...p].map((x,C)=>u.jsx("span",{className:"size-2.5 rounded-[3px]",style:{backgroundColor:x}},`${x}-${C}`)),u.jsx("span",{className:"ml-0.5",children:"More"})]}),v.peak!==null&&b>0?u.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[u.jsxs(Ca,{label:"Peak",children:[Na(Rl(v.peak,c),c)," ·"," ",ds[v.peak.day]," ",Fr(v.peak.hour),":00"]}),u.jsxs(Ca,{label:"Busiest day",children:[ds[v.busiestDay]," ·"," ",Na(v.dayValues[v.busiestDay],c)]}),u.jsxs(Ca,{label:"Busiest hour",children:[Fr(v.busiestHour),":00 ·"," ",Na(v.hourValues[v.busiestHour],c)]}),u.jsxs(Ca,{label:"Active hours",children:[v.activeHours,"/168"]}),u.jsx(Ca,{label:"Avg / hour",children:Na(v.avgPerHour,c)}),u.jsx(Ca,{label:"Median / hour",children:Na(v.medianPerHour,c)})]}):null]})}function u3({label:a,value:o,hint:r,icon:c,color:m,series:f}){const p=`kpi-${S.useId().replace(/[^a-zA-Z0-9]/g,"")}`,y=f.map((v,j)=>({index:j,point:v}));return u.jsx(Kt,{className:"gap-0 overflow-hidden",children:u.jsxs(Nn,{className:"px-4 py-3.5",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("span",{className:"flex size-6 shrink-0 items-center justify-center rounded-md",style:{backgroundColor:`${m}1f`,color:m},children:c}),u.jsx("p",{className:"truncate text-xs text-muted-foreground",children:a})]}),u.jsx("p",{className:"mt-1.5 truncate font-mono text-2xl font-semibold tracking-tight leading-tight",children:o}),r?u.jsx("p",{className:"mt-0.5 truncate text-[11px] text-muted-foreground",children:r}):null,u.jsx("div",{className:"mt-2 h-9",children:f.length>=2?u.jsx(pu,{width:"100%",height:"100%",children:u.jsxs(Ep,{data:y,margin:{top:2,right:0,bottom:0,left:0},children:[u.jsx("defs",{children:u.jsxs("linearGradient",{id:p,x1:"0",y1:"0",x2:"0",y2:"1",children:[u.jsx("stop",{offset:"0%",stopColor:m,stopOpacity:.1}),u.jsx("stop",{offset:"100%",stopColor:m,stopOpacity:0})]})}),u.jsx(ms,{type:"monotone",dataKey:"point",stroke:m,strokeWidth:2,strokeLinecap:"round",fill:`url(#${p})`,isAnimationActive:!1,dot:!1})]})}):u.jsx("div",{className:"flex h-full items-center justify-center rounded-md bg-muted/40 text-[10px] text-muted-foreground",children:"no trend yet"})})]})})}function f3({kpis:a,buckets:o}){const r=Yi()==="dark",c=Bu(r),m=[{label:"Total requests",value:a.requests.toLocaleString(),hint:`${o.length} time buckets in window`,icon:u.jsx(eu,{className:"size-3.5"}),color:c[0],series:o.map(f=>f.count)},{label:"Total tokens",value:it(a.inputTokens+a.outputTokens),hint:`${it(a.inputTokens)} in · ${it(a.outputTokens)} out`,icon:u.jsx(ex,{className:"size-3.5"}),color:c[1],series:o.map(f=>f.tokens)},{label:"Cache tokens",value:it(a.cacheReadTokens+a.cacheWriteTokens),hint:`${it(a.cacheReadTokens)} read · ${it(a.cacheWriteTokens)} written`,icon:u.jsx(ix,{className:"size-3.5"}),color:Ul("cacheRead",r),series:o.map(f=>f.cacheReadTokens+f.cacheWriteTokens)},{label:"Reasoning tokens",value:it(a.reasoningTokens),hint:"thinking / extended output",icon:u.jsx(Pv,{className:"size-3.5"}),color:Ul("reasoning",r),series:o.map(f=>f.reasoningTokens)},{label:"Tokens / minute",value:it(Math.round(a.tpm)),hint:"in+out · last 60s",icon:u.jsx(xu,{className:"size-3.5"}),color:c[3],series:o.map(f=>f.tokens/f.bucketSeconds*60)},{label:"Avg latency",value:qu(a.avgLatencyMs),hint:"per request",icon:u.jsx(bx,{className:"size-3.5"}),color:c[6],series:o.map(f=>f.latencyCount>0?f.latencySum/f.latencyCount:0)},{label:"Error rate",value:a3(a.errorRate),hint:`${a.errors} errors · ${a.cancelled} cancelled`,icon:u.jsx(vu,{className:"size-3.5"}),color:Dl.error,series:o.map(f=>f.count>0?f.error/f.count:0)},{label:"Tokens / second",value:a.tps.toFixed(1),hint:"output only · last 60s",icon:u.jsx(Sx,{className:"size-3.5"}),color:c[2],series:o.map(f=>f.tokens/f.bucketSeconds)}];return u.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6",children:m.map(f=>u.jsx(u3,{...f},f.label))})}function d3({records:a}){const o=Yi(),r=o==="dark",c=Ig(o),m=r?"#d95926":"#eb6834",f=Bu(r),{nodes:h,links:p}=S.useMemo(()=>n3(a),[a]),y=S.useMemo(()=>{const j=new Map(h.map(C=>[C.name,C.display])),b={0:0,1:0,2:0},x=C=>{if(C.category===0)return m;const w=b[C.category]++;return f[(w+(C.category-1)*3)%f.length]};return{tooltip:{trigger:"item",triggerOn:"mousemove",backgroundColor:c.card,borderColor:c.grid,textStyle:{color:c.text,fontSize:12}},series:[{type:"sankey",left:8,right:110,top:12,bottom:8,nodeWidth:12,nodeGap:14,layoutIterations:32,data:h.map(C=>({name:C.name,itemStyle:{color:x(C)}})),links:p,emphasis:{focus:"adjacency"},lineStyle:{color:"gradient",curveness:.5,opacity:.35},label:{show:!0,color:c.text,fontSize:11,formatter:C=>j.get(String(C.name))??String(C.name)}}]}},[h,p,c,m,f]),v=[{label:"Client protocol",color:m},{label:"Gateway model",color:f[0]},{label:"Provider",color:f[3]}];return u.jsx(Vi,{title:"Routing flow",subtitle:"Client → gateway model → provider",className:"h-full",contentClassName:"flex flex-col",children:h.length>0?u.jsxs(u.Fragment,{children:[u.jsx(Fg,{option:y,className:"h-72 w-full",ariaLabel:"Request routing flow from client protocol through gateway models to providers"}),u.jsx("div",{className:"mt-2 flex flex-wrap items-center gap-x-4 gap-y-1",children:v.map(j=>u.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[u.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:j.color}}),j.label]},j.label))})]}):u.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No requests in this window yet."})})}function m3({kpis:a}){const o=Yi()==="dark",r=IS(a,o),c=r.reduce((f,h)=>f+h.value,0),m=a.inputTokens+a.outputTokens;return u.jsxs(Vi,{title:"Token mix",subtitle:"Input, output, cache, and reasoning tokens",contentClassName:"flex flex-col",children:[u.jsxs("div",{className:"relative mx-auto w-full max-w-56",children:[u.jsx("div",{className:"h-44 w-full",children:u.jsx(pu,{width:"100%",height:"100%",children:u.jsxs(Ev,{children:[u.jsx(zp,{content:u.jsx(Pg,{formatter:(f,h)=>`${it(f)} · ${h}`})}),u.jsx(zv,{data:r,dataKey:"value",nameKey:"name",innerRadius:"66%",outerRadius:"92%",paddingAngle:2,cornerRadius:4,stroke:"var(--card)",strokeWidth:2,children:r.map(f=>u.jsx(_v,{fill:f.color},f.name))})]})})}),u.jsxs("div",{className:"pointer-events-none absolute inset-0 flex flex-col items-center justify-center",children:[u.jsx("p",{className:"font-mono text-xl font-semibold tracking-tight leading-tight",children:it(m)}),u.jsx("p",{className:"text-[11px] text-muted-foreground",children:"tokens"})]})]}),u.jsx("div",{className:"mt-3 space-y-1.5",children:r.length>0?r.map(f=>u.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-1.5 text-muted-foreground",children:[u.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:f.color}}),u.jsx("span",{className:"truncate",children:f.name})]}),u.jsxs("span",{className:"flex shrink-0 items-center gap-2 font-mono",children:[u.jsx("span",{className:"text-muted-foreground",children:c>0?`${Math.round(f.value/c*100)}%`:"0%"}),u.jsx("span",{className:"w-12 text-right",children:it(f.value)})]})]},f.name)):u.jsx("p",{className:"py-2 text-center text-xs text-muted-foreground",children:"No token usage in this window yet."})})]})}const h3=[{key:"model",label:"Model"},{key:"provider",label:"Provider"}];function p3({item:a,index:o,maxTokens:r}){const c=Yi()==="dark",m=Bu(c)[o%8],f=r>0?a.tokens/r*100:0;return u.jsxs("li",{children:[u.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[u.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[u.jsx("span",{className:"w-4 shrink-0 text-right font-mono text-muted-foreground",children:o+1}),u.jsx("span",{className:"truncate font-mono",children:a.name}),a.errors>0?u.jsxs(at,{variant:"error",className:"px-1.5 py-0 text-[10px] font-medium",children:[a.errors," err"]}):null]}),u.jsxs("span",{className:"flex shrink-0 items-center gap-2 font-mono",children:[u.jsxs("span",{className:"text-muted-foreground",children:[a.requests," req"]}),u.jsx("span",{className:"w-12 text-right",children:it(a.tokens)})]})]}),u.jsx("div",{className:"mt-1 ml-6 h-1.5 overflow-hidden rounded-full bg-muted",children:u.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${f}%`,backgroundColor:m}})})]})}function g3({records:a}){const[o,r]=S.useState("model"),c=o==="model"?e3(a):t3(a),m=c.length>0?c[0].tokens:0;return u.jsx(Vi,{title:"Top endpoints",subtitle:o==="model"?"Gateway models ranked by token usage":"Providers ranked by token usage",className:"h-full",actions:u.jsx("div",{className:"flex items-center gap-1 rounded-lg border bg-muted/40 p-0.5",role:"group","aria-label":"Group by",children:h3.map(f=>u.jsx("button",{type:"button",className:ge("rounded-md px-2 py-1 text-xs font-medium transition-colors",o===f.key?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>r(f.key),children:f.label},f.key))}),children:c.length>0?u.jsx("ol",{className:"space-y-3",children:c.map((f,h)=>u.jsx(p3,{item:f,index:h,maxTokens:m},`${o}-${f.name}`))}):u.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No requests in this window yet."})})}const y3=[{key:"requests",label:"Requests"},{key:"tokens",label:"Tokens"}];function v3({buckets:a}){const[o,r]=S.useState("requests"),m=S.useId().replace(/[^a-zA-Z0-9]/g,""),f=a.map(y=>({label:y.label,success:o==="requests"?y.success:y.successTokens,error:o==="requests"?y.error:y.errorTokens,cancelled:o==="requests"?y.cancelled:y.cancelledTokens})),h=f.reduce((y,v)=>({success:y.success+v.success,error:y.error+v.error,cancelled:y.cancelled+v.cancelled}),{success:0,error:0,cancelled:0}),p=(y,v)=>o==="tokens"?it(y):String(y);return u.jsxs(Vi,{title:"Request volume",subtitle:"Requests per time bucket, stacked by status",className:"h-full",actions:u.jsx("div",{className:"flex items-center gap-1 rounded-lg border bg-muted/40 p-0.5",role:"group","aria-label":"Chart metric",children:y3.map(y=>u.jsx("button",{type:"button",className:ge("rounded-md px-2 py-1 text-xs font-medium transition-colors",o===y.key?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>r(y.key),children:y.label},y.key))}),children:[u.jsx("div",{className:"h-56 w-full",children:u.jsx(pu,{width:"100%",height:"100%",children:u.jsxs(Ep,{data:f,margin:{top:6,right:8,bottom:0,left:0},children:[u.jsx("defs",{children:["success","error","cancelled"].map(y=>u.jsxs("linearGradient",{id:`vol-${m}-${y}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[u.jsx("stop",{offset:"0%",stopColor:Dl[y],stopOpacity:.1}),u.jsx("stop",{offset:"100%",stopColor:Dl[y],stopOpacity:.02})]},y))}),u.jsx(Mv,{stroke:"var(--border)",strokeWidth:1,vertical:!1}),u.jsx(Ov,{dataKey:"label",tickLine:!1,axisLine:!1,minTickGap:32,interval:"preserveStartEnd",tick:{fill:"var(--muted-foreground)",fontSize:11}}),u.jsx(kv,{tickLine:!1,axisLine:!1,width:40,allowDecimals:!1,tick:{fill:"var(--muted-foreground)",fontSize:11}}),u.jsx(zp,{content:u.jsx(Pg,{formatter:p})}),u.jsx(ms,{type:"monotone",dataKey:"success",name:"Success",stackId:"volume",stroke:Dl.success,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",fill:`url(#vol-${m}-success)`}),u.jsx(ms,{type:"monotone",dataKey:"error",name:"Error",stackId:"volume",stroke:Dl.error,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",fill:`url(#vol-${m}-error)`}),u.jsx(ms,{type:"monotone",dataKey:"cancelled",name:"Cancelled",stackId:"volume",stroke:Dl.cancelled,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round",fill:`url(#vol-${m}-cancelled)`})]})})}),u.jsx("div",{className:"mt-2 flex flex-wrap items-center gap-x-4 gap-y-1",children:[["success","Success"],["error","Error"],["cancelled","Cancelled"]].map(([y,v])=>u.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[u.jsx("span",{className:"size-2 rounded-full",style:{backgroundColor:Dl[y]}}),v,u.jsx("span",{className:"font-mono text-foreground",children:o==="tokens"?it(h[y]):h[y]})]},y))})]})}function Tt({className:a,...o}){return u.jsx("div",{"data-slot":"skeleton",className:ge("bg-accent animate-pulse rounded-md",a),...o})}const x3=1e4,b3=[10,25,50];function S3(a,o){if(o<=7)return Array.from({length:o},(f,h)=>h+1);const r=[1];a>3&&r.push("…");const c=Math.max(2,a-1),m=Math.min(o-1,a+1);for(let f=c;f<=m;f+=1)r.push(f);return a<o-2&&r.push("…"),r.push(o),r}const j3={success:"ok",error:"error",cancelled:"neutral"},gs={success:u.jsx(yu,{className:"size-3.5"}),error:u.jsx(vu,{className:"size-3.5"}),cancelled:u.jsx(bu,{className:"size-3.5"})};function w3(a){return a==="cancelled"?"Cancelled":a==="error"?"Error":"Success"}function N3({value:a,onChange:o}){return u.jsx("div",{className:"flex items-center gap-1 rounded-lg border bg-muted/40 p-1",role:"group","aria-label":"Time range",children:Jg.map(r=>u.jsx("button",{type:"button",className:ge("rounded-md px-2.5 py-1 text-xs font-medium transition-colors",a===r.key?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>o(r.key),children:r.label},r.key))})}function C3(){const[a,o]=S.useState(null),[r,c]=S.useState(!0),[m,f]=S.useState(null),[h,p]=S.useState(null),[y,v]=S.useState("1h"),[j,b]=S.useState(null),[x,C]=S.useState(1),[w,E]=S.useState(10),O=async()=>{try{const F=await _x();o(F),f(null),b(Date.now()/1e3)}catch(F){f(At(F))}finally{c(!1)}};S.useEffect(()=>{O();const F=setInterval(()=>{O()},x3);return()=>clearInterval(F)},[]);const k=(a==null?void 0:a.records)??[],B=Date.now()/1e3,q=$S(k,y,B),Z=FS(q,B),V=PS(q,B),z=Math.max(1,Math.ceil(k.length/w)),Q=Math.min(x,z),W=(Q-1)*w,ne=k.slice(W,W+w),le=k.length===0?0:W+1,re=Math.min(k.length,W+w);if(r&&!a)return u.jsxs("section",{className:"space-y-4","aria-label":"Usage statistics",children:[u.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6",children:Array.from({length:6}).map((F,ie)=>u.jsx(Tt,{className:"h-32 w-full"},ie))}),u.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[u.jsx(Tt,{className:"h-80 w-full"}),u.jsx(Tt,{className:"h-80 w-full lg:col-span-2"})]}),u.jsx(Tt,{className:"h-72 w-full"})]});if(m&&!a)return u.jsx("section",{className:"space-y-4","aria-label":"Usage statistics",children:u.jsx(Kt,{className:"border-dashed",children:u.jsxs(Nn,{className:"flex flex-col items-center gap-3 py-12 text-center",children:[u.jsx("span",{className:"flex size-12 items-center justify-center rounded-full bg-red-100 text-red-600 dark:bg-red-500/15",children:u.jsx(bu,{className:"size-6"})}),u.jsxs("p",{className:"text-sm text-muted-foreground",children:["Could not load usage statistics: ",m]}),u.jsxs(Ce,{type:"button",variant:"secondary",onClick:()=>void O(),children:[u.jsx(ki,{}),"Retry"]})]})})});const $={success:k.reduce((F,ie)=>F+(ie.status==="success"?1:0),0),error:k.reduce((F,ie)=>F+(ie.status==="error"?1:0),0),cancelled:k.reduce((F,ie)=>F+(ie.status==="cancelled"?1:0),0)};return u.jsxs("section",{className:"space-y-5","aria-label":"Usage statistics",children:[u.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("h3",{className:"text-xl font-semibold tracking-tight",children:"Usage"}),u.jsxs("p",{className:"mt-1 max-w-2xl text-sm text-muted-foreground",children:["Token throughput and request routing for the gateway, refreshed automatically every 10 seconds. Full prompts are captured for each request (capped at 64 KB) in ",u.jsx("code",{children:"~/.fcc/usage.json"}),"."]})]}),u.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1.5",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[u.jsx(N3,{value:y,onChange:v}),u.jsxs(Ce,{type:"button",variant:"secondary",size:"sm",onClick:()=>void O(),children:[u.jsx(ki,{}),"Refresh"]})]}),j!==null?u.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Updated ",o3(j)]}):null]})]}),k.length===0?u.jsx(Kt,{className:"border-dashed",children:u.jsxs(Nn,{className:"flex flex-col items-center gap-3 py-12 text-center",children:[u.jsx("span",{className:"flex size-12 items-center justify-center rounded-full bg-primary/10",children:u.jsx(eu,{className:"size-6 text-primary"})}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"No requests tracked yet. Send a request through the proxy and it will appear here."})]})}):q.length===0?u.jsx(Kt,{className:"border-dashed",children:u.jsxs(Nn,{className:"flex flex-col items-center gap-3 py-12 text-center",children:[u.jsx("span",{className:"flex size-12 items-center justify-center rounded-full bg-primary/10",children:u.jsx(eu,{className:"size-6 text-primary"})}),u.jsx("p",{className:"text-sm text-muted-foreground",children:"No requests in the selected window. Try a wider range."}),u.jsx(Ce,{type:"button",variant:"secondary",onClick:()=>v("all"),children:"Show all requests"})]})}):u.jsxs(u.Fragment,{children:[u.jsx(f3,{kpis:V,buckets:Z}),u.jsxs("div",{className:"grid gap-4 lg:grid-cols-3",children:[u.jsx(m3,{kpis:V}),u.jsx("div",{className:"lg:col-span-2",children:u.jsx(v3,{buckets:Z})})]}),u.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[u.jsx(g3,{records:q}),u.jsx(d3,{records:q})]}),u.jsx(r3,{records:q})]}),u.jsxs(Kt,{className:"gap-0 overflow-hidden",children:[u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b px-5 py-3",children:[u.jsxs("div",{children:[u.jsx("h4",{className:"text-sm font-semibold",children:"Recent requests"}),u.jsxs("p",{className:"mt-0.5 text-xs text-muted-foreground",children:[k.length," tracked · newest first"]})]}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsxs(at,{variant:"ok",className:"gap-1 font-normal",children:[gs.success,$.success]}),u.jsxs(at,{variant:"error",className:"gap-1 font-normal",children:[gs.error,$.error]}),u.jsxs(at,{variant:"neutral",className:"gap-1 font-normal",children:[gs.cancelled,$.cancelled]})]})]}),u.jsxs(Nn,{className:"px-0 py-0",children:[u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-left text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"border-b bg-muted/40 text-xs text-muted-foreground",children:[u.jsx("th",{className:"w-8 px-3 py-2.5"}),u.jsx("th",{className:"px-3 py-2.5 font-medium",children:"Time"}),u.jsx("th",{className:"px-3 py-2.5 font-medium",children:"Provider / Model"}),u.jsx("th",{className:"px-3 py-2.5 text-right font-medium",children:"Input"}),u.jsx("th",{className:"px-3 py-2.5 text-right font-medium",children:"Output"}),u.jsx("th",{className:"px-3 py-2.5 text-right font-medium",children:"Cache"}),u.jsx("th",{className:"px-3 py-2.5 text-right font-medium",children:"Reasoning"}),u.jsx("th",{className:"px-3 py-2.5 text-right font-medium",children:"Duration"}),u.jsx("th",{className:"px-3 py-2.5 font-medium",children:"Status"})]})}),u.jsx("tbody",{children:ne.map(F=>{const ie=F.request_id===h,J=F.cache_creation_tokens+F.cache_read_tokens;return u.jsx(A3,{record:F,expanded:ie,cacheTokens:J,onToggle:()=>p(ie?null:F.request_id)},F.request_id)})})]})}),k.length>w?u.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3",children:[u.jsxs("p",{className:"text-xs text-muted-foreground",children:["Showing"," ",u.jsxs("span",{className:"font-mono",children:[le,"–",re]})," ","of ",u.jsx("span",{className:"font-mono",children:k.length})]}),u.jsxs("nav",{className:"flex flex-wrap items-center gap-1","aria-label":"Request log pages",children:[u.jsx(Ce,{type:"button",variant:"ghost",size:"sm",className:"px-1.5",disabled:Q<=1,onClick:()=>C(Q-1),"aria-label":"Previous page",children:u.jsx(tx,{className:"size-3.5"})}),S3(Q,z).map((F,ie)=>F==="…"?u.jsx("span",{className:"px-0.5 text-xs text-muted-foreground",children:"…"},`ellipsis-${ie}`):u.jsx(Ce,{type:"button",size:"sm",variant:F===Q?"default":"ghost",className:"min-w-7 px-1.5","aria-current":F===Q?"page":void 0,onClick:()=>C(F),children:F},F)),u.jsx(Ce,{type:"button",variant:"ghost",size:"sm",className:"px-1.5",disabled:Q>=z,onClick:()=>C(Q+1),"aria-label":"Next page",children:u.jsx(kp,{className:"size-3.5"})})]}),u.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",role:"group","aria-label":"Rows per page",children:[u.jsx("span",{className:"hidden sm:inline",children:"Per page"}),u.jsx("div",{className:"flex items-center gap-1 rounded-lg border bg-muted/40 p-0.5",children:b3.map(F=>u.jsx("button",{type:"button",className:ge("rounded-md px-2 py-1 text-xs font-medium transition-colors",w===F?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>{E(F),C(1)},children:F},F))})]})]}):null]})]})]})}function A3({record:a,expanded:o,cacheTokens:r,onToggle:c}){const m=a.gateway_model||a.provider_model,f=a.cache_read_tokens,h=a.cache_creation_tokens;return u.jsxs(u.Fragment,{children:[u.jsxs("tr",{className:ge("cursor-pointer border-b transition-colors hover:bg-accent/40",o&&"bg-accent/30"),onClick:c,children:[u.jsx("td",{className:"px-3 py-2.5",children:o?u.jsx(Op,{className:"size-4 text-muted-foreground"}):u.jsx(kp,{className:"size-4 text-muted-foreground"})}),u.jsx("td",{className:"px-3 py-2.5 whitespace-nowrap text-muted-foreground",children:i3(a.timestamp)}),u.jsxs("td",{className:"max-w-64 px-3 py-2.5",children:[u.jsx("p",{className:"truncate font-mono text-xs",children:m}),u.jsxs("p",{className:"truncate font-mono text-[11px] text-muted-foreground",children:[a.provider,a.provider_model&&a.provider_model!==m?` → ${a.provider_model}`:""]})]}),u.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-xs",children:a.input_tokens}),u.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-xs",children:a.output_tokens}),u.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-xs",children:r>0?u.jsx("span",{title:`${h} created · ${f} read`,className:"cursor-help",children:r}):u.jsx("span",{className:"text-muted-foreground/50",children:"–"})}),u.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-xs",children:a.reasoning_tokens>0?a.reasoning_tokens:u.jsx("span",{className:"text-muted-foreground/50",children:"–"})}),u.jsx("td",{className:"px-3 py-2.5 text-right font-mono text-xs",children:qu(a.duration_ms)}),u.jsx("td",{className:"px-3 py-2.5",children:u.jsxs(at,{variant:j3[a.status],className:"gap-1 font-normal",children:[gs[a.status],w3(a.status)]})})]}),o?u.jsx("tr",{className:"border-b bg-muted/20",children:u.jsx("td",{colSpan:9,className:"px-3 py-3",children:u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[u.jsx(at,{variant:"outline",className:"gap-1.5 font-normal",children:a.wire_api}),a.error_type?u.jsx(at,{variant:"error",className:"gap-1.5 font-normal",children:a.error_type}):null,u.jsx("span",{className:"font-mono",children:a.request_id})]}),u.jsx("pre",{className:"max-h-64 overflow-auto rounded-md border bg-background/70 p-3 font-mono text-xs whitespace-pre-wrap text-foreground/90",children:a.prompt||"(no prompt captured)"})]})})}):null]})}const ey="fcc-admin-theme",ty=S.createContext(null);function Ap(){try{const a=window.localStorage.getItem(ey);if(a==="light"||a==="dark"||a==="system")return a}catch{}return"system"}function T3(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Pr(a){const o=a==="system"?T3():a;return document.documentElement.classList.toggle("dark",o==="dark"),o}function E3({children:a}){const[o,r]=S.useState(Ap),[c,m]=S.useState(()=>Pr(Ap()));S.useEffect(()=>{if(m(Pr(o)),o!=="system")return;const p=window.matchMedia("(prefers-color-scheme: dark)"),y=()=>m(Pr("system"));return p.addEventListener("change",y),()=>p.removeEventListener("change",y)},[o]);const f=p=>{r(p);try{window.localStorage.setItem(ey,p)}catch{}},h=()=>{f(c==="dark"?"light":"dark")};return u.jsx(ty.Provider,{value:{theme:o,resolvedTheme:c,setTheme:f,toggleTheme:h},children:a})}function z3(){const a=S.useContext(ty);if(!a)throw new Error("useTheme must be used within a ThemeProvider");return a}function _3(){const{resolvedTheme:a,toggleTheme:o}=z3(),r=a==="dark";return u.jsxs(Zg,{children:[u.jsx(Kg,{asChild:!0,children:u.jsx(Ce,{type:"button",variant:"ghost",size:"icon","aria-label":r?"Switch to light theme":"Switch to dark theme",onClick:o,children:r?u.jsx(xx,{}):u.jsx(mx,{})})}),u.jsx($g,{side:"bottom",children:r?"Switch to light theme":"Switch to dark theme"})]})}const M3="********",ul=[{id:"providers",label:"Providers",title:"Providers",description:"Check connectivity and manage provider credentials",path:"providers",sections:["providers","runtime"],icon:Ri},{id:"model_config",label:"Model Config",title:"Model Config",description:"Choose models, reasoning behavior, and web tooling",path:"model-config",sections:["models","reasoning","web_tools"],icon:vx},{id:"openai_compatible",label:"OpenAI-Compatible",title:"OpenAI-Compatible Endpoints",description:"Add any OpenAI-compatible server as a numbered provider",path:"openai-compatible",sections:[],icon:px},{id:"messaging",label:"Messaging",title:"Messaging",description:"Chat platforms and voice integration",path:"messaging",sections:["messaging","voice"],icon:Up},{id:"usage",label:"Usage",title:"Usage",description:"Token throughput and recent request logs",path:"usage",sections:[],icon:xu}];function ny(a){var o;return((o=ul.find(r=>r.path===a))==null?void 0:o.id)??"providers"}function O3(a){return/^openai_compatible_\d+$/.test(a)}function Ir(a,o){return O3(a)?o:`${a}/${o}`}function ly(){const a=window.location.hash.replace(/^#\/?/,""),[o]=a.split("?");return o||""}function k3(){var o;const a=ny(ly());return window.location.hash=`/${((o=ul.find(r=>r.id===a))==null?void 0:o.path)??a}`,a}const R3=a=>["configured","reachable","running","connected"].includes(a??"")?"ok":["missing_key","missing_config","missing_url","unknown","connecting"].includes(a??"")?"warn":["offline","error"].includes(a??"")?"error":"neutral";function D3(a){return a.type==="boolean"?String(a.value).toLowerCase()==="true"?"true":"false":a.type==="optional_model"&&a.value==="None"?"":a.pool_supported?(a.keys||[]).join(","):a.value||""}function U3(a){return a.pool_supported?(a.keys||[]).join(","):a.type==="secret"?"":a.type==="boolean"?String(a.value).toLowerCase()==="true"?"true":"false":a.type==="optional_model"&&a.value==="None"?"":a.pool_supported?(a.keys||[]).join(","):a.value||""}function L3(a,o){return a.type==="boolean"?o==="true"?"true":"false":a.type==="optional_model"&&o.trim().toLowerCase()==="none"?"":a.pool_supported?o:a.secret&&a.configured?o||M3:o}function At(a){return a instanceof Error?a.message:String(a)}function H3(){const[a,o]=S.useState(null),[r,c]=S.useState({}),[m,f]=S.useState([]),[h,p]=S.useState({}),[y,v]=S.useState({}),[j,b]=S.useState({}),[x,C]=S.useState(null),[w,E]=S.useState(()=>k3()),[O,k]=S.useState(!1),[B,q]=S.useState(!1),Z=S.useRef({}),V=S.useCallback(K=>C({text:K}),[]),z=S.useCallback(K=>C({text:K,kind:"error"}),[]),Q=S.useCallback(K=>C({text:K,kind:"warn"}),[]),W=S.useCallback((K,I)=>C({text:K,kind:I}),[]),ne=S.useCallback(()=>{if(!a)return{};const K={};for(const I of a.fields){if(I.locked)continue;const ee=L3(I,r[I.key]??"");ee!==D3(I)&&(K[I.key]=ee)}return K},[a,r]),le=Object.keys(ne()).length,re=S.useCallback(K=>{const I=Z.current[K];I&&(clearTimeout(I),delete Z.current[K])},[]),$=S.useCallback(K=>{re(K);const I=setTimeout(async()=>{try{const ee=await Ph(K);v(ue=>({...ue,[K]:ee})),ee.state==="connecting"?$(K):(delete Z.current[K],ee.connected&&await F())}catch(ee){delete Z.current[K],z(At(ee))}},1e3);Z.current[K]=I},[re,z]),F=S.useCallback(async()=>{try{const K=await Ih(!1);f(K.models)}catch{}},[]),ie=S.useCallback(async()=>{try{const K=await Cx(),I={};for(const ee of K.providers)I[ee.provider_id]=ee;p(I)}catch(K){z(At(K))}},[z]),J=S.useCallback(async K=>{const I=K.provider_status.filter(ue=>ue.kind==="connected_account"),ee={};await Promise.all(I.map(async ue=>{try{const Be=await Ph(ue.provider_id);ee[ue.provider_id]=Be,Be.state==="connecting"&&$(ue.provider_id)}catch(Be){ee[ue.provider_id]={state:"error",connected:!1,label:"Needs attention",message:At(Be)}}})),v(ue=>({...ue,...ee}))},[$]),A=S.useCallback(async()=>{V("Loading admin config");try{const K=await wx();o(K);const I={};for(const ee of K.fields)I[ee.key]=U3(ee);c(I),await J(K),await F();try{const ee=await Wh({});!ee.valid&&ee.errors.length&&z(ee.errors.join("; "))}catch{}await ie(),V("")}catch(K){z(At(K))}},[J,F,ie,V,z]);S.useEffect(()=>{A();const K=()=>E(ny(ly()));window.addEventListener("hashchange",K);const I=ee=>{ee.key==="Escape"&&q(!1)};return window.addEventListener("keydown",I),()=>{window.removeEventListener("hashchange",K),window.removeEventListener("keydown",I);for(const ee of Object.values(Z.current))clearTimeout(ee);Z.current={}}},[A]);const D=K=>{var ee;const I=((ee=ul.find(ue=>ue.id===K))==null?void 0:ee.path)??K;E(K),window.location.hash=`/${I}`},H=S.useCallback(async()=>{try{const K=await Wh(ne());K.valid?V("Config shape is valid"):z(K.errors.join("; "))}catch(K){z(At(K))}},[ne,z,V]),P=S.useCallback(async()=>{k(!0);try{const K=await Nx(ne());if(!K.applied){const ue=K.errors??[];ue.length&&z(ue.join("; "));return}const I=K.restart;if(I!=null&&I.required&&I.automatic){V("Applied. Restarting server..."),setTimeout(()=>{window.location.href=I.admin_url||"/admin"},1600);return}const ee=I!=null&&I.required?I.fields??[]:K.pending_fields??[];await A(),V(ee.length?`Applied. Restart fcc-server to use: ${ee.join(", ")}`:"Applied")}catch(K){z(At(K))}finally{k(!1)}},[ne,A,z,V]),se=S.useCallback(async(K,I)=>{try{const ee=await Fh(K);ee.ok?(p(ue=>({...ue,[K]:{provider_id:K,display_name:K,kind:"remote",status:"reachable",label:`${ee.models.length} models`}})),f(ue=>[...new Set([...ue,...ee.models.map(Be=>Ir(K,Be))])]),V("Models refreshed")):p(ue=>({...ue,[K]:{provider_id:K,display_name:K,kind:"remote",status:"offline",label:ee.error_type??"Offline"}}))}catch(ee){z(At(ee))}finally{I==null||I()}},[z,V]),je=S.useCallback(async K=>{try{const I=await Fh(K);return I.ok?(f(ee=>[...new Set([...ee,...I.models.map(ue=>Ir(K,ue))])]),I.models):(z(`Could not fetch models from ${K}: ${I.error_type??"request failed"}`),[])}catch(I){return z(`Could not fetch models from ${K}: ${At(I)}`),[]}},[z]),ze=S.useCallback((K,I)=>{I.length!==0&&f(ee=>[...new Set([...ee,...I.map(ue=>Ir(K,ue))])])},[]),pe=S.useCallback(async(K,I)=>{try{const ee=await Ih(!0);f(ee.models);const ue=ee.failed_providers??[];ue.length?Q(`${ee.models.length} models available; could not refresh ${ue.join(", ")}`):V(`${ee.models.length} models available`)}catch(ee){z(`Could not refresh models: ${At(ee)}`)}finally{I==null||I()}},[z,V,Q]),He=S.useCallback(async(K,I)=>{b(ue=>({...ue,[K]:!0}));const ee=window.open("about:blank","_blank");ee&&(ee.opener=null);try{const ue=await Ax(K,I);v(Dn=>({...Dn,[K]:ue}));const Be=ue.authorization_url||ue.verification_url;Be&&ee?ee.location.replace(Be):Be?window.open(Be,"_blank","noopener"):ee&&ee.close(),ue.state==="connecting"&&$(K)}catch(ue){ee&&ee.close(),z(At(ue))}finally{b(ue=>({...ue,[K]:!1}))}},[$,z]),st=S.useCallback(async K=>{re(K);try{const I=await Tx(K);v(ee=>({...ee,[K]:I}))}catch(I){z(At(I))}},[re,z]),zt=S.useCallback(async K=>{if(window.confirm("Disconnect this ChatGPT account from FCC?")){re(K);try{const I=await Ex(K);v(ee=>({...ee,[K]:I})),await F()}catch(I){z(At(I))}}},[re,F,z]),Rn=S.useCallback(async K=>{try{await navigator.clipboard.writeText(K),V("Device code copied.")}catch{C({text:`Copy this device code: ${K}`})}},[V]);if(!a)return u.jsxs("div",{className:"flex min-h-screen",children:[u.jsxs("aside",{className:"sticky top-0 hidden h-screen w-64 shrink-0 flex-col gap-3 overflow-y-auto border-r p-4 md:flex",children:[u.jsx(Tt,{className:"h-10 w-full"}),u.jsxs("div",{className:"mt-3 space-y-2",children:[u.jsx(Tt,{className:"h-9 w-5/6"}),u.jsx(Tt,{className:"h-9 w-4/6"}),u.jsx(Tt,{className:"h-9 w-3/6"})]})]}),u.jsxs("main",{className:"flex min-w-0 flex-1 flex-col gap-6 p-4 md:p-6",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx(Tt,{className:"h-7 w-56"}),u.jsx(Tt,{className:"h-4 w-72"})]}),u.jsx(Tt,{className:"h-36 w-full"}),u.jsx(Tt,{className:"h-36 w-full"}),u.jsx(Tt,{className:"h-36 w-full"})]})]});const Wt=ul.find(K=>K.id===w)??ul[0],Yt=Wt.icon;return u.jsxs("div",{className:"flex min-h-screen",children:[u.jsx(jp,{config:a,activeView:w,onSelectView:D,className:"sticky top-0 hidden h-screen md:flex"}),B?u.jsxs("div",{className:"fixed inset-0 z-50 md:hidden",role:"dialog","aria-modal":"true","aria-label":"Admin navigation",children:[u.jsx("button",{type:"button","aria-label":"Close navigation",className:"absolute inset-0 bg-black/60",onClick:()=>q(!1)}),u.jsx(jp,{config:a,activeView:w,onSelectView:D,onNavigate:()=>q(!1),className:"animate-in slide-in-from-left absolute inset-y-0 left-0 shadow-2xl"}),u.jsx("button",{type:"button","aria-label":"Close navigation",className:"absolute top-4 right-4 flex size-8 items-center justify-center rounded-md text-white/80 hover:bg-white/10 hover:text-white",onClick:()=>q(!1),children:u.jsx(Lp,{className:"size-5"})})]}):null,u.jsxs("main",{className:"flex min-w-0 flex-1 flex-col",children:[u.jsxs("header",{className:"sticky top-0 z-30 flex items-center justify-between gap-4 border-b bg-background/80 px-4 py-3 backdrop-blur-md md:px-6",children:[u.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[u.jsx(Ce,{type:"button",variant:"ghost",size:"icon",className:"md:hidden","aria-label":"Open navigation",onClick:()=>q(!0),children:u.jsx(fx,{})}),u.jsx("div",{className:"hidden size-9 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary md:flex",children:u.jsx(Yt,{className:"size-4.5"})}),u.jsxs("div",{className:"min-w-0",children:[u.jsx("h2",{className:"truncate text-lg font-semibold tracking-tight leading-tight",children:Wt.title}),u.jsx("p",{className:"truncate text-xs text-muted-foreground",children:Wt.description})]})]}),u.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[a.version?u.jsxs(at,{variant:"outline",className:"hidden font-mono text-muted-foreground sm:inline-flex",children:["v",a.version]}):null,u.jsx(_3,{})]})]}),u.jsxs("div",{className:"flex-1 space-y-6 p-4 md:p-6",children:[w==="providers"&&u.jsx(yb,{config:a,localStatus:h,connectedStatus:y,connectedLoading:j,onTestProvider:se,onRefreshModels:pe,onStartLogin:He,onCancelLogin:st,onDisconnect:zt,onCopyDeviceCode:Rn}),w==="openai_compatible"&&u.jsx(mb,{config:a,values:r,onValuesChange:c,localStatus:h,onTestProvider:se,onFetchModels:je,onAddModels:ze,onMessage:W}),w==="usage"&&u.jsx(C3,{}),u.jsx(rb,{config:a,values:r,onValuesChange:c,modelOptions:m,onRefreshModels:pe,focusedView:w})]}),u.jsx(x1,{configPath:a.paths.managed,dirtyCount:le,message:x,applying:O,onValidate:H,onApply:P})]})]})}function ay(a){return R3(a)}$v.createRoot(document.getElementById("root")).render(u.jsx(S.StrictMode,{children:u.jsx(E3,{children:u.jsx(H3,{})})}));