Files
mission-control-v2/frontend/dist/assets/index-CSv49ImW.js
T
Hitonabi 0266dc9e92 Refactor: TanStack-Query-Daten-Layer + useDialog (Phase 3b)
- @tanstack/react-query (v5) als zentraler Daten-Layer; QueryClientProvider
  in main.tsx (retry 1, kein refetchOnWindowFocus, staleTime 5s).
- lib/queries.ts: Domänen-Hooks (useHealth/useSystemStatus/useServices/
  useModels/useRouting/useJobs/useTokenStats/useAgentStatus/useUpdates/
  useDiscover/useConnect/useMemory) + zentrale Query-Keys (qk) + invalidate.
  Gleicher Key = eine Anfrage über alle Views (Dedup), einheitliches Polling.
- lib/useDialog.tsx: ein Hook für Alert/Confirm/Prompt statt 5x dupliziertem
  Dialog-State + showAlert/showConfirm.
- api.ts: TokenStats + ModelsResp typisiert.
- Migriert auf Hooks/useDialog: App, SystemView, AgentView, ConnectView,
  MemoryView (manuelles useEffect+setInterval entfernt; Mutationen
  invalidieren gezielt die Query-Keys).

Verifiziert: tsc grün, Build grün, alle migrierten Views ohne Konsolenfehler,
Live-Daten (CPU/RAM/Dienste) rendern korrekt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-26 14:46:26 +02:00

381 lines
444 KiB
JavaScript

var sp=s=>{throw TypeError(s)};var pu=(s,o,i)=>o.has(s)||sp("Cannot "+i);var S=(s,o,i)=>(pu(s,o,"read from private field"),i?i.call(s):o.get(s)),be=(s,o,i)=>o.has(s)?sp("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(s):o.set(s,i),oe=(s,o,i,u)=>(pu(s,o,"write to private field"),u?u.call(s,i):o.set(s,i),i),_e=(s,o,i)=>(pu(s,o,"access private method"),i);var Xl=(s,o,i,u)=>({set _(d){oe(s,o,d,i)},get _(){return S(s,o,u)}});function dx(s,o){for(var i=0;i<o.length;i++){const u=o[i];if(typeof u!="string"&&!Array.isArray(u)){for(const d in u)if(d!=="default"&&!(d in s)){const f=Object.getOwnPropertyDescriptor(u,d);f&&Object.defineProperty(s,d,f.get?f:{enumerable:!0,get:()=>u[d]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const f of d)if(f.type==="childList")for(const g of f.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&u(g)}).observe(document,{childList:!0,subtree:!0});function i(d){const f={};return d.integrity&&(f.integrity=d.integrity),d.referrerPolicy&&(f.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?f.credentials="include":d.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function u(d){if(d.ep)return;d.ep=!0;const f=i(d);fetch(d.href,f)}})();function ih(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var hu={exports:{}},No={},mu={exports:{}},Ce={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var op;function fx(){if(op)return Ce;op=1;var s=Symbol.for("react.element"),o=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),f=Symbol.for("react.provider"),g=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),j=Symbol.iterator;function M(E){return E===null||typeof E!="object"?null:(E=j&&E[j]||E["@@iterator"],typeof E=="function"?E:null)}var O={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,w={};function C(E,k,G){this.props=E,this.context=k,this.refs=w,this.updater=G||O}C.prototype.isReactComponent={},C.prototype.setState=function(E,k){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,k,"setState")},C.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function _(){}_.prototype=C.prototype;function $(E,k,G){this.props=E,this.context=k,this.refs=w,this.updater=G||O}var V=$.prototype=new _;V.constructor=$,A(V,C.prototype),V.isPureReactComponent=!0;var z=Array.isArray,L=Object.prototype.hasOwnProperty,B={current:null},J={key:!0,ref:!0,__self:!0,__source:!0};function te(E,k,G){var X,Z={},ie=null,he=null;if(k!=null)for(X in k.ref!==void 0&&(he=k.ref),k.key!==void 0&&(ie=""+k.key),k)L.call(k,X)&&!J.hasOwnProperty(X)&&(Z[X]=k[X]);var xe=arguments.length-2;if(xe===1)Z.children=G;else if(1<xe){for(var U=Array(xe),F=0;F<xe;F++)U[F]=arguments[F+2];Z.children=U}if(E&&E.defaultProps)for(X in xe=E.defaultProps,xe)Z[X]===void 0&&(Z[X]=xe[X]);return{$$typeof:s,type:E,key:ie,ref:he,props:Z,_owner:B.current}}function re(E,k){return{$$typeof:s,type:E.type,key:k,ref:E.ref,props:E.props,_owner:E._owner}}function ee(E){return typeof E=="object"&&E!==null&&E.$$typeof===s}function ge(E){var k={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(G){return k[G]})}var ue=/\/+/g;function Ae(E,k){return typeof E=="object"&&E!==null&&E.key!=null?ge(""+E.key):k.toString(36)}function Ee(E,k,G,X,Z){var ie=typeof E;(ie==="undefined"||ie==="boolean")&&(E=null);var he=!1;if(E===null)he=!0;else switch(ie){case"string":case"number":he=!0;break;case"object":switch(E.$$typeof){case s:case o:he=!0}}if(he)return he=E,Z=Z(he),E=X===""?"."+Ae(he,0):X,z(Z)?(G="",E!=null&&(G=E.replace(ue,"$&/")+"/"),Ee(Z,k,G,"",function(F){return F})):Z!=null&&(ee(Z)&&(Z=re(Z,G+(!Z.key||he&&he.key===Z.key?"":(""+Z.key).replace(ue,"$&/")+"/")+E)),k.push(Z)),1;if(he=0,X=X===""?".":X+":",z(E))for(var xe=0;xe<E.length;xe++){ie=E[xe];var U=X+Ae(ie,xe);he+=Ee(ie,k,G,U,Z)}else if(U=M(E),typeof U=="function")for(E=U.call(E),xe=0;!(ie=E.next()).done;)ie=ie.value,U=X+Ae(ie,xe++),he+=Ee(ie,k,G,U,Z);else if(ie==="object")throw k=String(E),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.");return he}function De(E,k,G){if(E==null)return E;var X=[],Z=0;return Ee(E,X,"","",function(ie){return k.call(G,ie,Z++)}),X}function Me(E){if(E._status===-1){var k=E._result;k=k(),k.then(function(G){(E._status===0||E._status===-1)&&(E._status=1,E._result=G)},function(G){(E._status===0||E._status===-1)&&(E._status=2,E._result=G)}),E._status===-1&&(E._status=0,E._result=k)}if(E._status===1)return E._result.default;throw E._result}var Pe={current:null},Q={transition:null},ce={ReactCurrentDispatcher:Pe,ReactCurrentBatchConfig:Q,ReactCurrentOwner:B};function q(){throw Error("act(...) is not supported in production builds of React.")}return Ce.Children={map:De,forEach:function(E,k,G){De(E,function(){k.apply(this,arguments)},G)},count:function(E){var k=0;return De(E,function(){k++}),k},toArray:function(E){return De(E,function(k){return k})||[]},only:function(E){if(!ee(E))throw Error("React.Children.only expected to receive a single React element child.");return E}},Ce.Component=C,Ce.Fragment=i,Ce.Profiler=d,Ce.PureComponent=$,Ce.StrictMode=u,Ce.Suspense=v,Ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ce,Ce.act=q,Ce.cloneElement=function(E,k,G){if(E==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+E+".");var X=A({},E.props),Z=E.key,ie=E.ref,he=E._owner;if(k!=null){if(k.ref!==void 0&&(ie=k.ref,he=B.current),k.key!==void 0&&(Z=""+k.key),E.type&&E.type.defaultProps)var xe=E.type.defaultProps;for(U in k)L.call(k,U)&&!J.hasOwnProperty(U)&&(X[U]=k[U]===void 0&&xe!==void 0?xe[U]:k[U])}var U=arguments.length-2;if(U===1)X.children=G;else if(1<U){xe=Array(U);for(var F=0;F<U;F++)xe[F]=arguments[F+2];X.children=xe}return{$$typeof:s,type:E.type,key:Z,ref:ie,props:X,_owner:he}},Ce.createContext=function(E){return E={$$typeof:g,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},E.Provider={$$typeof:f,_context:E},E.Consumer=E},Ce.createElement=te,Ce.createFactory=function(E){var k=te.bind(null,E);return k.type=E,k},Ce.createRef=function(){return{current:null}},Ce.forwardRef=function(E){return{$$typeof:h,render:E}},Ce.isValidElement=ee,Ce.lazy=function(E){return{$$typeof:b,_payload:{_status:-1,_result:E},_init:Me}},Ce.memo=function(E,k){return{$$typeof:x,type:E,compare:k===void 0?null:k}},Ce.startTransition=function(E){var k=Q.transition;Q.transition={};try{E()}finally{Q.transition=k}},Ce.unstable_act=q,Ce.useCallback=function(E,k){return Pe.current.useCallback(E,k)},Ce.useContext=function(E){return Pe.current.useContext(E)},Ce.useDebugValue=function(){},Ce.useDeferredValue=function(E){return Pe.current.useDeferredValue(E)},Ce.useEffect=function(E,k){return Pe.current.useEffect(E,k)},Ce.useId=function(){return Pe.current.useId()},Ce.useImperativeHandle=function(E,k,G){return Pe.current.useImperativeHandle(E,k,G)},Ce.useInsertionEffect=function(E,k){return Pe.current.useInsertionEffect(E,k)},Ce.useLayoutEffect=function(E,k){return Pe.current.useLayoutEffect(E,k)},Ce.useMemo=function(E,k){return Pe.current.useMemo(E,k)},Ce.useReducer=function(E,k,G){return Pe.current.useReducer(E,k,G)},Ce.useRef=function(E){return Pe.current.useRef(E)},Ce.useState=function(E){return Pe.current.useState(E)},Ce.useSyncExternalStore=function(E,k,G){return Pe.current.useSyncExternalStore(E,k,G)},Ce.useTransition=function(){return Pe.current.useTransition()},Ce.version="18.3.1",Ce}var lp;function sc(){return lp||(lp=1,mu.exports=fx()),mu.exports}/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var ip;function px(){if(ip)return No;ip=1;var s=sc(),o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,d=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function g(h,v,x){var b,j={},M=null,O=null;x!==void 0&&(M=""+x),v.key!==void 0&&(M=""+v.key),v.ref!==void 0&&(O=v.ref);for(b in v)u.call(v,b)&&!f.hasOwnProperty(b)&&(j[b]=v[b]);if(h&&h.defaultProps)for(b in v=h.defaultProps,v)j[b]===void 0&&(j[b]=v[b]);return{$$typeof:o,type:h,key:M,ref:O,props:j,_owner:d.current}}return No.Fragment=i,No.jsx=g,No.jsxs=g,No}var ap;function hx(){return ap||(ap=1,hu.exports=px()),hu.exports}var n=hx(),m=sc();const ah=ih(m),oc=dx({__proto__:null,default:ah},[m]);var ei={},gu={exports:{}},jt={},xu={exports:{}},yu={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var up;function mx(){return up||(up=1,(function(s){function o(Q,ce){var q=Q.length;Q.push(ce);e:for(;0<q;){var E=q-1>>>1,k=Q[E];if(0<d(k,ce))Q[E]=ce,Q[q]=k,q=E;else break e}}function i(Q){return Q.length===0?null:Q[0]}function u(Q){if(Q.length===0)return null;var ce=Q[0],q=Q.pop();if(q!==ce){Q[0]=q;e:for(var E=0,k=Q.length,G=k>>>1;E<G;){var X=2*(E+1)-1,Z=Q[X],ie=X+1,he=Q[ie];if(0>d(Z,q))ie<k&&0>d(he,Z)?(Q[E]=he,Q[ie]=q,E=ie):(Q[E]=Z,Q[X]=q,E=X);else if(ie<k&&0>d(he,q))Q[E]=he,Q[ie]=q,E=ie;else break e}}return ce}function d(Q,ce){var q=Q.sortIndex-ce.sortIndex;return q!==0?q:Q.id-ce.id}if(typeof performance=="object"&&typeof performance.now=="function"){var f=performance;s.unstable_now=function(){return f.now()}}else{var g=Date,h=g.now();s.unstable_now=function(){return g.now()-h}}var v=[],x=[],b=1,j=null,M=3,O=!1,A=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,$=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function V(Q){for(var ce=i(x);ce!==null;){if(ce.callback===null)u(x);else if(ce.startTime<=Q)u(x),ce.sortIndex=ce.expirationTime,o(v,ce);else break;ce=i(x)}}function z(Q){if(w=!1,V(Q),!A)if(i(v)!==null)A=!0,Me(L);else{var ce=i(x);ce!==null&&Pe(z,ce.startTime-Q)}}function L(Q,ce){A=!1,w&&(w=!1,_(te),te=-1),O=!0;var q=M;try{for(V(ce),j=i(v);j!==null&&(!(j.expirationTime>ce)||Q&&!ge());){var E=j.callback;if(typeof E=="function"){j.callback=null,M=j.priorityLevel;var k=E(j.expirationTime<=ce);ce=s.unstable_now(),typeof k=="function"?j.callback=k:j===i(v)&&u(v),V(ce)}else u(v);j=i(v)}if(j!==null)var G=!0;else{var X=i(x);X!==null&&Pe(z,X.startTime-ce),G=!1}return G}finally{j=null,M=q,O=!1}}var B=!1,J=null,te=-1,re=5,ee=-1;function ge(){return!(s.unstable_now()-ee<re)}function ue(){if(J!==null){var Q=s.unstable_now();ee=Q;var ce=!0;try{ce=J(!0,Q)}finally{ce?Ae():(B=!1,J=null)}}else B=!1}var Ae;if(typeof $=="function")Ae=function(){$(ue)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,De=Ee.port2;Ee.port1.onmessage=ue,Ae=function(){De.postMessage(null)}}else Ae=function(){C(ue,0)};function Me(Q){J=Q,B||(B=!0,Ae())}function Pe(Q,ce){te=C(function(){Q(s.unstable_now())},ce)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(Q){Q.callback=null},s.unstable_continueExecution=function(){A||O||(A=!0,Me(L))},s.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):re=0<Q?Math.floor(1e3/Q):5},s.unstable_getCurrentPriorityLevel=function(){return M},s.unstable_getFirstCallbackNode=function(){return i(v)},s.unstable_next=function(Q){switch(M){case 1:case 2:case 3:var ce=3;break;default:ce=M}var q=M;M=ce;try{return Q()}finally{M=q}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function(Q,ce){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var q=M;M=Q;try{return ce()}finally{M=q}},s.unstable_scheduleCallback=function(Q,ce,q){var E=s.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?E+q:E):q=E,Q){case 1:var k=-1;break;case 2:k=250;break;case 5:k=1073741823;break;case 4:k=1e4;break;default:k=5e3}return k=q+k,Q={id:b++,callback:ce,priorityLevel:Q,startTime:q,expirationTime:k,sortIndex:-1},q>E?(Q.sortIndex=q,o(x,Q),i(v)===null&&Q===i(x)&&(w?(_(te),te=-1):w=!0,Pe(z,q-E))):(Q.sortIndex=k,o(v,Q),A||O||(A=!0,Me(L))),Q},s.unstable_shouldYield=ge,s.unstable_wrapCallback=function(Q){var ce=M;return function(){var q=M;M=ce;try{return Q.apply(this,arguments)}finally{M=q}}}})(yu)),yu}var cp;function gx(){return cp||(cp=1,xu.exports=mx()),xu.exports}/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var dp;function xx(){if(dp)return jt;dp=1;var s=sc(),o=gx();function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);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."}var u=new Set,d={};function f(e,t){g(e,t),g(e+"Capture",t)}function g(e,t){for(d[e]=t,e=0;e<t.length;e++)u.add(t[e])}var h=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),v=Object.prototype.hasOwnProperty,x=/^[: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]*$/,b={},j={};function M(e){return v.call(j,e)?!0:v.call(b,e)?!1:x.test(e)?j[e]=!0:(b[e]=!0,!1)}function O(e,t,r,l){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return l?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function A(e,t,r,l){if(t===null||typeof t>"u"||O(e,t,r,l))return!0;if(l)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function w(e,t,r,l,a,c,p){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=l,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=c,this.removeEmptyString=p}var C={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){C[e]=new w(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];C[t]=new w(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){C[e]=new w(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){C[e]=new w(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){C[e]=new w(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){C[e]=new w(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){C[e]=new w(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){C[e]=new w(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){C[e]=new w(e,5,!1,e.toLowerCase(),null,!1,!1)});var _=/[\-:]([a-z])/g;function $(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(_,$);C[t]=new w(t,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(_,$);C[t]=new w(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(_,$);C[t]=new w(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){C[e]=new w(e,1,!1,e.toLowerCase(),null,!1,!1)}),C.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){C[e]=new w(e,1,!1,e.toLowerCase(),null,!0,!0)});function V(e,t,r,l){var a=C.hasOwnProperty(t)?C[t]:null;(a!==null?a.type!==0:l||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(A(t,r,a,l)&&(r=null),l||a===null?M(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):a.mustUseProperty?e[a.propertyName]=r===null?a.type===3?!1:"":r:(t=a.attributeName,l=a.attributeNamespace,r===null?e.removeAttribute(t):(a=a.type,r=a===3||a===4&&r===!0?"":""+r,l?e.setAttributeNS(l,t,r):e.setAttribute(t,r))))}var z=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,L=Symbol.for("react.element"),B=Symbol.for("react.portal"),J=Symbol.for("react.fragment"),te=Symbol.for("react.strict_mode"),re=Symbol.for("react.profiler"),ee=Symbol.for("react.provider"),ge=Symbol.for("react.context"),ue=Symbol.for("react.forward_ref"),Ae=Symbol.for("react.suspense"),Ee=Symbol.for("react.suspense_list"),De=Symbol.for("react.memo"),Me=Symbol.for("react.lazy"),Pe=Symbol.for("react.offscreen"),Q=Symbol.iterator;function ce(e){return e===null||typeof e!="object"?null:(e=Q&&e[Q]||e["@@iterator"],typeof e=="function"?e:null)}var q=Object.assign,E;function k(e){if(E===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);E=t&&t[1]||""}return`
`+E+e}var G=!1;function X(e,t){if(!e||G)return"";G=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(I){var l=I}Reflect.construct(e,[],t)}else{try{t.call()}catch(I){l=I}e.call(t.prototype)}else{try{throw Error()}catch(I){l=I}e()}}catch(I){if(I&&l&&typeof I.stack=="string"){for(var a=I.stack.split(`
`),c=l.stack.split(`
`),p=a.length-1,y=c.length-1;1<=p&&0<=y&&a[p]!==c[y];)y--;for(;1<=p&&0<=y;p--,y--)if(a[p]!==c[y]){if(p!==1||y!==1)do if(p--,y--,0>y||a[p]!==c[y]){var N=`
`+a[p].replace(" at new "," at ");return e.displayName&&N.includes("<anonymous>")&&(N=N.replace("<anonymous>",e.displayName)),N}while(1<=p&&0<=y);break}}}finally{G=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?k(e):""}function Z(e){switch(e.tag){case 5:return k(e.type);case 16:return k("Lazy");case 13:return k("Suspense");case 19:return k("SuspenseList");case 0:case 2:case 15:return e=X(e.type,!1),e;case 11:return e=X(e.type.render,!1),e;case 1:return e=X(e.type,!0),e;default:return""}}function ie(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case J:return"Fragment";case B:return"Portal";case re:return"Profiler";case te:return"StrictMode";case Ae:return"Suspense";case Ee:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ge:return(e.displayName||"Context")+".Consumer";case ee:return(e._context.displayName||"Context")+".Provider";case ue:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case De:return t=e.displayName||null,t!==null?t:ie(e.type)||"Memo";case Me:t=e._payload,e=e._init;try{return ie(e(t))}catch{}}return null}function he(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ie(t);case 8:return t===te?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function xe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function U(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function F(e){var t=U(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,c=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(p){l=""+p,c.call(this,p)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return l},setValue:function(p){l=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function we(e){e._valueTracker||(e._valueTracker=F(e))}function at(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),l="";return e&&(l=U(e)?e.checked?"true":"false":e.value),e=l,e!==r?(t.setValue(e),!0):!1}function Ct(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}}function Et(e,t){var r=t.checked;return q({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Pt(e,t){var r=t.defaultValue==null?"":t.defaultValue,l=t.checked!=null?t.checked:t.defaultChecked;r=xe(t.value!=null?t.value:r),e._wrapperState={initialChecked:l,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Fs(e,t){t=t.checked,t!=null&&V(e,"checked",t,!1)}function $n(e,t){Fs(e,t);var r=xe(t.value),l=t.type;if(r!=null)l==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(l==="submit"||l==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Bn(e,t.type,r):t.hasOwnProperty("defaultValue")&&Bn(e,t.type,xe(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Sr(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var l=t.type;if(!(l!=="submit"&&l!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Bn(e,t,r){(t!=="number"||Ct(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Cr=Array.isArray;function ur(e,t,r,l){if(e=e.options,t){t={};for(var a=0;a<r.length;a++)t["$"+r[a]]=!0;for(r=0;r<e.length;r++)a=t.hasOwnProperty("$"+e[r].value),e[r].selected!==a&&(e[r].selected=a),a&&l&&(e[r].defaultSelected=!0)}else{for(r=""+xe(r),t=null,a=0;a<e.length;a++){if(e[a].value===r){e[a].selected=!0,l&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Hn(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(i(91));return q({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Us(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(i(92));if(Cr(r)){if(1<r.length)throw Error(i(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:xe(r)}}function T(e,t){var r=xe(t.value),l=xe(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),l!=null&&(e.defaultValue=""+l)}function le(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function ke(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Re(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ke(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Fe,Ht=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,l,a){MSApp.execUnsafeLocalFunction(function(){return e(t,r,l,a)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Fe=Fe||document.createElement("div"),Fe.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Fe.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function cr(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var dr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ni=["Webkit","ms","Moz","O"];Object.keys(dr).forEach(function(e){Ni.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),dr[t]=dr[e]})});function yc(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||dr.hasOwnProperty(e)&&dr[e]?(""+t).trim():t+"px"}function vc(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var l=r.indexOf("--")===0,a=yc(r,t[r],l);r==="float"&&(r="cssFloat"),l?e.setProperty(r,a):e[r]=a}}var gm=q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Si(e,t){if(t){if(gm[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(i(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(i(61))}if(t.style!=null&&typeof t.style!="object")throw Error(i(62))}}function Ci(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Ei=null;function Pi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var _i=null,Wn=null,Vn=null;function bc(e){if(e=ao(e)){if(typeof _i!="function")throw Error(i(280));var t=e.stateNode;t&&(t=hl(t),_i(e.stateNode,e.type,t))}}function wc(e){Wn?Vn?Vn.push(e):Vn=[e]:Wn=e}function jc(){if(Wn){var e=Wn,t=Vn;if(Vn=Wn=null,bc(e),t)for(e=0;e<t.length;e++)bc(t[e])}}function kc(e,t){return e(t)}function Nc(){}var Mi=!1;function Sc(e,t,r){if(Mi)return e(t,r);Mi=!0;try{return kc(e,t,r)}finally{Mi=!1,(Wn!==null||Vn!==null)&&(Nc(),jc())}}function $s(e,t){var r=e.stateNode;if(r===null)return null;var l=hl(r);if(l===null)return null;r=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(r&&typeof r!="function")throw Error(i(231,t,typeof r));return r}var Ri=!1;if(h)try{var Bs={};Object.defineProperty(Bs,"passive",{get:function(){Ri=!0}}),window.addEventListener("test",Bs,Bs),window.removeEventListener("test",Bs,Bs)}catch{Ri=!1}function xm(e,t,r,l,a,c,p,y,N){var I=Array.prototype.slice.call(arguments,3);try{t.apply(r,I)}catch(W){this.onError(W)}}var Hs=!1,Go=null,Ko=!1,Oi=null,ym={onError:function(e){Hs=!0,Go=e}};function vm(e,t,r,l,a,c,p,y,N){Hs=!1,Go=null,xm.apply(ym,arguments)}function bm(e,t,r,l,a,c,p,y,N){if(vm.apply(this,arguments),Hs){if(Hs){var I=Go;Hs=!1,Go=null}else throw Error(i(198));Ko||(Ko=!0,Oi=I)}}function un(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function Cc(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 Ec(e){if(un(e)!==e)throw Error(i(188))}function wm(e){var t=e.alternate;if(!t){if(t=un(e),t===null)throw Error(i(188));return t!==e?null:e}for(var r=e,l=t;;){var a=r.return;if(a===null)break;var c=a.alternate;if(c===null){if(l=a.return,l!==null){r=l;continue}break}if(a.child===c.child){for(c=a.child;c;){if(c===r)return Ec(a),e;if(c===l)return Ec(a),t;c=c.sibling}throw Error(i(188))}if(r.return!==l.return)r=a,l=c;else{for(var p=!1,y=a.child;y;){if(y===r){p=!0,r=a,l=c;break}if(y===l){p=!0,l=a,r=c;break}y=y.sibling}if(!p){for(y=c.child;y;){if(y===r){p=!0,r=c,l=a;break}if(y===l){p=!0,l=c,r=a;break}y=y.sibling}if(!p)throw Error(i(189))}}if(r.alternate!==l)throw Error(i(190))}if(r.tag!==3)throw Error(i(188));return r.stateNode.current===r?e:t}function Pc(e){return e=wm(e),e!==null?_c(e):null}function _c(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=_c(e);if(t!==null)return t;e=e.sibling}return null}var Mc=o.unstable_scheduleCallback,Rc=o.unstable_cancelCallback,jm=o.unstable_shouldYield,km=o.unstable_requestPaint,qe=o.unstable_now,Nm=o.unstable_getCurrentPriorityLevel,Di=o.unstable_ImmediatePriority,Oc=o.unstable_UserBlockingPriority,Qo=o.unstable_NormalPriority,Sm=o.unstable_LowPriority,Dc=o.unstable_IdlePriority,qo=null,Xt=null;function Cm(e){if(Xt&&typeof Xt.onCommitFiberRoot=="function")try{Xt.onCommitFiberRoot(qo,e,void 0,(e.current.flags&128)===128)}catch{}}var Wt=Math.clz32?Math.clz32:_m,Em=Math.log,Pm=Math.LN2;function _m(e){return e>>>=0,e===0?32:31-(Em(e)/Pm|0)|0}var Zo=64,Yo=4194304;function Ws(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Jo(e,t){var r=e.pendingLanes;if(r===0)return 0;var l=0,a=e.suspendedLanes,c=e.pingedLanes,p=r&268435455;if(p!==0){var y=p&~a;y!==0?l=Ws(y):(c&=p,c!==0&&(l=Ws(c)))}else p=r&~a,p!==0?l=Ws(p):c!==0&&(l=Ws(c));if(l===0)return 0;if(t!==0&&t!==l&&(t&a)===0&&(a=l&-l,c=t&-t,a>=c||a===16&&(c&4194240)!==0))return t;if((l&4)!==0&&(l|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=l;0<t;)r=31-Wt(t),a=1<<r,l|=e[r],t&=~a;return l}function Mm(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Rm(e,t){for(var r=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,c=e.pendingLanes;0<c;){var p=31-Wt(c),y=1<<p,N=a[p];N===-1?((y&r)===0||(y&l)!==0)&&(a[p]=Mm(y,t)):N<=t&&(e.expiredLanes|=y),c&=~y}}function Ti(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Tc(){var e=Zo;return Zo<<=1,(Zo&4194240)===0&&(Zo=64),e}function Ai(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Vs(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Wt(t),e[t]=r}function Om(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var l=e.eventTimes;for(e=e.expirationTimes;0<r;){var a=31-Wt(r),c=1<<a;t[a]=0,l[a]=-1,e[a]=-1,r&=~c}}function zi(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var l=31-Wt(r),a=1<<l;a&t|e[l]&t&&(e[l]|=t),r&=~a}}var Ie=0;function Ac(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var zc,Li,Lc,Ic,Fc,Ii=!1,Xo=[],Er=null,Pr=null,_r=null,Gs=new Map,Ks=new Map,Mr=[],Dm="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 submit".split(" ");function Uc(e,t){switch(e){case"focusin":case"focusout":Er=null;break;case"dragenter":case"dragleave":Pr=null;break;case"mouseover":case"mouseout":_r=null;break;case"pointerover":case"pointerout":Gs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ks.delete(t.pointerId)}}function Qs(e,t,r,l,a,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:r,eventSystemFlags:l,nativeEvent:c,targetContainers:[a]},t!==null&&(t=ao(t),t!==null&&Li(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Tm(e,t,r,l,a){switch(t){case"focusin":return Er=Qs(Er,e,t,r,l,a),!0;case"dragenter":return Pr=Qs(Pr,e,t,r,l,a),!0;case"mouseover":return _r=Qs(_r,e,t,r,l,a),!0;case"pointerover":var c=a.pointerId;return Gs.set(c,Qs(Gs.get(c)||null,e,t,r,l,a)),!0;case"gotpointercapture":return c=a.pointerId,Ks.set(c,Qs(Ks.get(c)||null,e,t,r,l,a)),!0}return!1}function $c(e){var t=cn(e.target);if(t!==null){var r=un(t);if(r!==null){if(t=r.tag,t===13){if(t=Cc(r),t!==null){e.blockedOn=t,Fc(e.priority,function(){Lc(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function el(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Ui(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var l=new r.constructor(r.type,r);Ei=l,r.target.dispatchEvent(l),Ei=null}else return t=ao(r),t!==null&&Li(t),e.blockedOn=r,!1;t.shift()}return!0}function Bc(e,t,r){el(e)&&r.delete(t)}function Am(){Ii=!1,Er!==null&&el(Er)&&(Er=null),Pr!==null&&el(Pr)&&(Pr=null),_r!==null&&el(_r)&&(_r=null),Gs.forEach(Bc),Ks.forEach(Bc)}function qs(e,t){e.blockedOn===t&&(e.blockedOn=null,Ii||(Ii=!0,o.unstable_scheduleCallback(o.unstable_NormalPriority,Am)))}function Zs(e){function t(a){return qs(a,e)}if(0<Xo.length){qs(Xo[0],e);for(var r=1;r<Xo.length;r++){var l=Xo[r];l.blockedOn===e&&(l.blockedOn=null)}}for(Er!==null&&qs(Er,e),Pr!==null&&qs(Pr,e),_r!==null&&qs(_r,e),Gs.forEach(t),Ks.forEach(t),r=0;r<Mr.length;r++)l=Mr[r],l.blockedOn===e&&(l.blockedOn=null);for(;0<Mr.length&&(r=Mr[0],r.blockedOn===null);)$c(r),r.blockedOn===null&&Mr.shift()}var Gn=z.ReactCurrentBatchConfig,tl=!0;function zm(e,t,r,l){var a=Ie,c=Gn.transition;Gn.transition=null;try{Ie=1,Fi(e,t,r,l)}finally{Ie=a,Gn.transition=c}}function Lm(e,t,r,l){var a=Ie,c=Gn.transition;Gn.transition=null;try{Ie=4,Fi(e,t,r,l)}finally{Ie=a,Gn.transition=c}}function Fi(e,t,r,l){if(tl){var a=Ui(e,t,r,l);if(a===null)na(e,t,l,rl,r),Uc(e,l);else if(Tm(a,e,t,r,l))l.stopPropagation();else if(Uc(e,l),t&4&&-1<Dm.indexOf(e)){for(;a!==null;){var c=ao(a);if(c!==null&&zc(c),c=Ui(e,t,r,l),c===null&&na(e,t,l,rl,r),c===a)break;a=c}a!==null&&l.stopPropagation()}else na(e,t,l,null,r)}}var rl=null;function Ui(e,t,r,l){if(rl=null,e=Pi(l),e=cn(e),e!==null)if(t=un(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Cc(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return rl=e,null}function Hc(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Nm()){case Di:return 1;case Oc:return 4;case Qo:case Sm:return 16;case Dc:return 536870912;default:return 16}default:return 16}}var Rr=null,$i=null,nl=null;function Wc(){if(nl)return nl;var e,t=$i,r=t.length,l,a="value"in Rr?Rr.value:Rr.textContent,c=a.length;for(e=0;e<r&&t[e]===a[e];e++);var p=r-e;for(l=1;l<=p&&t[r-l]===a[c-l];l++);return nl=a.slice(e,1<l?1-l:void 0)}function sl(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 ol(){return!0}function Vc(){return!1}function _t(e){function t(r,l,a,c,p){this._reactName=r,this._targetInst=a,this.type=l,this.nativeEvent=c,this.target=p,this.currentTarget=null;for(var y in e)e.hasOwnProperty(y)&&(r=e[y],this[y]=r?r(c):c[y]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?ol:Vc,this.isPropagationStopped=Vc,this}return q(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=ol)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=ol)},persist:function(){},isPersistent:ol}),t}var Kn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bi=_t(Kn),Ys=q({},Kn,{view:0,detail:0}),Im=_t(Ys),Hi,Wi,Js,ll=q({},Ys,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gi,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!==Js&&(Js&&e.type==="mousemove"?(Hi=e.screenX-Js.screenX,Wi=e.screenY-Js.screenY):Wi=Hi=0,Js=e),Hi)},movementY:function(e){return"movementY"in e?e.movementY:Wi}}),Gc=_t(ll),Fm=q({},ll,{dataTransfer:0}),Um=_t(Fm),$m=q({},Ys,{relatedTarget:0}),Vi=_t($m),Bm=q({},Kn,{animationName:0,elapsedTime:0,pseudoElement:0}),Hm=_t(Bm),Wm=q({},Kn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Vm=_t(Wm),Gm=q({},Kn,{data:0}),Kc=_t(Gm),Km={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Qm={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"},qm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=qm[e])?!!t[e]:!1}function Gi(){return Zm}var Ym=q({},Ys,{key:function(e){if(e.key){var t=Km[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=sl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Qm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gi,charCode:function(e){return e.type==="keypress"?sl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?sl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Jm=_t(Ym),Xm=q({},ll,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qc=_t(Xm),eg=q({},Ys,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gi}),tg=_t(eg),rg=q({},Kn,{propertyName:0,elapsedTime:0,pseudoElement:0}),ng=_t(rg),sg=q({},ll,{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}),og=_t(sg),lg=[9,13,27,32],Ki=h&&"CompositionEvent"in window,Xs=null;h&&"documentMode"in document&&(Xs=document.documentMode);var ig=h&&"TextEvent"in window&&!Xs,qc=h&&(!Ki||Xs&&8<Xs&&11>=Xs),Zc=" ",Yc=!1;function Jc(e,t){switch(e){case"keyup":return lg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qn=!1;function ag(e,t){switch(e){case"compositionend":return Xc(t);case"keypress":return t.which!==32?null:(Yc=!0,Zc);case"textInput":return e=t.data,e===Zc&&Yc?null:e;default:return null}}function ug(e,t){if(Qn)return e==="compositionend"||!Ki&&Jc(e,t)?(e=Wc(),nl=$i=Rr=null,Qn=!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 qc&&t.locale!=="ko"?null:t.data;default:return null}}var cg={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function ed(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!cg[e.type]:t==="textarea"}function td(e,t,r,l){wc(l),t=dl(t,"onChange"),0<t.length&&(r=new Bi("onChange","change",null,r,l),e.push({event:r,listeners:t}))}var eo=null,to=null;function dg(e){vd(e,0)}function il(e){var t=Xn(e);if(at(t))return e}function fg(e,t){if(e==="change")return t}var rd=!1;if(h){var Qi;if(h){var qi="oninput"in document;if(!qi){var nd=document.createElement("div");nd.setAttribute("oninput","return;"),qi=typeof nd.oninput=="function"}Qi=qi}else Qi=!1;rd=Qi&&(!document.documentMode||9<document.documentMode)}function sd(){eo&&(eo.detachEvent("onpropertychange",od),to=eo=null)}function od(e){if(e.propertyName==="value"&&il(to)){var t=[];td(t,to,e,Pi(e)),Sc(dg,t)}}function pg(e,t,r){e==="focusin"?(sd(),eo=t,to=r,eo.attachEvent("onpropertychange",od)):e==="focusout"&&sd()}function hg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return il(to)}function mg(e,t){if(e==="click")return il(t)}function gg(e,t){if(e==="input"||e==="change")return il(t)}function xg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Vt=typeof Object.is=="function"?Object.is:xg;function ro(e,t){if(Vt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),l=Object.keys(t);if(r.length!==l.length)return!1;for(l=0;l<r.length;l++){var a=r[l];if(!v.call(t,a)||!Vt(e[a],t[a]))return!1}return!0}function ld(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function id(e,t){var r=ld(e);e=0;for(var l;r;){if(r.nodeType===3){if(l=e+r.textContent.length,e<=t&&l>=t)return{node:r,offset:t-e};e=l}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ld(r)}}function ad(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ad(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ud(){for(var e=window,t=Ct();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Ct(e.document)}return t}function Zi(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")}function yg(e){var t=ud(),r=e.focusedElem,l=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&ad(r.ownerDocument.documentElement,r)){if(l!==null&&Zi(r)){if(t=l.start,e=l.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,c=Math.min(l.start,a);l=l.end===void 0?c:Math.min(l.end,a),!e.extend&&c>l&&(a=l,l=c,c=a),a=id(r,c);var p=id(r,l);a&&p&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==p.node||e.focusOffset!==p.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),c>l?(e.addRange(t),e.extend(p.node,p.offset)):(t.setEnd(p.node,p.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var vg=h&&"documentMode"in document&&11>=document.documentMode,qn=null,Yi=null,no=null,Ji=!1;function cd(e,t,r){var l=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ji||qn==null||qn!==Ct(l)||(l=qn,"selectionStart"in l&&Zi(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}),no&&ro(no,l)||(no=l,l=dl(Yi,"onSelect"),0<l.length&&(t=new Bi("onSelect","select",null,t,r),e.push({event:t,listeners:l}),t.target=qn)))}function al(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Zn={animationend:al("Animation","AnimationEnd"),animationiteration:al("Animation","AnimationIteration"),animationstart:al("Animation","AnimationStart"),transitionend:al("Transition","TransitionEnd")},Xi={},dd={};h&&(dd=document.createElement("div").style,"AnimationEvent"in window||(delete Zn.animationend.animation,delete Zn.animationiteration.animation,delete Zn.animationstart.animation),"TransitionEvent"in window||delete Zn.transitionend.transition);function ul(e){if(Xi[e])return Xi[e];if(!Zn[e])return e;var t=Zn[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in dd)return Xi[e]=t[r];return e}var fd=ul("animationend"),pd=ul("animationiteration"),hd=ul("animationstart"),md=ul("transitionend"),gd=new Map,xd="abort auxClick 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(" ");function Or(e,t){gd.set(e,t),f(t,[e])}for(var ea=0;ea<xd.length;ea++){var ta=xd[ea],bg=ta.toLowerCase(),wg=ta[0].toUpperCase()+ta.slice(1);Or(bg,"on"+wg)}Or(fd,"onAnimationEnd"),Or(pd,"onAnimationIteration"),Or(hd,"onAnimationStart"),Or("dblclick","onDoubleClick"),Or("focusin","onFocus"),Or("focusout","onBlur"),Or(md,"onTransitionEnd"),g("onMouseEnter",["mouseout","mouseover"]),g("onMouseLeave",["mouseout","mouseover"]),g("onPointerEnter",["pointerout","pointerover"]),g("onPointerLeave",["pointerout","pointerover"]),f("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),f("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),f("onBeforeInput",["compositionend","keypress","textInput","paste"]),f("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),f("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var so="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(" "),jg=new Set("cancel close invalid load scroll toggle".split(" ").concat(so));function yd(e,t,r){var l=e.type||"unknown-event";e.currentTarget=r,bm(l,t,void 0,e),e.currentTarget=null}function vd(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var l=e[r],a=l.event;l=l.listeners;e:{var c=void 0;if(t)for(var p=l.length-1;0<=p;p--){var y=l[p],N=y.instance,I=y.currentTarget;if(y=y.listener,N!==c&&a.isPropagationStopped())break e;yd(a,y,I),c=N}else for(p=0;p<l.length;p++){if(y=l[p],N=y.instance,I=y.currentTarget,y=y.listener,N!==c&&a.isPropagationStopped())break e;yd(a,y,I),c=N}}}if(Ko)throw e=Oi,Ko=!1,Oi=null,e}function $e(e,t){var r=t[ua];r===void 0&&(r=t[ua]=new Set);var l=e+"__bubble";r.has(l)||(bd(t,e,2,!1),r.add(l))}function ra(e,t,r){var l=0;t&&(l|=4),bd(r,e,l,t)}var cl="_reactListening"+Math.random().toString(36).slice(2);function oo(e){if(!e[cl]){e[cl]=!0,u.forEach(function(r){r!=="selectionchange"&&(jg.has(r)||ra(r,!1,e),ra(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[cl]||(t[cl]=!0,ra("selectionchange",!1,t))}}function bd(e,t,r,l){switch(Hc(t)){case 1:var a=zm;break;case 4:a=Lm;break;default:a=Fi}r=a.bind(null,t,r,e),a=void 0,!Ri||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),l?a!==void 0?e.addEventListener(t,r,{capture:!0,passive:a}):e.addEventListener(t,r,!0):a!==void 0?e.addEventListener(t,r,{passive:a}):e.addEventListener(t,r,!1)}function na(e,t,r,l,a){var c=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var p=l.tag;if(p===3||p===4){var y=l.stateNode.containerInfo;if(y===a||y.nodeType===8&&y.parentNode===a)break;if(p===4)for(p=l.return;p!==null;){var N=p.tag;if((N===3||N===4)&&(N=p.stateNode.containerInfo,N===a||N.nodeType===8&&N.parentNode===a))return;p=p.return}for(;y!==null;){if(p=cn(y),p===null)return;if(N=p.tag,N===5||N===6){l=c=p;continue e}y=y.parentNode}}l=l.return}Sc(function(){var I=c,W=Pi(r),K=[];e:{var H=gd.get(e);if(H!==void 0){var se=Bi,de=e;switch(e){case"keypress":if(sl(r)===0)break e;case"keydown":case"keyup":se=Jm;break;case"focusin":de="focus",se=Vi;break;case"focusout":de="blur",se=Vi;break;case"beforeblur":case"afterblur":se=Vi;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=Gc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=Um;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=tg;break;case fd:case pd:case hd:se=Hm;break;case md:se=ng;break;case"scroll":se=Im;break;case"wheel":se=og;break;case"copy":case"cut":case"paste":se=Vm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=Qc}var fe=(t&4)!==0,Ze=!fe&&e==="scroll",R=fe?H!==null?H+"Capture":null:H;fe=[];for(var P=I,D;P!==null;){D=P;var Y=D.stateNode;if(D.tag===5&&Y!==null&&(D=Y,R!==null&&(Y=$s(P,R),Y!=null&&fe.push(lo(P,Y,D)))),Ze)break;P=P.return}0<fe.length&&(H=new se(H,de,null,r,W),K.push({event:H,listeners:fe}))}}if((t&7)===0){e:{if(H=e==="mouseover"||e==="pointerover",se=e==="mouseout"||e==="pointerout",H&&r!==Ei&&(de=r.relatedTarget||r.fromElement)&&(cn(de)||de[fr]))break e;if((se||H)&&(H=W.window===W?W:(H=W.ownerDocument)?H.defaultView||H.parentWindow:window,se?(de=r.relatedTarget||r.toElement,se=I,de=de?cn(de):null,de!==null&&(Ze=un(de),de!==Ze||de.tag!==5&&de.tag!==6)&&(de=null)):(se=null,de=I),se!==de)){if(fe=Gc,Y="onMouseLeave",R="onMouseEnter",P="mouse",(e==="pointerout"||e==="pointerover")&&(fe=Qc,Y="onPointerLeave",R="onPointerEnter",P="pointer"),Ze=se==null?H:Xn(se),D=de==null?H:Xn(de),H=new fe(Y,P+"leave",se,r,W),H.target=Ze,H.relatedTarget=D,Y=null,cn(W)===I&&(fe=new fe(R,P+"enter",de,r,W),fe.target=D,fe.relatedTarget=Ze,Y=fe),Ze=Y,se&&de)t:{for(fe=se,R=de,P=0,D=fe;D;D=Yn(D))P++;for(D=0,Y=R;Y;Y=Yn(Y))D++;for(;0<P-D;)fe=Yn(fe),P--;for(;0<D-P;)R=Yn(R),D--;for(;P--;){if(fe===R||R!==null&&fe===R.alternate)break t;fe=Yn(fe),R=Yn(R)}fe=null}else fe=null;se!==null&&wd(K,H,se,fe,!1),de!==null&&Ze!==null&&wd(K,Ze,de,fe,!0)}}e:{if(H=I?Xn(I):window,se=H.nodeName&&H.nodeName.toLowerCase(),se==="select"||se==="input"&&H.type==="file")var pe=fg;else if(ed(H))if(rd)pe=gg;else{pe=hg;var ye=pg}else(se=H.nodeName)&&se.toLowerCase()==="input"&&(H.type==="checkbox"||H.type==="radio")&&(pe=mg);if(pe&&(pe=pe(e,I))){td(K,pe,r,W);break e}ye&&ye(e,H,I),e==="focusout"&&(ye=H._wrapperState)&&ye.controlled&&H.type==="number"&&Bn(H,"number",H.value)}switch(ye=I?Xn(I):window,e){case"focusin":(ed(ye)||ye.contentEditable==="true")&&(qn=ye,Yi=I,no=null);break;case"focusout":no=Yi=qn=null;break;case"mousedown":Ji=!0;break;case"contextmenu":case"mouseup":case"dragend":Ji=!1,cd(K,r,W);break;case"selectionchange":if(vg)break;case"keydown":case"keyup":cd(K,r,W)}var ve;if(Ki)e:{switch(e){case"compositionstart":var Ne="onCompositionStart";break e;case"compositionend":Ne="onCompositionEnd";break e;case"compositionupdate":Ne="onCompositionUpdate";break e}Ne=void 0}else Qn?Jc(e,r)&&(Ne="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(Ne="onCompositionStart");Ne&&(qc&&r.locale!=="ko"&&(Qn||Ne!=="onCompositionStart"?Ne==="onCompositionEnd"&&Qn&&(ve=Wc()):(Rr=W,$i="value"in Rr?Rr.value:Rr.textContent,Qn=!0)),ye=dl(I,Ne),0<ye.length&&(Ne=new Kc(Ne,e,null,r,W),K.push({event:Ne,listeners:ye}),ve?Ne.data=ve:(ve=Xc(r),ve!==null&&(Ne.data=ve)))),(ve=ig?ag(e,r):ug(e,r))&&(I=dl(I,"onBeforeInput"),0<I.length&&(W=new Kc("onBeforeInput","beforeinput",null,r,W),K.push({event:W,listeners:I}),W.data=ve))}vd(K,t)})}function lo(e,t,r){return{instance:e,listener:t,currentTarget:r}}function dl(e,t){for(var r=t+"Capture",l=[];e!==null;){var a=e,c=a.stateNode;a.tag===5&&c!==null&&(a=c,c=$s(e,r),c!=null&&l.unshift(lo(e,c,a)),c=$s(e,t),c!=null&&l.push(lo(e,c,a))),e=e.return}return l}function Yn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function wd(e,t,r,l,a){for(var c=t._reactName,p=[];r!==null&&r!==l;){var y=r,N=y.alternate,I=y.stateNode;if(N!==null&&N===l)break;y.tag===5&&I!==null&&(y=I,a?(N=$s(r,c),N!=null&&p.unshift(lo(r,N,y))):a||(N=$s(r,c),N!=null&&p.push(lo(r,N,y)))),r=r.return}p.length!==0&&e.push({event:t,listeners:p})}var kg=/\r\n?/g,Ng=/\u0000|\uFFFD/g;function jd(e){return(typeof e=="string"?e:""+e).replace(kg,`
`).replace(Ng,"")}function fl(e,t,r){if(t=jd(t),jd(e)!==t&&r)throw Error(i(425))}function pl(){}var sa=null,oa=null;function la(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ia=typeof setTimeout=="function"?setTimeout:void 0,Sg=typeof clearTimeout=="function"?clearTimeout:void 0,kd=typeof Promise=="function"?Promise:void 0,Cg=typeof queueMicrotask=="function"?queueMicrotask:typeof kd<"u"?function(e){return kd.resolve(null).then(e).catch(Eg)}:ia;function Eg(e){setTimeout(function(){throw e})}function aa(e,t){var r=t,l=0;do{var a=r.nextSibling;if(e.removeChild(r),a&&a.nodeType===8)if(r=a.data,r==="/$"){if(l===0){e.removeChild(a),Zs(t);return}l--}else r!=="$"&&r!=="$?"&&r!=="$!"||l++;r=a}while(r);Zs(t)}function Dr(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==="$?")break;if(t==="/$")return null}}return e}function Nd(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var Jn=Math.random().toString(36).slice(2),er="__reactFiber$"+Jn,io="__reactProps$"+Jn,fr="__reactContainer$"+Jn,ua="__reactEvents$"+Jn,Pg="__reactListeners$"+Jn,_g="__reactHandles$"+Jn;function cn(e){var t=e[er];if(t)return t;for(var r=e.parentNode;r;){if(t=r[fr]||r[er]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Nd(e);e!==null;){if(r=e[er])return r;e=Nd(e)}return t}e=r,r=e.parentNode}return null}function ao(e){return e=e[er]||e[fr],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Xn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function hl(e){return e[io]||null}var ca=[],es=-1;function Tr(e){return{current:e}}function Be(e){0>es||(e.current=ca[es],ca[es]=null,es--)}function Ue(e,t){es++,ca[es]=e.current,e.current=t}var Ar={},ut=Tr(Ar),xt=Tr(!1),dn=Ar;function ts(e,t){var r=e.type.contextTypes;if(!r)return Ar;var l=e.stateNode;if(l&&l.__reactInternalMemoizedUnmaskedChildContext===t)return l.__reactInternalMemoizedMaskedChildContext;var a={},c;for(c in r)a[c]=t[c];return l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function yt(e){return e=e.childContextTypes,e!=null}function ml(){Be(xt),Be(ut)}function Sd(e,t,r){if(ut.current!==Ar)throw Error(i(168));Ue(ut,t),Ue(xt,r)}function Cd(e,t,r){var l=e.stateNode;if(t=t.childContextTypes,typeof l.getChildContext!="function")return r;l=l.getChildContext();for(var a in l)if(!(a in t))throw Error(i(108,he(e)||"Unknown",a));return q({},r,l)}function gl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ar,dn=ut.current,Ue(ut,e),Ue(xt,xt.current),!0}function Ed(e,t,r){var l=e.stateNode;if(!l)throw Error(i(169));r?(e=Cd(e,t,dn),l.__reactInternalMemoizedMergedChildContext=e,Be(xt),Be(ut),Ue(ut,e)):Be(xt),Ue(xt,r)}var pr=null,xl=!1,da=!1;function Pd(e){pr===null?pr=[e]:pr.push(e)}function Mg(e){xl=!0,Pd(e)}function zr(){if(!da&&pr!==null){da=!0;var e=0,t=Ie;try{var r=pr;for(Ie=1;e<r.length;e++){var l=r[e];do l=l(!0);while(l!==null)}pr=null,xl=!1}catch(a){throw pr!==null&&(pr=pr.slice(e+1)),Mc(Di,zr),a}finally{Ie=t,da=!1}}return null}var rs=[],ns=0,yl=null,vl=0,zt=[],Lt=0,fn=null,hr=1,mr="";function pn(e,t){rs[ns++]=vl,rs[ns++]=yl,yl=e,vl=t}function _d(e,t,r){zt[Lt++]=hr,zt[Lt++]=mr,zt[Lt++]=fn,fn=e;var l=hr;e=mr;var a=32-Wt(l)-1;l&=~(1<<a),r+=1;var c=32-Wt(t)+a;if(30<c){var p=a-a%5;c=(l&(1<<p)-1).toString(32),l>>=p,a-=p,hr=1<<32-Wt(t)+a|r<<a|l,mr=c+e}else hr=1<<c|r<<a|l,mr=e}function fa(e){e.return!==null&&(pn(e,1),_d(e,1,0))}function pa(e){for(;e===yl;)yl=rs[--ns],rs[ns]=null,vl=rs[--ns],rs[ns]=null;for(;e===fn;)fn=zt[--Lt],zt[Lt]=null,mr=zt[--Lt],zt[Lt]=null,hr=zt[--Lt],zt[Lt]=null}var Mt=null,Rt=null,We=!1,Gt=null;function Md(e,t){var r=$t(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Rd(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Mt=e,Rt=Dr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Mt=e,Rt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=fn!==null?{id:hr,overflow:mr}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=$t(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Mt=e,Rt=null,!0):!1;default:return!1}}function ha(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ma(e){if(We){var t=Rt;if(t){var r=t;if(!Rd(e,t)){if(ha(e))throw Error(i(418));t=Dr(r.nextSibling);var l=Mt;t&&Rd(e,t)?Md(l,r):(e.flags=e.flags&-4097|2,We=!1,Mt=e)}}else{if(ha(e))throw Error(i(418));e.flags=e.flags&-4097|2,We=!1,Mt=e}}}function Od(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Mt=e}function bl(e){if(e!==Mt)return!1;if(!We)return Od(e),We=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!la(e.type,e.memoizedProps)),t&&(t=Rt)){if(ha(e))throw Dd(),Error(i(418));for(;t;)Md(e,t),t=Dr(t.nextSibling)}if(Od(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(i(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Rt=Dr(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Rt=null}}else Rt=Mt?Dr(e.stateNode.nextSibling):null;return!0}function Dd(){for(var e=Rt;e;)e=Dr(e.nextSibling)}function ss(){Rt=Mt=null,We=!1}function ga(e){Gt===null?Gt=[e]:Gt.push(e)}var Rg=z.ReactCurrentBatchConfig;function uo(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(i(309));var l=r.stateNode}if(!l)throw Error(i(147,e));var a=l,c=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===c?t.ref:(t=function(p){var y=a.refs;p===null?delete y[c]:y[c]=p},t._stringRef=c,t)}if(typeof e!="string")throw Error(i(284));if(!r._owner)throw Error(i(290,e))}return e}function wl(e,t){throw e=Object.prototype.toString.call(t),Error(i(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Td(e){var t=e._init;return t(e._payload)}function Ad(e){function t(R,P){if(e){var D=R.deletions;D===null?(R.deletions=[P],R.flags|=16):D.push(P)}}function r(R,P){if(!e)return null;for(;P!==null;)t(R,P),P=P.sibling;return null}function l(R,P){for(R=new Map;P!==null;)P.key!==null?R.set(P.key,P):R.set(P.index,P),P=P.sibling;return R}function a(R,P){return R=Wr(R,P),R.index=0,R.sibling=null,R}function c(R,P,D){return R.index=D,e?(D=R.alternate,D!==null?(D=D.index,D<P?(R.flags|=2,P):D):(R.flags|=2,P)):(R.flags|=1048576,P)}function p(R){return e&&R.alternate===null&&(R.flags|=2),R}function y(R,P,D,Y){return P===null||P.tag!==6?(P=iu(D,R.mode,Y),P.return=R,P):(P=a(P,D),P.return=R,P)}function N(R,P,D,Y){var pe=D.type;return pe===J?W(R,P,D.props.children,Y,D.key):P!==null&&(P.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===Me&&Td(pe)===P.type)?(Y=a(P,D.props),Y.ref=uo(R,P,D),Y.return=R,Y):(Y=Vl(D.type,D.key,D.props,null,R.mode,Y),Y.ref=uo(R,P,D),Y.return=R,Y)}function I(R,P,D,Y){return P===null||P.tag!==4||P.stateNode.containerInfo!==D.containerInfo||P.stateNode.implementation!==D.implementation?(P=au(D,R.mode,Y),P.return=R,P):(P=a(P,D.children||[]),P.return=R,P)}function W(R,P,D,Y,pe){return P===null||P.tag!==7?(P=wn(D,R.mode,Y,pe),P.return=R,P):(P=a(P,D),P.return=R,P)}function K(R,P,D){if(typeof P=="string"&&P!==""||typeof P=="number")return P=iu(""+P,R.mode,D),P.return=R,P;if(typeof P=="object"&&P!==null){switch(P.$$typeof){case L:return D=Vl(P.type,P.key,P.props,null,R.mode,D),D.ref=uo(R,null,P),D.return=R,D;case B:return P=au(P,R.mode,D),P.return=R,P;case Me:var Y=P._init;return K(R,Y(P._payload),D)}if(Cr(P)||ce(P))return P=wn(P,R.mode,D,null),P.return=R,P;wl(R,P)}return null}function H(R,P,D,Y){var pe=P!==null?P.key:null;if(typeof D=="string"&&D!==""||typeof D=="number")return pe!==null?null:y(R,P,""+D,Y);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case L:return D.key===pe?N(R,P,D,Y):null;case B:return D.key===pe?I(R,P,D,Y):null;case Me:return pe=D._init,H(R,P,pe(D._payload),Y)}if(Cr(D)||ce(D))return pe!==null?null:W(R,P,D,Y,null);wl(R,D)}return null}function se(R,P,D,Y,pe){if(typeof Y=="string"&&Y!==""||typeof Y=="number")return R=R.get(D)||null,y(P,R,""+Y,pe);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case L:return R=R.get(Y.key===null?D:Y.key)||null,N(P,R,Y,pe);case B:return R=R.get(Y.key===null?D:Y.key)||null,I(P,R,Y,pe);case Me:var ye=Y._init;return se(R,P,D,ye(Y._payload),pe)}if(Cr(Y)||ce(Y))return R=R.get(D)||null,W(P,R,Y,pe,null);wl(P,Y)}return null}function de(R,P,D,Y){for(var pe=null,ye=null,ve=P,Ne=P=0,rt=null;ve!==null&&Ne<D.length;Ne++){ve.index>Ne?(rt=ve,ve=null):rt=ve.sibling;var ze=H(R,ve,D[Ne],Y);if(ze===null){ve===null&&(ve=rt);break}e&&ve&&ze.alternate===null&&t(R,ve),P=c(ze,P,Ne),ye===null?pe=ze:ye.sibling=ze,ye=ze,ve=rt}if(Ne===D.length)return r(R,ve),We&&pn(R,Ne),pe;if(ve===null){for(;Ne<D.length;Ne++)ve=K(R,D[Ne],Y),ve!==null&&(P=c(ve,P,Ne),ye===null?pe=ve:ye.sibling=ve,ye=ve);return We&&pn(R,Ne),pe}for(ve=l(R,ve);Ne<D.length;Ne++)rt=se(ve,R,Ne,D[Ne],Y),rt!==null&&(e&&rt.alternate!==null&&ve.delete(rt.key===null?Ne:rt.key),P=c(rt,P,Ne),ye===null?pe=rt:ye.sibling=rt,ye=rt);return e&&ve.forEach(function(Vr){return t(R,Vr)}),We&&pn(R,Ne),pe}function fe(R,P,D,Y){var pe=ce(D);if(typeof pe!="function")throw Error(i(150));if(D=pe.call(D),D==null)throw Error(i(151));for(var ye=pe=null,ve=P,Ne=P=0,rt=null,ze=D.next();ve!==null&&!ze.done;Ne++,ze=D.next()){ve.index>Ne?(rt=ve,ve=null):rt=ve.sibling;var Vr=H(R,ve,ze.value,Y);if(Vr===null){ve===null&&(ve=rt);break}e&&ve&&Vr.alternate===null&&t(R,ve),P=c(Vr,P,Ne),ye===null?pe=Vr:ye.sibling=Vr,ye=Vr,ve=rt}if(ze.done)return r(R,ve),We&&pn(R,Ne),pe;if(ve===null){for(;!ze.done;Ne++,ze=D.next())ze=K(R,ze.value,Y),ze!==null&&(P=c(ze,P,Ne),ye===null?pe=ze:ye.sibling=ze,ye=ze);return We&&pn(R,Ne),pe}for(ve=l(R,ve);!ze.done;Ne++,ze=D.next())ze=se(ve,R,Ne,ze.value,Y),ze!==null&&(e&&ze.alternate!==null&&ve.delete(ze.key===null?Ne:ze.key),P=c(ze,P,Ne),ye===null?pe=ze:ye.sibling=ze,ye=ze);return e&&ve.forEach(function(cx){return t(R,cx)}),We&&pn(R,Ne),pe}function Ze(R,P,D,Y){if(typeof D=="object"&&D!==null&&D.type===J&&D.key===null&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case L:e:{for(var pe=D.key,ye=P;ye!==null;){if(ye.key===pe){if(pe=D.type,pe===J){if(ye.tag===7){r(R,ye.sibling),P=a(ye,D.props.children),P.return=R,R=P;break e}}else if(ye.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===Me&&Td(pe)===ye.type){r(R,ye.sibling),P=a(ye,D.props),P.ref=uo(R,ye,D),P.return=R,R=P;break e}r(R,ye);break}else t(R,ye);ye=ye.sibling}D.type===J?(P=wn(D.props.children,R.mode,Y,D.key),P.return=R,R=P):(Y=Vl(D.type,D.key,D.props,null,R.mode,Y),Y.ref=uo(R,P,D),Y.return=R,R=Y)}return p(R);case B:e:{for(ye=D.key;P!==null;){if(P.key===ye)if(P.tag===4&&P.stateNode.containerInfo===D.containerInfo&&P.stateNode.implementation===D.implementation){r(R,P.sibling),P=a(P,D.children||[]),P.return=R,R=P;break e}else{r(R,P);break}else t(R,P);P=P.sibling}P=au(D,R.mode,Y),P.return=R,R=P}return p(R);case Me:return ye=D._init,Ze(R,P,ye(D._payload),Y)}if(Cr(D))return de(R,P,D,Y);if(ce(D))return fe(R,P,D,Y);wl(R,D)}return typeof D=="string"&&D!==""||typeof D=="number"?(D=""+D,P!==null&&P.tag===6?(r(R,P.sibling),P=a(P,D),P.return=R,R=P):(r(R,P),P=iu(D,R.mode,Y),P.return=R,R=P),p(R)):r(R,P)}return Ze}var os=Ad(!0),zd=Ad(!1),jl=Tr(null),kl=null,ls=null,xa=null;function ya(){xa=ls=kl=null}function va(e){var t=jl.current;Be(jl),e._currentValue=t}function ba(e,t,r){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===r)break;e=e.return}}function is(e,t){kl=e,xa=ls=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(vt=!0),e.firstContext=null)}function It(e){var t=e._currentValue;if(xa!==e)if(e={context:e,memoizedValue:t,next:null},ls===null){if(kl===null)throw Error(i(308));ls=e,kl.dependencies={lanes:0,firstContext:e}}else ls=ls.next=e;return t}var hn=null;function wa(e){hn===null?hn=[e]:hn.push(e)}function Ld(e,t,r,l){var a=t.interleaved;return a===null?(r.next=r,wa(t)):(r.next=a.next,a.next=r),t.interleaved=r,gr(e,l)}function gr(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Lr=!1;function ja(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Id(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function xr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ir(e,t,r){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Te&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,gr(e,r)}return a=l.interleaved,a===null?(t.next=t,wa(l)):(t.next=a.next,a.next=t),l.interleaved=t,gr(e,r)}function Nl(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var l=t.lanes;l&=e.pendingLanes,r|=l,t.lanes=r,zi(e,r)}}function Fd(e,t){var r=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,r===l)){var a=null,c=null;if(r=r.firstBaseUpdate,r!==null){do{var p={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};c===null?a=c=p:c=c.next=p,r=r.next}while(r!==null);c===null?a=c=t:c=c.next=t}else a=c=t;r={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:c,shared:l.shared,effects:l.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Sl(e,t,r,l){var a=e.updateQueue;Lr=!1;var c=a.firstBaseUpdate,p=a.lastBaseUpdate,y=a.shared.pending;if(y!==null){a.shared.pending=null;var N=y,I=N.next;N.next=null,p===null?c=I:p.next=I,p=N;var W=e.alternate;W!==null&&(W=W.updateQueue,y=W.lastBaseUpdate,y!==p&&(y===null?W.firstBaseUpdate=I:y.next=I,W.lastBaseUpdate=N))}if(c!==null){var K=a.baseState;p=0,W=I=N=null,y=c;do{var H=y.lane,se=y.eventTime;if((l&H)===H){W!==null&&(W=W.next={eventTime:se,lane:0,tag:y.tag,payload:y.payload,callback:y.callback,next:null});e:{var de=e,fe=y;switch(H=t,se=r,fe.tag){case 1:if(de=fe.payload,typeof de=="function"){K=de.call(se,K,H);break e}K=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=fe.payload,H=typeof de=="function"?de.call(se,K,H):de,H==null)break e;K=q({},K,H);break e;case 2:Lr=!0}}y.callback!==null&&y.lane!==0&&(e.flags|=64,H=a.effects,H===null?a.effects=[y]:H.push(y))}else se={eventTime:se,lane:H,tag:y.tag,payload:y.payload,callback:y.callback,next:null},W===null?(I=W=se,N=K):W=W.next=se,p|=H;if(y=y.next,y===null){if(y=a.shared.pending,y===null)break;H=y,y=H.next,H.next=null,a.lastBaseUpdate=H,a.shared.pending=null}}while(!0);if(W===null&&(N=K),a.baseState=N,a.firstBaseUpdate=I,a.lastBaseUpdate=W,t=a.shared.interleaved,t!==null){a=t;do p|=a.lane,a=a.next;while(a!==t)}else c===null&&(a.shared.lanes=0);xn|=p,e.lanes=p,e.memoizedState=K}}function Ud(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var l=e[t],a=l.callback;if(a!==null){if(l.callback=null,l=r,typeof a!="function")throw Error(i(191,a));a.call(l)}}}var co={},tr=Tr(co),fo=Tr(co),po=Tr(co);function mn(e){if(e===co)throw Error(i(174));return e}function ka(e,t){switch(Ue(po,t),Ue(fo,e),Ue(tr,co),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Re(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Re(t,e)}Be(tr),Ue(tr,t)}function as(){Be(tr),Be(fo),Be(po)}function $d(e){mn(po.current);var t=mn(tr.current),r=Re(t,e.type);t!==r&&(Ue(fo,e),Ue(tr,r))}function Na(e){fo.current===e&&(Be(tr),Be(fo))}var Ve=Tr(0);function Cl(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){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 Sa=[];function Ca(){for(var e=0;e<Sa.length;e++)Sa[e]._workInProgressVersionPrimary=null;Sa.length=0}var El=z.ReactCurrentDispatcher,Ea=z.ReactCurrentBatchConfig,gn=0,Ge=null,Je=null,et=null,Pl=!1,ho=!1,mo=0,Og=0;function ct(){throw Error(i(321))}function Pa(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!Vt(e[r],t[r]))return!1;return!0}function _a(e,t,r,l,a,c){if(gn=c,Ge=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,El.current=e===null||e.memoizedState===null?zg:Lg,e=r(l,a),ho){c=0;do{if(ho=!1,mo=0,25<=c)throw Error(i(301));c+=1,et=Je=null,t.updateQueue=null,El.current=Ig,e=r(l,a)}while(ho)}if(El.current=Rl,t=Je!==null&&Je.next!==null,gn=0,et=Je=Ge=null,Pl=!1,t)throw Error(i(300));return e}function Ma(){var e=mo!==0;return mo=0,e}function rr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?Ge.memoizedState=et=e:et=et.next=e,et}function Ft(){if(Je===null){var e=Ge.alternate;e=e!==null?e.memoizedState:null}else e=Je.next;var t=et===null?Ge.memoizedState:et.next;if(t!==null)et=t,Je=e;else{if(e===null)throw Error(i(310));Je=e,e={memoizedState:Je.memoizedState,baseState:Je.baseState,baseQueue:Je.baseQueue,queue:Je.queue,next:null},et===null?Ge.memoizedState=et=e:et=et.next=e}return et}function go(e,t){return typeof t=="function"?t(e):t}function Ra(e){var t=Ft(),r=t.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=e;var l=Je,a=l.baseQueue,c=r.pending;if(c!==null){if(a!==null){var p=a.next;a.next=c.next,c.next=p}l.baseQueue=a=c,r.pending=null}if(a!==null){c=a.next,l=l.baseState;var y=p=null,N=null,I=c;do{var W=I.lane;if((gn&W)===W)N!==null&&(N=N.next={lane:0,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null}),l=I.hasEagerState?I.eagerState:e(l,I.action);else{var K={lane:W,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null};N===null?(y=N=K,p=l):N=N.next=K,Ge.lanes|=W,xn|=W}I=I.next}while(I!==null&&I!==c);N===null?p=l:N.next=y,Vt(l,t.memoizedState)||(vt=!0),t.memoizedState=l,t.baseState=p,t.baseQueue=N,r.lastRenderedState=l}if(e=r.interleaved,e!==null){a=e;do c=a.lane,Ge.lanes|=c,xn|=c,a=a.next;while(a!==e)}else a===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Oa(e){var t=Ft(),r=t.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=e;var l=r.dispatch,a=r.pending,c=t.memoizedState;if(a!==null){r.pending=null;var p=a=a.next;do c=e(c,p.action),p=p.next;while(p!==a);Vt(c,t.memoizedState)||(vt=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),r.lastRenderedState=c}return[c,l]}function Bd(){}function Hd(e,t){var r=Ge,l=Ft(),a=t(),c=!Vt(l.memoizedState,a);if(c&&(l.memoizedState=a,vt=!0),l=l.queue,Da(Gd.bind(null,r,l,e),[e]),l.getSnapshot!==t||c||et!==null&&et.memoizedState.tag&1){if(r.flags|=2048,xo(9,Vd.bind(null,r,l,a,t),void 0,null),tt===null)throw Error(i(349));(gn&30)!==0||Wd(r,t,a)}return a}function Wd(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=Ge.updateQueue,t===null?(t={lastEffect:null,stores:null},Ge.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function Vd(e,t,r,l){t.value=r,t.getSnapshot=l,Kd(t)&&Qd(e)}function Gd(e,t,r){return r(function(){Kd(t)&&Qd(e)})}function Kd(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Vt(e,r)}catch{return!0}}function Qd(e){var t=gr(e,1);t!==null&&Zt(t,e,1,-1)}function qd(e){var t=rr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:go,lastRenderedState:e},t.queue=e,e=e.dispatch=Ag.bind(null,Ge,e),[t.memoizedState,e]}function xo(e,t,r,l){return e={tag:e,create:t,destroy:r,deps:l,next:null},t=Ge.updateQueue,t===null?(t={lastEffect:null,stores:null},Ge.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(l=r.next,r.next=e,e.next=l,t.lastEffect=e)),e}function Zd(){return Ft().memoizedState}function _l(e,t,r,l){var a=rr();Ge.flags|=e,a.memoizedState=xo(1|t,r,void 0,l===void 0?null:l)}function Ml(e,t,r,l){var a=Ft();l=l===void 0?null:l;var c=void 0;if(Je!==null){var p=Je.memoizedState;if(c=p.destroy,l!==null&&Pa(l,p.deps)){a.memoizedState=xo(t,r,c,l);return}}Ge.flags|=e,a.memoizedState=xo(1|t,r,c,l)}function Yd(e,t){return _l(8390656,8,e,t)}function Da(e,t){return Ml(2048,8,e,t)}function Jd(e,t){return Ml(4,2,e,t)}function Xd(e,t){return Ml(4,4,e,t)}function ef(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function tf(e,t,r){return r=r!=null?r.concat([e]):null,Ml(4,4,ef.bind(null,t,e),r)}function Ta(){}function rf(e,t){var r=Ft();t=t===void 0?null:t;var l=r.memoizedState;return l!==null&&t!==null&&Pa(t,l[1])?l[0]:(r.memoizedState=[e,t],e)}function nf(e,t){var r=Ft();t=t===void 0?null:t;var l=r.memoizedState;return l!==null&&t!==null&&Pa(t,l[1])?l[0]:(e=e(),r.memoizedState=[e,t],e)}function sf(e,t,r){return(gn&21)===0?(e.baseState&&(e.baseState=!1,vt=!0),e.memoizedState=r):(Vt(r,t)||(r=Tc(),Ge.lanes|=r,xn|=r,e.baseState=!0),t)}function Dg(e,t){var r=Ie;Ie=r!==0&&4>r?r:4,e(!0);var l=Ea.transition;Ea.transition={};try{e(!1),t()}finally{Ie=r,Ea.transition=l}}function of(){return Ft().memoizedState}function Tg(e,t,r){var l=Br(e);if(r={lane:l,action:r,hasEagerState:!1,eagerState:null,next:null},lf(e))af(t,r);else if(r=Ld(e,t,r,l),r!==null){var a=mt();Zt(r,e,l,a),uf(r,t,l)}}function Ag(e,t,r){var l=Br(e),a={lane:l,action:r,hasEagerState:!1,eagerState:null,next:null};if(lf(e))af(t,a);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var p=t.lastRenderedState,y=c(p,r);if(a.hasEagerState=!0,a.eagerState=y,Vt(y,p)){var N=t.interleaved;N===null?(a.next=a,wa(t)):(a.next=N.next,N.next=a),t.interleaved=a;return}}catch{}finally{}r=Ld(e,t,a,l),r!==null&&(a=mt(),Zt(r,e,l,a),uf(r,t,l))}}function lf(e){var t=e.alternate;return e===Ge||t!==null&&t===Ge}function af(e,t){ho=Pl=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function uf(e,t,r){if((r&4194240)!==0){var l=t.lanes;l&=e.pendingLanes,r|=l,t.lanes=r,zi(e,r)}}var Rl={readContext:It,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useInsertionEffect:ct,useLayoutEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useMutableSource:ct,useSyncExternalStore:ct,useId:ct,unstable_isNewReconciler:!1},zg={readContext:It,useCallback:function(e,t){return rr().memoizedState=[e,t===void 0?null:t],e},useContext:It,useEffect:Yd,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,_l(4194308,4,ef.bind(null,t,e),r)},useLayoutEffect:function(e,t){return _l(4194308,4,e,t)},useInsertionEffect:function(e,t){return _l(4,2,e,t)},useMemo:function(e,t){var r=rr();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var l=rr();return t=r!==void 0?r(t):t,l.memoizedState=l.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},l.queue=e,e=e.dispatch=Tg.bind(null,Ge,e),[l.memoizedState,e]},useRef:function(e){var t=rr();return e={current:e},t.memoizedState=e},useState:qd,useDebugValue:Ta,useDeferredValue:function(e){return rr().memoizedState=e},useTransition:function(){var e=qd(!1),t=e[0];return e=Dg.bind(null,e[1]),rr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var l=Ge,a=rr();if(We){if(r===void 0)throw Error(i(407));r=r()}else{if(r=t(),tt===null)throw Error(i(349));(gn&30)!==0||Wd(l,t,r)}a.memoizedState=r;var c={value:r,getSnapshot:t};return a.queue=c,Yd(Gd.bind(null,l,c,e),[e]),l.flags|=2048,xo(9,Vd.bind(null,l,c,r,t),void 0,null),r},useId:function(){var e=rr(),t=tt.identifierPrefix;if(We){var r=mr,l=hr;r=(l&~(1<<32-Wt(l)-1)).toString(32)+r,t=":"+t+"R"+r,r=mo++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Og++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Lg={readContext:It,useCallback:rf,useContext:It,useEffect:Da,useImperativeHandle:tf,useInsertionEffect:Jd,useLayoutEffect:Xd,useMemo:nf,useReducer:Ra,useRef:Zd,useState:function(){return Ra(go)},useDebugValue:Ta,useDeferredValue:function(e){var t=Ft();return sf(t,Je.memoizedState,e)},useTransition:function(){var e=Ra(go)[0],t=Ft().memoizedState;return[e,t]},useMutableSource:Bd,useSyncExternalStore:Hd,useId:of,unstable_isNewReconciler:!1},Ig={readContext:It,useCallback:rf,useContext:It,useEffect:Da,useImperativeHandle:tf,useInsertionEffect:Jd,useLayoutEffect:Xd,useMemo:nf,useReducer:Oa,useRef:Zd,useState:function(){return Oa(go)},useDebugValue:Ta,useDeferredValue:function(e){var t=Ft();return Je===null?t.memoizedState=e:sf(t,Je.memoizedState,e)},useTransition:function(){var e=Oa(go)[0],t=Ft().memoizedState;return[e,t]},useMutableSource:Bd,useSyncExternalStore:Hd,useId:of,unstable_isNewReconciler:!1};function Kt(e,t){if(e&&e.defaultProps){t=q({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Aa(e,t,r,l){t=e.memoizedState,r=r(l,t),r=r==null?t:q({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Ol={isMounted:function(e){return(e=e._reactInternals)?un(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var l=mt(),a=Br(e),c=xr(l,a);c.payload=t,r!=null&&(c.callback=r),t=Ir(e,c,a),t!==null&&(Zt(t,e,a,l),Nl(t,e,a))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var l=mt(),a=Br(e),c=xr(l,a);c.tag=1,c.payload=t,r!=null&&(c.callback=r),t=Ir(e,c,a),t!==null&&(Zt(t,e,a,l),Nl(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=mt(),l=Br(e),a=xr(r,l);a.tag=2,t!=null&&(a.callback=t),t=Ir(e,a,l),t!==null&&(Zt(t,e,l,r),Nl(t,e,l))}};function cf(e,t,r,l,a,c,p){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,c,p):t.prototype&&t.prototype.isPureReactComponent?!ro(r,l)||!ro(a,c):!0}function df(e,t,r){var l=!1,a=Ar,c=t.contextType;return typeof c=="object"&&c!==null?c=It(c):(a=yt(t)?dn:ut.current,l=t.contextTypes,c=(l=l!=null)?ts(e,a):Ar),t=new t(r,c),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ol,e.stateNode=t,t._reactInternals=e,l&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=c),t}function ff(e,t,r,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,l),t.state!==e&&Ol.enqueueReplaceState(t,t.state,null)}function za(e,t,r,l){var a=e.stateNode;a.props=r,a.state=e.memoizedState,a.refs={},ja(e);var c=t.contextType;typeof c=="object"&&c!==null?a.context=It(c):(c=yt(t)?dn:ut.current,a.context=ts(e,c)),a.state=e.memoizedState,c=t.getDerivedStateFromProps,typeof c=="function"&&(Aa(e,t,c,r),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&Ol.enqueueReplaceState(a,a.state,null),Sl(e,r,a,l),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function us(e,t){try{var r="",l=t;do r+=Z(l),l=l.return;while(l);var a=r}catch(c){a=`
Error generating stack: `+c.message+`
`+c.stack}return{value:e,source:t,stack:a,digest:null}}function La(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Ia(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Fg=typeof WeakMap=="function"?WeakMap:Map;function pf(e,t,r){r=xr(-1,r),r.tag=3,r.payload={element:null};var l=t.value;return r.callback=function(){Fl||(Fl=!0,Xa=l),Ia(e,t)},r}function hf(e,t,r){r=xr(-1,r),r.tag=3;var l=e.type.getDerivedStateFromError;if(typeof l=="function"){var a=t.value;r.payload=function(){return l(a)},r.callback=function(){Ia(e,t)}}var c=e.stateNode;return c!==null&&typeof c.componentDidCatch=="function"&&(r.callback=function(){Ia(e,t),typeof l!="function"&&(Ur===null?Ur=new Set([this]):Ur.add(this));var p=t.stack;this.componentDidCatch(t.value,{componentStack:p!==null?p:""})}),r}function mf(e,t,r){var l=e.pingCache;if(l===null){l=e.pingCache=new Fg;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(r)||(a.add(r),e=Xg.bind(null,e,t,r),t.then(e,e))}function gf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function xf(e,t,r,l,a){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=xr(-1,1),t.tag=2,Ir(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=a,e)}var Ug=z.ReactCurrentOwner,vt=!1;function ht(e,t,r,l){t.child=e===null?zd(t,null,r,l):os(t,e.child,r,l)}function yf(e,t,r,l,a){r=r.render;var c=t.ref;return is(t,a),l=_a(e,t,r,l,c,a),r=Ma(),e!==null&&!vt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,yr(e,t,a)):(We&&r&&fa(t),t.flags|=1,ht(e,t,l,a),t.child)}function vf(e,t,r,l,a){if(e===null){var c=r.type;return typeof c=="function"&&!lu(c)&&c.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=c,bf(e,t,c,l,a)):(e=Vl(r.type,null,l,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,(e.lanes&a)===0){var p=c.memoizedProps;if(r=r.compare,r=r!==null?r:ro,r(p,l)&&e.ref===t.ref)return yr(e,t,a)}return t.flags|=1,e=Wr(c,l),e.ref=t.ref,e.return=t,t.child=e}function bf(e,t,r,l,a){if(e!==null){var c=e.memoizedProps;if(ro(c,l)&&e.ref===t.ref)if(vt=!1,t.pendingProps=l=c,(e.lanes&a)!==0)(e.flags&131072)!==0&&(vt=!0);else return t.lanes=e.lanes,yr(e,t,a)}return Fa(e,t,r,l,a)}function wf(e,t,r){var l=t.pendingProps,a=l.children,c=e!==null?e.memoizedState:null;if(l.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ue(ds,Ot),Ot|=r;else{if((r&1073741824)===0)return e=c!==null?c.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ue(ds,Ot),Ot|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},l=c!==null?c.baseLanes:r,Ue(ds,Ot),Ot|=l}else c!==null?(l=c.baseLanes|r,t.memoizedState=null):l=r,Ue(ds,Ot),Ot|=l;return ht(e,t,a,r),t.child}function jf(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Fa(e,t,r,l,a){var c=yt(r)?dn:ut.current;return c=ts(t,c),is(t,a),r=_a(e,t,r,l,c,a),l=Ma(),e!==null&&!vt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,yr(e,t,a)):(We&&l&&fa(t),t.flags|=1,ht(e,t,r,a),t.child)}function kf(e,t,r,l,a){if(yt(r)){var c=!0;gl(t)}else c=!1;if(is(t,a),t.stateNode===null)Tl(e,t),df(t,r,l),za(t,r,l,a),l=!0;else if(e===null){var p=t.stateNode,y=t.memoizedProps;p.props=y;var N=p.context,I=r.contextType;typeof I=="object"&&I!==null?I=It(I):(I=yt(r)?dn:ut.current,I=ts(t,I));var W=r.getDerivedStateFromProps,K=typeof W=="function"||typeof p.getSnapshotBeforeUpdate=="function";K||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(y!==l||N!==I)&&ff(t,p,l,I),Lr=!1;var H=t.memoizedState;p.state=H,Sl(t,l,p,a),N=t.memoizedState,y!==l||H!==N||xt.current||Lr?(typeof W=="function"&&(Aa(t,r,W,l),N=t.memoizedState),(y=Lr||cf(t,r,y,l,H,N,I))?(K||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(t.flags|=4194308)):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=N),p.props=l,p.state=N,p.context=I,l=y):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{p=t.stateNode,Id(e,t),y=t.memoizedProps,I=t.type===t.elementType?y:Kt(t.type,y),p.props=I,K=t.pendingProps,H=p.context,N=r.contextType,typeof N=="object"&&N!==null?N=It(N):(N=yt(r)?dn:ut.current,N=ts(t,N));var se=r.getDerivedStateFromProps;(W=typeof se=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(y!==K||H!==N)&&ff(t,p,l,N),Lr=!1,H=t.memoizedState,p.state=H,Sl(t,l,p,a);var de=t.memoizedState;y!==K||H!==de||xt.current||Lr?(typeof se=="function"&&(Aa(t,r,se,l),de=t.memoizedState),(I=Lr||cf(t,r,I,l,H,de,N)||!1)?(W||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(l,de,N),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(l,de,N)),typeof p.componentDidUpdate=="function"&&(t.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof p.componentDidUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=de),p.props=l,p.state=de,p.context=N,l=I):(typeof p.componentDidUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||y===e.memoizedProps&&H===e.memoizedState||(t.flags|=1024),l=!1)}return Ua(e,t,r,l,c,a)}function Ua(e,t,r,l,a,c){jf(e,t);var p=(t.flags&128)!==0;if(!l&&!p)return a&&Ed(t,r,!1),yr(e,t,c);l=t.stateNode,Ug.current=t;var y=p&&typeof r.getDerivedStateFromError!="function"?null:l.render();return t.flags|=1,e!==null&&p?(t.child=os(t,e.child,null,c),t.child=os(t,null,y,c)):ht(e,t,y,c),t.memoizedState=l.state,a&&Ed(t,r,!0),t.child}function Nf(e){var t=e.stateNode;t.pendingContext?Sd(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Sd(e,t.context,!1),ka(e,t.containerInfo)}function Sf(e,t,r,l,a){return ss(),ga(a),t.flags|=256,ht(e,t,r,l),t.child}var $a={dehydrated:null,treeContext:null,retryLane:0};function Ba(e){return{baseLanes:e,cachePool:null,transitions:null}}function Cf(e,t,r){var l=t.pendingProps,a=Ve.current,c=!1,p=(t.flags&128)!==0,y;if((y=p)||(y=e!==null&&e.memoizedState===null?!1:(a&2)!==0),y?(c=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),Ue(Ve,a&1),e===null)return ma(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(p=l.children,e=l.fallback,c?(l=t.mode,c=t.child,p={mode:"hidden",children:p},(l&1)===0&&c!==null?(c.childLanes=0,c.pendingProps=p):c=Gl(p,l,0,null),e=wn(e,l,r,null),c.return=t,e.return=t,c.sibling=e,t.child=c,t.child.memoizedState=Ba(r),t.memoizedState=$a,e):Ha(t,p));if(a=e.memoizedState,a!==null&&(y=a.dehydrated,y!==null))return $g(e,t,p,l,y,a,r);if(c){c=l.fallback,p=t.mode,a=e.child,y=a.sibling;var N={mode:"hidden",children:l.children};return(p&1)===0&&t.child!==a?(l=t.child,l.childLanes=0,l.pendingProps=N,t.deletions=null):(l=Wr(a,N),l.subtreeFlags=a.subtreeFlags&14680064),y!==null?c=Wr(y,c):(c=wn(c,p,r,null),c.flags|=2),c.return=t,l.return=t,l.sibling=c,t.child=l,l=c,c=t.child,p=e.child.memoizedState,p=p===null?Ba(r):{baseLanes:p.baseLanes|r,cachePool:null,transitions:p.transitions},c.memoizedState=p,c.childLanes=e.childLanes&~r,t.memoizedState=$a,l}return c=e.child,e=c.sibling,l=Wr(c,{mode:"visible",children:l.children}),(t.mode&1)===0&&(l.lanes=r),l.return=t,l.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=l,t.memoizedState=null,l}function Ha(e,t){return t=Gl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Dl(e,t,r,l){return l!==null&&ga(l),os(t,e.child,null,r),e=Ha(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $g(e,t,r,l,a,c,p){if(r)return t.flags&256?(t.flags&=-257,l=La(Error(i(422))),Dl(e,t,p,l)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(c=l.fallback,a=t.mode,l=Gl({mode:"visible",children:l.children},a,0,null),c=wn(c,a,p,null),c.flags|=2,l.return=t,c.return=t,l.sibling=c,t.child=l,(t.mode&1)!==0&&os(t,e.child,null,p),t.child.memoizedState=Ba(p),t.memoizedState=$a,c);if((t.mode&1)===0)return Dl(e,t,p,null);if(a.data==="$!"){if(l=a.nextSibling&&a.nextSibling.dataset,l)var y=l.dgst;return l=y,c=Error(i(419)),l=La(c,l,void 0),Dl(e,t,p,l)}if(y=(p&e.childLanes)!==0,vt||y){if(l=tt,l!==null){switch(p&-p){case 4:a=2;break;case 16:a=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=(a&(l.suspendedLanes|p))!==0?0:a,a!==0&&a!==c.retryLane&&(c.retryLane=a,gr(e,a),Zt(l,e,a,-1))}return ou(),l=La(Error(i(421))),Dl(e,t,p,l)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=ex.bind(null,e),a._reactRetry=t,null):(e=c.treeContext,Rt=Dr(a.nextSibling),Mt=t,We=!0,Gt=null,e!==null&&(zt[Lt++]=hr,zt[Lt++]=mr,zt[Lt++]=fn,hr=e.id,mr=e.overflow,fn=t),t=Ha(t,l.children),t.flags|=4096,t)}function Ef(e,t,r){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),ba(e.return,t,r)}function Wa(e,t,r,l,a){var c=e.memoizedState;c===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:r,tailMode:a}:(c.isBackwards=t,c.rendering=null,c.renderingStartTime=0,c.last=l,c.tail=r,c.tailMode=a)}function Pf(e,t,r){var l=t.pendingProps,a=l.revealOrder,c=l.tail;if(ht(e,t,l.children,r),l=Ve.current,(l&2)!==0)l=l&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ef(e,r,t);else if(e.tag===19)Ef(e,r,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}l&=1}if(Ue(Ve,l),(t.mode&1)===0)t.memoizedState=null;else switch(a){case"forwards":for(r=t.child,a=null;r!==null;)e=r.alternate,e!==null&&Cl(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),Wa(t,!1,a,r,c);break;case"backwards":for(r=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Cl(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}Wa(t,!0,r,null,c);break;case"together":Wa(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Tl(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function yr(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),xn|=t.lanes,(r&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,r=Wr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Wr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Bg(e,t,r){switch(t.tag){case 3:Nf(t),ss();break;case 5:$d(t);break;case 1:yt(t.type)&&gl(t);break;case 4:ka(t,t.stateNode.containerInfo);break;case 10:var l=t.type._context,a=t.memoizedProps.value;Ue(jl,l._currentValue),l._currentValue=a;break;case 13:if(l=t.memoizedState,l!==null)return l.dehydrated!==null?(Ue(Ve,Ve.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?Cf(e,t,r):(Ue(Ve,Ve.current&1),e=yr(e,t,r),e!==null?e.sibling:null);Ue(Ve,Ve.current&1);break;case 19:if(l=(r&t.childLanes)!==0,(e.flags&128)!==0){if(l)return Pf(e,t,r);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Ue(Ve,Ve.current),l)break;return null;case 22:case 23:return t.lanes=0,wf(e,t,r)}return yr(e,t,r)}var _f,Va,Mf,Rf;_f=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Va=function(){},Mf=function(e,t,r,l){var a=e.memoizedProps;if(a!==l){e=t.stateNode,mn(tr.current);var c=null;switch(r){case"input":a=Et(e,a),l=Et(e,l),c=[];break;case"select":a=q({},a,{value:void 0}),l=q({},l,{value:void 0}),c=[];break;case"textarea":a=Hn(e,a),l=Hn(e,l),c=[];break;default:typeof a.onClick!="function"&&typeof l.onClick=="function"&&(e.onclick=pl)}Si(r,l);var p;r=null;for(I in a)if(!l.hasOwnProperty(I)&&a.hasOwnProperty(I)&&a[I]!=null)if(I==="style"){var y=a[I];for(p in y)y.hasOwnProperty(p)&&(r||(r={}),r[p]="")}else I!=="dangerouslySetInnerHTML"&&I!=="children"&&I!=="suppressContentEditableWarning"&&I!=="suppressHydrationWarning"&&I!=="autoFocus"&&(d.hasOwnProperty(I)?c||(c=[]):(c=c||[]).push(I,null));for(I in l){var N=l[I];if(y=a!=null?a[I]:void 0,l.hasOwnProperty(I)&&N!==y&&(N!=null||y!=null))if(I==="style")if(y){for(p in y)!y.hasOwnProperty(p)||N&&N.hasOwnProperty(p)||(r||(r={}),r[p]="");for(p in N)N.hasOwnProperty(p)&&y[p]!==N[p]&&(r||(r={}),r[p]=N[p])}else r||(c||(c=[]),c.push(I,r)),r=N;else I==="dangerouslySetInnerHTML"?(N=N?N.__html:void 0,y=y?y.__html:void 0,N!=null&&y!==N&&(c=c||[]).push(I,N)):I==="children"?typeof N!="string"&&typeof N!="number"||(c=c||[]).push(I,""+N):I!=="suppressContentEditableWarning"&&I!=="suppressHydrationWarning"&&(d.hasOwnProperty(I)?(N!=null&&I==="onScroll"&&$e("scroll",e),c||y===N||(c=[])):(c=c||[]).push(I,N))}r&&(c=c||[]).push("style",r);var I=c;(t.updateQueue=I)&&(t.flags|=4)}},Rf=function(e,t,r,l){r!==l&&(t.flags|=4)};function yo(e,t){if(!We)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var l=null;r!==null;)r.alternate!==null&&(l=r),r=r.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function dt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,l=0;if(t)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,l|=a.subtreeFlags&14680064,l|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,l|=a.subtreeFlags,l|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=l,e.childLanes=r,t}function Hg(e,t,r){var l=t.pendingProps;switch(pa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return dt(t),null;case 1:return yt(t.type)&&ml(),dt(t),null;case 3:return l=t.stateNode,as(),Be(xt),Be(ut),Ca(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(bl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Gt!==null&&(ru(Gt),Gt=null))),Va(e,t),dt(t),null;case 5:Na(t);var a=mn(po.current);if(r=t.type,e!==null&&t.stateNode!=null)Mf(e,t,r,l,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!l){if(t.stateNode===null)throw Error(i(166));return dt(t),null}if(e=mn(tr.current),bl(t)){l=t.stateNode,r=t.type;var c=t.memoizedProps;switch(l[er]=t,l[io]=c,e=(t.mode&1)!==0,r){case"dialog":$e("cancel",l),$e("close",l);break;case"iframe":case"object":case"embed":$e("load",l);break;case"video":case"audio":for(a=0;a<so.length;a++)$e(so[a],l);break;case"source":$e("error",l);break;case"img":case"image":case"link":$e("error",l),$e("load",l);break;case"details":$e("toggle",l);break;case"input":Pt(l,c),$e("invalid",l);break;case"select":l._wrapperState={wasMultiple:!!c.multiple},$e("invalid",l);break;case"textarea":Us(l,c),$e("invalid",l)}Si(r,c),a=null;for(var p in c)if(c.hasOwnProperty(p)){var y=c[p];p==="children"?typeof y=="string"?l.textContent!==y&&(c.suppressHydrationWarning!==!0&&fl(l.textContent,y,e),a=["children",y]):typeof y=="number"&&l.textContent!==""+y&&(c.suppressHydrationWarning!==!0&&fl(l.textContent,y,e),a=["children",""+y]):d.hasOwnProperty(p)&&y!=null&&p==="onScroll"&&$e("scroll",l)}switch(r){case"input":we(l),Sr(l,c,!0);break;case"textarea":we(l),le(l);break;case"select":case"option":break;default:typeof c.onClick=="function"&&(l.onclick=pl)}l=a,t.updateQueue=l,l!==null&&(t.flags|=4)}else{p=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=ke(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=p.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof l.is=="string"?e=p.createElement(r,{is:l.is}):(e=p.createElement(r),r==="select"&&(p=e,l.multiple?p.multiple=!0:l.size&&(p.size=l.size))):e=p.createElementNS(e,r),e[er]=t,e[io]=l,_f(e,t,!1,!1),t.stateNode=e;e:{switch(p=Ci(r,l),r){case"dialog":$e("cancel",e),$e("close",e),a=l;break;case"iframe":case"object":case"embed":$e("load",e),a=l;break;case"video":case"audio":for(a=0;a<so.length;a++)$e(so[a],e);a=l;break;case"source":$e("error",e),a=l;break;case"img":case"image":case"link":$e("error",e),$e("load",e),a=l;break;case"details":$e("toggle",e),a=l;break;case"input":Pt(e,l),a=Et(e,l),$e("invalid",e);break;case"option":a=l;break;case"select":e._wrapperState={wasMultiple:!!l.multiple},a=q({},l,{value:void 0}),$e("invalid",e);break;case"textarea":Us(e,l),a=Hn(e,l),$e("invalid",e);break;default:a=l}Si(r,a),y=a;for(c in y)if(y.hasOwnProperty(c)){var N=y[c];c==="style"?vc(e,N):c==="dangerouslySetInnerHTML"?(N=N?N.__html:void 0,N!=null&&Ht(e,N)):c==="children"?typeof N=="string"?(r!=="textarea"||N!=="")&&cr(e,N):typeof N=="number"&&cr(e,""+N):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(d.hasOwnProperty(c)?N!=null&&c==="onScroll"&&$e("scroll",e):N!=null&&V(e,c,N,p))}switch(r){case"input":we(e),Sr(e,l,!1);break;case"textarea":we(e),le(e);break;case"option":l.value!=null&&e.setAttribute("value",""+xe(l.value));break;case"select":e.multiple=!!l.multiple,c=l.value,c!=null?ur(e,!!l.multiple,c,!1):l.defaultValue!=null&&ur(e,!!l.multiple,l.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=pl)}switch(r){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}}l&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return dt(t),null;case 6:if(e&&t.stateNode!=null)Rf(e,t,e.memoizedProps,l);else{if(typeof l!="string"&&t.stateNode===null)throw Error(i(166));if(r=mn(po.current),mn(tr.current),bl(t)){if(l=t.stateNode,r=t.memoizedProps,l[er]=t,(c=l.nodeValue!==r)&&(e=Mt,e!==null))switch(e.tag){case 3:fl(l.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&fl(l.nodeValue,r,(e.mode&1)!==0)}c&&(t.flags|=4)}else l=(r.nodeType===9?r:r.ownerDocument).createTextNode(l),l[er]=t,t.stateNode=l}return dt(t),null;case 13:if(Be(Ve),l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(We&&Rt!==null&&(t.mode&1)!==0&&(t.flags&128)===0)Dd(),ss(),t.flags|=98560,c=!1;else if(c=bl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!c)throw Error(i(318));if(c=t.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(i(317));c[er]=t}else ss(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;dt(t),c=!1}else Gt!==null&&(ru(Gt),Gt=null),c=!0;if(!c)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=r,t):(l=l!==null,l!==(e!==null&&e.memoizedState!==null)&&l&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Ve.current&1)!==0?Xe===0&&(Xe=3):ou())),t.updateQueue!==null&&(t.flags|=4),dt(t),null);case 4:return as(),Va(e,t),e===null&&oo(t.stateNode.containerInfo),dt(t),null;case 10:return va(t.type._context),dt(t),null;case 17:return yt(t.type)&&ml(),dt(t),null;case 19:if(Be(Ve),c=t.memoizedState,c===null)return dt(t),null;if(l=(t.flags&128)!==0,p=c.rendering,p===null)if(l)yo(c,!1);else{if(Xe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(p=Cl(e),p!==null){for(t.flags|=128,yo(c,!1),l=p.updateQueue,l!==null&&(t.updateQueue=l,t.flags|=4),t.subtreeFlags=0,l=r,r=t.child;r!==null;)c=r,e=l,c.flags&=14680066,p=c.alternate,p===null?(c.childLanes=0,c.lanes=e,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=p.childLanes,c.lanes=p.lanes,c.child=p.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=p.memoizedProps,c.memoizedState=p.memoizedState,c.updateQueue=p.updateQueue,c.type=p.type,e=p.dependencies,c.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ue(Ve,Ve.current&1|2),t.child}e=e.sibling}c.tail!==null&&qe()>fs&&(t.flags|=128,l=!0,yo(c,!1),t.lanes=4194304)}else{if(!l)if(e=Cl(p),e!==null){if(t.flags|=128,l=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),yo(c,!0),c.tail===null&&c.tailMode==="hidden"&&!p.alternate&&!We)return dt(t),null}else 2*qe()-c.renderingStartTime>fs&&r!==1073741824&&(t.flags|=128,l=!0,yo(c,!1),t.lanes=4194304);c.isBackwards?(p.sibling=t.child,t.child=p):(r=c.last,r!==null?r.sibling=p:t.child=p,c.last=p)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=qe(),t.sibling=null,r=Ve.current,Ue(Ve,l?r&1|2:r&1),t):(dt(t),null);case 22:case 23:return su(),l=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==l&&(t.flags|=8192),l&&(t.mode&1)!==0?(Ot&1073741824)!==0&&(dt(t),t.subtreeFlags&6&&(t.flags|=8192)):dt(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function Wg(e,t){switch(pa(t),t.tag){case 1:return yt(t.type)&&ml(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return as(),Be(xt),Be(ut),Ca(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Na(t),null;case 13:if(Be(Ve),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ss()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Be(Ve),null;case 4:return as(),null;case 10:return va(t.type._context),null;case 22:case 23:return su(),null;case 24:return null;default:return null}}var Al=!1,ft=!1,Vg=typeof WeakSet=="function"?WeakSet:Set,ae=null;function cs(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(l){Ke(e,t,l)}else r.current=null}function Ga(e,t,r){try{r()}catch(l){Ke(e,t,l)}}var Of=!1;function Gg(e,t){if(sa=tl,e=ud(),Zi(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var l=r.getSelection&&r.getSelection();if(l&&l.rangeCount!==0){r=l.anchorNode;var a=l.anchorOffset,c=l.focusNode;l=l.focusOffset;try{r.nodeType,c.nodeType}catch{r=null;break e}var p=0,y=-1,N=-1,I=0,W=0,K=e,H=null;t:for(;;){for(var se;K!==r||a!==0&&K.nodeType!==3||(y=p+a),K!==c||l!==0&&K.nodeType!==3||(N=p+l),K.nodeType===3&&(p+=K.nodeValue.length),(se=K.firstChild)!==null;)H=K,K=se;for(;;){if(K===e)break t;if(H===r&&++I===a&&(y=p),H===c&&++W===l&&(N=p),(se=K.nextSibling)!==null)break;K=H,H=K.parentNode}K=se}r=y===-1||N===-1?null:{start:y,end:N}}else r=null}r=r||{start:0,end:0}}else r=null;for(oa={focusedElem:e,selectionRange:r},tl=!1,ae=t;ae!==null;)if(t=ae,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ae=e;else for(;ae!==null;){t=ae;try{var de=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(de!==null){var fe=de.memoizedProps,Ze=de.memoizedState,R=t.stateNode,P=R.getSnapshotBeforeUpdate(t.elementType===t.type?fe:Kt(t.type,fe),Ze);R.__reactInternalSnapshotBeforeUpdate=P}break;case 3:var D=t.stateNode.containerInfo;D.nodeType===1?D.textContent="":D.nodeType===9&&D.documentElement&&D.removeChild(D.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(Y){Ke(t,t.return,Y)}if(e=t.sibling,e!==null){e.return=t.return,ae=e;break}ae=t.return}return de=Of,Of=!1,de}function vo(e,t,r){var l=t.updateQueue;if(l=l!==null?l.lastEffect:null,l!==null){var a=l=l.next;do{if((a.tag&e)===e){var c=a.destroy;a.destroy=void 0,c!==void 0&&Ga(t,r,c)}a=a.next}while(a!==l)}}function zl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var l=r.create;r.destroy=l()}r=r.next}while(r!==t)}}function Ka(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Df(e){var t=e.alternate;t!==null&&(e.alternate=null,Df(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[er],delete t[io],delete t[ua],delete t[Pg],delete t[_g])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Tf(e){return e.tag===5||e.tag===3||e.tag===4}function Af(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Tf(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.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 Qa(e,t,r){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=pl));else if(l!==4&&(e=e.child,e!==null))for(Qa(e,t,r),e=e.sibling;e!==null;)Qa(e,t,r),e=e.sibling}function qa(e,t,r){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(l!==4&&(e=e.child,e!==null))for(qa(e,t,r),e=e.sibling;e!==null;)qa(e,t,r),e=e.sibling}var st=null,Qt=!1;function Fr(e,t,r){for(r=r.child;r!==null;)zf(e,t,r),r=r.sibling}function zf(e,t,r){if(Xt&&typeof Xt.onCommitFiberUnmount=="function")try{Xt.onCommitFiberUnmount(qo,r)}catch{}switch(r.tag){case 5:ft||cs(r,t);case 6:var l=st,a=Qt;st=null,Fr(e,t,r),st=l,Qt=a,st!==null&&(Qt?(e=st,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):st.removeChild(r.stateNode));break;case 18:st!==null&&(Qt?(e=st,r=r.stateNode,e.nodeType===8?aa(e.parentNode,r):e.nodeType===1&&aa(e,r),Zs(e)):aa(st,r.stateNode));break;case 4:l=st,a=Qt,st=r.stateNode.containerInfo,Qt=!0,Fr(e,t,r),st=l,Qt=a;break;case 0:case 11:case 14:case 15:if(!ft&&(l=r.updateQueue,l!==null&&(l=l.lastEffect,l!==null))){a=l=l.next;do{var c=a,p=c.destroy;c=c.tag,p!==void 0&&((c&2)!==0||(c&4)!==0)&&Ga(r,t,p),a=a.next}while(a!==l)}Fr(e,t,r);break;case 1:if(!ft&&(cs(r,t),l=r.stateNode,typeof l.componentWillUnmount=="function"))try{l.props=r.memoizedProps,l.state=r.memoizedState,l.componentWillUnmount()}catch(y){Ke(r,t,y)}Fr(e,t,r);break;case 21:Fr(e,t,r);break;case 22:r.mode&1?(ft=(l=ft)||r.memoizedState!==null,Fr(e,t,r),ft=l):Fr(e,t,r);break;default:Fr(e,t,r)}}function Lf(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Vg),t.forEach(function(l){var a=tx.bind(null,e,l);r.has(l)||(r.add(l),l.then(a,a))})}}function qt(e,t){var r=t.deletions;if(r!==null)for(var l=0;l<r.length;l++){var a=r[l];try{var c=e,p=t,y=p;e:for(;y!==null;){switch(y.tag){case 5:st=y.stateNode,Qt=!1;break e;case 3:st=y.stateNode.containerInfo,Qt=!0;break e;case 4:st=y.stateNode.containerInfo,Qt=!0;break e}y=y.return}if(st===null)throw Error(i(160));zf(c,p,a),st=null,Qt=!1;var N=a.alternate;N!==null&&(N.return=null),a.return=null}catch(I){Ke(a,t,I)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)If(t,e),t=t.sibling}function If(e,t){var r=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(qt(t,e),nr(e),l&4){try{vo(3,e,e.return),zl(3,e)}catch(fe){Ke(e,e.return,fe)}try{vo(5,e,e.return)}catch(fe){Ke(e,e.return,fe)}}break;case 1:qt(t,e),nr(e),l&512&&r!==null&&cs(r,r.return);break;case 5:if(qt(t,e),nr(e),l&512&&r!==null&&cs(r,r.return),e.flags&32){var a=e.stateNode;try{cr(a,"")}catch(fe){Ke(e,e.return,fe)}}if(l&4&&(a=e.stateNode,a!=null)){var c=e.memoizedProps,p=r!==null?r.memoizedProps:c,y=e.type,N=e.updateQueue;if(e.updateQueue=null,N!==null)try{y==="input"&&c.type==="radio"&&c.name!=null&&Fs(a,c),Ci(y,p);var I=Ci(y,c);for(p=0;p<N.length;p+=2){var W=N[p],K=N[p+1];W==="style"?vc(a,K):W==="dangerouslySetInnerHTML"?Ht(a,K):W==="children"?cr(a,K):V(a,W,K,I)}switch(y){case"input":$n(a,c);break;case"textarea":T(a,c);break;case"select":var H=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!c.multiple;var se=c.value;se!=null?ur(a,!!c.multiple,se,!1):H!==!!c.multiple&&(c.defaultValue!=null?ur(a,!!c.multiple,c.defaultValue,!0):ur(a,!!c.multiple,c.multiple?[]:"",!1))}a[io]=c}catch(fe){Ke(e,e.return,fe)}}break;case 6:if(qt(t,e),nr(e),l&4){if(e.stateNode===null)throw Error(i(162));a=e.stateNode,c=e.memoizedProps;try{a.nodeValue=c}catch(fe){Ke(e,e.return,fe)}}break;case 3:if(qt(t,e),nr(e),l&4&&r!==null&&r.memoizedState.isDehydrated)try{Zs(t.containerInfo)}catch(fe){Ke(e,e.return,fe)}break;case 4:qt(t,e),nr(e);break;case 13:qt(t,e),nr(e),a=e.child,a.flags&8192&&(c=a.memoizedState!==null,a.stateNode.isHidden=c,!c||a.alternate!==null&&a.alternate.memoizedState!==null||(Ja=qe())),l&4&&Lf(e);break;case 22:if(W=r!==null&&r.memoizedState!==null,e.mode&1?(ft=(I=ft)||W,qt(t,e),ft=I):qt(t,e),nr(e),l&8192){if(I=e.memoizedState!==null,(e.stateNode.isHidden=I)&&!W&&(e.mode&1)!==0)for(ae=e,W=e.child;W!==null;){for(K=ae=W;ae!==null;){switch(H=ae,se=H.child,H.tag){case 0:case 11:case 14:case 15:vo(4,H,H.return);break;case 1:cs(H,H.return);var de=H.stateNode;if(typeof de.componentWillUnmount=="function"){l=H,r=H.return;try{t=l,de.props=t.memoizedProps,de.state=t.memoizedState,de.componentWillUnmount()}catch(fe){Ke(l,r,fe)}}break;case 5:cs(H,H.return);break;case 22:if(H.memoizedState!==null){$f(K);continue}}se!==null?(se.return=H,ae=se):$f(K)}W=W.sibling}e:for(W=null,K=e;;){if(K.tag===5){if(W===null){W=K;try{a=K.stateNode,I?(c=a.style,typeof c.setProperty=="function"?c.setProperty("display","none","important"):c.display="none"):(y=K.stateNode,N=K.memoizedProps.style,p=N!=null&&N.hasOwnProperty("display")?N.display:null,y.style.display=yc("display",p))}catch(fe){Ke(e,e.return,fe)}}}else if(K.tag===6){if(W===null)try{K.stateNode.nodeValue=I?"":K.memoizedProps}catch(fe){Ke(e,e.return,fe)}}else if((K.tag!==22&&K.tag!==23||K.memoizedState===null||K===e)&&K.child!==null){K.child.return=K,K=K.child;continue}if(K===e)break e;for(;K.sibling===null;){if(K.return===null||K.return===e)break e;W===K&&(W=null),K=K.return}W===K&&(W=null),K.sibling.return=K.return,K=K.sibling}}break;case 19:qt(t,e),nr(e),l&4&&Lf(e);break;case 21:break;default:qt(t,e),nr(e)}}function nr(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Tf(r)){var l=r;break e}r=r.return}throw Error(i(160))}switch(l.tag){case 5:var a=l.stateNode;l.flags&32&&(cr(a,""),l.flags&=-33);var c=Af(e);qa(e,c,a);break;case 3:case 4:var p=l.stateNode.containerInfo,y=Af(e);Qa(e,y,p);break;default:throw Error(i(161))}}catch(N){Ke(e,e.return,N)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Kg(e,t,r){ae=e,Ff(e)}function Ff(e,t,r){for(var l=(e.mode&1)!==0;ae!==null;){var a=ae,c=a.child;if(a.tag===22&&l){var p=a.memoizedState!==null||Al;if(!p){var y=a.alternate,N=y!==null&&y.memoizedState!==null||ft;y=Al;var I=ft;if(Al=p,(ft=N)&&!I)for(ae=a;ae!==null;)p=ae,N=p.child,p.tag===22&&p.memoizedState!==null?Bf(a):N!==null?(N.return=p,ae=N):Bf(a);for(;c!==null;)ae=c,Ff(c),c=c.sibling;ae=a,Al=y,ft=I}Uf(e)}else(a.subtreeFlags&8772)!==0&&c!==null?(c.return=a,ae=c):Uf(e)}}function Uf(e){for(;ae!==null;){var t=ae;if((t.flags&8772)!==0){var r=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:ft||zl(5,t);break;case 1:var l=t.stateNode;if(t.flags&4&&!ft)if(r===null)l.componentDidMount();else{var a=t.elementType===t.type?r.memoizedProps:Kt(t.type,r.memoizedProps);l.componentDidUpdate(a,r.memoizedState,l.__reactInternalSnapshotBeforeUpdate)}var c=t.updateQueue;c!==null&&Ud(t,c,l);break;case 3:var p=t.updateQueue;if(p!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Ud(t,p,r)}break;case 5:var y=t.stateNode;if(r===null&&t.flags&4){r=y;var N=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":N.autoFocus&&r.focus();break;case"img":N.src&&(r.src=N.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var I=t.alternate;if(I!==null){var W=I.memoizedState;if(W!==null){var K=W.dehydrated;K!==null&&Zs(K)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}ft||t.flags&512&&Ka(t)}catch(H){Ke(t,t.return,H)}}if(t===e){ae=null;break}if(r=t.sibling,r!==null){r.return=t.return,ae=r;break}ae=t.return}}function $f(e){for(;ae!==null;){var t=ae;if(t===e){ae=null;break}var r=t.sibling;if(r!==null){r.return=t.return,ae=r;break}ae=t.return}}function Bf(e){for(;ae!==null;){var t=ae;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{zl(4,t)}catch(N){Ke(t,r,N)}break;case 1:var l=t.stateNode;if(typeof l.componentDidMount=="function"){var a=t.return;try{l.componentDidMount()}catch(N){Ke(t,a,N)}}var c=t.return;try{Ka(t)}catch(N){Ke(t,c,N)}break;case 5:var p=t.return;try{Ka(t)}catch(N){Ke(t,p,N)}}}catch(N){Ke(t,t.return,N)}if(t===e){ae=null;break}var y=t.sibling;if(y!==null){y.return=t.return,ae=y;break}ae=t.return}}var Qg=Math.ceil,Ll=z.ReactCurrentDispatcher,Za=z.ReactCurrentOwner,Ut=z.ReactCurrentBatchConfig,Te=0,tt=null,Ye=null,ot=0,Ot=0,ds=Tr(0),Xe=0,bo=null,xn=0,Il=0,Ya=0,wo=null,bt=null,Ja=0,fs=1/0,vr=null,Fl=!1,Xa=null,Ur=null,Ul=!1,$r=null,$l=0,jo=0,eu=null,Bl=-1,Hl=0;function mt(){return(Te&6)!==0?qe():Bl!==-1?Bl:Bl=qe()}function Br(e){return(e.mode&1)===0?1:(Te&2)!==0&&ot!==0?ot&-ot:Rg.transition!==null?(Hl===0&&(Hl=Tc()),Hl):(e=Ie,e!==0||(e=window.event,e=e===void 0?16:Hc(e.type)),e)}function Zt(e,t,r,l){if(50<jo)throw jo=0,eu=null,Error(i(185));Vs(e,r,l),((Te&2)===0||e!==tt)&&(e===tt&&((Te&2)===0&&(Il|=r),Xe===4&&Hr(e,ot)),wt(e,l),r===1&&Te===0&&(t.mode&1)===0&&(fs=qe()+500,xl&&zr()))}function wt(e,t){var r=e.callbackNode;Rm(e,t);var l=Jo(e,e===tt?ot:0);if(l===0)r!==null&&Rc(r),e.callbackNode=null,e.callbackPriority=0;else if(t=l&-l,e.callbackPriority!==t){if(r!=null&&Rc(r),t===1)e.tag===0?Mg(Wf.bind(null,e)):Pd(Wf.bind(null,e)),Cg(function(){(Te&6)===0&&zr()}),r=null;else{switch(Ac(l)){case 1:r=Di;break;case 4:r=Oc;break;case 16:r=Qo;break;case 536870912:r=Dc;break;default:r=Qo}r=Jf(r,Hf.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Hf(e,t){if(Bl=-1,Hl=0,(Te&6)!==0)throw Error(i(327));var r=e.callbackNode;if(ps()&&e.callbackNode!==r)return null;var l=Jo(e,e===tt?ot:0);if(l===0)return null;if((l&30)!==0||(l&e.expiredLanes)!==0||t)t=Wl(e,l);else{t=l;var a=Te;Te|=2;var c=Gf();(tt!==e||ot!==t)&&(vr=null,fs=qe()+500,vn(e,t));do try{Yg();break}catch(y){Vf(e,y)}while(!0);ya(),Ll.current=c,Te=a,Ye!==null?t=0:(tt=null,ot=0,t=Xe)}if(t!==0){if(t===2&&(a=Ti(e),a!==0&&(l=a,t=tu(e,a))),t===1)throw r=bo,vn(e,0),Hr(e,l),wt(e,qe()),r;if(t===6)Hr(e,l);else{if(a=e.current.alternate,(l&30)===0&&!qg(a)&&(t=Wl(e,l),t===2&&(c=Ti(e),c!==0&&(l=c,t=tu(e,c))),t===1))throw r=bo,vn(e,0),Hr(e,l),wt(e,qe()),r;switch(e.finishedWork=a,e.finishedLanes=l,t){case 0:case 1:throw Error(i(345));case 2:bn(e,bt,vr);break;case 3:if(Hr(e,l),(l&130023424)===l&&(t=Ja+500-qe(),10<t)){if(Jo(e,0)!==0)break;if(a=e.suspendedLanes,(a&l)!==l){mt(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=ia(bn.bind(null,e,bt,vr),t);break}bn(e,bt,vr);break;case 4:if(Hr(e,l),(l&4194240)===l)break;for(t=e.eventTimes,a=-1;0<l;){var p=31-Wt(l);c=1<<p,p=t[p],p>a&&(a=p),l&=~c}if(l=a,l=qe()-l,l=(120>l?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Qg(l/1960))-l,10<l){e.timeoutHandle=ia(bn.bind(null,e,bt,vr),l);break}bn(e,bt,vr);break;case 5:bn(e,bt,vr);break;default:throw Error(i(329))}}}return wt(e,qe()),e.callbackNode===r?Hf.bind(null,e):null}function tu(e,t){var r=wo;return e.current.memoizedState.isDehydrated&&(vn(e,t).flags|=256),e=Wl(e,t),e!==2&&(t=bt,bt=r,t!==null&&ru(t)),e}function ru(e){bt===null?bt=e:bt.push.apply(bt,e)}function qg(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var l=0;l<r.length;l++){var a=r[l],c=a.getSnapshot;a=a.value;try{if(!Vt(c(),a))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 Hr(e,t){for(t&=~Ya,t&=~Il,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Wt(t),l=1<<r;e[r]=-1,t&=~l}}function Wf(e){if((Te&6)!==0)throw Error(i(327));ps();var t=Jo(e,0);if((t&1)===0)return wt(e,qe()),null;var r=Wl(e,t);if(e.tag!==0&&r===2){var l=Ti(e);l!==0&&(t=l,r=tu(e,l))}if(r===1)throw r=bo,vn(e,0),Hr(e,t),wt(e,qe()),r;if(r===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,bn(e,bt,vr),wt(e,qe()),null}function nu(e,t){var r=Te;Te|=1;try{return e(t)}finally{Te=r,Te===0&&(fs=qe()+500,xl&&zr())}}function yn(e){$r!==null&&$r.tag===0&&(Te&6)===0&&ps();var t=Te;Te|=1;var r=Ut.transition,l=Ie;try{if(Ut.transition=null,Ie=1,e)return e()}finally{Ie=l,Ut.transition=r,Te=t,(Te&6)===0&&zr()}}function su(){Ot=ds.current,Be(ds)}function vn(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Sg(r)),Ye!==null)for(r=Ye.return;r!==null;){var l=r;switch(pa(l),l.tag){case 1:l=l.type.childContextTypes,l!=null&&ml();break;case 3:as(),Be(xt),Be(ut),Ca();break;case 5:Na(l);break;case 4:as();break;case 13:Be(Ve);break;case 19:Be(Ve);break;case 10:va(l.type._context);break;case 22:case 23:su()}r=r.return}if(tt=e,Ye=e=Wr(e.current,null),ot=Ot=t,Xe=0,bo=null,Ya=Il=xn=0,bt=wo=null,hn!==null){for(t=0;t<hn.length;t++)if(r=hn[t],l=r.interleaved,l!==null){r.interleaved=null;var a=l.next,c=r.pending;if(c!==null){var p=c.next;c.next=a,l.next=p}r.pending=l}hn=null}return e}function Vf(e,t){do{var r=Ye;try{if(ya(),El.current=Rl,Pl){for(var l=Ge.memoizedState;l!==null;){var a=l.queue;a!==null&&(a.pending=null),l=l.next}Pl=!1}if(gn=0,et=Je=Ge=null,ho=!1,mo=0,Za.current=null,r===null||r.return===null){Xe=1,bo=t,Ye=null;break}e:{var c=e,p=r.return,y=r,N=t;if(t=ot,y.flags|=32768,N!==null&&typeof N=="object"&&typeof N.then=="function"){var I=N,W=y,K=W.tag;if((W.mode&1)===0&&(K===0||K===11||K===15)){var H=W.alternate;H?(W.updateQueue=H.updateQueue,W.memoizedState=H.memoizedState,W.lanes=H.lanes):(W.updateQueue=null,W.memoizedState=null)}var se=gf(p);if(se!==null){se.flags&=-257,xf(se,p,y,c,t),se.mode&1&&mf(c,I,t),t=se,N=I;var de=t.updateQueue;if(de===null){var fe=new Set;fe.add(N),t.updateQueue=fe}else de.add(N);break e}else{if((t&1)===0){mf(c,I,t),ou();break e}N=Error(i(426))}}else if(We&&y.mode&1){var Ze=gf(p);if(Ze!==null){(Ze.flags&65536)===0&&(Ze.flags|=256),xf(Ze,p,y,c,t),ga(us(N,y));break e}}c=N=us(N,y),Xe!==4&&(Xe=2),wo===null?wo=[c]:wo.push(c),c=p;do{switch(c.tag){case 3:c.flags|=65536,t&=-t,c.lanes|=t;var R=pf(c,N,t);Fd(c,R);break e;case 1:y=N;var P=c.type,D=c.stateNode;if((c.flags&128)===0&&(typeof P.getDerivedStateFromError=="function"||D!==null&&typeof D.componentDidCatch=="function"&&(Ur===null||!Ur.has(D)))){c.flags|=65536,t&=-t,c.lanes|=t;var Y=hf(c,y,t);Fd(c,Y);break e}}c=c.return}while(c!==null)}Qf(r)}catch(pe){t=pe,Ye===r&&r!==null&&(Ye=r=r.return);continue}break}while(!0)}function Gf(){var e=Ll.current;return Ll.current=Rl,e===null?Rl:e}function ou(){(Xe===0||Xe===3||Xe===2)&&(Xe=4),tt===null||(xn&268435455)===0&&(Il&268435455)===0||Hr(tt,ot)}function Wl(e,t){var r=Te;Te|=2;var l=Gf();(tt!==e||ot!==t)&&(vr=null,vn(e,t));do try{Zg();break}catch(a){Vf(e,a)}while(!0);if(ya(),Te=r,Ll.current=l,Ye!==null)throw Error(i(261));return tt=null,ot=0,Xe}function Zg(){for(;Ye!==null;)Kf(Ye)}function Yg(){for(;Ye!==null&&!jm();)Kf(Ye)}function Kf(e){var t=Yf(e.alternate,e,Ot);e.memoizedProps=e.pendingProps,t===null?Qf(e):Ye=t,Za.current=null}function Qf(e){var t=e;do{var r=t.alternate;if(e=t.return,(t.flags&32768)===0){if(r=Hg(r,t,Ot),r!==null){Ye=r;return}}else{if(r=Wg(r,t),r!==null){r.flags&=32767,Ye=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Xe=6,Ye=null;return}}if(t=t.sibling,t!==null){Ye=t;return}Ye=t=e}while(t!==null);Xe===0&&(Xe=5)}function bn(e,t,r){var l=Ie,a=Ut.transition;try{Ut.transition=null,Ie=1,Jg(e,t,r,l)}finally{Ut.transition=a,Ie=l}return null}function Jg(e,t,r,l){do ps();while($r!==null);if((Te&6)!==0)throw Error(i(327));r=e.finishedWork;var a=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0;var c=r.lanes|r.childLanes;if(Om(e,c),e===tt&&(Ye=tt=null,ot=0),(r.subtreeFlags&2064)===0&&(r.flags&2064)===0||Ul||(Ul=!0,Jf(Qo,function(){return ps(),null})),c=(r.flags&15990)!==0,(r.subtreeFlags&15990)!==0||c){c=Ut.transition,Ut.transition=null;var p=Ie;Ie=1;var y=Te;Te|=4,Za.current=null,Gg(e,r),If(r,e),yg(oa),tl=!!sa,oa=sa=null,e.current=r,Kg(r),km(),Te=y,Ie=p,Ut.transition=c}else e.current=r;if(Ul&&(Ul=!1,$r=e,$l=a),c=e.pendingLanes,c===0&&(Ur=null),Cm(r.stateNode),wt(e,qe()),t!==null)for(l=e.onRecoverableError,r=0;r<t.length;r++)a=t[r],l(a.value,{componentStack:a.stack,digest:a.digest});if(Fl)throw Fl=!1,e=Xa,Xa=null,e;return($l&1)!==0&&e.tag!==0&&ps(),c=e.pendingLanes,(c&1)!==0?e===eu?jo++:(jo=0,eu=e):jo=0,zr(),null}function ps(){if($r!==null){var e=Ac($l),t=Ut.transition,r=Ie;try{if(Ut.transition=null,Ie=16>e?16:e,$r===null)var l=!1;else{if(e=$r,$r=null,$l=0,(Te&6)!==0)throw Error(i(331));var a=Te;for(Te|=4,ae=e.current;ae!==null;){var c=ae,p=c.child;if((ae.flags&16)!==0){var y=c.deletions;if(y!==null){for(var N=0;N<y.length;N++){var I=y[N];for(ae=I;ae!==null;){var W=ae;switch(W.tag){case 0:case 11:case 15:vo(8,W,c)}var K=W.child;if(K!==null)K.return=W,ae=K;else for(;ae!==null;){W=ae;var H=W.sibling,se=W.return;if(Df(W),W===I){ae=null;break}if(H!==null){H.return=se,ae=H;break}ae=se}}}var de=c.alternate;if(de!==null){var fe=de.child;if(fe!==null){de.child=null;do{var Ze=fe.sibling;fe.sibling=null,fe=Ze}while(fe!==null)}}ae=c}}if((c.subtreeFlags&2064)!==0&&p!==null)p.return=c,ae=p;else e:for(;ae!==null;){if(c=ae,(c.flags&2048)!==0)switch(c.tag){case 0:case 11:case 15:vo(9,c,c.return)}var R=c.sibling;if(R!==null){R.return=c.return,ae=R;break e}ae=c.return}}var P=e.current;for(ae=P;ae!==null;){p=ae;var D=p.child;if((p.subtreeFlags&2064)!==0&&D!==null)D.return=p,ae=D;else e:for(p=P;ae!==null;){if(y=ae,(y.flags&2048)!==0)try{switch(y.tag){case 0:case 11:case 15:zl(9,y)}}catch(pe){Ke(y,y.return,pe)}if(y===p){ae=null;break e}var Y=y.sibling;if(Y!==null){Y.return=y.return,ae=Y;break e}ae=y.return}}if(Te=a,zr(),Xt&&typeof Xt.onPostCommitFiberRoot=="function")try{Xt.onPostCommitFiberRoot(qo,e)}catch{}l=!0}return l}finally{Ie=r,Ut.transition=t}}return!1}function qf(e,t,r){t=us(r,t),t=pf(e,t,1),e=Ir(e,t,1),t=mt(),e!==null&&(Vs(e,1,t),wt(e,t))}function Ke(e,t,r){if(e.tag===3)qf(e,e,r);else for(;t!==null;){if(t.tag===3){qf(t,e,r);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Ur===null||!Ur.has(l))){e=us(r,e),e=hf(t,e,1),t=Ir(t,e,1),e=mt(),t!==null&&(Vs(t,1,e),wt(t,e));break}}t=t.return}}function Xg(e,t,r){var l=e.pingCache;l!==null&&l.delete(t),t=mt(),e.pingedLanes|=e.suspendedLanes&r,tt===e&&(ot&r)===r&&(Xe===4||Xe===3&&(ot&130023424)===ot&&500>qe()-Ja?vn(e,0):Ya|=r),wt(e,t)}function Zf(e,t){t===0&&((e.mode&1)===0?t=1:(t=Yo,Yo<<=1,(Yo&130023424)===0&&(Yo=4194304)));var r=mt();e=gr(e,t),e!==null&&(Vs(e,t,r),wt(e,r))}function ex(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Zf(e,r)}function tx(e,t){var r=0;switch(e.tag){case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(i(314))}l!==null&&l.delete(t),Zf(e,r)}var Yf;Yf=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||xt.current)vt=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return vt=!1,Bg(e,t,r);vt=(e.flags&131072)!==0}else vt=!1,We&&(t.flags&1048576)!==0&&_d(t,vl,t.index);switch(t.lanes=0,t.tag){case 2:var l=t.type;Tl(e,t),e=t.pendingProps;var a=ts(t,ut.current);is(t,r),a=_a(null,t,l,e,a,r);var c=Ma();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,yt(l)?(c=!0,gl(t)):c=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,ja(t),a.updater=Ol,t.stateNode=a,a._reactInternals=t,za(t,l,e,r),t=Ua(null,t,l,!0,c,r)):(t.tag=0,We&&c&&fa(t),ht(null,t,a,r),t=t.child),t;case 16:l=t.elementType;e:{switch(Tl(e,t),e=t.pendingProps,a=l._init,l=a(l._payload),t.type=l,a=t.tag=nx(l),e=Kt(l,e),a){case 0:t=Fa(null,t,l,e,r);break e;case 1:t=kf(null,t,l,e,r);break e;case 11:t=yf(null,t,l,e,r);break e;case 14:t=vf(null,t,l,Kt(l.type,e),r);break e}throw Error(i(306,l,""))}return t;case 0:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:Kt(l,a),Fa(e,t,l,a,r);case 1:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:Kt(l,a),kf(e,t,l,a,r);case 3:e:{if(Nf(t),e===null)throw Error(i(387));l=t.pendingProps,c=t.memoizedState,a=c.element,Id(e,t),Sl(t,l,null,r);var p=t.memoizedState;if(l=p.element,c.isDehydrated)if(c={element:l,isDehydrated:!1,cache:p.cache,pendingSuspenseBoundaries:p.pendingSuspenseBoundaries,transitions:p.transitions},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){a=us(Error(i(423)),t),t=Sf(e,t,l,r,a);break e}else if(l!==a){a=us(Error(i(424)),t),t=Sf(e,t,l,r,a);break e}else for(Rt=Dr(t.stateNode.containerInfo.firstChild),Mt=t,We=!0,Gt=null,r=zd(t,null,l,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ss(),l===a){t=yr(e,t,r);break e}ht(e,t,l,r)}t=t.child}return t;case 5:return $d(t),e===null&&ma(t),l=t.type,a=t.pendingProps,c=e!==null?e.memoizedProps:null,p=a.children,la(l,a)?p=null:c!==null&&la(l,c)&&(t.flags|=32),jf(e,t),ht(e,t,p,r),t.child;case 6:return e===null&&ma(t),null;case 13:return Cf(e,t,r);case 4:return ka(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=os(t,null,l,r):ht(e,t,l,r),t.child;case 11:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:Kt(l,a),yf(e,t,l,a,r);case 7:return ht(e,t,t.pendingProps,r),t.child;case 8:return ht(e,t,t.pendingProps.children,r),t.child;case 12:return ht(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(l=t.type._context,a=t.pendingProps,c=t.memoizedProps,p=a.value,Ue(jl,l._currentValue),l._currentValue=p,c!==null)if(Vt(c.value,p)){if(c.children===a.children&&!xt.current){t=yr(e,t,r);break e}}else for(c=t.child,c!==null&&(c.return=t);c!==null;){var y=c.dependencies;if(y!==null){p=c.child;for(var N=y.firstContext;N!==null;){if(N.context===l){if(c.tag===1){N=xr(-1,r&-r),N.tag=2;var I=c.updateQueue;if(I!==null){I=I.shared;var W=I.pending;W===null?N.next=N:(N.next=W.next,W.next=N),I.pending=N}}c.lanes|=r,N=c.alternate,N!==null&&(N.lanes|=r),ba(c.return,r,t),y.lanes|=r;break}N=N.next}}else if(c.tag===10)p=c.type===t.type?null:c.child;else if(c.tag===18){if(p=c.return,p===null)throw Error(i(341));p.lanes|=r,y=p.alternate,y!==null&&(y.lanes|=r),ba(p,r,t),p=c.sibling}else p=c.child;if(p!==null)p.return=c;else for(p=c;p!==null;){if(p===t){p=null;break}if(c=p.sibling,c!==null){c.return=p.return,p=c;break}p=p.return}c=p}ht(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,l=t.pendingProps.children,is(t,r),a=It(a),l=l(a),t.flags|=1,ht(e,t,l,r),t.child;case 14:return l=t.type,a=Kt(l,t.pendingProps),a=Kt(l.type,a),vf(e,t,l,a,r);case 15:return bf(e,t,t.type,t.pendingProps,r);case 17:return l=t.type,a=t.pendingProps,a=t.elementType===l?a:Kt(l,a),Tl(e,t),t.tag=1,yt(l)?(e=!0,gl(t)):e=!1,is(t,r),df(t,l,a),za(t,l,a,r),Ua(null,t,l,!0,e,r);case 19:return Pf(e,t,r);case 22:return wf(e,t,r)}throw Error(i(156,t.tag))};function Jf(e,t){return Mc(e,t)}function rx(e,t,r,l){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,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 $t(e,t,r,l){return new rx(e,t,r,l)}function lu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function nx(e){if(typeof e=="function")return lu(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ue)return 11;if(e===De)return 14}return 2}function Wr(e,t){var r=e.alternate;return r===null?(r=$t(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Vl(e,t,r,l,a,c){var p=2;if(l=e,typeof e=="function")lu(e)&&(p=1);else if(typeof e=="string")p=5;else e:switch(e){case J:return wn(r.children,a,c,t);case te:p=8,a|=8;break;case re:return e=$t(12,r,t,a|2),e.elementType=re,e.lanes=c,e;case Ae:return e=$t(13,r,t,a),e.elementType=Ae,e.lanes=c,e;case Ee:return e=$t(19,r,t,a),e.elementType=Ee,e.lanes=c,e;case Pe:return Gl(r,a,c,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ee:p=10;break e;case ge:p=9;break e;case ue:p=11;break e;case De:p=14;break e;case Me:p=16,l=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return t=$t(p,r,t,a),t.elementType=e,t.type=l,t.lanes=c,t}function wn(e,t,r,l){return e=$t(7,e,l,t),e.lanes=r,e}function Gl(e,t,r,l){return e=$t(22,e,l,t),e.elementType=Pe,e.lanes=r,e.stateNode={isHidden:!1},e}function iu(e,t,r){return e=$t(6,e,null,t),e.lanes=r,e}function au(e,t,r){return t=$t(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function sx(e,t,r,l,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ai(0),this.expirationTimes=Ai(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ai(0),this.identifierPrefix=l,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function uu(e,t,r,l,a,c,p,y,N){return e=new sx(e,t,r,y,N),t===1?(t=1,c===!0&&(t|=8)):t=0,c=$t(3,null,null,t),e.current=c,c.stateNode=e,c.memoizedState={element:l,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},ja(c),e}function ox(e,t,r){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:B,key:l==null?null:""+l,children:e,containerInfo:t,implementation:r}}function Xf(e){if(!e)return Ar;e=e._reactInternals;e:{if(un(e)!==e||e.tag!==1)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(yt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(i(171))}if(e.tag===1){var r=e.type;if(yt(r))return Cd(e,r,t)}return t}function ep(e,t,r,l,a,c,p,y,N){return e=uu(r,l,!0,e,a,c,p,y,N),e.context=Xf(null),r=e.current,l=mt(),a=Br(r),c=xr(l,a),c.callback=t??null,Ir(r,c,a),e.current.lanes=a,Vs(e,a,l),wt(e,l),e}function Kl(e,t,r,l){var a=t.current,c=mt(),p=Br(a);return r=Xf(r),t.context===null?t.context=r:t.pendingContext=r,t=xr(c,p),t.payload={element:e},l=l===void 0?null:l,l!==null&&(t.callback=l),e=Ir(a,t,p),e!==null&&(Zt(e,a,p,c),Nl(e,a,p)),p}function Ql(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function tp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function cu(e,t){tp(e,t),(e=e.alternate)&&tp(e,t)}function lx(){return null}var rp=typeof reportError=="function"?reportError:function(e){console.error(e)};function du(e){this._internalRoot=e}ql.prototype.render=du.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));Kl(e,t,null,null)},ql.prototype.unmount=du.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;yn(function(){Kl(null,e,null,null)}),t[fr]=null}};function ql(e){this._internalRoot=e}ql.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ic();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Mr.length&&t!==0&&t<Mr[r].priority;r++);Mr.splice(r,0,e),r===0&&$c(e)}};function fu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Zl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function np(){}function ix(e,t,r,l,a){if(a){if(typeof l=="function"){var c=l;l=function(){var I=Ql(p);c.call(I)}}var p=ep(t,l,e,0,null,!1,!1,"",np);return e._reactRootContainer=p,e[fr]=p.current,oo(e.nodeType===8?e.parentNode:e),yn(),p}for(;a=e.lastChild;)e.removeChild(a);if(typeof l=="function"){var y=l;l=function(){var I=Ql(N);y.call(I)}}var N=uu(e,0,!1,null,null,!1,!1,"",np);return e._reactRootContainer=N,e[fr]=N.current,oo(e.nodeType===8?e.parentNode:e),yn(function(){Kl(t,N,r,l)}),N}function Yl(e,t,r,l,a){var c=r._reactRootContainer;if(c){var p=c;if(typeof a=="function"){var y=a;a=function(){var N=Ql(p);y.call(N)}}Kl(t,p,e,a)}else p=ix(r,t,e,a,l);return Ql(p)}zc=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Ws(t.pendingLanes);r!==0&&(zi(t,r|1),wt(t,qe()),(Te&6)===0&&(fs=qe()+500,zr()))}break;case 13:yn(function(){var l=gr(e,1);if(l!==null){var a=mt();Zt(l,e,1,a)}}),cu(e,1)}},Li=function(e){if(e.tag===13){var t=gr(e,134217728);if(t!==null){var r=mt();Zt(t,e,134217728,r)}cu(e,134217728)}},Lc=function(e){if(e.tag===13){var t=Br(e),r=gr(e,t);if(r!==null){var l=mt();Zt(r,e,t,l)}cu(e,t)}},Ic=function(){return Ie},Fc=function(e,t){var r=Ie;try{return Ie=e,t()}finally{Ie=r}},_i=function(e,t,r){switch(t){case"input":if($n(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var l=r[t];if(l!==e&&l.form===e.form){var a=hl(l);if(!a)throw Error(i(90));at(l),$n(l,a)}}}break;case"textarea":T(e,r);break;case"select":t=r.value,t!=null&&ur(e,!!r.multiple,t,!1)}},kc=nu,Nc=yn;var ax={usingClientEntryPoint:!1,Events:[ao,Xn,hl,wc,jc,nu]},ko={findFiberByHostInstance:cn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},ux={bundleType:ko.bundleType,version:ko.version,rendererPackageName:ko.rendererPackageName,rendererConfig:ko.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:z.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Pc(e),e===null?null:e.stateNode},findFiberByHostInstance:ko.findFiberByHostInstance||lx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Jl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jl.isDisabled&&Jl.supportsFiber)try{qo=Jl.inject(ux),Xt=Jl}catch{}}return jt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ax,jt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!fu(t))throw Error(i(200));return ox(e,t,null,r)},jt.createRoot=function(e,t){if(!fu(e))throw Error(i(299));var r=!1,l="",a=rp;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=uu(e,1,!1,null,null,r,!1,l,a),e[fr]=t.current,oo(e.nodeType===8?e.parentNode:e),new du(t)},jt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(i(188)):(e=Object.keys(e).join(","),Error(i(268,e)));return e=Pc(t),e=e===null?null:e.stateNode,e},jt.flushSync=function(e){return yn(e)},jt.hydrate=function(e,t,r){if(!Zl(t))throw Error(i(200));return Yl(null,e,t,!0,r)},jt.hydrateRoot=function(e,t,r){if(!fu(e))throw Error(i(405));var l=r!=null&&r.hydratedSources||null,a=!1,c="",p=rp;if(r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(c=r.identifierPrefix),r.onRecoverableError!==void 0&&(p=r.onRecoverableError)),t=ep(t,null,e,1,r??null,a,!1,c,p),e[fr]=t.current,oo(e),l)for(e=0;e<l.length;e++)r=l[e],a=r._getVersion,a=a(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,a]:t.mutableSourceEagerHydrationData.push(r,a);return new ql(t)},jt.render=function(e,t,r){if(!Zl(t))throw Error(i(200));return Yl(null,e,t,!1,r)},jt.unmountComponentAtNode=function(e){if(!Zl(e))throw Error(i(40));return e._reactRootContainer?(yn(function(){Yl(null,null,e,!1,function(){e._reactRootContainer=null,e[fr]=null})}),!0):!1},jt.unstable_batchedUpdates=nu,jt.unstable_renderSubtreeIntoContainer=function(e,t,r,l){if(!Zl(r))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return Yl(e,t,r,!1,l)},jt.version="18.3.1-next-f1338f8080-20240426",jt}var fp;function uh(){if(fp)return gu.exports;fp=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(o){console.error(o)}}return s(),gu.exports=xx(),gu.exports}var pp;function yx(){if(pp)return ei;pp=1;var s=uh();return ei.createRoot=s.createRoot,ei.hydrateRoot=s.hydrateRoot,ei}var vx=yx();const bx=ih(vx);var Ho=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(s){return this.listeners.add(s),this.onSubscribe(),()=>{this.listeners.delete(s),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Sn,Zr,js,Yp,wx=(Yp=class extends Ho{constructor(){super();be(this,Sn);be(this,Zr);be(this,js);oe(this,js,o=>{if(typeof window<"u"&&window.addEventListener){const i=()=>o();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}})}onSubscribe(){S(this,Zr)||this.setEventListener(S(this,js))}onUnsubscribe(){var o;this.hasListeners()||((o=S(this,Zr))==null||o.call(this),oe(this,Zr,void 0))}setEventListener(o){var i;oe(this,js,o),(i=S(this,Zr))==null||i.call(this),oe(this,Zr,o(u=>{typeof u=="boolean"?this.setFocused(u):this.onFocus()}))}setFocused(o){S(this,Sn)!==o&&(oe(this,Sn,o),this.onFocus())}onFocus(){const o=this.isFocused();this.listeners.forEach(i=>{i(o)})}isFocused(){var o;return typeof S(this,Sn)=="boolean"?S(this,Sn):((o=globalThis.document)==null?void 0:o.visibilityState)!=="hidden"}},Sn=new WeakMap,Zr=new WeakMap,js=new WeakMap,Yp),lc=new wx,jx={setTimeout:(s,o)=>setTimeout(s,o),clearTimeout:s=>clearTimeout(s),setInterval:(s,o)=>setInterval(s,o),clearInterval:s=>clearInterval(s)},Yr,nc,Jp,kx=(Jp=class{constructor(){be(this,Yr,jx);be(this,nc,!1)}setTimeoutProvider(s){oe(this,Yr,s)}setTimeout(s,o){return S(this,Yr).setTimeout(s,o)}clearTimeout(s){S(this,Yr).clearTimeout(s)}setInterval(s,o){return S(this,Yr).setInterval(s,o)}clearInterval(s){S(this,Yr).clearInterval(s)}},Yr=new WeakMap,nc=new WeakMap,Jp),Nn=new kx;function Nx(s){setTimeout(s,0)}var Sx=typeof window>"u"||"Deno"in globalThis;function Nt(){}function Cx(s,o){return typeof s=="function"?s(o):s}function Ru(s){return typeof s=="number"&&s>=0&&s!==1/0}function ch(s,o){return Math.max(s+(o||0)-Date.now(),0)}function sn(s,o){return typeof s=="function"?s(o):s}function Tt(s,o){return typeof s=="function"?s(o):s}function hp(s,o){const{type:i="all",exact:u,fetchStatus:d,predicate:f,queryKey:g,stale:h}=s;if(g){if(u){if(o.queryHash!==ic(g,o.options))return!1}else if(!Mo(o.queryKey,g))return!1}if(i!=="all"){const v=o.isActive();if(i==="active"&&!v||i==="inactive"&&v)return!1}return!(typeof h=="boolean"&&o.isStale()!==h||d&&d!==o.state.fetchStatus||f&&!f(o))}function mp(s,o){const{exact:i,status:u,predicate:d,mutationKey:f}=s;if(f){if(!o.options.mutationKey)return!1;if(i){if(_o(o.options.mutationKey)!==_o(f))return!1}else if(!Mo(o.options.mutationKey,f))return!1}return!(u&&o.state.status!==u||d&&!d(o))}function ic(s,o){return((o==null?void 0:o.queryKeyHashFn)||_o)(s)}function _o(s){return JSON.stringify(s,(o,i)=>Du(i)?Object.keys(i).sort().reduce((u,d)=>(u[d]=i[d],u),{}):i)}function Mo(s,o){return s===o?!0:typeof s!=typeof o?!1:s&&o&&typeof s=="object"&&typeof o=="object"?Object.keys(o).every(i=>Mo(s[i],o[i])):!1}var Ex=Object.prototype.hasOwnProperty;function dh(s,o,i=0){if(s===o)return s;if(i>500)return o;const u=gp(s)&&gp(o);if(!u&&!(Du(s)&&Du(o)))return o;const f=(u?s:Object.keys(s)).length,g=u?o:Object.keys(o),h=g.length,v=u?new Array(h):{};let x=0;for(let b=0;b<h;b++){const j=u?b:g[b],M=s[j],O=o[j];if(M===O){v[j]=M,(u?b<f:Ex.call(s,j))&&x++;continue}if(M===null||O===null||typeof M!="object"||typeof O!="object"){v[j]=O;continue}const A=dh(M,O,i+1);v[j]=A,A===M&&x++}return f===h&&x===f?s:v}function Ou(s,o){if(!o||Object.keys(s).length!==Object.keys(o).length)return!1;for(const i in s)if(s[i]!==o[i])return!1;return!0}function gp(s){return Array.isArray(s)&&s.length===Object.keys(s).length}function Du(s){if(!xp(s))return!1;const o=s.constructor;if(o===void 0)return!0;const i=o.prototype;return!(!xp(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(s)!==Object.prototype)}function xp(s){return Object.prototype.toString.call(s)==="[object Object]"}function Px(s){return new Promise(o=>{Nn.setTimeout(o,s)})}function Tu(s,o,i){return typeof i.structuralSharing=="function"?i.structuralSharing(s,o):i.structuralSharing!==!1?dh(s,o):o}function _x(s,o,i=0){const u=[...s,o];return i&&u.length>i?u.slice(1):u}function Mx(s,o,i=0){const u=[o,...s];return i&&u.length>i?u.slice(0,-1):u}var ac=Symbol();function fh(s,o){return!s.queryFn&&(o!=null&&o.initialPromise)?()=>o.initialPromise:!s.queryFn||s.queryFn===ac?()=>Promise.reject(new Error(`Missing queryFn: '${s.queryHash}'`)):s.queryFn}function ph(s,o){return typeof s=="function"?s(...o):!!s}function Rx(s,o,i){let u=!1,d;return Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(d??(d=o()),u||(u=!0,d.aborted?i():d.addEventListener("abort",i,{once:!0})),d)}),s}var Ro=(()=>{let s=()=>Sx;return{isServer(){return s()},setIsServer(o){s=o}}})();function Au(){let s,o;const i=new Promise((d,f)=>{s=d,o=f});i.status="pending",i.catch(()=>{});function u(d){Object.assign(i,d),delete i.resolve,delete i.reject}return i.resolve=d=>{u({status:"fulfilled",value:d}),s(d)},i.reject=d=>{u({status:"rejected",reason:d}),o(d)},i}var Ox=Nx;function Dx(){let s=[],o=0,i=h=>{h()},u=h=>{h()},d=Ox;const f=h=>{o?s.push(h):d(()=>{i(h)})},g=()=>{const h=s;s=[],h.length&&d(()=>{u(()=>{h.forEach(v=>{i(v)})})})};return{batch:h=>{let v;o++;try{v=h()}finally{o--,o||g()}return v},batchCalls:h=>(...v)=>{f(()=>{h(...v)})},schedule:f,setNotifyFunction:h=>{i=h},setBatchNotifyFunction:h=>{u=h},setScheduler:h=>{d=h}}}var lt=Dx(),ks,Jr,Ns,Xp,Tx=(Xp=class extends Ho{constructor(){super();be(this,ks,!0);be(this,Jr);be(this,Ns);oe(this,Ns,o=>{if(typeof window<"u"&&window.addEventListener){const i=()=>o(!0),u=()=>o(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",u,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",u)}}})}onSubscribe(){S(this,Jr)||this.setEventListener(S(this,Ns))}onUnsubscribe(){var o;this.hasListeners()||((o=S(this,Jr))==null||o.call(this),oe(this,Jr,void 0))}setEventListener(o){var i;oe(this,Ns,o),(i=S(this,Jr))==null||i.call(this),oe(this,Jr,o(this.setOnline.bind(this)))}setOnline(o){S(this,ks)!==o&&(oe(this,ks,o),this.listeners.forEach(u=>{u(o)}))}isOnline(){return S(this,ks)}},ks=new WeakMap,Jr=new WeakMap,Ns=new WeakMap,Xp),hi=new Tx;function Ax(s){return Math.min(1e3*2**s,3e4)}function hh(s){return(s??"online")==="online"?hi.isOnline():!0}var zu=class extends Error{constructor(s){super("CancelledError"),this.revert=s==null?void 0:s.revert,this.silent=s==null?void 0:s.silent}};function mh(s){let o=!1,i=0,u;const d=Au(),f=()=>d.status!=="pending",g=w=>{var C;if(!f()){const _=new zu(w);M(_),(C=s.onCancel)==null||C.call(s,_)}},h=()=>{o=!0},v=()=>{o=!1},x=()=>lc.isFocused()&&(s.networkMode==="always"||hi.isOnline())&&s.canRun(),b=()=>hh(s.networkMode)&&s.canRun(),j=w=>{f()||(u==null||u(),d.resolve(w))},M=w=>{f()||(u==null||u(),d.reject(w))},O=()=>new Promise(w=>{var C;u=_=>{(f()||x())&&w(_)},(C=s.onPause)==null||C.call(s)}).then(()=>{var w;u=void 0,f()||(w=s.onContinue)==null||w.call(s)}),A=()=>{if(f())return;let w;const C=i===0?s.initialPromise:void 0;try{w=C??s.fn()}catch(_){w=Promise.reject(_)}Promise.resolve(w).then(j).catch(_=>{var B;if(f())return;const $=s.retry??(Ro.isServer()?0:3),V=s.retryDelay??Ax,z=typeof V=="function"?V(i,_):V,L=$===!0||typeof $=="number"&&i<$||typeof $=="function"&&$(i,_);if(o||!L){M(_);return}i++,(B=s.onFail)==null||B.call(s,i,_),Px(z).then(()=>x()?void 0:O()).then(()=>{o?M(_):A()})})};return{promise:d,status:()=>d.status,cancel:g,continue:()=>(u==null||u(),d),cancelRetry:h,continueRetry:v,canStart:b,start:()=>(b()?A():O().then(A),d)}}var Cn,eh,gh=(eh=class{constructor(){be(this,Cn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ru(this.gcTime)&&oe(this,Cn,Nn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(s){this.gcTime=Math.max(this.gcTime||0,s??(Ro.isServer()?1/0:300*1e3))}clearGcTimeout(){S(this,Cn)!==void 0&&(Nn.clearTimeout(S(this,Cn)),oe(this,Cn,void 0))}},Cn=new WeakMap,eh);function zx(s){return{onFetch:(o,i)=>{var b,j,M,O,A;const u=o.options,d=(M=(j=(b=o.fetchOptions)==null?void 0:b.meta)==null?void 0:j.fetchMore)==null?void 0:M.direction,f=((O=o.state.data)==null?void 0:O.pages)||[],g=((A=o.state.data)==null?void 0:A.pageParams)||[];let h={pages:[],pageParams:[]},v=0;const x=async()=>{let w=!1;const C=V=>{Rx(V,()=>o.signal,()=>w=!0)},_=fh(o.options,o.fetchOptions),$=async(V,z,L)=>{if(w)return Promise.reject(o.signal.reason);if(z==null&&V.pages.length)return Promise.resolve(V);const J=(()=>{const ge={client:o.client,queryKey:o.queryKey,pageParam:z,direction:L?"backward":"forward",meta:o.options.meta};return C(ge),ge})(),te=await _(J),{maxPages:re}=o.options,ee=L?Mx:_x;return{pages:ee(V.pages,te,re),pageParams:ee(V.pageParams,z,re)}};if(d&&f.length){const V=d==="backward",z=V?Lx:yp,L={pages:f,pageParams:g},B=z(u,L);h=await $(L,B,V)}else{const V=s??f.length;do{const z=v===0?g[0]??u.initialPageParam:yp(u,h);if(v>0&&z==null)break;h=await $(h,z),v++}while(v<V)}return h};o.options.persister?o.fetchFn=()=>{var w,C;return(C=(w=o.options).persister)==null?void 0:C.call(w,x,{client:o.client,queryKey:o.queryKey,meta:o.options.meta,signal:o.signal},i)}:o.fetchFn=x}}}function yp(s,{pages:o,pageParams:i}){const u=o.length-1;return o.length>0?s.getNextPageParam(o[u],o,i[u],i):void 0}function Lx(s,{pages:o,pageParams:i}){var u;return o.length>0?(u=s.getPreviousPageParam)==null?void 0:u.call(s,o[0],o,i[0],i):void 0}var Ss,En,Cs,Bt,Pn,nt,Io,_n,Dt,xh,wr,th,Ix=(th=class extends gh{constructor(o){super();be(this,Dt);be(this,Ss);be(this,En);be(this,Cs);be(this,Bt);be(this,Pn);be(this,nt);be(this,Io);be(this,_n);oe(this,_n,!1),oe(this,Io,o.defaultOptions),this.setOptions(o.options),this.observers=[],oe(this,Pn,o.client),oe(this,Bt,S(this,Pn).getQueryCache()),this.queryKey=o.queryKey,this.queryHash=o.queryHash,oe(this,En,bp(this.options)),this.state=o.state??S(this,En),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return S(this,Ss)}get promise(){var o;return(o=S(this,nt))==null?void 0:o.promise}setOptions(o){if(this.options={...S(this,Io),...o},o!=null&&o._type&&oe(this,Ss,o._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=bp(this.options);i.data!==void 0&&(this.setState(vp(i.data,i.dataUpdatedAt)),oe(this,En,i))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&S(this,Bt).remove(this)}setData(o,i){const u=Tu(this.state.data,o,this.options);return _e(this,Dt,wr).call(this,{data:u,type:"success",dataUpdatedAt:i==null?void 0:i.updatedAt,manual:i==null?void 0:i.manual}),u}setState(o){_e(this,Dt,wr).call(this,{type:"setState",state:o})}cancel(o){var u,d;const i=(u=S(this,nt))==null?void 0:u.promise;return(d=S(this,nt))==null||d.cancel(o),i?i.then(Nt).catch(Nt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return S(this,En)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(o=>Tt(o.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===ac||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(o=>sn(o.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(o=>o.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(o=0){return this.state.data===void 0?!0:o==="static"?!1:this.state.isInvalidated?!0:!ch(this.state.dataUpdatedAt,o)}onFocus(){var i;const o=this.observers.find(u=>u.shouldFetchOnWindowFocus());o==null||o.refetch({cancelRefetch:!1}),(i=S(this,nt))==null||i.continue()}onOnline(){var i;const o=this.observers.find(u=>u.shouldFetchOnReconnect());o==null||o.refetch({cancelRefetch:!1}),(i=S(this,nt))==null||i.continue()}addObserver(o){this.observers.includes(o)||(this.observers.push(o),this.clearGcTimeout(),S(this,Bt).notify({type:"observerAdded",query:this,observer:o}))}removeObserver(o){this.observers.includes(o)&&(this.observers=this.observers.filter(i=>i!==o),this.observers.length||(S(this,nt)&&(S(this,_n)||_e(this,Dt,xh).call(this)?S(this,nt).cancel({revert:!0}):S(this,nt).cancelRetry()),this.scheduleGc()),S(this,Bt).notify({type:"observerRemoved",query:this,observer:o}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||_e(this,Dt,wr).call(this,{type:"invalidate"})}async fetch(o,i){var x,b,j,M,O,A,w,C,_,$,V;if(this.state.fetchStatus!=="idle"&&((x=S(this,nt))==null?void 0:x.status())!=="rejected"){if(this.state.data!==void 0&&(i!=null&&i.cancelRefetch))this.cancel({silent:!0});else if(S(this,nt))return S(this,nt).continueRetry(),S(this,nt).promise}if(o&&this.setOptions(o),!this.options.queryFn){const z=this.observers.find(L=>L.options.queryFn);z&&this.setOptions(z.options)}const u=new AbortController,d=z=>{Object.defineProperty(z,"signal",{enumerable:!0,get:()=>(oe(this,_n,!0),u.signal)})},f=()=>{const z=fh(this.options,i),B=(()=>{const J={client:S(this,Pn),queryKey:this.queryKey,meta:this.meta};return d(J),J})();return oe(this,_n,!1),this.options.persister?this.options.persister(z,B,this):z(B)},h=(()=>{const z={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:S(this,Pn),state:this.state,fetchFn:f};return d(z),z})(),v=S(this,Ss)==="infinite"?zx(this.options.pages):this.options.behavior;v==null||v.onFetch(h,this),oe(this,Cs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((b=h.fetchOptions)==null?void 0:b.meta))&&_e(this,Dt,wr).call(this,{type:"fetch",meta:(j=h.fetchOptions)==null?void 0:j.meta}),oe(this,nt,mh({initialPromise:i==null?void 0:i.initialPromise,fn:h.fetchFn,onCancel:z=>{z instanceof zu&&z.revert&&this.setState({...S(this,Cs),fetchStatus:"idle"}),u.abort()},onFail:(z,L)=>{_e(this,Dt,wr).call(this,{type:"failed",failureCount:z,error:L})},onPause:()=>{_e(this,Dt,wr).call(this,{type:"pause"})},onContinue:()=>{_e(this,Dt,wr).call(this,{type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0}));try{const z=await S(this,nt).start();if(z===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(z),(O=(M=S(this,Bt).config).onSuccess)==null||O.call(M,z,this),(w=(A=S(this,Bt).config).onSettled)==null||w.call(A,z,this.state.error,this),z}catch(z){if(z instanceof zu){if(z.silent)return S(this,nt).promise;if(z.revert){if(this.state.data===void 0)throw z;return this.state.data}}throw _e(this,Dt,wr).call(this,{type:"error",error:z}),(_=(C=S(this,Bt).config).onError)==null||_.call(C,z,this),(V=($=S(this,Bt).config).onSettled)==null||V.call($,this.state.data,z,this),z}finally{this.scheduleGc()}}},Ss=new WeakMap,En=new WeakMap,Cs=new WeakMap,Bt=new WeakMap,Pn=new WeakMap,nt=new WeakMap,Io=new WeakMap,_n=new WeakMap,Dt=new WeakSet,xh=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},wr=function(o){const i=u=>{switch(o.type){case"failed":return{...u,fetchFailureCount:o.failureCount,fetchFailureReason:o.error};case"pause":return{...u,fetchStatus:"paused"};case"continue":return{...u,fetchStatus:"fetching"};case"fetch":return{...u,...yh(u.data,this.options),fetchMeta:o.meta??null};case"success":const d={...u,...vp(o.data,o.dataUpdatedAt),dataUpdateCount:u.dataUpdateCount+1,...!o.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return oe(this,Cs,o.manual?d:void 0),d;case"error":const f=o.error;return{...u,error:f,errorUpdateCount:u.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:u.fetchFailureCount+1,fetchFailureReason:f,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...u,isInvalidated:!0};case"setState":return{...u,...o.state}}};this.state=i(this.state),lt.batch(()=>{this.observers.forEach(u=>{u.onQueryUpdate()}),S(this,Bt).notify({query:this,type:"updated",action:o})})},th);function yh(s,o){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:hh(o.networkMode)?"fetching":"paused",...s===void 0&&{error:null,status:"pending"}}}function vp(s,o){return{data:s,dataUpdatedAt:o??Date.now(),error:null,isInvalidated:!1,status:"success"}}function bp(s){const o=typeof s.initialData=="function"?s.initialData():s.initialData,i=o!==void 0,u=i?typeof s.initialDataUpdatedAt=="function"?s.initialDataUpdatedAt():s.initialDataUpdatedAt:0;return{data:o,dataUpdateCount:0,dataUpdatedAt:i?u??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var kt,Oe,Fo,gt,Mn,Es,jr,Xr,Uo,Ps,_s,Rn,On,en,Ms,Le,Po,Lu,Iu,Fu,Uu,$u,Bu,Hu,vh,rh,Fx=(rh=class extends Ho{constructor(o,i){super();be(this,Le);be(this,kt);be(this,Oe);be(this,Fo);be(this,gt);be(this,Mn);be(this,Es);be(this,jr);be(this,Xr);be(this,Uo);be(this,Ps);be(this,_s);be(this,Rn);be(this,On);be(this,en);be(this,Ms,new Set);this.options=i,oe(this,kt,o),oe(this,Xr,null),oe(this,jr,Au()),this.bindMethods(),this.setOptions(i)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(S(this,Oe).addObserver(this),wp(S(this,Oe),this.options)?_e(this,Le,Po).call(this):this.updateResult(),_e(this,Le,Uu).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Wu(S(this,Oe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Wu(S(this,Oe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,_e(this,Le,$u).call(this),_e(this,Le,Bu).call(this),S(this,Oe).removeObserver(this)}setOptions(o){const i=this.options,u=S(this,Oe);if(this.options=S(this,kt).defaultQueryOptions(o),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Tt(this.options.enabled,S(this,Oe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");_e(this,Le,Hu).call(this),S(this,Oe).setOptions(this.options),i._defaulted&&!Ou(this.options,i)&&S(this,kt).getQueryCache().notify({type:"observerOptionsUpdated",query:S(this,Oe),observer:this});const d=this.hasListeners();d&&jp(S(this,Oe),u,this.options,i)&&_e(this,Le,Po).call(this),this.updateResult(),d&&(S(this,Oe)!==u||Tt(this.options.enabled,S(this,Oe))!==Tt(i.enabled,S(this,Oe))||sn(this.options.staleTime,S(this,Oe))!==sn(i.staleTime,S(this,Oe)))&&_e(this,Le,Lu).call(this);const f=_e(this,Le,Iu).call(this);d&&(S(this,Oe)!==u||Tt(this.options.enabled,S(this,Oe))!==Tt(i.enabled,S(this,Oe))||f!==S(this,en))&&_e(this,Le,Fu).call(this,f)}getOptimisticResult(o){const i=S(this,kt).getQueryCache().build(S(this,kt),o),u=this.createResult(i,o);return $x(this,u)&&(oe(this,gt,u),oe(this,Es,this.options),oe(this,Mn,S(this,Oe).state)),u}getCurrentResult(){return S(this,gt)}trackResult(o,i){return new Proxy(o,{get:(u,d)=>(this.trackProp(d),i==null||i(d),d==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&S(this,jr).status==="pending"&&S(this,jr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(u,d))})}trackProp(o){S(this,Ms).add(o)}getCurrentQuery(){return S(this,Oe)}refetch({...o}={}){return this.fetch({...o})}fetchOptimistic(o){const i=S(this,kt).defaultQueryOptions(o),u=S(this,kt).getQueryCache().build(S(this,kt),i);return u.fetch().then(()=>this.createResult(u,i))}fetch(o){return _e(this,Le,Po).call(this,{...o,cancelRefetch:o.cancelRefetch??!0}).then(()=>(this.updateResult(),S(this,gt)))}createResult(o,i){var re;const u=S(this,Oe),d=this.options,f=S(this,gt),g=S(this,Mn),h=S(this,Es),x=o!==u?o.state:S(this,Fo),{state:b}=o;let j={...b},M=!1,O;if(i._optimisticResults){const ee=this.hasListeners(),ge=!ee&&wp(o,i),ue=ee&&jp(o,u,i,d);(ge||ue)&&(j={...j,...yh(b.data,o.options)}),i._optimisticResults==="isRestoring"&&(j.fetchStatus="idle")}let{error:A,errorUpdatedAt:w,status:C}=j;O=j.data;let _=!1;if(i.placeholderData!==void 0&&O===void 0&&C==="pending"){let ee;f!=null&&f.isPlaceholderData&&i.placeholderData===(h==null?void 0:h.placeholderData)?(ee=f.data,_=!0):ee=typeof i.placeholderData=="function"?i.placeholderData((re=S(this,_s))==null?void 0:re.state.data,S(this,_s)):i.placeholderData,ee!==void 0&&(C="success",O=Tu(f==null?void 0:f.data,ee,i),M=!0)}if(i.select&&O!==void 0&&!_)if(f&&O===(g==null?void 0:g.data)&&i.select===S(this,Uo))O=S(this,Ps);else try{oe(this,Uo,i.select),O=i.select(O),O=Tu(f==null?void 0:f.data,O,i),oe(this,Ps,O),oe(this,Xr,null)}catch(ee){oe(this,Xr,ee)}S(this,Xr)&&(A=S(this,Xr),O=S(this,Ps),w=Date.now(),C="error");const $=j.fetchStatus==="fetching",V=C==="pending",z=C==="error",L=V&&$,B=O!==void 0,te={status:C,fetchStatus:j.fetchStatus,isPending:V,isSuccess:C==="success",isError:z,isInitialLoading:L,isLoading:L,data:O,dataUpdatedAt:j.dataUpdatedAt,error:A,errorUpdatedAt:w,failureCount:j.fetchFailureCount,failureReason:j.fetchFailureReason,errorUpdateCount:j.errorUpdateCount,isFetched:o.isFetched(),isFetchedAfterMount:j.dataUpdateCount>x.dataUpdateCount||j.errorUpdateCount>x.errorUpdateCount,isFetching:$,isRefetching:$&&!V,isLoadingError:z&&!B,isPaused:j.fetchStatus==="paused",isPlaceholderData:M,isRefetchError:z&&B,isStale:uc(o,i),refetch:this.refetch,promise:S(this,jr),isEnabled:Tt(i.enabled,o)!==!1};if(this.options.experimental_prefetchInRender){const ee=te.data!==void 0,ge=te.status==="error"&&!ee,ue=De=>{ge?De.reject(te.error):ee&&De.resolve(te.data)},Ae=()=>{const De=oe(this,jr,te.promise=Au());ue(De)},Ee=S(this,jr);switch(Ee.status){case"pending":o.queryHash===u.queryHash&&ue(Ee);break;case"fulfilled":(ge||te.data!==Ee.value)&&Ae();break;case"rejected":(!ge||te.error!==Ee.reason)&&Ae();break}}return te}updateResult(){const o=S(this,gt),i=this.createResult(S(this,Oe),this.options);if(oe(this,Mn,S(this,Oe).state),oe(this,Es,this.options),S(this,Mn).data!==void 0&&oe(this,_s,S(this,Oe)),Ou(i,o))return;oe(this,gt,i);const u=()=>{if(!o)return!0;const{notifyOnChangeProps:d}=this.options,f=typeof d=="function"?d():d;if(f==="all"||!f&&!S(this,Ms).size)return!0;const g=new Set(f??S(this,Ms));return this.options.throwOnError&&g.add("error"),Object.keys(S(this,gt)).some(h=>{const v=h;return S(this,gt)[v]!==o[v]&&g.has(v)})};_e(this,Le,vh).call(this,{listeners:u()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&_e(this,Le,Uu).call(this)}},kt=new WeakMap,Oe=new WeakMap,Fo=new WeakMap,gt=new WeakMap,Mn=new WeakMap,Es=new WeakMap,jr=new WeakMap,Xr=new WeakMap,Uo=new WeakMap,Ps=new WeakMap,_s=new WeakMap,Rn=new WeakMap,On=new WeakMap,en=new WeakMap,Ms=new WeakMap,Le=new WeakSet,Po=function(o){_e(this,Le,Hu).call(this);let i=S(this,Oe).fetch(this.options,o);return o!=null&&o.throwOnError||(i=i.catch(Nt)),i},Lu=function(){_e(this,Le,$u).call(this);const o=sn(this.options.staleTime,S(this,Oe));if(Ro.isServer()||S(this,gt).isStale||!Ru(o))return;const u=ch(S(this,gt).dataUpdatedAt,o)+1;oe(this,Rn,Nn.setTimeout(()=>{S(this,gt).isStale||this.updateResult()},u))},Iu=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(S(this,Oe)):this.options.refetchInterval)??!1},Fu=function(o){_e(this,Le,Bu).call(this),oe(this,en,o),!(Ro.isServer()||Tt(this.options.enabled,S(this,Oe))===!1||!Ru(S(this,en))||S(this,en)===0)&&oe(this,On,Nn.setInterval(()=>{(this.options.refetchIntervalInBackground||lc.isFocused())&&_e(this,Le,Po).call(this)},S(this,en)))},Uu=function(){_e(this,Le,Lu).call(this),_e(this,Le,Fu).call(this,_e(this,Le,Iu).call(this))},$u=function(){S(this,Rn)!==void 0&&(Nn.clearTimeout(S(this,Rn)),oe(this,Rn,void 0))},Bu=function(){S(this,On)!==void 0&&(Nn.clearInterval(S(this,On)),oe(this,On,void 0))},Hu=function(){const o=S(this,kt).getQueryCache().build(S(this,kt),this.options);if(o===S(this,Oe))return;const i=S(this,Oe);oe(this,Oe,o),oe(this,Fo,o.state),this.hasListeners()&&(i==null||i.removeObserver(this),o.addObserver(this))},vh=function(o){lt.batch(()=>{o.listeners&&this.listeners.forEach(i=>{i(S(this,gt))}),S(this,kt).getQueryCache().notify({query:S(this,Oe),type:"observerResultsUpdated"})})},rh);function Ux(s,o){return Tt(o.enabled,s)!==!1&&s.state.data===void 0&&!(s.state.status==="error"&&Tt(o.retryOnMount,s)===!1)}function wp(s,o){return Ux(s,o)||s.state.data!==void 0&&Wu(s,o,o.refetchOnMount)}function Wu(s,o,i){if(Tt(o.enabled,s)!==!1&&sn(o.staleTime,s)!=="static"){const u=typeof i=="function"?i(s):i;return u==="always"||u!==!1&&uc(s,o)}return!1}function jp(s,o,i,u){return(s!==o||Tt(u.enabled,s)===!1)&&(!i.suspense||s.state.status!=="error")&&uc(s,i)}function uc(s,o){return Tt(o.enabled,s)!==!1&&s.isStaleByTime(sn(o.staleTime,s))}function $x(s,o){return!Ou(s.getCurrentResult(),o)}var $o,or,pt,Dn,lr,Qr,nh,Bx=(nh=class extends gh{constructor(o){super();be(this,lr);be(this,$o);be(this,or);be(this,pt);be(this,Dn);oe(this,$o,o.client),this.mutationId=o.mutationId,oe(this,pt,o.mutationCache),oe(this,or,[]),this.state=o.state||Hx(),this.setOptions(o.options),this.scheduleGc()}setOptions(o){this.options=o,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(o){S(this,or).includes(o)||(S(this,or).push(o),this.clearGcTimeout(),S(this,pt).notify({type:"observerAdded",mutation:this,observer:o}))}removeObserver(o){oe(this,or,S(this,or).filter(i=>i!==o)),this.scheduleGc(),S(this,pt).notify({type:"observerRemoved",mutation:this,observer:o})}optionalRemove(){S(this,or).length||(this.state.status==="pending"?this.scheduleGc():S(this,pt).remove(this))}continue(){var o;return((o=S(this,Dn))==null?void 0:o.continue())??this.execute(this.state.variables)}async execute(o){var g,h,v,x,b,j,M,O,A,w,C,_,$,V,z,L,B,J;const i=()=>{_e(this,lr,Qr).call(this,{type:"continue"})},u={client:S(this,$o),meta:this.options.meta,mutationKey:this.options.mutationKey};oe(this,Dn,mh({fn:()=>this.options.mutationFn?this.options.mutationFn(o,u):Promise.reject(new Error("No mutationFn found")),onFail:(te,re)=>{_e(this,lr,Qr).call(this,{type:"failed",failureCount:te,error:re})},onPause:()=>{_e(this,lr,Qr).call(this,{type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>S(this,pt).canRun(this)}));const d=this.state.status==="pending",f=!S(this,Dn).canStart();try{if(d)i();else{_e(this,lr,Qr).call(this,{type:"pending",variables:o,isPaused:f}),S(this,pt).config.onMutate&&await S(this,pt).config.onMutate(o,this,u);const re=await((h=(g=this.options).onMutate)==null?void 0:h.call(g,o,u));re!==this.state.context&&_e(this,lr,Qr).call(this,{type:"pending",context:re,variables:o,isPaused:f})}const te=await S(this,Dn).start();return await((x=(v=S(this,pt).config).onSuccess)==null?void 0:x.call(v,te,o,this.state.context,this,u)),await((j=(b=this.options).onSuccess)==null?void 0:j.call(b,te,o,this.state.context,u)),await((O=(M=S(this,pt).config).onSettled)==null?void 0:O.call(M,te,null,this.state.variables,this.state.context,this,u)),await((w=(A=this.options).onSettled)==null?void 0:w.call(A,te,null,o,this.state.context,u)),_e(this,lr,Qr).call(this,{type:"success",data:te}),te}catch(te){try{await((_=(C=S(this,pt).config).onError)==null?void 0:_.call(C,te,o,this.state.context,this,u))}catch(re){Promise.reject(re)}try{await((V=($=this.options).onError)==null?void 0:V.call($,te,o,this.state.context,u))}catch(re){Promise.reject(re)}try{await((L=(z=S(this,pt).config).onSettled)==null?void 0:L.call(z,void 0,te,this.state.variables,this.state.context,this,u))}catch(re){Promise.reject(re)}try{await((J=(B=this.options).onSettled)==null?void 0:J.call(B,void 0,te,o,this.state.context,u))}catch(re){Promise.reject(re)}throw _e(this,lr,Qr).call(this,{type:"error",error:te}),te}finally{S(this,pt).runNext(this)}}},$o=new WeakMap,or=new WeakMap,pt=new WeakMap,Dn=new WeakMap,lr=new WeakSet,Qr=function(o){const i=u=>{switch(o.type){case"failed":return{...u,failureCount:o.failureCount,failureReason:o.error};case"pause":return{...u,isPaused:!0};case"continue":return{...u,isPaused:!1};case"pending":return{...u,context:o.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:o.isPaused,status:"pending",variables:o.variables,submittedAt:Date.now()};case"success":return{...u,data:o.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...u,data:void 0,error:o.error,failureCount:u.failureCount+1,failureReason:o.error,isPaused:!1,status:"error"}}};this.state=i(this.state),lt.batch(()=>{S(this,or).forEach(u=>{u.onMutationUpdate(o)}),S(this,pt).notify({mutation:this,type:"updated",action:o})})},nh);function Hx(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var kr,Yt,Bo,sh,Wx=(sh=class extends Ho{constructor(o={}){super();be(this,kr);be(this,Yt);be(this,Bo);this.config=o,oe(this,kr,new Set),oe(this,Yt,new Map),oe(this,Bo,0)}build(o,i,u){const d=new Bx({client:o,mutationCache:this,mutationId:++Xl(this,Bo)._,options:o.defaultMutationOptions(i),state:u});return this.add(d),d}add(o){S(this,kr).add(o);const i=ti(o);if(typeof i=="string"){const u=S(this,Yt).get(i);u?u.push(o):S(this,Yt).set(i,[o])}this.notify({type:"added",mutation:o})}remove(o){if(S(this,kr).delete(o)){const i=ti(o);if(typeof i=="string"){const u=S(this,Yt).get(i);if(u)if(u.length>1){const d=u.indexOf(o);d!==-1&&u.splice(d,1)}else u[0]===o&&S(this,Yt).delete(i)}}this.notify({type:"removed",mutation:o})}canRun(o){const i=ti(o);if(typeof i=="string"){const u=S(this,Yt).get(i),d=u==null?void 0:u.find(f=>f.state.status==="pending");return!d||d===o}else return!0}runNext(o){var u;const i=ti(o);if(typeof i=="string"){const d=(u=S(this,Yt).get(i))==null?void 0:u.find(f=>f!==o&&f.state.isPaused);return(d==null?void 0:d.continue())??Promise.resolve()}else return Promise.resolve()}clear(){lt.batch(()=>{S(this,kr).forEach(o=>{this.notify({type:"removed",mutation:o})}),S(this,kr).clear(),S(this,Yt).clear()})}getAll(){return Array.from(S(this,kr))}find(o){const i={exact:!0,...o};return this.getAll().find(u=>mp(i,u))}findAll(o={}){return this.getAll().filter(i=>mp(o,i))}notify(o){lt.batch(()=>{this.listeners.forEach(i=>{i(o)})})}resumePausedMutations(){const o=this.getAll().filter(i=>i.state.isPaused);return lt.batch(()=>Promise.all(o.map(i=>i.continue().catch(Nt))))}},kr=new WeakMap,Yt=new WeakMap,Bo=new WeakMap,sh);function ti(s){var o;return(o=s.options.scope)==null?void 0:o.id}var ir,oh,Vx=(oh=class extends Ho{constructor(o={}){super();be(this,ir);this.config=o,oe(this,ir,new Map)}build(o,i,u){const d=i.queryKey,f=i.queryHash??ic(d,i);let g=this.get(f);return g||(g=new Ix({client:o,queryKey:d,queryHash:f,options:o.defaultQueryOptions(i),state:u,defaultOptions:o.getQueryDefaults(d)}),this.add(g)),g}add(o){S(this,ir).has(o.queryHash)||(S(this,ir).set(o.queryHash,o),this.notify({type:"added",query:o}))}remove(o){const i=S(this,ir).get(o.queryHash);i&&(o.destroy(),i===o&&S(this,ir).delete(o.queryHash),this.notify({type:"removed",query:o}))}clear(){lt.batch(()=>{this.getAll().forEach(o=>{this.remove(o)})})}get(o){return S(this,ir).get(o)}getAll(){return[...S(this,ir).values()]}find(o){const i={exact:!0,...o};return this.getAll().find(u=>hp(i,u))}findAll(o={}){const i=this.getAll();return Object.keys(o).length>0?i.filter(u=>hp(o,u)):i}notify(o){lt.batch(()=>{this.listeners.forEach(i=>{i(o)})})}onFocus(){lt.batch(()=>{this.getAll().forEach(o=>{o.onFocus()})})}onOnline(){lt.batch(()=>{this.getAll().forEach(o=>{o.onOnline()})})}},ir=new WeakMap,oh),Qe,tn,rn,Rs,Os,nn,Ds,Ts,lh,Gx=(lh=class{constructor(s={}){be(this,Qe);be(this,tn);be(this,rn);be(this,Rs);be(this,Os);be(this,nn);be(this,Ds);be(this,Ts);oe(this,Qe,s.queryCache||new Vx),oe(this,tn,s.mutationCache||new Wx),oe(this,rn,s.defaultOptions||{}),oe(this,Rs,new Map),oe(this,Os,new Map),oe(this,nn,0)}mount(){Xl(this,nn)._++,S(this,nn)===1&&(oe(this,Ds,lc.subscribe(async s=>{s&&(await this.resumePausedMutations(),S(this,Qe).onFocus())})),oe(this,Ts,hi.subscribe(async s=>{s&&(await this.resumePausedMutations(),S(this,Qe).onOnline())})))}unmount(){var s,o;Xl(this,nn)._--,S(this,nn)===0&&((s=S(this,Ds))==null||s.call(this),oe(this,Ds,void 0),(o=S(this,Ts))==null||o.call(this),oe(this,Ts,void 0))}isFetching(s){return S(this,Qe).findAll({...s,fetchStatus:"fetching"}).length}isMutating(s){return S(this,tn).findAll({...s,status:"pending"}).length}getQueryData(s){var i;const o=this.defaultQueryOptions({queryKey:s});return(i=S(this,Qe).get(o.queryHash))==null?void 0:i.state.data}ensureQueryData(s){const o=this.defaultQueryOptions(s),i=S(this,Qe).build(this,o),u=i.state.data;return u===void 0?this.fetchQuery(s):(s.revalidateIfStale&&i.isStaleByTime(sn(o.staleTime,i))&&this.prefetchQuery(o),Promise.resolve(u))}getQueriesData(s){return S(this,Qe).findAll(s).map(({queryKey:o,state:i})=>{const u=i.data;return[o,u]})}setQueryData(s,o,i){const u=this.defaultQueryOptions({queryKey:s}),d=S(this,Qe).get(u.queryHash),f=d==null?void 0:d.state.data,g=Cx(o,f);if(g!==void 0)return S(this,Qe).build(this,u).setData(g,{...i,manual:!0})}setQueriesData(s,o,i){return lt.batch(()=>S(this,Qe).findAll(s).map(({queryKey:u})=>[u,this.setQueryData(u,o,i)]))}getQueryState(s){var i;const o=this.defaultQueryOptions({queryKey:s});return(i=S(this,Qe).get(o.queryHash))==null?void 0:i.state}removeQueries(s){const o=S(this,Qe);lt.batch(()=>{o.findAll(s).forEach(i=>{o.remove(i)})})}resetQueries(s,o){const i=S(this,Qe);return lt.batch(()=>(i.findAll(s).forEach(u=>{u.reset()}),this.refetchQueries({type:"active",...s},o)))}cancelQueries(s,o={}){const i={revert:!0,...o},u=lt.batch(()=>S(this,Qe).findAll(s).map(d=>d.cancel(i)));return Promise.all(u).then(Nt).catch(Nt)}invalidateQueries(s,o={}){return lt.batch(()=>(S(this,Qe).findAll(s).forEach(i=>{i.invalidate()}),(s==null?void 0:s.refetchType)==="none"?Promise.resolve():this.refetchQueries({...s,type:(s==null?void 0:s.refetchType)??(s==null?void 0:s.type)??"active"},o)))}refetchQueries(s,o={}){const i={...o,cancelRefetch:o.cancelRefetch??!0},u=lt.batch(()=>S(this,Qe).findAll(s).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let f=d.fetch(void 0,i);return i.throwOnError||(f=f.catch(Nt)),d.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(u).then(Nt)}fetchQuery(s){const o=this.defaultQueryOptions(s);o.retry===void 0&&(o.retry=!1);const i=S(this,Qe).build(this,o);return i.isStaleByTime(sn(o.staleTime,i))?i.fetch(o):Promise.resolve(i.state.data)}prefetchQuery(s){return this.fetchQuery(s).then(Nt).catch(Nt)}fetchInfiniteQuery(s){return s._type="infinite",this.fetchQuery(s)}prefetchInfiniteQuery(s){return this.fetchInfiniteQuery(s).then(Nt).catch(Nt)}ensureInfiniteQueryData(s){return s._type="infinite",this.ensureQueryData(s)}resumePausedMutations(){return hi.isOnline()?S(this,tn).resumePausedMutations():Promise.resolve()}getQueryCache(){return S(this,Qe)}getMutationCache(){return S(this,tn)}getDefaultOptions(){return S(this,rn)}setDefaultOptions(s){oe(this,rn,s)}setQueryDefaults(s,o){S(this,Rs).set(_o(s),{queryKey:s,defaultOptions:o})}getQueryDefaults(s){const o=[...S(this,Rs).values()],i={};return o.forEach(u=>{Mo(s,u.queryKey)&&Object.assign(i,u.defaultOptions)}),i}setMutationDefaults(s,o){S(this,Os).set(_o(s),{mutationKey:s,defaultOptions:o})}getMutationDefaults(s){const o=[...S(this,Os).values()],i={};return o.forEach(u=>{Mo(s,u.mutationKey)&&Object.assign(i,u.defaultOptions)}),i}defaultQueryOptions(s){if(s._defaulted)return s;const o={...S(this,rn).queries,...this.getQueryDefaults(s.queryKey),...s,_defaulted:!0};return o.queryHash||(o.queryHash=ic(o.queryKey,o)),o.refetchOnReconnect===void 0&&(o.refetchOnReconnect=o.networkMode!=="always"),o.throwOnError===void 0&&(o.throwOnError=!!o.suspense),!o.networkMode&&o.persister&&(o.networkMode="offlineFirst"),o.queryFn===ac&&(o.enabled=!1),o}defaultMutationOptions(s){return s!=null&&s._defaulted?s:{...S(this,rn).mutations,...(s==null?void 0:s.mutationKey)&&this.getMutationDefaults(s.mutationKey),...s,_defaulted:!0}}clear(){S(this,Qe).clear(),S(this,tn).clear()}},Qe=new WeakMap,tn=new WeakMap,rn=new WeakMap,Rs=new WeakMap,Os=new WeakMap,nn=new WeakMap,Ds=new WeakMap,Ts=new WeakMap,lh),bh=m.createContext(void 0),cc=s=>{const o=m.useContext(bh);if(!o)throw new Error("No QueryClient set, use QueryClientProvider to set one");return o},Kx=({client:s,children:o})=>(m.useEffect(()=>(s.mount(),()=>{s.unmount()}),[s]),n.jsx(bh.Provider,{value:s,children:o})),wh=m.createContext(!1),Qx=()=>m.useContext(wh);wh.Provider;function qx(){let s=!1;return{clearReset:()=>{s=!1},reset:()=>{s=!0},isReset:()=>s}}var Zx=m.createContext(qx()),Yx=()=>m.useContext(Zx),Jx=(s,o,i)=>{const u=i!=null&&i.state.error&&typeof s.throwOnError=="function"?ph(s.throwOnError,[i.state.error,i]):s.throwOnError;(s.suspense||s.experimental_prefetchInRender||u)&&(o.isReset()||(s.retryOnMount=!1))},Xx=s=>{m.useEffect(()=>{s.clearReset()},[s])},e0=({result:s,errorResetBoundary:o,throwOnError:i,query:u,suspense:d})=>s.isError&&!o.isReset()&&!s.isFetching&&u&&(d&&s.data===void 0||ph(i,[s.error,u])),t0=s=>{if(s.suspense){const i=d=>d==="static"?d:Math.max(d??1e3,1e3),u=s.staleTime;s.staleTime=typeof u=="function"?(...d)=>i(u(...d)):i(u),typeof s.gcTime=="number"&&(s.gcTime=Math.max(s.gcTime,1e3))}},r0=(s,o)=>s.isLoading&&s.isFetching&&!o,n0=(s,o)=>(s==null?void 0:s.suspense)&&o.isPending,kp=(s,o,i)=>o.fetchOptimistic(s).catch(()=>{i.clearReset()});function s0(s,o,i){var O,A,w,C;const u=Qx(),d=Yx(),f=cc(),g=f.defaultQueryOptions(s);(A=(O=f.getDefaultOptions().queries)==null?void 0:O._experimental_beforeQuery)==null||A.call(O,g);const h=f.getQueryCache().get(g.queryHash),v=s.subscribed!==!1;g._optimisticResults=u?"isRestoring":v?"optimistic":void 0,t0(g),Jx(g,d,h),Xx(d);const x=!f.getQueryCache().get(g.queryHash),[b]=m.useState(()=>new o(f,g)),j=b.getOptimisticResult(g),M=!u&&v;if(m.useSyncExternalStore(m.useCallback(_=>{const $=M?b.subscribe(lt.batchCalls(_)):Nt;return b.updateResult(),$},[b,M]),()=>b.getCurrentResult(),()=>b.getCurrentResult()),m.useEffect(()=>{b.setOptions(g)},[g,b]),n0(g,j))throw kp(g,b,d);if(e0({result:j,errorResetBoundary:d,throwOnError:g.throwOnError,query:h,suspense:g.suspense}))throw j.error;if((C=(w=f.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||C.call(w,g,j),g.experimental_prefetchInRender&&!Ro.isServer()&&r0(j,u)){const _=x?kp(g,b,d):h==null?void 0:h.promise;_==null||_.catch(Nt).finally(()=>{b.updateResult()})}return g.notifyOnChangeProps?j:b.trackResult(j)}function Fn(s,o){return s0(s,Fx)}/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const o0=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),jh=(...s)=>s.filter((o,i,u)=>!!o&&o.trim()!==""&&u.indexOf(o)===i).join(" ").trim();/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var l0={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.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const i0=m.forwardRef(({color:s="currentColor",size:o=24,strokeWidth:i=2,absoluteStrokeWidth:u,className:d="",children:f,iconNode:g,...h},v)=>m.createElement("svg",{ref:v,...l0,width:o,height:o,stroke:s,strokeWidth:u?Number(i)*24/Number(o):i,className:jh("lucide",d),...h},[...g.map(([x,b])=>m.createElement(x,b)),...Array.isArray(f)?f:[f]]));/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const je=(s,o)=>{const i=m.forwardRef(({className:u,...d},f)=>m.createElement(i0,{ref:f,iconNode:o,className:jh(`lucide-${o0(s)}`,u),...d}));return i.displayName=`${s}`,i};/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mi=je("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.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Np=je("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
* @license lucide-react v0.460.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=je("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.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Oo=je("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.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const a0=je("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Do=je("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.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const As=je("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const u0=je("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const c0=je("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const d0=je("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const f0=je("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const p0=je("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const h0=je("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
* @license lucide-react v0.460.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=je("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const m0=je("Coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const g0=je("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/**
* @license lucide-react v0.460.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=je("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const x0=je("Construction",[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Nh=je("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const At=je("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.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const An=je("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gi=je("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Sp=je("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ku=je("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const y0=je("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const v0=je("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.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Qu=je("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const b0=je("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.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const w0=je("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const To=je("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const j0=je("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const k0=je("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const N0=je("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.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Sh=je("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ch=je("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Tn=je("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.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const S0=je("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const C0=je("Scroll",[["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const dc=je("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const E0=je("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.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const P0=je("ShieldAlert",[["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:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zn=je("Shield",[["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"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _0=je("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Eh=je("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.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const M0=je("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xi=je("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qu=je("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.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const R0=je("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.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const O0=je("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const yi=je("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
* @license lucide-react v0.460.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ln=je("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Zu=[{id:"dashboard",label:"Zentrale",hint:"System- & Stack-Status",icon:j0},{id:"models",label:"Modell-Manager",hint:"Verwalten, laden & Gateway-Routing",icon:a0},{id:"system",label:"Diagnose",hint:"Metriken, Dienste, Logs",icon:At},{id:"memory",label:"Gedächtnis",hint:"Geteiltes Memory verwalten",icon:Do},{id:"connect",label:"Verbinden",hint:"IDE-/Agent-Configs erzeugen",icon:N0},{id:"agent",label:"Hermes",hint:"Agent-Status & WebUI öffnen",icon:Oo},{id:"guide",label:"Anleitung",hint:"Einrichten & Vibe-Coding",icon:p0}];var Cp=1,D0=.9,T0=.8,A0=.17,vu=.1,bu=.999,z0=.9999,L0=.99,I0=/[\\\/_+.#"@\[\(\{&]/,F0=/[\\\/_+.#"@\[\(\{&]/g,U0=/[\s-]/,Ph=/[\s-]/g;function Yu(s,o,i,u,d,f,g){if(f===o.length)return d===s.length?Cp:L0;var h=`${d},${f}`;if(g[h]!==void 0)return g[h];for(var v=u.charAt(f),x=i.indexOf(v,d),b=0,j,M,O,A;x>=0;)j=Yu(s,o,i,u,x+1,f+1,g),j>b&&(x===d?j*=Cp:I0.test(s.charAt(x-1))?(j*=T0,O=s.slice(d,x-1).match(F0),O&&d>0&&(j*=Math.pow(bu,O.length))):U0.test(s.charAt(x-1))?(j*=D0,A=s.slice(d,x-1).match(Ph),A&&d>0&&(j*=Math.pow(bu,A.length))):(j*=A0,d>0&&(j*=Math.pow(bu,x-d))),s.charAt(x)!==o.charAt(f)&&(j*=z0)),(j<vu&&i.charAt(x-1)===u.charAt(f+1)||u.charAt(f+1)===u.charAt(f)&&i.charAt(x-1)!==u.charAt(f))&&(M=Yu(s,o,i,u,x+1,f+2,g),M*vu>j&&(j=M*vu)),j>b&&(b=j),x=i.indexOf(v,x+1);return g[h]=b,b}function Ep(s){return s.toLowerCase().replace(Ph," ")}function $0(s,o,i){return s=i&&i.length>0?`${s+" "+i.join(" ")}`:s,Yu(s,o,Ep(s),Ep(o),0,0,{})}function on(s,o,{checkForDefaultPrevented:i=!0}={}){return function(d){if(s==null||s(d),i===!1||!d.defaultPrevented)return o==null?void 0:o(d)}}function Pp(s,o){if(typeof s=="function")return s(o);s!=null&&(s.current=o)}function zs(...s){return o=>{let i=!1;const u=s.map(d=>{const f=Pp(d,o);return!i&&typeof f=="function"&&(i=!0),f});if(i)return()=>{for(let d=0;d<u.length;d++){const f=u[d];typeof f=="function"?f():Pp(s[d],null)}}}}function Un(...s){return m.useCallback(zs(...s),s)}function B0(s,o=[]){let i=[];function u(f,g){const h=m.createContext(g);h.displayName=f+"Context";const v=i.length;i=[...i,g];const x=j=>{var _;const{scope:M,children:O,...A}=j,w=((_=M==null?void 0:M[s])==null?void 0:_[v])||h,C=m.useMemo(()=>A,Object.values(A));return n.jsx(w.Provider,{value:C,children:O})};x.displayName=f+"Provider";function b(j,M){var w;const O=((w=M==null?void 0:M[s])==null?void 0:w[v])||h,A=m.useContext(O);if(A)return A;if(g!==void 0)return g;throw new Error(`\`${j}\` must be used within \`${f}\``)}return[x,b]}const d=()=>{const f=i.map(g=>m.createContext(g));return function(h){const v=(h==null?void 0:h[s])||f;return m.useMemo(()=>({[`__scope${s}`]:{...h,[s]:v}}),[h,v])}};return d.scopeName=s,[u,H0(d,...o)]}function H0(...s){const o=s[0];if(s.length===1)return o;const i=()=>{const u=s.map(d=>({useScope:d(),scopeName:d.scopeName}));return function(f){const g=u.reduce((h,{useScope:v,scopeName:x})=>{const j=v(f)[`__scope${x}`];return{...h,...j}},{});return m.useMemo(()=>({[`__scope${o.scopeName}`]:g}),[g])}};return i.scopeName=o.scopeName,i}var Ao=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},W0=oc[" useId ".trim().toString()]||(()=>{}),V0=0;function Nr(s){const[o,i]=m.useState(W0());return Ao(()=>{i(u=>u??String(V0++))},[s]),o?`radix-${o}`:""}var G0=oc[" useInsertionEffect ".trim().toString()]||Ao;function K0({prop:s,defaultProp:o,onChange:i=()=>{},caller:u}){const[d,f,g]=Q0({defaultProp:o,onChange:i}),h=s!==void 0,v=h?s:d;{const b=m.useRef(s!==void 0);m.useEffect(()=>{const j=b.current;j!==h&&console.warn(`${u} is changing from ${j?"controlled":"uncontrolled"} to ${h?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),b.current=h},[h,u])}const x=m.useCallback(b=>{var j;if(h){const M=q0(b)?b(s):b;M!==s&&((j=g.current)==null||j.call(g,M))}else f(b)},[h,s,f,g]);return[v,x]}function Q0({defaultProp:s,onChange:o}){const[i,u]=m.useState(s),d=m.useRef(i),f=m.useRef(o);return G0(()=>{f.current=o},[o]),m.useEffect(()=>{var g;d.current!==i&&((g=f.current)==null||g.call(f,i),d.current=i)},[i,d]),[i,u,f]}function q0(s){return typeof s=="function"}var _h=uh();function Mh(s){const o=m.forwardRef((i,u)=>{let{children:d,...f}=i,g=null,h=!1;const v=[];_p(d)&&typeof ri=="function"&&(d=ri(d._payload)),m.Children.forEach(d,M=>{var O;if(ey(M)){h=!0;const A=M;let w="child"in A.props?A.props.child:A.props.children;_p(w)&&typeof ri=="function"&&(w=ri(w._payload)),g=Y0(A,w),v.push((O=g==null?void 0:g.props)==null?void 0:O.children)}else v.push(M)}),g?g=m.cloneElement(g,void 0,v):!h&&m.Children.count(d)===1&&m.isValidElement(d)&&(g=d);const x=g?X0(g):void 0,b=Un(u,x);if(!g){if(d||d===0)throw new Error(h?sy(s):ny(s));return d}const j=J0(f,g.props??{});return g.type!==m.Fragment&&(j.ref=u?b:x),m.cloneElement(g,j)});return o.displayName=`${s}.Slot`,o}var Z0=Symbol.for("radix.slottable"),Y0=(s,o)=>{if("child"in s.props){const i=s.props.child;return m.isValidElement(i)?m.cloneElement(i,void 0,s.props.children(i.props.children)):null}return m.isValidElement(o)?o:null};function J0(s,o){const i={...o};for(const u in o){const d=s[u],f=o[u];/^on[A-Z]/.test(u)?d&&f?i[u]=(...h)=>{const v=f(...h);return d(...h),v}:d&&(i[u]=d):u==="style"?i[u]={...d,...f}:u==="className"&&(i[u]=[d,f].filter(Boolean).join(" "))}return{...s,...i}}function X0(s){var u,d;let o=(u=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:u.get,i=o&&"isReactWarning"in o&&o.isReactWarning;return i?s.ref:(o=(d=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:d.get,i=o&&"isReactWarning"in o&&o.isReactWarning,i?s.props.ref:s.props.ref||s.ref)}function ey(s){return m.isValidElement(s)&&typeof s.type=="function"&&"__radixId"in s.type&&s.type.__radixId===Z0}var ty=Symbol.for("react.lazy");function _p(s){return s!=null&&typeof s=="object"&&"$$typeof"in s&&s.$$typeof===ty&&"_payload"in s&&ry(s._payload)}function ry(s){return typeof s=="object"&&s!==null&&"then"in s}var ny=s=>`${s} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,sy=s=>`${s} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,ri=oc[" use ".trim().toString()],oy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],it=oy.reduce((s,o)=>{const i=Mh(`Primitive.${o}`),u=m.forwardRef((d,f)=>{const{asChild:g,...h}=d,v=g?i:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(v,{...h,ref:f})});return u.displayName=`Primitive.${o}`,{...s,[o]:u}},{});function ly(s,o){s&&_h.flushSync(()=>s.dispatchEvent(o))}function zo(s){const o=m.useRef(s);return m.useEffect(()=>{o.current=s}),m.useMemo(()=>((...i)=>{var u;return(u=o.current)==null?void 0:u.call(o,...i)}),[])}function iy(s,o=globalThis==null?void 0:globalThis.document){const i=zo(s);m.useEffect(()=>{const u=d=>{d.key==="Escape"&&i(d)};return o.addEventListener("keydown",u,{capture:!0}),()=>o.removeEventListener("keydown",u,{capture:!0})},[i,o])}var ay="DismissableLayer",Ju="dismissableLayer.update",uy="dismissableLayer.pointerDownOutside",cy="dismissableLayer.focusOutside",Mp,fc=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Rh=m.forwardRef((s,o)=>{const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:u=!1,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:g,onInteractOutside:h,onDismiss:v,...x}=s,b=m.useContext(fc),[j,M]=m.useState(null),O=(j==null?void 0:j.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,A]=m.useState({}),w=Un(o,re=>M(re)),C=Array.from(b.layers),[_]=[...b.layersWithOutsidePointerEventsDisabled].slice(-1),$=C.indexOf(_),V=j?C.indexOf(j):-1,z=b.layersWithOutsidePointerEventsDisabled.size>0,L=V>=$,B=m.useRef(!1),J=hy(re=>{const ee=re.target;if(!(ee instanceof Node))return;const ge=[...b.branches].some(ue=>ue.contains(ee));!L||ge||(f==null||f(re),h==null||h(re),re.defaultPrevented||v==null||v())},{ownerDocument:O,deferPointerDownOutside:u,isDeferredPointerDownOutsideRef:B,dismissableSurfaces:b.dismissableSurfaces}),te=my(re=>{if(u&&B.current)return;const ee=re.target;[...b.branches].some(ue=>ue.contains(ee))||(g==null||g(re),h==null||h(re),re.defaultPrevented||v==null||v())},O);return iy(re=>{V===b.layers.size-1&&(d==null||d(re),!re.defaultPrevented&&v&&(re.preventDefault(),v()))},O),m.useEffect(()=>{if(j)return i&&(b.layersWithOutsidePointerEventsDisabled.size===0&&(Mp=O.body.style.pointerEvents,O.body.style.pointerEvents="none"),b.layersWithOutsidePointerEventsDisabled.add(j)),b.layers.add(j),Rp(),()=>{i&&(b.layersWithOutsidePointerEventsDisabled.delete(j),b.layersWithOutsidePointerEventsDisabled.size===0&&(O.body.style.pointerEvents=Mp))}},[j,O,i,b]),m.useEffect(()=>()=>{j&&(b.layers.delete(j),b.layersWithOutsidePointerEventsDisabled.delete(j),Rp())},[j,b]),m.useEffect(()=>{const re=()=>A({});return document.addEventListener(Ju,re),()=>document.removeEventListener(Ju,re)},[]),n.jsx(it.div,{...x,ref:w,style:{pointerEvents:z?L?"auto":"none":void 0,...s.style},onFocusCapture:on(s.onFocusCapture,te.onFocusCapture),onBlurCapture:on(s.onBlurCapture,te.onBlurCapture),onPointerDownCapture:on(s.onPointerDownCapture,J.onPointerDownCapture)})});Rh.displayName=ay;var dy="DismissableLayerBranch",fy=m.forwardRef((s,o)=>{const i=m.useContext(fc),u=m.useRef(null),d=Un(o,u);return m.useEffect(()=>{const f=u.current;if(f)return i.branches.add(f),()=>{i.branches.delete(f)}},[i.branches]),n.jsx(it.div,{...s,ref:d})});fy.displayName=dy;function py(){const s=m.useContext(fc),[o,i]=m.useState(null);return m.useEffect(()=>{if(o)return s.dismissableSurfaces.add(o),()=>{s.dismissableSurfaces.delete(o)}},[o,s.dismissableSurfaces]),i}function hy(s,o){const{ownerDocument:i=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:u=!1,isDeferredPointerDownOutsideRef:d,dismissableSurfaces:f}=o,g=zo(s),h=m.useRef(!1),v=m.useRef(!1),x=m.useRef(new Map),b=m.useRef(()=>{});return m.useEffect(()=>{function j(){v.current=!1,d.current=!1,x.current.clear()}function M(){return Array.from(x.current.values()).some(Boolean)}function O($){if(!v.current)return;const V=$.target;V instanceof Node&&[...f].some(L=>L.contains(V))||x.current.set($.type,!0),$.type==="click"&&window.setTimeout(()=>{v.current&&b.current()},0)}function A($){v.current&&x.current.set($.type,!1)}const w=$=>{if($.target&&!h.current){let V=function(){i.removeEventListener("click",b.current);const L=M();j(),L||Oh(uy,g,z,{discrete:!0})};const z={originalEvent:$};v.current=!0,d.current=u&&$.button===0,x.current.clear(),!u||$.button!==0?V():(i.removeEventListener("click",b.current),b.current=V,i.addEventListener("click",b.current,{once:!0}))}else i.removeEventListener("click",b.current),j();h.current=!1},C=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const $ of C)i.addEventListener($,O,!0),i.addEventListener($,A);const _=window.setTimeout(()=>{i.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(_),i.removeEventListener("pointerdown",w),i.removeEventListener("click",b.current);for(const $ of C)i.removeEventListener($,O,!0),i.removeEventListener($,A)}},[i,g,u,d,f]),{onPointerDownCapture:()=>h.current=!0}}function my(s,o=globalThis==null?void 0:globalThis.document){const i=zo(s),u=m.useRef(!1);return m.useEffect(()=>{const d=f=>{f.target&&!u.current&&Oh(cy,i,{originalEvent:f},{discrete:!1})};return o.addEventListener("focusin",d),()=>o.removeEventListener("focusin",d)},[o,i]),{onFocusCapture:()=>u.current=!0,onBlurCapture:()=>u.current=!1}}function Rp(){const s=new CustomEvent(Ju);document.dispatchEvent(s)}function Oh(s,o,i,{discrete:u}){const d=i.originalEvent.target,f=new CustomEvent(s,{bubbles:!1,cancelable:!0,detail:i});o&&d.addEventListener(s,o,{once:!0}),u?ly(d,f):d.dispatchEvent(f)}var wu="focusScope.autoFocusOnMount",ju="focusScope.autoFocusOnUnmount",Op={bubbles:!1,cancelable:!0},gy="FocusScope",Dh=m.forwardRef((s,o)=>{const{loop:i=!1,trapped:u=!1,onMountAutoFocus:d,onUnmountAutoFocus:f,...g}=s,[h,v]=m.useState(null),x=zo(d),b=zo(f),j=m.useRef(null),M=Un(o,w=>v(w)),O=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(u){let w=function(V){if(O.paused||!h)return;const z=V.target;h.contains(z)?j.current=z:qr(j.current,{select:!0})},C=function(V){if(O.paused||!h)return;const z=V.relatedTarget;z!==null&&(h.contains(z)||qr(j.current,{select:!0}))},_=function(V){if(document.activeElement===document.body)for(const L of V)L.removedNodes.length>0&&qr(h)};document.addEventListener("focusin",w),document.addEventListener("focusout",C);const $=new MutationObserver(_);return h&&$.observe(h,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",C),$.disconnect()}}},[u,h,O.paused]),m.useEffect(()=>{if(h){Tp.add(O);const w=document.activeElement;if(!h.contains(w)){const _=new CustomEvent(wu,Op);h.addEventListener(wu,x),h.dispatchEvent(_),_.defaultPrevented||(xy(jy(Th(h)),{select:!0}),document.activeElement===w&&qr(h))}return()=>{h.removeEventListener(wu,x),setTimeout(()=>{const _=new CustomEvent(ju,Op);h.addEventListener(ju,b),h.dispatchEvent(_),_.defaultPrevented||qr(w??document.body,{select:!0}),h.removeEventListener(ju,b),Tp.remove(O)},0)}}},[h,x,b,O]);const A=m.useCallback(w=>{if(!i&&!u||O.paused)return;const C=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,_=document.activeElement;if(C&&_){const $=w.currentTarget,[V,z]=yy($);V&&z?!w.shiftKey&&_===z?(w.preventDefault(),i&&qr(V,{select:!0})):w.shiftKey&&_===V&&(w.preventDefault(),i&&qr(z,{select:!0})):_===$&&w.preventDefault()}},[i,u,O.paused]);return n.jsx(it.div,{tabIndex:-1,...g,ref:M,onKeyDown:A})});Dh.displayName=gy;function xy(s,{select:o=!1}={}){const i=document.activeElement;for(const u of s)if(qr(u,{select:o}),document.activeElement!==i)return}function yy(s){const o=Th(s),i=Dp(o,s),u=Dp(o.reverse(),s);return[i,u]}function Th(s){const o=[],i=document.createTreeWalker(s,NodeFilter.SHOW_ELEMENT,{acceptNode:u=>{const d=u.tagName==="INPUT"&&u.type==="hidden";return u.disabled||u.hidden||d?NodeFilter.FILTER_SKIP:u.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)o.push(i.currentNode);return o}function Dp(s,o){for(const i of s)if(!vy(i,{upTo:o}))return i}function vy(s,{upTo:o}){if(getComputedStyle(s).visibility==="hidden")return!0;for(;s;){if(o!==void 0&&s===o)return!1;if(getComputedStyle(s).display==="none")return!0;s=s.parentElement}return!1}function by(s){return s instanceof HTMLInputElement&&"select"in s}function qr(s,{select:o=!1}={}){if(s&&s.focus){const i=document.activeElement;s.focus({preventScroll:!0}),s!==i&&by(s)&&o&&s.select()}}var Tp=wy();function wy(){let s=[];return{add(o){const i=s[0];o!==i&&(i==null||i.pause()),s=Ap(s,o),s.unshift(o)},remove(o){var i;s=Ap(s,o),(i=s[0])==null||i.resume()}}}function Ap(s,o){const i=[...s],u=i.indexOf(o);return u!==-1&&i.splice(u,1),i}function jy(s){return s.filter(o=>o.tagName!=="A")}var ky="Portal",Ah=m.forwardRef((s,o)=>{var h;const{container:i,...u}=s,[d,f]=m.useState(!1);Ao(()=>f(!0),[]);const g=i||d&&((h=globalThis==null?void 0:globalThis.document)==null?void 0:h.body);return g?_h.createPortal(n.jsx(it.div,{...u,ref:o}),g):null});Ah.displayName=ky;function Ny(s,o){return m.useReducer((i,u)=>o[i][u]??i,s)}var bi=s=>{const{present:o,children:i}=s,u=Sy(o),d=typeof i=="function"?i({present:u.isPresent}):m.Children.only(i),f=Cy(u.ref,Ey(d));return typeof i=="function"||u.isPresent?m.cloneElement(d,{ref:f}):null};bi.displayName="Presence";function Sy(s){const[o,i]=m.useState(),u=m.useRef(null),d=m.useRef(s),f=m.useRef("none"),g=s?"mounted":"unmounted",[h,v]=Ny(g,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const x=ni(u.current);f.current=h==="mounted"?x:"none"},[h]),Ao(()=>{const x=u.current,b=d.current;if(b!==s){const M=f.current,O=ni(x);s?v("MOUNT"):O==="none"||(x==null?void 0:x.display)==="none"?v("UNMOUNT"):v(b&&M!==O?"ANIMATION_OUT":"UNMOUNT"),d.current=s}},[s,v]),Ao(()=>{if(o){let x;const b=o.ownerDocument.defaultView??window,j=O=>{const w=ni(u.current).includes(CSS.escape(O.animationName));if(O.target===o&&w&&(v("ANIMATION_END"),!d.current)){const C=o.style.animationFillMode;o.style.animationFillMode="forwards",x=b.setTimeout(()=>{o.style.animationFillMode==="forwards"&&(o.style.animationFillMode=C)})}},M=O=>{O.target===o&&(f.current=ni(u.current))};return o.addEventListener("animationstart",M),o.addEventListener("animationcancel",j),o.addEventListener("animationend",j),()=>{b.clearTimeout(x),o.removeEventListener("animationstart",M),o.removeEventListener("animationcancel",j),o.removeEventListener("animationend",j)}}else v("ANIMATION_END")},[o,v]),{isPresent:["mounted","unmountSuspended"].includes(h),ref:m.useCallback(x=>{u.current=x?getComputedStyle(x):null,i(x)},[])}}function zp(s,o){if(typeof s=="function")return s(o);s!=null&&(s.current=o)}function Cy(...s){const o=m.useRef(s);return o.current=s,m.useCallback(i=>{const u=o.current;let d=!1;const f=u.map(g=>{const h=zp(g,i);return!d&&typeof h=="function"&&(d=!0),h});if(d)return()=>{for(let g=0;g<f.length;g++){const h=f[g];typeof h=="function"?h():zp(u[g],null)}}},[])}function ni(s){return(s==null?void 0:s.animationName)||"none"}function Ey(s){var u,d;let o=(u=Object.getOwnPropertyDescriptor(s.props,"ref"))==null?void 0:u.get,i=o&&"isReactWarning"in o&&o.isReactWarning;return i?s.ref:(o=(d=Object.getOwnPropertyDescriptor(s,"ref"))==null?void 0:d.get,i=o&&"isReactWarning"in o&&o.isReactWarning,i?s.props.ref:s.props.ref||s.ref)}var si=0,sr=null;function Py(){m.useEffect(()=>{sr||(sr={start:Lp(),end:Lp()});const{start:s,end:o}=sr;return document.body.firstElementChild!==s&&document.body.insertAdjacentElement("afterbegin",s),document.body.lastElementChild!==o&&document.body.insertAdjacentElement("beforeend",o),si++,()=>{si===1&&(sr==null||sr.start.remove(),sr==null||sr.end.remove(),sr=null),si=Math.max(0,si-1)}},[])}function Lp(){const s=document.createElement("span");return s.setAttribute("data-radix-focus-guard",""),s.tabIndex=0,s.style.outline="none",s.style.opacity="0",s.style.position="fixed",s.style.pointerEvents="none",s}var ar=function(){return ar=Object.assign||function(o){for(var i,u=1,d=arguments.length;u<d;u++){i=arguments[u];for(var f in i)Object.prototype.hasOwnProperty.call(i,f)&&(o[f]=i[f])}return o},ar.apply(this,arguments)};function zh(s,o){var i={};for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&o.indexOf(u)<0&&(i[u]=s[u]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var d=0,u=Object.getOwnPropertySymbols(s);d<u.length;d++)o.indexOf(u[d])<0&&Object.prototype.propertyIsEnumerable.call(s,u[d])&&(i[u[d]]=s[u[d]]);return i}function _y(s,o,i){if(i||arguments.length===2)for(var u=0,d=o.length,f;u<d;u++)(f||!(u in o))&&(f||(f=Array.prototype.slice.call(o,0,u)),f[u]=o[u]);return s.concat(f||Array.prototype.slice.call(o))}var fi="right-scroll-bar-position",pi="width-before-scroll-bar",My="with-scroll-bars-hidden",Ry="--removed-body-scroll-bar-size";function ku(s,o){return typeof s=="function"?s(o):s&&(s.current=o),s}function Oy(s,o){var i=m.useState(function(){return{value:s,callback:o,facade:{get current(){return i.value},set current(u){var d=i.value;d!==u&&(i.value=u,i.callback(u,d))}}}})[0];return i.callback=o,i.facade}var Dy=typeof window<"u"?m.useLayoutEffect:m.useEffect,Ip=new WeakMap;function Ty(s,o){var i=Oy(null,function(u){return s.forEach(function(d){return ku(d,u)})});return Dy(function(){var u=Ip.get(i);if(u){var d=new Set(u),f=new Set(s),g=i.current;d.forEach(function(h){f.has(h)||ku(h,null)}),f.forEach(function(h){d.has(h)||ku(h,g)})}Ip.set(i,s)},[s]),i}function Ay(s){return s}function zy(s,o){o===void 0&&(o=Ay);var i=[],u=!1,d={read:function(){if(u)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:s},useMedium:function(f){var g=o(f,u);return i.push(g),function(){i=i.filter(function(h){return h!==g})}},assignSyncMedium:function(f){for(u=!0;i.length;){var g=i;i=[],g.forEach(f)}i={push:function(h){return f(h)},filter:function(){return i}}},assignMedium:function(f){u=!0;var g=[];if(i.length){var h=i;i=[],h.forEach(f),g=i}var v=function(){var b=g;g=[],b.forEach(f)},x=function(){return Promise.resolve().then(v)};x(),i={push:function(b){g.push(b),x()},filter:function(b){return g=g.filter(b),i}}}};return d}function Ly(s){s===void 0&&(s={});var o=zy(null);return o.options=ar({async:!0,ssr:!1},s),o}var Lh=function(s){var o=s.sideCar,i=zh(s,["sideCar"]);if(!o)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var u=o.read();if(!u)throw new Error("Sidecar medium not found");return m.createElement(u,ar({},i))};Lh.isSideCarExport=!0;function Iy(s,o){return s.useMedium(o),Lh}var Ih=Ly(),Nu=function(){},wi=m.forwardRef(function(s,o){var i=m.useRef(null),u=m.useState({onScrollCapture:Nu,onWheelCapture:Nu,onTouchMoveCapture:Nu}),d=u[0],f=u[1],g=s.forwardProps,h=s.children,v=s.className,x=s.removeScrollBar,b=s.enabled,j=s.shards,M=s.sideCar,O=s.noRelative,A=s.noIsolation,w=s.inert,C=s.allowPinchZoom,_=s.as,$=_===void 0?"div":_,V=s.gapMode,z=zh(s,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),L=M,B=Ty([i,o]),J=ar(ar({},z),d);return m.createElement(m.Fragment,null,b&&m.createElement(L,{sideCar:Ih,removeScrollBar:x,shards:j,noRelative:O,noIsolation:A,inert:w,setCallbacks:f,allowPinchZoom:!!C,lockRef:i,gapMode:V}),g?m.cloneElement(m.Children.only(h),ar(ar({},J),{ref:B})):m.createElement($,ar({},J,{className:v,ref:B}),h))});wi.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};wi.classNames={fullWidth:pi,zeroRight:fi};var Fy=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Uy(){if(!document)return null;var s=document.createElement("style");s.type="text/css";var o=Fy();return o&&s.setAttribute("nonce",o),s}function $y(s,o){s.styleSheet?s.styleSheet.cssText=o:s.appendChild(document.createTextNode(o))}function By(s){var o=document.head||document.getElementsByTagName("head")[0];o.appendChild(s)}var Hy=function(){var s=0,o=null;return{add:function(i){s==0&&(o=Uy())&&($y(o,i),By(o)),s++},remove:function(){s--,!s&&o&&(o.parentNode&&o.parentNode.removeChild(o),o=null)}}},Wy=function(){var s=Hy();return function(o,i){m.useEffect(function(){return s.add(o),function(){s.remove()}},[o&&i])}},Fh=function(){var s=Wy(),o=function(i){var u=i.styles,d=i.dynamic;return s(u,d),null};return o},Vy={left:0,top:0,right:0,gap:0},Su=function(s){return parseInt(s||"",10)||0},Gy=function(s){var o=window.getComputedStyle(document.body),i=o[s==="padding"?"paddingLeft":"marginLeft"],u=o[s==="padding"?"paddingTop":"marginTop"],d=o[s==="padding"?"paddingRight":"marginRight"];return[Su(i),Su(u),Su(d)]},Ky=function(s){if(s===void 0&&(s="margin"),typeof window>"u")return Vy;var o=Gy(s),i=document.documentElement.clientWidth,u=window.innerWidth;return{left:o[0],top:o[1],right:o[2],gap:Math.max(0,u-i+o[2]-o[0])}},Qy=Fh(),bs="data-scroll-locked",qy=function(s,o,i,u){var d=s.left,f=s.top,g=s.right,h=s.gap;return i===void 0&&(i="margin"),`
.`.concat(My,` {
overflow: hidden `).concat(u,`;
padding-right: `).concat(h,"px ").concat(u,`;
}
body[`).concat(bs,`] {
overflow: hidden `).concat(u,`;
overscroll-behavior: contain;
`).concat([o&&"position: relative ".concat(u,";"),i==="margin"&&`
padding-left: `.concat(d,`px;
padding-top: `).concat(f,`px;
padding-right: `).concat(g,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(h,"px ").concat(u,`;
`),i==="padding"&&"padding-right: ".concat(h,"px ").concat(u,";")].filter(Boolean).join(""),`
}
.`).concat(fi,` {
right: `).concat(h,"px ").concat(u,`;
}
.`).concat(pi,` {
margin-right: `).concat(h,"px ").concat(u,`;
}
.`).concat(fi," .").concat(fi,` {
right: 0 `).concat(u,`;
}
.`).concat(pi," .").concat(pi,` {
margin-right: 0 `).concat(u,`;
}
body[`).concat(bs,`] {
`).concat(Ry,": ").concat(h,`px;
}
`)},Fp=function(){var s=parseInt(document.body.getAttribute(bs)||"0",10);return isFinite(s)?s:0},Zy=function(){m.useEffect(function(){return document.body.setAttribute(bs,(Fp()+1).toString()),function(){var s=Fp()-1;s<=0?document.body.removeAttribute(bs):document.body.setAttribute(bs,s.toString())}},[])},Yy=function(s){var o=s.noRelative,i=s.noImportant,u=s.gapMode,d=u===void 0?"margin":u;Zy();var f=m.useMemo(function(){return Ky(d)},[d]);return m.createElement(Qy,{styles:qy(f,!o,d,i?"":"!important")})},Xu=!1;if(typeof window<"u")try{var oi=Object.defineProperty({},"passive",{get:function(){return Xu=!0,!0}});window.addEventListener("test",oi,oi),window.removeEventListener("test",oi,oi)}catch{Xu=!1}var hs=Xu?{passive:!1}:!1,Jy=function(s){return s.tagName==="TEXTAREA"},Uh=function(s,o){if(!(s instanceof Element))return!1;var i=window.getComputedStyle(s);return i[o]!=="hidden"&&!(i.overflowY===i.overflowX&&!Jy(s)&&i[o]==="visible")},Xy=function(s){return Uh(s,"overflowY")},ev=function(s){return Uh(s,"overflowX")},Up=function(s,o){var i=o.ownerDocument,u=o;do{typeof ShadowRoot<"u"&&u instanceof ShadowRoot&&(u=u.host);var d=$h(s,u);if(d){var f=Bh(s,u),g=f[1],h=f[2];if(g>h)return!0}u=u.parentNode}while(u&&u!==i.body);return!1},tv=function(s){var o=s.scrollTop,i=s.scrollHeight,u=s.clientHeight;return[o,i,u]},rv=function(s){var o=s.scrollLeft,i=s.scrollWidth,u=s.clientWidth;return[o,i,u]},$h=function(s,o){return s==="v"?Xy(o):ev(o)},Bh=function(s,o){return s==="v"?tv(o):rv(o)},nv=function(s,o){return s==="h"&&o==="rtl"?-1:1},sv=function(s,o,i,u,d){var f=nv(s,window.getComputedStyle(o).direction),g=f*u,h=i.target,v=o.contains(h),x=!1,b=g>0,j=0,M=0;do{if(!h)break;var O=Bh(s,h),A=O[0],w=O[1],C=O[2],_=w-C-f*A;(A||_)&&$h(s,h)&&(j+=_,M+=A);var $=h.parentNode;h=$&&$.nodeType===Node.DOCUMENT_FRAGMENT_NODE?$.host:$}while(!v&&h!==document.body||v&&(o.contains(h)||o===h));return(b&&Math.abs(j)<1||!b&&Math.abs(M)<1)&&(x=!0),x},li=function(s){return"changedTouches"in s?[s.changedTouches[0].clientX,s.changedTouches[0].clientY]:[0,0]},$p=function(s){return[s.deltaX,s.deltaY]},Bp=function(s){return s&&"current"in s?s.current:s},ov=function(s,o){return s[0]===o[0]&&s[1]===o[1]},lv=function(s){return`
.block-interactivity-`.concat(s,` {pointer-events: none;}
.allow-interactivity-`).concat(s,` {pointer-events: all;}
`)},iv=0,ms=[];function av(s){var o=m.useRef([]),i=m.useRef([0,0]),u=m.useRef(),d=m.useState(iv++)[0],f=m.useState(Fh)[0],g=m.useRef(s);m.useEffect(function(){g.current=s},[s]),m.useEffect(function(){if(s.inert){document.body.classList.add("block-interactivity-".concat(d));var w=_y([s.lockRef.current],(s.shards||[]).map(Bp),!0).filter(Boolean);return w.forEach(function(C){return C.classList.add("allow-interactivity-".concat(d))}),function(){document.body.classList.remove("block-interactivity-".concat(d)),w.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(d))})}}},[s.inert,s.lockRef.current,s.shards]);var h=m.useCallback(function(w,C){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!g.current.allowPinchZoom;var _=li(w),$=i.current,V="deltaX"in w?w.deltaX:$[0]-_[0],z="deltaY"in w?w.deltaY:$[1]-_[1],L,B=w.target,J=Math.abs(V)>Math.abs(z)?"h":"v";if("touches"in w&&J==="h"&&B.type==="range")return!1;var te=window.getSelection(),re=te&&te.anchorNode,ee=re?re===B||re.contains(B):!1;if(ee)return!1;var ge=Up(J,B);if(!ge)return!0;if(ge?L=J:(L=J==="v"?"h":"v",ge=Up(J,B)),!ge)return!1;if(!u.current&&"changedTouches"in w&&(V||z)&&(u.current=L),!L)return!0;var ue=u.current||L;return sv(ue,C,w,ue==="h"?V:z)},[]),v=m.useCallback(function(w){var C=w;if(!(!ms.length||ms[ms.length-1]!==f)){var _="deltaY"in C?$p(C):li(C),$=o.current.filter(function(L){return L.name===C.type&&(L.target===C.target||C.target===L.shadowParent)&&ov(L.delta,_)})[0];if($&&$.should){C.cancelable&&C.preventDefault();return}if(!$){var V=(g.current.shards||[]).map(Bp).filter(Boolean).filter(function(L){return L.contains(C.target)}),z=V.length>0?h(C,V[0]):!g.current.noIsolation;z&&C.cancelable&&C.preventDefault()}}},[]),x=m.useCallback(function(w,C,_,$){var V={name:w,delta:C,target:_,should:$,shadowParent:uv(_)};o.current.push(V),setTimeout(function(){o.current=o.current.filter(function(z){return z!==V})},1)},[]),b=m.useCallback(function(w){i.current=li(w),u.current=void 0},[]),j=m.useCallback(function(w){x(w.type,$p(w),w.target,h(w,s.lockRef.current))},[]),M=m.useCallback(function(w){x(w.type,li(w),w.target,h(w,s.lockRef.current))},[]);m.useEffect(function(){return ms.push(f),s.setCallbacks({onScrollCapture:j,onWheelCapture:j,onTouchMoveCapture:M}),document.addEventListener("wheel",v,hs),document.addEventListener("touchmove",v,hs),document.addEventListener("touchstart",b,hs),function(){ms=ms.filter(function(w){return w!==f}),document.removeEventListener("wheel",v,hs),document.removeEventListener("touchmove",v,hs),document.removeEventListener("touchstart",b,hs)}},[]);var O=s.removeScrollBar,A=s.inert;return m.createElement(m.Fragment,null,A?m.createElement(f,{styles:lv(d)}):null,O?m.createElement(Yy,{noRelative:s.noRelative,gapMode:s.gapMode}):null)}function uv(s){for(var o=null;s!==null;)s instanceof ShadowRoot&&(o=s.host,s=s.host),s=s.parentNode;return o}const cv=Iy(Ih,av);var Hh=m.forwardRef(function(s,o){return m.createElement(wi,ar({},s,{ref:o,sideCar:cv}))});Hh.classNames=wi.classNames;var dv=function(s){if(typeof document>"u")return null;var o=Array.isArray(s)?s[0]:s;return o.ownerDocument.body},gs=new WeakMap,ii=new WeakMap,ai={},Cu=0,Wh=function(s){return s&&(s.host||Wh(s.parentNode))},fv=function(s,o){return o.map(function(i){if(s.contains(i))return i;var u=Wh(i);return u&&s.contains(u)?u:(console.error("aria-hidden",i,"in not contained inside",s,". Doing nothing"),null)}).filter(function(i){return!!i})},pv=function(s,o,i,u){var d=fv(o,Array.isArray(s)?s:[s]);ai[i]||(ai[i]=new WeakMap);var f=ai[i],g=[],h=new Set,v=new Set(d),x=function(j){!j||h.has(j)||(h.add(j),x(j.parentNode))};d.forEach(x);var b=function(j){!j||v.has(j)||Array.prototype.forEach.call(j.children,function(M){if(h.has(M))b(M);else try{var O=M.getAttribute(u),A=O!==null&&O!=="false",w=(gs.get(M)||0)+1,C=(f.get(M)||0)+1;gs.set(M,w),f.set(M,C),g.push(M),w===1&&A&&ii.set(M,!0),C===1&&M.setAttribute(i,"true"),A||M.setAttribute(u,"true")}catch(_){console.error("aria-hidden: cannot operate on ",M,_)}})};return b(o),h.clear(),Cu++,function(){g.forEach(function(j){var M=gs.get(j)-1,O=f.get(j)-1;gs.set(j,M),f.set(j,O),M||(ii.has(j)||j.removeAttribute(u),ii.delete(j)),O||j.removeAttribute(i)}),Cu--,Cu||(gs=new WeakMap,gs=new WeakMap,ii=new WeakMap,ai={})}},hv=function(s,o,i){i===void 0&&(i="data-aria-hidden");var u=Array.from(Array.isArray(s)?s:[s]),d=dv(s);return d?(u.push.apply(u,Array.from(d.querySelectorAll("[aria-live], script"))),pv(u,d,i,"aria-hidden")):function(){return null}},ji="Dialog",[Vh]=B0(ji),[mv,Jt]=Vh(ji),Gh=s=>{const{__scopeDialog:o,children:i,open:u,defaultOpen:d,onOpenChange:f,modal:g=!0}=s,h=m.useRef(null),v=m.useRef(null),[x,b]=K0({prop:u,defaultProp:d??!1,onChange:f,caller:ji});return n.jsx(mv,{scope:o,triggerRef:h,contentRef:v,contentId:Nr(),titleId:Nr(),descriptionId:Nr(),open:x,onOpenChange:b,onOpenToggle:m.useCallback(()=>b(j=>!j),[b]),modal:g,children:i})};Gh.displayName=ji;var Kh="DialogTrigger",gv=m.forwardRef((s,o)=>{const{__scopeDialog:i,...u}=s,d=Jt(Kh,i),f=Un(o,d.triggerRef);return n.jsx(it.button,{type:"button","aria-haspopup":"dialog","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":hc(d.open),...u,ref:f,onClick:on(s.onClick,d.onOpenToggle)})});gv.displayName=Kh;var pc="DialogPortal",[xv,Qh]=Vh(pc,{forceMount:void 0}),qh=s=>{const{__scopeDialog:o,forceMount:i,children:u,container:d}=s,f=Jt(pc,o);return n.jsx(xv,{scope:o,forceMount:i,children:m.Children.map(u,g=>n.jsx(bi,{present:i||f.open,children:n.jsx(Ah,{asChild:!0,container:d,children:g})}))})};qh.displayName=pc;var vi="DialogOverlay",Zh=m.forwardRef((s,o)=>{const i=Qh(vi,s.__scopeDialog),{forceMount:u=i.forceMount,...d}=s,f=Jt(vi,s.__scopeDialog);return f.modal?n.jsx(bi,{present:u||f.open,children:n.jsx(vv,{...d,ref:o})}):null});Zh.displayName=vi;var yv=Mh("DialogOverlay.RemoveScroll"),vv=m.forwardRef((s,o)=>{const{__scopeDialog:i,...u}=s,d=Jt(vi,i),f=py(),g=Un(o,f);return n.jsx(Hh,{as:yv,allowPinchZoom:!0,shards:[d.contentRef],children:n.jsx(it.div,{"data-state":hc(d.open),...u,ref:g,style:{pointerEvents:"auto",...u.style}})})}),Ls="DialogContent",Yh=m.forwardRef((s,o)=>{const i=Qh(Ls,s.__scopeDialog),{forceMount:u=i.forceMount,...d}=s,f=Jt(Ls,s.__scopeDialog);return n.jsx(bi,{present:u||f.open,children:f.modal?n.jsx(bv,{...d,ref:o}):n.jsx(wv,{...d,ref:o})})});Yh.displayName=Ls;var bv=m.forwardRef((s,o)=>{const i=Jt(Ls,s.__scopeDialog),u=m.useRef(null),d=Un(o,i.contentRef,u);return m.useEffect(()=>{const f=u.current;if(f)return hv(f)},[]),n.jsx(Jh,{...s,ref:d,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:on(s.onCloseAutoFocus,f=>{var g;f.preventDefault(),(g=i.triggerRef.current)==null||g.focus()}),onPointerDownOutside:on(s.onPointerDownOutside,f=>{const g=f.detail.originalEvent,h=g.button===0&&g.ctrlKey===!0;(g.button===2||h)&&f.preventDefault()}),onFocusOutside:on(s.onFocusOutside,f=>f.preventDefault())})}),wv=m.forwardRef((s,o)=>{const i=Jt(Ls,s.__scopeDialog),u=m.useRef(!1),d=m.useRef(!1);return n.jsx(Jh,{...s,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:f=>{var g,h;(g=s.onCloseAutoFocus)==null||g.call(s,f),f.defaultPrevented||(u.current||(h=i.triggerRef.current)==null||h.focus(),f.preventDefault()),u.current=!1,d.current=!1},onInteractOutside:f=>{var v,x;(v=s.onInteractOutside)==null||v.call(s,f),f.defaultPrevented||(u.current=!0,f.detail.originalEvent.type==="pointerdown"&&(d.current=!0));const g=f.target;((x=i.triggerRef.current)==null?void 0:x.contains(g))&&f.preventDefault(),f.detail.originalEvent.type==="focusin"&&d.current&&f.preventDefault()}})}),Jh=m.forwardRef((s,o)=>{const{__scopeDialog:i,trapFocus:u,onOpenAutoFocus:d,onCloseAutoFocus:f,...g}=s,h=Jt(Ls,i);return Py(),n.jsx(n.Fragment,{children:n.jsx(Dh,{asChild:!0,loop:!0,trapped:u,onMountAutoFocus:d,onUnmountAutoFocus:f,children:n.jsx(Rh,{role:"dialog",id:h.contentId,"aria-describedby":h.descriptionId,"aria-labelledby":h.titleId,"data-state":hc(h.open),...g,ref:o,deferPointerDownOutside:!0,onDismiss:()=>h.onOpenChange(!1)})})})}),Xh="DialogTitle",jv=m.forwardRef((s,o)=>{const{__scopeDialog:i,...u}=s,d=Jt(Xh,i);return n.jsx(it.h2,{id:d.titleId,...u,ref:o})});jv.displayName=Xh;var em="DialogDescription",kv=m.forwardRef((s,o)=>{const{__scopeDialog:i,...u}=s,d=Jt(em,i);return n.jsx(it.p,{id:d.descriptionId,...u,ref:o})});kv.displayName=em;var tm="DialogClose",Nv=m.forwardRef((s,o)=>{const{__scopeDialog:i,...u}=s,d=Jt(tm,i);return n.jsx(it.button,{type:"button",...u,ref:o,onClick:on(s.onClick,()=>d.onOpenChange(!1))})});Nv.displayName=tm;function hc(s){return s?"open":"closed"}var So='[cmdk-group=""]',Eu='[cmdk-group-items=""]',Sv='[cmdk-group-heading=""]',rm='[cmdk-item=""]',Hp=`${rm}:not([aria-disabled="true"])`,ec="cmdk-item-select",ys="data-value",Cv=(s,o,i)=>$0(s,o,i),nm=m.createContext(void 0),Wo=()=>m.useContext(nm),sm=m.createContext(void 0),mc=()=>m.useContext(sm),om=m.createContext(void 0),lm=m.forwardRef((s,o)=>{let i=vs(()=>{var k,G;return{search:"",value:(G=(k=s.value)!=null?k:s.defaultValue)!=null?G:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),u=vs(()=>new Set),d=vs(()=>new Map),f=vs(()=>new Map),g=vs(()=>new Set),h=im(s),{label:v,children:x,value:b,onValueChange:j,filter:M,shouldFilter:O,loop:A,disablePointerSelection:w=!1,vimBindings:C=!0,..._}=s,$=Nr(),V=Nr(),z=Nr(),L=m.useRef(null),B=Lv();In(()=>{if(b!==void 0){let k=b.trim();i.current.value=k,J.emit()}},[b]),In(()=>{B(6,Ae)},[]);let J=m.useMemo(()=>({subscribe:k=>(g.current.add(k),()=>g.current.delete(k)),snapshot:()=>i.current,setState:(k,G,X)=>{var Z,ie,he,xe;if(!Object.is(i.current[k],G)){if(i.current[k]=G,k==="search")ue(),ee(),B(1,ge);else if(k==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let U=document.getElementById(z);U?U.focus():(Z=document.getElementById($))==null||Z.focus()}if(B(7,()=>{var U;i.current.selectedItemId=(U=Ee())==null?void 0:U.id,J.emit()}),X||B(5,Ae),((ie=h.current)==null?void 0:ie.value)!==void 0){let U=G??"";(xe=(he=h.current).onValueChange)==null||xe.call(he,U);return}}J.emit()}},emit:()=>{g.current.forEach(k=>k())}}),[]),te=m.useMemo(()=>({value:(k,G,X)=>{var Z;G!==((Z=f.current.get(k))==null?void 0:Z.value)&&(f.current.set(k,{value:G,keywords:X}),i.current.filtered.items.set(k,re(G,X)),B(2,()=>{ee(),J.emit()}))},item:(k,G)=>(u.current.add(k),G&&(d.current.has(G)?d.current.get(G).add(k):d.current.set(G,new Set([k]))),B(3,()=>{ue(),ee(),i.current.value||ge(),J.emit()}),()=>{f.current.delete(k),u.current.delete(k),i.current.filtered.items.delete(k);let X=Ee();B(4,()=>{ue(),(X==null?void 0:X.getAttribute("id"))===k&&ge(),J.emit()})}),group:k=>(d.current.has(k)||d.current.set(k,new Set),()=>{f.current.delete(k),d.current.delete(k)}),filter:()=>h.current.shouldFilter,label:v||s["aria-label"],getDisablePointerSelection:()=>h.current.disablePointerSelection,listId:$,inputId:z,labelId:V,listInnerRef:L}),[]);function re(k,G){var X,Z;let ie=(Z=(X=h.current)==null?void 0:X.filter)!=null?Z:Cv;return k?ie(k,i.current.search,G):0}function ee(){if(!i.current.search||h.current.shouldFilter===!1)return;let k=i.current.filtered.items,G=[];i.current.filtered.groups.forEach(Z=>{let ie=d.current.get(Z),he=0;ie.forEach(xe=>{let U=k.get(xe);he=Math.max(U,he)}),G.push([Z,he])});let X=L.current;De().sort((Z,ie)=>{var he,xe;let U=Z.getAttribute("id"),F=ie.getAttribute("id");return((he=k.get(F))!=null?he:0)-((xe=k.get(U))!=null?xe:0)}).forEach(Z=>{let ie=Z.closest(Eu);ie?ie.appendChild(Z.parentElement===ie?Z:Z.closest(`${Eu} > *`)):X.appendChild(Z.parentElement===X?Z:Z.closest(`${Eu} > *`))}),G.sort((Z,ie)=>ie[1]-Z[1]).forEach(Z=>{var ie;let he=(ie=L.current)==null?void 0:ie.querySelector(`${So}[${ys}="${encodeURIComponent(Z[0])}"]`);he==null||he.parentElement.appendChild(he)})}function ge(){let k=De().find(X=>X.getAttribute("aria-disabled")!=="true"),G=k==null?void 0:k.getAttribute(ys);J.setState("value",G||void 0)}function ue(){var k,G,X,Z;if(!i.current.search||h.current.shouldFilter===!1){i.current.filtered.count=u.current.size;return}i.current.filtered.groups=new Set;let ie=0;for(let he of u.current){let xe=(G=(k=f.current.get(he))==null?void 0:k.value)!=null?G:"",U=(Z=(X=f.current.get(he))==null?void 0:X.keywords)!=null?Z:[],F=re(xe,U);i.current.filtered.items.set(he,F),F>0&&ie++}for(let[he,xe]of d.current)for(let U of xe)if(i.current.filtered.items.get(U)>0){i.current.filtered.groups.add(he);break}i.current.filtered.count=ie}function Ae(){var k,G,X;let Z=Ee();Z&&(((k=Z.parentElement)==null?void 0:k.firstChild)===Z&&((X=(G=Z.closest(So))==null?void 0:G.querySelector(Sv))==null||X.scrollIntoView({block:"nearest"})),Z.scrollIntoView({block:"nearest"}))}function Ee(){var k;return(k=L.current)==null?void 0:k.querySelector(`${rm}[aria-selected="true"]`)}function De(){var k;return Array.from(((k=L.current)==null?void 0:k.querySelectorAll(Hp))||[])}function Me(k){let G=De()[k];G&&J.setState("value",G.getAttribute(ys))}function Pe(k){var G;let X=Ee(),Z=De(),ie=Z.findIndex(xe=>xe===X),he=Z[ie+k];(G=h.current)!=null&&G.loop&&(he=ie+k<0?Z[Z.length-1]:ie+k===Z.length?Z[0]:Z[ie+k]),he&&J.setState("value",he.getAttribute(ys))}function Q(k){let G=Ee(),X=G==null?void 0:G.closest(So),Z;for(;X&&!Z;)X=k>0?Av(X,So):zv(X,So),Z=X==null?void 0:X.querySelector(Hp);Z?J.setState("value",Z.getAttribute(ys)):Pe(k)}let ce=()=>Me(De().length-1),q=k=>{k.preventDefault(),k.metaKey?ce():k.altKey?Q(1):Pe(1)},E=k=>{k.preventDefault(),k.metaKey?Me(0):k.altKey?Q(-1):Pe(-1)};return m.createElement(it.div,{ref:o,tabIndex:-1,..._,"cmdk-root":"",onKeyDown:k=>{var G;(G=_.onKeyDown)==null||G.call(_,k);let X=k.nativeEvent.isComposing||k.keyCode===229;if(!(k.defaultPrevented||X))switch(k.key){case"n":case"j":{C&&k.ctrlKey&&q(k);break}case"ArrowDown":{q(k);break}case"p":case"k":{C&&k.ctrlKey&&E(k);break}case"ArrowUp":{E(k);break}case"Home":{k.preventDefault(),Me(0);break}case"End":{k.preventDefault(),ce();break}case"Enter":{k.preventDefault();let Z=Ee();if(Z){let ie=new Event(ec);Z.dispatchEvent(ie)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:te.inputId,id:te.labelId,style:Fv},v),ki(s,k=>m.createElement(sm.Provider,{value:J},m.createElement(nm.Provider,{value:te},k))))}),Ev=m.forwardRef((s,o)=>{var i,u;let d=Nr(),f=m.useRef(null),g=m.useContext(om),h=Wo(),v=im(s),x=(u=(i=v.current)==null?void 0:i.forceMount)!=null?u:g==null?void 0:g.forceMount;In(()=>{if(!x)return h.item(d,g==null?void 0:g.id)},[x]);let b=am(d,f,[s.value,s.children,f],s.keywords),j=mc(),M=ln(B=>B.value&&B.value===b.current),O=ln(B=>x||h.filter()===!1?!0:B.search?B.filtered.items.get(d)>0:!0);m.useEffect(()=>{let B=f.current;if(!(!B||s.disabled))return B.addEventListener(ec,A),()=>B.removeEventListener(ec,A)},[O,s.onSelect,s.disabled]);function A(){var B,J;w(),(J=(B=v.current).onSelect)==null||J.call(B,b.current)}function w(){j.setState("value",b.current,!0)}if(!O)return null;let{disabled:C,value:_,onSelect:$,forceMount:V,keywords:z,...L}=s;return m.createElement(it.div,{ref:zs(f,o),...L,id:d,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!M,"data-disabled":!!C,"data-selected":!!M,onPointerMove:C||h.getDisablePointerSelection()?void 0:w,onClick:C?void 0:A},s.children)}),Pv=m.forwardRef((s,o)=>{let{heading:i,children:u,forceMount:d,...f}=s,g=Nr(),h=m.useRef(null),v=m.useRef(null),x=Nr(),b=Wo(),j=ln(O=>d||b.filter()===!1?!0:O.search?O.filtered.groups.has(g):!0);In(()=>b.group(g),[]),am(g,h,[s.value,s.heading,v]);let M=m.useMemo(()=>({id:g,forceMount:d}),[d]);return m.createElement(it.div,{ref:zs(h,o),...f,"cmdk-group":"",role:"presentation",hidden:j?void 0:!0},i&&m.createElement("div",{ref:v,"cmdk-group-heading":"","aria-hidden":!0,id:x},i),ki(s,O=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":i?x:void 0},m.createElement(om.Provider,{value:M},O))))}),_v=m.forwardRef((s,o)=>{let{alwaysRender:i,...u}=s,d=m.useRef(null),f=ln(g=>!g.search);return!i&&!f?null:m.createElement(it.div,{ref:zs(d,o),...u,"cmdk-separator":"",role:"separator"})}),Mv=m.forwardRef((s,o)=>{let{onValueChange:i,...u}=s,d=s.value!=null,f=mc(),g=ln(x=>x.search),h=ln(x=>x.selectedItemId),v=Wo();return m.useEffect(()=>{s.value!=null&&f.setState("search",s.value)},[s.value]),m.createElement(it.input,{ref:o,...u,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":v.listId,"aria-labelledby":v.labelId,"aria-activedescendant":h,id:v.inputId,type:"text",value:d?s.value:g,onChange:x=>{d||f.setState("search",x.target.value),i==null||i(x.target.value)}})}),Rv=m.forwardRef((s,o)=>{let{children:i,label:u="Suggestions",...d}=s,f=m.useRef(null),g=m.useRef(null),h=ln(x=>x.selectedItemId),v=Wo();return m.useEffect(()=>{if(g.current&&f.current){let x=g.current,b=f.current,j,M=new ResizeObserver(()=>{j=requestAnimationFrame(()=>{let O=x.offsetHeight;b.style.setProperty("--cmdk-list-height",O.toFixed(1)+"px")})});return M.observe(x),()=>{cancelAnimationFrame(j),M.unobserve(x)}}},[]),m.createElement(it.div,{ref:zs(f,o),...d,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":h,"aria-label":u,id:v.listId},ki(s,x=>m.createElement("div",{ref:zs(g,v.listInnerRef),"cmdk-list-sizer":""},x)))}),Ov=m.forwardRef((s,o)=>{let{open:i,onOpenChange:u,overlayClassName:d,contentClassName:f,container:g,...h}=s;return m.createElement(Gh,{open:i,onOpenChange:u},m.createElement(qh,{container:g},m.createElement(Zh,{"cmdk-overlay":"",className:d}),m.createElement(Yh,{"aria-label":s.label,"cmdk-dialog":"",className:f},m.createElement(lm,{ref:o,...h}))))}),Dv=m.forwardRef((s,o)=>ln(i=>i.filtered.count===0)?m.createElement(it.div,{ref:o,...s,"cmdk-empty":"",role:"presentation"}):null),Tv=m.forwardRef((s,o)=>{let{progress:i,children:u,label:d="Loading...",...f}=s;return m.createElement(it.div,{ref:o,...f,"cmdk-loading":"",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,"aria-label":d},ki(s,g=>m.createElement("div",{"aria-hidden":!0},g)))}),xs=Object.assign(lm,{List:Rv,Item:Ev,Input:Mv,Group:Pv,Separator:_v,Dialog:Ov,Empty:Dv,Loading:Tv});function Av(s,o){let i=s.nextElementSibling;for(;i;){if(i.matches(o))return i;i=i.nextElementSibling}}function zv(s,o){let i=s.previousElementSibling;for(;i;){if(i.matches(o))return i;i=i.previousElementSibling}}function im(s){let o=m.useRef(s);return In(()=>{o.current=s}),o}var In=typeof window>"u"?m.useEffect:m.useLayoutEffect;function vs(s){let o=m.useRef();return o.current===void 0&&(o.current=s()),o}function ln(s){let o=mc(),i=()=>s(o.snapshot());return m.useSyncExternalStore(o.subscribe,i,i)}function am(s,o,i,u=[]){let d=m.useRef(),f=Wo();return In(()=>{var g;let h=(()=>{var x;for(let b of i){if(typeof b=="string")return b.trim();if(typeof b=="object"&&"current"in b)return b.current?(x=b.current.textContent)==null?void 0:x.trim():d.current}})(),v=u.map(x=>x.trim());f.value(s,h,v),(g=o.current)==null||g.setAttribute(ys,h),d.current=h}),d}var Lv=()=>{let[s,o]=m.useState(),i=vs(()=>new Map);return In(()=>{i.current.forEach(u=>u()),i.current=new Map},[s]),(u,d)=>{i.current.set(u,d),o({})}};function Iv(s){let o=s.type;return typeof o=="function"?o(s.props):"render"in o?o.render(s.props):s}function ki({asChild:s,children:o},i){return s&&m.isValidElement(o)?m.cloneElement(Iv(o),{ref:o.ref},i(o.props.children)):i(o)}var Fv={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Uv({onNavigate:s}){const[o,i]=m.useState(!1);return m.useEffect(()=>{const u=d=>{(d.metaKey||d.ctrlKey)&&d.key.toLowerCase()==="k"&&(d.preventDefault(),i(f=>!f))};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[]),n.jsx(xs.Dialog,{open:o,onOpenChange:i,label:"Befehlspalette",className:"fixed inset-0 z-50 flex items-start justify-center bg-black/50 p-4 pt-[12vh]",onClick:()=>i(!1),children:n.jsxs("div",{className:"w-full max-w-lg overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-2xl",onClick:u=>u.stopPropagation(),children:[n.jsx(xs.Input,{autoFocus:!0,placeholder:"Springe zu… (Modelle, Routing, System …)",className:"w-full border-b border-border bg-transparent px-4 py-3 text-sm outline-none placeholder:text-muted-foreground"}),n.jsxs(xs.List,{className:"max-h-80 overflow-y-auto p-2",children:[n.jsx(xs.Empty,{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Nichts gefunden."}),n.jsx(xs.Group,{heading:"Bereiche",className:"px-1 py-1 text-xs text-muted-foreground",children:Zu.map(u=>n.jsxs(xs.Item,{value:`${u.label} ${u.hint}`,onSelect:()=>{s(u.id),i(!1)},className:"flex cursor-pointer items-center gap-3 rounded-md px-3 py-2 text-sm text-foreground aria-selected:bg-accent aria-selected:text-accent-foreground",children:[n.jsx(u.icon,{className:"h-4 w-4 text-primary"}),n.jsx("span",{children:u.label}),n.jsx("span",{className:"ml-auto truncate text-xs text-muted-foreground",children:u.hint})]},u.id))})]})]})})}async function me(s,o){var v;const i={"Content-Type":"application/json",...o==null?void 0:o.headers},u=localStorage.getItem("mc_sudo_password"),d=localStorage.getItem("mc_hf_token");u&&(i["X-Sudo-Password"]=u);let f=o==null?void 0:o.body;if((((v=o==null?void 0:o.method)==null?void 0:v.toUpperCase())||"GET")==="POST"){if(typeof f=="string")try{const x=JSON.parse(f);let b=!1;u&&!("sudo_password"in x)&&(x.sudo_password=u,b=!0),d&&!("hf_token"in x)&&(x.hf_token=d,b=!0),b&&(f=JSON.stringify(x))}catch{}else if(!f){const x={};u&&(x.sudo_password=u),d&&(x.hf_token=d),Object.keys(x).length>0&&(f=JSON.stringify(x))}}const h=await fetch(s,{...o,headers:i,body:f});if(!h.ok)throw new Error(`${h.status} ${h.statusText}`);return h.json()}function um(s){var o,i,u="";if(typeof s=="string"||typeof s=="number")u+=s;else if(typeof s=="object")if(Array.isArray(s)){var d=s.length;for(o=0;o<d;o++)s[o]&&(i=um(s[o]))&&(u&&(u+=" "),u+=i)}else for(i in s)s[i]&&(u&&(u+=" "),u+=i);return u}function $v(){for(var s,o,i=0,u="",d=arguments.length;i<d;i++)(s=arguments[i])&&(o=um(s))&&(u&&(u+=" "),u+=o);return u}const gc="-",Bv=s=>{const o=Wv(s),{conflictingClassGroups:i,conflictingClassGroupModifiers:u}=s;return{getClassGroupId:g=>{const h=g.split(gc);return h[0]===""&&h.length!==1&&h.shift(),cm(h,o)||Hv(g)},getConflictingClassGroupIds:(g,h)=>{const v=i[g]||[];return h&&u[g]?[...v,...u[g]]:v}}},cm=(s,o)=>{var g;if(s.length===0)return o.classGroupId;const i=s[0],u=o.nextPart.get(i),d=u?cm(s.slice(1),u):void 0;if(d)return d;if(o.validators.length===0)return;const f=s.join(gc);return(g=o.validators.find(({validator:h})=>h(f)))==null?void 0:g.classGroupId},Wp=/^\[(.+)\]$/,Hv=s=>{if(Wp.test(s)){const o=Wp.exec(s)[1],i=o==null?void 0:o.substring(0,o.indexOf(":"));if(i)return"arbitrary.."+i}},Wv=s=>{const{theme:o,prefix:i}=s,u={nextPart:new Map,validators:[]};return Gv(Object.entries(s.classGroups),i).forEach(([f,g])=>{tc(g,u,f,o)}),u},tc=(s,o,i,u)=>{s.forEach(d=>{if(typeof d=="string"){const f=d===""?o:Vp(o,d);f.classGroupId=i;return}if(typeof d=="function"){if(Vv(d)){tc(d(u),o,i,u);return}o.validators.push({validator:d,classGroupId:i});return}Object.entries(d).forEach(([f,g])=>{tc(g,Vp(o,f),i,u)})})},Vp=(s,o)=>{let i=s;return o.split(gc).forEach(u=>{i.nextPart.has(u)||i.nextPart.set(u,{nextPart:new Map,validators:[]}),i=i.nextPart.get(u)}),i},Vv=s=>s.isThemeGetter,Gv=(s,o)=>o?s.map(([i,u])=>{const d=u.map(f=>typeof f=="string"?o+f:typeof f=="object"?Object.fromEntries(Object.entries(f).map(([g,h])=>[o+g,h])):f);return[i,d]}):s,Kv=s=>{if(s<1)return{get:()=>{},set:()=>{}};let o=0,i=new Map,u=new Map;const d=(f,g)=>{i.set(f,g),o++,o>s&&(o=0,u=i,i=new Map)};return{get(f){let g=i.get(f);if(g!==void 0)return g;if((g=u.get(f))!==void 0)return d(f,g),g},set(f,g){i.has(f)?i.set(f,g):d(f,g)}}},dm="!",Qv=s=>{const{separator:o,experimentalParseClassName:i}=s,u=o.length===1,d=o[0],f=o.length,g=h=>{const v=[];let x=0,b=0,j;for(let C=0;C<h.length;C++){let _=h[C];if(x===0){if(_===d&&(u||h.slice(C,C+f)===o)){v.push(h.slice(b,C)),b=C+f;continue}if(_==="/"){j=C;continue}}_==="["?x++:_==="]"&&x--}const M=v.length===0?h:h.substring(b),O=M.startsWith(dm),A=O?M.substring(1):M,w=j&&j>b?j-b:void 0;return{modifiers:v,hasImportantModifier:O,baseClassName:A,maybePostfixModifierPosition:w}};return i?h=>i({className:h,parseClassName:g}):g},qv=s=>{if(s.length<=1)return s;const o=[];let i=[];return s.forEach(u=>{u[0]==="["?(o.push(...i.sort(),u),i=[]):i.push(u)}),o.push(...i.sort()),o},Zv=s=>({cache:Kv(s.cacheSize),parseClassName:Qv(s),...Bv(s)}),Yv=/\s+/,Jv=(s,o)=>{const{parseClassName:i,getClassGroupId:u,getConflictingClassGroupIds:d}=o,f=[],g=s.trim().split(Yv);let h="";for(let v=g.length-1;v>=0;v-=1){const x=g[v],{modifiers:b,hasImportantModifier:j,baseClassName:M,maybePostfixModifierPosition:O}=i(x);let A=!!O,w=u(A?M.substring(0,O):M);if(!w){if(!A){h=x+(h.length>0?" "+h:h);continue}if(w=u(M),!w){h=x+(h.length>0?" "+h:h);continue}A=!1}const C=qv(b).join(":"),_=j?C+dm:C,$=_+w;if(f.includes($))continue;f.push($);const V=d(w,A);for(let z=0;z<V.length;++z){const L=V[z];f.push(_+L)}h=x+(h.length>0?" "+h:h)}return h};function Xv(){let s=0,o,i,u="";for(;s<arguments.length;)(o=arguments[s++])&&(i=fm(o))&&(u&&(u+=" "),u+=i);return u}const fm=s=>{if(typeof s=="string")return s;let o,i="";for(let u=0;u<s.length;u++)s[u]&&(o=fm(s[u]))&&(i&&(i+=" "),i+=o);return i};function eb(s,...o){let i,u,d,f=g;function g(v){const x=o.reduce((b,j)=>j(b),s());return i=Zv(x),u=i.cache.get,d=i.cache.set,f=h,h(v)}function h(v){const x=u(v);if(x)return x;const b=Jv(v,i);return d(v,b),b}return function(){return f(Xv.apply(null,arguments))}}const He=s=>{const o=i=>i[s]||[];return o.isThemeGetter=!0,o},pm=/^\[(?:([a-z-]+):)?(.+)\]$/i,tb=/^\d+\/\d+$/,rb=new Set(["px","full","screen"]),nb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sb=/\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$/,ob=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ib=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,br=s=>ws(s)||rb.has(s)||tb.test(s),Gr=s=>Is(s,"length",mb),ws=s=>!!s&&!Number.isNaN(Number(s)),Pu=s=>Is(s,"number",ws),Co=s=>!!s&&Number.isInteger(Number(s)),ab=s=>s.endsWith("%")&&ws(s.slice(0,-1)),Se=s=>pm.test(s),Kr=s=>nb.test(s),ub=new Set(["length","size","percentage"]),cb=s=>Is(s,ub,hm),db=s=>Is(s,"position",hm),fb=new Set(["image","url"]),pb=s=>Is(s,fb,xb),hb=s=>Is(s,"",gb),Eo=()=>!0,Is=(s,o,i)=>{const u=pm.exec(s);return u?u[1]?typeof o=="string"?u[1]===o:o.has(u[1]):i(u[2]):!1},mb=s=>sb.test(s)&&!ob.test(s),hm=()=>!1,gb=s=>lb.test(s),xb=s=>ib.test(s),yb=()=>{const s=He("colors"),o=He("spacing"),i=He("blur"),u=He("brightness"),d=He("borderColor"),f=He("borderRadius"),g=He("borderSpacing"),h=He("borderWidth"),v=He("contrast"),x=He("grayscale"),b=He("hueRotate"),j=He("invert"),M=He("gap"),O=He("gradientColorStops"),A=He("gradientColorStopPositions"),w=He("inset"),C=He("margin"),_=He("opacity"),$=He("padding"),V=He("saturate"),z=He("scale"),L=He("sepia"),B=He("skew"),J=He("space"),te=He("translate"),re=()=>["auto","contain","none"],ee=()=>["auto","hidden","clip","visible","scroll"],ge=()=>["auto",Se,o],ue=()=>[Se,o],Ae=()=>["",br,Gr],Ee=()=>["auto",ws,Se],De=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Me=()=>["solid","dashed","dotted","double","none"],Pe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],ce=()=>["","0",Se],q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>[ws,Se];return{cacheSize:500,separator:":",theme:{colors:[Eo],spacing:[br,Gr],blur:["none","",Kr,Se],brightness:E(),borderColor:[s],borderRadius:["none","","full",Kr,Se],borderSpacing:ue(),borderWidth:Ae(),contrast:E(),grayscale:ce(),hueRotate:E(),invert:ce(),gap:ue(),gradientColorStops:[s],gradientColorStopPositions:[ab,Gr],inset:ge(),margin:ge(),opacity:E(),padding:ue(),saturate:E(),scale:E(),sepia:ce(),skew:E(),space:ue(),translate:ue()},classGroups:{aspect:[{aspect:["auto","square","video",Se]}],container:["container"],columns:[{columns:[Kr]}],"break-after":[{"break-after":q()}],"break-before":[{"break-before":q()}],"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:[...De(),Se]}],overflow:[{overflow:ee()}],"overflow-x":[{"overflow-x":ee()}],"overflow-y":[{"overflow-y":ee()}],overscroll:[{overscroll:re()}],"overscroll-x":[{"overscroll-x":re()}],"overscroll-y":[{"overscroll-y":re()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Co,Se]}],basis:[{basis:ge()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Se]}],grow:[{grow:ce()}],shrink:[{shrink:ce()}],order:[{order:["first","last","none",Co,Se]}],"grid-cols":[{"grid-cols":[Eo]}],"col-start-end":[{col:["auto",{span:["full",Co,Se]},Se]}],"col-start":[{"col-start":Ee()}],"col-end":[{"col-end":Ee()}],"grid-rows":[{"grid-rows":[Eo]}],"row-start-end":[{row:["auto",{span:[Co,Se]},Se]}],"row-start":[{"row-start":Ee()}],"row-end":[{"row-end":Ee()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Se]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Se]}],gap:[{gap:[M]}],"gap-x":[{"gap-x":[M]}],"gap-y":[{"gap-y":[M]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[$]}],px:[{px:[$]}],py:[{py:[$]}],ps:[{ps:[$]}],pe:[{pe:[$]}],pt:[{pt:[$]}],pr:[{pr:[$]}],pb:[{pb:[$]}],pl:[{pl:[$]}],m:[{m:[C]}],mx:[{mx:[C]}],my:[{my:[C]}],ms:[{ms:[C]}],me:[{me:[C]}],mt:[{mt:[C]}],mr:[{mr:[C]}],mb:[{mb:[C]}],ml:[{ml:[C]}],"space-x":[{"space-x":[J]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[J]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Se,o]}],"min-w":[{"min-w":[Se,o,"min","max","fit"]}],"max-w":[{"max-w":[Se,o,"none","full","min","max","fit","prose",{screen:[Kr]},Kr]}],h:[{h:[Se,o,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Se,o,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Se,o,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Se,o,"auto","min","max","fit"]}],"font-size":[{text:["base",Kr,Gr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Pu]}],"font-family":[{font:[Eo]}],"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",Se]}],"line-clamp":[{"line-clamp":["none",ws,Pu]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",br,Se]}],"list-image":[{"list-image":["none",Se]}],"list-style-type":[{list:["none","disc","decimal",Se]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[s]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[s]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Me(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",br,Gr]}],"underline-offset":[{"underline-offset":["auto",br,Se]}],"text-decoration-color":[{decoration:[s]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ue()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Se]}],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",Se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...De(),db]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",cb]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},pb]}],"bg-color":[{bg:[s]}],"gradient-from-pos":[{from:[A]}],"gradient-via-pos":[{via:[A]}],"gradient-to-pos":[{to:[A]}],"gradient-from":[{from:[O]}],"gradient-via":[{via:[O]}],"gradient-to":[{to:[O]}],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:[h]}],"border-w-x":[{"border-x":[h]}],"border-w-y":[{"border-y":[h]}],"border-w-s":[{"border-s":[h]}],"border-w-e":[{"border-e":[h]}],"border-w-t":[{"border-t":[h]}],"border-w-r":[{"border-r":[h]}],"border-w-b":[{"border-b":[h]}],"border-w-l":[{"border-l":[h]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...Me(),"hidden"]}],"divide-x":[{"divide-x":[h]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[h]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:Me()}],"border-color":[{border:[d]}],"border-color-x":[{"border-x":[d]}],"border-color-y":[{"border-y":[d]}],"border-color-s":[{"border-s":[d]}],"border-color-e":[{"border-e":[d]}],"border-color-t":[{"border-t":[d]}],"border-color-r":[{"border-r":[d]}],"border-color-b":[{"border-b":[d]}],"border-color-l":[{"border-l":[d]}],"divide-color":[{divide:[d]}],"outline-style":[{outline:["",...Me()]}],"outline-offset":[{"outline-offset":[br,Se]}],"outline-w":[{outline:[br,Gr]}],"outline-color":[{outline:[s]}],"ring-w":[{ring:Ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[s]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[br,Gr]}],"ring-offset-color":[{"ring-offset":[s]}],shadow:[{shadow:["","inner","none",Kr,hb]}],"shadow-color":[{shadow:[Eo]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...Pe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Pe()}],filter:[{filter:["","none"]}],blur:[{blur:[i]}],brightness:[{brightness:[u]}],contrast:[{contrast:[v]}],"drop-shadow":[{"drop-shadow":["","none",Kr,Se]}],grayscale:[{grayscale:[x]}],"hue-rotate":[{"hue-rotate":[b]}],invert:[{invert:[j]}],saturate:[{saturate:[V]}],sepia:[{sepia:[L]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[i]}],"backdrop-brightness":[{"backdrop-brightness":[u]}],"backdrop-contrast":[{"backdrop-contrast":[v]}],"backdrop-grayscale":[{"backdrop-grayscale":[x]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[b]}],"backdrop-invert":[{"backdrop-invert":[j]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[V]}],"backdrop-sepia":[{"backdrop-sepia":[L]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[g]}],"border-spacing-x":[{"border-spacing-x":[g]}],"border-spacing-y":[{"border-spacing-y":[g]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Se]}],duration:[{duration:E()}],ease:[{ease:["linear","in","out","in-out",Se]}],delay:[{delay:E()}],animate:[{animate:["none","spin","ping","pulse","bounce",Se]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[z]}],"scale-x":[{"scale-x":[z]}],"scale-y":[{"scale-y":[z]}],rotate:[{rotate:[Co,Se]}],"translate-x":[{"translate-x":[te]}],"translate-y":[{"translate-y":[te]}],"skew-x":[{"skew-x":[B]}],"skew-y":[{"skew-y":[B]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Se]}],accent:[{accent:["auto",s]}],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",Se]}],"caret-color":[{caret:[s]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ue()}],"scroll-mx":[{"scroll-mx":ue()}],"scroll-my":[{"scroll-my":ue()}],"scroll-ms":[{"scroll-ms":ue()}],"scroll-me":[{"scroll-me":ue()}],"scroll-mt":[{"scroll-mt":ue()}],"scroll-mr":[{"scroll-mr":ue()}],"scroll-mb":[{"scroll-mb":ue()}],"scroll-ml":[{"scroll-ml":ue()}],"scroll-p":[{"scroll-p":ue()}],"scroll-px":[{"scroll-px":ue()}],"scroll-py":[{"scroll-py":ue()}],"scroll-ps":[{"scroll-ps":ue()}],"scroll-pe":[{"scroll-pe":ue()}],"scroll-pt":[{"scroll-pt":ue()}],"scroll-pr":[{"scroll-pr":ue()}],"scroll-pb":[{"scroll-pb":ue()}],"scroll-pl":[{"scroll-pl":ue()}],"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",Se]}],fill:[{fill:[s,"none"]}],"stroke-w":[{stroke:[br,Gr,Pu]}],stroke:[{stroke:[s,"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"]}}},vb=eb(yb);function ne(...s){return vb($v(s))}function Lo(s){return s?s.replace(/127\.0\.0\.1|localhost/g,"192.168.178.151"):""}function St(s){return(s/1024**3).toFixed(1)}function rc(s){return s?s>1024**3?`${(s/1024**3).toFixed(1)} GB`:`${(s/1024**2).toFixed(0)} MB`:""}function jn(s){if(!s)return"—";const o=s/1024**3;return o>=1?`${o.toFixed(1)} GB`:`${(s/1024**2).toFixed(0)} MB`}function bb(s){if(!s)return"";const o=Math.floor(s/60);return o>0?`${o} min`:`${s} s`}function Gp(s){return s?`${Math.round(s/1024)}k`:"—"}function Vo({type:s,title:o,message:i,defaultValue:u,onConfirm:d,onCancel:f}){const g=m.useRef(null);return n.jsx("div",{className:"fixed inset-0 z-[99] bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:o}),n.jsx("button",{onClick:f||(()=>d()),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Ln,{className:"h-4 w-4"})})]}),n.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:i}),s==="prompt"&&n.jsx("input",{ref:g,type:"text",defaultValue:u,className:"w-full h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground",autoFocus:!0,onKeyDown:h=>{var v;h.key==="Enter"&&d((v=g.current)==null?void 0:v.value)}}),n.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[(s==="confirm"||s==="prompt")&&n.jsx("button",{onClick:f,className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Abbrechen"}),n.jsx("button",{onClick:()=>{var v;const h=s==="prompt"?(v=g.current)==null?void 0:v.value:void 0;d(h)},className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/95 rounded-lg transition-colors cursor-pointer",children:s==="confirm"?"Ja, fortfahren":s==="prompt"?"Übernehmen":"OK"})]})]})})}function ui({value:s,label:o,detail:i}){const d=2*Math.PI*24,f=d-Math.min(s,100)/100*d,g=s>90?"stroke-red-500":s>75?"stroke-amber-500":"stroke-primary";return n.jsxs("div",{className:"flex flex-col items-center gap-1.5 p-2 bg-background/20 rounded-xl border border-border/40",children:[n.jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[n.jsxs("svg",{className:"absolute inset-0 h-full w-full -rotate-90",children:[n.jsx("circle",{cx:"32",cy:"32",r:24,className:"stroke-muted fill-none",strokeWidth:"4.5"}),n.jsx("circle",{cx:"32",cy:"32",r:24,className:ne("fill-none transition-all duration-700 ease-out",g),strokeWidth:"4.5",strokeDasharray:d,strokeDashoffset:f,strokeLinecap:"round"})]}),n.jsxs("span",{className:"text-xs font-mono font-bold tracking-tight text-foreground",children:[Math.round(s),"%"]})]}),n.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:o}),i&&n.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/80",children:i})]})}function wb(){var U;const[s,o]=m.useState(null),[i,u]=m.useState(null),[d,f]=m.useState([]),[g,h]=m.useState([]),[v,x]=m.useState([]),[b,j]=m.useState(null),[M,O]=m.useState([]),[A,w]=m.useState(null),[C,_]=m.useState(""),[$,V]=m.useState(!1),[z,L]=m.useState(""),[B,J]=m.useState(!1),[te,re]=m.useState({open:!1,actionPath:"",actionLabel:""}),[ee,ge]=m.useState(null),[ue,Ae]=m.useState(!1);async function Ee(F){try{await me("/api/agent/brain",{method:"POST",body:JSON.stringify({model:F})}),ge({type:"alert",title:"Erfolgreich",message:`Hermes-Gehirn wurde auf '${F}' geändert. Der Gateway-Dienst wurde neu gestartet.`,onConfirm:()=>ge(null)}),k(),Ae(!1)}catch(we){ge({type:"alert",title:"Fehler",message:`Fehler beim Wechseln des Gehirns: ${we.message}`,onConfirm:()=>ge(null)})}}function De(F,we,at){ge({type:"confirm",title:F,message:we,onConfirm:()=>{ge(null),at()},onCancel:()=>ge(null)})}const[Me,Pe]=m.useState(""),[Q,ce]=m.useState("stable"),[q,E]=m.useState(!1);function k(){me("/api/system/status").then(o).catch(()=>{}),me("/api/agent/status").then(u).catch(()=>{}),me("/api/models").then(F=>{f(F.models||[]),h(F.running||[])}).catch(()=>{}),me("/api/memory?category=").then(F=>x(F.slice(0,3))).catch(()=>{}),me("/api/maintenance/updates").then(j).catch(()=>{}),me("/api/jobs").then(F=>O(F.jobs||[])).catch(()=>{}),me("/api/system/token-stats").then(w).catch(()=>{})}m.useEffect(()=>{k();const F=setInterval(k,3e3);return()=>clearInterval(F)},[]);async function G(F,we,at,Ct){_(`${we} wird ausgeführt...`),V(!0);try{const Et={...at},Pt=await me(F,{method:"POST",body:JSON.stringify(Et)});if(Pt.status==="password_required"||Pt.status==="incorrect_password"){re({open:!0,actionPath:F,actionLabel:we,payload:at,error:Pt.status==="incorrect_password"?"Falsches Sudo-Passwort. Bitte erneut versuchen.":void 0}),_("");return}Pt.job_id?_(`${we} gestartet (Job-ID: ${Pt.job_id})`):Pt.ok?_(`${we} erfolgreich ausgeführt.`):_(`Fehler: ${Pt.err||"Unbekannter Fehler"}`),k()}catch(Et){_(`Fehler bei ${we}: ${Et.message}`)}finally{V(!1)}}async function X(){J(!0);try{const F={...te.payload,sudo_password:z},we=await me(te.actionPath,{method:"POST",body:JSON.stringify(F)});if(we.status==="password_required"||we.status==="incorrect_password"){re(at=>({...at,error:"Falsches Sudo-Passwort. Bitte erneut versuchen."}));return}we.job_id?_(`${te.actionLabel} gestartet (Job-ID: ${we.job_id})`):we.ok?_(`${te.actionLabel} erfolgreich ausgeführt.`):_(`Fehler: ${we.err||"Unbekannter Fehler"}`),re({open:!1,actionPath:"",actionLabel:""}),L(""),k()}catch(F){_(`Fehler: ${F.message}`),re({open:!1,actionPath:"",actionLabel:""}),L("")}finally{J(!1)}}async function Z(F,we){_(`Upgrade für ${F} wird gestartet...`);try{await me("/api/models/install",{method:"POST",body:JSON.stringify({repo:F,role:we,quant:"Q4_K_M",jinja:!0})}),_("Upgrade-Download gestartet."),k()}catch(at){_(`Upgrade fehlgeschlagen: ${at.message}`)}}async function ie(){if(!(!Me.trim()||q)){E(!0);try{await me("/api/memory",{method:"POST",body:JSON.stringify({content:Me,category:Q,source:"dashboard"})}),Pe(""),me("/api/memory?category=").then(F=>x(F.slice(0,3))).catch(()=>{})}catch(F){console.error(F)}finally{E(!1)}}}const he=M.find(F=>F.label.includes("OS-Update")&&(F.state==="running"||F.state==="queued")),xe=M.find(F=>F.label.includes("Engine-Update")&&(F.state==="running"||F.state==="queued"));return n.jsxs("div",{className:"space-y-6",children:[te.open&&n.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-4",children:n.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-border/60 bg-card/90 backdrop-blur-xl p-5 shadow-2xl space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-primary font-space",children:"Sudo-Passwort erforderlich"}),n.jsx("button",{onClick:()=>{re({open:!1,actionPath:"",actionLabel:""}),L("")},className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Ln,{className:"h-4 w-4"})})]}),n.jsxs("p",{className:"text-[10px] text-muted-foreground leading-normal",children:["Für die Aktion ",n.jsx("strong",{children:te.actionLabel})," wird das Administrator-Passwort (Sudo) auf der Box benötigt."]}),n.jsxs("div",{className:"space-y-2",children:[n.jsx("input",{type:"password",value:z,onChange:F=>L(F.target.value),placeholder:"Sudo-Passwort eingeben...",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground",onKeyDown:F=>F.key==="Enter"&&X(),autoFocus:!0}),te.error&&n.jsx("div",{className:"text-[10px] font-semibold text-red-400",children:te.error})]}),n.jsxs("div",{className:"flex gap-2 justify-end",children:[n.jsx("button",{onClick:()=>{re({open:!1,actionPath:"",actionLabel:""}),L("")},className:"h-8 px-3 rounded-lg border border-border/60 bg-background/25 text-[10px] font-bold uppercase hover:bg-accent transition-all cursor-pointer",children:"Abbrechen"}),n.jsx("button",{onClick:X,disabled:!z||B,className:"h-8 px-4 rounded-lg bg-primary text-primary-foreground text-[10px] font-bold uppercase hover:opacity-90 transition-all disabled:opacity-50 cursor-pointer flex items-center justify-center gap-1.5",children:B?"Prüfe...":"Ausführen"})]})]})}),n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Zentrale"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Aktueller Status von System, Modellen und Agent."})]}),n.jsxs("div",{className:"grid gap-6 md:grid-cols-3",children:[n.jsxs("div",{className:"md:col-span-2 flex flex-col justify-between rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(At,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"System-Status"})]}),s?n.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[n.jsx(ui,{value:s.cpu.percent,label:"CPU",detail:s.cpu.cores?`${s.cpu.cores} Cores`:void 0}),n.jsx(ui,{value:s.ram.percent,label:"RAM",detail:`${St(s.ram.used)} / ${St(s.ram.total)} GB`}),s.gpu&&s.gpu.busy_percent!=null&&s.gpu.gtt_used!=null&&s.gpu.gtt_total!=null&&n.jsx(ui,{value:s.gpu.busy_percent,label:"GPU",detail:`${St(s.gpu.gtt_used)} / ${St(s.gpu.gtt_total)} GB`}),s.disk&&n.jsx(ui,{value:s.disk.percent,label:"Disk",detail:`${St(s.disk.used)} / ${St(s.disk.total)} GB`})]}):n.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Systemdaten…"})]}),(s==null?void 0:s.temp)&&(s.temp.cpu||s.temp.gpu)&&n.jsxs("div",{className:"mt-4 flex gap-4 text-xs font-mono text-muted-foreground/80 border-t border-border/30 pt-3",children:[s.temp.cpu!=null&&n.jsxs("span",{children:["CPU Temp: ",s.temp.cpu," °C"]}),s.temp.gpu!=null&&n.jsxs("span",{children:["GPU Temp: ",s.temp.gpu," °C"]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2 border-b border-border/20 pb-2",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(P0,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Updates & Pflege"})]}),(b==null?void 0:b.last_check)&&n.jsxs("span",{className:"text-[9px] text-muted-foreground/80 font-mono",children:["Zuletzt gesucht: ",new Date(b.last_check*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"})]})]}),b?n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:ne("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",b.os>0?"border-amber-500/30 bg-amber-500/5 text-amber-400 font-semibold":"border-border/30 bg-background/25 text-muted-foreground"),children:[n.jsx("span",{children:"OS-Pakete"}),n.jsx("span",{className:"font-mono",children:b.os>0?`${b.os} verfügbar`:"aktuell"})]}),n.jsxs("div",{className:ne("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",b.engine>0?"border-amber-500/30 bg-amber-500/5 text-amber-400 font-semibold":"border-border/30 bg-background/25 text-muted-foreground"),children:[n.jsx("span",{children:"Engine (llama.cpp)"}),n.jsx("span",{className:"font-mono",children:b.engine>0?"Update verfügbar":"aktuell"})]}),n.jsxs("div",{className:ne("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",b.models>0?"border-primary/30 bg-primary/5 text-primary font-semibold animate-pulse":"border-border/30 bg-background/25 text-muted-foreground"),children:[n.jsx("span",{children:"Modell-Upgrades"}),n.jsx("span",{className:"font-mono",children:b.models>0?`${b.models} verfügbar`:"aktuell"})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-2 border-t border-border/20 pt-3",children:[n.jsx("button",{onClick:()=>G("/api/maintenance/os-update","OS-Update"),disabled:$||!!he,className:"h-8 px-2 rounded-lg border border-border/60 bg-background/20 text-[10px] font-bold uppercase hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer disabled:opacity-50 flex items-center justify-center gap-1",children:he?n.jsxs(n.Fragment,{children:[n.jsx(Tn,{className:"h-3 w-3 animate-spin text-primary"}),n.jsxs("span",{children:["Aktiv (",he.progress??0,"%)"]})]}):n.jsx("span",{children:"OS Update"})}),n.jsx("button",{onClick:()=>G("/api/maintenance/engine-update","Engine-Update"),disabled:$||!!xe,className:"h-8 px-2 rounded-lg border border-border/60 bg-background/20 text-[10px] font-bold uppercase hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer disabled:opacity-50 flex items-center justify-center gap-1",children:xe?n.jsxs(n.Fragment,{children:[n.jsx(Tn,{className:"h-3 w-3 animate-spin text-primary"}),n.jsxs("span",{children:["Aktiv (",xe.progress??0,"%)"]})]}):n.jsx("span",{children:"Engine Update"})})]}),n.jsxs("button",{onClick:()=>{De("Host-System neu starten?","Bist du sicher, dass du das Host-System neu starten willst?",()=>G("/api/maintenance/reboot","Reboot"))},disabled:$,className:"w-full h-8 flex items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/5 text-red-400 text-[10px] font-bold uppercase hover:bg-red-500/10 transition-all cursor-pointer disabled:opacity-50",children:[n.jsx(Ch,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:"Host Reboot"})]}),b.model_list.length>0&&n.jsxs("div",{className:"space-y-1.5 border-t border-border/20 pt-3",children:[n.jsx("div",{className:"text-[9px] uppercase font-bold text-muted-foreground/60 tracking-wider",children:"Verfügbare Modell-Upgrades:"}),n.jsx("div",{className:"max-h-24 overflow-y-auto space-y-1.5 pr-1 scrollbar-thin",children:b.model_list.map(F=>n.jsxs("div",{className:"flex items-center justify-between p-2 rounded bg-background/25 border border-border/30 text-[10px] font-mono text-muted-foreground",children:[n.jsxs("span",{className:"truncate flex-1 mr-1.5",title:`${F.role}: ${F.repo}`,children:[n.jsx("span",{className:"text-primary font-bold uppercase",children:F.role}),": ",F.repo.split("/").pop()]}),n.jsxs("button",{onClick:()=>Z(F.repo,F.role),className:"px-2 py-0.5 text-[8px] font-bold uppercase rounded bg-primary text-primary-foreground hover:opacity-90 transition-all cursor-pointer flex items-center gap-0.5",children:[n.jsx(An,{className:"h-2.5 w-2.5"})," Laden"]})]},F.repo))})]})]}):n.jsx("div",{className:"h-24 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Updates..."}),C&&n.jsx("div",{className:"text-[10px] font-mono text-primary font-medium bg-primary/5 p-2 rounded-lg border border-primary/20 break-all leading-normal",children:C}),n.jsxs("div",{className:"text-[9px] text-muted-foreground/60 leading-normal border-t border-border/10 pt-2.5 flex items-start gap-1",children:[n.jsx(zn,{className:"h-3 w-3 shrink-0 text-muted-foreground/50 mt-0.5"}),n.jsxs("span",{children:["OS-Update & Reboot benötigen NOPASSWD in ",n.jsx("code",{children:"/etc/sudoers"})," (z.B. ",n.jsx("code",{children:"hitonabi ALL=(root) NOPASSWD:..."}),") oder ein gültiges Sudo-Passwort per Pop-up."]})]})]}),n.jsx("div",{className:"mt-4 border-t border-border/30 pt-3 shrink-0",children:n.jsx("button",{onClick:()=>window.dispatchEvent(new CustomEvent("open-system-drawer")),className:"w-full h-8 flex items-center justify-center gap-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all cursor-pointer shadow-md shadow-primary/10",children:"System-Zentrale öffnen"})})]})]}),n.jsxs("div",{className:"grid gap-6 md:grid-cols-2 xl:grid-cols-4",children:[n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center justify-between mb-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Oo,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Hermes Agent"})]}),(i==null?void 0:i.webui_url)&&n.jsxs("a",{href:Lo(i.webui_url),target:"_blank",rel:"noopener",className:ne("flex items-center gap-1 px-3 py-1 rounded-lg text-xs font-medium transition-all",i.webui_reachable?"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/20":"border border-border text-muted-foreground"),children:[n.jsx(gi,{className:"h-3 w-3"})," Hermes öffnen"]})]}),i?n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[n.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Gateway"}),n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[n.jsx("span",{className:ne("h-2 w-2 rounded-full",i.gateway_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),n.jsx("span",{className:"text-xs font-medium",children:i.gateway_reachable?"Online":"Offline"})]})]}),n.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[n.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"WebUI"}),n.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[n.jsx("span",{className:ne("h-2 w-2 rounded-full",i.webui_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),n.jsx("span",{className:"text-xs font-medium",children:i.webui_reachable?"Online":"Offline"})]})]})]}),n.jsxs("div",{onClick:()=>Ae(!0),className:"p-3 bg-background/20 rounded-xl border border-border/40 hover:border-primary/45 hover:bg-background/30 transition-all duration-300 cursor-pointer group",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("span",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Aktives Gehirn"}),n.jsxs("button",{className:"flex items-center gap-1 text-[9px] font-bold uppercase tracking-wider text-primary border border-primary/20 bg-primary/10 hover:bg-primary/20 px-1.5 py-0.5 rounded transition-all cursor-pointer font-space",children:[n.jsx(At,{className:"h-3 w-3"})," Ändern"]})]}),n.jsxs("div",{className:"text-xs font-medium mt-1 font-mono text-primary flex items-center gap-1.5",children:[n.jsx(To,{className:"h-3.5 w-3.5"}),i.brain_model?`model: ${i.brain_model}`:"model: auto"]})]})]}):n.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Agenten-Status…"})]}),n.jsx("div",{className:"mt-3 text-[10px] text-muted-foreground/80 border-t border-border/30 pt-3",children:"Gedächtnis & Stack-Tools via MCP gekoppelt."})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(To,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Rollen-Belegung"})]}),n.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto pr-1 scrollbar-thin",children:["fast","heavy","coder","reasoning","vision","scout"].map(F=>{var Ct;const we=d.find(Et=>Et.role===F),at=we?g.includes(we.name):!1;return n.jsxs("div",{className:ne("flex items-center justify-between p-2 rounded-xl border transition-all duration-300",at?"border-emerald-500/30 bg-emerald-500/5 shadow-sm shadow-emerald-500/5":we?"border-primary/20 bg-primary/5":"border-border/30 bg-background/10 opacity-60"),children:[n.jsx("div",{className:"min-w-0 flex-1 mr-2",children:n.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[n.jsx("span",{className:ne("text-[9px] font-semibold uppercase px-1.5 py-0.5 rounded font-mono border tracking-wider shrink-0",F==="fast"?"bg-cyan-500/15 text-cyan-400 border-cyan-500/25":F==="heavy"?"bg-amber-500/15 text-amber-400 border-amber-500/25":F==="coder"?"bg-violet-500/15 text-violet-400 border-violet-500/25":F==="reasoning"?"bg-emerald-500/15 text-emerald-400 border-emerald-500/25":F==="vision"?"bg-pink-500/15 text-pink-400 border-pink-500/25":"bg-teal-500/15 text-teal-400 border-teal-500/25"),children:F}),n.jsxs("div",{className:"flex flex-col min-w-0",children:[n.jsx("span",{className:"text-xs font-semibold truncate font-mono text-foreground",children:we?(Ct=we.name.split("/").pop())==null?void 0:Ct.replace(/\.gguf$/i,""):"nicht zugewiesen"}),we&&n.jsxs("div",{className:"flex gap-1 items-center mt-0.5 flex-wrap",children:[we.prompt_cache&&n.jsx("span",{className:"text-[7px] leading-none font-mono font-bold bg-cyan-500/10 text-cyan-400 border border-cyan-500/20 px-1 py-0.5 rounded",title:"Prompt Caching aktiv",children:"PC"}),we.spec_draft_model&&n.jsx("span",{className:"text-[7px] leading-none font-mono font-bold bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 px-1 py-0.5 rounded",title:`Speculative Decoding aktiv (Draft: ${we.spec_draft_model})`,children:"SPEC"}),we.parallel_slots>1&&n.jsxs("span",{className:"text-[7px] leading-none font-mono font-bold bg-violet-500/10 text-violet-400 border border-violet-500/20 px-1 py-0.5 rounded",title:`${we.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",we.parallel_slots]})]})]})]})}),n.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:we?at?n.jsxs("span",{className:"flex items-center gap-1 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider font-mono",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]}):n.jsx("span",{className:"text-[8px] font-semibold text-muted-foreground uppercase tracking-wider font-mono",children:"bereit"}):n.jsx("span",{className:"text-[8px] font-semibold text-muted-foreground/60 uppercase tracking-wider font-mono",children:"—"})})]},F)})})]}),n.jsx("div",{className:"mt-4 text-[10px] text-muted-foreground/80 border-t border-border/30 pt-3",children:"Laden erfolgt automatisch per Auto-Swap."})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(Do,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Gedächtnis"})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("textarea",{value:Me,onChange:F=>Pe(F.target.value),placeholder:"Fakt / Regel im Pool speichern...",rows:2,className:"w-full resize-none rounded-xl border border-border/50 bg-background/30 p-2 text-[10px] outline-none focus:ring-1 focus:ring-primary transition-all leading-normal"}),n.jsxs("div",{className:"flex items-center gap-2 justify-between",children:[n.jsxs("select",{value:Q,onChange:F=>ce(F.target.value),className:"h-7 rounded-lg border border-border/50 bg-background/50 px-2 text-[10px] outline-none cursor-pointer",children:[n.jsx("option",{value:"stable",children:"🔵 Fakt"}),n.jsx("option",{value:"instruction",children:"📋 Regel"}),n.jsx("option",{value:"user",children:"👤 User"}),n.jsx("option",{value:"versioned",children:"🟡 Version"})]}),n.jsxs("button",{onClick:ie,disabled:!Me.trim()||q,className:"flex h-7 items-center gap-1 rounded-lg bg-primary px-3 text-[10px] font-semibold text-primary-foreground hover:opacity-90 disabled:opacity-50 transition-all cursor-pointer",children:[n.jsx(Sh,{className:"h-3.5 w-3.5"})," Speichern"]})]})]}),n.jsxs("div",{className:"mt-3.5 space-y-1.5",children:[n.jsx("div",{className:"text-[9px] text-muted-foreground uppercase font-bold tracking-wider",children:"Zuletzt gespeichert:"}),n.jsx("div",{className:"max-h-20 overflow-y-auto space-y-1 pr-1 scrollbar-thin",children:v.length===0?n.jsx("div",{className:"text-[10px] text-muted-foreground/75 py-1",children:"Keine Einträge vorhanden."}):v.map(F=>n.jsxs("div",{className:"text-[10px] bg-background/10 border border-border/30 rounded p-1.5 flex items-start gap-1.5",children:[n.jsx("span",{className:"shrink-0 text-[8px] font-mono text-muted-foreground/80 px-1 py-0.5 rounded bg-muted/20",children:F.category}),n.jsx("span",{className:"truncate flex-1 text-muted-foreground hover:text-foreground transition-colors",title:F.content,children:F.content})]},F.id))})]})]}),n.jsx("div",{className:"mt-4 text-[10px] text-muted-foreground/80 border-t border-border/30 pt-3",children:"Steht allen Clients per MCP zur Verfügung."})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[n.jsxs("div",{children:[n.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[n.jsx(m0,{className:"h-4.5 w-4.5 text-primary animate-pulse"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Effizienz & Ersparnis"})]}),A?n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-2.5",children:[n.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40 text-left",children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Geld gespart"}),n.jsxs("div",{className:"text-base font-bold text-emerald-400 mt-0.5 tracking-tight font-space",children:[A.saved_eur.toLocaleString("de-DE",{minimumFractionDigits:2})," €"]}),n.jsxs("div",{className:"text-[8px] text-muted-foreground/80 mt-0.5 font-mono",children:["(",A.saved_usd.toLocaleString("en-US",{minimumFractionDigits:2})," $)"]})]}),n.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40 text-left",children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Gesamt-Tokens"}),n.jsx("div",{className:"text-base font-bold text-primary mt-0.5 tracking-tight font-space",children:A.total_tokens.toLocaleString("de-DE")}),n.jsx("div",{className:"text-[8px] text-muted-foreground/80 mt-0.5 font-mono",children:"(Lokale Inferenz)"})]})]}),n.jsxs("div",{className:"space-y-2 border-t border-border/20 pt-3 text-[10px] text-muted-foreground",children:[n.jsxs("div",{className:"flex justify-between items-center font-mono",children:[n.jsx("span",{children:"Input (Prompts):"}),n.jsxs("span",{className:"font-semibold text-foreground",children:[A.prompt_tokens.toLocaleString("de-DE")," tkn"]})]}),n.jsxs("div",{className:"flex justify-between items-center font-mono",children:[n.jsx("span",{children:"Output (Antworten):"}),n.jsxs("span",{className:"font-semibold text-foreground",children:[A.completion_tokens.toLocaleString("de-DE")," tkn"]})]})]})]}):n.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Statistiken…"})]}),n.jsxs("div",{className:"mt-4 text-[9px] text-muted-foreground/70 border-t border-border/30 pt-2.5 leading-normal",children:["Berechnet im Vergleich zu Cloud-APIs von Juni 2026",(U=A==null?void 0:A.pricing)!=null&&U.heavy?`${A.pricing.heavy.in.toFixed(2).replace(".",",")} $ / ${A.pricing.heavy.out.toFixed(2).replace(".",",")} $ pro 1M tkn).`:"."]})]})]}),i&&ue&&n.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[n.jsx(At,{className:"h-4 w-4"}),n.jsx("span",{children:"Hermes-Gehirn konfigurieren"})]}),n.jsx("button",{onClick:()=>Ae(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Ln,{className:"h-4 w-4"})})]}),n.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:['Das „Gehirn" ist das primäre LLM für Hermes. Wähle ein Modell aus deiner Bibliothek oder nutze ein Gateway-Alias (',n.jsx("code",{className:"text-primary font-semibold",children:"auto"})," / ",n.jsx("code",{className:"text-primary font-semibold",children:"fast"})," / ",n.jsx("code",{className:"text-primary font-semibold",children:"heavy"}),"):"]}),n.jsx("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:["auto","fast","heavy",...d.map(F=>{var we;return((we=F.name.split("/").pop())==null?void 0:we.replace(".gguf",""))||F.name})].map(F=>{const we=["auto","fast","heavy"].includes(F);return n.jsxs("button",{onClick:()=>Ee(F),className:ne("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border border-border/30",i.brain_model===F||!i.brain_model&&F==="auto"?"text-primary font-bold bg-primary/10 border-primary/30":"text-foreground bg-background/20"),children:[n.jsxs("div",{className:"flex flex-col text-left",children:[n.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:F}),n.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:we?"Gateway Routing Alias":"Installiertes GGUF Modell"})]}),(i.brain_model===F||!i.brain_model&&F==="auto")&&n.jsx(As,{className:"h-4 w-4 shrink-0 text-primary"})]},F)})})]})}),ee&&n.jsx(Vo,{type:ee.type,title:ee.title,message:ee.message,onConfirm:()=>ee.onConfirm(),onCancel:ee.onCancel})]})}function kn({children:s,tone:o="muted"}){const i={muted:"bg-muted text-muted-foreground",primary:"bg-primary/15 text-primary",warn:"bg-amber-500/15 text-amber-500"};return n.jsx("span",{className:`rounded px-1.5 py-0.5 text-[11px] font-medium ${i[o]}`,children:s})}function Kp({caps:s}){return s?n.jsxs("span",{className:"inline-flex flex-wrap gap-1",children:[s.coder&&n.jsx(kn,{children:"💻 Code"}),s.vision&&n.jsx(kn,{children:"👁 Bild"}),s.reasoning&&n.jsx(kn,{children:"🧠 Reason"}),s.moe&&n.jsxs(kn,{tone:"primary",children:["🧩 MoE",s.active_b?`·${s.active_b}b`:""]}),s.tools==="yes"&&n.jsx(kn,{tone:"primary",children:"🛠 Tools"}),s.tools==="likely"&&n.jsx(kn,{tone:"warn",children:"🛠 Tools?"}),s.embedding&&n.jsx(kn,{children:"🔢 Embed"})]}):null}function jb({onError:s}){const[o,i]=m.useState([]),[u,d]=m.useState(null);function f(){me("/api/jobs").then(x=>i(x.jobs||[])).catch(()=>{})}m.useEffect(()=>{f();const x=setInterval(f,2e3);return()=>clearInterval(x)},[]);async function g(x){try{await me(`/api/jobs/${x}/cancel`,{method:"POST"}),f()}catch(b){s?s(b.message):d(b.message)}}const h=o.filter(x=>x.state==="running"||x.state==="queued"),v=o.filter(x=>x.state!=="running"&&x.state!=="queued").slice(-3);return h.length===0&&v.length===0?null:n.jsxs("div",{className:"space-y-3 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-4 shadow-lg shadow-black/10",children:[n.jsx("div",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Aktive Downloads"}),h.map(x=>n.jsxs("div",{className:"space-y-1.5 p-3 rounded-xl bg-background/20 border border-border/40",children:[n.jsxs("div",{className:"flex justify-between items-center text-xs",children:[n.jsx("span",{className:"font-semibold truncate max-w-[250px]",children:x.label}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-muted-foreground font-mono",children:[x.progress??0,"% • ",rc(x.done_bytes),"/",rc(x.total_bytes),x.eta_s?` • ETA ${bb(x.eta_s)}`:""]}),n.jsx("button",{onClick:()=>g(x.id),className:"text-[10px] text-red-400 hover:text-red-300 font-semibold border border-red-500/25 bg-red-500/5 px-2 py-0.5 rounded transition-all cursor-pointer",children:"Abbrechen"})]})]}),n.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted",children:n.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-500",style:{width:`${x.progress??0}%`}})})]},x.id)),v.map(x=>n.jsxs("div",{className:"flex justify-between items-center text-xs text-muted-foreground px-1",children:[n.jsx("span",{className:"truncate",children:x.label}),n.jsx("span",{className:ne("font-semibold text-[10px] px-1.5 py-0.5 rounded uppercase font-mono",x.state==="done"?"bg-emerald-500/10 text-emerald-400":"bg-amber-500/10 text-amber-400"),children:x.state})]},x.id)),u&&n.jsx(Vo,{type:"alert",title:"Fehler",message:u,onConfirm:()=>d(null)})]})}function kb({fit:s}){const o={perfect:"bg-emerald-500/15 text-emerald-400 border border-emerald-500/20",marginal:"bg-amber-500/15 text-amber-400 border border-amber-500/20",too_tight:"bg-red-500/15 text-red-400 border border-red-500/20"}[s.level];return n.jsxs("span",{className:ne("rounded px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider font-mono",o),children:[s.text," • ",s.req_gb," GB RAM"]})}const Nb=["fast","heavy","coder","reasoning","agent","vision","scout"];function Qp(s){const o=s.toLowerCase();return o.includes("qwen")?{name:"Qwen",color:"bg-purple-500/20 text-purple-300 border-purple-500/30",initial:"Q"}:o.includes("gemma")?{name:"Gemma",color:"bg-blue-500/20 text-blue-300 border-blue-500/30",initial:"G"}:o.includes("llama")?{name:"Llama",color:"bg-red-500/20 text-red-300 border-red-500/30",initial:"🦙"}:o.includes("mistral")||o.includes("mixtral")?{name:"Mistral",color:"bg-orange-500/20 text-orange-300 border-orange-500/30",initial:"M"}:o.includes("deepseek")?{name:"DeepSeek",color:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30",initial:"D"}:o.includes("hermes")||o.includes("nous")?{name:"Hermes",color:"bg-amber-500/20 text-amber-300 border-amber-500/30",initial:"H"}:o.includes("phi")?{name:"Phi",color:"bg-emerald-500/20 text-emerald-300 border-emerald-500/30",initial:"Φ"}:{name:"Other",color:"bg-slate-500/20 text-slate-300 border-slate-500/30",initial:"AI"}}function Sb(){var Bn,Cr,ur,Hn,Us;const[s,o]=m.useState([]),[i,u]=m.useState([]),[d,f]=m.useState(null),[g,h]=m.useState(null),[v,x]=m.useState(null),[b,j]=m.useState(!0),[M,O]=m.useState(""),[A,w]=m.useState(null),[C,_]=m.useState(null),[$,V]=m.useState(!1),[z,L]=m.useState(null),[B,J]=m.useState("grid"),[te,re]=m.useState("all"),[ee,ge]=m.useState(null);function ue(T,le,ke){ge({type:"alert",title:T,message:le,onConfirm:()=>{ge(null)}})}function Ae(T,le,ke,Re){ge({type:"confirm",title:T,message:le,onConfirm:()=>{ge(null),ke()},onCancel:()=>{ge(null)}})}function Ee(T,le,ke,Re,Fe){ge({type:"prompt",title:T,message:le,defaultValue:ke,onConfirm:Ht=>{ge(null),Re(Ht)},onCancel:()=>{ge(null)}})}const De=s.filter(T=>te==="in_use"?!!T.role||i.includes(T.name):!0),[Me,Pe]=m.useState({width:800,height:360}),Q=m.useRef(null),ce=m.useCallback(T=>{if(Q.current&&(Q.current.disconnect(),Q.current=null),T){const le=new ResizeObserver(ke=>{if(!ke||ke.length===0)return;const Re=ke[0].contentRect;Pe({width:Re.width,height:Re.height})});le.observe(T),Q.current=le}},[]),q=Me.width,E=Me.height,k=T=>{const le=q*.1,ke=E*T,Re=q*.5,Fe=E*.5,Ht=q*.3,cr=ke,dr=q*.3;return`M ${le} ${ke} C ${Ht} ${cr}, ${dr} ${Fe}, ${Re} ${Fe}`},G=T=>{const le=q*.5,ke=E*.5,Re=q*.9,Fe=E*T,Ht=q*.7,cr=ke,dr=q*.7;return`M ${le} ${ke} C ${Ht} ${cr}, ${dr} ${Fe}, ${Re} ${Fe}`};function X(){Promise.all([me("/api/models"),me("/api/routing"),me("/api/connect"),me("/api/maintenance/updates")]).then(([T,le,ke,Re])=>{o(T.models||[]),u(T.running||[]),f(le),h(ke),x(Re)}).catch(T=>O(String(T))).finally(()=>j(!1))}m.useEffect(()=>{X();const T=setInterval(X,4e3);return()=>clearInterval(T)},[]);async function Z(T){try{await me(`/api/models/${encodeURIComponent(T)}/load`,{method:"POST"}),X()}catch(le){ue("Fehler",`Fehler beim Laden des Modells: ${le.message}`)}}async function ie(T){try{await me(`/api/models/${encodeURIComponent(T)}/unload`,{method:"POST"}),X()}catch(le){ue("Fehler",`Fehler beim Entladen des Modells: ${le.message}`)}}async function he(){try{await me("/api/models/unload",{method:"POST"}),X()}catch(T){ue("Fehler",`Fehler beim Entladen aller Modelle: ${T.message}`)}}async function xe(T,le){try{await me(`/api/models/${encodeURIComponent(le)}/role`,{method:"POST",body:JSON.stringify({role:T||null})}),X()}catch(ke){ue("Fehler",`Fehler beim Zuweisen der Rolle: ${ke.message||ke}`)}}async function U(T,le){Ee("Kontextlänge anpassen","Gib die gewünschte Kontextlänge in Tokens an:",String(le||32768),async ke=>{if(ke)try{await me(`/api/models/${encodeURIComponent(T)}/ctx`,{method:"POST",body:JSON.stringify({ctx:parseInt(ke,10)})}),X()}catch(Re){ue("Fehler",`Fehler beim Setzen des Kontexts: ${Re.message||Re}`)}})}async function F(T){Ae("Modell löschen?",`Modell '${T}' und alle zugehörigen GGUF-Dateien unwiderruflich von der Box löschen?`,async()=>{try{await me(`/api/models/${encodeURIComponent(T)}`,{method:"DELETE"}),X()}catch(le){ue("Fehler",`Fehler beim Löschen: ${le.message||le}`)}})}async function we(T,le,ke,Re){try{await me("/api/models/install",{method:"POST",body:JSON.stringify({repo:T,role:le,quant:ke,jinja:Re})}),ue("Herunterladen gestartet",`Download für '${T}' gestartet! Der Fortschritt wird oben angezeigt.`)}catch(Fe){ue("Fehler",`Fehler beim Starten des Upgrades: ${Fe.message||Fe}`)}}async function at(T){T&&(await navigator.clipboard.writeText(T),V(!0),setTimeout(()=>V(!1),1500))}if(b)return n.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Initialisiere HUD Cockpit…"});if(M)return n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Gateway oder Engine nicht erreichbar (",M,")."]});const Ct=s.filter(T=>i.includes(T.name)),Et=Ct.reduce((T,le)=>T+(le.size_bytes||0),0),Pt=16*1024**3,Fs=Et>Pt?Et*1.2:Pt,$n=T=>s.find(le=>le.role===T),Sr=T=>{const le=$n(T);return le?i.includes(le.name):!1};return n.jsxs("div",{className:"space-y-8",children:[n.jsx("style",{children:`
@keyframes flow-dash {
to {
stroke-dashoffset: -20;
}
}
.svg-flow-path {
stroke-dasharray: 4 6;
animation: flow-dash 1s linear infinite;
}
`}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Qu,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"VRAM / Memory Belegung"})]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["Llama Swap VRAM-Pool: ",jn(Et)," / ",jn(Fs)," geladen"]}),i.length>0&&n.jsx("button",{onClick:he,className:"h-6 px-2.5 rounded border border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10 text-amber-400 text-[9px] font-bold uppercase transition-all cursor-pointer",children:"Alle entladen"})]})]}),n.jsx("div",{className:"h-7 w-full rounded-xl bg-background/50 border border-border/40 overflow-hidden flex p-0.5 relative group",children:Ct.length===0?n.jsx("div",{className:"w-full h-full flex items-center justify-center text-[10px] text-muted-foreground/60 italic font-mono select-none",children:"VRAM Leer — Auto-Swap lädt Modelle bei Anfrage"}):Ct.map((T,le)=>{var Fe;const ke=(T.size_bytes||0)/Fs*100,Re=["from-teal-500 to-emerald-500","from-indigo-500 to-blue-500","from-purple-500 to-pink-500","from-cyan-500 to-sky-500"][le%4];return n.jsxs("div",{style:{width:`${ke}%`},className:ne("h-full rounded bg-gradient-to-r flex items-center justify-between px-2.5 transition-all text-white/95 shrink-0 shadow-inner select-none",Re),title:`${T.name} (${jn(T.size_bytes)})`,children:[n.jsxs("span",{className:"text-[9px] font-bold truncate max-w-[120px] font-space tracking-wide",children:[T.role?`[${T.role}] `:"",(Fe=T.name.split("/").pop())==null?void 0:Fe.replace(".gguf","")]}),n.jsx("span",{className:"text-[8px] font-mono opacity-80",children:jn(T.size_bytes)})]},T.name)})})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Interactive Gateway Graph"}),n.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-relaxed",children:"Klicke links auf Editoren, um Configs zu kopieren. Klicke rechts auf Rollen, um GGUF-Zuweisungen live zu ändern."})]}),n.jsxs("div",{ref:ce,className:"relative w-full h-96 border border-border/30 rounded-xl bg-black/25 overflow-hidden flex",children:[n.jsxs("svg",{className:"absolute inset-0 pointer-events-none w-full h-full",children:[n.jsxs("defs",{children:[n.jsxs("linearGradient",{id:"cyan-to-teal",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0.45"}),n.jsx("stop",{offset:"100%",stopColor:"#0d9488",stopOpacity:"0.45"})]}),n.jsxs("linearGradient",{id:"active-glow",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:"0.8"}),n.jsx("stop",{offset:"100%",stopColor:"#10b981",stopOpacity:"0.8"})]})]}),n.jsx("path",{d:k(.1),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(z==="roocode"||A==="roocode")&&n.jsx("path",{d:k(.1),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:k(.3),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(z==="cursor"||A==="cursor")&&n.jsx("path",{d:k(.3),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:k(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(z==="opencode"||A==="opencode")&&n.jsx("path",{d:k(.5),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:k(.7),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(z==="zed"||A==="zed")&&n.jsx("path",{d:k(.7),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:k(.9),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(z==="continue"||A==="continue")&&n.jsx("path",{d:k(.9),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:G(.12),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),Sr("fast")&&n.jsx("path",{d:G(.12),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:G(.31),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),Sr("heavy")&&n.jsx("path",{d:G(.31),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:G(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),Sr("coder")&&n.jsx("path",{d:G(.5),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:G(.69),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),Sr("vision")&&n.jsx("path",{d:G(.69),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:G(.88),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),Sr("scout")&&n.jsx("path",{d:G(.88),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"10%"},onMouseEnter:()=>L("roocode"),onMouseLeave:()=>L(null),onClick:()=>w(T=>T==="roocode"?null:"roocode"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Roo Code"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"30%"},onMouseEnter:()=>L("cursor"),onMouseLeave:()=>L(null),onClick:()=>w(T=>T==="cursor"?null:"cursor"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Cursor IDE"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"50%"},onMouseEnter:()=>L("opencode"),onMouseLeave:()=>L(null),onClick:()=>w(T=>T==="opencode"?null:"opencode"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"OpenCode"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"70%"},onMouseEnter:()=>L("zed"),onMouseLeave:()=>L(null),onClick:()=>w(T=>T==="zed"?null:"zed"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Zed"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"90%"},onMouseEnter:()=>L("continue"),onMouseLeave:()=>L(null),onClick:()=>w(T=>T==="continue"?null:"continue"),children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),n.jsx("span",{children:"Continue"})]}),n.jsxs("div",{className:"absolute select-none z-10 w-36 py-3 px-4 -translate-y-1/2 -translate-x-1/2 rounded-2xl border border-primary/50 bg-card/90 backdrop-blur-md flex flex-col items-center justify-center text-center shadow-lg shadow-primary/5",style:{left:"50%",top:"50%"},children:[n.jsx("div",{className:"text-[10px] uppercase font-bold text-primary font-space tracking-wide",children:"Gateway Auto"}),n.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground mt-0.5",children:["Schwelle: > ",d!=null&&d.heavy_threshold_chars?d.heavy_threshold_chars/1e3:"4","k Zeichen"]}),n.jsx("div",{className:"mt-1 px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[9px] font-semibold text-primary uppercase font-mono",children:"Auto-Swap"})]}),Nb.map(T=>{var Ht;const le=["12%","31%","50%","69%","88%"],ke=$n(T),Re=ke?i.includes(ke.name):!1;if(T==="reasoning"||T==="agent")return null;const Fe={fast:0,heavy:1,coder:2,vision:3,scout:4}[T];return n.jsxs("div",{className:ne("absolute z-10 w-44 py-1.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-xl border flex flex-col justify-center hover:border-primary/50 transition-all text-left shadow select-none cursor-pointer",Re?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":ke?"border-border/60 bg-card/75":"border-dashed border-border/40 bg-background/20"),style:{left:"90%",top:le[Fe]},onClick:()=>_(T),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:T}),Re&&n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),n.jsx("div",{className:"text-[10px] font-mono font-medium truncate mt-0.5 text-foreground max-w-[150px]",children:ke?(Ht=ke.name.split("/").pop())==null?void 0:Ht.replace(".gguf",""):"Keine Zuweisung"})]},T)}),A&&g&&n.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200 flex flex-col justify-between",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("span",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:[A==="roocode"&&"Roo Code Setup",A==="cursor"&&"Cursor Setup",A==="opencode"&&"OpenCode Setup",A==="zed"&&"Zed Setup",A==="continue"&&"Continue Setup"]}),n.jsx("button",{onClick:()=>w(null),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Ln,{className:"h-4 w-4"})})]}),n.jsxs("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:[A==="roocode"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Suche in VS Code nach der Erweiterung ",n.jsx("strong",{children:"Roo Code"})," und installiere sie."]}),n.jsxs("li",{children:["Wähle in den Roo Code Einstellungen: Provider: ",n.jsx("strong",{children:"OpenAI Compatible"}),"."]}),n.jsxs("li",{children:["Füge das untenstehende JSON-Snippet in die ",n.jsx("code",{children:"settings.json"})," ein."]})]}),A==="cursor"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne Cursor Settings ➔ ",n.jsx("strong",{children:"Models"}),"."]}),n.jsxs("li",{children:["Deaktiviere Cloud-Modelle, klappe ",n.jsx("strong",{children:"OpenAI API"})," auf."]}),n.jsxs("li",{children:["Trage die Base URL unten ein und aktiviere das Modell ",n.jsx("strong",{children:"auto"}),"."]})]}),A==="opencode"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne die ",n.jsx("code",{children:"opencode.jsonc"})," Konfigurationsdatei."]}),n.jsxs("li",{children:["Ersetze den Provider-Eintrag unter ",n.jsx("code",{children:"provider"})," mit dem Snippet unten."]})]}),A==="zed"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsxs("li",{children:["Öffne die Zed Settings (",n.jsx("code",{children:"ctrl+,"}),")."]}),n.jsxs("li",{children:["Füge das untenstehende JSON-Segment unter ",n.jsx("code",{children:"language_models"})," ein."]})]}),A==="continue"&&n.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[n.jsx("li",{children:"Klicke auf das Zahnrad-Symbol in der Continue-Erweiterung."}),n.jsxs("li",{children:["Füge den Gateway-Eintrag zum ",n.jsx("code",{children:"models"}),"-Array hinzu."]})]})]}),g.tools&&n.jsxs("div",{className:"relative rounded-xl border border-border/40 bg-black/40 overflow-hidden mt-1 shrink-0",children:[n.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border/20 bg-black/20",children:[n.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:"JSON Config"}),n.jsxs("button",{onClick:()=>{var T,le,ke,Re,Fe;return at(A==="roocode"?(T=g.tools.cline)==null?void 0:T.snippet:A==="cursor"?(le=g.tools.cursor)==null?void 0:le.snippet:A==="opencode"?(ke=g.tools.opencode)==null?void 0:ke.snippet:A==="zed"?(Re=g.tools.zed)==null?void 0:Re.snippet:(Fe=g.tools.continue)==null?void 0:Fe.snippet)},className:"text-xs font-semibold text-primary hover:text-primary-foreground flex items-center gap-1 cursor-pointer",children:[$?n.jsx(As,{className:"h-3.5 w-3.5 text-emerald-400"}):n.jsx(Nh,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:$?"Kopiert":"Kopieren"})]})]}),n.jsx("pre",{className:"p-3 max-h-48 overflow-y-auto text-xs font-mono text-cyan-200/90 whitespace-pre scrollbar-thin select-text",children:n.jsxs("code",{children:[A==="roocode"&&((Bn=g.tools.cline)==null?void 0:Bn.snippet),A==="cursor"&&((Cr=g.tools.cursor)==null?void 0:Cr.snippet),A==="opencode"&&((ur=g.tools.opencode)==null?void 0:ur.snippet),A==="zed"&&((Hn=g.tools.zed)==null?void 0:Hn.snippet),A==="continue"&&((Us=g.tools.continue)==null?void 0:Us.snippet)]})})]}),n.jsx("button",{onClick:()=>w(null),className:"w-full h-9 rounded-lg bg-primary text-primary-foreground hover:opacity-90 font-semibold text-xs transition-opacity cursor-pointer mt-2",children:"Schließen"})]})})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-6 mt-3 text-[10px] text-muted-foreground border-t border-border/20 pt-3",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-cyan-400"}),n.jsx("span",{children:"Cyan-Fluss: Client-Anfrage an Gateway"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 animate-pulse"}),n.jsx("span",{children:"Grüner Puls: Aktive Verbindung / Warmes Modell geladen"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded bg-gradient-to-r from-teal-500 to-emerald-500"}),n.jsx("span",{children:"VRAM-Verlauf: Modellspezifischer Speicheranteil"})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground px-1",children:"Gateway Steckplatz-Belegung (Slot-Zuweisung)"}),n.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3",children:["fast","heavy","coder","reasoning","vision","scout"].map(T=>{var Re;const le=s.find(Fe=>Fe.role===T),ke=le?i.includes(le.name):!1;return n.jsxs("div",{onClick:()=>_(T),className:ne("rounded-xl border p-3 flex flex-col justify-between gap-2.5 transition-all cursor-pointer select-none text-left bg-background/25 hover:border-primary/45 hover:bg-background/40 group min-h-[90px]",ke?"border-emerald-500/40 shadow-sm shadow-emerald-500/5":le?"border-primary/20 bg-primary/5":"border-border/30 border-dashed opacity-75"),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:ne("text-[9px] font-bold uppercase tracking-wider font-mono px-1.5 py-0.5 rounded border",T==="fast"?"bg-cyan-500/10 text-cyan-400 border-cyan-500/20":T==="heavy"?"bg-amber-500/10 text-amber-400 border-amber-500/20":T==="coder"?"bg-violet-500/10 text-violet-400 border-violet-500/20":T==="reasoning"?"bg-emerald-500/10 text-emerald-400 border-emerald-500/20":T==="vision"?"bg-pink-500/10 text-pink-400 border-pink-500/20":"bg-teal-500/10 text-teal-400 border-teal-500/20"),children:T}),ke&&n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),n.jsx("div",{className:"text-[10px] font-mono font-medium truncate text-foreground/90 pr-1 font-space",title:le==null?void 0:le.name,children:le?(Re=le.name.split("/").pop())==null?void 0:Re.replace(/\.gguf$/i,""):"nicht zugewiesen"}),n.jsx("div",{className:"text-[8px] text-primary/70 group-hover:text-primary font-bold uppercase tracking-wider transition-colors font-space",children:"Ändern ➔"})]},T)})})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 px-1",children:[n.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:["Installierte Modell-Bibliothek (",De.length," von ",s.length,")"]}),n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[n.jsx("button",{onClick:()=>re("all"),className:ne("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",te==="all"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Vorhanden"}),n.jsx("button",{onClick:()=>re("in_use"),className:ne("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",te==="in_use"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"In Benutzung"})]}),n.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[n.jsx("button",{onClick:()=>J("grid"),className:ne("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",B==="grid"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Grid"}),n.jsx("button",{onClick:()=>J("list"),className:ne("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",B==="list"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"List"})]})]})]}),B==="grid"?n.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:De.length===0?n.jsx("div",{className:"col-span-full text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:te==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):De.map(T=>{const le=i.includes(T.name),ke=v==null?void 0:v.model_list.find(Fe=>Fe.role===T.role),Re=Qp(T.name);return n.jsxs("div",{className:ne("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-4 transition-all duration-300 hover:border-primary/40 group relative overflow-hidden",le?"border-primary/45 shadow-primary/5":T.role?"border-primary/30 bg-primary/5 shadow-inner":"border-border/60"),children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("div",{className:"flex items-start justify-between gap-3",children:n.jsxs("div",{className:"flex gap-2.5 min-w-0",children:[n.jsx("div",{className:ne("w-7 h-7 rounded-lg border flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",Re.color),title:Re.name,children:Re.initial}),n.jsxs("div",{className:"min-w-0",children:[n.jsx("h3",{className:"text-xs font-bold tracking-tight text-foreground line-clamp-2 break-all font-mono",title:T.name,children:T.name.split("/").pop()}),n.jsxs("div",{className:"flex items-center gap-2 flex-wrap mt-1",children:[n.jsx("span",{className:"text-[9px] font-mono text-muted-foreground bg-background/40 px-1.5 py-0.5 rounded border border-border/30",children:T.quant||"GGUF"}),le&&n.jsxs("span",{className:"flex items-center gap-1 text-[9px] font-semibold text-emerald-400 uppercase tracking-wider",children:[n.jsx(mi,{className:"h-3 w-3 animate-pulse"})," Warm"]}),T.role&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[9px] font-mono text-primary font-bold uppercase",children:T.role}),T.prompt_cache&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-cyan-500/10 border border-cyan-500/20 text-[9px] font-mono text-cyan-400 font-bold uppercase",title:"Prompt Caching aktiv",children:"PC"}),T.spec_draft_model&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-[9px] font-mono text-emerald-400 font-bold uppercase",title:`Speculative Decoding aktiv (Draft: ${T.spec_draft_model})`,children:"SPEC"}),T.parallel_slots>1&&n.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-violet-500/10 border border-violet-500/20 text-[9px] font-mono text-violet-400 font-bold uppercase",title:`${T.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",T.parallel_slots]})]})]})]})}),n.jsx("div",{className:"border-t border-border/30 pt-3 flex flex-wrap gap-1",children:n.jsx(Kp,{caps:T.capabilities})})]}),n.jsxs("div",{className:"space-y-3 pt-1",children:[n.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[10px] font-mono text-muted-foreground",children:[n.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[n.jsx(Qu,{className:"h-3.5 w-3.5 text-primary/80"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Größe"}),n.jsx("div",{className:"text-foreground font-semibold",children:jn(T.size_bytes)})]})]}),n.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[n.jsx(k0,{className:"h-3.5 w-3.5 text-primary/80"}),n.jsxs("div",{children:[n.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Kontext"}),n.jsx("div",{className:"text-foreground font-semibold",children:Gp(T.ctx)})]})]})]}),ke&&n.jsxs("div",{className:"p-3 bg-amber-500/5 border border-amber-500/30 rounded-xl space-y-2 flex flex-col justify-between shrink-0",children:[n.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping"}),n.jsxs("span",{children:["Upgrade verfügbar: ",ke.repo.split("/").pop()]})]}),n.jsxs("button",{onClick:()=>we(ke.repo,T.role,T.quant||"Q4_K_M",T.capabilities.tools!=="no"),className:"h-7 w-full flex items-center justify-center gap-1 rounded-lg bg-amber-500 text-black text-[10px] font-bold hover:bg-amber-400 transition-colors cursor-pointer",children:[n.jsx(An,{className:"h-3 w-3"})," Smart-Swap starten"]})]}),n.jsxs("div",{className:"flex items-center gap-1.5 border-t border-border/20 pt-3 mt-auto",children:[n.jsx("button",{onClick:()=>le?ie(T.name):Z(T.name),className:ne("flex-1 h-7 rounded-lg text-[9px] font-bold uppercase transition-all cursor-pointer border flex items-center justify-center gap-1",le?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary"),children:le?"Entladen":"Laden"}),n.jsx("button",{onClick:()=>U(T.name,T.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),n.jsx("button",{onClick:()=>F(T.name),className:"h-7 w-7 rounded-lg border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 flex items-center justify-center transition-colors cursor-pointer",title:"Modell löschen",children:n.jsx(qu,{className:"h-3.5 w-3.5"})})]})]})]},T.name)})}):n.jsx("div",{className:"space-y-2",children:De.length===0?n.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:te==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):De.map(T=>{const le=i.includes(T.name),ke=Qp(T.name);return n.jsxs("div",{className:ne("rounded-xl border bg-card/45 backdrop-blur-md p-3.5 shadow-lg shadow-black/5 flex flex-col sm:flex-row sm:items-center justify-between gap-3 hover:border-primary/40 transition-all",le?"border-primary/45":T.role?"border-primary/30 bg-primary/5":"border-border/60"),children:[n.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[n.jsx("div",{className:ne("w-8 h-8 rounded-lg border border-border/40 flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",ke.color),title:ke.name,children:ke.initial}),n.jsxs("div",{className:"min-w-0 text-left",children:[n.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[n.jsx("h4",{className:"text-xs font-bold text-foreground truncate max-w-[250px] sm:max-w-[400px] break-all font-mono",title:T.name,children:T.name.split("/").pop()}),T.role&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[8px] font-mono text-primary font-bold uppercase shrink-0",children:T.role}),T.prompt_cache&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-cyan-500/10 border border-cyan-500/20 text-[8px] font-mono text-cyan-400 font-bold uppercase shrink-0",title:"Prompt Caching aktiv",children:"PC"}),T.spec_draft_model&&n.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-[8px] font-mono text-emerald-400 font-bold uppercase shrink-0",title:`Speculative Decoding aktiv (Draft: ${T.spec_draft_model})`,children:"SPEC"}),T.parallel_slots>1&&n.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-violet-500/10 border border-violet-500/20 text-[8px] font-mono text-violet-400 font-bold uppercase shrink-0",title:`${T.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",T.parallel_slots]}),le&&n.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider shrink-0",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]})]}),n.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 mt-0.5",children:[n.jsxs("span",{children:["Größe: ",jn(T.size_bytes)]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Kontext: ",Gp(T.ctx)]}),n.jsx("span",{children:"•"}),n.jsx("span",{className:"font-mono text-[9px]",children:T.quant||"GGUF"})]})]})]}),n.jsxs("div",{className:"flex items-center gap-3 shrink-0 self-end sm:self-auto",children:[n.jsx("div",{className:"hidden lg:flex flex-wrap gap-1",children:n.jsx(Kp,{caps:T.capabilities})}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("button",{onClick:()=>le?ie(T.name):Z(T.name),className:ne("h-7 px-3 rounded-lg text-[9px] font-bold uppercase transition-all cursor-pointer border flex items-center gap-1",le?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary"),children:le?"Entladen":"Laden"}),n.jsx("button",{onClick:()=>U(T.name,T.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-all cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),n.jsx("button",{onClick:()=>F(T.name),className:"h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 transition-all cursor-pointer",title:"Modell löschen",children:n.jsx(qu,{className:"h-3.5 w-3.5"})})]})]})]},T.name)})})]}),C&&n.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:["Rolle '",C,"' konfigurieren"]}),n.jsx("button",{onClick:()=>_(null),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Ln,{className:"h-4 w-4"})})]}),n.jsxs("p",{className:"text-xs text-muted-foreground",children:["Wähle ein Modell aus deiner Bibliothek für die Rolle ",n.jsx("strong",{className:"text-foreground",children:C}),":"]}),n.jsxs("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:[n.jsx("button",{onClick:()=>{xe(C,""),_(null)},className:"w-full text-left px-3 py-2 rounded-lg text-xs hover:bg-accent text-red-400 font-semibold cursor-pointer border border-red-500/20 bg-red-500/5 flex items-center justify-between",children:n.jsx("span",{children:"Zuweisung entfernen"})}),s.map(T=>{var le;return n.jsxs("button",{onClick:()=>{xe(C,T.name),_(null)},className:ne("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border border-border/30",T.role===C?"text-primary font-bold bg-primary/10 border-primary/30":"text-foreground bg-background/20"),children:[n.jsxs("div",{className:"flex flex-col text-left",children:[n.jsx("span",{className:"truncate max-w-[280px] font-semibold",children:(le=T.name.split("/").pop())==null?void 0:le.replace(".gguf","")}),n.jsxs("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:[jn(T.size_bytes)," · ",T.quant]})]}),T.role===C&&n.jsx(As,{className:"h-4 w-4 shrink-0 text-primary"})]},T.name)})]})]})}),ee&&n.jsx(Vo,{type:ee.type,title:ee.title,message:ee.message,defaultValue:ee.defaultValue,onConfirm:ee.onConfirm,onCancel:ee.onCancel})]})}function Cb(){const[s,o]=m.useState(""),[i,u]=m.useState([]),[d,f]=m.useState("Q4_K_M"),[g,h]=m.useState(""),[v,x]=m.useState(""),[b,j]=m.useState([]);async function M(w){const C=w??s;if(C.trim()){h("Analysiere HuggingFace Repository...");try{const _=await me(`/api/hf/quants?repo=${encodeURIComponent(C)}`);o(_.repo),u(_.quants),_.quants.length&&f(_.quants.includes("Q4_K_M")?"Q4_K_M":_.quants[0]),h(_.quants.length?"":"Keine GGUF-Dateien in diesem Repository gefunden.")}catch(_){h(`Fehler: ${_}`)}}}async function O(){if(v.trim()){h("Durchsuche HuggingFace...");try{const w=await me(`/api/hf/search?q=${encodeURIComponent(v)}`);j(w.results),h(w.results.length?"":"Keine Ergebnisse gefunden.")}catch(w){h(`Suche fehlgeschlagen: ${w}`)}}}async function A(){if(s.trim()){h("Download-Job wird initiiert...");try{await me("/api/models/install",{method:"POST",body:JSON.stringify({repo:s,quant:d,jinja:!0})}),h(`Download gestartet: ${s} (${d}). Fortschritt wird oben angezeigt.`)}catch(w){h(`Download-Fehler: ${w}`)}}}return n.jsxs("div",{className:"space-y-4 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"HF Download & Suche"}),n.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[n.jsx("input",{value:s,onChange:w=>o(w.target.value),placeholder:"HF-URL oder org/repo (z.B. unsloth/Qwen2.5-Coder-7B-Instruct-GGUF)",className:"flex-1 h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx("button",{onClick:()=>M(),className:"h-9 px-4 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer whitespace-nowrap",children:"Quants laden"}),i.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("select",{value:d,onChange:w=>f(w.target.value),className:"h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none text-foreground font-semibold",children:i.map(w=>n.jsx("option",{value:w,className:"bg-popover text-foreground",children:w},w))}),n.jsxs("button",{onClick:A,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all cursor-pointer flex items-center gap-1.5",children:[n.jsx(An,{className:"h-3.5 w-3.5"})," Herunterladen"]})]})]})]}),n.jsxs("div",{className:"flex gap-2 border-t border-border/20 pt-4",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("input",{value:v,onChange:w=>x(w.target.value),onKeyDown:w=>w.key==="Enter"&&O(),placeholder:"HuggingFace durchsuchen (z.B. Llama-3.1)...",className:"w-full h-9 pl-9 pr-3 rounded-lg border border-border/60 bg-background/40 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),n.jsx(dc,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),n.jsx("button",{onClick:O,className:"h-9 px-4 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer",children:"Suchen"})]}),b.length>0&&n.jsx("div",{className:"max-h-48 space-y-1.5 overflow-y-auto border border-border/40 bg-background/20 p-2 rounded-xl scrollbar-thin",children:b.map(w=>n.jsxs("button",{onClick:()=>{o(w.repo),j([]),x(""),M(w.repo)},className:"flex w-full items-center justify-between rounded-lg px-3 py-2 text-left text-xs bg-background/10 border border-border/10 hover:border-primary/30 hover:bg-background/30 transition-all",children:[n.jsx("span",{className:"font-semibold truncate",children:w.repo}),n.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground flex items-center gap-1 shrink-0",children:[n.jsx(An,{className:"h-3 w-3"})," ",w.downloads.toLocaleString()]})]},w.repo))}),g&&n.jsx("div",{className:"text-[10px] font-medium text-primary font-mono",children:g})]})}const Eb={vision:{title:"Bilder & Vision",desc:"Verarbeitet Bilder, Screenshots und visuelle Diagramme in multimodalen Chats.",icon:Ku},coder:{title:"Coden & Entwicklung",desc:"Autovervollständigung, Refactoring und Codegenerierung direkt in deiner IDE.",icon:Vu},reasoning:{title:"Logik & Nachdenken",desc:"Komplexe logische Gedankengänge, Mathematik und tiefgründiges Planen (Reasoning).",icon:Do},agent:{title:"Autonomer Agent (Hermes)",desc:"Führt selbstständig Terminalbefehle aus und interagiert mit deinem Homelab.",icon:Oo},scout:{title:"Allrounder & Chat",desc:"Schnelle Antworten, Zusammenfassungen, Übersetzungen und alltägliche Fragen.",icon:Gu}};function Pb(){const[s,o]=m.useState(null),[i,u]=m.useState([]),[d,f]=m.useState(null),[g,h]=m.useState(""),[v,x]=m.useState(!0),[b,j]=m.useState({}),[M,O]=m.useState({}),[A,w]=m.useState(!1);m.useEffect(()=>{Promise.all([me("/api/discover"),me("/api/models"),me("/api/maintenance/updates").catch(()=>null)]).then(([_,$,V])=>{o(_),u($.models||[]),V&&f(V)}).catch(_=>h(String(_))).finally(()=>x(!1))},[]);async function C(_,$,V,z){j(L=>({...L,[_]:"Starte..."}));try{await me("/api/models/install",{method:"POST",body:JSON.stringify({repo:_,role:$,quant:V,jinja:z})}),j(L=>({...L,[_]:"Download läuft"}))}catch{j(B=>({...B,[_]:"Fehler"}))}}return v?n.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Analysiere Hardware und suche passende GGUF-Empfehlungen…"}):g||!s?n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Empfehlungsdienst temporär nicht erreichbar (",g,")."]}):n.jsxs("div",{className:"space-y-8",children:[n.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-4 rounded-xl flex flex-col sm:flex-row sm:items-center justify-between gap-3 shadow-sm",children:[n.jsxs("div",{children:["Modell-Registry geladen für ",n.jsxs("span",{className:"text-foreground font-bold",children:[s.sys_ram_gb," GB"]})," System-RAM."]}),n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Eh,{className:"h-3.5 w-3.5 text-primary fill-primary/20"}),n.jsx("span",{children:"Empfehlungen sind automatisch auf deine Box-Hardware optimiert."})]})]}),n.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:s.categories.map(_=>{const $=Eb[_.role]||{title:_.title||_.role,desc:"Spezifisches Modell für diese Systemrolle.",icon:To},V=$.icon,z=i.find(ee=>ee.role===_.role),L=d==null?void 0:d.model_list.find(ee=>ee.role===_.role),B=_.models.find(ee=>ee.repo===_.recommended)||_.models[0];if(!B)return null;const J=b[B.repo],te=_.models.filter(ee=>ee.repo!==_.recommended),re=!!M[_.role];return n.jsxs("div",{className:ne("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-5 transition-all duration-300 hover:border-primary/40",z?"border-border/60":"border-primary/20 shadow-primary/5"),children:[n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 border border-primary/20 flex items-center justify-center text-primary shadow-sm shrink-0",children:n.jsx(V,{className:"h-5.5 w-5.5"})}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-sm font-bold tracking-tight text-foreground",children:$.title}),n.jsxs("span",{className:"text-[9px] font-mono text-muted-foreground uppercase bg-background/50 px-1.5 py-0.5 rounded border border-border/30 inline-block mt-0.5",children:["Rolle: ",_.role]})]})]}),z?n.jsxs("span",{className:"flex items-center gap-1.5 text-[9px] font-bold text-emerald-400 uppercase tracking-wider bg-emerald-500/10 border border-emerald-500/20 px-2.5 py-1 rounded-lg",children:[n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"Aktiviert"]}):n.jsx("span",{className:"text-[9px] font-bold text-primary/70 uppercase tracking-wider bg-primary/10 border border-primary/20 px-2.5 py-1 rounded-lg",children:"Frei"})]}),n.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:$.desc}),n.jsx("div",{className:"p-3.5 rounded-xl bg-background/35 border border-border/30 space-y-2.5",children:z?n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-muted-foreground/60",children:"Aktive GGUF-Belegung"}),n.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:z.name,children:z.name.split("/").pop()}),n.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2",children:[n.jsxs("span",{children:["Größe: ",rc(z.size_bytes||0)]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Quant: ",z.quant||"GGUF"]})]})]}):n.jsxs("div",{className:"space-y-1.5",children:[n.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-primary/80",children:"Empfohlenes Modell"}),n.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:B.name,children:B.name}),n.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 flex-wrap",children:[n.jsxs("span",{children:["Ersteller: ",B.author]}),n.jsx("span",{children:"•"}),n.jsxs("span",{children:["Quant: ",B.quant]})]}),n.jsx("div",{className:"flex items-center gap-1.5 pt-0.5",children:n.jsx(kb,{fit:B.fit})})]})}),n.jsx("div",{className:"pt-1",children:z?L?n.jsxs("div",{className:"space-y-2",children:[n.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1.5",children:[n.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),n.jsxs("span",{children:["Bessere Version in der Registry: ",L.repo.split("/").pop()]})]}),n.jsxs("button",{onClick:()=>C(L.repo,_.role,B.quant||"Q4_K_M",B.caps.tools!=="no"),disabled:!!b[L.repo],className:"h-8 w-full flex items-center justify-center gap-1.5 rounded-lg bg-amber-500 text-black text-xs font-bold hover:bg-amber-400 disabled:opacity-50 transition-all cursor-pointer shadow-md shadow-amber-500/10",children:[n.jsx(An,{className:"h-3.5 w-3.5"}),b[L.repo]||"Auf neue Version aktualisieren"]})]}):n.jsxs("div",{className:"h-8 flex items-center justify-center gap-1.5 text-[10px] font-bold text-emerald-400 uppercase tracking-wide bg-emerald-500/5 border border-emerald-500/10 rounded-lg select-none",children:[n.jsx(As,{className:"h-4 w-4"})," Auf neuestem Stand"]}):n.jsxs("button",{onClick:()=>C(B.repo,_.role,B.quant||"Q4_K_M",B.caps.tools!=="no"),disabled:!!J,className:ne("h-8 w-full flex items-center justify-center gap-1.5 rounded-lg text-xs font-bold transition-all cursor-pointer border",J?"border-primary/40 bg-primary/5 text-primary":"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/10"),children:[n.jsx(An,{className:"h-3.5 w-3.5"}),J||"Optimales Modell einsetzen"]})})]}),te.length>0&&n.jsxs("div",{className:"border-t border-border/20 pt-3",children:[n.jsxs("button",{onClick:()=>O(ee=>({...ee,[_.role]:!re})),className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/80 hover:text-foreground transition-colors cursor-pointer",children:[re?n.jsx(f0,{className:"h-3 w-3"}):n.jsx(u0,{className:"h-3 w-3"}),n.jsxs("span",{children:["Alternative Empfehlungen anzeigen (",te.length,")"]})]}),re&&n.jsx("div",{className:"mt-2.5 space-y-2 max-h-36 overflow-y-auto pr-1 scrollbar-thin",children:te.map(ee=>n.jsxs("div",{className:"p-2 rounded-lg bg-background/25 border border-border/20 flex items-center justify-between gap-3",children:[n.jsxs("div",{className:"min-w-0",children:[n.jsx("div",{className:"text-[10px] font-mono font-bold text-foreground truncate",title:ee.name,children:ee.name}),n.jsxs("div",{className:"text-[9px] text-muted-foreground flex items-center gap-1.5 mt-0.5",children:[n.jsxs("span",{children:["Quant: ",ee.quant]}),n.jsx("span",{children:"•"}),n.jsx("span",{children:ee.fit.text})]})]}),n.jsx("button",{onClick:()=>C(ee.repo,_.role,ee.quant||"Q4_K_M",ee.caps.tools!=="no"),disabled:!!b[ee.repo],className:"h-6 px-2.5 rounded bg-background/40 hover:bg-background/80 border border-border/40 text-[9px] font-bold text-foreground transition-all cursor-pointer shrink-0 disabled:opacity-50",children:b[ee.repo]||"Installieren"})]},ee.repo))})]})]},_.role)})}),n.jsxs("div",{className:"border border-border/50 bg-card/20 rounded-2xl overflow-hidden shadow-md mt-4",children:[n.jsxs("button",{onClick:()=>w(!A),className:"w-full px-5 py-4 flex items-center justify-between text-xs font-bold uppercase tracking-wider text-muted-foreground hover:bg-card/30 transition-colors cursor-pointer",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(dc,{className:"h-4 w-4 text-primary"}),n.jsx("span",{children:"Eigenes Modell von Hugging Face laden (Erweiterte Ansicht)"})]}),n.jsx("span",{className:"text-[10px] text-primary hover:underline",children:A?"Ausblenden ▲":"Anzeigen ▼"})]}),A&&n.jsx("div",{className:"p-5 border-t border-border/20 bg-card/10",children:n.jsx(Cb,{})})]})]})}function _b(){const[s,o]=m.useState("cockpit");return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Modell-Manager"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Verwalte deine Modelle und passe das Gateway-Routing live über das interaktive Cockpit an."})]}),n.jsx("div",{className:"flex rounded-xl border border-border/60 bg-card/45 backdrop-blur-md p-1 self-start",children:["cockpit","discover"].map(i=>n.jsx("button",{onClick:()=>o(i),className:ne("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",s===i?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:i==="cockpit"?"Cockpit":"Modelle finden"},i))})]}),n.jsx(jb,{}),n.jsx("div",{className:"transition-all duration-300",children:s==="cockpit"?n.jsx(Sb,{}):n.jsx(Pb,{})})]})}const an={health:["health"],systemStatus:["system-status"],services:["services"],models:["models"],routing:["routing"],jobs:["jobs"],tokenStats:["token-stats"],agentStatus:["agent-status"],updates:["updates"],discover:["discover"],connect:s=>["connect",s??""],memory:(s,o)=>["memory",s??"",o??""]},Mb=()=>Fn({queryKey:an.health,queryFn:()=>me("/api/health"),refetchInterval:1e4}),mm=(s=5e3)=>Fn({queryKey:an.systemStatus,queryFn:()=>me("/api/system/status"),refetchInterval:s}),Rb=(s=3e3)=>Fn({queryKey:an.services,queryFn:()=>me("/api/system/services"),refetchInterval:s}),Ob=(s=4e3)=>Fn({queryKey:an.models,queryFn:()=>me("/api/models"),refetchInterval:s}),Db=(s=5e3)=>Fn({queryKey:an.agentStatus,queryFn:()=>me("/api/agent/status"),refetchInterval:s}),Tb=s=>Fn({queryKey:an.connect(s),queryFn:()=>me(s?`/api/connect?${s}`:"/api/connect")}),Ab=s=>Fn({queryKey:an.memory(s==null?void 0:s.q,s==null?void 0:s.category),queryFn:()=>{const o=new URLSearchParams;return s!=null&&s.q&&o.set("q",s.q),s!=null&&s.category&&o.set("category",s.category),me(`/api/memory?${o}`)},select:o=>s!=null&&s.limit?o.slice(0,s.limit):o});function xc(){const[s,o]=m.useState(null),i=m.useCallback(()=>o(null),[]),u=m.useCallback((h,v,x)=>{o({type:"alert",title:h,message:v,onConfirm:()=>{o(null),x==null||x()}})},[]),d=m.useCallback((h,v,x,b)=>{o({type:"confirm",title:h,message:v,onConfirm:()=>{o(null),x()},onCancel:()=>{o(null),b==null||b()}})},[]),f=m.useCallback((h,v,x,b,j)=>{o({type:"prompt",title:h,message:v,defaultValue:x,onConfirm:M=>{o(null),b(M)},onCancel:()=>{o(null),j==null||j()}})},[]),g=s?n.jsx(Vo,{...s}):null;return{showAlert:u,showConfirm:d,showPrompt:f,close:i,dialogElement:g}}function ci({label:s,percent:o,detail:i,icon:u}){const d=o>90?"bg-red-500 shadow-md shadow-red-500/20":o>75?"bg-amber-500 shadow-md shadow-amber-500/20":"bg-primary shadow-md shadow-primary/20";return n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-3 hover:border-primary/30 transition-all duration-300",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(u,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-foreground",children:s})]}),n.jsxs("span",{className:"text-xs font-mono font-bold text-foreground",children:[Math.round(o),"%"]})]}),n.jsx("div",{className:"w-full h-2 bg-background/40 rounded-full overflow-hidden border border-border/20",children:n.jsx("div",{className:ne("h-full transition-all duration-700 ease-out",d),style:{width:`${Math.min(o,100)}%`}})}),i&&n.jsx("div",{className:"text-[10px] font-mono text-muted-foreground/80",children:i})]})}function zb(){const{data:s,error:o}=mm(3e3),{data:i}=Rb(3e3),{showAlert:u,dialogElement:d}=xc(),f=o?String(o):"",[g,h]=m.useState(""),[v,x]=m.useState({});async function b(){h("Backup snapshotted...");try{const M=await me("/api/system/backup",{method:"POST"});h(M.ok?`Snapshot erzeugt: ${M.snapshot} (${M.files.length} Dateien)`:"Keine Änderungen zu sichern.")}catch(M){h(`Fehler: ${M.message}`)}}async function j(M){x(O=>({...O,[M]:!0}));try{const O=await me("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:M})});O.ok?u("Erfolgreich",`Dienst ${M} wurde erfolgreich neu gestartet.`):u("Fehler beim Neustart",`Fehler beim Neustart: ${O.err||"Unbekannter Fehler"}`)}catch(O){u("Fehler",`Fehler: ${O.message}`)}finally{x(O=>({...O,[M]:!1}))}}return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"System-Diagnose & Status"}),n.jsx("p",{className:"text-sm text-muted-foreground flex items-center gap-1",children:"Echtzeit-Ressourcen der Box, Dienst-Überwachung und Systempflege."})]}),f&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400 font-mono",children:["System-Status nicht lesbar (",f,")."]}),s&&n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[n.jsx(ci,{label:"CPU",percent:s.cpu.percent,detail:s.cpu.cores?`${s.cpu.cores} Cores`:void 0,icon:At}),n.jsx(ci,{label:"RAM",percent:s.ram.percent,detail:`${St(s.ram.used)} / ${St(s.ram.total)} GB`,icon:mi}),s.gpu&&s.gpu.busy_percent!=null&&n.jsx(ci,{label:"GPU",percent:s.gpu.busy_percent,detail:s.gpu.gtt_used!=null&&s.gpu.gtt_total?`${St(s.gpu.gtt_used)} / ${St(s.gpu.gtt_total)} GB (GTT/unified)`:s.gpu.vram_used!=null&&s.gpu.vram_total?`${St(s.gpu.vram_used)} / ${St(s.gpu.vram_total)} GB VRAM`:void 0,icon:At}),s.disk&&n.jsx(ci,{label:"Disk",percent:s.disk.percent,detail:`${St(s.disk.used)} / ${St(s.disk.total)} GB`,icon:Qu})]}),s.temp&&(s.temp.cpu||s.temp.gpu)&&n.jsxs("div",{className:"flex gap-3 text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-2.5 rounded-xl self-start w-fit",children:[s.temp.cpu!=null&&n.jsxs("span",{className:"flex items-center gap-1",children:["CPU-Temperatur: ",n.jsxs("span",{className:"text-foreground font-bold",children:[s.temp.cpu," °C"]})]}),s.temp.cpu!=null&&s.temp.gpu!=null&&n.jsx("span",{children:"|"}),s.temp.gpu!=null&&n.jsxs("span",{className:"flex items-center gap-1",children:["GPU-Temperatur: ",n.jsxs("span",{className:"text-foreground font-bold",children:[s.temp.gpu," °C"]})]})]})]}),i&&n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Homelab-Dienste"}),n.jsx("button",{onClick:()=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:"logs"}})),className:"h-7 px-3 rounded-lg border border-border/60 bg-background/25 text-[10px] font-bold uppercase hover:bg-accent text-muted-foreground transition-all cursor-pointer",children:"System-Logs anzeigen"})]}),n.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:i.services.map(M=>n.jsxs("div",{className:"flex items-center justify-between p-3.5 rounded-xl bg-background/20 border border-border/30 hover:border-primary/20 transition-all group",children:[n.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[n.jsx("span",{className:ne("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",M.ok?"bg-emerald-500":"bg-amber-500")}),n.jsxs("div",{className:"truncate",children:[n.jsx("div",{className:"text-xs font-bold text-foreground truncate",children:M.name}),n.jsx("div",{className:"text-[9px] text-muted-foreground/60 font-mono mt-0.5 truncate",children:M.url})]})]}),n.jsx("button",{onClick:()=>j(M.name),disabled:v[M.name],className:"h-7 w-7 rounded-lg border border-border/40 text-muted-foreground hover:text-primary hover:bg-primary/5 flex items-center justify-center transition-all opacity-0 group-hover:opacity-100",title:"Dienst neu starten",children:n.jsx(Tn,{className:ne("h-3.5 w-3.5",v[M.name]&&"animate-spin")})})]},M.name))}),n.jsxs("div",{className:"flex flex-wrap gap-4 border-t border-border/20 pt-4 text-[10px] font-semibold text-muted-foreground",children:[n.jsxs("a",{href:Lo(i.links.engine_ui),target:"_blank",rel:"noopener",className:"flex items-center gap-1 text-primary hover:text-primary-foreground hover:bg-primary/10 px-2 py-1 rounded transition-colors",children:[n.jsx(gi,{className:"h-3 w-3"})," Engine Dashboard (llama-swap)"]}),n.jsxs("a",{href:Lo(i.links.gateway),target:"_blank",rel:"noopener",className:"flex items-center gap-1 text-primary hover:text-primary-foreground hover:bg-primary/10 px-2 py-1 rounded transition-colors",children:[n.jsx(gi,{className:"h-3 w-3"})," OpenAI Gateway"]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"System-Backup & Snapshot"}),n.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Erzeuge einen Git-Snapshot der aktuellen Konfigurationen und des System-Zustands."})]}),n.jsx("div",{className:"flex items-center gap-3 self-start sm:self-auto shrink-0",children:n.jsxs("button",{onClick:b,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer shadow-md shadow-primary/10",children:[n.jsx(S0,{className:"h-4 w-4"})," Snapshot erstellen"]})})]}),g&&n.jsx("div",{className:"text-[10px] font-mono text-primary font-medium bg-primary/5 p-3 rounded-xl border border-primary/20",children:g}),d]})}function Lb(){const[s,o]=m.useState(localStorage.getItem("mc_host")||"192.168.178.151"),[i,u]=m.useState(localStorage.getItem("mc_mcp_path")||""),[d,f]=m.useState("cline"),[g,h]=m.useState(!1),v=new URLSearchParams({host:s});i&&v.set("mcp_path",i);const{data:x,error:b}=Tb(v.toString()),j=b?String(b):"";function M(C){o(C),C&&localStorage.setItem("mc_host",C)}function O(C){u(C),localStorage.setItem("mc_mcp_path",C)}const A=x==null?void 0:x.tools[d];async function w(){A&&(await navigator.clipboard.writeText(A.snippet),h(!0),setTimeout(()=>h(!1),1500))}return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Verbindung & Integration"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Kopiere vorgefertigte Konfigurationsdateien für deinen lokalen PC (IDEs, Cline, Roo Code, Cursor), um direkt auf das geteilte Gedächtnis und den Auto-Swap-Gateway der Box zuzugreifen."})]}),n.jsxs("div",{className:"grid gap-4 md:grid-cols-2 p-5 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md shadow-lg shadow-black/10",children:[n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[n.jsx(v0,{className:"h-3.5 w-3.5 text-primary"})," Box LAN IP-Adresse"]}),n.jsx("input",{value:s,onChange:C=>M(C.target.value),placeholder:"z.B. 192.168.178.151",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[n.jsx(y0,{className:"h-3.5 w-3.5 text-primary"})," Lokaler MCP-Scriptpfad"]}),n.jsx("input",{value:i,onChange:C=>O(C.target.value),placeholder:"z.B. F:\\Coding Stuff\\mission-control-2\\mcp\\mcp_memory.py",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]})]}),j&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler beim Generieren der Snippets: ",j]}),x&&n.jsxs("div",{className:"space-y-4",children:[n.jsx("div",{className:"flex flex-wrap gap-1 bg-card/20 p-1 border border-border/40 rounded-xl max-w-fit",children:Object.entries(x.tools).map(([C,_])=>n.jsx("button",{onClick:()=>f(C),className:ne("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",d===C?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:_.label},C))}),A&&n.jsxs("div",{className:"space-y-3",children:[A.note&&n.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-primary/5 border border-primary/20 text-xs text-muted-foreground leading-relaxed",children:[n.jsx(b0,{className:"h-4.5 w-4.5 text-primary shrink-0 mt-0.5"}),n.jsx("span",{children:A.note})]}),n.jsxs("div",{className:"flex flex-col border border-border/60 bg-black/60 rounded-2xl overflow-hidden shadow-2xl",children:[n.jsxs("div",{className:"flex h-11 items-center justify-between px-4 border-b border-border/40 bg-black/40 shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-3 w-3 rounded-full bg-red-500/80 shadow-md shadow-red-500/10"}),n.jsx("span",{className:"h-3 w-3 rounded-full bg-amber-500/80 shadow-md shadow-amber-500/10"}),n.jsx("span",{className:"h-3 w-3 rounded-full bg-emerald-500/80 shadow-md shadow-emerald-500/10"})]}),n.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground/75 bg-background/30 px-3 py-1 rounded-md border border-border/20",children:[n.jsx(xi,{className:"h-3.5 w-3.5 text-primary"}),n.jsx("span",{children:d==="cline"||d==="cursor"?"config.json":"settings.json"})]}),n.jsxs("button",{onClick:w,className:"flex h-7 px-2.5 items-center gap-1.5 rounded-lg border border-border/40 bg-background/30 text-[10px] font-semibold text-muted-foreground hover:text-foreground hover:bg-background/60 transition-all cursor-pointer",children:[g?n.jsx(As,{className:"h-3.5 w-3.5 text-emerald-400"}):n.jsx(Nh,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:g?"Kopiert":"Kopieren"})]})]}),n.jsx("pre",{className:"p-5 overflow-x-auto text-xs font-mono text-cyan-200/90 whitespace-pre leading-relaxed scrollbar-thin select-text bg-black/10",children:n.jsx("code",{children:A.snippet})})]})]})]})]})}const qp=["user","instruction","stable","versioned","ephemeral"],_u={user:{label:"User",icon:O0,color:"text-cyan-400",border:"border-cyan-500/30",bg:"bg-cyan-500/10",text:"text-cyan-400"},instruction:{label:"Regel",icon:C0,color:"text-violet-400",border:"border-violet-500/30",bg:"bg-violet-500/10",text:"text-violet-400"},stable:{label:"Fakt",icon:zn,color:"text-indigo-400",border:"border-indigo-500/30",bg:"bg-indigo-500/10",text:"text-indigo-400"},versioned:{label:"Version",icon:M0,color:"text-amber-400",border:"border-amber-500/30",bg:"bg-amber-500/10",text:"text-amber-400"},ephemeral:{label:"Temporär",icon:h0,color:"text-pink-400",border:"border-pink-500/30",bg:"bg-pink-500/10",text:"text-pink-400"}},Zp={label:"Gedächtnis",icon:kh,bg:"bg-muted/10",text:"text-muted-foreground"},Ib={user:"border-l-cyan-500/80",instruction:"border-l-violet-500/80",stable:"border-l-indigo-500/80",versioned:"border-l-amber-500/80",ephemeral:"border-l-pink-500/80"};function Fb(){const[s,o]=m.useState(""),[i,u]=m.useState(""),[d,f]=m.useState(""),[g,h]=m.useState("stable"),[v,x]=m.useState(!1),b=cc(),{showAlert:j,showConfirm:M,dialogElement:O}=xc(),{data:A=[],error:w}=Ab({q:i,category:s}),C=w?String(w):"",_=()=>b.invalidateQueries({queryKey:["memory"]});async function $(){d.trim()&&(await me("/api/memory",{method:"POST",body:JSON.stringify({content:d,category:g,source:"ui"})}),f(""),_())}async function V(L){await me(`/api/memory/${L}`,{method:"DELETE"}),_()}async function z(){x(!0);try{const L=await me("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!1})});if(L.duplicate_count===0){j("Ergebnis","Keine Dubletten gefunden — alles sauber.");return}M("Deduplizierung bestätigen",`${L.duplicate_count} Dublette(n) in ${L.groups.length} Gruppe(n) gefunden. Entfernen?`,async()=>{try{await me("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!0})}),_()}catch(B){j("Fehler",`Fehler beim Löschen: ${B.message}`)}})}catch(L){j("Fehler",`Fehler bei der Deduplizierung: ${L.message}`)}finally{x(!1)}}return n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Gedächtnis-Pool (Memory)"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Die geteilte Konstitution des Systems. Alle Instanzen (Hermes, IDEs, Gateway) lesen und schreiben hierauf per MCP-Protokoll."})]}),n.jsxs("button",{onClick:z,disabled:v,className:"flex h-9 px-4 items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-card hover:border-primary/50 transition-all cursor-pointer shadow-md disabled:opacity-50 shrink-0 self-start",children:[n.jsx(_0,{className:"h-4 w-4 text-primary animate-pulse"}),n.jsx("span",{children:"Deduplizieren"})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-4",children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Neuen Eintrag anlegen"}),n.jsx("textarea",{value:d,onChange:L=>f(L.target.value),placeholder:"Füge eine neue Regel, eine Vorliebe oder einen stabilen Fakt über das Projekt oder dich hinzu...",rows:3,className:"w-full resize-none rounded-xl border border-border/60 bg-background/30 p-3.5 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground transition-all leading-relaxed"}),n.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Kategorie"}),n.jsx("select",{value:g,onChange:L=>h(L.target.value),className:"h-8 rounded-lg border border-border/60 bg-background/50 px-2 py-1 text-xs outline-none font-semibold text-foreground cursor-pointer",children:qp.map(L=>{var B;return n.jsx("option",{value:L,className:"bg-popover text-foreground",children:((B=_u[L])==null?void 0:B.label)||L},L)})})]}),n.jsxs("button",{onClick:$,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer shadow-md shadow-primary/10",children:[n.jsx(Sh,{className:"h-4 w-4"})," Speichern"]})]})]}),n.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center gap-3",children:[n.jsxs("div",{className:"relative flex-1",children:[n.jsx("input",{value:i,onChange:L=>u(L.target.value),placeholder:"Gedächtnis durchsuchen...",className:"w-full h-9 pl-9 pr-3 rounded-lg border border-border/60 bg-card/45 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),n.jsx(dc,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 p-1 bg-card/30 border border-border/40 rounded-xl overflow-x-auto max-w-full",children:[n.jsx("button",{onClick:()=>o(""),className:ne("h-7 px-3 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer whitespace-nowrap",s?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"),children:"Alle"}),qp.map(L=>{const B=_u[L]||Zp,J=B.icon;return n.jsxs("button",{onClick:()=>o(L),className:ne("h-7 px-2.5 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer flex items-center gap-1 whitespace-nowrap",s===L?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[n.jsx(J,{className:"h-3 w-3"}),n.jsx("span",{children:B.label})]},L)})]})]}),C&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler beim Laden des Gedächtnisses: ",C]}),n.jsx("div",{className:"space-y-3",children:A.length===0?n.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center",children:"Keine Einträge für die aktuellen Filterkriterien gefunden."}):A.map(L=>{const B=_u[L.category]||Zp,J=B.icon;return n.jsxs("div",{className:ne("flex items-start justify-between gap-4 p-4 rounded-xl border border-l-4 bg-card/45 backdrop-blur-md border-border/60 shadow-md shadow-black/5 hover:border-primary/20 transition-all group",Ib[L.category]||"border-l-muted"),children:[n.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[n.jsxs("span",{className:ne("flex items-center gap-1 px-2 py-0.5 rounded text-[9px] font-bold uppercase tracking-wider font-mono shrink-0",B.bg,B.text),children:[n.jsx(J,{className:"h-3 w-3"}),n.jsx("span",{className:"hidden sm:inline",children:B.label})]}),n.jsx("span",{className:"text-xs text-foreground leading-relaxed break-words whitespace-pre-wrap flex-1",children:L.content})]}),n.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[n.jsx("span",{className:"text-[9px] font-mono text-muted-foreground/60 bg-background/20 px-1.5 py-0.5 rounded uppercase tracking-wider",children:L.source}),n.jsx("button",{onClick:()=>V(L.id),className:"h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 transition-all opacity-0 group-hover:opacity-100",title:"Eintrag löschen",children:n.jsx(qu,{className:"h-3.5 w-3.5"})})]})]},L.id)})}),O]})}function di({label:s,ok:o,detail:i,icon:u,onClick:d}){return n.jsxs("div",{onClick:d,className:ne("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-3 hover:border-primary/40 transition-all duration-300",o?"border-border/60":"border-amber-500/30",d&&"cursor-pointer hover:bg-card/70"),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:s}),n.jsx(u,{className:ne("h-4.5 w-4.5",o?"text-primary":"text-amber-500")})]}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("span",{className:ne("h-2 w-2 rounded-full ring-2 ring-black/40",o?"bg-emerald-500 animate-pulse":"bg-amber-500")}),n.jsx("span",{className:"text-xs font-semibold text-foreground",children:o?"Bereit / Online":"Offline / Inaktiv"})]}),i&&n.jsx("div",{className:"text-[10px] font-mono text-muted-foreground truncate max-w-[200px]",title:i,children:i})]}),d&&n.jsxs("button",{onClick:f=>{f.stopPropagation(),d()},className:"mt-2 flex items-center justify-center gap-1.5 w-full py-1.5 px-3 rounded-lg border border-primary/30 bg-primary/10 hover:bg-primary/20 text-primary text-[10px] font-bold uppercase tracking-wider transition-all cursor-pointer font-space",children:[n.jsx(At,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:"Gehirn wechseln"})]})]})}function Ub(){const{data:s,error:o}=Db(5e3),{data:i}=Ob(),{showAlert:u,dialogElement:d}=xc(),f=cc(),g=o?String(o):"",h=m.useMemo(()=>["auto","fast","heavy",...((i==null?void 0:i.models)??[]).map(L=>{var B;return((B=L.name.split("/").pop())==null?void 0:B.replace(".gguf",""))||L.name})],[i]),[v,x]=m.useState(null),[b,j]=m.useState(!1),[M,O]=m.useState({width:800,height:360}),A=m.useRef(null),w=m.useCallback(z=>{if(A.current&&(A.current.disconnect(),A.current=null),z){const L=new ResizeObserver(B=>{if(!B||B.length===0)return;const J=B[0].contentRect;O({width:J.width,height:J.height})});L.observe(z),A.current=L}},[]),C=M.width,_=M.height,$=(z,L,B,J)=>{const te=(z+B)/2;return`M ${z} ${L} C ${te} ${L}, ${te} ${J}, ${B} ${J}`};async function V(z){try{await me("/api/agent/brain",{method:"POST",body:JSON.stringify({model:z})}),u("Erfolgreich",`Hermes-Gehirn wurde auf '${z}' geändert. Der Gateway-Dienst wurde neu gestartet.`),f.invalidateQueries({queryKey:an.agentStatus}),j(!1)}catch(L){u("Fehler",`Fehler beim Wechseln des Gehirns: ${L.message}`)}}return n.jsxs("div",{className:"space-y-6",children:[n.jsx("style",{children:`
@keyframes flow-dash {
to {
stroke-dashoffset: -20;
}
}
.svg-flow-path {
stroke-dasharray: 4 6;
animation: flow-dash 1s linear infinite;
}
`}),n.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Hermes Agenten-Cockpit"}),n.jsxs("p",{className:"text-sm text-muted-foreground",children:["Hermes ist ein autonomer Agent, der im Hintergrund der Box läuft (Port ",n.jsx("code",{children:":8642"}),") und seine eigene UI besitzt."]})]}),(s==null?void 0:s.webui_url)&&n.jsxs("a",{href:Lo(s.webui_url),target:"_blank",rel:"noopener",className:ne("flex h-9 px-4 items-center gap-1.5 text-xs font-semibold rounded-lg transition-all cursor-pointer shadow-md shrink-0 self-start",s.webui_reachable?"bg-primary text-primary-foreground hover:opacity-90 shadow-primary/10":"border border-border/60 text-muted-foreground bg-background/20"),children:[n.jsx(gi,{className:"h-4 w-4"}),n.jsx("span",{children:"Hermes WebUI öffnen"})]})]}),g&&n.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400 font-mono",children:["Status nicht lesbar (",g,")."]}),s&&n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[n.jsx(di,{label:"Agent Gateway",ok:s.gateway_reachable,detail:"Port :8642 (REST API)",icon:Oo}),n.jsx(di,{label:"Agent WebUI",ok:s.webui_reachable,detail:"Port :8787 (Chat UI)",icon:mi}),n.jsx(di,{label:"Aktives Gehirn",ok:s.gateway_reachable,detail:s.brain_model?`Model: ${s.brain_model}`:"Model: auto",icon:At,onClick:()=>j(!0)}),n.jsx(di,{label:"Verdrahtung",ok:s.has_config,detail:`Config: ${s.has_config?"✓":"—"} · Skills: ${s.has_skills?"✓":"—"} · Memory: ${s.has_memories?"✓":"—"}`,icon:yi})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Interactive Agent Flow Graph"}),n.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-relaxed",children:"Visualisiert das Zusammenspiel und die Verbindungspfade zwischen den Hermes-Systemkomponenten."})]}),n.jsxs("div",{ref:w,className:"relative w-full h-96 border border-border/30 rounded-xl bg-black/25 overflow-hidden flex",children:[n.jsxs("svg",{className:"absolute inset-0 pointer-events-none w-full h-full",children:[n.jsxs("defs",{children:[n.jsxs("linearGradient",{id:"cyan-to-teal",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0.45"}),n.jsx("stop",{offset:"100%",stopColor:"#0d9488",stopOpacity:"0.45"})]}),n.jsxs("linearGradient",{id:"active-glow",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[n.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:"0.8"}),n.jsx("stop",{offset:"100%",stopColor:"#10b981",stopOpacity:"0.8"})]})]}),n.jsx("path",{d:$(C*.15,_*.5,C*.5,_*.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(v==="webui"||s.webui_reachable)&&n.jsx("path",{d:$(C*.15,_*.5,C*.5,_*.5),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:$(C*.5,_*.5,C*.85,_*.3),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(v==="gateway"||v==="brain"||s.gateway_reachable)&&n.jsx("path",{d:$(C*.5,_*.5,C*.85,_*.3),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),n.jsx("path",{d:$(C*.5,_*.5,C*.85,_*.7),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(v==="gateway"||v==="wiring"||s.gateway_reachable)&&n.jsx("path",{d:$(C*.5,_*.5,C*.85,_*.7),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"})]}),n.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-36 h-9 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2.5 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"15%",top:"50%"},onMouseEnter:()=>x("webui"),onMouseLeave:()=>x(null),onClick:()=>s.webui_reachable&&window.open(Lo(s.webui_url),"_blank"),title:s.webui_reachable?"Klicken um Chat-WebUI zu öffnen":"WebUI Offline",children:[n.jsx(mi,{className:ne("h-3.5 w-3.5",s.webui_reachable?"text-emerald-400":"text-amber-500")}),n.jsx("span",{children:"Agent WebUI"}),n.jsx("span",{className:ne("w-1.5 h-1.5 rounded-full animate-pulse ml-auto",s.webui_reachable?"bg-emerald-500":"bg-amber-500")})]}),n.jsxs("div",{className:"absolute select-none z-10 w-40 py-2.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-2xl border border-primary/50 bg-card/90 backdrop-blur-md flex flex-col items-center justify-center text-center shadow-lg shadow-primary/5 cursor-pointer",style:{left:"50%",top:"50%"},onMouseEnter:()=>x("gateway"),onMouseLeave:()=>x(null),children:[n.jsxs("div",{className:"flex items-center gap-1",children:[n.jsx(Oo,{className:"h-3.5 w-3.5 text-primary"}),n.jsx("span",{className:"text-[10px] uppercase font-bold text-primary font-space tracking-wide",children:"Agent Gateway"})]}),n.jsx("div",{className:"text-[9px] font-mono text-muted-foreground mt-0.5",children:"Port :8642"}),n.jsx("div",{className:ne("mt-1 px-1.5 py-0.5 rounded text-[8px] font-semibold uppercase font-mono border",s.gateway_reachable?"bg-emerald-500/10 border-emerald-500/20 text-emerald-400":"bg-red-500/10 border-red-500/20 text-red-400"),children:s.gateway_reachable?"Online":"Offline"})]}),n.jsxs("div",{className:ne("absolute z-20 w-44 py-1.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-xl border flex flex-col justify-center hover:border-primary/50 transition-all text-left shadow select-none cursor-pointer",s.gateway_reachable?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":"border-border/60 bg-card/75"),style:{left:"85%",top:"30%"},onMouseEnter:()=>x("brain"),onMouseLeave:()=>x(null),onClick:()=>j(!0),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[n.jsx(At,{className:"h-3 w-3 text-primary"}),n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Aktives Gehirn"})]}),s.gateway_reachable&&n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),n.jsx("div",{className:"text-[10px] font-mono font-medium truncate mt-0.5 text-foreground font-space",title:s.brain_model,children:s.brain_model||"auto"})]}),n.jsxs("div",{className:ne("absolute z-10 w-44 py-1.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-xl border flex flex-col justify-center hover:border-primary/50 transition-all text-left shadow select-none",s.has_config?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":"border-border/60 bg-card/75"),style:{left:"85%",top:"70%"},onMouseEnter:()=>x("wiring"),onMouseLeave:()=>x(null),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[n.jsx(yi,{className:"h-3 w-3 text-primary"}),n.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Verdrahtung"})]}),s.has_config&&n.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),n.jsxs("div",{className:"text-[9px] font-mono mt-0.5 text-muted-foreground flex gap-1 justify-between",children:[n.jsxs("span",{children:["Config: ",s.has_config?"✓":"—"]}),n.jsxs("span",{children:["Skills: ",s.has_skills?"✓":"—"]}),n.jsxs("span",{children:["Memory: ",s.has_memories?"✓":"—"]})]})]})]}),n.jsxs("div",{className:"flex flex-wrap items-center gap-6 mt-3 text-[10px] text-muted-foreground border-t border-border/20 pt-3",children:[n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-cyan-400"}),n.jsx("span",{children:"Cyan-Fluss: Client-Anfrage an Agenten"})]}),n.jsxs("span",{className:"flex items-center gap-1.5",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 animate-pulse"}),n.jsx("span",{children:"Grüner Puls: Verbindung hergestellt / Modul online"})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(zn,{className:"h-5 w-5 text-primary"}),n.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"SSH-Kopplung & Sandbox-Umgehung"})]}),n.jsxs("div",{className:"grid gap-6 md:grid-cols-2 text-xs text-muted-foreground leading-relaxed text-left",children:[n.jsxs("div",{className:"space-y-3",children:[n.jsx("h4",{className:"text-xs font-bold text-foreground",children:"1. Warum verweigert Hermes Aktionen auf dem PC?"}),n.jsx("p",{children:"Hermes ist standardmäßig so ausgerichtet, dass er sich als virtueller Assistent ohne Systemzugriff versteht. Um dies zu umgehen, musst du Hermes' **System-Prompt** in der Chat-WebUI anpassen."}),n.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[9px] text-cyan-300",children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Beispiel System-Prompt Erweiterung:"}),n.jsx("br",{}),'"Du hast über das terminal-Tool vollen SSH-Zugriff auf den Windows-PC des Users (TobisPC). Nutze SSH-Befehle um Aktionen dort auszuführen, wenn danach gefragt wird. Behaupte nie, du könntest das nicht!"']})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsx("h4",{className:"text-xs font-bold text-foreground",children:"2. SSH-Verbindung zum lokalen Windows-PC einrichten"}),n.jsx("p",{children:"Damit der Agent Befehle auf deinem PC ausführen kann, muss OpenSSH auf Windows aktiv und mit einem Key gekoppelt sein:"}),n.jsxs("ul",{className:"list-disc pl-4 space-y-1.5 text-[11px]",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"OpenSSH Server auf Windows starten:"})," In PowerShell als Admin ausführen: ",n.jsx("code",{className:"text-foreground font-mono",children:"Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0"})]}),n.jsxs("li",{children:[n.jsx("strong",{children:"SSH-Key auf der Box erzeugen:"})," ",n.jsx("code",{className:"text-foreground font-mono",children:"ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_hermes_agent"})]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Key autorisieren:"})," Kopiere den Inhalt von ",n.jsx("code",{className:"text-foreground font-mono",children:"~/.ssh/id_ed25519_hermes_agent.pub"})," in deine Windows-Datei ",n.jsx("code",{className:"text-foreground font-mono",children:"C:\\Users\\TobisPC\\.ssh\\authorized_keys"})]})]})]})]})]}),!s.gateway_reachable&&n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10 text-left",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(zn,{className:"h-5 w-5 text-amber-500"}),n.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"Hermes-Agent Diagnostics"})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-3 leading-relaxed",children:[n.jsx("p",{children:"Der Hermes-Dienst ist auf der Box derzeit offline oder kann sich nicht mit dem lokalen llama-swap verbinden."}),n.jsxs("p",{children:["Stelle sicher, dass die systemd-Dienste auf der Box laufen. Du kannst den Status im ",n.jsx("strong",{children:"OS & Updates Drawer"})," prüfen und die Dienste bei Bedarf neu starten."]}),n.jsxs("div",{className:"p-3.5 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1",children:[n.jsx("div",{className:"text-muted-foreground/60",children:"# Dienste manuell auf der Box prüfen:"}),n.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-gateway"}),n.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-webui"})]}),n.jsxs("p",{children:["Weitere Einrichtungsdetails (Brain-Konfiguration, MCP-Kopplungen, SSH-Tunneling und Such-Engines) findest du in der Dokumentationsdatei:",n.jsx("code",{className:"ml-1 px-1.5 py-0.5 rounded bg-muted/40 text-foreground border border-border/30",children:"docs/HERMES_SETUP.md"}),"."]})]})]})]}),s&&b&&n.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:n.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[n.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[n.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[n.jsx(At,{className:"h-4 w-4"}),n.jsx("span",{children:"Hermes-Gehirn konfigurieren"})]}),n.jsx("button",{onClick:()=>j(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:n.jsx(Ln,{className:"h-4 w-4"})})]}),n.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:['Das „Gehirn" ist das primäre LLM für Hermes. Wähle ein Modell aus deiner Bibliothek oder nutze ein Gateway-Alias (',n.jsx("code",{className:"text-primary font-semibold",children:"auto"})," / ",n.jsx("code",{className:"text-primary font-semibold",children:"fast"})," / ",n.jsx("code",{className:"text-primary font-semibold",children:"heavy"}),"):"]}),n.jsx("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:h.map(z=>{const L=["auto","fast","heavy"].includes(z);return n.jsxs("button",{onClick:()=>V(z),className:ne("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border border-border/30",s.brain_model===z||!s.brain_model&&z==="auto"?"text-primary font-bold bg-primary/10 border-primary/30":"text-foreground bg-background/20"),children:[n.jsxs("div",{className:"flex flex-col text-left",children:[n.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:z}),n.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:L?"Gateway Routing Alias":"Installiertes GGUF Modell"})]}),(s.brain_model===z||!s.brain_model&&z==="auto")&&n.jsx(As,{className:"h-4 w-4 shrink-0 text-primary"})]},z)})})]})}),d]})}function $b(){const[s,o]=m.useState("connect"),[i,u]=m.useState("roocode"),[d,f]=m.useState(null),g="192.168.178.151",[h,v]=m.useState(!1),[x,b]=m.useState(null);function j(){v(!0),me("/api/health").then(M=>{f(M),b(M.engine_reachable?"success":"partial")}).catch(()=>{f(null),b("fail")}).finally(()=>v(!1))}return m.useEffect(()=>{j()},[]),n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Stack-Anleitung & Vibe-Coding-Guide"}),n.jsx("p",{className:"text-sm text-muted-foreground",children:"Einsteigerfreundliche Erklärungen zu deinem Stack und Schritt-für-Schritt-Anleitungen zur Anbindung deiner Editoren."})]}),n.jsxs("div",{className:"flex gap-4 border-b border-border/40 pb-px",children:[n.jsx("button",{onClick:()=>o("connect"),className:ne("pb-3 text-xs font-bold uppercase tracking-wider border-b-2 px-1 transition-all",s==="connect"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"Editor-Anbindung"}),n.jsx("button",{onClick:()=>o("concepts"),className:ne("pb-3 text-xs font-bold uppercase tracking-wider border-b-2 px-1 transition-all",s==="concepts"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"KI-Wissensdatenbank (Juni 2026)"})]}),s==="connect"?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx("span",{className:ne("h-3 w-3 rounded-full ring-2 ring-black/40",x==="success"&&"bg-emerald-500 animate-pulse",x==="partial"&&"bg-amber-500",x==="fail"&&"bg-red-500",!x&&"bg-muted")}),n.jsxs("div",{children:[n.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Lokaler Verbindungs-Check"}),n.jsxs("div",{className:"text-[10px] text-muted-foreground mt-0.5 font-mono",children:[x==="success"&&`Erfolgreich! Dein PC hat Zugriff auf das Box-Gateway (v${(d==null?void 0:d.version)||""}).`,x==="partial"&&"Gateway erreichbar, aber die llama-cpp-Engine ist offline.",x==="fail"&&"Verbindung fehlgeschlagen. Ist die Box im selben LAN-Netzwerk?",!x&&"Verbindung wird geprüft..."]})]})]}),n.jsxs("button",{onClick:j,disabled:h,className:"h-8 px-3 flex items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-background/20 hover:border-primary/50 transition-colors disabled:opacity-50 cursor-pointer self-start sm:self-auto shrink-0",children:[n.jsx(Tn,{className:ne("h-3.5 w-3.5",h&&"animate-spin")}),n.jsx("span",{children:"Testen"})]})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center gap-2 px-1",children:[n.jsx(kh,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Wie funktioniert mein Stack?"})]}),n.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[n.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(At,{className:"h-4 w-4 text-cyan-400"}),n.jsx("h3",{className:"text-xs font-bold text-foreground",children:"1. Die Zentrale"})]}),n.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:"Dein Dashboard. Hier siehst du die CPU-/RAM- und GPU-Last der Box und siehst sofort, ob Updates anstehen."})]}),n.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(To,{className:"h-4 w-4 text-violet-400"}),n.jsx("h3",{className:"text-xs font-bold text-foreground",children:"2. Modell-Zentrale"})]}),n.jsxs("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:["Deine GGUF-Datenbank. Gesteuert von ",n.jsx("strong",{children:"llama-swap"}),". Lädt dein schnelles Alltags-Hirn (`fast`) oder dein schweres Logik-Hirn (`heavy`) vollautomatisch im VRAM."]})]}),n.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[n.jsxs("div",{className:"flex items-center gap-1.5",children:[n.jsx(Do,{className:"h-4 w-4 text-indigo-400"}),n.jsx("h3",{className:"text-xs font-bold text-foreground",children:"3. Das Gedächtnis"})]}),n.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:"Dein geteiltes Langzeitgedächtnis (Memory-Pool). Hier merkt sich dein Agent Regeln, Projekt-Details und Vorlieben."})]})]})]}),n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2 px-1",children:[n.jsx(Vu,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Vibe Coding auf dem PC einrichten"})]}),n.jsxs("div",{className:"flex gap-1.5 bg-card/20 p-1 border border-border/40 rounded-xl max-w-fit",children:[n.jsxs("button",{onClick:()=>u("roocode"),className:ne("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer flex items-center gap-1.5",i==="roocode"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:[n.jsx(Eh,{className:"h-3.5 w-3.5 fill-amber-400/20"}),"Roo Code (VS Code)"]}),n.jsx("button",{onClick:()=>u("cursor"),className:ne("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",i==="cursor"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:"Cursor IDE"}),n.jsx("button",{onClick:()=>u("opencode"),className:ne("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",i==="opencode"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:"OpenCode Desktop"})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10",children:[i==="roocode"&&n.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Roo Code Kopplung (Empfohlene Open-Source-Erweiterung)"}),n.jsx("p",{children:"Roo Code ist die beliebteste und flexibelste Vibe-Coding-Erweiterung für VS Code im Jahr 2026. Sie ermöglicht vollen Zugriff auf das Terminal und das MCP-Gedächtnis."})]}),n.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"1"}),"Roo Code installieren"]}),n.jsxs("p",{className:"pl-6",children:["Suche in VS Code nach der Erweiterung ",n.jsx("strong",{children:"Roo Code"})," und installiere sie."]})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"2"}),"API-Anbindung konfigurieren"]}),n.jsx("p",{className:"pl-6",children:"Klicke auf das Roo-Code-Symbol in der Sidebar, öffne die Einstellungen (Zahnrad) und stelle folgendes ein:"}),n.jsx("div",{className:"pl-6 pt-1",children:n.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"API Provider:"})," OpenAI Compatible"]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Base URL:"})," http://",g,":9001/v1"]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"API Key:"})," ",n.jsx("span",{className:"italic text-muted-foreground/50",children:'beliebig (z.B. "local")'})]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Model ID:"})," auto"]})]})})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"3"}),"MCP Gedächtnis verknüpfen (Optional, aber empfohlen)"]}),n.jsxs("p",{className:"pl-6",children:["Damit Roo Code auf deinen ",n.jsx("strong",{children:"Gedächtnis-Pool"})," zugreifen kann, kopiere die MCP-Konfiguration aus dem Reiter ",n.jsx("strong",{children:"Verbinden"})," und füge sie in deine lokale Roo-Code-Konfigurationsdatei ein."]})]})]})]}),i==="cursor"&&n.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Cursor IDE Kopplung (Proprietäre All-in-One IDE)"}),n.jsx("p",{children:"Cursor ist ein polierter, extrem schneller VS-Code-Fork mit hervorragenden, tief integrierten Autovervollständigungen (Tab-Completions)."})]}),n.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"1"}),"Einstellungen öffnen"]}),n.jsxs("p",{className:"pl-6",children:["Öffne Cursor, klicke oben rechts auf das Zahnrad (Settings) und navigiere zu ",n.jsx("strong",{children:"Models"}),"."]})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"2"}),"OpenAI API überschreiben"]}),n.jsxs("p",{className:"pl-6",children:["Deaktiviere die Standard-Cloudmodelle, klappe den Bereich ",n.jsx("strong",{children:"OpenAI API"})," auf und konfiguriere:"]}),n.jsx("div",{className:"pl-6 pt-1",children:n.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Override Base URL:"})," http://",g,":9001/v1"]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"API Key:"})," ",n.jsx("span",{className:"italic text-muted-foreground/50",children:'beliebig (z.B. "local")'})]})]})})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"3"}),"Modell hinzufügen"]}),n.jsxs("p",{className:"pl-6",children:["Trage in der Modell-Liste ein neues Modell mit dem Namen ",n.jsx("strong",{children:"auto"})," ein und wähle es als aktives Modell aus. Cursor leitet ab jetzt alle deine Anfragen an die Box weiter."]})]})]})]}),i==="opencode"&&n.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-sm font-bold text-foreground",children:"OpenCode Desktop Kopplung (Open-Source Vibe-Coding-App)"}),n.jsx("p",{children:"OpenCode ist eine standalone Desktop-App für ein ablenkungsfreies Coden über natürliche Sprache. Es trennt den KI-Prozess von deinem Editor."})]}),n.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"1"}),"OpenCode Desktop herunterladen"]}),n.jsx("p",{className:"pl-6",children:"Lade die Desktop-Anwendung von der offiziellen Website (opencode.ai) herunter und starte sie."})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"2"}),"Endpunkt auf Box-Gateway setzen"]}),n.jsx("p",{className:"pl-6",children:"Gehe in den Bereich Einstellungen ➔ Provider, deaktiviere die Cloud-Voreinstellungen und trage deinen lokalen Server ein:"}),n.jsx("div",{className:"pl-6 pt-1",children:n.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Base URL:"})," http://",g,":9001/v1"]}),n.jsxs("div",{children:[n.jsx("span",{className:"text-muted-foreground/60",children:"Model:"})," auto"]})]})})]}),n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[n.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"3"}),"Erster Vibe-Coding Test"]}),n.jsx("p",{className:"pl-6",children:'Starte eine neue Session und teste die Verbindung mit einem einfachen Prompt, z. B. *"Erstelle ein einfaches Skript, das die Fibonaccizahlen berechnet"*. Das Box-Gateway tauscht das Modell im Hintergrund vollautomatisch aus.'})]})]})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 space-y-3 shadow-lg shadow-black/10",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(xi,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Was tun, wenn das Coden hakt?"})]}),n.jsxs("ul",{className:"text-[11px] text-muted-foreground space-y-2 list-disc pl-4 leading-relaxed",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"Keine Verbindung?"})," Überprüfe im Live-Verbindungsprüfer oben, ob die Box-IP erreichbar ist. Stelle sicher, dass dein lokaler PC im selben WLAN/LAN-Netzwerk wie die Box eingeloggt ist."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Modell antwortet nicht?"})," Schaue unter ",n.jsx("strong",{children:"Diagnose"}),", ob der Dienst `llama-swap` aktiv (grün) is. Wenn nicht, klicke daneben auf ",n.jsx("strong",{children:"Restart"}),"."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Hermes Agent reagiert merkwürdig?"})," Starte in der Hermes WebUI einfach eine frische Session (neuen Chat). Ältere Chats sammeln Kontext-Müll an."]})]})]})]}):n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex items-start gap-4",children:[n.jsx(Gu,{className:"h-8 w-8 text-primary shrink-0 mt-0.5"}),n.jsxs("div",{className:"space-y-1",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Entwickler-Guide: Modernes Agentic Coding (2026)"}),n.jsx("p",{className:"text-xs text-muted-foreground leading-normal",children:"Willkommen im Wissenszentrum für dein Mission Control 2 Setup. Hier erfährst du, wie die verschiedenen Technologien (MoE, MCP, Skills, Hermes) zusammenarbeiten und wie du das Maximum aus deinen AI-Prozessabläufen herausholst."})]})]}),n.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[n.jsx(To,{className:"h-5 w-5 text-cyan-400"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"1. Mixture of Experts (MoE)"}),n.jsx("span",{className:"text-[9px] text-cyan-400 font-mono",children:"Effizienz durch Spezialisierung"})]})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[n.jsxs("p",{children:[n.jsx("strong",{children:"Was ist das?"})," Bei traditionellen LLMs wird für jedes Wort das gesamte neuronale Netz aktiviert. Bei MoE besteht das Modell aus mehreren spezialisierten Teilnetzwerken (den ",n.jsx("em",{children:"Experts"}),"). Ein intelligenter ",n.jsx("em",{children:"Router"})," entscheidet pro Token (Wortteil), welche Experten zur Berechnung herangezogen werden."]}),n.jsxs("p",{children:[n.jsx("strong",{children:"Warum in MC2?"})," So können extrem leistungsstarke Modelle (wie DeepSeek-V3, Mixtral oder Command R+) mit wesentlich geringeren Hardwarekosten ausgeführt werden. Es wird nur ein Bruchteil der Parameter geladen und aktiv berechnet, was Speicherplatz spart und die Inferenz beschleunigt."]}),n.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] text-foreground",children:[n.jsx("span",{className:"text-cyan-400",children:"Vorteil:"})," GPT-4-Klasse Performance bei einem Bruchteil der aktiven VRAM-Last auf deinem Homelab!"]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[n.jsx(Gu,{className:"h-5 w-5 text-violet-400"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"2. Model Context Protocol (MCP)"}),n.jsx("span",{className:"text-[9px] text-violet-400 font-mono",children:"Standardisierte Agenten-Tools"})]})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[n.jsxs("p",{children:[n.jsx("strong",{children:"Was ist das?"})," MCP ist ein offenes Protokoll (initiiert von Anthropic), das festlegt, wie ein KI-Client (z.B. Roo Code auf deinem PC) mit externen Datenquellen und Tools kommuniziert. Es funktioniert wie ein USB-Standard für KI."]}),n.jsxs("p",{children:[n.jsx("strong",{children:"Warum in MC2?"})," MCP trennt den AI-Kern von der Umgebung. Statt für jeden Editor eigene Tools zu schreiben, binden deine Agenten (Roo Code, Hermes) einfach MCP-Server an. Diese Server können Dateien lesen, Websuchen durchführen, Git bedienen oder mit deiner App interagieren."]}),n.jsxs("div",{className:"space-y-1.5 p-3 bg-background/25 rounded-xl border border-border/30 text-[10px]",children:[n.jsx("div",{className:"font-bold text-foreground",children:"Gute Quellen für MCP Server:"}),n.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-muted-foreground",children:[n.jsxs("li",{children:[n.jsx("a",{href:"https://smithery.ai/",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"Smithery Registry"})," — Ein Portal zum Suchen und automatischen Installieren von MCP Servern."]}),n.jsxs("li",{children:[n.jsx("a",{href:"https://glama.ai/mcp/servers",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"Glama MCP Registry"})," — Eine kuratierte, umfangreiche Community-Datenbank von MCP Servern."]}),n.jsxs("li",{children:[n.jsx("a",{href:"https://github.com/modelcontextprotocol/servers",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"Offizielles Anthropic Repo"})," — Das offizielle Repository mit Standards wie filesystem, postgres, sqlite, brave-search und puppeteer."]})]})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[n.jsx(Do,{className:"h-5 w-5 text-emerald-400"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"3. Agent Skills"}),n.jsx("span",{className:"text-[9px] text-emerald-400 font-mono",children:"Modulbasierte Fähigkeiten"})]})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[n.jsxs("p",{children:[n.jsx("strong",{children:"Was ist das?"})," Ein Skill ist ein Verzeichnis mit standardisierten Anweisungen, Scripten und Beispielen, das deine Agenten für spezifische Aufgaben trainiert (z.B. Test-Driven Development, Code-Vereinfachung, API-Design)."]}),n.jsxs("p",{children:[n.jsx("strong",{children:"Wie benutzt man sie?"})," Lege einen Skill-Ordner unter ",n.jsx("code",{children:".agents/skills/<name>"})," in deinem Projekt an. Das Herzstück ist die Datei ",n.jsx("code",{children:"SKILL.md"})," mit folgendem Aufbau:"]}),n.jsx("pre",{className:"p-2.5 bg-background/25 rounded-lg border border-border/30 font-mono text-[9px] text-foreground overflow-x-auto whitespace-pre",children:`---
name: tdd-pro
description: Drive development with strict TDD practices
---
# Instructions
...`}),n.jsxs("div",{className:"space-y-1.5 p-3 bg-background/25 rounded-xl border border-border/30 text-[10px]",children:[n.jsx("div",{className:"font-bold text-foreground",children:"Wo gibt es Skills & wo liegen sie?"}),n.jsxs("ul",{className:"list-disc pl-4 space-y-2.5 text-muted-foreground",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"skills.sh Registry & CLI:"})," Das offizielle offene Portal für Agent-Skills (",n.jsx("a",{href:"https://skills.sh/",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"skills.sh"}),"). Du kannst Skills direkt über das Terminal suchen und in deinem Projekt installieren:",n.jsxs("div",{className:"mt-1 font-mono text-[9px] bg-background/40 p-2 rounded border border-border/30 text-cyan-300",children:["# Nach Skills suchen:",n.jsx("br",{}),n.jsx("span",{className:"text-foreground",children:"npx skills find"}),n.jsx("br",{}),"# Skill zum aktuellen Projekt hinzufügen:",n.jsx("br",{}),n.jsx("span",{className:"text-foreground",children:"npx skills add [owner/repo]"})]})]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Globaler Pfad:"})," ",n.jsx("code",{className:"text-foreground select-all",children:"C:\\Users\\TobisPC\\.gemini\\config\\plugins\\agent-skills\\skills\\"}),". Hier sind deine vorinstallierten, global verfügbaren Skills (wie ",n.jsx("i",{children:"code-simplification"}),", ",n.jsx("i",{children:"api-and-interface-design"}),", etc.) abgelegt."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Projekt-Pfad:"})," ",n.jsx("code",{className:"text-foreground select-all",children:".agents/skills/"}),". Lege diesen Ordner im Root eines beliebigen Projekts an. Dein lokaler Editor-Agent (z.B. Roo Code) liest ihn beim Starten automatisch ein."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Vorlagen / Beispiele:"})," Kopiere einfach bestehende Skills aus dem globalen Verzeichnis oder erstelle deine eigenen, indem du eine ",n.jsx("code",{children:"SKILL.md"})," mit YAML-Header (name, description) anlegst."]})]})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[n.jsx(At,{className:"h-5 w-5 text-indigo-400"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"4. Arbeiten mit Hermes"}),n.jsx("span",{className:"text-[9px] text-indigo-400 font-mono",children:"Autonomer Box-Agent"})]})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[n.jsxs("p",{children:[n.jsx("strong",{children:"Was ist das?"})," Hermes ist der auf der Box installierte, autonome Hintergrund-Agent. Er verwaltet das Dateisystem und kann über REST (Port 8642) oder eine interaktive ChatUI (Port 8787) gesteuert werden."]}),n.jsx("p",{children:n.jsx("strong",{children:"Best Practices für Hermes:"})}),n.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"Chat-Kontext sauber halten:"})," Starte regelmäßig neue Chats. Zu große Historien verlangsamen den Agenten und führen zu Halluzinationen."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Gehirn festlegen:"})," Konfiguriere im Gateway die Modell-Rolle ",n.jsx("code",{children:"brain"})," für Hermes, damit er automatisch das passende Modell per Llama Swap lädt."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Sandbox umgehen:"})," Erweitere Hermes' System-Prompt (WebUI-Einstellungen), um Befehle über SSH an deinen Windows-PC zu leiten."]})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4 md:col-span-2",children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[n.jsx(yi,{className:"h-5 w-5 text-amber-400"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"5. Richtiges Arbeiten mit Tools (Dateien, Terminal, DevTools)"}),n.jsx("span",{className:"text-[9px] text-amber-400 font-mono",children:"Fehler vermeiden & Kosten senken"})]})]}),n.jsxs("div",{className:"grid md:grid-cols-3 gap-4 text-xs text-muted-foreground leading-normal",children:[n.jsxs("div",{className:"space-y-1.5 p-3 bg-background/10 rounded-xl border border-border/30",children:[n.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1",children:[n.jsx(xi,{className:"h-3.5 w-3.5 text-primary"})," Terminal"]}),n.jsxs("p",{className:"text-[11px]",children:["Verwende nur non-interaktive Befehle. Hänge bei langen Tasks (wie dev-Servern) ein ",n.jsx("code",{children:"&"})," an oder nutze die integrierte Job-Verwaltung. Verwende niemals interaktive Eingabeaufforderungen."]})]}),n.jsxs("div",{className:"space-y-1.5 p-3 bg-background/10 rounded-xl border border-border/30",children:[n.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1",children:[n.jsx(Vu,{className:"h-3.5 w-3.5 text-cyan-400"})," Dateimanager"]}),n.jsxs("p",{className:"text-[11px]",children:["Überschreibe keine ganzen Dateien, wenn du nur eine Zeile ändern willst. Verwende gezielte Ersetzungs-Tools (wie ",n.jsx("code",{children:"replace_file_content"}),"). Das spart massiv Token-Kosten und beugt Fehlern vor."]})]}),n.jsxs("div",{className:"space-y-1.5 p-3 bg-background/10 rounded-xl border border-border/30",children:[n.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1",children:[n.jsx(yi,{className:"h-3.5 w-3.5 text-violet-400"})," Browser DevTools"]}),n.jsx("p",{className:"text-[11px]",children:"Koppele deine Debug-Dienste mit dem Chrome-DevTools-Plugin. So kann der Agent Fehler in der Konsole live analysieren und das DOM verifizieren, anstatt blind zu raten."})]})]})]}),n.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4 md:col-span-2",children:[n.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[n.jsx(zn,{className:"h-5 w-5 text-emerald-400"}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Wie autonom ist Mission Control 2 wirklich?"}),n.jsx("span",{className:"text-[9px] text-emerald-400 font-mono",children:"Die Grenze zwischen Automatisierung und Kontrolle"})]})]}),n.jsxs("div",{className:"text-xs text-muted-foreground space-y-3 leading-normal",children:[n.jsxs("p",{children:["Mission Control 2 ist als ",n.jsx("strong",{children:"semi-autonomes Gateway"})," konzipiert. Es besitzt die Fähigkeit, komplexe Workflows komplett selbstständig durchzuführen, unterliegt jedoch strikten Sicherheitsplanken:"]}),n.jsxs("div",{className:"grid sm:grid-cols-2 gap-4 pt-1",children:[n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1 text-[11px]",children:[n.jsx(Np,{className:"h-3 w-3 text-emerald-400"})," Was läuft vollautomatisch?"]}),n.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-[11px]",children:[n.jsx("li",{children:"Modellaustausch (Routing) per llama-swap je nach Anfragetyp (z.B. Code vs. Reasoning)."}),n.jsx("li",{children:"Hintergrund-Synchronisation und Speicherung von Gedächtniseinträgen (Memory)."}),n.jsx("li",{children:"Modell-Installation und API-Key-Injektionen in Gateway-Verbindungen."})]})]}),n.jsxs("div",{className:"space-y-1.5",children:[n.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1 text-[11px]",children:[n.jsx(Np,{className:"h-3 w-3 text-amber-400"})," Wo ist menschliche Freigabe nötig?"]}),n.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-[11px]",children:[n.jsxs("li",{children:[n.jsx("strong",{children:"Systembefehle:"})," Das Ausführen von Terminal-Kommandos auf deinem PC erfordert standardmäßig deine Bestätigung."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Kritische Systemeingriffe:"})," OS-Updates, Engine-Rebuilds und Host-Reboots müssen manuell über das Dashboard ausgelöst werden."]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Gedächtnis-Löschung:"})," Permanentes Verwerfen von gesammelten Memorys wird von dir freigegeben."]})]})]})]}),n.jsxs("p",{className:"text-[11px] bg-background/25 p-3 rounded-xl border border-border/30 mt-2",children:[n.jsx("strong",{children:"Fazit:"})," Der Stack erledigt die Kärrnerarbeit (Modelle tauschen, API-Adapter bereitstellen, Sandbox-Verbindungen herstellen) komplett im Hintergrund. Er agiert als dein persönlicher, treuer Copilot, ohne jemals ungefragt schädliche Operationen auf deinem Hauptsystem auszuführen."]})]})]})]})]})]})}function Bb({title:s,hint:o}){return n.jsxs("div",{className:"space-y-4",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"text-xl font-semibold",children:s}),n.jsx("p",{className:"text-sm text-muted-foreground",children:o})]}),n.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border bg-card/50 py-20 text-center",children:[n.jsx(x0,{className:"h-8 w-8 text-muted-foreground"}),n.jsx("div",{className:"text-sm text-muted-foreground",children:"Kommt in einer späteren Phase."})]})]})}const Hb=[{id:"llama-swap",label:"Llama Swap",type:"system"},{id:"mission-control-2",label:"Mission Control 2",type:"user"},{id:"hermes-gateway",label:"Hermes Gateway",type:"user"},{id:"hermes-dashboard",label:"Hermes Dashboard",type:"user"},{id:"hermes-webui",label:"Hermes WebUI",type:"user"}];function Mu(s){return s==null?"":s>1024**3?`${(s/1024**3).toFixed(2)} GB`:`${(s/1024**2).toFixed(1)} MB`}function Wb({open:s,onClose:o,defaultTab:i="maintenance"}){const[u,d]=m.useState(null),[f,g]=m.useState([]),[h,v]=m.useState("llama-swap"),[x,b]=m.useState(""),[j,M]=m.useState(!1),[O,A]=m.useState(null),[w,C]=m.useState({}),[_,$]=m.useState("maintenance"),[V,z]=m.useState(!1),[L,B]=m.useState(null);function J(U,F,we){B({type:"alert",title:U,message:F,onConfirm:()=>{B(null),we&&we()}})}function te(U,F,we){B({type:"confirm",title:U,message:F,onConfirm:()=>{B(null),we()},onCancel:()=>B(null)})}function re(U){return U?new Date(U*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"Nie"}const[ee,ge]=m.useState(""),[ue,Ae]=m.useState(""),[Ee,De]=m.useState(!1),[Me,Pe]=m.useState(!1);m.useEffect(()=>{s&&(ge(localStorage.getItem("mc_sudo_password")||""),Ae(localStorage.getItem("mc_hf_token")||""))},[s]),m.useEffect(()=>{s&&i&&$(i)},[s,i]);const Q=m.useRef(null);function ce(){me("/api/maintenance/updates").then(d).catch(U=>console.error("Error loading updates",U))}function q(){me("/api/jobs").then(U=>g(U.jobs||[])).catch(U=>console.error("Error loading jobs",U))}function E(U){M(!0),A(null),me(`/api/maintenance/logs?service=${U}&lines=150`).then(F=>{F.ok?b(F.text):(b(`Fehler beim Laden der Logs: ${F.err||"Unbekannter Fehler"}`),(F.status==="incorrect_password"||F.status==="password_required")&&A(F.status))}).catch(F=>b(`Fehler: ${F.message}`)).finally(()=>{M(!1),setTimeout(()=>{Q.current&&(Q.current.scrollTop=Q.current.scrollHeight)},50)})}m.useEffect(()=>{if(!s)return;ce(),q();const U=setInterval(()=>{q(),ce()},3e3);return()=>clearInterval(U)},[s]),m.useEffect(()=>{!s||_!=="logs"||E(h)},[s,_,h]);async function k(){try{await me("/api/maintenance/os-update",{method:"POST"}),q(),$("maintenance")}catch(U){J("Fehler",`Fehler beim Starten des OS-Updates: ${U.message}`)}}async function G(){try{await me("/api/maintenance/engine-update",{method:"POST"}),q(),$("maintenance")}catch(U){J("Fehler",`Fehler beim Engine-Update: ${U.message}`)}}async function X(){z(!0);try{await me("/api/maintenance/check-updates",{method:"POST"}),q(),$("maintenance")}catch(U){J("Fehler",`Fehler bei der Update-Suche: ${U.message}`)}finally{z(!1)}}async function Z(U,F){try{await me("/api/models/install",{method:"POST",body:JSON.stringify({repo:U,role:F})}),J("Gestartet",`Modell-Upgrade für '${F}' (${U}) gestartet.`),q(),$("maintenance")}catch(we){J("Fehler",`Fehler beim Starten des Modell-Upgrades: ${we.message}`)}}async function ie(){te("Reboot bestätigen","Bist du sicher, dass du das gesamte Host-System neu starten willst?",async()=>{try{await me("/api/maintenance/reboot",{method:"POST"}),J("Reboot","Reboot ausgelöst. System startet neu...",()=>{o()})}catch(U){J("Fehler",`Fehler beim Reboot: ${U.message}`)}})}async function he(U){C(F=>({...F,[U]:!0}));try{const F=await me("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:U})});F.ok?J("Dienst neu gestartet",`Dienst ${U} wurde erfolgreich neu gestartet.`,()=>{_==="logs"&&h===U&&E(U)}):J("Fehler",`Fehler beim Neustart: ${F.err||"Unbekannter Fehler"}`)}catch(F){J("Fehler",`Fehler beim Neustart: ${F.message}`)}finally{C(F=>({...F,[U]:!1}))}}async function xe(U){try{await me(`/api/jobs/${U}/cancel`,{method:"POST"}),q()}catch(F){J("Fehler",`Fehler beim Abbrechen: ${F.message}`)}}return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:ne("fixed inset-0 bg-black/60 backdrop-blur-sm z-50 transition-opacity duration-300",s?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),onClick:o}),n.jsxs("div",{className:ne("fixed inset-y-0 right-0 w-full sm:w-[500px] bg-card/85 backdrop-blur-xl border-l border-border/60 shadow-2xl z-50 flex flex-col transform transition-transform duration-300 ease-in-out font-sans text-foreground",s?"translate-x-0":"translate-x-full"),children:[n.jsxs("div",{className:"flex h-16 shrink-0 items-center justify-between border-b border-border/40 px-6",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(At,{className:"h-4.5 w-4.5 text-primary"}),n.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase font-space",children:"OS-Zentrale & Pflege"})]}),n.jsx("button",{onClick:o,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-border/40 text-muted-foreground hover:bg-accent transition-colors",children:n.jsx(Ln,{className:"h-4 w-4"})})]}),n.jsxs("div",{className:"flex border-b border-border/40 px-6",children:[n.jsx("button",{onClick:()=>$("maintenance"),className:ne("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",_==="maintenance"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Wartung"}),n.jsx("button",{onClick:()=>$("logs"),className:ne("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",_==="logs"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Logs"}),n.jsx("button",{onClick:()=>$("settings"),className:ne("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",_==="settings"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"Einstellungen"})]}),n.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[_==="maintenance"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Wartungsaktionen"}),n.jsxs("div",{className:"flex items-center gap-2",children:[(u==null?void 0:u.last_check)&&n.jsxs("span",{className:"text-[9px] text-muted-foreground",children:["Zuletzt gesucht: ",re(u.last_check)]}),n.jsxs("button",{onClick:X,disabled:V,className:"flex items-center gap-1 text-[10px] font-semibold text-primary hover:text-primary/80 transition-colors disabled:opacity-50",children:[n.jsx(Tn,{className:ne("h-3 w-3",V&&"animate-spin")}),"Nach Updates suchen"]})]})]}),n.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[n.jsxs("button",{onClick:k,className:"flex flex-col items-start gap-1 p-4 rounded-xl border border-border/60 bg-background/20 hover:border-primary/50 transition-all text-left group",children:[n.jsx(zn,{className:"h-5 w-5 text-cyan-400 mb-1 group-hover:scale-105 transition-transform"}),n.jsx("span",{className:"text-xs font-semibold",children:"OS Update (apt)"}),n.jsx("span",{className:"text-[10px] text-muted-foreground",children:u!=null&&u.os?`${u.os} Updates verfügbar`:"Auf neuestem Stand"})]}),n.jsxs("button",{onClick:G,className:"flex flex-col items-start gap-1 p-4 rounded-xl border border-border/60 bg-background/20 hover:border-primary/50 transition-all text-left group",children:[n.jsx(E0,{className:"h-5 w-5 text-violet-400 mb-1 group-hover:scale-105 transition-transform"}),n.jsx("span",{className:"text-xs font-semibold",children:"Engine Update"}),n.jsx("span",{className:"text-[10px] text-muted-foreground",children:u!=null&&u.engine?"Update verfügbar":"Auf neuestem Stand"})]})]}),n.jsxs("button",{onClick:ie,className:"flex w-full items-center gap-3 p-3 rounded-xl border border-red-500/20 bg-red-500/5 hover:bg-red-500/10 text-red-400 transition-all text-left text-xs font-semibold",children:[n.jsx(Ch,{className:"h-4.5 w-4.5"}),n.jsxs("div",{children:[n.jsx("div",{children:"Host-System neu starten (Reboot)"}),n.jsx("div",{className:"text-[10px] text-red-400/80 font-normal",children:"Startet das gesamte Betriebssystem des Homelabs neu"})]})]})]}),(u==null?void 0:u.model_list)&&u.model_list.length>0&&n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Verfügbare Modell-Upgrades"}),(u==null?void 0:u.last_check)&&n.jsxs("span",{className:"text-[9px] text-muted-foreground",children:["Gesucht: ",re(u.last_check)]})]}),n.jsx("div",{className:"space-y-2",children:u.model_list.map(U=>n.jsx("div",{className:"p-3 rounded-xl border border-border/60 bg-background/20 flex flex-col gap-2",children:n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{children:[n.jsx("div",{className:"text-xs font-semibold",children:U.title}),n.jsx("div",{className:"text-[10px] font-mono text-muted-foreground",children:U.repo}),n.jsxs("div",{className:"text-[10px] text-primary font-semibold uppercase mt-0.5",children:["Rolle: ",U.role]})]}),n.jsxs("button",{onClick:()=>Z(U.repo,U.role),className:"flex items-center gap-1.5 text-[10px] font-semibold text-emerald-400 hover:text-emerald-300 border border-emerald-500/20 bg-emerald-500/5 hover:bg-emerald-500/10 px-2 py-1 rounded-lg transition-colors shrink-0",children:[n.jsx(An,{className:"h-3.5 w-3.5"}),"Upgrade"]})]})},U.role))})]}),n.jsxs("div",{className:"space-y-3",children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Hintergrund-Aufgaben"}),n.jsxs("span",{className:"text-[10px] font-mono bg-primary/10 text-primary px-1.5 py-0.5 rounded-full",children:[f.filter(U=>U.state==="running"||U.state==="queued").length," Aktiv"]})]}),n.jsx("div",{className:"space-y-3",children:f.length===0?n.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-xl p-6 text-center",children:"Aktuell keine aktiven Hintergrund-Jobs."}):f.map(U=>{const F=U.state==="running"||U.state==="queued";return n.jsxs("div",{className:ne("p-3 rounded-xl border transition-all duration-300",F?"border-primary/40 bg-primary/5 shadow-md shadow-primary/5":"border-border/40 bg-background/20 opacity-80"),children:[n.jsxs("div",{className:"flex items-start justify-between gap-3",children:[n.jsxs("div",{className:"space-y-1",children:[n.jsxs("div",{className:"text-xs font-semibold flex items-center gap-1.5",children:[F&&n.jsxs("span",{className:"flex h-2 w-2 relative",children:[n.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),n.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),U.label]}),n.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground uppercase flex items-center gap-2",children:[n.jsxs("span",{children:["ID: ",U.id]}),n.jsx("span",{children:"•"}),n.jsx("span",{className:ne(U.state==="done"&&"text-emerald-400",U.state==="failed"&&"text-red-400",U.state==="running"&&"text-primary",U.state==="queued"&&"text-amber-400",U.state==="canceled"&&"text-muted-foreground"),children:U.state})]})]}),F&&n.jsx("button",{onClick:()=>xe(U.id),className:"text-[10px] font-semibold text-red-400 hover:text-red-300 border border-red-500/20 bg-red-500/5 hover:bg-red-500/10 px-2 py-0.5 rounded transition-colors",children:"Abbrechen"})]}),U.state==="running"&&n.jsxs("div",{className:"mt-3 space-y-1",children:[n.jsx("div",{className:"w-full h-1.5 bg-muted rounded-full overflow-hidden",children:n.jsx("div",{className:"h-full bg-primary transition-all duration-500",style:{width:`${U.progress??0}%`}})}),n.jsxs("div",{className:"flex justify-between items-center text-[9px] font-mono text-muted-foreground",children:[n.jsxs("span",{children:[U.progress??0,"%"]}),U.done_bytes!=null&&U.total_bytes!=null&&n.jsxs("span",{children:[Mu(U.done_bytes)," / ",Mu(U.total_bytes),U.rate_bps!=null&&` (${Mu(U.rate_bps)}/s)`]}),U.eta_s!=null&&n.jsxs("span",{children:["ETA: ",U.eta_s,"s"]})]})]})]},U.id)})})]})]}),_==="logs"&&n.jsxs("div",{className:"flex flex-col h-full space-y-4",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("select",{value:h,onChange:U=>v(U.target.value),className:"flex-1 h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none text-foreground font-semibold",children:Hb.map(U=>n.jsxs("option",{value:U.id,children:[U.label," (",U.type==="system"?"systemd-root":"user",")"]},U.id))}),n.jsxs("button",{onClick:()=>he(h),disabled:w[h],className:"flex h-9 px-3 items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-background/20 hover:border-primary/50 transition-colors disabled:opacity-50",title:"Dienst neu starten",children:[n.jsx(Tn,{className:ne("h-3.5 w-3.5",w[h]&&"animate-spin")}),"Restart"]})]}),n.jsxs("div",{className:"flex-1 flex flex-col min-h-[300px] border border-border/60 bg-black/50 rounded-xl overflow-hidden shadow-inner",children:[n.jsxs("div",{className:"flex h-9 items-center justify-between px-4 border-b border-border/40 bg-black/30 shrink-0",children:[n.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground",children:[n.jsx(xi,{className:"h-3 w-3 text-primary"}),n.jsxs("span",{children:["stdout/stderr - ",h]})]}),n.jsx("button",{onClick:()=>E(h),disabled:j,className:"text-muted-foreground hover:text-foreground transition-colors",children:n.jsx(Tn,{className:ne("h-3 w-3",j&&"animate-spin")})})]}),n.jsx("pre",{ref:Q,className:"flex-1 p-4 overflow-y-auto text-[10px] font-mono text-cyan-300/90 whitespace-pre-wrap select-text leading-relaxed scrollbar-thin",children:O==="password_required"||O==="incorrect_password"?n.jsxs("div",{className:"flex flex-col items-center justify-center p-6 text-center h-full space-y-3",children:[n.jsx(R0,{className:"h-8 w-8 text-amber-400 animate-pulse animate-duration-1000"}),n.jsx("div",{className:"text-xs font-semibold text-amber-300",children:O==="incorrect_password"?"Falsches Sudo-Passwort hinterlegt.":"Sudo-Passwort für systemd-Dienste erforderlich."}),n.jsxs("p",{className:"text-[10px] text-muted-foreground max-w-xs leading-normal",children:["Für das Auslesen der systemd-Logs von ",h," werden Root-Rechte benötigt. Hinterlege dein Passwort in den Einstellungen."]}),n.jsx("button",{onClick:()=>$("settings"),className:"px-3 py-1.5 text-[10px] font-semibold text-primary-foreground bg-primary hover:bg-primary/95 rounded-md transition-colors mt-2",children:"Sudo-Passwort eintragen"})]}):j&&!x?n.jsx("span",{className:"text-muted-foreground",children:"Lade Logs..."}):x||n.jsx("span",{className:"text-muted-foreground",children:"Keine Logeinträge vorhanden."})})]})]}),_==="settings"&&n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{className:"space-y-2",children:[n.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Zugangsdaten & Schlüssel"}),n.jsx("p",{className:"text-[10px] text-muted-foreground leading-normal",children:"Diese Daten werden ausschließlich lokal in deinem Browser (localStorage) gespeichert und bei Bedarf an das Backend übertragen."})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[n.jsx(zn,{className:"h-4 w-4 text-amber-400"}),"Host Sudo-Passwort"]}),n.jsxs("div",{className:"relative",children:[n.jsx("input",{type:Ee?"text":"password",value:ee,onChange:U=>ge(U.target.value),placeholder:"Sudo-Passwort für System-Operationen",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),n.jsx("button",{type:"button",onClick:()=>De(!Ee),className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:Ee?n.jsx(Sp,{className:"h-4 w-4"}):n.jsx(Ku,{className:"h-4 w-4"})})]}),n.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Wird benötigt für systemd-Dienste (Llama Swap logs/restart), OS-Update (apt) und Reboot."})]}),n.jsxs("div",{className:"space-y-2",children:[n.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[n.jsx(w0,{className:"h-4 w-4 text-violet-400"}),"HuggingFace API Token"]}),n.jsxs("div",{className:"relative",children:[n.jsx("input",{type:Me?"text":"password",value:ue,onChange:U=>Ae(U.target.value),placeholder:"hf_...",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),n.jsx("button",{type:"button",onClick:()=>Pe(!Me),className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:Me?n.jsx(Sp,{className:"h-4 w-4"}):n.jsx(Ku,{className:"h-4 w-4"})})]}),n.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Erlaubt das Herunterladen von geschützten oder Gate-restricted Modellen direkt über Mission Control."})]}),n.jsxs("div",{className:"flex gap-3 pt-2",children:[n.jsx("button",{onClick:()=>{localStorage.setItem("mc_sudo_password",ee),localStorage.setItem("mc_hf_token",ue),J("Erfolgreich","Einstellungen erfolgreich lokal gespeichert.")},className:"flex-1 h-9 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/90 rounded-lg transition-colors shadow shadow-primary/10 cursor-pointer",children:"Speichern"}),n.jsx("button",{onClick:()=>{ge(""),Ae(""),localStorage.removeItem("mc_sudo_password"),localStorage.removeItem("mc_hf_token"),J("Gelöscht","Zugangsdaten gelöscht.")},className:"h-9 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Zurücksetzen"})]})]})]})]}),L&&n.jsx(Vo,{type:L.type,title:L.title,message:L.message,onConfirm:L.onConfirm,onCancel:L.onCancel})]})}function Vb(){var j,M,O,A,w;const[s,o]=m.useState("dashboard"),[i,u]=m.useState(()=>localStorage.getItem("mc_sidebar_collapsed")==="true"),[d,f]=m.useState(!1),[g,h]=m.useState("maintenance"),{data:v}=Mb(),{data:x}=mm(2e4);m.useEffect(()=>{document.documentElement.classList.add("dark")},[]),m.useEffect(()=>{const C=_=>{var V;h(((V=_.detail)==null?void 0:V.tab)||"maintenance"),f(!0)};return window.addEventListener("open-system-drawer",C),()=>window.removeEventListener("open-system-drawer",C)},[]);const b=Zu.find(C=>C.id===s);return n.jsxs("div",{className:"flex h-full relative",children:[n.jsxs("div",{className:"fixed inset-0 -z-50 pointer-events-none overflow-hidden bg-[hsl(224,30%,6%)]",children:[n.jsx("div",{className:"absolute inset-0 opacity-35 animate-aurora bg-gradient-to-tr from-teal-500/20 via-indigo-500/15 to-purple-500/20 blur-[130px]"}),n.jsx("div",{className:"absolute top-[-10%] left-[-10%] h-[50%] w-[50%] rounded-full bg-teal-500/15 blur-[160px]"}),n.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] h-[50%] w-[50%] rounded-full bg-purple-500/15 blur-[160px]"}),n.jsx("div",{className:"absolute top-[30%] right-[20%] h-[40%] w-[40%] rounded-full bg-indigo-500/10 blur-[140px]"})]}),n.jsx(Uv,{onNavigate:o}),n.jsx(Wb,{open:d,onClose:()=>f(!1),defaultTab:g}),n.jsxs("aside",{className:ne("flex shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md transition-all duration-300 ease-in-out",i?"w-16":"w-60"),children:[n.jsxs("div",{className:ne("flex items-center py-4 border-b border-border/40 shrink-0",i?"flex-col gap-3 px-2":"justify-between px-5"),children:[n.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[n.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20 shrink-0"}),!i&&n.jsxs("div",{className:"leading-tight",children:[n.jsx("div",{className:"text-sm font-semibold tracking-wide font-space",children:"Mission Control"}),n.jsx("div",{className:"text-xs text-muted-foreground",children:"2.0"})]})]}),n.jsx("button",{onClick:()=>{u(C=>{const _=!C;return localStorage.setItem("mc_sidebar_collapsed",_.toString()),_})},className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:i?"Maximieren":"Minimieren",children:i?n.jsx(d0,{className:"h-4 w-4"}):n.jsx(c0,{className:"h-4 w-4"})})]}),n.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4 overflow-y-auto",children:Zu.map(C=>n.jsxs("button",{onClick:()=>o(C.id),className:ne("flex w-full items-center rounded-md text-sm transition-all cursor-pointer",i?"justify-center p-2.5":"gap-3 px-3 py-2",s===C.id?"bg-primary/15 text-primary shadow-sm shadow-primary/5":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),title:i?C.label:void 0,children:[n.jsx(C.icon,{className:"h-4.5 w-4.5 shrink-0"}),!i&&n.jsx("span",{className:"truncate",children:C.label})]},C.id))}),n.jsx("div",{className:ne("py-3 text-xs text-muted-foreground border-t border-border/40 shrink-0",i?"px-2 text-center":"px-5"),children:i?n.jsx("div",{className:"flex justify-center",children:n.jsx("span",{className:ne("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",v?v.engine_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500":"bg-red-500"),title:v?`Engine ${v.engine_reachable?"online":"offline"}`:"Backend offline"})}):n.jsxs("div",{className:"space-y-2 text-left",children:[v?n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx("span",{className:ne("h-2 w-2 rounded-full animate-pulse",v.engine_reachable?"bg-emerald-500":"bg-amber-500")}),n.jsxs("span",{className:"truncate",children:["Engine ",v.engine_reachable?"online":"offline"]})]}):n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"})," ",n.jsx("span",{className:"truncate",children:"Backend offline"})]}),(x==null?void 0:x.versions)&&n.jsxs("div",{className:"space-y-1 text-[9px] text-muted-foreground/60 mt-2 pt-2 border-t border-border/30",children:[n.jsxs("div",{className:"truncate",title:x.versions.mc2?`${x.versions.mc2.branch}-${x.versions.mc2.hash}${x.versions.mc2.dirty?"*":""} (${x.versions.mc2.date})`:"nicht gefunden",children:[n.jsx("strong",{children:"MC2:"})," ",x.versions.mc2?`${x.versions.mc2.hash}${x.versions.mc2.dirty?"*":""}`:"—"]}),n.jsxs("div",{className:"truncate",title:((j=x.versions.engine)==null?void 0:j.type)==="git"?`${x.versions.engine.branch}-${x.versions.engine.hash}${x.versions.engine.dirty?"*":""} (${x.versions.engine.date})`:((M=x.versions.engine)==null?void 0:M.version_text)||"unbekannt",children:[n.jsx("strong",{children:"Engine:"})," ",((O=x.versions.engine)==null?void 0:O.type)==="git"?`${x.versions.engine.hash}${x.versions.engine.dirty?"*":""}`:((w=(A=x.versions.engine)==null?void 0:A.version_text)==null?void 0:w.split(" ").pop())||"—"]}),n.jsxs("div",{className:"truncate",title:x.versions.hermes_ui?`${x.versions.hermes_ui.branch}-${x.versions.hermes_ui.hash}${x.versions.hermes_ui.dirty?"*":""} (${x.versions.hermes_ui.date})`:"nicht gefunden",children:[n.jsx("strong",{children:"Hermes UI:"})," ",x.versions.hermes_ui?`${x.versions.hermes_ui.hash}${x.versions.hermes_ui.dirty?"*":""}`:"—"]}),n.jsxs("div",{className:"truncate",title:x.versions.hermes_agent?`${x.versions.hermes_agent.branch}-${x.versions.hermes_agent.hash}${x.versions.hermes_agent.dirty?"*":""} (${x.versions.hermes_agent.date})`:"nicht gefunden",children:[n.jsx("strong",{children:"Hermes Agent:"})," ",x.versions.hermes_agent?`${x.versions.hermes_agent.hash}${x.versions.hermes_agent.dirty?"*":""}`:"—"]})]})]})})]}),n.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[n.jsxs("header",{className:"flex h-14 shrink-0 items-center justify-between border-b border-border/40 px-6 bg-card/20 backdrop-blur-sm",children:[n.jsx("div",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase font-sans",children:b.hint}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("a",{href:"https://git.tobisniceshomelab.ddnsfree.com/Hitonabi/mission-control-v2/src/branch/main/docs/BEDIENUNG.md",target:"_blank",rel:"noopener",className:"flex h-8 items-center rounded-md border border-border/40 bg-background/40 px-2.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer font-semibold",title:"Bedien-Anleitung",children:"Hilfe"}),n.jsxs("button",{onClick:()=>{const C=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(C)},className:"flex items-center gap-2 rounded-md border border-border/40 bg-background/40 px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer",children:[n.jsx(g0,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:"Suchen"}),n.jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[9px]",children:"⌘K"})]})]})]}),n.jsxs("main",{className:"flex-1 overflow-y-auto p-6 scrollbar-thin",children:[s==="dashboard"&&n.jsx(wb,{}),s==="models"&&n.jsx(_b,{}),s==="system"&&n.jsx(zb,{}),s==="connect"&&n.jsx(Lb,{}),s==="memory"&&n.jsx(Fb,{}),s==="agent"&&n.jsx(Ub,{}),s==="guide"&&n.jsx($b,{}),!["dashboard","models","system","connect","memory","agent","guide"].includes(s)&&n.jsx(Bb,{title:b.label,hint:b.hint})]})]})]})}const Gb=new Gx({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5e3}}});bx.createRoot(document.getElementById("root")).render(n.jsx(ah.StrictMode,{children:n.jsx(Kx,{client:Gb,children:n.jsx(Vb,{})})}));