diff --git a/frontend/dist/assets/index-CgKqjgpB.js b/frontend/dist/assets/index-BtTFipce.js similarity index 75% rename from frontend/dist/assets/index-CgKqjgpB.js rename to frontend/dist/assets/index-BtTFipce.js index 889feb2..64a8ba3 100644 --- a/frontend/dist/assets/index-CgKqjgpB.js +++ b/frontend/dist/assets/index-BtTFipce.js @@ -6,7 +6,7 @@ function Am(o,u){for(var i=0;i>>1,y=M[b];if(0>>1;bf(W,$))tef(ie,W)?(M[b]=ie,M[te]=$,b=te):(M[b]=W,M[K]=$,b=K);else if(tef(ie,$))M[b]=ie,M[te]=$,b=te;else break e}}return G}function f(M,G){var $=M.sortIndex-G.sortIndex;return $!==0?$:M.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var p=performance;o.unstable_now=function(){return p.now()}}else{var m=Date,g=m.now();o.unstable_now=function(){return m.now()-g}}var S=[],j=[],k=1,C=null,D=3,O=!1,R=!1,N=!1,L=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Q(M){for(var G=i(j);G!==null;){if(G.callback===null)c(j);else if(G.startTime<=M)c(j),G.sortIndex=G.expirationTime,u(S,G);else break;G=i(j)}}function q(M){if(N=!1,Q(M),!R)if(i(S)!==null)R=!0,je(F);else{var G=i(j);G!==null&&xe(q,G.startTime-M)}}function F(M,G){R=!1,N&&(N=!1,B(be),be=-1),O=!0;var $=D;try{for(Q(G),C=i(S);C!==null&&(!(C.expirationTime>G)||M&&!Se());){var b=C.callback;if(typeof b=="function"){C.callback=null,D=C.priorityLevel;var y=b(C.expirationTime<=G);G=o.unstable_now(),typeof y=="function"?C.callback=y:C===i(S)&&c(S),Q(G)}else c(S);C=i(S)}if(C!==null)var H=!0;else{var K=i(j);K!==null&&xe(q,K.startTime-G),H=!1}return H}finally{C=null,D=$,O=!1}}var J=!1,ae=null,be=-1,A=5,ue=-1;function Se(){return!(o.unstable_now()-ueM||125b?(M.sortIndex=$,u(j,M),i(S)===null&&M===i(j)&&(N?(B(be),be=-1):N=!0,xe(q,$-b))):(M.sortIndex=y,u(S,M),R||O||(R=!0,je(F))),M},o.unstable_shouldYield=Se,o.unstable_wrapCallback=function(M){var G=D;return function(){var $=D;D=G;try{return M.apply(this,arguments)}finally{D=$}}}})(zi)),zi}var md;function Vm(){return md||(md=1,Ti.exports=Bm()),Ti.exports}/** + */var pd;function Bm(){return pd||(pd=1,(function(o){function u(M,G){var B=M.length;M.push(G);e:for(;0>>1,y=M[w];if(0>>1;wf(W,B))tef(ie,W)?(M[w]=ie,M[te]=B,w=te):(M[w]=W,M[K]=B,w=K);else if(tef(ie,B))M[w]=ie,M[te]=B,w=te;else break e}}return G}function f(M,G){var B=M.sortIndex-G.sortIndex;return B!==0?B:M.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var p=performance;o.unstable_now=function(){return p.now()}}else{var m=Date,g=m.now();o.unstable_now=function(){return m.now()-g}}var S=[],j=[],b=1,C=null,D=3,O=!1,R=!1,N=!1,L=typeof setTimeout=="function"?setTimeout:null,F=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Q(M){for(var G=i(j);G!==null;){if(G.callback===null)c(j);else if(G.startTime<=M)c(j),G.sortIndex=G.expirationTime,u(S,G);else break;G=i(j)}}function q(M){if(N=!1,Q(M),!R)if(i(S)!==null)R=!0,je(U);else{var G=i(j);G!==null&&xe(q,G.startTime-M)}}function U(M,G){R=!1,N&&(N=!1,F(be),be=-1),O=!0;var B=D;try{for(Q(G),C=i(S);C!==null&&(!(C.expirationTime>G)||M&&!Se());){var w=C.callback;if(typeof w=="function"){C.callback=null,D=C.priorityLevel;var y=w(C.expirationTime<=G);G=o.unstable_now(),typeof y=="function"?C.callback=y:C===i(S)&&c(S),Q(G)}else c(S);C=i(S)}if(C!==null)var H=!0;else{var K=i(j);K!==null&&xe(q,K.startTime-G),H=!1}return H}finally{C=null,D=B,O=!1}}var J=!1,ae=null,be=-1,A=5,ue=-1;function Se(){return!(o.unstable_now()-ueM||125w?(M.sortIndex=B,u(j,M),i(S)===null&&M===i(j)&&(N?(F(be),be=-1):N=!0,xe(q,B-w))):(M.sortIndex=y,u(S,M),R||O||(R=!0,je(U))),M},o.unstable_shouldYield=Se,o.unstable_wrapCallback=function(M){var G=D;return function(){var B=D;D=G;try{return M.apply(this,arguments)}finally{D=B}}}})(zi)),zi}var md;function Vm(){return md||(md=1,Ti.exports=Bm()),Ti.exports}/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ function Am(o,u){for(var i=0;i"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),S=Object.prototype.hasOwnProperty,j=/^[: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]*$/,k={},C={};function D(e){return S.call(C,e)?!0:S.call(k,e)?!1:j.test(e)?C[e]=!0:(k[e]=!0,!1)}function O(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function R(e,t,r,n){if(t===null||typeof t>"u"||O(e,t,r,n))return!0;if(n)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 N(e,t,r,n,s,a,d){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=d}var L={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){L[e]=new N(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];L[t]=new N(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){L[e]=new N(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){L[e]=new N(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){L[e]=new N(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){L[e]=new N(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){L[e]=new N(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){L[e]=new N(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){L[e]=new N(e,5,!1,e.toLowerCase(),null,!1,!1)});var B=/[\-:]([a-z])/g;function T(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(B,T);L[t]=new N(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(B,T);L[t]=new N(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(B,T);L[t]=new N(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){L[e]=new N(e,1,!1,e.toLowerCase(),null,!1,!1)}),L.xlinkHref=new N("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){L[e]=new N(e,1,!1,e.toLowerCase(),null,!0,!0)});function Q(e,t,r,n){var s=L.hasOwnProperty(t)?L[t]:null;(s!==null?s.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),S=Object.prototype.hasOwnProperty,j=/^[: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={},C={};function D(e){return S.call(C,e)?!0:S.call(b,e)?!1:j.test(e)?C[e]=!0:(b[e]=!0,!1)}function O(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function R(e,t,r,n){if(t===null||typeof t>"u"||O(e,t,r,n))return!0;if(n)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 N(e,t,r,n,s,a,d){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=d}var L={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){L[e]=new N(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];L[t]=new N(t,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){L[e]=new N(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){L[e]=new N(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){L[e]=new N(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){L[e]=new N(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){L[e]=new N(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){L[e]=new N(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){L[e]=new N(e,5,!1,e.toLowerCase(),null,!1,!1)});var F=/[\-:]([a-z])/g;function T(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(F,T);L[t]=new N(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(F,T);L[t]=new N(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(F,T);L[t]=new N(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){L[e]=new N(e,1,!1,e.toLowerCase(),null,!1,!1)}),L.xlinkHref=new N("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){L[e]=new N(e,1,!1,e.toLowerCase(),null,!0,!0)});function Q(e,t,r,n){var s=L.hasOwnProperty(t)?L[t]:null;(s!==null?s.type!==0:n||!(2x||s[d]!==a[x]){var v=` -`+s[d].replace(" at new "," at ");return e.displayName&&v.includes("")&&(v=v.replace("",e.displayName)),v}while(1<=d&&0<=x);break}}}finally{H=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?y(e):""}function W(e){switch(e.tag){case 5:return y(e.type);case 16:return y("Lazy");case 13:return y("Suspense");case 19:return y("SuspenseList");case 0:case 2:case 15:return e=K(e.type,!1),e;case 11:return e=K(e.type.render,!1),e;case 1:return e=K(e.type,!0),e;default:return""}}function te(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 ae:return"Fragment";case J:return"Portal";case A:return"Profiler";case be:return"StrictMode";case Pe:return"Suspense";case ke:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Se:return(e.displayName||"Context")+".Consumer";case ue:return(e._context.displayName||"Context")+".Provider";case se:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Oe:return t=e.displayName||null,t!==null?t:te(e.type)||"Memo";case je:t=e._payload,e=e._init;try{return te(e(t))}catch{}}return null}function ie(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 te(t);case 8:return t===be?"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 pe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function he(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ue(e){var t=he(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(d){n=""+d,a.call(this,d)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(d){n=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function lo(e){e._valueTracker||(e._valueTracker=Ue(e))}function ha(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=he(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function so(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 Fl(e,t){var r=t.checked;return $({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function ga(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=pe(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function xa(e,t){t=t.checked,t!=null&&Q(e,"checked",t,!1)}function Ul(e,t){xa(e,t);var r=pe(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?$l(e,t.type,r):t.hasOwnProperty("defaultValue")&&$l(e,t.type,pe(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function va(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="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 $l(e,t,r){(t!=="number"||so(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var fn=Array.isArray;function _r(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=io.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function pn(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var mn={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},Bf=["Webkit","ms","Moz","O"];Object.keys(mn).forEach(function(e){Bf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),mn[t]=mn[e]})});function Na(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||mn.hasOwnProperty(e)&&mn[e]?(""+t).trim():t+"px"}function Sa(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=Na(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var Vf=$({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 Wl(e,t){if(t){if(Vf[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 Hl(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 Gl=null;function Kl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ql=null,Mr=null,Pr=null;function Ca(e){if(e=zn(e)){if(typeof Ql!="function")throw Error(i(280));var t=e.stateNode;t&&(t=Ro(t),Ql(e.stateNode,e.type,t))}}function Ea(e){Mr?Pr?Pr.push(e):Pr=[e]:Mr=e}function _a(){if(Mr){var e=Mr,t=Pr;if(Pr=Mr=null,Ca(e),t)for(e=0;e>>=0,e===0?32:31-(ep(e)/tp|0)|0}var po=64,mo=4194304;function vn(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 ho(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,a=e.pingedLanes,d=r&268435455;if(d!==0){var x=d&~s;x!==0?n=vn(x):(a&=d,a!==0&&(n=vn(a)))}else d=r&~s,d!==0?n=vn(d):a!==0&&(n=vn(a));if(n===0)return 0;if(t!==0&&t!==n&&(t&s)===0&&(s=n&-n,a=t&-t,s>=a||s===16&&(a&4194240)!==0))return t;if((n&4)!==0&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function yn(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ht(t),e[t]=r}function lp(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 n=e.eventTimes;for(e=e.expirationTimes;0=En),ru=" ",nu=!1;function ou(e,t){switch(e){case"keyup":return Op.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Or=!1;function Tp(e,t){switch(e){case"compositionend":return lu(t);case"keypress":return t.which!==32?null:(nu=!0,ru);case"textInput":return e=t.data,e===ru&&nu?null:e;default:return null}}function zp(e,t){if(Or)return e==="compositionend"||!fs&&ou(e,t)?(e=qa(),bo=ss=Wt=null,Or=!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)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=fu(r)}}function mu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function hu(){for(var e=window,t=so();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=so(e.document)}return t}function hs(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 Hp(e){var t=hu(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&mu(r.ownerDocument.documentElement,r)){if(n!==null&&hs(r)){if(t=n.start,e=n.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 s=r.textContent.length,a=Math.min(n.start,s);n=n.end===void 0?a:Math.min(n.end,s),!e.extend&&a>n&&(s=n,n=a,a=s),s=pu(r,a);var d=pu(r,n);s&&d&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==d.node||e.focusOffset!==d.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(d.node,d.offset)):(t.setEnd(d.node,d.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=document.documentMode,Dr=null,gs=null,Rn=null,xs=!1;function gu(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;xs||Dr==null||Dr!==so(n)||(n=Dr,"selectionStart"in n&&hs(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Rn&&Pn(Rn,n)||(Rn=n,n=_o(gs,"onSelect"),0Fr||(e.current=Ms[Fr],Ms[Fr]=null,Fr--)}function Ne(e,t){Fr++,Ms[Fr]=e.current,e.current=t}var Qt={},Ke=Kt(Qt),Je=Kt(!1),mr=Qt;function Ur(e,t){var r=e.type.contextTypes;if(!r)return Qt;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},a;for(a in r)s[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function et(e){return e=e.childContextTypes,e!=null}function Lo(){Ee(Je),Ee(Ke)}function Ru(e,t,r){if(Ke.current!==Qt)throw Error(i(168));Ne(Ke,t),Ne(Je,r)}function Lu(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(i(108,ie(e)||"Unknown",s));return $({},r,n)}function Oo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qt,mr=Ke.current,Ne(Ke,e),Ne(Je,Je.current),!0}function Ou(e,t,r){var n=e.stateNode;if(!n)throw Error(i(169));r?(e=Lu(e,t,mr),n.__reactInternalMemoizedMergedChildContext=e,Ee(Je),Ee(Ke),Ne(Ke,e)):Ee(Je),Ne(Je,r)}var Rt=null,Do=!1,Ps=!1;function Du(e){Rt===null?Rt=[e]:Rt.push(e)}function nm(e){Do=!0,Du(e)}function Zt(){if(!Ps&&Rt!==null){Ps=!0;var e=0,t=we;try{var r=Rt;for(we=1;e>=d,s-=d,Lt=1<<32-ht(t)+s|r<ce?(Ve=le,le=null):Ve=le.sibling;var ye=z(E,le,_[ce],V);if(ye===null){le===null&&(le=Ve);break}e&&le&&ye.alternate===null&&t(E,le),w=a(ye,w,ce),oe===null?re=ye:oe.sibling=ye,oe=ye,le=Ve}if(ce===_.length)return r(E,le),Me&&gr(E,ce),re;if(le===null){for(;ce<_.length;ce++)le=U(E,_[ce],V),le!==null&&(w=a(le,w,ce),oe===null?re=le:oe.sibling=le,oe=le);return Me&&gr(E,ce),re}for(le=n(E,le);ce<_.length;ce++)Ve=Z(le,E,ce,_[ce],V),Ve!==null&&(e&&Ve.alternate!==null&&le.delete(Ve.key===null?ce:Ve.key),w=a(Ve,w,ce),oe===null?re=Ve:oe.sibling=Ve,oe=Ve);return e&&le.forEach(function(or){return t(E,or)}),Me&&gr(E,ce),re}function ee(E,w,_,V){var re=G(_);if(typeof re!="function")throw Error(i(150));if(_=re.call(_),_==null)throw Error(i(151));for(var oe=re=null,le=w,ce=w=0,Ve=null,ye=_.next();le!==null&&!ye.done;ce++,ye=_.next()){le.index>ce?(Ve=le,le=null):Ve=le.sibling;var or=z(E,le,ye.value,V);if(or===null){le===null&&(le=Ve);break}e&&le&&or.alternate===null&&t(E,le),w=a(or,w,ce),oe===null?re=or:oe.sibling=or,oe=or,le=Ve}if(ye.done)return r(E,le),Me&&gr(E,ce),re;if(le===null){for(;!ye.done;ce++,ye=_.next())ye=U(E,ye.value,V),ye!==null&&(w=a(ye,w,ce),oe===null?re=ye:oe.sibling=ye,oe=ye);return Me&&gr(E,ce),re}for(le=n(E,le);!ye.done;ce++,ye=_.next())ye=Z(le,E,ce,ye.value,V),ye!==null&&(e&&ye.alternate!==null&&le.delete(ye.key===null?ce:ye.key),w=a(ye,w,ce),oe===null?re=ye:oe.sibling=ye,oe=ye);return e&&le.forEach(function(Im){return t(E,Im)}),Me&&gr(E,ce),re}function ze(E,w,_,V){if(typeof _=="object"&&_!==null&&_.type===ae&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case F:e:{for(var re=_.key,oe=w;oe!==null;){if(oe.key===re){if(re=_.type,re===ae){if(oe.tag===7){r(E,oe.sibling),w=s(oe,_.props.children),w.return=E,E=w;break e}}else if(oe.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===je&&Uu(re)===oe.type){r(E,oe.sibling),w=s(oe,_.props),w.ref=In(E,oe,_),w.return=E,E=w;break e}r(E,oe);break}else t(E,oe);oe=oe.sibling}_.type===ae?(w=Nr(_.props.children,E.mode,V,_.key),w.return=E,E=w):(V=al(_.type,_.key,_.props,null,E.mode,V),V.ref=In(E,w,_),V.return=E,E=V)}return d(E);case J:e:{for(oe=_.key;w!==null;){if(w.key===oe)if(w.tag===4&&w.stateNode.containerInfo===_.containerInfo&&w.stateNode.implementation===_.implementation){r(E,w.sibling),w=s(w,_.children||[]),w.return=E,E=w;break e}else{r(E,w);break}else t(E,w);w=w.sibling}w=Ei(_,E.mode,V),w.return=E,E=w}return d(E);case je:return oe=_._init,ze(E,w,oe(_._payload),V)}if(fn(_))return X(E,w,_,V);if(G(_))return ee(E,w,_,V);Ao(E,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,w!==null&&w.tag===6?(r(E,w.sibling),w=s(w,_),w.return=E,E=w):(r(E,w),w=Ci(_,E.mode,V),w.return=E,E=w),d(E)):r(E,w)}return ze}var Wr=$u(!0),Bu=$u(!1),Fo=Kt(null),Uo=null,Hr=null,zs=null;function Is(){zs=Hr=Uo=null}function As(e){var t=Fo.current;Ee(Fo),e._currentValue=t}function Fs(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Gr(e,t){Uo=e,zs=Hr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(tt=!0),e.firstContext=null)}function dt(e){var t=e._currentValue;if(zs!==e)if(e={context:e,memoizedValue:t,next:null},Hr===null){if(Uo===null)throw Error(i(308));Hr=e,Uo.dependencies={lanes:0,firstContext:e}}else Hr=Hr.next=e;return t}var xr=null;function Us(e){xr===null?xr=[e]:xr.push(e)}function Vu(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,Us(t)):(r.next=s.next,s.next=r),t.interleaved=r,Dt(e,n)}function Dt(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 qt=!1;function $s(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Wu(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 Tt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Yt(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(ve&2)!==0){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,Dt(e,r)}return s=n.interleaved,s===null?(t.next=t,Us(n)):(t.next=s.next,s.next=t),n.interleaved=t,Dt(e,r)}function $o(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,ts(e,r)}}function Hu(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var d={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?s=a=d:a=a.next=d,r=r.next}while(r!==null);a===null?s=a=t:a=a.next=t}else s=a=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Bo(e,t,r,n){var s=e.updateQueue;qt=!1;var a=s.firstBaseUpdate,d=s.lastBaseUpdate,x=s.shared.pending;if(x!==null){s.shared.pending=null;var v=x,P=v.next;v.next=null,d===null?a=P:d.next=P,d=v;var I=e.alternate;I!==null&&(I=I.updateQueue,x=I.lastBaseUpdate,x!==d&&(x===null?I.firstBaseUpdate=P:x.next=P,I.lastBaseUpdate=v))}if(a!==null){var U=s.baseState;d=0,I=P=v=null,x=a;do{var z=x.lane,Z=x.eventTime;if((n&z)===z){I!==null&&(I=I.next={eventTime:Z,lane:0,tag:x.tag,payload:x.payload,callback:x.callback,next:null});e:{var X=e,ee=x;switch(z=t,Z=r,ee.tag){case 1:if(X=ee.payload,typeof X=="function"){U=X.call(Z,U,z);break e}U=X;break e;case 3:X.flags=X.flags&-65537|128;case 0:if(X=ee.payload,z=typeof X=="function"?X.call(Z,U,z):X,z==null)break e;U=$({},U,z);break e;case 2:qt=!0}}x.callback!==null&&x.lane!==0&&(e.flags|=64,z=s.effects,z===null?s.effects=[x]:z.push(x))}else Z={eventTime:Z,lane:z,tag:x.tag,payload:x.payload,callback:x.callback,next:null},I===null?(P=I=Z,v=U):I=I.next=Z,d|=z;if(x=x.next,x===null){if(x=s.shared.pending,x===null)break;z=x,x=z.next,z.next=null,s.lastBaseUpdate=z,s.shared.pending=null}}while(!0);if(I===null&&(v=U),s.baseState=v,s.firstBaseUpdate=P,s.lastBaseUpdate=I,t=s.shared.interleaved,t!==null){s=t;do d|=s.lane,s=s.next;while(s!==t)}else a===null&&(s.shared.lanes=0);br|=d,e.lanes=d,e.memoizedState=U}}function Gu(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Gs.transition;Gs.transition={};try{e(!1),t()}finally{we=r,Gs.transition=n}}function dc(){return ft().memoizedState}function im(e,t,r){var n=tr(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},fc(e))pc(t,r);else if(r=Vu(e,t,r,n),r!==null){var s=Xe();wt(r,e,n,s),mc(r,t,n)}}function am(e,t,r){var n=tr(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(fc(e))pc(t,s);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var d=t.lastRenderedState,x=a(d,r);if(s.hasEagerState=!0,s.eagerState=x,gt(x,d)){var v=t.interleaved;v===null?(s.next=s,Us(t)):(s.next=v.next,v.next=s),t.interleaved=s;return}}catch{}finally{}r=Vu(e,t,s,n),r!==null&&(s=Xe(),wt(r,e,n,s),mc(r,t,n))}}function fc(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function pc(e,t){$n=Ho=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function mc(e,t,r){if((r&4194240)!==0){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,ts(e,r)}}var Qo={readContext:dt,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useInsertionEffect:Qe,useLayoutEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useMutableSource:Qe,useSyncExternalStore:Qe,useId:Qe,unstable_isNewReconciler:!1},um={readContext:dt,useCallback:function(e,t){return Ct().memoizedState=[e,t===void 0?null:t],e},useContext:dt,useEffect:nc,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Go(4194308,4,sc.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Go(4194308,4,e,t)},useInsertionEffect:function(e,t){return Go(4,2,e,t)},useMemo:function(e,t){var r=Ct();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Ct();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=im.bind(null,Le,e),[n.memoizedState,e]},useRef:function(e){var t=Ct();return e={current:e},t.memoizedState=e},useState:tc,useDebugValue:Js,useDeferredValue:function(e){return Ct().memoizedState=e},useTransition:function(){var e=tc(!1),t=e[0];return e=sm.bind(null,e[1]),Ct().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Le,s=Ct();if(Me){if(r===void 0)throw Error(i(407));r=r()}else{if(r=t(),Be===null)throw Error(i(349));(yr&30)!==0||qu(n,t,r)}s.memoizedState=r;var a={value:r,getSnapshot:t};return s.queue=a,nc(Xu.bind(null,n,a,e),[e]),n.flags|=2048,Wn(9,Yu.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Ct(),t=Be.identifierPrefix;if(Me){var r=Ot,n=Lt;r=(n&~(1<<32-ht(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Bn++,0")&&(v=v.replace("",e.displayName)),v}while(1<=d&&0<=x);break}}}finally{H=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?y(e):""}function W(e){switch(e.tag){case 5:return y(e.type);case 16:return y("Lazy");case 13:return y("Suspense");case 19:return y("SuspenseList");case 0:case 2:case 15:return e=K(e.type,!1),e;case 11:return e=K(e.type.render,!1),e;case 1:return e=K(e.type,!0),e;default:return""}}function te(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 ae:return"Fragment";case J:return"Portal";case A:return"Profiler";case be:return"StrictMode";case Pe:return"Suspense";case ke:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Se:return(e.displayName||"Context")+".Consumer";case ue:return(e._context.displayName||"Context")+".Provider";case se:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Oe:return t=e.displayName||null,t!==null?t:te(e.type)||"Memo";case je:t=e._payload,e=e._init;try{return te(e(t))}catch{}}return null}function ie(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 te(t);case 8:return t===be?"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 pe(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function he(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ue(e){var t=he(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(d){n=""+d,a.call(this,d)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(d){n=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function lo(e){e._valueTracker||(e._valueTracker=Ue(e))}function ha(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=he(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function so(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 Fl(e,t){var r=t.checked;return B({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function ga(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=pe(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function xa(e,t){t=t.checked,t!=null&&Q(e,"checked",t,!1)}function Ul(e,t){xa(e,t);var r=pe(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?$l(e,t.type,r):t.hasOwnProperty("defaultValue")&&$l(e,t.type,pe(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function va(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="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 $l(e,t,r){(t!=="number"||so(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var fn=Array.isArray;function _r(e,t,r,n){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=io.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function pn(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var mn={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},Bf=["Webkit","ms","Moz","O"];Object.keys(mn).forEach(function(e){Bf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),mn[t]=mn[e]})});function Na(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||mn.hasOwnProperty(e)&&mn[e]?(""+t).trim():t+"px"}function Sa(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=Na(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,s):e[r]=s}}var Vf=B({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 Wl(e,t){if(t){if(Vf[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 Hl(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 Gl=null;function Kl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ql=null,Mr=null,Pr=null;function Ca(e){if(e=zn(e)){if(typeof Ql!="function")throw Error(i(280));var t=e.stateNode;t&&(t=Ro(t),Ql(e.stateNode,e.type,t))}}function Ea(e){Mr?Pr?Pr.push(e):Pr=[e]:Mr=e}function _a(){if(Mr){var e=Mr,t=Pr;if(Pr=Mr=null,Ca(e),t)for(e=0;e>>=0,e===0?32:31-(ep(e)/tp|0)|0}var po=64,mo=4194304;function vn(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 ho(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,s=e.suspendedLanes,a=e.pingedLanes,d=r&268435455;if(d!==0){var x=d&~s;x!==0?n=vn(x):(a&=d,a!==0&&(n=vn(a)))}else d=r&~s,d!==0?n=vn(d):a!==0&&(n=vn(a));if(n===0)return 0;if(t!==0&&t!==n&&(t&s)===0&&(s=n&-n,a=t&-t,s>=a||s===16&&(a&4194240)!==0))return t;if((n&4)!==0&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function yn(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ht(t),e[t]=r}function lp(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 n=e.eventTimes;for(e=e.expirationTimes;0=En),ru=" ",nu=!1;function ou(e,t){switch(e){case"keyup":return Op.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Or=!1;function Tp(e,t){switch(e){case"compositionend":return lu(t);case"keypress":return t.which!==32?null:(nu=!0,ru);case"textInput":return e=t.data,e===ru&&nu?null:e;default:return null}}function zp(e,t){if(Or)return e==="compositionend"||!fs&&ou(e,t)?(e=qa(),bo=ss=Wt=null,Or=!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)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=fu(r)}}function mu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function hu(){for(var e=window,t=so();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=so(e.document)}return t}function hs(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 Hp(e){var t=hu(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&mu(r.ownerDocument.documentElement,r)){if(n!==null&&hs(r)){if(t=n.start,e=n.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 s=r.textContent.length,a=Math.min(n.start,s);n=n.end===void 0?a:Math.min(n.end,s),!e.extend&&a>n&&(s=n,n=a,a=s),s=pu(r,a);var d=pu(r,n);s&&d&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==d.node||e.focusOffset!==d.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(d.node,d.offset)):(t.setEnd(d.node,d.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=document.documentMode,Dr=null,gs=null,Rn=null,xs=!1;function gu(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;xs||Dr==null||Dr!==so(n)||(n=Dr,"selectionStart"in n&&hs(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Rn&&Pn(Rn,n)||(Rn=n,n=_o(gs,"onSelect"),0Fr||(e.current=Ms[Fr],Ms[Fr]=null,Fr--)}function Ne(e,t){Fr++,Ms[Fr]=e.current,e.current=t}var Qt={},Ke=Kt(Qt),Je=Kt(!1),mr=Qt;function Ur(e,t){var r=e.type.contextTypes;if(!r)return Qt;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var s={},a;for(a in r)s[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function et(e){return e=e.childContextTypes,e!=null}function Lo(){Ee(Je),Ee(Ke)}function Ru(e,t,r){if(Ke.current!==Qt)throw Error(i(168));Ne(Ke,t),Ne(Je,r)}function Lu(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in t))throw Error(i(108,ie(e)||"Unknown",s));return B({},r,n)}function Oo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Qt,mr=Ke.current,Ne(Ke,e),Ne(Je,Je.current),!0}function Ou(e,t,r){var n=e.stateNode;if(!n)throw Error(i(169));r?(e=Lu(e,t,mr),n.__reactInternalMemoizedMergedChildContext=e,Ee(Je),Ee(Ke),Ne(Ke,e)):Ee(Je),Ne(Je,r)}var Rt=null,Do=!1,Ps=!1;function Du(e){Rt===null?Rt=[e]:Rt.push(e)}function nm(e){Do=!0,Du(e)}function Zt(){if(!Ps&&Rt!==null){Ps=!0;var e=0,t=we;try{var r=Rt;for(we=1;e>=d,s-=d,Lt=1<<32-ht(t)+s|r<ce?(Ve=le,le=null):Ve=le.sibling;var ye=z(E,le,_[ce],V);if(ye===null){le===null&&(le=Ve);break}e&&le&&ye.alternate===null&&t(E,le),k=a(ye,k,ce),oe===null?re=ye:oe.sibling=ye,oe=ye,le=Ve}if(ce===_.length)return r(E,le),Me&&gr(E,ce),re;if(le===null){for(;ce<_.length;ce++)le=$(E,_[ce],V),le!==null&&(k=a(le,k,ce),oe===null?re=le:oe.sibling=le,oe=le);return Me&&gr(E,ce),re}for(le=n(E,le);ce<_.length;ce++)Ve=Z(le,E,ce,_[ce],V),Ve!==null&&(e&&Ve.alternate!==null&&le.delete(Ve.key===null?ce:Ve.key),k=a(Ve,k,ce),oe===null?re=Ve:oe.sibling=Ve,oe=Ve);return e&&le.forEach(function(or){return t(E,or)}),Me&&gr(E,ce),re}function ee(E,k,_,V){var re=G(_);if(typeof re!="function")throw Error(i(150));if(_=re.call(_),_==null)throw Error(i(151));for(var oe=re=null,le=k,ce=k=0,Ve=null,ye=_.next();le!==null&&!ye.done;ce++,ye=_.next()){le.index>ce?(Ve=le,le=null):Ve=le.sibling;var or=z(E,le,ye.value,V);if(or===null){le===null&&(le=Ve);break}e&&le&&or.alternate===null&&t(E,le),k=a(or,k,ce),oe===null?re=or:oe.sibling=or,oe=or,le=Ve}if(ye.done)return r(E,le),Me&&gr(E,ce),re;if(le===null){for(;!ye.done;ce++,ye=_.next())ye=$(E,ye.value,V),ye!==null&&(k=a(ye,k,ce),oe===null?re=ye:oe.sibling=ye,oe=ye);return Me&&gr(E,ce),re}for(le=n(E,le);!ye.done;ce++,ye=_.next())ye=Z(le,E,ce,ye.value,V),ye!==null&&(e&&ye.alternate!==null&&le.delete(ye.key===null?ce:ye.key),k=a(ye,k,ce),oe===null?re=ye:oe.sibling=ye,oe=ye);return e&&le.forEach(function(Im){return t(E,Im)}),Me&&gr(E,ce),re}function ze(E,k,_,V){if(typeof _=="object"&&_!==null&&_.type===ae&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case U:e:{for(var re=_.key,oe=k;oe!==null;){if(oe.key===re){if(re=_.type,re===ae){if(oe.tag===7){r(E,oe.sibling),k=s(oe,_.props.children),k.return=E,E=k;break e}}else if(oe.elementType===re||typeof re=="object"&&re!==null&&re.$$typeof===je&&Uu(re)===oe.type){r(E,oe.sibling),k=s(oe,_.props),k.ref=In(E,oe,_),k.return=E,E=k;break e}r(E,oe);break}else t(E,oe);oe=oe.sibling}_.type===ae?(k=Nr(_.props.children,E.mode,V,_.key),k.return=E,E=k):(V=al(_.type,_.key,_.props,null,E.mode,V),V.ref=In(E,k,_),V.return=E,E=V)}return d(E);case J:e:{for(oe=_.key;k!==null;){if(k.key===oe)if(k.tag===4&&k.stateNode.containerInfo===_.containerInfo&&k.stateNode.implementation===_.implementation){r(E,k.sibling),k=s(k,_.children||[]),k.return=E,E=k;break e}else{r(E,k);break}else t(E,k);k=k.sibling}k=Ei(_,E.mode,V),k.return=E,E=k}return d(E);case je:return oe=_._init,ze(E,k,oe(_._payload),V)}if(fn(_))return X(E,k,_,V);if(G(_))return ee(E,k,_,V);Ao(E,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,k!==null&&k.tag===6?(r(E,k.sibling),k=s(k,_),k.return=E,E=k):(r(E,k),k=Ci(_,E.mode,V),k.return=E,E=k),d(E)):r(E,k)}return ze}var Wr=$u(!0),Bu=$u(!1),Fo=Kt(null),Uo=null,Hr=null,zs=null;function Is(){zs=Hr=Uo=null}function As(e){var t=Fo.current;Ee(Fo),e._currentValue=t}function Fs(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Gr(e,t){Uo=e,zs=Hr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(tt=!0),e.firstContext=null)}function dt(e){var t=e._currentValue;if(zs!==e)if(e={context:e,memoizedValue:t,next:null},Hr===null){if(Uo===null)throw Error(i(308));Hr=e,Uo.dependencies={lanes:0,firstContext:e}}else Hr=Hr.next=e;return t}var xr=null;function Us(e){xr===null?xr=[e]:xr.push(e)}function Vu(e,t,r,n){var s=t.interleaved;return s===null?(r.next=r,Us(t)):(r.next=s.next,s.next=r),t.interleaved=r,Dt(e,n)}function Dt(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 qt=!1;function $s(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Wu(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 Tt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Yt(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(ve&2)!==0){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,Dt(e,r)}return s=n.interleaved,s===null?(t.next=t,Us(n)):(t.next=s.next,s.next=t),n.interleaved=t,Dt(e,r)}function $o(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,ts(e,r)}}function Hu(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var d={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?s=a=d:a=a.next=d,r=r.next}while(r!==null);a===null?s=a=t:a=a.next=t}else s=a=t;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Bo(e,t,r,n){var s=e.updateQueue;qt=!1;var a=s.firstBaseUpdate,d=s.lastBaseUpdate,x=s.shared.pending;if(x!==null){s.shared.pending=null;var v=x,P=v.next;v.next=null,d===null?a=P:d.next=P,d=v;var I=e.alternate;I!==null&&(I=I.updateQueue,x=I.lastBaseUpdate,x!==d&&(x===null?I.firstBaseUpdate=P:x.next=P,I.lastBaseUpdate=v))}if(a!==null){var $=s.baseState;d=0,I=P=v=null,x=a;do{var z=x.lane,Z=x.eventTime;if((n&z)===z){I!==null&&(I=I.next={eventTime:Z,lane:0,tag:x.tag,payload:x.payload,callback:x.callback,next:null});e:{var X=e,ee=x;switch(z=t,Z=r,ee.tag){case 1:if(X=ee.payload,typeof X=="function"){$=X.call(Z,$,z);break e}$=X;break e;case 3:X.flags=X.flags&-65537|128;case 0:if(X=ee.payload,z=typeof X=="function"?X.call(Z,$,z):X,z==null)break e;$=B({},$,z);break e;case 2:qt=!0}}x.callback!==null&&x.lane!==0&&(e.flags|=64,z=s.effects,z===null?s.effects=[x]:z.push(x))}else Z={eventTime:Z,lane:z,tag:x.tag,payload:x.payload,callback:x.callback,next:null},I===null?(P=I=Z,v=$):I=I.next=Z,d|=z;if(x=x.next,x===null){if(x=s.shared.pending,x===null)break;z=x,x=z.next,z.next=null,s.lastBaseUpdate=z,s.shared.pending=null}}while(!0);if(I===null&&(v=$),s.baseState=v,s.firstBaseUpdate=P,s.lastBaseUpdate=I,t=s.shared.interleaved,t!==null){s=t;do d|=s.lane,s=s.next;while(s!==t)}else a===null&&(s.shared.lanes=0);br|=d,e.lanes=d,e.memoizedState=$}}function Gu(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Gs.transition;Gs.transition={};try{e(!1),t()}finally{we=r,Gs.transition=n}}function dc(){return ft().memoizedState}function im(e,t,r){var n=tr(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},fc(e))pc(t,r);else if(r=Vu(e,t,r,n),r!==null){var s=Xe();wt(r,e,n,s),mc(r,t,n)}}function am(e,t,r){var n=tr(e),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(fc(e))pc(t,s);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var d=t.lastRenderedState,x=a(d,r);if(s.hasEagerState=!0,s.eagerState=x,gt(x,d)){var v=t.interleaved;v===null?(s.next=s,Us(t)):(s.next=v.next,v.next=s),t.interleaved=s;return}}catch{}finally{}r=Vu(e,t,s,n),r!==null&&(s=Xe(),wt(r,e,n,s),mc(r,t,n))}}function fc(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function pc(e,t){$n=Ho=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function mc(e,t,r){if((r&4194240)!==0){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,ts(e,r)}}var Qo={readContext:dt,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useInsertionEffect:Qe,useLayoutEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useMutableSource:Qe,useSyncExternalStore:Qe,useId:Qe,unstable_isNewReconciler:!1},um={readContext:dt,useCallback:function(e,t){return Ct().memoizedState=[e,t===void 0?null:t],e},useContext:dt,useEffect:nc,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Go(4194308,4,sc.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Go(4194308,4,e,t)},useInsertionEffect:function(e,t){return Go(4,2,e,t)},useMemo:function(e,t){var r=Ct();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Ct();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=im.bind(null,Le,e),[n.memoizedState,e]},useRef:function(e){var t=Ct();return e={current:e},t.memoizedState=e},useState:tc,useDebugValue:Js,useDeferredValue:function(e){return Ct().memoizedState=e},useTransition:function(){var e=tc(!1),t=e[0];return e=sm.bind(null,e[1]),Ct().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Le,s=Ct();if(Me){if(r===void 0)throw Error(i(407));r=r()}else{if(r=t(),Be===null)throw Error(i(349));(yr&30)!==0||qu(n,t,r)}s.memoizedState=r;var a={value:r,getSnapshot:t};return s.queue=a,nc(Xu.bind(null,n,a,e),[e]),n.flags|=2048,Wn(9,Yu.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Ct(),t=Be.identifierPrefix;if(Me){var r=Ot,n=Lt;r=(n&~(1<<32-ht(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Bn++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=d.createElement(r,{is:n.is}):(e=d.createElement(r),r==="select"&&(d=e,n.multiple?d.multiple=!0:n.size&&(d.size=n.size))):e=d.createElementNS(e,r),e[Nt]=t,e[Tn]=n,Dc(e,t,!1,!1),t.stateNode=e;e:{switch(d=Hl(r,n),r){case"dialog":Ce("cancel",e),Ce("close",e),s=n;break;case"iframe":case"object":case"embed":Ce("load",e),s=n;break;case"video":case"audio":for(s=0;sYr&&(t.flags|=128,n=!0,Hn(a,!1),t.lanes=4194304)}else{if(!n)if(e=Vo(d),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Hn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!d.alternate&&!Me)return Ze(t),null}else 2*Te()-a.renderingStartTime>Yr&&r!==1073741824&&(t.flags|=128,n=!0,Hn(a,!1),t.lanes=4194304);a.isBackwards?(d.sibling=t.child,t.child=d):(r=a.last,r!==null?r.sibling=d:t.child=d,a.last=d)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Te(),t.sibling=null,r=Re.current,Ne(Re,n?r&1|2:r&1),t):(Ze(t),null);case 22:case 23:return ji(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&(t.mode&1)!==0?(at&1073741824)!==0&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function xm(e,t){switch(Ls(t),t.tag){case 1:return et(t.type)&&Lo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Kr(),Ee(Je),Ee(Ke),Hs(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Vs(t),null;case 13:if(Ee(Re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Vr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ee(Re),null;case 4:return Kr(),null;case 10:return As(t.type._context),null;case 22:case 23:return ji(),null;case 24:return null;default:return null}}var Xo=!1,qe=!1,vm=typeof WeakSet=="function"?WeakSet:Set,Y=null;function Zr(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){De(e,t,n)}else r.current=null}function di(e,t,r){try{r()}catch(n){De(e,t,n)}}var Ic=!1;function ym(e,t){if(js=vo,e=hu(),hs(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var d=0,x=-1,v=-1,P=0,I=0,U=e,z=null;t:for(;;){for(var Z;U!==r||s!==0&&U.nodeType!==3||(x=d+s),U!==a||n!==0&&U.nodeType!==3||(v=d+n),U.nodeType===3&&(d+=U.nodeValue.length),(Z=U.firstChild)!==null;)z=U,U=Z;for(;;){if(U===e)break t;if(z===r&&++P===s&&(x=d),z===a&&++I===n&&(v=d),(Z=U.nextSibling)!==null)break;U=z,z=U.parentNode}U=Z}r=x===-1||v===-1?null:{start:x,end:v}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ns={focusedElem:e,selectionRange:r},vo=!1,Y=t;Y!==null;)if(t=Y,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;try{var X=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(X!==null){var ee=X.memoizedProps,ze=X.memoizedState,E=t.stateNode,w=E.getSnapshotBeforeUpdate(t.elementType===t.type?ee:vt(t.type,ee),ze);E.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(V){De(t,t.return,V)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return X=Ic,Ic=!1,X}function Gn(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var a=s.destroy;s.destroy=void 0,a!==void 0&&di(t,r,a)}s=s.next}while(s!==n)}}function Jo(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 n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function fi(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 Ac(e){var t=e.alternate;t!==null&&(e.alternate=null,Ac(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Nt],delete t[Tn],delete t[_s],delete t[tm],delete t[rm])),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 Fc(e){return e.tag===5||e.tag===3||e.tag===4}function Uc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fc(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 pi(e,t,r){var n=e.tag;if(n===5||n===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=Po));else if(n!==4&&(e=e.child,e!==null))for(pi(e,t,r),e=e.sibling;e!==null;)pi(e,t,r),e=e.sibling}function mi(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(mi(e,t,r),e=e.sibling;e!==null;)mi(e,t,r),e=e.sibling}var We=null,yt=!1;function Xt(e,t,r){for(r=r.child;r!==null;)$c(e,t,r),r=r.sibling}function $c(e,t,r){if(jt&&typeof jt.onCommitFiberUnmount=="function")try{jt.onCommitFiberUnmount(fo,r)}catch{}switch(r.tag){case 5:qe||Zr(r,t);case 6:var n=We,s=yt;We=null,Xt(e,t,r),We=n,yt=s,We!==null&&(yt?(e=We,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):We.removeChild(r.stateNode));break;case 18:We!==null&&(yt?(e=We,r=r.stateNode,e.nodeType===8?Es(e.parentNode,r):e.nodeType===1&&Es(e,r),Nn(e)):Es(We,r.stateNode));break;case 4:n=We,s=yt,We=r.stateNode.containerInfo,yt=!0,Xt(e,t,r),We=n,yt=s;break;case 0:case 11:case 14:case 15:if(!qe&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var a=s,d=a.destroy;a=a.tag,d!==void 0&&((a&2)!==0||(a&4)!==0)&&di(r,t,d),s=s.next}while(s!==n)}Xt(e,t,r);break;case 1:if(!qe&&(Zr(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(x){De(r,t,x)}Xt(e,t,r);break;case 21:Xt(e,t,r);break;case 22:r.mode&1?(qe=(n=qe)||r.memoizedState!==null,Xt(e,t,r),qe=n):Xt(e,t,r);break;default:Xt(e,t,r)}}function Bc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new vm),t.forEach(function(n){var s=_m.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function bt(e,t){var r=t.deletions;if(r!==null)for(var n=0;ns&&(s=d),n&=~a}if(n=s,n=Te()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*wm(n/1960))-n,10e?16:e,er===null)var n=!1;else{if(e=er,er=null,ol=0,(ve&6)!==0)throw Error(i(331));var s=ve;for(ve|=4,Y=e.current;Y!==null;){var a=Y,d=a.child;if((Y.flags&16)!==0){var x=a.deletions;if(x!==null){for(var v=0;vTe()-xi?kr(e,0):gi|=r),nt(e,t)}function td(e,t){t===0&&((e.mode&1)===0?t=1:(t=mo,mo<<=1,(mo&130023424)===0&&(mo=4194304)));var r=Xe();e=Dt(e,t),e!==null&&(yn(e,t,r),nt(e,r))}function Em(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),td(e,r)}function _m(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(i(314))}n!==null&&n.delete(t),td(e,r)}var rd;rd=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Je.current)tt=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return tt=!1,hm(e,t,r);tt=(e.flags&131072)!==0}else tt=!1,Me&&(t.flags&1048576)!==0&&Tu(t,zo,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Yo(e,t),e=t.pendingProps;var s=Ur(t,Ke.current);Gr(t,r),s=Qs(null,t,n,e,s,r);var a=Zs();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,et(n)?(a=!0,Oo(t)):a=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,$s(t),s.updater=Zo,t.stateNode=s,s._reactInternals=t,ti(t,n,e,r),t=li(null,t,n,!0,a,r)):(t.tag=0,Me&&a&&Rs(t),Ye(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Yo(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=Pm(n),e=vt(n,e),s){case 0:t=oi(null,t,n,e,r);break e;case 1:t=_c(null,t,n,e,r);break e;case 11:t=jc(null,t,n,e,r);break e;case 14:t=Nc(null,t,n,vt(n.type,e),r);break e}throw Error(i(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:vt(n,s),oi(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:vt(n,s),_c(e,t,n,s,r);case 3:e:{if(Mc(t),e===null)throw Error(i(387));n=t.pendingProps,a=t.memoizedState,s=a.element,Wu(e,t),Bo(t,n,null,r);var d=t.memoizedState;if(n=d.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:d.cache,pendingSuspenseBoundaries:d.pendingSuspenseBoundaries,transitions:d.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){s=Qr(Error(i(423)),t),t=Pc(e,t,n,r,s);break e}else if(n!==s){s=Qr(Error(i(424)),t),t=Pc(e,t,n,r,s);break e}else for(it=Gt(t.stateNode.containerInfo.firstChild),st=t,Me=!0,xt=null,r=Bu(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Vr(),n===s){t=zt(e,t,r);break e}Ye(e,t,n,r)}t=t.child}return t;case 5:return Ku(t),e===null&&Ds(t),n=t.type,s=t.pendingProps,a=e!==null?e.memoizedProps:null,d=s.children,Ss(n,s)?d=null:a!==null&&Ss(n,a)&&(t.flags|=32),Ec(e,t),Ye(e,t,d,r),t.child;case 6:return e===null&&Ds(t),null;case 13:return Rc(e,t,r);case 4:return Bs(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Wr(t,null,n,r):Ye(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:vt(n,s),jc(e,t,n,s,r);case 7:return Ye(e,t,t.pendingProps,r),t.child;case 8:return Ye(e,t,t.pendingProps.children,r),t.child;case 12:return Ye(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,a=t.memoizedProps,d=s.value,Ne(Fo,n._currentValue),n._currentValue=d,a!==null)if(gt(a.value,d)){if(a.children===s.children&&!Je.current){t=zt(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var x=a.dependencies;if(x!==null){d=a.child;for(var v=x.firstContext;v!==null;){if(v.context===n){if(a.tag===1){v=Tt(-1,r&-r),v.tag=2;var P=a.updateQueue;if(P!==null){P=P.shared;var I=P.pending;I===null?v.next=v:(v.next=I.next,I.next=v),P.pending=v}}a.lanes|=r,v=a.alternate,v!==null&&(v.lanes|=r),Fs(a.return,r,t),x.lanes|=r;break}v=v.next}}else if(a.tag===10)d=a.type===t.type?null:a.child;else if(a.tag===18){if(d=a.return,d===null)throw Error(i(341));d.lanes|=r,x=d.alternate,x!==null&&(x.lanes|=r),Fs(d,r,t),d=a.sibling}else d=a.child;if(d!==null)d.return=a;else for(d=a;d!==null;){if(d===t){d=null;break}if(a=d.sibling,a!==null){a.return=d.return,d=a;break}d=d.return}a=d}Ye(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Gr(t,r),s=dt(s),n=n(s),t.flags|=1,Ye(e,t,n,r),t.child;case 14:return n=t.type,s=vt(n,t.pendingProps),s=vt(n.type,s),Nc(e,t,n,s,r);case 15:return Sc(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:vt(n,s),Yo(e,t),t.tag=1,et(n)?(e=!0,Oo(t)):e=!1,Gr(t,r),gc(t,n,s),ti(t,n,s,r),li(null,t,n,!0,e,r);case 19:return Oc(e,t,r);case 22:return Cc(e,t,r)}throw Error(i(156,t.tag))};function nd(e,t){return za(e,t)}function Mm(e,t,r,n){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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mt(e,t,r,n){return new Mm(e,t,r,n)}function Si(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pm(e){if(typeof e=="function")return Si(e)?1:0;if(e!=null){if(e=e.$$typeof,e===se)return 11;if(e===Oe)return 14}return 2}function nr(e,t){var r=e.alternate;return r===null?(r=mt(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 al(e,t,r,n,s,a){var d=2;if(n=e,typeof e=="function")Si(e)&&(d=1);else if(typeof e=="string")d=5;else e:switch(e){case ae:return Nr(r.children,s,a,t);case be:d=8,s|=8;break;case A:return e=mt(12,r,t,s|2),e.elementType=A,e.lanes=a,e;case Pe:return e=mt(13,r,t,s),e.elementType=Pe,e.lanes=a,e;case ke:return e=mt(19,r,t,s),e.elementType=ke,e.lanes=a,e;case xe:return ul(r,s,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ue:d=10;break e;case Se:d=9;break e;case se:d=11;break e;case Oe:d=14;break e;case je:d=16,n=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return t=mt(d,r,t,s),t.elementType=e,t.type=n,t.lanes=a,t}function Nr(e,t,r,n){return e=mt(7,e,n,t),e.lanes=r,e}function ul(e,t,r,n){return e=mt(22,e,n,t),e.elementType=xe,e.lanes=r,e.stateNode={isHidden:!1},e}function Ci(e,t,r){return e=mt(6,e,null,t),e.lanes=r,e}function Ei(e,t,r){return t=mt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Rm(e,t,r,n,s){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=es(0),this.expirationTimes=es(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=es(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function _i(e,t,r,n,s,a,d,x,v){return e=new Rm(e,t,r,x,v),t===1?(t=1,a===!0&&(t|=8)):t=0,a=mt(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},$s(a),e}function Lm(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(u){console.error(u)}}return o(),Di.exports=Wm(),Di.exports}var xd;function Hm(){if(xd)return gl;xd=1;var o=Vd();return gl.createRoot=o.createRoot,gl.hydrateRoot=o.hydrateRoot,gl}var Gm=Hm();const Km=$d(Gm);/** +`+a.stack}return{value:e,source:t,stack:s,digest:null}}function ri(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function ni(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var fm=typeof WeakMap=="function"?WeakMap:Map;function vc(e,t,r){r=Tt(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){rl||(rl=!0,vi=n),ni(e,t)},r}function yc(e,t,r){r=Tt(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var s=t.value;r.payload=function(){return n(s)},r.callback=function(){ni(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){ni(e,t),typeof n!="function"&&(Jt===null?Jt=new Set([this]):Jt.add(this));var d=t.stack;this.componentDidCatch(t.value,{componentStack:d!==null?d:""})}),r}function bc(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new fm;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(r)||(s.add(r),e=Cm.bind(null,e,t,r),t.then(e,e))}function wc(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 kc(e,t,r,n,s){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=Tt(-1,1),t.tag=2,Yt(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=s,e)}var pm=q.ReactCurrentOwner,tt=!1;function Ye(e,t,r,n){t.child=e===null?Bu(t,null,r,n):Wr(t,e.child,r,n)}function jc(e,t,r,n,s){r=r.render;var a=t.ref;return Gr(t,s),n=Qs(e,t,r,n,a,s),r=Zs(),e!==null&&!tt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,zt(e,t,s)):(Me&&r&&Rs(t),t.flags|=1,Ye(e,t,n,s),t.child)}function Nc(e,t,r,n,s){if(e===null){var a=r.type;return typeof a=="function"&&!Si(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,Sc(e,t,a,n,s)):(e=al(r.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&s)===0){var d=a.memoizedProps;if(r=r.compare,r=r!==null?r:Pn,r(d,n)&&e.ref===t.ref)return zt(e,t,s)}return t.flags|=1,e=nr(a,n),e.ref=t.ref,e.return=t,t.child=e}function Sc(e,t,r,n,s){if(e!==null){var a=e.memoizedProps;if(Pn(a,n)&&e.ref===t.ref)if(tt=!1,t.pendingProps=n=a,(e.lanes&s)!==0)(e.flags&131072)!==0&&(tt=!0);else return t.lanes=e.lanes,zt(e,t,s)}return oi(e,t,r,n,s)}function Cc(e,t,r){var n=t.pendingProps,s=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ne(qr,at),at|=r;else{if((r&1073741824)===0)return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ne(qr,at),at|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Ne(qr,at),at|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Ne(qr,at),at|=n;return Ye(e,t,s,r),t.child}function Ec(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function oi(e,t,r,n,s){var a=et(r)?mr:Ke.current;return a=Ur(t,a),Gr(t,s),r=Qs(e,t,r,n,a,s),n=Zs(),e!==null&&!tt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,zt(e,t,s)):(Me&&n&&Rs(t),t.flags|=1,Ye(e,t,r,s),t.child)}function _c(e,t,r,n,s){if(et(r)){var a=!0;Oo(t)}else a=!1;if(Gr(t,s),t.stateNode===null)Yo(e,t),gc(t,r,n),ti(t,r,n,s),n=!0;else if(e===null){var d=t.stateNode,x=t.memoizedProps;d.props=x;var v=d.context,P=r.contextType;typeof P=="object"&&P!==null?P=dt(P):(P=et(r)?mr:Ke.current,P=Ur(t,P));var I=r.getDerivedStateFromProps,$=typeof I=="function"||typeof d.getSnapshotBeforeUpdate=="function";$||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(x!==n||v!==P)&&xc(t,d,n,P),qt=!1;var z=t.memoizedState;d.state=z,Bo(t,n,d,s),v=t.memoizedState,x!==n||z!==v||Je.current||qt?(typeof I=="function"&&(ei(t,r,I,n),v=t.memoizedState),(x=qt||hc(t,r,x,n,z,v,P))?($||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=v),d.props=n,d.state=v,d.context=P,n=x):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{d=t.stateNode,Wu(e,t),x=t.memoizedProps,P=t.type===t.elementType?x:vt(t.type,x),d.props=P,$=t.pendingProps,z=d.context,v=r.contextType,typeof v=="object"&&v!==null?v=dt(v):(v=et(r)?mr:Ke.current,v=Ur(t,v));var Z=r.getDerivedStateFromProps;(I=typeof Z=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(x!==$||z!==v)&&xc(t,d,n,v),qt=!1,z=t.memoizedState,d.state=z,Bo(t,n,d,s);var X=t.memoizedState;x!==$||z!==X||Je.current||qt?(typeof Z=="function"&&(ei(t,r,Z,n),X=t.memoizedState),(P=qt||hc(t,r,P,n,z,X,v)||!1)?(I||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(n,X,v),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(n,X,v)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||x===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=X),d.props=n,d.state=X,d.context=v,n=P):(typeof d.componentDidUpdate!="function"||x===e.memoizedProps&&z===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&z===e.memoizedState||(t.flags|=1024),n=!1)}return li(e,t,r,n,a,s)}function li(e,t,r,n,s,a){Ec(e,t);var d=(t.flags&128)!==0;if(!n&&!d)return s&&Ou(t,r,!1),zt(e,t,a);n=t.stateNode,pm.current=t;var x=d&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&d?(t.child=Wr(t,e.child,null,a),t.child=Wr(t,null,x,a)):Ye(e,t,x,a),t.memoizedState=n.state,s&&Ou(t,r,!0),t.child}function Mc(e){var t=e.stateNode;t.pendingContext?Ru(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ru(e,t.context,!1),Bs(e,t.containerInfo)}function Pc(e,t,r,n,s){return Vr(),Ts(s),t.flags|=256,Ye(e,t,r,n),t.child}var si={dehydrated:null,treeContext:null,retryLane:0};function ii(e){return{baseLanes:e,cachePool:null,transitions:null}}function Rc(e,t,r){var n=t.pendingProps,s=Re.current,a=!1,d=(t.flags&128)!==0,x;if((x=d)||(x=e!==null&&e.memoizedState===null?!1:(s&2)!==0),x?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),Ne(Re,s&1),e===null)return Ds(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):(d=n.children,e=n.fallback,a?(n=t.mode,a=t.child,d={mode:"hidden",children:d},(n&1)===0&&a!==null?(a.childLanes=0,a.pendingProps=d):a=ul(d,n,0,null),e=Nr(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=ii(r),t.memoizedState=si,e):ai(t,d));if(s=e.memoizedState,s!==null&&(x=s.dehydrated,x!==null))return mm(e,t,d,n,x,s,r);if(a){a=n.fallback,d=t.mode,s=e.child,x=s.sibling;var v={mode:"hidden",children:n.children};return(d&1)===0&&t.child!==s?(n=t.child,n.childLanes=0,n.pendingProps=v,t.deletions=null):(n=nr(s,v),n.subtreeFlags=s.subtreeFlags&14680064),x!==null?a=nr(x,a):(a=Nr(a,d,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,d=e.child.memoizedState,d=d===null?ii(r):{baseLanes:d.baseLanes|r,cachePool:null,transitions:d.transitions},a.memoizedState=d,a.childLanes=e.childLanes&~r,t.memoizedState=si,n}return a=e.child,e=a.sibling,n=nr(a,{mode:"visible",children:n.children}),(t.mode&1)===0&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function ai(e,t){return t=ul({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function qo(e,t,r,n){return n!==null&&Ts(n),Wr(t,e.child,null,r),e=ai(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function mm(e,t,r,n,s,a,d){if(r)return t.flags&256?(t.flags&=-257,n=ri(Error(i(422))),qo(e,t,d,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,s=t.mode,n=ul({mode:"visible",children:n.children},s,0,null),a=Nr(a,s,d,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,(t.mode&1)!==0&&Wr(t,e.child,null,d),t.child.memoizedState=ii(d),t.memoizedState=si,a);if((t.mode&1)===0)return qo(e,t,d,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var x=n.dgst;return n=x,a=Error(i(419)),n=ri(a,n,void 0),qo(e,t,d,n)}if(x=(d&e.childLanes)!==0,tt||x){if(n=Be,n!==null){switch(d&-d){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=(s&(n.suspendedLanes|d))!==0?0:s,s!==0&&s!==a.retryLane&&(a.retryLane=s,Dt(e,s),wt(n,e,s,-1))}return Ni(),n=ri(Error(i(421))),qo(e,t,d,n)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Em.bind(null,e),s._reactRetry=t,null):(e=a.treeContext,it=Gt(s.nextSibling),st=t,Me=!0,xt=null,e!==null&&(ut[ct++]=Lt,ut[ct++]=Ot,ut[ct++]=hr,Lt=e.id,Ot=e.overflow,hr=t),t=ai(t,n.children),t.flags|=4096,t)}function Lc(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Fs(e.return,t,r)}function ui(e,t,r,n,s){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=s)}function Oc(e,t,r){var n=t.pendingProps,s=n.revealOrder,a=n.tail;if(Ye(e,t,n.children,r),n=Re.current,(n&2)!==0)n=n&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&&Lc(e,r,t);else if(e.tag===19)Lc(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}n&=1}if(Ne(Re,n),(t.mode&1)===0)t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&Vo(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),ui(t,!1,s,r,a);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Vo(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}ui(t,!0,r,null,a);break;case"together":ui(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Yo(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function zt(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),br|=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=nr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=nr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function hm(e,t,r){switch(t.tag){case 3:Mc(t),Vr();break;case 5:Ku(t);break;case 1:et(t.type)&&Oo(t);break;case 4:Bs(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,s=t.memoizedProps.value;Ne(Fo,n._currentValue),n._currentValue=s;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Ne(Re,Re.current&1),t.flags|=128,null):(r&t.child.childLanes)!==0?Rc(e,t,r):(Ne(Re,Re.current&1),e=zt(e,t,r),e!==null?e.sibling:null);Ne(Re,Re.current&1);break;case 19:if(n=(r&t.childLanes)!==0,(e.flags&128)!==0){if(n)return Oc(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Ne(Re,Re.current),n)break;return null;case 22:case 23:return t.lanes=0,Cc(e,t,r)}return zt(e,t,r)}var Dc,ci,Tc,zc;Dc=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}},ci=function(){},Tc=function(e,t,r,n){var s=e.memoizedProps;if(s!==n){e=t.stateNode,vr(St.current);var a=null;switch(r){case"input":s=Fl(e,s),n=Fl(e,n),a=[];break;case"select":s=B({},s,{value:void 0}),n=B({},n,{value:void 0}),a=[];break;case"textarea":s=Bl(e,s),n=Bl(e,n),a=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=Po)}Wl(r,n);var d;r=null;for(P in s)if(!n.hasOwnProperty(P)&&s.hasOwnProperty(P)&&s[P]!=null)if(P==="style"){var x=s[P];for(d in x)x.hasOwnProperty(d)&&(r||(r={}),r[d]="")}else P!=="dangerouslySetInnerHTML"&&P!=="children"&&P!=="suppressContentEditableWarning"&&P!=="suppressHydrationWarning"&&P!=="autoFocus"&&(f.hasOwnProperty(P)?a||(a=[]):(a=a||[]).push(P,null));for(P in n){var v=n[P];if(x=s!=null?s[P]:void 0,n.hasOwnProperty(P)&&v!==x&&(v!=null||x!=null))if(P==="style")if(x){for(d in x)!x.hasOwnProperty(d)||v&&v.hasOwnProperty(d)||(r||(r={}),r[d]="");for(d in v)v.hasOwnProperty(d)&&x[d]!==v[d]&&(r||(r={}),r[d]=v[d])}else r||(a||(a=[]),a.push(P,r)),r=v;else P==="dangerouslySetInnerHTML"?(v=v?v.__html:void 0,x=x?x.__html:void 0,v!=null&&x!==v&&(a=a||[]).push(P,v)):P==="children"?typeof v!="string"&&typeof v!="number"||(a=a||[]).push(P,""+v):P!=="suppressContentEditableWarning"&&P!=="suppressHydrationWarning"&&(f.hasOwnProperty(P)?(v!=null&&P==="onScroll"&&Ce("scroll",e),a||x===v||(a=[])):(a=a||[]).push(P,v))}r&&(a=a||[]).push("style",r);var P=a;(t.updateQueue=P)&&(t.flags|=4)}},zc=function(e,t,r,n){r!==n&&(t.flags|=4)};function Hn(e,t){if(!Me)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 n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ze(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function gm(e,t,r){var n=t.pendingProps;switch(Ls(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(t),null;case 1:return et(t.type)&&Lo(),Ze(t),null;case 3:return n=t.stateNode,Kr(),Ee(Je),Ee(Ke),Hs(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Io(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,xt!==null&&(wi(xt),xt=null))),ci(e,t),Ze(t),null;case 5:Vs(t);var s=vr(Un.current);if(r=t.type,e!==null&&t.stateNode!=null)Tc(e,t,r,n,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(i(166));return Ze(t),null}if(e=vr(St.current),Io(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[Nt]=t,n[Tn]=a,e=(t.mode&1)!==0,r){case"dialog":Ce("cancel",n),Ce("close",n);break;case"iframe":case"object":case"embed":Ce("load",n);break;case"video":case"audio":for(s=0;s<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=d.createElement(r,{is:n.is}):(e=d.createElement(r),r==="select"&&(d=e,n.multiple?d.multiple=!0:n.size&&(d.size=n.size))):e=d.createElementNS(e,r),e[Nt]=t,e[Tn]=n,Dc(e,t,!1,!1),t.stateNode=e;e:{switch(d=Hl(r,n),r){case"dialog":Ce("cancel",e),Ce("close",e),s=n;break;case"iframe":case"object":case"embed":Ce("load",e),s=n;break;case"video":case"audio":for(s=0;sYr&&(t.flags|=128,n=!0,Hn(a,!1),t.lanes=4194304)}else{if(!n)if(e=Vo(d),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Hn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!d.alternate&&!Me)return Ze(t),null}else 2*Te()-a.renderingStartTime>Yr&&r!==1073741824&&(t.flags|=128,n=!0,Hn(a,!1),t.lanes=4194304);a.isBackwards?(d.sibling=t.child,t.child=d):(r=a.last,r!==null?r.sibling=d:t.child=d,a.last=d)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Te(),t.sibling=null,r=Re.current,Ne(Re,n?r&1|2:r&1),t):(Ze(t),null);case 22:case 23:return ji(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&(t.mode&1)!==0?(at&1073741824)!==0&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function xm(e,t){switch(Ls(t),t.tag){case 1:return et(t.type)&&Lo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Kr(),Ee(Je),Ee(Ke),Hs(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Vs(t),null;case 13:if(Ee(Re),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Vr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ee(Re),null;case 4:return Kr(),null;case 10:return As(t.type._context),null;case 22:case 23:return ji(),null;case 24:return null;default:return null}}var Xo=!1,qe=!1,vm=typeof WeakSet=="function"?WeakSet:Set,Y=null;function Zr(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){De(e,t,n)}else r.current=null}function di(e,t,r){try{r()}catch(n){De(e,t,n)}}var Ic=!1;function ym(e,t){if(js=vo,e=hu(),hs(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var d=0,x=-1,v=-1,P=0,I=0,$=e,z=null;t:for(;;){for(var Z;$!==r||s!==0&&$.nodeType!==3||(x=d+s),$!==a||n!==0&&$.nodeType!==3||(v=d+n),$.nodeType===3&&(d+=$.nodeValue.length),(Z=$.firstChild)!==null;)z=$,$=Z;for(;;){if($===e)break t;if(z===r&&++P===s&&(x=d),z===a&&++I===n&&(v=d),(Z=$.nextSibling)!==null)break;$=z,z=$.parentNode}$=Z}r=x===-1||v===-1?null:{start:x,end:v}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ns={focusedElem:e,selectionRange:r},vo=!1,Y=t;Y!==null;)if(t=Y,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;try{var X=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(X!==null){var ee=X.memoizedProps,ze=X.memoizedState,E=t.stateNode,k=E.getSnapshotBeforeUpdate(t.elementType===t.type?ee:vt(t.type,ee),ze);E.__reactInternalSnapshotBeforeUpdate=k}break;case 3:var _=t.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(V){De(t,t.return,V)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return X=Ic,Ic=!1,X}function Gn(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&e)===e){var a=s.destroy;s.destroy=void 0,a!==void 0&&di(t,r,a)}s=s.next}while(s!==n)}}function Jo(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 n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function fi(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 Ac(e){var t=e.alternate;t!==null&&(e.alternate=null,Ac(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Nt],delete t[Tn],delete t[_s],delete t[tm],delete t[rm])),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 Fc(e){return e.tag===5||e.tag===3||e.tag===4}function Uc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Fc(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 pi(e,t,r){var n=e.tag;if(n===5||n===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=Po));else if(n!==4&&(e=e.child,e!==null))for(pi(e,t,r),e=e.sibling;e!==null;)pi(e,t,r),e=e.sibling}function mi(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(mi(e,t,r),e=e.sibling;e!==null;)mi(e,t,r),e=e.sibling}var We=null,yt=!1;function Xt(e,t,r){for(r=r.child;r!==null;)$c(e,t,r),r=r.sibling}function $c(e,t,r){if(jt&&typeof jt.onCommitFiberUnmount=="function")try{jt.onCommitFiberUnmount(fo,r)}catch{}switch(r.tag){case 5:qe||Zr(r,t);case 6:var n=We,s=yt;We=null,Xt(e,t,r),We=n,yt=s,We!==null&&(yt?(e=We,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):We.removeChild(r.stateNode));break;case 18:We!==null&&(yt?(e=We,r=r.stateNode,e.nodeType===8?Es(e.parentNode,r):e.nodeType===1&&Es(e,r),Nn(e)):Es(We,r.stateNode));break;case 4:n=We,s=yt,We=r.stateNode.containerInfo,yt=!0,Xt(e,t,r),We=n,yt=s;break;case 0:case 11:case 14:case 15:if(!qe&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var a=s,d=a.destroy;a=a.tag,d!==void 0&&((a&2)!==0||(a&4)!==0)&&di(r,t,d),s=s.next}while(s!==n)}Xt(e,t,r);break;case 1:if(!qe&&(Zr(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(x){De(r,t,x)}Xt(e,t,r);break;case 21:Xt(e,t,r);break;case 22:r.mode&1?(qe=(n=qe)||r.memoizedState!==null,Xt(e,t,r),qe=n):Xt(e,t,r);break;default:Xt(e,t,r)}}function Bc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new vm),t.forEach(function(n){var s=_m.bind(null,e,n);r.has(n)||(r.add(n),n.then(s,s))})}}function bt(e,t){var r=t.deletions;if(r!==null)for(var n=0;ns&&(s=d),n&=~a}if(n=s,n=Te()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*wm(n/1960))-n,10e?16:e,er===null)var n=!1;else{if(e=er,er=null,ol=0,(ve&6)!==0)throw Error(i(331));var s=ve;for(ve|=4,Y=e.current;Y!==null;){var a=Y,d=a.child;if((Y.flags&16)!==0){var x=a.deletions;if(x!==null){for(var v=0;vTe()-xi?kr(e,0):gi|=r),nt(e,t)}function td(e,t){t===0&&((e.mode&1)===0?t=1:(t=mo,mo<<=1,(mo&130023424)===0&&(mo=4194304)));var r=Xe();e=Dt(e,t),e!==null&&(yn(e,t,r),nt(e,r))}function Em(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),td(e,r)}function _m(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(i(314))}n!==null&&n.delete(t),td(e,r)}var rd;rd=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Je.current)tt=!0;else{if((e.lanes&r)===0&&(t.flags&128)===0)return tt=!1,hm(e,t,r);tt=(e.flags&131072)!==0}else tt=!1,Me&&(t.flags&1048576)!==0&&Tu(t,zo,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Yo(e,t),e=t.pendingProps;var s=Ur(t,Ke.current);Gr(t,r),s=Qs(null,t,n,e,s,r);var a=Zs();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,et(n)?(a=!0,Oo(t)):a=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,$s(t),s.updater=Zo,t.stateNode=s,s._reactInternals=t,ti(t,n,e,r),t=li(null,t,n,!0,a,r)):(t.tag=0,Me&&a&&Rs(t),Ye(null,t,s,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Yo(e,t),e=t.pendingProps,s=n._init,n=s(n._payload),t.type=n,s=t.tag=Pm(n),e=vt(n,e),s){case 0:t=oi(null,t,n,e,r);break e;case 1:t=_c(null,t,n,e,r);break e;case 11:t=jc(null,t,n,e,r);break e;case 14:t=Nc(null,t,n,vt(n.type,e),r);break e}throw Error(i(306,n,""))}return t;case 0:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:vt(n,s),oi(e,t,n,s,r);case 1:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:vt(n,s),_c(e,t,n,s,r);case 3:e:{if(Mc(t),e===null)throw Error(i(387));n=t.pendingProps,a=t.memoizedState,s=a.element,Wu(e,t),Bo(t,n,null,r);var d=t.memoizedState;if(n=d.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:d.cache,pendingSuspenseBoundaries:d.pendingSuspenseBoundaries,transitions:d.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){s=Qr(Error(i(423)),t),t=Pc(e,t,n,r,s);break e}else if(n!==s){s=Qr(Error(i(424)),t),t=Pc(e,t,n,r,s);break e}else for(it=Gt(t.stateNode.containerInfo.firstChild),st=t,Me=!0,xt=null,r=Bu(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Vr(),n===s){t=zt(e,t,r);break e}Ye(e,t,n,r)}t=t.child}return t;case 5:return Ku(t),e===null&&Ds(t),n=t.type,s=t.pendingProps,a=e!==null?e.memoizedProps:null,d=s.children,Ss(n,s)?d=null:a!==null&&Ss(n,a)&&(t.flags|=32),Ec(e,t),Ye(e,t,d,r),t.child;case 6:return e===null&&Ds(t),null;case 13:return Rc(e,t,r);case 4:return Bs(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Wr(t,null,n,r):Ye(e,t,n,r),t.child;case 11:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:vt(n,s),jc(e,t,n,s,r);case 7:return Ye(e,t,t.pendingProps,r),t.child;case 8:return Ye(e,t,t.pendingProps.children,r),t.child;case 12:return Ye(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,s=t.pendingProps,a=t.memoizedProps,d=s.value,Ne(Fo,n._currentValue),n._currentValue=d,a!==null)if(gt(a.value,d)){if(a.children===s.children&&!Je.current){t=zt(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var x=a.dependencies;if(x!==null){d=a.child;for(var v=x.firstContext;v!==null;){if(v.context===n){if(a.tag===1){v=Tt(-1,r&-r),v.tag=2;var P=a.updateQueue;if(P!==null){P=P.shared;var I=P.pending;I===null?v.next=v:(v.next=I.next,I.next=v),P.pending=v}}a.lanes|=r,v=a.alternate,v!==null&&(v.lanes|=r),Fs(a.return,r,t),x.lanes|=r;break}v=v.next}}else if(a.tag===10)d=a.type===t.type?null:a.child;else if(a.tag===18){if(d=a.return,d===null)throw Error(i(341));d.lanes|=r,x=d.alternate,x!==null&&(x.lanes|=r),Fs(d,r,t),d=a.sibling}else d=a.child;if(d!==null)d.return=a;else for(d=a;d!==null;){if(d===t){d=null;break}if(a=d.sibling,a!==null){a.return=d.return,d=a;break}d=d.return}a=d}Ye(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,n=t.pendingProps.children,Gr(t,r),s=dt(s),n=n(s),t.flags|=1,Ye(e,t,n,r),t.child;case 14:return n=t.type,s=vt(n,t.pendingProps),s=vt(n.type,s),Nc(e,t,n,s,r);case 15:return Sc(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,s=t.pendingProps,s=t.elementType===n?s:vt(n,s),Yo(e,t),t.tag=1,et(n)?(e=!0,Oo(t)):e=!1,Gr(t,r),gc(t,n,s),ti(t,n,s,r),li(null,t,n,!0,e,r);case 19:return Oc(e,t,r);case 22:return Cc(e,t,r)}throw Error(i(156,t.tag))};function nd(e,t){return za(e,t)}function Mm(e,t,r,n){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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mt(e,t,r,n){return new Mm(e,t,r,n)}function Si(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Pm(e){if(typeof e=="function")return Si(e)?1:0;if(e!=null){if(e=e.$$typeof,e===se)return 11;if(e===Oe)return 14}return 2}function nr(e,t){var r=e.alternate;return r===null?(r=mt(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 al(e,t,r,n,s,a){var d=2;if(n=e,typeof e=="function")Si(e)&&(d=1);else if(typeof e=="string")d=5;else e:switch(e){case ae:return Nr(r.children,s,a,t);case be:d=8,s|=8;break;case A:return e=mt(12,r,t,s|2),e.elementType=A,e.lanes=a,e;case Pe:return e=mt(13,r,t,s),e.elementType=Pe,e.lanes=a,e;case ke:return e=mt(19,r,t,s),e.elementType=ke,e.lanes=a,e;case xe:return ul(r,s,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ue:d=10;break e;case Se:d=9;break e;case se:d=11;break e;case Oe:d=14;break e;case je:d=16,n=null;break e}throw Error(i(130,e==null?e:typeof e,""))}return t=mt(d,r,t,s),t.elementType=e,t.type=n,t.lanes=a,t}function Nr(e,t,r,n){return e=mt(7,e,n,t),e.lanes=r,e}function ul(e,t,r,n){return e=mt(22,e,n,t),e.elementType=xe,e.lanes=r,e.stateNode={isHidden:!1},e}function Ci(e,t,r){return e=mt(6,e,null,t),e.lanes=r,e}function Ei(e,t,r){return t=mt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Rm(e,t,r,n,s){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=es(0),this.expirationTimes=es(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=es(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function _i(e,t,r,n,s,a,d,x,v){return e=new Rm(e,t,r,x,v),t===1?(t=1,a===!0&&(t|=8)):t=0,a=mt(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},$s(a),e}function Lm(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(o)}catch(u){console.error(u)}}return o(),Di.exports=Wm(),Di.exports}var xd;function Hm(){if(xd)return gl;xd=1;var o=Vd();return gl.createRoot=o.createRoot,gl.hydrateRoot=o.hydrateRoot,gl}var Gm=Hm();const Km=$d(Gm);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -52,7 +52,7 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qm=h.forwardRef(({color:o="currentColor",size:u=24,strokeWidth:i=2,absoluteStrokeWidth:c,className:f="",children:p,iconNode:m,...g},S)=>h.createElement("svg",{ref:S,...Zm,width:u,height:u,stroke:o,strokeWidth:c?Number(i)*24/Number(u):i,className:Wd("lucide",f),...g},[...m.map(([j,k])=>h.createElement(j,k)),...Array.isArray(p)?p:[p]]));/** + */const qm=h.forwardRef(({color:o="currentColor",size:u=24,strokeWidth:i=2,absoluteStrokeWidth:c,className:f="",children:p,iconNode:m,...g},S)=>h.createElement("svg",{ref:S,...Zm,width:u,height:u,stroke:o,strokeWidth:c?Number(i)*24/Number(u):i,className:Wd("lucide",f),...g},[...m.map(([j,b])=>h.createElement(j,b)),...Array.isArray(p)?p:[p]]));/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -277,7 +277,7 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Xd=fe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Yi=[{id:"dashboard",label:"Zentrale",hint:"System- & Stack-Status",icon:ah},{id:"models",label:"Modell-Zentrale",hint:"Verwalten, laden & Gateway-Routing",icon:Ym},{id:"system",label:"Diagnose",hint:"Metriken, Dienste, Logs",icon:cr},{id:"memory",label:"Gedächtnis",hint:"Geteiltes Memory verwalten",icon:ia},{id:"connect",label:"Verbinden",hint:"IDE-/Agent-Configs erzeugen",icon:dh},{id:"agent",label:"Hermes",hint:"Agent-Status & WebUI öffnen",icon:sa},{id:"guide",label:"Anleitung",hint:"Einrichten & Vibe-Coding",icon:eh}];var vd=1,wh=.9,kh=.8,jh=.17,Ii=.1,Ai=.999,Nh=.9999,Sh=.99,Ch=/[\\\/_+.#"@\[\(\{&]/,Eh=/[\\\/_+.#"@\[\(\{&]/g,_h=/[\s-]/,Jd=/[\s-]/g;function Xi(o,u,i,c,f,p,m){if(p===u.length)return f===o.length?vd:Sh;var g=`${f},${p}`;if(m[g]!==void 0)return m[g];for(var S=c.charAt(p),j=i.indexOf(S,f),k=0,C,D,O,R;j>=0;)C=Xi(o,u,i,c,j+1,p+1,m),C>k&&(j===f?C*=vd:Ch.test(o.charAt(j-1))?(C*=kh,O=o.slice(f,j-1).match(Eh),O&&f>0&&(C*=Math.pow(Ai,O.length))):_h.test(o.charAt(j-1))?(C*=wh,R=o.slice(f,j-1).match(Jd),R&&f>0&&(C*=Math.pow(Ai,R.length))):(C*=jh,f>0&&(C*=Math.pow(Ai,j-f))),o.charAt(j)!==u.charAt(p)&&(C*=Nh)),(CC&&(C=D*Ii)),C>k&&(k=C),j=i.indexOf(S,j+1);return m[g]=k,k}function yd(o){return o.toLowerCase().replace(Jd," ")}function Mh(o,u,i){return o=i&&i.length>0?`${o+" "+i.join(" ")}`:o,Xi(o,u,yd(o),yd(u),0,0,{})}function ur(o,u,{checkForDefaultPrevented:i=!0}={}){return function(f){if(o==null||o(f),i===!1||!f.defaultPrevented)return u==null?void 0:u(f)}}function bd(o,u){if(typeof o=="function")return o(u);o!=null&&(o.current=u)}function un(...o){return u=>{let i=!1;const c=o.map(f=>{const p=bd(f,u);return!i&&typeof p=="function"&&(i=!0),p});if(i)return()=>{for(let f=0;f{var B;const{scope:D,children:O,...R}=C,N=((B=D==null?void 0:D[o])==null?void 0:B[S])||g,L=h.useMemo(()=>R,Object.values(R));return l.jsx(N.Provider,{value:L,children:O})};j.displayName=p+"Provider";function k(C,D){var N;const O=((N=D==null?void 0:D[o])==null?void 0:N[S])||g,R=h.useContext(O);if(R)return R;if(m!==void 0)return m;throw new Error(`\`${C}\` must be used within \`${p}\``)}return[j,k]}const f=()=>{const p=i.map(m=>h.createContext(m));return function(g){const S=(g==null?void 0:g[o])||p;return h.useMemo(()=>({[`__scope${o}`]:{...g,[o]:S}}),[g,S])}};return f.scopeName=o,[c,Rh(f,...u)]}function Rh(...o){const u=o[0];if(o.length===1)return u;const i=()=>{const c=o.map(f=>({useScope:f(),scopeName:f.scopeName}));return function(p){const m=c.reduce((g,{useScope:S,scopeName:j})=>{const C=S(p)[`__scope${j}`];return{...g,...C}},{});return h.useMemo(()=>({[`__scope${u.scopeName}`]:m}),[m])}};return i.scopeName=u.scopeName,i}var ro=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Lh=oa[" useId ".trim().toString()]||(()=>{}),Oh=0;function Ft(o){const[u,i]=h.useState(Lh());return ro(()=>{i(c=>c??String(Oh++))},[o]),u?`radix-${u}`:""}var Dh=oa[" useInsertionEffect ".trim().toString()]||ro;function Th({prop:o,defaultProp:u,onChange:i=()=>{},caller:c}){const[f,p,m]=zh({defaultProp:u,onChange:i}),g=o!==void 0,S=g?o:f;{const k=h.useRef(o!==void 0);h.useEffect(()=>{const C=k.current;C!==g&&console.warn(`${c} is changing from ${C?"controlled":"uncontrolled"} to ${g?"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.`),k.current=g},[g,c])}const j=h.useCallback(k=>{var C;if(g){const D=Ih(k)?k(o):k;D!==o&&((C=m.current)==null||C.call(m,D))}else p(k)},[g,o,p,m]);return[S,j]}function zh({defaultProp:o,onChange:u}){const[i,c]=h.useState(o),f=h.useRef(i),p=h.useRef(u);return Dh(()=>{p.current=u},[u]),h.useEffect(()=>{var m;f.current!==i&&((m=p.current)==null||m.call(p,i),f.current=i)},[i,f]),[i,c,p]}function Ih(o){return typeof o=="function"}var ef=Vd();function tf(o){const u=h.forwardRef((i,c)=>{let{children:f,...p}=i,m=null,g=!1;const S=[];wd(f)&&typeof xl=="function"&&(f=xl(f._payload)),h.Children.forEach(f,D=>{var O;if(Bh(D)){g=!0;const R=D;let N="child"in R.props?R.props.child:R.props.children;wd(N)&&typeof xl=="function"&&(N=xl(N._payload)),m=Fh(R,N),S.push((O=m==null?void 0:m.props)==null?void 0:O.children)}else S.push(D)}),m?m=h.cloneElement(m,void 0,S):!g&&h.Children.count(f)===1&&h.isValidElement(f)&&(m=f);const j=m?$h(m):void 0,k=Er(c,j);if(!m){if(f||f===0)throw new Error(g?Gh(o):Hh(o));return f}const C=Uh(p,m.props??{});return m.type!==h.Fragment&&(C.ref=c?k:j),h.cloneElement(m,C)});return u.displayName=`${o}.Slot`,u}var Ah=Symbol.for("radix.slottable"),Fh=(o,u)=>{if("child"in o.props){const i=o.props.child;return h.isValidElement(i)?h.cloneElement(i,void 0,o.props.children(i.props.children)):null}return h.isValidElement(u)?u:null};function Uh(o,u){const i={...u};for(const c in u){const f=o[c],p=u[c];/^on[A-Z]/.test(c)?f&&p?i[c]=(...g)=>{const S=p(...g);return f(...g),S}:f&&(i[c]=f):c==="style"?i[c]={...f,...p}:c==="className"&&(i[c]=[f,p].filter(Boolean).join(" "))}return{...o,...i}}function $h(o){var c,f;let u=(c=Object.getOwnPropertyDescriptor(o.props,"ref"))==null?void 0:c.get,i=u&&"isReactWarning"in u&&u.isReactWarning;return i?o.ref:(u=(f=Object.getOwnPropertyDescriptor(o,"ref"))==null?void 0:f.get,i=u&&"isReactWarning"in u&&u.isReactWarning,i?o.props.ref:o.props.ref||o.ref)}function Bh(o){return h.isValidElement(o)&&typeof o.type=="function"&&"__radixId"in o.type&&o.type.__radixId===Ah}var Vh=Symbol.for("react.lazy");function wd(o){return o!=null&&typeof o=="object"&&"$$typeof"in o&&o.$$typeof===Vh&&"_payload"in o&&Wh(o._payload)}function Wh(o){return typeof o=="object"&&o!==null&&"then"in o}var Hh=o=>`${o} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Gh=o=>`${o} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,xl=oa[" use ".trim().toString()],Kh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ge=Kh.reduce((o,u)=>{const i=tf(`Primitive.${u}`),c=h.forwardRef((f,p)=>{const{asChild:m,...g}=f,S=m?i:u;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(S,{...g,ref:p})});return c.displayName=`Primitive.${u}`,{...o,[u]:c}},{});function Qh(o,u){o&&ef.flushSync(()=>o.dispatchEvent(u))}function no(o){const u=h.useRef(o);return h.useEffect(()=>{u.current=o}),h.useMemo(()=>((...i)=>{var c;return(c=u.current)==null?void 0:c.call(u,...i)}),[])}function Zh(o,u=globalThis==null?void 0:globalThis.document){const i=no(o);h.useEffect(()=>{const c=f=>{f.key==="Escape"&&i(f)};return u.addEventListener("keydown",c,{capture:!0}),()=>u.removeEventListener("keydown",c,{capture:!0})},[i,u])}var qh="DismissableLayer",Ji="dismissableLayer.update",Yh="dismissableLayer.pointerDownOutside",Xh="dismissableLayer.focusOutside",kd,ca=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),rf=h.forwardRef((o,u)=>{const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:g,onDismiss:S,...j}=o,k=h.useContext(ca),[C,D]=h.useState(null),O=(C==null?void 0:C.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,R]=h.useState({}),N=Er(u,A=>D(A)),L=Array.from(k.layers),[B]=[...k.layersWithOutsidePointerEventsDisabled].slice(-1),T=L.indexOf(B),Q=C?L.indexOf(C):-1,q=k.layersWithOutsidePointerEventsDisabled.size>0,F=Q>=T,J=h.useRef(!1),ae=rg(A=>{const ue=A.target;if(!(ue instanceof Node))return;const Se=[...k.branches].some(se=>se.contains(ue));!F||Se||(p==null||p(A),g==null||g(A),A.defaultPrevented||S==null||S())},{ownerDocument:O,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:J,dismissableSurfaces:k.dismissableSurfaces}),be=ng(A=>{if(c&&J.current)return;const ue=A.target;[...k.branches].some(se=>se.contains(ue))||(m==null||m(A),g==null||g(A),A.defaultPrevented||S==null||S())},O);return Zh(A=>{Q===k.layers.size-1&&(f==null||f(A),!A.defaultPrevented&&S&&(A.preventDefault(),S()))},O),h.useEffect(()=>{if(C)return i&&(k.layersWithOutsidePointerEventsDisabled.size===0&&(kd=O.body.style.pointerEvents,O.body.style.pointerEvents="none"),k.layersWithOutsidePointerEventsDisabled.add(C)),k.layers.add(C),jd(),()=>{i&&(k.layersWithOutsidePointerEventsDisabled.delete(C),k.layersWithOutsidePointerEventsDisabled.size===0&&(O.body.style.pointerEvents=kd))}},[C,O,i,k]),h.useEffect(()=>()=>{C&&(k.layers.delete(C),k.layersWithOutsidePointerEventsDisabled.delete(C),jd())},[C,k]),h.useEffect(()=>{const A=()=>R({});return document.addEventListener(Ji,A),()=>document.removeEventListener(Ji,A)},[]),l.jsx(Ge.div,{...j,ref:N,style:{pointerEvents:q?F?"auto":"none":void 0,...o.style},onFocusCapture:ur(o.onFocusCapture,be.onFocusCapture),onBlurCapture:ur(o.onBlurCapture,be.onBlurCapture),onPointerDownCapture:ur(o.onPointerDownCapture,ae.onPointerDownCapture)})});rf.displayName=qh;var Jh="DismissableLayerBranch",eg=h.forwardRef((o,u)=>{const i=h.useContext(ca),c=h.useRef(null),f=Er(u,c);return h.useEffect(()=>{const p=c.current;if(p)return i.branches.add(p),()=>{i.branches.delete(p)}},[i.branches]),l.jsx(Ge.div,{...o,ref:f})});eg.displayName=Jh;function tg(){const o=h.useContext(ca),[u,i]=h.useState(null);return h.useEffect(()=>{if(u)return o.dismissableSurfaces.add(u),()=>{o.dismissableSurfaces.delete(u)}},[u,o.dismissableSurfaces]),i}function rg(o,u){const{ownerDocument:i=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:c=!1,isDeferredPointerDownOutsideRef:f,dismissableSurfaces:p}=u,m=no(o),g=h.useRef(!1),S=h.useRef(!1),j=h.useRef(new Map),k=h.useRef(()=>{});return h.useEffect(()=>{function C(){S.current=!1,f.current=!1,j.current.clear()}function D(){return Array.from(j.current.values()).some(Boolean)}function O(T){if(!S.current)return;const Q=T.target;Q instanceof Node&&[...p].some(F=>F.contains(Q))||j.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{S.current&&k.current()},0)}function R(T){S.current&&j.current.set(T.type,!1)}const N=T=>{if(T.target&&!g.current){let Q=function(){i.removeEventListener("click",k.current);const F=D();C(),F||nf(Yh,m,q,{discrete:!0})};const q={originalEvent:T};S.current=!0,f.current=c&&T.button===0,j.current.clear(),!c||T.button!==0?Q():(i.removeEventListener("click",k.current),k.current=Q,i.addEventListener("click",k.current,{once:!0}))}else i.removeEventListener("click",k.current),C();g.current=!1},L=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of L)i.addEventListener(T,O,!0),i.addEventListener(T,R);const B=window.setTimeout(()=>{i.addEventListener("pointerdown",N)},0);return()=>{window.clearTimeout(B),i.removeEventListener("pointerdown",N),i.removeEventListener("click",k.current);for(const T of L)i.removeEventListener(T,O,!0),i.removeEventListener(T,R)}},[i,m,c,f,p]),{onPointerDownCapture:()=>g.current=!0}}function ng(o,u=globalThis==null?void 0:globalThis.document){const i=no(o),c=h.useRef(!1);return h.useEffect(()=>{const f=p=>{p.target&&!c.current&&nf(Xh,i,{originalEvent:p},{discrete:!1})};return u.addEventListener("focusin",f),()=>u.removeEventListener("focusin",f)},[u,i]),{onFocusCapture:()=>c.current=!0,onBlurCapture:()=>c.current=!1}}function jd(){const o=new CustomEvent(Ji);document.dispatchEvent(o)}function nf(o,u,i,{discrete:c}){const f=i.originalEvent.target,p=new CustomEvent(o,{bubbles:!1,cancelable:!0,detail:i});u&&f.addEventListener(o,u,{once:!0}),c?Qh(f,p):f.dispatchEvent(p)}var Fi="focusScope.autoFocusOnMount",Ui="focusScope.autoFocusOnUnmount",Nd={bubbles:!1,cancelable:!0},og="FocusScope",of=h.forwardRef((o,u)=>{const{loop:i=!1,trapped:c=!1,onMountAutoFocus:f,onUnmountAutoFocus:p,...m}=o,[g,S]=h.useState(null),j=no(f),k=no(p),C=h.useRef(null),D=Er(u,N=>S(N)),O=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(c){let N=function(Q){if(O.paused||!g)return;const q=Q.target;g.contains(q)?C.current=q:ar(C.current,{select:!0})},L=function(Q){if(O.paused||!g)return;const q=Q.relatedTarget;q!==null&&(g.contains(q)||ar(C.current,{select:!0}))},B=function(Q){if(document.activeElement===document.body)for(const F of Q)F.removedNodes.length>0&&ar(g)};document.addEventListener("focusin",N),document.addEventListener("focusout",L);const T=new MutationObserver(B);return g&&T.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",N),document.removeEventListener("focusout",L),T.disconnect()}}},[c,g,O.paused]),h.useEffect(()=>{if(g){Cd.add(O);const N=document.activeElement;if(!g.contains(N)){const B=new CustomEvent(Fi,Nd);g.addEventListener(Fi,j),g.dispatchEvent(B),B.defaultPrevented||(lg(cg(lf(g)),{select:!0}),document.activeElement===N&&ar(g))}return()=>{g.removeEventListener(Fi,j),setTimeout(()=>{const B=new CustomEvent(Ui,Nd);g.addEventListener(Ui,k),g.dispatchEvent(B),B.defaultPrevented||ar(N??document.body,{select:!0}),g.removeEventListener(Ui,k),Cd.remove(O)},0)}}},[g,j,k,O]);const R=h.useCallback(N=>{if(!i&&!c||O.paused)return;const L=N.key==="Tab"&&!N.altKey&&!N.ctrlKey&&!N.metaKey,B=document.activeElement;if(L&&B){const T=N.currentTarget,[Q,q]=sg(T);Q&&q?!N.shiftKey&&B===q?(N.preventDefault(),i&&ar(Q,{select:!0})):N.shiftKey&&B===Q&&(N.preventDefault(),i&&ar(q,{select:!0})):B===T&&N.preventDefault()}},[i,c,O.paused]);return l.jsx(Ge.div,{tabIndex:-1,...m,ref:D,onKeyDown:R})});of.displayName=og;function lg(o,{select:u=!1}={}){const i=document.activeElement;for(const c of o)if(ar(c,{select:u}),document.activeElement!==i)return}function sg(o){const u=lf(o),i=Sd(u,o),c=Sd(u.reverse(),o);return[i,c]}function lf(o){const u=[],i=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,{acceptNode:c=>{const f=c.tagName==="INPUT"&&c.type==="hidden";return c.disabled||c.hidden||f?NodeFilter.FILTER_SKIP:c.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)u.push(i.currentNode);return u}function Sd(o,u){for(const i of o)if(!ig(i,{upTo:u}))return i}function ig(o,{upTo:u}){if(getComputedStyle(o).visibility==="hidden")return!0;for(;o;){if(u!==void 0&&o===u)return!1;if(getComputedStyle(o).display==="none")return!0;o=o.parentElement}return!1}function ag(o){return o instanceof HTMLInputElement&&"select"in o}function ar(o,{select:u=!1}={}){if(o&&o.focus){const i=document.activeElement;o.focus({preventScroll:!0}),o!==i&&ag(o)&&u&&o.select()}}var Cd=ug();function ug(){let o=[];return{add(u){const i=o[0];u!==i&&(i==null||i.pause()),o=Ed(o,u),o.unshift(u)},remove(u){var i;o=Ed(o,u),(i=o[0])==null||i.resume()}}}function Ed(o,u){const i=[...o],c=i.indexOf(u);return c!==-1&&i.splice(c,1),i}function cg(o){return o.filter(u=>u.tagName!=="A")}var dg="Portal",sf=h.forwardRef((o,u)=>{var g;const{container:i,...c}=o,[f,p]=h.useState(!1);ro(()=>p(!0),[]);const m=i||f&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return m?ef.createPortal(l.jsx(Ge.div,{...c,ref:u}),m):null});sf.displayName=dg;function fg(o,u){return h.useReducer((i,c)=>u[i][c]??i,o)}var Tl=o=>{const{present:u,children:i}=o,c=pg(u),f=typeof i=="function"?i({present:c.isPresent}):h.Children.only(i),p=mg(c.ref,hg(f));return typeof i=="function"||c.isPresent?h.cloneElement(f,{ref:p}):null};Tl.displayName="Presence";function pg(o){const[u,i]=h.useState(),c=h.useRef(null),f=h.useRef(o),p=h.useRef("none"),m=o?"mounted":"unmounted",[g,S]=fg(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const j=vl(c.current);p.current=g==="mounted"?j:"none"},[g]),ro(()=>{const j=c.current,k=f.current;if(k!==o){const D=p.current,O=vl(j);o?S("MOUNT"):O==="none"||(j==null?void 0:j.display)==="none"?S("UNMOUNT"):S(k&&D!==O?"ANIMATION_OUT":"UNMOUNT"),f.current=o}},[o,S]),ro(()=>{if(u){let j;const k=u.ownerDocument.defaultView??window,C=O=>{const N=vl(c.current).includes(CSS.escape(O.animationName));if(O.target===u&&N&&(S("ANIMATION_END"),!f.current)){const L=u.style.animationFillMode;u.style.animationFillMode="forwards",j=k.setTimeout(()=>{u.style.animationFillMode==="forwards"&&(u.style.animationFillMode=L)})}},D=O=>{O.target===u&&(p.current=vl(c.current))};return u.addEventListener("animationstart",D),u.addEventListener("animationcancel",C),u.addEventListener("animationend",C),()=>{k.clearTimeout(j),u.removeEventListener("animationstart",D),u.removeEventListener("animationcancel",C),u.removeEventListener("animationend",C)}}else S("ANIMATION_END")},[u,S]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:h.useCallback(j=>{c.current=j?getComputedStyle(j):null,i(j)},[])}}function _d(o,u){if(typeof o=="function")return o(u);o!=null&&(o.current=u)}function mg(...o){const u=h.useRef(o);return u.current=o,h.useCallback(i=>{const c=u.current;let f=!1;const p=c.map(m=>{const g=_d(m,i);return!f&&typeof g=="function"&&(f=!0),g});if(f)return()=>{for(let m=0;m{_t||(_t={start:Md(),end:Md()});const{start:o,end:u}=_t;return document.body.firstElementChild!==o&&document.body.insertAdjacentElement("afterbegin",o),document.body.lastElementChild!==u&&document.body.insertAdjacentElement("beforeend",u),yl++,()=>{yl===1&&(_t==null||_t.start.remove(),_t==null||_t.end.remove(),_t=null),yl=Math.max(0,yl-1)}},[])}function Md(){const o=document.createElement("span");return o.setAttribute("data-radix-focus-guard",""),o.tabIndex=0,o.style.outline="none",o.style.opacity="0",o.style.position="fixed",o.style.pointerEvents="none",o}var Mt=function(){return Mt=Object.assign||function(u){for(var i,c=1,f=arguments.length;c"u")return Og;var u=Dg(o),i=document.documentElement.clientWidth,c=window.innerWidth;return{left:u[0],top:u[1],right:u[2],gap:Math.max(0,c-i+u[2]-u[0])}},zg=df(),sn="data-scroll-locked",Ig=function(o,u,i,c){var f=o.left,p=o.top,m=o.right,g=o.gap;return i===void 0&&(i="margin"),` + */const Xd=fe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Yi=[{id:"dashboard",label:"Zentrale",hint:"System- & Stack-Status",icon:ah},{id:"models",label:"Modell-Zentrale",hint:"Verwalten, laden & Gateway-Routing",icon:Ym},{id:"system",label:"Diagnose",hint:"Metriken, Dienste, Logs",icon:cr},{id:"memory",label:"Gedächtnis",hint:"Geteiltes Memory verwalten",icon:ia},{id:"connect",label:"Verbinden",hint:"IDE-/Agent-Configs erzeugen",icon:dh},{id:"agent",label:"Hermes",hint:"Agent-Status & WebUI öffnen",icon:sa},{id:"guide",label:"Anleitung",hint:"Einrichten & Vibe-Coding",icon:eh}];var vd=1,wh=.9,kh=.8,jh=.17,Ii=.1,Ai=.999,Nh=.9999,Sh=.99,Ch=/[\\\/_+.#"@\[\(\{&]/,Eh=/[\\\/_+.#"@\[\(\{&]/g,_h=/[\s-]/,Jd=/[\s-]/g;function Xi(o,u,i,c,f,p,m){if(p===u.length)return f===o.length?vd:Sh;var g=`${f},${p}`;if(m[g]!==void 0)return m[g];for(var S=c.charAt(p),j=i.indexOf(S,f),b=0,C,D,O,R;j>=0;)C=Xi(o,u,i,c,j+1,p+1,m),C>b&&(j===f?C*=vd:Ch.test(o.charAt(j-1))?(C*=kh,O=o.slice(f,j-1).match(Eh),O&&f>0&&(C*=Math.pow(Ai,O.length))):_h.test(o.charAt(j-1))?(C*=wh,R=o.slice(f,j-1).match(Jd),R&&f>0&&(C*=Math.pow(Ai,R.length))):(C*=jh,f>0&&(C*=Math.pow(Ai,j-f))),o.charAt(j)!==u.charAt(p)&&(C*=Nh)),(CC&&(C=D*Ii)),C>b&&(b=C),j=i.indexOf(S,j+1);return m[g]=b,b}function yd(o){return o.toLowerCase().replace(Jd," ")}function Mh(o,u,i){return o=i&&i.length>0?`${o+" "+i.join(" ")}`:o,Xi(o,u,yd(o),yd(u),0,0,{})}function ur(o,u,{checkForDefaultPrevented:i=!0}={}){return function(f){if(o==null||o(f),i===!1||!f.defaultPrevented)return u==null?void 0:u(f)}}function bd(o,u){if(typeof o=="function")return o(u);o!=null&&(o.current=u)}function un(...o){return u=>{let i=!1;const c=o.map(f=>{const p=bd(f,u);return!i&&typeof p=="function"&&(i=!0),p});if(i)return()=>{for(let f=0;f{var F;const{scope:D,children:O,...R}=C,N=((F=D==null?void 0:D[o])==null?void 0:F[S])||g,L=h.useMemo(()=>R,Object.values(R));return l.jsx(N.Provider,{value:L,children:O})};j.displayName=p+"Provider";function b(C,D){var N;const O=((N=D==null?void 0:D[o])==null?void 0:N[S])||g,R=h.useContext(O);if(R)return R;if(m!==void 0)return m;throw new Error(`\`${C}\` must be used within \`${p}\``)}return[j,b]}const f=()=>{const p=i.map(m=>h.createContext(m));return function(g){const S=(g==null?void 0:g[o])||p;return h.useMemo(()=>({[`__scope${o}`]:{...g,[o]:S}}),[g,S])}};return f.scopeName=o,[c,Rh(f,...u)]}function Rh(...o){const u=o[0];if(o.length===1)return u;const i=()=>{const c=o.map(f=>({useScope:f(),scopeName:f.scopeName}));return function(p){const m=c.reduce((g,{useScope:S,scopeName:j})=>{const C=S(p)[`__scope${j}`];return{...g,...C}},{});return h.useMemo(()=>({[`__scope${u.scopeName}`]:m}),[m])}};return i.scopeName=u.scopeName,i}var ro=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Lh=oa[" useId ".trim().toString()]||(()=>{}),Oh=0;function Ft(o){const[u,i]=h.useState(Lh());return ro(()=>{i(c=>c??String(Oh++))},[o]),u?`radix-${u}`:""}var Dh=oa[" useInsertionEffect ".trim().toString()]||ro;function Th({prop:o,defaultProp:u,onChange:i=()=>{},caller:c}){const[f,p,m]=zh({defaultProp:u,onChange:i}),g=o!==void 0,S=g?o:f;{const b=h.useRef(o!==void 0);h.useEffect(()=>{const C=b.current;C!==g&&console.warn(`${c} is changing from ${C?"controlled":"uncontrolled"} to ${g?"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=g},[g,c])}const j=h.useCallback(b=>{var C;if(g){const D=Ih(b)?b(o):b;D!==o&&((C=m.current)==null||C.call(m,D))}else p(b)},[g,o,p,m]);return[S,j]}function zh({defaultProp:o,onChange:u}){const[i,c]=h.useState(o),f=h.useRef(i),p=h.useRef(u);return Dh(()=>{p.current=u},[u]),h.useEffect(()=>{var m;f.current!==i&&((m=p.current)==null||m.call(p,i),f.current=i)},[i,f]),[i,c,p]}function Ih(o){return typeof o=="function"}var ef=Vd();function tf(o){const u=h.forwardRef((i,c)=>{let{children:f,...p}=i,m=null,g=!1;const S=[];wd(f)&&typeof xl=="function"&&(f=xl(f._payload)),h.Children.forEach(f,D=>{var O;if(Bh(D)){g=!0;const R=D;let N="child"in R.props?R.props.child:R.props.children;wd(N)&&typeof xl=="function"&&(N=xl(N._payload)),m=Fh(R,N),S.push((O=m==null?void 0:m.props)==null?void 0:O.children)}else S.push(D)}),m?m=h.cloneElement(m,void 0,S):!g&&h.Children.count(f)===1&&h.isValidElement(f)&&(m=f);const j=m?$h(m):void 0,b=Er(c,j);if(!m){if(f||f===0)throw new Error(g?Gh(o):Hh(o));return f}const C=Uh(p,m.props??{});return m.type!==h.Fragment&&(C.ref=c?b:j),h.cloneElement(m,C)});return u.displayName=`${o}.Slot`,u}var Ah=Symbol.for("radix.slottable"),Fh=(o,u)=>{if("child"in o.props){const i=o.props.child;return h.isValidElement(i)?h.cloneElement(i,void 0,o.props.children(i.props.children)):null}return h.isValidElement(u)?u:null};function Uh(o,u){const i={...u};for(const c in u){const f=o[c],p=u[c];/^on[A-Z]/.test(c)?f&&p?i[c]=(...g)=>{const S=p(...g);return f(...g),S}:f&&(i[c]=f):c==="style"?i[c]={...f,...p}:c==="className"&&(i[c]=[f,p].filter(Boolean).join(" "))}return{...o,...i}}function $h(o){var c,f;let u=(c=Object.getOwnPropertyDescriptor(o.props,"ref"))==null?void 0:c.get,i=u&&"isReactWarning"in u&&u.isReactWarning;return i?o.ref:(u=(f=Object.getOwnPropertyDescriptor(o,"ref"))==null?void 0:f.get,i=u&&"isReactWarning"in u&&u.isReactWarning,i?o.props.ref:o.props.ref||o.ref)}function Bh(o){return h.isValidElement(o)&&typeof o.type=="function"&&"__radixId"in o.type&&o.type.__radixId===Ah}var Vh=Symbol.for("react.lazy");function wd(o){return o!=null&&typeof o=="object"&&"$$typeof"in o&&o.$$typeof===Vh&&"_payload"in o&&Wh(o._payload)}function Wh(o){return typeof o=="object"&&o!==null&&"then"in o}var Hh=o=>`${o} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,Gh=o=>`${o} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,xl=oa[" use ".trim().toString()],Kh=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ge=Kh.reduce((o,u)=>{const i=tf(`Primitive.${u}`),c=h.forwardRef((f,p)=>{const{asChild:m,...g}=f,S=m?i:u;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(S,{...g,ref:p})});return c.displayName=`Primitive.${u}`,{...o,[u]:c}},{});function Qh(o,u){o&&ef.flushSync(()=>o.dispatchEvent(u))}function no(o){const u=h.useRef(o);return h.useEffect(()=>{u.current=o}),h.useMemo(()=>((...i)=>{var c;return(c=u.current)==null?void 0:c.call(u,...i)}),[])}function Zh(o,u=globalThis==null?void 0:globalThis.document){const i=no(o);h.useEffect(()=>{const c=f=>{f.key==="Escape"&&i(f)};return u.addEventListener("keydown",c,{capture:!0}),()=>u.removeEventListener("keydown",c,{capture:!0})},[i,u])}var qh="DismissableLayer",Ji="dismissableLayer.update",Yh="dismissableLayer.pointerDownOutside",Xh="dismissableLayer.focusOutside",kd,ca=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),rf=h.forwardRef((o,u)=>{const{disableOutsidePointerEvents:i=!1,deferPointerDownOutside:c=!1,onEscapeKeyDown:f,onPointerDownOutside:p,onFocusOutside:m,onInteractOutside:g,onDismiss:S,...j}=o,b=h.useContext(ca),[C,D]=h.useState(null),O=(C==null?void 0:C.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,R]=h.useState({}),N=Er(u,A=>D(A)),L=Array.from(b.layers),[F]=[...b.layersWithOutsidePointerEventsDisabled].slice(-1),T=L.indexOf(F),Q=C?L.indexOf(C):-1,q=b.layersWithOutsidePointerEventsDisabled.size>0,U=Q>=T,J=h.useRef(!1),ae=rg(A=>{const ue=A.target;if(!(ue instanceof Node))return;const Se=[...b.branches].some(se=>se.contains(ue));!U||Se||(p==null||p(A),g==null||g(A),A.defaultPrevented||S==null||S())},{ownerDocument:O,deferPointerDownOutside:c,isDeferredPointerDownOutsideRef:J,dismissableSurfaces:b.dismissableSurfaces}),be=ng(A=>{if(c&&J.current)return;const ue=A.target;[...b.branches].some(se=>se.contains(ue))||(m==null||m(A),g==null||g(A),A.defaultPrevented||S==null||S())},O);return Zh(A=>{Q===b.layers.size-1&&(f==null||f(A),!A.defaultPrevented&&S&&(A.preventDefault(),S()))},O),h.useEffect(()=>{if(C)return i&&(b.layersWithOutsidePointerEventsDisabled.size===0&&(kd=O.body.style.pointerEvents,O.body.style.pointerEvents="none"),b.layersWithOutsidePointerEventsDisabled.add(C)),b.layers.add(C),jd(),()=>{i&&(b.layersWithOutsidePointerEventsDisabled.delete(C),b.layersWithOutsidePointerEventsDisabled.size===0&&(O.body.style.pointerEvents=kd))}},[C,O,i,b]),h.useEffect(()=>()=>{C&&(b.layers.delete(C),b.layersWithOutsidePointerEventsDisabled.delete(C),jd())},[C,b]),h.useEffect(()=>{const A=()=>R({});return document.addEventListener(Ji,A),()=>document.removeEventListener(Ji,A)},[]),l.jsx(Ge.div,{...j,ref:N,style:{pointerEvents:q?U?"auto":"none":void 0,...o.style},onFocusCapture:ur(o.onFocusCapture,be.onFocusCapture),onBlurCapture:ur(o.onBlurCapture,be.onBlurCapture),onPointerDownCapture:ur(o.onPointerDownCapture,ae.onPointerDownCapture)})});rf.displayName=qh;var Jh="DismissableLayerBranch",eg=h.forwardRef((o,u)=>{const i=h.useContext(ca),c=h.useRef(null),f=Er(u,c);return h.useEffect(()=>{const p=c.current;if(p)return i.branches.add(p),()=>{i.branches.delete(p)}},[i.branches]),l.jsx(Ge.div,{...o,ref:f})});eg.displayName=Jh;function tg(){const o=h.useContext(ca),[u,i]=h.useState(null);return h.useEffect(()=>{if(u)return o.dismissableSurfaces.add(u),()=>{o.dismissableSurfaces.delete(u)}},[u,o.dismissableSurfaces]),i}function rg(o,u){const{ownerDocument:i=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:c=!1,isDeferredPointerDownOutsideRef:f,dismissableSurfaces:p}=u,m=no(o),g=h.useRef(!1),S=h.useRef(!1),j=h.useRef(new Map),b=h.useRef(()=>{});return h.useEffect(()=>{function C(){S.current=!1,f.current=!1,j.current.clear()}function D(){return Array.from(j.current.values()).some(Boolean)}function O(T){if(!S.current)return;const Q=T.target;Q instanceof Node&&[...p].some(U=>U.contains(Q))||j.current.set(T.type,!0),T.type==="click"&&window.setTimeout(()=>{S.current&&b.current()},0)}function R(T){S.current&&j.current.set(T.type,!1)}const N=T=>{if(T.target&&!g.current){let Q=function(){i.removeEventListener("click",b.current);const U=D();C(),U||nf(Yh,m,q,{discrete:!0})};const q={originalEvent:T};S.current=!0,f.current=c&&T.button===0,j.current.clear(),!c||T.button!==0?Q():(i.removeEventListener("click",b.current),b.current=Q,i.addEventListener("click",b.current,{once:!0}))}else i.removeEventListener("click",b.current),C();g.current=!1},L=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const T of L)i.addEventListener(T,O,!0),i.addEventListener(T,R);const F=window.setTimeout(()=>{i.addEventListener("pointerdown",N)},0);return()=>{window.clearTimeout(F),i.removeEventListener("pointerdown",N),i.removeEventListener("click",b.current);for(const T of L)i.removeEventListener(T,O,!0),i.removeEventListener(T,R)}},[i,m,c,f,p]),{onPointerDownCapture:()=>g.current=!0}}function ng(o,u=globalThis==null?void 0:globalThis.document){const i=no(o),c=h.useRef(!1);return h.useEffect(()=>{const f=p=>{p.target&&!c.current&&nf(Xh,i,{originalEvent:p},{discrete:!1})};return u.addEventListener("focusin",f),()=>u.removeEventListener("focusin",f)},[u,i]),{onFocusCapture:()=>c.current=!0,onBlurCapture:()=>c.current=!1}}function jd(){const o=new CustomEvent(Ji);document.dispatchEvent(o)}function nf(o,u,i,{discrete:c}){const f=i.originalEvent.target,p=new CustomEvent(o,{bubbles:!1,cancelable:!0,detail:i});u&&f.addEventListener(o,u,{once:!0}),c?Qh(f,p):f.dispatchEvent(p)}var Fi="focusScope.autoFocusOnMount",Ui="focusScope.autoFocusOnUnmount",Nd={bubbles:!1,cancelable:!0},og="FocusScope",of=h.forwardRef((o,u)=>{const{loop:i=!1,trapped:c=!1,onMountAutoFocus:f,onUnmountAutoFocus:p,...m}=o,[g,S]=h.useState(null),j=no(f),b=no(p),C=h.useRef(null),D=Er(u,N=>S(N)),O=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(c){let N=function(Q){if(O.paused||!g)return;const q=Q.target;g.contains(q)?C.current=q:ar(C.current,{select:!0})},L=function(Q){if(O.paused||!g)return;const q=Q.relatedTarget;q!==null&&(g.contains(q)||ar(C.current,{select:!0}))},F=function(Q){if(document.activeElement===document.body)for(const U of Q)U.removedNodes.length>0&&ar(g)};document.addEventListener("focusin",N),document.addEventListener("focusout",L);const T=new MutationObserver(F);return g&&T.observe(g,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",N),document.removeEventListener("focusout",L),T.disconnect()}}},[c,g,O.paused]),h.useEffect(()=>{if(g){Cd.add(O);const N=document.activeElement;if(!g.contains(N)){const F=new CustomEvent(Fi,Nd);g.addEventListener(Fi,j),g.dispatchEvent(F),F.defaultPrevented||(lg(cg(lf(g)),{select:!0}),document.activeElement===N&&ar(g))}return()=>{g.removeEventListener(Fi,j),setTimeout(()=>{const F=new CustomEvent(Ui,Nd);g.addEventListener(Ui,b),g.dispatchEvent(F),F.defaultPrevented||ar(N??document.body,{select:!0}),g.removeEventListener(Ui,b),Cd.remove(O)},0)}}},[g,j,b,O]);const R=h.useCallback(N=>{if(!i&&!c||O.paused)return;const L=N.key==="Tab"&&!N.altKey&&!N.ctrlKey&&!N.metaKey,F=document.activeElement;if(L&&F){const T=N.currentTarget,[Q,q]=sg(T);Q&&q?!N.shiftKey&&F===q?(N.preventDefault(),i&&ar(Q,{select:!0})):N.shiftKey&&F===Q&&(N.preventDefault(),i&&ar(q,{select:!0})):F===T&&N.preventDefault()}},[i,c,O.paused]);return l.jsx(Ge.div,{tabIndex:-1,...m,ref:D,onKeyDown:R})});of.displayName=og;function lg(o,{select:u=!1}={}){const i=document.activeElement;for(const c of o)if(ar(c,{select:u}),document.activeElement!==i)return}function sg(o){const u=lf(o),i=Sd(u,o),c=Sd(u.reverse(),o);return[i,c]}function lf(o){const u=[],i=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,{acceptNode:c=>{const f=c.tagName==="INPUT"&&c.type==="hidden";return c.disabled||c.hidden||f?NodeFilter.FILTER_SKIP:c.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;i.nextNode();)u.push(i.currentNode);return u}function Sd(o,u){for(const i of o)if(!ig(i,{upTo:u}))return i}function ig(o,{upTo:u}){if(getComputedStyle(o).visibility==="hidden")return!0;for(;o;){if(u!==void 0&&o===u)return!1;if(getComputedStyle(o).display==="none")return!0;o=o.parentElement}return!1}function ag(o){return o instanceof HTMLInputElement&&"select"in o}function ar(o,{select:u=!1}={}){if(o&&o.focus){const i=document.activeElement;o.focus({preventScroll:!0}),o!==i&&ag(o)&&u&&o.select()}}var Cd=ug();function ug(){let o=[];return{add(u){const i=o[0];u!==i&&(i==null||i.pause()),o=Ed(o,u),o.unshift(u)},remove(u){var i;o=Ed(o,u),(i=o[0])==null||i.resume()}}}function Ed(o,u){const i=[...o],c=i.indexOf(u);return c!==-1&&i.splice(c,1),i}function cg(o){return o.filter(u=>u.tagName!=="A")}var dg="Portal",sf=h.forwardRef((o,u)=>{var g;const{container:i,...c}=o,[f,p]=h.useState(!1);ro(()=>p(!0),[]);const m=i||f&&((g=globalThis==null?void 0:globalThis.document)==null?void 0:g.body);return m?ef.createPortal(l.jsx(Ge.div,{...c,ref:u}),m):null});sf.displayName=dg;function fg(o,u){return h.useReducer((i,c)=>u[i][c]??i,o)}var Tl=o=>{const{present:u,children:i}=o,c=pg(u),f=typeof i=="function"?i({present:c.isPresent}):h.Children.only(i),p=mg(c.ref,hg(f));return typeof i=="function"||c.isPresent?h.cloneElement(f,{ref:p}):null};Tl.displayName="Presence";function pg(o){const[u,i]=h.useState(),c=h.useRef(null),f=h.useRef(o),p=h.useRef("none"),m=o?"mounted":"unmounted",[g,S]=fg(m,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const j=vl(c.current);p.current=g==="mounted"?j:"none"},[g]),ro(()=>{const j=c.current,b=f.current;if(b!==o){const D=p.current,O=vl(j);o?S("MOUNT"):O==="none"||(j==null?void 0:j.display)==="none"?S("UNMOUNT"):S(b&&D!==O?"ANIMATION_OUT":"UNMOUNT"),f.current=o}},[o,S]),ro(()=>{if(u){let j;const b=u.ownerDocument.defaultView??window,C=O=>{const N=vl(c.current).includes(CSS.escape(O.animationName));if(O.target===u&&N&&(S("ANIMATION_END"),!f.current)){const L=u.style.animationFillMode;u.style.animationFillMode="forwards",j=b.setTimeout(()=>{u.style.animationFillMode==="forwards"&&(u.style.animationFillMode=L)})}},D=O=>{O.target===u&&(p.current=vl(c.current))};return u.addEventListener("animationstart",D),u.addEventListener("animationcancel",C),u.addEventListener("animationend",C),()=>{b.clearTimeout(j),u.removeEventListener("animationstart",D),u.removeEventListener("animationcancel",C),u.removeEventListener("animationend",C)}}else S("ANIMATION_END")},[u,S]),{isPresent:["mounted","unmountSuspended"].includes(g),ref:h.useCallback(j=>{c.current=j?getComputedStyle(j):null,i(j)},[])}}function _d(o,u){if(typeof o=="function")return o(u);o!=null&&(o.current=u)}function mg(...o){const u=h.useRef(o);return u.current=o,h.useCallback(i=>{const c=u.current;let f=!1;const p=c.map(m=>{const g=_d(m,i);return!f&&typeof g=="function"&&(f=!0),g});if(f)return()=>{for(let m=0;m{_t||(_t={start:Md(),end:Md()});const{start:o,end:u}=_t;return document.body.firstElementChild!==o&&document.body.insertAdjacentElement("afterbegin",o),document.body.lastElementChild!==u&&document.body.insertAdjacentElement("beforeend",u),yl++,()=>{yl===1&&(_t==null||_t.start.remove(),_t==null||_t.end.remove(),_t=null),yl=Math.max(0,yl-1)}},[])}function Md(){const o=document.createElement("span");return o.setAttribute("data-radix-focus-guard",""),o.tabIndex=0,o.style.outline="none",o.style.opacity="0",o.style.position="fixed",o.style.pointerEvents="none",o}var Mt=function(){return Mt=Object.assign||function(u){for(var i,c=1,f=arguments.length;c"u")return Og;var u=Dg(o),i=document.documentElement.clientWidth,c=window.innerWidth;return{left:u[0],top:u[1],right:u[2],gap:Math.max(0,c-i+u[2]-u[0])}},zg=df(),sn="data-scroll-locked",Ig=function(o,u,i,c){var f=o.left,p=o.top,m=o.right,g=o.gap;return i===void 0&&(i="margin"),` .`.concat(vg,` { overflow: hidden `).concat(c,`; padding-right: `).concat(g,"px ").concat(c,`; @@ -314,10 +314,10 @@ Error generating stack: `+a.message+` body[`).concat(sn,`] { `).concat(yg,": ").concat(g,`px; } -`)},Rd=function(){var o=parseInt(document.body.getAttribute(sn)||"0",10);return isFinite(o)?o:0},Ag=function(){h.useEffect(function(){return document.body.setAttribute(sn,(Rd()+1).toString()),function(){var o=Rd()-1;o<=0?document.body.removeAttribute(sn):document.body.setAttribute(sn,o.toString())}},[])},Fg=function(o){var u=o.noRelative,i=o.noImportant,c=o.gapMode,f=c===void 0?"margin":c;Ag();var p=h.useMemo(function(){return Tg(f)},[f]);return h.createElement(zg,{styles:Ig(p,!u,f,i?"":"!important")})},ea=!1;if(typeof window<"u")try{var bl=Object.defineProperty({},"passive",{get:function(){return ea=!0,!0}});window.addEventListener("test",bl,bl),window.removeEventListener("test",bl,bl)}catch{ea=!1}var Jr=ea?{passive:!1}:!1,Ug=function(o){return o.tagName==="TEXTAREA"},ff=function(o,u){if(!(o instanceof Element))return!1;var i=window.getComputedStyle(o);return i[u]!=="hidden"&&!(i.overflowY===i.overflowX&&!Ug(o)&&i[u]==="visible")},$g=function(o){return ff(o,"overflowY")},Bg=function(o){return ff(o,"overflowX")},Ld=function(o,u){var i=u.ownerDocument,c=u;do{typeof ShadowRoot<"u"&&c instanceof ShadowRoot&&(c=c.host);var f=pf(o,c);if(f){var p=mf(o,c),m=p[1],g=p[2];if(m>g)return!0}c=c.parentNode}while(c&&c!==i.body);return!1},Vg=function(o){var u=o.scrollTop,i=o.scrollHeight,c=o.clientHeight;return[u,i,c]},Wg=function(o){var u=o.scrollLeft,i=o.scrollWidth,c=o.clientWidth;return[u,i,c]},pf=function(o,u){return o==="v"?$g(u):Bg(u)},mf=function(o,u){return o==="v"?Vg(u):Wg(u)},Hg=function(o,u){return o==="h"&&u==="rtl"?-1:1},Gg=function(o,u,i,c,f){var p=Hg(o,window.getComputedStyle(u).direction),m=p*c,g=i.target,S=u.contains(g),j=!1,k=m>0,C=0,D=0;do{if(!g)break;var O=mf(o,g),R=O[0],N=O[1],L=O[2],B=N-L-p*R;(R||B)&&pf(o,g)&&(C+=B,D+=R);var T=g.parentNode;g=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!S&&g!==document.body||S&&(u.contains(g)||u===g));return(k&&Math.abs(C)<1||!k&&Math.abs(D)<1)&&(j=!0),j},wl=function(o){return"changedTouches"in o?[o.changedTouches[0].clientX,o.changedTouches[0].clientY]:[0,0]},Od=function(o){return[o.deltaX,o.deltaY]},Dd=function(o){return o&&"current"in o?o.current:o},Kg=function(o,u){return o[0]===u[0]&&o[1]===u[1]},Qg=function(o){return` +`)},Rd=function(){var o=parseInt(document.body.getAttribute(sn)||"0",10);return isFinite(o)?o:0},Ag=function(){h.useEffect(function(){return document.body.setAttribute(sn,(Rd()+1).toString()),function(){var o=Rd()-1;o<=0?document.body.removeAttribute(sn):document.body.setAttribute(sn,o.toString())}},[])},Fg=function(o){var u=o.noRelative,i=o.noImportant,c=o.gapMode,f=c===void 0?"margin":c;Ag();var p=h.useMemo(function(){return Tg(f)},[f]);return h.createElement(zg,{styles:Ig(p,!u,f,i?"":"!important")})},ea=!1;if(typeof window<"u")try{var bl=Object.defineProperty({},"passive",{get:function(){return ea=!0,!0}});window.addEventListener("test",bl,bl),window.removeEventListener("test",bl,bl)}catch{ea=!1}var Jr=ea?{passive:!1}:!1,Ug=function(o){return o.tagName==="TEXTAREA"},ff=function(o,u){if(!(o instanceof Element))return!1;var i=window.getComputedStyle(o);return i[u]!=="hidden"&&!(i.overflowY===i.overflowX&&!Ug(o)&&i[u]==="visible")},$g=function(o){return ff(o,"overflowY")},Bg=function(o){return ff(o,"overflowX")},Ld=function(o,u){var i=u.ownerDocument,c=u;do{typeof ShadowRoot<"u"&&c instanceof ShadowRoot&&(c=c.host);var f=pf(o,c);if(f){var p=mf(o,c),m=p[1],g=p[2];if(m>g)return!0}c=c.parentNode}while(c&&c!==i.body);return!1},Vg=function(o){var u=o.scrollTop,i=o.scrollHeight,c=o.clientHeight;return[u,i,c]},Wg=function(o){var u=o.scrollLeft,i=o.scrollWidth,c=o.clientWidth;return[u,i,c]},pf=function(o,u){return o==="v"?$g(u):Bg(u)},mf=function(o,u){return o==="v"?Vg(u):Wg(u)},Hg=function(o,u){return o==="h"&&u==="rtl"?-1:1},Gg=function(o,u,i,c,f){var p=Hg(o,window.getComputedStyle(u).direction),m=p*c,g=i.target,S=u.contains(g),j=!1,b=m>0,C=0,D=0;do{if(!g)break;var O=mf(o,g),R=O[0],N=O[1],L=O[2],F=N-L-p*R;(R||F)&&pf(o,g)&&(C+=F,D+=R);var T=g.parentNode;g=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!S&&g!==document.body||S&&(u.contains(g)||u===g));return(b&&Math.abs(C)<1||!b&&Math.abs(D)<1)&&(j=!0),j},wl=function(o){return"changedTouches"in o?[o.changedTouches[0].clientX,o.changedTouches[0].clientY]:[0,0]},Od=function(o){return[o.deltaX,o.deltaY]},Dd=function(o){return o&&"current"in o?o.current:o},Kg=function(o,u){return o[0]===u[0]&&o[1]===u[1]},Qg=function(o){return` .block-interactivity-`.concat(o,` {pointer-events: none;} .allow-interactivity-`).concat(o,` {pointer-events: all;} -`)},Zg=0,en=[];function qg(o){var u=h.useRef([]),i=h.useRef([0,0]),c=h.useRef(),f=h.useState(Zg++)[0],p=h.useState(df)[0],m=h.useRef(o);h.useEffect(function(){m.current=o},[o]),h.useEffect(function(){if(o.inert){document.body.classList.add("block-interactivity-".concat(f));var N=xg([o.lockRef.current],(o.shards||[]).map(Dd),!0).filter(Boolean);return N.forEach(function(L){return L.classList.add("allow-interactivity-".concat(f))}),function(){document.body.classList.remove("block-interactivity-".concat(f)),N.forEach(function(L){return L.classList.remove("allow-interactivity-".concat(f))})}}},[o.inert,o.lockRef.current,o.shards]);var g=h.useCallback(function(N,L){if("touches"in N&&N.touches.length===2||N.type==="wheel"&&N.ctrlKey)return!m.current.allowPinchZoom;var B=wl(N),T=i.current,Q="deltaX"in N?N.deltaX:T[0]-B[0],q="deltaY"in N?N.deltaY:T[1]-B[1],F,J=N.target,ae=Math.abs(Q)>Math.abs(q)?"h":"v";if("touches"in N&&ae==="h"&&J.type==="range")return!1;var be=window.getSelection(),A=be&&be.anchorNode,ue=A?A===J||A.contains(J):!1;if(ue)return!1;var Se=Ld(ae,J);if(!Se)return!0;if(Se?F=ae:(F=ae==="v"?"h":"v",Se=Ld(ae,J)),!Se)return!1;if(!c.current&&"changedTouches"in N&&(Q||q)&&(c.current=F),!F)return!0;var se=c.current||F;return Gg(se,L,N,se==="h"?Q:q)},[]),S=h.useCallback(function(N){var L=N;if(!(!en.length||en[en.length-1]!==p)){var B="deltaY"in L?Od(L):wl(L),T=u.current.filter(function(F){return F.name===L.type&&(F.target===L.target||L.target===F.shadowParent)&&Kg(F.delta,B)})[0];if(T&&T.should){L.cancelable&&L.preventDefault();return}if(!T){var Q=(m.current.shards||[]).map(Dd).filter(Boolean).filter(function(F){return F.contains(L.target)}),q=Q.length>0?g(L,Q[0]):!m.current.noIsolation;q&&L.cancelable&&L.preventDefault()}}},[]),j=h.useCallback(function(N,L,B,T){var Q={name:N,delta:L,target:B,should:T,shadowParent:Yg(B)};u.current.push(Q),setTimeout(function(){u.current=u.current.filter(function(q){return q!==Q})},1)},[]),k=h.useCallback(function(N){i.current=wl(N),c.current=void 0},[]),C=h.useCallback(function(N){j(N.type,Od(N),N.target,g(N,o.lockRef.current))},[]),D=h.useCallback(function(N){j(N.type,wl(N),N.target,g(N,o.lockRef.current))},[]);h.useEffect(function(){return en.push(p),o.setCallbacks({onScrollCapture:C,onWheelCapture:C,onTouchMoveCapture:D}),document.addEventListener("wheel",S,Jr),document.addEventListener("touchmove",S,Jr),document.addEventListener("touchstart",k,Jr),function(){en=en.filter(function(N){return N!==p}),document.removeEventListener("wheel",S,Jr),document.removeEventListener("touchmove",S,Jr),document.removeEventListener("touchstart",k,Jr)}},[]);var O=o.removeScrollBar,R=o.inert;return h.createElement(h.Fragment,null,R?h.createElement(p,{styles:Qg(f)}):null,O?h.createElement(Fg,{noRelative:o.noRelative,gapMode:o.gapMode}):null)}function Yg(o){for(var u=null;o!==null;)o instanceof ShadowRoot&&(u=o.host,o=o.host),o=o.parentNode;return u}const Xg=Cg(cf,qg);var hf=h.forwardRef(function(o,u){return h.createElement(zl,Mt({},o,{ref:u,sideCar:Xg}))});hf.classNames=zl.classNames;var Jg=function(o){if(typeof document>"u")return null;var u=Array.isArray(o)?o[0]:o;return u.ownerDocument.body},tn=new WeakMap,kl=new WeakMap,jl={},Wi=0,gf=function(o){return o&&(o.host||gf(o.parentNode))},ex=function(o,u){return u.map(function(i){if(o.contains(i))return i;var c=gf(i);return c&&o.contains(c)?c:(console.error("aria-hidden",i,"in not contained inside",o,". Doing nothing"),null)}).filter(function(i){return!!i})},tx=function(o,u,i,c){var f=ex(u,Array.isArray(o)?o:[o]);jl[i]||(jl[i]=new WeakMap);var p=jl[i],m=[],g=new Set,S=new Set(f),j=function(C){!C||g.has(C)||(g.add(C),j(C.parentNode))};f.forEach(j);var k=function(C){!C||S.has(C)||Array.prototype.forEach.call(C.children,function(D){if(g.has(D))k(D);else try{var O=D.getAttribute(c),R=O!==null&&O!=="false",N=(tn.get(D)||0)+1,L=(p.get(D)||0)+1;tn.set(D,N),p.set(D,L),m.push(D),N===1&&R&&kl.set(D,!0),L===1&&D.setAttribute(i,"true"),R||D.setAttribute(c,"true")}catch(B){console.error("aria-hidden: cannot operate on ",D,B)}})};return k(u),g.clear(),Wi++,function(){m.forEach(function(C){var D=tn.get(C)-1,O=p.get(C)-1;tn.set(C,D),p.set(C,O),D||(kl.has(C)||C.removeAttribute(c),kl.delete(C)),O||C.removeAttribute(i)}),Wi--,Wi||(tn=new WeakMap,tn=new WeakMap,kl=new WeakMap,jl={})}},rx=function(o,u,i){i===void 0&&(i="data-aria-hidden");var c=Array.from(Array.isArray(o)?o:[o]),f=Jg(o);return f?(c.push.apply(c,Array.from(f.querySelectorAll("[aria-live], script"))),tx(c,f,i,"aria-hidden")):function(){return null}},Il="Dialog",[xf]=Ph(Il),[nx,kt]=xf(Il),vf=o=>{const{__scopeDialog:u,children:i,open:c,defaultOpen:f,onOpenChange:p,modal:m=!0}=o,g=h.useRef(null),S=h.useRef(null),[j,k]=Th({prop:c,defaultProp:f??!1,onChange:p,caller:Il});return l.jsx(nx,{scope:u,triggerRef:g,contentRef:S,contentId:Ft(),titleId:Ft(),descriptionId:Ft(),open:j,onOpenChange:k,onOpenToggle:h.useCallback(()=>k(C=>!C),[k]),modal:m,children:i})};vf.displayName=Il;var yf="DialogTrigger",ox=h.forwardRef((o,u)=>{const{__scopeDialog:i,...c}=o,f=kt(yf,i),p=Er(u,f.triggerRef);return l.jsx(Ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":fa(f.open),...c,ref:p,onClick:ur(o.onClick,f.onOpenToggle)})});ox.displayName=yf;var da="DialogPortal",[lx,bf]=xf(da,{forceMount:void 0}),wf=o=>{const{__scopeDialog:u,forceMount:i,children:c,container:f}=o,p=kt(da,u);return l.jsx(lx,{scope:u,forceMount:i,children:h.Children.map(c,m=>l.jsx(Tl,{present:i||p.open,children:l.jsx(sf,{asChild:!0,container:f,children:m})}))})};wf.displayName=da;var Ol="DialogOverlay",kf=h.forwardRef((o,u)=>{const i=bf(Ol,o.__scopeDialog),{forceMount:c=i.forceMount,...f}=o,p=kt(Ol,o.__scopeDialog);return p.modal?l.jsx(Tl,{present:c||p.open,children:l.jsx(ix,{...f,ref:u})}):null});kf.displayName=Ol;var sx=tf("DialogOverlay.RemoveScroll"),ix=h.forwardRef((o,u)=>{const{__scopeDialog:i,...c}=o,f=kt(Ol,i),p=tg(),m=Er(u,p);return l.jsx(hf,{as:sx,allowPinchZoom:!0,shards:[f.contentRef],children:l.jsx(Ge.div,{"data-state":fa(f.open),...c,ref:m,style:{pointerEvents:"auto",...c.style}})})}),cn="DialogContent",jf=h.forwardRef((o,u)=>{const i=bf(cn,o.__scopeDialog),{forceMount:c=i.forceMount,...f}=o,p=kt(cn,o.__scopeDialog);return l.jsx(Tl,{present:c||p.open,children:p.modal?l.jsx(ax,{...f,ref:u}):l.jsx(ux,{...f,ref:u})})});jf.displayName=cn;var ax=h.forwardRef((o,u)=>{const i=kt(cn,o.__scopeDialog),c=h.useRef(null),f=Er(u,i.contentRef,c);return h.useEffect(()=>{const p=c.current;if(p)return rx(p)},[]),l.jsx(Nf,{...o,ref:f,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:ur(o.onCloseAutoFocus,p=>{var m;p.preventDefault(),(m=i.triggerRef.current)==null||m.focus()}),onPointerDownOutside:ur(o.onPointerDownOutside,p=>{const m=p.detail.originalEvent,g=m.button===0&&m.ctrlKey===!0;(m.button===2||g)&&p.preventDefault()}),onFocusOutside:ur(o.onFocusOutside,p=>p.preventDefault())})}),ux=h.forwardRef((o,u)=>{const i=kt(cn,o.__scopeDialog),c=h.useRef(!1),f=h.useRef(!1);return l.jsx(Nf,{...o,ref:u,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:p=>{var m,g;(m=o.onCloseAutoFocus)==null||m.call(o,p),p.defaultPrevented||(c.current||(g=i.triggerRef.current)==null||g.focus(),p.preventDefault()),c.current=!1,f.current=!1},onInteractOutside:p=>{var S,j;(S=o.onInteractOutside)==null||S.call(o,p),p.defaultPrevented||(c.current=!0,p.detail.originalEvent.type==="pointerdown"&&(f.current=!0));const m=p.target;((j=i.triggerRef.current)==null?void 0:j.contains(m))&&p.preventDefault(),p.detail.originalEvent.type==="focusin"&&f.current&&p.preventDefault()}})}),Nf=h.forwardRef((o,u)=>{const{__scopeDialog:i,trapFocus:c,onOpenAutoFocus:f,onCloseAutoFocus:p,...m}=o,g=kt(cn,i);return gg(),l.jsx(l.Fragment,{children:l.jsx(of,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:f,onUnmountAutoFocus:p,children:l.jsx(rf,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionId,"aria-labelledby":g.titleId,"data-state":fa(g.open),...m,ref:u,deferPointerDownOutside:!0,onDismiss:()=>g.onOpenChange(!1)})})})}),Sf="DialogTitle",cx=h.forwardRef((o,u)=>{const{__scopeDialog:i,...c}=o,f=kt(Sf,i);return l.jsx(Ge.h2,{id:f.titleId,...c,ref:u})});cx.displayName=Sf;var Cf="DialogDescription",dx=h.forwardRef((o,u)=>{const{__scopeDialog:i,...c}=o,f=kt(Cf,i);return l.jsx(Ge.p,{id:f.descriptionId,...c,ref:u})});dx.displayName=Cf;var Ef="DialogClose",fx=h.forwardRef((o,u)=>{const{__scopeDialog:i,...c}=o,f=kt(Ef,i);return l.jsx(Ge.button,{type:"button",...c,ref:u,onClick:ur(o.onClick,()=>f.onOpenChange(!1))})});fx.displayName=Ef;function fa(o){return o?"open":"closed"}var Xn='[cmdk-group=""]',Hi='[cmdk-group-items=""]',px='[cmdk-group-heading=""]',_f='[cmdk-item=""]',Td=`${_f}:not([aria-disabled="true"])`,ta="cmdk-item-select",on="data-value",mx=(o,u,i)=>Mh(o,u,i),Mf=h.createContext(void 0),oo=()=>h.useContext(Mf),Pf=h.createContext(void 0),pa=()=>h.useContext(Pf),Rf=h.createContext(void 0),Lf=h.forwardRef((o,u)=>{let i=ln(()=>{var y,H;return{search:"",value:(H=(y=o.value)!=null?y:o.defaultValue)!=null?H:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),c=ln(()=>new Set),f=ln(()=>new Map),p=ln(()=>new Map),m=ln(()=>new Set),g=Of(o),{label:S,children:j,value:k,onValueChange:C,filter:D,shouldFilter:O,loop:R,disablePointerSelection:N=!1,vimBindings:L=!0,...B}=o,T=Ft(),Q=Ft(),q=Ft(),F=h.useRef(null),J=Sx();Cr(()=>{if(k!==void 0){let y=k.trim();i.current.value=y,ae.emit()}},[k]),Cr(()=>{J(6,Pe)},[]);let ae=h.useMemo(()=>({subscribe:y=>(m.current.add(y),()=>m.current.delete(y)),snapshot:()=>i.current,setState:(y,H,K)=>{var W,te,ie,pe;if(!Object.is(i.current[y],H)){if(i.current[y]=H,y==="search")se(),ue(),J(1,Se);else if(y==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let he=document.getElementById(q);he?he.focus():(W=document.getElementById(T))==null||W.focus()}if(J(7,()=>{var he;i.current.selectedItemId=(he=ke())==null?void 0:he.id,ae.emit()}),K||J(5,Pe),((te=g.current)==null?void 0:te.value)!==void 0){let he=H??"";(pe=(ie=g.current).onValueChange)==null||pe.call(ie,he);return}}ae.emit()}},emit:()=>{m.current.forEach(y=>y())}}),[]),be=h.useMemo(()=>({value:(y,H,K)=>{var W;H!==((W=p.current.get(y))==null?void 0:W.value)&&(p.current.set(y,{value:H,keywords:K}),i.current.filtered.items.set(y,A(H,K)),J(2,()=>{ue(),ae.emit()}))},item:(y,H)=>(c.current.add(y),H&&(f.current.has(H)?f.current.get(H).add(y):f.current.set(H,new Set([y]))),J(3,()=>{se(),ue(),i.current.value||Se(),ae.emit()}),()=>{p.current.delete(y),c.current.delete(y),i.current.filtered.items.delete(y);let K=ke();J(4,()=>{se(),(K==null?void 0:K.getAttribute("id"))===y&&Se(),ae.emit()})}),group:y=>(f.current.has(y)||f.current.set(y,new Set),()=>{p.current.delete(y),f.current.delete(y)}),filter:()=>g.current.shouldFilter,label:S||o["aria-label"],getDisablePointerSelection:()=>g.current.disablePointerSelection,listId:T,inputId:q,labelId:Q,listInnerRef:F}),[]);function A(y,H){var K,W;let te=(W=(K=g.current)==null?void 0:K.filter)!=null?W:mx;return y?te(y,i.current.search,H):0}function ue(){if(!i.current.search||g.current.shouldFilter===!1)return;let y=i.current.filtered.items,H=[];i.current.filtered.groups.forEach(W=>{let te=f.current.get(W),ie=0;te.forEach(pe=>{let he=y.get(pe);ie=Math.max(he,ie)}),H.push([W,ie])});let K=F.current;Oe().sort((W,te)=>{var ie,pe;let he=W.getAttribute("id"),Ue=te.getAttribute("id");return((ie=y.get(Ue))!=null?ie:0)-((pe=y.get(he))!=null?pe:0)}).forEach(W=>{let te=W.closest(Hi);te?te.appendChild(W.parentElement===te?W:W.closest(`${Hi} > *`)):K.appendChild(W.parentElement===K?W:W.closest(`${Hi} > *`))}),H.sort((W,te)=>te[1]-W[1]).forEach(W=>{var te;let ie=(te=F.current)==null?void 0:te.querySelector(`${Xn}[${on}="${encodeURIComponent(W[0])}"]`);ie==null||ie.parentElement.appendChild(ie)})}function Se(){let y=Oe().find(K=>K.getAttribute("aria-disabled")!=="true"),H=y==null?void 0:y.getAttribute(on);ae.setState("value",H||void 0)}function se(){var y,H,K,W;if(!i.current.search||g.current.shouldFilter===!1){i.current.filtered.count=c.current.size;return}i.current.filtered.groups=new Set;let te=0;for(let ie of c.current){let pe=(H=(y=p.current.get(ie))==null?void 0:y.value)!=null?H:"",he=(W=(K=p.current.get(ie))==null?void 0:K.keywords)!=null?W:[],Ue=A(pe,he);i.current.filtered.items.set(ie,Ue),Ue>0&&te++}for(let[ie,pe]of f.current)for(let he of pe)if(i.current.filtered.items.get(he)>0){i.current.filtered.groups.add(ie);break}i.current.filtered.count=te}function Pe(){var y,H,K;let W=ke();W&&(((y=W.parentElement)==null?void 0:y.firstChild)===W&&((K=(H=W.closest(Xn))==null?void 0:H.querySelector(px))==null||K.scrollIntoView({block:"nearest"})),W.scrollIntoView({block:"nearest"}))}function ke(){var y;return(y=F.current)==null?void 0:y.querySelector(`${_f}[aria-selected="true"]`)}function Oe(){var y;return Array.from(((y=F.current)==null?void 0:y.querySelectorAll(Td))||[])}function je(y){let H=Oe()[y];H&&ae.setState("value",H.getAttribute(on))}function xe(y){var H;let K=ke(),W=Oe(),te=W.findIndex(pe=>pe===K),ie=W[te+y];(H=g.current)!=null&&H.loop&&(ie=te+y<0?W[W.length-1]:te+y===W.length?W[0]:W[te+y]),ie&&ae.setState("value",ie.getAttribute(on))}function M(y){let H=ke(),K=H==null?void 0:H.closest(Xn),W;for(;K&&!W;)K=y>0?jx(K,Xn):Nx(K,Xn),W=K==null?void 0:K.querySelector(Td);W?ae.setState("value",W.getAttribute(on)):xe(y)}let G=()=>je(Oe().length-1),$=y=>{y.preventDefault(),y.metaKey?G():y.altKey?M(1):xe(1)},b=y=>{y.preventDefault(),y.metaKey?je(0):y.altKey?M(-1):xe(-1)};return h.createElement(Ge.div,{ref:u,tabIndex:-1,...B,"cmdk-root":"",onKeyDown:y=>{var H;(H=B.onKeyDown)==null||H.call(B,y);let K=y.nativeEvent.isComposing||y.keyCode===229;if(!(y.defaultPrevented||K))switch(y.key){case"n":case"j":{L&&y.ctrlKey&&$(y);break}case"ArrowDown":{$(y);break}case"p":case"k":{L&&y.ctrlKey&&b(y);break}case"ArrowUp":{b(y);break}case"Home":{y.preventDefault(),je(0);break}case"End":{y.preventDefault(),G();break}case"Enter":{y.preventDefault();let W=ke();if(W){let te=new Event(ta);W.dispatchEvent(te)}}}}},h.createElement("label",{"cmdk-label":"",htmlFor:be.inputId,id:be.labelId,style:Ex},S),Al(o,y=>h.createElement(Pf.Provider,{value:ae},h.createElement(Mf.Provider,{value:be},y))))}),hx=h.forwardRef((o,u)=>{var i,c;let f=Ft(),p=h.useRef(null),m=h.useContext(Rf),g=oo(),S=Of(o),j=(c=(i=S.current)==null?void 0:i.forceMount)!=null?c:m==null?void 0:m.forceMount;Cr(()=>{if(!j)return g.item(f,m==null?void 0:m.id)},[j]);let k=Df(f,p,[o.value,o.children,p],o.keywords),C=pa(),D=dr(J=>J.value&&J.value===k.current),O=dr(J=>j||g.filter()===!1?!0:J.search?J.filtered.items.get(f)>0:!0);h.useEffect(()=>{let J=p.current;if(!(!J||o.disabled))return J.addEventListener(ta,R),()=>J.removeEventListener(ta,R)},[O,o.onSelect,o.disabled]);function R(){var J,ae;N(),(ae=(J=S.current).onSelect)==null||ae.call(J,k.current)}function N(){C.setState("value",k.current,!0)}if(!O)return null;let{disabled:L,value:B,onSelect:T,forceMount:Q,keywords:q,...F}=o;return h.createElement(Ge.div,{ref:un(p,u),...F,id:f,"cmdk-item":"",role:"option","aria-disabled":!!L,"aria-selected":!!D,"data-disabled":!!L,"data-selected":!!D,onPointerMove:L||g.getDisablePointerSelection()?void 0:N,onClick:L?void 0:R},o.children)}),gx=h.forwardRef((o,u)=>{let{heading:i,children:c,forceMount:f,...p}=o,m=Ft(),g=h.useRef(null),S=h.useRef(null),j=Ft(),k=oo(),C=dr(O=>f||k.filter()===!1?!0:O.search?O.filtered.groups.has(m):!0);Cr(()=>k.group(m),[]),Df(m,g,[o.value,o.heading,S]);let D=h.useMemo(()=>({id:m,forceMount:f}),[f]);return h.createElement(Ge.div,{ref:un(g,u),...p,"cmdk-group":"",role:"presentation",hidden:C?void 0:!0},i&&h.createElement("div",{ref:S,"cmdk-group-heading":"","aria-hidden":!0,id:j},i),Al(o,O=>h.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":i?j:void 0},h.createElement(Rf.Provider,{value:D},O))))}),xx=h.forwardRef((o,u)=>{let{alwaysRender:i,...c}=o,f=h.useRef(null),p=dr(m=>!m.search);return!i&&!p?null:h.createElement(Ge.div,{ref:un(f,u),...c,"cmdk-separator":"",role:"separator"})}),vx=h.forwardRef((o,u)=>{let{onValueChange:i,...c}=o,f=o.value!=null,p=pa(),m=dr(j=>j.search),g=dr(j=>j.selectedItemId),S=oo();return h.useEffect(()=>{o.value!=null&&p.setState("search",o.value)},[o.value]),h.createElement(Ge.input,{ref:u,...c,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":S.listId,"aria-labelledby":S.labelId,"aria-activedescendant":g,id:S.inputId,type:"text",value:f?o.value:m,onChange:j=>{f||p.setState("search",j.target.value),i==null||i(j.target.value)}})}),yx=h.forwardRef((o,u)=>{let{children:i,label:c="Suggestions",...f}=o,p=h.useRef(null),m=h.useRef(null),g=dr(j=>j.selectedItemId),S=oo();return h.useEffect(()=>{if(m.current&&p.current){let j=m.current,k=p.current,C,D=new ResizeObserver(()=>{C=requestAnimationFrame(()=>{let O=j.offsetHeight;k.style.setProperty("--cmdk-list-height",O.toFixed(1)+"px")})});return D.observe(j),()=>{cancelAnimationFrame(C),D.unobserve(j)}}},[]),h.createElement(Ge.div,{ref:un(p,u),...f,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":g,"aria-label":c,id:S.listId},Al(o,j=>h.createElement("div",{ref:un(m,S.listInnerRef),"cmdk-list-sizer":""},j)))}),bx=h.forwardRef((o,u)=>{let{open:i,onOpenChange:c,overlayClassName:f,contentClassName:p,container:m,...g}=o;return h.createElement(vf,{open:i,onOpenChange:c},h.createElement(wf,{container:m},h.createElement(kf,{"cmdk-overlay":"",className:f}),h.createElement(jf,{"aria-label":o.label,"cmdk-dialog":"",className:p},h.createElement(Lf,{ref:u,...g}))))}),wx=h.forwardRef((o,u)=>dr(i=>i.filtered.count===0)?h.createElement(Ge.div,{ref:u,...o,"cmdk-empty":"",role:"presentation"}):null),kx=h.forwardRef((o,u)=>{let{progress:i,children:c,label:f="Loading...",...p}=o;return h.createElement(Ge.div,{ref:u,...p,"cmdk-loading":"",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,"aria-label":f},Al(o,m=>h.createElement("div",{"aria-hidden":!0},m)))}),rn=Object.assign(Lf,{List:yx,Item:hx,Input:vx,Group:gx,Separator:xx,Dialog:bx,Empty:wx,Loading:kx});function jx(o,u){let i=o.nextElementSibling;for(;i;){if(i.matches(u))return i;i=i.nextElementSibling}}function Nx(o,u){let i=o.previousElementSibling;for(;i;){if(i.matches(u))return i;i=i.previousElementSibling}}function Of(o){let u=h.useRef(o);return Cr(()=>{u.current=o}),u}var Cr=typeof window>"u"?h.useEffect:h.useLayoutEffect;function ln(o){let u=h.useRef();return u.current===void 0&&(u.current=o()),u}function dr(o){let u=pa(),i=()=>o(u.snapshot());return h.useSyncExternalStore(u.subscribe,i,i)}function Df(o,u,i,c=[]){let f=h.useRef(),p=oo();return Cr(()=>{var m;let g=(()=>{var j;for(let k of i){if(typeof k=="string")return k.trim();if(typeof k=="object"&&"current"in k)return k.current?(j=k.current.textContent)==null?void 0:j.trim():f.current}})(),S=c.map(j=>j.trim());p.value(o,g,S),(m=u.current)==null||m.setAttribute(on,g),f.current=g}),f}var Sx=()=>{let[o,u]=h.useState(),i=ln(()=>new Map);return Cr(()=>{i.current.forEach(c=>c()),i.current=new Map},[o]),(c,f)=>{i.current.set(c,f),u({})}};function Cx(o){let u=o.type;return typeof u=="function"?u(o.props):"render"in u?u.render(o.props):o}function Al({asChild:o,children:u},i){return o&&h.isValidElement(u)?h.cloneElement(Cx(u),{ref:u.ref},i(u.props.children)):i(u)}var Ex={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function _x({onNavigate:o}){const[u,i]=h.useState(!1);return h.useEffect(()=>{const c=f=>{(f.metaKey||f.ctrlKey)&&f.key.toLowerCase()==="k"&&(f.preventDefault(),i(p=>!p))};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[]),l.jsx(rn.Dialog,{open:u,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:l.jsxs("div",{className:"w-full max-w-lg overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-2xl",onClick:c=>c.stopPropagation(),children:[l.jsx(rn.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"}),l.jsxs(rn.List,{className:"max-h-80 overflow-y-auto p-2",children:[l.jsx(rn.Empty,{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Nichts gefunden."}),l.jsx(rn.Group,{heading:"Bereiche",className:"px-1 py-1 text-xs text-muted-foreground",children:Yi.map(c=>l.jsxs(rn.Item,{value:`${c.label} ${c.hint}`,onSelect:()=>{o(c.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:[l.jsx(c.icon,{className:"h-4 w-4 text-primary"}),l.jsx("span",{children:c.label}),l.jsx("span",{className:"ml-auto truncate text-xs text-muted-foreground",children:c.hint})]},c.id))})]})]})})}async function de(o,u){const i=await fetch(o,{headers:{"Content-Type":"application/json"},...u});if(!i.ok)throw new Error(`${i.status} ${i.statusText}`);return i.json()}function Tf(o){var u,i,c="";if(typeof o=="string"||typeof o=="number")c+=o;else if(typeof o=="object")if(Array.isArray(o)){var f=o.length;for(u=0;u{const u=Lx(o),{conflictingClassGroups:i,conflictingClassGroupModifiers:c}=o;return{getClassGroupId:m=>{const g=m.split(ma);return g[0]===""&&g.length!==1&&g.shift(),zf(g,u)||Rx(m)},getConflictingClassGroupIds:(m,g)=>{const S=i[m]||[];return g&&c[m]?[...S,...c[m]]:S}}},zf=(o,u)=>{var m;if(o.length===0)return u.classGroupId;const i=o[0],c=u.nextPart.get(i),f=c?zf(o.slice(1),c):void 0;if(f)return f;if(u.validators.length===0)return;const p=o.join(ma);return(m=u.validators.find(({validator:g})=>g(p)))==null?void 0:m.classGroupId},zd=/^\[(.+)\]$/,Rx=o=>{if(zd.test(o)){const u=zd.exec(o)[1],i=u==null?void 0:u.substring(0,u.indexOf(":"));if(i)return"arbitrary.."+i}},Lx=o=>{const{theme:u,prefix:i}=o,c={nextPart:new Map,validators:[]};return Dx(Object.entries(o.classGroups),i).forEach(([p,m])=>{ra(m,c,p,u)}),c},ra=(o,u,i,c)=>{o.forEach(f=>{if(typeof f=="string"){const p=f===""?u:Id(u,f);p.classGroupId=i;return}if(typeof f=="function"){if(Ox(f)){ra(f(c),u,i,c);return}u.validators.push({validator:f,classGroupId:i});return}Object.entries(f).forEach(([p,m])=>{ra(m,Id(u,p),i,c)})})},Id=(o,u)=>{let i=o;return u.split(ma).forEach(c=>{i.nextPart.has(c)||i.nextPart.set(c,{nextPart:new Map,validators:[]}),i=i.nextPart.get(c)}),i},Ox=o=>o.isThemeGetter,Dx=(o,u)=>u?o.map(([i,c])=>{const f=c.map(p=>typeof p=="string"?u+p:typeof p=="object"?Object.fromEntries(Object.entries(p).map(([m,g])=>[u+m,g])):p);return[i,f]}):o,Tx=o=>{if(o<1)return{get:()=>{},set:()=>{}};let u=0,i=new Map,c=new Map;const f=(p,m)=>{i.set(p,m),u++,u>o&&(u=0,c=i,i=new Map)};return{get(p){let m=i.get(p);if(m!==void 0)return m;if((m=c.get(p))!==void 0)return f(p,m),m},set(p,m){i.has(p)?i.set(p,m):f(p,m)}}},If="!",zx=o=>{const{separator:u,experimentalParseClassName:i}=o,c=u.length===1,f=u[0],p=u.length,m=g=>{const S=[];let j=0,k=0,C;for(let L=0;Lk?C-k:void 0;return{modifiers:S,hasImportantModifier:O,baseClassName:R,maybePostfixModifierPosition:N}};return i?g=>i({className:g,parseClassName:m}):m},Ix=o=>{if(o.length<=1)return o;const u=[];let i=[];return o.forEach(c=>{c[0]==="["?(u.push(...i.sort(),c),i=[]):i.push(c)}),u.push(...i.sort()),u},Ax=o=>({cache:Tx(o.cacheSize),parseClassName:zx(o),...Px(o)}),Fx=/\s+/,Ux=(o,u)=>{const{parseClassName:i,getClassGroupId:c,getConflictingClassGroupIds:f}=u,p=[],m=o.trim().split(Fx);let g="";for(let S=m.length-1;S>=0;S-=1){const j=m[S],{modifiers:k,hasImportantModifier:C,baseClassName:D,maybePostfixModifierPosition:O}=i(j);let R=!!O,N=c(R?D.substring(0,O):D);if(!N){if(!R){g=j+(g.length>0?" "+g:g);continue}if(N=c(D),!N){g=j+(g.length>0?" "+g:g);continue}R=!1}const L=Ix(k).join(":"),B=C?L+If:L,T=B+N;if(p.includes(T))continue;p.push(T);const Q=f(N,R);for(let q=0;q0?" "+g:g)}return g};function $x(){let o=0,u,i,c="";for(;o{if(typeof o=="string")return o;let u,i="";for(let c=0;cC(k),o());return i=Ax(j),c=i.cache.get,f=i.cache.set,p=g,g(S)}function g(S){const j=c(S);if(j)return j;const k=Ux(S,i);return f(S,k),k}return function(){return p($x.apply(null,arguments))}}const _e=o=>{const u=i=>i[o]||[];return u.isThemeGetter=!0,u},Ff=/^\[(?:([a-z-]+):)?(.+)\]$/i,Vx=/^\d+\/\d+$/,Wx=new Set(["px","full","screen"]),Hx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Gx=/\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$/,Kx=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Qx=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,At=o=>an(o)||Wx.has(o)||Vx.test(o),lr=o=>dn(o,"length",n0),an=o=>!!o&&!Number.isNaN(Number(o)),Gi=o=>dn(o,"number",an),Jn=o=>!!o&&Number.isInteger(Number(o)),qx=o=>o.endsWith("%")&&an(o.slice(0,-1)),me=o=>Ff.test(o),sr=o=>Hx.test(o),Yx=new Set(["length","size","percentage"]),Xx=o=>dn(o,Yx,Uf),Jx=o=>dn(o,"position",Uf),e0=new Set(["image","url"]),t0=o=>dn(o,e0,l0),r0=o=>dn(o,"",o0),eo=()=>!0,dn=(o,u,i)=>{const c=Ff.exec(o);return c?c[1]?typeof u=="string"?c[1]===u:u.has(c[1]):i(c[2]):!1},n0=o=>Gx.test(o)&&!Kx.test(o),Uf=()=>!1,o0=o=>Qx.test(o),l0=o=>Zx.test(o),s0=()=>{const o=_e("colors"),u=_e("spacing"),i=_e("blur"),c=_e("brightness"),f=_e("borderColor"),p=_e("borderRadius"),m=_e("borderSpacing"),g=_e("borderWidth"),S=_e("contrast"),j=_e("grayscale"),k=_e("hueRotate"),C=_e("invert"),D=_e("gap"),O=_e("gradientColorStops"),R=_e("gradientColorStopPositions"),N=_e("inset"),L=_e("margin"),B=_e("opacity"),T=_e("padding"),Q=_e("saturate"),q=_e("scale"),F=_e("sepia"),J=_e("skew"),ae=_e("space"),be=_e("translate"),A=()=>["auto","contain","none"],ue=()=>["auto","hidden","clip","visible","scroll"],Se=()=>["auto",me,u],se=()=>[me,u],Pe=()=>["",At,lr],ke=()=>["auto",an,me],Oe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],je=()=>["solid","dashed","dotted","double","none"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",me],$=()=>["auto","avoid","all","avoid-page","page","left","right","column"],b=()=>[an,me];return{cacheSize:500,separator:":",theme:{colors:[eo],spacing:[At,lr],blur:["none","",sr,me],brightness:b(),borderColor:[o],borderRadius:["none","","full",sr,me],borderSpacing:se(),borderWidth:Pe(),contrast:b(),grayscale:G(),hueRotate:b(),invert:G(),gap:se(),gradientColorStops:[o],gradientColorStopPositions:[qx,lr],inset:Se(),margin:Se(),opacity:b(),padding:se(),saturate:b(),scale:b(),sepia:G(),skew:b(),space:se(),translate:se()},classGroups:{aspect:[{aspect:["auto","square","video",me]}],container:["container"],columns:[{columns:[sr]}],"break-after":[{"break-after":$()}],"break-before":[{"break-before":$()}],"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:[...Oe(),me]}],overflow:[{overflow:ue()}],"overflow-x":[{"overflow-x":ue()}],"overflow-y":[{"overflow-y":ue()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[N]}],"inset-x":[{"inset-x":[N]}],"inset-y":[{"inset-y":[N]}],start:[{start:[N]}],end:[{end:[N]}],top:[{top:[N]}],right:[{right:[N]}],bottom:[{bottom:[N]}],left:[{left:[N]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Jn,me]}],basis:[{basis:Se()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",me]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",Jn,me]}],"grid-cols":[{"grid-cols":[eo]}],"col-start-end":[{col:["auto",{span:["full",Jn,me]},me]}],"col-start":[{"col-start":ke()}],"col-end":[{"col-end":ke()}],"grid-rows":[{"grid-rows":[eo]}],"row-start-end":[{row:["auto",{span:[Jn,me]},me]}],"row-start":[{"row-start":ke()}],"row-end":[{"row-end":ke()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",me]}],gap:[{gap:[D]}],"gap-x":[{"gap-x":[D]}],"gap-y":[{"gap-y":[D]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[L]}],mx:[{mx:[L]}],my:[{my:[L]}],ms:[{ms:[L]}],me:[{me:[L]}],mt:[{mt:[L]}],mr:[{mr:[L]}],mb:[{mb:[L]}],ml:[{ml:[L]}],"space-x":[{"space-x":[ae]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ae]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",me,u]}],"min-w":[{"min-w":[me,u,"min","max","fit"]}],"max-w":[{"max-w":[me,u,"none","full","min","max","fit","prose",{screen:[sr]},sr]}],h:[{h:[me,u,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[me,u,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[me,u,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[me,u,"auto","min","max","fit"]}],"font-size":[{text:["base",sr,lr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Gi]}],"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",me]}],"line-clamp":[{"line-clamp":["none",an,Gi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",At,me]}],"list-image":[{"list-image":["none",me]}],"list-style-type":[{list:["none","disc","decimal",me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[o]}],"placeholder-opacity":[{"placeholder-opacity":[B]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[o]}],"text-opacity":[{"text-opacity":[B]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...je(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",At,lr]}],"underline-offset":[{"underline-offset":["auto",At,me]}],"text-decoration-color":[{decoration:[o]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:se()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",me]}],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",me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[B]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Oe(),Jx]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Xx]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},t0]}],"bg-color":[{bg:[o]}],"gradient-from-pos":[{from:[R]}],"gradient-via-pos":[{via:[R]}],"gradient-to-pos":[{to:[R]}],"gradient-from":[{from:[O]}],"gradient-via":[{via:[O]}],"gradient-to":[{to:[O]}],rounded:[{rounded:[p]}],"rounded-s":[{"rounded-s":[p]}],"rounded-e":[{"rounded-e":[p]}],"rounded-t":[{"rounded-t":[p]}],"rounded-r":[{"rounded-r":[p]}],"rounded-b":[{"rounded-b":[p]}],"rounded-l":[{"rounded-l":[p]}],"rounded-ss":[{"rounded-ss":[p]}],"rounded-se":[{"rounded-se":[p]}],"rounded-ee":[{"rounded-ee":[p]}],"rounded-es":[{"rounded-es":[p]}],"rounded-tl":[{"rounded-tl":[p]}],"rounded-tr":[{"rounded-tr":[p]}],"rounded-br":[{"rounded-br":[p]}],"rounded-bl":[{"rounded-bl":[p]}],"border-w":[{border:[g]}],"border-w-x":[{"border-x":[g]}],"border-w-y":[{"border-y":[g]}],"border-w-s":[{"border-s":[g]}],"border-w-e":[{"border-e":[g]}],"border-w-t":[{"border-t":[g]}],"border-w-r":[{"border-r":[g]}],"border-w-b":[{"border-b":[g]}],"border-w-l":[{"border-l":[g]}],"border-opacity":[{"border-opacity":[B]}],"border-style":[{border:[...je(),"hidden"]}],"divide-x":[{"divide-x":[g]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[g]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[B]}],"divide-style":[{divide:je()}],"border-color":[{border:[f]}],"border-color-x":[{"border-x":[f]}],"border-color-y":[{"border-y":[f]}],"border-color-s":[{"border-s":[f]}],"border-color-e":[{"border-e":[f]}],"border-color-t":[{"border-t":[f]}],"border-color-r":[{"border-r":[f]}],"border-color-b":[{"border-b":[f]}],"border-color-l":[{"border-l":[f]}],"divide-color":[{divide:[f]}],"outline-style":[{outline:["",...je()]}],"outline-offset":[{"outline-offset":[At,me]}],"outline-w":[{outline:[At,lr]}],"outline-color":[{outline:[o]}],"ring-w":[{ring:Pe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[o]}],"ring-opacity":[{"ring-opacity":[B]}],"ring-offset-w":[{"ring-offset":[At,lr]}],"ring-offset-color":[{"ring-offset":[o]}],shadow:[{shadow:["","inner","none",sr,r0]}],"shadow-color":[{shadow:[eo]}],opacity:[{opacity:[B]}],"mix-blend":[{"mix-blend":[...xe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":xe()}],filter:[{filter:["","none"]}],blur:[{blur:[i]}],brightness:[{brightness:[c]}],contrast:[{contrast:[S]}],"drop-shadow":[{"drop-shadow":["","none",sr,me]}],grayscale:[{grayscale:[j]}],"hue-rotate":[{"hue-rotate":[k]}],invert:[{invert:[C]}],saturate:[{saturate:[Q]}],sepia:[{sepia:[F]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[i]}],"backdrop-brightness":[{"backdrop-brightness":[c]}],"backdrop-contrast":[{"backdrop-contrast":[S]}],"backdrop-grayscale":[{"backdrop-grayscale":[j]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[k]}],"backdrop-invert":[{"backdrop-invert":[C]}],"backdrop-opacity":[{"backdrop-opacity":[B]}],"backdrop-saturate":[{"backdrop-saturate":[Q]}],"backdrop-sepia":[{"backdrop-sepia":[F]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[m]}],"border-spacing-x":[{"border-spacing-x":[m]}],"border-spacing-y":[{"border-spacing-y":[m]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",me]}],duration:[{duration:b()}],ease:[{ease:["linear","in","out","in-out",me]}],delay:[{delay:b()}],animate:[{animate:["none","spin","ping","pulse","bounce",me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[q]}],"scale-x":[{"scale-x":[q]}],"scale-y":[{"scale-y":[q]}],rotate:[{rotate:[Jn,me]}],"translate-x":[{"translate-x":[be]}],"translate-y":[{"translate-y":[be]}],"skew-x":[{"skew-x":[J]}],"skew-y":[{"skew-y":[J]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",me]}],accent:[{accent:["auto",o]}],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",me]}],"caret-color":[{caret:[o]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":se()}],"scroll-mx":[{"scroll-mx":se()}],"scroll-my":[{"scroll-my":se()}],"scroll-ms":[{"scroll-ms":se()}],"scroll-me":[{"scroll-me":se()}],"scroll-mt":[{"scroll-mt":se()}],"scroll-mr":[{"scroll-mr":se()}],"scroll-mb":[{"scroll-mb":se()}],"scroll-ml":[{"scroll-ml":se()}],"scroll-p":[{"scroll-p":se()}],"scroll-px":[{"scroll-px":se()}],"scroll-py":[{"scroll-py":se()}],"scroll-ps":[{"scroll-ps":se()}],"scroll-pe":[{"scroll-pe":se()}],"scroll-pt":[{"scroll-pt":se()}],"scroll-pr":[{"scroll-pr":se()}],"scroll-pb":[{"scroll-pb":se()}],"scroll-pl":[{"scroll-pl":se()}],"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",me]}],fill:[{fill:[o,"none"]}],"stroke-w":[{stroke:[At,lr,Gi]}],stroke:[{stroke:[o,"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"]}}},i0=Bx(s0);function ne(...o){return i0(Mx(o))}function Dl(o){if(!o)return"";const u=window.location.hostname;return u!=="127.0.0.1"&&u!=="localhost"&&u!==""?o.replace(/127\.0\.0\.1|localhost/g,u):o}function nn(o){return(o/1024**3).toFixed(1)}function Nl({value:o,label:u,detail:i}){const f=2*Math.PI*24,p=f-Math.min(o,100)/100*f,m=o>90?"stroke-red-500":o>75?"stroke-amber-500":"stroke-primary";return l.jsxs("div",{className:"flex flex-col items-center gap-1.5 p-2 bg-background/20 rounded-xl border border-border/40",children:[l.jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[l.jsxs("svg",{className:"absolute inset-0 h-full w-full -rotate-90",children:[l.jsx("circle",{cx:"32",cy:"32",r:24,className:"stroke-muted fill-none",strokeWidth:"4.5"}),l.jsx("circle",{cx:"32",cy:"32",r:24,className:ne("fill-none transition-all duration-700 ease-out",m),strokeWidth:"4.5",strokeDasharray:f,strokeDashoffset:p,strokeLinecap:"round"})]}),l.jsxs("span",{className:"text-xs font-mono font-bold tracking-tight text-foreground",children:[Math.round(o),"%"]})]}),l.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:u}),i&&l.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/80",children:i})]})}function a0(){const[o,u]=h.useState(null),[i,c]=h.useState(null),[f,p]=h.useState([]),[m,g]=h.useState([]),[S,j]=h.useState([]),[k,C]=h.useState(null),[D,O]=h.useState(""),[R,N]=h.useState("stable"),[L,B]=h.useState(!1);function T(){de("/api/system/status").then(u).catch(()=>{}),de("/api/agent/status").then(c).catch(()=>{}),de("/api/models").then(F=>{p(F.models||[]),g(F.running||[])}).catch(()=>{}),de("/api/memory?category=").then(F=>j(F.slice(0,3))).catch(()=>{}),de("/api/maintenance/updates").then(C).catch(()=>{})}h.useEffect(()=>{T();const F=setInterval(T,3e3);return()=>clearInterval(F)},[]);async function Q(){if(!(!D.trim()||L)){B(!0);try{await de("/api/memory",{method:"POST",body:JSON.stringify({content:D,category:R,source:"dashboard"})}),O(""),de("/api/memory?category=").then(F=>j(F.slice(0,3))).catch(()=>{})}catch(F){console.error(F)}finally{B(!1)}}}const q=f.filter(F=>F.role);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.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"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Aktueller Status von System, Modellen und Agent."})]}),l.jsxs("div",{className:"grid gap-6 md:grid-cols-3",children:[l.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:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(cr,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"System-Status"})]}),o?l.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[l.jsx(Nl,{value:o.cpu.percent,label:"CPU",detail:`${o.cpu.cores} Cores`}),l.jsx(Nl,{value:o.ram.percent,label:"RAM",detail:`${nn(o.ram.used)} / ${nn(o.ram.total)} GB`}),o.gpu&&o.gpu.busy_percent!=null&&o.gpu.gtt_used!=null&&o.gpu.gtt_total!=null&&l.jsx(Nl,{value:o.gpu.busy_percent,label:"GPU",detail:`${nn(o.gpu.gtt_used)} / ${nn(o.gpu.gtt_total)} GB`}),o.disk&&l.jsx(Nl,{value:o.disk.percent,label:"Disk",detail:`${nn(o.disk.used)} / ${nn(o.disk.total)} GB`})]}):l.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Systemdaten…"})]}),(o==null?void 0:o.temp)&&(o.temp.cpu||o.temp.gpu)&&l.jsxs("div",{className:"mt-4 flex gap-4 text-xs font-mono text-muted-foreground/80 border-t border-border/30 pt-3",children:[o.temp.cpu!=null&&l.jsxs("span",{children:["CPU Temp: ",o.temp.cpu," °C"]}),o.temp.gpu!=null&&l.jsxs("span",{children:["GPU Temp: ",o.temp.gpu," °C"]})]})]}),l.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:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(Zd,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Updates & Pflege"})]}),k?l.jsxs("div",{className:"space-y-2.5",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("div",{className:ne("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",k.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:[l.jsx("span",{children:"OS-Pakete"}),l.jsx("span",{className:"font-mono",children:k.os>0?`${k.os} verfügbar`:"aktuell"})]}),l.jsxs("div",{className:ne("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",k.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:[l.jsx("span",{children:"Engine (llama.cpp)"}),l.jsx("span",{className:"font-mono",children:k.engine>0?"Update verfügbar":"aktuell"})]}),l.jsxs("div",{className:ne("flex items-center justify-between px-3 py-1.5 rounded-lg border text-xs",k.models>0?"border-primary/30 bg-primary/5 text-primary font-semibold animate-pulse":"border-border/30 bg-background/25 text-muted-foreground"),children:[l.jsx("span",{children:"Modell-Upgrades"}),l.jsx("span",{className:"font-mono",children:k.models>0?`${k.models} verfügbar`:"aktuell"})]})]}),k.model_list.length>0&&l.jsxs("div",{className:"mt-2 space-y-1",children:[l.jsx("div",{className:"text-[9px] uppercase font-bold text-muted-foreground/60 tracking-wider",children:"Upgrades:"}),l.jsx("div",{className:"max-h-20 overflow-y-auto space-y-1 pr-1 scrollbar-thin",children:k.model_list.map(F=>l.jsxs("div",{className:"text-[9px] bg-background/20 border border-border/20 rounded p-1.5 font-mono text-muted-foreground truncate",title:`${F.role}: ${F.repo}`,children:[l.jsx("span",{className:"text-primary font-semibold uppercase",children:F.role}),": ",F.repo.split("/").pop()]},F.repo))})]})]}):l.jsx("div",{className:"h-24 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Updates..."})]}),l.jsx("div",{className:"mt-4 border-t border-border/30 pt-3 shrink-0",children:l.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"})})]})]}),l.jsxs("div",{className:"grid gap-6 md:grid-cols-3",children:[l.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:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(sa,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Hermes Agent"})]}),(i==null?void 0:i.webui_url)&&l.jsxs("a",{href:Dl(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:[l.jsx(Pl,{className:"h-3 w-3"})," Hermes öffnen"]})]}),i?l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[l.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Gateway"}),l.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[l.jsx("span",{className:ne("h-2 w-2 rounded-full",i.gateway_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),l.jsx("span",{className:"text-xs font-medium",children:i.gateway_reachable?"Online":"Offline"})]})]}),l.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[l.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"WebUI"}),l.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[l.jsx("span",{className:ne("h-2 w-2 rounded-full",i.webui_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),l.jsx("span",{className:"text-xs font-medium",children:i.webui_reachable?"Online":"Offline"})]})]})]}),l.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[l.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Aktives Gehirn"}),l.jsxs("div",{className:"text-xs font-medium mt-1 font-mono text-primary flex items-center gap-1.5",children:[l.jsx(Rl,{className:"h-3.5 w-3.5"}),i.brain_model?`model: ${i.brain_model}`:"model: auto"]})]})]}):l.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Agenten-Status…"})]}),l.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."})]}),l.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:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(Rl,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Aktive Rollen"})]}),l.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto pr-1 scrollbar-thin",children:q.length===0?l.jsx("div",{className:"text-xs text-muted-foreground py-6 text-center",children:"Keine Modelle als Rollen zugewiesen."}):q.map(F=>{const J=m.includes(F.name);return l.jsxs("div",{className:ne("flex items-center justify-between p-2.5 rounded-xl border transition-all duration-300",J?"border-primary/50 bg-primary/5 shadow-md shadow-primary/5":"border-border/40 bg-background/20"),children:[l.jsxs("div",{className:"min-w-0 flex-1 mr-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:ne("text-[9px] font-semibold uppercase px-1.5 py-0.5 rounded font-mono",F.role==="fast"?"bg-cyan-500/15 text-cyan-400":F.role==="heavy"?"bg-amber-500/15 text-amber-400":F.role==="coder"?"bg-violet-500/15 text-violet-400":F.role==="vision"?"bg-pink-500/15 text-pink-400":"bg-muted text-muted-foreground"),children:F.role}),J&&l.jsxs("span",{className:"flex h-2 w-2 relative",children:[l.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),l.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-emerald-500"})]})]}),l.jsx("div",{className:"text-[10px] font-medium mt-1 truncate",title:F.name,children:F.name})]}),l.jsx("div",{className:"text-[9px] font-mono text-muted-foreground shrink-0",children:J?"Warm":"Bereit"})]},F.name)})})]}),l.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."})]}),l.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:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(ia,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Gedächtnis"})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx("textarea",{value:D,onChange:F=>O(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"}),l.jsxs("div",{className:"flex items-center gap-2 justify-between",children:[l.jsxs("select",{value:R,onChange:F=>N(F.target.value),className:"h-7 rounded-lg border border-border/50 bg-background/50 px-2 text-[10px] outline-none cursor-pointer",children:[l.jsx("option",{value:"stable",children:"🔵 Fakt"}),l.jsx("option",{value:"instruction",children:"📋 Regel"}),l.jsx("option",{value:"user",children:"👤 User"}),l.jsx("option",{value:"versioned",children:"🟡 Version"})]}),l.jsxs("button",{onClick:Q,disabled:!D.trim()||L,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:[l.jsx(Kd,{className:"h-3.5 w-3.5"})," Speichern"]})]})]}),l.jsxs("div",{className:"mt-3.5 space-y-1.5",children:[l.jsx("div",{className:"text-[9px] text-muted-foreground uppercase font-bold tracking-wider",children:"Zuletzt gespeichert:"}),l.jsx("div",{className:"max-h-20 overflow-y-auto space-y-1 pr-1 scrollbar-thin",children:S.length===0?l.jsx("div",{className:"text-[10px] text-muted-foreground/75 py-1",children:"Keine Einträge vorhanden."}):S.map(F=>l.jsxs("div",{className:"text-[10px] bg-background/10 border border-border/30 rounded p-1.5 flex items-start gap-1.5",children:[l.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}),l.jsx("span",{className:"truncate flex-1 text-muted-foreground hover:text-foreground transition-colors",title:F.content,children:F.content})]},F.id))})]})]}),l.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."})]})]})]})}function Sr({children:o,tone:u="muted"}){const i={muted:"bg-muted text-muted-foreground",primary:"bg-primary/15 text-primary",warn:"bg-amber-500/15 text-amber-500"};return l.jsx("span",{className:`rounded px-1.5 py-0.5 text-[11px] font-medium ${i[u]}`,children:o})}function $f({caps:o}){return o?l.jsxs("span",{className:"inline-flex flex-wrap gap-1",children:[o.coder&&l.jsx(Sr,{children:"💻 Code"}),o.vision&&l.jsx(Sr,{children:"👁 Bild"}),o.reasoning&&l.jsx(Sr,{children:"🧠 Reason"}),o.moe&&l.jsxs(Sr,{tone:"primary",children:["🧩 MoE",o.active_b?`·${o.active_b}b`:""]}),o.tools==="yes"&&l.jsx(Sr,{tone:"primary",children:"🛠 Tools"}),o.tools==="likely"&&l.jsx(Sr,{tone:"warn",children:"🛠 Tools?"}),o.embedding&&l.jsx(Sr,{children:"🔢 Embed"})]}):null}function Ad(o){return o?o>1024**3?`${(o/1024**3).toFixed(1)} GB`:`${(o/1024**2).toFixed(0)} MB`:""}function u0(o){if(!o)return"";const u=Math.floor(o/60);return u>0?`${u} min`:`${o} s`}function c0(){const[o,u]=h.useState([]);function i(){de("/api/jobs").then(m=>u(m.jobs||[])).catch(()=>{})}h.useEffect(()=>{i();const m=setInterval(i,2e3);return()=>clearInterval(m)},[]);async function c(m){try{await de(`/api/jobs/${m}/cancel`,{method:"POST"}),i()}catch(g){alert(`Fehler: ${g.message}`)}}const f=o.filter(m=>m.state==="running"||m.state==="queued"),p=o.filter(m=>m.state!=="running"&&m.state!=="queued").slice(-3);return f.length===0&&p.length===0?null:l.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:[l.jsx("div",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Aktive Downloads"}),f.map(m=>l.jsxs("div",{className:"space-y-1.5 p-3 rounded-xl bg-background/20 border border-border/40",children:[l.jsxs("div",{className:"flex justify-between items-center text-xs",children:[l.jsx("span",{className:"font-semibold truncate max-w-[250px]",children:m.label}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"text-muted-foreground font-mono",children:[m.progress??0,"% • ",Ad(m.done_bytes),"/",Ad(m.total_bytes),m.eta_s?` • ETA ${u0(m.eta_s)}`:""]}),l.jsx("button",{onClick:()=>c(m.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"})]})]}),l.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted",children:l.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-500",style:{width:`${m.progress??0}%`}})})]},m.id)),p.map(m=>l.jsxs("div",{className:"flex justify-between items-center text-xs text-muted-foreground px-1",children:[l.jsx("span",{className:"truncate",children:m.label}),l.jsx("span",{className:ne("font-semibold text-[10px] px-1.5 py-0.5 rounded uppercase font-mono",m.state==="done"?"bg-emerald-500/10 text-emerald-400":"bg-amber-500/10 text-amber-400"),children:m.state})]},m.id))]})}function to(o){if(!o)return"—";const u=o/1024**3;return u>=1?`${u.toFixed(1)} GB`:`${(o/1024**2).toFixed(0)} MB`}function d0(o){return o?`${Math.round(o/1024)}k`:"—"}function f0({fit:o}){const u={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"}[o.level];return l.jsxs("span",{className:ne("rounded px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider font-mono",u),children:[o.text," • ",o.req_gb," GB RAM"]})}const p0=["fast","heavy","coder","reasoning","agent","vision","scout"];function m0(){const[o,u]=h.useState([]),[i,c]=h.useState([]),[f,p]=h.useState(null),[m,g]=h.useState(null),[S,j]=h.useState(null),[k,C]=h.useState(!0),[D,O]=h.useState(""),[R,N]=h.useState(null),[L,B]=h.useState(null),[T,Q]=h.useState(!1),[q,F]=h.useState(null);function J(){Promise.all([de("/api/models"),de("/api/routing"),de("/api/connect"),de("/api/maintenance/updates")]).then(([M,G,$,b])=>{u(M.models||[]),c(M.running||[]),p(G),g($),j(b)}).catch(M=>O(String(M))).finally(()=>C(!1))}h.useEffect(()=>{J();const M=setInterval(J,4e3);return()=>clearInterval(M)},[]);async function ae(M,G){B(null);try{await de(`/api/models/${encodeURIComponent(G)}/role`,{method:"POST",body:JSON.stringify({role:M||null})}),J()}catch($){alert(`Fehler beim Zuweisen der Rolle: ${$}`)}}async function be(M,G){const $=prompt("Kontextlänge (Tokens):",String(G||32768));if($)try{await de(`/api/models/${encodeURIComponent(M)}/ctx`,{method:"POST",body:JSON.stringify({ctx:parseInt($,10)})}),J()}catch(b){alert(`Fehler beim Setzen des Kontexts: ${b}`)}}async function A(M){if(confirm(`Modell '${M}' aus der Config entfernen? (GGUF-Datei bleibt)`))try{await de(`/api/models/${encodeURIComponent(M)}`,{method:"DELETE"}),J()}catch(G){alert(`Fehler beim Löschen: ${G}`)}}async function ue(M,G,$,b){try{await de("/api/models/install",{method:"POST",body:JSON.stringify({repo:M,role:G,quant:$,jinja:b})}),alert(`Download für '${M}' gestartet! Der Fortschritt wird oben angezeigt.`)}catch(y){alert(`Fehler beim Starten des Upgrades: ${y}`)}}async function Se(M){M&&(await navigator.clipboard.writeText(M),Q(!0),setTimeout(()=>Q(!1),1500))}if(k)return l.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Initialisiere HUD Cockpit…"});if(D)return l.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 (",D,")."]});const se=o.filter(M=>i.includes(M.name)),Pe=se.reduce((M,G)=>M+(G.size_bytes||0),0),ke=16*1024**3,Oe=Pe>ke?Pe*1.2:ke,je=M=>o.find(G=>G.role===M),xe=M=>{const G=je(M);return G?i.includes(G.name):!1};return l.jsxs("div",{className:"space-y-8",children:[l.jsx("style",{children:` +`)},Zg=0,en=[];function qg(o){var u=h.useRef([]),i=h.useRef([0,0]),c=h.useRef(),f=h.useState(Zg++)[0],p=h.useState(df)[0],m=h.useRef(o);h.useEffect(function(){m.current=o},[o]),h.useEffect(function(){if(o.inert){document.body.classList.add("block-interactivity-".concat(f));var N=xg([o.lockRef.current],(o.shards||[]).map(Dd),!0).filter(Boolean);return N.forEach(function(L){return L.classList.add("allow-interactivity-".concat(f))}),function(){document.body.classList.remove("block-interactivity-".concat(f)),N.forEach(function(L){return L.classList.remove("allow-interactivity-".concat(f))})}}},[o.inert,o.lockRef.current,o.shards]);var g=h.useCallback(function(N,L){if("touches"in N&&N.touches.length===2||N.type==="wheel"&&N.ctrlKey)return!m.current.allowPinchZoom;var F=wl(N),T=i.current,Q="deltaX"in N?N.deltaX:T[0]-F[0],q="deltaY"in N?N.deltaY:T[1]-F[1],U,J=N.target,ae=Math.abs(Q)>Math.abs(q)?"h":"v";if("touches"in N&&ae==="h"&&J.type==="range")return!1;var be=window.getSelection(),A=be&&be.anchorNode,ue=A?A===J||A.contains(J):!1;if(ue)return!1;var Se=Ld(ae,J);if(!Se)return!0;if(Se?U=ae:(U=ae==="v"?"h":"v",Se=Ld(ae,J)),!Se)return!1;if(!c.current&&"changedTouches"in N&&(Q||q)&&(c.current=U),!U)return!0;var se=c.current||U;return Gg(se,L,N,se==="h"?Q:q)},[]),S=h.useCallback(function(N){var L=N;if(!(!en.length||en[en.length-1]!==p)){var F="deltaY"in L?Od(L):wl(L),T=u.current.filter(function(U){return U.name===L.type&&(U.target===L.target||L.target===U.shadowParent)&&Kg(U.delta,F)})[0];if(T&&T.should){L.cancelable&&L.preventDefault();return}if(!T){var Q=(m.current.shards||[]).map(Dd).filter(Boolean).filter(function(U){return U.contains(L.target)}),q=Q.length>0?g(L,Q[0]):!m.current.noIsolation;q&&L.cancelable&&L.preventDefault()}}},[]),j=h.useCallback(function(N,L,F,T){var Q={name:N,delta:L,target:F,should:T,shadowParent:Yg(F)};u.current.push(Q),setTimeout(function(){u.current=u.current.filter(function(q){return q!==Q})},1)},[]),b=h.useCallback(function(N){i.current=wl(N),c.current=void 0},[]),C=h.useCallback(function(N){j(N.type,Od(N),N.target,g(N,o.lockRef.current))},[]),D=h.useCallback(function(N){j(N.type,wl(N),N.target,g(N,o.lockRef.current))},[]);h.useEffect(function(){return en.push(p),o.setCallbacks({onScrollCapture:C,onWheelCapture:C,onTouchMoveCapture:D}),document.addEventListener("wheel",S,Jr),document.addEventListener("touchmove",S,Jr),document.addEventListener("touchstart",b,Jr),function(){en=en.filter(function(N){return N!==p}),document.removeEventListener("wheel",S,Jr),document.removeEventListener("touchmove",S,Jr),document.removeEventListener("touchstart",b,Jr)}},[]);var O=o.removeScrollBar,R=o.inert;return h.createElement(h.Fragment,null,R?h.createElement(p,{styles:Qg(f)}):null,O?h.createElement(Fg,{noRelative:o.noRelative,gapMode:o.gapMode}):null)}function Yg(o){for(var u=null;o!==null;)o instanceof ShadowRoot&&(u=o.host,o=o.host),o=o.parentNode;return u}const Xg=Cg(cf,qg);var hf=h.forwardRef(function(o,u){return h.createElement(zl,Mt({},o,{ref:u,sideCar:Xg}))});hf.classNames=zl.classNames;var Jg=function(o){if(typeof document>"u")return null;var u=Array.isArray(o)?o[0]:o;return u.ownerDocument.body},tn=new WeakMap,kl=new WeakMap,jl={},Wi=0,gf=function(o){return o&&(o.host||gf(o.parentNode))},ex=function(o,u){return u.map(function(i){if(o.contains(i))return i;var c=gf(i);return c&&o.contains(c)?c:(console.error("aria-hidden",i,"in not contained inside",o,". Doing nothing"),null)}).filter(function(i){return!!i})},tx=function(o,u,i,c){var f=ex(u,Array.isArray(o)?o:[o]);jl[i]||(jl[i]=new WeakMap);var p=jl[i],m=[],g=new Set,S=new Set(f),j=function(C){!C||g.has(C)||(g.add(C),j(C.parentNode))};f.forEach(j);var b=function(C){!C||S.has(C)||Array.prototype.forEach.call(C.children,function(D){if(g.has(D))b(D);else try{var O=D.getAttribute(c),R=O!==null&&O!=="false",N=(tn.get(D)||0)+1,L=(p.get(D)||0)+1;tn.set(D,N),p.set(D,L),m.push(D),N===1&&R&&kl.set(D,!0),L===1&&D.setAttribute(i,"true"),R||D.setAttribute(c,"true")}catch(F){console.error("aria-hidden: cannot operate on ",D,F)}})};return b(u),g.clear(),Wi++,function(){m.forEach(function(C){var D=tn.get(C)-1,O=p.get(C)-1;tn.set(C,D),p.set(C,O),D||(kl.has(C)||C.removeAttribute(c),kl.delete(C)),O||C.removeAttribute(i)}),Wi--,Wi||(tn=new WeakMap,tn=new WeakMap,kl=new WeakMap,jl={})}},rx=function(o,u,i){i===void 0&&(i="data-aria-hidden");var c=Array.from(Array.isArray(o)?o:[o]),f=Jg(o);return f?(c.push.apply(c,Array.from(f.querySelectorAll("[aria-live], script"))),tx(c,f,i,"aria-hidden")):function(){return null}},Il="Dialog",[xf]=Ph(Il),[nx,kt]=xf(Il),vf=o=>{const{__scopeDialog:u,children:i,open:c,defaultOpen:f,onOpenChange:p,modal:m=!0}=o,g=h.useRef(null),S=h.useRef(null),[j,b]=Th({prop:c,defaultProp:f??!1,onChange:p,caller:Il});return l.jsx(nx,{scope:u,triggerRef:g,contentRef:S,contentId:Ft(),titleId:Ft(),descriptionId:Ft(),open:j,onOpenChange:b,onOpenToggle:h.useCallback(()=>b(C=>!C),[b]),modal:m,children:i})};vf.displayName=Il;var yf="DialogTrigger",ox=h.forwardRef((o,u)=>{const{__scopeDialog:i,...c}=o,f=kt(yf,i),p=Er(u,f.triggerRef);return l.jsx(Ge.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.open?f.contentId:void 0,"data-state":fa(f.open),...c,ref:p,onClick:ur(o.onClick,f.onOpenToggle)})});ox.displayName=yf;var da="DialogPortal",[lx,bf]=xf(da,{forceMount:void 0}),wf=o=>{const{__scopeDialog:u,forceMount:i,children:c,container:f}=o,p=kt(da,u);return l.jsx(lx,{scope:u,forceMount:i,children:h.Children.map(c,m=>l.jsx(Tl,{present:i||p.open,children:l.jsx(sf,{asChild:!0,container:f,children:m})}))})};wf.displayName=da;var Ol="DialogOverlay",kf=h.forwardRef((o,u)=>{const i=bf(Ol,o.__scopeDialog),{forceMount:c=i.forceMount,...f}=o,p=kt(Ol,o.__scopeDialog);return p.modal?l.jsx(Tl,{present:c||p.open,children:l.jsx(ix,{...f,ref:u})}):null});kf.displayName=Ol;var sx=tf("DialogOverlay.RemoveScroll"),ix=h.forwardRef((o,u)=>{const{__scopeDialog:i,...c}=o,f=kt(Ol,i),p=tg(),m=Er(u,p);return l.jsx(hf,{as:sx,allowPinchZoom:!0,shards:[f.contentRef],children:l.jsx(Ge.div,{"data-state":fa(f.open),...c,ref:m,style:{pointerEvents:"auto",...c.style}})})}),cn="DialogContent",jf=h.forwardRef((o,u)=>{const i=bf(cn,o.__scopeDialog),{forceMount:c=i.forceMount,...f}=o,p=kt(cn,o.__scopeDialog);return l.jsx(Tl,{present:c||p.open,children:p.modal?l.jsx(ax,{...f,ref:u}):l.jsx(ux,{...f,ref:u})})});jf.displayName=cn;var ax=h.forwardRef((o,u)=>{const i=kt(cn,o.__scopeDialog),c=h.useRef(null),f=Er(u,i.contentRef,c);return h.useEffect(()=>{const p=c.current;if(p)return rx(p)},[]),l.jsx(Nf,{...o,ref:f,trapFocus:i.open,disableOutsidePointerEvents:i.open,onCloseAutoFocus:ur(o.onCloseAutoFocus,p=>{var m;p.preventDefault(),(m=i.triggerRef.current)==null||m.focus()}),onPointerDownOutside:ur(o.onPointerDownOutside,p=>{const m=p.detail.originalEvent,g=m.button===0&&m.ctrlKey===!0;(m.button===2||g)&&p.preventDefault()}),onFocusOutside:ur(o.onFocusOutside,p=>p.preventDefault())})}),ux=h.forwardRef((o,u)=>{const i=kt(cn,o.__scopeDialog),c=h.useRef(!1),f=h.useRef(!1);return l.jsx(Nf,{...o,ref:u,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:p=>{var m,g;(m=o.onCloseAutoFocus)==null||m.call(o,p),p.defaultPrevented||(c.current||(g=i.triggerRef.current)==null||g.focus(),p.preventDefault()),c.current=!1,f.current=!1},onInteractOutside:p=>{var S,j;(S=o.onInteractOutside)==null||S.call(o,p),p.defaultPrevented||(c.current=!0,p.detail.originalEvent.type==="pointerdown"&&(f.current=!0));const m=p.target;((j=i.triggerRef.current)==null?void 0:j.contains(m))&&p.preventDefault(),p.detail.originalEvent.type==="focusin"&&f.current&&p.preventDefault()}})}),Nf=h.forwardRef((o,u)=>{const{__scopeDialog:i,trapFocus:c,onOpenAutoFocus:f,onCloseAutoFocus:p,...m}=o,g=kt(cn,i);return gg(),l.jsx(l.Fragment,{children:l.jsx(of,{asChild:!0,loop:!0,trapped:c,onMountAutoFocus:f,onUnmountAutoFocus:p,children:l.jsx(rf,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionId,"aria-labelledby":g.titleId,"data-state":fa(g.open),...m,ref:u,deferPointerDownOutside:!0,onDismiss:()=>g.onOpenChange(!1)})})})}),Sf="DialogTitle",cx=h.forwardRef((o,u)=>{const{__scopeDialog:i,...c}=o,f=kt(Sf,i);return l.jsx(Ge.h2,{id:f.titleId,...c,ref:u})});cx.displayName=Sf;var Cf="DialogDescription",dx=h.forwardRef((o,u)=>{const{__scopeDialog:i,...c}=o,f=kt(Cf,i);return l.jsx(Ge.p,{id:f.descriptionId,...c,ref:u})});dx.displayName=Cf;var Ef="DialogClose",fx=h.forwardRef((o,u)=>{const{__scopeDialog:i,...c}=o,f=kt(Ef,i);return l.jsx(Ge.button,{type:"button",...c,ref:u,onClick:ur(o.onClick,()=>f.onOpenChange(!1))})});fx.displayName=Ef;function fa(o){return o?"open":"closed"}var Xn='[cmdk-group=""]',Hi='[cmdk-group-items=""]',px='[cmdk-group-heading=""]',_f='[cmdk-item=""]',Td=`${_f}:not([aria-disabled="true"])`,ta="cmdk-item-select",on="data-value",mx=(o,u,i)=>Mh(o,u,i),Mf=h.createContext(void 0),oo=()=>h.useContext(Mf),Pf=h.createContext(void 0),pa=()=>h.useContext(Pf),Rf=h.createContext(void 0),Lf=h.forwardRef((o,u)=>{let i=ln(()=>{var y,H;return{search:"",value:(H=(y=o.value)!=null?y:o.defaultValue)!=null?H:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),c=ln(()=>new Set),f=ln(()=>new Map),p=ln(()=>new Map),m=ln(()=>new Set),g=Of(o),{label:S,children:j,value:b,onValueChange:C,filter:D,shouldFilter:O,loop:R,disablePointerSelection:N=!1,vimBindings:L=!0,...F}=o,T=Ft(),Q=Ft(),q=Ft(),U=h.useRef(null),J=Sx();Cr(()=>{if(b!==void 0){let y=b.trim();i.current.value=y,ae.emit()}},[b]),Cr(()=>{J(6,Pe)},[]);let ae=h.useMemo(()=>({subscribe:y=>(m.current.add(y),()=>m.current.delete(y)),snapshot:()=>i.current,setState:(y,H,K)=>{var W,te,ie,pe;if(!Object.is(i.current[y],H)){if(i.current[y]=H,y==="search")se(),ue(),J(1,Se);else if(y==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let he=document.getElementById(q);he?he.focus():(W=document.getElementById(T))==null||W.focus()}if(J(7,()=>{var he;i.current.selectedItemId=(he=ke())==null?void 0:he.id,ae.emit()}),K||J(5,Pe),((te=g.current)==null?void 0:te.value)!==void 0){let he=H??"";(pe=(ie=g.current).onValueChange)==null||pe.call(ie,he);return}}ae.emit()}},emit:()=>{m.current.forEach(y=>y())}}),[]),be=h.useMemo(()=>({value:(y,H,K)=>{var W;H!==((W=p.current.get(y))==null?void 0:W.value)&&(p.current.set(y,{value:H,keywords:K}),i.current.filtered.items.set(y,A(H,K)),J(2,()=>{ue(),ae.emit()}))},item:(y,H)=>(c.current.add(y),H&&(f.current.has(H)?f.current.get(H).add(y):f.current.set(H,new Set([y]))),J(3,()=>{se(),ue(),i.current.value||Se(),ae.emit()}),()=>{p.current.delete(y),c.current.delete(y),i.current.filtered.items.delete(y);let K=ke();J(4,()=>{se(),(K==null?void 0:K.getAttribute("id"))===y&&Se(),ae.emit()})}),group:y=>(f.current.has(y)||f.current.set(y,new Set),()=>{p.current.delete(y),f.current.delete(y)}),filter:()=>g.current.shouldFilter,label:S||o["aria-label"],getDisablePointerSelection:()=>g.current.disablePointerSelection,listId:T,inputId:q,labelId:Q,listInnerRef:U}),[]);function A(y,H){var K,W;let te=(W=(K=g.current)==null?void 0:K.filter)!=null?W:mx;return y?te(y,i.current.search,H):0}function ue(){if(!i.current.search||g.current.shouldFilter===!1)return;let y=i.current.filtered.items,H=[];i.current.filtered.groups.forEach(W=>{let te=f.current.get(W),ie=0;te.forEach(pe=>{let he=y.get(pe);ie=Math.max(he,ie)}),H.push([W,ie])});let K=U.current;Oe().sort((W,te)=>{var ie,pe;let he=W.getAttribute("id"),Ue=te.getAttribute("id");return((ie=y.get(Ue))!=null?ie:0)-((pe=y.get(he))!=null?pe:0)}).forEach(W=>{let te=W.closest(Hi);te?te.appendChild(W.parentElement===te?W:W.closest(`${Hi} > *`)):K.appendChild(W.parentElement===K?W:W.closest(`${Hi} > *`))}),H.sort((W,te)=>te[1]-W[1]).forEach(W=>{var te;let ie=(te=U.current)==null?void 0:te.querySelector(`${Xn}[${on}="${encodeURIComponent(W[0])}"]`);ie==null||ie.parentElement.appendChild(ie)})}function Se(){let y=Oe().find(K=>K.getAttribute("aria-disabled")!=="true"),H=y==null?void 0:y.getAttribute(on);ae.setState("value",H||void 0)}function se(){var y,H,K,W;if(!i.current.search||g.current.shouldFilter===!1){i.current.filtered.count=c.current.size;return}i.current.filtered.groups=new Set;let te=0;for(let ie of c.current){let pe=(H=(y=p.current.get(ie))==null?void 0:y.value)!=null?H:"",he=(W=(K=p.current.get(ie))==null?void 0:K.keywords)!=null?W:[],Ue=A(pe,he);i.current.filtered.items.set(ie,Ue),Ue>0&&te++}for(let[ie,pe]of f.current)for(let he of pe)if(i.current.filtered.items.get(he)>0){i.current.filtered.groups.add(ie);break}i.current.filtered.count=te}function Pe(){var y,H,K;let W=ke();W&&(((y=W.parentElement)==null?void 0:y.firstChild)===W&&((K=(H=W.closest(Xn))==null?void 0:H.querySelector(px))==null||K.scrollIntoView({block:"nearest"})),W.scrollIntoView({block:"nearest"}))}function ke(){var y;return(y=U.current)==null?void 0:y.querySelector(`${_f}[aria-selected="true"]`)}function Oe(){var y;return Array.from(((y=U.current)==null?void 0:y.querySelectorAll(Td))||[])}function je(y){let H=Oe()[y];H&&ae.setState("value",H.getAttribute(on))}function xe(y){var H;let K=ke(),W=Oe(),te=W.findIndex(pe=>pe===K),ie=W[te+y];(H=g.current)!=null&&H.loop&&(ie=te+y<0?W[W.length-1]:te+y===W.length?W[0]:W[te+y]),ie&&ae.setState("value",ie.getAttribute(on))}function M(y){let H=ke(),K=H==null?void 0:H.closest(Xn),W;for(;K&&!W;)K=y>0?jx(K,Xn):Nx(K,Xn),W=K==null?void 0:K.querySelector(Td);W?ae.setState("value",W.getAttribute(on)):xe(y)}let G=()=>je(Oe().length-1),B=y=>{y.preventDefault(),y.metaKey?G():y.altKey?M(1):xe(1)},w=y=>{y.preventDefault(),y.metaKey?je(0):y.altKey?M(-1):xe(-1)};return h.createElement(Ge.div,{ref:u,tabIndex:-1,...F,"cmdk-root":"",onKeyDown:y=>{var H;(H=F.onKeyDown)==null||H.call(F,y);let K=y.nativeEvent.isComposing||y.keyCode===229;if(!(y.defaultPrevented||K))switch(y.key){case"n":case"j":{L&&y.ctrlKey&&B(y);break}case"ArrowDown":{B(y);break}case"p":case"k":{L&&y.ctrlKey&&w(y);break}case"ArrowUp":{w(y);break}case"Home":{y.preventDefault(),je(0);break}case"End":{y.preventDefault(),G();break}case"Enter":{y.preventDefault();let W=ke();if(W){let te=new Event(ta);W.dispatchEvent(te)}}}}},h.createElement("label",{"cmdk-label":"",htmlFor:be.inputId,id:be.labelId,style:Ex},S),Al(o,y=>h.createElement(Pf.Provider,{value:ae},h.createElement(Mf.Provider,{value:be},y))))}),hx=h.forwardRef((o,u)=>{var i,c;let f=Ft(),p=h.useRef(null),m=h.useContext(Rf),g=oo(),S=Of(o),j=(c=(i=S.current)==null?void 0:i.forceMount)!=null?c:m==null?void 0:m.forceMount;Cr(()=>{if(!j)return g.item(f,m==null?void 0:m.id)},[j]);let b=Df(f,p,[o.value,o.children,p],o.keywords),C=pa(),D=dr(J=>J.value&&J.value===b.current),O=dr(J=>j||g.filter()===!1?!0:J.search?J.filtered.items.get(f)>0:!0);h.useEffect(()=>{let J=p.current;if(!(!J||o.disabled))return J.addEventListener(ta,R),()=>J.removeEventListener(ta,R)},[O,o.onSelect,o.disabled]);function R(){var J,ae;N(),(ae=(J=S.current).onSelect)==null||ae.call(J,b.current)}function N(){C.setState("value",b.current,!0)}if(!O)return null;let{disabled:L,value:F,onSelect:T,forceMount:Q,keywords:q,...U}=o;return h.createElement(Ge.div,{ref:un(p,u),...U,id:f,"cmdk-item":"",role:"option","aria-disabled":!!L,"aria-selected":!!D,"data-disabled":!!L,"data-selected":!!D,onPointerMove:L||g.getDisablePointerSelection()?void 0:N,onClick:L?void 0:R},o.children)}),gx=h.forwardRef((o,u)=>{let{heading:i,children:c,forceMount:f,...p}=o,m=Ft(),g=h.useRef(null),S=h.useRef(null),j=Ft(),b=oo(),C=dr(O=>f||b.filter()===!1?!0:O.search?O.filtered.groups.has(m):!0);Cr(()=>b.group(m),[]),Df(m,g,[o.value,o.heading,S]);let D=h.useMemo(()=>({id:m,forceMount:f}),[f]);return h.createElement(Ge.div,{ref:un(g,u),...p,"cmdk-group":"",role:"presentation",hidden:C?void 0:!0},i&&h.createElement("div",{ref:S,"cmdk-group-heading":"","aria-hidden":!0,id:j},i),Al(o,O=>h.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":i?j:void 0},h.createElement(Rf.Provider,{value:D},O))))}),xx=h.forwardRef((o,u)=>{let{alwaysRender:i,...c}=o,f=h.useRef(null),p=dr(m=>!m.search);return!i&&!p?null:h.createElement(Ge.div,{ref:un(f,u),...c,"cmdk-separator":"",role:"separator"})}),vx=h.forwardRef((o,u)=>{let{onValueChange:i,...c}=o,f=o.value!=null,p=pa(),m=dr(j=>j.search),g=dr(j=>j.selectedItemId),S=oo();return h.useEffect(()=>{o.value!=null&&p.setState("search",o.value)},[o.value]),h.createElement(Ge.input,{ref:u,...c,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":S.listId,"aria-labelledby":S.labelId,"aria-activedescendant":g,id:S.inputId,type:"text",value:f?o.value:m,onChange:j=>{f||p.setState("search",j.target.value),i==null||i(j.target.value)}})}),yx=h.forwardRef((o,u)=>{let{children:i,label:c="Suggestions",...f}=o,p=h.useRef(null),m=h.useRef(null),g=dr(j=>j.selectedItemId),S=oo();return h.useEffect(()=>{if(m.current&&p.current){let j=m.current,b=p.current,C,D=new ResizeObserver(()=>{C=requestAnimationFrame(()=>{let O=j.offsetHeight;b.style.setProperty("--cmdk-list-height",O.toFixed(1)+"px")})});return D.observe(j),()=>{cancelAnimationFrame(C),D.unobserve(j)}}},[]),h.createElement(Ge.div,{ref:un(p,u),...f,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":g,"aria-label":c,id:S.listId},Al(o,j=>h.createElement("div",{ref:un(m,S.listInnerRef),"cmdk-list-sizer":""},j)))}),bx=h.forwardRef((o,u)=>{let{open:i,onOpenChange:c,overlayClassName:f,contentClassName:p,container:m,...g}=o;return h.createElement(vf,{open:i,onOpenChange:c},h.createElement(wf,{container:m},h.createElement(kf,{"cmdk-overlay":"",className:f}),h.createElement(jf,{"aria-label":o.label,"cmdk-dialog":"",className:p},h.createElement(Lf,{ref:u,...g}))))}),wx=h.forwardRef((o,u)=>dr(i=>i.filtered.count===0)?h.createElement(Ge.div,{ref:u,...o,"cmdk-empty":"",role:"presentation"}):null),kx=h.forwardRef((o,u)=>{let{progress:i,children:c,label:f="Loading...",...p}=o;return h.createElement(Ge.div,{ref:u,...p,"cmdk-loading":"",role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,"aria-label":f},Al(o,m=>h.createElement("div",{"aria-hidden":!0},m)))}),rn=Object.assign(Lf,{List:yx,Item:hx,Input:vx,Group:gx,Separator:xx,Dialog:bx,Empty:wx,Loading:kx});function jx(o,u){let i=o.nextElementSibling;for(;i;){if(i.matches(u))return i;i=i.nextElementSibling}}function Nx(o,u){let i=o.previousElementSibling;for(;i;){if(i.matches(u))return i;i=i.previousElementSibling}}function Of(o){let u=h.useRef(o);return Cr(()=>{u.current=o}),u}var Cr=typeof window>"u"?h.useEffect:h.useLayoutEffect;function ln(o){let u=h.useRef();return u.current===void 0&&(u.current=o()),u}function dr(o){let u=pa(),i=()=>o(u.snapshot());return h.useSyncExternalStore(u.subscribe,i,i)}function Df(o,u,i,c=[]){let f=h.useRef(),p=oo();return Cr(()=>{var m;let g=(()=>{var j;for(let b of i){if(typeof b=="string")return b.trim();if(typeof b=="object"&&"current"in b)return b.current?(j=b.current.textContent)==null?void 0:j.trim():f.current}})(),S=c.map(j=>j.trim());p.value(o,g,S),(m=u.current)==null||m.setAttribute(on,g),f.current=g}),f}var Sx=()=>{let[o,u]=h.useState(),i=ln(()=>new Map);return Cr(()=>{i.current.forEach(c=>c()),i.current=new Map},[o]),(c,f)=>{i.current.set(c,f),u({})}};function Cx(o){let u=o.type;return typeof u=="function"?u(o.props):"render"in u?u.render(o.props):o}function Al({asChild:o,children:u},i){return o&&h.isValidElement(u)?h.cloneElement(Cx(u),{ref:u.ref},i(u.props.children)):i(u)}var Ex={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function _x({onNavigate:o}){const[u,i]=h.useState(!1);return h.useEffect(()=>{const c=f=>{(f.metaKey||f.ctrlKey)&&f.key.toLowerCase()==="k"&&(f.preventDefault(),i(p=>!p))};return document.addEventListener("keydown",c),()=>document.removeEventListener("keydown",c)},[]),l.jsx(rn.Dialog,{open:u,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:l.jsxs("div",{className:"w-full max-w-lg overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-2xl",onClick:c=>c.stopPropagation(),children:[l.jsx(rn.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"}),l.jsxs(rn.List,{className:"max-h-80 overflow-y-auto p-2",children:[l.jsx(rn.Empty,{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Nichts gefunden."}),l.jsx(rn.Group,{heading:"Bereiche",className:"px-1 py-1 text-xs text-muted-foreground",children:Yi.map(c=>l.jsxs(rn.Item,{value:`${c.label} ${c.hint}`,onSelect:()=>{o(c.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:[l.jsx(c.icon,{className:"h-4 w-4 text-primary"}),l.jsx("span",{children:c.label}),l.jsx("span",{className:"ml-auto truncate text-xs text-muted-foreground",children:c.hint})]},c.id))})]})]})})}async function de(o,u){const i=await fetch(o,{headers:{"Content-Type":"application/json"},...u});if(!i.ok)throw new Error(`${i.status} ${i.statusText}`);return i.json()}function Tf(o){var u,i,c="";if(typeof o=="string"||typeof o=="number")c+=o;else if(typeof o=="object")if(Array.isArray(o)){var f=o.length;for(u=0;u{const u=Lx(o),{conflictingClassGroups:i,conflictingClassGroupModifiers:c}=o;return{getClassGroupId:m=>{const g=m.split(ma);return g[0]===""&&g.length!==1&&g.shift(),zf(g,u)||Rx(m)},getConflictingClassGroupIds:(m,g)=>{const S=i[m]||[];return g&&c[m]?[...S,...c[m]]:S}}},zf=(o,u)=>{var m;if(o.length===0)return u.classGroupId;const i=o[0],c=u.nextPart.get(i),f=c?zf(o.slice(1),c):void 0;if(f)return f;if(u.validators.length===0)return;const p=o.join(ma);return(m=u.validators.find(({validator:g})=>g(p)))==null?void 0:m.classGroupId},zd=/^\[(.+)\]$/,Rx=o=>{if(zd.test(o)){const u=zd.exec(o)[1],i=u==null?void 0:u.substring(0,u.indexOf(":"));if(i)return"arbitrary.."+i}},Lx=o=>{const{theme:u,prefix:i}=o,c={nextPart:new Map,validators:[]};return Dx(Object.entries(o.classGroups),i).forEach(([p,m])=>{ra(m,c,p,u)}),c},ra=(o,u,i,c)=>{o.forEach(f=>{if(typeof f=="string"){const p=f===""?u:Id(u,f);p.classGroupId=i;return}if(typeof f=="function"){if(Ox(f)){ra(f(c),u,i,c);return}u.validators.push({validator:f,classGroupId:i});return}Object.entries(f).forEach(([p,m])=>{ra(m,Id(u,p),i,c)})})},Id=(o,u)=>{let i=o;return u.split(ma).forEach(c=>{i.nextPart.has(c)||i.nextPart.set(c,{nextPart:new Map,validators:[]}),i=i.nextPart.get(c)}),i},Ox=o=>o.isThemeGetter,Dx=(o,u)=>u?o.map(([i,c])=>{const f=c.map(p=>typeof p=="string"?u+p:typeof p=="object"?Object.fromEntries(Object.entries(p).map(([m,g])=>[u+m,g])):p);return[i,f]}):o,Tx=o=>{if(o<1)return{get:()=>{},set:()=>{}};let u=0,i=new Map,c=new Map;const f=(p,m)=>{i.set(p,m),u++,u>o&&(u=0,c=i,i=new Map)};return{get(p){let m=i.get(p);if(m!==void 0)return m;if((m=c.get(p))!==void 0)return f(p,m),m},set(p,m){i.has(p)?i.set(p,m):f(p,m)}}},If="!",zx=o=>{const{separator:u,experimentalParseClassName:i}=o,c=u.length===1,f=u[0],p=u.length,m=g=>{const S=[];let j=0,b=0,C;for(let L=0;Lb?C-b:void 0;return{modifiers:S,hasImportantModifier:O,baseClassName:R,maybePostfixModifierPosition:N}};return i?g=>i({className:g,parseClassName:m}):m},Ix=o=>{if(o.length<=1)return o;const u=[];let i=[];return o.forEach(c=>{c[0]==="["?(u.push(...i.sort(),c),i=[]):i.push(c)}),u.push(...i.sort()),u},Ax=o=>({cache:Tx(o.cacheSize),parseClassName:zx(o),...Px(o)}),Fx=/\s+/,Ux=(o,u)=>{const{parseClassName:i,getClassGroupId:c,getConflictingClassGroupIds:f}=u,p=[],m=o.trim().split(Fx);let g="";for(let S=m.length-1;S>=0;S-=1){const j=m[S],{modifiers:b,hasImportantModifier:C,baseClassName:D,maybePostfixModifierPosition:O}=i(j);let R=!!O,N=c(R?D.substring(0,O):D);if(!N){if(!R){g=j+(g.length>0?" "+g:g);continue}if(N=c(D),!N){g=j+(g.length>0?" "+g:g);continue}R=!1}const L=Ix(b).join(":"),F=C?L+If:L,T=F+N;if(p.includes(T))continue;p.push(T);const Q=f(N,R);for(let q=0;q0?" "+g:g)}return g};function $x(){let o=0,u,i,c="";for(;o{if(typeof o=="string")return o;let u,i="";for(let c=0;cC(b),o());return i=Ax(j),c=i.cache.get,f=i.cache.set,p=g,g(S)}function g(S){const j=c(S);if(j)return j;const b=Ux(S,i);return f(S,b),b}return function(){return p($x.apply(null,arguments))}}const _e=o=>{const u=i=>i[o]||[];return u.isThemeGetter=!0,u},Ff=/^\[(?:([a-z-]+):)?(.+)\]$/i,Vx=/^\d+\/\d+$/,Wx=new Set(["px","full","screen"]),Hx=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Gx=/\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$/,Kx=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Qx=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,At=o=>an(o)||Wx.has(o)||Vx.test(o),lr=o=>dn(o,"length",n0),an=o=>!!o&&!Number.isNaN(Number(o)),Gi=o=>dn(o,"number",an),Jn=o=>!!o&&Number.isInteger(Number(o)),qx=o=>o.endsWith("%")&&an(o.slice(0,-1)),me=o=>Ff.test(o),sr=o=>Hx.test(o),Yx=new Set(["length","size","percentage"]),Xx=o=>dn(o,Yx,Uf),Jx=o=>dn(o,"position",Uf),e0=new Set(["image","url"]),t0=o=>dn(o,e0,l0),r0=o=>dn(o,"",o0),eo=()=>!0,dn=(o,u,i)=>{const c=Ff.exec(o);return c?c[1]?typeof u=="string"?c[1]===u:u.has(c[1]):i(c[2]):!1},n0=o=>Gx.test(o)&&!Kx.test(o),Uf=()=>!1,o0=o=>Qx.test(o),l0=o=>Zx.test(o),s0=()=>{const o=_e("colors"),u=_e("spacing"),i=_e("blur"),c=_e("brightness"),f=_e("borderColor"),p=_e("borderRadius"),m=_e("borderSpacing"),g=_e("borderWidth"),S=_e("contrast"),j=_e("grayscale"),b=_e("hueRotate"),C=_e("invert"),D=_e("gap"),O=_e("gradientColorStops"),R=_e("gradientColorStopPositions"),N=_e("inset"),L=_e("margin"),F=_e("opacity"),T=_e("padding"),Q=_e("saturate"),q=_e("scale"),U=_e("sepia"),J=_e("skew"),ae=_e("space"),be=_e("translate"),A=()=>["auto","contain","none"],ue=()=>["auto","hidden","clip","visible","scroll"],Se=()=>["auto",me,u],se=()=>[me,u],Pe=()=>["",At,lr],ke=()=>["auto",an,me],Oe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],je=()=>["solid","dashed","dotted","double","none"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",me],B=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>[an,me];return{cacheSize:500,separator:":",theme:{colors:[eo],spacing:[At,lr],blur:["none","",sr,me],brightness:w(),borderColor:[o],borderRadius:["none","","full",sr,me],borderSpacing:se(),borderWidth:Pe(),contrast:w(),grayscale:G(),hueRotate:w(),invert:G(),gap:se(),gradientColorStops:[o],gradientColorStopPositions:[qx,lr],inset:Se(),margin:Se(),opacity:w(),padding:se(),saturate:w(),scale:w(),sepia:G(),skew:w(),space:se(),translate:se()},classGroups:{aspect:[{aspect:["auto","square","video",me]}],container:["container"],columns:[{columns:[sr]}],"break-after":[{"break-after":B()}],"break-before":[{"break-before":B()}],"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:[...Oe(),me]}],overflow:[{overflow:ue()}],"overflow-x":[{"overflow-x":ue()}],"overflow-y":[{"overflow-y":ue()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[N]}],"inset-x":[{"inset-x":[N]}],"inset-y":[{"inset-y":[N]}],start:[{start:[N]}],end:[{end:[N]}],top:[{top:[N]}],right:[{right:[N]}],bottom:[{bottom:[N]}],left:[{left:[N]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Jn,me]}],basis:[{basis:Se()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",me]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",Jn,me]}],"grid-cols":[{"grid-cols":[eo]}],"col-start-end":[{col:["auto",{span:["full",Jn,me]},me]}],"col-start":[{"col-start":ke()}],"col-end":[{"col-end":ke()}],"grid-rows":[{"grid-rows":[eo]}],"row-start-end":[{row:["auto",{span:[Jn,me]},me]}],"row-start":[{"row-start":ke()}],"row-end":[{"row-end":ke()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",me]}],gap:[{gap:[D]}],"gap-x":[{"gap-x":[D]}],"gap-y":[{"gap-y":[D]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[L]}],mx:[{mx:[L]}],my:[{my:[L]}],ms:[{ms:[L]}],me:[{me:[L]}],mt:[{mt:[L]}],mr:[{mr:[L]}],mb:[{mb:[L]}],ml:[{ml:[L]}],"space-x":[{"space-x":[ae]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ae]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",me,u]}],"min-w":[{"min-w":[me,u,"min","max","fit"]}],"max-w":[{"max-w":[me,u,"none","full","min","max","fit","prose",{screen:[sr]},sr]}],h:[{h:[me,u,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[me,u,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[me,u,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[me,u,"auto","min","max","fit"]}],"font-size":[{text:["base",sr,lr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Gi]}],"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",me]}],"line-clamp":[{"line-clamp":["none",an,Gi]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",At,me]}],"list-image":[{"list-image":["none",me]}],"list-style-type":[{list:["none","disc","decimal",me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[o]}],"placeholder-opacity":[{"placeholder-opacity":[F]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[o]}],"text-opacity":[{"text-opacity":[F]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...je(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",At,lr]}],"underline-offset":[{"underline-offset":["auto",At,me]}],"text-decoration-color":[{decoration:[o]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:se()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",me]}],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",me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[F]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Oe(),Jx]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Xx]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},t0]}],"bg-color":[{bg:[o]}],"gradient-from-pos":[{from:[R]}],"gradient-via-pos":[{via:[R]}],"gradient-to-pos":[{to:[R]}],"gradient-from":[{from:[O]}],"gradient-via":[{via:[O]}],"gradient-to":[{to:[O]}],rounded:[{rounded:[p]}],"rounded-s":[{"rounded-s":[p]}],"rounded-e":[{"rounded-e":[p]}],"rounded-t":[{"rounded-t":[p]}],"rounded-r":[{"rounded-r":[p]}],"rounded-b":[{"rounded-b":[p]}],"rounded-l":[{"rounded-l":[p]}],"rounded-ss":[{"rounded-ss":[p]}],"rounded-se":[{"rounded-se":[p]}],"rounded-ee":[{"rounded-ee":[p]}],"rounded-es":[{"rounded-es":[p]}],"rounded-tl":[{"rounded-tl":[p]}],"rounded-tr":[{"rounded-tr":[p]}],"rounded-br":[{"rounded-br":[p]}],"rounded-bl":[{"rounded-bl":[p]}],"border-w":[{border:[g]}],"border-w-x":[{"border-x":[g]}],"border-w-y":[{"border-y":[g]}],"border-w-s":[{"border-s":[g]}],"border-w-e":[{"border-e":[g]}],"border-w-t":[{"border-t":[g]}],"border-w-r":[{"border-r":[g]}],"border-w-b":[{"border-b":[g]}],"border-w-l":[{"border-l":[g]}],"border-opacity":[{"border-opacity":[F]}],"border-style":[{border:[...je(),"hidden"]}],"divide-x":[{"divide-x":[g]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[g]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[F]}],"divide-style":[{divide:je()}],"border-color":[{border:[f]}],"border-color-x":[{"border-x":[f]}],"border-color-y":[{"border-y":[f]}],"border-color-s":[{"border-s":[f]}],"border-color-e":[{"border-e":[f]}],"border-color-t":[{"border-t":[f]}],"border-color-r":[{"border-r":[f]}],"border-color-b":[{"border-b":[f]}],"border-color-l":[{"border-l":[f]}],"divide-color":[{divide:[f]}],"outline-style":[{outline:["",...je()]}],"outline-offset":[{"outline-offset":[At,me]}],"outline-w":[{outline:[At,lr]}],"outline-color":[{outline:[o]}],"ring-w":[{ring:Pe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[o]}],"ring-opacity":[{"ring-opacity":[F]}],"ring-offset-w":[{"ring-offset":[At,lr]}],"ring-offset-color":[{"ring-offset":[o]}],shadow:[{shadow:["","inner","none",sr,r0]}],"shadow-color":[{shadow:[eo]}],opacity:[{opacity:[F]}],"mix-blend":[{"mix-blend":[...xe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":xe()}],filter:[{filter:["","none"]}],blur:[{blur:[i]}],brightness:[{brightness:[c]}],contrast:[{contrast:[S]}],"drop-shadow":[{"drop-shadow":["","none",sr,me]}],grayscale:[{grayscale:[j]}],"hue-rotate":[{"hue-rotate":[b]}],invert:[{invert:[C]}],saturate:[{saturate:[Q]}],sepia:[{sepia:[U]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[i]}],"backdrop-brightness":[{"backdrop-brightness":[c]}],"backdrop-contrast":[{"backdrop-contrast":[S]}],"backdrop-grayscale":[{"backdrop-grayscale":[j]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[b]}],"backdrop-invert":[{"backdrop-invert":[C]}],"backdrop-opacity":[{"backdrop-opacity":[F]}],"backdrop-saturate":[{"backdrop-saturate":[Q]}],"backdrop-sepia":[{"backdrop-sepia":[U]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[m]}],"border-spacing-x":[{"border-spacing-x":[m]}],"border-spacing-y":[{"border-spacing-y":[m]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",me]}],duration:[{duration:w()}],ease:[{ease:["linear","in","out","in-out",me]}],delay:[{delay:w()}],animate:[{animate:["none","spin","ping","pulse","bounce",me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[q]}],"scale-x":[{"scale-x":[q]}],"scale-y":[{"scale-y":[q]}],rotate:[{rotate:[Jn,me]}],"translate-x":[{"translate-x":[be]}],"translate-y":[{"translate-y":[be]}],"skew-x":[{"skew-x":[J]}],"skew-y":[{"skew-y":[J]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",me]}],accent:[{accent:["auto",o]}],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",me]}],"caret-color":[{caret:[o]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":se()}],"scroll-mx":[{"scroll-mx":se()}],"scroll-my":[{"scroll-my":se()}],"scroll-ms":[{"scroll-ms":se()}],"scroll-me":[{"scroll-me":se()}],"scroll-mt":[{"scroll-mt":se()}],"scroll-mr":[{"scroll-mr":se()}],"scroll-mb":[{"scroll-mb":se()}],"scroll-ml":[{"scroll-ml":se()}],"scroll-p":[{"scroll-p":se()}],"scroll-px":[{"scroll-px":se()}],"scroll-py":[{"scroll-py":se()}],"scroll-ps":[{"scroll-ps":se()}],"scroll-pe":[{"scroll-pe":se()}],"scroll-pt":[{"scroll-pt":se()}],"scroll-pr":[{"scroll-pr":se()}],"scroll-pb":[{"scroll-pb":se()}],"scroll-pl":[{"scroll-pl":se()}],"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",me]}],fill:[{fill:[o,"none"]}],"stroke-w":[{stroke:[At,lr,Gi]}],stroke:[{stroke:[o,"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"]}}},i0=Bx(s0);function ne(...o){return i0(Mx(o))}function Dl(o){if(!o)return"";const u=window.location.hostname;return u!=="127.0.0.1"&&u!=="localhost"&&u!==""?o.replace(/127\.0\.0\.1|localhost/g,u):o}function nn(o){return(o/1024**3).toFixed(1)}function Nl({value:o,label:u,detail:i}){const f=2*Math.PI*24,p=f-Math.min(o,100)/100*f,m=o>90?"stroke-red-500":o>75?"stroke-amber-500":"stroke-primary";return l.jsxs("div",{className:"flex flex-col items-center gap-1.5 p-2 bg-background/20 rounded-xl border border-border/40",children:[l.jsxs("div",{className:"relative flex h-16 w-16 items-center justify-center",children:[l.jsxs("svg",{className:"absolute inset-0 h-full w-full -rotate-90",children:[l.jsx("circle",{cx:"32",cy:"32",r:24,className:"stroke-muted fill-none",strokeWidth:"4.5"}),l.jsx("circle",{cx:"32",cy:"32",r:24,className:ne("fill-none transition-all duration-700 ease-out",m),strokeWidth:"4.5",strokeDasharray:f,strokeDashoffset:p,strokeLinecap:"round"})]}),l.jsxs("span",{className:"text-xs font-mono font-bold tracking-tight text-foreground",children:[Math.round(o),"%"]})]}),l.jsx("span",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:u}),i&&l.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/80",children:i})]})}function a0(){const[o,u]=h.useState(null),[i,c]=h.useState(null),[f,p]=h.useState([]),[m,g]=h.useState([]),[S,j]=h.useState([]),[b,C]=h.useState(null),[D,O]=h.useState(""),[R,N]=h.useState("stable"),[L,F]=h.useState(!1);function T(){de("/api/system/status").then(u).catch(()=>{}),de("/api/agent/status").then(c).catch(()=>{}),de("/api/models").then(U=>{p(U.models||[]),g(U.running||[])}).catch(()=>{}),de("/api/memory?category=").then(U=>j(U.slice(0,3))).catch(()=>{}),de("/api/maintenance/updates").then(C).catch(()=>{})}h.useEffect(()=>{T();const U=setInterval(T,3e3);return()=>clearInterval(U)},[]);async function Q(){if(!(!D.trim()||L)){F(!0);try{await de("/api/memory",{method:"POST",body:JSON.stringify({content:D,category:R,source:"dashboard"})}),O(""),de("/api/memory?category=").then(U=>j(U.slice(0,3))).catch(()=>{})}catch(U){console.error(U)}finally{F(!1)}}}const q=f.filter(U=>U.role);return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.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"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Aktueller Status von System, Modellen und Agent."})]}),l.jsxs("div",{className:"grid gap-6 md:grid-cols-3",children:[l.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:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(cr,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"System-Status"})]}),o?l.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-4",children:[l.jsx(Nl,{value:o.cpu.percent,label:"CPU",detail:`${o.cpu.cores} Cores`}),l.jsx(Nl,{value:o.ram.percent,label:"RAM",detail:`${nn(o.ram.used)} / ${nn(o.ram.total)} GB`}),o.gpu&&o.gpu.busy_percent!=null&&o.gpu.gtt_used!=null&&o.gpu.gtt_total!=null&&l.jsx(Nl,{value:o.gpu.busy_percent,label:"GPU",detail:`${nn(o.gpu.gtt_used)} / ${nn(o.gpu.gtt_total)} GB`}),o.disk&&l.jsx(Nl,{value:o.disk.percent,label:"Disk",detail:`${nn(o.disk.used)} / ${nn(o.disk.total)} GB`})]}):l.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Systemdaten…"})]}),(o==null?void 0:o.temp)&&(o.temp.cpu||o.temp.gpu)&&l.jsxs("div",{className:"mt-4 flex gap-4 text-xs font-mono text-muted-foreground/80 border-t border-border/30 pt-3",children:[o.temp.cpu!=null&&l.jsxs("span",{children:["CPU Temp: ",o.temp.cpu," °C"]}),o.temp.gpu!=null&&l.jsxs("span",{children:["GPU Temp: ",o.temp.gpu," °C"]})]})]}),l.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:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(Zd,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Updates & Pflege"})]}),b?l.jsxs("div",{className:"space-y-2.5",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.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:[l.jsx("span",{children:"OS-Pakete"}),l.jsx("span",{className:"font-mono",children:b.os>0?`${b.os} verfügbar`:"aktuell"})]}),l.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:[l.jsx("span",{children:"Engine (llama.cpp)"}),l.jsx("span",{className:"font-mono",children:b.engine>0?"Update verfügbar":"aktuell"})]}),l.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:[l.jsx("span",{children:"Modell-Upgrades"}),l.jsx("span",{className:"font-mono",children:b.models>0?`${b.models} verfügbar`:"aktuell"})]})]}),b.model_list.length>0&&l.jsxs("div",{className:"mt-2 space-y-1",children:[l.jsx("div",{className:"text-[9px] uppercase font-bold text-muted-foreground/60 tracking-wider",children:"Upgrades:"}),l.jsx("div",{className:"max-h-20 overflow-y-auto space-y-1 pr-1 scrollbar-thin",children:b.model_list.map(U=>l.jsxs("div",{className:"text-[9px] bg-background/20 border border-border/20 rounded p-1.5 font-mono text-muted-foreground truncate",title:`${U.role}: ${U.repo}`,children:[l.jsx("span",{className:"text-primary font-semibold uppercase",children:U.role}),": ",U.repo.split("/").pop()]},U.repo))})]})]}):l.jsx("div",{className:"h-24 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Updates..."})]}),l.jsx("div",{className:"mt-4 border-t border-border/30 pt-3 shrink-0",children:l.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"})})]})]}),l.jsxs("div",{className:"grid gap-6 md:grid-cols-3",children:[l.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:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(sa,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Hermes Agent"})]}),(i==null?void 0:i.webui_url)&&l.jsxs("a",{href:Dl(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:[l.jsx(Pl,{className:"h-3 w-3"})," Hermes öffnen"]})]}),i?l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[l.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Gateway"}),l.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[l.jsx("span",{className:ne("h-2 w-2 rounded-full",i.gateway_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),l.jsx("span",{className:"text-xs font-medium",children:i.gateway_reachable?"Online":"Offline"})]})]}),l.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[l.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"WebUI"}),l.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[l.jsx("span",{className:ne("h-2 w-2 rounded-full",i.webui_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),l.jsx("span",{className:"text-xs font-medium",children:i.webui_reachable?"Online":"Offline"})]})]})]}),l.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[l.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Aktives Gehirn"}),l.jsxs("div",{className:"text-xs font-medium mt-1 font-mono text-primary flex items-center gap-1.5",children:[l.jsx(Rl,{className:"h-3.5 w-3.5"}),i.brain_model?`model: ${i.brain_model}`:"model: auto"]})]})]}):l.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Agenten-Status…"})]}),l.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."})]}),l.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:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(Rl,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Aktive Rollen"})]}),l.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto pr-1 scrollbar-thin",children:q.length===0?l.jsx("div",{className:"text-xs text-muted-foreground py-6 text-center",children:"Keine Modelle als Rollen zugewiesen."}):q.map(U=>{const J=m.includes(U.name);return l.jsxs("div",{className:ne("flex items-center justify-between p-2.5 rounded-xl border transition-all duration-300",J?"border-primary/50 bg-primary/5 shadow-md shadow-primary/5":"border-border/40 bg-background/20"),children:[l.jsxs("div",{className:"min-w-0 flex-1 mr-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:ne("text-[9px] font-semibold uppercase px-1.5 py-0.5 rounded font-mono",U.role==="fast"?"bg-cyan-500/15 text-cyan-400":U.role==="heavy"?"bg-amber-500/15 text-amber-400":U.role==="coder"?"bg-violet-500/15 text-violet-400":U.role==="vision"?"bg-pink-500/15 text-pink-400":"bg-muted text-muted-foreground"),children:U.role}),J&&l.jsxs("span",{className:"flex h-2 w-2 relative",children:[l.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),l.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-emerald-500"})]})]}),l.jsx("div",{className:"text-[10px] font-medium mt-1 truncate",title:U.name,children:U.name})]}),l.jsx("div",{className:"text-[9px] font-mono text-muted-foreground shrink-0",children:J?"Warm":"Bereit"})]},U.name)})})]}),l.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."})]}),l.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:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[l.jsx(ia,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Gedächtnis"})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx("textarea",{value:D,onChange:U=>O(U.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"}),l.jsxs("div",{className:"flex items-center gap-2 justify-between",children:[l.jsxs("select",{value:R,onChange:U=>N(U.target.value),className:"h-7 rounded-lg border border-border/50 bg-background/50 px-2 text-[10px] outline-none cursor-pointer",children:[l.jsx("option",{value:"stable",children:"🔵 Fakt"}),l.jsx("option",{value:"instruction",children:"📋 Regel"}),l.jsx("option",{value:"user",children:"👤 User"}),l.jsx("option",{value:"versioned",children:"🟡 Version"})]}),l.jsxs("button",{onClick:Q,disabled:!D.trim()||L,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:[l.jsx(Kd,{className:"h-3.5 w-3.5"})," Speichern"]})]})]}),l.jsxs("div",{className:"mt-3.5 space-y-1.5",children:[l.jsx("div",{className:"text-[9px] text-muted-foreground uppercase font-bold tracking-wider",children:"Zuletzt gespeichert:"}),l.jsx("div",{className:"max-h-20 overflow-y-auto space-y-1 pr-1 scrollbar-thin",children:S.length===0?l.jsx("div",{className:"text-[10px] text-muted-foreground/75 py-1",children:"Keine Einträge vorhanden."}):S.map(U=>l.jsxs("div",{className:"text-[10px] bg-background/10 border border-border/30 rounded p-1.5 flex items-start gap-1.5",children:[l.jsx("span",{className:"shrink-0 text-[8px] font-mono text-muted-foreground/80 px-1 py-0.5 rounded bg-muted/20",children:U.category}),l.jsx("span",{className:"truncate flex-1 text-muted-foreground hover:text-foreground transition-colors",title:U.content,children:U.content})]},U.id))})]})]}),l.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."})]})]})]})}function Sr({children:o,tone:u="muted"}){const i={muted:"bg-muted text-muted-foreground",primary:"bg-primary/15 text-primary",warn:"bg-amber-500/15 text-amber-500"};return l.jsx("span",{className:`rounded px-1.5 py-0.5 text-[11px] font-medium ${i[u]}`,children:o})}function $f({caps:o}){return o?l.jsxs("span",{className:"inline-flex flex-wrap gap-1",children:[o.coder&&l.jsx(Sr,{children:"💻 Code"}),o.vision&&l.jsx(Sr,{children:"👁 Bild"}),o.reasoning&&l.jsx(Sr,{children:"🧠 Reason"}),o.moe&&l.jsxs(Sr,{tone:"primary",children:["🧩 MoE",o.active_b?`·${o.active_b}b`:""]}),o.tools==="yes"&&l.jsx(Sr,{tone:"primary",children:"🛠 Tools"}),o.tools==="likely"&&l.jsx(Sr,{tone:"warn",children:"🛠 Tools?"}),o.embedding&&l.jsx(Sr,{children:"🔢 Embed"})]}):null}function Ad(o){return o?o>1024**3?`${(o/1024**3).toFixed(1)} GB`:`${(o/1024**2).toFixed(0)} MB`:""}function u0(o){if(!o)return"";const u=Math.floor(o/60);return u>0?`${u} min`:`${o} s`}function c0(){const[o,u]=h.useState([]);function i(){de("/api/jobs").then(m=>u(m.jobs||[])).catch(()=>{})}h.useEffect(()=>{i();const m=setInterval(i,2e3);return()=>clearInterval(m)},[]);async function c(m){try{await de(`/api/jobs/${m}/cancel`,{method:"POST"}),i()}catch(g){alert(`Fehler: ${g.message}`)}}const f=o.filter(m=>m.state==="running"||m.state==="queued"),p=o.filter(m=>m.state!=="running"&&m.state!=="queued").slice(-3);return f.length===0&&p.length===0?null:l.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:[l.jsx("div",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Aktive Downloads"}),f.map(m=>l.jsxs("div",{className:"space-y-1.5 p-3 rounded-xl bg-background/20 border border-border/40",children:[l.jsxs("div",{className:"flex justify-between items-center text-xs",children:[l.jsx("span",{className:"font-semibold truncate max-w-[250px]",children:m.label}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"text-muted-foreground font-mono",children:[m.progress??0,"% • ",Ad(m.done_bytes),"/",Ad(m.total_bytes),m.eta_s?` • ETA ${u0(m.eta_s)}`:""]}),l.jsx("button",{onClick:()=>c(m.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"})]})]}),l.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted",children:l.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-500",style:{width:`${m.progress??0}%`}})})]},m.id)),p.map(m=>l.jsxs("div",{className:"flex justify-between items-center text-xs text-muted-foreground px-1",children:[l.jsx("span",{className:"truncate",children:m.label}),l.jsx("span",{className:ne("font-semibold text-[10px] px-1.5 py-0.5 rounded uppercase font-mono",m.state==="done"?"bg-emerald-500/10 text-emerald-400":"bg-amber-500/10 text-amber-400"),children:m.state})]},m.id))]})}function to(o){if(!o)return"—";const u=o/1024**3;return u>=1?`${u.toFixed(1)} GB`:`${(o/1024**2).toFixed(0)} MB`}function d0(o){return o?`${Math.round(o/1024)}k`:"—"}function f0({fit:o}){const u={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"}[o.level];return l.jsxs("span",{className:ne("rounded px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider font-mono",u),children:[o.text," • ",o.req_gb," GB RAM"]})}const p0=["fast","heavy","coder","reasoning","agent","vision","scout"];function m0(){const[o,u]=h.useState([]),[i,c]=h.useState([]),[f,p]=h.useState(null),[m,g]=h.useState(null),[S,j]=h.useState(null),[b,C]=h.useState(!0),[D,O]=h.useState(""),[R,N]=h.useState(null),[L,F]=h.useState(null),[T,Q]=h.useState(!1),[q,U]=h.useState(null);function J(){Promise.all([de("/api/models"),de("/api/routing"),de("/api/connect"),de("/api/maintenance/updates")]).then(([M,G,B,w])=>{u(M.models||[]),c(M.running||[]),p(G),g(B),j(w)}).catch(M=>O(String(M))).finally(()=>C(!1))}h.useEffect(()=>{J();const M=setInterval(J,4e3);return()=>clearInterval(M)},[]);async function ae(M,G){F(null);try{await de(`/api/models/${encodeURIComponent(G)}/role`,{method:"POST",body:JSON.stringify({role:M||null})}),J()}catch(B){alert(`Fehler beim Zuweisen der Rolle: ${B}`)}}async function be(M,G){const B=prompt("Kontextlänge (Tokens):",String(G||32768));if(B)try{await de(`/api/models/${encodeURIComponent(M)}/ctx`,{method:"POST",body:JSON.stringify({ctx:parseInt(B,10)})}),J()}catch(w){alert(`Fehler beim Setzen des Kontexts: ${w}`)}}async function A(M){if(confirm(`Modell '${M}' aus der Config entfernen? (GGUF-Datei bleibt)`))try{await de(`/api/models/${encodeURIComponent(M)}`,{method:"DELETE"}),J()}catch(G){alert(`Fehler beim Löschen: ${G}`)}}async function ue(M,G,B,w){try{await de("/api/models/install",{method:"POST",body:JSON.stringify({repo:M,role:G,quant:B,jinja:w})}),alert(`Download für '${M}' gestartet! Der Fortschritt wird oben angezeigt.`)}catch(y){alert(`Fehler beim Starten des Upgrades: ${y}`)}}async function Se(M){M&&(await navigator.clipboard.writeText(M),Q(!0),setTimeout(()=>Q(!1),1500))}if(b)return l.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Initialisiere HUD Cockpit…"});if(D)return l.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 (",D,")."]});const se=o.filter(M=>i.includes(M.name)),Pe=se.reduce((M,G)=>M+(G.size_bytes||0),0),ke=16*1024**3,Oe=Pe>ke?Pe*1.2:ke,je=M=>o.find(G=>G.role===M),xe=M=>{const G=je(M);return G?i.includes(G.name):!1};return l.jsxs("div",{className:"space-y-8",children:[l.jsx("style",{children:` @keyframes flow-dash { to { stroke-dashoffset: -40; @@ -327,4 +327,4 @@ Error generating stack: `+a.message+` stroke-dasharray: 8 24; animation: flow-dash 1.2s linear infinite; } - `}),l.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:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(qi,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"VRAM / Memory Belegung"})]}),l.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["Llama Swap VRAM-Pool: ",to(Pe)," / ",to(Oe)," geladen"]})]}),l.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:se.length===0?l.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"}):se.map((M,G)=>{var y;const $=(M.size_bytes||0)/Oe*100,b=["from-teal-500 to-emerald-500","from-indigo-500 to-blue-500","from-purple-500 to-pink-500","from-cyan-500 to-sky-500"][G%4];return l.jsxs("div",{style:{width:`${$}%`},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",b),title:`${M.name} (${to(M.size_bytes)})`,children:[l.jsxs("span",{className:"text-[9px] font-bold truncate max-w-[120px] font-space tracking-wide",children:[M.role?`[${M.role}] `:"",(y=M.name.split("/").pop())==null?void 0:y.replace(".gguf","")]}),l.jsx("span",{className:"text-[8px] font-mono opacity-80",children:to(M.size_bytes)})]},M.name)})})]}),l.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:[l.jsxs("div",{children:[l.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Interactive Gateway Graph"}),l.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."})]}),l.jsxs("div",{className:"relative w-full h-[360px] border border-border/30 rounded-xl bg-black/25 overflow-hidden flex",children:[l.jsxs("svg",{className:"absolute inset-0 pointer-events-none w-full h-full",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:[l.jsxs("defs",{children:[l.jsxs("linearGradient",{id:"cyan-to-teal",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[l.jsx("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0.45"}),l.jsx("stop",{offset:"100%",stopColor:"#0d9488",stopOpacity:"0.45"})]}),l.jsxs("linearGradient",{id:"active-glow",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[l.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:"0.8"}),l.jsx("stop",{offset:"100%",stopColor:"#10b981",stopOpacity:"0.8"})]})]}),l.jsx("path",{d:"M 10 18 C 30 18, 30 50, 50 50",stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(q==="roocode"||R==="roocode")&&l.jsx("path",{d:"M 10 18 C 30 18, 30 50, 50 50",stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),l.jsx("path",{d:"M 10 50 C 30 50, 30 50, 50 50",stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(q==="cursor"||R==="cursor")&&l.jsx("path",{d:"M 10 50 C 30 50, 30 50, 50 50",stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),l.jsx("path",{d:"M 10 82 C 30 82, 30 50, 50 50",stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(q==="opencode"||R==="opencode")&&l.jsx("path",{d:"M 10 82 C 30 82, 30 50, 50 50",stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),l.jsx("path",{d:"M 50 50 C 70 50, 70 12, 90 12",stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),xe("fast")&&l.jsx("path",{d:"M 50 50 C 70 50, 70 12, 90 12",stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),l.jsx("path",{d:"M 50 50 C 70 50, 70 31, 90 31",stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),xe("heavy")&&l.jsx("path",{d:"M 50 50 C 70 50, 70 31, 90 31",stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),l.jsx("path",{d:"M 50 50 C 70 50, 70 50, 90 50",stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),xe("coder")&&l.jsx("path",{d:"M 50 50 C 70 50, 70 50, 90 50",stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),l.jsx("path",{d:"M 50 50 C 70 50, 70 69, 90 69",stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),xe("vision")&&l.jsx("path",{d:"M 50 50 C 70 50, 70 69, 90 69",stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),l.jsx("path",{d:"M 50 50 C 70 50, 70 88, 90 88",stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),xe("scout")&&l.jsx("path",{d:"M 50 50 C 70 50, 70 88, 90 88",stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"})]}),l.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-10 -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-xs font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"18%"},onMouseEnter:()=>F("roocode"),onMouseLeave:()=>F(null),onClick:()=>N(M=>M==="roocode"?null:"roocode"),children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),l.jsx("span",{children:"Roo Code"})]}),l.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-10 -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-xs font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"50%"},onMouseEnter:()=>F("cursor"),onMouseLeave:()=>F(null),onClick:()=>N(M=>M==="cursor"?null:"cursor"),children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),l.jsx("span",{children:"Cursor IDE"})]}),l.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-10 -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-xs font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"82%"},onMouseEnter:()=>F("opencode"),onMouseLeave:()=>F(null),onClick:()=>N(M=>M==="opencode"?null:"opencode"),children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),l.jsx("span",{children:"OpenCode"})]}),l.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 select-none",style:{left:"50%",top:"50%"},children:[l.jsx("div",{className:"text-[10px] uppercase font-bold text-primary font-space tracking-wide",children:"Gateway Auto"}),l.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground mt-0.5",children:["Schwelle: > ",f!=null&&f.heavy_threshold_chars?f.heavy_threshold_chars/1e3:"4","k Zeichen"]}),l.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"})]}),p0.map(M=>{var H;const G=["12%","31%","50%","69%","88%"],$=je(M),b=$?i.includes($.name):!1;if(M==="reasoning"||M==="agent")return null;const y={fast:0,heavy:1,coder:2,vision:3,scout:4}[M];return l.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",b?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":$?"border-border/60 bg-card/75":"border-dashed border-border/40 bg-background/20"),style:{left:"90%",top:G[y]},onClick:()=>B(L===M?null:M),children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:M}),b&&l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),l.jsx("div",{className:"text-[10px] font-mono font-medium truncate mt-0.5 text-foreground max-w-[150px]",children:$?(H=$.name.split("/").pop())==null?void 0:H.replace(".gguf",""):"Keine Zuweisung"}),L===M&&l.jsxs("div",{className:"absolute right-0 top-full mt-1 z-35 w-52 rounded-xl border border-border/80 bg-popover/95 backdrop-blur-md p-1.5 shadow-2xl space-y-1",children:[l.jsx("div",{className:"text-[9px] uppercase font-bold text-muted-foreground/60 px-2 py-1 select-none",children:"Modell zuweisen:"}),l.jsx("button",{onClick:()=>ae(M,""),className:"w-full text-left px-2.5 py-1.5 rounded-lg text-[10px] hover:bg-accent text-red-400 font-semibold cursor-pointer",children:"Zuweisung entfernen"}),o.map(K=>{var W;return l.jsxs("button",{onClick:()=>ae(M,K.name),className:ne("w-full text-left px-2.5 py-1.5 rounded-lg text-[10px] hover:bg-accent flex items-center justify-between font-mono cursor-pointer",K.role===M?"text-primary font-bold":"text-foreground"),children:[l.jsx("span",{className:"truncate max-w-[150px]",children:(W=K.name.split("/").pop())==null?void 0:W.replace(".gguf","")}),K.role===M&&l.jsx(Zi,{className:"h-3 w-3 shrink-0"})]},K.name)})]})]},M)}),R&&m&&l.jsxs("div",{className:"absolute z-30 md:w-96 w-[90%] rounded-2xl border border-border/80 bg-card/95 backdrop-blur-xl p-4 shadow-2xl space-y-3 flex flex-col justify-between",style:{left:"22%",top:R==="roocode"?"8%":R==="cursor"?"30%":"48%"},children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsxs("span",{className:"text-[11px] font-bold uppercase tracking-wider text-primary",children:[R==="roocode"&&"Roo Code Setup",R==="cursor"&&"Cursor Setup",R==="opencode"&&"OpenCode Setup"]}),l.jsx("button",{onClick:()=>N(null),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:l.jsx(Xd,{className:"h-3.5 w-3.5"})})]}),l.jsxs("div",{className:"text-[10px] text-muted-foreground leading-relaxed space-y-2",children:[R==="roocode"&&l.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[l.jsxs("li",{children:["Suche in VS Code nach der Erweiterung ",l.jsx("strong",{children:"Roo Code"})," und installiere sie."]}),l.jsxs("li",{children:["Wähle in den Roo Code Einstellungen: Provider: ",l.jsx("strong",{children:"OpenAI Compatible"}),"."]}),l.jsxs("li",{children:["Füge das untenstehende JSON-Snippet in die ",l.jsx("code",{children:"settings.json"})," ein."]})]}),R==="cursor"&&l.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[l.jsxs("li",{children:["Öffne Cursor Settings ➔ ",l.jsx("strong",{children:"Models"}),"."]}),l.jsxs("li",{children:["Deaktiviere Cloud-Modelle, klappe ",l.jsx("strong",{children:"OpenAI API"})," auf."]}),l.jsxs("li",{children:["Trage die Base URL unten ein und aktiviere das Modell ",l.jsx("strong",{children:"auto"}),"."]})]}),R==="opencode"&&l.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[l.jsxs("li",{children:["Öffne die ",l.jsx("code",{children:"opencode.jsonc"})," Konfigurationsdatei."]}),l.jsxs("li",{children:["Ersetze den Provider-Eintrag unter ",l.jsx("code",{children:"providers"})," mit dem Snippet unten."]})]})]}),m.tools&&l.jsxs("div",{className:"relative rounded-xl border border-border/40 bg-black/40 overflow-hidden mt-1 shrink-0",children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border/20 bg-black/20",children:[l.jsx("span",{className:"text-[8px] font-mono text-muted-foreground",children:"JSON Config"}),l.jsxs("button",{onClick:()=>Se(R==="roocode"?m.tools.cline.snippet:R==="cursor"?m.tools.cursor.snippet:m.tools.opencode.snippet),className:"text-[9px] font-semibold text-primary hover:text-primary-foreground flex items-center gap-1 cursor-pointer",children:[T?l.jsx(Zi,{className:"h-3 w-3 text-emerald-400"}):l.jsx(Gd,{className:"h-3 w-3"}),l.jsx("span",{children:T?"Kopiert":"Kopieren"})]})]}),l.jsx("pre",{className:"p-3 max-h-36 overflow-y-auto text-[9px] font-mono text-cyan-200/90 whitespace-pre scrollbar-thin select-text",children:l.jsxs("code",{children:[R==="roocode"&&m.tools.cline.snippet,R==="cursor"&&m.tools.cursor.snippet,R==="opencode"&&m.tools.opencode.snippet]})})]})]})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground px-1",children:"Installierte Modell-Bibliothek"}),l.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:o.length===0?l.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:'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):o.map(M=>{const G=i.includes(M.name),$=S==null?void 0:S.model_list.find(b=>b.role===M.role);return l.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",G?"border-primary/45 shadow-primary/5":"border-border/60"),children:[l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("h3",{className:"text-xs font-bold tracking-tight text-foreground line-clamp-2 break-all",title:M.name,children:M.name}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.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:M.quant||"GGUF"}),G&&l.jsxs("span",{className:"flex items-center gap-1 text-[9px] font-semibold text-emerald-400 uppercase tracking-wider",children:[l.jsx(la,{className:"h-3 w-3 animate-pulse"})," Warm"]}),M.role&&l.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:M.role})]})]}),l.jsx("button",{onClick:()=>A(M.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 opacity-0 group-hover:opacity-100 shrink-0 cursor-pointer",title:"Modell aus Config entfernen",children:l.jsx(Yd,{className:"h-3.5 w-3.5"})})]}),l.jsx("div",{className:"border-t border-border/30 pt-3 flex flex-wrap gap-1",children:l.jsx($f,{caps:M.capabilities})})]}),l.jsxs("div",{className:"space-y-3 pt-1",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[10px] font-mono text-muted-foreground",children:[l.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[l.jsx(qi,{className:"h-3.5 w-3.5 text-primary/80"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Größe"}),l.jsx("div",{className:"text-foreground font-semibold",children:to(M.size_bytes)})]})]}),l.jsxs("button",{onClick:()=>be(M.name,M.ctx),className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20 hover:border-primary/40 text-left transition-colors cursor-pointer",children:[l.jsx(ch,{className:"h-3.5 w-3.5 text-primary/80"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Kontext"}),l.jsx("div",{className:"text-foreground font-semibold",children:d0(M.ctx)})]})]})]}),$&&l.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:[l.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1",children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping"}),l.jsxs("span",{children:["Upgrade verfügbar: ",$.repo.split("/").pop()]})]}),l.jsxs("button",{onClick:()=>ue($.repo,M.role,M.quant||"Q4_K_M",M.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:[l.jsx(Ml,{className:"h-3 w-3"})," Smart-Swap starten"]})]})]})]},M.name)})})]})]})}function h0(){const[o,u]=h.useState(""),[i,c]=h.useState([]),[f,p]=h.useState("Q4_K_M"),[m,g]=h.useState(""),[S,j]=h.useState(""),[k,C]=h.useState([]);async function D(N){const L=N??o;if(L.trim()){g("Analysiere HuggingFace Repository...");try{const B=await de(`/api/hf/quants?repo=${encodeURIComponent(L)}`);u(B.repo),c(B.quants),B.quants.length&&p(B.quants.includes("Q4_K_M")?"Q4_K_M":B.quants[0]),g(B.quants.length?"":"Keine GGUF-Dateien in diesem Repository gefunden.")}catch(B){g(`Fehler: ${B}`)}}}async function O(){if(S.trim()){g("Durchsuche HuggingFace...");try{const N=await de(`/api/hf/search?q=${encodeURIComponent(S)}`);C(N.results),g(N.results.length?"":"Keine Ergebnisse gefunden.")}catch(N){g(`Suche fehlgeschlagen: ${N}`)}}}async function R(){if(o.trim()){g("Download-Job wird initiiert...");try{await de("/api/models/install",{method:"POST",body:JSON.stringify({repo:o,quant:f,jinja:!0})}),g(`Download gestartet: ${o} (${f}). Fortschritt wird oben angezeigt.`)}catch(N){g(`Download-Fehler: ${N}`)}}}return l.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:[l.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"HF Download & Suche"}),l.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[l.jsx("input",{value:o,onChange:N=>u(N.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"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>D(),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&&l.jsxs(l.Fragment,{children:[l.jsx("select",{value:f,onChange:N=>p(N.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(N=>l.jsx("option",{value:N,className:"bg-popover text-foreground",children:N},N))}),l.jsxs("button",{onClick:R,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:[l.jsx(Ml,{className:"h-3.5 w-3.5"})," Herunterladen"]})]})]})]}),l.jsxs("div",{className:"flex gap-2 border-t border-border/20 pt-4",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx("input",{value:S,onChange:N=>j(N.target.value),onKeyDown:N=>N.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"}),l.jsx(Qd,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),l.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"})]}),k.length>0&&l.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:k.map(N=>l.jsxs("button",{onClick:()=>{u(N.repo),C([]),j(""),D(N.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:[l.jsx("span",{className:"font-semibold truncate",children:N.repo}),l.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground flex items-center gap-1 shrink-0",children:[l.jsx(Ml,{className:"h-3 w-3"})," ",N.downloads.toLocaleString()]})]},N.repo))}),m&&l.jsx("div",{className:"text-[10px] font-medium text-primary font-mono",children:m})]})}function g0(){const[o,u]=h.useState(null),[i,c]=h.useState(""),[f,p]=h.useState(!0),[m,g]=h.useState({});h.useEffect(()=>{de("/api/discover").then(u).catch(j=>c(String(j))).finally(()=>p(!1))},[]);async function S(j,k,C,D){g(O=>({...O,[j]:"Starte..."}));try{await de("/api/models/install",{method:"POST",body:JSON.stringify({repo:j,role:k,quant:C,jinja:D})}),g(O=>({...O,[j]:"Download läuft"}))}catch{g(R=>({...R,[j]:"Fehler"}))}}return f?l.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Analysiere Hardware und suche passende GGUF-Empfehlungen…"}):i||!o?l.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 (",i,")."]}):l.jsxs("div",{className:"space-y-6",children:[l.jsx(h0,{}),l.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-3 rounded-xl",children:["Modell-Registry geladen für ",o.sys_ram_gb," GB System-RAM • ⭐ markiert die empfohlene Standard-Rolle."]}),o.categories.map(j=>l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 px-1",children:[l.jsx(Rl,{className:"h-4 w-4 text-primary"}),l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:j.title})]}),l.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:j.models.map(k=>{const C=j.recommended===k.repo;return l.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",C?"border-primary/30":"border-border/60"),children:[l.jsxs("div",{className:"space-y-3.5",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[C&&l.jsx("span",{title:"Empfohlen für diese Rolle",children:l.jsx(qd,{className:"h-3.5 w-3.5 text-amber-400 fill-amber-400"})}),l.jsx("h4",{className:"text-xs font-bold text-foreground truncate max-w-[200px]",title:k.name,children:k.name})]}),l.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:k.author})]}),l.jsx("div",{className:"text-[10px] font-mono bg-background/40 px-1.5 py-0.5 rounded border border-border/30 text-muted-foreground",children:k.quant})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-t border-border/30 pt-3",children:[l.jsx($f,{caps:k.caps}),l.jsx(f0,{fit:k.fit})]})]}),k.fit.level!=="too_tight"&&l.jsxs("button",{onClick:()=>S(k.repo,k.role,k.quant,k.caps.tools!=="no"),disabled:!!m[k.repo],className:ne("mt-2 h-8 w-full flex items-center justify-center gap-1.5 rounded-lg text-xs font-semibold transition-all cursor-pointer border border-border/60 bg-background/20 hover:border-primary/50 disabled:opacity-50",m[k.repo]&&"border-primary/40 bg-primary/5 text-primary"),children:[l.jsx(Ml,{className:ne("h-3.5 w-3.5",!m[k.repo]&&"text-primary")}),m[k.repo]||"Modell laden"]})]},k.repo)})})]},j.role))]})}function x0(){const[o,u]=h.useState("cockpit");return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[l.jsxs("div",{children:[l.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-Zentrale"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Verwalte deine Modelle und passe das Gateway-Routing live über das interaktive Cockpit an."})]}),l.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=>l.jsx("button",{onClick:()=>u(i),className:ne("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",o===i?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:i==="cockpit"?"Cockpit":"Modelle finden"},i))})]}),l.jsx(c0,{}),l.jsx("div",{className:"transition-all duration-300",children:o==="cockpit"?l.jsx(m0,{}):l.jsx(g0,{})})]})}function ir(o){return(o/1024**3).toFixed(1)}function Sl({label:o,percent:u,detail:i,icon:c}){const f=u>90?"bg-red-500 shadow-md shadow-red-500/20":u>75?"bg-amber-500 shadow-md shadow-amber-500/20":"bg-primary shadow-md shadow-primary/20";return l.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:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(c,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-foreground",children:o})]}),l.jsxs("span",{className:"text-xs font-mono font-bold text-foreground",children:[Math.round(u),"%"]})]}),l.jsx("div",{className:"w-full h-2 bg-background/40 rounded-full overflow-hidden border border-border/20",children:l.jsx("div",{className:ne("h-full transition-all duration-700 ease-out",f),style:{width:`${Math.min(u,100)}%`}})}),i&&l.jsx("div",{className:"text-[10px] font-mono text-muted-foreground/80",children:i})]})}function v0(){const[o,u]=h.useState(null),[i,c]=h.useState(""),[f,p]=h.useState(!1);function m(){de("/api/maintenance/updates").then(u).catch(()=>{})}h.useEffect(m,[]);async function g(j,k){c(`${k} wird ausgeführt...`),p(!0);try{const C=await de(j,{method:"POST"});c(C.job_id?`${k} gestartet (Job-ID: ${C.job_id})`:C.ok?`${k} erfolgreich ausgeführt.`:`Fehler: ${C.err||"Unbekannt"}`)}catch(C){c(`Fehler bei ${k}: ${C.message}`)}finally{p(!1)}}async function S(j,k){c(`Upgrade für ${j} wird gestartet...`);try{await de("/api/models/install",{method:"POST",body:JSON.stringify({repo:j,role:k,quant:"Q4_K_M",jinja:!0})}),c("Upgrade-Download gestartet.")}catch(C){c(`Upgrade fehlgeschlagen: ${C.message}`)}}return l.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:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Wartung & Updates"}),o&&l.jsxs("div",{className:"flex gap-1.5 text-[9px] font-mono font-bold uppercase tracking-wider",children:[l.jsxs("span",{className:ne("px-1.5 py-0.5 rounded",o.os?"bg-amber-500/10 text-amber-400 border border-amber-500/20":"bg-background/40 text-muted-foreground border border-border/20"),children:["OS: ",o.os]}),l.jsxs("span",{className:ne("px-1.5 py-0.5 rounded",o.engine?"bg-amber-500/10 text-amber-400 border border-amber-500/20":"bg-background/40 text-muted-foreground border border-border/20"),children:["Engine: ",o.engine?"neu":"aktuell"]}),l.jsxs("span",{className:ne("px-1.5 py-0.5 rounded",o.models?"bg-primary/10 text-primary border border-primary/20":"bg-background/40 text-muted-foreground border border-border/20"),children:["Modelle: ",o.models]})]})]}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[l.jsx("button",{onClick:()=>g("/api/maintenance/os-update","OS-Update"),disabled:f,className:"h-8 px-3 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 disabled:opacity-50",children:"OS (Apt) aktualisieren"}),l.jsx("button",{onClick:()=>g("/api/maintenance/engine-update","Engine-Update"),disabled:f,className:"h-8 px-3 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 disabled:opacity-50",children:"Engine aktualisieren"}),l.jsx("button",{onClick:()=>{confirm("Bist du sicher, dass du den Host neu starten willst?")&&g("/api/maintenance/reboot","Reboot")},disabled:f,className:"h-8 px-3 rounded-lg border border-red-500/30 bg-red-500/5 text-red-400 text-xs font-semibold hover:bg-red-500/10 transition-all cursor-pointer disabled:opacity-50",children:"Host Reboot"})]}),o&&o.model_list.length>0&&l.jsxs("div",{className:"mt-3 space-y-2 border-t border-border/20 pt-3",children:[l.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Verfügbare Modell-Updates:"}),l.jsx("div",{className:"space-y-1.5",children:o.model_list.map(j=>l.jsxs("div",{className:"flex items-center justify-between p-2.5 rounded-xl bg-background/20 border border-border/30 text-xs font-semibold",children:[l.jsxs("span",{className:"truncate",children:[l.jsx("span",{className:"text-primary uppercase font-mono text-[10px] mr-1.5",children:j.role})," ",j.repo]}),l.jsx("button",{onClick:()=>S(j.repo,j.role),className:"px-2.5 py-1 text-[10px] font-bold rounded-md bg-primary text-primary-foreground hover:opacity-90 transition-all cursor-pointer",children:"Laden"})]},j.repo))})]}),i&&l.jsx("div",{className:"text-[10px] font-mono text-primary font-medium",children:i}),l.jsxs("div",{className:"text-[9px] text-muted-foreground/60 leading-normal border-t border-border/10 pt-2 flex items-center gap-1",children:[l.jsx(Zd,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{children:"OS-Update & Reboot benötigen NOPASSWD Berechtigungen in der sudoers Datei des Hosts."})]})]})}function y0(){const[o,u]=h.useState(null),[i,c]=h.useState(null),[f,p]=h.useState(""),[m,g]=h.useState(""),[S,j]=h.useState({});function k(){de("/api/system/status").then(u).catch(O=>p(String(O))),de("/api/system/services").then(c).catch(()=>{})}h.useEffect(()=>{k();const O=setInterval(k,3e3);return()=>clearInterval(O)},[]);async function C(){g("Backup snapshotted...");try{const O=await de("/api/system/backup",{method:"POST"});g(O.ok?`Snapshot erzeugt: ${O.snapshot} (${O.files.length} Dateien)`:"Keine Änderungen zu sichern.")}catch(O){g(`Fehler: ${O.message}`)}}async function D(O){j(R=>({...R,[O]:!0}));try{const R=await de("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:O})});R.ok?alert(`Dienst ${O} wurde erfolgreich neu gestartet.`):alert(`Fehler beim Neustart: ${R.err||"Unbekannter Fehler"}`)}catch(R){alert(`Fehler: ${R.message}`)}finally{j(R=>({...R,[O]:!1}))}}return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.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"}),l.jsx("p",{className:"text-sm text-muted-foreground flex items-center gap-1",children:"Echtzeit-Ressourcen der Box, Dienst-Überwachung und Systempflege."})]}),f&&l.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,")."]}),o&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[l.jsx(Sl,{label:"CPU",percent:o.cpu.percent,detail:o.cpu.cores?`${o.cpu.cores} Cores`:void 0,icon:cr}),l.jsx(Sl,{label:"RAM",percent:o.ram.percent,detail:`${ir(o.ram.used)} / ${ir(o.ram.total)} GB`,icon:la}),o.gpu&&o.gpu.busy_percent!=null&&l.jsx(Sl,{label:"GPU",percent:o.gpu.busy_percent,detail:o.gpu.gtt_used!=null&&o.gpu.gtt_total?`${ir(o.gpu.gtt_used)} / ${ir(o.gpu.gtt_total)} GB (GTT/unified)`:o.gpu.vram_used!=null&&o.gpu.vram_total?`${ir(o.gpu.vram_used)} / ${ir(o.gpu.vram_total)} GB VRAM`:void 0,icon:cr}),o.disk&&l.jsx(Sl,{label:"Disk",percent:o.disk.percent,detail:`${ir(o.disk.used)} / ${ir(o.disk.total)} GB`,icon:qi})]}),o.temp&&(o.temp.cpu||o.temp.gpu)&&l.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:[o.temp.cpu!=null&&l.jsxs("span",{className:"flex items-center gap-1",children:["CPU-Temperatur: ",l.jsxs("span",{className:"text-foreground font-bold",children:[o.temp.cpu," °C"]})]}),o.temp.cpu!=null&&o.temp.gpu!=null&&l.jsx("span",{children:"|"}),o.temp.gpu!=null&&l.jsxs("span",{className:"flex items-center gap-1",children:["GPU-Temperatur: ",l.jsxs("span",{className:"text-foreground font-bold",children:[o.temp.gpu," °C"]})]})]})]}),i&&l.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:[l.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Homelab-Dienste"}),l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:i.services.map(O=>l.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:[l.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[l.jsx("span",{className:ne("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",O.ok?"bg-emerald-500":"bg-amber-500")}),l.jsxs("div",{className:"truncate",children:[l.jsx("div",{className:"text-xs font-bold text-foreground truncate",children:O.name}),l.jsx("div",{className:"text-[9px] text-muted-foreground/60 font-mono mt-0.5 truncate",children:O.url})]})]}),l.jsx("button",{onClick:()=>D(O.name),disabled:S[O.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:l.jsx(Ll,{className:ne("h-3.5 w-3.5",S[O.name]&&"animate-spin")})})]},O.name))}),l.jsxs("div",{className:"flex flex-wrap gap-4 border-t border-border/20 pt-4 text-[10px] font-semibold text-muted-foreground",children:[l.jsxs("a",{href:Dl(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:[l.jsx(Pl,{className:"h-3 w-3"})," Engine Dashboard (llama-swap)"]}),l.jsxs("a",{href:Dl(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:[l.jsx(Pl,{className:"h-3 w-3"})," OpenAI Gateway"]})]})]}),l.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:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"System-Backup & Snapshot"}),l.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Erzeuge einen Git-Snapshot der aktuellen Konfigurationen und des System-Zustands."})]}),l.jsx("div",{className:"flex items-center gap-3 self-start sm:self-auto shrink-0",children:l.jsxs("button",{onClick:C,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:[l.jsx(ph,{className:"h-4 w-4"})," Snapshot erstellen"]})})]}),m&&l.jsx("div",{className:"text-[10px] font-mono text-primary font-medium bg-primary/5 p-3 rounded-xl border border-primary/20",children:m}),l.jsx(v0,{})]})}function b0(){const[o,u]=h.useState(localStorage.getItem("mc_host")||"192.168.178.151"),[i,c]=h.useState(localStorage.getItem("mc_mcp_path")||""),[f,p]=h.useState(null),[m,g]=h.useState("cline"),[S,j]=h.useState(!1),[k,C]=h.useState("");h.useEffect(()=>{const L=new URLSearchParams;L.set("host",o),i&&L.set("mcp_path",i),de(`/api/connect?${L}`).then(p).catch(B=>C(String(B)))},[o,i]);function D(L){u(L),L&&localStorage.setItem("mc_host",L)}function O(L){c(L),localStorage.setItem("mc_mcp_path",L)}const R=f==null?void 0:f.tools[m];async function N(){R&&(await navigator.clipboard.writeText(R.snippet),j(!0),setTimeout(()=>j(!1),1500))}return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.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"}),l.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."})]}),l.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:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[l.jsx(sh,{className:"h-3.5 w-3.5 text-primary"})," Box LAN IP-Adresse"]}),l.jsx("input",{value:o,onChange:L=>D(L.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"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[l.jsx(lh,{className:"h-3.5 w-3.5 text-primary"})," Lokaler MCP-Scriptpfad"]}),l.jsx("input",{value:i,onChange:L=>O(L.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"})]})]}),k&&l.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: ",k]}),f&&l.jsxs("div",{className:"space-y-4",children:[l.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(f.tools).map(([L,B])=>l.jsx("button",{onClick:()=>g(L),className:ne("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",m===L?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:B.label},L))}),R&&l.jsxs("div",{className:"space-y-3",children:[R.note&&l.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:[l.jsx(ih,{className:"h-4.5 w-4.5 text-primary shrink-0 mt-0.5"}),l.jsx("span",{children:R.note})]}),l.jsxs("div",{className:"flex flex-col border border-border/60 bg-black/60 rounded-2xl overflow-hidden shadow-2xl",children:[l.jsxs("div",{className:"flex h-11 items-center justify-between px-4 border-b border-border/40 bg-black/40 shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"h-3 w-3 rounded-full bg-red-500/80 shadow-md shadow-red-500/10"}),l.jsx("span",{className:"h-3 w-3 rounded-full bg-amber-500/80 shadow-md shadow-amber-500/10"}),l.jsx("span",{className:"h-3 w-3 rounded-full bg-emerald-500/80 shadow-md shadow-emerald-500/10"})]}),l.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:[l.jsx(ua,{className:"h-3.5 w-3.5 text-primary"}),l.jsx("span",{children:m==="cline"||m==="cursor"?"config.json":"settings.json"})]}),l.jsxs("button",{onClick:N,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:[S?l.jsx(Zi,{className:"h-3.5 w-3.5 text-emerald-400"}):l.jsx(Gd,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:S?"Kopiert":"Kopieren"})]})]}),l.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:l.jsx("code",{children:R.snippet})})]})]})]})]})}const Fd=["user","instruction","stable","versioned","ephemeral"],Ki={user:{label:"User",icon:yh,color:"text-cyan-400",border:"border-cyan-500/30",bg:"bg-cyan-500/10",text:"text-cyan-400"},instruction:{label:"Regel",icon:mh,color:"text-violet-400",border:"border-violet-500/30",bg:"bg-violet-500/10",text:"text-violet-400"},stable:{label:"Fakt",icon:aa,color:"text-indigo-400",border:"border-indigo-500/30",bg:"bg-indigo-500/10",text:"text-indigo-400"},versioned:{label:"Version",icon:vh,color:"text-amber-400",border:"border-amber-500/30",bg:"bg-amber-500/10",text:"text-amber-400"},ephemeral:{label:"Temporär",icon:th,color:"text-pink-400",border:"border-pink-500/30",bg:"bg-pink-500/10",text:"text-pink-400"}},Ud={label:"Gedächtnis",icon:Hd,bg:"bg-muted/10",text:"text-muted-foreground"},w0={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 k0(){const[o,u]=h.useState([]),[i,c]=h.useState(""),[f,p]=h.useState(""),[m,g]=h.useState(""),[S,j]=h.useState("stable"),[k,C]=h.useState(""),[D,O]=h.useState(!1);function R(){const T=new URLSearchParams;f&&T.set("q",f),i&&T.set("category",i),de(`/api/memory?${T}`).then(u).catch(Q=>C(String(Q)))}h.useEffect(R,[f,i]);async function N(){m.trim()&&(await de("/api/memory",{method:"POST",body:JSON.stringify({content:m,category:S,source:"ui"})}),g(""),R())}async function L(T){await de(`/api/memory/${T}`,{method:"DELETE"}),R()}async function B(){O(!0);try{const T=await de("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!1})});if(T.duplicate_count===0){alert("Keine Dubletten gefunden — alles sauber.");return}confirm(`${T.duplicate_count} Dublette(n) in ${T.groups.length} Gruppe(n) gefunden. Entfernen?`)&&(await de("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!0})}),R())}catch(T){alert(`Fehler: ${T.message}`)}finally{O(!1)}}return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[l.jsxs("div",{children:[l.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)"}),l.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."})]}),l.jsxs("button",{onClick:B,disabled:D,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:[l.jsx(gh,{className:"h-4 w-4 text-primary animate-pulse"}),l.jsx("span",{children:"Deduplizieren"})]})]}),l.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:[l.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Neuen Eintrag anlegen"}),l.jsx("textarea",{value:m,onChange:T=>g(T.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"}),l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Kategorie"}),l.jsx("select",{value:S,onChange:T=>j(T.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:Fd.map(T=>{var Q;return l.jsx("option",{value:T,className:"bg-popover text-foreground",children:((Q=Ki[T])==null?void 0:Q.label)||T},T)})})]}),l.jsxs("button",{onClick:N,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:[l.jsx(Kd,{className:"h-4 w-4"})," Speichern"]})]})]}),l.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center gap-3",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx("input",{value:f,onChange:T=>p(T.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"}),l.jsx(Qd,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),l.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:[l.jsx("button",{onClick:()=>c(""),className:ne("h-7 px-3 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer whitespace-nowrap",i?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"),children:"Alle"}),Fd.map(T=>{const Q=Ki[T]||Ud,q=Q.icon;return l.jsxs("button",{onClick:()=>c(T),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",i===T?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[l.jsx(q,{className:"h-3 w-3"}),l.jsx("span",{children:Q.label})]},T)})]})]}),k&&l.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: ",k]}),l.jsx("div",{className:"space-y-3",children:o.length===0?l.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."}):o.map(T=>{const Q=Ki[T.category]||Ud,q=Q.icon;return l.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",w0[T.category]||"border-l-muted"),children:[l.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[l.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",Q.bg,Q.text),children:[l.jsx(q,{className:"h-3 w-3"}),l.jsx("span",{className:"hidden sm:inline",children:Q.label})]}),l.jsx("span",{className:"text-xs text-foreground leading-relaxed break-words whitespace-pre-wrap flex-1",children:T.content})]}),l.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[l.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:T.source}),l.jsx("button",{onClick:()=>L(T.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:l.jsx(Yd,{className:"h-3.5 w-3.5"})})]})]},T.id)})})]})}function Cl({label:o,ok:u,detail:i,icon:c}){return l.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-3 hover:border-primary/40 transition-all duration-300",u?"border-border/60":"border-amber-500/30"),children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:o}),l.jsx(c,{className:ne("h-4.5 w-4.5",u?"text-primary":"text-amber-500")})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:ne("h-2 w-2 rounded-full ring-2 ring-black/40",u?"bg-emerald-500 animate-pulse":"bg-amber-500")}),l.jsx("span",{className:"text-xs font-semibold text-foreground",children:u?"Bereit / Online":"Offline / Inaktiv"})]}),i&&l.jsx("div",{className:"text-[10px] font-mono text-muted-foreground truncate max-w-[200px]",title:i,children:i})]})]})}function j0(){const[o,u]=h.useState(null),[i,c]=h.useState("");return h.useEffect(()=>{const f=()=>de("/api/agent/status").then(u).catch(m=>c(String(m)));f();const p=setInterval(f,5e3);return()=>clearInterval(p)},[]),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[l.jsxs("div",{children:[l.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"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:["Hermes ist ein autonomer Agent, der im Hintergrund der Box läuft (Port ",l.jsx("code",{children:":8642"}),") und seine eigene UI besitzt."]})]}),(o==null?void 0:o.webui_url)&&l.jsxs("a",{href:Dl(o.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",o.webui_reachable?"bg-primary text-primary-foreground hover:opacity-90 shadow-primary/10":"border border-border/60 text-muted-foreground bg-background/20"),children:[l.jsx(Pl,{className:"h-4 w-4"}),l.jsx("span",{children:"Hermes WebUI öffnen"})]})]}),i&&l.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 (",i,")."]}),o&&l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[l.jsx(Cl,{label:"Agent Gateway",ok:o.gateway_reachable,detail:"Port :8642 (REST API)",icon:sa}),l.jsx(Cl,{label:"Agent WebUI",ok:o.webui_reachable,detail:"Port :8787 (Chat UI)",icon:la}),l.jsx(Cl,{label:"Aktives Gehirn",ok:o.gateway_reachable,detail:o.brain_model?`Model: ${o.brain_model}`:"Model: auto",icon:cr}),l.jsx(Cl,{label:"Verdrahtung",ok:o.has_config,detail:`Config: ${o.has_config?"✓":"—"} · Skills: ${o.has_skills?"✓":"—"} · Memory: ${o.has_memories?"✓":"—"}`,icon:bh})]}),!o.gateway_reachable&&l.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:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(aa,{className:"h-5 w-5 text-amber-500"}),l.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"Hermes-Agent Diagnostics"})]}),l.jsxs("div",{className:"text-xs text-muted-foreground space-y-3 leading-relaxed",children:[l.jsx("p",{children:"Der Hermes-Dienst ist auf der Box derzeit offline oder kann sich nicht mit dem lokalen llama-swap verbinden."}),l.jsxs("p",{children:["Stelle sicher, dass die systemd-Dienste auf der Box laufen. Du kannst den Status im ",l.jsx("strong",{children:"OS & Updates Drawer"})," prüfen und die Dienste bei Bedarf neu starten."]}),l.jsxs("div",{className:"p-3.5 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1",children:[l.jsx("div",{className:"text-muted-foreground/60",children:"# Dienste manuell auf der Box prüfen:"}),l.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-gateway"}),l.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-webui"})]}),l.jsxs("p",{children:["Weitere Einrichtungsdetails (Brain-Konfiguration, MCP-Kopplungen, SSH-Tunneling und Such-Engines) findest du in der Dokumentationsdatei:",l.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"}),"."]})]})]})]})]})}function N0(){const[o,u]=h.useState("roocode"),[i,c]=h.useState(null),[f,p]=h.useState(!1),[m,g]=h.useState(null);function S(){p(!0),de("/api/health").then(j=>{c(j),g(j.engine_reachable?"success":"partial")}).catch(()=>{c(null),g("fail")}).finally(()=>p(!1))}return h.useEffect(()=>{S()},[]),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.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"}),l.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."})]}),l.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:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:ne("h-3 w-3 rounded-full ring-2 ring-black/40",m==="success"&&"bg-emerald-500 animate-pulse",m==="partial"&&"bg-amber-500",m==="fail"&&"bg-red-500",!m&&"bg-muted")}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Lokaler Verbindungs-Check"}),l.jsxs("div",{className:"text-[10px] text-muted-foreground mt-0.5 font-mono",children:[m==="success"&&`Erfolgreich! Dein PC hat Zugriff auf das Box-Gateway (v${(i==null?void 0:i.version)||""}).`,m==="partial"&&"Gateway erreichbar, aber die llama-cpp-Engine ist offline.",m==="fail"&&"Verbindung fehlgeschlagen. Ist die Box im selben LAN-Netzwerk?",!m&&"Verbindung wird geprüft..."]})]})]}),l.jsxs("button",{onClick:S,disabled:f,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:[l.jsx(Ll,{className:ne("h-3.5 w-3.5",f&&"animate-spin")}),l.jsx("span",{children:"Testen"})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 px-1",children:[l.jsx(Hd,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Wie funktioniert mein Stack?"})]}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[l.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(cr,{className:"h-4 w-4 text-cyan-400"}),l.jsx("h3",{className:"text-xs font-bold text-foreground",children:"1. Die Zentrale"})]}),l.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."})]}),l.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Rl,{className:"h-4 w-4 text-violet-400"}),l.jsx("h3",{className:"text-xs font-bold text-foreground",children:"2. Modell-Zentrale"})]}),l.jsxs("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:["Deine GGUF-Datenbank. Gesteuert von ",l.jsx("strong",{children:"llama-swap"}),". Lädt dein schnelles Alltags-Hirn (`fast`) oder dein schweres Logik-Hirn (`heavy`) vollautomatisch im VRAM."]})]}),l.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(ia,{className:"h-4 w-4 text-indigo-400"}),l.jsx("h3",{className:"text-xs font-bold text-foreground",children:"3. Das Gedächtnis"})]}),l.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."})]})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-2 px-1",children:[l.jsx(rh,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Vibe Coding auf dem PC einrichten"})]}),l.jsxs("div",{className:"flex gap-1.5 bg-card/20 p-1 border border-border/40 rounded-xl max-w-fit",children:[l.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",o==="roocode"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:[l.jsx(qd,{className:"h-3.5 w-3.5 fill-amber-400/20"}),"Roo Code (VS Code)"]}),l.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",o==="cursor"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:"Cursor IDE"}),l.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",o==="opencode"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:"OpenCode Desktop"})]}),l.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:[o==="roocode"&&l.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Roo Code Kopplung (Empfohlene Open-Source-Erweiterung)"}),l.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."})]}),l.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[l.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"]}),l.jsxs("p",{className:"pl-6",children:["Suche in VS Code nach der Erweiterung ",l.jsx("strong",{children:"Roo Code"})," und installiere sie."]})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[l.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"]}),l.jsx("p",{className:"pl-6",children:"Klicke auf das Roo-Code-Symbol in der Sidebar, öffne die Einstellungen (Zahnrad) und stelle folgendes ein:"}),l.jsx("div",{className:"pl-6 pt-1",children:l.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground/60",children:"API Provider:"})," OpenAI Compatible"]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground/60",children:"Base URL:"})," http://192.168.178.151:9001/v1"]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground/60",children:"API Key:"})," ",l.jsx("span",{className:"italic text-muted-foreground/50",children:'beliebig (z.B. "local")'})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground/60",children:"Model ID:"})," auto"]})]})})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[l.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)"]}),l.jsxs("p",{className:"pl-6",children:["Damit Roo Code auf deinen ",l.jsx("strong",{children:"Gedächtnis-Pool"})," zugreifen kann, kopiere die MCP-Konfiguration aus dem Reiter ",l.jsx("strong",{children:"Verbinden"})," und füge sie in deine lokale Roo-Code-Konfigurationsdatei ein."]})]})]})]}),o==="cursor"&&l.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Cursor IDE Kopplung (Proprietäre All-in-One IDE)"}),l.jsx("p",{children:"Cursor ist ein polierter, extrem schneller VS-Code-Fork mit hervorragenden, tief integrierten Autovervollständigungen (Tab-Completions)."})]}),l.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[l.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"]}),l.jsxs("p",{className:"pl-6",children:["Öffne Cursor, klicke oben rechts auf das Zahnrad (Settings) und navigiere zu ",l.jsx("strong",{children:"Models"}),"."]})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[l.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"]}),l.jsxs("p",{className:"pl-6",children:["Deaktiviere die Standard-Cloudmodelle, klappe den Bereich ",l.jsx("strong",{children:"OpenAI API"})," auf und konfiguriere:"]}),l.jsx("div",{className:"pl-6 pt-1",children:l.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground/60",children:"Override Base URL:"})," http://192.168.178.151:9001/v1"]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground/60",children:"API Key:"})," ",l.jsx("span",{className:"italic text-muted-foreground/50",children:'beliebig (z.B. "local")'})]})]})})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[l.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"]}),l.jsxs("p",{className:"pl-6",children:["Trage in der Modell-Liste ein neues Modell mit dem Namen ",l.jsx("strong",{children:"auto"})," ein und wähle es als aktives Modell aus. Cursor leitet ab jetzt alle deine Anfragen an die Box weiter."]})]})]})]}),o==="opencode"&&l.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("h3",{className:"text-sm font-bold text-foreground",children:"OpenCode Desktop Kopplung (Open-Source Vibe-Coding-App)"}),l.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."})]}),l.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[l.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"]}),l.jsx("p",{className:"pl-6",children:"Lade die Desktop-Anwendung von der offiziellen Website (opencode.ai) herunter und starte sie."})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[l.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"]}),l.jsx("p",{className:"pl-6",children:"Gehe in den Bereich Einstellungen ➔ Provider, deaktiviere die Cloud-Voreinstellungen und trage deinen lokalen Server ein:"}),l.jsx("div",{className:"pl-6 pt-1",children:l.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground/60",children:"Base URL:"})," http://192.168.178.151:9001/v1"]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground/60",children:"Model:"})," auto"]})]})})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[l.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"]}),l.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.'})]})]})]})]})]}),l.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:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ua,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Was tun, wenn das Coden hakt?"})]}),l.jsxs("ul",{className:"text-[11px] text-muted-foreground space-y-2 list-disc pl-4 leading-relaxed",children:[l.jsxs("li",{children:[l.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."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Modell antwortet nicht?"})," Schaue unter ",l.jsx("strong",{children:"Diagnose"}),", ob der Dienst `llama-swap` aktiv (grün) ist. Wenn nicht, klicke daneben auf ",l.jsx("strong",{children:"Restart"}),"."]}),l.jsxs("li",{children:[l.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."]})]})]})]})}function S0({title:o,hint:u}){return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold",children:o}),l.jsx("p",{className:"text-sm text-muted-foreground",children:u})]}),l.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:[l.jsx(oh,{className:"h-8 w-8 text-muted-foreground"}),l.jsx("div",{className:"text-sm text-muted-foreground",children:"Kommt in einer späteren Phase."})]})]})}const C0=[{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 Qi(o){return o==null?"":o>1024**3?`${(o/1024**3).toFixed(2)} GB`:`${(o/1024**2).toFixed(1)} MB`}function E0({open:o,onClose:u}){const[i,c]=h.useState(null),[f,p]=h.useState([]),[m,g]=h.useState("llama-swap"),[S,j]=h.useState(""),[k,C]=h.useState(!1),[D,O]=h.useState({}),[R,N]=h.useState("maintenance"),L=h.useRef(null);function B(){de("/api/maintenance/updates").then(c).catch(A=>console.error("Error loading updates",A))}function T(){de("/api/jobs").then(A=>p(A.jobs||[])).catch(A=>console.error("Error loading jobs",A))}function Q(A){C(!0),de(`/api/maintenance/logs?service=${A}&lines=150`).then(ue=>{ue.ok?j(ue.text):j(`Fehler beim Laden der Logs: ${ue.err||"Unbekannter Fehler"}`)}).catch(ue=>j(`Fehler: ${ue.message}`)).finally(()=>{C(!1),setTimeout(()=>{L.current&&(L.current.scrollTop=L.current.scrollHeight)},50)})}h.useEffect(()=>{if(!o)return;B(),T();const A=setInterval(()=>{T(),B()},3e3);return()=>clearInterval(A)},[o]),h.useEffect(()=>{!o||R!=="logs"||Q(m)},[o,R,m]);async function q(){try{await de("/api/maintenance/os-update",{method:"POST"}),T(),N("maintenance")}catch(A){alert(`Fehler beim Starten des OS-Updates: ${A.message}`)}}async function F(){try{await de("/api/maintenance/engine-update",{method:"POST"}),T(),N("maintenance")}catch(A){alert(`Fehler: ${A.message}`)}}async function J(){if(confirm("Bist du sicher, dass du das gesamte Host-System neu starten willst?"))try{await de("/api/maintenance/reboot",{method:"POST"}),alert("Reboot ausgelöst. System startet neu..."),u()}catch(A){alert(`Fehler: ${A.message}`)}}async function ae(A){O(ue=>({...ue,[A]:!0}));try{const ue=await de("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:A})});ue.ok?(alert(`Dienst ${A} wurde erfolgreich neu gestartet.`),R==="logs"&&m===A&&Q(A)):alert(`Fehler beim Neustart: ${ue.err||"Unbekannter Fehler"}`)}catch(ue){alert(`Fehler: ${ue.message}`)}finally{O(ue=>({...ue,[A]:!1}))}}async function be(A){try{await de(`/api/jobs/${A}/cancel`,{method:"POST"}),T()}catch(ue){alert(`Fehler beim Abbrechen: ${ue.message}`)}}return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:ne("fixed inset-0 bg-black/60 backdrop-blur-sm z-50 transition-opacity duration-300",o?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),onClick:u}),l.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",o?"translate-x-0":"translate-x-full"),children:[l.jsxs("div",{className:"flex h-16 shrink-0 items-center justify-between border-b border-border/40 px-6",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(cr,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase font-space",children:"OS-Zentrale & Pflege"})]}),l.jsx("button",{onClick:u,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:l.jsx(Xd,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex border-b border-border/40 px-6",children:[l.jsx("button",{onClick:()=>N("maintenance"),className:ne("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",R==="maintenance"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Wartung"}),l.jsx("button",{onClick:()=>N("logs"),className:ne("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",R==="logs"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Logs"})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:R==="maintenance"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Wartungsaktionen"}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("button",{onClick:q,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:[l.jsx(aa,{className:"h-5 w-5 text-cyan-400 mb-1 group-hover:scale-105 transition-transform"}),l.jsx("span",{className:"text-xs font-semibold",children:"OS Update (apt)"}),l.jsx("span",{className:"text-[10px] text-muted-foreground",children:i!=null&&i.os?`${i.os} Updates verfügbar`:"Auf neuestem Stand"})]}),l.jsxs("button",{onClick:F,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:[l.jsx(hh,{className:"h-5 w-5 text-violet-400 mb-1 group-hover:scale-105 transition-transform"}),l.jsx("span",{className:"text-xs font-semibold",children:"Engine Update"}),l.jsx("span",{className:"text-[10px] text-muted-foreground",children:i!=null&&i.engine?"Update verfügbar":"Auf neuestem Stand"})]})]}),l.jsxs("button",{onClick:J,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:[l.jsx(fh,{className:"h-4.5 w-4.5"}),l.jsxs("div",{children:[l.jsx("div",{children:"Host-System neu starten (Reboot)"}),l.jsx("div",{className:"text-[10px] text-red-400/80 font-normal",children:"Startet das gesamte Betriebssystem des Homelabs neu"})]})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Hintergrund-Aufgaben"}),l.jsxs("span",{className:"text-[10px] font-mono bg-primary/10 text-primary px-1.5 py-0.5 rounded-full",children:[f.filter(A=>A.state==="running"||A.state==="queued").length," Aktiv"]})]}),l.jsx("div",{className:"space-y-3",children:f.length===0?l.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(A=>{const ue=A.state==="running"||A.state==="queued";return l.jsxs("div",{className:ne("p-3 rounded-xl border transition-all duration-300",ue?"border-primary/40 bg-primary/5 shadow-md shadow-primary/5":"border-border/40 bg-background/20 opacity-80"),children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"text-xs font-semibold flex items-center gap-1.5",children:[ue&&l.jsxs("span",{className:"flex h-2 w-2 relative",children:[l.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),l.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),A.label]}),l.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground uppercase flex items-center gap-2",children:[l.jsxs("span",{children:["ID: ",A.id]}),l.jsx("span",{children:"•"}),l.jsx("span",{className:ne(A.state==="done"&&"text-emerald-400",A.state==="failed"&&"text-red-400",A.state==="running"&&"text-primary",A.state==="queued"&&"text-amber-400",A.state==="canceled"&&"text-muted-foreground"),children:A.state})]})]}),ue&&l.jsx("button",{onClick:()=>be(A.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"})]}),A.state==="running"&&l.jsxs("div",{className:"mt-3 space-y-1",children:[l.jsx("div",{className:"w-full h-1.5 bg-muted rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full bg-primary transition-all duration-500",style:{width:`${A.progress??0}%`}})}),l.jsxs("div",{className:"flex justify-between items-center text-[9px] font-mono text-muted-foreground",children:[l.jsxs("span",{children:[A.progress??0,"%"]}),A.done_bytes!=null&&A.total_bytes!=null&&l.jsxs("span",{children:[Qi(A.done_bytes)," / ",Qi(A.total_bytes),A.rate_bps!=null&&` (${Qi(A.rate_bps)}/s)`]}),A.eta_s!=null&&l.jsxs("span",{children:["ETA: ",A.eta_s,"s"]})]})]})]},A.id)})})]})]}):l.jsxs("div",{className:"flex flex-col h-full space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("select",{value:m,onChange:A=>g(A.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:C0.map(A=>l.jsxs("option",{value:A.id,children:[A.label," (",A.type==="system"?"systemd-root":"user",")"]},A.id))}),l.jsxs("button",{onClick:()=>ae(m),disabled:D[m],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:[l.jsx(Ll,{className:ne("h-3.5 w-3.5",D[m]&&"animate-spin")}),"Restart"]})]}),l.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:[l.jsxs("div",{className:"flex h-9 items-center justify-between px-4 border-b border-border/40 bg-black/30 shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground",children:[l.jsx(ua,{className:"h-3 w-3 text-primary"}),l.jsxs("span",{children:["stdout/stderr - ",m]})]}),l.jsx("button",{onClick:()=>Q(m),disabled:k,className:"text-muted-foreground hover:text-foreground transition-colors",children:l.jsx(Ll,{className:ne("h-3 w-3",k&&"animate-spin")})})]}),l.jsx("pre",{ref:L,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:k&&!S?l.jsx("span",{className:"text-muted-foreground",children:"Lade Logs..."}):S||l.jsx("span",{className:"text-muted-foreground",children:"Keine Logeinträge vorhanden."})})]})]})})]})]})}function _0(){const[o,u]=h.useState("dashboard"),[i,c]=h.useState(null),[f,p]=h.useState(()=>localStorage.getItem("mc_theme")!=="light"),[m,g]=h.useState(()=>localStorage.getItem("mc_sidebar_collapsed")==="true"),[S,j]=h.useState(null),[k,C]=h.useState(!1);h.useEffect(()=>{const R=()=>de("/api/health").then(c).catch(()=>c(null));R();const N=setInterval(R,1e4);return()=>clearInterval(N)},[]),h.useEffect(()=>{const R=()=>de("/api/maintenance/updates").then(j).catch(()=>{});R();const N=setInterval(R,2e4);return()=>clearInterval(N)},[]),h.useEffect(()=>{document.documentElement.classList.toggle("dark",f),localStorage.setItem("mc_theme",f?"dark":"light")},[f]),h.useEffect(()=>{const R=()=>C(!0);return window.addEventListener("open-system-drawer",R),()=>window.removeEventListener("open-system-drawer",R)},[]);const D=Yi.find(R=>R.id===o),O=S?S.os+S.engine+S.models:0;return l.jsxs("div",{className:"flex h-full relative",children:[l.jsxs("div",{className:"fixed inset-0 -z-50 pointer-events-none overflow-hidden bg-[hsl(224,30%,6%)]",children:[l.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]"}),l.jsx("div",{className:"absolute top-[-10%] left-[-10%] h-[50%] w-[50%] rounded-full bg-teal-500/15 blur-[160px]"}),l.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] h-[50%] w-[50%] rounded-full bg-purple-500/15 blur-[160px]"}),l.jsx("div",{className:"absolute top-[30%] right-[20%] h-[40%] w-[40%] rounded-full bg-indigo-500/10 blur-[140px]"})]}),l.jsx(_x,{onNavigate:u}),l.jsx(E0,{open:k,onClose:()=>C(!1)}),l.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",m?"w-16":"w-60"),children:[l.jsxs("div",{className:ne("flex items-center py-4 border-b border-border/40 shrink-0",m?"flex-col gap-3 px-2":"justify-between px-5"),children:[l.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[l.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20 shrink-0"}),!m&&l.jsxs("div",{className:"leading-tight",children:[l.jsx("div",{className:"text-sm font-semibold tracking-wide font-space",children:"Mission Control"}),l.jsx("div",{className:"text-xs text-muted-foreground",children:"2.0"})]})]}),l.jsx("button",{onClick:()=>{g(R=>{const N=!R;return localStorage.setItem("mc_sidebar_collapsed",N.toString()),N})},className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:m?"Maximieren":"Minimieren",children:m?l.jsx(Jm,{className:"h-4 w-4"}):l.jsx(Xm,{className:"h-4 w-4"})})]}),l.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4 overflow-y-auto",children:Yi.map(R=>l.jsxs("button",{onClick:()=>u(R.id),className:ne("flex w-full items-center rounded-md text-sm transition-all cursor-pointer",m?"justify-center p-2.5":"gap-3 px-3 py-2",o===R.id?"bg-primary/15 text-primary shadow-sm shadow-primary/5":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),title:m?R.label:void 0,children:[l.jsx(R.icon,{className:"h-4.5 w-4.5 shrink-0"}),!m&&l.jsx("span",{className:"truncate",children:R.label})]},R.id))}),l.jsx("div",{className:ne("py-3 text-xs text-muted-foreground border-t border-border/40 shrink-0",m?"px-2 text-center":"px-5"),children:m?l.jsx("div",{className:"flex justify-center",children:l.jsx("span",{className:ne("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",i?i.engine_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500":"bg-red-500"),title:i?`Engine ${i.engine_reachable?"online":"offline"}`:"Backend offline"})}):i?l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:ne("h-2 w-2 rounded-full",i.engine_reachable?"bg-emerald-500":"bg-amber-500")}),l.jsxs("span",{className:"truncate",children:["Engine ",i.engine_reachable?"online":"offline"," · v",i.version]})]}):l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"})," ",l.jsx("span",{className:"truncate",children:"Backend offline"})]})})]}),l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[l.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:[l.jsx("div",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase font-sans",children:D.hint}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{onClick:()=>C(!0),className:"relative flex h-8 items-center rounded-md border border-border/40 bg-background/40 px-3 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground gap-1.5 transition-all cursor-pointer font-semibold",title:"System-Pflege öffnen",children:[l.jsx(cr,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:"OS & Updates"}),O>0&&l.jsxs("span",{className:"flex h-1.5 w-1.5 relative",children:[l.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-amber-400 opacity-75"}),l.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-amber-500"})]})]}),l.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"}),l.jsx("button",{onClick:()=>p(R=>!R),className:"flex h-8 w-8 items-center justify-center rounded-md border border-border/40 bg-background/40 text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer",title:"Hell/Dunkel",children:f?l.jsx(xh,{className:"h-3.5 w-3.5"}):l.jsx(uh,{className:"h-3.5 w-3.5"})}),l.jsxs("button",{onClick:()=>{const R=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(R)},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:[l.jsx(nh,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:"Suchen"}),l.jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[9px]",children:"⌘K"})]})]})]}),l.jsxs("main",{className:"flex-1 overflow-y-auto p-6 scrollbar-thin",children:[o==="dashboard"&&l.jsx(a0,{}),o==="models"&&l.jsx(x0,{}),o==="system"&&l.jsx(y0,{}),o==="connect"&&l.jsx(b0,{}),o==="memory"&&l.jsx(k0,{}),o==="agent"&&l.jsx(j0,{}),o==="guide"&&l.jsx(N0,{}),!["dashboard","models","system","connect","memory","agent","guide"].includes(o)&&l.jsx(S0,{title:D.label,hint:D.hint})]})]})]})}Km.createRoot(document.getElementById("root")).render(l.jsx(Bd.StrictMode,{children:l.jsx(_0,{})})); + `}),l.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:[l.jsxs("div",{className:"flex justify-between items-center",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(qi,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"VRAM / Memory Belegung"})]}),l.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["Llama Swap VRAM-Pool: ",to(Pe)," / ",to(Oe)," geladen"]})]}),l.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:se.length===0?l.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"}):se.map((M,G)=>{var y;const B=(M.size_bytes||0)/Oe*100,w=["from-teal-500 to-emerald-500","from-indigo-500 to-blue-500","from-purple-500 to-pink-500","from-cyan-500 to-sky-500"][G%4];return l.jsxs("div",{style:{width:`${B}%`},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",w),title:`${M.name} (${to(M.size_bytes)})`,children:[l.jsxs("span",{className:"text-[9px] font-bold truncate max-w-[120px] font-space tracking-wide",children:[M.role?`[${M.role}] `:"",(y=M.name.split("/").pop())==null?void 0:y.replace(".gguf","")]}),l.jsx("span",{className:"text-[8px] font-mono opacity-80",children:to(M.size_bytes)})]},M.name)})})]}),l.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:[l.jsxs("div",{children:[l.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Interactive Gateway Graph"}),l.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."})]}),l.jsxs("div",{className:"relative w-full h-[360px] border border-border/30 rounded-xl bg-black/25 overflow-hidden flex",children:[l.jsxs("svg",{className:"absolute inset-0 pointer-events-none w-full h-full",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:[l.jsxs("defs",{children:[l.jsxs("linearGradient",{id:"cyan-to-teal",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[l.jsx("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0.45"}),l.jsx("stop",{offset:"100%",stopColor:"#0d9488",stopOpacity:"0.45"})]}),l.jsxs("linearGradient",{id:"active-glow",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[l.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:"0.8"}),l.jsx("stop",{offset:"100%",stopColor:"#10b981",stopOpacity:"0.8"})]})]}),l.jsx("path",{d:"M 10 18 C 30 18, 30 50, 50 50",stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(q==="roocode"||R==="roocode")&&l.jsx("path",{d:"M 10 18 C 30 18, 30 50, 50 50",stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),l.jsx("path",{d:"M 10 50 C 30 50, 30 50, 50 50",stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(q==="cursor"||R==="cursor")&&l.jsx("path",{d:"M 10 50 C 30 50, 30 50, 50 50",stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),l.jsx("path",{d:"M 10 82 C 30 82, 30 50, 50 50",stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(q==="opencode"||R==="opencode")&&l.jsx("path",{d:"M 10 82 C 30 82, 30 50, 50 50",stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),l.jsx("path",{d:"M 50 50 C 70 50, 70 12, 90 12",stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),xe("fast")&&l.jsx("path",{d:"M 50 50 C 70 50, 70 12, 90 12",stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),l.jsx("path",{d:"M 50 50 C 70 50, 70 31, 90 31",stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),xe("heavy")&&l.jsx("path",{d:"M 50 50 C 70 50, 70 31, 90 31",stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),l.jsx("path",{d:"M 50 50 C 70 50, 70 50, 90 50",stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),xe("coder")&&l.jsx("path",{d:"M 50 50 C 70 50, 70 50, 90 50",stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),l.jsx("path",{d:"M 50 50 C 70 50, 70 69, 90 69",stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),xe("vision")&&l.jsx("path",{d:"M 50 50 C 70 50, 70 69, 90 69",stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"}),l.jsx("path",{d:"M 50 50 C 70 50, 70 88, 90 88",stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),xe("scout")&&l.jsx("path",{d:"M 50 50 C 70 50, 70 88, 90 88",stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"animate-flow-cyan"})]}),l.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-10 -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-xs font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"18%"},onMouseEnter:()=>U("roocode"),onMouseLeave:()=>U(null),onClick:()=>N(M=>M==="roocode"?null:"roocode"),children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),l.jsx("span",{children:"Roo Code"})]}),l.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-10 -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-xs font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"50%"},onMouseEnter:()=>U("cursor"),onMouseLeave:()=>U(null),onClick:()=>N(M=>M==="cursor"?null:"cursor"),children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),l.jsx("span",{children:"Cursor IDE"})]}),l.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-10 -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-xs font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"82%"},onMouseEnter:()=>U("opencode"),onMouseLeave:()=>U(null),onClick:()=>N(M=>M==="opencode"?null:"opencode"),children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),l.jsx("span",{children:"OpenCode"})]}),l.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 select-none",style:{left:"50%",top:"50%"},children:[l.jsx("div",{className:"text-[10px] uppercase font-bold text-primary font-space tracking-wide",children:"Gateway Auto"}),l.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground mt-0.5",children:["Schwelle: > ",f!=null&&f.heavy_threshold_chars?f.heavy_threshold_chars/1e3:"4","k Zeichen"]}),l.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"})]}),p0.map(M=>{var H;const G=["12%","31%","50%","69%","88%"],B=je(M),w=B?i.includes(B.name):!1;if(M==="reasoning"||M==="agent")return null;const y={fast:0,heavy:1,coder:2,vision:3,scout:4}[M];return l.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",w?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":B?"border-border/60 bg-card/75":"border-dashed border-border/40 bg-background/20"),style:{left:"90%",top:G[y]},onClick:()=>F(L===M?null:M),children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:M}),w&&l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),l.jsx("div",{className:"text-[10px] font-mono font-medium truncate mt-0.5 text-foreground max-w-[150px]",children:B?(H=B.name.split("/").pop())==null?void 0:H.replace(".gguf",""):"Keine Zuweisung"}),L===M&&l.jsxs("div",{className:"absolute right-0 top-full mt-1 z-35 w-52 rounded-xl border border-border/80 bg-popover/95 backdrop-blur-md p-1.5 shadow-2xl space-y-1",children:[l.jsx("div",{className:"text-[9px] uppercase font-bold text-muted-foreground/60 px-2 py-1 select-none",children:"Modell zuweisen:"}),l.jsx("button",{onClick:()=>ae(M,""),className:"w-full text-left px-2.5 py-1.5 rounded-lg text-[10px] hover:bg-accent text-red-400 font-semibold cursor-pointer",children:"Zuweisung entfernen"}),o.map(K=>{var W;return l.jsxs("button",{onClick:()=>ae(M,K.name),className:ne("w-full text-left px-2.5 py-1.5 rounded-lg text-[10px] hover:bg-accent flex items-center justify-between font-mono cursor-pointer",K.role===M?"text-primary font-bold":"text-foreground"),children:[l.jsx("span",{className:"truncate max-w-[150px]",children:(W=K.name.split("/").pop())==null?void 0:W.replace(".gguf","")}),K.role===M&&l.jsx(Zi,{className:"h-3 w-3 shrink-0"})]},K.name)})]})]},M)}),R&&m&&l.jsxs("div",{className:"absolute z-30 md:w-96 w-[90%] rounded-2xl border border-border/80 bg-card/95 backdrop-blur-xl p-4 shadow-2xl space-y-3 flex flex-col justify-between",style:{left:"22%",top:R==="roocode"?"8%":R==="cursor"?"30%":"48%"},children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsxs("span",{className:"text-[11px] font-bold uppercase tracking-wider text-primary",children:[R==="roocode"&&"Roo Code Setup",R==="cursor"&&"Cursor Setup",R==="opencode"&&"OpenCode Setup"]}),l.jsx("button",{onClick:()=>N(null),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:l.jsx(Xd,{className:"h-3.5 w-3.5"})})]}),l.jsxs("div",{className:"text-[10px] text-muted-foreground leading-relaxed space-y-2",children:[R==="roocode"&&l.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[l.jsxs("li",{children:["Suche in VS Code nach der Erweiterung ",l.jsx("strong",{children:"Roo Code"})," und installiere sie."]}),l.jsxs("li",{children:["Wähle in den Roo Code Einstellungen: Provider: ",l.jsx("strong",{children:"OpenAI Compatible"}),"."]}),l.jsxs("li",{children:["Füge das untenstehende JSON-Snippet in die ",l.jsx("code",{children:"settings.json"})," ein."]})]}),R==="cursor"&&l.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[l.jsxs("li",{children:["Öffne Cursor Settings ➔ ",l.jsx("strong",{children:"Models"}),"."]}),l.jsxs("li",{children:["Deaktiviere Cloud-Modelle, klappe ",l.jsx("strong",{children:"OpenAI API"})," auf."]}),l.jsxs("li",{children:["Trage die Base URL unten ein und aktiviere das Modell ",l.jsx("strong",{children:"auto"}),"."]})]}),R==="opencode"&&l.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[l.jsxs("li",{children:["Öffne die ",l.jsx("code",{children:"opencode.jsonc"})," Konfigurationsdatei."]}),l.jsxs("li",{children:["Ersetze den Provider-Eintrag unter ",l.jsx("code",{children:"providers"})," mit dem Snippet unten."]})]})]}),m.tools&&l.jsxs("div",{className:"relative rounded-xl border border-border/40 bg-black/40 overflow-hidden mt-1 shrink-0",children:[l.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border/20 bg-black/20",children:[l.jsx("span",{className:"text-[8px] font-mono text-muted-foreground",children:"JSON Config"}),l.jsxs("button",{onClick:()=>Se(R==="roocode"?m.tools.cline.snippet:R==="cursor"?m.tools.cursor.snippet:m.tools.opencode.snippet),className:"text-[9px] font-semibold text-primary hover:text-primary-foreground flex items-center gap-1 cursor-pointer",children:[T?l.jsx(Zi,{className:"h-3 w-3 text-emerald-400"}):l.jsx(Gd,{className:"h-3 w-3"}),l.jsx("span",{children:T?"Kopiert":"Kopieren"})]})]}),l.jsx("pre",{className:"p-3 max-h-36 overflow-y-auto text-[9px] font-mono text-cyan-200/90 whitespace-pre scrollbar-thin select-text",children:l.jsxs("code",{children:[R==="roocode"&&m.tools.cline.snippet,R==="cursor"&&m.tools.cursor.snippet,R==="opencode"&&m.tools.opencode.snippet]})})]})]})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground px-1",children:"Installierte Modell-Bibliothek"}),l.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:o.length===0?l.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:'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):o.map(M=>{const G=i.includes(M.name),B=S==null?void 0:S.model_list.find(w=>w.role===M.role);return l.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",G?"border-primary/45 shadow-primary/5":"border-border/60"),children:[l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("h3",{className:"text-xs font-bold tracking-tight text-foreground line-clamp-2 break-all",title:M.name,children:M.name}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.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:M.quant||"GGUF"}),G&&l.jsxs("span",{className:"flex items-center gap-1 text-[9px] font-semibold text-emerald-400 uppercase tracking-wider",children:[l.jsx(la,{className:"h-3 w-3 animate-pulse"})," Warm"]}),M.role&&l.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:M.role})]})]}),l.jsx("button",{onClick:()=>A(M.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 opacity-0 group-hover:opacity-100 shrink-0 cursor-pointer",title:"Modell aus Config entfernen",children:l.jsx(Yd,{className:"h-3.5 w-3.5"})})]}),l.jsx("div",{className:"border-t border-border/30 pt-3 flex flex-wrap gap-1",children:l.jsx($f,{caps:M.capabilities})})]}),l.jsxs("div",{className:"space-y-3 pt-1",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[10px] font-mono text-muted-foreground",children:[l.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[l.jsx(qi,{className:"h-3.5 w-3.5 text-primary/80"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Größe"}),l.jsx("div",{className:"text-foreground font-semibold",children:to(M.size_bytes)})]})]}),l.jsxs("button",{onClick:()=>be(M.name,M.ctx),className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20 hover:border-primary/40 text-left transition-colors cursor-pointer",children:[l.jsx(ch,{className:"h-3.5 w-3.5 text-primary/80"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Kontext"}),l.jsx("div",{className:"text-foreground font-semibold",children:d0(M.ctx)})]})]})]}),B&&l.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:[l.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1",children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping"}),l.jsxs("span",{children:["Upgrade verfügbar: ",B.repo.split("/").pop()]})]}),l.jsxs("button",{onClick:()=>ue(B.repo,M.role,M.quant||"Q4_K_M",M.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:[l.jsx(Ml,{className:"h-3 w-3"})," Smart-Swap starten"]})]})]})]},M.name)})})]})]})}function h0(){const[o,u]=h.useState(""),[i,c]=h.useState([]),[f,p]=h.useState("Q4_K_M"),[m,g]=h.useState(""),[S,j]=h.useState(""),[b,C]=h.useState([]);async function D(N){const L=N??o;if(L.trim()){g("Analysiere HuggingFace Repository...");try{const F=await de(`/api/hf/quants?repo=${encodeURIComponent(L)}`);u(F.repo),c(F.quants),F.quants.length&&p(F.quants.includes("Q4_K_M")?"Q4_K_M":F.quants[0]),g(F.quants.length?"":"Keine GGUF-Dateien in diesem Repository gefunden.")}catch(F){g(`Fehler: ${F}`)}}}async function O(){if(S.trim()){g("Durchsuche HuggingFace...");try{const N=await de(`/api/hf/search?q=${encodeURIComponent(S)}`);C(N.results),g(N.results.length?"":"Keine Ergebnisse gefunden.")}catch(N){g(`Suche fehlgeschlagen: ${N}`)}}}async function R(){if(o.trim()){g("Download-Job wird initiiert...");try{await de("/api/models/install",{method:"POST",body:JSON.stringify({repo:o,quant:f,jinja:!0})}),g(`Download gestartet: ${o} (${f}). Fortschritt wird oben angezeigt.`)}catch(N){g(`Download-Fehler: ${N}`)}}}return l.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:[l.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"HF Download & Suche"}),l.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[l.jsx("input",{value:o,onChange:N=>u(N.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"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:()=>D(),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&&l.jsxs(l.Fragment,{children:[l.jsx("select",{value:f,onChange:N=>p(N.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(N=>l.jsx("option",{value:N,className:"bg-popover text-foreground",children:N},N))}),l.jsxs("button",{onClick:R,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:[l.jsx(Ml,{className:"h-3.5 w-3.5"})," Herunterladen"]})]})]})]}),l.jsxs("div",{className:"flex gap-2 border-t border-border/20 pt-4",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx("input",{value:S,onChange:N=>j(N.target.value),onKeyDown:N=>N.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"}),l.jsx(Qd,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),l.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&&l.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(N=>l.jsxs("button",{onClick:()=>{u(N.repo),C([]),j(""),D(N.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:[l.jsx("span",{className:"font-semibold truncate",children:N.repo}),l.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground flex items-center gap-1 shrink-0",children:[l.jsx(Ml,{className:"h-3 w-3"})," ",N.downloads.toLocaleString()]})]},N.repo))}),m&&l.jsx("div",{className:"text-[10px] font-medium text-primary font-mono",children:m})]})}function g0(){const[o,u]=h.useState(null),[i,c]=h.useState(""),[f,p]=h.useState(!0),[m,g]=h.useState({});h.useEffect(()=>{de("/api/discover").then(u).catch(j=>c(String(j))).finally(()=>p(!1))},[]);async function S(j,b,C,D){g(O=>({...O,[j]:"Starte..."}));try{await de("/api/models/install",{method:"POST",body:JSON.stringify({repo:j,role:b,quant:C,jinja:D})}),g(O=>({...O,[j]:"Download läuft"}))}catch{g(R=>({...R,[j]:"Fehler"}))}}return f?l.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Analysiere Hardware und suche passende GGUF-Empfehlungen…"}):i||!o?l.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 (",i,")."]}):l.jsxs("div",{className:"space-y-6",children:[l.jsx(h0,{}),l.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-3 rounded-xl",children:["Modell-Registry geladen für ",o.sys_ram_gb," GB System-RAM • ⭐ markiert die empfohlene Standard-Rolle."]}),o.categories.map(j=>l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 px-1",children:[l.jsx(Rl,{className:"h-4 w-4 text-primary"}),l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:j.title})]}),l.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:j.models.map(b=>{const C=j.recommended===b.repo;return l.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",C?"border-primary/30":"border-border/60"),children:[l.jsxs("div",{className:"space-y-3.5",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[C&&l.jsx("span",{title:"Empfohlen für diese Rolle",children:l.jsx(qd,{className:"h-3.5 w-3.5 text-amber-400 fill-amber-400"})}),l.jsx("h4",{className:"text-xs font-bold text-foreground truncate max-w-[200px]",title:b.name,children:b.name})]}),l.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:b.author})]}),l.jsx("div",{className:"text-[10px] font-mono bg-background/40 px-1.5 py-0.5 rounded border border-border/30 text-muted-foreground",children:b.quant})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 border-t border-border/30 pt-3",children:[l.jsx($f,{caps:b.caps}),l.jsx(f0,{fit:b.fit})]})]}),b.fit.level!=="too_tight"&&l.jsxs("button",{onClick:()=>S(b.repo,b.role,b.quant,b.caps.tools!=="no"),disabled:!!m[b.repo],className:ne("mt-2 h-8 w-full flex items-center justify-center gap-1.5 rounded-lg text-xs font-semibold transition-all cursor-pointer border border-border/60 bg-background/20 hover:border-primary/50 disabled:opacity-50",m[b.repo]&&"border-primary/40 bg-primary/5 text-primary"),children:[l.jsx(Ml,{className:ne("h-3.5 w-3.5",!m[b.repo]&&"text-primary")}),m[b.repo]||"Modell laden"]})]},b.repo)})})]},j.role))]})}function x0(){const[o,u]=h.useState("cockpit");return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[l.jsxs("div",{children:[l.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-Zentrale"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Verwalte deine Modelle und passe das Gateway-Routing live über das interaktive Cockpit an."})]}),l.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=>l.jsx("button",{onClick:()=>u(i),className:ne("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",o===i?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:i==="cockpit"?"Cockpit":"Modelle finden"},i))})]}),l.jsx(c0,{}),l.jsx("div",{className:"transition-all duration-300",children:o==="cockpit"?l.jsx(m0,{}):l.jsx(g0,{})})]})}function ir(o){return(o/1024**3).toFixed(1)}function Sl({label:o,percent:u,detail:i,icon:c}){const f=u>90?"bg-red-500 shadow-md shadow-red-500/20":u>75?"bg-amber-500 shadow-md shadow-amber-500/20":"bg-primary shadow-md shadow-primary/20";return l.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:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(c,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-foreground",children:o})]}),l.jsxs("span",{className:"text-xs font-mono font-bold text-foreground",children:[Math.round(u),"%"]})]}),l.jsx("div",{className:"w-full h-2 bg-background/40 rounded-full overflow-hidden border border-border/20",children:l.jsx("div",{className:ne("h-full transition-all duration-700 ease-out",f),style:{width:`${Math.min(u,100)}%`}})}),i&&l.jsx("div",{className:"text-[10px] font-mono text-muted-foreground/80",children:i})]})}function v0(){const[o,u]=h.useState(null),[i,c]=h.useState(""),[f,p]=h.useState(!1);function m(){de("/api/maintenance/updates").then(u).catch(()=>{})}h.useEffect(m,[]);async function g(j,b){c(`${b} wird ausgeführt...`),p(!0);try{const C=await de(j,{method:"POST"});c(C.job_id?`${b} gestartet (Job-ID: ${C.job_id})`:C.ok?`${b} erfolgreich ausgeführt.`:`Fehler: ${C.err||"Unbekannt"}`)}catch(C){c(`Fehler bei ${b}: ${C.message}`)}finally{p(!1)}}async function S(j,b){c(`Upgrade für ${j} wird gestartet...`);try{await de("/api/models/install",{method:"POST",body:JSON.stringify({repo:j,role:b,quant:"Q4_K_M",jinja:!0})}),c("Upgrade-Download gestartet.")}catch(C){c(`Upgrade fehlgeschlagen: ${C.message}`)}}return l.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:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Wartung & Updates"}),o&&l.jsxs("div",{className:"flex gap-1.5 text-[9px] font-mono font-bold uppercase tracking-wider",children:[l.jsxs("span",{className:ne("px-1.5 py-0.5 rounded",o.os?"bg-amber-500/10 text-amber-400 border border-amber-500/20":"bg-background/40 text-muted-foreground border border-border/20"),children:["OS: ",o.os]}),l.jsxs("span",{className:ne("px-1.5 py-0.5 rounded",o.engine?"bg-amber-500/10 text-amber-400 border border-amber-500/20":"bg-background/40 text-muted-foreground border border-border/20"),children:["Engine: ",o.engine?"neu":"aktuell"]}),l.jsxs("span",{className:ne("px-1.5 py-0.5 rounded",o.models?"bg-primary/10 text-primary border border-primary/20":"bg-background/40 text-muted-foreground border border-border/20"),children:["Modelle: ",o.models]})]})]}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[l.jsx("button",{onClick:()=>g("/api/maintenance/os-update","OS-Update"),disabled:f,className:"h-8 px-3 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 disabled:opacity-50",children:"OS (Apt) aktualisieren"}),l.jsx("button",{onClick:()=>g("/api/maintenance/engine-update","Engine-Update"),disabled:f,className:"h-8 px-3 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 disabled:opacity-50",children:"Engine aktualisieren"}),l.jsx("button",{onClick:()=>{confirm("Bist du sicher, dass du den Host neu starten willst?")&&g("/api/maintenance/reboot","Reboot")},disabled:f,className:"h-8 px-3 rounded-lg border border-red-500/30 bg-red-500/5 text-red-400 text-xs font-semibold hover:bg-red-500/10 transition-all cursor-pointer disabled:opacity-50",children:"Host Reboot"})]}),o&&o.model_list.length>0&&l.jsxs("div",{className:"mt-3 space-y-2 border-t border-border/20 pt-3",children:[l.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Verfügbare Modell-Updates:"}),l.jsx("div",{className:"space-y-1.5",children:o.model_list.map(j=>l.jsxs("div",{className:"flex items-center justify-between p-2.5 rounded-xl bg-background/20 border border-border/30 text-xs font-semibold",children:[l.jsxs("span",{className:"truncate",children:[l.jsx("span",{className:"text-primary uppercase font-mono text-[10px] mr-1.5",children:j.role})," ",j.repo]}),l.jsx("button",{onClick:()=>S(j.repo,j.role),className:"px-2.5 py-1 text-[10px] font-bold rounded-md bg-primary text-primary-foreground hover:opacity-90 transition-all cursor-pointer",children:"Laden"})]},j.repo))})]}),i&&l.jsx("div",{className:"text-[10px] font-mono text-primary font-medium",children:i}),l.jsxs("div",{className:"text-[9px] text-muted-foreground/60 leading-normal border-t border-border/10 pt-2 flex items-center gap-1",children:[l.jsx(Zd,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{children:"OS-Update & Reboot benötigen NOPASSWD Berechtigungen in der sudoers Datei des Hosts."})]})]})}function y0(){const[o,u]=h.useState(null),[i,c]=h.useState(null),[f,p]=h.useState(""),[m,g]=h.useState(""),[S,j]=h.useState({});function b(){de("/api/system/status").then(u).catch(O=>p(String(O))),de("/api/system/services").then(c).catch(()=>{})}h.useEffect(()=>{b();const O=setInterval(b,3e3);return()=>clearInterval(O)},[]);async function C(){g("Backup snapshotted...");try{const O=await de("/api/system/backup",{method:"POST"});g(O.ok?`Snapshot erzeugt: ${O.snapshot} (${O.files.length} Dateien)`:"Keine Änderungen zu sichern.")}catch(O){g(`Fehler: ${O.message}`)}}async function D(O){j(R=>({...R,[O]:!0}));try{const R=await de("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:O})});R.ok?alert(`Dienst ${O} wurde erfolgreich neu gestartet.`):alert(`Fehler beim Neustart: ${R.err||"Unbekannter Fehler"}`)}catch(R){alert(`Fehler: ${R.message}`)}finally{j(R=>({...R,[O]:!1}))}}return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.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"}),l.jsx("p",{className:"text-sm text-muted-foreground flex items-center gap-1",children:"Echtzeit-Ressourcen der Box, Dienst-Überwachung und Systempflege."})]}),f&&l.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,")."]}),o&&l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[l.jsx(Sl,{label:"CPU",percent:o.cpu.percent,detail:o.cpu.cores?`${o.cpu.cores} Cores`:void 0,icon:cr}),l.jsx(Sl,{label:"RAM",percent:o.ram.percent,detail:`${ir(o.ram.used)} / ${ir(o.ram.total)} GB`,icon:la}),o.gpu&&o.gpu.busy_percent!=null&&l.jsx(Sl,{label:"GPU",percent:o.gpu.busy_percent,detail:o.gpu.gtt_used!=null&&o.gpu.gtt_total?`${ir(o.gpu.gtt_used)} / ${ir(o.gpu.gtt_total)} GB (GTT/unified)`:o.gpu.vram_used!=null&&o.gpu.vram_total?`${ir(o.gpu.vram_used)} / ${ir(o.gpu.vram_total)} GB VRAM`:void 0,icon:cr}),o.disk&&l.jsx(Sl,{label:"Disk",percent:o.disk.percent,detail:`${ir(o.disk.used)} / ${ir(o.disk.total)} GB`,icon:qi})]}),o.temp&&(o.temp.cpu||o.temp.gpu)&&l.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:[o.temp.cpu!=null&&l.jsxs("span",{className:"flex items-center gap-1",children:["CPU-Temperatur: ",l.jsxs("span",{className:"text-foreground font-bold",children:[o.temp.cpu," °C"]})]}),o.temp.cpu!=null&&o.temp.gpu!=null&&l.jsx("span",{children:"|"}),o.temp.gpu!=null&&l.jsxs("span",{className:"flex items-center gap-1",children:["GPU-Temperatur: ",l.jsxs("span",{className:"text-foreground font-bold",children:[o.temp.gpu," °C"]})]})]})]}),i&&l.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:[l.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Homelab-Dienste"}),l.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:i.services.map(O=>l.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:[l.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[l.jsx("span",{className:ne("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",O.ok?"bg-emerald-500":"bg-amber-500")}),l.jsxs("div",{className:"truncate",children:[l.jsx("div",{className:"text-xs font-bold text-foreground truncate",children:O.name}),l.jsx("div",{className:"text-[9px] text-muted-foreground/60 font-mono mt-0.5 truncate",children:O.url})]})]}),l.jsx("button",{onClick:()=>D(O.name),disabled:S[O.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:l.jsx(Ll,{className:ne("h-3.5 w-3.5",S[O.name]&&"animate-spin")})})]},O.name))}),l.jsxs("div",{className:"flex flex-wrap gap-4 border-t border-border/20 pt-4 text-[10px] font-semibold text-muted-foreground",children:[l.jsxs("a",{href:Dl(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:[l.jsx(Pl,{className:"h-3 w-3"})," Engine Dashboard (llama-swap)"]}),l.jsxs("a",{href:Dl(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:[l.jsx(Pl,{className:"h-3 w-3"})," OpenAI Gateway"]})]})]}),l.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:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"System-Backup & Snapshot"}),l.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Erzeuge einen Git-Snapshot der aktuellen Konfigurationen und des System-Zustands."})]}),l.jsx("div",{className:"flex items-center gap-3 self-start sm:self-auto shrink-0",children:l.jsxs("button",{onClick:C,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:[l.jsx(ph,{className:"h-4 w-4"})," Snapshot erstellen"]})})]}),m&&l.jsx("div",{className:"text-[10px] font-mono text-primary font-medium bg-primary/5 p-3 rounded-xl border border-primary/20",children:m}),l.jsx(v0,{})]})}function b0(){const[o,u]=h.useState(()=>{const L=localStorage.getItem("mc_host");if(L)return L;const F=window.location.hostname;return F&&F!=="localhost"&&F!=="127.0.0.1"?F:"192.168.178.151"}),[i,c]=h.useState(localStorage.getItem("mc_mcp_path")||""),[f,p]=h.useState(null),[m,g]=h.useState("cline"),[S,j]=h.useState(!1),[b,C]=h.useState("");h.useEffect(()=>{const L=new URLSearchParams;L.set("host",o),i&&L.set("mcp_path",i),de(`/api/connect?${L}`).then(p).catch(F=>C(String(F)))},[o,i]);function D(L){u(L),L&&localStorage.setItem("mc_host",L)}function O(L){c(L),localStorage.setItem("mc_mcp_path",L)}const R=f==null?void 0:f.tools[m];async function N(){R&&(await navigator.clipboard.writeText(R.snippet),j(!0),setTimeout(()=>j(!1),1500))}return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.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"}),l.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."})]}),l.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:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[l.jsx(sh,{className:"h-3.5 w-3.5 text-primary"})," Box LAN IP-Adresse"]}),l.jsx("input",{value:o,onChange:L=>D(L.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"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[l.jsx(lh,{className:"h-3.5 w-3.5 text-primary"})," Lokaler MCP-Scriptpfad"]}),l.jsx("input",{value:i,onChange:L=>O(L.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"})]})]}),b&&l.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: ",b]}),f&&l.jsxs("div",{className:"space-y-4",children:[l.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(f.tools).map(([L,F])=>l.jsx("button",{onClick:()=>g(L),className:ne("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",m===L?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:F.label},L))}),R&&l.jsxs("div",{className:"space-y-3",children:[R.note&&l.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:[l.jsx(ih,{className:"h-4.5 w-4.5 text-primary shrink-0 mt-0.5"}),l.jsx("span",{children:R.note})]}),l.jsxs("div",{className:"flex flex-col border border-border/60 bg-black/60 rounded-2xl overflow-hidden shadow-2xl",children:[l.jsxs("div",{className:"flex h-11 items-center justify-between px-4 border-b border-border/40 bg-black/40 shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"h-3 w-3 rounded-full bg-red-500/80 shadow-md shadow-red-500/10"}),l.jsx("span",{className:"h-3 w-3 rounded-full bg-amber-500/80 shadow-md shadow-amber-500/10"}),l.jsx("span",{className:"h-3 w-3 rounded-full bg-emerald-500/80 shadow-md shadow-emerald-500/10"})]}),l.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:[l.jsx(ua,{className:"h-3.5 w-3.5 text-primary"}),l.jsx("span",{children:m==="cline"||m==="cursor"?"config.json":"settings.json"})]}),l.jsxs("button",{onClick:N,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:[S?l.jsx(Zi,{className:"h-3.5 w-3.5 text-emerald-400"}):l.jsx(Gd,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:S?"Kopiert":"Kopieren"})]})]}),l.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:l.jsx("code",{children:R.snippet})})]})]})]})]})}const Fd=["user","instruction","stable","versioned","ephemeral"],Ki={user:{label:"User",icon:yh,color:"text-cyan-400",border:"border-cyan-500/30",bg:"bg-cyan-500/10",text:"text-cyan-400"},instruction:{label:"Regel",icon:mh,color:"text-violet-400",border:"border-violet-500/30",bg:"bg-violet-500/10",text:"text-violet-400"},stable:{label:"Fakt",icon:aa,color:"text-indigo-400",border:"border-indigo-500/30",bg:"bg-indigo-500/10",text:"text-indigo-400"},versioned:{label:"Version",icon:vh,color:"text-amber-400",border:"border-amber-500/30",bg:"bg-amber-500/10",text:"text-amber-400"},ephemeral:{label:"Temporär",icon:th,color:"text-pink-400",border:"border-pink-500/30",bg:"bg-pink-500/10",text:"text-pink-400"}},Ud={label:"Gedächtnis",icon:Hd,bg:"bg-muted/10",text:"text-muted-foreground"},w0={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 k0(){const[o,u]=h.useState([]),[i,c]=h.useState(""),[f,p]=h.useState(""),[m,g]=h.useState(""),[S,j]=h.useState("stable"),[b,C]=h.useState(""),[D,O]=h.useState(!1);function R(){const T=new URLSearchParams;f&&T.set("q",f),i&&T.set("category",i),de(`/api/memory?${T}`).then(u).catch(Q=>C(String(Q)))}h.useEffect(R,[f,i]);async function N(){m.trim()&&(await de("/api/memory",{method:"POST",body:JSON.stringify({content:m,category:S,source:"ui"})}),g(""),R())}async function L(T){await de(`/api/memory/${T}`,{method:"DELETE"}),R()}async function F(){O(!0);try{const T=await de("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!1})});if(T.duplicate_count===0){alert("Keine Dubletten gefunden — alles sauber.");return}confirm(`${T.duplicate_count} Dublette(n) in ${T.groups.length} Gruppe(n) gefunden. Entfernen?`)&&(await de("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!0})}),R())}catch(T){alert(`Fehler: ${T.message}`)}finally{O(!1)}}return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[l.jsxs("div",{children:[l.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)"}),l.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."})]}),l.jsxs("button",{onClick:F,disabled:D,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:[l.jsx(gh,{className:"h-4 w-4 text-primary animate-pulse"}),l.jsx("span",{children:"Deduplizieren"})]})]}),l.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:[l.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Neuen Eintrag anlegen"}),l.jsx("textarea",{value:m,onChange:T=>g(T.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"}),l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Kategorie"}),l.jsx("select",{value:S,onChange:T=>j(T.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:Fd.map(T=>{var Q;return l.jsx("option",{value:T,className:"bg-popover text-foreground",children:((Q=Ki[T])==null?void 0:Q.label)||T},T)})})]}),l.jsxs("button",{onClick:N,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:[l.jsx(Kd,{className:"h-4 w-4"})," Speichern"]})]})]}),l.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center gap-3",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx("input",{value:f,onChange:T=>p(T.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"}),l.jsx(Qd,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),l.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:[l.jsx("button",{onClick:()=>c(""),className:ne("h-7 px-3 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer whitespace-nowrap",i?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"),children:"Alle"}),Fd.map(T=>{const Q=Ki[T]||Ud,q=Q.icon;return l.jsxs("button",{onClick:()=>c(T),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",i===T?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[l.jsx(q,{className:"h-3 w-3"}),l.jsx("span",{children:Q.label})]},T)})]})]}),b&&l.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: ",b]}),l.jsx("div",{className:"space-y-3",children:o.length===0?l.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."}):o.map(T=>{const Q=Ki[T.category]||Ud,q=Q.icon;return l.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",w0[T.category]||"border-l-muted"),children:[l.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[l.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",Q.bg,Q.text),children:[l.jsx(q,{className:"h-3 w-3"}),l.jsx("span",{className:"hidden sm:inline",children:Q.label})]}),l.jsx("span",{className:"text-xs text-foreground leading-relaxed break-words whitespace-pre-wrap flex-1",children:T.content})]}),l.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[l.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:T.source}),l.jsx("button",{onClick:()=>L(T.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:l.jsx(Yd,{className:"h-3.5 w-3.5"})})]})]},T.id)})})]})}function Cl({label:o,ok:u,detail:i,icon:c}){return l.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-3 hover:border-primary/40 transition-all duration-300",u?"border-border/60":"border-amber-500/30"),children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:o}),l.jsx(c,{className:ne("h-4.5 w-4.5",u?"text-primary":"text-amber-500")})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:ne("h-2 w-2 rounded-full ring-2 ring-black/40",u?"bg-emerald-500 animate-pulse":"bg-amber-500")}),l.jsx("span",{className:"text-xs font-semibold text-foreground",children:u?"Bereit / Online":"Offline / Inaktiv"})]}),i&&l.jsx("div",{className:"text-[10px] font-mono text-muted-foreground truncate max-w-[200px]",title:i,children:i})]})]})}function j0(){const[o,u]=h.useState(null),[i,c]=h.useState("");return h.useEffect(()=>{const f=()=>de("/api/agent/status").then(u).catch(m=>c(String(m)));f();const p=setInterval(f,5e3);return()=>clearInterval(p)},[]),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[l.jsxs("div",{children:[l.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"}),l.jsxs("p",{className:"text-sm text-muted-foreground",children:["Hermes ist ein autonomer Agent, der im Hintergrund der Box läuft (Port ",l.jsx("code",{children:":8642"}),") und seine eigene UI besitzt."]})]}),(o==null?void 0:o.webui_url)&&l.jsxs("a",{href:Dl(o.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",o.webui_reachable?"bg-primary text-primary-foreground hover:opacity-90 shadow-primary/10":"border border-border/60 text-muted-foreground bg-background/20"),children:[l.jsx(Pl,{className:"h-4 w-4"}),l.jsx("span",{children:"Hermes WebUI öffnen"})]})]}),i&&l.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 (",i,")."]}),o&&l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[l.jsx(Cl,{label:"Agent Gateway",ok:o.gateway_reachable,detail:"Port :8642 (REST API)",icon:sa}),l.jsx(Cl,{label:"Agent WebUI",ok:o.webui_reachable,detail:"Port :8787 (Chat UI)",icon:la}),l.jsx(Cl,{label:"Aktives Gehirn",ok:o.gateway_reachable,detail:o.brain_model?`Model: ${o.brain_model}`:"Model: auto",icon:cr}),l.jsx(Cl,{label:"Verdrahtung",ok:o.has_config,detail:`Config: ${o.has_config?"✓":"—"} · Skills: ${o.has_skills?"✓":"—"} · Memory: ${o.has_memories?"✓":"—"}`,icon:bh})]}),!o.gateway_reachable&&l.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:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(aa,{className:"h-5 w-5 text-amber-500"}),l.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"Hermes-Agent Diagnostics"})]}),l.jsxs("div",{className:"text-xs text-muted-foreground space-y-3 leading-relaxed",children:[l.jsx("p",{children:"Der Hermes-Dienst ist auf der Box derzeit offline oder kann sich nicht mit dem lokalen llama-swap verbinden."}),l.jsxs("p",{children:["Stelle sicher, dass die systemd-Dienste auf der Box laufen. Du kannst den Status im ",l.jsx("strong",{children:"OS & Updates Drawer"})," prüfen und die Dienste bei Bedarf neu starten."]}),l.jsxs("div",{className:"p-3.5 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1",children:[l.jsx("div",{className:"text-muted-foreground/60",children:"# Dienste manuell auf der Box prüfen:"}),l.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-gateway"}),l.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-webui"})]}),l.jsxs("p",{children:["Weitere Einrichtungsdetails (Brain-Konfiguration, MCP-Kopplungen, SSH-Tunneling und Such-Engines) findest du in der Dokumentationsdatei:",l.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"}),"."]})]})]})]})]})}function N0(){const[o,u]=h.useState("roocode"),[i,c]=h.useState(null),f=(()=>{const b=window.location.hostname;return b&&b!=="localhost"&&b!=="127.0.0.1"?b:"192.168.178.151"})(),[p,m]=h.useState(!1),[g,S]=h.useState(null);function j(){m(!0),de("/api/health").then(b=>{c(b),S(b.engine_reachable?"success":"partial")}).catch(()=>{c(null),S("fail")}).finally(()=>m(!1))}return h.useEffect(()=>{j()},[]),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{children:[l.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"}),l.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."})]}),l.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:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:ne("h-3 w-3 rounded-full ring-2 ring-black/40",g==="success"&&"bg-emerald-500 animate-pulse",g==="partial"&&"bg-amber-500",g==="fail"&&"bg-red-500",!g&&"bg-muted")}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Lokaler Verbindungs-Check"}),l.jsxs("div",{className:"text-[10px] text-muted-foreground mt-0.5 font-mono",children:[g==="success"&&`Erfolgreich! Dein PC hat Zugriff auf das Box-Gateway (v${(i==null?void 0:i.version)||""}).`,g==="partial"&&"Gateway erreichbar, aber die llama-cpp-Engine ist offline.",g==="fail"&&"Verbindung fehlgeschlagen. Ist die Box im selben LAN-Netzwerk?",!g&&"Verbindung wird geprüft..."]})]})]}),l.jsxs("button",{onClick:j,disabled:p,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:[l.jsx(Ll,{className:ne("h-3.5 w-3.5",p&&"animate-spin")}),l.jsx("span",{children:"Testen"})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 px-1",children:[l.jsx(Hd,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Wie funktioniert mein Stack?"})]}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[l.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(cr,{className:"h-4 w-4 text-cyan-400"}),l.jsx("h3",{className:"text-xs font-bold text-foreground",children:"1. Die Zentrale"})]}),l.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."})]}),l.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(Rl,{className:"h-4 w-4 text-violet-400"}),l.jsx("h3",{className:"text-xs font-bold text-foreground",children:"2. Modell-Zentrale"})]}),l.jsxs("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:["Deine GGUF-Datenbank. Gesteuert von ",l.jsx("strong",{children:"llama-swap"}),". Lädt dein schnelles Alltags-Hirn (`fast`) oder dein schweres Logik-Hirn (`heavy`) vollautomatisch im VRAM."]})]}),l.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(ia,{className:"h-4 w-4 text-indigo-400"}),l.jsx("h3",{className:"text-xs font-bold text-foreground",children:"3. Das Gedächtnis"})]}),l.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."})]})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-2 px-1",children:[l.jsx(rh,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Vibe Coding auf dem PC einrichten"})]}),l.jsxs("div",{className:"flex gap-1.5 bg-card/20 p-1 border border-border/40 rounded-xl max-w-fit",children:[l.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",o==="roocode"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:[l.jsx(qd,{className:"h-3.5 w-3.5 fill-amber-400/20"}),"Roo Code (VS Code)"]}),l.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",o==="cursor"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:"Cursor IDE"}),l.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",o==="opencode"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:"OpenCode Desktop"})]}),l.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:[o==="roocode"&&l.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Roo Code Kopplung (Empfohlene Open-Source-Erweiterung)"}),l.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."})]}),l.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[l.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"]}),l.jsxs("p",{className:"pl-6",children:["Suche in VS Code nach der Erweiterung ",l.jsx("strong",{children:"Roo Code"})," und installiere sie."]})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[l.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"]}),l.jsx("p",{className:"pl-6",children:"Klicke auf das Roo-Code-Symbol in der Sidebar, öffne die Einstellungen (Zahnrad) und stelle folgendes ein:"}),l.jsx("div",{className:"pl-6 pt-1",children:l.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground/60",children:"API Provider:"})," OpenAI Compatible"]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground/60",children:"Base URL:"})," http://",f,":9001/v1"]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground/60",children:"API Key:"})," ",l.jsx("span",{className:"italic text-muted-foreground/50",children:'beliebig (z.B. "local")'})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground/60",children:"Model ID:"})," auto"]})]})})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[l.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)"]}),l.jsxs("p",{className:"pl-6",children:["Damit Roo Code auf deinen ",l.jsx("strong",{children:"Gedächtnis-Pool"})," zugreifen kann, kopiere die MCP-Konfiguration aus dem Reiter ",l.jsx("strong",{children:"Verbinden"})," und füge sie in deine lokale Roo-Code-Konfigurationsdatei ein."]})]})]})]}),o==="cursor"&&l.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Cursor IDE Kopplung (Proprietäre All-in-One IDE)"}),l.jsx("p",{children:"Cursor ist ein polierter, extrem schneller VS-Code-Fork mit hervorragenden, tief integrierten Autovervollständigungen (Tab-Completions)."})]}),l.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[l.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"]}),l.jsxs("p",{className:"pl-6",children:["Öffne Cursor, klicke oben rechts auf das Zahnrad (Settings) und navigiere zu ",l.jsx("strong",{children:"Models"}),"."]})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[l.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"]}),l.jsxs("p",{className:"pl-6",children:["Deaktiviere die Standard-Cloudmodelle, klappe den Bereich ",l.jsx("strong",{children:"OpenAI API"})," auf und konfiguriere:"]}),l.jsx("div",{className:"pl-6 pt-1",children:l.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground/60",children:"Override Base URL:"})," http://",f,":9001/v1"]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground/60",children:"API Key:"})," ",l.jsx("span",{className:"italic text-muted-foreground/50",children:'beliebig (z.B. "local")'})]})]})})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[l.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"]}),l.jsxs("p",{className:"pl-6",children:["Trage in der Modell-Liste ein neues Modell mit dem Namen ",l.jsx("strong",{children:"auto"})," ein und wähle es als aktives Modell aus. Cursor leitet ab jetzt alle deine Anfragen an die Box weiter."]})]})]})]}),o==="opencode"&&l.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("h3",{className:"text-sm font-bold text-foreground",children:"OpenCode Desktop Kopplung (Open-Source Vibe-Coding-App)"}),l.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."})]}),l.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[l.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"]}),l.jsx("p",{className:"pl-6",children:"Lade die Desktop-Anwendung von der offiziellen Website (opencode.ai) herunter und starte sie."})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[l.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"]}),l.jsx("p",{className:"pl-6",children:"Gehe in den Bereich Einstellungen ➔ Provider, deaktiviere die Cloud-Voreinstellungen und trage deinen lokalen Server ein:"}),l.jsx("div",{className:"pl-6 pt-1",children:l.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground/60",children:"Base URL:"})," http://",f,":9001/v1"]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-muted-foreground/60",children:"Model:"})," auto"]})]})})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[l.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"]}),l.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.'})]})]})]})]})]}),l.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:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ua,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Was tun, wenn das Coden hakt?"})]}),l.jsxs("ul",{className:"text-[11px] text-muted-foreground space-y-2 list-disc pl-4 leading-relaxed",children:[l.jsxs("li",{children:[l.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."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Modell antwortet nicht?"})," Schaue unter ",l.jsx("strong",{children:"Diagnose"}),", ob der Dienst `llama-swap` aktiv (grün) ist. Wenn nicht, klicke daneben auf ",l.jsx("strong",{children:"Restart"}),"."]}),l.jsxs("li",{children:[l.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."]})]})]})]})}function S0({title:o,hint:u}){return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold",children:o}),l.jsx("p",{className:"text-sm text-muted-foreground",children:u})]}),l.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:[l.jsx(oh,{className:"h-8 w-8 text-muted-foreground"}),l.jsx("div",{className:"text-sm text-muted-foreground",children:"Kommt in einer späteren Phase."})]})]})}const C0=[{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 Qi(o){return o==null?"":o>1024**3?`${(o/1024**3).toFixed(2)} GB`:`${(o/1024**2).toFixed(1)} MB`}function E0({open:o,onClose:u}){const[i,c]=h.useState(null),[f,p]=h.useState([]),[m,g]=h.useState("llama-swap"),[S,j]=h.useState(""),[b,C]=h.useState(!1),[D,O]=h.useState({}),[R,N]=h.useState("maintenance"),L=h.useRef(null);function F(){de("/api/maintenance/updates").then(c).catch(A=>console.error("Error loading updates",A))}function T(){de("/api/jobs").then(A=>p(A.jobs||[])).catch(A=>console.error("Error loading jobs",A))}function Q(A){C(!0),de(`/api/maintenance/logs?service=${A}&lines=150`).then(ue=>{ue.ok?j(ue.text):j(`Fehler beim Laden der Logs: ${ue.err||"Unbekannter Fehler"}`)}).catch(ue=>j(`Fehler: ${ue.message}`)).finally(()=>{C(!1),setTimeout(()=>{L.current&&(L.current.scrollTop=L.current.scrollHeight)},50)})}h.useEffect(()=>{if(!o)return;F(),T();const A=setInterval(()=>{T(),F()},3e3);return()=>clearInterval(A)},[o]),h.useEffect(()=>{!o||R!=="logs"||Q(m)},[o,R,m]);async function q(){try{await de("/api/maintenance/os-update",{method:"POST"}),T(),N("maintenance")}catch(A){alert(`Fehler beim Starten des OS-Updates: ${A.message}`)}}async function U(){try{await de("/api/maintenance/engine-update",{method:"POST"}),T(),N("maintenance")}catch(A){alert(`Fehler: ${A.message}`)}}async function J(){if(confirm("Bist du sicher, dass du das gesamte Host-System neu starten willst?"))try{await de("/api/maintenance/reboot",{method:"POST"}),alert("Reboot ausgelöst. System startet neu..."),u()}catch(A){alert(`Fehler: ${A.message}`)}}async function ae(A){O(ue=>({...ue,[A]:!0}));try{const ue=await de("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:A})});ue.ok?(alert(`Dienst ${A} wurde erfolgreich neu gestartet.`),R==="logs"&&m===A&&Q(A)):alert(`Fehler beim Neustart: ${ue.err||"Unbekannter Fehler"}`)}catch(ue){alert(`Fehler: ${ue.message}`)}finally{O(ue=>({...ue,[A]:!1}))}}async function be(A){try{await de(`/api/jobs/${A}/cancel`,{method:"POST"}),T()}catch(ue){alert(`Fehler beim Abbrechen: ${ue.message}`)}}return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:ne("fixed inset-0 bg-black/60 backdrop-blur-sm z-50 transition-opacity duration-300",o?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),onClick:u}),l.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",o?"translate-x-0":"translate-x-full"),children:[l.jsxs("div",{className:"flex h-16 shrink-0 items-center justify-between border-b border-border/40 px-6",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(cr,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase font-space",children:"OS-Zentrale & Pflege"})]}),l.jsx("button",{onClick:u,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:l.jsx(Xd,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex border-b border-border/40 px-6",children:[l.jsx("button",{onClick:()=>N("maintenance"),className:ne("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",R==="maintenance"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Wartung"}),l.jsx("button",{onClick:()=>N("logs"),className:ne("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",R==="logs"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Logs"})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:R==="maintenance"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Wartungsaktionen"}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("button",{onClick:q,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:[l.jsx(aa,{className:"h-5 w-5 text-cyan-400 mb-1 group-hover:scale-105 transition-transform"}),l.jsx("span",{className:"text-xs font-semibold",children:"OS Update (apt)"}),l.jsx("span",{className:"text-[10px] text-muted-foreground",children:i!=null&&i.os?`${i.os} Updates verfügbar`:"Auf neuestem Stand"})]}),l.jsxs("button",{onClick:U,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:[l.jsx(hh,{className:"h-5 w-5 text-violet-400 mb-1 group-hover:scale-105 transition-transform"}),l.jsx("span",{className:"text-xs font-semibold",children:"Engine Update"}),l.jsx("span",{className:"text-[10px] text-muted-foreground",children:i!=null&&i.engine?"Update verfügbar":"Auf neuestem Stand"})]})]}),l.jsxs("button",{onClick:J,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:[l.jsx(fh,{className:"h-4.5 w-4.5"}),l.jsxs("div",{children:[l.jsx("div",{children:"Host-System neu starten (Reboot)"}),l.jsx("div",{className:"text-[10px] text-red-400/80 font-normal",children:"Startet das gesamte Betriebssystem des Homelabs neu"})]})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Hintergrund-Aufgaben"}),l.jsxs("span",{className:"text-[10px] font-mono bg-primary/10 text-primary px-1.5 py-0.5 rounded-full",children:[f.filter(A=>A.state==="running"||A.state==="queued").length," Aktiv"]})]}),l.jsx("div",{className:"space-y-3",children:f.length===0?l.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(A=>{const ue=A.state==="running"||A.state==="queued";return l.jsxs("div",{className:ne("p-3 rounded-xl border transition-all duration-300",ue?"border-primary/40 bg-primary/5 shadow-md shadow-primary/5":"border-border/40 bg-background/20 opacity-80"),children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"text-xs font-semibold flex items-center gap-1.5",children:[ue&&l.jsxs("span",{className:"flex h-2 w-2 relative",children:[l.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),l.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),A.label]}),l.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground uppercase flex items-center gap-2",children:[l.jsxs("span",{children:["ID: ",A.id]}),l.jsx("span",{children:"•"}),l.jsx("span",{className:ne(A.state==="done"&&"text-emerald-400",A.state==="failed"&&"text-red-400",A.state==="running"&&"text-primary",A.state==="queued"&&"text-amber-400",A.state==="canceled"&&"text-muted-foreground"),children:A.state})]})]}),ue&&l.jsx("button",{onClick:()=>be(A.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"})]}),A.state==="running"&&l.jsxs("div",{className:"mt-3 space-y-1",children:[l.jsx("div",{className:"w-full h-1.5 bg-muted rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full bg-primary transition-all duration-500",style:{width:`${A.progress??0}%`}})}),l.jsxs("div",{className:"flex justify-between items-center text-[9px] font-mono text-muted-foreground",children:[l.jsxs("span",{children:[A.progress??0,"%"]}),A.done_bytes!=null&&A.total_bytes!=null&&l.jsxs("span",{children:[Qi(A.done_bytes)," / ",Qi(A.total_bytes),A.rate_bps!=null&&` (${Qi(A.rate_bps)}/s)`]}),A.eta_s!=null&&l.jsxs("span",{children:["ETA: ",A.eta_s,"s"]})]})]})]},A.id)})})]})]}):l.jsxs("div",{className:"flex flex-col h-full space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("select",{value:m,onChange:A=>g(A.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:C0.map(A=>l.jsxs("option",{value:A.id,children:[A.label," (",A.type==="system"?"systemd-root":"user",")"]},A.id))}),l.jsxs("button",{onClick:()=>ae(m),disabled:D[m],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:[l.jsx(Ll,{className:ne("h-3.5 w-3.5",D[m]&&"animate-spin")}),"Restart"]})]}),l.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:[l.jsxs("div",{className:"flex h-9 items-center justify-between px-4 border-b border-border/40 bg-black/30 shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground",children:[l.jsx(ua,{className:"h-3 w-3 text-primary"}),l.jsxs("span",{children:["stdout/stderr - ",m]})]}),l.jsx("button",{onClick:()=>Q(m),disabled:b,className:"text-muted-foreground hover:text-foreground transition-colors",children:l.jsx(Ll,{className:ne("h-3 w-3",b&&"animate-spin")})})]}),l.jsx("pre",{ref:L,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:b&&!S?l.jsx("span",{className:"text-muted-foreground",children:"Lade Logs..."}):S||l.jsx("span",{className:"text-muted-foreground",children:"Keine Logeinträge vorhanden."})})]})]})})]})]})}function _0(){const[o,u]=h.useState("dashboard"),[i,c]=h.useState(null),[f,p]=h.useState(()=>localStorage.getItem("mc_theme")!=="light"),[m,g]=h.useState(()=>localStorage.getItem("mc_sidebar_collapsed")==="true"),[S,j]=h.useState(null),[b,C]=h.useState(!1);h.useEffect(()=>{const R=()=>de("/api/health").then(c).catch(()=>c(null));R();const N=setInterval(R,1e4);return()=>clearInterval(N)},[]),h.useEffect(()=>{const R=()=>de("/api/maintenance/updates").then(j).catch(()=>{});R();const N=setInterval(R,2e4);return()=>clearInterval(N)},[]),h.useEffect(()=>{document.documentElement.classList.toggle("dark",f),localStorage.setItem("mc_theme",f?"dark":"light")},[f]),h.useEffect(()=>{const R=()=>C(!0);return window.addEventListener("open-system-drawer",R),()=>window.removeEventListener("open-system-drawer",R)},[]);const D=Yi.find(R=>R.id===o),O=S?S.os+S.engine+S.models:0;return l.jsxs("div",{className:"flex h-full relative",children:[l.jsxs("div",{className:"fixed inset-0 -z-50 pointer-events-none overflow-hidden bg-[hsl(224,30%,6%)]",children:[l.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]"}),l.jsx("div",{className:"absolute top-[-10%] left-[-10%] h-[50%] w-[50%] rounded-full bg-teal-500/15 blur-[160px]"}),l.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] h-[50%] w-[50%] rounded-full bg-purple-500/15 blur-[160px]"}),l.jsx("div",{className:"absolute top-[30%] right-[20%] h-[40%] w-[40%] rounded-full bg-indigo-500/10 blur-[140px]"})]}),l.jsx(_x,{onNavigate:u}),l.jsx(E0,{open:b,onClose:()=>C(!1)}),l.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",m?"w-16":"w-60"),children:[l.jsxs("div",{className:ne("flex items-center py-4 border-b border-border/40 shrink-0",m?"flex-col gap-3 px-2":"justify-between px-5"),children:[l.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[l.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20 shrink-0"}),!m&&l.jsxs("div",{className:"leading-tight",children:[l.jsx("div",{className:"text-sm font-semibold tracking-wide font-space",children:"Mission Control"}),l.jsx("div",{className:"text-xs text-muted-foreground",children:"2.0"})]})]}),l.jsx("button",{onClick:()=>{g(R=>{const N=!R;return localStorage.setItem("mc_sidebar_collapsed",N.toString()),N})},className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:m?"Maximieren":"Minimieren",children:m?l.jsx(Jm,{className:"h-4 w-4"}):l.jsx(Xm,{className:"h-4 w-4"})})]}),l.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4 overflow-y-auto",children:Yi.map(R=>l.jsxs("button",{onClick:()=>u(R.id),className:ne("flex w-full items-center rounded-md text-sm transition-all cursor-pointer",m?"justify-center p-2.5":"gap-3 px-3 py-2",o===R.id?"bg-primary/15 text-primary shadow-sm shadow-primary/5":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),title:m?R.label:void 0,children:[l.jsx(R.icon,{className:"h-4.5 w-4.5 shrink-0"}),!m&&l.jsx("span",{className:"truncate",children:R.label})]},R.id))}),l.jsx("div",{className:ne("py-3 text-xs text-muted-foreground border-t border-border/40 shrink-0",m?"px-2 text-center":"px-5"),children:m?l.jsx("div",{className:"flex justify-center",children:l.jsx("span",{className:ne("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",i?i.engine_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500":"bg-red-500"),title:i?`Engine ${i.engine_reachable?"online":"offline"}`:"Backend offline"})}):i?l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:ne("h-2 w-2 rounded-full",i.engine_reachable?"bg-emerald-500":"bg-amber-500")}),l.jsxs("span",{className:"truncate",children:["Engine ",i.engine_reachable?"online":"offline"," · v",i.version]})]}):l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"})," ",l.jsx("span",{className:"truncate",children:"Backend offline"})]})})]}),l.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[l.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:[l.jsx("div",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase font-sans",children:D.hint}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{onClick:()=>C(!0),className:"relative flex h-8 items-center rounded-md border border-border/40 bg-background/40 px-3 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground gap-1.5 transition-all cursor-pointer font-semibold",title:"System-Pflege öffnen",children:[l.jsx(cr,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:"OS & Updates"}),O>0&&l.jsxs("span",{className:"flex h-1.5 w-1.5 relative",children:[l.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-amber-400 opacity-75"}),l.jsx("span",{className:"relative inline-flex rounded-full h-1.5 w-1.5 bg-amber-500"})]})]}),l.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"}),l.jsx("button",{onClick:()=>p(R=>!R),className:"flex h-8 w-8 items-center justify-center rounded-md border border-border/40 bg-background/40 text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer",title:"Hell/Dunkel",children:f?l.jsx(xh,{className:"h-3.5 w-3.5"}):l.jsx(uh,{className:"h-3.5 w-3.5"})}),l.jsxs("button",{onClick:()=>{const R=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(R)},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:[l.jsx(nh,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:"Suchen"}),l.jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[9px]",children:"⌘K"})]})]})]}),l.jsxs("main",{className:"flex-1 overflow-y-auto p-6 scrollbar-thin",children:[o==="dashboard"&&l.jsx(a0,{}),o==="models"&&l.jsx(x0,{}),o==="system"&&l.jsx(y0,{}),o==="connect"&&l.jsx(b0,{}),o==="memory"&&l.jsx(k0,{}),o==="agent"&&l.jsx(j0,{}),o==="guide"&&l.jsx(N0,{}),!["dashboard","models","system","connect","memory","agent","guide"].includes(o)&&l.jsx(S0,{title:D.label,hint:D.hint})]})]})]})}Km.createRoot(document.getElementById("root")).render(l.jsx(Bd.StrictMode,{children:l.jsx(_0,{})})); diff --git a/frontend/dist/index.html b/frontend/dist/index.html index 68e8654..de80c3f 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -6,7 +6,7 @@ Mission Control 2.0 - + diff --git a/frontend/src/views/ConnectView.tsx b/frontend/src/views/ConnectView.tsx index fb9f256..df70535 100644 --- a/frontend/src/views/ConnectView.tsx +++ b/frontend/src/views/ConnectView.tsx @@ -4,7 +4,13 @@ import { api, type ConnectResp } from "@/lib/api" import { cn } from "@/lib/utils" export function ConnectView() { - const [host, setHost] = useState(localStorage.getItem("mc_host") || "192.168.178.151") + const [host, setHost] = useState(() => { + const saved = localStorage.getItem("mc_host") + if (saved) return saved + const hn = window.location.hostname + if (hn && hn !== "localhost" && hn !== "127.0.0.1") return hn + return "192.168.178.151" + }) const [mcpPath, setMcpPath] = useState(localStorage.getItem("mc_mcp_path") || "") const [data, setData] = useState(null) const [active, setActive] = useState("cline") diff --git a/frontend/src/views/GuideView.tsx b/frontend/src/views/GuideView.tsx index 49e1437..b5f2637 100644 --- a/frontend/src/views/GuideView.tsx +++ b/frontend/src/views/GuideView.tsx @@ -6,6 +6,13 @@ import { cn } from "@/lib/utils" export function GuideView() { const [activeTab, setActiveTab] = useState<"roocode" | "cursor" | "opencode">("roocode") const [health, setHealth] = useState(null) + + const currentHost = (() => { + const hn = window.location.hostname + if (hn && hn !== "localhost" && hn !== "127.0.0.1") return hn + return "192.168.178.151" + })() + const [testing, setTesting] = useState(false) const [testResult, setTestResult] = useState(null) @@ -185,7 +192,7 @@ export function GuideView() {
API Provider: OpenAI Compatible
-
Base URL: http://192.168.178.151:9001/v1
+
Base URL: http://{currentHost}:9001/v1
API Key: beliebig (z.B. "local")
Model ID: auto
@@ -227,7 +234,7 @@ export function GuideView() {

Deaktiviere die Standard-Cloudmodelle, klappe den Bereich OpenAI API auf und konfiguriere:

-
Override Base URL: http://192.168.178.151:9001/v1
+
Override Base URL: http://{currentHost}:9001/v1
API Key: beliebig (z.B. "local")
@@ -268,7 +275,7 @@ export function GuideView() {

Gehe in den Bereich Einstellungen ➔ Provider, deaktiviere die Cloud-Voreinstellungen und trage deinen lokalen Server ein:

-
Base URL: http://192.168.178.151:9001/v1
+
Base URL: http://{currentHost}:9001/v1
Model: auto