diff --git a/backend/services/connect.py b/backend/services/connect.py index 069d74f..870307f 100644 --- a/backend/services/connect.py +++ b/backend/services/connect.py @@ -69,7 +69,7 @@ def build_snippets(host: str = DEFAULT_HOST, f"#\n"\ f"# 3. Token im Browser-Login einfügen — fertig.\n"\ f"#\n"\ - f"# Modelle im Hermes Desktop: {PRIMARY_MODEL} (bauen), heavy (denken), vision (Bilder)."\ + f"# Modelle im Hermes Desktop: {PRIMARY_MODEL} (bauen), heavy (denken), vision (Bilder)." ) # Claude Code spricht das Anthropic-Format; der Gateway ist OpenAI-kompatibel und @@ -124,8 +124,9 @@ def build_snippets(host: str = DEFAULT_HOST, def check_health() -> dict: - """Live-Erreichbarkeit der beiden Leitungen, aus Sicht der Box: - Leitung 1 = Gateway/Engine (llama-swap), Leitung 2 = Gedächtnis-Sidecar (Mem0).""" + """Live-Erreichbarkeit der drei Leitungen, aus Sicht der Box: + Leitung 1 = Gateway/Engine (llama-swap), Leitung 2 = Gedächtnis-Sidecar (Mem0), + Leitung 3 = Desktop-Gateway (Hermes-Builtin-UI).""" gateway = {"ok": False, "detail": "nicht erreichbar"} try: with httpx.Client(timeout=3.0) as c: @@ -147,4 +148,13 @@ def check_health() -> dict: except Exception: # noqa: BLE001 pass - return {"gateway": gateway, "memory": memory} + desktop_gateway = {"ok": False, "detail": "nicht erreichbar"} + try: + with httpx.Client(timeout=3.0) as c: + r = c.get("http://127.0.0.1:9119/api/status") + desktop_gateway = ({"ok": True, "detail": "bereit"} if r.status_code == 200 + else {"ok": False, "detail": f"HTTP {r.status_code}"}) + except Exception: # noqa: BLE001 + pass + + return {"gateway": gateway, "memory": memory, "desktop_gateway": desktop_gateway} diff --git a/frontend/dist/assets/GraphView-tjR4wIPi.js b/frontend/dist/assets/GraphView-Bk5Qkble.js similarity index 99% rename from frontend/dist/assets/GraphView-tjR4wIPi.js rename to frontend/dist/assets/GraphView-Bk5Qkble.js index 35c925c..ba2cbc1 100644 --- a/frontend/dist/assets/GraphView-tjR4wIPi.js +++ b/frontend/dist/assets/GraphView-Bk5Qkble.js @@ -1,4 +1,4 @@ -import{g as bi,r as ce,j as H,R as rr,S as nr,a as Ut,T as ar}from"./index-BHaK9XZl.js";var et={exports:{}},zt;function or(){if(zt)return et.exports;zt=1;var n=typeof Reflect=="object"?Reflect:null,i=n&&typeof n.apply=="function"?n.apply:function(b,R,A){return Function.prototype.apply.call(b,R,A)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(b){return Object.getOwnPropertyNames(b).concat(Object.getOwnPropertySymbols(b))}:t=function(b){return Object.getOwnPropertyNames(b)};function e(p){console&&console.warn&&console.warn(p)}var r=Number.isNaN||function(b){return b!==b};function a(){a.init.call(this)}et.exports=a,et.exports.once=D,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var o=10;function s(p){if(typeof p!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof p)}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(p){if(typeof p!="number"||p<0||r(p))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+p+".");o=p}}),a.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(b){if(typeof b!="number"||b<0||r(b))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+b+".");return this._maxListeners=b,this};function u(p){return p._maxListeners===void 0?a.defaultMaxListeners:p._maxListeners}a.prototype.getMaxListeners=function(){return u(this)},a.prototype.emit=function(b){for(var R=[],A=1;A0&&(P=R[0]),P instanceof Error)throw P;var V=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw V.context=P,V}var z=F[b];if(z===void 0)return!1;if(typeof z=="function")i(z,this,R);else for(var g=z.length,K=y(z,g),A=0;A0&&P.length>G&&!P.warned){P.warned=!0;var V=new Error("Possible EventEmitter memory leak detected. "+P.length+" "+String(b)+" listeners added. Use emitter.setMaxListeners() to increase limit");V.name="MaxListenersExceededWarning",V.emitter=p,V.type=b,V.count=P.length,e(V)}return p}a.prototype.addListener=function(b,R){return h(this,b,R,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(b,R){return h(this,b,R,!0)};function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(p,b,R){var A={fired:!1,wrapFn:void 0,target:p,type:b,listener:R},G=d.bind(A);return G.listener=R,A.wrapFn=G,G}a.prototype.once=function(b,R){return s(R),this.on(b,l(this,b,R)),this},a.prototype.prependOnceListener=function(b,R){return s(R),this.prependListener(b,l(this,b,R)),this},a.prototype.removeListener=function(b,R){var A,G,F,P,V;if(s(R),G=this._events,G===void 0)return this;if(A=G[b],A===void 0)return this;if(A===R||A.listener===R)--this._eventsCount===0?this._events=Object.create(null):(delete G[b],G.removeListener&&this.emit("removeListener",b,A.listener||R));else if(typeof A!="function"){for(F=-1,P=A.length-1;P>=0;P--)if(A[P]===R||A[P].listener===R){V=A[P].listener,F=P;break}if(F<0)return this;F===0?A.shift():w(A,F),A.length===1&&(G[b]=A[0]),G.removeListener!==void 0&&this.emit("removeListener",b,V||R)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(b){var R,A,G;if(A=this._events,A===void 0)return this;if(A.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):A[b]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete A[b]),this;if(arguments.length===0){var F=Object.keys(A),P;for(G=0;G=0;G--)this.removeListener(b,R[G]);return this};function f(p,b,R){var A=p._events;if(A===void 0)return[];var G=A[b];return G===void 0?[]:typeof G=="function"?R?[G.listener||G]:[G]:R?T(G):y(G,G.length)}a.prototype.listeners=function(b){return f(this,b,!0)},a.prototype.rawListeners=function(b){return f(this,b,!1)},a.listenerCount=function(p,b){return typeof p.listenerCount=="function"?p.listenerCount(b):c.call(p,b)},a.prototype.listenerCount=c;function c(p){var b=this._events;if(b!==void 0){var R=b[p];if(typeof R=="function")return 1;if(R!==void 0)return R.length}return 0}a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function y(p,b){for(var R=new Array(b),A=0;An++}function me(){const n=arguments;let i=null,t=-1;return{[Symbol.iterator](){return this},next(){let e=null;do{if(i===null){if(t++,t>=n.length)return{done:!0};i=n[t][Symbol.iterator]()}if(e=i.next(),e.done){i=null;continue}break}while(!0);return e}}}function Le(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class Lt extends Error{constructor(i){super(),this.name="GraphError",this.message=i}}class k extends Lt{constructor(i){super(i),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,k.prototype.constructor)}}class C extends Lt{constructor(i){super(i),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,C.prototype.constructor)}}class I extends Lt{constructor(i){super(i),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,I.prototype.constructor)}}function _i(n,i){this.key=n,this.attributes=i,this.clear()}_i.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function Ti(n,i){this.key=n,this.attributes=i,this.clear()}Ti.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function Si(n,i){this.key=n,this.attributes=i,this.clear()}Si.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Ge(n,i,t,e,r){this.key=i,this.attributes=r,this.undirected=n,this.source=t,this.target=e}Ge.prototype.attach=function(){let n="out",i="in";this.undirected&&(n=i="undirected");const t=this.source.key,e=this.target.key;this.source[n][e]=this,!(this.undirected&&t===e)&&(this.target[i][t]=this)};Ge.prototype.attachMulti=function(){let n="out",i="in";const t=this.source.key,e=this.target.key;this.undirected&&(n=i="undirected");const r=this.source[n],a=r[e];if(typeof a>"u"){r[e]=this,this.undirected&&t===e||(this.target[i][t]=this);return}a.previous=this,this.next=a,r[e]=this,this.target[i][t]=this};Ge.prototype.detach=function(){const n=this.source.key,i=this.target.key;let t="out",e="in";this.undirected&&(t=e="undirected"),delete this.source[t][i],delete this.target[e][n]};Ge.prototype.detachMulti=function(){const n=this.source.key,i=this.target.key;let t="out",e="in";this.undirected&&(t=e="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[t][i],delete this.target[e][n]):(this.next.previous=void 0,this.source[t][i]=this.next,this.target[e][n]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const Ri=0,Ai=1,hr=2,xi=3;function ye(n,i,t,e,r,a,o){let s,u,h,d;if(e=""+e,t===Ri){if(s=n._nodes.get(e),!s)throw new C(`Graph.${i}: could not find the "${e}" node in the graph.`);h=r,d=a}else if(t===xi){if(r=""+r,u=n._edges.get(r),!u)throw new C(`Graph.${i}: could not find the "${r}" edge in the graph.`);const l=u.source.key,f=u.target.key;if(e===l)s=u.target;else if(e===f)s=u.source;else throw new C(`Graph.${i}: the "${e}" node is not attached to the "${r}" edge (${l}, ${f}).`);h=a,d=o}else{if(u=n._edges.get(e),!u)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`);t===Ai?s=u.source:s=u.target,h=r,d=a}return[s,h,d]}function dr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);return o.attributes[s]}}function lr(n,i,t){n.prototype[i]=function(e,r){const[a]=ye(this,i,t,e,r);return a.attributes}}function cr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);return o.attributes.hasOwnProperty(s)}}function fr(n,i,t){n.prototype[i]=function(e,r,a,o){const[s,u,h]=ye(this,i,t,e,r,a,o);return s.attributes[u]=h,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:u}),this}}function gr(n,i,t){n.prototype[i]=function(e,r,a,o){const[s,u,h]=ye(this,i,t,e,r,a,o);if(typeof h!="function")throw new k(`Graph.${i}: updater should be a function.`);const d=s.attributes,l=h(d[u]);return d[u]=l,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:u}),this}}function pr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);return delete o.attributes[s],this.emit("nodeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:s}),this}}function vr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);if(!J(s))throw new k(`Graph.${i}: provided attributes are not a plain object.`);return o.attributes=s,this.emit("nodeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}function mr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);if(!J(s))throw new k(`Graph.${i}: provided attributes are not a plain object.`);return Z(o.attributes,s),this.emit("nodeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:s}),this}}function yr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);if(typeof s!="function")throw new k(`Graph.${i}: provided updater is not a function.`);return o.attributes=s(o.attributes),this.emit("nodeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}const br=[{name:n=>`get${n}Attribute`,attacher:dr},{name:n=>`get${n}Attributes`,attacher:lr},{name:n=>`has${n}Attribute`,attacher:cr},{name:n=>`set${n}Attribute`,attacher:fr},{name:n=>`update${n}Attribute`,attacher:gr},{name:n=>`remove${n}Attribute`,attacher:pr},{name:n=>`replace${n}Attributes`,attacher:vr},{name:n=>`merge${n}Attributes`,attacher:mr},{name:n=>`update${n}Attributes`,attacher:yr}];function wr(n){br.forEach(function({name:i,attacher:t}){t(n,i("Node"),Ri),t(n,i("Source"),Ai),t(n,i("Target"),hr),t(n,i("Opposite"),xi)})}function Er(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return a.attributes[r]}}function _r(n,i,t){n.prototype[i]=function(e){let r;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+e,o=""+arguments[1];if(r=oe(this,a,o,t),!r)throw new C(`Graph.${i}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,r=this._edges.get(e),!r)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return r.attributes}}function Tr(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return a.attributes.hasOwnProperty(r)}}function Sr(n,i,t){n.prototype[i]=function(e,r,a){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+e,u=""+r;if(r=arguments[2],a=arguments[3],o=oe(this,s,u,t),!o)throw new C(`Graph.${i}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,o=this._edges.get(e),!o)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return o.attributes[r]=a,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}function Rr(n,i,t){n.prototype[i]=function(e,r,a){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+e,u=""+r;if(r=arguments[2],a=arguments[3],o=oe(this,s,u,t),!o)throw new C(`Graph.${i}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,o=this._edges.get(e),!o)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}if(typeof a!="function")throw new k(`Graph.${i}: updater should be a function.`);return o.attributes[r]=a(o.attributes[r]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}function Ar(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return delete a.attributes[r],this.emit("edgeAttributesUpdated",{key:a.key,type:"remove",attributes:a.attributes,name:r}),this}}function xr(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}if(!J(r))throw new k(`Graph.${i}: provided attributes are not a plain object.`);return a.attributes=r,this.emit("edgeAttributesUpdated",{key:a.key,type:"replace",attributes:a.attributes}),this}}function Cr(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}if(!J(r))throw new k(`Graph.${i}: provided attributes are not a plain object.`);return Z(a.attributes,r),this.emit("edgeAttributesUpdated",{key:a.key,type:"merge",attributes:a.attributes,data:r}),this}}function kr(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}if(typeof r!="function")throw new k(`Graph.${i}: provided updater is not a function.`);return a.attributes=r(a.attributes),this.emit("edgeAttributesUpdated",{key:a.key,type:"update",attributes:a.attributes}),this}}const Dr=[{name:n=>`get${n}Attribute`,attacher:Er},{name:n=>`get${n}Attributes`,attacher:_r},{name:n=>`has${n}Attribute`,attacher:Tr},{name:n=>`set${n}Attribute`,attacher:Sr},{name:n=>`update${n}Attribute`,attacher:Rr},{name:n=>`remove${n}Attribute`,attacher:Ar},{name:n=>`replace${n}Attributes`,attacher:xr},{name:n=>`merge${n}Attributes`,attacher:Cr},{name:n=>`update${n}Attributes`,attacher:kr}];function Lr(n){Dr.forEach(function({name:i,attacher:t}){t(n,i("Edge"),"mixed"),t(n,i("DirectedEdge"),"directed"),t(n,i("UndirectedEdge"),"undirected")})}const Gr=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Fr(n,i,t,e){let r=!1;for(const a in i){if(a===e)continue;const o=i[a];if(r=t(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),n&&r)return o.key}}function Nr(n,i,t,e){let r,a,o,s=!1;for(const u in i)if(u!==e){r=i[u];do{if(a=r.source,o=r.target,s=t(r.key,r.attributes,a.key,o.key,a.attributes,o.attributes,r.undirected),n&&s)return r.key;r=r.next}while(r!==void 0)}}function lt(n,i){const t=Object.keys(n),e=t.length;let r,a=0;return{[Symbol.iterator](){return this},next(){do if(r)r=r.next;else{if(a>=e)return{done:!0};const o=t[a++];if(o===i){r=void 0;continue}r=n[o]}while(!r);return{done:!1,value:{edge:r.key,attributes:r.attributes,source:r.source.key,target:r.target.key,sourceAttributes:r.source.attributes,targetAttributes:r.target.attributes,undirected:r.undirected}}}}}function Pr(n,i,t,e){const r=i[t];if(!r)return;const a=r.source,o=r.target;if(e(r.key,r.attributes,a.key,o.key,a.attributes,o.attributes,r.undirected)&&n)return r.key}function Ir(n,i,t,e){let r=i[t];if(!r)return;let a=!1;do{if(a=e(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected),n&&a)return r.key;r=r.next}while(r!==void 0)}function ct(n,i){let t=n[i];if(t.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!t)return{done:!0};const r={edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected};return t=t.next,{done:!1,value:r}}};let e=!1;return{[Symbol.iterator](){return this},next(){return e===!0?{done:!0}:(e=!0,{done:!1,value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected}})}}}function Or(n,i){if(n.size===0)return[];if(i==="mixed"||i===n.type)return Array.from(n._edges.keys());const t=i==="undirected"?n.undirectedSize:n.directedSize,e=new Array(t),r=i==="undirected",a=n._edges.values();let o=0,s,u;for(;s=a.next(),s.done!==!0;)u=s.value,u.undirected===r&&(e[o++]=u.key);return e}function Ci(n,i,t,e){if(i.size===0)return;const r=t!=="mixed"&&t!==i.type,a=t==="undirected";let o,s,u=!1;const h=i._edges.values();for(;o=h.next(),o.done!==!0;){if(s=o.value,r&&s.undirected!==a)continue;const{key:d,attributes:l,source:f,target:c}=s;if(u=e(d,l,f.key,c.key,f.attributes,c.attributes,s.undirected),n&&u)return d}}function Ur(n,i){if(n.size===0)return Le();const t=i!=="mixed"&&i!==n.type,e=i==="undirected",r=n._edges.values();return{[Symbol.iterator](){return this},next(){let a,o;for(;;){if(a=r.next(),a.done)return a;if(o=a.value,!(t&&o.undirected!==e))break}return{value:{edge:o.key,attributes:o.attributes,source:o.source.key,target:o.target.key,sourceAttributes:o.source.attributes,targetAttributes:o.target.attributes,undirected:o.undirected},done:!1}}}}function Gt(n,i,t,e,r,a){const o=i?Nr:Fr;let s;if(t!=="undirected"&&(e!=="out"&&(s=o(n,r.in,a),n&&s)||e!=="in"&&(s=o(n,r.out,a,e?void 0:r.key),n&&s))||t!=="directed"&&(s=o(n,r.undirected,a),n&&s))return s}function zr(n,i,t,e){const r=[];return Gt(!1,n,i,t,e,function(a){r.push(a)}),r}function $r(n,i,t){let e=Le();return n!=="undirected"&&(i!=="out"&&typeof t.in<"u"&&(e=me(e,lt(t.in))),i!=="in"&&typeof t.out<"u"&&(e=me(e,lt(t.out,i?void 0:t.key)))),n!=="directed"&&typeof t.undirected<"u"&&(e=me(e,lt(t.undirected))),e}function Ft(n,i,t,e,r,a,o){const s=t?Ir:Pr;let u;if(i!=="undirected"&&(typeof r.in<"u"&&e!=="out"&&(u=s(n,r.in,a,o),n&&u)||typeof r.out<"u"&&e!=="in"&&(e||r.key!==a)&&(u=s(n,r.out,a,o),n&&u))||i!=="directed"&&typeof r.undirected<"u"&&(u=s(n,r.undirected,a,o),n&&u))return u}function Br(n,i,t,e,r){const a=[];return Ft(!1,n,i,t,e,r,function(o){a.push(o)}),a}function Mr(n,i,t,e){let r=Le();return n!=="undirected"&&(typeof t.in<"u"&&i!=="out"&&e in t.in&&(r=me(r,ct(t.in,e))),typeof t.out<"u"&&i!=="in"&&e in t.out&&(i||t.key!==e)&&(r=me(r,ct(t.out,e)))),n!=="directed"&&typeof t.undirected<"u"&&e in t.undirected&&(r=me(r,ct(t.undirected,e))),r}function Hr(n,i){const{name:t,type:e,direction:r}=i;n.prototype[t]=function(a,o){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return[];if(!arguments.length)return Or(this,e);if(arguments.length===1){a=""+a;const s=this._nodes.get(a);if(typeof s>"u")throw new C(`Graph.${t}: could not find the "${a}" node in the graph.`);return zr(this.multi,e==="mixed"?this.type:e,r,s)}if(arguments.length===2){a=""+a,o=""+o;const s=this._nodes.get(a);if(!s)throw new C(`Graph.${t}: could not find the "${a}" source node in the graph.`);if(!this._nodes.has(o))throw new C(`Graph.${t}: could not find the "${o}" target node in the graph.`);return Br(e,this.multi,r,s,o)}throw new k(`Graph.${t}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Wr(n,i){const{name:t,type:e,direction:r}=i,a="forEach"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[a]=function(h,d,l){if(!(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)){if(arguments.length===1)return l=h,Ci(!1,this,e,l);if(arguments.length===2){h=""+h,l=d;const f=this._nodes.get(h);if(typeof f>"u")throw new C(`Graph.${a}: could not find the "${h}" node in the graph.`);return Gt(!1,this.multi,e==="mixed"?this.type:e,r,f,l)}if(arguments.length===3){h=""+h,d=""+d;const f=this._nodes.get(h);if(!f)throw new C(`Graph.${a}: could not find the "${h}" source node in the graph.`);if(!this._nodes.has(d))throw new C(`Graph.${a}: could not find the "${d}" target node in the graph.`);return Ft(!1,e,this.multi,r,f,d,l)}throw new k(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const o="map"+t[0].toUpperCase()+t.slice(1);n.prototype[o]=function(){const h=Array.prototype.slice.call(arguments),d=h.pop();let l;if(h.length===0){let f=0;e!=="directed"&&(f+=this.undirectedSize),e!=="undirected"&&(f+=this.directedSize),l=new Array(f);let c=0;h.push((y,w,T,D,m,S,p)=>{l[c++]=d(y,w,T,D,m,S,p)})}else l=[],h.push((f,c,y,w,T,D,m)=>{l.push(d(f,c,y,w,T,D,m))});return this[a].apply(this,h),l};const s="filter"+t[0].toUpperCase()+t.slice(1);n.prototype[s]=function(){const h=Array.prototype.slice.call(arguments),d=h.pop(),l=[];return h.push((f,c,y,w,T,D,m)=>{d(f,c,y,w,T,D,m)&&l.push(f)}),this[a].apply(this,h),l};const u="reduce"+t[0].toUpperCase()+t.slice(1);n.prototype[u]=function(){let h=Array.prototype.slice.call(arguments);if(h.length<2||h.length>4)throw new k(`Graph.${u}: invalid number of arguments (expecting 2, 3 or 4 and got ${h.length}).`);if(typeof h[h.length-1]=="function"&&typeof h[h.length-2]!="function")throw new k(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let d,l;h.length===2?(d=h[0],l=h[1],h=[]):h.length===3?(d=h[1],l=h[2],h=[h[0]]):h.length===4&&(d=h[2],l=h[3],h=[h[0],h[1]]);let f=l;return h.push((c,y,w,T,D,m,S)=>{f=d(f,c,y,w,T,D,m,S)}),this[a].apply(this,h),f}}function jr(n,i){const{name:t,type:e,direction:r}=i,a="find"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[a]=function(u,h,d){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return!1;if(arguments.length===1)return d=u,Ci(!0,this,e,d);if(arguments.length===2){u=""+u,d=h;const l=this._nodes.get(u);if(typeof l>"u")throw new C(`Graph.${a}: could not find the "${u}" node in the graph.`);return Gt(!0,this.multi,e==="mixed"?this.type:e,r,l,d)}if(arguments.length===3){u=""+u,h=""+h;const l=this._nodes.get(u);if(!l)throw new C(`Graph.${a}: could not find the "${u}" source node in the graph.`);if(!this._nodes.has(h))throw new C(`Graph.${a}: could not find the "${h}" target node in the graph.`);return Ft(!0,e,this.multi,r,l,h,d)}throw new k(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const o="some"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[o]=function(){const u=Array.prototype.slice.call(arguments),h=u.pop();return u.push((l,f,c,y,w,T,D)=>h(l,f,c,y,w,T,D)),!!this[a].apply(this,u)};const s="every"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[s]=function(){const u=Array.prototype.slice.call(arguments),h=u.pop();return u.push((l,f,c,y,w,T,D)=>!h(l,f,c,y,w,T,D)),!this[a].apply(this,u)}}function Vr(n,i){const{name:t,type:e,direction:r}=i,a=t.slice(0,-1)+"Entries";n.prototype[a]=function(o,s){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return Le();if(!arguments.length)return Ur(this,e);if(arguments.length===1){o=""+o;const u=this._nodes.get(o);if(!u)throw new C(`Graph.${a}: could not find the "${o}" node in the graph.`);return $r(e,r,u)}if(arguments.length===2){o=""+o,s=""+s;const u=this._nodes.get(o);if(!u)throw new C(`Graph.${a}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(s))throw new C(`Graph.${a}: could not find the "${s}" target node in the graph.`);return Mr(e,r,u,s)}throw new k(`Graph.${a}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function qr(n){Gr.forEach(i=>{Hr(n,i),Wr(n,i),jr(n,i),Vr(n,i)})}const Kr=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function ut(){this.A=null,this.B=null}ut.prototype.wrap=function(n){this.A===null?this.A=n:this.B===null&&(this.B=n)};ut.prototype.has=function(n){return this.A!==null&&n in this.A||this.B!==null&&n in this.B};function Oe(n,i,t,e,r){for(const a in e){const o=e[a],s=o.source,u=o.target,h=s===t?u:s;if(i&&i.has(h.key))continue;const d=r(h.key,h.attributes);if(n&&d)return h.key}}function Nt(n,i,t,e,r){if(i!=="mixed"){if(i==="undirected")return Oe(n,null,e,e.undirected,r);if(typeof t=="string")return Oe(n,null,e,e[t],r)}const a=new ut;let o;if(i!=="undirected"){if(t!=="out"){if(o=Oe(n,null,e,e.in,r),n&&o)return o;a.wrap(e.in)}if(t!=="in"){if(o=Oe(n,a,e,e.out,r),n&&o)return o;a.wrap(e.out)}}if(i!=="directed"&&(o=Oe(n,a,e,e.undirected,r),n&&o))return o}function Yr(n,i,t){if(n!=="mixed"){if(n==="undirected")return Object.keys(t.undirected);if(typeof i=="string")return Object.keys(t[i])}const e=[];return Nt(!1,n,i,t,function(r){e.push(r)}),e}function Ue(n,i,t){const e=Object.keys(t),r=e.length;let a=0;return{[Symbol.iterator](){return this},next(){let o=null;do{if(a>=r)return n&&n.wrap(t),{done:!0};const s=t[e[a++]],u=s.source,h=s.target;if(o=u===i?h:u,n&&n.has(o.key)){o=null;continue}}while(o===null);return{done:!1,value:{neighbor:o.key,attributes:o.attributes}}}}}function Zr(n,i,t){if(n!=="mixed"){if(n==="undirected")return Ue(null,t,t.undirected);if(typeof i=="string")return Ue(null,t,t[i])}let e=Le();const r=new ut;return n!=="undirected"&&(i!=="out"&&(e=me(e,Ue(r,t,t.in))),i!=="in"&&(e=me(e,Ue(r,t,t.out)))),n!=="directed"&&(e=me(e,Ue(r,t,t.undirected))),e}function Xr(n,i){const{name:t,type:e,direction:r}=i;n.prototype[t]=function(a){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return[];a=""+a;const o=this._nodes.get(a);if(typeof o>"u")throw new C(`Graph.${t}: could not find the "${a}" node in the graph.`);return Yr(e==="mixed"?this.type:e,r,o)}}function Jr(n,i){const{name:t,type:e,direction:r}=i,a="forEach"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[a]=function(h,d){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return;h=""+h;const l=this._nodes.get(h);if(typeof l>"u")throw new C(`Graph.${a}: could not find the "${h}" node in the graph.`);Nt(!1,e==="mixed"?this.type:e,r,l,d)};const o="map"+t[0].toUpperCase()+t.slice(1);n.prototype[o]=function(h,d){const l=[];return this[a](h,(f,c)=>{l.push(d(f,c))}),l};const s="filter"+t[0].toUpperCase()+t.slice(1);n.prototype[s]=function(h,d){const l=[];return this[a](h,(f,c)=>{d(f,c)&&l.push(f)}),l};const u="reduce"+t[0].toUpperCase()+t.slice(1);n.prototype[u]=function(h,d,l){if(arguments.length<3)throw new k(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let f=l;return this[a](h,(c,y)=>{f=d(f,c,y)}),f}}function Qr(n,i){const{name:t,type:e,direction:r}=i,a=t[0].toUpperCase()+t.slice(1,-1),o="find"+a;n.prototype[o]=function(h,d){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return;h=""+h;const l=this._nodes.get(h);if(typeof l>"u")throw new C(`Graph.${o}: could not find the "${h}" node in the graph.`);return Nt(!0,e==="mixed"?this.type:e,r,l,d)};const s="some"+a;n.prototype[s]=function(h,d){return!!this[o](h,d)};const u="every"+a;n.prototype[u]=function(h,d){return!this[o](h,(f,c)=>!d(f,c))}}function en(n,i){const{name:t,type:e,direction:r}=i,a=t.slice(0,-1)+"Entries";n.prototype[a]=function(o){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return Le();o=""+o;const s=this._nodes.get(o);if(typeof s>"u")throw new C(`Graph.${a}: could not find the "${o}" node in the graph.`);return Zr(e==="mixed"?this.type:e,r,s)}}function tn(n){Kr.forEach(i=>{Xr(n,i),Jr(n,i),Qr(n,i),en(n,i)})}function tt(n,i,t,e,r){const a=e._nodes.values(),o=e.type;let s,u,h,d,l,f;for(;s=a.next(),s.done!==!0;){let c=!1;if(u=s.value,o!=="undirected"){d=u.out;for(h in d){l=d[h];do f=l.target,c=!0,r(u.key,f.key,u.attributes,f.attributes,l.key,l.attributes,l.undirected),l=l.next;while(l)}}if(o!=="directed"){d=u.undirected;for(h in d)if(!(i&&u.key>h)){l=d[h];do f=l.target,f.key!==h&&(f=l.source),c=!0,r(u.key,f.key,u.attributes,f.attributes,l.key,l.attributes,l.undirected),l=l.next;while(l)}}t&&!c&&r(u.key,null,u.attributes,null,null,null,null)}}function rn(n,i){const t={key:n};return Ei(i.attributes)||(t.attributes=Z({},i.attributes)),t}function nn(n,i,t){const e={key:i,source:t.source.key,target:t.target.key};return Ei(t.attributes)||(e.attributes=Z({},t.attributes)),n==="mixed"&&t.undirected&&(e.undirected=!0),e}function an(n){if(!J(n))throw new k('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in n))throw new k("Graph.import: serialized node is missing its key.");if("attributes"in n&&(!J(n.attributes)||n.attributes===null))throw new k("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function on(n){if(!J(n))throw new k('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in n))throw new k("Graph.import: serialized edge is missing its source.");if(!("target"in n))throw new k("Graph.import: serialized edge is missing its target.");if("attributes"in n&&(!J(n.attributes)||n.attributes===null))throw new k("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in n&&typeof n.undirected!="boolean")throw new k("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const sn=ur(),un=new Set(["directed","undirected","mixed"]),Bt=new Set(["domain","_events","_eventsCount","_maxListeners"]),hn=[{name:n=>`${n}Edge`,generateKey:!0},{name:n=>`${n}DirectedEdge`,generateKey:!0,type:"directed"},{name:n=>`${n}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:n=>`${n}EdgeWithKey`},{name:n=>`${n}DirectedEdgeWithKey`,type:"directed"},{name:n=>`${n}UndirectedEdgeWithKey`,type:"undirected"}],dn={allowSelfLoops:!0,multi:!1,type:"mixed"};function ln(n,i,t){if(t&&!J(t))throw new k(`Graph.addNode: invalid attributes. Expecting an object but got "${t}"`);if(i=""+i,t=t||{},n._nodes.has(i))throw new I(`Graph.addNode: the "${i}" node already exist in the graph.`);const e=new n.NodeDataClass(i,t);return n._nodes.set(i,e),n.emit("nodeAdded",{key:i,attributes:t}),e}function Mt(n,i,t){const e=new n.NodeDataClass(i,t);return n._nodes.set(i,e),n.emit("nodeAdded",{key:i,attributes:t}),e}function ki(n,i,t,e,r,a,o,s){if(!e&&n.type==="undirected")throw new I(`Graph.${i}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(e&&n.type==="directed")throw new I(`Graph.${i}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(s&&!J(s))throw new k(`Graph.${i}: invalid attributes. Expecting an object but got "${s}"`);if(a=""+a,o=""+o,s=s||{},!n.allowSelfLoops&&a===o)throw new I(`Graph.${i}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const u=n._nodes.get(a),h=n._nodes.get(o);if(!u)throw new C(`Graph.${i}: source node "${a}" not found.`);if(!h)throw new C(`Graph.${i}: target node "${o}" not found.`);const d={key:null,undirected:e,source:a,target:o,attributes:s};if(t)r=n._edgeKeyGenerator();else if(r=""+r,n._edges.has(r))throw new I(`Graph.${i}: the "${r}" edge already exists in the graph.`);if(!n.multi&&(e?typeof u.undirected[o]<"u":typeof u.out[o]<"u"))throw new I(`Graph.${i}: an edge linking "${a}" to "${o}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const l=new Ge(e,r,u,h,s);n._edges.set(r,l);const f=a===o;return e?(u.undirectedDegree++,h.undirectedDegree++,f&&(u.undirectedLoops++,n._undirectedSelfLoopCount++)):(u.outDegree++,h.inDegree++,f&&(u.directedLoops++,n._directedSelfLoopCount++)),n.multi?l.attachMulti():l.attach(),e?n._undirectedSize++:n._directedSize++,d.key=r,n.emit("edgeAdded",d),r}function cn(n,i,t,e,r,a,o,s,u){if(!e&&n.type==="undirected")throw new I(`Graph.${i}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(e&&n.type==="directed")throw new I(`Graph.${i}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(s){if(u){if(typeof s!="function")throw new k(`Graph.${i}: invalid updater function. Expecting a function but got "${s}"`)}else if(!J(s))throw new k(`Graph.${i}: invalid attributes. Expecting an object but got "${s}"`)}a=""+a,o=""+o;let h;if(u&&(h=s,s=void 0),!n.allowSelfLoops&&a===o)throw new I(`Graph.${i}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let d=n._nodes.get(a),l=n._nodes.get(o),f,c;if(!t&&(f=n._edges.get(r),f)){if((f.source.key!==a||f.target.key!==o)&&(!e||f.source.key!==o||f.target.key!==a))throw new I(`Graph.${i}: inconsistency detected when attempting to merge the "${r}" edge with "${a}" source & "${o}" target vs. ("${f.source.key}", "${f.target.key}").`);c=f}if(!c&&!n.multi&&d&&(c=e?d.undirected[o]:d.out[o]),c){const m=[c.key,!1,!1,!1];if(u?!h:!s)return m;if(u){const S=c.attributes;c.attributes=h(S),n.emit("edgeAttributesUpdated",{type:"replace",key:c.key,attributes:c.attributes})}else Z(c.attributes,s),n.emit("edgeAttributesUpdated",{type:"merge",key:c.key,attributes:c.attributes,data:s});return m}s=s||{},u&&h&&(s=h(s));const y={key:null,undirected:e,source:a,target:o,attributes:s};if(t)r=n._edgeKeyGenerator();else if(r=""+r,n._edges.has(r))throw new I(`Graph.${i}: the "${r}" edge already exists in the graph.`);let w=!1,T=!1;d||(d=Mt(n,a,{}),w=!0,a===o&&(l=d,T=!0)),l||(l=Mt(n,o,{}),T=!0),f=new Ge(e,r,d,l,s),n._edges.set(r,f);const D=a===o;return e?(d.undirectedDegree++,l.undirectedDegree++,D&&(d.undirectedLoops++,n._undirectedSelfLoopCount++)):(d.outDegree++,l.inDegree++,D&&(d.directedLoops++,n._directedSelfLoopCount++)),n.multi?f.attachMulti():f.attach(),e?n._undirectedSize++:n._directedSize++,y.key=r,n.emit("edgeAdded",y),[r,!0,w,T]}function xe(n,i){n._edges.delete(i.key);const{source:t,target:e,attributes:r}=i,a=i.undirected,o=t===e;a?(t.undirectedDegree--,e.undirectedDegree--,o&&(t.undirectedLoops--,n._undirectedSelfLoopCount--)):(t.outDegree--,e.inDegree--,o&&(t.directedLoops--,n._directedSelfLoopCount--)),n.multi?i.detachMulti():i.detach(),a?n._undirectedSize--:n._directedSize--,n.emit("edgeDropped",{key:i.key,attributes:r,source:t.key,target:e.key,undirected:a})}class j extends wi.EventEmitter{constructor(i){if(super(),i=Z({},dn,i),typeof i.multi!="boolean")throw new k(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${i.multi}".`);if(!un.has(i.type))throw new k(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${i.type}".`);if(typeof i.allowSelfLoops!="boolean")throw new k(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${i.allowSelfLoops}".`);const t=i.type==="mixed"?_i:i.type==="directed"?Ti:Si;ae(this,"NodeDataClass",t);const e="geid_"+sn()+"_";let r=0;const a=()=>{let o;do o=e+r++;while(this._edges.has(o));return o};ae(this,"_attributes",{}),ae(this,"_nodes",new Map),ae(this,"_edges",new Map),ae(this,"_directedSize",0),ae(this,"_undirectedSize",0),ae(this,"_directedSelfLoopCount",0),ae(this,"_undirectedSelfLoopCount",0),ae(this,"_edgeKeyGenerator",a),ae(this,"_options",i),Bt.forEach(o=>ae(this,o,this[o])),he(this,"order",()=>this._nodes.size),he(this,"size",()=>this._edges.size),he(this,"directedSize",()=>this._directedSize),he(this,"undirectedSize",()=>this._undirectedSize),he(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),he(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),he(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),he(this,"multi",this._options.multi),he(this,"type",this._options.type),he(this,"allowSelfLoops",this._options.allowSelfLoops),he(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(i){return this._nodes.has(""+i)}hasDirectedEdge(i,t){if(this.type==="undirected")return!1;if(arguments.length===1){const e=""+i,r=this._edges.get(e);return!!r&&!r.undirected}else if(arguments.length===2){i=""+i,t=""+t;const e=this._nodes.get(i);return e?e.out.hasOwnProperty(t):!1}throw new k(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(i,t){if(this.type==="directed")return!1;if(arguments.length===1){const e=""+i,r=this._edges.get(e);return!!r&&r.undirected}else if(arguments.length===2){i=""+i,t=""+t;const e=this._nodes.get(i);return e?e.undirected.hasOwnProperty(t):!1}throw new k(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(i,t){if(arguments.length===1){const e=""+i;return this._edges.has(e)}else if(arguments.length===2){i=""+i,t=""+t;const e=this._nodes.get(i);return e?typeof e.out<"u"&&e.out.hasOwnProperty(t)||typeof e.undirected<"u"&&e.undirected.hasOwnProperty(t):!1}throw new k(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(i,t){if(this.type==="undirected")return;if(i=""+i,t=""+t,this.multi)throw new I("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const e=this._nodes.get(i);if(!e)throw new C(`Graph.directedEdge: could not find the "${i}" source node in the graph.`);if(!this._nodes.has(t))throw new C(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);const r=e.out&&e.out[t]||void 0;if(r)return r.key}undirectedEdge(i,t){if(this.type==="directed")return;if(i=""+i,t=""+t,this.multi)throw new I("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const e=this._nodes.get(i);if(!e)throw new C(`Graph.undirectedEdge: could not find the "${i}" source node in the graph.`);if(!this._nodes.has(t))throw new C(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);const r=e.undirected&&e.undirected[t]||void 0;if(r)return r.key}edge(i,t){if(this.multi)throw new I("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.edge: could not find the "${i}" source node in the graph.`);if(!this._nodes.has(t))throw new C(`Graph.edge: could not find the "${t}" target node in the graph.`);const r=e.out&&e.out[t]||e.undirected&&e.undirected[t]||void 0;if(r)return r.key}areDirectedNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areDirectedNeighbors: could not find the "${i}" node in the graph.`);return this.type==="undirected"?!1:t in e.in||t in e.out}areOutNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areOutNeighbors: could not find the "${i}" node in the graph.`);return this.type==="undirected"?!1:t in e.out}areInNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areInNeighbors: could not find the "${i}" node in the graph.`);return this.type==="undirected"?!1:t in e.in}areUndirectedNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areUndirectedNeighbors: could not find the "${i}" node in the graph.`);return this.type==="directed"?!1:t in e.undirected}areNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areNeighbors: could not find the "${i}" node in the graph.`);return this.type!=="undirected"&&(t in e.in||t in e.out)||this.type!=="directed"&&t in e.undirected}areInboundNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areInboundNeighbors: could not find the "${i}" node in the graph.`);return this.type!=="undirected"&&t in e.in||this.type!=="directed"&&t in e.undirected}areOutboundNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areOutboundNeighbors: could not find the "${i}" node in the graph.`);return this.type!=="undirected"&&t in e.out||this.type!=="directed"&&t in e.undirected}inDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.inDegree: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.inDegree}outDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.outDegree: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.outDegree}directedDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.directedDegree: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree}undirectedDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.undirectedDegree: could not find the "${i}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree}inboundDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.inboundDegree: could not find the "${i}" node in the graph.`);let e=0;return this.type!=="directed"&&(e+=t.undirectedDegree),this.type!=="undirected"&&(e+=t.inDegree),e}outboundDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.outboundDegree: could not find the "${i}" node in the graph.`);let e=0;return this.type!=="directed"&&(e+=t.undirectedDegree),this.type!=="undirected"&&(e+=t.outDegree),e}degree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.degree: could not find the "${i}" node in the graph.`);let e=0;return this.type!=="directed"&&(e+=t.undirectedDegree),this.type!=="undirected"&&(e+=t.inDegree+t.outDegree),e}inDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.inDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.outDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.directedDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);let e=0,r=0;return this.type!=="directed"&&(e+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(e+=t.inDegree,r+=t.directedLoops),e-r}outboundDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);let e=0,r=0;return this.type!=="directed"&&(e+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(e+=t.outDegree,r+=t.directedLoops),e-r}degreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.degreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);let e=0,r=0;return this.type!=="directed"&&(e+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(e+=t.inDegree+t.outDegree,r+=t.directedLoops*2),e-r}source(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.source: could not find the "${i}" edge in the graph.`);return t.source.key}target(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.target: could not find the "${i}" edge in the graph.`);return t.target.key}extremities(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.extremities: could not find the "${i}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(i,t){i=""+i,t=""+t;const e=this._edges.get(t);if(!e)throw new C(`Graph.opposite: could not find the "${t}" edge in the graph.`);const r=e.source.key,a=e.target.key;if(i===r)return a;if(i===a)return r;throw new C(`Graph.opposite: the "${i}" node is not attached to the "${t}" edge (${r}, ${a}).`)}hasExtremity(i,t){i=""+i,t=""+t;const e=this._edges.get(i);if(!e)throw new C(`Graph.hasExtremity: could not find the "${i}" edge in the graph.`);return e.source.key===t||e.target.key===t}isUndirected(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.isUndirected: could not find the "${i}" edge in the graph.`);return t.undirected}isDirected(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.isDirected: could not find the "${i}" edge in the graph.`);return!t.undirected}isSelfLoop(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.isSelfLoop: could not find the "${i}" edge in the graph.`);return t.source===t.target}addNode(i,t){return ln(this,i,t).key}mergeNode(i,t){if(t&&!J(t))throw new k(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);i=""+i,t=t||{};let e=this._nodes.get(i);return e?(t&&(Z(e.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:i,attributes:e.attributes,data:t})),[i,!1]):(e=new this.NodeDataClass(i,t),this._nodes.set(i,e),this.emit("nodeAdded",{key:i,attributes:t}),[i,!0])}updateNode(i,t){if(t&&typeof t!="function")throw new k(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);i=""+i;let e=this._nodes.get(i);if(e){if(t){const a=e.attributes;e.attributes=t(a),this.emit("nodeAttributesUpdated",{type:"replace",key:i,attributes:e.attributes})}return[i,!1]}const r=t?t({}):{};return e=new this.NodeDataClass(i,r),this._nodes.set(i,e),this.emit("nodeAdded",{key:i,attributes:r}),[i,!0]}dropNode(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.dropNode: could not find the "${i}" node in the graph.`);let e;if(this.type!=="undirected"){for(const r in t.out){e=t.out[r];do xe(this,e),e=e.next;while(e)}for(const r in t.in){e=t.in[r];do xe(this,e),e=e.next;while(e)}}if(this.type!=="directed")for(const r in t.undirected){e=t.undirected[r];do xe(this,e),e=e.next;while(e)}this._nodes.delete(i),this.emit("nodeDropped",{key:i,attributes:t.attributes})}dropEdge(i){let t;if(arguments.length>1){const e=""+arguments[0],r=""+arguments[1];if(t=oe(this,e,r,this.type),!t)throw new C(`Graph.dropEdge: could not find the "${e}" -> "${r}" edge in the graph.`)}else if(i=""+i,t=this._edges.get(i),!t)throw new C(`Graph.dropEdge: could not find the "${i}" edge in the graph.`);return xe(this,t),this}dropDirectedEdge(i,t){if(arguments.length<2)throw new I("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new I("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");i=""+i,t=""+t;const e=oe(this,i,t,"directed");if(!e)throw new C(`Graph.dropDirectedEdge: could not find a "${i}" -> "${t}" edge in the graph.`);return xe(this,e),this}dropUndirectedEdge(i,t){if(arguments.length<2)throw new I("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new I("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const e=oe(this,i,t,"undirected");if(!e)throw new C(`Graph.dropUndirectedEdge: could not find a "${i}" -> "${t}" edge in the graph.`);return xe(this,e),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const i=this._nodes.values();let t;for(;t=i.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(i){return this._attributes[i]}getAttributes(){return this._attributes}hasAttribute(i){return this._attributes.hasOwnProperty(i)}setAttribute(i,t){return this._attributes[i]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:i}),this}updateAttribute(i,t){if(typeof t!="function")throw new k("Graph.updateAttribute: updater should be a function.");const e=this._attributes[i];return this._attributes[i]=t(e),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:i}),this}removeAttribute(i){return delete this._attributes[i],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:i}),this}replaceAttributes(i){if(!J(i))throw new k("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=i,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(i){if(!J(i))throw new k("Graph.mergeAttributes: provided attributes are not a plain object.");return Z(this._attributes,i),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:i}),this}updateAttributes(i){if(typeof i!="function")throw new k("Graph.updateAttributes: provided updater is not a function.");return this._attributes=i(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(i,t){if(typeof i!="function")throw new k("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!$t(t))throw new k("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const e=this._nodes.values();let r,a;for(;r=e.next(),r.done!==!0;)a=r.value,a.attributes=i(a.key,a.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})}updateEachEdgeAttributes(i,t){if(typeof i!="function")throw new k("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!$t(t))throw new k("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const e=this._edges.values();let r,a,o,s;for(;r=e.next(),r.done!==!0;)a=r.value,o=a.source,s=a.target,a.attributes=i(a.key,a.attributes,o.key,s.key,o.attributes,s.attributes,a.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})}forEachAdjacencyEntry(i){if(typeof i!="function")throw new k("Graph.forEachAdjacencyEntry: expecting a callback.");tt(!1,!1,!1,this,i)}forEachAdjacencyEntryWithOrphans(i){if(typeof i!="function")throw new k("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");tt(!1,!1,!0,this,i)}forEachAssymetricAdjacencyEntry(i){if(typeof i!="function")throw new k("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");tt(!1,!0,!1,this,i)}forEachAssymetricAdjacencyEntryWithOrphans(i){if(typeof i!="function")throw new k("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");tt(!1,!0,!0,this,i)}nodes(){return Array.from(this._nodes.keys())}forEachNode(i){if(typeof i!="function")throw new k("Graph.forEachNode: expecting a callback.");const t=this._nodes.values();let e,r;for(;e=t.next(),e.done!==!0;)r=e.value,i(r.key,r.attributes)}findNode(i){if(typeof i!="function")throw new k("Graph.findNode: expecting a callback.");const t=this._nodes.values();let e,r;for(;e=t.next(),e.done!==!0;)if(r=e.value,i(r.key,r.attributes))return r.key}mapNodes(i){if(typeof i!="function")throw new k("Graph.mapNode: expecting a callback.");const t=this._nodes.values();let e,r;const a=new Array(this.order);let o=0;for(;e=t.next(),e.done!==!0;)r=e.value,a[o++]=i(r.key,r.attributes);return a}someNode(i){if(typeof i!="function")throw new k("Graph.someNode: expecting a callback.");const t=this._nodes.values();let e,r;for(;e=t.next(),e.done!==!0;)if(r=e.value,i(r.key,r.attributes))return!0;return!1}everyNode(i){if(typeof i!="function")throw new k("Graph.everyNode: expecting a callback.");const t=this._nodes.values();let e,r;for(;e=t.next(),e.done!==!0;)if(r=e.value,!i(r.key,r.attributes))return!1;return!0}filterNodes(i){if(typeof i!="function")throw new k("Graph.filterNodes: expecting a callback.");const t=this._nodes.values();let e,r;const a=[];for(;e=t.next(),e.done!==!0;)r=e.value,i(r.key,r.attributes)&&a.push(r.key);return a}reduceNodes(i,t){if(typeof i!="function")throw new k("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new k("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let e=t;const r=this._nodes.values();let a,o;for(;a=r.next(),a.done!==!0;)o=a.value,e=i(e,o.key,o.attributes);return e}nodeEntries(){const i=this._nodes.values();return{[Symbol.iterator](){return this},next(){const t=i.next();if(t.done)return t;const e=t.value;return{value:{node:e.key,attributes:e.attributes},done:!1}}}}export(){const i=new Array(this._nodes.size);let t=0;this._nodes.forEach((r,a)=>{i[t++]=rn(a,r)});const e=new Array(this._edges.size);return t=0,this._edges.forEach((r,a)=>{e[t++]=nn(this.type,a,r)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:i,edges:e}}import(i,t=!1){if(i instanceof j)return i.forEachNode((u,h)=>{t?this.mergeNode(u,h):this.addNode(u,h)}),i.forEachEdge((u,h,d,l,f,c,y)=>{t?y?this.mergeUndirectedEdgeWithKey(u,d,l,h):this.mergeDirectedEdgeWithKey(u,d,l,h):y?this.addUndirectedEdgeWithKey(u,d,l,h):this.addDirectedEdgeWithKey(u,d,l,h)}),this;if(!J(i))throw new k("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(i.attributes){if(!J(i.attributes))throw new k("Graph.import: invalid attributes. Expecting a plain object.");t?this.mergeAttributes(i.attributes):this.replaceAttributes(i.attributes)}let e,r,a,o,s;if(i.nodes){if(a=i.nodes,!Array.isArray(a))throw new k("Graph.import: invalid nodes. Expecting an array.");for(e=0,r=a.length;e{const a=Z({},e.attributes);e=new t.NodeDataClass(r,a),t._nodes.set(r,e)}),t}copy(i){if(i=i||{},typeof i.type=="string"&&i.type!==this.type&&i.type!=="mixed")throw new I(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${i.type}" because this would mean losing information about the current graph.`);if(typeof i.multi=="boolean"&&i.multi!==this.multi&&i.multi!==!0)throw new I("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof i.allowSelfLoops=="boolean"&&i.allowSelfLoops!==this.allowSelfLoops&&i.allowSelfLoops!==!0)throw new I("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const t=this.emptyCopy(i),e=this._edges.values();let r,a;for(;r=e.next(),r.done!==!0;)a=r.value,ki(t,"copy",!1,a.undirected,a.key,a.source.key,a.target.key,Z({},a.attributes));return t}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const i={};this._nodes.forEach((a,o)=>{i[o]=a.attributes});const t={},e={};this._edges.forEach((a,o)=>{const s=a.undirected?"--":"->";let u="",h=a.source.key,d=a.target.key,l;a.undirected&&h>d&&(l=h,h=d,d=l);const f=`(${h})${s}(${d})`;o.startsWith("geid_")?this.multi&&(typeof e[f]>"u"?e[f]=0:e[f]++,u+=`${e[f]}. `):u+=`[${o}]: `,u+=f,t[u]=a.attributes});const r={};for(const a in this)this.hasOwnProperty(a)&&!Bt.has(a)&&typeof this[a]!="function"&&typeof a!="symbol"&&(r[a]=this[a]);return r.attributes=this._attributes,r.nodes=i,r.edges=t,ae(r,"constructor",this.constructor),r}}typeof Symbol<"u"&&(j.prototype[Symbol.for("nodejs.util.inspect.custom")]=j.prototype.inspect);hn.forEach(n=>{["add","merge","update"].forEach(i=>{const t=n.name(i),e=i==="add"?ki:cn;n.generateKey?j.prototype[t]=function(r,a,o){return e(this,t,!0,(n.type||this.type)==="undirected",null,r,a,o,i==="update")}:j.prototype[t]=function(r,a,o,s){return e(this,t,!1,(n.type||this.type)==="undirected",r,a,o,s,i==="update")}})});wr(j);Lr(j);qr(j);tn(j);class Di extends j{constructor(i){const t=Z({type:"directed"},i);if("multi"in t&&t.multi!==!1)throw new k("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="directed")throw new k('DirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class Li extends j{constructor(i){const t=Z({type:"undirected"},i);if("multi"in t&&t.multi!==!1)throw new k("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="undirected")throw new k('UndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class Gi extends j{constructor(i){const t=Z({multi:!0},i);if("multi"in t&&t.multi!==!0)throw new k("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(t)}}class Fi extends j{constructor(i){const t=Z({type:"directed",multi:!0},i);if("multi"in t&&t.multi!==!0)throw new k("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="directed")throw new k('MultiDirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class Ni extends j{constructor(i){const t=Z({type:"undirected",multi:!0},i);if("multi"in t&&t.multi!==!0)throw new k("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="undirected")throw new k('MultiUndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}function Fe(n){n.from=function(i,t){const e=Z({},i.options,t),r=new n(e);return r.import(i),r}}Fe(j);Fe(Di);Fe(Li);Fe(Gi);Fe(Fi);Fe(Ni);j.Graph=j;j.DirectedGraph=Di;j.UndirectedGraph=Li;j.MultiGraph=Gi;j.MultiDirectedGraph=Fi;j.MultiUndirectedGraph=Ni;j.InvalidArgumentsGraphError=k;j.NotFoundGraphError=C;j.UsageGraphError=I;var ft,Ht;function Pi(){return Ht||(Ht=1,ft=function(i){return i!==null&&typeof i=="object"&&typeof i.addUndirectedEdgeWithKey=="function"&&typeof i.dropNode=="function"&&typeof i.multi=="boolean"}),ft}var ze={},Wt;function fn(){if(Wt)return ze;Wt=1;function n(e){return typeof e!="number"||isNaN(e)?1:e}function i(e,r){var a={},o=function(h){return typeof h>"u"?r:h};typeof r=="function"&&(o=r);var s=function(h){return o(h[e])},u=function(){return o(void 0)};return typeof e=="string"?(a.fromAttributes=s,a.fromGraph=function(h,d){return s(h.getNodeAttributes(d))},a.fromEntry=function(h,d){return s(d)}):typeof e=="function"?(a.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},a.fromGraph=function(h,d){return o(e(d,h.getNodeAttributes(d)))},a.fromEntry=function(h,d){return o(e(h,d))}):(a.fromAttributes=u,a.fromGraph=u,a.fromEntry=u),a}function t(e,r){var a={},o=function(h){return typeof h>"u"?r:h};typeof r=="function"&&(o=r);var s=function(h){return o(h[e])},u=function(){return o(void 0)};return typeof e=="string"?(a.fromAttributes=s,a.fromGraph=function(h,d){return s(h.getEdgeAttributes(d))},a.fromEntry=function(h,d){return s(d)},a.fromPartialEntry=a.fromEntry,a.fromMinimalEntry=a.fromEntry):typeof e=="function"?(a.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},a.fromGraph=function(h,d){var l=h.extremities(d);return o(e(d,h.getEdgeAttributes(d),l[0],l[1],h.getNodeAttributes(l[0]),h.getNodeAttributes(l[1]),h.isUndirected(d)))},a.fromEntry=function(h,d,l,f,c,y,w){return o(e(h,d,l,f,c,y,w))},a.fromPartialEntry=function(h,d,l,f){return o(e(h,d,l,f))},a.fromMinimalEntry=function(h,d){return o(e(h,d))}):(a.fromAttributes=u,a.fromGraph=u,a.fromEntry=u,a.fromMinimalEntry=u),a}return ze.createNodeValueGetter=i,ze.createEdgeValueGetter=t,ze.createEdgeWeightGetter=function(e){return t(e,n)},ze}var gt,jt;function gn(){if(jt)return gt;jt=1;var n=0,i=1,t=2,e=3,r=4,a=5,o=6,s=7,u=8,h=9,d=0,l=1,f=2,c=0,y=1,w=2,T=3,D=4,m=5,S=6,p=7,b=8,R=3,A=10,G=3,F=9,P=10;return gt=function(z,g,K){var te,x,v,$,W,X,ie,Y,N,Ne,re=g.length,tr=K.length,Pe=z.adjustSizes,ir=z.barnesHutTheta*z.barnesHutTheta,qe,q,B,M,fe,U,O,E=[];for(v=0;vYe?(Ee-=(Ke-Ye)/2,Re=Ee+Ke):(we-=(Ye-Ke)/2,Se=we+Ye),E[0+c]=-1,E[0+y]=(we+Se)/2,E[0+w]=(Ee+Re)/2,E[0+T]=Math.max(Se-we,Re-Ee),E[0+D]=-1,E[0+m]=-1,E[0+S]=0,E[0+p]=0,E[0+b]=0,te=1,v=0;v=0){g[v+n]=0)if(U=Math.pow(g[v+n]-E[x+p],2)+Math.pow(g[v+i]-E[x+b],2),Ne=E[x+T],4*Ne*Ne/U0?(O=q*g[v+o]*E[x+S]/U,g[v+t]+=B*O,g[v+e]+=M*O):U<0&&(O=-q*g[v+o]*E[x+S]/Math.sqrt(U),g[v+t]+=B*O,g[v+e]+=M*O):U>0&&(O=q*g[v+o]*E[x+S]/U,g[v+t]+=B*O,g[v+e]+=M*O),x=E[x+D],x<0)break;continue}else{x=E[x+m];continue}else{if(X=E[x+c],X>=0&&X!==v&&(B=g[v+n]-g[X+n],M=g[v+i]-g[X+i],U=B*B+M*M,Pe===!0?U>0?(O=q*g[v+o]*g[X+o]/U,g[v+t]+=B*O,g[v+e]+=M*O):U<0&&(O=-q*g[v+o]*g[X+o]/Math.sqrt(U),g[v+t]+=B*O,g[v+e]+=M*O):U>0&&(O=q*g[v+o]*g[X+o]/U,g[v+t]+=B*O,g[v+e]+=M*O)),x=E[x+D],x<0)break;continue}else for(q=z.scalingRatio,$=0;$0?(O=q*g[$+o]*g[W+o]/U/U,g[$+t]+=B*O,g[$+e]+=M*O,g[W+t]-=B*O,g[W+e]-=M*O):U<0&&(O=100*q*g[$+o]*g[W+o],g[$+t]+=B*O,g[$+e]+=M*O,g[W+t]-=B*O,g[W+e]-=M*O)):(U=Math.sqrt(B*B+M*M),U>0&&(O=q*g[$+o]*g[W+o]/U/U,g[$+t]+=B*O,g[$+e]+=M*O,g[W+t]-=B*O,g[W+e]-=M*O));for(N=z.gravity/z.scalingRatio,q=z.scalingRatio,v=0;v0&&(O=q*g[v+o]*N):U>0&&(O=q*g[v+o]*N/U),g[v+t]-=B*O,g[v+e]-=M*O;for(q=1*(z.outboundAttractionDistribution?qe:1),ie=0;ie0&&(O=-q*fe*Math.log(1+U)/U/g[$+o]):U>0&&(O=-q*fe*Math.log(1+U)/U):z.outboundAttractionDistribution?U>0&&(O=-q*fe/g[$+o]):U>0&&(O=-q*fe)):(U=Math.sqrt(Math.pow(B,2)+Math.pow(M,2)),z.linLogMode?z.outboundAttractionDistribution?U>0&&(O=-q*fe*Math.log(1+U)/U/g[$+o]):U>0&&(O=-q*fe*Math.log(1+U)/U):z.outboundAttractionDistribution?(U=1,O=-q*fe/g[$+o]):(U=1,O=-q*fe)),U>0&&(g[$+t]+=B*O,g[$+e]+=M*O,g[W+t]-=B*O,g[W+e]-=M*O);var Ze,Ie,Xe,_e,Je,Qe;if(Pe===!0)for(v=0;vP&&(g[v+t]=g[v+t]*P/Ze,g[v+e]=g[v+e]*P/Ze),Ie=g[v+o]*Math.sqrt((g[v+r]-g[v+t])*(g[v+r]-g[v+t])+(g[v+a]-g[v+e])*(g[v+a]-g[v+e])),Xe=Math.sqrt((g[v+r]+g[v+t])*(g[v+r]+g[v+t])+(g[v+a]+g[v+e])*(g[v+a]+g[v+e]))/2,_e=.1*Math.log(1+Xe)/(1+Math.sqrt(Ie)),Je=g[v+n]+g[v+t]*(_e/z.slowDown),g[v+n]=Je,Qe=g[v+i]+g[v+e]*(_e/z.slowDown),g[v+i]=Qe);else for(v=0;v=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in t&&typeof t.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in t&&!(typeof t.gravity=="number"&&t.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in t&&!(typeof t.slowDown=="number"||t.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in t&&typeof t.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in t&&!(typeof t.barnesHutTheta=="number"&&t.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},ge.graphToByteArrays=function(t,e){var r=t.order,a=t.size,o={},s,u=new Float32Array(r*n),h=new Float32Array(a*i);return s=0,t.forEachNode(function(d,l){o[d]=s,u[s]=l.x,u[s+1]=l.y,u[s+2]=0,u[s+3]=0,u[s+4]=0,u[s+5]=0,u[s+6]=1,u[s+7]=1,u[s+8]=l.size||1,u[s+9]=l.fixed?1:0,s+=n}),s=0,t.forEachEdge(function(d,l,f,c,y,w,T){var D=o[f],m=o[c],S=e(d,l,f,c,y,w,T);u[D+6]+=S,u[m+6]+=S,h[s]=D,h[s+1]=m,h[s+2]=S,s+=i}),{nodes:u,edges:h}},ge.assignLayoutChanges=function(t,e,r){var a=0;t.updateEachNodeAttributes(function(o,s){return s.x=e[a],s.y=e[a+1],a+=n,r?r(o,s):s})},ge.readGraphPositions=function(t,e){var r=0;t.forEachNode(function(a,o){e[r]=o.x,e[r+1]=o.y,r+=n})},ge.collectLayoutChanges=function(t,e,r){for(var a=t.nodes(),o={},s=0,u=0,h=e.length;s2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(h)}}var s=a.bind(null,!1);return s.assign=a.bind(null,!0),s.inferSettings=o,vt=s,vt}var yn=mn();const it=bi(yn);function bn(n,i){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var e=t.call(n,i);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}function je(n){var i=bn(n,"string");return typeof i=="symbol"?i:i+""}function Q(n,i){if(!(n instanceof i))throw new TypeError("Cannot call a class as a function")}function Yt(n,i){for(var t=0;tn.length)&&(i=n.length);for(var t=0,e=Array(i);t0&&(P=R[0]),P instanceof Error)throw P;var V=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw V.context=P,V}var z=F[b];if(z===void 0)return!1;if(typeof z=="function")i(z,this,R);else for(var g=z.length,K=y(z,g),A=0;A0&&P.length>G&&!P.warned){P.warned=!0;var V=new Error("Possible EventEmitter memory leak detected. "+P.length+" "+String(b)+" listeners added. Use emitter.setMaxListeners() to increase limit");V.name="MaxListenersExceededWarning",V.emitter=p,V.type=b,V.count=P.length,e(V)}return p}a.prototype.addListener=function(b,R){return h(this,b,R,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(b,R){return h(this,b,R,!0)};function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(p,b,R){var A={fired:!1,wrapFn:void 0,target:p,type:b,listener:R},G=d.bind(A);return G.listener=R,A.wrapFn=G,G}a.prototype.once=function(b,R){return s(R),this.on(b,l(this,b,R)),this},a.prototype.prependOnceListener=function(b,R){return s(R),this.prependListener(b,l(this,b,R)),this},a.prototype.removeListener=function(b,R){var A,G,F,P,V;if(s(R),G=this._events,G===void 0)return this;if(A=G[b],A===void 0)return this;if(A===R||A.listener===R)--this._eventsCount===0?this._events=Object.create(null):(delete G[b],G.removeListener&&this.emit("removeListener",b,A.listener||R));else if(typeof A!="function"){for(F=-1,P=A.length-1;P>=0;P--)if(A[P]===R||A[P].listener===R){V=A[P].listener,F=P;break}if(F<0)return this;F===0?A.shift():w(A,F),A.length===1&&(G[b]=A[0]),G.removeListener!==void 0&&this.emit("removeListener",b,V||R)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(b){var R,A,G;if(A=this._events,A===void 0)return this;if(A.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):A[b]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete A[b]),this;if(arguments.length===0){var F=Object.keys(A),P;for(G=0;G=0;G--)this.removeListener(b,R[G]);return this};function f(p,b,R){var A=p._events;if(A===void 0)return[];var G=A[b];return G===void 0?[]:typeof G=="function"?R?[G.listener||G]:[G]:R?T(G):y(G,G.length)}a.prototype.listeners=function(b){return f(this,b,!0)},a.prototype.rawListeners=function(b){return f(this,b,!1)},a.listenerCount=function(p,b){return typeof p.listenerCount=="function"?p.listenerCount(b):c.call(p,b)},a.prototype.listenerCount=c;function c(p){var b=this._events;if(b!==void 0){var R=b[p];if(typeof R=="function")return 1;if(R!==void 0)return R.length}return 0}a.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function y(p,b){for(var R=new Array(b),A=0;An++}function me(){const n=arguments;let i=null,t=-1;return{[Symbol.iterator](){return this},next(){let e=null;do{if(i===null){if(t++,t>=n.length)return{done:!0};i=n[t][Symbol.iterator]()}if(e=i.next(),e.done){i=null;continue}break}while(!0);return e}}}function Le(){return{[Symbol.iterator](){return this},next(){return{done:!0}}}}class Lt extends Error{constructor(i){super(),this.name="GraphError",this.message=i}}class k extends Lt{constructor(i){super(i),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,k.prototype.constructor)}}class C extends Lt{constructor(i){super(i),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,C.prototype.constructor)}}class I extends Lt{constructor(i){super(i),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,I.prototype.constructor)}}function _i(n,i){this.key=n,this.attributes=i,this.clear()}_i.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function Ti(n,i){this.key=n,this.attributes=i,this.clear()}Ti.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function Si(n,i){this.key=n,this.attributes=i,this.clear()}Si.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Ge(n,i,t,e,r){this.key=i,this.attributes=r,this.undirected=n,this.source=t,this.target=e}Ge.prototype.attach=function(){let n="out",i="in";this.undirected&&(n=i="undirected");const t=this.source.key,e=this.target.key;this.source[n][e]=this,!(this.undirected&&t===e)&&(this.target[i][t]=this)};Ge.prototype.attachMulti=function(){let n="out",i="in";const t=this.source.key,e=this.target.key;this.undirected&&(n=i="undirected");const r=this.source[n],a=r[e];if(typeof a>"u"){r[e]=this,this.undirected&&t===e||(this.target[i][t]=this);return}a.previous=this,this.next=a,r[e]=this,this.target[i][t]=this};Ge.prototype.detach=function(){const n=this.source.key,i=this.target.key;let t="out",e="in";this.undirected&&(t=e="undirected"),delete this.source[t][i],delete this.target[e][n]};Ge.prototype.detachMulti=function(){const n=this.source.key,i=this.target.key;let t="out",e="in";this.undirected&&(t=e="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[t][i],delete this.target[e][n]):(this.next.previous=void 0,this.source[t][i]=this.next,this.target[e][n]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const Ri=0,Ai=1,hr=2,xi=3;function ye(n,i,t,e,r,a,o){let s,u,h,d;if(e=""+e,t===Ri){if(s=n._nodes.get(e),!s)throw new C(`Graph.${i}: could not find the "${e}" node in the graph.`);h=r,d=a}else if(t===xi){if(r=""+r,u=n._edges.get(r),!u)throw new C(`Graph.${i}: could not find the "${r}" edge in the graph.`);const l=u.source.key,f=u.target.key;if(e===l)s=u.target;else if(e===f)s=u.source;else throw new C(`Graph.${i}: the "${e}" node is not attached to the "${r}" edge (${l}, ${f}).`);h=a,d=o}else{if(u=n._edges.get(e),!u)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`);t===Ai?s=u.source:s=u.target,h=r,d=a}return[s,h,d]}function dr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);return o.attributes[s]}}function lr(n,i,t){n.prototype[i]=function(e,r){const[a]=ye(this,i,t,e,r);return a.attributes}}function cr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);return o.attributes.hasOwnProperty(s)}}function fr(n,i,t){n.prototype[i]=function(e,r,a,o){const[s,u,h]=ye(this,i,t,e,r,a,o);return s.attributes[u]=h,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:u}),this}}function gr(n,i,t){n.prototype[i]=function(e,r,a,o){const[s,u,h]=ye(this,i,t,e,r,a,o);if(typeof h!="function")throw new k(`Graph.${i}: updater should be a function.`);const d=s.attributes,l=h(d[u]);return d[u]=l,this.emit("nodeAttributesUpdated",{key:s.key,type:"set",attributes:s.attributes,name:u}),this}}function pr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);return delete o.attributes[s],this.emit("nodeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:s}),this}}function vr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);if(!J(s))throw new k(`Graph.${i}: provided attributes are not a plain object.`);return o.attributes=s,this.emit("nodeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}function mr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);if(!J(s))throw new k(`Graph.${i}: provided attributes are not a plain object.`);return Z(o.attributes,s),this.emit("nodeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:s}),this}}function yr(n,i,t){n.prototype[i]=function(e,r,a){const[o,s]=ye(this,i,t,e,r,a);if(typeof s!="function")throw new k(`Graph.${i}: provided updater is not a function.`);return o.attributes=s(o.attributes),this.emit("nodeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}const br=[{name:n=>`get${n}Attribute`,attacher:dr},{name:n=>`get${n}Attributes`,attacher:lr},{name:n=>`has${n}Attribute`,attacher:cr},{name:n=>`set${n}Attribute`,attacher:fr},{name:n=>`update${n}Attribute`,attacher:gr},{name:n=>`remove${n}Attribute`,attacher:pr},{name:n=>`replace${n}Attributes`,attacher:vr},{name:n=>`merge${n}Attributes`,attacher:mr},{name:n=>`update${n}Attributes`,attacher:yr}];function wr(n){br.forEach(function({name:i,attacher:t}){t(n,i("Node"),Ri),t(n,i("Source"),Ai),t(n,i("Target"),hr),t(n,i("Opposite"),xi)})}function Er(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return a.attributes[r]}}function _r(n,i,t){n.prototype[i]=function(e){let r;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+e,o=""+arguments[1];if(r=oe(this,a,o,t),!r)throw new C(`Graph.${i}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,r=this._edges.get(e),!r)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return r.attributes}}function Tr(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return a.attributes.hasOwnProperty(r)}}function Sr(n,i,t){n.prototype[i]=function(e,r,a){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+e,u=""+r;if(r=arguments[2],a=arguments[3],o=oe(this,s,u,t),!o)throw new C(`Graph.${i}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,o=this._edges.get(e),!o)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return o.attributes[r]=a,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}function Rr(n,i,t){n.prototype[i]=function(e,r,a){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+e,u=""+r;if(r=arguments[2],a=arguments[3],o=oe(this,s,u,t),!o)throw new C(`Graph.${i}: could not find an edge for the given path ("${s}" - "${u}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,o=this._edges.get(e),!o)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}if(typeof a!="function")throw new k(`Graph.${i}: updater should be a function.`);return o.attributes[r]=a(o.attributes[r]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:r}),this}}function Ar(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}return delete a.attributes[r],this.emit("edgeAttributesUpdated",{key:a.key,type:"remove",attributes:a.attributes,name:r}),this}}function xr(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}if(!J(r))throw new k(`Graph.${i}: provided attributes are not a plain object.`);return a.attributes=r,this.emit("edgeAttributesUpdated",{key:a.key,type:"replace",attributes:a.attributes}),this}}function Cr(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}if(!J(r))throw new k(`Graph.${i}: provided attributes are not a plain object.`);return Z(a.attributes,r),this.emit("edgeAttributesUpdated",{key:a.key,type:"merge",attributes:a.attributes,data:r}),this}}function kr(n,i,t){n.prototype[i]=function(e,r){let a;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new I(`Graph.${i}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new I(`Graph.${i}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+e,s=""+r;if(r=arguments[2],a=oe(this,o,s,t),!a)throw new C(`Graph.${i}: could not find an edge for the given path ("${o}" - "${s}").`)}else{if(t!=="mixed")throw new I(`Graph.${i}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(e=""+e,a=this._edges.get(e),!a)throw new C(`Graph.${i}: could not find the "${e}" edge in the graph.`)}if(typeof r!="function")throw new k(`Graph.${i}: provided updater is not a function.`);return a.attributes=r(a.attributes),this.emit("edgeAttributesUpdated",{key:a.key,type:"update",attributes:a.attributes}),this}}const Dr=[{name:n=>`get${n}Attribute`,attacher:Er},{name:n=>`get${n}Attributes`,attacher:_r},{name:n=>`has${n}Attribute`,attacher:Tr},{name:n=>`set${n}Attribute`,attacher:Sr},{name:n=>`update${n}Attribute`,attacher:Rr},{name:n=>`remove${n}Attribute`,attacher:Ar},{name:n=>`replace${n}Attributes`,attacher:xr},{name:n=>`merge${n}Attributes`,attacher:Cr},{name:n=>`update${n}Attributes`,attacher:kr}];function Lr(n){Dr.forEach(function({name:i,attacher:t}){t(n,i("Edge"),"mixed"),t(n,i("DirectedEdge"),"directed"),t(n,i("UndirectedEdge"),"undirected")})}const Gr=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Fr(n,i,t,e){let r=!1;for(const a in i){if(a===e)continue;const o=i[a];if(r=t(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),n&&r)return o.key}}function Nr(n,i,t,e){let r,a,o,s=!1;for(const u in i)if(u!==e){r=i[u];do{if(a=r.source,o=r.target,s=t(r.key,r.attributes,a.key,o.key,a.attributes,o.attributes,r.undirected),n&&s)return r.key;r=r.next}while(r!==void 0)}}function lt(n,i){const t=Object.keys(n),e=t.length;let r,a=0;return{[Symbol.iterator](){return this},next(){do if(r)r=r.next;else{if(a>=e)return{done:!0};const o=t[a++];if(o===i){r=void 0;continue}r=n[o]}while(!r);return{done:!1,value:{edge:r.key,attributes:r.attributes,source:r.source.key,target:r.target.key,sourceAttributes:r.source.attributes,targetAttributes:r.target.attributes,undirected:r.undirected}}}}}function Pr(n,i,t,e){const r=i[t];if(!r)return;const a=r.source,o=r.target;if(e(r.key,r.attributes,a.key,o.key,a.attributes,o.attributes,r.undirected)&&n)return r.key}function Ir(n,i,t,e){let r=i[t];if(!r)return;let a=!1;do{if(a=e(r.key,r.attributes,r.source.key,r.target.key,r.source.attributes,r.target.attributes,r.undirected),n&&a)return r.key;r=r.next}while(r!==void 0)}function ct(n,i){let t=n[i];if(t.next!==void 0)return{[Symbol.iterator](){return this},next(){if(!t)return{done:!0};const r={edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected};return t=t.next,{done:!1,value:r}}};let e=!1;return{[Symbol.iterator](){return this},next(){return e===!0?{done:!0}:(e=!0,{done:!1,value:{edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected}})}}}function Or(n,i){if(n.size===0)return[];if(i==="mixed"||i===n.type)return Array.from(n._edges.keys());const t=i==="undirected"?n.undirectedSize:n.directedSize,e=new Array(t),r=i==="undirected",a=n._edges.values();let o=0,s,u;for(;s=a.next(),s.done!==!0;)u=s.value,u.undirected===r&&(e[o++]=u.key);return e}function Ci(n,i,t,e){if(i.size===0)return;const r=t!=="mixed"&&t!==i.type,a=t==="undirected";let o,s,u=!1;const h=i._edges.values();for(;o=h.next(),o.done!==!0;){if(s=o.value,r&&s.undirected!==a)continue;const{key:d,attributes:l,source:f,target:c}=s;if(u=e(d,l,f.key,c.key,f.attributes,c.attributes,s.undirected),n&&u)return d}}function Ur(n,i){if(n.size===0)return Le();const t=i!=="mixed"&&i!==n.type,e=i==="undirected",r=n._edges.values();return{[Symbol.iterator](){return this},next(){let a,o;for(;;){if(a=r.next(),a.done)return a;if(o=a.value,!(t&&o.undirected!==e))break}return{value:{edge:o.key,attributes:o.attributes,source:o.source.key,target:o.target.key,sourceAttributes:o.source.attributes,targetAttributes:o.target.attributes,undirected:o.undirected},done:!1}}}}function Gt(n,i,t,e,r,a){const o=i?Nr:Fr;let s;if(t!=="undirected"&&(e!=="out"&&(s=o(n,r.in,a),n&&s)||e!=="in"&&(s=o(n,r.out,a,e?void 0:r.key),n&&s))||t!=="directed"&&(s=o(n,r.undirected,a),n&&s))return s}function zr(n,i,t,e){const r=[];return Gt(!1,n,i,t,e,function(a){r.push(a)}),r}function $r(n,i,t){let e=Le();return n!=="undirected"&&(i!=="out"&&typeof t.in<"u"&&(e=me(e,lt(t.in))),i!=="in"&&typeof t.out<"u"&&(e=me(e,lt(t.out,i?void 0:t.key)))),n!=="directed"&&typeof t.undirected<"u"&&(e=me(e,lt(t.undirected))),e}function Ft(n,i,t,e,r,a,o){const s=t?Ir:Pr;let u;if(i!=="undirected"&&(typeof r.in<"u"&&e!=="out"&&(u=s(n,r.in,a,o),n&&u)||typeof r.out<"u"&&e!=="in"&&(e||r.key!==a)&&(u=s(n,r.out,a,o),n&&u))||i!=="directed"&&typeof r.undirected<"u"&&(u=s(n,r.undirected,a,o),n&&u))return u}function Br(n,i,t,e,r){const a=[];return Ft(!1,n,i,t,e,r,function(o){a.push(o)}),a}function Mr(n,i,t,e){let r=Le();return n!=="undirected"&&(typeof t.in<"u"&&i!=="out"&&e in t.in&&(r=me(r,ct(t.in,e))),typeof t.out<"u"&&i!=="in"&&e in t.out&&(i||t.key!==e)&&(r=me(r,ct(t.out,e)))),n!=="directed"&&typeof t.undirected<"u"&&e in t.undirected&&(r=me(r,ct(t.undirected,e))),r}function Hr(n,i){const{name:t,type:e,direction:r}=i;n.prototype[t]=function(a,o){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return[];if(!arguments.length)return Or(this,e);if(arguments.length===1){a=""+a;const s=this._nodes.get(a);if(typeof s>"u")throw new C(`Graph.${t}: could not find the "${a}" node in the graph.`);return zr(this.multi,e==="mixed"?this.type:e,r,s)}if(arguments.length===2){a=""+a,o=""+o;const s=this._nodes.get(a);if(!s)throw new C(`Graph.${t}: could not find the "${a}" source node in the graph.`);if(!this._nodes.has(o))throw new C(`Graph.${t}: could not find the "${o}" target node in the graph.`);return Br(e,this.multi,r,s,o)}throw new k(`Graph.${t}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Wr(n,i){const{name:t,type:e,direction:r}=i,a="forEach"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[a]=function(h,d,l){if(!(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)){if(arguments.length===1)return l=h,Ci(!1,this,e,l);if(arguments.length===2){h=""+h,l=d;const f=this._nodes.get(h);if(typeof f>"u")throw new C(`Graph.${a}: could not find the "${h}" node in the graph.`);return Gt(!1,this.multi,e==="mixed"?this.type:e,r,f,l)}if(arguments.length===3){h=""+h,d=""+d;const f=this._nodes.get(h);if(!f)throw new C(`Graph.${a}: could not find the "${h}" source node in the graph.`);if(!this._nodes.has(d))throw new C(`Graph.${a}: could not find the "${d}" target node in the graph.`);return Ft(!1,e,this.multi,r,f,d,l)}throw new k(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const o="map"+t[0].toUpperCase()+t.slice(1);n.prototype[o]=function(){const h=Array.prototype.slice.call(arguments),d=h.pop();let l;if(h.length===0){let f=0;e!=="directed"&&(f+=this.undirectedSize),e!=="undirected"&&(f+=this.directedSize),l=new Array(f);let c=0;h.push((y,w,T,D,m,S,p)=>{l[c++]=d(y,w,T,D,m,S,p)})}else l=[],h.push((f,c,y,w,T,D,m)=>{l.push(d(f,c,y,w,T,D,m))});return this[a].apply(this,h),l};const s="filter"+t[0].toUpperCase()+t.slice(1);n.prototype[s]=function(){const h=Array.prototype.slice.call(arguments),d=h.pop(),l=[];return h.push((f,c,y,w,T,D,m)=>{d(f,c,y,w,T,D,m)&&l.push(f)}),this[a].apply(this,h),l};const u="reduce"+t[0].toUpperCase()+t.slice(1);n.prototype[u]=function(){let h=Array.prototype.slice.call(arguments);if(h.length<2||h.length>4)throw new k(`Graph.${u}: invalid number of arguments (expecting 2, 3 or 4 and got ${h.length}).`);if(typeof h[h.length-1]=="function"&&typeof h[h.length-2]!="function")throw new k(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let d,l;h.length===2?(d=h[0],l=h[1],h=[]):h.length===3?(d=h[1],l=h[2],h=[h[0]]):h.length===4&&(d=h[2],l=h[3],h=[h[0],h[1]]);let f=l;return h.push((c,y,w,T,D,m,S)=>{f=d(f,c,y,w,T,D,m,S)}),this[a].apply(this,h),f}}function jr(n,i){const{name:t,type:e,direction:r}=i,a="find"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[a]=function(u,h,d){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return!1;if(arguments.length===1)return d=u,Ci(!0,this,e,d);if(arguments.length===2){u=""+u,d=h;const l=this._nodes.get(u);if(typeof l>"u")throw new C(`Graph.${a}: could not find the "${u}" node in the graph.`);return Gt(!0,this.multi,e==="mixed"?this.type:e,r,l,d)}if(arguments.length===3){u=""+u,h=""+h;const l=this._nodes.get(u);if(!l)throw new C(`Graph.${a}: could not find the "${u}" source node in the graph.`);if(!this._nodes.has(h))throw new C(`Graph.${a}: could not find the "${h}" target node in the graph.`);return Ft(!0,e,this.multi,r,l,h,d)}throw new k(`Graph.${a}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const o="some"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[o]=function(){const u=Array.prototype.slice.call(arguments),h=u.pop();return u.push((l,f,c,y,w,T,D)=>h(l,f,c,y,w,T,D)),!!this[a].apply(this,u)};const s="every"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[s]=function(){const u=Array.prototype.slice.call(arguments),h=u.pop();return u.push((l,f,c,y,w,T,D)=>!h(l,f,c,y,w,T,D)),!this[a].apply(this,u)}}function Vr(n,i){const{name:t,type:e,direction:r}=i,a=t.slice(0,-1)+"Entries";n.prototype[a]=function(o,s){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return Le();if(!arguments.length)return Ur(this,e);if(arguments.length===1){o=""+o;const u=this._nodes.get(o);if(!u)throw new C(`Graph.${a}: could not find the "${o}" node in the graph.`);return $r(e,r,u)}if(arguments.length===2){o=""+o,s=""+s;const u=this._nodes.get(o);if(!u)throw new C(`Graph.${a}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(s))throw new C(`Graph.${a}: could not find the "${s}" target node in the graph.`);return Mr(e,r,u,s)}throw new k(`Graph.${a}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function qr(n){Gr.forEach(i=>{Hr(n,i),Wr(n,i),jr(n,i),Vr(n,i)})}const Kr=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function ut(){this.A=null,this.B=null}ut.prototype.wrap=function(n){this.A===null?this.A=n:this.B===null&&(this.B=n)};ut.prototype.has=function(n){return this.A!==null&&n in this.A||this.B!==null&&n in this.B};function Oe(n,i,t,e,r){for(const a in e){const o=e[a],s=o.source,u=o.target,h=s===t?u:s;if(i&&i.has(h.key))continue;const d=r(h.key,h.attributes);if(n&&d)return h.key}}function Nt(n,i,t,e,r){if(i!=="mixed"){if(i==="undirected")return Oe(n,null,e,e.undirected,r);if(typeof t=="string")return Oe(n,null,e,e[t],r)}const a=new ut;let o;if(i!=="undirected"){if(t!=="out"){if(o=Oe(n,null,e,e.in,r),n&&o)return o;a.wrap(e.in)}if(t!=="in"){if(o=Oe(n,a,e,e.out,r),n&&o)return o;a.wrap(e.out)}}if(i!=="directed"&&(o=Oe(n,a,e,e.undirected,r),n&&o))return o}function Yr(n,i,t){if(n!=="mixed"){if(n==="undirected")return Object.keys(t.undirected);if(typeof i=="string")return Object.keys(t[i])}const e=[];return Nt(!1,n,i,t,function(r){e.push(r)}),e}function Ue(n,i,t){const e=Object.keys(t),r=e.length;let a=0;return{[Symbol.iterator](){return this},next(){let o=null;do{if(a>=r)return n&&n.wrap(t),{done:!0};const s=t[e[a++]],u=s.source,h=s.target;if(o=u===i?h:u,n&&n.has(o.key)){o=null;continue}}while(o===null);return{done:!1,value:{neighbor:o.key,attributes:o.attributes}}}}}function Zr(n,i,t){if(n!=="mixed"){if(n==="undirected")return Ue(null,t,t.undirected);if(typeof i=="string")return Ue(null,t,t[i])}let e=Le();const r=new ut;return n!=="undirected"&&(i!=="out"&&(e=me(e,Ue(r,t,t.in))),i!=="in"&&(e=me(e,Ue(r,t,t.out)))),n!=="directed"&&(e=me(e,Ue(r,t,t.undirected))),e}function Xr(n,i){const{name:t,type:e,direction:r}=i;n.prototype[t]=function(a){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return[];a=""+a;const o=this._nodes.get(a);if(typeof o>"u")throw new C(`Graph.${t}: could not find the "${a}" node in the graph.`);return Yr(e==="mixed"?this.type:e,r,o)}}function Jr(n,i){const{name:t,type:e,direction:r}=i,a="forEach"+t[0].toUpperCase()+t.slice(1,-1);n.prototype[a]=function(h,d){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return;h=""+h;const l=this._nodes.get(h);if(typeof l>"u")throw new C(`Graph.${a}: could not find the "${h}" node in the graph.`);Nt(!1,e==="mixed"?this.type:e,r,l,d)};const o="map"+t[0].toUpperCase()+t.slice(1);n.prototype[o]=function(h,d){const l=[];return this[a](h,(f,c)=>{l.push(d(f,c))}),l};const s="filter"+t[0].toUpperCase()+t.slice(1);n.prototype[s]=function(h,d){const l=[];return this[a](h,(f,c)=>{d(f,c)&&l.push(f)}),l};const u="reduce"+t[0].toUpperCase()+t.slice(1);n.prototype[u]=function(h,d,l){if(arguments.length<3)throw new k(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let f=l;return this[a](h,(c,y)=>{f=d(f,c,y)}),f}}function Qr(n,i){const{name:t,type:e,direction:r}=i,a=t[0].toUpperCase()+t.slice(1,-1),o="find"+a;n.prototype[o]=function(h,d){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return;h=""+h;const l=this._nodes.get(h);if(typeof l>"u")throw new C(`Graph.${o}: could not find the "${h}" node in the graph.`);return Nt(!0,e==="mixed"?this.type:e,r,l,d)};const s="some"+a;n.prototype[s]=function(h,d){return!!this[o](h,d)};const u="every"+a;n.prototype[u]=function(h,d){return!this[o](h,(f,c)=>!d(f,c))}}function en(n,i){const{name:t,type:e,direction:r}=i,a=t.slice(0,-1)+"Entries";n.prototype[a]=function(o){if(e!=="mixed"&&this.type!=="mixed"&&e!==this.type)return Le();o=""+o;const s=this._nodes.get(o);if(typeof s>"u")throw new C(`Graph.${a}: could not find the "${o}" node in the graph.`);return Zr(e==="mixed"?this.type:e,r,s)}}function tn(n){Kr.forEach(i=>{Xr(n,i),Jr(n,i),Qr(n,i),en(n,i)})}function tt(n,i,t,e,r){const a=e._nodes.values(),o=e.type;let s,u,h,d,l,f;for(;s=a.next(),s.done!==!0;){let c=!1;if(u=s.value,o!=="undirected"){d=u.out;for(h in d){l=d[h];do f=l.target,c=!0,r(u.key,f.key,u.attributes,f.attributes,l.key,l.attributes,l.undirected),l=l.next;while(l)}}if(o!=="directed"){d=u.undirected;for(h in d)if(!(i&&u.key>h)){l=d[h];do f=l.target,f.key!==h&&(f=l.source),c=!0,r(u.key,f.key,u.attributes,f.attributes,l.key,l.attributes,l.undirected),l=l.next;while(l)}}t&&!c&&r(u.key,null,u.attributes,null,null,null,null)}}function rn(n,i){const t={key:n};return Ei(i.attributes)||(t.attributes=Z({},i.attributes)),t}function nn(n,i,t){const e={key:i,source:t.source.key,target:t.target.key};return Ei(t.attributes)||(e.attributes=Z({},t.attributes)),n==="mixed"&&t.undirected&&(e.undirected=!0),e}function an(n){if(!J(n))throw new k('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in n))throw new k("Graph.import: serialized node is missing its key.");if("attributes"in n&&(!J(n.attributes)||n.attributes===null))throw new k("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function on(n){if(!J(n))throw new k('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in n))throw new k("Graph.import: serialized edge is missing its source.");if(!("target"in n))throw new k("Graph.import: serialized edge is missing its target.");if("attributes"in n&&(!J(n.attributes)||n.attributes===null))throw new k("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in n&&typeof n.undirected!="boolean")throw new k("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const sn=ur(),un=new Set(["directed","undirected","mixed"]),Bt=new Set(["domain","_events","_eventsCount","_maxListeners"]),hn=[{name:n=>`${n}Edge`,generateKey:!0},{name:n=>`${n}DirectedEdge`,generateKey:!0,type:"directed"},{name:n=>`${n}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:n=>`${n}EdgeWithKey`},{name:n=>`${n}DirectedEdgeWithKey`,type:"directed"},{name:n=>`${n}UndirectedEdgeWithKey`,type:"undirected"}],dn={allowSelfLoops:!0,multi:!1,type:"mixed"};function ln(n,i,t){if(t&&!J(t))throw new k(`Graph.addNode: invalid attributes. Expecting an object but got "${t}"`);if(i=""+i,t=t||{},n._nodes.has(i))throw new I(`Graph.addNode: the "${i}" node already exist in the graph.`);const e=new n.NodeDataClass(i,t);return n._nodes.set(i,e),n.emit("nodeAdded",{key:i,attributes:t}),e}function Mt(n,i,t){const e=new n.NodeDataClass(i,t);return n._nodes.set(i,e),n.emit("nodeAdded",{key:i,attributes:t}),e}function ki(n,i,t,e,r,a,o,s){if(!e&&n.type==="undirected")throw new I(`Graph.${i}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(e&&n.type==="directed")throw new I(`Graph.${i}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(s&&!J(s))throw new k(`Graph.${i}: invalid attributes. Expecting an object but got "${s}"`);if(a=""+a,o=""+o,s=s||{},!n.allowSelfLoops&&a===o)throw new I(`Graph.${i}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const u=n._nodes.get(a),h=n._nodes.get(o);if(!u)throw new C(`Graph.${i}: source node "${a}" not found.`);if(!h)throw new C(`Graph.${i}: target node "${o}" not found.`);const d={key:null,undirected:e,source:a,target:o,attributes:s};if(t)r=n._edgeKeyGenerator();else if(r=""+r,n._edges.has(r))throw new I(`Graph.${i}: the "${r}" edge already exists in the graph.`);if(!n.multi&&(e?typeof u.undirected[o]<"u":typeof u.out[o]<"u"))throw new I(`Graph.${i}: an edge linking "${a}" to "${o}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const l=new Ge(e,r,u,h,s);n._edges.set(r,l);const f=a===o;return e?(u.undirectedDegree++,h.undirectedDegree++,f&&(u.undirectedLoops++,n._undirectedSelfLoopCount++)):(u.outDegree++,h.inDegree++,f&&(u.directedLoops++,n._directedSelfLoopCount++)),n.multi?l.attachMulti():l.attach(),e?n._undirectedSize++:n._directedSize++,d.key=r,n.emit("edgeAdded",d),r}function cn(n,i,t,e,r,a,o,s,u){if(!e&&n.type==="undirected")throw new I(`Graph.${i}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(e&&n.type==="directed")throw new I(`Graph.${i}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(s){if(u){if(typeof s!="function")throw new k(`Graph.${i}: invalid updater function. Expecting a function but got "${s}"`)}else if(!J(s))throw new k(`Graph.${i}: invalid attributes. Expecting an object but got "${s}"`)}a=""+a,o=""+o;let h;if(u&&(h=s,s=void 0),!n.allowSelfLoops&&a===o)throw new I(`Graph.${i}: source & target are the same ("${a}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let d=n._nodes.get(a),l=n._nodes.get(o),f,c;if(!t&&(f=n._edges.get(r),f)){if((f.source.key!==a||f.target.key!==o)&&(!e||f.source.key!==o||f.target.key!==a))throw new I(`Graph.${i}: inconsistency detected when attempting to merge the "${r}" edge with "${a}" source & "${o}" target vs. ("${f.source.key}", "${f.target.key}").`);c=f}if(!c&&!n.multi&&d&&(c=e?d.undirected[o]:d.out[o]),c){const m=[c.key,!1,!1,!1];if(u?!h:!s)return m;if(u){const S=c.attributes;c.attributes=h(S),n.emit("edgeAttributesUpdated",{type:"replace",key:c.key,attributes:c.attributes})}else Z(c.attributes,s),n.emit("edgeAttributesUpdated",{type:"merge",key:c.key,attributes:c.attributes,data:s});return m}s=s||{},u&&h&&(s=h(s));const y={key:null,undirected:e,source:a,target:o,attributes:s};if(t)r=n._edgeKeyGenerator();else if(r=""+r,n._edges.has(r))throw new I(`Graph.${i}: the "${r}" edge already exists in the graph.`);let w=!1,T=!1;d||(d=Mt(n,a,{}),w=!0,a===o&&(l=d,T=!0)),l||(l=Mt(n,o,{}),T=!0),f=new Ge(e,r,d,l,s),n._edges.set(r,f);const D=a===o;return e?(d.undirectedDegree++,l.undirectedDegree++,D&&(d.undirectedLoops++,n._undirectedSelfLoopCount++)):(d.outDegree++,l.inDegree++,D&&(d.directedLoops++,n._directedSelfLoopCount++)),n.multi?f.attachMulti():f.attach(),e?n._undirectedSize++:n._directedSize++,y.key=r,n.emit("edgeAdded",y),[r,!0,w,T]}function xe(n,i){n._edges.delete(i.key);const{source:t,target:e,attributes:r}=i,a=i.undirected,o=t===e;a?(t.undirectedDegree--,e.undirectedDegree--,o&&(t.undirectedLoops--,n._undirectedSelfLoopCount--)):(t.outDegree--,e.inDegree--,o&&(t.directedLoops--,n._directedSelfLoopCount--)),n.multi?i.detachMulti():i.detach(),a?n._undirectedSize--:n._directedSize--,n.emit("edgeDropped",{key:i.key,attributes:r,source:t.key,target:e.key,undirected:a})}class j extends wi.EventEmitter{constructor(i){if(super(),i=Z({},dn,i),typeof i.multi!="boolean")throw new k(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${i.multi}".`);if(!un.has(i.type))throw new k(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${i.type}".`);if(typeof i.allowSelfLoops!="boolean")throw new k(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${i.allowSelfLoops}".`);const t=i.type==="mixed"?_i:i.type==="directed"?Ti:Si;ae(this,"NodeDataClass",t);const e="geid_"+sn()+"_";let r=0;const a=()=>{let o;do o=e+r++;while(this._edges.has(o));return o};ae(this,"_attributes",{}),ae(this,"_nodes",new Map),ae(this,"_edges",new Map),ae(this,"_directedSize",0),ae(this,"_undirectedSize",0),ae(this,"_directedSelfLoopCount",0),ae(this,"_undirectedSelfLoopCount",0),ae(this,"_edgeKeyGenerator",a),ae(this,"_options",i),Bt.forEach(o=>ae(this,o,this[o])),he(this,"order",()=>this._nodes.size),he(this,"size",()=>this._edges.size),he(this,"directedSize",()=>this._directedSize),he(this,"undirectedSize",()=>this._undirectedSize),he(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),he(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),he(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),he(this,"multi",this._options.multi),he(this,"type",this._options.type),he(this,"allowSelfLoops",this._options.allowSelfLoops),he(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(i){return this._nodes.has(""+i)}hasDirectedEdge(i,t){if(this.type==="undirected")return!1;if(arguments.length===1){const e=""+i,r=this._edges.get(e);return!!r&&!r.undirected}else if(arguments.length===2){i=""+i,t=""+t;const e=this._nodes.get(i);return e?e.out.hasOwnProperty(t):!1}throw new k(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(i,t){if(this.type==="directed")return!1;if(arguments.length===1){const e=""+i,r=this._edges.get(e);return!!r&&r.undirected}else if(arguments.length===2){i=""+i,t=""+t;const e=this._nodes.get(i);return e?e.undirected.hasOwnProperty(t):!1}throw new k(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(i,t){if(arguments.length===1){const e=""+i;return this._edges.has(e)}else if(arguments.length===2){i=""+i,t=""+t;const e=this._nodes.get(i);return e?typeof e.out<"u"&&e.out.hasOwnProperty(t)||typeof e.undirected<"u"&&e.undirected.hasOwnProperty(t):!1}throw new k(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(i,t){if(this.type==="undirected")return;if(i=""+i,t=""+t,this.multi)throw new I("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const e=this._nodes.get(i);if(!e)throw new C(`Graph.directedEdge: could not find the "${i}" source node in the graph.`);if(!this._nodes.has(t))throw new C(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);const r=e.out&&e.out[t]||void 0;if(r)return r.key}undirectedEdge(i,t){if(this.type==="directed")return;if(i=""+i,t=""+t,this.multi)throw new I("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const e=this._nodes.get(i);if(!e)throw new C(`Graph.undirectedEdge: could not find the "${i}" source node in the graph.`);if(!this._nodes.has(t))throw new C(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);const r=e.undirected&&e.undirected[t]||void 0;if(r)return r.key}edge(i,t){if(this.multi)throw new I("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.edge: could not find the "${i}" source node in the graph.`);if(!this._nodes.has(t))throw new C(`Graph.edge: could not find the "${t}" target node in the graph.`);const r=e.out&&e.out[t]||e.undirected&&e.undirected[t]||void 0;if(r)return r.key}areDirectedNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areDirectedNeighbors: could not find the "${i}" node in the graph.`);return this.type==="undirected"?!1:t in e.in||t in e.out}areOutNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areOutNeighbors: could not find the "${i}" node in the graph.`);return this.type==="undirected"?!1:t in e.out}areInNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areInNeighbors: could not find the "${i}" node in the graph.`);return this.type==="undirected"?!1:t in e.in}areUndirectedNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areUndirectedNeighbors: could not find the "${i}" node in the graph.`);return this.type==="directed"?!1:t in e.undirected}areNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areNeighbors: could not find the "${i}" node in the graph.`);return this.type!=="undirected"&&(t in e.in||t in e.out)||this.type!=="directed"&&t in e.undirected}areInboundNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areInboundNeighbors: could not find the "${i}" node in the graph.`);return this.type!=="undirected"&&t in e.in||this.type!=="directed"&&t in e.undirected}areOutboundNeighbors(i,t){i=""+i,t=""+t;const e=this._nodes.get(i);if(!e)throw new C(`Graph.areOutboundNeighbors: could not find the "${i}" node in the graph.`);return this.type!=="undirected"&&t in e.out||this.type!=="directed"&&t in e.undirected}inDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.inDegree: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.inDegree}outDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.outDegree: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.outDegree}directedDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.directedDegree: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree}undirectedDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.undirectedDegree: could not find the "${i}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree}inboundDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.inboundDegree: could not find the "${i}" node in the graph.`);let e=0;return this.type!=="directed"&&(e+=t.undirectedDegree),this.type!=="undirected"&&(e+=t.inDegree),e}outboundDegree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.outboundDegree: could not find the "${i}" node in the graph.`);let e=0;return this.type!=="directed"&&(e+=t.undirectedDegree),this.type!=="undirected"&&(e+=t.outDegree),e}degree(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.degree: could not find the "${i}" node in the graph.`);let e=0;return this.type!=="directed"&&(e+=t.undirectedDegree),this.type!=="undirected"&&(e+=t.inDegree+t.outDegree),e}inDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.inDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.outDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.directedDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);let e=0,r=0;return this.type!=="directed"&&(e+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(e+=t.inDegree,r+=t.directedLoops),e-r}outboundDegreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);let e=0,r=0;return this.type!=="directed"&&(e+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(e+=t.outDegree,r+=t.directedLoops),e-r}degreeWithoutSelfLoops(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.degreeWithoutSelfLoops: could not find the "${i}" node in the graph.`);let e=0,r=0;return this.type!=="directed"&&(e+=t.undirectedDegree,r+=t.undirectedLoops*2),this.type!=="undirected"&&(e+=t.inDegree+t.outDegree,r+=t.directedLoops*2),e-r}source(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.source: could not find the "${i}" edge in the graph.`);return t.source.key}target(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.target: could not find the "${i}" edge in the graph.`);return t.target.key}extremities(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.extremities: could not find the "${i}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(i,t){i=""+i,t=""+t;const e=this._edges.get(t);if(!e)throw new C(`Graph.opposite: could not find the "${t}" edge in the graph.`);const r=e.source.key,a=e.target.key;if(i===r)return a;if(i===a)return r;throw new C(`Graph.opposite: the "${i}" node is not attached to the "${t}" edge (${r}, ${a}).`)}hasExtremity(i,t){i=""+i,t=""+t;const e=this._edges.get(i);if(!e)throw new C(`Graph.hasExtremity: could not find the "${i}" edge in the graph.`);return e.source.key===t||e.target.key===t}isUndirected(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.isUndirected: could not find the "${i}" edge in the graph.`);return t.undirected}isDirected(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.isDirected: could not find the "${i}" edge in the graph.`);return!t.undirected}isSelfLoop(i){i=""+i;const t=this._edges.get(i);if(!t)throw new C(`Graph.isSelfLoop: could not find the "${i}" edge in the graph.`);return t.source===t.target}addNode(i,t){return ln(this,i,t).key}mergeNode(i,t){if(t&&!J(t))throw new k(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);i=""+i,t=t||{};let e=this._nodes.get(i);return e?(t&&(Z(e.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:i,attributes:e.attributes,data:t})),[i,!1]):(e=new this.NodeDataClass(i,t),this._nodes.set(i,e),this.emit("nodeAdded",{key:i,attributes:t}),[i,!0])}updateNode(i,t){if(t&&typeof t!="function")throw new k(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);i=""+i;let e=this._nodes.get(i);if(e){if(t){const a=e.attributes;e.attributes=t(a),this.emit("nodeAttributesUpdated",{type:"replace",key:i,attributes:e.attributes})}return[i,!1]}const r=t?t({}):{};return e=new this.NodeDataClass(i,r),this._nodes.set(i,e),this.emit("nodeAdded",{key:i,attributes:r}),[i,!0]}dropNode(i){i=""+i;const t=this._nodes.get(i);if(!t)throw new C(`Graph.dropNode: could not find the "${i}" node in the graph.`);let e;if(this.type!=="undirected"){for(const r in t.out){e=t.out[r];do xe(this,e),e=e.next;while(e)}for(const r in t.in){e=t.in[r];do xe(this,e),e=e.next;while(e)}}if(this.type!=="directed")for(const r in t.undirected){e=t.undirected[r];do xe(this,e),e=e.next;while(e)}this._nodes.delete(i),this.emit("nodeDropped",{key:i,attributes:t.attributes})}dropEdge(i){let t;if(arguments.length>1){const e=""+arguments[0],r=""+arguments[1];if(t=oe(this,e,r,this.type),!t)throw new C(`Graph.dropEdge: could not find the "${e}" -> "${r}" edge in the graph.`)}else if(i=""+i,t=this._edges.get(i),!t)throw new C(`Graph.dropEdge: could not find the "${i}" edge in the graph.`);return xe(this,t),this}dropDirectedEdge(i,t){if(arguments.length<2)throw new I("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new I("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");i=""+i,t=""+t;const e=oe(this,i,t,"directed");if(!e)throw new C(`Graph.dropDirectedEdge: could not find a "${i}" -> "${t}" edge in the graph.`);return xe(this,e),this}dropUndirectedEdge(i,t){if(arguments.length<2)throw new I("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new I("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const e=oe(this,i,t,"undirected");if(!e)throw new C(`Graph.dropUndirectedEdge: could not find a "${i}" -> "${t}" edge in the graph.`);return xe(this,e),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const i=this._nodes.values();let t;for(;t=i.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(i){return this._attributes[i]}getAttributes(){return this._attributes}hasAttribute(i){return this._attributes.hasOwnProperty(i)}setAttribute(i,t){return this._attributes[i]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:i}),this}updateAttribute(i,t){if(typeof t!="function")throw new k("Graph.updateAttribute: updater should be a function.");const e=this._attributes[i];return this._attributes[i]=t(e),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:i}),this}removeAttribute(i){return delete this._attributes[i],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:i}),this}replaceAttributes(i){if(!J(i))throw new k("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=i,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(i){if(!J(i))throw new k("Graph.mergeAttributes: provided attributes are not a plain object.");return Z(this._attributes,i),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:i}),this}updateAttributes(i){if(typeof i!="function")throw new k("Graph.updateAttributes: provided updater is not a function.");return this._attributes=i(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(i,t){if(typeof i!="function")throw new k("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!$t(t))throw new k("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const e=this._nodes.values();let r,a;for(;r=e.next(),r.done!==!0;)a=r.value,a.attributes=i(a.key,a.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})}updateEachEdgeAttributes(i,t){if(typeof i!="function")throw new k("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!$t(t))throw new k("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const e=this._edges.values();let r,a,o,s;for(;r=e.next(),r.done!==!0;)a=r.value,o=a.source,s=a.target,a.attributes=i(a.key,a.attributes,o.key,s.key,o.attributes,s.attributes,a.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})}forEachAdjacencyEntry(i){if(typeof i!="function")throw new k("Graph.forEachAdjacencyEntry: expecting a callback.");tt(!1,!1,!1,this,i)}forEachAdjacencyEntryWithOrphans(i){if(typeof i!="function")throw new k("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");tt(!1,!1,!0,this,i)}forEachAssymetricAdjacencyEntry(i){if(typeof i!="function")throw new k("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");tt(!1,!0,!1,this,i)}forEachAssymetricAdjacencyEntryWithOrphans(i){if(typeof i!="function")throw new k("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");tt(!1,!0,!0,this,i)}nodes(){return Array.from(this._nodes.keys())}forEachNode(i){if(typeof i!="function")throw new k("Graph.forEachNode: expecting a callback.");const t=this._nodes.values();let e,r;for(;e=t.next(),e.done!==!0;)r=e.value,i(r.key,r.attributes)}findNode(i){if(typeof i!="function")throw new k("Graph.findNode: expecting a callback.");const t=this._nodes.values();let e,r;for(;e=t.next(),e.done!==!0;)if(r=e.value,i(r.key,r.attributes))return r.key}mapNodes(i){if(typeof i!="function")throw new k("Graph.mapNode: expecting a callback.");const t=this._nodes.values();let e,r;const a=new Array(this.order);let o=0;for(;e=t.next(),e.done!==!0;)r=e.value,a[o++]=i(r.key,r.attributes);return a}someNode(i){if(typeof i!="function")throw new k("Graph.someNode: expecting a callback.");const t=this._nodes.values();let e,r;for(;e=t.next(),e.done!==!0;)if(r=e.value,i(r.key,r.attributes))return!0;return!1}everyNode(i){if(typeof i!="function")throw new k("Graph.everyNode: expecting a callback.");const t=this._nodes.values();let e,r;for(;e=t.next(),e.done!==!0;)if(r=e.value,!i(r.key,r.attributes))return!1;return!0}filterNodes(i){if(typeof i!="function")throw new k("Graph.filterNodes: expecting a callback.");const t=this._nodes.values();let e,r;const a=[];for(;e=t.next(),e.done!==!0;)r=e.value,i(r.key,r.attributes)&&a.push(r.key);return a}reduceNodes(i,t){if(typeof i!="function")throw new k("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new k("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let e=t;const r=this._nodes.values();let a,o;for(;a=r.next(),a.done!==!0;)o=a.value,e=i(e,o.key,o.attributes);return e}nodeEntries(){const i=this._nodes.values();return{[Symbol.iterator](){return this},next(){const t=i.next();if(t.done)return t;const e=t.value;return{value:{node:e.key,attributes:e.attributes},done:!1}}}}export(){const i=new Array(this._nodes.size);let t=0;this._nodes.forEach((r,a)=>{i[t++]=rn(a,r)});const e=new Array(this._edges.size);return t=0,this._edges.forEach((r,a)=>{e[t++]=nn(this.type,a,r)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:i,edges:e}}import(i,t=!1){if(i instanceof j)return i.forEachNode((u,h)=>{t?this.mergeNode(u,h):this.addNode(u,h)}),i.forEachEdge((u,h,d,l,f,c,y)=>{t?y?this.mergeUndirectedEdgeWithKey(u,d,l,h):this.mergeDirectedEdgeWithKey(u,d,l,h):y?this.addUndirectedEdgeWithKey(u,d,l,h):this.addDirectedEdgeWithKey(u,d,l,h)}),this;if(!J(i))throw new k("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(i.attributes){if(!J(i.attributes))throw new k("Graph.import: invalid attributes. Expecting a plain object.");t?this.mergeAttributes(i.attributes):this.replaceAttributes(i.attributes)}let e,r,a,o,s;if(i.nodes){if(a=i.nodes,!Array.isArray(a))throw new k("Graph.import: invalid nodes. Expecting an array.");for(e=0,r=a.length;e{const a=Z({},e.attributes);e=new t.NodeDataClass(r,a),t._nodes.set(r,e)}),t}copy(i){if(i=i||{},typeof i.type=="string"&&i.type!==this.type&&i.type!=="mixed")throw new I(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${i.type}" because this would mean losing information about the current graph.`);if(typeof i.multi=="boolean"&&i.multi!==this.multi&&i.multi!==!0)throw new I("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof i.allowSelfLoops=="boolean"&&i.allowSelfLoops!==this.allowSelfLoops&&i.allowSelfLoops!==!0)throw new I("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const t=this.emptyCopy(i),e=this._edges.values();let r,a;for(;r=e.next(),r.done!==!0;)a=r.value,ki(t,"copy",!1,a.undirected,a.key,a.source.key,a.target.key,Z({},a.attributes));return t}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const i={};this._nodes.forEach((a,o)=>{i[o]=a.attributes});const t={},e={};this._edges.forEach((a,o)=>{const s=a.undirected?"--":"->";let u="",h=a.source.key,d=a.target.key,l;a.undirected&&h>d&&(l=h,h=d,d=l);const f=`(${h})${s}(${d})`;o.startsWith("geid_")?this.multi&&(typeof e[f]>"u"?e[f]=0:e[f]++,u+=`${e[f]}. `):u+=`[${o}]: `,u+=f,t[u]=a.attributes});const r={};for(const a in this)this.hasOwnProperty(a)&&!Bt.has(a)&&typeof this[a]!="function"&&typeof a!="symbol"&&(r[a]=this[a]);return r.attributes=this._attributes,r.nodes=i,r.edges=t,ae(r,"constructor",this.constructor),r}}typeof Symbol<"u"&&(j.prototype[Symbol.for("nodejs.util.inspect.custom")]=j.prototype.inspect);hn.forEach(n=>{["add","merge","update"].forEach(i=>{const t=n.name(i),e=i==="add"?ki:cn;n.generateKey?j.prototype[t]=function(r,a,o){return e(this,t,!0,(n.type||this.type)==="undirected",null,r,a,o,i==="update")}:j.prototype[t]=function(r,a,o,s){return e(this,t,!1,(n.type||this.type)==="undirected",r,a,o,s,i==="update")}})});wr(j);Lr(j);qr(j);tn(j);class Di extends j{constructor(i){const t=Z({type:"directed"},i);if("multi"in t&&t.multi!==!1)throw new k("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="directed")throw new k('DirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class Li extends j{constructor(i){const t=Z({type:"undirected"},i);if("multi"in t&&t.multi!==!1)throw new k("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="undirected")throw new k('UndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class Gi extends j{constructor(i){const t=Z({multi:!0},i);if("multi"in t&&t.multi!==!0)throw new k("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(t)}}class Fi extends j{constructor(i){const t=Z({type:"directed",multi:!0},i);if("multi"in t&&t.multi!==!0)throw new k("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="directed")throw new k('MultiDirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class Ni extends j{constructor(i){const t=Z({type:"undirected",multi:!0},i);if("multi"in t&&t.multi!==!0)throw new k("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="undirected")throw new k('MultiUndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}function Fe(n){n.from=function(i,t){const e=Z({},i.options,t),r=new n(e);return r.import(i),r}}Fe(j);Fe(Di);Fe(Li);Fe(Gi);Fe(Fi);Fe(Ni);j.Graph=j;j.DirectedGraph=Di;j.UndirectedGraph=Li;j.MultiGraph=Gi;j.MultiDirectedGraph=Fi;j.MultiUndirectedGraph=Ni;j.InvalidArgumentsGraphError=k;j.NotFoundGraphError=C;j.UsageGraphError=I;var ft,Ht;function Pi(){return Ht||(Ht=1,ft=function(i){return i!==null&&typeof i=="object"&&typeof i.addUndirectedEdgeWithKey=="function"&&typeof i.dropNode=="function"&&typeof i.multi=="boolean"}),ft}var ze={},Wt;function fn(){if(Wt)return ze;Wt=1;function n(e){return typeof e!="number"||isNaN(e)?1:e}function i(e,r){var a={},o=function(h){return typeof h>"u"?r:h};typeof r=="function"&&(o=r);var s=function(h){return o(h[e])},u=function(){return o(void 0)};return typeof e=="string"?(a.fromAttributes=s,a.fromGraph=function(h,d){return s(h.getNodeAttributes(d))},a.fromEntry=function(h,d){return s(d)}):typeof e=="function"?(a.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},a.fromGraph=function(h,d){return o(e(d,h.getNodeAttributes(d)))},a.fromEntry=function(h,d){return o(e(h,d))}):(a.fromAttributes=u,a.fromGraph=u,a.fromEntry=u),a}function t(e,r){var a={},o=function(h){return typeof h>"u"?r:h};typeof r=="function"&&(o=r);var s=function(h){return o(h[e])},u=function(){return o(void 0)};return typeof e=="string"?(a.fromAttributes=s,a.fromGraph=function(h,d){return s(h.getEdgeAttributes(d))},a.fromEntry=function(h,d){return s(d)},a.fromPartialEntry=a.fromEntry,a.fromMinimalEntry=a.fromEntry):typeof e=="function"?(a.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},a.fromGraph=function(h,d){var l=h.extremities(d);return o(e(d,h.getEdgeAttributes(d),l[0],l[1],h.getNodeAttributes(l[0]),h.getNodeAttributes(l[1]),h.isUndirected(d)))},a.fromEntry=function(h,d,l,f,c,y,w){return o(e(h,d,l,f,c,y,w))},a.fromPartialEntry=function(h,d,l,f){return o(e(h,d,l,f))},a.fromMinimalEntry=function(h,d){return o(e(h,d))}):(a.fromAttributes=u,a.fromGraph=u,a.fromEntry=u,a.fromMinimalEntry=u),a}return ze.createNodeValueGetter=i,ze.createEdgeValueGetter=t,ze.createEdgeWeightGetter=function(e){return t(e,n)},ze}var gt,jt;function gn(){if(jt)return gt;jt=1;var n=0,i=1,t=2,e=3,r=4,a=5,o=6,s=7,u=8,h=9,d=0,l=1,f=2,c=0,y=1,w=2,T=3,D=4,m=5,S=6,p=7,b=8,R=3,A=10,G=3,F=9,P=10;return gt=function(z,g,K){var te,x,v,$,W,X,ie,Y,N,Ne,re=g.length,tr=K.length,Pe=z.adjustSizes,ir=z.barnesHutTheta*z.barnesHutTheta,qe,q,B,M,fe,U,O,E=[];for(v=0;vYe?(Ee-=(Ke-Ye)/2,Re=Ee+Ke):(we-=(Ye-Ke)/2,Se=we+Ye),E[0+c]=-1,E[0+y]=(we+Se)/2,E[0+w]=(Ee+Re)/2,E[0+T]=Math.max(Se-we,Re-Ee),E[0+D]=-1,E[0+m]=-1,E[0+S]=0,E[0+p]=0,E[0+b]=0,te=1,v=0;v=0){g[v+n]=0)if(U=Math.pow(g[v+n]-E[x+p],2)+Math.pow(g[v+i]-E[x+b],2),Ne=E[x+T],4*Ne*Ne/U0?(O=q*g[v+o]*E[x+S]/U,g[v+t]+=B*O,g[v+e]+=M*O):U<0&&(O=-q*g[v+o]*E[x+S]/Math.sqrt(U),g[v+t]+=B*O,g[v+e]+=M*O):U>0&&(O=q*g[v+o]*E[x+S]/U,g[v+t]+=B*O,g[v+e]+=M*O),x=E[x+D],x<0)break;continue}else{x=E[x+m];continue}else{if(X=E[x+c],X>=0&&X!==v&&(B=g[v+n]-g[X+n],M=g[v+i]-g[X+i],U=B*B+M*M,Pe===!0?U>0?(O=q*g[v+o]*g[X+o]/U,g[v+t]+=B*O,g[v+e]+=M*O):U<0&&(O=-q*g[v+o]*g[X+o]/Math.sqrt(U),g[v+t]+=B*O,g[v+e]+=M*O):U>0&&(O=q*g[v+o]*g[X+o]/U,g[v+t]+=B*O,g[v+e]+=M*O)),x=E[x+D],x<0)break;continue}else for(q=z.scalingRatio,$=0;$0?(O=q*g[$+o]*g[W+o]/U/U,g[$+t]+=B*O,g[$+e]+=M*O,g[W+t]-=B*O,g[W+e]-=M*O):U<0&&(O=100*q*g[$+o]*g[W+o],g[$+t]+=B*O,g[$+e]+=M*O,g[W+t]-=B*O,g[W+e]-=M*O)):(U=Math.sqrt(B*B+M*M),U>0&&(O=q*g[$+o]*g[W+o]/U/U,g[$+t]+=B*O,g[$+e]+=M*O,g[W+t]-=B*O,g[W+e]-=M*O));for(N=z.gravity/z.scalingRatio,q=z.scalingRatio,v=0;v0&&(O=q*g[v+o]*N):U>0&&(O=q*g[v+o]*N/U),g[v+t]-=B*O,g[v+e]-=M*O;for(q=1*(z.outboundAttractionDistribution?qe:1),ie=0;ie0&&(O=-q*fe*Math.log(1+U)/U/g[$+o]):U>0&&(O=-q*fe*Math.log(1+U)/U):z.outboundAttractionDistribution?U>0&&(O=-q*fe/g[$+o]):U>0&&(O=-q*fe)):(U=Math.sqrt(Math.pow(B,2)+Math.pow(M,2)),z.linLogMode?z.outboundAttractionDistribution?U>0&&(O=-q*fe*Math.log(1+U)/U/g[$+o]):U>0&&(O=-q*fe*Math.log(1+U)/U):z.outboundAttractionDistribution?(U=1,O=-q*fe/g[$+o]):(U=1,O=-q*fe)),U>0&&(g[$+t]+=B*O,g[$+e]+=M*O,g[W+t]-=B*O,g[W+e]-=M*O);var Ze,Ie,Xe,_e,Je,Qe;if(Pe===!0)for(v=0;vP&&(g[v+t]=g[v+t]*P/Ze,g[v+e]=g[v+e]*P/Ze),Ie=g[v+o]*Math.sqrt((g[v+r]-g[v+t])*(g[v+r]-g[v+t])+(g[v+a]-g[v+e])*(g[v+a]-g[v+e])),Xe=Math.sqrt((g[v+r]+g[v+t])*(g[v+r]+g[v+t])+(g[v+a]+g[v+e])*(g[v+a]+g[v+e]))/2,_e=.1*Math.log(1+Xe)/(1+Math.sqrt(Ie)),Je=g[v+n]+g[v+t]*(_e/z.slowDown),g[v+n]=Je,Qe=g[v+i]+g[v+e]*(_e/z.slowDown),g[v+i]=Qe);else for(v=0;v=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in t&&typeof t.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in t&&!(typeof t.gravity=="number"&&t.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in t&&!(typeof t.slowDown=="number"||t.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in t&&typeof t.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in t&&!(typeof t.barnesHutTheta=="number"&&t.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},ge.graphToByteArrays=function(t,e){var r=t.order,a=t.size,o={},s,u=new Float32Array(r*n),h=new Float32Array(a*i);return s=0,t.forEachNode(function(d,l){o[d]=s,u[s]=l.x,u[s+1]=l.y,u[s+2]=0,u[s+3]=0,u[s+4]=0,u[s+5]=0,u[s+6]=1,u[s+7]=1,u[s+8]=l.size||1,u[s+9]=l.fixed?1:0,s+=n}),s=0,t.forEachEdge(function(d,l,f,c,y,w,T){var D=o[f],m=o[c],S=e(d,l,f,c,y,w,T);u[D+6]+=S,u[m+6]+=S,h[s]=D,h[s+1]=m,h[s+2]=S,s+=i}),{nodes:u,edges:h}},ge.assignLayoutChanges=function(t,e,r){var a=0;t.updateEachNodeAttributes(function(o,s){return s.x=e[a],s.y=e[a+1],a+=n,r?r(o,s):s})},ge.readGraphPositions=function(t,e){var r=0;t.forEachNode(function(a,o){e[r]=o.x,e[r+1]=o.y,r+=n})},ge.collectLayoutChanges=function(t,e,r){for(var a=t.nodes(),o={},s=0,u=0,h=e.length;s2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(h)}}var s=a.bind(null,!1);return s.assign=a.bind(null,!0),s.inferSettings=o,vt=s,vt}var yn=mn();const it=bi(yn);function bn(n,i){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var e=t.call(n,i);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}function je(n){var i=bn(n,"string");return typeof i=="symbol"?i:i+""}function Q(n,i){if(!(n instanceof i))throw new TypeError("Cannot call a class as a function")}function Yt(n,i){for(var t=0;tn.length)&&(i=n.length);for(var t=0,e=Array(i);t>>16,t=(n&65280)>>>8,e=n&255,r=255,a=zi(i,t,e,r);return bt[n]=a,a}function Zt(n,i,t,e){return t+(i<<8)+(n<<16)}function Xt(n,i,t,e,r,a){var o=Math.floor(t/a*r),s=Math.floor(n.drawingBufferHeight/a-e/a*r),u=new Uint8Array(4);n.bindFramebuffer(n.FRAMEBUFFER,i),n.readPixels(o,s,1,1,n.RGBA,n.UNSIGNED_BYTE,u);var h=De(u,4),d=h[0],l=h[1],f=h[2],c=h[3];return[d,l,f,c]}function _(n,i,t){return(i=je(i))in n?Object.defineProperty(n,i,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[i]=t,n}function Jt(n,i){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(n);i&&(e=e.filter(function(r){return Object.getOwnPropertyDescriptor(n,r).enumerable})),t.push.apply(t,e)}return t}function L(n){for(var i=1;i{throw TypeError(e)};var P4=(e,t,r)=>t in e?C4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var is=(e,t,r)=>P4(e,typeof t!="symbol"?t+"":t,r),eg=(e,t,r)=>t.has(e)||hw("Cannot "+r);var L=(e,t,r)=>(eg(e,t,"read from private field"),r?r.call(e):t.get(e)),De=(e,t,r)=>t.has(e)?hw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),we=(e,t,r,n)=>(eg(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),We=(e,t,r)=>(eg(e,t,"access private method"),r);var Ad=(e,t,r,n)=>({set _(i){we(e,t,i,r)},get _(){return L(e,t,n)}});function O4(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();function Ex(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tg={exports:{}},Jl={},rg={exports:{}},Be={};/** +var P4=Object.defineProperty;var mw=e=>{throw TypeError(e)};var O4=(e,t,r)=>t in e?P4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var is=(e,t,r)=>O4(e,typeof t!="symbol"?t+"":t,r),eg=(e,t,r)=>t.has(e)||mw("Cannot "+r);var R=(e,t,r)=>(eg(e,t,"read from private field"),r?r.call(e):t.get(e)),De=(e,t,r)=>t.has(e)?mw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),we=(e,t,r,n)=>(eg(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),We=(e,t,r)=>(eg(e,t,"access private method"),r);var Cd=(e,t,r,n)=>({set _(i){we(e,t,i,r)},get _(){return R(e,t,n)}});function _4(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();function Ax(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var tg={exports:{}},Jl={},rg={exports:{}},Be={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var C4=Object.defineProperty;var hw=e=>{throw TypeError(e)};var P4=(e,t,r)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var mw;function _4(){if(mw)return Be;mw=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.iterator;function v(I){return I===null||typeof I!="object"?null:(I=p&&I[p]||I["@@iterator"],typeof I=="function"?I:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function k(I,M,U){this.props=I,this.context=M,this.refs=w,this.updater=U||b}k.prototype.isReactComponent={},k.prototype.setState=function(I,M){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,M,"setState")},k.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function N(){}N.prototype=k.prototype;function E(I,M,U){this.props=I,this.context=M,this.refs=w,this.updater=U||b}var A=E.prototype=new N;A.constructor=E,S(A,k.prototype),A.isPureReactComponent=!0;var C=Array.isArray,_=Object.prototype.hasOwnProperty,O={current:null},D={key:!0,ref:!0,__self:!0,__source:!0};function B(I,M,U){var ne,ee={},X=null,ae=null;if(M!=null)for(ne in M.ref!==void 0&&(ae=M.ref),M.key!==void 0&&(X=""+M.key),M)_.call(M,ne)&&!D.hasOwnProperty(ne)&&(ee[ne]=M[ne]);var me=arguments.length-2;if(me===1)ee.children=U;else if(1{throw TypeError(e)};var P4=(e,t,r)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var gw;function M4(){if(gw)return Jl;gw=1;var e=Xs(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function c(u,f,h){var m,p={},v=null,b=null;h!==void 0&&(v=""+h),f.key!==void 0&&(v=""+f.key),f.ref!==void 0&&(b=f.ref);for(m in f)n.call(f,m)&&!o.hasOwnProperty(m)&&(p[m]=f[m]);if(u&&u.defaultProps)for(m in f=u.defaultProps,f)p[m]===void 0&&(p[m]=f[m]);return{$$typeof:t,type:u,key:v,ref:b,props:p,_owner:i.current}}return Jl.Fragment=r,Jl.jsx=c,Jl.jsxs=c,Jl}var vw;function I4(){return vw||(vw=1,tg.exports=M4()),tg.exports}var l=I4(),x=Xs();const Ax=Ex(x),hh=O4({__proto__:null,default:Ax},[x]);var Cd={},ng={exports:{}},Nr={},ig={exports:{}},ag={};/** + */var vw;function I4(){if(vw)return Jl;vw=1;var e=Xs(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function c(u,f,h){var m,p={},v=null,b=null;h!==void 0&&(v=""+h),f.key!==void 0&&(v=""+f.key),f.ref!==void 0&&(b=f.ref);for(m in f)n.call(f,m)&&!o.hasOwnProperty(m)&&(p[m]=f[m]);if(u&&u.defaultProps)for(m in f=u.defaultProps,f)p[m]===void 0&&(p[m]=f[m]);return{$$typeof:t,type:u,key:v,ref:b,props:p,_owner:i.current}}return Jl.Fragment=r,Jl.jsx=c,Jl.jsxs=c,Jl}var xw;function T4(){return xw||(xw=1,tg.exports=I4()),tg.exports}var l=T4(),x=Xs();const Cx=Ax(x),hh=_4({__proto__:null,default:Cx},[x]);var Pd={},ng={exports:{}},Nr={},ig={exports:{}},ag={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var C4=Object.defineProperty;var hw=e=>{throw TypeError(e)};var P4=(e,t,r)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var xw;function T4(){return xw||(xw=1,(function(e){function t(Z,ie){var te=Z.length;Z.push(ie);e:for(;0>>1,M=Z[I];if(0>>1;Ii(ee,te))Xi(ae,ee)?(Z[I]=ae,Z[X]=te,I=X):(Z[I]=ee,Z[ne]=te,I=ne);else if(Xi(ae,te))Z[I]=ae,Z[X]=te,I=X;else break e}}return ie}function i(Z,ie){var te=Z.sortIndex-ie.sortIndex;return te!==0?te:Z.id-ie.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var f=[],h=[],m=1,p=null,v=3,b=!1,S=!1,w=!1,k=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(Z){for(var ie=r(h);ie!==null;){if(ie.callback===null)n(h);else if(ie.startTime<=Z)n(h),ie.sortIndex=ie.expirationTime,t(f,ie);else break;ie=r(h)}}function C(Z){if(w=!1,A(Z),!S)if(r(f)!==null)S=!0,oe(_);else{var ie=r(h);ie!==null&&le(C,ie.startTime-Z)}}function _(Z,ie){S=!1,w&&(w=!1,N(B),B=-1),b=!0;var te=v;try{for(A(ie),p=r(f);p!==null&&(!(p.expirationTime>ie)||Z&&!K());){var I=p.callback;if(typeof I=="function"){p.callback=null,v=p.priorityLevel;var M=I(p.expirationTime<=ie);ie=e.unstable_now(),typeof M=="function"?p.callback=M:p===r(f)&&n(f),A(ie)}else n(f);p=r(f)}if(p!==null)var U=!0;else{var ne=r(h);ne!==null&&le(C,ne.startTime-ie),U=!1}return U}finally{p=null,v=te,b=!1}}var O=!1,D=null,B=-1,z=5,$=-1;function K(){return!(e.unstable_now()-$Z||125I?(Z.sortIndex=te,t(h,Z),r(f)===null&&Z===r(h)&&(w?(N(B),B=-1):w=!0,le(C,te-I))):(Z.sortIndex=M,t(f,Z),S||b||(S=!0,oe(_))),Z},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(Z){var ie=v;return function(){var te=v;v=ie;try{return Z.apply(this,arguments)}finally{v=te}}}})(ag)),ag}var yw;function D4(){return yw||(yw=1,ig.exports=T4()),ig.exports}/** + */var yw;function D4(){return yw||(yw=1,(function(e){function t(Z,ie){var te=Z.length;Z.push(ie);e:for(;0>>1,M=Z[I];if(0>>1;Ii(ee,te))Xi(ae,ee)?(Z[I]=ae,Z[X]=te,I=X):(Z[I]=ee,Z[ne]=te,I=ne);else if(Xi(ae,te))Z[I]=ae,Z[X]=te,I=X;else break e}}return ie}function i(Z,ie){var te=Z.sortIndex-ie.sortIndex;return te!==0?te:Z.id-ie.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var f=[],h=[],m=1,p=null,v=3,b=!1,S=!1,w=!1,k=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(Z){for(var ie=r(h);ie!==null;){if(ie.callback===null)n(h);else if(ie.startTime<=Z)n(h),ie.sortIndex=ie.expirationTime,t(f,ie);else break;ie=r(h)}}function C(Z){if(w=!1,A(Z),!S)if(r(f)!==null)S=!0,oe(_);else{var ie=r(h);ie!==null&&le(C,ie.startTime-Z)}}function _(Z,ie){S=!1,w&&(w=!1,N(B),B=-1),b=!0;var te=v;try{for(A(ie),p=r(f);p!==null&&(!(p.expirationTime>ie)||Z&&!K());){var I=p.callback;if(typeof I=="function"){p.callback=null,v=p.priorityLevel;var M=I(p.expirationTime<=ie);ie=e.unstable_now(),typeof M=="function"?p.callback=M:p===r(f)&&n(f),A(ie)}else n(f);p=r(f)}if(p!==null)var U=!0;else{var ne=r(h);ne!==null&&le(C,ne.startTime-ie),U=!1}return U}finally{p=null,v=te,b=!1}}var O=!1,D=null,B=-1,z=5,$=-1;function K(){return!(e.unstable_now()-$Z||125I?(Z.sortIndex=te,t(h,Z),r(f)===null&&Z===r(h)&&(w?(N(B),B=-1):w=!0,le(C,te-I))):(Z.sortIndex=M,t(f,Z),S||b||(S=!0,oe(_))),Z},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(Z){var ie=v;return function(){var te=v;v=ie;try{return Z.apply(this,arguments)}finally{v=te}}}})(ag)),ag}var bw;function L4(){return bw||(bw=1,ig.exports=D4()),ig.exports}/** * @license React * react-dom.production.min.js * @@ -30,34 +30,34 @@ var C4=Object.defineProperty;var hw=e=>{throw TypeError(e)};var P4=(e,t,r)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var bw;function R4(){if(bw)return Nr;bw=1;var e=Xs(),t=D4();function r(a){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+a,d=1;d"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[: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]*$/,m={},p={};function v(a){return f.call(p,a)?!0:f.call(m,a)?!1:h.test(a)?p[a]=!0:(m[a]=!0,!1)}function b(a,s,d,g){if(d!==null&&d.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return g?!1:d!==null?!d.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function S(a,s,d,g){if(s===null||typeof s>"u"||b(a,s,d,g))return!0;if(g)return!1;if(d!==null)switch(d.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function w(a,s,d,g,y,j,P){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=g,this.attributeNamespace=y,this.mustUseProperty=d,this.propertyName=a,this.type=s,this.sanitizeURL=j,this.removeEmptyString=P}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){k[a]=new w(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var s=a[0];k[s]=new w(s,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){k[a]=new w(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){k[a]=new w(a,2,!1,a,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(a){k[a]=new w(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){k[a]=new w(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){k[a]=new w(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){k[a]=new w(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){k[a]=new w(a,5,!1,a.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function E(a){return a[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(a){var s=a.replace(N,E);k[s]=new w(s,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var s=a.replace(N,E);k[s]=new w(s,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var s=a.replace(N,E);k[s]=new w(s,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){k[a]=new w(a,1,!1,a.toLowerCase(),null,!1,!1)}),k.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){k[a]=new w(a,1,!1,a.toLowerCase(),null,!0,!0)});function A(a,s,d,g){var y=k.hasOwnProperty(s)?k[s]:null;(y!==null?y.type!==0:g||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[: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]*$/,m={},p={};function v(a){return f.call(p,a)?!0:f.call(m,a)?!1:h.test(a)?p[a]=!0:(m[a]=!0,!1)}function b(a,s,d,g){if(d!==null&&d.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return g?!1:d!==null?!d.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function S(a,s,d,g){if(s===null||typeof s>"u"||b(a,s,d,g))return!0;if(g)return!1;if(d!==null)switch(d.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function w(a,s,d,g,y,j,P){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=g,this.attributeNamespace=y,this.mustUseProperty=d,this.propertyName=a,this.type=s,this.sanitizeURL=j,this.removeEmptyString=P}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){k[a]=new w(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var s=a[0];k[s]=new w(s,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){k[a]=new w(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){k[a]=new w(a,2,!1,a,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(a){k[a]=new w(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){k[a]=new w(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){k[a]=new w(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){k[a]=new w(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){k[a]=new w(a,5,!1,a.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function E(a){return a[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(a){var s=a.replace(N,E);k[s]=new w(s,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var s=a.replace(N,E);k[s]=new w(s,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var s=a.replace(N,E);k[s]=new w(s,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){k[a]=new w(a,1,!1,a.toLowerCase(),null,!1,!1)}),k.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){k[a]=new w(a,1,!1,a.toLowerCase(),null,!0,!0)});function A(a,s,d,g){var y=k.hasOwnProperty(s)?k[s]:null;(y!==null?y.type!==0:g||!(2T||y[P]!==j[T]){var R=` -`+y[P].replace(" at new "," at ");return a.displayName&&R.includes("")&&(R=R.replace("",a.displayName)),R}while(1<=P&&0<=T);break}}}finally{U=!1,Error.prepareStackTrace=d}return(a=a?a.displayName||a.name:"")?M(a):""}function ee(a){switch(a.tag){case 5:return M(a.type);case 16:return M("Lazy");case 13:return M("Suspense");case 19:return M("SuspenseList");case 0:case 2:case 15:return a=ne(a.type,!1),a;case 11:return a=ne(a.type.render,!1),a;case 1:return a=ne(a.type,!0),a;default:return""}}function X(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case D:return"Fragment";case O:return"Portal";case z:return"Profiler";case B:return"StrictMode";case ve:return"Suspense";case ue:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case K:return(a.displayName||"Context")+".Consumer";case $:return(a._context.displayName||"Context")+".Provider";case W:var s=a.render;return a=a.displayName,a||(a=s.displayName||s.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case pe:return s=a.displayName||null,s!==null?s:X(a.type)||"Memo";case oe:s=a._payload,a=a._init;try{return X(a(s))}catch{}}return null}function ae(a){var s=a.type;switch(a.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=s.render,a=a.displayName||a.name||"",s.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return X(s);case 8:return s===B?"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 s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function me(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function re(a){var s=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function ye(a){var s=re(a)?"checked":"value",d=Object.getOwnPropertyDescriptor(a.constructor.prototype,s),g=""+a[s];if(!a.hasOwnProperty(s)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var y=d.get,j=d.set;return Object.defineProperty(a,s,{configurable:!0,get:function(){return y.call(this)},set:function(P){g=""+P,j.call(this,P)}}),Object.defineProperty(a,s,{enumerable:d.enumerable}),{getValue:function(){return g},setValue:function(P){g=""+P},stopTracking:function(){a._valueTracker=null,delete a[s]}}}}function Oe(a){a._valueTracker||(a._valueTracker=ye(a))}function fe(a){if(!a)return!1;var s=a._valueTracker;if(!s)return!0;var d=s.getValue(),g="";return a&&(g=re(a)?a.checked?"true":"false":a.value),a=g,a!==d?(s.setValue(a),!0):!1}function Xe(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Ue(a,s){var d=s.checked;return te({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??a._wrapperState.initialChecked})}function _e(a,s){var d=s.defaultValue==null?"":s.defaultValue,g=s.checked!=null?s.checked:s.defaultChecked;d=me(s.value!=null?s.value:d),a._wrapperState={initialChecked:g,initialValue:d,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function wt(a,s){s=s.checked,s!=null&&A(a,"checked",s,!1)}function tr(a,s){wt(a,s);var d=me(s.value),g=s.type;if(d!=null)g==="number"?(d===0&&a.value===""||a.value!=d)&&(a.value=""+d):a.value!==""+d&&(a.value=""+d);else if(g==="submit"||g==="reset"){a.removeAttribute("value");return}s.hasOwnProperty("value")?Ae(a,s.type,d):s.hasOwnProperty("defaultValue")&&Ae(a,s.type,me(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(a.defaultChecked=!!s.defaultChecked)}function G(a,s,d){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var g=s.type;if(!(g!=="submit"&&g!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+a._wrapperState.initialValue,d||s===a.value||(a.value=s),a.defaultValue=s}d=a.name,d!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,d!==""&&(a.name=d)}function Ae(a,s,d){(s!=="number"||Xe(a.ownerDocument)!==a)&&(d==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+d&&(a.defaultValue=""+d))}var Ce=Array.isArray;function Ye(a,s,d,g){if(a=a.options,s){s={};for(var y=0;y"+s.valueOf().toString()+"",s=it.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;s.firstChild;)a.appendChild(s.firstChild)}});function pl(a,s){if(s){var d=a.firstChild;if(d&&d===a.lastChild&&d.nodeType===3){d.nodeValue=s;return}}a.textContent=s}var gl={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},MO=["Webkit","ms","Moz","O"];Object.keys(gl).forEach(function(a){MO.forEach(function(s){s=s+a.charAt(0).toUpperCase()+a.substring(1),gl[s]=gl[a]})});function Cy(a,s,d){return s==null||typeof s=="boolean"||s===""?"":d||typeof s!="number"||s===0||gl.hasOwnProperty(a)&&gl[a]?(""+s).trim():s+"px"}function Py(a,s){a=a.style;for(var d in s)if(s.hasOwnProperty(d)){var g=d.indexOf("--")===0,y=Cy(d,s[d],g);d==="float"&&(d="cssFloat"),g?a.setProperty(d,y):a[d]=y}}var IO=te({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 fm(a,s){if(s){if(IO[a]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(r(137,a));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(r(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(r(61))}if(s.style!=null&&typeof s.style!="object")throw Error(r(62))}}function hm(a,s){if(a.indexOf("-")===-1)return typeof s.is=="string";switch(a){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 mm=null;function pm(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var gm=null,To=null,Do=null;function Oy(a){if(a=$l(a)){if(typeof gm!="function")throw Error(r(280));var s=a.stateNode;s&&(s=Uu(s),gm(a.stateNode,a.type,s))}}function _y(a){To?Do?Do.push(a):Do=[a]:To=a}function My(){if(To){var a=To,s=Do;if(Do=To=null,Oy(a),s)for(a=0;a>>=0,a===0?32:31-(HO(a)/KO|0)|0}var Su=64,Nu=4194304;function bl(a){switch(a&-a){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 a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Eu(a,s){var d=a.pendingLanes;if(d===0)return 0;var g=0,y=a.suspendedLanes,j=a.pingedLanes,P=d&268435455;if(P!==0){var T=P&~y;T!==0?g=bl(T):(j&=P,j!==0&&(g=bl(j)))}else P=d&~y,P!==0?g=bl(P):j!==0&&(g=bl(j));if(g===0)return 0;if(s!==0&&s!==g&&(s&y)===0&&(y=g&-g,j=s&-s,y>=j||y===16&&(j&4194240)!==0))return s;if((g&4)!==0&&(g|=d&16),s=a.entangledLanes,s!==0)for(a=a.entanglements,s&=g;0d;d++)s.push(a);return s}function wl(a,s,d){a.pendingLanes|=s,s!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,s=31-dn(s),a[s]=d}function QO(a,s){var d=a.pendingLanes&~s;a.pendingLanes=s,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=s,a.mutableReadLanes&=s,a.entangledLanes&=s,s=a.entanglements;var g=a.eventTimes;for(a=a.expirationTimes;0=Pl),ob=" ",sb=!1;function lb(a,s){switch(a){case"keyup":return j_.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cb(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var $o=!1;function N_(a,s){switch(a){case"compositionend":return cb(s);case"keypress":return s.which!==32?null:(sb=!0,ob);case"textInput":return a=s.data,a===ob&&sb?null:a;default:return null}}function E_(a,s){if($o)return a==="compositionend"||!Tm&&lb(a,s)?(a=eb(),_u=Cm=zi=null,$o=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:d,offset:s-a};a=g}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=gb(d)}}function xb(a,s){return a&&s?a===s?!0:a&&a.nodeType===3?!1:s&&s.nodeType===3?xb(a,s.parentNode):"contains"in a?a.contains(s):a.compareDocumentPosition?!!(a.compareDocumentPosition(s)&16):!1:!1}function yb(){for(var a=window,s=Xe();s instanceof a.HTMLIFrameElement;){try{var d=typeof s.contentWindow.location.href=="string"}catch{d=!1}if(d)a=s.contentWindow;else break;s=Xe(a.document)}return s}function Lm(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s&&(s==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||s==="textarea"||a.contentEditable==="true")}function D_(a){var s=yb(),d=a.focusedElem,g=a.selectionRange;if(s!==d&&d&&d.ownerDocument&&xb(d.ownerDocument.documentElement,d)){if(g!==null&&Lm(d)){if(s=g.start,a=g.end,a===void 0&&(a=s),"selectionStart"in d)d.selectionStart=s,d.selectionEnd=Math.min(a,d.value.length);else if(a=(s=d.ownerDocument||document)&&s.defaultView||window,a.getSelection){a=a.getSelection();var y=d.textContent.length,j=Math.min(g.start,y);g=g.end===void 0?j:Math.min(g.end,y),!a.extend&&j>g&&(y=g,g=j,j=y),y=vb(d,j);var P=vb(d,g);y&&P&&(a.rangeCount!==1||a.anchorNode!==y.node||a.anchorOffset!==y.offset||a.focusNode!==P.node||a.focusOffset!==P.offset)&&(s=s.createRange(),s.setStart(y.node,y.offset),a.removeAllRanges(),j>g?(a.addRange(s),a.extend(P.node,P.offset)):(s.setEnd(P.node,P.offset),a.addRange(s)))}}for(s=[],a=d;a=a.parentNode;)a.nodeType===1&&s.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d=document.documentMode,zo=null,$m=null,Il=null,zm=!1;function bb(a,s,d){var g=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;zm||zo==null||zo!==Xe(g)||(g=zo,"selectionStart"in g&&Lm(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Il&&Ml(Il,g)||(Il=g,g=zu($m,"onSelect"),0Ho||(a.current=Zm[Ho],Zm[Ho]=null,Ho--)}function rt(a,s){Ho++,Zm[Ho]=a.current,a.current=s}var Wi={},rr=Ui(Wi),br=Ui(!1),Oa=Wi;function Ko(a,s){var d=a.type.contextTypes;if(!d)return Wi;var g=a.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===s)return g.__reactInternalMemoizedMaskedChildContext;var y={},j;for(j in d)y[j]=s[j];return g&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=s,a.__reactInternalMemoizedMaskedChildContext=y),y}function wr(a){return a=a.childContextTypes,a!=null}function Wu(){ot(br),ot(rr)}function Db(a,s,d){if(rr.current!==Wi)throw Error(r(168));rt(rr,s),rt(br,d)}function Rb(a,s,d){var g=a.stateNode;if(s=s.childContextTypes,typeof g.getChildContext!="function")return d;g=g.getChildContext();for(var y in g)if(!(y in s))throw Error(r(108,ae(a)||"Unknown",y));return te({},d,g)}function Hu(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Wi,Oa=rr.current,rt(rr,a),rt(br,br.current),!0}function Lb(a,s,d){var g=a.stateNode;if(!g)throw Error(r(169));d?(a=Rb(a,s,Oa),g.__reactInternalMemoizedMergedChildContext=a,ot(br),ot(rr),rt(rr,a)):ot(br),rt(br,d)}var ei=null,Ku=!1,Xm=!1;function $b(a){ei===null?ei=[a]:ei.push(a)}function V_(a){Ku=!0,$b(a)}function Hi(){if(!Xm&&ei!==null){Xm=!0;var a=0,s=Je;try{var d=ei;for(Je=1;a>=P,y-=P,ti=1<<32-dn(s)+y|d<Le?(Lt=Te,Te=null):Lt=Te.sibling;var qe=ce(H,Te,q[Le],ge);if(qe===null){Te===null&&(Te=Lt);break}a&&Te&&qe.alternate===null&&s(H,Te),F=j(qe,F,Le),Ie===null?Pe=qe:Ie.sibling=qe,Ie=qe,Te=Lt}if(Le===q.length)return d(H,Te),ut&&Ma(H,Le),Pe;if(Te===null){for(;LeLe?(Lt=Te,Te=null):Lt=Te.sibling;var Ji=ce(H,Te,qe.value,ge);if(Ji===null){Te===null&&(Te=Lt);break}a&&Te&&Ji.alternate===null&&s(H,Te),F=j(Ji,F,Le),Ie===null?Pe=Ji:Ie.sibling=Ji,Ie=Ji,Te=Lt}if(qe.done)return d(H,Te),ut&&Ma(H,Le),Pe;if(Te===null){for(;!qe.done;Le++,qe=q.next())qe=he(H,qe.value,ge),qe!==null&&(F=j(qe,F,Le),Ie===null?Pe=qe:Ie.sibling=qe,Ie=qe);return ut&&Ma(H,Le),Pe}for(Te=g(H,Te);!qe.done;Le++,qe=q.next())qe=be(Te,H,Le,qe.value,ge),qe!==null&&(a&&qe.alternate!==null&&Te.delete(qe.key===null?Le:qe.key),F=j(qe,F,Le),Ie===null?Pe=qe:Ie.sibling=qe,Ie=qe);return a&&Te.forEach(function(A4){return s(H,A4)}),ut&&Ma(H,Le),Pe}function jt(H,F,q,ge){if(typeof q=="object"&&q!==null&&q.type===D&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case _:e:{for(var Pe=q.key,Ie=F;Ie!==null;){if(Ie.key===Pe){if(Pe=q.type,Pe===D){if(Ie.tag===7){d(H,Ie.sibling),F=y(Ie,q.props.children),F.return=H,H=F;break e}}else if(Ie.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===oe&&Hb(Pe)===Ie.type){d(H,Ie.sibling),F=y(Ie,q.props),F.ref=zl(H,Ie,q),F.return=H,H=F;break e}d(H,Ie);break}else s(H,Ie);Ie=Ie.sibling}q.type===D?(F=Fa(q.props.children,H.mode,ge,q.key),F.return=H,H=F):(ge=yd(q.type,q.key,q.props,null,H.mode,ge),ge.ref=zl(H,F,q),ge.return=H,H=ge)}return P(H);case O:e:{for(Ie=q.key;F!==null;){if(F.key===Ie)if(F.tag===4&&F.stateNode.containerInfo===q.containerInfo&&F.stateNode.implementation===q.implementation){d(H,F.sibling),F=y(F,q.children||[]),F.return=H,H=F;break e}else{d(H,F);break}else s(H,F);F=F.sibling}F=Qp(q,H.mode,ge),F.return=H,H=F}return P(H);case oe:return Ie=q._init,jt(H,F,Ie(q._payload),ge)}if(Ce(q))return Se(H,F,q,ge);if(ie(q))return Ne(H,F,q,ge);Qu(H,q)}return typeof q=="string"&&q!==""||typeof q=="number"?(q=""+q,F!==null&&F.tag===6?(d(H,F.sibling),F=y(F,q),F.return=H,H=F):(d(H,F),F=qp(q,H.mode,ge),F.return=H,H=F),P(H)):d(H,F)}return jt}var Qo=Kb(!0),Gb=Kb(!1),Yu=Ui(null),Zu=null,Yo=null,ip=null;function ap(){ip=Yo=Zu=null}function op(a){var s=Yu.current;ot(Yu),a._currentValue=s}function sp(a,s,d){for(;a!==null;){var g=a.alternate;if((a.childLanes&s)!==s?(a.childLanes|=s,g!==null&&(g.childLanes|=s)):g!==null&&(g.childLanes&s)!==s&&(g.childLanes|=s),a===d)break;a=a.return}}function Zo(a,s){Zu=a,ip=Yo=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&s)!==0&&(kr=!0),a.firstContext=null)}function Gr(a){var s=a._currentValue;if(ip!==a)if(a={context:a,memoizedValue:s,next:null},Yo===null){if(Zu===null)throw Error(r(308));Yo=a,Zu.dependencies={lanes:0,firstContext:a}}else Yo=Yo.next=a;return s}var Ia=null;function lp(a){Ia===null?Ia=[a]:Ia.push(a)}function Vb(a,s,d,g){var y=s.interleaved;return y===null?(d.next=d,lp(s)):(d.next=y.next,y.next=d),s.interleaved=d,ni(a,g)}function ni(a,s){a.lanes|=s;var d=a.alternate;for(d!==null&&(d.lanes|=s),d=a,a=a.return;a!==null;)a.childLanes|=s,d=a.alternate,d!==null&&(d.childLanes|=s),d=a,a=a.return;return d.tag===3?d.stateNode:null}var Ki=!1;function cp(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function qb(a,s){a=a.updateQueue,s.updateQueue===a&&(s.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function ii(a,s){return{eventTime:a,lane:s,tag:0,payload:null,callback:null,next:null}}function Gi(a,s,d){var g=a.updateQueue;if(g===null)return null;if(g=g.shared,(Ve&2)!==0){var y=g.pending;return y===null?s.next=s:(s.next=y.next,y.next=s),g.pending=s,ni(a,d)}return y=g.interleaved,y===null?(s.next=s,lp(g)):(s.next=y.next,y.next=s),g.interleaved=s,ni(a,d)}function Xu(a,s,d){if(s=s.updateQueue,s!==null&&(s=s.shared,(d&4194240)!==0)){var g=s.lanes;g&=a.pendingLanes,d|=g,s.lanes=d,jm(a,d)}}function Qb(a,s){var d=a.updateQueue,g=a.alternate;if(g!==null&&(g=g.updateQueue,d===g)){var y=null,j=null;if(d=d.firstBaseUpdate,d!==null){do{var P={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};j===null?y=j=P:j=j.next=P,d=d.next}while(d!==null);j===null?y=j=s:j=j.next=s}else y=j=s;d={baseState:g.baseState,firstBaseUpdate:y,lastBaseUpdate:j,shared:g.shared,effects:g.effects},a.updateQueue=d;return}a=d.lastBaseUpdate,a===null?d.firstBaseUpdate=s:a.next=s,d.lastBaseUpdate=s}function Ju(a,s,d,g){var y=a.updateQueue;Ki=!1;var j=y.firstBaseUpdate,P=y.lastBaseUpdate,T=y.shared.pending;if(T!==null){y.shared.pending=null;var R=T,Y=R.next;R.next=null,P===null?j=Y:P.next=Y,P=R;var de=a.alternate;de!==null&&(de=de.updateQueue,T=de.lastBaseUpdate,T!==P&&(T===null?de.firstBaseUpdate=Y:T.next=Y,de.lastBaseUpdate=R))}if(j!==null){var he=y.baseState;P=0,de=Y=R=null,T=j;do{var ce=T.lane,be=T.eventTime;if((g&ce)===ce){de!==null&&(de=de.next={eventTime:be,lane:0,tag:T.tag,payload:T.payload,callback:T.callback,next:null});e:{var Se=a,Ne=T;switch(ce=s,be=d,Ne.tag){case 1:if(Se=Ne.payload,typeof Se=="function"){he=Se.call(be,he,ce);break e}he=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Ne.payload,ce=typeof Se=="function"?Se.call(be,he,ce):Se,ce==null)break e;he=te({},he,ce);break e;case 2:Ki=!0}}T.callback!==null&&T.lane!==0&&(a.flags|=64,ce=y.effects,ce===null?y.effects=[T]:ce.push(T))}else be={eventTime:be,lane:ce,tag:T.tag,payload:T.payload,callback:T.callback,next:null},de===null?(Y=de=be,R=he):de=de.next=be,P|=ce;if(T=T.next,T===null){if(T=y.shared.pending,T===null)break;ce=T,T=ce.next,ce.next=null,y.lastBaseUpdate=ce,y.shared.pending=null}}while(!0);if(de===null&&(R=he),y.baseState=R,y.firstBaseUpdate=Y,y.lastBaseUpdate=de,s=y.shared.interleaved,s!==null){y=s;do P|=y.lane,y=y.next;while(y!==s)}else j===null&&(y.shared.lanes=0);Ra|=P,a.lanes=P,a.memoizedState=he}}function Yb(a,s,d){if(a=s.effects,s.effects=null,a!==null)for(s=0;sd?d:4,a(!0);var g=mp.transition;mp.transition={};try{a(!1),s()}finally{Je=d,mp.transition=g}}function p1(){return Vr().memoizedState}function Z_(a,s,d){var g=Yi(a);if(d={lane:g,action:d,hasEagerState:!1,eagerState:null,next:null},g1(a))v1(s,d);else if(d=Vb(a,s,d,g),d!==null){var y=hr();vn(d,a,g,y),x1(d,s,g)}}function X_(a,s,d){var g=Yi(a),y={lane:g,action:d,hasEagerState:!1,eagerState:null,next:null};if(g1(a))v1(s,y);else{var j=a.alternate;if(a.lanes===0&&(j===null||j.lanes===0)&&(j=s.lastRenderedReducer,j!==null))try{var P=s.lastRenderedState,T=j(P,d);if(y.hasEagerState=!0,y.eagerState=T,fn(T,P)){var R=s.interleaved;R===null?(y.next=y,lp(s)):(y.next=R.next,R.next=y),s.interleaved=y;return}}catch{}finally{}d=Vb(a,s,y,g),d!==null&&(y=hr(),vn(d,a,g,y),x1(d,s,g))}}function g1(a){var s=a.alternate;return a===pt||s!==null&&s===pt}function v1(a,s){Wl=rd=!0;var d=a.pending;d===null?s.next=s:(s.next=d.next,d.next=s),a.pending=s}function x1(a,s,d){if((d&4194240)!==0){var g=s.lanes;g&=a.pendingLanes,d|=g,s.lanes=d,jm(a,d)}}var ad={readContext:Gr,useCallback:nr,useContext:nr,useEffect:nr,useImperativeHandle:nr,useInsertionEffect:nr,useLayoutEffect:nr,useMemo:nr,useReducer:nr,useRef:nr,useState:nr,useDebugValue:nr,useDeferredValue:nr,useTransition:nr,useMutableSource:nr,useSyncExternalStore:nr,useId:nr,unstable_isNewReconciler:!1},J_={readContext:Gr,useCallback:function(a,s){return Mn().memoizedState=[a,s===void 0?null:s],a},useContext:Gr,useEffect:s1,useImperativeHandle:function(a,s,d){return d=d!=null?d.concat([a]):null,nd(4194308,4,u1.bind(null,s,a),d)},useLayoutEffect:function(a,s){return nd(4194308,4,a,s)},useInsertionEffect:function(a,s){return nd(4,2,a,s)},useMemo:function(a,s){var d=Mn();return s=s===void 0?null:s,a=a(),d.memoizedState=[a,s],a},useReducer:function(a,s,d){var g=Mn();return s=d!==void 0?d(s):s,g.memoizedState=g.baseState=s,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:s},g.queue=a,a=a.dispatch=Z_.bind(null,pt,a),[g.memoizedState,a]},useRef:function(a){var s=Mn();return a={current:a},s.memoizedState=a},useState:a1,useDebugValue:wp,useDeferredValue:function(a){return Mn().memoizedState=a},useTransition:function(){var a=a1(!1),s=a[0];return a=Y_.bind(null,a[1]),Mn().memoizedState=a,[s,a]},useMutableSource:function(){},useSyncExternalStore:function(a,s,d){var g=pt,y=Mn();if(ut){if(d===void 0)throw Error(r(407));d=d()}else{if(d=s(),Rt===null)throw Error(r(349));(Da&30)!==0||e1(g,s,d)}y.memoizedState=d;var j={value:d,getSnapshot:s};return y.queue=j,s1(r1.bind(null,g,j,a),[a]),g.flags|=2048,Gl(9,t1.bind(null,g,j,d,s),void 0,null),d},useId:function(){var a=Mn(),s=Rt.identifierPrefix;if(ut){var d=ri,g=ti;d=(g&~(1<<32-dn(g)-1)).toString(32)+d,s=":"+s+"R"+d,d=Hl++,0T||y[P]!==j[T]){var L=` +`+y[P].replace(" at new "," at ");return a.displayName&&L.includes("")&&(L=L.replace("",a.displayName)),L}while(1<=P&&0<=T);break}}}finally{U=!1,Error.prepareStackTrace=d}return(a=a?a.displayName||a.name:"")?M(a):""}function ee(a){switch(a.tag){case 5:return M(a.type);case 16:return M("Lazy");case 13:return M("Suspense");case 19:return M("SuspenseList");case 0:case 2:case 15:return a=ne(a.type,!1),a;case 11:return a=ne(a.type.render,!1),a;case 1:return a=ne(a.type,!0),a;default:return""}}function X(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case D:return"Fragment";case O:return"Portal";case z:return"Profiler";case B:return"StrictMode";case ve:return"Suspense";case ue:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case K:return(a.displayName||"Context")+".Consumer";case $:return(a._context.displayName||"Context")+".Provider";case W:var s=a.render;return a=a.displayName,a||(a=s.displayName||s.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case pe:return s=a.displayName||null,s!==null?s:X(a.type)||"Memo";case oe:s=a._payload,a=a._init;try{return X(a(s))}catch{}}return null}function ae(a){var s=a.type;switch(a.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=s.render,a=a.displayName||a.name||"",s.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return X(s);case 8:return s===B?"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 s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function me(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function re(a){var s=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function ye(a){var s=re(a)?"checked":"value",d=Object.getOwnPropertyDescriptor(a.constructor.prototype,s),g=""+a[s];if(!a.hasOwnProperty(s)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var y=d.get,j=d.set;return Object.defineProperty(a,s,{configurable:!0,get:function(){return y.call(this)},set:function(P){g=""+P,j.call(this,P)}}),Object.defineProperty(a,s,{enumerable:d.enumerable}),{getValue:function(){return g},setValue:function(P){g=""+P},stopTracking:function(){a._valueTracker=null,delete a[s]}}}}function Oe(a){a._valueTracker||(a._valueTracker=ye(a))}function fe(a){if(!a)return!1;var s=a._valueTracker;if(!s)return!0;var d=s.getValue(),g="";return a&&(g=re(a)?a.checked?"true":"false":a.value),a=g,a!==d?(s.setValue(a),!0):!1}function Xe(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Ue(a,s){var d=s.checked;return te({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??a._wrapperState.initialChecked})}function _e(a,s){var d=s.defaultValue==null?"":s.defaultValue,g=s.checked!=null?s.checked:s.defaultChecked;d=me(s.value!=null?s.value:d),a._wrapperState={initialChecked:g,initialValue:d,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function wt(a,s){s=s.checked,s!=null&&A(a,"checked",s,!1)}function tr(a,s){wt(a,s);var d=me(s.value),g=s.type;if(d!=null)g==="number"?(d===0&&a.value===""||a.value!=d)&&(a.value=""+d):a.value!==""+d&&(a.value=""+d);else if(g==="submit"||g==="reset"){a.removeAttribute("value");return}s.hasOwnProperty("value")?Ae(a,s.type,d):s.hasOwnProperty("defaultValue")&&Ae(a,s.type,me(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(a.defaultChecked=!!s.defaultChecked)}function G(a,s,d){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var g=s.type;if(!(g!=="submit"&&g!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+a._wrapperState.initialValue,d||s===a.value||(a.value=s),a.defaultValue=s}d=a.name,d!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,d!==""&&(a.name=d)}function Ae(a,s,d){(s!=="number"||Xe(a.ownerDocument)!==a)&&(d==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+d&&(a.defaultValue=""+d))}var Ce=Array.isArray;function Ye(a,s,d,g){if(a=a.options,s){s={};for(var y=0;y"+s.valueOf().toString()+"",s=it.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;s.firstChild;)a.appendChild(s.firstChild)}});function pl(a,s){if(s){var d=a.firstChild;if(d&&d===a.lastChild&&d.nodeType===3){d.nodeValue=s;return}}a.textContent=s}var gl={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},IO=["Webkit","ms","Moz","O"];Object.keys(gl).forEach(function(a){IO.forEach(function(s){s=s+a.charAt(0).toUpperCase()+a.substring(1),gl[s]=gl[a]})});function Py(a,s,d){return s==null||typeof s=="boolean"||s===""?"":d||typeof s!="number"||s===0||gl.hasOwnProperty(a)&&gl[a]?(""+s).trim():s+"px"}function Oy(a,s){a=a.style;for(var d in s)if(s.hasOwnProperty(d)){var g=d.indexOf("--")===0,y=Py(d,s[d],g);d==="float"&&(d="cssFloat"),g?a.setProperty(d,y):a[d]=y}}var TO=te({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 fm(a,s){if(s){if(TO[a]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(r(137,a));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(r(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(r(61))}if(s.style!=null&&typeof s.style!="object")throw Error(r(62))}}function hm(a,s){if(a.indexOf("-")===-1)return typeof s.is=="string";switch(a){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 mm=null;function pm(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var gm=null,To=null,Do=null;function _y(a){if(a=$l(a)){if(typeof gm!="function")throw Error(r(280));var s=a.stateNode;s&&(s=Wu(s),gm(a.stateNode,a.type,s))}}function My(a){To?Do?Do.push(a):Do=[a]:To=a}function Iy(){if(To){var a=To,s=Do;if(Do=To=null,_y(a),s)for(a=0;a>>=0,a===0?32:31-(KO(a)/GO|0)|0}var Nu=64,Eu=4194304;function bl(a){switch(a&-a){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 a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Au(a,s){var d=a.pendingLanes;if(d===0)return 0;var g=0,y=a.suspendedLanes,j=a.pingedLanes,P=d&268435455;if(P!==0){var T=P&~y;T!==0?g=bl(T):(j&=P,j!==0&&(g=bl(j)))}else P=d&~y,P!==0?g=bl(P):j!==0&&(g=bl(j));if(g===0)return 0;if(s!==0&&s!==g&&(s&y)===0&&(y=g&-g,j=s&-s,y>=j||y===16&&(j&4194240)!==0))return s;if((g&4)!==0&&(g|=d&16),s=a.entangledLanes,s!==0)for(a=a.entanglements,s&=g;0d;d++)s.push(a);return s}function wl(a,s,d){a.pendingLanes|=s,s!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,s=31-dn(s),a[s]=d}function YO(a,s){var d=a.pendingLanes&~s;a.pendingLanes=s,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=s,a.mutableReadLanes&=s,a.entangledLanes&=s,s=a.entanglements;var g=a.eventTimes;for(a=a.expirationTimes;0=Pl),sb=" ",lb=!1;function cb(a,s){switch(a){case"keyup":return S_.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ub(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var $o=!1;function E_(a,s){switch(a){case"compositionend":return ub(s);case"keypress":return s.which!==32?null:(lb=!0,sb);case"textInput":return a=s.data,a===sb&&lb?null:a;default:return null}}function A_(a,s){if($o)return a==="compositionend"||!Tm&&cb(a,s)?(a=tb(),Mu=Cm=zi=null,$o=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:d,offset:s-a};a=g}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=vb(d)}}function yb(a,s){return a&&s?a===s?!0:a&&a.nodeType===3?!1:s&&s.nodeType===3?yb(a,s.parentNode):"contains"in a?a.contains(s):a.compareDocumentPosition?!!(a.compareDocumentPosition(s)&16):!1:!1}function bb(){for(var a=window,s=Xe();s instanceof a.HTMLIFrameElement;){try{var d=typeof s.contentWindow.location.href=="string"}catch{d=!1}if(d)a=s.contentWindow;else break;s=Xe(a.document)}return s}function Rm(a){var s=a&&a.nodeName&&a.nodeName.toLowerCase();return s&&(s==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||s==="textarea"||a.contentEditable==="true")}function L_(a){var s=bb(),d=a.focusedElem,g=a.selectionRange;if(s!==d&&d&&d.ownerDocument&&yb(d.ownerDocument.documentElement,d)){if(g!==null&&Rm(d)){if(s=g.start,a=g.end,a===void 0&&(a=s),"selectionStart"in d)d.selectionStart=s,d.selectionEnd=Math.min(a,d.value.length);else if(a=(s=d.ownerDocument||document)&&s.defaultView||window,a.getSelection){a=a.getSelection();var y=d.textContent.length,j=Math.min(g.start,y);g=g.end===void 0?j:Math.min(g.end,y),!a.extend&&j>g&&(y=g,g=j,j=y),y=xb(d,j);var P=xb(d,g);y&&P&&(a.rangeCount!==1||a.anchorNode!==y.node||a.anchorOffset!==y.offset||a.focusNode!==P.node||a.focusOffset!==P.offset)&&(s=s.createRange(),s.setStart(y.node,y.offset),a.removeAllRanges(),j>g?(a.addRange(s),a.extend(P.node,P.offset)):(s.setEnd(P.node,P.offset),a.addRange(s)))}}for(s=[],a=d;a=a.parentNode;)a.nodeType===1&&s.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d=document.documentMode,zo=null,$m=null,Il=null,zm=!1;function wb(a,s,d){var g=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;zm||zo==null||zo!==Xe(g)||(g=zo,"selectionStart"in g&&Rm(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Il&&Ml(Il,g)||(Il=g,g=Fu($m,"onSelect"),0Ho||(a.current=Zm[Ho],Zm[Ho]=null,Ho--)}function rt(a,s){Ho++,Zm[Ho]=a.current,a.current=s}var Wi={},rr=Ui(Wi),br=Ui(!1),Oa=Wi;function Ko(a,s){var d=a.type.contextTypes;if(!d)return Wi;var g=a.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===s)return g.__reactInternalMemoizedMaskedChildContext;var y={},j;for(j in d)y[j]=s[j];return g&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=s,a.__reactInternalMemoizedMaskedChildContext=y),y}function wr(a){return a=a.childContextTypes,a!=null}function Hu(){ot(br),ot(rr)}function Lb(a,s,d){if(rr.current!==Wi)throw Error(r(168));rt(rr,s),rt(br,d)}function Rb(a,s,d){var g=a.stateNode;if(s=s.childContextTypes,typeof g.getChildContext!="function")return d;g=g.getChildContext();for(var y in g)if(!(y in s))throw Error(r(108,ae(a)||"Unknown",y));return te({},d,g)}function Ku(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Wi,Oa=rr.current,rt(rr,a),rt(br,br.current),!0}function $b(a,s,d){var g=a.stateNode;if(!g)throw Error(r(169));d?(a=Rb(a,s,Oa),g.__reactInternalMemoizedMergedChildContext=a,ot(br),ot(rr),rt(rr,a)):ot(br),rt(br,d)}var ei=null,Gu=!1,Xm=!1;function zb(a){ei===null?ei=[a]:ei.push(a)}function q_(a){Gu=!0,zb(a)}function Hi(){if(!Xm&&ei!==null){Xm=!0;var a=0,s=Je;try{var d=ei;for(Je=1;a>=P,y-=P,ti=1<<32-dn(s)+y|d<Re?(Rt=Te,Te=null):Rt=Te.sibling;var qe=ce(H,Te,q[Re],ge);if(qe===null){Te===null&&(Te=Rt);break}a&&Te&&qe.alternate===null&&s(H,Te),F=j(qe,F,Re),Ie===null?Pe=qe:Ie.sibling=qe,Ie=qe,Te=Rt}if(Re===q.length)return d(H,Te),ut&&Ma(H,Re),Pe;if(Te===null){for(;ReRe?(Rt=Te,Te=null):Rt=Te.sibling;var Ji=ce(H,Te,qe.value,ge);if(Ji===null){Te===null&&(Te=Rt);break}a&&Te&&Ji.alternate===null&&s(H,Te),F=j(Ji,F,Re),Ie===null?Pe=Ji:Ie.sibling=Ji,Ie=Ji,Te=Rt}if(qe.done)return d(H,Te),ut&&Ma(H,Re),Pe;if(Te===null){for(;!qe.done;Re++,qe=q.next())qe=he(H,qe.value,ge),qe!==null&&(F=j(qe,F,Re),Ie===null?Pe=qe:Ie.sibling=qe,Ie=qe);return ut&&Ma(H,Re),Pe}for(Te=g(H,Te);!qe.done;Re++,qe=q.next())qe=be(Te,H,Re,qe.value,ge),qe!==null&&(a&&qe.alternate!==null&&Te.delete(qe.key===null?Re:qe.key),F=j(qe,F,Re),Ie===null?Pe=qe:Ie.sibling=qe,Ie=qe);return a&&Te.forEach(function(C4){return s(H,C4)}),ut&&Ma(H,Re),Pe}function jt(H,F,q,ge){if(typeof q=="object"&&q!==null&&q.type===D&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case _:e:{for(var Pe=q.key,Ie=F;Ie!==null;){if(Ie.key===Pe){if(Pe=q.type,Pe===D){if(Ie.tag===7){d(H,Ie.sibling),F=y(Ie,q.props.children),F.return=H,H=F;break e}}else if(Ie.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===oe&&Kb(Pe)===Ie.type){d(H,Ie.sibling),F=y(Ie,q.props),F.ref=zl(H,Ie,q),F.return=H,H=F;break e}d(H,Ie);break}else s(H,Ie);Ie=Ie.sibling}q.type===D?(F=Fa(q.props.children,H.mode,ge,q.key),F.return=H,H=F):(ge=bd(q.type,q.key,q.props,null,H.mode,ge),ge.ref=zl(H,F,q),ge.return=H,H=ge)}return P(H);case O:e:{for(Ie=q.key;F!==null;){if(F.key===Ie)if(F.tag===4&&F.stateNode.containerInfo===q.containerInfo&&F.stateNode.implementation===q.implementation){d(H,F.sibling),F=y(F,q.children||[]),F.return=H,H=F;break e}else{d(H,F);break}else s(H,F);F=F.sibling}F=Qp(q,H.mode,ge),F.return=H,H=F}return P(H);case oe:return Ie=q._init,jt(H,F,Ie(q._payload),ge)}if(Ce(q))return Se(H,F,q,ge);if(ie(q))return Ne(H,F,q,ge);Yu(H,q)}return typeof q=="string"&&q!==""||typeof q=="number"?(q=""+q,F!==null&&F.tag===6?(d(H,F.sibling),F=y(F,q),F.return=H,H=F):(d(H,F),F=qp(q,H.mode,ge),F.return=H,H=F),P(H)):d(H,F)}return jt}var Qo=Gb(!0),Vb=Gb(!1),Zu=Ui(null),Xu=null,Yo=null,ip=null;function ap(){ip=Yo=Xu=null}function op(a){var s=Zu.current;ot(Zu),a._currentValue=s}function sp(a,s,d){for(;a!==null;){var g=a.alternate;if((a.childLanes&s)!==s?(a.childLanes|=s,g!==null&&(g.childLanes|=s)):g!==null&&(g.childLanes&s)!==s&&(g.childLanes|=s),a===d)break;a=a.return}}function Zo(a,s){Xu=a,ip=Yo=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&s)!==0&&(kr=!0),a.firstContext=null)}function Gr(a){var s=a._currentValue;if(ip!==a)if(a={context:a,memoizedValue:s,next:null},Yo===null){if(Xu===null)throw Error(r(308));Yo=a,Xu.dependencies={lanes:0,firstContext:a}}else Yo=Yo.next=a;return s}var Ia=null;function lp(a){Ia===null?Ia=[a]:Ia.push(a)}function qb(a,s,d,g){var y=s.interleaved;return y===null?(d.next=d,lp(s)):(d.next=y.next,y.next=d),s.interleaved=d,ni(a,g)}function ni(a,s){a.lanes|=s;var d=a.alternate;for(d!==null&&(d.lanes|=s),d=a,a=a.return;a!==null;)a.childLanes|=s,d=a.alternate,d!==null&&(d.childLanes|=s),d=a,a=a.return;return d.tag===3?d.stateNode:null}var Ki=!1;function cp(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Qb(a,s){a=a.updateQueue,s.updateQueue===a&&(s.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function ii(a,s){return{eventTime:a,lane:s,tag:0,payload:null,callback:null,next:null}}function Gi(a,s,d){var g=a.updateQueue;if(g===null)return null;if(g=g.shared,(Ve&2)!==0){var y=g.pending;return y===null?s.next=s:(s.next=y.next,y.next=s),g.pending=s,ni(a,d)}return y=g.interleaved,y===null?(s.next=s,lp(g)):(s.next=y.next,y.next=s),g.interleaved=s,ni(a,d)}function Ju(a,s,d){if(s=s.updateQueue,s!==null&&(s=s.shared,(d&4194240)!==0)){var g=s.lanes;g&=a.pendingLanes,d|=g,s.lanes=d,jm(a,d)}}function Yb(a,s){var d=a.updateQueue,g=a.alternate;if(g!==null&&(g=g.updateQueue,d===g)){var y=null,j=null;if(d=d.firstBaseUpdate,d!==null){do{var P={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};j===null?y=j=P:j=j.next=P,d=d.next}while(d!==null);j===null?y=j=s:j=j.next=s}else y=j=s;d={baseState:g.baseState,firstBaseUpdate:y,lastBaseUpdate:j,shared:g.shared,effects:g.effects},a.updateQueue=d;return}a=d.lastBaseUpdate,a===null?d.firstBaseUpdate=s:a.next=s,d.lastBaseUpdate=s}function ed(a,s,d,g){var y=a.updateQueue;Ki=!1;var j=y.firstBaseUpdate,P=y.lastBaseUpdate,T=y.shared.pending;if(T!==null){y.shared.pending=null;var L=T,Y=L.next;L.next=null,P===null?j=Y:P.next=Y,P=L;var de=a.alternate;de!==null&&(de=de.updateQueue,T=de.lastBaseUpdate,T!==P&&(T===null?de.firstBaseUpdate=Y:T.next=Y,de.lastBaseUpdate=L))}if(j!==null){var he=y.baseState;P=0,de=Y=L=null,T=j;do{var ce=T.lane,be=T.eventTime;if((g&ce)===ce){de!==null&&(de=de.next={eventTime:be,lane:0,tag:T.tag,payload:T.payload,callback:T.callback,next:null});e:{var Se=a,Ne=T;switch(ce=s,be=d,Ne.tag){case 1:if(Se=Ne.payload,typeof Se=="function"){he=Se.call(be,he,ce);break e}he=Se;break e;case 3:Se.flags=Se.flags&-65537|128;case 0:if(Se=Ne.payload,ce=typeof Se=="function"?Se.call(be,he,ce):Se,ce==null)break e;he=te({},he,ce);break e;case 2:Ki=!0}}T.callback!==null&&T.lane!==0&&(a.flags|=64,ce=y.effects,ce===null?y.effects=[T]:ce.push(T))}else be={eventTime:be,lane:ce,tag:T.tag,payload:T.payload,callback:T.callback,next:null},de===null?(Y=de=be,L=he):de=de.next=be,P|=ce;if(T=T.next,T===null){if(T=y.shared.pending,T===null)break;ce=T,T=ce.next,ce.next=null,y.lastBaseUpdate=ce,y.shared.pending=null}}while(!0);if(de===null&&(L=he),y.baseState=L,y.firstBaseUpdate=Y,y.lastBaseUpdate=de,s=y.shared.interleaved,s!==null){y=s;do P|=y.lane,y=y.next;while(y!==s)}else j===null&&(y.shared.lanes=0);La|=P,a.lanes=P,a.memoizedState=he}}function Zb(a,s,d){if(a=s.effects,s.effects=null,a!==null)for(s=0;sd?d:4,a(!0);var g=mp.transition;mp.transition={};try{a(!1),s()}finally{Je=d,mp.transition=g}}function g1(){return Vr().memoizedState}function X_(a,s,d){var g=Yi(a);if(d={lane:g,action:d,hasEagerState:!1,eagerState:null,next:null},v1(a))x1(s,d);else if(d=qb(a,s,d,g),d!==null){var y=hr();vn(d,a,g,y),y1(d,s,g)}}function J_(a,s,d){var g=Yi(a),y={lane:g,action:d,hasEagerState:!1,eagerState:null,next:null};if(v1(a))x1(s,y);else{var j=a.alternate;if(a.lanes===0&&(j===null||j.lanes===0)&&(j=s.lastRenderedReducer,j!==null))try{var P=s.lastRenderedState,T=j(P,d);if(y.hasEagerState=!0,y.eagerState=T,fn(T,P)){var L=s.interleaved;L===null?(y.next=y,lp(s)):(y.next=L.next,L.next=y),s.interleaved=y;return}}catch{}finally{}d=qb(a,s,y,g),d!==null&&(y=hr(),vn(d,a,g,y),y1(d,s,g))}}function v1(a){var s=a.alternate;return a===pt||s!==null&&s===pt}function x1(a,s){Wl=nd=!0;var d=a.pending;d===null?s.next=s:(s.next=d.next,d.next=s),a.pending=s}function y1(a,s,d){if((d&4194240)!==0){var g=s.lanes;g&=a.pendingLanes,d|=g,s.lanes=d,jm(a,d)}}var od={readContext:Gr,useCallback:nr,useContext:nr,useEffect:nr,useImperativeHandle:nr,useInsertionEffect:nr,useLayoutEffect:nr,useMemo:nr,useReducer:nr,useRef:nr,useState:nr,useDebugValue:nr,useDeferredValue:nr,useTransition:nr,useMutableSource:nr,useSyncExternalStore:nr,useId:nr,unstable_isNewReconciler:!1},e4={readContext:Gr,useCallback:function(a,s){return Mn().memoizedState=[a,s===void 0?null:s],a},useContext:Gr,useEffect:l1,useImperativeHandle:function(a,s,d){return d=d!=null?d.concat([a]):null,id(4194308,4,d1.bind(null,s,a),d)},useLayoutEffect:function(a,s){return id(4194308,4,a,s)},useInsertionEffect:function(a,s){return id(4,2,a,s)},useMemo:function(a,s){var d=Mn();return s=s===void 0?null:s,a=a(),d.memoizedState=[a,s],a},useReducer:function(a,s,d){var g=Mn();return s=d!==void 0?d(s):s,g.memoizedState=g.baseState=s,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:s},g.queue=a,a=a.dispatch=X_.bind(null,pt,a),[g.memoizedState,a]},useRef:function(a){var s=Mn();return a={current:a},s.memoizedState=a},useState:o1,useDebugValue:wp,useDeferredValue:function(a){return Mn().memoizedState=a},useTransition:function(){var a=o1(!1),s=a[0];return a=Z_.bind(null,a[1]),Mn().memoizedState=a,[s,a]},useMutableSource:function(){},useSyncExternalStore:function(a,s,d){var g=pt,y=Mn();if(ut){if(d===void 0)throw Error(r(407));d=d()}else{if(d=s(),Lt===null)throw Error(r(349));(Da&30)!==0||t1(g,s,d)}y.memoizedState=d;var j={value:d,getSnapshot:s};return y.queue=j,l1(n1.bind(null,g,j,a),[a]),g.flags|=2048,Gl(9,r1.bind(null,g,j,d,s),void 0,null),d},useId:function(){var a=Mn(),s=Lt.identifierPrefix;if(ut){var d=ri,g=ti;d=(g&~(1<<32-dn(g)-1)).toString(32)+d,s=":"+s+"R"+d,d=Hl++,0<\/script>",a=a.removeChild(a.firstChild)):typeof g.is=="string"?a=P.createElement(d,{is:g.is}):(a=P.createElement(d),d==="select"&&(P=a,g.multiple?P.multiple=!0:g.size&&(P.size=g.size))):a=P.createElementNS(a,d),a[On]=s,a[Ll]=g,$1(a,s,!1,!1),s.stateNode=a;e:{switch(P=hm(d,g),d){case"dialog":at("cancel",a),at("close",a),y=g;break;case"iframe":case"object":case"embed":at("load",a),y=g;break;case"video":case"audio":for(y=0;yrs&&(s.flags|=128,g=!0,Vl(j,!1),s.lanes=4194304)}else{if(!g)if(a=ed(P),a!==null){if(s.flags|=128,g=!0,d=a.updateQueue,d!==null&&(s.updateQueue=d,s.flags|=4),Vl(j,!0),j.tail===null&&j.tailMode==="hidden"&&!P.alternate&&!ut)return ir(s),null}else 2*kt()-j.renderingStartTime>rs&&d!==1073741824&&(s.flags|=128,g=!0,Vl(j,!1),s.lanes=4194304);j.isBackwards?(P.sibling=s.child,s.child=P):(d=j.last,d!==null?d.sibling=P:s.child=P,j.last=P)}return j.tail!==null?(s=j.tail,j.rendering=s,j.tail=s.sibling,j.renderingStartTime=kt(),s.sibling=null,d=mt.current,rt(mt,g?d&1|2:d&1),s):(ir(s),null);case 22:case 23:return Kp(),g=s.memoizedState!==null,a!==null&&a.memoizedState!==null!==g&&(s.flags|=8192),g&&(s.mode&1)!==0?(Tr&1073741824)!==0&&(ir(s),s.subtreeFlags&6&&(s.flags|=8192)):ir(s),null;case 24:return null;case 25:return null}throw Error(r(156,s.tag))}function s4(a,s){switch(ep(s),s.tag){case 1:return wr(s.type)&&Wu(),a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 3:return Xo(),ot(br),ot(rr),hp(),a=s.flags,(a&65536)!==0&&(a&128)===0?(s.flags=a&-65537|128,s):null;case 5:return dp(s),null;case 13:if(ot(mt),a=s.memoizedState,a!==null&&a.dehydrated!==null){if(s.alternate===null)throw Error(r(340));qo()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 19:return ot(mt),null;case 4:return Xo(),null;case 10:return op(s.type._context),null;case 22:case 23:return Kp(),null;case 24:return null;default:return null}}var cd=!1,ar=!1,l4=typeof WeakSet=="function"?WeakSet:Set,ke=null;function es(a,s){var d=a.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(g){vt(a,s,g)}else d.current=null}function Ip(a,s,d){try{d()}catch(g){vt(a,s,g)}}var B1=!1;function c4(a,s){if(Km=Pu,a=yb(),Lm(a)){if("selectionStart"in a)var d={start:a.selectionStart,end:a.selectionEnd};else e:{d=(d=a.ownerDocument)&&d.defaultView||window;var g=d.getSelection&&d.getSelection();if(g&&g.rangeCount!==0){d=g.anchorNode;var y=g.anchorOffset,j=g.focusNode;g=g.focusOffset;try{d.nodeType,j.nodeType}catch{d=null;break e}var P=0,T=-1,R=-1,Y=0,de=0,he=a,ce=null;t:for(;;){for(var be;he!==d||y!==0&&he.nodeType!==3||(T=P+y),he!==j||g!==0&&he.nodeType!==3||(R=P+g),he.nodeType===3&&(P+=he.nodeValue.length),(be=he.firstChild)!==null;)ce=he,he=be;for(;;){if(he===a)break t;if(ce===d&&++Y===y&&(T=P),ce===j&&++de===g&&(R=P),(be=he.nextSibling)!==null)break;he=ce,ce=he.parentNode}he=be}d=T===-1||R===-1?null:{start:T,end:R}}else d=null}d=d||{start:0,end:0}}else d=null;for(Gm={focusedElem:a,selectionRange:d},Pu=!1,ke=s;ke!==null;)if(s=ke,a=s.child,(s.subtreeFlags&1028)!==0&&a!==null)a.return=s,ke=a;else for(;ke!==null;){s=ke;try{var Se=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(Se!==null){var Ne=Se.memoizedProps,jt=Se.memoizedState,H=s.stateNode,F=H.getSnapshotBeforeUpdate(s.elementType===s.type?Ne:mn(s.type,Ne),jt);H.__reactInternalSnapshotBeforeUpdate=F}break;case 3:var q=s.stateNode.containerInfo;q.nodeType===1?q.textContent="":q.nodeType===9&&q.documentElement&&q.removeChild(q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ge){vt(s,s.return,ge)}if(a=s.sibling,a!==null){a.return=s.return,ke=a;break}ke=s.return}return Se=B1,B1=!1,Se}function ql(a,s,d){var g=s.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var y=g=g.next;do{if((y.tag&a)===a){var j=y.destroy;y.destroy=void 0,j!==void 0&&Ip(s,d,j)}y=y.next}while(y!==g)}}function ud(a,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var d=s=s.next;do{if((d.tag&a)===a){var g=d.create;d.destroy=g()}d=d.next}while(d!==s)}}function Tp(a){var s=a.ref;if(s!==null){var d=a.stateNode;switch(a.tag){case 5:a=d;break;default:a=d}typeof s=="function"?s(a):s.current=a}}function U1(a){var s=a.alternate;s!==null&&(a.alternate=null,U1(s)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(s=a.stateNode,s!==null&&(delete s[On],delete s[Ll],delete s[Ym],delete s[K_],delete s[G_])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function W1(a){return a.tag===5||a.tag===3||a.tag===4}function H1(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||W1(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Dp(a,s,d){var g=a.tag;if(g===5||g===6)a=a.stateNode,s?d.nodeType===8?d.parentNode.insertBefore(a,s):d.insertBefore(a,s):(d.nodeType===8?(s=d.parentNode,s.insertBefore(a,d)):(s=d,s.appendChild(a)),d=d._reactRootContainer,d!=null||s.onclick!==null||(s.onclick=Bu));else if(g!==4&&(a=a.child,a!==null))for(Dp(a,s,d),a=a.sibling;a!==null;)Dp(a,s,d),a=a.sibling}function Rp(a,s,d){var g=a.tag;if(g===5||g===6)a=a.stateNode,s?d.insertBefore(a,s):d.appendChild(a);else if(g!==4&&(a=a.child,a!==null))for(Rp(a,s,d),a=a.sibling;a!==null;)Rp(a,s,d),a=a.sibling}var Kt=null,pn=!1;function Vi(a,s,d){for(d=d.child;d!==null;)K1(a,s,d),d=d.sibling}function K1(a,s,d){if(Pn&&typeof Pn.onCommitFiberUnmount=="function")try{Pn.onCommitFiberUnmount(ju,d)}catch{}switch(d.tag){case 5:ar||es(d,s);case 6:var g=Kt,y=pn;Kt=null,Vi(a,s,d),Kt=g,pn=y,Kt!==null&&(pn?(a=Kt,d=d.stateNode,a.nodeType===8?a.parentNode.removeChild(d):a.removeChild(d)):Kt.removeChild(d.stateNode));break;case 18:Kt!==null&&(pn?(a=Kt,d=d.stateNode,a.nodeType===8?Qm(a.parentNode,d):a.nodeType===1&&Qm(a,d),El(a)):Qm(Kt,d.stateNode));break;case 4:g=Kt,y=pn,Kt=d.stateNode.containerInfo,pn=!0,Vi(a,s,d),Kt=g,pn=y;break;case 0:case 11:case 14:case 15:if(!ar&&(g=d.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){y=g=g.next;do{var j=y,P=j.destroy;j=j.tag,P!==void 0&&((j&2)!==0||(j&4)!==0)&&Ip(d,s,P),y=y.next}while(y!==g)}Vi(a,s,d);break;case 1:if(!ar&&(es(d,s),g=d.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=d.memoizedProps,g.state=d.memoizedState,g.componentWillUnmount()}catch(T){vt(d,s,T)}Vi(a,s,d);break;case 21:Vi(a,s,d);break;case 22:d.mode&1?(ar=(g=ar)||d.memoizedState!==null,Vi(a,s,d),ar=g):Vi(a,s,d);break;default:Vi(a,s,d)}}function G1(a){var s=a.updateQueue;if(s!==null){a.updateQueue=null;var d=a.stateNode;d===null&&(d=a.stateNode=new l4),s.forEach(function(g){var y=x4.bind(null,a,g);d.has(g)||(d.add(g),g.then(y,y))})}}function gn(a,s){var d=s.deletions;if(d!==null)for(var g=0;gy&&(y=P),g&=~j}if(g=y,g=kt()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*d4(g/1960))-g,10a?16:a,Qi===null)var g=!1;else{if(a=Qi,Qi=null,pd=0,(Ve&6)!==0)throw Error(r(331));var y=Ve;for(Ve|=4,ke=a.current;ke!==null;){var j=ke,P=j.child;if((ke.flags&16)!==0){var T=j.deletions;if(T!==null){for(var R=0;Rkt()-zp?$a(a,0):$p|=d),Sr(a,s)}function aw(a,s){s===0&&((a.mode&1)===0?s=1:(s=Nu,Nu<<=1,(Nu&130023424)===0&&(Nu=4194304)));var d=hr();a=ni(a,s),a!==null&&(wl(a,s,d),Sr(a,d))}function v4(a){var s=a.memoizedState,d=0;s!==null&&(d=s.retryLane),aw(a,d)}function x4(a,s){var d=0;switch(a.tag){case 13:var g=a.stateNode,y=a.memoizedState;y!==null&&(d=y.retryLane);break;case 19:g=a.stateNode;break;default:throw Error(r(314))}g!==null&&g.delete(s),aw(a,d)}var ow;ow=function(a,s,d){if(a!==null)if(a.memoizedProps!==s.pendingProps||br.current)kr=!0;else{if((a.lanes&d)===0&&(s.flags&128)===0)return kr=!1,a4(a,s,d);kr=(a.flags&131072)!==0}else kr=!1,ut&&(s.flags&1048576)!==0&&zb(s,Vu,s.index);switch(s.lanes=0,s.tag){case 2:var g=s.type;ld(a,s),a=s.pendingProps;var y=Ko(s,rr.current);Zo(s,d),y=gp(null,s,g,a,y,d);var j=vp();return s.flags|=1,typeof y=="object"&&y!==null&&typeof y.render=="function"&&y.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,wr(g)?(j=!0,Hu(s)):j=!1,s.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,cp(s),y.updater=od,s.stateNode=y,y._reactInternals=s,jp(s,g,a,d),s=Ap(null,s,g,!0,j,d)):(s.tag=0,ut&&j&&Jm(s),fr(null,s,y,d),s=s.child),s;case 16:g=s.elementType;e:{switch(ld(a,s),a=s.pendingProps,y=g._init,g=y(g._payload),s.type=g,y=s.tag=b4(g),a=mn(g,a),y){case 0:s=Ep(null,s,g,a,d);break e;case 1:s=M1(null,s,g,a,d);break e;case 11:s=A1(null,s,g,a,d);break e;case 14:s=C1(null,s,g,mn(g.type,a),d);break e}throw Error(r(306,g,""))}return s;case 0:return g=s.type,y=s.pendingProps,y=s.elementType===g?y:mn(g,y),Ep(a,s,g,y,d);case 1:return g=s.type,y=s.pendingProps,y=s.elementType===g?y:mn(g,y),M1(a,s,g,y,d);case 3:e:{if(I1(s),a===null)throw Error(r(387));g=s.pendingProps,j=s.memoizedState,y=j.element,qb(a,s),Ju(s,g,null,d);var P=s.memoizedState;if(g=P.element,j.isDehydrated)if(j={element:g,isDehydrated:!1,cache:P.cache,pendingSuspenseBoundaries:P.pendingSuspenseBoundaries,transitions:P.transitions},s.updateQueue.baseState=j,s.memoizedState=j,s.flags&256){y=Jo(Error(r(423)),s),s=T1(a,s,g,d,y);break e}else if(g!==y){y=Jo(Error(r(424)),s),s=T1(a,s,g,d,y);break e}else for(Ir=Bi(s.stateNode.containerInfo.firstChild),Mr=s,ut=!0,hn=null,d=Gb(s,null,g,d),s.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(qo(),g===y){s=ai(a,s,d);break e}fr(a,s,g,d)}s=s.child}return s;case 5:return Zb(s),a===null&&rp(s),g=s.type,y=s.pendingProps,j=a!==null?a.memoizedProps:null,P=y.children,Vm(g,y)?P=null:j!==null&&Vm(g,j)&&(s.flags|=32),_1(a,s),fr(a,s,P,d),s.child;case 6:return a===null&&rp(s),null;case 13:return D1(a,s,d);case 4:return up(s,s.stateNode.containerInfo),g=s.pendingProps,a===null?s.child=Qo(s,null,g,d):fr(a,s,g,d),s.child;case 11:return g=s.type,y=s.pendingProps,y=s.elementType===g?y:mn(g,y),A1(a,s,g,y,d);case 7:return fr(a,s,s.pendingProps,d),s.child;case 8:return fr(a,s,s.pendingProps.children,d),s.child;case 12:return fr(a,s,s.pendingProps.children,d),s.child;case 10:e:{if(g=s.type._context,y=s.pendingProps,j=s.memoizedProps,P=y.value,rt(Yu,g._currentValue),g._currentValue=P,j!==null)if(fn(j.value,P)){if(j.children===y.children&&!br.current){s=ai(a,s,d);break e}}else for(j=s.child,j!==null&&(j.return=s);j!==null;){var T=j.dependencies;if(T!==null){P=j.child;for(var R=T.firstContext;R!==null;){if(R.context===g){if(j.tag===1){R=ii(-1,d&-d),R.tag=2;var Y=j.updateQueue;if(Y!==null){Y=Y.shared;var de=Y.pending;de===null?R.next=R:(R.next=de.next,de.next=R),Y.pending=R}}j.lanes|=d,R=j.alternate,R!==null&&(R.lanes|=d),sp(j.return,d,s),T.lanes|=d;break}R=R.next}}else if(j.tag===10)P=j.type===s.type?null:j.child;else if(j.tag===18){if(P=j.return,P===null)throw Error(r(341));P.lanes|=d,T=P.alternate,T!==null&&(T.lanes|=d),sp(P,d,s),P=j.sibling}else P=j.child;if(P!==null)P.return=j;else for(P=j;P!==null;){if(P===s){P=null;break}if(j=P.sibling,j!==null){j.return=P.return,P=j;break}P=P.return}j=P}fr(a,s,y.children,d),s=s.child}return s;case 9:return y=s.type,g=s.pendingProps.children,Zo(s,d),y=Gr(y),g=g(y),s.flags|=1,fr(a,s,g,d),s.child;case 14:return g=s.type,y=mn(g,s.pendingProps),y=mn(g.type,y),C1(a,s,g,y,d);case 15:return P1(a,s,s.type,s.pendingProps,d);case 17:return g=s.type,y=s.pendingProps,y=s.elementType===g?y:mn(g,y),ld(a,s),s.tag=1,wr(g)?(a=!0,Hu(s)):a=!1,Zo(s,d),b1(s,g,y),jp(s,g,y,d),Ap(null,s,g,!0,a,d);case 19:return L1(a,s,d);case 22:return O1(a,s,d)}throw Error(r(156,s.tag))};function sw(a,s){return Fy(a,s)}function y4(a,s,d,g){this.tag=a,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qr(a,s,d,g){return new y4(a,s,d,g)}function Vp(a){return a=a.prototype,!(!a||!a.isReactComponent)}function b4(a){if(typeof a=="function")return Vp(a)?1:0;if(a!=null){if(a=a.$$typeof,a===W)return 11;if(a===pe)return 14}return 2}function Xi(a,s){var d=a.alternate;return d===null?(d=Qr(a.tag,s,a.key,a.mode),d.elementType=a.elementType,d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.pendingProps=s,d.type=a.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=a.flags&14680064,d.childLanes=a.childLanes,d.lanes=a.lanes,d.child=a.child,d.memoizedProps=a.memoizedProps,d.memoizedState=a.memoizedState,d.updateQueue=a.updateQueue,s=a.dependencies,d.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},d.sibling=a.sibling,d.index=a.index,d.ref=a.ref,d}function yd(a,s,d,g,y,j){var P=2;if(g=a,typeof a=="function")Vp(a)&&(P=1);else if(typeof a=="string")P=5;else e:switch(a){case D:return Fa(d.children,y,j,s);case B:P=8,y|=8;break;case z:return a=Qr(12,d,s,y|2),a.elementType=z,a.lanes=j,a;case ve:return a=Qr(13,d,s,y),a.elementType=ve,a.lanes=j,a;case ue:return a=Qr(19,d,s,y),a.elementType=ue,a.lanes=j,a;case le:return bd(d,y,j,s);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case $:P=10;break e;case K:P=9;break e;case W:P=11;break e;case pe:P=14;break e;case oe:P=16,g=null;break e}throw Error(r(130,a==null?a:typeof a,""))}return s=Qr(P,d,s,y),s.elementType=a,s.type=g,s.lanes=j,s}function Fa(a,s,d,g){return a=Qr(7,a,g,s),a.lanes=d,a}function bd(a,s,d,g){return a=Qr(22,a,g,s),a.elementType=le,a.lanes=d,a.stateNode={isHidden:!1},a}function qp(a,s,d){return a=Qr(6,a,null,s),a.lanes=d,a}function Qp(a,s,d){return s=Qr(4,a.children!==null?a.children:[],a.key,s),s.lanes=d,s.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},s}function w4(a,s,d,g,y){this.tag=s,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=km(0),this.expirationTimes=km(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=km(0),this.identifierPrefix=g,this.onRecoverableError=y,this.mutableSourceEagerHydrationData=null}function Yp(a,s,d,g,y,j,P,T,R){return a=new w4(a,s,d,T,R),s===1?(s=1,j===!0&&(s|=8)):s=0,j=Qr(3,null,null,s),a.current=j,j.stateNode=a,j.memoizedState={element:g,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},cp(j),a}function k4(a,s,d){var g=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ng.exports=R4(),ng.exports}var kw;function L4(){if(kw)return Cd;kw=1;var e=LN();return Cd.createRoot=e.createRoot,Cd.hydrateRoot=e.hydrateRoot,Cd}var $4=L4();const z4=Ex($4);var Jc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},io,la,Es,AN,F4=(AN=class extends Jc{constructor(){super();De(this,io);De(this,la);De(this,Es);we(this,Es,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){L(this,la)||this.setEventListener(L(this,Es))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,la))==null||t.call(this),we(this,la,void 0))}setEventListener(t){var r;we(this,Es,t),(r=L(this,la))==null||r.call(this),we(this,la,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){L(this,io)!==t&&(we(this,io,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof L(this,io)=="boolean"?L(this,io):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},io=new WeakMap,la=new WeakMap,Es=new WeakMap,AN),Cx=new F4,B4={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ca,Nx,CN,U4=(CN=class{constructor(){De(this,ca,B4);De(this,Nx,!1)}setTimeoutProvider(e){we(this,ca,e)}setTimeout(e,t){return L(this,ca).setTimeout(e,t)}clearTimeout(e){L(this,ca).clearTimeout(e)}setInterval(e,t){return L(this,ca).setInterval(e,t)}clearInterval(e){L(this,ca).clearInterval(e)}},ca=new WeakMap,Nx=new WeakMap,CN),Za=new U4;function W4(e){setTimeout(e,0)}var H4=typeof window>"u"||"Deno"in globalThis;function Ar(){}function K4(e,t){return typeof e=="function"?e(t):e}function Jg(e){return typeof e=="number"&&e>=0&&e!==1/0}function $N(e,t){return Math.max(e+(t||0)-Date.now(),0)}function va(e,t){return typeof e=="function"?e(t):e}function Lr(e,t){return typeof e=="function"?e(t):e}function jw(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:c,stale:u}=e;if(c){if(n){if(t.queryHash!==Px(c,t.options))return!1}else if(!Sc(t.queryKey,c))return!1}if(r!=="all"){const f=t.isActive();if(r==="active"&&!f||r==="inactive"&&f)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||i&&i!==t.state.fetchStatus||o&&!o(t))}function Sw(e,t){const{exact:r,status:n,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(jc(t.options.mutationKey)!==jc(o))return!1}else if(!Sc(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function Px(e,t){return((t==null?void 0:t.queryKeyHashFn)||jc)(e)}function jc(e){return JSON.stringify(e,(t,r)=>tv(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Sc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Sc(e[r],t[r])):!1}var G4=Object.prototype.hasOwnProperty;function zN(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=Nw(e)&&Nw(t);if(!n&&!(tv(e)&&tv(t)))return t;const o=(n?e:Object.keys(e)).length,c=n?t:Object.keys(t),u=c.length,f=n?new Array(u):{};let h=0;for(let m=0;m{Za.setTimeout(t,e)})}function rv(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?zN(e,t):t}function q4(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Q4(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Ox=Symbol();function FN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ox?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function BN(e,t){return typeof e=="function"?e(...t):!!e}function Y4(e,t,r){let n=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),n||(n=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),e}var Nc=(()=>{let e=()=>H4;return{isServer(){return e()},setIsServer(t){e=t}}})();function nv(){let e,t;const r=new Promise((i,o)=>{e=i,t=o});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},r.reject=i=>{n({status:"rejected",reason:i}),t(i)},r}var Z4=W4;function X4(){let e=[],t=0,r=u=>{u()},n=u=>{u()},i=Z4;const o=u=>{t?e.push(u):i(()=>{r(u)})},c=()=>{const u=e;e=[],u.length&&i(()=>{n(()=>{u.forEach(f=>{r(f)})})})};return{batch:u=>{let f;t++;try{f=u()}finally{t--,t||c()}return f},batchCalls:u=>(...f)=>{o(()=>{u(...f)})},schedule:o,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{n=u},setScheduler:u=>{i=u}}}var Yt=X4(),As,ua,Cs,PN,J4=(PN=class extends Jc{constructor(){super();De(this,As,!0);De(this,ua);De(this,Cs);we(this,Cs,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){L(this,ua)||this.setEventListener(L(this,Cs))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,ua))==null||t.call(this),we(this,ua,void 0))}setEventListener(t){var r;we(this,Cs,t),(r=L(this,ua))==null||r.call(this),we(this,ua,t(this.setOnline.bind(this)))}setOnline(t){L(this,As)!==t&&(we(this,As,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return L(this,As)}},As=new WeakMap,ua=new WeakMap,Cs=new WeakMap,PN),ff=new J4;function eM(e){return Math.min(1e3*2**e,3e4)}function UN(e){return(e??"online")==="online"?ff.isOnline():!0}var iv=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function WN(e){let t=!1,r=0,n;const i=nv(),o=()=>i.status!=="pending",c=w=>{var k;if(!o()){const N=new iv(w);v(N),(k=e.onCancel)==null||k.call(e,N)}},u=()=>{t=!0},f=()=>{t=!1},h=()=>Cx.isFocused()&&(e.networkMode==="always"||ff.isOnline())&&e.canRun(),m=()=>UN(e.networkMode)&&e.canRun(),p=w=>{o()||(n==null||n(),i.resolve(w))},v=w=>{o()||(n==null||n(),i.reject(w))},b=()=>new Promise(w=>{var k;n=N=>{(o()||h())&&w(N)},(k=e.onPause)==null||k.call(e)}).then(()=>{var w;n=void 0,o()||(w=e.onContinue)==null||w.call(e)}),S=()=>{if(o())return;let w;const k=r===0?e.initialPromise:void 0;try{w=k??e.fn()}catch(N){w=Promise.reject(N)}Promise.resolve(w).then(p).catch(N=>{var O;if(o())return;const E=e.retry??(Nc.isServer()?0:3),A=e.retryDelay??eM,C=typeof A=="function"?A(r,N):A,_=E===!0||typeof E=="number"&&rh()?void 0:b()).then(()=>{t?v(N):S()})})};return{promise:i,status:()=>i.status,cancel:c,continue:()=>(n==null||n(),i),cancelRetry:u,continueRetry:f,canStart:m,start:()=>(m()?S():b().then(S),i)}}var ao,ON,HN=(ON=class{constructor(){De(this,ao)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Jg(this.gcTime)&&we(this,ao,Za.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Nc.isServer()?1/0:300*1e3))}clearGcTimeout(){L(this,ao)!==void 0&&(Za.clearTimeout(L(this,ao)),we(this,ao,void 0))}},ao=new WeakMap,ON);function tM(e){return{onFetch:(t,r)=>{var m,p,v,b,S;const n=t.options,i=(v=(p=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:p.fetchMore)==null?void 0:v.direction,o=((b=t.state.data)==null?void 0:b.pages)||[],c=((S=t.state.data)==null?void 0:S.pageParams)||[];let u={pages:[],pageParams:[]},f=0;const h=async()=>{let w=!1;const k=A=>{Y4(A,()=>t.signal,()=>w=!0)},N=FN(t.options,t.fetchOptions),E=async(A,C,_)=>{if(w)return Promise.reject(t.signal.reason);if(C==null&&A.pages.length)return Promise.resolve(A);const D=(()=>{const K={client:t.client,queryKey:t.queryKey,pageParam:C,direction:_?"backward":"forward",meta:t.options.meta};return k(K),K})(),B=await N(D),{maxPages:z}=t.options,$=_?Q4:q4;return{pages:$(A.pages,B,z),pageParams:$(A.pageParams,C,z)}};if(i&&o.length){const A=i==="backward",C=A?rM:Aw,_={pages:o,pageParams:c},O=C(n,_);u=await E(_,O,A)}else{const A=e??o.length;do{const C=f===0?c[0]??n.initialPageParam:Aw(n,u);if(f>0&&C==null)break;u=await E(u,C),f++}while(f{var w,k;return(k=(w=t.options).persister)==null?void 0:k.call(w,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=h}}}function Aw(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function rM(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Ps,oo,Os,Xr,so,$t,qc,lo,Rr,KN,li,_N,nM=(_N=class extends HN{constructor(t){super();De(this,Rr);De(this,Ps);De(this,oo);De(this,Os);De(this,Xr);De(this,so);De(this,$t);De(this,qc);De(this,lo);we(this,lo,!1),we(this,qc,t.defaultOptions),this.setOptions(t.options),this.observers=[],we(this,so,t.client),we(this,Xr,L(this,so).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,we(this,oo,Pw(this.options)),this.state=t.state??L(this,oo),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return L(this,Ps)}get promise(){var t;return(t=L(this,$t))==null?void 0:t.promise}setOptions(t){if(this.options={...L(this,qc),...t},t!=null&&t._type&&we(this,Ps,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Pw(this.options);r.data!==void 0&&(this.setState(Cw(r.data,r.dataUpdatedAt)),we(this,oo,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&L(this,Xr).remove(this)}setData(t,r){const n=rv(this.state.data,t,this.options);return We(this,Rr,li).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){We(this,Rr,li).call(this,{type:"setState",state:t})}cancel(t){var n,i;const r=(n=L(this,$t))==null?void 0:n.promise;return(i=L(this,$t))==null||i.cancel(t),r?r.then(Ar).catch(Ar):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return L(this,oo)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Lr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ox||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>va(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!$N(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=L(this,$t))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=L(this,$t))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),L(this,Xr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(L(this,$t)&&(L(this,lo)||We(this,Rr,KN).call(this)?L(this,$t).cancel({revert:!0}):L(this,$t).cancelRetry()),this.scheduleGc()),L(this,Xr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||We(this,Rr,li).call(this,{type:"invalidate"})}async fetch(t,r){var h,m,p,v,b,S,w,k,N,E,A;if(this.state.fetchStatus!=="idle"&&((h=L(this,$t))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(L(this,$t))return L(this,$t).continueRetry(),L(this,$t).promise}if(t&&this.setOptions(t),!this.options.queryFn){const C=this.observers.find(_=>_.options.queryFn);C&&this.setOptions(C.options)}const n=new AbortController,i=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(we(this,lo,!0),n.signal)})},o=()=>{const C=FN(this.options,r),O=(()=>{const D={client:L(this,so),queryKey:this.queryKey,meta:this.meta};return i(D),D})();return we(this,lo,!1),this.options.persister?this.options.persister(C,O,this):C(O)},u=(()=>{const C={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:L(this,so),state:this.state,fetchFn:o};return i(C),C})(),f=L(this,Ps)==="infinite"?tM(this.options.pages):this.options.behavior;f==null||f.onFetch(u,this),we(this,Os,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=u.fetchOptions)==null?void 0:m.meta))&&We(this,Rr,li).call(this,{type:"fetch",meta:(p=u.fetchOptions)==null?void 0:p.meta}),we(this,$t,WN({initialPromise:r==null?void 0:r.initialPromise,fn:u.fetchFn,onCancel:C=>{C instanceof iv&&C.revert&&this.setState({...L(this,Os),fetchStatus:"idle"}),n.abort()},onFail:(C,_)=>{We(this,Rr,li).call(this,{type:"failed",failureCount:C,error:_})},onPause:()=>{We(this,Rr,li).call(this,{type:"pause"})},onContinue:()=>{We(this,Rr,li).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const C=await L(this,$t).start();if(C===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(C),(b=(v=L(this,Xr).config).onSuccess)==null||b.call(v,C,this),(w=(S=L(this,Xr).config).onSettled)==null||w.call(S,C,this.state.error,this),C}catch(C){if(C instanceof iv){if(C.silent)return L(this,$t).promise;if(C.revert){if(this.state.data===void 0)throw C;return this.state.data}}throw We(this,Rr,li).call(this,{type:"error",error:C}),(N=(k=L(this,Xr).config).onError)==null||N.call(k,C,this),(A=(E=L(this,Xr).config).onSettled)==null||A.call(E,this.state.data,C,this),C}finally{this.scheduleGc()}}},Ps=new WeakMap,oo=new WeakMap,Os=new WeakMap,Xr=new WeakMap,so=new WeakMap,$t=new WeakMap,qc=new WeakMap,lo=new WeakMap,Rr=new WeakSet,KN=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},li=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...GN(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...Cw(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return we(this,Os,t.manual?i:void 0),i;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Yt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),L(this,Xr).notify({query:this,type:"updated",action:t})})},_N);function GN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:UN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Cw(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Pw(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Er,Ke,Qc,mr,co,_s,ui,da,Yc,Ms,Is,uo,fo,fa,Ts,Ze,mc,av,ov,sv,lv,cv,uv,dv,VN,MN,iM=(MN=class extends Jc{constructor(t,r){super();De(this,Ze);De(this,Er);De(this,Ke);De(this,Qc);De(this,mr);De(this,co);De(this,_s);De(this,ui);De(this,da);De(this,Yc);De(this,Ms);De(this,Is);De(this,uo);De(this,fo);De(this,fa);De(this,Ts,new Set);this.options=r,we(this,Er,t),we(this,da,null),we(this,ui,nv()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(L(this,Ke).addObserver(this),Ow(L(this,Ke),this.options)?We(this,Ze,mc).call(this):this.updateResult(),We(this,Ze,lv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fv(L(this,Ke),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fv(L(this,Ke),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,We(this,Ze,cv).call(this),We(this,Ze,uv).call(this),L(this,Ke).removeObserver(this)}setOptions(t){const r=this.options,n=L(this,Ke);if(this.options=L(this,Er).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Lr(this.options.enabled,L(this,Ke))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");We(this,Ze,dv).call(this),L(this,Ke).setOptions(this.options),r._defaulted&&!ev(this.options,r)&&L(this,Er).getQueryCache().notify({type:"observerOptionsUpdated",query:L(this,Ke),observer:this});const i=this.hasListeners();i&&_w(L(this,Ke),n,this.options,r)&&We(this,Ze,mc).call(this),this.updateResult(),i&&(L(this,Ke)!==n||Lr(this.options.enabled,L(this,Ke))!==Lr(r.enabled,L(this,Ke))||va(this.options.staleTime,L(this,Ke))!==va(r.staleTime,L(this,Ke)))&&We(this,Ze,av).call(this);const o=We(this,Ze,ov).call(this);i&&(L(this,Ke)!==n||Lr(this.options.enabled,L(this,Ke))!==Lr(r.enabled,L(this,Ke))||o!==L(this,fa))&&We(this,Ze,sv).call(this,o)}getOptimisticResult(t){const r=L(this,Er).getQueryCache().build(L(this,Er),t),n=this.createResult(r,t);return oM(this,n)&&(we(this,mr,n),we(this,_s,this.options),we(this,co,L(this,Ke).state)),n}getCurrentResult(){return L(this,mr)}trackResult(t,r){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),r==null||r(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&L(this,ui).status==="pending"&&L(this,ui).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(t){L(this,Ts).add(t)}getCurrentQuery(){return L(this,Ke)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=L(this,Er).defaultQueryOptions(t),n=L(this,Er).getQueryCache().build(L(this,Er),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return We(this,Ze,mc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),L(this,mr)))}createResult(t,r){var z;const n=L(this,Ke),i=this.options,o=L(this,mr),c=L(this,co),u=L(this,_s),h=t!==n?t.state:L(this,Qc),{state:m}=t;let p={...m},v=!1,b;if(r._optimisticResults){const $=this.hasListeners(),K=!$&&Ow(t,r),W=$&&_w(t,n,r,i);(K||W)&&(p={...p,...GN(m.data,t.options)}),r._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:S,errorUpdatedAt:w,status:k}=p;b=p.data;let N=!1;if(r.placeholderData!==void 0&&b===void 0&&k==="pending"){let $;o!=null&&o.isPlaceholderData&&r.placeholderData===(u==null?void 0:u.placeholderData)?($=o.data,N=!0):$=typeof r.placeholderData=="function"?r.placeholderData((z=L(this,Is))==null?void 0:z.state.data,L(this,Is)):r.placeholderData,$!==void 0&&(k="success",b=rv(o==null?void 0:o.data,$,r),v=!0)}if(r.select&&b!==void 0&&!N)if(o&&b===(c==null?void 0:c.data)&&r.select===L(this,Yc))b=L(this,Ms);else try{we(this,Yc,r.select),b=r.select(b),b=rv(o==null?void 0:o.data,b,r),we(this,Ms,b),we(this,da,null)}catch($){we(this,da,$)}L(this,da)&&(S=L(this,da),b=L(this,Ms),w=Date.now(),k="error");const E=p.fetchStatus==="fetching",A=k==="pending",C=k==="error",_=A&&E,O=b!==void 0,B={status:k,fetchStatus:p.fetchStatus,isPending:A,isSuccess:k==="success",isError:C,isInitialLoading:_,isLoading:_,data:b,dataUpdatedAt:p.dataUpdatedAt,error:S,errorUpdatedAt:w,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>h.dataUpdateCount||p.errorUpdateCount>h.errorUpdateCount,isFetching:E,isRefetching:E&&!A,isLoadingError:C&&!O,isPaused:p.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:C&&O,isStale:_x(t,r),refetch:this.refetch,promise:L(this,ui),isEnabled:Lr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const $=B.data!==void 0,K=B.status==="error"&&!$,W=pe=>{K?pe.reject(B.error):$&&pe.resolve(B.data)},ve=()=>{const pe=we(this,ui,B.promise=nv());W(pe)},ue=L(this,ui);switch(ue.status){case"pending":t.queryHash===n.queryHash&&W(ue);break;case"fulfilled":(K||B.data!==ue.value)&&ve();break;case"rejected":(!K||B.error!==ue.reason)&&ve();break}}return B}updateResult(){const t=L(this,mr),r=this.createResult(L(this,Ke),this.options);if(we(this,co,L(this,Ke).state),we(this,_s,this.options),L(this,co).data!==void 0&&we(this,Is,L(this,Ke)),ev(r,t))return;we(this,mr,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!L(this,Ts).size)return!0;const c=new Set(o??L(this,Ts));return this.options.throwOnError&&c.add("error"),Object.keys(L(this,mr)).some(u=>{const f=u;return L(this,mr)[f]!==t[f]&&c.has(f)})};We(this,Ze,VN).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&We(this,Ze,lv).call(this)}},Er=new WeakMap,Ke=new WeakMap,Qc=new WeakMap,mr=new WeakMap,co=new WeakMap,_s=new WeakMap,ui=new WeakMap,da=new WeakMap,Yc=new WeakMap,Ms=new WeakMap,Is=new WeakMap,uo=new WeakMap,fo=new WeakMap,fa=new WeakMap,Ts=new WeakMap,Ze=new WeakSet,mc=function(t){We(this,Ze,dv).call(this);let r=L(this,Ke).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Ar)),r},av=function(){We(this,Ze,cv).call(this);const t=va(this.options.staleTime,L(this,Ke));if(Nc.isServer()||L(this,mr).isStale||!Jg(t))return;const n=$N(L(this,mr).dataUpdatedAt,t)+1;we(this,uo,Za.setTimeout(()=>{L(this,mr).isStale||this.updateResult()},n))},ov=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(L(this,Ke)):this.options.refetchInterval)??!1},sv=function(t){We(this,Ze,uv).call(this),we(this,fa,t),!(Nc.isServer()||Lr(this.options.enabled,L(this,Ke))===!1||!Jg(L(this,fa))||L(this,fa)===0)&&we(this,fo,Za.setInterval(()=>{(this.options.refetchIntervalInBackground||Cx.isFocused())&&We(this,Ze,mc).call(this)},L(this,fa)))},lv=function(){We(this,Ze,av).call(this),We(this,Ze,sv).call(this,We(this,Ze,ov).call(this))},cv=function(){L(this,uo)!==void 0&&(Za.clearTimeout(L(this,uo)),we(this,uo,void 0))},uv=function(){L(this,fo)!==void 0&&(Za.clearInterval(L(this,fo)),we(this,fo,void 0))},dv=function(){const t=L(this,Er).getQueryCache().build(L(this,Er),this.options);if(t===L(this,Ke))return;const r=L(this,Ke);we(this,Ke,t),we(this,Qc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},VN=function(t){Yt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(L(this,mr))}),L(this,Er).getQueryCache().notify({query:L(this,Ke),type:"observerResultsUpdated"})})},MN);function aM(e,t){return Lr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Lr(t.retryOnMount,e)===!1)}function Ow(e,t){return aM(e,t)||e.state.data!==void 0&&fv(e,t,t.refetchOnMount)}function fv(e,t,r){if(Lr(t.enabled,e)!==!1&&va(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&_x(e,t)}return!1}function _w(e,t,r,n){return(e!==t||Lr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&_x(e,r)}function _x(e,t){return Lr(t.enabled,e)!==!1&&e.isStaleByTime(va(t.staleTime,e))}function oM(e,t){return!ev(e.getCurrentResult(),t)}var Zc,$n,or,ho,zn,na,IN,sM=(IN=class extends HN{constructor(t){super();De(this,zn);De(this,Zc);De(this,$n);De(this,or);De(this,ho);we(this,Zc,t.client),this.mutationId=t.mutationId,we(this,or,t.mutationCache),we(this,$n,[]),this.state=t.state||lM(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){L(this,$n).includes(t)||(L(this,$n).push(t),this.clearGcTimeout(),L(this,or).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){we(this,$n,L(this,$n).filter(r=>r!==t)),this.scheduleGc(),L(this,or).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){L(this,$n).length||(this.state.status==="pending"?this.scheduleGc():L(this,or).remove(this))}continue(){var t;return((t=L(this,ho))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,u,f,h,m,p,v,b,S,w,k,N,E,A,C,_,O,D;const r=()=>{We(this,zn,na).call(this,{type:"continue"})},n={client:L(this,Zc),meta:this.options.meta,mutationKey:this.options.mutationKey};we(this,ho,WN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(B,z)=>{We(this,zn,na).call(this,{type:"failed",failureCount:B,error:z})},onPause:()=>{We(this,zn,na).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>L(this,or).canRun(this)}));const i=this.state.status==="pending",o=!L(this,ho).canStart();try{if(i)r();else{We(this,zn,na).call(this,{type:"pending",variables:t,isPaused:o}),L(this,or).config.onMutate&&await L(this,or).config.onMutate(t,this,n);const z=await((u=(c=this.options).onMutate)==null?void 0:u.call(c,t,n));z!==this.state.context&&We(this,zn,na).call(this,{type:"pending",context:z,variables:t,isPaused:o})}const B=await L(this,ho).start();return await((h=(f=L(this,or).config).onSuccess)==null?void 0:h.call(f,B,t,this.state.context,this,n)),await((p=(m=this.options).onSuccess)==null?void 0:p.call(m,B,t,this.state.context,n)),await((b=(v=L(this,or).config).onSettled)==null?void 0:b.call(v,B,null,this.state.variables,this.state.context,this,n)),await((w=(S=this.options).onSettled)==null?void 0:w.call(S,B,null,t,this.state.context,n)),We(this,zn,na).call(this,{type:"success",data:B}),B}catch(B){try{await((N=(k=L(this,or).config).onError)==null?void 0:N.call(k,B,t,this.state.context,this,n))}catch(z){Promise.reject(z)}try{await((A=(E=this.options).onError)==null?void 0:A.call(E,B,t,this.state.context,n))}catch(z){Promise.reject(z)}try{await((_=(C=L(this,or).config).onSettled)==null?void 0:_.call(C,void 0,B,this.state.variables,this.state.context,this,n))}catch(z){Promise.reject(z)}try{await((D=(O=this.options).onSettled)==null?void 0:D.call(O,void 0,B,t,this.state.context,n))}catch(z){Promise.reject(z)}throw We(this,zn,na).call(this,{type:"error",error:B}),B}finally{L(this,or).runNext(this)}}},Zc=new WeakMap,$n=new WeakMap,or=new WeakMap,ho=new WeakMap,zn=new WeakSet,na=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Yt.batch(()=>{L(this,$n).forEach(n=>{n.onMutationUpdate(t)}),L(this,or).notify({mutation:this,type:"updated",action:t})})},IN);function lM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var di,yn,Xc,TN,cM=(TN=class extends Jc{constructor(t={}){super();De(this,di);De(this,yn);De(this,Xc);this.config=t,we(this,di,new Set),we(this,yn,new Map),we(this,Xc,0)}build(t,r,n){const i=new sM({client:t,mutationCache:this,mutationId:++Ad(this,Xc)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){L(this,di).add(t);const r=Pd(t);if(typeof r=="string"){const n=L(this,yn).get(r);n?n.push(t):L(this,yn).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(L(this,di).delete(t)){const r=Pd(t);if(typeof r=="string"){const n=L(this,yn).get(r);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&L(this,yn).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Pd(t);if(typeof r=="string"){const n=L(this,yn).get(r),i=n==null?void 0:n.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var n;const r=Pd(t);if(typeof r=="string"){const i=(n=L(this,yn).get(r))==null?void 0:n.find(o=>o!==t&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Yt.batch(()=>{L(this,di).forEach(t=>{this.notify({type:"removed",mutation:t})}),L(this,di).clear(),L(this,yn).clear()})}getAll(){return Array.from(L(this,di))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Sw(r,n))}findAll(t={}){return this.getAll().filter(r=>Sw(t,r))}notify(t){Yt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Yt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Ar))))}},di=new WeakMap,yn=new WeakMap,Xc=new WeakMap,TN);function Pd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Fn,DN,uM=(DN=class extends Jc{constructor(t={}){super();De(this,Fn);this.config=t,we(this,Fn,new Map)}build(t,r,n){const i=r.queryKey,o=r.queryHash??Px(i,r);let c=this.get(o);return c||(c=new nM({client:t,queryKey:i,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(c)),c}add(t){L(this,Fn).has(t.queryHash)||(L(this,Fn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=L(this,Fn).get(t.queryHash);r&&(t.destroy(),r===t&&L(this,Fn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Yt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return L(this,Fn).get(t)}getAll(){return[...L(this,Fn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>jw(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>jw(t,n)):r}notify(t){Yt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Yt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Yt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Fn=new WeakMap,DN),xt,ha,ma,Ds,Rs,pa,Ls,$s,RN,dM=(RN=class{constructor(e={}){De(this,xt);De(this,ha);De(this,ma);De(this,Ds);De(this,Rs);De(this,pa);De(this,Ls);De(this,$s);we(this,xt,e.queryCache||new uM),we(this,ha,e.mutationCache||new cM),we(this,ma,e.defaultOptions||{}),we(this,Ds,new Map),we(this,Rs,new Map),we(this,pa,0)}mount(){Ad(this,pa)._++,L(this,pa)===1&&(we(this,Ls,Cx.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,xt).onFocus())})),we(this,$s,ff.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,xt).onOnline())})))}unmount(){var e,t;Ad(this,pa)._--,L(this,pa)===0&&((e=L(this,Ls))==null||e.call(this),we(this,Ls,void 0),(t=L(this,$s))==null||t.call(this),we(this,$s,void 0))}isFetching(e){return L(this,xt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return L(this,ha).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=L(this,xt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=L(this,xt).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(va(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return L(this,xt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=L(this,xt).get(n.queryHash),o=i==null?void 0:i.state.data,c=K4(t,o);if(c!==void 0)return L(this,xt).build(this,n).setData(c,{...r,manual:!0})}setQueriesData(e,t,r){return Yt.batch(()=>L(this,xt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=L(this,xt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=L(this,xt);Yt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=L(this,xt);return Yt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Yt.batch(()=>L(this,xt).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(Ar).catch(Ar)}invalidateQueries(e,t={}){return Yt.batch(()=>(L(this,xt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Yt.batch(()=>L(this,xt).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,r);return r.throwOnError||(o=o.catch(Ar)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(Ar)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=L(this,xt).build(this,t);return r.isStaleByTime(va(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ar).catch(Ar)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ar).catch(Ar)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return ff.isOnline()?L(this,ha).resumePausedMutations():Promise.resolve()}getQueryCache(){return L(this,xt)}getMutationCache(){return L(this,ha)}getDefaultOptions(){return L(this,ma)}setDefaultOptions(e){we(this,ma,e)}setQueryDefaults(e,t){L(this,Ds).set(jc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...L(this,Ds).values()],r={};return t.forEach(n=>{Sc(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){L(this,Rs).set(jc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...L(this,Rs).values()],r={};return t.forEach(n=>{Sc(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...L(this,ma).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Px(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ox&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...L(this,ma).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){L(this,xt).clear(),L(this,ha).clear()}},xt=new WeakMap,ha=new WeakMap,ma=new WeakMap,Ds=new WeakMap,Rs=new WeakMap,pa=new WeakMap,Ls=new WeakMap,$s=new WeakMap,RN),qN=x.createContext(void 0),Wr=e=>{const t=x.useContext(qN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},fM=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(qN.Provider,{value:e,children:t})),QN=x.createContext(!1),hM=()=>x.useContext(QN);QN.Provider;function mM(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var pM=x.createContext(mM()),gM=()=>x.useContext(pM),vM=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?BN(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},xM=e=>{x.useEffect(()=>{e.clearReset()},[e])},yM=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||BN(r,[e.error,n])),bM=e=>{if(e.suspense){const r=i=>i==="static"?i:Math.max(i??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...i)=>r(n(...i)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},wM=(e,t)=>e.isLoading&&e.isFetching&&!t,kM=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Mw=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function jM(e,t,r){var b,S,w,k;const n=hM(),i=gM(),o=Wr(),c=o.defaultQueryOptions(e);(S=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||S.call(b,c);const u=o.getQueryCache().get(c.queryHash),f=e.subscribed!==!1;c._optimisticResults=n?"isRestoring":f?"optimistic":void 0,bM(c),vM(c,i,u),xM(i);const h=!o.getQueryCache().get(c.queryHash),[m]=x.useState(()=>new t(o,c)),p=m.getOptimisticResult(c),v=!n&&f;if(x.useSyncExternalStore(x.useCallback(N=>{const E=v?m.subscribe(Yt.batchCalls(N)):Ar;return m.updateResult(),E},[m,v]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),x.useEffect(()=>{m.setOptions(c)},[c,m]),kM(c,p))throw Mw(c,m,i);if(yM({result:p,errorResetBoundary:i,throwOnError:c.throwOnError,query:u,suspense:c.suspense}))throw p.error;if((k=(w=o.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||k.call(w,c,p),c.experimental_prefetchInRender&&!Nc.isServer()&&wM(p,n)){const N=h?Mw(c,m,i):u==null?void 0:u.promise;N==null||N.catch(Ar).finally(()=>{m.updateResult()})}return c.notifyOnChangeProps?p:m.trackResult(p)}function gt(e,t){return jM(e,iM)}/** +`+j.stack}return{value:a,source:s,stack:y,digest:null}}function Sp(a,s,d){return{value:a,source:null,stack:d??null,digest:s??null}}function Np(a,s){try{console.error(s.value)}catch(d){setTimeout(function(){throw d})}}var n4=typeof WeakMap=="function"?WeakMap:Map;function j1(a,s,d){d=ii(-1,d),d.tag=3,d.payload={element:null};var g=s.value;return d.callback=function(){md||(md=!0,Fp=g),Np(a,s)},d}function S1(a,s,d){d=ii(-1,d),d.tag=3;var g=a.type.getDerivedStateFromError;if(typeof g=="function"){var y=s.value;d.payload=function(){return g(y)},d.callback=function(){Np(a,s)}}var j=a.stateNode;return j!==null&&typeof j.componentDidCatch=="function"&&(d.callback=function(){Np(a,s),typeof g!="function"&&(qi===null?qi=new Set([this]):qi.add(this));var P=s.stack;this.componentDidCatch(s.value,{componentStack:P!==null?P:""})}),d}function N1(a,s,d){var g=a.pingCache;if(g===null){g=a.pingCache=new n4;var y=new Set;g.set(s,y)}else y=g.get(s),y===void 0&&(y=new Set,g.set(s,y));y.has(d)||(y.add(d),a=v4.bind(null,a,s,d),s.then(a,a))}function E1(a){do{var s;if((s=a.tag===13)&&(s=a.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return a;a=a.return}while(a!==null);return null}function A1(a,s,d,g,y){return(a.mode&1)===0?(a===s?a.flags|=65536:(a.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(s=ii(-1,1),s.tag=2,Gi(d,s,1))),d.lanes|=1),a):(a.flags|=65536,a.lanes=y,a)}var i4=C.ReactCurrentOwner,kr=!1;function fr(a,s,d,g){s.child=a===null?Vb(s,null,d,g):Qo(s,a.child,d,g)}function C1(a,s,d,g,y){d=d.render;var j=s.ref;return Zo(s,y),g=gp(a,s,d,g,j,y),d=vp(),a!==null&&!kr?(s.updateQueue=a.updateQueue,s.flags&=-2053,a.lanes&=~y,ai(a,s,y)):(ut&&d&&Jm(s),s.flags|=1,fr(a,s,g,y),s.child)}function P1(a,s,d,g,y){if(a===null){var j=d.type;return typeof j=="function"&&!Vp(j)&&j.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(s.tag=15,s.type=j,O1(a,s,j,g,y)):(a=bd(d.type,null,g,s,s.mode,y),a.ref=s.ref,a.return=s,s.child=a)}if(j=a.child,(a.lanes&y)===0){var P=j.memoizedProps;if(d=d.compare,d=d!==null?d:Ml,d(P,g)&&a.ref===s.ref)return ai(a,s,y)}return s.flags|=1,a=Xi(j,g),a.ref=s.ref,a.return=s,s.child=a}function O1(a,s,d,g,y){if(a!==null){var j=a.memoizedProps;if(Ml(j,g)&&a.ref===s.ref)if(kr=!1,s.pendingProps=g=j,(a.lanes&y)!==0)(a.flags&131072)!==0&&(kr=!0);else return s.lanes=a.lanes,ai(a,s,y)}return Ep(a,s,d,g,y)}function _1(a,s,d){var g=s.pendingProps,y=g.children,j=a!==null?a.memoizedState:null;if(g.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},rt(ts,Tr),Tr|=d;else{if((d&1073741824)===0)return a=j!==null?j.baseLanes|d:d,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:a,cachePool:null,transitions:null},s.updateQueue=null,rt(ts,Tr),Tr|=a,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=j!==null?j.baseLanes:d,rt(ts,Tr),Tr|=g}else j!==null?(g=j.baseLanes|d,s.memoizedState=null):g=d,rt(ts,Tr),Tr|=g;return fr(a,s,y,d),s.child}function M1(a,s){var d=s.ref;(a===null&&d!==null||a!==null&&a.ref!==d)&&(s.flags|=512,s.flags|=2097152)}function Ep(a,s,d,g,y){var j=wr(d)?Oa:rr.current;return j=Ko(s,j),Zo(s,y),d=gp(a,s,d,g,j,y),g=vp(),a!==null&&!kr?(s.updateQueue=a.updateQueue,s.flags&=-2053,a.lanes&=~y,ai(a,s,y)):(ut&&g&&Jm(s),s.flags|=1,fr(a,s,d,y),s.child)}function I1(a,s,d,g,y){if(wr(d)){var j=!0;Ku(s)}else j=!1;if(Zo(s,y),s.stateNode===null)cd(a,s),w1(s,d,g),jp(s,d,g,y),g=!0;else if(a===null){var P=s.stateNode,T=s.memoizedProps;P.props=T;var L=P.context,Y=d.contextType;typeof Y=="object"&&Y!==null?Y=Gr(Y):(Y=wr(d)?Oa:rr.current,Y=Ko(s,Y));var de=d.getDerivedStateFromProps,he=typeof de=="function"||typeof P.getSnapshotBeforeUpdate=="function";he||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(T!==g||L!==Y)&&k1(s,P,g,Y),Ki=!1;var ce=s.memoizedState;P.state=ce,ed(s,g,P,y),L=s.memoizedState,T!==g||ce!==L||br.current||Ki?(typeof de=="function"&&(kp(s,d,de,g),L=s.memoizedState),(T=Ki||b1(s,d,T,g,ce,L,Y))?(he||typeof P.UNSAFE_componentWillMount!="function"&&typeof P.componentWillMount!="function"||(typeof P.componentWillMount=="function"&&P.componentWillMount(),typeof P.UNSAFE_componentWillMount=="function"&&P.UNSAFE_componentWillMount()),typeof P.componentDidMount=="function"&&(s.flags|=4194308)):(typeof P.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=g,s.memoizedState=L),P.props=g,P.state=L,P.context=Y,g=T):(typeof P.componentDidMount=="function"&&(s.flags|=4194308),g=!1)}else{P=s.stateNode,Qb(a,s),T=s.memoizedProps,Y=s.type===s.elementType?T:mn(s.type,T),P.props=Y,he=s.pendingProps,ce=P.context,L=d.contextType,typeof L=="object"&&L!==null?L=Gr(L):(L=wr(d)?Oa:rr.current,L=Ko(s,L));var be=d.getDerivedStateFromProps;(de=typeof be=="function"||typeof P.getSnapshotBeforeUpdate=="function")||typeof P.UNSAFE_componentWillReceiveProps!="function"&&typeof P.componentWillReceiveProps!="function"||(T!==he||ce!==L)&&k1(s,P,g,L),Ki=!1,ce=s.memoizedState,P.state=ce,ed(s,g,P,y);var Se=s.memoizedState;T!==he||ce!==Se||br.current||Ki?(typeof be=="function"&&(kp(s,d,be,g),Se=s.memoizedState),(Y=Ki||b1(s,d,Y,g,ce,Se,L)||!1)?(de||typeof P.UNSAFE_componentWillUpdate!="function"&&typeof P.componentWillUpdate!="function"||(typeof P.componentWillUpdate=="function"&&P.componentWillUpdate(g,Se,L),typeof P.UNSAFE_componentWillUpdate=="function"&&P.UNSAFE_componentWillUpdate(g,Se,L)),typeof P.componentDidUpdate=="function"&&(s.flags|=4),typeof P.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof P.componentDidUpdate!="function"||T===a.memoizedProps&&ce===a.memoizedState||(s.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||T===a.memoizedProps&&ce===a.memoizedState||(s.flags|=1024),s.memoizedProps=g,s.memoizedState=Se),P.props=g,P.state=Se,P.context=L,g=Y):(typeof P.componentDidUpdate!="function"||T===a.memoizedProps&&ce===a.memoizedState||(s.flags|=4),typeof P.getSnapshotBeforeUpdate!="function"||T===a.memoizedProps&&ce===a.memoizedState||(s.flags|=1024),g=!1)}return Ap(a,s,d,g,j,y)}function Ap(a,s,d,g,y,j){M1(a,s);var P=(s.flags&128)!==0;if(!g&&!P)return y&&$b(s,d,!1),ai(a,s,j);g=s.stateNode,i4.current=s;var T=P&&typeof d.getDerivedStateFromError!="function"?null:g.render();return s.flags|=1,a!==null&&P?(s.child=Qo(s,a.child,null,j),s.child=Qo(s,null,T,j)):fr(a,s,T,j),s.memoizedState=g.state,y&&$b(s,d,!0),s.child}function T1(a){var s=a.stateNode;s.pendingContext?Lb(a,s.pendingContext,s.pendingContext!==s.context):s.context&&Lb(a,s.context,!1),up(a,s.containerInfo)}function D1(a,s,d,g,y){return qo(),np(y),s.flags|=256,fr(a,s,d,g),s.child}var Cp={dehydrated:null,treeContext:null,retryLane:0};function Pp(a){return{baseLanes:a,cachePool:null,transitions:null}}function L1(a,s,d){var g=s.pendingProps,y=mt.current,j=!1,P=(s.flags&128)!==0,T;if((T=P)||(T=a!==null&&a.memoizedState===null?!1:(y&2)!==0),T?(j=!0,s.flags&=-129):(a===null||a.memoizedState!==null)&&(y|=1),rt(mt,y&1),a===null)return rp(s),a=s.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((s.mode&1)===0?s.lanes=1:a.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(P=g.children,a=g.fallback,j?(g=s.mode,j=s.child,P={mode:"hidden",children:P},(g&1)===0&&j!==null?(j.childLanes=0,j.pendingProps=P):j=wd(P,g,0,null),a=Fa(a,g,d,null),j.return=s,a.return=s,j.sibling=a,s.child=j,s.child.memoizedState=Pp(d),s.memoizedState=Cp,a):Op(s,P));if(y=a.memoizedState,y!==null&&(T=y.dehydrated,T!==null))return a4(a,s,P,g,T,y,d);if(j){j=g.fallback,P=s.mode,y=a.child,T=y.sibling;var L={mode:"hidden",children:g.children};return(P&1)===0&&s.child!==y?(g=s.child,g.childLanes=0,g.pendingProps=L,s.deletions=null):(g=Xi(y,L),g.subtreeFlags=y.subtreeFlags&14680064),T!==null?j=Xi(T,j):(j=Fa(j,P,d,null),j.flags|=2),j.return=s,g.return=s,g.sibling=j,s.child=g,g=j,j=s.child,P=a.child.memoizedState,P=P===null?Pp(d):{baseLanes:P.baseLanes|d,cachePool:null,transitions:P.transitions},j.memoizedState=P,j.childLanes=a.childLanes&~d,s.memoizedState=Cp,g}return j=a.child,a=j.sibling,g=Xi(j,{mode:"visible",children:g.children}),(s.mode&1)===0&&(g.lanes=d),g.return=s,g.sibling=null,a!==null&&(d=s.deletions,d===null?(s.deletions=[a],s.flags|=16):d.push(a)),s.child=g,s.memoizedState=null,g}function Op(a,s){return s=wd({mode:"visible",children:s},a.mode,0,null),s.return=a,a.child=s}function ld(a,s,d,g){return g!==null&&np(g),Qo(s,a.child,null,d),a=Op(s,s.pendingProps.children),a.flags|=2,s.memoizedState=null,a}function a4(a,s,d,g,y,j,P){if(d)return s.flags&256?(s.flags&=-257,g=Sp(Error(r(422))),ld(a,s,P,g)):s.memoizedState!==null?(s.child=a.child,s.flags|=128,null):(j=g.fallback,y=s.mode,g=wd({mode:"visible",children:g.children},y,0,null),j=Fa(j,y,P,null),j.flags|=2,g.return=s,j.return=s,g.sibling=j,s.child=g,(s.mode&1)!==0&&Qo(s,a.child,null,P),s.child.memoizedState=Pp(P),s.memoizedState=Cp,j);if((s.mode&1)===0)return ld(a,s,P,null);if(y.data==="$!"){if(g=y.nextSibling&&y.nextSibling.dataset,g)var T=g.dgst;return g=T,j=Error(r(419)),g=Sp(j,g,void 0),ld(a,s,P,g)}if(T=(P&a.childLanes)!==0,kr||T){if(g=Lt,g!==null){switch(P&-P){case 4:y=2;break;case 16:y=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:y=32;break;case 536870912:y=268435456;break;default:y=0}y=(y&(g.suspendedLanes|P))!==0?0:y,y!==0&&y!==j.retryLane&&(j.retryLane=y,ni(a,y),vn(g,a,y,-1))}return Gp(),g=Sp(Error(r(421))),ld(a,s,P,g)}return y.data==="$?"?(s.flags|=128,s.child=a.child,s=x4.bind(null,a),y._reactRetry=s,null):(a=j.treeContext,Ir=Bi(y.nextSibling),Mr=s,ut=!0,hn=null,a!==null&&(Hr[Kr++]=ti,Hr[Kr++]=ri,Hr[Kr++]=_a,ti=a.id,ri=a.overflow,_a=s),s=Op(s,g.children),s.flags|=4096,s)}function R1(a,s,d){a.lanes|=s;var g=a.alternate;g!==null&&(g.lanes|=s),sp(a.return,s,d)}function _p(a,s,d,g,y){var j=a.memoizedState;j===null?a.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:g,tail:d,tailMode:y}:(j.isBackwards=s,j.rendering=null,j.renderingStartTime=0,j.last=g,j.tail=d,j.tailMode=y)}function $1(a,s,d){var g=s.pendingProps,y=g.revealOrder,j=g.tail;if(fr(a,s,g.children,d),g=mt.current,(g&2)!==0)g=g&1|2,s.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=s.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&R1(a,d,s);else if(a.tag===19)R1(a,d,s);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break e;for(;a.sibling===null;){if(a.return===null||a.return===s)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}g&=1}if(rt(mt,g),(s.mode&1)===0)s.memoizedState=null;else switch(y){case"forwards":for(d=s.child,y=null;d!==null;)a=d.alternate,a!==null&&td(a)===null&&(y=d),d=d.sibling;d=y,d===null?(y=s.child,s.child=null):(y=d.sibling,d.sibling=null),_p(s,!1,y,d,j);break;case"backwards":for(d=null,y=s.child,s.child=null;y!==null;){if(a=y.alternate,a!==null&&td(a)===null){s.child=y;break}a=y.sibling,y.sibling=d,d=y,y=a}_p(s,!0,d,null,j);break;case"together":_p(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function cd(a,s){(s.mode&1)===0&&a!==null&&(a.alternate=null,s.alternate=null,s.flags|=2)}function ai(a,s,d){if(a!==null&&(s.dependencies=a.dependencies),La|=s.lanes,(d&s.childLanes)===0)return null;if(a!==null&&s.child!==a.child)throw Error(r(153));if(s.child!==null){for(a=s.child,d=Xi(a,a.pendingProps),s.child=d,d.return=s;a.sibling!==null;)a=a.sibling,d=d.sibling=Xi(a,a.pendingProps),d.return=s;d.sibling=null}return s.child}function o4(a,s,d){switch(s.tag){case 3:T1(s),qo();break;case 5:Xb(s);break;case 1:wr(s.type)&&Ku(s);break;case 4:up(s,s.stateNode.containerInfo);break;case 10:var g=s.type._context,y=s.memoizedProps.value;rt(Zu,g._currentValue),g._currentValue=y;break;case 13:if(g=s.memoizedState,g!==null)return g.dehydrated!==null?(rt(mt,mt.current&1),s.flags|=128,null):(d&s.child.childLanes)!==0?L1(a,s,d):(rt(mt,mt.current&1),a=ai(a,s,d),a!==null?a.sibling:null);rt(mt,mt.current&1);break;case 19:if(g=(d&s.childLanes)!==0,(a.flags&128)!==0){if(g)return $1(a,s,d);s.flags|=128}if(y=s.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),rt(mt,mt.current),g)break;return null;case 22:case 23:return s.lanes=0,_1(a,s,d)}return ai(a,s,d)}var z1,Mp,F1,B1;z1=function(a,s){for(var d=s.child;d!==null;){if(d.tag===5||d.tag===6)a.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===s)break;for(;d.sibling===null;){if(d.return===null||d.return===s)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},Mp=function(){},F1=function(a,s,d,g){var y=a.memoizedProps;if(y!==g){a=s.stateNode,Ta(_n.current);var j=null;switch(d){case"input":y=Ue(a,y),g=Ue(a,g),j=[];break;case"select":y=te({},y,{value:void 0}),g=te({},g,{value:void 0}),j=[];break;case"textarea":y=et(a,y),g=et(a,g),j=[];break;default:typeof y.onClick!="function"&&typeof g.onClick=="function"&&(a.onclick=Uu)}fm(d,g);var P;d=null;for(Y in y)if(!g.hasOwnProperty(Y)&&y.hasOwnProperty(Y)&&y[Y]!=null)if(Y==="style"){var T=y[Y];for(P in T)T.hasOwnProperty(P)&&(d||(d={}),d[P]="")}else Y!=="dangerouslySetInnerHTML"&&Y!=="children"&&Y!=="suppressContentEditableWarning"&&Y!=="suppressHydrationWarning"&&Y!=="autoFocus"&&(i.hasOwnProperty(Y)?j||(j=[]):(j=j||[]).push(Y,null));for(Y in g){var L=g[Y];if(T=y!=null?y[Y]:void 0,g.hasOwnProperty(Y)&&L!==T&&(L!=null||T!=null))if(Y==="style")if(T){for(P in T)!T.hasOwnProperty(P)||L&&L.hasOwnProperty(P)||(d||(d={}),d[P]="");for(P in L)L.hasOwnProperty(P)&&T[P]!==L[P]&&(d||(d={}),d[P]=L[P])}else d||(j||(j=[]),j.push(Y,d)),d=L;else Y==="dangerouslySetInnerHTML"?(L=L?L.__html:void 0,T=T?T.__html:void 0,L!=null&&T!==L&&(j=j||[]).push(Y,L)):Y==="children"?typeof L!="string"&&typeof L!="number"||(j=j||[]).push(Y,""+L):Y!=="suppressContentEditableWarning"&&Y!=="suppressHydrationWarning"&&(i.hasOwnProperty(Y)?(L!=null&&Y==="onScroll"&&at("scroll",a),j||T===L||(j=[])):(j=j||[]).push(Y,L))}d&&(j=j||[]).push("style",d);var Y=j;(s.updateQueue=Y)&&(s.flags|=4)}},B1=function(a,s,d,g){d!==g&&(s.flags|=4)};function Vl(a,s){if(!ut)switch(a.tailMode){case"hidden":s=a.tail;for(var d=null;s!==null;)s.alternate!==null&&(d=s),s=s.sibling;d===null?a.tail=null:d.sibling=null;break;case"collapsed":d=a.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?s||a.tail===null?a.tail=null:a.tail.sibling=null:g.sibling=null}}function ir(a){var s=a.alternate!==null&&a.alternate.child===a.child,d=0,g=0;if(s)for(var y=a.child;y!==null;)d|=y.lanes|y.childLanes,g|=y.subtreeFlags&14680064,g|=y.flags&14680064,y.return=a,y=y.sibling;else for(y=a.child;y!==null;)d|=y.lanes|y.childLanes,g|=y.subtreeFlags,g|=y.flags,y.return=a,y=y.sibling;return a.subtreeFlags|=g,a.childLanes=d,s}function s4(a,s,d){var g=s.pendingProps;switch(ep(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ir(s),null;case 1:return wr(s.type)&&Hu(),ir(s),null;case 3:return g=s.stateNode,Xo(),ot(br),ot(rr),hp(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(a===null||a.child===null)&&(Qu(s)?s.flags|=4:a===null||a.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,hn!==null&&(Wp(hn),hn=null))),Mp(a,s),ir(s),null;case 5:dp(s);var y=Ta(Ul.current);if(d=s.type,a!==null&&s.stateNode!=null)F1(a,s,d,g,y),a.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!g){if(s.stateNode===null)throw Error(r(166));return ir(s),null}if(a=Ta(_n.current),Qu(s)){g=s.stateNode,d=s.type;var j=s.memoizedProps;switch(g[On]=s,g[Rl]=j,a=(s.mode&1)!==0,d){case"dialog":at("cancel",g),at("close",g);break;case"iframe":case"object":case"embed":at("load",g);break;case"video":case"audio":for(y=0;y<\/script>",a=a.removeChild(a.firstChild)):typeof g.is=="string"?a=P.createElement(d,{is:g.is}):(a=P.createElement(d),d==="select"&&(P=a,g.multiple?P.multiple=!0:g.size&&(P.size=g.size))):a=P.createElementNS(a,d),a[On]=s,a[Rl]=g,z1(a,s,!1,!1),s.stateNode=a;e:{switch(P=hm(d,g),d){case"dialog":at("cancel",a),at("close",a),y=g;break;case"iframe":case"object":case"embed":at("load",a),y=g;break;case"video":case"audio":for(y=0;yrs&&(s.flags|=128,g=!0,Vl(j,!1),s.lanes=4194304)}else{if(!g)if(a=td(P),a!==null){if(s.flags|=128,g=!0,d=a.updateQueue,d!==null&&(s.updateQueue=d,s.flags|=4),Vl(j,!0),j.tail===null&&j.tailMode==="hidden"&&!P.alternate&&!ut)return ir(s),null}else 2*kt()-j.renderingStartTime>rs&&d!==1073741824&&(s.flags|=128,g=!0,Vl(j,!1),s.lanes=4194304);j.isBackwards?(P.sibling=s.child,s.child=P):(d=j.last,d!==null?d.sibling=P:s.child=P,j.last=P)}return j.tail!==null?(s=j.tail,j.rendering=s,j.tail=s.sibling,j.renderingStartTime=kt(),s.sibling=null,d=mt.current,rt(mt,g?d&1|2:d&1),s):(ir(s),null);case 22:case 23:return Kp(),g=s.memoizedState!==null,a!==null&&a.memoizedState!==null!==g&&(s.flags|=8192),g&&(s.mode&1)!==0?(Tr&1073741824)!==0&&(ir(s),s.subtreeFlags&6&&(s.flags|=8192)):ir(s),null;case 24:return null;case 25:return null}throw Error(r(156,s.tag))}function l4(a,s){switch(ep(s),s.tag){case 1:return wr(s.type)&&Hu(),a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 3:return Xo(),ot(br),ot(rr),hp(),a=s.flags,(a&65536)!==0&&(a&128)===0?(s.flags=a&-65537|128,s):null;case 5:return dp(s),null;case 13:if(ot(mt),a=s.memoizedState,a!==null&&a.dehydrated!==null){if(s.alternate===null)throw Error(r(340));qo()}return a=s.flags,a&65536?(s.flags=a&-65537|128,s):null;case 19:return ot(mt),null;case 4:return Xo(),null;case 10:return op(s.type._context),null;case 22:case 23:return Kp(),null;case 24:return null;default:return null}}var ud=!1,ar=!1,c4=typeof WeakSet=="function"?WeakSet:Set,ke=null;function es(a,s){var d=a.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(g){vt(a,s,g)}else d.current=null}function Ip(a,s,d){try{d()}catch(g){vt(a,s,g)}}var U1=!1;function u4(a,s){if(Km=Ou,a=bb(),Rm(a)){if("selectionStart"in a)var d={start:a.selectionStart,end:a.selectionEnd};else e:{d=(d=a.ownerDocument)&&d.defaultView||window;var g=d.getSelection&&d.getSelection();if(g&&g.rangeCount!==0){d=g.anchorNode;var y=g.anchorOffset,j=g.focusNode;g=g.focusOffset;try{d.nodeType,j.nodeType}catch{d=null;break e}var P=0,T=-1,L=-1,Y=0,de=0,he=a,ce=null;t:for(;;){for(var be;he!==d||y!==0&&he.nodeType!==3||(T=P+y),he!==j||g!==0&&he.nodeType!==3||(L=P+g),he.nodeType===3&&(P+=he.nodeValue.length),(be=he.firstChild)!==null;)ce=he,he=be;for(;;){if(he===a)break t;if(ce===d&&++Y===y&&(T=P),ce===j&&++de===g&&(L=P),(be=he.nextSibling)!==null)break;he=ce,ce=he.parentNode}he=be}d=T===-1||L===-1?null:{start:T,end:L}}else d=null}d=d||{start:0,end:0}}else d=null;for(Gm={focusedElem:a,selectionRange:d},Ou=!1,ke=s;ke!==null;)if(s=ke,a=s.child,(s.subtreeFlags&1028)!==0&&a!==null)a.return=s,ke=a;else for(;ke!==null;){s=ke;try{var Se=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(Se!==null){var Ne=Se.memoizedProps,jt=Se.memoizedState,H=s.stateNode,F=H.getSnapshotBeforeUpdate(s.elementType===s.type?Ne:mn(s.type,Ne),jt);H.__reactInternalSnapshotBeforeUpdate=F}break;case 3:var q=s.stateNode.containerInfo;q.nodeType===1?q.textContent="":q.nodeType===9&&q.documentElement&&q.removeChild(q.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(ge){vt(s,s.return,ge)}if(a=s.sibling,a!==null){a.return=s.return,ke=a;break}ke=s.return}return Se=U1,U1=!1,Se}function ql(a,s,d){var g=s.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var y=g=g.next;do{if((y.tag&a)===a){var j=y.destroy;y.destroy=void 0,j!==void 0&&Ip(s,d,j)}y=y.next}while(y!==g)}}function dd(a,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var d=s=s.next;do{if((d.tag&a)===a){var g=d.create;d.destroy=g()}d=d.next}while(d!==s)}}function Tp(a){var s=a.ref;if(s!==null){var d=a.stateNode;switch(a.tag){case 5:a=d;break;default:a=d}typeof s=="function"?s(a):s.current=a}}function W1(a){var s=a.alternate;s!==null&&(a.alternate=null,W1(s)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(s=a.stateNode,s!==null&&(delete s[On],delete s[Rl],delete s[Ym],delete s[G_],delete s[V_])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function H1(a){return a.tag===5||a.tag===3||a.tag===4}function K1(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||H1(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Dp(a,s,d){var g=a.tag;if(g===5||g===6)a=a.stateNode,s?d.nodeType===8?d.parentNode.insertBefore(a,s):d.insertBefore(a,s):(d.nodeType===8?(s=d.parentNode,s.insertBefore(a,d)):(s=d,s.appendChild(a)),d=d._reactRootContainer,d!=null||s.onclick!==null||(s.onclick=Uu));else if(g!==4&&(a=a.child,a!==null))for(Dp(a,s,d),a=a.sibling;a!==null;)Dp(a,s,d),a=a.sibling}function Lp(a,s,d){var g=a.tag;if(g===5||g===6)a=a.stateNode,s?d.insertBefore(a,s):d.appendChild(a);else if(g!==4&&(a=a.child,a!==null))for(Lp(a,s,d),a=a.sibling;a!==null;)Lp(a,s,d),a=a.sibling}var Kt=null,pn=!1;function Vi(a,s,d){for(d=d.child;d!==null;)G1(a,s,d),d=d.sibling}function G1(a,s,d){if(Pn&&typeof Pn.onCommitFiberUnmount=="function")try{Pn.onCommitFiberUnmount(Su,d)}catch{}switch(d.tag){case 5:ar||es(d,s);case 6:var g=Kt,y=pn;Kt=null,Vi(a,s,d),Kt=g,pn=y,Kt!==null&&(pn?(a=Kt,d=d.stateNode,a.nodeType===8?a.parentNode.removeChild(d):a.removeChild(d)):Kt.removeChild(d.stateNode));break;case 18:Kt!==null&&(pn?(a=Kt,d=d.stateNode,a.nodeType===8?Qm(a.parentNode,d):a.nodeType===1&&Qm(a,d),El(a)):Qm(Kt,d.stateNode));break;case 4:g=Kt,y=pn,Kt=d.stateNode.containerInfo,pn=!0,Vi(a,s,d),Kt=g,pn=y;break;case 0:case 11:case 14:case 15:if(!ar&&(g=d.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){y=g=g.next;do{var j=y,P=j.destroy;j=j.tag,P!==void 0&&((j&2)!==0||(j&4)!==0)&&Ip(d,s,P),y=y.next}while(y!==g)}Vi(a,s,d);break;case 1:if(!ar&&(es(d,s),g=d.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=d.memoizedProps,g.state=d.memoizedState,g.componentWillUnmount()}catch(T){vt(d,s,T)}Vi(a,s,d);break;case 21:Vi(a,s,d);break;case 22:d.mode&1?(ar=(g=ar)||d.memoizedState!==null,Vi(a,s,d),ar=g):Vi(a,s,d);break;default:Vi(a,s,d)}}function V1(a){var s=a.updateQueue;if(s!==null){a.updateQueue=null;var d=a.stateNode;d===null&&(d=a.stateNode=new c4),s.forEach(function(g){var y=y4.bind(null,a,g);d.has(g)||(d.add(g),g.then(y,y))})}}function gn(a,s){var d=s.deletions;if(d!==null)for(var g=0;gy&&(y=P),g&=~j}if(g=y,g=kt()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*f4(g/1960))-g,10a?16:a,Qi===null)var g=!1;else{if(a=Qi,Qi=null,gd=0,(Ve&6)!==0)throw Error(r(331));var y=Ve;for(Ve|=4,ke=a.current;ke!==null;){var j=ke,P=j.child;if((ke.flags&16)!==0){var T=j.deletions;if(T!==null){for(var L=0;Lkt()-zp?$a(a,0):$p|=d),Sr(a,s)}function ow(a,s){s===0&&((a.mode&1)===0?s=1:(s=Eu,Eu<<=1,(Eu&130023424)===0&&(Eu=4194304)));var d=hr();a=ni(a,s),a!==null&&(wl(a,s,d),Sr(a,d))}function x4(a){var s=a.memoizedState,d=0;s!==null&&(d=s.retryLane),ow(a,d)}function y4(a,s){var d=0;switch(a.tag){case 13:var g=a.stateNode,y=a.memoizedState;y!==null&&(d=y.retryLane);break;case 19:g=a.stateNode;break;default:throw Error(r(314))}g!==null&&g.delete(s),ow(a,d)}var sw;sw=function(a,s,d){if(a!==null)if(a.memoizedProps!==s.pendingProps||br.current)kr=!0;else{if((a.lanes&d)===0&&(s.flags&128)===0)return kr=!1,o4(a,s,d);kr=(a.flags&131072)!==0}else kr=!1,ut&&(s.flags&1048576)!==0&&Fb(s,qu,s.index);switch(s.lanes=0,s.tag){case 2:var g=s.type;cd(a,s),a=s.pendingProps;var y=Ko(s,rr.current);Zo(s,d),y=gp(null,s,g,a,y,d);var j=vp();return s.flags|=1,typeof y=="object"&&y!==null&&typeof y.render=="function"&&y.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,wr(g)?(j=!0,Ku(s)):j=!1,s.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,cp(s),y.updater=sd,s.stateNode=y,y._reactInternals=s,jp(s,g,a,d),s=Ap(null,s,g,!0,j,d)):(s.tag=0,ut&&j&&Jm(s),fr(null,s,y,d),s=s.child),s;case 16:g=s.elementType;e:{switch(cd(a,s),a=s.pendingProps,y=g._init,g=y(g._payload),s.type=g,y=s.tag=w4(g),a=mn(g,a),y){case 0:s=Ep(null,s,g,a,d);break e;case 1:s=I1(null,s,g,a,d);break e;case 11:s=C1(null,s,g,a,d);break e;case 14:s=P1(null,s,g,mn(g.type,a),d);break e}throw Error(r(306,g,""))}return s;case 0:return g=s.type,y=s.pendingProps,y=s.elementType===g?y:mn(g,y),Ep(a,s,g,y,d);case 1:return g=s.type,y=s.pendingProps,y=s.elementType===g?y:mn(g,y),I1(a,s,g,y,d);case 3:e:{if(T1(s),a===null)throw Error(r(387));g=s.pendingProps,j=s.memoizedState,y=j.element,Qb(a,s),ed(s,g,null,d);var P=s.memoizedState;if(g=P.element,j.isDehydrated)if(j={element:g,isDehydrated:!1,cache:P.cache,pendingSuspenseBoundaries:P.pendingSuspenseBoundaries,transitions:P.transitions},s.updateQueue.baseState=j,s.memoizedState=j,s.flags&256){y=Jo(Error(r(423)),s),s=D1(a,s,g,d,y);break e}else if(g!==y){y=Jo(Error(r(424)),s),s=D1(a,s,g,d,y);break e}else for(Ir=Bi(s.stateNode.containerInfo.firstChild),Mr=s,ut=!0,hn=null,d=Vb(s,null,g,d),s.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(qo(),g===y){s=ai(a,s,d);break e}fr(a,s,g,d)}s=s.child}return s;case 5:return Xb(s),a===null&&rp(s),g=s.type,y=s.pendingProps,j=a!==null?a.memoizedProps:null,P=y.children,Vm(g,y)?P=null:j!==null&&Vm(g,j)&&(s.flags|=32),M1(a,s),fr(a,s,P,d),s.child;case 6:return a===null&&rp(s),null;case 13:return L1(a,s,d);case 4:return up(s,s.stateNode.containerInfo),g=s.pendingProps,a===null?s.child=Qo(s,null,g,d):fr(a,s,g,d),s.child;case 11:return g=s.type,y=s.pendingProps,y=s.elementType===g?y:mn(g,y),C1(a,s,g,y,d);case 7:return fr(a,s,s.pendingProps,d),s.child;case 8:return fr(a,s,s.pendingProps.children,d),s.child;case 12:return fr(a,s,s.pendingProps.children,d),s.child;case 10:e:{if(g=s.type._context,y=s.pendingProps,j=s.memoizedProps,P=y.value,rt(Zu,g._currentValue),g._currentValue=P,j!==null)if(fn(j.value,P)){if(j.children===y.children&&!br.current){s=ai(a,s,d);break e}}else for(j=s.child,j!==null&&(j.return=s);j!==null;){var T=j.dependencies;if(T!==null){P=j.child;for(var L=T.firstContext;L!==null;){if(L.context===g){if(j.tag===1){L=ii(-1,d&-d),L.tag=2;var Y=j.updateQueue;if(Y!==null){Y=Y.shared;var de=Y.pending;de===null?L.next=L:(L.next=de.next,de.next=L),Y.pending=L}}j.lanes|=d,L=j.alternate,L!==null&&(L.lanes|=d),sp(j.return,d,s),T.lanes|=d;break}L=L.next}}else if(j.tag===10)P=j.type===s.type?null:j.child;else if(j.tag===18){if(P=j.return,P===null)throw Error(r(341));P.lanes|=d,T=P.alternate,T!==null&&(T.lanes|=d),sp(P,d,s),P=j.sibling}else P=j.child;if(P!==null)P.return=j;else for(P=j;P!==null;){if(P===s){P=null;break}if(j=P.sibling,j!==null){j.return=P.return,P=j;break}P=P.return}j=P}fr(a,s,y.children,d),s=s.child}return s;case 9:return y=s.type,g=s.pendingProps.children,Zo(s,d),y=Gr(y),g=g(y),s.flags|=1,fr(a,s,g,d),s.child;case 14:return g=s.type,y=mn(g,s.pendingProps),y=mn(g.type,y),P1(a,s,g,y,d);case 15:return O1(a,s,s.type,s.pendingProps,d);case 17:return g=s.type,y=s.pendingProps,y=s.elementType===g?y:mn(g,y),cd(a,s),s.tag=1,wr(g)?(a=!0,Ku(s)):a=!1,Zo(s,d),w1(s,g,y),jp(s,g,y,d),Ap(null,s,g,!0,a,d);case 19:return $1(a,s,d);case 22:return _1(a,s,d)}throw Error(r(156,s.tag))};function lw(a,s){return By(a,s)}function b4(a,s,d,g){this.tag=a,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qr(a,s,d,g){return new b4(a,s,d,g)}function Vp(a){return a=a.prototype,!(!a||!a.isReactComponent)}function w4(a){if(typeof a=="function")return Vp(a)?1:0;if(a!=null){if(a=a.$$typeof,a===W)return 11;if(a===pe)return 14}return 2}function Xi(a,s){var d=a.alternate;return d===null?(d=Qr(a.tag,s,a.key,a.mode),d.elementType=a.elementType,d.type=a.type,d.stateNode=a.stateNode,d.alternate=a,a.alternate=d):(d.pendingProps=s,d.type=a.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=a.flags&14680064,d.childLanes=a.childLanes,d.lanes=a.lanes,d.child=a.child,d.memoizedProps=a.memoizedProps,d.memoizedState=a.memoizedState,d.updateQueue=a.updateQueue,s=a.dependencies,d.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},d.sibling=a.sibling,d.index=a.index,d.ref=a.ref,d}function bd(a,s,d,g,y,j){var P=2;if(g=a,typeof a=="function")Vp(a)&&(P=1);else if(typeof a=="string")P=5;else e:switch(a){case D:return Fa(d.children,y,j,s);case B:P=8,y|=8;break;case z:return a=Qr(12,d,s,y|2),a.elementType=z,a.lanes=j,a;case ve:return a=Qr(13,d,s,y),a.elementType=ve,a.lanes=j,a;case ue:return a=Qr(19,d,s,y),a.elementType=ue,a.lanes=j,a;case le:return wd(d,y,j,s);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case $:P=10;break e;case K:P=9;break e;case W:P=11;break e;case pe:P=14;break e;case oe:P=16,g=null;break e}throw Error(r(130,a==null?a:typeof a,""))}return s=Qr(P,d,s,y),s.elementType=a,s.type=g,s.lanes=j,s}function Fa(a,s,d,g){return a=Qr(7,a,g,s),a.lanes=d,a}function wd(a,s,d,g){return a=Qr(22,a,g,s),a.elementType=le,a.lanes=d,a.stateNode={isHidden:!1},a}function qp(a,s,d){return a=Qr(6,a,null,s),a.lanes=d,a}function Qp(a,s,d){return s=Qr(4,a.children!==null?a.children:[],a.key,s),s.lanes=d,s.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},s}function k4(a,s,d,g,y){this.tag=s,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=km(0),this.expirationTimes=km(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=km(0),this.identifierPrefix=g,this.onRecoverableError=y,this.mutableSourceEagerHydrationData=null}function Yp(a,s,d,g,y,j,P,T,L){return a=new k4(a,s,d,T,L),s===1?(s=1,j===!0&&(s|=8)):s=0,j=Qr(3,null,null,s),a.current=j,j.stateNode=a,j.memoizedState={element:g,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},cp(j),a}function j4(a,s,d){var g=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ng.exports=R4(),ng.exports}var jw;function $4(){if(jw)return Pd;jw=1;var e=$N();return Pd.createRoot=e.createRoot,Pd.hydrateRoot=e.hydrateRoot,Pd}var z4=$4();const F4=Ax(z4);var eu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},io,la,Es,CN,B4=(CN=class extends eu{constructor(){super();De(this,io);De(this,la);De(this,Es);we(this,Es,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){R(this,la)||this.setEventListener(R(this,Es))}onUnsubscribe(){var t;this.hasListeners()||((t=R(this,la))==null||t.call(this),we(this,la,void 0))}setEventListener(t){var r;we(this,Es,t),(r=R(this,la))==null||r.call(this),we(this,la,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){R(this,io)!==t&&(we(this,io,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof R(this,io)=="boolean"?R(this,io):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},io=new WeakMap,la=new WeakMap,Es=new WeakMap,CN),Px=new B4,U4={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ca,Ex,PN,W4=(PN=class{constructor(){De(this,ca,U4);De(this,Ex,!1)}setTimeoutProvider(e){we(this,ca,e)}setTimeout(e,t){return R(this,ca).setTimeout(e,t)}clearTimeout(e){R(this,ca).clearTimeout(e)}setInterval(e,t){return R(this,ca).setInterval(e,t)}clearInterval(e){R(this,ca).clearInterval(e)}},ca=new WeakMap,Ex=new WeakMap,PN),Za=new W4;function H4(e){setTimeout(e,0)}var K4=typeof window>"u"||"Deno"in globalThis;function Ar(){}function G4(e,t){return typeof e=="function"?e(t):e}function ev(e){return typeof e=="number"&&e>=0&&e!==1/0}function zN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function va(e,t){return typeof e=="function"?e(t):e}function Rr(e,t){return typeof e=="function"?e(t):e}function Sw(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:o,queryKey:c,stale:u}=e;if(c){if(n){if(t.queryHash!==Ox(c,t.options))return!1}else if(!Nc(t.queryKey,c))return!1}if(r!=="all"){const f=t.isActive();if(r==="active"&&!f||r==="inactive"&&f)return!1}return!(typeof u=="boolean"&&t.isStale()!==u||i&&i!==t.state.fetchStatus||o&&!o(t))}function Nw(e,t){const{exact:r,status:n,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(Sc(t.options.mutationKey)!==Sc(o))return!1}else if(!Nc(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function Ox(e,t){return((t==null?void 0:t.queryKeyHashFn)||Sc)(e)}function Sc(e){return JSON.stringify(e,(t,r)=>rv(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Nc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Nc(e[r],t[r])):!1}var V4=Object.prototype.hasOwnProperty;function FN(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=Ew(e)&&Ew(t);if(!n&&!(rv(e)&&rv(t)))return t;const o=(n?e:Object.keys(e)).length,c=n?t:Object.keys(t),u=c.length,f=n?new Array(u):{};let h=0;for(let m=0;m{Za.setTimeout(t,e)})}function nv(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?FN(e,t):t}function Q4(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Y4(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var _x=Symbol();function BN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===_x?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function UN(e,t){return typeof e=="function"?e(...t):!!e}function Z4(e,t,r){let n=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),n||(n=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),e}var Ec=(()=>{let e=()=>K4;return{isServer(){return e()},setIsServer(t){e=t}}})();function iv(){let e,t;const r=new Promise((i,o)=>{e=i,t=o});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},r.reject=i=>{n({status:"rejected",reason:i}),t(i)},r}var X4=H4;function J4(){let e=[],t=0,r=u=>{u()},n=u=>{u()},i=X4;const o=u=>{t?e.push(u):i(()=>{r(u)})},c=()=>{const u=e;e=[],u.length&&i(()=>{n(()=>{u.forEach(f=>{r(f)})})})};return{batch:u=>{let f;t++;try{f=u()}finally{t--,t||c()}return f},batchCalls:u=>(...f)=>{o(()=>{u(...f)})},schedule:o,setNotifyFunction:u=>{r=u},setBatchNotifyFunction:u=>{n=u},setScheduler:u=>{i=u}}}var Yt=J4(),As,ua,Cs,ON,eM=(ON=class extends eu{constructor(){super();De(this,As,!0);De(this,ua);De(this,Cs);we(this,Cs,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){R(this,ua)||this.setEventListener(R(this,Cs))}onUnsubscribe(){var t;this.hasListeners()||((t=R(this,ua))==null||t.call(this),we(this,ua,void 0))}setEventListener(t){var r;we(this,Cs,t),(r=R(this,ua))==null||r.call(this),we(this,ua,t(this.setOnline.bind(this)))}setOnline(t){R(this,As)!==t&&(we(this,As,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return R(this,As)}},As=new WeakMap,ua=new WeakMap,Cs=new WeakMap,ON),hf=new eM;function tM(e){return Math.min(1e3*2**e,3e4)}function WN(e){return(e??"online")==="online"?hf.isOnline():!0}var av=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function HN(e){let t=!1,r=0,n;const i=iv(),o=()=>i.status!=="pending",c=w=>{var k;if(!o()){const N=new av(w);v(N),(k=e.onCancel)==null||k.call(e,N)}},u=()=>{t=!0},f=()=>{t=!1},h=()=>Px.isFocused()&&(e.networkMode==="always"||hf.isOnline())&&e.canRun(),m=()=>WN(e.networkMode)&&e.canRun(),p=w=>{o()||(n==null||n(),i.resolve(w))},v=w=>{o()||(n==null||n(),i.reject(w))},b=()=>new Promise(w=>{var k;n=N=>{(o()||h())&&w(N)},(k=e.onPause)==null||k.call(e)}).then(()=>{var w;n=void 0,o()||(w=e.onContinue)==null||w.call(e)}),S=()=>{if(o())return;let w;const k=r===0?e.initialPromise:void 0;try{w=k??e.fn()}catch(N){w=Promise.reject(N)}Promise.resolve(w).then(p).catch(N=>{var O;if(o())return;const E=e.retry??(Ec.isServer()?0:3),A=e.retryDelay??tM,C=typeof A=="function"?A(r,N):A,_=E===!0||typeof E=="number"&&rh()?void 0:b()).then(()=>{t?v(N):S()})})};return{promise:i,status:()=>i.status,cancel:c,continue:()=>(n==null||n(),i),cancelRetry:u,continueRetry:f,canStart:m,start:()=>(m()?S():b().then(S),i)}}var ao,_N,KN=(_N=class{constructor(){De(this,ao)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ev(this.gcTime)&&we(this,ao,Za.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ec.isServer()?1/0:300*1e3))}clearGcTimeout(){R(this,ao)!==void 0&&(Za.clearTimeout(R(this,ao)),we(this,ao,void 0))}},ao=new WeakMap,_N);function rM(e){return{onFetch:(t,r)=>{var m,p,v,b,S;const n=t.options,i=(v=(p=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:p.fetchMore)==null?void 0:v.direction,o=((b=t.state.data)==null?void 0:b.pages)||[],c=((S=t.state.data)==null?void 0:S.pageParams)||[];let u={pages:[],pageParams:[]},f=0;const h=async()=>{let w=!1;const k=A=>{Z4(A,()=>t.signal,()=>w=!0)},N=BN(t.options,t.fetchOptions),E=async(A,C,_)=>{if(w)return Promise.reject(t.signal.reason);if(C==null&&A.pages.length)return Promise.resolve(A);const D=(()=>{const K={client:t.client,queryKey:t.queryKey,pageParam:C,direction:_?"backward":"forward",meta:t.options.meta};return k(K),K})(),B=await N(D),{maxPages:z}=t.options,$=_?Y4:Q4;return{pages:$(A.pages,B,z),pageParams:$(A.pageParams,C,z)}};if(i&&o.length){const A=i==="backward",C=A?nM:Cw,_={pages:o,pageParams:c},O=C(n,_);u=await E(_,O,A)}else{const A=e??o.length;do{const C=f===0?c[0]??n.initialPageParam:Cw(n,u);if(f>0&&C==null)break;u=await E(u,C),f++}while(f{var w,k;return(k=(w=t.options).persister)==null?void 0:k.call(w,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=h}}}function Cw(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function nM(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Ps,oo,Os,Xr,so,$t,Qc,lo,Lr,GN,li,MN,iM=(MN=class extends KN{constructor(t){super();De(this,Lr);De(this,Ps);De(this,oo);De(this,Os);De(this,Xr);De(this,so);De(this,$t);De(this,Qc);De(this,lo);we(this,lo,!1),we(this,Qc,t.defaultOptions),this.setOptions(t.options),this.observers=[],we(this,so,t.client),we(this,Xr,R(this,so).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,we(this,oo,Ow(this.options)),this.state=t.state??R(this,oo),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return R(this,Ps)}get promise(){var t;return(t=R(this,$t))==null?void 0:t.promise}setOptions(t){if(this.options={...R(this,Qc),...t},t!=null&&t._type&&we(this,Ps,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Ow(this.options);r.data!==void 0&&(this.setState(Pw(r.data,r.dataUpdatedAt)),we(this,oo,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&R(this,Xr).remove(this)}setData(t,r){const n=nv(this.state.data,t,this.options);return We(this,Lr,li).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){We(this,Lr,li).call(this,{type:"setState",state:t})}cancel(t){var n,i;const r=(n=R(this,$t))==null?void 0:n.promise;return(i=R(this,$t))==null||i.cancel(t),r?r.then(Ar).catch(Ar):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return R(this,oo)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Rr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_x||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>va(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!zN(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=R(this,$t))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=R(this,$t))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),R(this,Xr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(R(this,$t)&&(R(this,lo)||We(this,Lr,GN).call(this)?R(this,$t).cancel({revert:!0}):R(this,$t).cancelRetry()),this.scheduleGc()),R(this,Xr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||We(this,Lr,li).call(this,{type:"invalidate"})}async fetch(t,r){var h,m,p,v,b,S,w,k,N,E,A;if(this.state.fetchStatus!=="idle"&&((h=R(this,$t))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(R(this,$t))return R(this,$t).continueRetry(),R(this,$t).promise}if(t&&this.setOptions(t),!this.options.queryFn){const C=this.observers.find(_=>_.options.queryFn);C&&this.setOptions(C.options)}const n=new AbortController,i=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(we(this,lo,!0),n.signal)})},o=()=>{const C=BN(this.options,r),O=(()=>{const D={client:R(this,so),queryKey:this.queryKey,meta:this.meta};return i(D),D})();return we(this,lo,!1),this.options.persister?this.options.persister(C,O,this):C(O)},u=(()=>{const C={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:R(this,so),state:this.state,fetchFn:o};return i(C),C})(),f=R(this,Ps)==="infinite"?rM(this.options.pages):this.options.behavior;f==null||f.onFetch(u,this),we(this,Os,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=u.fetchOptions)==null?void 0:m.meta))&&We(this,Lr,li).call(this,{type:"fetch",meta:(p=u.fetchOptions)==null?void 0:p.meta}),we(this,$t,HN({initialPromise:r==null?void 0:r.initialPromise,fn:u.fetchFn,onCancel:C=>{C instanceof av&&C.revert&&this.setState({...R(this,Os),fetchStatus:"idle"}),n.abort()},onFail:(C,_)=>{We(this,Lr,li).call(this,{type:"failed",failureCount:C,error:_})},onPause:()=>{We(this,Lr,li).call(this,{type:"pause"})},onContinue:()=>{We(this,Lr,li).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const C=await R(this,$t).start();if(C===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(C),(b=(v=R(this,Xr).config).onSuccess)==null||b.call(v,C,this),(w=(S=R(this,Xr).config).onSettled)==null||w.call(S,C,this.state.error,this),C}catch(C){if(C instanceof av){if(C.silent)return R(this,$t).promise;if(C.revert){if(this.state.data===void 0)throw C;return this.state.data}}throw We(this,Lr,li).call(this,{type:"error",error:C}),(N=(k=R(this,Xr).config).onError)==null||N.call(k,C,this),(A=(E=R(this,Xr).config).onSettled)==null||A.call(E,this.state.data,C,this),C}finally{this.scheduleGc()}}},Ps=new WeakMap,oo=new WeakMap,Os=new WeakMap,Xr=new WeakMap,so=new WeakMap,$t=new WeakMap,Qc=new WeakMap,lo=new WeakMap,Lr=new WeakSet,GN=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},li=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...VN(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...Pw(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return we(this,Os,t.manual?i:void 0),i;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Yt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),R(this,Xr).notify({query:this,type:"updated",action:t})})},MN);function VN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:WN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Pw(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ow(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Er,Ke,Yc,mr,co,_s,ui,da,Zc,Ms,Is,uo,fo,fa,Ts,Ze,mc,ov,sv,lv,cv,uv,dv,fv,qN,IN,aM=(IN=class extends eu{constructor(t,r){super();De(this,Ze);De(this,Er);De(this,Ke);De(this,Yc);De(this,mr);De(this,co);De(this,_s);De(this,ui);De(this,da);De(this,Zc);De(this,Ms);De(this,Is);De(this,uo);De(this,fo);De(this,fa);De(this,Ts,new Set);this.options=r,we(this,Er,t),we(this,da,null),we(this,ui,iv()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(R(this,Ke).addObserver(this),_w(R(this,Ke),this.options)?We(this,Ze,mc).call(this):this.updateResult(),We(this,Ze,cv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return hv(R(this,Ke),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return hv(R(this,Ke),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,We(this,Ze,uv).call(this),We(this,Ze,dv).call(this),R(this,Ke).removeObserver(this)}setOptions(t){const r=this.options,n=R(this,Ke);if(this.options=R(this,Er).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Rr(this.options.enabled,R(this,Ke))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");We(this,Ze,fv).call(this),R(this,Ke).setOptions(this.options),r._defaulted&&!tv(this.options,r)&&R(this,Er).getQueryCache().notify({type:"observerOptionsUpdated",query:R(this,Ke),observer:this});const i=this.hasListeners();i&&Mw(R(this,Ke),n,this.options,r)&&We(this,Ze,mc).call(this),this.updateResult(),i&&(R(this,Ke)!==n||Rr(this.options.enabled,R(this,Ke))!==Rr(r.enabled,R(this,Ke))||va(this.options.staleTime,R(this,Ke))!==va(r.staleTime,R(this,Ke)))&&We(this,Ze,ov).call(this);const o=We(this,Ze,sv).call(this);i&&(R(this,Ke)!==n||Rr(this.options.enabled,R(this,Ke))!==Rr(r.enabled,R(this,Ke))||o!==R(this,fa))&&We(this,Ze,lv).call(this,o)}getOptimisticResult(t){const r=R(this,Er).getQueryCache().build(R(this,Er),t),n=this.createResult(r,t);return sM(this,n)&&(we(this,mr,n),we(this,_s,this.options),we(this,co,R(this,Ke).state)),n}getCurrentResult(){return R(this,mr)}trackResult(t,r){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),r==null||r(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&R(this,ui).status==="pending"&&R(this,ui).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(t){R(this,Ts).add(t)}getCurrentQuery(){return R(this,Ke)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=R(this,Er).defaultQueryOptions(t),n=R(this,Er).getQueryCache().build(R(this,Er),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return We(this,Ze,mc).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),R(this,mr)))}createResult(t,r){var z;const n=R(this,Ke),i=this.options,o=R(this,mr),c=R(this,co),u=R(this,_s),h=t!==n?t.state:R(this,Yc),{state:m}=t;let p={...m},v=!1,b;if(r._optimisticResults){const $=this.hasListeners(),K=!$&&_w(t,r),W=$&&Mw(t,n,r,i);(K||W)&&(p={...p,...VN(m.data,t.options)}),r._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:S,errorUpdatedAt:w,status:k}=p;b=p.data;let N=!1;if(r.placeholderData!==void 0&&b===void 0&&k==="pending"){let $;o!=null&&o.isPlaceholderData&&r.placeholderData===(u==null?void 0:u.placeholderData)?($=o.data,N=!0):$=typeof r.placeholderData=="function"?r.placeholderData((z=R(this,Is))==null?void 0:z.state.data,R(this,Is)):r.placeholderData,$!==void 0&&(k="success",b=nv(o==null?void 0:o.data,$,r),v=!0)}if(r.select&&b!==void 0&&!N)if(o&&b===(c==null?void 0:c.data)&&r.select===R(this,Zc))b=R(this,Ms);else try{we(this,Zc,r.select),b=r.select(b),b=nv(o==null?void 0:o.data,b,r),we(this,Ms,b),we(this,da,null)}catch($){we(this,da,$)}R(this,da)&&(S=R(this,da),b=R(this,Ms),w=Date.now(),k="error");const E=p.fetchStatus==="fetching",A=k==="pending",C=k==="error",_=A&&E,O=b!==void 0,B={status:k,fetchStatus:p.fetchStatus,isPending:A,isSuccess:k==="success",isError:C,isInitialLoading:_,isLoading:_,data:b,dataUpdatedAt:p.dataUpdatedAt,error:S,errorUpdatedAt:w,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:p.dataUpdateCount>h.dataUpdateCount||p.errorUpdateCount>h.errorUpdateCount,isFetching:E,isRefetching:E&&!A,isLoadingError:C&&!O,isPaused:p.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:C&&O,isStale:Mx(t,r),refetch:this.refetch,promise:R(this,ui),isEnabled:Rr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const $=B.data!==void 0,K=B.status==="error"&&!$,W=pe=>{K?pe.reject(B.error):$&&pe.resolve(B.data)},ve=()=>{const pe=we(this,ui,B.promise=iv());W(pe)},ue=R(this,ui);switch(ue.status){case"pending":t.queryHash===n.queryHash&&W(ue);break;case"fulfilled":(K||B.data!==ue.value)&&ve();break;case"rejected":(!K||B.error!==ue.reason)&&ve();break}}return B}updateResult(){const t=R(this,mr),r=this.createResult(R(this,Ke),this.options);if(we(this,co,R(this,Ke).state),we(this,_s,this.options),R(this,co).data!==void 0&&we(this,Is,R(this,Ke)),tv(r,t))return;we(this,mr,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!R(this,Ts).size)return!0;const c=new Set(o??R(this,Ts));return this.options.throwOnError&&c.add("error"),Object.keys(R(this,mr)).some(u=>{const f=u;return R(this,mr)[f]!==t[f]&&c.has(f)})};We(this,Ze,qN).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&We(this,Ze,cv).call(this)}},Er=new WeakMap,Ke=new WeakMap,Yc=new WeakMap,mr=new WeakMap,co=new WeakMap,_s=new WeakMap,ui=new WeakMap,da=new WeakMap,Zc=new WeakMap,Ms=new WeakMap,Is=new WeakMap,uo=new WeakMap,fo=new WeakMap,fa=new WeakMap,Ts=new WeakMap,Ze=new WeakSet,mc=function(t){We(this,Ze,fv).call(this);let r=R(this,Ke).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Ar)),r},ov=function(){We(this,Ze,uv).call(this);const t=va(this.options.staleTime,R(this,Ke));if(Ec.isServer()||R(this,mr).isStale||!ev(t))return;const n=zN(R(this,mr).dataUpdatedAt,t)+1;we(this,uo,Za.setTimeout(()=>{R(this,mr).isStale||this.updateResult()},n))},sv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(R(this,Ke)):this.options.refetchInterval)??!1},lv=function(t){We(this,Ze,dv).call(this),we(this,fa,t),!(Ec.isServer()||Rr(this.options.enabled,R(this,Ke))===!1||!ev(R(this,fa))||R(this,fa)===0)&&we(this,fo,Za.setInterval(()=>{(this.options.refetchIntervalInBackground||Px.isFocused())&&We(this,Ze,mc).call(this)},R(this,fa)))},cv=function(){We(this,Ze,ov).call(this),We(this,Ze,lv).call(this,We(this,Ze,sv).call(this))},uv=function(){R(this,uo)!==void 0&&(Za.clearTimeout(R(this,uo)),we(this,uo,void 0))},dv=function(){R(this,fo)!==void 0&&(Za.clearInterval(R(this,fo)),we(this,fo,void 0))},fv=function(){const t=R(this,Er).getQueryCache().build(R(this,Er),this.options);if(t===R(this,Ke))return;const r=R(this,Ke);we(this,Ke,t),we(this,Yc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},qN=function(t){Yt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(R(this,mr))}),R(this,Er).getQueryCache().notify({query:R(this,Ke),type:"observerResultsUpdated"})})},IN);function oM(e,t){return Rr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Rr(t.retryOnMount,e)===!1)}function _w(e,t){return oM(e,t)||e.state.data!==void 0&&hv(e,t,t.refetchOnMount)}function hv(e,t,r){if(Rr(t.enabled,e)!==!1&&va(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Mx(e,t)}return!1}function Mw(e,t,r,n){return(e!==t||Rr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Mx(e,r)}function Mx(e,t){return Rr(t.enabled,e)!==!1&&e.isStaleByTime(va(t.staleTime,e))}function sM(e,t){return!tv(e.getCurrentResult(),t)}var Xc,$n,or,ho,zn,na,TN,lM=(TN=class extends KN{constructor(t){super();De(this,zn);De(this,Xc);De(this,$n);De(this,or);De(this,ho);we(this,Xc,t.client),this.mutationId=t.mutationId,we(this,or,t.mutationCache),we(this,$n,[]),this.state=t.state||cM(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){R(this,$n).includes(t)||(R(this,$n).push(t),this.clearGcTimeout(),R(this,or).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){we(this,$n,R(this,$n).filter(r=>r!==t)),this.scheduleGc(),R(this,or).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){R(this,$n).length||(this.state.status==="pending"?this.scheduleGc():R(this,or).remove(this))}continue(){var t;return((t=R(this,ho))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,u,f,h,m,p,v,b,S,w,k,N,E,A,C,_,O,D;const r=()=>{We(this,zn,na).call(this,{type:"continue"})},n={client:R(this,Xc),meta:this.options.meta,mutationKey:this.options.mutationKey};we(this,ho,HN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(B,z)=>{We(this,zn,na).call(this,{type:"failed",failureCount:B,error:z})},onPause:()=>{We(this,zn,na).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>R(this,or).canRun(this)}));const i=this.state.status==="pending",o=!R(this,ho).canStart();try{if(i)r();else{We(this,zn,na).call(this,{type:"pending",variables:t,isPaused:o}),R(this,or).config.onMutate&&await R(this,or).config.onMutate(t,this,n);const z=await((u=(c=this.options).onMutate)==null?void 0:u.call(c,t,n));z!==this.state.context&&We(this,zn,na).call(this,{type:"pending",context:z,variables:t,isPaused:o})}const B=await R(this,ho).start();return await((h=(f=R(this,or).config).onSuccess)==null?void 0:h.call(f,B,t,this.state.context,this,n)),await((p=(m=this.options).onSuccess)==null?void 0:p.call(m,B,t,this.state.context,n)),await((b=(v=R(this,or).config).onSettled)==null?void 0:b.call(v,B,null,this.state.variables,this.state.context,this,n)),await((w=(S=this.options).onSettled)==null?void 0:w.call(S,B,null,t,this.state.context,n)),We(this,zn,na).call(this,{type:"success",data:B}),B}catch(B){try{await((N=(k=R(this,or).config).onError)==null?void 0:N.call(k,B,t,this.state.context,this,n))}catch(z){Promise.reject(z)}try{await((A=(E=this.options).onError)==null?void 0:A.call(E,B,t,this.state.context,n))}catch(z){Promise.reject(z)}try{await((_=(C=R(this,or).config).onSettled)==null?void 0:_.call(C,void 0,B,this.state.variables,this.state.context,this,n))}catch(z){Promise.reject(z)}try{await((D=(O=this.options).onSettled)==null?void 0:D.call(O,void 0,B,t,this.state.context,n))}catch(z){Promise.reject(z)}throw We(this,zn,na).call(this,{type:"error",error:B}),B}finally{R(this,or).runNext(this)}}},Xc=new WeakMap,$n=new WeakMap,or=new WeakMap,ho=new WeakMap,zn=new WeakSet,na=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Yt.batch(()=>{R(this,$n).forEach(n=>{n.onMutationUpdate(t)}),R(this,or).notify({mutation:this,type:"updated",action:t})})},TN);function cM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var di,yn,Jc,DN,uM=(DN=class extends eu{constructor(t={}){super();De(this,di);De(this,yn);De(this,Jc);this.config=t,we(this,di,new Set),we(this,yn,new Map),we(this,Jc,0)}build(t,r,n){const i=new lM({client:t,mutationCache:this,mutationId:++Cd(this,Jc)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){R(this,di).add(t);const r=Od(t);if(typeof r=="string"){const n=R(this,yn).get(r);n?n.push(t):R(this,yn).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(R(this,di).delete(t)){const r=Od(t);if(typeof r=="string"){const n=R(this,yn).get(r);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&R(this,yn).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Od(t);if(typeof r=="string"){const n=R(this,yn).get(r),i=n==null?void 0:n.find(o=>o.state.status==="pending");return!i||i===t}else return!0}runNext(t){var n;const r=Od(t);if(typeof r=="string"){const i=(n=R(this,yn).get(r))==null?void 0:n.find(o=>o!==t&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Yt.batch(()=>{R(this,di).forEach(t=>{this.notify({type:"removed",mutation:t})}),R(this,di).clear(),R(this,yn).clear()})}getAll(){return Array.from(R(this,di))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Nw(r,n))}findAll(t={}){return this.getAll().filter(r=>Nw(t,r))}notify(t){Yt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Yt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Ar))))}},di=new WeakMap,yn=new WeakMap,Jc=new WeakMap,DN);function Od(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Fn,LN,dM=(LN=class extends eu{constructor(t={}){super();De(this,Fn);this.config=t,we(this,Fn,new Map)}build(t,r,n){const i=r.queryKey,o=r.queryHash??Ox(i,r);let c=this.get(o);return c||(c=new iM({client:t,queryKey:i,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(c)),c}add(t){R(this,Fn).has(t.queryHash)||(R(this,Fn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=R(this,Fn).get(t.queryHash);r&&(t.destroy(),r===t&&R(this,Fn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Yt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return R(this,Fn).get(t)}getAll(){return[...R(this,Fn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>Sw(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>Sw(t,n)):r}notify(t){Yt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Yt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Yt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Fn=new WeakMap,LN),xt,ha,ma,Ds,Ls,pa,Rs,$s,RN,fM=(RN=class{constructor(e={}){De(this,xt);De(this,ha);De(this,ma);De(this,Ds);De(this,Ls);De(this,pa);De(this,Rs);De(this,$s);we(this,xt,e.queryCache||new dM),we(this,ha,e.mutationCache||new uM),we(this,ma,e.defaultOptions||{}),we(this,Ds,new Map),we(this,Ls,new Map),we(this,pa,0)}mount(){Cd(this,pa)._++,R(this,pa)===1&&(we(this,Rs,Px.subscribe(async e=>{e&&(await this.resumePausedMutations(),R(this,xt).onFocus())})),we(this,$s,hf.subscribe(async e=>{e&&(await this.resumePausedMutations(),R(this,xt).onOnline())})))}unmount(){var e,t;Cd(this,pa)._--,R(this,pa)===0&&((e=R(this,Rs))==null||e.call(this),we(this,Rs,void 0),(t=R(this,$s))==null||t.call(this),we(this,$s,void 0))}isFetching(e){return R(this,xt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return R(this,ha).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=R(this,xt).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=R(this,xt).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(va(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return R(this,xt).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=R(this,xt).get(n.queryHash),o=i==null?void 0:i.state.data,c=G4(t,o);if(c!==void 0)return R(this,xt).build(this,n).setData(c,{...r,manual:!0})}setQueriesData(e,t,r){return Yt.batch(()=>R(this,xt).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=R(this,xt).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=R(this,xt);Yt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=R(this,xt);return Yt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Yt.batch(()=>R(this,xt).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(Ar).catch(Ar)}invalidateQueries(e,t={}){return Yt.batch(()=>(R(this,xt).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Yt.batch(()=>R(this,xt).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,r);return r.throwOnError||(o=o.catch(Ar)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(Ar)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=R(this,xt).build(this,t);return r.isStaleByTime(va(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ar).catch(Ar)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ar).catch(Ar)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return hf.isOnline()?R(this,ha).resumePausedMutations():Promise.resolve()}getQueryCache(){return R(this,xt)}getMutationCache(){return R(this,ha)}getDefaultOptions(){return R(this,ma)}setDefaultOptions(e){we(this,ma,e)}setQueryDefaults(e,t){R(this,Ds).set(Sc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...R(this,Ds).values()],r={};return t.forEach(n=>{Nc(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){R(this,Ls).set(Sc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...R(this,Ls).values()],r={};return t.forEach(n=>{Nc(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...R(this,ma).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ox(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===_x&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...R(this,ma).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){R(this,xt).clear(),R(this,ha).clear()}},xt=new WeakMap,ha=new WeakMap,ma=new WeakMap,Ds=new WeakMap,Ls=new WeakMap,pa=new WeakMap,Rs=new WeakMap,$s=new WeakMap,RN),QN=x.createContext(void 0),Wr=e=>{const t=x.useContext(QN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},hM=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),l.jsx(QN.Provider,{value:e,children:t})),YN=x.createContext(!1),mM=()=>x.useContext(YN);YN.Provider;function pM(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var gM=x.createContext(pM()),vM=()=>x.useContext(gM),xM=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?UN(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},yM=e=>{x.useEffect(()=>{e.clearReset()},[e])},bM=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||UN(r,[e.error,n])),wM=e=>{if(e.suspense){const r=i=>i==="static"?i:Math.max(i??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...i)=>r(n(...i)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},kM=(e,t)=>e.isLoading&&e.isFetching&&!t,jM=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Iw=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function SM(e,t,r){var b,S,w,k;const n=mM(),i=vM(),o=Wr(),c=o.defaultQueryOptions(e);(S=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||S.call(b,c);const u=o.getQueryCache().get(c.queryHash),f=e.subscribed!==!1;c._optimisticResults=n?"isRestoring":f?"optimistic":void 0,wM(c),xM(c,i,u),yM(i);const h=!o.getQueryCache().get(c.queryHash),[m]=x.useState(()=>new t(o,c)),p=m.getOptimisticResult(c),v=!n&&f;if(x.useSyncExternalStore(x.useCallback(N=>{const E=v?m.subscribe(Yt.batchCalls(N)):Ar;return m.updateResult(),E},[m,v]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),x.useEffect(()=>{m.setOptions(c)},[c,m]),jM(c,p))throw Iw(c,m,i);if(bM({result:p,errorResetBoundary:i,throwOnError:c.throwOnError,query:u,suspense:c.suspense}))throw p.error;if((k=(w=o.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||k.call(w,c,p),c.experimental_prefetchInRender&&!Ec.isServer()&&kM(p,n)){const N=h?Iw(c,m,i):u==null?void 0:u.promise;N==null||N.catch(Ar).finally(()=>{m.updateResult()})}return c.notifyOnChangeProps?p:m.trackResult(p)}function gt(e,t){return SM(e,aM)}/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const SM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),YN=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** + */const NM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ZN=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var NM={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */var EM={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const EM=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:o,iconNode:c,...u},f)=>x.createElement("svg",{ref:f,...NM,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:YN("lucide",i),...u},[...c.map(([h,m])=>x.createElement(h,m)),...Array.isArray(o)?o:[o]]));/** + */const AM=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:o,iconNode:c,...u},f)=>x.createElement("svg",{ref:f,...EM,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ZN("lucide",i),...u},[...c.map(([h,m])=>x.createElement(h,m)),...Array.isArray(o)?o:[o]]));/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const se=(e,t)=>{const r=x.forwardRef(({className:n,...i},o)=>x.createElement(EM,{ref:o,iconNode:t,className:YN(`lucide-${SM(e)}`,n),...i}));return r.displayName=`${e}`,r};/** + */const se=(e,t)=>{const r=x.forwardRef(({className:n,...i},o)=>x.createElement(AM,{ref:o,iconNode:t,className:ZN(`lucide-${NM(e)}`,n),...i}));return r.displayName=`${e}`,r};/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -67,47 +67,47 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ZN=se("AlarmClock",[["circle",{cx:"12",cy:"13",r:"8",key:"3y4lt7"}],["path",{d:"M12 9v4l2 2",key:"1c63tq"}],["path",{d:"M5 3 2 6",key:"18tl5t"}],["path",{d:"m22 6-3-3",key:"1opdir"}],["path",{d:"M6.38 18.7 4 21",key:"17xu3x"}],["path",{d:"M17.64 18.67 20 21",key:"kv2oe2"}]]);/** + */const XN=se("AlarmClock",[["circle",{cx:"12",cy:"13",r:"8",key:"3y4lt7"}],["path",{d:"M12 9v4l2 2",key:"1c63tq"}],["path",{d:"M5 3 2 6",key:"18tl5t"}],["path",{d:"m22 6-3-3",key:"1opdir"}],["path",{d:"M6.38 18.7 4 21",key:"17xu3x"}],["path",{d:"M17.64 18.67 20 21",key:"kv2oe2"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Iw=se("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/** + */const Tw=se("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const XN=se("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** + */const JN=se("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const hf=se("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + */const bc=se("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const AM=se("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/** + */const CM=se("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const CM=se("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** + */const PM=se("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const JN=se("BookMarked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]);/** + */const e5=se("BookMarked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const hv=se("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** + */const mv=se("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const PM=se("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);/** + */const OM=se("Bookmark",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -117,7 +117,7 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const OM=se("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** + */const _M=se("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -127,12 +127,12 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _M=se("BrainCircuit",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]]);/** + */const MM=se("BrainCircuit",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const MM=se("BrainCog",[["path",{d:"M12 5a3 3 0 1 0-5.997.142 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588 4 4 0 0 0 7.636 2.106 3.2 3.2 0 0 0 .164-.546c.028-.13.306-.13.335 0a3.2 3.2 0 0 0 .163.546 4 4 0 0 0 7.636-2.106 4 4 0 0 0 .556-6.588 4 4 0 0 0-2.526-5.77A3 3 0 1 0 12 5",key:"1kgmhc"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m15.7 10.4-.9.4",key:"ayzo6p"}],["path",{d:"m9.2 13.2-.9.4",key:"1uzb3g"}],["path",{d:"m13.6 15.7-.4-.9",key:"11ifqf"}],["path",{d:"m10.8 9.2-.4-.9",key:"1pmk2v"}],["path",{d:"m15.7 13.5-.9-.4",key:"7ng02m"}],["path",{d:"m9.2 10.9-.9-.4",key:"1x66zd"}],["path",{d:"m10.5 15.7.4-.9",key:"3js94g"}],["path",{d:"m13.1 9.2.4-.9",key:"18n7mc"}]]);/** + */const IM=se("BrainCog",[["path",{d:"M12 5a3 3 0 1 0-5.997.142 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588 4 4 0 0 0 7.636 2.106 3.2 3.2 0 0 0 .164-.546c.028-.13.306-.13.335 0a3.2 3.2 0 0 0 .163.546 4 4 0 0 0 7.636-2.106 4 4 0 0 0 .556-6.588 4 4 0 0 0-2.526-5.77A3 3 0 1 0 12 5",key:"1kgmhc"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"m15.7 10.4-.9.4",key:"ayzo6p"}],["path",{d:"m9.2 13.2-.9.4",key:"1uzb3g"}],["path",{d:"m13.6 15.7-.4-.9",key:"11ifqf"}],["path",{d:"m10.8 9.2-.4-.9",key:"1pmk2v"}],["path",{d:"m15.7 13.5-.9-.4",key:"7ng02m"}],["path",{d:"m9.2 10.9-.9-.4",key:"1x66zd"}],["path",{d:"m10.5 15.7.4-.9",key:"3js94g"}],["path",{d:"m13.1 9.2.4-.9",key:"18n7mc"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -142,7 +142,7 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const IM=se("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** + */const TM=se("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -152,12 +152,12 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const eu=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const tu=se("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const TM=se("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + */const DM=se("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -167,17 +167,17 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const e5=se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + */const t5=se("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const DM=se("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/** + */const LM=se("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const t5=se("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + */const r5=se("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -187,7 +187,7 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const LM=se("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** + */const $M=se("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -197,12 +197,12 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $M=se("CloudDownload",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]);/** + */const zM=se("CloudDownload",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zM=se("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** + */const FM=se("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -212,22 +212,22 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const FM=se("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/** + */const BM=se("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mv=se("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + */const pv=se("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const BM=se("Construction",[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]]);/** + */const UM=se("Construction",[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pv=se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + */const gv=se("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -237,7 +237,7 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const UM=se("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** + */const WM=se("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -247,62 +247,62 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Mx=se("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** + */const Ix=se("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Tw=se("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** + */const Dw=se("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ec=se("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const Ac=se("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const WM=se("FileDiff",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);/** + */const HM=se("FileDiff",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const r5=se("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + */const n5=se("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const HM=se("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/** + */const KM=se("Flame",[["path",{d:"M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z",key:"96xj49"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const n5=se("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** + */const i5=se("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const i5=se("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/** + */const a5=se("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const KM=se("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** + */const GM=se("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const GM=se("GitCommitHorizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);/** + */const VM=se("GitCommitHorizontal",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["line",{x1:"3",x2:"9",y1:"12",y2:"12",key:"1dyftd"}],["line",{x1:"15",x2:"21",y1:"12",y2:"12",key:"oup4p8"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const VM=se("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** + */const qM=se("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qM=se("Hammer",[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]]);/** + */const QM=se("Hammer",[["path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9",key:"eefl8a"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"b7pghm"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -312,42 +312,42 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ix=se("HeartPulse",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]]);/** + */const Tx=se("HeartPulse",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M3.22 12H9.5l.5-1 2 4.5 2-7 1.5 3.5h5.27",key:"1uw2ng"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const QM=se("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** + */const YM=se("Heart",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Tx=se("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** + */const Dx=se("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tu=se("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/** + */const ru=se("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Dw=se("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + */const Lw=se("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const YM=se("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/** + */const ZM=se("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ZM=se("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/** + */const Rw=se("Laptop",[["path",{d:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",key:"tarvll"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const a5=se("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** + */const o5=se("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -357,7 +357,7 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Dx=se("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/** + */const Lx=se("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -387,7 +387,7 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const o5=se("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** + */const s5=se("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -412,12 +412,12 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Rw=se("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** + */const $w=se("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const s5=se("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + */const l5=se("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -427,22 +427,22 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Lw=se("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/** + */const zw=se("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const l5=se("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** + */const c5=se("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ac=se("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/** + */const Cc=se("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cc=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + */const Pc=se("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -452,7 +452,7 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const c5=se("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/** + */const u5=se("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -482,7 +482,7 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const u5=se("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/** + */const d5=se("Scale",[["path",{d:"m16 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"7g6ntu"}],["path",{d:"m2 16 3-8 3 8c-.87.65-1.92 1-3 1s-2.13-.35-3-1Z",key:"ijws7r"}],["path",{d:"M7 21h10",key:"1b0cd5"}],["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 7h2c2 0 5-1 7-2 2 1 5 2 7 2h2",key:"3gwbw2"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -517,12 +517,12 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Lx=se("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/** + */const $x=se("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const d5=se("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** + */const f5=se("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -537,7 +537,7 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const f5=se("Shuffle",[["path",{d:"M2 18h1.4c1.3 0 2.5-.6 3.3-1.7l6.1-8.6c.7-1.1 2-1.7 3.3-1.7H22",key:"1wmou1"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 6h1.9c1.5 0 2.9.9 3.6 2.2",key:"10bdb2"}],["path",{d:"M22 18h-5.9c-1.3 0-2.6-.7-3.3-1.8l-.5-.8",key:"vgxac0"}],["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}]]);/** + */const h5=se("Shuffle",[["path",{d:"M2 18h1.4c1.3 0 2.5-.6 3.3-1.7l6.1-8.6c.7-1.1 2-1.7 3.3-1.7H22",key:"1wmou1"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 6h1.9c1.5 0 2.9.9 3.6 2.2",key:"10bdb2"}],["path",{d:"M22 18h-5.9c-1.3 0-2.6-.7-3.3-1.8l-.5-.8",key:"vgxac0"}],["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -572,12 +572,12 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const h5=se("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** + */const m5=se("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Pc=se("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + */const Oc=se("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -592,7 +592,7 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ru=se("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** + */const nu=se("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. @@ -602,7 +602,7 @@ Error generating stack: `+j.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ka=se("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),pc=[{id:"dashboard",label:"Cockpit",hint:"Deine Box auf einen Blick",icon:XM},{id:"auftraege",label:"Auftragsbuch",hint:"Vorschläge der Box — annehmen oder ablehnen",icon:tu},{id:"models",label:"Modelle",hint:"Speicher, laden & Rollen",icon:mf},{id:"memory",label:"Gedächtnis",hint:"Geteiltes Memory verwalten",icon:Na},{id:"wissen",label:"Wissen",hint:"Lucys Wissens-Vault (Traum-Notizen)",icon:Dx},{id:"chronik",label:"Chronik",hint:"Was die Box von allein getan hat + Zeitmaschine",icon:Tx},{id:"connect",label:"Verbinden",hint:"IDE-/Agent-Configs erzeugen",icon:Ac},{id:"agent",label:"Hermes",hint:"Agent-Status & Verdrahtung",icon:jn},{id:"konsole",label:"Konsole",hint:"Direkte Box-Shell (SSH-artig)",icon:pf},{id:"guide",label:"Anleitung",hint:"Einrichten & Vibe-Coding",icon:RM}];var $w=1,kI=.9,jI=.8,SI=.17,og=.1,sg=.999,NI=.9999,EI=.99,AI=/[\\\/_+.#"@\[\(\{&]/,CI=/[\\\/_+.#"@\[\(\{&]/g,PI=/[\s-]/,m5=/[\s-]/g;function gv(e,t,r,n,i,o,c){if(o===t.length)return i===e.length?$w:EI;var u=`${i},${o}`;if(c[u]!==void 0)return c[u];for(var f=n.charAt(o),h=r.indexOf(f,i),m=0,p,v,b,S;h>=0;)p=gv(e,t,r,n,h+1,o+1,c),p>m&&(h===i?p*=$w:AI.test(e.charAt(h-1))?(p*=jI,b=e.slice(i,h-1).match(CI),b&&i>0&&(p*=Math.pow(sg,b.length))):PI.test(e.charAt(h-1))?(p*=kI,S=e.slice(i,h-1).match(m5),S&&i>0&&(p*=Math.pow(sg,S.length))):(p*=SI,i>0&&(p*=Math.pow(sg,h-i))),e.charAt(h)!==t.charAt(o)&&(p*=NI)),(pp&&(p=v*og)),p>m&&(m=p),h=r.indexOf(f,h+1);return c[u]=m,m}function zw(e){return e.toLowerCase().replace(m5," ")}function OI(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,gv(e,t,zw(e),zw(t),0,0,{})}function ya(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e==null||e(i),r===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Fw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Bs(...e){return t=>{let r=!1;const n=e.map(i=>{const o=Fw(i,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let i=0;i{var N;const{scope:v,children:b,...S}=p,w=((N=v==null?void 0:v[e])==null?void 0:N[f])||u,k=x.useMemo(()=>S,Object.values(S));return l.jsx(w.Provider,{value:k,children:b})};h.displayName=o+"Provider";function m(p,v){var w;const b=((w=v==null?void 0:v[e])==null?void 0:w[f])||u,S=x.useContext(b);if(S)return S;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[h,m]}const i=()=>{const o=r.map(c=>x.createContext(c));return function(u){const f=(u==null?void 0:u[e])||o;return x.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return i.scopeName=e,[n,MI(i,...t)]}function MI(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const c=n.reduce((u,{useScope:f,scopeName:h})=>{const p=f(o)[`__scope${h}`];return{...u,...p}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return r.scopeName=t.scopeName,r}var Oc=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},II=hh[" useId ".trim().toString()]||(()=>{}),TI=0;function vi(e){const[t,r]=x.useState(II());return Oc(()=>{r(n=>n??String(TI++))},[e]),t?`radix-${t}`:""}var DI=hh[" useInsertionEffect ".trim().toString()]||Oc;function RI({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[i,o,c]=LI({defaultProp:t,onChange:r}),u=e!==void 0,f=u?e:i;{const m=x.useRef(e!==void 0);x.useEffect(()=>{const p=m.current;p!==u&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${u?"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.`),m.current=u},[u,n])}const h=x.useCallback(m=>{var p;if(u){const v=$I(m)?m(e):m;v!==e&&((p=c.current)==null||p.call(c,v))}else o(m)},[u,e,o,c]);return[f,h]}function LI({defaultProp:e,onChange:t}){const[r,n]=x.useState(e),i=x.useRef(r),o=x.useRef(t);return DI(()=>{o.current=t},[t]),x.useEffect(()=>{var c;i.current!==r&&((c=o.current)==null||c.call(o,r),i.current=r)},[r,i]),[r,n,o]}function $I(e){return typeof e=="function"}var vh=LN();function p5(e){const t=x.forwardRef((r,n)=>{let{children:i,...o}=r,c=null,u=!1;const f=[];Bw(i)&&typeof Od=="function"&&(i=Od(i._payload)),x.Children.forEach(i,v=>{var b;if(WI(v)){u=!0;const S=v;let w="child"in S.props?S.props.child:S.props.children;Bw(w)&&typeof Od=="function"&&(w=Od(w._payload)),c=FI(S,w),f.push((b=c==null?void 0:c.props)==null?void 0:b.children)}else f.push(v)}),c?c=x.cloneElement(c,void 0,f):!u&&x.Children.count(i)===1&&x.isValidElement(i)&&(c=i);const h=c?UI(c):void 0,m=Co(n,h);if(!c){if(i||i===0)throw new Error(u?VI(e):GI(e));return i}const p=BI(o,c.props??{});return c.type!==x.Fragment&&(p.ref=n?m:h),x.cloneElement(c,p)});return t.displayName=`${e}.Slot`,t}var zI=Symbol.for("radix.slottable"),FI=(e,t)=>{if("child"in e.props){const r=e.props.child;return x.isValidElement(r)?x.cloneElement(r,void 0,e.props.children(r.props.children)):null}return x.isValidElement(t)?t:null};function BI(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function UI(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function WI(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zI}var HI=Symbol.for("react.lazy");function Bw(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===HI&&"_payload"in e&&KI(e._payload)}function KI(e){return typeof e=="object"&&e!==null&&"then"in e}var GI=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,VI=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,Od=hh[" use ".trim().toString()],qI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jt=qI.reduce((e,t)=>{const r=p5(`Primitive.${t}`),n=x.forwardRef((i,o)=>{const{asChild:c,...u}=i,f=c?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(f,{...u,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function QI(e,t){e&&vh.flushSync(()=>e.dispatchEvent(t))}function _c(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>((...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)}),[])}function YI(e,t=globalThis==null?void 0:globalThis.document){const r=_c(e);x.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var ZI="DismissableLayer",vv="dismissableLayer.update",XI="dismissableLayer.pointerDownOutside",JI="dismissableLayer.focusOutside",Uw,$x=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),g5=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:n=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:c,onInteractOutside:u,onDismiss:f,...h}=e,m=x.useContext($x),[p,v]=x.useState(null),b=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=x.useState({}),w=Co(t,z=>v(z)),k=Array.from(m.layers),[N]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),E=k.indexOf(N),A=p?k.indexOf(p):-1,C=m.layersWithOutsidePointerEventsDisabled.size>0,_=A>=E,O=x.useRef(!1),D=nT(z=>{const $=z.target;if(!($ instanceof Node))return;const K=[...m.branches].some(W=>W.contains($));!_||K||(o==null||o(z),u==null||u(z),z.defaultPrevented||f==null||f())},{ownerDocument:b,deferPointerDownOutside:n,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:m.dismissableSurfaces}),B=iT(z=>{if(n&&O.current)return;const $=z.target;[...m.branches].some(W=>W.contains($))||(c==null||c(z),u==null||u(z),z.defaultPrevented||f==null||f())},b);return YI(z=>{A===m.layers.size-1&&(i==null||i(z),!z.defaultPrevented&&f&&(z.preventDefault(),f()))},b),x.useEffect(()=>{if(p)return r&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Uw=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(p)),m.layers.add(p),Ww(),()=>{r&&(m.layersWithOutsidePointerEventsDisabled.delete(p),m.layersWithOutsidePointerEventsDisabled.size===0&&(b.body.style.pointerEvents=Uw))}},[p,b,r,m]),x.useEffect(()=>()=>{p&&(m.layers.delete(p),m.layersWithOutsidePointerEventsDisabled.delete(p),Ww())},[p,m]),x.useEffect(()=>{const z=()=>S({});return document.addEventListener(vv,z),()=>document.removeEventListener(vv,z)},[]),l.jsx(Jt.div,{...h,ref:w,style:{pointerEvents:C?_?"auto":"none":void 0,...e.style},onFocusCapture:ya(e.onFocusCapture,B.onFocusCapture),onBlurCapture:ya(e.onBlurCapture,B.onBlurCapture),onPointerDownCapture:ya(e.onPointerDownCapture,D.onPointerDownCapture)})});g5.displayName=ZI;var eT="DismissableLayerBranch",tT=x.forwardRef((e,t)=>{const r=x.useContext($x),n=x.useRef(null),i=Co(t,n);return x.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),l.jsx(Jt.div,{...e,ref:i})});tT.displayName=eT;function rT(){const e=x.useContext($x),[t,r]=x.useState(null);return x.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}function nT(e,t){const{ownerDocument:r=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:o}=t,c=_c(e),u=x.useRef(!1),f=x.useRef(!1),h=x.useRef(new Map),m=x.useRef(()=>{});return x.useEffect(()=>{function p(){f.current=!1,i.current=!1,h.current.clear()}function v(){return Array.from(h.current.values()).some(Boolean)}function b(E){if(!f.current)return;const A=E.target;A instanceof Node&&[...o].some(_=>_.contains(A))||h.current.set(E.type,!0),E.type==="click"&&window.setTimeout(()=>{f.current&&m.current()},0)}function S(E){f.current&&h.current.set(E.type,!1)}const w=E=>{if(E.target&&!u.current){let A=function(){r.removeEventListener("click",m.current);const _=v();p(),_||v5(XI,c,C,{discrete:!0})};const C={originalEvent:E};f.current=!0,i.current=n&&E.button===0,h.current.clear(),!n||E.button!==0?A():(r.removeEventListener("click",m.current),m.current=A,r.addEventListener("click",m.current,{once:!0}))}else r.removeEventListener("click",m.current),p();u.current=!1},k=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const E of k)r.addEventListener(E,b,!0),r.addEventListener(E,S);const N=window.setTimeout(()=>{r.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(N),r.removeEventListener("pointerdown",w),r.removeEventListener("click",m.current);for(const E of k)r.removeEventListener(E,b,!0),r.removeEventListener(E,S)}},[r,c,n,i,o]),{onPointerDownCapture:()=>u.current=!0}}function iT(e,t=globalThis==null?void 0:globalThis.document){const r=_c(e),n=x.useRef(!1);return x.useEffect(()=>{const i=o=>{o.target&&!n.current&&v5(JI,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Ww(){const e=new CustomEvent(vv);document.dispatchEvent(e)}function v5(e,t,r,{discrete:n}){const i=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?QI(i,o):i.dispatchEvent(o)}var lg="focusScope.autoFocusOnMount",cg="focusScope.autoFocusOnUnmount",Hw={bubbles:!1,cancelable:!0},aT="FocusScope",x5=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...c}=e,[u,f]=x.useState(null),h=_c(i),m=_c(o),p=x.useRef(null),v=Co(t,w=>f(w)),b=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let w=function(A){if(b.paused||!u)return;const C=A.target;u.contains(C)?p.current=C:ia(p.current,{select:!0})},k=function(A){if(b.paused||!u)return;const C=A.relatedTarget;C!==null&&(u.contains(C)||ia(p.current,{select:!0}))},N=function(A){if(document.activeElement===document.body)for(const _ of A)_.removedNodes.length>0&&ia(u)};document.addEventListener("focusin",w),document.addEventListener("focusout",k);const E=new MutationObserver(N);return u&&E.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",k),E.disconnect()}}},[n,u,b.paused]),x.useEffect(()=>{if(u){Gw.add(b);const w=document.activeElement;if(!u.contains(w)){const N=new CustomEvent(lg,Hw);u.addEventListener(lg,h),u.dispatchEvent(N),N.defaultPrevented||(oT(dT(y5(u)),{select:!0}),document.activeElement===w&&ia(u))}return()=>{u.removeEventListener(lg,h),setTimeout(()=>{const N=new CustomEvent(cg,Hw);u.addEventListener(cg,m),u.dispatchEvent(N),N.defaultPrevented||ia(w??document.body,{select:!0}),u.removeEventListener(cg,m),Gw.remove(b)},0)}}},[u,h,m,b]);const S=x.useCallback(w=>{if(!r&&!n||b.paused)return;const k=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,N=document.activeElement;if(k&&N){const E=w.currentTarget,[A,C]=sT(E);A&&C?!w.shiftKey&&N===C?(w.preventDefault(),r&&ia(A,{select:!0})):w.shiftKey&&N===A&&(w.preventDefault(),r&&ia(C,{select:!0})):N===E&&w.preventDefault()}},[r,n,b.paused]);return l.jsx(Jt.div,{tabIndex:-1,...c,ref:v,onKeyDown:S})});x5.displayName=aT;function oT(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ia(n,{select:t}),document.activeElement!==r)return}function sT(e){const t=y5(e),r=Kw(t,e),n=Kw(t.reverse(),e);return[r,n]}function y5(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Kw(e,t){for(const r of e)if(!lT(r,{upTo:t}))return r}function lT(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function cT(e){return e instanceof HTMLInputElement&&"select"in e}function ia(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&cT(e)&&t&&e.select()}}var Gw=uT();function uT(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Vw(e,t),e.unshift(t)},remove(t){var r;e=Vw(e,t),(r=e[0])==null||r.resume()}}}function Vw(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function dT(e){return e.filter(t=>t.tagName!=="A")}var fT="Portal",b5=x.forwardRef((e,t)=>{var u;const{container:r,...n}=e,[i,o]=x.useState(!1);Oc(()=>o(!0),[]);const c=r||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?vh.createPortal(l.jsx(Jt.div,{...n,ref:t}),c):null});b5.displayName=fT;function hT(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var xh=e=>{const{present:t,children:r}=e,n=mT(t),i=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),o=pT(n.ref,gT(i));return typeof r=="function"||n.isPresent?x.cloneElement(i,{ref:o}):null};xh.displayName="Presence";function mT(e){const[t,r]=x.useState(),n=x.useRef(null),i=x.useRef(e),o=x.useRef("none"),c=e?"mounted":"unmounted",[u,f]=hT(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=_d(n.current);o.current=u==="mounted"?h:"none"},[u]),Oc(()=>{const h=n.current,m=i.current;if(m!==e){const v=o.current,b=_d(h);e?f("MOUNT"):b==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(m&&v!==b?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,f]),Oc(()=>{if(t){let h;const m=t.ownerDocument.defaultView??window,p=b=>{const w=_d(n.current).includes(CSS.escape(b.animationName));if(b.target===t&&w&&(f("ANIMATION_END"),!i.current)){const k=t.style.animationFillMode;t.style.animationFillMode="forwards",h=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=k)})}},v=b=>{b.target===t&&(o.current=_d(n.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{m.clearTimeout(h),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:x.useCallback(h=>{n.current=h?getComputedStyle(h):null,r(h)},[])}}function qw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function pT(...e){const t=x.useRef(e);return t.current=e,x.useCallback(r=>{const n=t.current;let i=!1;const o=n.map(c=>{const u=qw(c,r);return!i&&typeof u=="function"&&(i=!0),u});if(i)return()=>{for(let c=0;c{Tn||(Tn={start:Qw(),end:Qw()});const{start:e,end:t}=Tn;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Md++,()=>{Md===1&&(Tn==null||Tn.start.remove(),Tn==null||Tn.end.remove(),Tn=null),Md=Math.max(0,Md-1)}},[])}function Qw(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Bn=function(){return Bn=Object.assign||function(t){for(var r,n=1,i=arguments.length;n"u")return TT;var t=DT(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},LT=S5(),ws="data-scroll-locked",$T=function(e,t,r,n){var i=e.left,o=e.top,c=e.right,u=e.gap;return r===void 0&&(r="margin"),` + */const ka=se("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),pc=[{id:"dashboard",label:"Cockpit",hint:"Deine Box auf einen Blick",icon:XM},{id:"auftraege",label:"Auftragsbuch",hint:"Vorschläge der Box — annehmen oder ablehnen",icon:ru},{id:"models",label:"Modelle",hint:"Speicher, laden & Rollen",icon:mf},{id:"memory",label:"Gedächtnis",hint:"Geteiltes Memory verwalten",icon:Na},{id:"wissen",label:"Wissen",hint:"Lucys Wissens-Vault (Traum-Notizen)",icon:Lx},{id:"chronik",label:"Chronik",hint:"Was die Box von allein getan hat + Zeitmaschine",icon:Dx},{id:"connect",label:"Verbinden",hint:"IDE-/Agent-Configs erzeugen",icon:Cc},{id:"agent",label:"Hermes",hint:"Agent-Status & Verdrahtung",icon:jn},{id:"konsole",label:"Konsole",hint:"Direkte Box-Shell (SSH-artig)",icon:pf},{id:"guide",label:"Anleitung",hint:"Einrichten & Vibe-Coding",icon:RM}];var Fw=1,kI=.9,jI=.8,SI=.17,og=.1,sg=.999,NI=.9999,EI=.99,AI=/[\\\/_+.#"@\[\(\{&]/,CI=/[\\\/_+.#"@\[\(\{&]/g,PI=/[\s-]/,p5=/[\s-]/g;function vv(e,t,r,n,i,o,c){if(o===t.length)return i===e.length?Fw:EI;var u=`${i},${o}`;if(c[u]!==void 0)return c[u];for(var f=n.charAt(o),h=r.indexOf(f,i),m=0,p,v,b,S;h>=0;)p=vv(e,t,r,n,h+1,o+1,c),p>m&&(h===i?p*=Fw:AI.test(e.charAt(h-1))?(p*=jI,b=e.slice(i,h-1).match(CI),b&&i>0&&(p*=Math.pow(sg,b.length))):PI.test(e.charAt(h-1))?(p*=kI,S=e.slice(i,h-1).match(p5),S&&i>0&&(p*=Math.pow(sg,S.length))):(p*=SI,i>0&&(p*=Math.pow(sg,h-i))),e.charAt(h)!==t.charAt(o)&&(p*=NI)),(pp&&(p=v*og)),p>m&&(m=p),h=r.indexOf(f,h+1);return c[u]=m,m}function Bw(e){return e.toLowerCase().replace(p5," ")}function OI(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,vv(e,t,Bw(e),Bw(t),0,0,{})}function ya(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e==null||e(i),r===!1||!i.defaultPrevented)return t==null?void 0:t(i)}}function Uw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Bs(...e){return t=>{let r=!1;const n=e.map(i=>{const o=Uw(i,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let i=0;i{var N;const{scope:v,children:b,...S}=p,w=((N=v==null?void 0:v[e])==null?void 0:N[f])||u,k=x.useMemo(()=>S,Object.values(S));return l.jsx(w.Provider,{value:k,children:b})};h.displayName=o+"Provider";function m(p,v){var w;const b=((w=v==null?void 0:v[e])==null?void 0:w[f])||u,S=x.useContext(b);if(S)return S;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[h,m]}const i=()=>{const o=r.map(c=>x.createContext(c));return function(u){const f=(u==null?void 0:u[e])||o;return x.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return i.scopeName=e,[n,MI(i,...t)]}function MI(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const c=n.reduce((u,{useScope:f,scopeName:h})=>{const p=f(o)[`__scope${h}`];return{...u,...p}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return r.scopeName=t.scopeName,r}var _c=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},II=hh[" useId ".trim().toString()]||(()=>{}),TI=0;function vi(e){const[t,r]=x.useState(II());return _c(()=>{r(n=>n??String(TI++))},[e]),t?`radix-${t}`:""}var DI=hh[" useInsertionEffect ".trim().toString()]||_c;function LI({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[i,o,c]=RI({defaultProp:t,onChange:r}),u=e!==void 0,f=u?e:i;{const m=x.useRef(e!==void 0);x.useEffect(()=>{const p=m.current;p!==u&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${u?"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.`),m.current=u},[u,n])}const h=x.useCallback(m=>{var p;if(u){const v=$I(m)?m(e):m;v!==e&&((p=c.current)==null||p.call(c,v))}else o(m)},[u,e,o,c]);return[f,h]}function RI({defaultProp:e,onChange:t}){const[r,n]=x.useState(e),i=x.useRef(r),o=x.useRef(t);return DI(()=>{o.current=t},[t]),x.useEffect(()=>{var c;i.current!==r&&((c=o.current)==null||c.call(o,r),i.current=r)},[r,i]),[r,n,o]}function $I(e){return typeof e=="function"}var vh=$N();function g5(e){const t=x.forwardRef((r,n)=>{let{children:i,...o}=r,c=null,u=!1;const f=[];Ww(i)&&typeof _d=="function"&&(i=_d(i._payload)),x.Children.forEach(i,v=>{var b;if(WI(v)){u=!0;const S=v;let w="child"in S.props?S.props.child:S.props.children;Ww(w)&&typeof _d=="function"&&(w=_d(w._payload)),c=FI(S,w),f.push((b=c==null?void 0:c.props)==null?void 0:b.children)}else f.push(v)}),c?c=x.cloneElement(c,void 0,f):!u&&x.Children.count(i)===1&&x.isValidElement(i)&&(c=i);const h=c?UI(c):void 0,m=Co(n,h);if(!c){if(i||i===0)throw new Error(u?VI(e):GI(e));return i}const p=BI(o,c.props??{});return c.type!==x.Fragment&&(p.ref=n?m:h),x.cloneElement(c,p)});return t.displayName=`${e}.Slot`,t}var zI=Symbol.for("radix.slottable"),FI=(e,t)=>{if("child"in e.props){const r=e.props.child;return x.isValidElement(r)?x.cloneElement(r,void 0,e.props.children(r.props.children)):null}return x.isValidElement(t)?t:null};function BI(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function UI(e){var n,i;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function WI(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zI}var HI=Symbol.for("react.lazy");function Ww(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===HI&&"_payload"in e&&KI(e._payload)}function KI(e){return typeof e=="object"&&e!==null&&"then"in e}var GI=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,VI=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,_d=hh[" use ".trim().toString()],qI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jt=qI.reduce((e,t)=>{const r=g5(`Primitive.${t}`),n=x.forwardRef((i,o)=>{const{asChild:c,...u}=i,f=c?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),l.jsx(f,{...u,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function QI(e,t){e&&vh.flushSync(()=>e.dispatchEvent(t))}function Mc(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>((...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)}),[])}function YI(e,t=globalThis==null?void 0:globalThis.document){const r=Mc(e);x.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var ZI="DismissableLayer",xv="dismissableLayer.update",XI="dismissableLayer.pointerDownOutside",JI="dismissableLayer.focusOutside",Hw,zx=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),v5=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:n=!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:c,onInteractOutside:u,onDismiss:f,...h}=e,m=x.useContext(zx),[p,v]=x.useState(null),b=(p==null?void 0:p.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,S]=x.useState({}),w=Co(t,z=>v(z)),k=Array.from(m.layers),[N]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),E=k.indexOf(N),A=p?k.indexOf(p):-1,C=m.layersWithOutsidePointerEventsDisabled.size>0,_=A>=E,O=x.useRef(!1),D=nT(z=>{const $=z.target;if(!($ instanceof Node))return;const K=[...m.branches].some(W=>W.contains($));!_||K||(o==null||o(z),u==null||u(z),z.defaultPrevented||f==null||f())},{ownerDocument:b,deferPointerDownOutside:n,isDeferredPointerDownOutsideRef:O,dismissableSurfaces:m.dismissableSurfaces}),B=iT(z=>{if(n&&O.current)return;const $=z.target;[...m.branches].some(W=>W.contains($))||(c==null||c(z),u==null||u(z),z.defaultPrevented||f==null||f())},b);return YI(z=>{A===m.layers.size-1&&(i==null||i(z),!z.defaultPrevented&&f&&(z.preventDefault(),f()))},b),x.useEffect(()=>{if(p)return r&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(Hw=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(p)),m.layers.add(p),Kw(),()=>{r&&(m.layersWithOutsidePointerEventsDisabled.delete(p),m.layersWithOutsidePointerEventsDisabled.size===0&&(b.body.style.pointerEvents=Hw))}},[p,b,r,m]),x.useEffect(()=>()=>{p&&(m.layers.delete(p),m.layersWithOutsidePointerEventsDisabled.delete(p),Kw())},[p,m]),x.useEffect(()=>{const z=()=>S({});return document.addEventListener(xv,z),()=>document.removeEventListener(xv,z)},[]),l.jsx(Jt.div,{...h,ref:w,style:{pointerEvents:C?_?"auto":"none":void 0,...e.style},onFocusCapture:ya(e.onFocusCapture,B.onFocusCapture),onBlurCapture:ya(e.onBlurCapture,B.onBlurCapture),onPointerDownCapture:ya(e.onPointerDownCapture,D.onPointerDownCapture)})});v5.displayName=ZI;var eT="DismissableLayerBranch",tT=x.forwardRef((e,t)=>{const r=x.useContext(zx),n=x.useRef(null),i=Co(t,n);return x.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),l.jsx(Jt.div,{...e,ref:i})});tT.displayName=eT;function rT(){const e=x.useContext(zx),[t,r]=x.useState(null);return x.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}function nT(e,t){const{ownerDocument:r=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:o}=t,c=Mc(e),u=x.useRef(!1),f=x.useRef(!1),h=x.useRef(new Map),m=x.useRef(()=>{});return x.useEffect(()=>{function p(){f.current=!1,i.current=!1,h.current.clear()}function v(){return Array.from(h.current.values()).some(Boolean)}function b(E){if(!f.current)return;const A=E.target;A instanceof Node&&[...o].some(_=>_.contains(A))||h.current.set(E.type,!0),E.type==="click"&&window.setTimeout(()=>{f.current&&m.current()},0)}function S(E){f.current&&h.current.set(E.type,!1)}const w=E=>{if(E.target&&!u.current){let A=function(){r.removeEventListener("click",m.current);const _=v();p(),_||x5(XI,c,C,{discrete:!0})};const C={originalEvent:E};f.current=!0,i.current=n&&E.button===0,h.current.clear(),!n||E.button!==0?A():(r.removeEventListener("click",m.current),m.current=A,r.addEventListener("click",m.current,{once:!0}))}else r.removeEventListener("click",m.current),p();u.current=!1},k=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const E of k)r.addEventListener(E,b,!0),r.addEventListener(E,S);const N=window.setTimeout(()=>{r.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(N),r.removeEventListener("pointerdown",w),r.removeEventListener("click",m.current);for(const E of k)r.removeEventListener(E,b,!0),r.removeEventListener(E,S)}},[r,c,n,i,o]),{onPointerDownCapture:()=>u.current=!0}}function iT(e,t=globalThis==null?void 0:globalThis.document){const r=Mc(e),n=x.useRef(!1);return x.useEffect(()=>{const i=o=>{o.target&&!n.current&&x5(JI,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Kw(){const e=new CustomEvent(xv);document.dispatchEvent(e)}function x5(e,t,r,{discrete:n}){const i=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?QI(i,o):i.dispatchEvent(o)}var lg="focusScope.autoFocusOnMount",cg="focusScope.autoFocusOnUnmount",Gw={bubbles:!1,cancelable:!0},aT="FocusScope",y5=x.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...c}=e,[u,f]=x.useState(null),h=Mc(i),m=Mc(o),p=x.useRef(null),v=Co(t,w=>f(w)),b=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let w=function(A){if(b.paused||!u)return;const C=A.target;u.contains(C)?p.current=C:ia(p.current,{select:!0})},k=function(A){if(b.paused||!u)return;const C=A.relatedTarget;C!==null&&(u.contains(C)||ia(p.current,{select:!0}))},N=function(A){if(document.activeElement===document.body)for(const _ of A)_.removedNodes.length>0&&ia(u)};document.addEventListener("focusin",w),document.addEventListener("focusout",k);const E=new MutationObserver(N);return u&&E.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",k),E.disconnect()}}},[n,u,b.paused]),x.useEffect(()=>{if(u){qw.add(b);const w=document.activeElement;if(!u.contains(w)){const N=new CustomEvent(lg,Gw);u.addEventListener(lg,h),u.dispatchEvent(N),N.defaultPrevented||(oT(dT(b5(u)),{select:!0}),document.activeElement===w&&ia(u))}return()=>{u.removeEventListener(lg,h),setTimeout(()=>{const N=new CustomEvent(cg,Gw);u.addEventListener(cg,m),u.dispatchEvent(N),N.defaultPrevented||ia(w??document.body,{select:!0}),u.removeEventListener(cg,m),qw.remove(b)},0)}}},[u,h,m,b]);const S=x.useCallback(w=>{if(!r&&!n||b.paused)return;const k=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,N=document.activeElement;if(k&&N){const E=w.currentTarget,[A,C]=sT(E);A&&C?!w.shiftKey&&N===C?(w.preventDefault(),r&&ia(A,{select:!0})):w.shiftKey&&N===A&&(w.preventDefault(),r&&ia(C,{select:!0})):N===E&&w.preventDefault()}},[r,n,b.paused]);return l.jsx(Jt.div,{tabIndex:-1,...c,ref:v,onKeyDown:S})});y5.displayName=aT;function oT(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ia(n,{select:t}),document.activeElement!==r)return}function sT(e){const t=b5(e),r=Vw(t,e),n=Vw(t.reverse(),e);return[r,n]}function b5(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Vw(e,t){for(const r of e)if(!lT(r,{upTo:t}))return r}function lT(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function cT(e){return e instanceof HTMLInputElement&&"select"in e}function ia(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&cT(e)&&t&&e.select()}}var qw=uT();function uT(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Qw(e,t),e.unshift(t)},remove(t){var r;e=Qw(e,t),(r=e[0])==null||r.resume()}}}function Qw(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function dT(e){return e.filter(t=>t.tagName!=="A")}var fT="Portal",w5=x.forwardRef((e,t)=>{var u;const{container:r,...n}=e,[i,o]=x.useState(!1);_c(()=>o(!0),[]);const c=r||i&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?vh.createPortal(l.jsx(Jt.div,{...n,ref:t}),c):null});w5.displayName=fT;function hT(e,t){return x.useReducer((r,n)=>t[r][n]??r,e)}var xh=e=>{const{present:t,children:r}=e,n=mT(t),i=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),o=pT(n.ref,gT(i));return typeof r=="function"||n.isPresent?x.cloneElement(i,{ref:o}):null};xh.displayName="Presence";function mT(e){const[t,r]=x.useState(),n=x.useRef(null),i=x.useRef(e),o=x.useRef("none"),c=e?"mounted":"unmounted",[u,f]=hT(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const h=Md(n.current);o.current=u==="mounted"?h:"none"},[u]),_c(()=>{const h=n.current,m=i.current;if(m!==e){const v=o.current,b=Md(h);e?f("MOUNT"):b==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(m&&v!==b?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,f]),_c(()=>{if(t){let h;const m=t.ownerDocument.defaultView??window,p=b=>{const w=Md(n.current).includes(CSS.escape(b.animationName));if(b.target===t&&w&&(f("ANIMATION_END"),!i.current)){const k=t.style.animationFillMode;t.style.animationFillMode="forwards",h=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=k)})}},v=b=>{b.target===t&&(o.current=Md(n.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{m.clearTimeout(h),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:x.useCallback(h=>{n.current=h?getComputedStyle(h):null,r(h)},[])}}function Yw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function pT(...e){const t=x.useRef(e);return t.current=e,x.useCallback(r=>{const n=t.current;let i=!1;const o=n.map(c=>{const u=Yw(c,r);return!i&&typeof u=="function"&&(i=!0),u});if(i)return()=>{for(let c=0;c{Tn||(Tn={start:Zw(),end:Zw()});const{start:e,end:t}=Tn;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Id++,()=>{Id===1&&(Tn==null||Tn.start.remove(),Tn==null||Tn.end.remove(),Tn=null),Id=Math.max(0,Id-1)}},[])}function Zw(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Bn=function(){return Bn=Object.assign||function(t){for(var r,n=1,i=arguments.length;n"u")return TT;var t=DT(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},RT=N5(),ws="data-scroll-locked",$T=function(e,t,r,n){var i=e.left,o=e.top,c=e.right,u=e.gap;return r===void 0&&(r="margin"),` .`.concat(yT,` { overflow: hidden `).concat(n,`; padding-right: `).concat(u,"px ").concat(n,`; @@ -620,37 +620,37 @@ Error generating stack: `+j.message+` `),r==="padding"&&"padding-right: ".concat(u,"px ").concat(n,";")].filter(Boolean).join(""),` } - .`).concat(tf,` { + .`).concat(rf,` { right: `).concat(u,"px ").concat(n,`; } - .`).concat(rf,` { + .`).concat(nf,` { margin-right: `).concat(u,"px ").concat(n,`; } - .`).concat(tf," .").concat(tf,` { + .`).concat(rf," .").concat(rf,` { right: 0 `).concat(n,`; } - .`).concat(rf," .").concat(rf,` { + .`).concat(nf," .").concat(nf,` { margin-right: 0 `).concat(n,`; } body[`).concat(ws,`] { `).concat(bT,": ").concat(u,`px; } -`)},Zw=function(){var e=parseInt(document.body.getAttribute(ws)||"0",10);return isFinite(e)?e:0},zT=function(){x.useEffect(function(){return document.body.setAttribute(ws,(Zw()+1).toString()),function(){var e=Zw()-1;e<=0?document.body.removeAttribute(ws):document.body.setAttribute(ws,e.toString())}},[])},FT=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;zT();var o=x.useMemo(function(){return RT(i)},[i]);return x.createElement(LT,{styles:$T(o,!t,i,r?"":"!important")})},xv=!1;if(typeof window<"u")try{var Id=Object.defineProperty({},"passive",{get:function(){return xv=!0,!0}});window.addEventListener("test",Id,Id),window.removeEventListener("test",Id,Id)}catch{xv=!1}var as=xv?{passive:!1}:!1,BT=function(e){return e.tagName==="TEXTAREA"},N5=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!BT(e)&&r[t]==="visible")},UT=function(e){return N5(e,"overflowY")},WT=function(e){return N5(e,"overflowX")},Xw=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=E5(e,n);if(i){var o=A5(e,n),c=o[1],u=o[2];if(c>u)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},HT=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},KT=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},E5=function(e,t){return e==="v"?UT(t):WT(t)},A5=function(e,t){return e==="v"?HT(t):KT(t)},GT=function(e,t){return e==="h"&&t==="rtl"?-1:1},VT=function(e,t,r,n,i){var o=GT(e,window.getComputedStyle(t).direction),c=o*n,u=r.target,f=t.contains(u),h=!1,m=c>0,p=0,v=0;do{if(!u)break;var b=A5(e,u),S=b[0],w=b[1],k=b[2],N=w-k-o*S;(S||N)&&E5(e,u)&&(p+=N,v+=S);var E=u.parentNode;u=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(m&&Math.abs(p)<1||!m&&Math.abs(v)<1)&&(h=!0),h},Td=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Jw=function(e){return[e.deltaX,e.deltaY]},ek=function(e){return e&&"current"in e?e.current:e},qT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},QT=function(e){return` +`)},Jw=function(){var e=parseInt(document.body.getAttribute(ws)||"0",10);return isFinite(e)?e:0},zT=function(){x.useEffect(function(){return document.body.setAttribute(ws,(Jw()+1).toString()),function(){var e=Jw()-1;e<=0?document.body.removeAttribute(ws):document.body.setAttribute(ws,e.toString())}},[])},FT=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;zT();var o=x.useMemo(function(){return LT(i)},[i]);return x.createElement(RT,{styles:$T(o,!t,i,r?"":"!important")})},yv=!1;if(typeof window<"u")try{var Td=Object.defineProperty({},"passive",{get:function(){return yv=!0,!0}});window.addEventListener("test",Td,Td),window.removeEventListener("test",Td,Td)}catch{yv=!1}var as=yv?{passive:!1}:!1,BT=function(e){return e.tagName==="TEXTAREA"},E5=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!BT(e)&&r[t]==="visible")},UT=function(e){return E5(e,"overflowY")},WT=function(e){return E5(e,"overflowX")},ek=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=A5(e,n);if(i){var o=C5(e,n),c=o[1],u=o[2];if(c>u)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},HT=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},KT=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},A5=function(e,t){return e==="v"?UT(t):WT(t)},C5=function(e,t){return e==="v"?HT(t):KT(t)},GT=function(e,t){return e==="h"&&t==="rtl"?-1:1},VT=function(e,t,r,n,i){var o=GT(e,window.getComputedStyle(t).direction),c=o*n,u=r.target,f=t.contains(u),h=!1,m=c>0,p=0,v=0;do{if(!u)break;var b=C5(e,u),S=b[0],w=b[1],k=b[2],N=w-k-o*S;(S||N)&&A5(e,u)&&(p+=N,v+=S);var E=u.parentNode;u=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(m&&Math.abs(p)<1||!m&&Math.abs(v)<1)&&(h=!0),h},Dd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},tk=function(e){return[e.deltaX,e.deltaY]},rk=function(e){return e&&"current"in e?e.current:e},qT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},QT=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},YT=0,os=[];function ZT(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),i=x.useState(YT++)[0],o=x.useState(S5)[0],c=x.useRef(e);x.useEffect(function(){c.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=xT([e.lockRef.current],(e.shards||[]).map(ek),!0).filter(Boolean);return w.forEach(function(k){return k.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=x.useCallback(function(w,k){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!c.current.allowPinchZoom;var N=Td(w),E=r.current,A="deltaX"in w?w.deltaX:E[0]-N[0],C="deltaY"in w?w.deltaY:E[1]-N[1],_,O=w.target,D=Math.abs(A)>Math.abs(C)?"h":"v";if("touches"in w&&D==="h"&&O.type==="range")return!1;var B=window.getSelection(),z=B&&B.anchorNode,$=z?z===O||z.contains(O):!1;if($)return!1;var K=Xw(D,O);if(!K)return!0;if(K?_=D:(_=D==="v"?"h":"v",K=Xw(D,O)),!K)return!1;if(!n.current&&"changedTouches"in w&&(A||C)&&(n.current=_),!_)return!0;var W=n.current||_;return VT(W,k,w,W==="h"?A:C)},[]),f=x.useCallback(function(w){var k=w;if(!(!os.length||os[os.length-1]!==o)){var N="deltaY"in k?Jw(k):Td(k),E=t.current.filter(function(_){return _.name===k.type&&(_.target===k.target||k.target===_.shadowParent)&&qT(_.delta,N)})[0];if(E&&E.should){k.cancelable&&k.preventDefault();return}if(!E){var A=(c.current.shards||[]).map(ek).filter(Boolean).filter(function(_){return _.contains(k.target)}),C=A.length>0?u(k,A[0]):!c.current.noIsolation;C&&k.cancelable&&k.preventDefault()}}},[]),h=x.useCallback(function(w,k,N,E){var A={name:w,delta:k,target:N,should:E,shadowParent:XT(N)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(C){return C!==A})},1)},[]),m=x.useCallback(function(w){r.current=Td(w),n.current=void 0},[]),p=x.useCallback(function(w){h(w.type,Jw(w),w.target,u(w,e.lockRef.current))},[]),v=x.useCallback(function(w){h(w.type,Td(w),w.target,u(w,e.lockRef.current))},[]);x.useEffect(function(){return os.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",f,as),document.addEventListener("touchmove",f,as),document.addEventListener("touchstart",m,as),function(){os=os.filter(function(w){return w!==o}),document.removeEventListener("wheel",f,as),document.removeEventListener("touchmove",f,as),document.removeEventListener("touchstart",m,as)}},[]);var b=e.removeScrollBar,S=e.inert;return x.createElement(x.Fragment,null,S?x.createElement(o,{styles:QT(i)}):null,b?x.createElement(FT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function XT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const JT=AT(j5,ZT);var C5=x.forwardRef(function(e,t){return x.createElement(yh,Bn({},e,{ref:t,sideCar:JT}))});C5.classNames=yh.classNames;var eD=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ss=new WeakMap,Dd=new WeakMap,Rd={},hg=0,P5=function(e){return e&&(e.host||P5(e.parentNode))},tD=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=P5(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},rD=function(e,t,r,n){var i=tD(t,Array.isArray(e)?e:[e]);Rd[r]||(Rd[r]=new WeakMap);var o=Rd[r],c=[],u=new Set,f=new Set(i),h=function(p){!p||u.has(p)||(u.add(p),h(p.parentNode))};i.forEach(h);var m=function(p){!p||f.has(p)||Array.prototype.forEach.call(p.children,function(v){if(u.has(v))m(v);else try{var b=v.getAttribute(n),S=b!==null&&b!=="false",w=(ss.get(v)||0)+1,k=(o.get(v)||0)+1;ss.set(v,w),o.set(v,k),c.push(v),w===1&&S&&Dd.set(v,!0),k===1&&v.setAttribute(r,"true"),S||v.setAttribute(n,"true")}catch(N){console.error("aria-hidden: cannot operate on ",v,N)}})};return m(t),u.clear(),hg++,function(){c.forEach(function(p){var v=ss.get(p)-1,b=o.get(p)-1;ss.set(p,v),o.set(p,b),v||(Dd.has(p)||p.removeAttribute(n),Dd.delete(p)),b||p.removeAttribute(r)}),hg--,hg||(ss=new WeakMap,ss=new WeakMap,Dd=new WeakMap,Rd={})}},nD=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=eD(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),rD(n,i,r,"aria-hidden")):function(){return null}},bh="Dialog",[O5]=_I(bh),[iD,En]=O5(bh),_5=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,u=x.useRef(null),f=x.useRef(null),[h,m]=RI({prop:n,defaultProp:i??!1,onChange:o,caller:bh});return l.jsx(iD,{scope:t,triggerRef:u,contentRef:f,contentId:vi(),titleId:vi(),descriptionId:vi(),open:h,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(p=>!p),[m]),modal:c,children:r})};_5.displayName=bh;var M5="DialogTrigger",aD=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=En(M5,r),o=Co(t,i.triggerRef);return l.jsx(Jt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Fx(i.open),...n,ref:o,onClick:ya(e.onClick,i.onOpenToggle)})});aD.displayName=M5;var zx="DialogPortal",[oD,I5]=O5(zx,{forceMount:void 0}),T5=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,o=En(zx,t);return l.jsx(oD,{scope:t,forceMount:r,children:x.Children.map(n,c=>l.jsx(xh,{present:r||o.open,children:l.jsx(b5,{asChild:!0,container:i,children:c})}))})};T5.displayName=zx;var gf="DialogOverlay",D5=x.forwardRef((e,t)=>{const r=I5(gf,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=En(gf,e.__scopeDialog);return o.modal?l.jsx(xh,{present:n||o.open,children:l.jsx(lD,{...i,ref:t})}):null});D5.displayName=gf;var sD=p5("DialogOverlay.RemoveScroll"),lD=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=En(gf,r),o=rT(),c=Co(t,o);return l.jsx(C5,{as:sD,allowPinchZoom:!0,shards:[i.contentRef],children:l.jsx(Jt.div,{"data-state":Fx(i.open),...n,ref:c,style:{pointerEvents:"auto",...n.style}})})}),Us="DialogContent",R5=x.forwardRef((e,t)=>{const r=I5(Us,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=En(Us,e.__scopeDialog);return l.jsx(xh,{present:n||o.open,children:o.modal?l.jsx(cD,{...i,ref:t}):l.jsx(uD,{...i,ref:t})})});R5.displayName=Us;var cD=x.forwardRef((e,t)=>{const r=En(Us,e.__scopeDialog),n=x.useRef(null),i=Co(t,r.contentRef,n);return x.useEffect(()=>{const o=n.current;if(o)return nD(o)},[]),l.jsx(L5,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:ya(e.onCloseAutoFocus,o=>{var c;o.preventDefault(),(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:ya(e.onPointerDownOutside,o=>{const c=o.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&o.preventDefault()}),onFocusOutside:ya(e.onFocusOutside,o=>o.preventDefault())})}),uD=x.forwardRef((e,t)=>{const r=En(Us,e.__scopeDialog),n=x.useRef(!1),i=x.useRef(!1);return l.jsx(L5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,o),o.defaultPrevented||(n.current||(u=r.triggerRef.current)==null||u.focus(),o.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:o=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=o.target;((h=r.triggerRef.current)==null?void 0:h.contains(c))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),L5=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:o,...c}=e,u=En(Us,r);return vT(),l.jsx(l.Fragment,{children:l.jsx(x5,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:o,children:l.jsx(g5,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Fx(u.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})}),$5="DialogTitle",dD=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=En($5,r);return l.jsx(Jt.h2,{id:i.titleId,...n,ref:t})});dD.displayName=$5;var z5="DialogDescription",fD=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=En(z5,r);return l.jsx(Jt.p,{id:i.descriptionId,...n,ref:t})});fD.displayName=z5;var F5="DialogClose",hD=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=En(F5,r);return l.jsx(Jt.button,{type:"button",...n,ref:t,onClick:ya(e.onClick,()=>i.onOpenChange(!1))})});hD.displayName=F5;function Fx(e){return e?"open":"closed"}var ec='[cmdk-group=""]',mg='[cmdk-group-items=""]',mD='[cmdk-group-heading=""]',B5='[cmdk-item=""]',tk=`${B5}:not([aria-disabled="true"])`,yv="cmdk-item-select",gs="data-value",pD=(e,t,r)=>OI(e,t,r),U5=x.createContext(void 0),nu=()=>x.useContext(U5),W5=x.createContext(void 0),Bx=()=>x.useContext(W5),H5=x.createContext(void 0),K5=x.forwardRef((e,t)=>{let r=vs(()=>{var M,U;return{search:"",value:(U=(M=e.value)!=null?M:e.defaultValue)!=null?U:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=vs(()=>new Set),i=vs(()=>new Map),o=vs(()=>new Map),c=vs(()=>new Set),u=G5(e),{label:f,children:h,value:m,onValueChange:p,filter:v,shouldFilter:b,loop:S,disablePointerSelection:w=!1,vimBindings:k=!0,...N}=e,E=vi(),A=vi(),C=vi(),_=x.useRef(null),O=ED();yo(()=>{if(m!==void 0){let M=m.trim();r.current.value=M,D.emit()}},[m]),yo(()=>{O(6,ve)},[]);let D=x.useMemo(()=>({subscribe:M=>(c.current.add(M),()=>c.current.delete(M)),snapshot:()=>r.current,setState:(M,U,ne)=>{var ee,X,ae,me;if(!Object.is(r.current[M],U)){if(r.current[M]=U,M==="search")W(),$(),O(1,K);else if(M==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let re=document.getElementById(C);re?re.focus():(ee=document.getElementById(E))==null||ee.focus()}if(O(7,()=>{var re;r.current.selectedItemId=(re=ue())==null?void 0:re.id,D.emit()}),ne||O(5,ve),((X=u.current)==null?void 0:X.value)!==void 0){let re=U??"";(me=(ae=u.current).onValueChange)==null||me.call(ae,re);return}}D.emit()}},emit:()=>{c.current.forEach(M=>M())}}),[]),B=x.useMemo(()=>({value:(M,U,ne)=>{var ee;U!==((ee=o.current.get(M))==null?void 0:ee.value)&&(o.current.set(M,{value:U,keywords:ne}),r.current.filtered.items.set(M,z(U,ne)),O(2,()=>{$(),D.emit()}))},item:(M,U)=>(n.current.add(M),U&&(i.current.has(U)?i.current.get(U).add(M):i.current.set(U,new Set([M]))),O(3,()=>{W(),$(),r.current.value||K(),D.emit()}),()=>{o.current.delete(M),n.current.delete(M),r.current.filtered.items.delete(M);let ne=ue();O(4,()=>{W(),(ne==null?void 0:ne.getAttribute("id"))===M&&K(),D.emit()})}),group:M=>(i.current.has(M)||i.current.set(M,new Set),()=>{o.current.delete(M),i.current.delete(M)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:E,inputId:C,labelId:A,listInnerRef:_}),[]);function z(M,U){var ne,ee;let X=(ee=(ne=u.current)==null?void 0:ne.filter)!=null?ee:pD;return M?X(M,r.current.search,U):0}function $(){if(!r.current.search||u.current.shouldFilter===!1)return;let M=r.current.filtered.items,U=[];r.current.filtered.groups.forEach(ee=>{let X=i.current.get(ee),ae=0;X.forEach(me=>{let re=M.get(me);ae=Math.max(re,ae)}),U.push([ee,ae])});let ne=_.current;pe().sort((ee,X)=>{var ae,me;let re=ee.getAttribute("id"),ye=X.getAttribute("id");return((ae=M.get(ye))!=null?ae:0)-((me=M.get(re))!=null?me:0)}).forEach(ee=>{let X=ee.closest(mg);X?X.appendChild(ee.parentElement===X?ee:ee.closest(`${mg} > *`)):ne.appendChild(ee.parentElement===ne?ee:ee.closest(`${mg} > *`))}),U.sort((ee,X)=>X[1]-ee[1]).forEach(ee=>{var X;let ae=(X=_.current)==null?void 0:X.querySelector(`${ec}[${gs}="${encodeURIComponent(ee[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function K(){let M=pe().find(ne=>ne.getAttribute("aria-disabled")!=="true"),U=M==null?void 0:M.getAttribute(gs);D.setState("value",U||void 0)}function W(){var M,U,ne,ee;if(!r.current.search||u.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let X=0;for(let ae of n.current){let me=(U=(M=o.current.get(ae))==null?void 0:M.value)!=null?U:"",re=(ee=(ne=o.current.get(ae))==null?void 0:ne.keywords)!=null?ee:[],ye=z(me,re);r.current.filtered.items.set(ae,ye),ye>0&&X++}for(let[ae,me]of i.current)for(let re of me)if(r.current.filtered.items.get(re)>0){r.current.filtered.groups.add(ae);break}r.current.filtered.count=X}function ve(){var M,U,ne;let ee=ue();ee&&(((M=ee.parentElement)==null?void 0:M.firstChild)===ee&&((ne=(U=ee.closest(ec))==null?void 0:U.querySelector(mD))==null||ne.scrollIntoView({block:"nearest"})),ee.scrollIntoView({block:"nearest"}))}function ue(){var M;return(M=_.current)==null?void 0:M.querySelector(`${B5}[aria-selected="true"]`)}function pe(){var M;return Array.from(((M=_.current)==null?void 0:M.querySelectorAll(tk))||[])}function oe(M){let U=pe()[M];U&&D.setState("value",U.getAttribute(gs))}function le(M){var U;let ne=ue(),ee=pe(),X=ee.findIndex(me=>me===ne),ae=ee[X+M];(U=u.current)!=null&&U.loop&&(ae=X+M<0?ee[ee.length-1]:X+M===ee.length?ee[0]:ee[X+M]),ae&&D.setState("value",ae.getAttribute(gs))}function Z(M){let U=ue(),ne=U==null?void 0:U.closest(ec),ee;for(;ne&&!ee;)ne=M>0?SD(ne,ec):ND(ne,ec),ee=ne==null?void 0:ne.querySelector(tk);ee?D.setState("value",ee.getAttribute(gs)):le(M)}let ie=()=>oe(pe().length-1),te=M=>{M.preventDefault(),M.metaKey?ie():M.altKey?Z(1):le(1)},I=M=>{M.preventDefault(),M.metaKey?oe(0):M.altKey?Z(-1):le(-1)};return x.createElement(Jt.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:M=>{var U;(U=N.onKeyDown)==null||U.call(N,M);let ne=M.nativeEvent.isComposing||M.keyCode===229;if(!(M.defaultPrevented||ne))switch(M.key){case"n":case"j":{k&&M.ctrlKey&&te(M);break}case"ArrowDown":{te(M);break}case"p":case"k":{k&&M.ctrlKey&&I(M);break}case"ArrowUp":{I(M);break}case"Home":{M.preventDefault(),oe(0);break}case"End":{M.preventDefault(),ie();break}case"Enter":{M.preventDefault();let ee=ue();if(ee){let X=new Event(yv);ee.dispatchEvent(X)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:B.inputId,id:B.labelId,style:CD},f),wh(e,M=>x.createElement(W5.Provider,{value:D},x.createElement(U5.Provider,{value:B},M))))}),gD=x.forwardRef((e,t)=>{var r,n;let i=vi(),o=x.useRef(null),c=x.useContext(H5),u=nu(),f=G5(e),h=(n=(r=f.current)==null?void 0:r.forceMount)!=null?n:c==null?void 0:c.forceMount;yo(()=>{if(!h)return u.item(i,c==null?void 0:c.id)},[h]);let m=V5(i,o,[e.value,e.children,o],e.keywords),p=Bx(),v=ja(O=>O.value&&O.value===m.current),b=ja(O=>h||u.filter()===!1?!0:O.search?O.filtered.items.get(i)>0:!0);x.useEffect(()=>{let O=o.current;if(!(!O||e.disabled))return O.addEventListener(yv,S),()=>O.removeEventListener(yv,S)},[b,e.onSelect,e.disabled]);function S(){var O,D;w(),(D=(O=f.current).onSelect)==null||D.call(O,m.current)}function w(){p.setState("value",m.current,!0)}if(!b)return null;let{disabled:k,value:N,onSelect:E,forceMount:A,keywords:C,..._}=e;return x.createElement(Jt.div,{ref:Bs(o,t),..._,id:i,"cmdk-item":"",role:"option","aria-disabled":!!k,"aria-selected":!!v,"data-disabled":!!k,"data-selected":!!v,onPointerMove:k||u.getDisablePointerSelection()?void 0:w,onClick:k?void 0:S},e.children)}),vD=x.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:i,...o}=e,c=vi(),u=x.useRef(null),f=x.useRef(null),h=vi(),m=nu(),p=ja(b=>i||m.filter()===!1?!0:b.search?b.filtered.groups.has(c):!0);yo(()=>m.group(c),[]),V5(c,u,[e.value,e.heading,f]);let v=x.useMemo(()=>({id:c,forceMount:i}),[i]);return x.createElement(Jt.div,{ref:Bs(u,t),...o,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},r&&x.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:h},r),wh(e,b=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?h:void 0},x.createElement(H5.Provider,{value:v},b))))}),xD=x.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,i=x.useRef(null),o=ja(c=>!c.search);return!r&&!o?null:x.createElement(Jt.div,{ref:Bs(i,t),...n,"cmdk-separator":"",role:"separator"})}),yD=x.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,i=e.value!=null,o=Bx(),c=ja(h=>h.search),u=ja(h=>h.selectedItemId),f=nu();return x.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),x.createElement(Jt.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":u,id:f.inputId,type:"text",value:i?e.value:c,onChange:h=>{i||o.setState("search",h.target.value),r==null||r(h.target.value)}})}),bD=x.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...i}=e,o=x.useRef(null),c=x.useRef(null),u=ja(h=>h.selectedItemId),f=nu();return x.useEffect(()=>{if(c.current&&o.current){let h=c.current,m=o.current,p,v=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let b=h.offsetHeight;m.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return v.observe(h),()=>{cancelAnimationFrame(p),v.unobserve(h)}}},[]),x.createElement(Jt.div,{ref:Bs(o,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":n,id:f.listId},wh(e,h=>x.createElement("div",{ref:Bs(c,f.listInnerRef),"cmdk-list-sizer":""},h)))}),wD=x.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:i,contentClassName:o,container:c,...u}=e;return x.createElement(_5,{open:r,onOpenChange:n},x.createElement(T5,{container:c},x.createElement(D5,{"cmdk-overlay":"",className:i}),x.createElement(R5,{"aria-label":e.label,"cmdk-dialog":"",className:o},x.createElement(K5,{ref:t,...u}))))}),kD=x.forwardRef((e,t)=>ja(r=>r.filtered.count===0)?x.createElement(Jt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),jD=x.forwardRef((e,t)=>{let{progress:r,children:n,label:i="Loading...",...o}=e;return x.createElement(Jt.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},wh(e,c=>x.createElement("div",{"aria-hidden":!0},c)))}),ls=Object.assign(K5,{List:bD,Item:gD,Input:yD,Group:vD,Separator:xD,Dialog:wD,Empty:kD,Loading:jD});function SD(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function ND(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function G5(e){let t=x.useRef(e);return yo(()=>{t.current=e}),t}var yo=typeof window>"u"?x.useEffect:x.useLayoutEffect;function vs(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function ja(e){let t=Bx(),r=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,r,r)}function V5(e,t,r,n=[]){let i=x.useRef(),o=nu();return yo(()=>{var c;let u=(()=>{var h;for(let m of r){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(h=m.current.textContent)==null?void 0:h.trim():i.current}})(),f=n.map(h=>h.trim());o.value(e,u,f),(c=t.current)==null||c.setAttribute(gs,u),i.current=u}),i}var ED=()=>{let[e,t]=x.useState(),r=vs(()=>new Map);return yo(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,i)=>{r.current.set(n,i),t({})}};function AD(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function wh({asChild:e,children:t},r){return e&&x.isValidElement(t)?x.cloneElement(AD(t),{ref:t.ref},r(t.props.children)):r(t)}var CD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function PD({onNavigate:e}){const[t,r]=x.useState(!1);return x.useEffect(()=>{const n=i=>{(i.metaKey||i.ctrlKey)&&i.key.toLowerCase()==="k"&&(i.preventDefault(),r(o=>!o))};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[]),l.jsx(ls.Dialog,{open:t,onOpenChange:r,label:"Befehlspalette",className:"fixed inset-0 z-50 flex items-start justify-center bg-black/50 p-4 pt-[12vh] overscroll-contain",onClick:()=>r(!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:n=>n.stopPropagation(),children:[l.jsx(ls.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(ls.List,{className:"max-h-80 overflow-y-auto p-2",children:[l.jsx(ls.Empty,{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Nichts gefunden."}),l.jsx(ls.Group,{heading:"Bereiche",className:"px-1 py-1 text-xs text-muted-foreground",children:pc.map(n=>l.jsxs(ls.Item,{value:`${n.label} ${n.hint}`,onSelect:()=>{e(n.id),r(!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(n.icon,{className:"h-4 w-4 text-primary"}),l.jsx("span",{children:n.label}),l.jsx("span",{className:"ml-auto truncate text-xs text-muted-foreground",children:n.hint})]},n.id))})]})]})})}const q5="mc_expert_mode",bv="mc-expert-mode-change",OD=()=>{try{return localStorage.getItem(q5)==="true"}catch{return!1}};function _D(e){return window.addEventListener(bv,e),window.addEventListener("storage",e),()=>{window.removeEventListener(bv,e),window.removeEventListener("storage",e)}}function rk(e){localStorage.setItem(q5,String(e)),window.dispatchEvent(new Event(bv))}function Ux(){return x.useSyncExternalStore(_D,OD,()=>!1)}function Q5(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const t=TD(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:c=>{const u=c.split(Wx);return u[0]===""&&u.length!==1&&u.shift(),Y5(u,t)||ID(c)},getConflictingClassGroupIds:(c,u)=>{const f=r[c]||[];return u&&n[c]?[...f,...n[c]]:f}}},Y5=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),i=n?Y5(e.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(Wx);return(c=t.validators.find(({validator:u})=>u(o)))==null?void 0:c.classGroupId},nk=/^\[(.+)\]$/,ID=e=>{if(nk.test(e)){const t=nk.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},TD=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return RD(Object.entries(e.classGroups),r).forEach(([o,c])=>{wv(c,n,o,t)}),n},wv=(e,t,r,n)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:ik(t,i);o.classGroupId=r;return}if(typeof i=="function"){if(DD(i)){wv(i(n),t,r,n);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([o,c])=>{wv(c,ik(t,o),r,n)})})},ik=(e,t)=>{let r=e;return t.split(Wx).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},DD=e=>e.isThemeGetter,RD=(e,t)=>t?e.map(([r,n])=>{const i=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([c,u])=>[t+c,u])):o);return[r,i]}):e,LD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const i=(o,c)=>{r.set(o,c),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let c=r.get(o);if(c!==void 0)return c;if((c=n.get(o))!==void 0)return i(o,c),c},set(o,c){r.has(o)?r.set(o,c):i(o,c)}}},Z5="!",$D=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,i=t[0],o=t.length,c=u=>{const f=[];let h=0,m=0,p;for(let k=0;km?p-m:void 0;return{modifiers:f,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:w}};return r?u=>r({className:u,parseClassName:c}):c},zD=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},FD=e=>({cache:LD(e.cacheSize),parseClassName:$D(e),...MD(e)}),BD=/\s+/,UD=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=t,o=[],c=e.trim().split(BD);let u="";for(let f=c.length-1;f>=0;f-=1){const h=c[f],{modifiers:m,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:b}=r(h);let S=!!b,w=n(S?v.substring(0,b):v);if(!w){if(!S){u=h+(u.length>0?" "+u:u);continue}if(w=n(v),!w){u=h+(u.length>0?" "+u:u);continue}S=!1}const k=zD(m).join(":"),N=p?k+Z5:k,E=N+w;if(o.includes(E))continue;o.push(E);const A=i(w,S);for(let C=0;C0?" "+u:u)}return u};function WD(){let e=0,t,r,n="";for(;e{if(typeof e=="string")return e;let t,r="";for(let n=0;np(m),e());return r=FD(h),n=r.cache.get,i=r.cache.set,o=u,u(f)}function u(f){const h=n(f);if(h)return h;const m=UD(f,r);return i(f,m),m}return function(){return o(WD.apply(null,arguments))}}const st=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},J5=/^\[(?:([a-z-]+):)?(.+)\]$/i,KD=/^\d+\/\d+$/,GD=new Set(["px","full","screen"]),VD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qD=/\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$/,QD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,YD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ZD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,si=e=>ks(e)||GD.has(e)||KD.test(e),ea=e=>tl(e,"length",aR),ks=e=>!!e&&!Number.isNaN(Number(e)),pg=e=>tl(e,"number",ks),tc=e=>!!e&&Number.isInteger(Number(e)),XD=e=>e.endsWith("%")&&ks(e.slice(0,-1)),ze=e=>J5.test(e),ta=e=>VD.test(e),JD=new Set(["length","size","percentage"]),eR=e=>tl(e,JD,eE),tR=e=>tl(e,"position",eE),rR=new Set(["image","url"]),nR=e=>tl(e,rR,sR),iR=e=>tl(e,"",oR),rc=()=>!0,tl=(e,t,r)=>{const n=J5.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},aR=e=>qD.test(e)&&!QD.test(e),eE=()=>!1,oR=e=>YD.test(e),sR=e=>ZD.test(e),lR=()=>{const e=st("colors"),t=st("spacing"),r=st("blur"),n=st("brightness"),i=st("borderColor"),o=st("borderRadius"),c=st("borderSpacing"),u=st("borderWidth"),f=st("contrast"),h=st("grayscale"),m=st("hueRotate"),p=st("invert"),v=st("gap"),b=st("gradientColorStops"),S=st("gradientColorStopPositions"),w=st("inset"),k=st("margin"),N=st("opacity"),E=st("padding"),A=st("saturate"),C=st("scale"),_=st("sepia"),O=st("skew"),D=st("space"),B=st("translate"),z=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto",ze,t],W=()=>[ze,t],ve=()=>["",si,ea],ue=()=>["auto",ks,ze],pe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],oe=()=>["solid","dashed","dotted","double","none"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>["start","end","center","between","around","evenly","stretch"],ie=()=>["","0",ze],te=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>[ks,ze];return{cacheSize:500,separator:":",theme:{colors:[rc],spacing:[si,ea],blur:["none","",ta,ze],brightness:I(),borderColor:[e],borderRadius:["none","","full",ta,ze],borderSpacing:W(),borderWidth:ve(),contrast:I(),grayscale:ie(),hueRotate:I(),invert:ie(),gap:W(),gradientColorStops:[e],gradientColorStopPositions:[XD,ea],inset:K(),margin:K(),opacity:I(),padding:W(),saturate:I(),scale:I(),sepia:ie(),skew:I(),space:W(),translate:W()},classGroups:{aspect:[{aspect:["auto","square","video",ze]}],container:["container"],columns:[{columns:[ta]}],"break-after":[{"break-after":te()}],"break-before":[{"break-before":te()}],"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:[...pe(),ze]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",tc,ze]}],basis:[{basis:K()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ze]}],grow:[{grow:ie()}],shrink:[{shrink:ie()}],order:[{order:["first","last","none",tc,ze]}],"grid-cols":[{"grid-cols":[rc]}],"col-start-end":[{col:["auto",{span:["full",tc,ze]},ze]}],"col-start":[{"col-start":ue()}],"col-end":[{"col-end":ue()}],"grid-rows":[{"grid-rows":[rc]}],"row-start-end":[{row:["auto",{span:[tc,ze]},ze]}],"row-start":[{"row-start":ue()}],"row-end":[{"row-end":ue()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ze]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ze]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...Z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[k]}],mx:[{mx:[k]}],my:[{my:[k]}],ms:[{ms:[k]}],me:[{me:[k]}],mt:[{mt:[k]}],mr:[{mr:[k]}],mb:[{mb:[k]}],ml:[{ml:[k]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ze,t]}],"min-w":[{"min-w":[ze,t,"min","max","fit"]}],"max-w":[{"max-w":[ze,t,"none","full","min","max","fit","prose",{screen:[ta]},ta]}],h:[{h:[ze,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ze,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ze,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ze,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ta,ea]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",pg]}],"font-family":[{font:[rc]}],"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",ze]}],"line-clamp":[{"line-clamp":["none",ks,pg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",si,ze]}],"list-image":[{"list-image":["none",ze]}],"list-style-type":[{list:["none","disc","decimal",ze]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",si,ea]}],"underline-offset":[{"underline-offset":["auto",si,ze]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:W()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ze]}],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",ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...pe(),tR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",eR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},nR]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[N]}],"border-style":[{border:[...oe(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[N]}],"divide-style":[{divide:oe()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...oe()]}],"outline-offset":[{"outline-offset":[si,ze]}],"outline-w":[{outline:[si,ea]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ve()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[si,ea]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ta,iR]}],"shadow-color":[{shadow:[rc]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...le(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":le()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",ta,ze]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[p]}],saturate:[{saturate:[A]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[A]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ze]}],duration:[{duration:I()}],ease:[{ease:["linear","in","out","in-out",ze]}],delay:[{delay:I()}],animate:[{animate:["none","spin","ping","pulse","bounce",ze]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[tc,ze]}],"translate-x":[{"translate-x":[B]}],"translate-y":[{"translate-y":[B]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ze]}],accent:[{accent:["auto",e]}],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",ze]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":W()}],"scroll-mx":[{"scroll-mx":W()}],"scroll-my":[{"scroll-my":W()}],"scroll-ms":[{"scroll-ms":W()}],"scroll-me":[{"scroll-me":W()}],"scroll-mt":[{"scroll-mt":W()}],"scroll-mr":[{"scroll-mr":W()}],"scroll-mb":[{"scroll-mb":W()}],"scroll-ml":[{"scroll-ml":W()}],"scroll-p":[{"scroll-p":W()}],"scroll-px":[{"scroll-px":W()}],"scroll-py":[{"scroll-py":W()}],"scroll-ps":[{"scroll-ps":W()}],"scroll-pe":[{"scroll-pe":W()}],"scroll-pt":[{"scroll-pt":W()}],"scroll-pr":[{"scroll-pr":W()}],"scroll-pb":[{"scroll-pb":W()}],"scroll-pl":[{"scroll-pl":W()}],"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",ze]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[si,ea,pg]}],stroke:[{stroke:[e,"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"]}}},cR=HD(lR);function J(...e){return cR(nt(e))}function kv(e){return e?e.replace(/127\.0\.0\.1|localhost/g,"192.168.178.151"):""}function tE(){const e=Ux();return l.jsxs("div",{className:"flex items-center rounded-md border border-border/40 bg-background/40 p-0.5",role:"group","aria-label":"Ansichtsmodus",title:"Einfach zeigt nur das Wichtigste. Experte zeigt alle technischen Details.",children:[l.jsxs("button",{onClick:()=>rk(!1),"aria-pressed":!e,className:J("flex items-center gap-1 rounded px-2 py-1 text-xs font-semibold transition-all cursor-pointer",e?"text-muted-foreground hover:text-foreground":"bg-primary/15 text-primary shadow-sm"),children:[l.jsx(hi,{className:"h-3.5 w-3.5"})," Einfach"]}),l.jsxs("button",{onClick:()=>rk(!0),"aria-pressed":e,className:J("flex items-center gap-1 rounded px-2 py-1 text-xs font-semibold transition-all cursor-pointer",e?"bg-primary/15 text-primary shadow-sm":"text-muted-foreground hover:text-foreground"),children:[l.jsx(vI,{className:"h-3.5 w-3.5"})," Experte"]})]})}async function xe(e,t){var f;const r={"Content-Type":"application/json",...t==null?void 0:t.headers},n=localStorage.getItem("mc_sudo_password"),i=localStorage.getItem("mc_hf_token");n&&(r["X-Sudo-Password"]=n);let o=t==null?void 0:t.body;if((((f=t==null?void 0:t.method)==null?void 0:f.toUpperCase())||"GET")==="POST"){if(typeof o=="string")try{const h=JSON.parse(o);let m=!1;n&&!("sudo_password"in h)&&(h.sudo_password=n,m=!0),i&&!("hf_token"in h)&&(h.hf_token=i,m=!0),m&&(o=JSON.stringify(h))}catch{}else if(!o){const h={};n&&(h.sudo_password=n),i&&(h.hf_token=i),Object.keys(h).length>0&&(o=JSON.stringify(h))}}const u=await fetch(e,{...t,headers:r,body:o});if(!u.ok)throw new Error(`${u.status} ${u.statusText}`);return u.json()}const rE=(e,t,r=!1,n=!0)=>xe("/api/groups",{method:"PUT",body:JSON.stringify({group:e,members:t,swap:r,persist:n})}),uR=e=>xe("/api/routing/policy",{method:"PUT",body:JSON.stringify(e)}),$e={health:["health"],systemStatus:["system-status"],services:["services"],models:["models"],groups:["groups"],routing:["routing"],routingPolicy:["routing-policy"],jobs:["jobs"],tokenStats:["token-stats"],agentStatus:["agent-status"],hermesBrain:["hermes-brain"],updates:["updates"],discover:["discover"],drafts:e=>["drafts",e??""],connect:e=>["connect",e??""],connectHealth:["connect-health"],memory:(e,t)=>["memory",e??"",t??""],memoryGraph:["memory-graph"],voiceTrace:["voice-trace"],auftragsbuch:["auftragsbuch"],chronik:["chronik"],wissen:["wissen"],zeitmaschine:["zeitmaschine"],reminders:["reminders"]},nE=(e=8e3)=>gt({queryKey:$e.auftragsbuch,queryFn:()=>xe("/api/auftragsbuch"),refetchInterval:e}),iE=(e=150,t=15e3)=>gt({queryKey:$e.chronik,queryFn:()=>xe(`/api/chronik?limit=${e}`),refetchInterval:t,select:r=>r.items??[]}),dR=()=>gt({queryKey:$e.wissen,queryFn:()=>xe("/api/wissen")}),fR=(e=3e4)=>gt({queryKey:$e.zeitmaschine,queryFn:()=>xe("/api/zeitmaschine"),refetchInterval:e}),hR=(e=2e4)=>gt({queryKey:$e.reminders,queryFn:()=>xe("/api/reminders"),refetchInterval:e,select:t=>t.items??[]}),mR=(e=12,t=4e3)=>gt({queryKey:$e.voiceTrace,queryFn:()=>xe(`/api/voice/trace?limit=${e}`),refetchInterval:t,select:r=>r.turns??[]}),pR=(e=!0)=>gt({queryKey:$e.memoryGraph,queryFn:()=>xe("/api/memory/graph"),enabled:e}),Hx=()=>gt({queryKey:$e.health,queryFn:()=>xe("/api/health"),refetchInterval:1e4}),Po=(e=5e3)=>gt({queryKey:$e.systemStatus,queryFn:()=>xe("/api/system/status"),refetchInterval:e}),aE=(e=3e3)=>gt({queryKey:$e.services,queryFn:()=>xe("/api/system/services"),refetchInterval:e}),Ei=(e=4e3)=>gt({queryKey:$e.models,queryFn:()=>xe("/api/models"),refetchInterval:e}),Kx=(e=8e3)=>gt({queryKey:$e.groups,queryFn:()=>xe("/api/groups"),refetchInterval:e}),gR=()=>gt({queryKey:$e.routingPolicy,queryFn:()=>xe("/api/routing/policy")}),vR=(e=2e3)=>gt({queryKey:$e.jobs,queryFn:()=>xe("/api/jobs"),refetchInterval:e,select:t=>t.jobs??[]}),oE=(e=3e3)=>gt({queryKey:$e.tokenStats,queryFn:()=>xe("/api/system/token-stats"),refetchInterval:e}),Gx=(e=5e3)=>gt({queryKey:$e.agentStatus,queryFn:()=>xe("/api/agent/status"),refetchInterval:e}),sE=(e=6e4)=>gt({queryKey:$e.hermesBrain,queryFn:()=>xe("/api/agent/brain"),refetchInterval:e}),kh=e=>gt({queryKey:$e.updates,queryFn:()=>xe("/api/maintenance/updates"),refetchInterval:e}),xR=()=>gt({queryKey:$e.discover,queryFn:()=>xe("/api/discover")}),yR=e=>gt({queryKey:$e.drafts(e),queryFn:()=>xe(`/api/models/drafts?target=${encodeURIComponent(e??"")}`),enabled:!!e}),bR=e=>gt({queryKey:$e.connect(e),queryFn:()=>xe(e?`/api/connect?${e}`:"/api/connect")}),lE=()=>gt({queryKey:$e.connectHealth,queryFn:()=>xe("/api/connect/health"),refetchInterval:15e3}),jv=e=>gt({queryKey:$e.memory(e==null?void 0:e.q,e==null?void 0:e.category),queryFn:()=>{const t=new URLSearchParams;return e!=null&&e.q&&t.set("q",e.q),e!=null&&e.category&&t.set("category",e.category),xe(`/api/memory?${t}`)},select:t=>e!=null&&e.limit?t.slice(0,e.limit):t});function cE({type:e,title:t,message:r,defaultValue:n,autoValue:i,autoLabel:o,onConfirm:c,onCancel:u}){const f=x.useRef(null);return l.jsx("div",{className:"fixed inset-0 z-[99] bg-black/60 backdrop-blur-sm flex items-center justify-center p-4 overscroll-contain",role:"dialog","aria-modal":"true","aria-label":t,children:l.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:t}),l.jsx("button",{onClick:u||(()=>c()),"aria-label":"Schließen",className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:l.jsx(nn,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("p",{className:"max-h-72 overflow-y-auto whitespace-pre-line text-xs text-muted-foreground leading-relaxed scrollbar-thin",children:r}),e==="prompt"&&l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{ref:f,type:"text",defaultValue:n,"aria-label":t,className:"flex-1 h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground",autoFocus:!0,onKeyDown:h=>{var m;h.key==="Enter"&&c((m=f.current)==null?void 0:m.value)}}),i!==void 0&&l.jsx("button",{type:"button",onClick:()=>{f.current&&(f.current.value=i)},title:"Setup-bewussten Optimalwert eintragen",className:"h-9 px-3 shrink-0 text-xs font-semibold text-primary border border-primary/50 bg-primary/10 hover:bg-primary/20 rounded-lg transition-colors cursor-pointer",children:o||"Auto"})]}),l.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[(e==="confirm"||e==="prompt")&&l.jsx("button",{onClick:u,className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Abbrechen"}),l.jsx("button",{onClick:()=>{var m;const h=e==="prompt"?(m=f.current)==null?void 0:m.value:void 0;c(h)},className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/95 rounded-lg transition-colors cursor-pointer",children:e==="confirm"?"Ja, fortfahren":e==="prompt"?"Übernehmen":"OK"})]})]})})}function An(){const[e,t]=x.useState(null),r=x.useCallback(()=>t(null),[]),n=x.useCallback((u,f,h)=>{t({type:"alert",title:u,message:f,onConfirm:()=>{t(null),h==null||h()}})},[]),i=x.useCallback((u,f,h,m)=>{t({type:"confirm",title:u,message:f,onConfirm:()=>{t(null),h()},onCancel:()=>{t(null),m==null||m()}})},[]),o=x.useCallback((u,f,h,m,p,v)=>{t({type:"prompt",title:u,message:f,defaultValue:h,autoValue:v==null?void 0:v.autoValue,autoLabel:v==null?void 0:v.autoLabel,onConfirm:b=>{t(null),m(b)},onCancel:()=>{t(null),p==null||p()}})},[]),c=e?l.jsx(cE,{...e}):null;return{showAlert:n,showConfirm:i,showPrompt:o,close:r,dialogElement:c}}function Jr(e){return(e/1024**3).toFixed(1)}function Sv(e){return e?e>1024**3?`${(e/1024**3).toFixed(1)} GB`:`${(e/1024**2).toFixed(0)} MB`:""}function lr(e){if(!e)return"—";const t=e/1024**3;return t>=1?`${t.toFixed(1)} GB`:`${(e/1024**2).toFixed(0)} MB`}function wR(e){if(!e)return"";const t=Math.floor(e/60);return t>0?`${t} min`:`${e} s`}function Nv(e){return e?`${Math.round(e/1024)}k`:"—"}function kR(){const e=Wr(),{data:t=[]}=vR(2e3),{showAlert:r,dialogElement:n}=An();async function i(u){try{await xe(`/api/jobs/${u}/cancel`,{method:"POST"}),e.invalidateQueries({queryKey:$e.jobs})}catch(f){r("Fehler",f.message)}}const o=t.filter(u=>u.state==="running"||u.state==="queued"),c=t.filter(u=>u.state!=="running"&&u.state!=="queued").slice(-3);return o.length===0&&c.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"}),o.map(u=>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:u.label}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"text-muted-foreground font-mono",children:[u.progress??0,"% • ",Sv(u.done_bytes),"/",Sv(u.total_bytes),u.eta_s?` • ETA ${wR(u.eta_s)}`:""]}),l.jsx("button",{onClick:()=>i(u.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:`${u.progress??0}%`}})})]},u.id)),c.map(u=>l.jsxs("div",{className:"flex justify-between items-center text-xs text-muted-foreground px-1",children:[l.jsx("span",{className:"truncate",children:u.label}),l.jsx("span",{className:J("font-semibold text-[10px] px-1.5 py-0.5 rounded uppercase font-mono",u.state==="done"?"bg-emerald-500/10 text-emerald-400":"bg-amber-500/10 text-amber-400"),children:u.state})]},u.id)),n]})}function Ba({children:e,tone:t="muted"}){const r={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 ${r[t]}`,children:e})}function Ev({caps:e}){return e?l.jsxs("span",{className:"inline-flex flex-wrap gap-1",children:[e.coder&&l.jsx(Ba,{children:"💻 Code"}),e.vision&&l.jsx(Ba,{children:"👁 Bild"}),e.reasoning&&l.jsx(Ba,{children:"🧠 Reason"}),e.moe&&l.jsxs(Ba,{tone:"primary",children:["🧩 MoE",e.active_b?`·${e.active_b}b`:""]}),e.tools==="yes"&&l.jsx(Ba,{tone:"primary",children:"🛠 Tools"}),e.tools==="likely"&&l.jsx(Ba,{tone:"warn",children:"🛠 Tools?"}),e.embedding&&l.jsx(Ba,{children:"🔢 Embed"})]}):null}const Vx=[{role:"hermes",label:"Lucys Hirn",short:"Hirn",icon:Na,desc:"Lucys Alltags-Verstand — denkt und redet mit dir. Immer bereit.",tone:"bg-indigo-500/15 text-indigo-400 border-indigo-500/25",protected:!0},{role:"embed",label:"Lucys Gedächtnis",short:"Gedächtnis",icon:JN,desc:"Merkt sich Wichtiges und findet es später wieder.",tone:"bg-emerald-500/15 text-emerald-400 border-emerald-500/25",protected:!0},{role:"reranker",label:"Gedächtnis-Sortierer",short:"Sortierer",icon:tI,desc:"Ordnet gefundene Erinnerungen nach echter Relevanz — die Feinsortierung hinter dem Gedächtnis.",tone:"bg-lime-500/15 text-lime-400 border-lime-500/25"},{role:"vision",label:"Lucys Augen",short:"Augen",icon:Ec,desc:"Sieht Bilder und Screenshots und beschreibt, was drauf ist.",tone:"bg-pink-500/15 text-pink-400 border-pink-500/25"},{role:"heavy",label:"Großes Hirn",short:"Groß",icon:MM,desc:"Das schwere Geschütz — wird für besonders knifflige Fragen dazugeholt.",tone:"bg-amber-500/15 text-amber-400 border-amber-500/25"},{role:"coder-lite",label:"Programmierer (schnell)",short:"Code schnell",icon:zs,desc:"Schnelles Programmieren im Alltag.",tone:"bg-violet-500/15 text-violet-400 border-violet-500/25"},{role:"coder",label:"Programmierer (gründlich)",short:"Code gründlich",icon:zs,desc:"Schreibt und prüft Code besonders sorgfältig — für schwere Coding-Aufgaben.",tone:"bg-fuchsia-500/15 text-fuchsia-400 border-fuchsia-500/25"},{role:"scout",label:"Späher",short:"Späher",icon:bI,desc:"Schneller erster Blick und grobe Einschätzung.",tone:"bg-teal-500/15 text-teal-400 border-teal-500/25"},{role:"kritiker",label:"Kritiker",short:"Kritiker",icon:u5,desc:"Die unbestechliche Zweitmeinung — prüft Behauptungen und Patches (anderer Hersteller als das Hirn).",tone:"bg-cyan-500/15 text-cyan-400 border-cyan-500/25"}],jR=Vx.map(e=>e.role),ak=Object.fromEntries(Vx.map(e=>[e.role,e])),ok=e=>({role:e||"?",label:e||"unbekannt",short:e||"?",icon:Na,desc:"Rolle ohne hinterlegten Klartext-Namen.",tone:"bg-slate-500/15 text-slate-300 border-slate-500/25"}),SR={fast:"hermes",coder_lite:"coder-lite"};function dt(e){return e&&(ak[e]||ak[SR[e]])||ok(e)}function po({role:e,dense:t=!1,className:r}){const n=dt(e),i=n.icon;return l.jsxs("span",{className:J("inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-semibold border tracking-wide",n.tone,r),title:`${n.desc} (${n.role})`,children:[l.jsx(i,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}),t?n.short:n.label]})}function NR({fit:e}){const t={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"}[e.level];return l.jsxs("span",{className:J("rounded px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider font-mono",t),children:[e.text," • ",e.req_gb," GB RAM"]})}function vf(e){const t=e.toLowerCase();return t.includes("qwen")?{name:"Qwen",color:"bg-purple-500/20 text-purple-300 border-purple-500/30",initial:"Q"}:t.includes("gemma")?{name:"Gemma",color:"bg-blue-500/20 text-blue-300 border-blue-500/30",initial:"G"}:t.includes("llama")?{name:"Llama",color:"bg-red-500/20 text-red-300 border-red-500/30",initial:"🦙"}:t.includes("mistral")||t.includes("mixtral")?{name:"Mistral",color:"bg-orange-500/20 text-orange-300 border-orange-500/30",initial:"M"}:t.includes("deepseek")?{name:"DeepSeek",color:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30",initial:"D"}:t.includes("hermes")||t.includes("nous")?{name:"Hermes",color:"bg-amber-500/20 text-amber-300 border-amber-500/30",initial:"H"}:t.includes("phi")?{name:"Phi",color:"bg-emerald-500/20 text-emerald-300 border-emerald-500/30",initial:"Φ"}:{name:"Other",color:"bg-slate-500/20 text-slate-300 border-slate-500/30",initial:"AI"}}function uE({model:e,onClose:t,onChanged:r}){var w,k;const{data:n,isLoading:i}=yR(e.gguf_path),[o,c]=x.useState(null),[u,f]=x.useState(""),h=n==null?void 0:n.target_vocab,m=(n==null?void 0:n.drafts)??[],p=m.filter(N=>N.compatible===!0),v=e.spec_draft_model;async function b(N){c(N??"__clear__"),f("");try{await xe(`/api/models/${encodeURIComponent(e.name)}/draft`,{method:"POST",body:JSON.stringify({draft_path:N})}),r(),t()}catch(E){f(String((E==null?void 0:E.message)||E)),c(null)}}const S=N=>{var E;return N?`${N.pre??"?"} · ${((E=N.n_vocab)==null?void 0:E.toLocaleString())??"?"} Tokens`:"—"};return l.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:l.jsxs("div",{className:"w-full max-w-lg rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-2",children:[l.jsx(ka,{className:"h-4 w-4"})," Speculative Draft"]}),l.jsx("button",{onClick:t,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:l.jsx(nn,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"text-xs text-muted-foreground leading-relaxed",children:['Beschleunigt die Token-Generierung mit einem kleinen "Draft"-Modell. Voraussetzung: der Draft muss den ',l.jsx("strong",{className:"text-foreground",children:"exakt gleichen Tokenizer (Vocab)"})," haben wie das Modell — sonst lehnt llama.cpp es ab."]}),l.jsxs("div",{className:"rounded-lg border border-border/40 bg-background/30 px-3 py-2 text-[11px] font-mono flex items-center justify-between",children:[l.jsx("span",{className:"text-muted-foreground",children:(w=e.name.split("/").pop())==null?void 0:w.replace(/\.gguf$/i,"")}),l.jsxs("span",{className:"text-foreground",children:["Vocab: ",S(h)]})]}),e.spec_active&&v&&l.jsxs("div",{className:"rounded-lg border border-emerald-500/30 bg-emerald-500/5 px-3 py-2 flex items-center justify-between gap-2",children:[l.jsxs("span",{className:"text-[11px] text-emerald-400 font-mono flex items-center gap-1.5 truncate",children:[l.jsx(Mt,{className:"h-3.5 w-3.5 shrink-0"})," Aktiv: ",v]}),l.jsx("button",{onClick:()=>b(null),disabled:o!==null,className:"h-6 px-2.5 rounded border border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10 text-amber-400 text-[9px] font-bold uppercase shrink-0 cursor-pointer disabled:opacity-50",children:"Deaktivieren"})]}),!(n!=null&&n.target_exists)&&l.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-[11px] text-amber-400 flex items-center gap-2",children:[l.jsx(vr,{className:"h-3.5 w-3.5 shrink-0"}),"Modell-GGUF noch nicht vorhanden — Spec-Draft ist nach dem Download konfigurierbar."]}),l.jsx("div",{className:"space-y-1.5 max-h-64 overflow-y-auto pr-1",children:i?l.jsx("div",{className:"text-xs text-muted-foreground py-6 text-center",children:"Prüfe Vocab-Kompatibilität…"}):m.length===0?l.jsxs("div",{className:"text-[11px] text-muted-foreground border border-dashed border-border/50 rounded-lg p-4 text-center",children:["Keine Draft-Modelle in ",l.jsx("code",{className:"font-mono",children:"/srv/models/drafts"}),". Lade ein kleines same-family-Modell (z.B. Qwen3-0.6B) und lege es dort ab."]}):m.map(N=>{var C,_;const E=N.filename===v,A=N.compatible===!0;return l.jsxs("div",{className:J("rounded-lg border px-3 py-2 flex items-center justify-between gap-2 text-left",A?"border-border/40 bg-background/20":"border-border/20 bg-background/10 opacity-60",E&&"border-primary/40 bg-primary/10"),children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"text-[11px] font-mono font-semibold text-foreground truncate flex items-center gap-1.5",children:[N.filename,N.mtp&&l.jsx("span",{className:"shrink-0 rounded bg-indigo-500/15 px-1.5 py-0.5 text-[8px] font-bold uppercase tracking-wider text-indigo-400 border border-indigo-500/25",title:"MTP-Kopf (Multi-Token-Prediction) — by-construction vocab-identisch, höchste Akzeptanzrate",children:"MTP"})]}),l.jsxs("div",{className:"text-[9px] text-muted-foreground font-mono",children:[lr(N.size_bytes)," · Vocab: ",S(N.vocab)]})]}),A?E?l.jsxs("span",{className:"text-[9px] font-bold uppercase text-primary flex items-center gap-1 shrink-0",children:[l.jsx(Mt,{className:"h-3.5 w-3.5"})," Aktiv"]}):l.jsx("button",{onClick:()=>b(N.path),disabled:o!==null,className:"h-7 px-3 rounded-lg border border-emerald-500/30 bg-emerald-500/5 hover:bg-emerald-500/15 text-emerald-400 text-[9px] font-bold uppercase shrink-0 cursor-pointer disabled:opacity-50",children:"Aktivieren"}):l.jsxs("span",{className:"text-[9px] font-bold uppercase text-amber-400/80 flex items-center gap-1 shrink-0",title:N.compatible===!1?`Inkompatibel: Tokenizer/Vocab weicht ab (Draft ${(C=N.vocab)==null?void 0:C.pre}/${(_=N.vocab)==null?void 0:_.n_vocab} ≠ Modell ${h==null?void 0:h.pre}/${h==null?void 0:h.n_vocab}).`:"Kompatibilität nicht prüfbar (Datei fehlt).",children:[l.jsx(vr,{className:"h-3.5 w-3.5"})," ",N.compatible===!1?"Vocab ≠":"n/a"]})]},N.path)})}),!i&&(n==null?void 0:n.target_exists)&&m.length>0&&p.length===0&&l.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-[11px] text-amber-400 leading-relaxed",children:["Kein vocab-kompatibler Draft verfügbar — Speculative Decoding ist für dieses Modell nicht möglich. Es braucht einen Draft mit identischem Tokenizer (pre=",l.jsx("span",{className:"font-mono",children:h==null?void 0:h.pre}),", n_vocab=",l.jsx("span",{className:"font-mono",children:(k=h==null?void 0:h.n_vocab)==null?void 0:k.toLocaleString()}),")."]}),u&&l.jsx("div",{className:"text-[10px] text-red-400 font-mono",children:u})]})})}const sk={hermes:{bar:"bg-indigo-500",dot:"bg-indigo-500",text:"text-indigo-400"},embed:{bar:"bg-emerald-500",dot:"bg-emerald-500",text:"text-emerald-400"},vision:{bar:"bg-pink-500",dot:"bg-pink-500",text:"text-pink-400"},heavy:{bar:"bg-amber-500",dot:"bg-amber-500",text:"text-amber-400"},"coder-lite":{bar:"bg-violet-500",dot:"bg-violet-500",text:"text-violet-400"},coder:{bar:"bg-fuchsia-500",dot:"bg-fuchsia-500",text:"text-fuchsia-400"},scout:{bar:"bg-teal-500",dot:"bg-teal-500",text:"text-teal-400"},kritiker:{bar:"bg-cyan-500",dot:"bg-cyan-500",text:"text-cyan-400"},reranker:{bar:"bg-lime-500",dot:"bg-lime-500",text:"text-lime-400"}},ER={fast:"hermes",coder_lite:"coder-lite"},lk={bar:"bg-slate-400",dot:"bg-slate-400",text:"text-slate-300"};function xf(e){return e&&(sk[e]||sk[ER[e]])||lk}const ck=1024**3,uk=e=>{var t;return((t=e.split("/").pop())==null?void 0:t.replace(/\.gguf$/i,""))??e};function AR({running:e,capacityBytes:t,realUsedBytes:r,selected:n,onSelect:i}){const o=t>2*ck?t:124*ck,c=e.reduce((h,m)=>h+(m.size_bytes||0),0),u=Math.max(0,o-c),f=u/o*100;return l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-5 shadow-lg shadow-black/15 backdrop-blur-md",children:[l.jsxs("div",{className:"mb-3 flex flex-wrap items-end justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(xa,{className:"h-5 w-5 text-primary"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Arbeitsspeicher"}),l.jsxs("div",{className:"font-space text-xl font-bold tracking-tight text-foreground",children:[Jr(o)," GB ",l.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"gesamt"})]})]})]}),l.jsxs("div",{className:"text-right text-[11px] font-mono text-muted-foreground",children:[l.jsxs("div",{children:[l.jsxs("span",{className:"font-bold text-foreground",children:[Jr(c)," GB"]})," Modelle geladen"]}),r>0&&l.jsxs("div",{children:[Jr(r)," GB real belegt (inkl. KV-Cache)"]}),l.jsxs("div",{className:"text-emerald-400",children:[Jr(u)," GB frei"]})]})]}),l.jsx("div",{className:"flex h-12 w-full overflow-hidden rounded-xl border border-border/40 bg-background/50 p-1",children:e.length===0?l.jsx("div",{className:"flex w-full items-center justify-center text-[11px] italic text-muted-foreground/60",children:"Kein Modell geladen — Auto-Swap holt bei Anfrage automatisch das passende."}):l.jsxs(l.Fragment,{children:[e.map(h=>{const m=(h.size_bytes||0)/o*100,p=xf(h.role),v=n===h.name;return l.jsxs("button",{onClick:()=>i==null?void 0:i(h.name),style:{width:`${m}%`},title:`${dt(h.role).label} · ${uk(h.name)} · ${lr(h.size_bytes)}`,className:J("group flex h-full min-w-[2.5rem] shrink-0 flex-col justify-center gap-0.5 rounded-lg px-2 text-left text-white transition-all",p.bar,v?"ring-2 ring-white/70":"opacity-90 hover:opacity-100"),children:[l.jsx("span",{className:"truncate font-space text-[10px] font-bold leading-tight tracking-wide",children:dt(h.role).short}),l.jsx("span",{className:"truncate font-mono text-[9px] leading-tight opacity-85",children:lr(h.size_bytes)})]},h.name)}),f>1.5&&l.jsx("div",{style:{width:`${f}%`},className:"flex h-full min-w-[2rem] items-center justify-center rounded-lg text-[9px] font-mono text-muted-foreground/50",title:`${Jr(u)} GB frei`,children:"frei"})]})}),e.length>0&&l.jsxs("div",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-1.5",children:[e.map(h=>{const m=xf(h.role);return l.jsxs("button",{onClick:()=>i==null?void 0:i(h.name),className:"flex items-center gap-1.5 text-[11px] text-muted-foreground transition-colors hover:text-foreground",children:[l.jsx("span",{className:J("h-2.5 w-2.5 rounded-sm",m.dot)}),l.jsx("span",{className:J("font-semibold",m.text),children:dt(h.role).short}),l.jsx("span",{className:"font-mono text-muted-foreground/70",children:uk(h.name)})]},h.name)}),l.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground/60",children:[l.jsx("span",{className:"h-2.5 w-2.5 rounded-sm border border-border/50 bg-background/50"})," frei · ",Jr(u)," GB"]})]})]})}const dk=1024**3,Va=e=>{var t;return((t=e.split("/").pop())==null?void 0:t.replace(/\.gguf$/i,""))??e};function CR(){var M,U,ne,ee;const e=Wr(),{data:t,isLoading:r,error:n}=Ei(4e3),{data:i}=Po(),{data:o}=Kx(),{showAlert:c,showConfirm:u,showPrompt:f,dialogElement:h}=An(),m=Ux(),p=(t==null?void 0:t.models)??[],v=(t==null?void 0:t.running)??[],b=X=>!!dt(X).protected,S=(M=o==null?void 0:o.groups)==null?void 0:M.brains,w=(S==null?void 0:S.members)??[],k=X=>w.includes(X),[N,E]=x.useState(null),[A,C]=x.useState(""),[_,O]=x.useState("all"),[D,B]=x.useState(null),z=()=>{e.invalidateQueries({queryKey:$e.models}),e.invalidateQueries({queryKey:$e.routing}),e.invalidateQueries({queryKey:$e.groups})},$=p.filter(X=>v.includes(X.name)),K=((U=i==null?void 0:i.gpu)==null?void 0:U.gtt_total)||((ne=i==null?void 0:i.gpu)==null?void 0:ne.vram_total)||0,W=((ee=i==null?void 0:i.gpu)==null?void 0:ee.gtt_used)||0,ve=K>2*dk?K:124*dk,ue=x.useMemo(()=>{const X=A.trim().toLowerCase();return p.filter(ae=>_==="in_use"?!!ae.role||v.includes(ae.name):!0).filter(ae=>X?ae.name.toLowerCase().includes(X):!0).sort((ae,me)=>{const re=v.includes(ae.name)?0:1,ye=v.includes(me.name)?0:1;return re!==ye?re-ye:Va(ae.name).localeCompare(Va(me.name))})},[p,v,_,A]),pe=p.find(X=>X.name===N)??null;async function oe(X){try{await xe(`/api/models/${encodeURIComponent(X)}/load`,{method:"POST"}),z()}catch(ae){c("Fehler",`Laden fehlgeschlagen: ${ae.message||ae}`)}}async function le(X){const ae=w.some(me=>v.includes(me));if(S&&ae&&!k(X)){const me=w.filter(re=>v.includes(re)).map(Va).join(", ");u("Verdrängt das Hirn?",`„${Va(X)}" ist nicht ko-resident. Beim Laden wirft es das warme Hirn (${me}) raus — Lucy verliert Hirn bzw. Augen. +`)},YT=0,os=[];function ZT(e){var t=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),i=x.useState(YT++)[0],o=x.useState(N5)[0],c=x.useRef(e);x.useEffect(function(){c.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=xT([e.lockRef.current],(e.shards||[]).map(rk),!0).filter(Boolean);return w.forEach(function(k){return k.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(k){return k.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=x.useCallback(function(w,k){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!c.current.allowPinchZoom;var N=Dd(w),E=r.current,A="deltaX"in w?w.deltaX:E[0]-N[0],C="deltaY"in w?w.deltaY:E[1]-N[1],_,O=w.target,D=Math.abs(A)>Math.abs(C)?"h":"v";if("touches"in w&&D==="h"&&O.type==="range")return!1;var B=window.getSelection(),z=B&&B.anchorNode,$=z?z===O||z.contains(O):!1;if($)return!1;var K=ek(D,O);if(!K)return!0;if(K?_=D:(_=D==="v"?"h":"v",K=ek(D,O)),!K)return!1;if(!n.current&&"changedTouches"in w&&(A||C)&&(n.current=_),!_)return!0;var W=n.current||_;return VT(W,k,w,W==="h"?A:C)},[]),f=x.useCallback(function(w){var k=w;if(!(!os.length||os[os.length-1]!==o)){var N="deltaY"in k?tk(k):Dd(k),E=t.current.filter(function(_){return _.name===k.type&&(_.target===k.target||k.target===_.shadowParent)&&qT(_.delta,N)})[0];if(E&&E.should){k.cancelable&&k.preventDefault();return}if(!E){var A=(c.current.shards||[]).map(rk).filter(Boolean).filter(function(_){return _.contains(k.target)}),C=A.length>0?u(k,A[0]):!c.current.noIsolation;C&&k.cancelable&&k.preventDefault()}}},[]),h=x.useCallback(function(w,k,N,E){var A={name:w,delta:k,target:N,should:E,shadowParent:XT(N)};t.current.push(A),setTimeout(function(){t.current=t.current.filter(function(C){return C!==A})},1)},[]),m=x.useCallback(function(w){r.current=Dd(w),n.current=void 0},[]),p=x.useCallback(function(w){h(w.type,tk(w),w.target,u(w,e.lockRef.current))},[]),v=x.useCallback(function(w){h(w.type,Dd(w),w.target,u(w,e.lockRef.current))},[]);x.useEffect(function(){return os.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",f,as),document.addEventListener("touchmove",f,as),document.addEventListener("touchstart",m,as),function(){os=os.filter(function(w){return w!==o}),document.removeEventListener("wheel",f,as),document.removeEventListener("touchmove",f,as),document.removeEventListener("touchstart",m,as)}},[]);var b=e.removeScrollBar,S=e.inert;return x.createElement(x.Fragment,null,S?x.createElement(o,{styles:QT(i)}):null,b?x.createElement(FT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function XT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const JT=AT(S5,ZT);var P5=x.forwardRef(function(e,t){return x.createElement(yh,Bn({},e,{ref:t,sideCar:JT}))});P5.classNames=yh.classNames;var eD=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ss=new WeakMap,Ld=new WeakMap,Rd={},hg=0,O5=function(e){return e&&(e.host||O5(e.parentNode))},tD=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=O5(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},rD=function(e,t,r,n){var i=tD(t,Array.isArray(e)?e:[e]);Rd[r]||(Rd[r]=new WeakMap);var o=Rd[r],c=[],u=new Set,f=new Set(i),h=function(p){!p||u.has(p)||(u.add(p),h(p.parentNode))};i.forEach(h);var m=function(p){!p||f.has(p)||Array.prototype.forEach.call(p.children,function(v){if(u.has(v))m(v);else try{var b=v.getAttribute(n),S=b!==null&&b!=="false",w=(ss.get(v)||0)+1,k=(o.get(v)||0)+1;ss.set(v,w),o.set(v,k),c.push(v),w===1&&S&&Ld.set(v,!0),k===1&&v.setAttribute(r,"true"),S||v.setAttribute(n,"true")}catch(N){console.error("aria-hidden: cannot operate on ",v,N)}})};return m(t),u.clear(),hg++,function(){c.forEach(function(p){var v=ss.get(p)-1,b=o.get(p)-1;ss.set(p,v),o.set(p,b),v||(Ld.has(p)||p.removeAttribute(n),Ld.delete(p)),b||p.removeAttribute(r)}),hg--,hg||(ss=new WeakMap,ss=new WeakMap,Ld=new WeakMap,Rd={})}},nD=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=eD(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),rD(n,i,r,"aria-hidden")):function(){return null}},bh="Dialog",[_5]=_I(bh),[iD,En]=_5(bh),M5=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:o,modal:c=!0}=e,u=x.useRef(null),f=x.useRef(null),[h,m]=LI({prop:n,defaultProp:i??!1,onChange:o,caller:bh});return l.jsx(iD,{scope:t,triggerRef:u,contentRef:f,contentId:vi(),titleId:vi(),descriptionId:vi(),open:h,onOpenChange:m,onOpenToggle:x.useCallback(()=>m(p=>!p),[m]),modal:c,children:r})};M5.displayName=bh;var I5="DialogTrigger",aD=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=En(I5,r),o=Co(t,i.triggerRef);return l.jsx(Jt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Bx(i.open),...n,ref:o,onClick:ya(e.onClick,i.onOpenToggle)})});aD.displayName=I5;var Fx="DialogPortal",[oD,T5]=_5(Fx,{forceMount:void 0}),D5=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,o=En(Fx,t);return l.jsx(oD,{scope:t,forceMount:r,children:x.Children.map(n,c=>l.jsx(xh,{present:r||o.open,children:l.jsx(w5,{asChild:!0,container:i,children:c})}))})};D5.displayName=Fx;var gf="DialogOverlay",L5=x.forwardRef((e,t)=>{const r=T5(gf,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=En(gf,e.__scopeDialog);return o.modal?l.jsx(xh,{present:n||o.open,children:l.jsx(lD,{...i,ref:t})}):null});L5.displayName=gf;var sD=g5("DialogOverlay.RemoveScroll"),lD=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=En(gf,r),o=rT(),c=Co(t,o);return l.jsx(P5,{as:sD,allowPinchZoom:!0,shards:[i.contentRef],children:l.jsx(Jt.div,{"data-state":Bx(i.open),...n,ref:c,style:{pointerEvents:"auto",...n.style}})})}),Us="DialogContent",R5=x.forwardRef((e,t)=>{const r=T5(Us,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=En(Us,e.__scopeDialog);return l.jsx(xh,{present:n||o.open,children:o.modal?l.jsx(cD,{...i,ref:t}):l.jsx(uD,{...i,ref:t})})});R5.displayName=Us;var cD=x.forwardRef((e,t)=>{const r=En(Us,e.__scopeDialog),n=x.useRef(null),i=Co(t,r.contentRef,n);return x.useEffect(()=>{const o=n.current;if(o)return nD(o)},[]),l.jsx($5,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:ya(e.onCloseAutoFocus,o=>{var c;o.preventDefault(),(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:ya(e.onPointerDownOutside,o=>{const c=o.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&o.preventDefault()}),onFocusOutside:ya(e.onFocusOutside,o=>o.preventDefault())})}),uD=x.forwardRef((e,t)=>{const r=En(Us,e.__scopeDialog),n=x.useRef(!1),i=x.useRef(!1);return l.jsx($5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var c,u;(c=e.onCloseAutoFocus)==null||c.call(e,o),o.defaultPrevented||(n.current||(u=r.triggerRef.current)==null||u.focus(),o.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:o=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const c=o.target;((h=r.triggerRef.current)==null?void 0:h.contains(c))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),$5=x.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:o,...c}=e,u=En(Us,r);return vT(),l.jsx(l.Fragment,{children:l.jsx(y5,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:o,children:l.jsx(v5,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Bx(u.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})}),z5="DialogTitle",dD=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=En(z5,r);return l.jsx(Jt.h2,{id:i.titleId,...n,ref:t})});dD.displayName=z5;var F5="DialogDescription",fD=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=En(F5,r);return l.jsx(Jt.p,{id:i.descriptionId,...n,ref:t})});fD.displayName=F5;var B5="DialogClose",hD=x.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=En(B5,r);return l.jsx(Jt.button,{type:"button",...n,ref:t,onClick:ya(e.onClick,()=>i.onOpenChange(!1))})});hD.displayName=B5;function Bx(e){return e?"open":"closed"}var ec='[cmdk-group=""]',mg='[cmdk-group-items=""]',mD='[cmdk-group-heading=""]',U5='[cmdk-item=""]',nk=`${U5}:not([aria-disabled="true"])`,bv="cmdk-item-select",gs="data-value",pD=(e,t,r)=>OI(e,t,r),W5=x.createContext(void 0),iu=()=>x.useContext(W5),H5=x.createContext(void 0),Ux=()=>x.useContext(H5),K5=x.createContext(void 0),G5=x.forwardRef((e,t)=>{let r=vs(()=>{var M,U;return{search:"",value:(U=(M=e.value)!=null?M:e.defaultValue)!=null?U:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=vs(()=>new Set),i=vs(()=>new Map),o=vs(()=>new Map),c=vs(()=>new Set),u=V5(e),{label:f,children:h,value:m,onValueChange:p,filter:v,shouldFilter:b,loop:S,disablePointerSelection:w=!1,vimBindings:k=!0,...N}=e,E=vi(),A=vi(),C=vi(),_=x.useRef(null),O=ED();yo(()=>{if(m!==void 0){let M=m.trim();r.current.value=M,D.emit()}},[m]),yo(()=>{O(6,ve)},[]);let D=x.useMemo(()=>({subscribe:M=>(c.current.add(M),()=>c.current.delete(M)),snapshot:()=>r.current,setState:(M,U,ne)=>{var ee,X,ae,me;if(!Object.is(r.current[M],U)){if(r.current[M]=U,M==="search")W(),$(),O(1,K);else if(M==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let re=document.getElementById(C);re?re.focus():(ee=document.getElementById(E))==null||ee.focus()}if(O(7,()=>{var re;r.current.selectedItemId=(re=ue())==null?void 0:re.id,D.emit()}),ne||O(5,ve),((X=u.current)==null?void 0:X.value)!==void 0){let re=U??"";(me=(ae=u.current).onValueChange)==null||me.call(ae,re);return}}D.emit()}},emit:()=>{c.current.forEach(M=>M())}}),[]),B=x.useMemo(()=>({value:(M,U,ne)=>{var ee;U!==((ee=o.current.get(M))==null?void 0:ee.value)&&(o.current.set(M,{value:U,keywords:ne}),r.current.filtered.items.set(M,z(U,ne)),O(2,()=>{$(),D.emit()}))},item:(M,U)=>(n.current.add(M),U&&(i.current.has(U)?i.current.get(U).add(M):i.current.set(U,new Set([M]))),O(3,()=>{W(),$(),r.current.value||K(),D.emit()}),()=>{o.current.delete(M),n.current.delete(M),r.current.filtered.items.delete(M);let ne=ue();O(4,()=>{W(),(ne==null?void 0:ne.getAttribute("id"))===M&&K(),D.emit()})}),group:M=>(i.current.has(M)||i.current.set(M,new Set),()=>{o.current.delete(M),i.current.delete(M)}),filter:()=>u.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:E,inputId:C,labelId:A,listInnerRef:_}),[]);function z(M,U){var ne,ee;let X=(ee=(ne=u.current)==null?void 0:ne.filter)!=null?ee:pD;return M?X(M,r.current.search,U):0}function $(){if(!r.current.search||u.current.shouldFilter===!1)return;let M=r.current.filtered.items,U=[];r.current.filtered.groups.forEach(ee=>{let X=i.current.get(ee),ae=0;X.forEach(me=>{let re=M.get(me);ae=Math.max(re,ae)}),U.push([ee,ae])});let ne=_.current;pe().sort((ee,X)=>{var ae,me;let re=ee.getAttribute("id"),ye=X.getAttribute("id");return((ae=M.get(ye))!=null?ae:0)-((me=M.get(re))!=null?me:0)}).forEach(ee=>{let X=ee.closest(mg);X?X.appendChild(ee.parentElement===X?ee:ee.closest(`${mg} > *`)):ne.appendChild(ee.parentElement===ne?ee:ee.closest(`${mg} > *`))}),U.sort((ee,X)=>X[1]-ee[1]).forEach(ee=>{var X;let ae=(X=_.current)==null?void 0:X.querySelector(`${ec}[${gs}="${encodeURIComponent(ee[0])}"]`);ae==null||ae.parentElement.appendChild(ae)})}function K(){let M=pe().find(ne=>ne.getAttribute("aria-disabled")!=="true"),U=M==null?void 0:M.getAttribute(gs);D.setState("value",U||void 0)}function W(){var M,U,ne,ee;if(!r.current.search||u.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let X=0;for(let ae of n.current){let me=(U=(M=o.current.get(ae))==null?void 0:M.value)!=null?U:"",re=(ee=(ne=o.current.get(ae))==null?void 0:ne.keywords)!=null?ee:[],ye=z(me,re);r.current.filtered.items.set(ae,ye),ye>0&&X++}for(let[ae,me]of i.current)for(let re of me)if(r.current.filtered.items.get(re)>0){r.current.filtered.groups.add(ae);break}r.current.filtered.count=X}function ve(){var M,U,ne;let ee=ue();ee&&(((M=ee.parentElement)==null?void 0:M.firstChild)===ee&&((ne=(U=ee.closest(ec))==null?void 0:U.querySelector(mD))==null||ne.scrollIntoView({block:"nearest"})),ee.scrollIntoView({block:"nearest"}))}function ue(){var M;return(M=_.current)==null?void 0:M.querySelector(`${U5}[aria-selected="true"]`)}function pe(){var M;return Array.from(((M=_.current)==null?void 0:M.querySelectorAll(nk))||[])}function oe(M){let U=pe()[M];U&&D.setState("value",U.getAttribute(gs))}function le(M){var U;let ne=ue(),ee=pe(),X=ee.findIndex(me=>me===ne),ae=ee[X+M];(U=u.current)!=null&&U.loop&&(ae=X+M<0?ee[ee.length-1]:X+M===ee.length?ee[0]:ee[X+M]),ae&&D.setState("value",ae.getAttribute(gs))}function Z(M){let U=ue(),ne=U==null?void 0:U.closest(ec),ee;for(;ne&&!ee;)ne=M>0?SD(ne,ec):ND(ne,ec),ee=ne==null?void 0:ne.querySelector(nk);ee?D.setState("value",ee.getAttribute(gs)):le(M)}let ie=()=>oe(pe().length-1),te=M=>{M.preventDefault(),M.metaKey?ie():M.altKey?Z(1):le(1)},I=M=>{M.preventDefault(),M.metaKey?oe(0):M.altKey?Z(-1):le(-1)};return x.createElement(Jt.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:M=>{var U;(U=N.onKeyDown)==null||U.call(N,M);let ne=M.nativeEvent.isComposing||M.keyCode===229;if(!(M.defaultPrevented||ne))switch(M.key){case"n":case"j":{k&&M.ctrlKey&&te(M);break}case"ArrowDown":{te(M);break}case"p":case"k":{k&&M.ctrlKey&&I(M);break}case"ArrowUp":{I(M);break}case"Home":{M.preventDefault(),oe(0);break}case"End":{M.preventDefault(),ie();break}case"Enter":{M.preventDefault();let ee=ue();if(ee){let X=new Event(bv);ee.dispatchEvent(X)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:B.inputId,id:B.labelId,style:CD},f),wh(e,M=>x.createElement(H5.Provider,{value:D},x.createElement(W5.Provider,{value:B},M))))}),gD=x.forwardRef((e,t)=>{var r,n;let i=vi(),o=x.useRef(null),c=x.useContext(K5),u=iu(),f=V5(e),h=(n=(r=f.current)==null?void 0:r.forceMount)!=null?n:c==null?void 0:c.forceMount;yo(()=>{if(!h)return u.item(i,c==null?void 0:c.id)},[h]);let m=q5(i,o,[e.value,e.children,o],e.keywords),p=Ux(),v=ja(O=>O.value&&O.value===m.current),b=ja(O=>h||u.filter()===!1?!0:O.search?O.filtered.items.get(i)>0:!0);x.useEffect(()=>{let O=o.current;if(!(!O||e.disabled))return O.addEventListener(bv,S),()=>O.removeEventListener(bv,S)},[b,e.onSelect,e.disabled]);function S(){var O,D;w(),(D=(O=f.current).onSelect)==null||D.call(O,m.current)}function w(){p.setState("value",m.current,!0)}if(!b)return null;let{disabled:k,value:N,onSelect:E,forceMount:A,keywords:C,..._}=e;return x.createElement(Jt.div,{ref:Bs(o,t),..._,id:i,"cmdk-item":"",role:"option","aria-disabled":!!k,"aria-selected":!!v,"data-disabled":!!k,"data-selected":!!v,onPointerMove:k||u.getDisablePointerSelection()?void 0:w,onClick:k?void 0:S},e.children)}),vD=x.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:i,...o}=e,c=vi(),u=x.useRef(null),f=x.useRef(null),h=vi(),m=iu(),p=ja(b=>i||m.filter()===!1?!0:b.search?b.filtered.groups.has(c):!0);yo(()=>m.group(c),[]),q5(c,u,[e.value,e.heading,f]);let v=x.useMemo(()=>({id:c,forceMount:i}),[i]);return x.createElement(Jt.div,{ref:Bs(u,t),...o,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},r&&x.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:h},r),wh(e,b=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?h:void 0},x.createElement(K5.Provider,{value:v},b))))}),xD=x.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,i=x.useRef(null),o=ja(c=>!c.search);return!r&&!o?null:x.createElement(Jt.div,{ref:Bs(i,t),...n,"cmdk-separator":"",role:"separator"})}),yD=x.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,i=e.value!=null,o=Ux(),c=ja(h=>h.search),u=ja(h=>h.selectedItemId),f=iu();return x.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),x.createElement(Jt.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":u,id:f.inputId,type:"text",value:i?e.value:c,onChange:h=>{i||o.setState("search",h.target.value),r==null||r(h.target.value)}})}),bD=x.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...i}=e,o=x.useRef(null),c=x.useRef(null),u=ja(h=>h.selectedItemId),f=iu();return x.useEffect(()=>{if(c.current&&o.current){let h=c.current,m=o.current,p,v=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let b=h.offsetHeight;m.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return v.observe(h),()=>{cancelAnimationFrame(p),v.unobserve(h)}}},[]),x.createElement(Jt.div,{ref:Bs(o,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":n,id:f.listId},wh(e,h=>x.createElement("div",{ref:Bs(c,f.listInnerRef),"cmdk-list-sizer":""},h)))}),wD=x.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:i,contentClassName:o,container:c,...u}=e;return x.createElement(M5,{open:r,onOpenChange:n},x.createElement(D5,{container:c},x.createElement(L5,{"cmdk-overlay":"",className:i}),x.createElement(R5,{"aria-label":e.label,"cmdk-dialog":"",className:o},x.createElement(G5,{ref:t,...u}))))}),kD=x.forwardRef((e,t)=>ja(r=>r.filtered.count===0)?x.createElement(Jt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),jD=x.forwardRef((e,t)=>{let{progress:r,children:n,label:i="Loading...",...o}=e;return x.createElement(Jt.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},wh(e,c=>x.createElement("div",{"aria-hidden":!0},c)))}),ls=Object.assign(G5,{List:bD,Item:gD,Input:yD,Group:vD,Separator:xD,Dialog:wD,Empty:kD,Loading:jD});function SD(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function ND(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function V5(e){let t=x.useRef(e);return yo(()=>{t.current=e}),t}var yo=typeof window>"u"?x.useEffect:x.useLayoutEffect;function vs(e){let t=x.useRef();return t.current===void 0&&(t.current=e()),t}function ja(e){let t=Ux(),r=()=>e(t.snapshot());return x.useSyncExternalStore(t.subscribe,r,r)}function q5(e,t,r,n=[]){let i=x.useRef(),o=iu();return yo(()=>{var c;let u=(()=>{var h;for(let m of r){if(typeof m=="string")return m.trim();if(typeof m=="object"&&"current"in m)return m.current?(h=m.current.textContent)==null?void 0:h.trim():i.current}})(),f=n.map(h=>h.trim());o.value(e,u,f),(c=t.current)==null||c.setAttribute(gs,u),i.current=u}),i}var ED=()=>{let[e,t]=x.useState(),r=vs(()=>new Map);return yo(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,i)=>{r.current.set(n,i),t({})}};function AD(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function wh({asChild:e,children:t},r){return e&&x.isValidElement(t)?x.cloneElement(AD(t),{ref:t.ref},r(t.props.children)):r(t)}var CD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function PD({onNavigate:e}){const[t,r]=x.useState(!1);return x.useEffect(()=>{const n=i=>{(i.metaKey||i.ctrlKey)&&i.key.toLowerCase()==="k"&&(i.preventDefault(),r(o=>!o))};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[]),l.jsx(ls.Dialog,{open:t,onOpenChange:r,label:"Befehlspalette",className:"fixed inset-0 z-50 flex items-start justify-center bg-black/50 p-4 pt-[12vh] overscroll-contain",onClick:()=>r(!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:n=>n.stopPropagation(),children:[l.jsx(ls.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(ls.List,{className:"max-h-80 overflow-y-auto p-2",children:[l.jsx(ls.Empty,{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Nichts gefunden."}),l.jsx(ls.Group,{heading:"Bereiche",className:"px-1 py-1 text-xs text-muted-foreground",children:pc.map(n=>l.jsxs(ls.Item,{value:`${n.label} ${n.hint}`,onSelect:()=>{e(n.id),r(!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(n.icon,{className:"h-4 w-4 text-primary"}),l.jsx("span",{children:n.label}),l.jsx("span",{className:"ml-auto truncate text-xs text-muted-foreground",children:n.hint})]},n.id))})]})]})})}const Q5="mc_expert_mode",wv="mc-expert-mode-change",OD=()=>{try{return localStorage.getItem(Q5)==="true"}catch{return!1}};function _D(e){return window.addEventListener(wv,e),window.addEventListener("storage",e),()=>{window.removeEventListener(wv,e),window.removeEventListener("storage",e)}}function ik(e){localStorage.setItem(Q5,String(e)),window.dispatchEvent(new Event(wv))}function Wx(){return x.useSyncExternalStore(_D,OD,()=>!1)}function Y5(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const t=TD(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:c=>{const u=c.split(Hx);return u[0]===""&&u.length!==1&&u.shift(),Z5(u,t)||ID(c)},getConflictingClassGroupIds:(c,u)=>{const f=r[c]||[];return u&&n[c]?[...f,...n[c]]:f}}},Z5=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),i=n?Z5(e.slice(1),n):void 0;if(i)return i;if(t.validators.length===0)return;const o=e.join(Hx);return(c=t.validators.find(({validator:u})=>u(o)))==null?void 0:c.classGroupId},ak=/^\[(.+)\]$/,ID=e=>{if(ak.test(e)){const t=ak.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},TD=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return LD(Object.entries(e.classGroups),r).forEach(([o,c])=>{kv(c,n,o,t)}),n},kv=(e,t,r,n)=>{e.forEach(i=>{if(typeof i=="string"){const o=i===""?t:ok(t,i);o.classGroupId=r;return}if(typeof i=="function"){if(DD(i)){kv(i(n),t,r,n);return}t.validators.push({validator:i,classGroupId:r});return}Object.entries(i).forEach(([o,c])=>{kv(c,ok(t,o),r,n)})})},ok=(e,t)=>{let r=e;return t.split(Hx).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},DD=e=>e.isThemeGetter,LD=(e,t)=>t?e.map(([r,n])=>{const i=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([c,u])=>[t+c,u])):o);return[r,i]}):e,RD=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const i=(o,c)=>{r.set(o,c),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let c=r.get(o);if(c!==void 0)return c;if((c=n.get(o))!==void 0)return i(o,c),c},set(o,c){r.has(o)?r.set(o,c):i(o,c)}}},X5="!",$D=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,i=t[0],o=t.length,c=u=>{const f=[];let h=0,m=0,p;for(let k=0;km?p-m:void 0;return{modifiers:f,hasImportantModifier:b,baseClassName:S,maybePostfixModifierPosition:w}};return r?u=>r({className:u,parseClassName:c}):c},zD=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},FD=e=>({cache:RD(e.cacheSize),parseClassName:$D(e),...MD(e)}),BD=/\s+/,UD=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i}=t,o=[],c=e.trim().split(BD);let u="";for(let f=c.length-1;f>=0;f-=1){const h=c[f],{modifiers:m,hasImportantModifier:p,baseClassName:v,maybePostfixModifierPosition:b}=r(h);let S=!!b,w=n(S?v.substring(0,b):v);if(!w){if(!S){u=h+(u.length>0?" "+u:u);continue}if(w=n(v),!w){u=h+(u.length>0?" "+u:u);continue}S=!1}const k=zD(m).join(":"),N=p?k+X5:k,E=N+w;if(o.includes(E))continue;o.push(E);const A=i(w,S);for(let C=0;C0?" "+u:u)}return u};function WD(){let e=0,t,r,n="";for(;e{if(typeof e=="string")return e;let t,r="";for(let n=0;np(m),e());return r=FD(h),n=r.cache.get,i=r.cache.set,o=u,u(f)}function u(f){const h=n(f);if(h)return h;const m=UD(f,r);return i(f,m),m}return function(){return o(WD.apply(null,arguments))}}const st=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},eE=/^\[(?:([a-z-]+):)?(.+)\]$/i,KD=/^\d+\/\d+$/,GD=new Set(["px","full","screen"]),VD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qD=/\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$/,QD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,YD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ZD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,si=e=>ks(e)||GD.has(e)||KD.test(e),ea=e=>tl(e,"length",aL),ks=e=>!!e&&!Number.isNaN(Number(e)),pg=e=>tl(e,"number",ks),tc=e=>!!e&&Number.isInteger(Number(e)),XD=e=>e.endsWith("%")&&ks(e.slice(0,-1)),ze=e=>eE.test(e),ta=e=>VD.test(e),JD=new Set(["length","size","percentage"]),eL=e=>tl(e,JD,tE),tL=e=>tl(e,"position",tE),rL=new Set(["image","url"]),nL=e=>tl(e,rL,sL),iL=e=>tl(e,"",oL),rc=()=>!0,tl=(e,t,r)=>{const n=eE.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},aL=e=>qD.test(e)&&!QD.test(e),tE=()=>!1,oL=e=>YD.test(e),sL=e=>ZD.test(e),lL=()=>{const e=st("colors"),t=st("spacing"),r=st("blur"),n=st("brightness"),i=st("borderColor"),o=st("borderRadius"),c=st("borderSpacing"),u=st("borderWidth"),f=st("contrast"),h=st("grayscale"),m=st("hueRotate"),p=st("invert"),v=st("gap"),b=st("gradientColorStops"),S=st("gradientColorStopPositions"),w=st("inset"),k=st("margin"),N=st("opacity"),E=st("padding"),A=st("saturate"),C=st("scale"),_=st("sepia"),O=st("skew"),D=st("space"),B=st("translate"),z=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],K=()=>["auto",ze,t],W=()=>[ze,t],ve=()=>["",si,ea],ue=()=>["auto",ks,ze],pe=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],oe=()=>["solid","dashed","dotted","double","none"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>["start","end","center","between","around","evenly","stretch"],ie=()=>["","0",ze],te=()=>["auto","avoid","all","avoid-page","page","left","right","column"],I=()=>[ks,ze];return{cacheSize:500,separator:":",theme:{colors:[rc],spacing:[si,ea],blur:["none","",ta,ze],brightness:I(),borderColor:[e],borderRadius:["none","","full",ta,ze],borderSpacing:W(),borderWidth:ve(),contrast:I(),grayscale:ie(),hueRotate:I(),invert:ie(),gap:W(),gradientColorStops:[e],gradientColorStopPositions:[XD,ea],inset:K(),margin:K(),opacity:I(),padding:W(),saturate:I(),scale:I(),sepia:ie(),skew:I(),space:W(),translate:W()},classGroups:{aspect:[{aspect:["auto","square","video",ze]}],container:["container"],columns:[{columns:[ta]}],"break-after":[{"break-after":te()}],"break-before":[{"break-before":te()}],"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:[...pe(),ze]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",tc,ze]}],basis:[{basis:K()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ze]}],grow:[{grow:ie()}],shrink:[{shrink:ie()}],order:[{order:["first","last","none",tc,ze]}],"grid-cols":[{"grid-cols":[rc]}],"col-start-end":[{col:["auto",{span:["full",tc,ze]},ze]}],"col-start":[{"col-start":ue()}],"col-end":[{"col-end":ue()}],"grid-rows":[{"grid-rows":[rc]}],"row-start-end":[{row:["auto",{span:[tc,ze]},ze]}],"row-start":[{"row-start":ue()}],"row-end":[{"row-end":ue()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ze]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ze]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...Z()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Z(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Z(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[E]}],px:[{px:[E]}],py:[{py:[E]}],ps:[{ps:[E]}],pe:[{pe:[E]}],pt:[{pt:[E]}],pr:[{pr:[E]}],pb:[{pb:[E]}],pl:[{pl:[E]}],m:[{m:[k]}],mx:[{mx:[k]}],my:[{my:[k]}],ms:[{ms:[k]}],me:[{me:[k]}],mt:[{mt:[k]}],mr:[{mr:[k]}],mb:[{mb:[k]}],ml:[{ml:[k]}],"space-x":[{"space-x":[D]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[D]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ze,t]}],"min-w":[{"min-w":[ze,t,"min","max","fit"]}],"max-w":[{"max-w":[ze,t,"none","full","min","max","fit","prose",{screen:[ta]},ta]}],h:[{h:[ze,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ze,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ze,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ze,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ta,ea]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",pg]}],"font-family":[{font:[rc]}],"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",ze]}],"line-clamp":[{"line-clamp":["none",ks,pg]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",si,ze]}],"list-image":[{"list-image":["none",ze]}],"list-style-type":[{list:["none","disc","decimal",ze]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...oe(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",si,ea]}],"underline-offset":[{"underline-offset":["auto",si,ze]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:W()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ze]}],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",ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...pe(),tL]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",eL]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},nL]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[N]}],"border-style":[{border:[...oe(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[N]}],"divide-style":[{divide:oe()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:["",...oe()]}],"outline-offset":[{"outline-offset":[si,ze]}],"outline-w":[{outline:[si,ea]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ve()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[si,ea]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ta,iL]}],"shadow-color":[{shadow:[rc]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...le(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":le()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",ta,ze]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[p]}],saturate:[{saturate:[A]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[p]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[A]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ze]}],duration:[{duration:I()}],ease:[{ease:["linear","in","out","in-out",ze]}],delay:[{delay:I()}],animate:[{animate:["none","spin","ping","pulse","bounce",ze]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[tc,ze]}],"translate-x":[{"translate-x":[B]}],"translate-y":[{"translate-y":[B]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ze]}],accent:[{accent:["auto",e]}],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",ze]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":W()}],"scroll-mx":[{"scroll-mx":W()}],"scroll-my":[{"scroll-my":W()}],"scroll-ms":[{"scroll-ms":W()}],"scroll-me":[{"scroll-me":W()}],"scroll-mt":[{"scroll-mt":W()}],"scroll-mr":[{"scroll-mr":W()}],"scroll-mb":[{"scroll-mb":W()}],"scroll-ml":[{"scroll-ml":W()}],"scroll-p":[{"scroll-p":W()}],"scroll-px":[{"scroll-px":W()}],"scroll-py":[{"scroll-py":W()}],"scroll-ps":[{"scroll-ps":W()}],"scroll-pe":[{"scroll-pe":W()}],"scroll-pt":[{"scroll-pt":W()}],"scroll-pr":[{"scroll-pr":W()}],"scroll-pb":[{"scroll-pb":W()}],"scroll-pl":[{"scroll-pl":W()}],"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",ze]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[si,ea,pg]}],stroke:[{stroke:[e,"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"]}}},cL=HD(lL);function J(...e){return cL(nt(e))}function jv(e){return e?e.replace(/127\.0\.0\.1|localhost/g,"192.168.178.151"):""}function rE(){const e=Wx();return l.jsxs("div",{className:"flex items-center rounded-md border border-border/40 bg-background/40 p-0.5",role:"group","aria-label":"Ansichtsmodus",title:"Einfach zeigt nur das Wichtigste. Experte zeigt alle technischen Details.",children:[l.jsxs("button",{onClick:()=>ik(!1),"aria-pressed":!e,className:J("flex items-center gap-1 rounded px-2 py-1 text-xs font-semibold transition-all cursor-pointer",e?"text-muted-foreground hover:text-foreground":"bg-primary/15 text-primary shadow-sm"),children:[l.jsx(hi,{className:"h-3.5 w-3.5"})," Einfach"]}),l.jsxs("button",{onClick:()=>ik(!0),"aria-pressed":e,className:J("flex items-center gap-1 rounded px-2 py-1 text-xs font-semibold transition-all cursor-pointer",e?"bg-primary/15 text-primary shadow-sm":"text-muted-foreground hover:text-foreground"),children:[l.jsx(vI,{className:"h-3.5 w-3.5"})," Experte"]})]})}async function xe(e,t){var f;const r={"Content-Type":"application/json",...t==null?void 0:t.headers},n=localStorage.getItem("mc_sudo_password"),i=localStorage.getItem("mc_hf_token");n&&(r["X-Sudo-Password"]=n);let o=t==null?void 0:t.body;if((((f=t==null?void 0:t.method)==null?void 0:f.toUpperCase())||"GET")==="POST"){if(typeof o=="string")try{const h=JSON.parse(o);let m=!1;n&&!("sudo_password"in h)&&(h.sudo_password=n,m=!0),i&&!("hf_token"in h)&&(h.hf_token=i,m=!0),m&&(o=JSON.stringify(h))}catch{}else if(!o){const h={};n&&(h.sudo_password=n),i&&(h.hf_token=i),Object.keys(h).length>0&&(o=JSON.stringify(h))}}const u=await fetch(e,{...t,headers:r,body:o});if(!u.ok)throw new Error(`${u.status} ${u.statusText}`);return u.json()}const nE=(e,t,r=!1,n=!0)=>xe("/api/groups",{method:"PUT",body:JSON.stringify({group:e,members:t,swap:r,persist:n})}),uL=e=>xe("/api/routing/policy",{method:"PUT",body:JSON.stringify(e)}),$e={health:["health"],systemStatus:["system-status"],services:["services"],models:["models"],groups:["groups"],routing:["routing"],routingPolicy:["routing-policy"],jobs:["jobs"],tokenStats:["token-stats"],agentStatus:["agent-status"],hermesBrain:["hermes-brain"],updates:["updates"],discover:["discover"],drafts:e=>["drafts",e??""],connect:e=>["connect",e??""],connectHealth:["connect-health"],memory:(e,t)=>["memory",e??"",t??""],memoryGraph:["memory-graph"],voiceTrace:["voice-trace"],auftragsbuch:["auftragsbuch"],chronik:["chronik"],wissen:["wissen"],zeitmaschine:["zeitmaschine"],reminders:["reminders"]},iE=(e=8e3)=>gt({queryKey:$e.auftragsbuch,queryFn:()=>xe("/api/auftragsbuch"),refetchInterval:e}),aE=(e=150,t=15e3)=>gt({queryKey:$e.chronik,queryFn:()=>xe(`/api/chronik?limit=${e}`),refetchInterval:t,select:r=>r.items??[]}),dL=()=>gt({queryKey:$e.wissen,queryFn:()=>xe("/api/wissen")}),fL=(e=3e4)=>gt({queryKey:$e.zeitmaschine,queryFn:()=>xe("/api/zeitmaschine"),refetchInterval:e}),hL=(e=2e4)=>gt({queryKey:$e.reminders,queryFn:()=>xe("/api/reminders"),refetchInterval:e,select:t=>t.items??[]}),mL=(e=12,t=4e3)=>gt({queryKey:$e.voiceTrace,queryFn:()=>xe(`/api/voice/trace?limit=${e}`),refetchInterval:t,select:r=>r.turns??[]}),pL=(e=!0)=>gt({queryKey:$e.memoryGraph,queryFn:()=>xe("/api/memory/graph"),enabled:e}),Kx=()=>gt({queryKey:$e.health,queryFn:()=>xe("/api/health"),refetchInterval:1e4}),Po=(e=5e3)=>gt({queryKey:$e.systemStatus,queryFn:()=>xe("/api/system/status"),refetchInterval:e}),oE=(e=3e3)=>gt({queryKey:$e.services,queryFn:()=>xe("/api/system/services"),refetchInterval:e}),Ei=(e=4e3)=>gt({queryKey:$e.models,queryFn:()=>xe("/api/models"),refetchInterval:e}),Gx=(e=8e3)=>gt({queryKey:$e.groups,queryFn:()=>xe("/api/groups"),refetchInterval:e}),gL=()=>gt({queryKey:$e.routingPolicy,queryFn:()=>xe("/api/routing/policy")}),vL=(e=2e3)=>gt({queryKey:$e.jobs,queryFn:()=>xe("/api/jobs"),refetchInterval:e,select:t=>t.jobs??[]}),sE=(e=3e3)=>gt({queryKey:$e.tokenStats,queryFn:()=>xe("/api/system/token-stats"),refetchInterval:e}),Vx=(e=5e3)=>gt({queryKey:$e.agentStatus,queryFn:()=>xe("/api/agent/status"),refetchInterval:e}),lE=(e=6e4)=>gt({queryKey:$e.hermesBrain,queryFn:()=>xe("/api/agent/brain"),refetchInterval:e}),kh=e=>gt({queryKey:$e.updates,queryFn:()=>xe("/api/maintenance/updates"),refetchInterval:e}),xL=()=>gt({queryKey:$e.discover,queryFn:()=>xe("/api/discover")}),yL=e=>gt({queryKey:$e.drafts(e),queryFn:()=>xe(`/api/models/drafts?target=${encodeURIComponent(e??"")}`),enabled:!!e}),bL=e=>gt({queryKey:$e.connect(e),queryFn:()=>xe(e?`/api/connect?${e}`:"/api/connect")}),cE=()=>gt({queryKey:$e.connectHealth,queryFn:()=>xe("/api/connect/health"),refetchInterval:15e3}),Sv=e=>gt({queryKey:$e.memory(e==null?void 0:e.q,e==null?void 0:e.category),queryFn:()=>{const t=new URLSearchParams;return e!=null&&e.q&&t.set("q",e.q),e!=null&&e.category&&t.set("category",e.category),xe(`/api/memory?${t}`)},select:t=>e!=null&&e.limit?t.slice(0,e.limit):t});function uE({type:e,title:t,message:r,defaultValue:n,autoValue:i,autoLabel:o,onConfirm:c,onCancel:u}){const f=x.useRef(null);return l.jsx("div",{className:"fixed inset-0 z-[99] bg-black/60 backdrop-blur-sm flex items-center justify-center p-4 overscroll-contain",role:"dialog","aria-modal":"true","aria-label":t,children:l.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:t}),l.jsx("button",{onClick:u||(()=>c()),"aria-label":"Schließen",className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:l.jsx(nn,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("p",{className:"max-h-72 overflow-y-auto whitespace-pre-line text-xs text-muted-foreground leading-relaxed scrollbar-thin",children:r}),e==="prompt"&&l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{ref:f,type:"text",defaultValue:n,"aria-label":t,className:"flex-1 h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground",autoFocus:!0,onKeyDown:h=>{var m;h.key==="Enter"&&c((m=f.current)==null?void 0:m.value)}}),i!==void 0&&l.jsx("button",{type:"button",onClick:()=>{f.current&&(f.current.value=i)},title:"Setup-bewussten Optimalwert eintragen",className:"h-9 px-3 shrink-0 text-xs font-semibold text-primary border border-primary/50 bg-primary/10 hover:bg-primary/20 rounded-lg transition-colors cursor-pointer",children:o||"Auto"})]}),l.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[(e==="confirm"||e==="prompt")&&l.jsx("button",{onClick:u,className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Abbrechen"}),l.jsx("button",{onClick:()=>{var m;const h=e==="prompt"?(m=f.current)==null?void 0:m.value:void 0;c(h)},className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/95 rounded-lg transition-colors cursor-pointer",children:e==="confirm"?"Ja, fortfahren":e==="prompt"?"Übernehmen":"OK"})]})]})})}function An(){const[e,t]=x.useState(null),r=x.useCallback(()=>t(null),[]),n=x.useCallback((u,f,h)=>{t({type:"alert",title:u,message:f,onConfirm:()=>{t(null),h==null||h()}})},[]),i=x.useCallback((u,f,h,m)=>{t({type:"confirm",title:u,message:f,onConfirm:()=>{t(null),h()},onCancel:()=>{t(null),m==null||m()}})},[]),o=x.useCallback((u,f,h,m,p,v)=>{t({type:"prompt",title:u,message:f,defaultValue:h,autoValue:v==null?void 0:v.autoValue,autoLabel:v==null?void 0:v.autoLabel,onConfirm:b=>{t(null),m(b)},onCancel:()=>{t(null),p==null||p()}})},[]),c=e?l.jsx(uE,{...e}):null;return{showAlert:n,showConfirm:i,showPrompt:o,close:r,dialogElement:c}}function Jr(e){return(e/1024**3).toFixed(1)}function Nv(e){return e?e>1024**3?`${(e/1024**3).toFixed(1)} GB`:`${(e/1024**2).toFixed(0)} MB`:""}function lr(e){if(!e)return"—";const t=e/1024**3;return t>=1?`${t.toFixed(1)} GB`:`${(e/1024**2).toFixed(0)} MB`}function wL(e){if(!e)return"";const t=Math.floor(e/60);return t>0?`${t} min`:`${e} s`}function Ev(e){return e?`${Math.round(e/1024)}k`:"—"}function kL(){const e=Wr(),{data:t=[]}=vL(2e3),{showAlert:r,dialogElement:n}=An();async function i(u){try{await xe(`/api/jobs/${u}/cancel`,{method:"POST"}),e.invalidateQueries({queryKey:$e.jobs})}catch(f){r("Fehler",f.message)}}const o=t.filter(u=>u.state==="running"||u.state==="queued"),c=t.filter(u=>u.state!=="running"&&u.state!=="queued").slice(-3);return o.length===0&&c.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"}),o.map(u=>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:u.label}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"text-muted-foreground font-mono",children:[u.progress??0,"% • ",Nv(u.done_bytes),"/",Nv(u.total_bytes),u.eta_s?` • ETA ${wL(u.eta_s)}`:""]}),l.jsx("button",{onClick:()=>i(u.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:`${u.progress??0}%`}})})]},u.id)),c.map(u=>l.jsxs("div",{className:"flex justify-between items-center text-xs text-muted-foreground px-1",children:[l.jsx("span",{className:"truncate",children:u.label}),l.jsx("span",{className:J("font-semibold text-[10px] px-1.5 py-0.5 rounded uppercase font-mono",u.state==="done"?"bg-emerald-500/10 text-emerald-400":"bg-amber-500/10 text-amber-400"),children:u.state})]},u.id)),n]})}function Ba({children:e,tone:t="muted"}){const r={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 ${r[t]}`,children:e})}function Av({caps:e}){return e?l.jsxs("span",{className:"inline-flex flex-wrap gap-1",children:[e.coder&&l.jsx(Ba,{children:"💻 Code"}),e.vision&&l.jsx(Ba,{children:"👁 Bild"}),e.reasoning&&l.jsx(Ba,{children:"🧠 Reason"}),e.moe&&l.jsxs(Ba,{tone:"primary",children:["🧩 MoE",e.active_b?`·${e.active_b}b`:""]}),e.tools==="yes"&&l.jsx(Ba,{tone:"primary",children:"🛠 Tools"}),e.tools==="likely"&&l.jsx(Ba,{tone:"warn",children:"🛠 Tools?"}),e.embedding&&l.jsx(Ba,{children:"🔢 Embed"})]}):null}const qx=[{role:"hermes",label:"Lucys Hirn",short:"Hirn",icon:Na,desc:"Lucys Alltags-Verstand — denkt und redet mit dir. Immer bereit.",tone:"bg-indigo-500/15 text-indigo-400 border-indigo-500/25",protected:!0},{role:"embed",label:"Lucys Gedächtnis",short:"Gedächtnis",icon:e5,desc:"Merkt sich Wichtiges und findet es später wieder.",tone:"bg-emerald-500/15 text-emerald-400 border-emerald-500/25",protected:!0},{role:"reranker",label:"Gedächtnis-Sortierer",short:"Sortierer",icon:tI,desc:"Ordnet gefundene Erinnerungen nach echter Relevanz — die Feinsortierung hinter dem Gedächtnis.",tone:"bg-lime-500/15 text-lime-400 border-lime-500/25"},{role:"vision",label:"Lucys Augen",short:"Augen",icon:Ac,desc:"Sieht Bilder und Screenshots und beschreibt, was drauf ist.",tone:"bg-pink-500/15 text-pink-400 border-pink-500/25"},{role:"heavy",label:"Großes Hirn",short:"Groß",icon:IM,desc:"Das schwere Geschütz — wird für besonders knifflige Fragen dazugeholt.",tone:"bg-amber-500/15 text-amber-400 border-amber-500/25"},{role:"coder-lite",label:"Programmierer (schnell)",short:"Code schnell",icon:zs,desc:"Schnelles Programmieren im Alltag.",tone:"bg-violet-500/15 text-violet-400 border-violet-500/25"},{role:"coder",label:"Programmierer (gründlich)",short:"Code gründlich",icon:zs,desc:"Schreibt und prüft Code besonders sorgfältig — für schwere Coding-Aufgaben.",tone:"bg-fuchsia-500/15 text-fuchsia-400 border-fuchsia-500/25"},{role:"scout",label:"Späher",short:"Späher",icon:bI,desc:"Schneller erster Blick und grobe Einschätzung.",tone:"bg-teal-500/15 text-teal-400 border-teal-500/25"},{role:"kritiker",label:"Kritiker",short:"Kritiker",icon:d5,desc:"Die unbestechliche Zweitmeinung — prüft Behauptungen und Patches (anderer Hersteller als das Hirn).",tone:"bg-cyan-500/15 text-cyan-400 border-cyan-500/25"}],jL=qx.map(e=>e.role),sk=Object.fromEntries(qx.map(e=>[e.role,e])),lk=e=>({role:e||"?",label:e||"unbekannt",short:e||"?",icon:Na,desc:"Rolle ohne hinterlegten Klartext-Namen.",tone:"bg-slate-500/15 text-slate-300 border-slate-500/25"}),SL={fast:"hermes",coder_lite:"coder-lite"};function dt(e){return e&&(sk[e]||sk[SL[e]])||lk(e)}function po({role:e,dense:t=!1,className:r}){const n=dt(e),i=n.icon;return l.jsxs("span",{className:J("inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-semibold border tracking-wide",n.tone,r),title:`${n.desc} (${n.role})`,children:[l.jsx(i,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}),t?n.short:n.label]})}function NL({fit:e}){const t={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"}[e.level];return l.jsxs("span",{className:J("rounded px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider font-mono",t),children:[e.text," • ",e.req_gb," GB RAM"]})}function vf(e){const t=e.toLowerCase();return t.includes("qwen")?{name:"Qwen",color:"bg-purple-500/20 text-purple-300 border-purple-500/30",initial:"Q"}:t.includes("gemma")?{name:"Gemma",color:"bg-blue-500/20 text-blue-300 border-blue-500/30",initial:"G"}:t.includes("llama")?{name:"Llama",color:"bg-red-500/20 text-red-300 border-red-500/30",initial:"🦙"}:t.includes("mistral")||t.includes("mixtral")?{name:"Mistral",color:"bg-orange-500/20 text-orange-300 border-orange-500/30",initial:"M"}:t.includes("deepseek")?{name:"DeepSeek",color:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30",initial:"D"}:t.includes("hermes")||t.includes("nous")?{name:"Hermes",color:"bg-amber-500/20 text-amber-300 border-amber-500/30",initial:"H"}:t.includes("phi")?{name:"Phi",color:"bg-emerald-500/20 text-emerald-300 border-emerald-500/30",initial:"Φ"}:{name:"Other",color:"bg-slate-500/20 text-slate-300 border-slate-500/30",initial:"AI"}}function dE({model:e,onClose:t,onChanged:r}){var w,k;const{data:n,isLoading:i}=yL(e.gguf_path),[o,c]=x.useState(null),[u,f]=x.useState(""),h=n==null?void 0:n.target_vocab,m=(n==null?void 0:n.drafts)??[],p=m.filter(N=>N.compatible===!0),v=e.spec_draft_model;async function b(N){c(N??"__clear__"),f("");try{await xe(`/api/models/${encodeURIComponent(e.name)}/draft`,{method:"POST",body:JSON.stringify({draft_path:N})}),r(),t()}catch(E){f(String((E==null?void 0:E.message)||E)),c(null)}}const S=N=>{var E;return N?`${N.pre??"?"} · ${((E=N.n_vocab)==null?void 0:E.toLocaleString())??"?"} Tokens`:"—"};return l.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:l.jsxs("div",{className:"w-full max-w-lg rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-2",children:[l.jsx(ka,{className:"h-4 w-4"})," Speculative Draft"]}),l.jsx("button",{onClick:t,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:l.jsx(nn,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"text-xs text-muted-foreground leading-relaxed",children:['Beschleunigt die Token-Generierung mit einem kleinen "Draft"-Modell. Voraussetzung: der Draft muss den ',l.jsx("strong",{className:"text-foreground",children:"exakt gleichen Tokenizer (Vocab)"})," haben wie das Modell — sonst lehnt llama.cpp es ab."]}),l.jsxs("div",{className:"rounded-lg border border-border/40 bg-background/30 px-3 py-2 text-[11px] font-mono flex items-center justify-between",children:[l.jsx("span",{className:"text-muted-foreground",children:(w=e.name.split("/").pop())==null?void 0:w.replace(/\.gguf$/i,"")}),l.jsxs("span",{className:"text-foreground",children:["Vocab: ",S(h)]})]}),e.spec_active&&v&&l.jsxs("div",{className:"rounded-lg border border-emerald-500/30 bg-emerald-500/5 px-3 py-2 flex items-center justify-between gap-2",children:[l.jsxs("span",{className:"text-[11px] text-emerald-400 font-mono flex items-center gap-1.5 truncate",children:[l.jsx(Mt,{className:"h-3.5 w-3.5 shrink-0"})," Aktiv: ",v]}),l.jsx("button",{onClick:()=>b(null),disabled:o!==null,className:"h-6 px-2.5 rounded border border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10 text-amber-400 text-[9px] font-bold uppercase shrink-0 cursor-pointer disabled:opacity-50",children:"Deaktivieren"})]}),!(n!=null&&n.target_exists)&&l.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-[11px] text-amber-400 flex items-center gap-2",children:[l.jsx(vr,{className:"h-3.5 w-3.5 shrink-0"}),"Modell-GGUF noch nicht vorhanden — Spec-Draft ist nach dem Download konfigurierbar."]}),l.jsx("div",{className:"space-y-1.5 max-h-64 overflow-y-auto pr-1",children:i?l.jsx("div",{className:"text-xs text-muted-foreground py-6 text-center",children:"Prüfe Vocab-Kompatibilität…"}):m.length===0?l.jsxs("div",{className:"text-[11px] text-muted-foreground border border-dashed border-border/50 rounded-lg p-4 text-center",children:["Keine Draft-Modelle in ",l.jsx("code",{className:"font-mono",children:"/srv/models/drafts"}),". Lade ein kleines same-family-Modell (z.B. Qwen3-0.6B) und lege es dort ab."]}):m.map(N=>{var C,_;const E=N.filename===v,A=N.compatible===!0;return l.jsxs("div",{className:J("rounded-lg border px-3 py-2 flex items-center justify-between gap-2 text-left",A?"border-border/40 bg-background/20":"border-border/20 bg-background/10 opacity-60",E&&"border-primary/40 bg-primary/10"),children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"text-[11px] font-mono font-semibold text-foreground truncate flex items-center gap-1.5",children:[N.filename,N.mtp&&l.jsx("span",{className:"shrink-0 rounded bg-indigo-500/15 px-1.5 py-0.5 text-[8px] font-bold uppercase tracking-wider text-indigo-400 border border-indigo-500/25",title:"MTP-Kopf (Multi-Token-Prediction) — by-construction vocab-identisch, höchste Akzeptanzrate",children:"MTP"})]}),l.jsxs("div",{className:"text-[9px] text-muted-foreground font-mono",children:[lr(N.size_bytes)," · Vocab: ",S(N.vocab)]})]}),A?E?l.jsxs("span",{className:"text-[9px] font-bold uppercase text-primary flex items-center gap-1 shrink-0",children:[l.jsx(Mt,{className:"h-3.5 w-3.5"})," Aktiv"]}):l.jsx("button",{onClick:()=>b(N.path),disabled:o!==null,className:"h-7 px-3 rounded-lg border border-emerald-500/30 bg-emerald-500/5 hover:bg-emerald-500/15 text-emerald-400 text-[9px] font-bold uppercase shrink-0 cursor-pointer disabled:opacity-50",children:"Aktivieren"}):l.jsxs("span",{className:"text-[9px] font-bold uppercase text-amber-400/80 flex items-center gap-1 shrink-0",title:N.compatible===!1?`Inkompatibel: Tokenizer/Vocab weicht ab (Draft ${(C=N.vocab)==null?void 0:C.pre}/${(_=N.vocab)==null?void 0:_.n_vocab} ≠ Modell ${h==null?void 0:h.pre}/${h==null?void 0:h.n_vocab}).`:"Kompatibilität nicht prüfbar (Datei fehlt).",children:[l.jsx(vr,{className:"h-3.5 w-3.5"})," ",N.compatible===!1?"Vocab ≠":"n/a"]})]},N.path)})}),!i&&(n==null?void 0:n.target_exists)&&m.length>0&&p.length===0&&l.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-[11px] text-amber-400 leading-relaxed",children:["Kein vocab-kompatibler Draft verfügbar — Speculative Decoding ist für dieses Modell nicht möglich. Es braucht einen Draft mit identischem Tokenizer (pre=",l.jsx("span",{className:"font-mono",children:h==null?void 0:h.pre}),", n_vocab=",l.jsx("span",{className:"font-mono",children:(k=h==null?void 0:h.n_vocab)==null?void 0:k.toLocaleString()}),")."]}),u&&l.jsx("div",{className:"text-[10px] text-red-400 font-mono",children:u})]})})}const ck={hermes:{bar:"bg-indigo-500",dot:"bg-indigo-500",text:"text-indigo-400"},embed:{bar:"bg-emerald-500",dot:"bg-emerald-500",text:"text-emerald-400"},vision:{bar:"bg-pink-500",dot:"bg-pink-500",text:"text-pink-400"},heavy:{bar:"bg-amber-500",dot:"bg-amber-500",text:"text-amber-400"},"coder-lite":{bar:"bg-violet-500",dot:"bg-violet-500",text:"text-violet-400"},coder:{bar:"bg-fuchsia-500",dot:"bg-fuchsia-500",text:"text-fuchsia-400"},scout:{bar:"bg-teal-500",dot:"bg-teal-500",text:"text-teal-400"},kritiker:{bar:"bg-cyan-500",dot:"bg-cyan-500",text:"text-cyan-400"},reranker:{bar:"bg-lime-500",dot:"bg-lime-500",text:"text-lime-400"}},EL={fast:"hermes",coder_lite:"coder-lite"},uk={bar:"bg-slate-400",dot:"bg-slate-400",text:"text-slate-300"};function xf(e){return e&&(ck[e]||ck[EL[e]])||uk}const dk=1024**3,fk=e=>{var t;return((t=e.split("/").pop())==null?void 0:t.replace(/\.gguf$/i,""))??e};function AL({running:e,capacityBytes:t,realUsedBytes:r,selected:n,onSelect:i}){const o=t>2*dk?t:124*dk,c=e.reduce((h,m)=>h+(m.size_bytes||0),0),u=Math.max(0,o-c),f=u/o*100;return l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-5 shadow-lg shadow-black/15 backdrop-blur-md",children:[l.jsxs("div",{className:"mb-3 flex flex-wrap items-end justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(xa,{className:"h-5 w-5 text-primary"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Arbeitsspeicher"}),l.jsxs("div",{className:"font-space text-xl font-bold tracking-tight text-foreground",children:[Jr(o)," GB ",l.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"gesamt"})]})]})]}),l.jsxs("div",{className:"text-right text-[11px] font-mono text-muted-foreground",children:[l.jsxs("div",{children:[l.jsxs("span",{className:"font-bold text-foreground",children:[Jr(c)," GB"]})," Modelle geladen"]}),r>0&&l.jsxs("div",{children:[Jr(r)," GB real belegt (inkl. KV-Cache)"]}),l.jsxs("div",{className:"text-emerald-400",children:[Jr(u)," GB frei"]})]})]}),l.jsx("div",{className:"flex h-12 w-full overflow-hidden rounded-xl border border-border/40 bg-background/50 p-1",children:e.length===0?l.jsx("div",{className:"flex w-full items-center justify-center text-[11px] italic text-muted-foreground/60",children:"Kein Modell geladen — Auto-Swap holt bei Anfrage automatisch das passende."}):l.jsxs(l.Fragment,{children:[e.map(h=>{const m=(h.size_bytes||0)/o*100,p=xf(h.role),v=n===h.name;return l.jsxs("button",{onClick:()=>i==null?void 0:i(h.name),style:{width:`${m}%`},title:`${dt(h.role).label} · ${fk(h.name)} · ${lr(h.size_bytes)}`,className:J("group flex h-full min-w-[2.5rem] shrink-0 flex-col justify-center gap-0.5 rounded-lg px-2 text-left text-white transition-all",p.bar,v?"ring-2 ring-white/70":"opacity-90 hover:opacity-100"),children:[l.jsx("span",{className:"truncate font-space text-[10px] font-bold leading-tight tracking-wide",children:dt(h.role).short}),l.jsx("span",{className:"truncate font-mono text-[9px] leading-tight opacity-85",children:lr(h.size_bytes)})]},h.name)}),f>1.5&&l.jsx("div",{style:{width:`${f}%`},className:"flex h-full min-w-[2rem] items-center justify-center rounded-lg text-[9px] font-mono text-muted-foreground/50",title:`${Jr(u)} GB frei`,children:"frei"})]})}),e.length>0&&l.jsxs("div",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-1.5",children:[e.map(h=>{const m=xf(h.role);return l.jsxs("button",{onClick:()=>i==null?void 0:i(h.name),className:"flex items-center gap-1.5 text-[11px] text-muted-foreground transition-colors hover:text-foreground",children:[l.jsx("span",{className:J("h-2.5 w-2.5 rounded-sm",m.dot)}),l.jsx("span",{className:J("font-semibold",m.text),children:dt(h.role).short}),l.jsx("span",{className:"font-mono text-muted-foreground/70",children:fk(h.name)})]},h.name)}),l.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground/60",children:[l.jsx("span",{className:"h-2.5 w-2.5 rounded-sm border border-border/50 bg-background/50"})," frei · ",Jr(u)," GB"]})]})]})}const hk=1024**3,Va=e=>{var t;return((t=e.split("/").pop())==null?void 0:t.replace(/\.gguf$/i,""))??e};function CL(){var M,U,ne,ee;const e=Wr(),{data:t,isLoading:r,error:n}=Ei(4e3),{data:i}=Po(),{data:o}=Gx(),{showAlert:c,showConfirm:u,showPrompt:f,dialogElement:h}=An(),m=Wx(),p=(t==null?void 0:t.models)??[],v=(t==null?void 0:t.running)??[],b=X=>!!dt(X).protected,S=(M=o==null?void 0:o.groups)==null?void 0:M.brains,w=(S==null?void 0:S.members)??[],k=X=>w.includes(X),[N,E]=x.useState(null),[A,C]=x.useState(""),[_,O]=x.useState("all"),[D,B]=x.useState(null),z=()=>{e.invalidateQueries({queryKey:$e.models}),e.invalidateQueries({queryKey:$e.routing}),e.invalidateQueries({queryKey:$e.groups})},$=p.filter(X=>v.includes(X.name)),K=((U=i==null?void 0:i.gpu)==null?void 0:U.gtt_total)||((ne=i==null?void 0:i.gpu)==null?void 0:ne.vram_total)||0,W=((ee=i==null?void 0:i.gpu)==null?void 0:ee.gtt_used)||0,ve=K>2*hk?K:124*hk,ue=x.useMemo(()=>{const X=A.trim().toLowerCase();return p.filter(ae=>_==="in_use"?!!ae.role||v.includes(ae.name):!0).filter(ae=>X?ae.name.toLowerCase().includes(X):!0).sort((ae,me)=>{const re=v.includes(ae.name)?0:1,ye=v.includes(me.name)?0:1;return re!==ye?re-ye:Va(ae.name).localeCompare(Va(me.name))})},[p,v,_,A]),pe=p.find(X=>X.name===N)??null;async function oe(X){try{await xe(`/api/models/${encodeURIComponent(X)}/load`,{method:"POST"}),z()}catch(ae){c("Fehler",`Laden fehlgeschlagen: ${ae.message||ae}`)}}async function le(X){const ae=w.some(me=>v.includes(me));if(S&&ae&&!k(X)){const me=w.filter(re=>v.includes(re)).map(Va).join(", ");u("Verdrängt das Hirn?",`„${Va(X)}" ist nicht ko-resident. Beim Laden wirft es das warme Hirn (${me}) raus — Lucy verliert Hirn bzw. Augen. -Trotzdem exklusiv laden?`,()=>oe(X));return}oe(X)}async function Z(X){const ae=p.find(me=>me.name===X);if(ae&&b(ae.role)){c("Geschützt",`„${dt(ae.role).label}" ist lebenswichtig und bleibt geladen.`);return}try{await xe(`/api/models/${encodeURIComponent(X)}/unload`,{method:"POST"}),z()}catch(me){c("Fehler",`Entladen fehlgeschlagen: ${me.message||me}`)}}async function ie(X,ae){try{const me=await xe(`/api/models/${encodeURIComponent(ae)}/role`,{method:"POST",body:JSON.stringify({role:X||null})});z(),me!=null&&me.warning&&c("Rolle gesetzt — Hinweis",me.warning)}catch(me){c("Fehler",`Rolle zuweisen fehlgeschlagen: ${me.message||me}`)}}async function te(X,ae){let me=null;try{me=await xe(`/api/models/${encodeURIComponent(X)}/ctx/auto`)}catch{}const re=me?`Optimal für dein Setup: ${(me.ctx/1024).toFixed(0)}k (${me.ctx}). »Auto« trägt diesen Wert ein.`:"Gib die gewünschte Kontextlänge in Tokens an:";f("Kontextlänge anpassen",re,String(ae||32768),async ye=>{if(ye)try{await xe(`/api/models/${encodeURIComponent(X)}/ctx`,{method:"POST",body:JSON.stringify({ctx:parseInt(ye,10)})}),z()}catch(Oe){c("Fehler",`Kontext setzen fehlgeschlagen: ${Oe.message||Oe}`)}},void 0,me?{autoValue:String(me.ctx),autoLabel:`Auto (${(me.ctx/1024).toFixed(0)}k)`}:void 0)}async function I(X){const ae=p.find(me=>me.name===X);if(ae&&b(ae.role)){c("Geschützt",`„${dt(ae.role).label}" kann nicht gelöscht werden. Weise die Rolle zuerst einem anderen Modell zu.`);return}u("Modell löschen?",`„${Va(X)}" und alle GGUF-Dateien unwiderruflich von der Box löschen?`,async()=>{try{await xe(`/api/models/${encodeURIComponent(X)}`,{method:"DELETE"}),N===X&&E(null),z()}catch(me){c("Fehler",`Löschen fehlgeschlagen: ${me.message||me}`)}})}return r?l.jsx("div",{className:"py-16 text-center text-xs text-muted-foreground",children:"Werkbank wird geladen …"}):n?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 (",String(n),")."]}):l.jsxs("div",{className:"space-y-5",children:[l.jsx(AR,{running:$,capacityBytes:ve,realUsedBytes:W,selected:N,onSelect:E}),l.jsxs("div",{className:"grid gap-5 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.3fr)]",children:[l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-4 shadow-lg shadow-black/15 backdrop-blur-md",children:[l.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx(Js,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/60"}),l.jsx("input",{value:A,onChange:X=>C(X.target.value),placeholder:"Modell suchen …",className:"h-8 w-full rounded-lg border border-border/40 bg-background/40 pl-8 pr-2 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-primary/50 focus:outline-none"})]}),l.jsx("div",{className:"flex rounded-lg border border-border/40 bg-background/30 p-0.5",children:["all","in_use"].map(X=>l.jsx("button",{onClick:()=>O(X),className:J("rounded-md px-2 py-1 text-[9px] font-bold uppercase transition-all cursor-pointer",_===X?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:X==="all"?"Alle":"In Benutzung"},X))})]}),l.jsx("div",{className:"max-h-[60vh] space-y-1.5 overflow-y-auto scrollbar-thin pr-1",children:ue.length===0?l.jsx("div",{className:"rounded-xl border border-dashed border-border/50 p-8 text-center text-xs text-muted-foreground",children:"Keine Modelle."}):ue.map(X=>{const ae=v.includes(X.name),me=N===X.name,re=vf(X.name),ye=xf(X.role);return l.jsxs("button",{onClick:()=>E(X.name),className:J("flex w-full items-center gap-2.5 rounded-xl border p-2.5 text-left transition-all cursor-pointer",me?"border-primary/60 bg-primary/10":"border-border/40 bg-background/20 hover:border-primary/30 hover:bg-background/40"),children:[l.jsx("span",{className:J("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border text-[10px] font-bold",re.color),children:re.initial}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("div",{className:"truncate font-mono text-xs font-semibold text-foreground",children:Va(X.name)}),l.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5",children:[X.role&&l.jsx("span",{className:J("h-2 w-2 rounded-sm",ye.dot)}),l.jsx("span",{className:"text-[10px] text-muted-foreground",children:X.role?dt(X.role).short:"keine Rolle"}),l.jsxs("span",{className:"text-[10px] text-muted-foreground/50",children:["· ",lr(X.size_bytes)]})]})]}),ae?l.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[9px] font-bold uppercase text-emerald-400",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"warm"]}):X.incomplete?l.jsx("span",{className:"shrink-0 text-[9px] font-bold uppercase text-amber-400",children:"⚠ fehlt"}):l.jsx("span",{className:"shrink-0 text-[9px] font-semibold uppercase text-muted-foreground/50",children:"bereit"})]},X.name)})})]}),l.jsx("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-5 shadow-lg shadow-black/15 backdrop-blur-md",children:pe?l.jsx(PR,{m:pe,warm:v.includes(pe.name),expert:m,protectedRole:b(pe.role),coresident:k(pe.name),onLoad:()=>le(pe.name),onUnload:()=>Z(pe.name),onRole:X=>ie(X,pe.name),onCtx:()=>te(pe.name,pe.ctx),onSpec:()=>B(pe),onDelete:()=>I(pe.name)}):l.jsxs("div",{className:"flex h-full min-h-[16rem] flex-col items-center justify-center gap-2 text-center text-muted-foreground",children:[l.jsx(wi,{className:"h-8 w-8 opacity-40"}),l.jsx("p",{className:"text-sm font-semibold",children:"Links ein Modell wählen"}),l.jsx("p",{className:"text-xs",children:"Dann verwaltest du es hier — laden, Rolle, Kontext, löschen."})]})})]}),D&&l.jsx(uE,{model:D,onClose:()=>B(null),onChanged:z}),h]})}function PR({m:e,warm:t,expert:r,protectedRole:n,coresident:i,onLoad:o,onUnload:c,onRole:u,onCtx:f,onSpec:h,onDelete:m}){const p=vf(e.name),v=t&&n;return l.jsxs("div",{className:"flex h-full flex-col gap-4",children:[l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("span",{className:J("flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border text-sm font-bold",p.color),children:p.initial}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("h2",{className:"break-all font-mono text-sm font-bold text-foreground",children:Va(e.name)}),l.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[e.role?l.jsx(po,{role:e.role}):l.jsx("span",{className:"rounded border border-dashed border-border/50 px-1.5 py-0.5 text-[10px] text-muted-foreground",children:"keine Rolle"}),n&&l.jsxs("span",{className:"rounded bg-background/40 px-1.5 py-0.5 text-[10px] text-muted-foreground",title:"Lebenswichtig — geschützt",children:[l.jsx(o5,{className:"mr-0.5 inline h-3 w-3"}),"geschützt"]}),i&&l.jsxs("span",{className:"rounded border border-fuchsia-500/30 bg-fuchsia-500/10 px-1.5 py-0.5 text-[10px] font-bold uppercase text-fuchsia-300",children:[l.jsx(Na,{className:"mr-0.5 inline h-3 w-3"}),"Ko-resident"]}),t&&l.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold uppercase text-emerald-400",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"warm"]})]})]})]}),l.jsxs("button",{onClick:t?c:o,disabled:e.incomplete&&!t||v,className:J("flex h-11 w-full items-center justify-center gap-2 rounded-xl border text-sm font-bold transition-all cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",t?"border-amber-500/40 bg-amber-500/10 text-amber-300 hover:bg-amber-500/20":"border-primary/40 bg-primary/10 text-primary hover:bg-primary/20"),title:v?`„${dt(e.role).label}" bleibt geladen (geschützt).`:void 0,children:[t?l.jsx(lI,{className:"h-4 w-4"}):l.jsx(c5,{className:"h-4 w-4"}),v?"🔒 bleibt geladen":t?"Entladen":"Ins Warm-Set laden"]}),l.jsxs("div",{className:"rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsx("div",{className:"mb-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Rolle"}),l.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[l.jsx(fk,{active:!e.role,onClick:()=>u(""),dot:"bg-slate-400",label:"keine"}),Vx.map(b=>l.jsx(fk,{active:e.role===b.role,onClick:()=>u(b.role),dot:xf(b.role).dot,label:b.short},b.role))]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[l.jsx(OR,{icon:xa,label:"Größe",value:lr(e.size_bytes)}),l.jsxs("button",{onClick:f,className:"group flex items-center gap-2 rounded-lg border border-border/30 bg-background/20 p-2.5 text-left transition-colors hover:border-primary/40 cursor-pointer",children:[l.jsx(l5,{className:"h-4 w-4 text-primary/80"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:"Kontext · ändern"}),l.jsx("div",{className:"font-semibold text-foreground",children:Nv(e.ctx)})]})]})]}),l.jsxs("div",{className:"rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[l.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Beschleuniger"}),r&&l.jsxs("button",{onClick:h,className:J("flex h-6 items-center gap-1 rounded-lg border px-2 text-[9px] font-bold uppercase transition-colors cursor-pointer",e.spec_active?"border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10":e.spec_draft_model?"border-amber-500/30 text-amber-400 hover:bg-amber-500/10":"border-border/40 text-muted-foreground hover:bg-accent"),children:[l.jsx(ka,{className:"h-3 w-3"})," Spec"]})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.spec_active&&l.jsx(Ld,{tone:"emerald",label:"Spec-Decoding aktiv"}),!e.spec_active&&e.spec_draft_model&&l.jsx(Ld,{tone:"amber",label:"Spec inaktiv"}),e.prompt_cache&&l.jsx(Ld,{tone:"cyan",label:"Prompt-Cache"}),e.parallel_slots>1&&l.jsx(Ld,{tone:"violet",label:`${e.parallel_slots} Slots`}),!e.spec_active&&!e.spec_draft_model&&!e.prompt_cache&&e.parallel_slots<=1&&l.jsx("span",{className:"text-[11px] text-muted-foreground/60",children:"keine aktiv"})]})]}),l.jsx("div",{className:"flex flex-wrap gap-1",children:l.jsx(Ev,{caps:e.capabilities})}),l.jsxs("button",{onClick:m,disabled:n,className:J("mt-auto flex h-9 items-center justify-center gap-1.5 rounded-lg border text-xs font-semibold transition-colors",n?"cursor-not-allowed border-border/30 text-muted-foreground/40":"border-red-500/30 text-red-400 hover:bg-red-500/10 cursor-pointer"),children:[l.jsx(Pc,{className:"h-3.5 w-3.5"})," ",n?"geschützt — nicht löschbar":"Modell löschen"]})]})}function fk({active:e,onClick:t,dot:r,label:n}){return l.jsxs("button",{onClick:t,className:J("flex items-center gap-1.5 rounded-lg border px-2 py-1 text-[10px] font-semibold transition-all cursor-pointer",e?"border-primary/60 bg-primary/15 text-foreground":"border-border/40 bg-background/20 text-muted-foreground hover:border-primary/30"),children:[l.jsx("span",{className:J("h-2 w-2 rounded-sm",r)}),n,e&&l.jsx(Mt,{className:"h-3 w-3 text-primary"})]})}function OR({icon:e,label:t,value:r}){return l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border/30 bg-background/20 p-2.5",children:[l.jsx(e,{className:"h-4 w-4 text-primary/80"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:t}),l.jsx("div",{className:"font-semibold text-foreground",children:r})]})]})}function Ld({tone:e,label:t}){const r={emerald:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",amber:"bg-amber-500/10 text-amber-400 border-amber-500/20",cyan:"bg-cyan-500/10 text-cyan-400 border-cyan-500/20",violet:"bg-violet-500/10 text-violet-400 border-violet-500/20"}[e];return l.jsx("span",{className:J("rounded border px-1.5 py-0.5 text-[10px] font-semibold",r),children:t})}const _R=[{key:"popular",label:"Beliebt",q:""},{key:"coder",label:"Coder",q:"coder"},{key:"vision",label:"Vision",q:"vision"},{key:"reasoning",label:"Reasoning",q:"reasoning"},{key:"small",label:"Klein (≤4B)",q:"3B"}],MR=["fast","heavy","coder","vision","hermes","scout"],IR=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1});function hk(e){return IR.format(e)}function TR(){const{data:e}=Ei(),t=(e==null?void 0:e.models)??[],[r,n]=x.useState(""),[i,o]=x.useState([]),[c,u]=x.useState(!1),[f,h]=x.useState(""),[m,p]=x.useState("popular"),[v,b]=x.useState(""),[S,w]=x.useState(null),[k,N]=x.useState([]),[E,A]=x.useState("Q4_K_M"),[C,_]=x.useState(""),[O,D]=x.useState(null),[B,z]=x.useState(!1),[$,K]=x.useState({});async function W(M){u(!0),h("");try{const U=await xe(`/api/hf/search?q=${encodeURIComponent(M)}`);o(U.results),U.results.length||h("Keine Ergebnisse.")}catch(U){h(`Suche fehlgeschlagen: ${U}`)}finally{u(!1)}}x.useEffect(()=>{W("")},[]);function ve(M){p(M.key),n(""),W(M.q)}function ue(){p(""),W(r)}async function pe(M,U,ne){z(!1);try{const ee=await xe(`/api/fit?params_b=0&quant=${encodeURIComponent(U)}&ctx=8192&name=${encodeURIComponent(M)}&role=${encodeURIComponent(ne)}`);D(ee)}catch{D(null)}}async function oe(M){if(S===M){w(null);return}w(M),N([]),D(null),_(""),z(!1),h("Analysiere Repository…");try{const U=await xe(`/api/hf/quants?repo=${encodeURIComponent(M)}`);N(U.quants);const ne=U.quants.includes("Q4_K_M")?"Q4_K_M":U.quants[0]||"Q4_K_M";A(ne),h(U.quants.length?"":"Keine GGUF-Dateien in diesem Repo gefunden."),U.quants.length&&pe(U.repo,ne,"")}catch(U){h(`Fehler: ${U}`)}}function le(){const M=v.trim();M&&(o(U=>U.some(ne=>ne.repo===M)?U:[{repo:M,downloads:0,likes:0},...U]),b(""),oe(M))}const Z=C?t.find(M=>(M.role||"").toLowerCase()===C):void 0;async function ie(M){if((O==null?void 0:O.fit.level)==="too_tight"&&!B){z(!0);return}K(U=>({...U,[M]:"Starte…"}));try{await xe("/api/models/install",{method:"POST",body:JSON.stringify({repo:M,quant:E,role:C||void 0,jinja:!0})}),K(U=>({...U,[M]:"Download läuft"})),z(!1)}catch{K(ne=>({...ne,[M]:"Fehler"}))}}const te=M=>{var ne;const U=((ne=M.split("/").pop())==null?void 0:ne.toLowerCase().replace(/-gguf$/i,""))||"";return U.length>3&&t.some(ee=>ee.name.toLowerCase().includes(U))},I=M=>M==="perfect"?"text-emerald-400 border-emerald-500/40 bg-emerald-500/10":M==="marginal"?"text-amber-400 border-amber-500/40 bg-amber-500/10":"text-red-400 border-red-500/40 bg-red-500/10";return l.jsxs("div",{className:"space-y-5",children:[l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx(Js,{className:"absolute left-3 top-2.5 h-4 w-4 text-muted-foreground"}),l.jsx("input",{value:r,onChange:M=>n(M.target.value),onKeyDown:M=>M.key==="Enter"&&ue(),"aria-label":"HuggingFace durchsuchen",type:"search",spellCheck:!1,placeholder:"HuggingFace durchsuchen (z.B. Qwen Coder, Llama-3.1, gemma)…",className:"w-full h-10 pl-9 pr-3 rounded-xl border border-border/60 bg-background/40 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]}),l.jsx("button",{onClick:ue,className:"h-10 px-5 rounded-xl bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all cursor-pointer",children:"Suchen"})]}),l.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:_R.map(M=>l.jsxs("button",{onClick:()=>ve(M),className:J("flex items-center gap-1.5 rounded-full px-3 py-1.5 text-[11px] font-semibold transition-all cursor-pointer border",m===M.key?"bg-primary/15 text-primary border-primary/30":"border-border/50 text-muted-foreground hover:text-foreground hover:border-border"),children:[M.key==="popular"&&l.jsx(HM,{className:"h-3 w-3"}),M.label]},M.key))}),c?l.jsx("div",{className:"text-xs text-muted-foreground py-10 text-center",children:"Lade GGUF-Modelle von HuggingFace…"}):l.jsxs("div",{className:"space-y-2",children:[i.map(M=>{const U=S===M.repo,ne=te(M.repo),ee=M.repo.includes("/")?M.repo.split("/")[0]:"—",X=M.repo.split("/").pop();return l.jsxs("div",{className:J("rounded-xl border bg-card/45 backdrop-blur-md transition-all",U?"border-primary/40 shadow-lg shadow-primary/5":"border-border/50 hover:border-primary/30"),children:[l.jsxs("button",{onClick:()=>oe(M.repo),className:"w-full flex items-center gap-3 p-3.5 text-left cursor-pointer",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("span",{className:"text-xs font-bold font-mono text-foreground truncate max-w-[280px]",title:M.repo,children:X}),ne&&l.jsxs("span",{className:"flex items-center gap-1 text-[8px] font-bold text-emerald-400 uppercase tracking-wider bg-emerald-500/10 border border-emerald-500/20 px-1.5 py-0.5 rounded",children:[l.jsx(Mt,{className:"h-2.5 w-2.5"})," installiert"]})]}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-3 mt-0.5 font-mono",children:[l.jsx("span",{children:ee}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Fs,{className:"h-3 w-3"})," ",hk(M.downloads)]}),M.likes>0&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(QM,{className:"h-3 w-3"})," ",hk(M.likes)]})]})]}),U?l.jsx(e5,{className:"h-4 w-4 text-muted-foreground shrink-0"}):l.jsx(eu,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),U&&l.jsx("div",{className:"border-t border-border/30 p-3.5 space-y-3",children:k.length===0?l.jsx("div",{className:"text-[11px] text-muted-foreground font-mono",children:f||"Lade Quants…"}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Quant"}),l.jsx("select",{value:E,onChange:ae=>{A(ae.target.value),pe(M.repo,ae.target.value,C)},"aria-label":"Quantisierung",className:"h-8 rounded-lg border border-border/60 bg-background/40 px-2 text-xs text-foreground font-semibold outline-none",children:k.map(ae=>l.jsx("option",{value:ae,className:"bg-popover text-foreground",children:ae},ae))}),l.jsx("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground ml-1",children:"Rolle"}),l.jsxs("select",{value:C,onChange:ae=>{_(ae.target.value),pe(M.repo,E,ae.target.value)},"aria-label":"Rolle",title:"Optional — bestimmt Auto-Konfiguration + setup-bewussten Kontext",className:"h-8 rounded-lg border border-border/60 bg-background/40 px-2 text-xs text-foreground font-semibold outline-none",children:[l.jsx("option",{value:"",className:"bg-popover text-foreground",children:"keine"}),MR.map(ae=>l.jsx("option",{value:ae,className:"bg-popover text-foreground",children:ae},ae))]}),l.jsx("button",{onClick:()=>ie(M.repo),disabled:!!$[M.repo]&&$[M.repo]==="Download läuft",className:J("h-8 px-3.5 ml-auto rounded-lg text-xs font-semibold transition-all cursor-pointer flex items-center gap-1.5",B?"bg-red-500 text-white hover:opacity-90":"bg-primary text-primary-foreground hover:opacity-90"),children:$[M.repo]?$[M.repo]:B?l.jsxs(l.Fragment,{children:[l.jsx(vr,{className:"h-3.5 w-3.5"})," OOM — trotzdem laden"]}):l.jsxs(l.Fragment,{children:[l.jsx(Fs,{className:"h-3.5 w-3.5"})," Herunterladen"]})})]}),O&&l.jsxs("div",{className:J("flex flex-wrap items-center gap-x-3 gap-y-1 rounded-lg border px-3 py-2 text-[11px] font-medium",I(O.fit.level)),children:[l.jsx("span",{className:"font-bold uppercase tracking-wide",children:O.fit.text}),l.jsxs("span",{className:"font-mono opacity-90",children:["~",O.params_b,"B · ~",O.fit.req_gb," GB / ",O.sys_ram_gb," GB · ~",O.fit.tps," t/s"]}),O.fit.level!=="too_tight"?l.jsxs("span",{className:"font-mono opacity-80",children:["ctx → ",(O.assigned_ctx/1024).toFixed(0),"k"]}):l.jsx("span",{className:"opacity-90",children:"— passt nicht, würde beim Laden abstürzen (OOM)."})]}),Z&&l.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-[11px] text-amber-400",children:[l.jsx(vr,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),l.jsxs("span",{children:["Rolle ",l.jsxs("strong",{children:["„",C,'"']})," hält aktuell ",l.jsx("strong",{children:Z.name.split("/").pop()})," — wird beim Download übernommen."]})]})]})})]},M.repo)}),!i.length&&!c&&l.jsx("div",{className:"text-xs text-muted-foreground py-10 text-center",children:f||"Keine Ergebnisse."})]}),l.jsxs("div",{className:"border-t border-border/30 pt-4 flex flex-col sm:flex-row gap-2 items-stretch sm:items-center",children:[l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground shrink-0",children:"Direkt:"}),l.jsx("input",{value:v,onChange:M=>b(M.target.value),onKeyDown:M=>M.key==="Enter"&&le(),"aria-label":"Repository oder URL direkt eingeben",spellCheck:!1,placeholder:"org/repo oder HF-URL (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 font-mono"}),l.jsx("button",{onClick:le,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:"Laden"})]})]})}const DR={fast:{title:"Schnelles Alltags-Hirn",desc:"Schnelle MoE-Antworten für Chat, Zusammenfassungen und alltägliche Aufgaben.",icon:ka},heavy:{title:"Schweres Reasoning",desc:"Große Modelle für komplexe Logik, Mathematik und tiefgründiges Planen.",icon:Na},coder:{title:"Coden & Entwicklung",desc:"Autovervollständigung, Refactoring und Codegenerierung direkt in deiner IDE.",icon:zs},vision:{title:"Bilder & Vision",desc:"Verarbeitet Bilder, Screenshots und visuelle Diagramme in multimodalen Chats.",icon:Ec},hermes:{title:"Lucys Hirn (Agent)",desc:"Lucys dauer-warmes Agent-Hirn mit Tool-Calling — bleibt ko-resident, lädt nie kalt nach.",icon:_M},scout:{title:"Multimodal-Allrounder",desc:"Multimodaler Allrounder für schnelle Antworten, Übersetzungen und Alltag.",icon:mv},kritiker:{title:"Kritisches Prüf-Hirn",desc:"Schärfer Blick für Fehler, Schwachstellen und Sicherheitslücken — denkt skeptisch, bevor du deployst.",icon:u5},reranker:{title:"Gedächtnis-Sortierer",desc:"Sortiert und gewichtet gespeicherte Fakten nach Relevanz — damit die richtige Info sofort da ist.",icon:Js}};function RR(){const{data:e,isLoading:t,error:r}=xR(),{data:n}=Ei(),{data:i}=kh(),o=(n==null?void 0:n.models)??[],c=r?String(r):"",[u,f]=x.useState({}),[h,m]=x.useState({}),[p,v]=x.useState("recommended");async function b(S,w,k,N){f(E=>({...E,[S]:"Starte..."}));try{await xe("/api/models/install",{method:"POST",body:JSON.stringify({repo:S,role:w,quant:k,jinja:N})}),f(E=>({...E,[S]:"Download läuft"}))}catch{f(A=>({...A,[S]:"Fehler"}))}}return l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{className:"flex rounded-xl border border-border/60 bg-card/45 backdrop-blur-md p-1 w-fit",children:[["recommended","Empfohlen"],["browse","Stöbern & Suchen"]].map(([S,w])=>l.jsx("button",{onClick:()=>v(S),className:J("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide transition-all cursor-pointer",p===S?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:w},S))}),p==="browse"?l.jsx(TR,{}):t?l.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Analysiere Hardware und suche passende GGUF-Empfehlungen…"}):c||!e?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 (",c,")."]}):l.jsxs("div",{className:"space-y-8",children:[l.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-4 rounded-xl flex flex-col sm:flex-row sm:items-center justify-between gap-3 shadow-sm",children:[l.jsxs("div",{children:["Modell-Registry geladen für ",l.jsxs("span",{className:"text-foreground font-bold",children:[e.sys_ram_gb," GB"]})," System-RAM."]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(yI,{className:"h-3.5 w-3.5 text-primary fill-primary/20"}),l.jsx("span",{children:"Empfehlungen sind automatisch auf deine Box-Hardware optimiert."})]})]}),l.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:e.categories.map(S=>{const w=DR[S.role]||{title:S.title||S.role,desc:"Spezifisches Modell für diese Systemrolle.",icon:a5},k=w.icon,N=o.find(D=>D.role===S.role||(D.aliases||[]).includes(S.role)),E=i==null?void 0:i.model_list.find(D=>D.role===S.role),A=S.models.find(D=>D.repo===S.recommended)||S.models[0];if(!A)return null;const C=u[A.repo],_=S.models.filter(D=>D.repo!==S.recommended),O=!!h[S.role];return l.jsxs("div",{className:J("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-5 transition-all duration-300 hover:border-primary/40",N?"border-border/60":"border-primary/20 shadow-primary/5"),children:[l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 border border-primary/20 flex items-center justify-center text-primary shadow-sm shrink-0",children:l.jsx(k,{className:"h-5.5 w-5.5"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-bold tracking-tight text-foreground",children:w.title}),l.jsxs("span",{className:"text-[9px] font-mono text-muted-foreground uppercase bg-background/50 px-1.5 py-0.5 rounded border border-border/30 inline-block mt-0.5",children:["Rolle: ",S.role]})]})]}),N?l.jsxs("span",{className:"flex items-center gap-1.5 text-[9px] font-bold text-emerald-400 uppercase tracking-wider bg-emerald-500/10 border border-emerald-500/20 px-2.5 py-1 rounded-lg",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"Aktiviert"]}):l.jsx("span",{className:"text-[9px] font-bold text-primary/70 uppercase tracking-wider bg-primary/10 border border-primary/20 px-2.5 py-1 rounded-lg",children:"Frei"})]}),l.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:w.desc}),l.jsx("div",{className:"p-3.5 rounded-xl bg-background/35 border border-border/30 space-y-2.5",children:N?l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-muted-foreground/60",children:"Aktive GGUF-Belegung"}),l.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:N.name,children:N.name.split("/").pop()}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2",children:[l.jsxs("span",{children:["Größe: ",Sv(N.size_bytes||0)]}),l.jsx("span",{children:"•"}),l.jsxs("span",{children:["Quant: ",N.quant||"GGUF"]})]})]}):l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-primary/80",children:"Empfohlenes Modell"}),l.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:A.name,children:A.name}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 flex-wrap",children:[l.jsxs("span",{children:["Ersteller: ",A.author]}),l.jsx("span",{children:"•"}),l.jsxs("span",{children:["Quant: ",A.quant]})]}),l.jsx("div",{className:"flex items-center gap-1.5 pt-0.5",children:l.jsx(NR,{fit:A.fit})})]})}),l.jsx("div",{className:"pt-1",children:N?E?l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1.5",children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),l.jsxs("span",{children:["Bessere Version in der Registry: ",E.repo.split("/").pop()]})]}),l.jsxs("button",{onClick:()=>b(E.repo,S.role,A.quant||"Q4_K_M",A.caps.tools!=="no"),disabled:!!u[E.repo],className:"h-8 w-full flex items-center justify-center gap-1.5 rounded-lg bg-amber-500 text-black text-xs font-bold hover:bg-amber-400 disabled:opacity-50 transition-all cursor-pointer shadow-md shadow-amber-500/10",children:[l.jsx(Fs,{className:"h-3.5 w-3.5"}),u[E.repo]||"Auf neue Version aktualisieren"]})]}):l.jsxs("div",{className:"h-8 flex items-center justify-center gap-1.5 text-[10px] font-bold text-emerald-400 uppercase tracking-wide bg-emerald-500/5 border border-emerald-500/10 rounded-lg select-none",children:[l.jsx(Mt,{className:"h-4 w-4"})," Auf neuestem Stand"]}):l.jsxs("button",{onClick:()=>b(A.repo,S.role,A.quant||"Q4_K_M",A.caps.tools!=="no"),disabled:!!C,className:J("h-8 w-full flex items-center justify-center gap-1.5 rounded-lg text-xs font-bold transition-all cursor-pointer border",C?"border-primary/40 bg-primary/5 text-primary":"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/10"),children:[l.jsx(Fs,{className:"h-3.5 w-3.5"}),C||"Optimales Modell einsetzen"]})})]}),_.length>0&&l.jsxs("div",{className:"border-t border-border/20 pt-3",children:[l.jsxs("button",{onClick:()=>m(D=>({...D,[S.role]:!O})),className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/80 hover:text-foreground transition-colors cursor-pointer",children:[O?l.jsx(e5,{className:"h-3 w-3"}):l.jsx(eu,{className:"h-3 w-3"}),l.jsxs("span",{children:["Alternative Empfehlungen anzeigen (",_.length,")"]})]}),O&&l.jsx("div",{className:"mt-2.5 space-y-2 max-h-36 overflow-y-auto pr-1 scrollbar-thin",children:_.map(D=>l.jsxs("div",{className:"p-2 rounded-lg bg-background/25 border border-border/20 flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[10px] font-mono font-bold text-foreground truncate",title:D.name,children:D.name}),l.jsxs("div",{className:"text-[9px] text-muted-foreground flex items-center gap-1.5 mt-0.5",children:[l.jsxs("span",{children:["Quant: ",D.quant]}),l.jsx("span",{children:"•"}),l.jsx("span",{children:D.fit.text})]})]}),l.jsx("button",{onClick:()=>b(D.repo,S.role,D.quant||"Q4_K_M",D.caps.tools!=="no"),disabled:!!u[D.repo],className:"h-6 px-2.5 rounded bg-background/40 hover:bg-background/80 border border-border/40 text-[9px] font-bold text-foreground transition-all cursor-pointer shrink-0 disabled:opacity-50",children:u[D.repo]||"Installieren"})]},D.repo))})]})]},S.role)})})]})]})}function LR(){const[e,t]=x.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-Manager"}),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(r=>l.jsx("button",{onClick:()=>t(r),className:J("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",e===r?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:r==="cockpit"?"Werkbank":"Modelle finden"},r))})]}),l.jsx(kR,{}),l.jsx("div",{className:"transition-all duration-300",children:e==="cockpit"?l.jsx(CR,{}):l.jsx(RR,{})})]})}const $R={hermes_desktop:"Hermes Desktop: Browser-Login",kilo:"Kilo: Einstellungen → API Provider",claude_code:"env / Übersetzer"};function mk({line:e,loading:t}){return t||!e?l.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold text-muted-foreground",children:[l.jsx(Bt,{className:"h-3 w-3 animate-spin"})," prüfe…"]}):e.ok?l.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold text-emerald-400",children:[l.jsx(t5,{className:"h-3 w-3"})," ",e.detail]}):l.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold text-red-400",children:[l.jsx(LM,{className:"h-3 w-3"})," ",e.detail]})}function pk({tool:e,fileName:t,accent:r,copied:n,onCopy:i}){return 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"}),l.jsx("span",{className:"h-3 w-3 rounded-full bg-amber-500/80"}),l.jsx("span",{className:"h-3 w-3 rounded-full bg-emerald-500/80"})]}),l.jsx("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("span",{children:t})}),l.jsxs("button",{onClick:i,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:[n?l.jsx(Mt,{className:"h-3.5 w-3.5 text-emerald-400"}):l.jsx(pv,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:n?"Kopiert":"Kopieren"})]})]}),l.jsx("pre",{className:J("p-5 overflow-x-auto text-xs font-mono whitespace-pre leading-relaxed scrollbar-thin select-text bg-black/10",r==="teal"?"text-cyan-200/90":"text-violet-200/90"),children:l.jsx("code",{children:e.snippet})})]})}function dE(){const[e,t]=x.useState(localStorage.getItem("mc_host")||"192.168.178.151"),[r,n]=x.useState(localStorage.getItem("mc_mcp_path")||""),[i,o]=x.useState("hermes_desktop"),[c,u]=x.useState(null),f=new URLSearchParams({host:e});r&&f.set("mcp_path",r);const{data:h,error:m}=bR(f.toString()),{data:p,isLoading:v}=lE(),b=m?String(m):"";function S(E){t(E),E&&localStorage.setItem("mc_host",E)}function w(E){n(E),localStorage.setItem("mc_mcp_path",E)}const k=h==null?void 0:h.tools[i];async function N(E,A){A&&(await navigator.clipboard.writeText(A),u(E),setTimeout(()=>u(null),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.jsxs("p",{className:"text-sm text-muted-foreground",children:["Binde deinen lokalen Agenten an die Box an — über ",l.jsx("span",{className:"text-foreground",children:"zwei getrennte Leitungen"}),": das Modell (Gateway) und das geteilte Gedächtnis (MCP)."]})]}),l.jsxs("div",{className:"p-5 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md shadow-lg shadow-black/10",children:[l.jsxs("div",{className:"grid gap-4 md:grid-cols-[170px_1fr] items-center",children:[l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-background/40 p-4 text-center",children:[l.jsx(ZM,{className:"h-7 w-7 mx-auto text-muted-foreground"}),l.jsx("div",{className:"mt-2 text-sm font-semibold text-foreground",children:"Dein lokaler Agent"}),l.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Hermes Desktop · Kilo Code · Claude Code …"})]}),l.jsxs("div",{className:"flex flex-col gap-2.5",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(hf,{className:"h-4 w-4 text-muted-foreground shrink-0"}),l.jsxs("div",{className:"flex-1 rounded-xl border border-primary/25 bg-primary/5 px-3.5 py-2.5",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-primary",children:[l.jsx(wi,{className:"h-3.5 w-3.5"})," Leitung 1 — Modell"]}),l.jsx(mk,{line:p==null?void 0:p.gateway,loading:v})]}),l.jsx("div",{className:"mt-1 text-[11px] font-mono text-primary/80",children:"Gateway · :9001/v1 · Lanes chat / coding"})]})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(hf,{className:"h-4 w-4 text-muted-foreground shrink-0"}),l.jsxs("div",{className:"flex-1 rounded-xl border border-violet-500/25 bg-violet-500/5 px-3.5 py-2.5",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-violet-300",children:[l.jsx(Na,{className:"h-3.5 w-3.5"})," Leitung 2 — Gedächtnis"]}),l.jsx(mk,{line:p==null?void 0:p.memory,loading:v})]}),l.jsx("div",{className:"mt-1 text-[11px] font-mono text-violet-300/80",children:"MCP · mcp_memory.py · separat"})]})]})]})]}),l.jsxs("p",{className:"mt-3.5 text-[11px] text-muted-foreground leading-relaxed",children:["Der Gateway liefert ",l.jsx("span",{className:"text-foreground",children:"nur das LLM"}),". Das geteilte Gedächtnis läuft über einen",l.jsx("span",{className:"text-foreground",children:" eigenen MCP-Server"})," — beide werden unabhängig eingerichtet."]})]}),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(VM,{className:"h-3.5 w-3.5 text-primary"})," Box LAN IP-Adresse"]}),l.jsx("input",{value:e,onChange:E=>S(E.target.value),"aria-label":"Box LAN IP-Adresse",spellCheck:!1,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(n5,{className:"h-3.5 w-3.5 text-violet-400"})," Lokaler MCP-Scriptpfad",l.jsx("span",{className:"text-violet-400/70 normal-case font-semibold tracking-normal",children:"(nur Leitung 2)"})]}),l.jsx("input",{value:r,onChange:E=>w(E.target.value),"aria-label":"Lokaler MCP-Scriptpfad",spellCheck:!1,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-violet-500/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]}),h&&l.jsxs("div",{className:"grid gap-5 lg:grid-cols-2",children:[l.jsxs("div",{className:"space-y-3 rounded-2xl border border-border/60 border-t-2 border-t-primary/70 bg-card/30 p-4",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-space font-bold text-foreground",children:[l.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-md bg-primary/15 text-primary text-[11px]",children:"1"}),"Modell anbinden"]}),l.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"Wähle dein Tool — das Snippet zeigt auf den Gateway."})]}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(h.tools).map(([E,A])=>l.jsx("button",{onClick:()=>o(E),className:J("rounded-lg px-3 py-1.5 text-[11px] font-semibold tracking-wide transition-all cursor-pointer",i===E?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"border border-border/50 text-muted-foreground hover:text-foreground"),children:A.label},E))}),k&&l.jsxs(l.Fragment,{children:[k.note&&l.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-primary/5 border border-primary/20 text-[11px] text-muted-foreground leading-relaxed",children:[l.jsx(Dw,{className:"h-4 w-4 text-primary shrink-0 mt-0.5"}),l.jsx("span",{children:k.note})]}),l.jsx(pk,{tool:k,fileName:$R[i]||"config.json",accent:"teal",copied:c==="model",onCopy:()=>N("model",k.snippet)})]})]}),l.jsxs("div",{className:"space-y-3 rounded-2xl border border-border/60 border-t-2 border-t-violet-500/70 bg-card/30 p-4",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-space font-bold text-foreground",children:[l.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-md bg-violet-500/15 text-violet-300 text-[11px]",children:"2"}),"Gedächtnis anbinden",l.jsx("span",{className:"text-[10px] font-medium text-muted-foreground normal-case",children:"optional"})]}),l.jsxs("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:["Ein MCP-Block — gilt zusätzlich für ",l.jsx("em",{children:"jedes"})," Tool aus Schritt 1."]})]}),l.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-violet-500/5 border border-violet-500/20 text-[11px] text-muted-foreground leading-relaxed",children:[l.jsx(Dw,{className:"h-4 w-4 text-violet-400 shrink-0 mt-0.5"}),l.jsx("span",{children:h.memory.note})]}),l.jsx(pk,{tool:h.memory,fileName:"mcp.json",accent:"violet",copied:c==="memory",onCopy:()=>N("memory",h.memory.snippet)})]})]})]})}const zR="modulepreload",FR=function(e){return"/"+e},gk={},BR=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){let c=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),f=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));i=c(r.map(h=>{if(h=FR(h),h in gk)return;gk[h]=!0;const m=h.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${p}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":zR,m||(v.as="script"),v.crossOrigin="",v.href=h,f&&v.setAttribute("nonce",f),document.head.appendChild(v),m)return new Promise((b,S)=>{v.addEventListener("load",b),v.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return i.then(c=>{for(const u of c||[])u.status==="rejected"&&o(u.reason);return t().catch(o)})};class UR extends x.Component{constructor(){super(...arguments);is(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}render(){return this.state.error?l.jsxs("div",{className:"h-[480px] rounded-2xl border border-red-500/20 bg-red-500/5 p-6 text-xs text-red-400 overflow-auto",children:[l.jsx("div",{className:"font-semibold mb-2",children:"Graph konnte nicht gerendert werden"}),l.jsx("pre",{className:"whitespace-pre-wrap break-words text-[11px] leading-relaxed",children:this.state.error.message})]}):this.props.children}}const WR=x.lazy(()=>BR(()=>import("./GraphView-tjR4wIPi.js"),[]).then(e=>({default:e.GraphView}))),$d=["identity","knowledge","rules","events"],vk=new Set(["auto","agent","hermes"]),gg={identity:{label:"Identität",icon:wI,bg:"bg-cyan-500/10",text:"text-cyan-400"},knowledge:{label:"Wissen",icon:el,bg:"bg-indigo-500/10",text:"text-indigo-400"},rules:{label:"Regeln",icon:hI,bg:"bg-violet-500/10",text:"text-violet-400"},events:{label:"Ereignisse",icon:ph,bg:"bg-amber-500/10",text:"text-amber-400"}},xk={label:"Gedächtnis",icon:hv,text:"text-muted-foreground"},HR={identity:"border-l-cyan-500/80",knowledge:"border-l-indigo-500/80",rules:"border-l-violet-500/80",events:"border-l-amber-500/80"},yk=`Hi Hermes! Lass uns ein kurzes Onboarding machen, damit du dich künftig an mich erinnerst. Stell mir nacheinander ein paar kurze Fragen zu: +Trotzdem exklusiv laden?`,()=>oe(X));return}oe(X)}async function Z(X){const ae=p.find(me=>me.name===X);if(ae&&b(ae.role)){c("Geschützt",`„${dt(ae.role).label}" ist lebenswichtig und bleibt geladen.`);return}try{await xe(`/api/models/${encodeURIComponent(X)}/unload`,{method:"POST"}),z()}catch(me){c("Fehler",`Entladen fehlgeschlagen: ${me.message||me}`)}}async function ie(X,ae){try{const me=await xe(`/api/models/${encodeURIComponent(ae)}/role`,{method:"POST",body:JSON.stringify({role:X||null})});z(),me!=null&&me.warning&&c("Rolle gesetzt — Hinweis",me.warning)}catch(me){c("Fehler",`Rolle zuweisen fehlgeschlagen: ${me.message||me}`)}}async function te(X,ae){let me=null;try{me=await xe(`/api/models/${encodeURIComponent(X)}/ctx/auto`)}catch{}const re=me?`Optimal für dein Setup: ${(me.ctx/1024).toFixed(0)}k (${me.ctx}). »Auto« trägt diesen Wert ein.`:"Gib die gewünschte Kontextlänge in Tokens an:";f("Kontextlänge anpassen",re,String(ae||32768),async ye=>{if(ye)try{await xe(`/api/models/${encodeURIComponent(X)}/ctx`,{method:"POST",body:JSON.stringify({ctx:parseInt(ye,10)})}),z()}catch(Oe){c("Fehler",`Kontext setzen fehlgeschlagen: ${Oe.message||Oe}`)}},void 0,me?{autoValue:String(me.ctx),autoLabel:`Auto (${(me.ctx/1024).toFixed(0)}k)`}:void 0)}async function I(X){const ae=p.find(me=>me.name===X);if(ae&&b(ae.role)){c("Geschützt",`„${dt(ae.role).label}" kann nicht gelöscht werden. Weise die Rolle zuerst einem anderen Modell zu.`);return}u("Modell löschen?",`„${Va(X)}" und alle GGUF-Dateien unwiderruflich von der Box löschen?`,async()=>{try{await xe(`/api/models/${encodeURIComponent(X)}`,{method:"DELETE"}),N===X&&E(null),z()}catch(me){c("Fehler",`Löschen fehlgeschlagen: ${me.message||me}`)}})}return r?l.jsx("div",{className:"py-16 text-center text-xs text-muted-foreground",children:"Werkbank wird geladen …"}):n?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 (",String(n),")."]}):l.jsxs("div",{className:"space-y-5",children:[l.jsx(AL,{running:$,capacityBytes:ve,realUsedBytes:W,selected:N,onSelect:E}),l.jsxs("div",{className:"grid gap-5 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.3fr)]",children:[l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-4 shadow-lg shadow-black/15 backdrop-blur-md",children:[l.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx(Js,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground/60"}),l.jsx("input",{value:A,onChange:X=>C(X.target.value),placeholder:"Modell suchen …",className:"h-8 w-full rounded-lg border border-border/40 bg-background/40 pl-8 pr-2 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-primary/50 focus:outline-none"})]}),l.jsx("div",{className:"flex rounded-lg border border-border/40 bg-background/30 p-0.5",children:["all","in_use"].map(X=>l.jsx("button",{onClick:()=>O(X),className:J("rounded-md px-2 py-1 text-[9px] font-bold uppercase transition-all cursor-pointer",_===X?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:X==="all"?"Alle":"In Benutzung"},X))})]}),l.jsx("div",{className:"max-h-[60vh] space-y-1.5 overflow-y-auto scrollbar-thin pr-1",children:ue.length===0?l.jsx("div",{className:"rounded-xl border border-dashed border-border/50 p-8 text-center text-xs text-muted-foreground",children:"Keine Modelle."}):ue.map(X=>{const ae=v.includes(X.name),me=N===X.name,re=vf(X.name),ye=xf(X.role);return l.jsxs("button",{onClick:()=>E(X.name),className:J("flex w-full items-center gap-2.5 rounded-xl border p-2.5 text-left transition-all cursor-pointer",me?"border-primary/60 bg-primary/10":"border-border/40 bg-background/20 hover:border-primary/30 hover:bg-background/40"),children:[l.jsx("span",{className:J("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border text-[10px] font-bold",re.color),children:re.initial}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("div",{className:"truncate font-mono text-xs font-semibold text-foreground",children:Va(X.name)}),l.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5",children:[X.role&&l.jsx("span",{className:J("h-2 w-2 rounded-sm",ye.dot)}),l.jsx("span",{className:"text-[10px] text-muted-foreground",children:X.role?dt(X.role).short:"keine Rolle"}),l.jsxs("span",{className:"text-[10px] text-muted-foreground/50",children:["· ",lr(X.size_bytes)]})]})]}),ae?l.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[9px] font-bold uppercase text-emerald-400",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"warm"]}):X.incomplete?l.jsx("span",{className:"shrink-0 text-[9px] font-bold uppercase text-amber-400",children:"⚠ fehlt"}):l.jsx("span",{className:"shrink-0 text-[9px] font-semibold uppercase text-muted-foreground/50",children:"bereit"})]},X.name)})})]}),l.jsx("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-5 shadow-lg shadow-black/15 backdrop-blur-md",children:pe?l.jsx(PL,{m:pe,warm:v.includes(pe.name),expert:m,protectedRole:b(pe.role),coresident:k(pe.name),onLoad:()=>le(pe.name),onUnload:()=>Z(pe.name),onRole:X=>ie(X,pe.name),onCtx:()=>te(pe.name,pe.ctx),onSpec:()=>B(pe),onDelete:()=>I(pe.name)}):l.jsxs("div",{className:"flex h-full min-h-[16rem] flex-col items-center justify-center gap-2 text-center text-muted-foreground",children:[l.jsx(wi,{className:"h-8 w-8 opacity-40"}),l.jsx("p",{className:"text-sm font-semibold",children:"Links ein Modell wählen"}),l.jsx("p",{className:"text-xs",children:"Dann verwaltest du es hier — laden, Rolle, Kontext, löschen."})]})})]}),D&&l.jsx(dE,{model:D,onClose:()=>B(null),onChanged:z}),h]})}function PL({m:e,warm:t,expert:r,protectedRole:n,coresident:i,onLoad:o,onUnload:c,onRole:u,onCtx:f,onSpec:h,onDelete:m}){const p=vf(e.name),v=t&&n;return l.jsxs("div",{className:"flex h-full flex-col gap-4",children:[l.jsxs("div",{className:"flex items-start gap-3",children:[l.jsx("span",{className:J("flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border text-sm font-bold",p.color),children:p.initial}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsx("h2",{className:"break-all font-mono text-sm font-bold text-foreground",children:Va(e.name)}),l.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[e.role?l.jsx(po,{role:e.role}):l.jsx("span",{className:"rounded border border-dashed border-border/50 px-1.5 py-0.5 text-[10px] text-muted-foreground",children:"keine Rolle"}),n&&l.jsxs("span",{className:"rounded bg-background/40 px-1.5 py-0.5 text-[10px] text-muted-foreground",title:"Lebenswichtig — geschützt",children:[l.jsx(s5,{className:"mr-0.5 inline h-3 w-3"}),"geschützt"]}),i&&l.jsxs("span",{className:"rounded border border-fuchsia-500/30 bg-fuchsia-500/10 px-1.5 py-0.5 text-[10px] font-bold uppercase text-fuchsia-300",children:[l.jsx(Na,{className:"mr-0.5 inline h-3 w-3"}),"Ko-resident"]}),t&&l.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold uppercase text-emerald-400",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"warm"]})]})]})]}),l.jsxs("button",{onClick:t?c:o,disabled:e.incomplete&&!t||v,className:J("flex h-11 w-full items-center justify-center gap-2 rounded-xl border text-sm font-bold transition-all cursor-pointer disabled:cursor-not-allowed disabled:opacity-50",t?"border-amber-500/40 bg-amber-500/10 text-amber-300 hover:bg-amber-500/20":"border-primary/40 bg-primary/10 text-primary hover:bg-primary/20"),title:v?`„${dt(e.role).label}" bleibt geladen (geschützt).`:void 0,children:[t?l.jsx(lI,{className:"h-4 w-4"}):l.jsx(u5,{className:"h-4 w-4"}),v?"🔒 bleibt geladen":t?"Entladen":"Ins Warm-Set laden"]}),l.jsxs("div",{className:"rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsx("div",{className:"mb-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Rolle"}),l.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[l.jsx(mk,{active:!e.role,onClick:()=>u(""),dot:"bg-slate-400",label:"keine"}),qx.map(b=>l.jsx(mk,{active:e.role===b.role,onClick:()=>u(b.role),dot:xf(b.role).dot,label:b.short},b.role))]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[l.jsx(OL,{icon:xa,label:"Größe",value:lr(e.size_bytes)}),l.jsxs("button",{onClick:f,className:"group flex items-center gap-2 rounded-lg border border-border/30 bg-background/20 p-2.5 text-left transition-colors hover:border-primary/40 cursor-pointer",children:[l.jsx(c5,{className:"h-4 w-4 text-primary/80"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:"Kontext · ändern"}),l.jsx("div",{className:"font-semibold text-foreground",children:Ev(e.ctx)})]})]})]}),l.jsxs("div",{className:"rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[l.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Beschleuniger"}),r&&l.jsxs("button",{onClick:h,className:J("flex h-6 items-center gap-1 rounded-lg border px-2 text-[9px] font-bold uppercase transition-colors cursor-pointer",e.spec_active?"border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10":e.spec_draft_model?"border-amber-500/30 text-amber-400 hover:bg-amber-500/10":"border-border/40 text-muted-foreground hover:bg-accent"),children:[l.jsx(ka,{className:"h-3 w-3"})," Spec"]})]}),l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.spec_active&&l.jsx($d,{tone:"emerald",label:"Spec-Decoding aktiv"}),!e.spec_active&&e.spec_draft_model&&l.jsx($d,{tone:"amber",label:"Spec inaktiv"}),e.prompt_cache&&l.jsx($d,{tone:"cyan",label:"Prompt-Cache"}),e.parallel_slots>1&&l.jsx($d,{tone:"violet",label:`${e.parallel_slots} Slots`}),!e.spec_active&&!e.spec_draft_model&&!e.prompt_cache&&e.parallel_slots<=1&&l.jsx("span",{className:"text-[11px] text-muted-foreground/60",children:"keine aktiv"})]})]}),l.jsx("div",{className:"flex flex-wrap gap-1",children:l.jsx(Av,{caps:e.capabilities})}),l.jsxs("button",{onClick:m,disabled:n,className:J("mt-auto flex h-9 items-center justify-center gap-1.5 rounded-lg border text-xs font-semibold transition-colors",n?"cursor-not-allowed border-border/30 text-muted-foreground/40":"border-red-500/30 text-red-400 hover:bg-red-500/10 cursor-pointer"),children:[l.jsx(Oc,{className:"h-3.5 w-3.5"})," ",n?"geschützt — nicht löschbar":"Modell löschen"]})]})}function mk({active:e,onClick:t,dot:r,label:n}){return l.jsxs("button",{onClick:t,className:J("flex items-center gap-1.5 rounded-lg border px-2 py-1 text-[10px] font-semibold transition-all cursor-pointer",e?"border-primary/60 bg-primary/15 text-foreground":"border-border/40 bg-background/20 text-muted-foreground hover:border-primary/30"),children:[l.jsx("span",{className:J("h-2 w-2 rounded-sm",r)}),n,e&&l.jsx(Mt,{className:"h-3 w-3 text-primary"})]})}function OL({icon:e,label:t,value:r}){return l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border/30 bg-background/20 p-2.5",children:[l.jsx(e,{className:"h-4 w-4 text-primary/80"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:t}),l.jsx("div",{className:"font-semibold text-foreground",children:r})]})]})}function $d({tone:e,label:t}){const r={emerald:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",amber:"bg-amber-500/10 text-amber-400 border-amber-500/20",cyan:"bg-cyan-500/10 text-cyan-400 border-cyan-500/20",violet:"bg-violet-500/10 text-violet-400 border-violet-500/20"}[e];return l.jsx("span",{className:J("rounded border px-1.5 py-0.5 text-[10px] font-semibold",r),children:t})}const _L=[{key:"popular",label:"Beliebt",q:""},{key:"coder",label:"Coder",q:"coder"},{key:"vision",label:"Vision",q:"vision"},{key:"reasoning",label:"Reasoning",q:"reasoning"},{key:"small",label:"Klein (≤4B)",q:"3B"}],ML=["fast","heavy","coder","vision","hermes","scout"],IL=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1});function pk(e){return IL.format(e)}function TL(){const{data:e}=Ei(),t=(e==null?void 0:e.models)??[],[r,n]=x.useState(""),[i,o]=x.useState([]),[c,u]=x.useState(!1),[f,h]=x.useState(""),[m,p]=x.useState("popular"),[v,b]=x.useState(""),[S,w]=x.useState(null),[k,N]=x.useState([]),[E,A]=x.useState("Q4_K_M"),[C,_]=x.useState(""),[O,D]=x.useState(null),[B,z]=x.useState(!1),[$,K]=x.useState({});async function W(M){u(!0),h("");try{const U=await xe(`/api/hf/search?q=${encodeURIComponent(M)}`);o(U.results),U.results.length||h("Keine Ergebnisse.")}catch(U){h(`Suche fehlgeschlagen: ${U}`)}finally{u(!1)}}x.useEffect(()=>{W("")},[]);function ve(M){p(M.key),n(""),W(M.q)}function ue(){p(""),W(r)}async function pe(M,U,ne){z(!1);try{const ee=await xe(`/api/fit?params_b=0&quant=${encodeURIComponent(U)}&ctx=8192&name=${encodeURIComponent(M)}&role=${encodeURIComponent(ne)}`);D(ee)}catch{D(null)}}async function oe(M){if(S===M){w(null);return}w(M),N([]),D(null),_(""),z(!1),h("Analysiere Repository…");try{const U=await xe(`/api/hf/quants?repo=${encodeURIComponent(M)}`);N(U.quants);const ne=U.quants.includes("Q4_K_M")?"Q4_K_M":U.quants[0]||"Q4_K_M";A(ne),h(U.quants.length?"":"Keine GGUF-Dateien in diesem Repo gefunden."),U.quants.length&&pe(U.repo,ne,"")}catch(U){h(`Fehler: ${U}`)}}function le(){const M=v.trim();M&&(o(U=>U.some(ne=>ne.repo===M)?U:[{repo:M,downloads:0,likes:0},...U]),b(""),oe(M))}const Z=C?t.find(M=>(M.role||"").toLowerCase()===C):void 0;async function ie(M){if((O==null?void 0:O.fit.level)==="too_tight"&&!B){z(!0);return}K(U=>({...U,[M]:"Starte…"}));try{await xe("/api/models/install",{method:"POST",body:JSON.stringify({repo:M,quant:E,role:C||void 0,jinja:!0})}),K(U=>({...U,[M]:"Download läuft"})),z(!1)}catch{K(ne=>({...ne,[M]:"Fehler"}))}}const te=M=>{var ne;const U=((ne=M.split("/").pop())==null?void 0:ne.toLowerCase().replace(/-gguf$/i,""))||"";return U.length>3&&t.some(ee=>ee.name.toLowerCase().includes(U))},I=M=>M==="perfect"?"text-emerald-400 border-emerald-500/40 bg-emerald-500/10":M==="marginal"?"text-amber-400 border-amber-500/40 bg-amber-500/10":"text-red-400 border-red-500/40 bg-red-500/10";return l.jsxs("div",{className:"space-y-5",children:[l.jsxs("div",{className:"flex gap-2",children:[l.jsxs("div",{className:"relative flex-1",children:[l.jsx(Js,{className:"absolute left-3 top-2.5 h-4 w-4 text-muted-foreground"}),l.jsx("input",{value:r,onChange:M=>n(M.target.value),onKeyDown:M=>M.key==="Enter"&&ue(),"aria-label":"HuggingFace durchsuchen",type:"search",spellCheck:!1,placeholder:"HuggingFace durchsuchen (z.B. Qwen Coder, Llama-3.1, gemma)…",className:"w-full h-10 pl-9 pr-3 rounded-xl border border-border/60 bg-background/40 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]}),l.jsx("button",{onClick:ue,className:"h-10 px-5 rounded-xl bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all cursor-pointer",children:"Suchen"})]}),l.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:_L.map(M=>l.jsxs("button",{onClick:()=>ve(M),className:J("flex items-center gap-1.5 rounded-full px-3 py-1.5 text-[11px] font-semibold transition-all cursor-pointer border",m===M.key?"bg-primary/15 text-primary border-primary/30":"border-border/50 text-muted-foreground hover:text-foreground hover:border-border"),children:[M.key==="popular"&&l.jsx(KM,{className:"h-3 w-3"}),M.label]},M.key))}),c?l.jsx("div",{className:"text-xs text-muted-foreground py-10 text-center",children:"Lade GGUF-Modelle von HuggingFace…"}):l.jsxs("div",{className:"space-y-2",children:[i.map(M=>{const U=S===M.repo,ne=te(M.repo),ee=M.repo.includes("/")?M.repo.split("/")[0]:"—",X=M.repo.split("/").pop();return l.jsxs("div",{className:J("rounded-xl border bg-card/45 backdrop-blur-md transition-all",U?"border-primary/40 shadow-lg shadow-primary/5":"border-border/50 hover:border-primary/30"),children:[l.jsxs("button",{onClick:()=>oe(M.repo),className:"w-full flex items-center gap-3 p-3.5 text-left cursor-pointer",children:[l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("span",{className:"text-xs font-bold font-mono text-foreground truncate max-w-[280px]",title:M.repo,children:X}),ne&&l.jsxs("span",{className:"flex items-center gap-1 text-[8px] font-bold text-emerald-400 uppercase tracking-wider bg-emerald-500/10 border border-emerald-500/20 px-1.5 py-0.5 rounded",children:[l.jsx(Mt,{className:"h-2.5 w-2.5"})," installiert"]})]}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-3 mt-0.5 font-mono",children:[l.jsx("span",{children:ee}),l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(Fs,{className:"h-3 w-3"})," ",pk(M.downloads)]}),M.likes>0&&l.jsxs("span",{className:"flex items-center gap-1",children:[l.jsx(YM,{className:"h-3 w-3"})," ",pk(M.likes)]})]})]}),U?l.jsx(t5,{className:"h-4 w-4 text-muted-foreground shrink-0"}):l.jsx(tu,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),U&&l.jsx("div",{className:"border-t border-border/30 p-3.5 space-y-3",children:k.length===0?l.jsx("div",{className:"text-[11px] text-muted-foreground font-mono",children:f||"Lade Quants…"}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Quant"}),l.jsx("select",{value:E,onChange:ae=>{A(ae.target.value),pe(M.repo,ae.target.value,C)},"aria-label":"Quantisierung",className:"h-8 rounded-lg border border-border/60 bg-background/40 px-2 text-xs text-foreground font-semibold outline-none",children:k.map(ae=>l.jsx("option",{value:ae,className:"bg-popover text-foreground",children:ae},ae))}),l.jsx("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground ml-1",children:"Rolle"}),l.jsxs("select",{value:C,onChange:ae=>{_(ae.target.value),pe(M.repo,E,ae.target.value)},"aria-label":"Rolle",title:"Optional — bestimmt Auto-Konfiguration + setup-bewussten Kontext",className:"h-8 rounded-lg border border-border/60 bg-background/40 px-2 text-xs text-foreground font-semibold outline-none",children:[l.jsx("option",{value:"",className:"bg-popover text-foreground",children:"keine"}),ML.map(ae=>l.jsx("option",{value:ae,className:"bg-popover text-foreground",children:ae},ae))]}),l.jsx("button",{onClick:()=>ie(M.repo),disabled:!!$[M.repo]&&$[M.repo]==="Download läuft",className:J("h-8 px-3.5 ml-auto rounded-lg text-xs font-semibold transition-all cursor-pointer flex items-center gap-1.5",B?"bg-red-500 text-white hover:opacity-90":"bg-primary text-primary-foreground hover:opacity-90"),children:$[M.repo]?$[M.repo]:B?l.jsxs(l.Fragment,{children:[l.jsx(vr,{className:"h-3.5 w-3.5"})," OOM — trotzdem laden"]}):l.jsxs(l.Fragment,{children:[l.jsx(Fs,{className:"h-3.5 w-3.5"})," Herunterladen"]})})]}),O&&l.jsxs("div",{className:J("flex flex-wrap items-center gap-x-3 gap-y-1 rounded-lg border px-3 py-2 text-[11px] font-medium",I(O.fit.level)),children:[l.jsx("span",{className:"font-bold uppercase tracking-wide",children:O.fit.text}),l.jsxs("span",{className:"font-mono opacity-90",children:["~",O.params_b,"B · ~",O.fit.req_gb," GB / ",O.sys_ram_gb," GB · ~",O.fit.tps," t/s"]}),O.fit.level!=="too_tight"?l.jsxs("span",{className:"font-mono opacity-80",children:["ctx → ",(O.assigned_ctx/1024).toFixed(0),"k"]}):l.jsx("span",{className:"opacity-90",children:"— passt nicht, würde beim Laden abstürzen (OOM)."})]}),Z&&l.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-[11px] text-amber-400",children:[l.jsx(vr,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),l.jsxs("span",{children:["Rolle ",l.jsxs("strong",{children:["„",C,'"']})," hält aktuell ",l.jsx("strong",{children:Z.name.split("/").pop()})," — wird beim Download übernommen."]})]})]})})]},M.repo)}),!i.length&&!c&&l.jsx("div",{className:"text-xs text-muted-foreground py-10 text-center",children:f||"Keine Ergebnisse."})]}),l.jsxs("div",{className:"border-t border-border/30 pt-4 flex flex-col sm:flex-row gap-2 items-stretch sm:items-center",children:[l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground shrink-0",children:"Direkt:"}),l.jsx("input",{value:v,onChange:M=>b(M.target.value),onKeyDown:M=>M.key==="Enter"&&le(),"aria-label":"Repository oder URL direkt eingeben",spellCheck:!1,placeholder:"org/repo oder HF-URL (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 font-mono"}),l.jsx("button",{onClick:le,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:"Laden"})]})]})}const DL={fast:{title:"Schnelles Alltags-Hirn",desc:"Schnelle MoE-Antworten für Chat, Zusammenfassungen und alltägliche Aufgaben.",icon:ka},heavy:{title:"Schweres Reasoning",desc:"Große Modelle für komplexe Logik, Mathematik und tiefgründiges Planen.",icon:Na},coder:{title:"Coden & Entwicklung",desc:"Autovervollständigung, Refactoring und Codegenerierung direkt in deiner IDE.",icon:zs},vision:{title:"Bilder & Vision",desc:"Verarbeitet Bilder, Screenshots und visuelle Diagramme in multimodalen Chats.",icon:Ac},hermes:{title:"Lucys Hirn (Agent)",desc:"Lucys dauer-warmes Agent-Hirn mit Tool-Calling — bleibt ko-resident, lädt nie kalt nach.",icon:MM},scout:{title:"Multimodal-Allrounder",desc:"Multimodaler Allrounder für schnelle Antworten, Übersetzungen und Alltag.",icon:pv},kritiker:{title:"Kritisches Prüf-Hirn",desc:"Schärfer Blick für Fehler, Schwachstellen und Sicherheitslücken — denkt skeptisch, bevor du deployst.",icon:d5},reranker:{title:"Gedächtnis-Sortierer",desc:"Sortiert und gewichtet gespeicherte Fakten nach Relevanz — damit die richtige Info sofort da ist.",icon:Js}};function LL(){const{data:e,isLoading:t,error:r}=xL(),{data:n}=Ei(),{data:i}=kh(),o=(n==null?void 0:n.models)??[],c=r?String(r):"",[u,f]=x.useState({}),[h,m]=x.useState({}),[p,v]=x.useState("recommended");async function b(S,w,k,N){f(E=>({...E,[S]:"Starte..."}));try{await xe("/api/models/install",{method:"POST",body:JSON.stringify({repo:S,role:w,quant:k,jinja:N})}),f(E=>({...E,[S]:"Download läuft"}))}catch{f(A=>({...A,[S]:"Fehler"}))}}return l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{className:"flex rounded-xl border border-border/60 bg-card/45 backdrop-blur-md p-1 w-fit",children:[["recommended","Empfohlen"],["browse","Stöbern & Suchen"]].map(([S,w])=>l.jsx("button",{onClick:()=>v(S),className:J("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide transition-all cursor-pointer",p===S?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:w},S))}),p==="browse"?l.jsx(TL,{}):t?l.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Analysiere Hardware und suche passende GGUF-Empfehlungen…"}):c||!e?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 (",c,")."]}):l.jsxs("div",{className:"space-y-8",children:[l.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-4 rounded-xl flex flex-col sm:flex-row sm:items-center justify-between gap-3 shadow-sm",children:[l.jsxs("div",{children:["Modell-Registry geladen für ",l.jsxs("span",{className:"text-foreground font-bold",children:[e.sys_ram_gb," GB"]})," System-RAM."]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(yI,{className:"h-3.5 w-3.5 text-primary fill-primary/20"}),l.jsx("span",{children:"Empfehlungen sind automatisch auf deine Box-Hardware optimiert."})]})]}),l.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:e.categories.map(S=>{const w=DL[S.role]||{title:S.title||S.role,desc:"Spezifisches Modell für diese Systemrolle.",icon:o5},k=w.icon,N=o.find(D=>D.role===S.role||(D.aliases||[]).includes(S.role)),E=i==null?void 0:i.model_list.find(D=>D.role===S.role),A=S.models.find(D=>D.repo===S.recommended)||S.models[0];if(!A)return null;const C=u[A.repo],_=S.models.filter(D=>D.repo!==S.recommended),O=!!h[S.role];return l.jsxs("div",{className:J("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-5 transition-all duration-300 hover:border-primary/40",N?"border-border/60":"border-primary/20 shadow-primary/5"),children:[l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 border border-primary/20 flex items-center justify-center text-primary shadow-sm shrink-0",children:l.jsx(k,{className:"h-5.5 w-5.5"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-bold tracking-tight text-foreground",children:w.title}),l.jsxs("span",{className:"text-[9px] font-mono text-muted-foreground uppercase bg-background/50 px-1.5 py-0.5 rounded border border-border/30 inline-block mt-0.5",children:["Rolle: ",S.role]})]})]}),N?l.jsxs("span",{className:"flex items-center gap-1.5 text-[9px] font-bold text-emerald-400 uppercase tracking-wider bg-emerald-500/10 border border-emerald-500/20 px-2.5 py-1 rounded-lg",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"Aktiviert"]}):l.jsx("span",{className:"text-[9px] font-bold text-primary/70 uppercase tracking-wider bg-primary/10 border border-primary/20 px-2.5 py-1 rounded-lg",children:"Frei"})]}),l.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:w.desc}),l.jsx("div",{className:"p-3.5 rounded-xl bg-background/35 border border-border/30 space-y-2.5",children:N?l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-muted-foreground/60",children:"Aktive GGUF-Belegung"}),l.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:N.name,children:N.name.split("/").pop()}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2",children:[l.jsxs("span",{children:["Größe: ",Nv(N.size_bytes||0)]}),l.jsx("span",{children:"•"}),l.jsxs("span",{children:["Quant: ",N.quant||"GGUF"]})]})]}):l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-primary/80",children:"Empfohlenes Modell"}),l.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:A.name,children:A.name}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 flex-wrap",children:[l.jsxs("span",{children:["Ersteller: ",A.author]}),l.jsx("span",{children:"•"}),l.jsxs("span",{children:["Quant: ",A.quant]})]}),l.jsx("div",{className:"flex items-center gap-1.5 pt-0.5",children:l.jsx(NL,{fit:A.fit})})]})}),l.jsx("div",{className:"pt-1",children:N?E?l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1.5",children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),l.jsxs("span",{children:["Bessere Version in der Registry: ",E.repo.split("/").pop()]})]}),l.jsxs("button",{onClick:()=>b(E.repo,S.role,A.quant||"Q4_K_M",A.caps.tools!=="no"),disabled:!!u[E.repo],className:"h-8 w-full flex items-center justify-center gap-1.5 rounded-lg bg-amber-500 text-black text-xs font-bold hover:bg-amber-400 disabled:opacity-50 transition-all cursor-pointer shadow-md shadow-amber-500/10",children:[l.jsx(Fs,{className:"h-3.5 w-3.5"}),u[E.repo]||"Auf neue Version aktualisieren"]})]}):l.jsxs("div",{className:"h-8 flex items-center justify-center gap-1.5 text-[10px] font-bold text-emerald-400 uppercase tracking-wide bg-emerald-500/5 border border-emerald-500/10 rounded-lg select-none",children:[l.jsx(Mt,{className:"h-4 w-4"})," Auf neuestem Stand"]}):l.jsxs("button",{onClick:()=>b(A.repo,S.role,A.quant||"Q4_K_M",A.caps.tools!=="no"),disabled:!!C,className:J("h-8 w-full flex items-center justify-center gap-1.5 rounded-lg text-xs font-bold transition-all cursor-pointer border",C?"border-primary/40 bg-primary/5 text-primary":"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/10"),children:[l.jsx(Fs,{className:"h-3.5 w-3.5"}),C||"Optimales Modell einsetzen"]})})]}),_.length>0&&l.jsxs("div",{className:"border-t border-border/20 pt-3",children:[l.jsxs("button",{onClick:()=>m(D=>({...D,[S.role]:!O})),className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/80 hover:text-foreground transition-colors cursor-pointer",children:[O?l.jsx(t5,{className:"h-3 w-3"}):l.jsx(tu,{className:"h-3 w-3"}),l.jsxs("span",{children:["Alternative Empfehlungen anzeigen (",_.length,")"]})]}),O&&l.jsx("div",{className:"mt-2.5 space-y-2 max-h-36 overflow-y-auto pr-1 scrollbar-thin",children:_.map(D=>l.jsxs("div",{className:"p-2 rounded-lg bg-background/25 border border-border/20 flex items-center justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[10px] font-mono font-bold text-foreground truncate",title:D.name,children:D.name}),l.jsxs("div",{className:"text-[9px] text-muted-foreground flex items-center gap-1.5 mt-0.5",children:[l.jsxs("span",{children:["Quant: ",D.quant]}),l.jsx("span",{children:"•"}),l.jsx("span",{children:D.fit.text})]})]}),l.jsx("button",{onClick:()=>b(D.repo,S.role,D.quant||"Q4_K_M",D.caps.tools!=="no"),disabled:!!u[D.repo],className:"h-6 px-2.5 rounded bg-background/40 hover:bg-background/80 border border-border/40 text-[9px] font-bold text-foreground transition-all cursor-pointer shrink-0 disabled:opacity-50",children:u[D.repo]||"Installieren"})]},D.repo))})]})]},S.role)})})]})]})}function RL(){const[e,t]=x.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-Manager"}),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(r=>l.jsx("button",{onClick:()=>t(r),className:J("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",e===r?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:r==="cockpit"?"Werkbank":"Modelle finden"},r))})]}),l.jsx(kL,{}),l.jsx("div",{className:"transition-all duration-300",children:e==="cockpit"?l.jsx(CL,{}):l.jsx(LL,{})})]})}const $L={hermes_desktop:"Hermes Desktop: Browser-Login",kilo:"Kilo: Einstellungen → API Provider",claude_code:"env / Übersetzer"};function gg({line:e,loading:t}){return t||!e?l.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold text-muted-foreground",children:[l.jsx(Bt,{className:"h-3 w-3 animate-spin"})," prüfe…"]}):e.ok?l.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold text-emerald-400",children:[l.jsx(r5,{className:"h-3 w-3"})," ",e.detail]}):l.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold text-red-400",children:[l.jsx($M,{className:"h-3 w-3"})," ",e.detail]})}function gk({tool:e,fileName:t,accent:r,copied:n,onCopy:i}){return 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"}),l.jsx("span",{className:"h-3 w-3 rounded-full bg-amber-500/80"}),l.jsx("span",{className:"h-3 w-3 rounded-full bg-emerald-500/80"})]}),l.jsx("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("span",{children:t})}),l.jsxs("button",{onClick:i,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:[n?l.jsx(Mt,{className:"h-3.5 w-3.5 text-emerald-400"}):l.jsx(gv,{className:"h-3.5 w-3.5"}),l.jsx("span",{children:n?"Kopiert":"Kopieren"})]})]}),l.jsx("pre",{className:J("p-5 overflow-x-auto text-xs font-mono whitespace-pre leading-relaxed scrollbar-thin select-text bg-black/10",r==="teal"?"text-cyan-200/90":"text-violet-200/90"),children:l.jsx("code",{children:e.snippet})})]})}function fE(){const[e,t]=x.useState(localStorage.getItem("mc_host")||"192.168.178.151"),[r,n]=x.useState(localStorage.getItem("mc_mcp_path")||""),[i,o]=x.useState("hermes_desktop"),[c,u]=x.useState(null),f=new URLSearchParams({host:e});r&&f.set("mcp_path",r);const{data:h,error:m}=bL(f.toString()),{data:p,isLoading:v}=cE(),b=m?String(m):"";function S(E){t(E),E&&localStorage.setItem("mc_host",E)}function w(E){n(E),localStorage.setItem("mc_mcp_path",E)}const k=h==null?void 0:h.tools[i];async function N(E,A){A&&(await navigator.clipboard.writeText(A),u(E),setTimeout(()=>u(null),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.jsxs("p",{className:"text-sm text-muted-foreground",children:["Binde deinen lokalen Agenten an die Box an — über ",l.jsx("span",{className:"text-foreground",children:"drei getrennte Leitungen"}),": das Modell (Gateway), das geteilte Gedächtnis (MCP) und das Desktop-Gateway."]})]}),l.jsxs("div",{className:"p-5 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md shadow-lg shadow-black/10",children:[l.jsxs("div",{className:"grid gap-4 md:grid-cols-[170px_1fr] items-center",children:[l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-background/40 p-4 text-center",children:[l.jsx(Rw,{className:"h-7 w-7 mx-auto text-muted-foreground"}),l.jsx("div",{className:"mt-2 text-sm font-semibold text-foreground",children:"Dein lokaler Agent"}),l.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Hermes Desktop · Kilo Code · Claude Code …"})]}),l.jsxs("div",{className:"flex flex-col gap-2.5",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(bc,{className:"h-4 w-4 text-muted-foreground shrink-0"}),l.jsxs("div",{className:"flex-1 rounded-xl border border-primary/25 bg-primary/5 px-3.5 py-2.5",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-primary",children:[l.jsx(wi,{className:"h-3.5 w-3.5"})," Leitung 1 — Modell"]}),l.jsx(gg,{line:p==null?void 0:p.gateway,loading:v})]}),l.jsx("div",{className:"mt-1 text-[11px] font-mono text-primary/80",children:"Gateway · :9001/v1 · Lanes chat / coding"})]})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(bc,{className:"h-4 w-4 text-muted-foreground shrink-0"}),l.jsxs("div",{className:"flex-1 rounded-xl border border-violet-500/25 bg-violet-500/5 px-3.5 py-2.5",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-violet-300",children:[l.jsx(Na,{className:"h-3.5 w-3.5"})," Leitung 2 — Gedächtnis"]}),l.jsx(gg,{line:p==null?void 0:p.memory,loading:v})]}),l.jsx("div",{className:"mt-1 text-[11px] font-mono text-violet-300/80",children:"MCP · mcp_memory.py · separat"})]})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(bc,{className:"h-4 w-4 text-muted-foreground shrink-0"}),l.jsxs("div",{className:"flex-1 rounded-xl border border-emerald-500/25 bg-emerald-500/5 px-3.5 py-2.5",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-emerald-300",children:[l.jsx(Rw,{className:"h-3.5 w-3.5"})," Leitung 3 — Desktop-Gateway"]}),l.jsx(gg,{line:p==null?void 0:p.desktop_gateway,loading:v})]}),l.jsx("div",{className:"mt-1 text-[11px] font-mono text-emerald-300/80",children:"Desktop-Gateway · :9119 · API-Status"})]})]})]})]}),l.jsxs("p",{className:"mt-3.5 text-[11px] text-muted-foreground leading-relaxed",children:["Der Gateway liefert ",l.jsx("span",{className:"text-foreground",children:"nur das LLM"}),". Das geteilte Gedächtnis läuft über einen",l.jsx("span",{className:"text-foreground",children:" eigenen MCP-Server"})," und das Desktop-Gateway bietet die Agenten-Schnittstelle — alle drei Leitungen werden unabhängig eingerichtet."]})]}),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(qM,{className:"h-3.5 w-3.5 text-primary"})," Box LAN IP-Adresse"]}),l.jsx("input",{value:e,onChange:E=>S(E.target.value),"aria-label":"Box LAN IP-Adresse",spellCheck:!1,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(i5,{className:"h-3.5 w-3.5 text-violet-400"})," Lokaler MCP-Scriptpfad",l.jsx("span",{className:"text-violet-400/70 normal-case font-semibold tracking-normal",children:"(nur Leitung 2)"})]}),l.jsx("input",{value:r,onChange:E=>w(E.target.value),"aria-label":"Lokaler MCP-Scriptpfad",spellCheck:!1,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-violet-500/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]}),h&&l.jsxs("div",{className:"grid gap-5 lg:grid-cols-2",children:[l.jsxs("div",{className:"space-y-3 rounded-2xl border border-border/60 border-t-2 border-t-primary/70 bg-card/30 p-4",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-space font-bold text-foreground",children:[l.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-md bg-primary/15 text-primary text-[11px]",children:"1"}),"Modell anbinden"]}),l.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"Wähle dein Tool — das Snippet zeigt auf den Gateway."})]}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(h.tools).map(([E,A])=>l.jsx("button",{onClick:()=>o(E),className:J("rounded-lg px-3 py-1.5 text-[11px] font-semibold tracking-wide transition-all cursor-pointer",i===E?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"border border-border/50 text-muted-foreground hover:text-foreground"),children:A.label},E))}),k&&l.jsxs(l.Fragment,{children:[k.note&&l.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-primary/5 border border-primary/20 text-[11px] text-muted-foreground leading-relaxed",children:[l.jsx(Lw,{className:"h-4 w-4 text-primary shrink-0 mt-0.5"}),l.jsx("span",{children:k.note})]}),l.jsx(gk,{tool:k,fileName:$L[i]||"config.json",accent:"teal",copied:c==="model",onCopy:()=>N("model",k.snippet)})]})]}),l.jsxs("div",{className:"space-y-3 rounded-2xl border border-border/60 border-t-2 border-t-violet-500/70 bg-card/30 p-4",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-space font-bold text-foreground",children:[l.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-md bg-violet-500/15 text-violet-300 text-[11px]",children:"2"}),"Gedächtnis anbinden",l.jsx("span",{className:"text-[10px] font-medium text-muted-foreground normal-case",children:"optional"})]}),l.jsxs("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:["Ein MCP-Block — gilt zusätzlich für ",l.jsx("em",{children:"jedes"})," Tool aus Schritt 1."]})]}),l.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-violet-500/5 border border-violet-500/20 text-[11px] text-muted-foreground leading-relaxed",children:[l.jsx(Lw,{className:"h-4 w-4 text-violet-400 shrink-0 mt-0.5"}),l.jsx("span",{children:h.memory.note})]}),l.jsx(gk,{tool:h.memory,fileName:"mcp.json",accent:"violet",copied:c==="memory",onCopy:()=>N("memory",h.memory.snippet)})]})]})]})}const zL="modulepreload",FL=function(e){return"/"+e},vk={},BL=function(t,r,n){let i=Promise.resolve();if(r&&r.length>0){let c=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),f=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));i=c(r.map(h=>{if(h=FL(h),h in vk)return;vk[h]=!0;const m=h.endsWith(".css"),p=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${p}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":zL,m||(v.as="script"),v.crossOrigin="",v.href=h,f&&v.setAttribute("nonce",f),document.head.appendChild(v),m)return new Promise((b,S)=>{v.addEventListener("load",b),v.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(c){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=c,window.dispatchEvent(u),!u.defaultPrevented)throw c}return i.then(c=>{for(const u of c||[])u.status==="rejected"&&o(u.reason);return t().catch(o)})};class UL extends x.Component{constructor(){super(...arguments);is(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}render(){return this.state.error?l.jsxs("div",{className:"h-[480px] rounded-2xl border border-red-500/20 bg-red-500/5 p-6 text-xs text-red-400 overflow-auto",children:[l.jsx("div",{className:"font-semibold mb-2",children:"Graph konnte nicht gerendert werden"}),l.jsx("pre",{className:"whitespace-pre-wrap break-words text-[11px] leading-relaxed",children:this.state.error.message})]}):this.props.children}}const WL=x.lazy(()=>BL(()=>import("./GraphView-Bk5Qkble.js"),[]).then(e=>({default:e.GraphView}))),zd=["identity","knowledge","rules","events"],xk=new Set(["auto","agent","hermes"]),vg={identity:{label:"Identität",icon:wI,bg:"bg-cyan-500/10",text:"text-cyan-400"},knowledge:{label:"Wissen",icon:el,bg:"bg-indigo-500/10",text:"text-indigo-400"},rules:{label:"Regeln",icon:hI,bg:"bg-violet-500/10",text:"text-violet-400"},events:{label:"Ereignisse",icon:ph,bg:"bg-amber-500/10",text:"text-amber-400"}},yk={label:"Gedächtnis",icon:mv,text:"text-muted-foreground"},HL={identity:"border-l-cyan-500/80",knowledge:"border-l-indigo-500/80",rules:"border-l-violet-500/80",events:"border-l-amber-500/80"},bk=`Hi Hermes! Lass uns ein kurzes Onboarding machen, damit du dich künftig an mich erinnerst. Stell mir nacheinander ein paar kurze Fragen zu: 1) wer ich bin und woran ich gerade arbeite, 2) wie ich angesprochen werden möchte, 3) meine bevorzugten Tools, Sprachen und Arbeitsweise, 4) wichtige Regeln/Konventionen, die du beachten sollst, 5) meine Infrastruktur (Server, Dienste – ohne Geheimnisse). -Frag immer nur eine Sache auf einmal und fass am Ende zusammen, was du dir gemerkt hast.`;function fE(){const[e,t]=x.useState(""),[r,n]=x.useState(""),[i,o]=x.useState(""),[c,u]=x.useState("knowledge"),[f,h]=x.useState(!1),[m,p]=x.useState(!1),[v,b]=x.useState("liste"),[S,w]=x.useState(!1),k=Wr(),{showAlert:N,showConfirm:E,dialogElement:A}=An(),{data:C=[]}=jv({}),{data:_=[],error:O}=jv({q:r,category:e}),{data:D}=pR(v==="graph"),B=O?String(O):"",z=()=>{k.invalidateQueries({queryKey:["memory"]}),k.invalidateQueries({queryKey:["memory-graph"]})},$=x.useMemo(()=>{const I=C.length,M=C.filter(U=>vk.has(U.source)).length;return{total:I,auto:M,manual:I-M,cats:new Set(C.map(U=>U.category)).size}},[C]),K=C.length===0,W=x.useMemo(()=>{const I=D??{nodes:[],edges:[]};if(!r.trim())return I;const M=r.toLowerCase(),U=I.nodes.filter(ee=>ee.content.toLowerCase().includes(M)),ne=new Set(U.map(ee=>ee.id));return{nodes:U,edges:I.edges.filter(ee=>ne.has(ee.source)&&ne.has(ee.target))}},[D,r]),ve=x.useMemo(()=>{const I={};return _.forEach(M=>{var U;(I[U=M.category]??(I[U]=[])).push(M)}),I},[_]),ue=x.useMemo(()=>_.filter(I=>!$d.includes(I.category)),[_]);async function pe(){i.trim()&&(await xe("/api/memory",{method:"POST",body:JSON.stringify({content:i,category:c,source:"ui"})}),o(""),w(!1),z())}function oe(I){E("Eintrag löschen?","Diesen Gedächtnis-Eintrag dauerhaft entfernen?",async()=>{try{await xe(`/api/memory/${I}`,{method:"DELETE"}),z()}catch(M){N("Fehler",`Löschen fehlgeschlagen: ${M.message||M}`)}})}async function le(){try{await navigator.clipboard.writeText(yk),p(!0),setTimeout(()=>p(!1),1800)}catch{N("Kopieren fehlgeschlagen","Markiere den Prompt und kopiere ihn manuell (Strg+C).")}}function Z(){le(),window.dispatchEvent(new CustomEvent("mc-navigate",{detail:{view:"terminal"}}))}async function ie(){h(!0);try{const I=await xe("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!1})});if(I.duplicate_count===0){N("Ergebnis","Keine Dubletten gefunden — alles sauber.");return}const M=ne=>ne.length>90?ne.slice(0,90)+"…":ne,U=I.groups.slice(0,5).map(ne=>`✓ bleibt: „${M(ne.keep.content)}" +Frag immer nur eine Sache auf einmal und fass am Ende zusammen, was du dir gemerkt hast.`;function hE(){const[e,t]=x.useState(""),[r,n]=x.useState(""),[i,o]=x.useState(""),[c,u]=x.useState("knowledge"),[f,h]=x.useState(!1),[m,p]=x.useState(!1),[v,b]=x.useState("liste"),[S,w]=x.useState(!1),k=Wr(),{showAlert:N,showConfirm:E,dialogElement:A}=An(),{data:C=[]}=Sv({}),{data:_=[],error:O}=Sv({q:r,category:e}),{data:D}=pL(v==="graph"),B=O?String(O):"",z=()=>{k.invalidateQueries({queryKey:["memory"]}),k.invalidateQueries({queryKey:["memory-graph"]})},$=x.useMemo(()=>{const I=C.length,M=C.filter(U=>xk.has(U.source)).length;return{total:I,auto:M,manual:I-M,cats:new Set(C.map(U=>U.category)).size}},[C]),K=C.length===0,W=x.useMemo(()=>{const I=D??{nodes:[],edges:[]};if(!r.trim())return I;const M=r.toLowerCase(),U=I.nodes.filter(ee=>ee.content.toLowerCase().includes(M)),ne=new Set(U.map(ee=>ee.id));return{nodes:U,edges:I.edges.filter(ee=>ne.has(ee.source)&&ne.has(ee.target))}},[D,r]),ve=x.useMemo(()=>{const I={};return _.forEach(M=>{var U;(I[U=M.category]??(I[U]=[])).push(M)}),I},[_]),ue=x.useMemo(()=>_.filter(I=>!zd.includes(I.category)),[_]);async function pe(){i.trim()&&(await xe("/api/memory",{method:"POST",body:JSON.stringify({content:i,category:c,source:"ui"})}),o(""),w(!1),z())}function oe(I){E("Eintrag löschen?","Diesen Gedächtnis-Eintrag dauerhaft entfernen?",async()=>{try{await xe(`/api/memory/${I}`,{method:"DELETE"}),z()}catch(M){N("Fehler",`Löschen fehlgeschlagen: ${M.message||M}`)}})}async function le(){try{await navigator.clipboard.writeText(bk),p(!0),setTimeout(()=>p(!1),1800)}catch{N("Kopieren fehlgeschlagen","Markiere den Prompt und kopiere ihn manuell (Strg+C).")}}function Z(){le(),window.dispatchEvent(new CustomEvent("mc-navigate",{detail:{view:"terminal"}}))}async function ie(){h(!0);try{const I=await xe("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!1})});if(I.duplicate_count===0){N("Ergebnis","Keine Dubletten gefunden — alles sauber.");return}const M=ne=>ne.length>90?ne.slice(0,90)+"…":ne,U=I.groups.slice(0,5).map(ne=>`✓ bleibt: „${M(ne.keep.content)}" ✗ weg: ${ne.remove.map(ee=>`„${M(ee.content)}"`).join(", ")}`).join(` `)+(I.groups.length>5?` @@ -659,15 +659,15 @@ Frag immer nur eine Sache auf einmal und fass am Ende zusammen, was du dir gemer ${U} -Zusammenführen?`,async()=>{try{await xe("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!0})}),z()}catch(ne){N("Fehler",`Fehler beim Löschen: ${ne.message}`)}})}catch(I){N("Fehler",`Fehler bei der Deduplizierung: ${I.message}`)}finally{h(!1)}}const te=({value:I,label:M,accent:U})=>l.jsxs("span",{className:J("flex items-center gap-1.5 text-[11px] rounded-lg px-2.5 py-1 border",U==="auto"?"text-emerald-400 bg-emerald-500/[0.07] border-emerald-500/20":"text-muted-foreground bg-card/40 border-border/50"),children:[U==="auto"&&l.jsx(hi,{className:"h-3 w-3"}),l.jsx("b",{className:J("font-semibold",U==="auto"?"":"text-foreground"),children:I})," ",M]});return l.jsxs("div",{className:"space-y-5",children:[l.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between gap-3",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"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Geteilte Konstitution — Hermes, IDEs & Gateway lesen und lernen hier per MCP."})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsxs("div",{className:"relative",children:[l.jsx("input",{value:r,onChange:I=>n(I.target.value),"aria-label":"Gedächtnis durchsuchen",type:"search",placeholder:"Semantisch suchen…",className:"w-52 h-9 pl-8 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(Js,{className:"absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),l.jsxs("button",{onClick:()=>w(I=>!I),className:"h-9 px-3 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(Cc,{className:"h-4 w-4"})," Eintrag"]}),l.jsx("div",{className:"flex items-center gap-1 p-1 bg-card/30 border border-border/40 rounded-lg",children:[["liste",rI,"Liste"],["graph",pI,"Graph"]].map(([I,M,U])=>l.jsxs("button",{onClick:()=>b(I),className:J("flex h-7 px-2.5 items-center gap-1.5 text-[11px] font-semibold rounded-md transition-all cursor-pointer",v===I?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[l.jsx(M,{className:"h-3.5 w-3.5"})," ",U]},I))}),l.jsx("button",{onClick:ie,disabled:f,className:"flex h-9 w-9 items-center justify-center rounded-lg border border-border/60 bg-card hover:border-primary/50 transition-all cursor-pointer shadow-md disabled:opacity-50","aria-label":"Duplikate bereinigen",title:"Deduplizieren",children:l.jsx(hi,{className:"h-4 w-4 text-primary","aria-hidden":"true"})})]})]}),!K&&l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(te,{value:$.total,label:"Fakten"}),l.jsx(te,{value:$.auto,label:"auto gelernt",accent:"auto"}),l.jsx(te,{value:$.manual,label:"manuell"}),l.jsx(te,{value:$.cats,label:"Kategorien"}),l.jsxs("span",{className:"ml-auto text-[11px] text-muted-foreground/70 flex items-center gap-1.5",children:[l.jsx(hi,{className:"h-3 w-3 text-emerald-400"})," lernt automatisch aus Hermes-Gesprächen"]})]}),S&&l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-4 space-y-3",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:"Neuen Eintrag anlegen"}),l.jsx("button",{onClick:()=>w(!1),"aria-label":"Schließen",className:"text-muted-foreground hover:text-foreground",children:l.jsx(nn,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("textarea",{value:i,onChange:I=>o(I.target.value),rows:2,"aria-label":"Eintragstext",placeholder:"Eine Regel, Vorliebe oder einen stabilen Fakt über dich oder das Projekt…",className:"w-full resize-none rounded-xl border border-border/60 bg-background/30 p-3 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground leading-relaxed"}),l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[l.jsx("select",{value:c,onChange:I=>u(I.target.value),"aria-label":"Kategorie",className:"h-8 rounded-lg border border-border/60 bg-background/50 px-2 text-xs outline-none font-semibold text-foreground cursor-pointer",children:$d.map(I=>{var M;return l.jsx("option",{value:I,className:"bg-popover text-foreground",children:((M=gg[I])==null?void 0:M.label)||I},I)})}),l.jsxs("button",{onClick:pe,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",children:[l.jsx(Cc,{className:"h-4 w-4"})," Speichern"]})]})]}),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: ",B]}),K?l.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 bg-card/20 p-8 sm:p-10 flex flex-col items-center text-center gap-5",children:[l.jsx("div",{className:"h-14 w-14 rounded-2xl bg-primary/10 flex items-center justify-center",children:l.jsx(aI,{className:"h-7 w-7 text-primary"})}),l.jsxs("div",{className:"space-y-1.5 max-w-lg",children:[l.jsx("h3",{className:"text-base font-semibold text-foreground",children:"Lass Hermes dich kennenlernen"}),l.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Statt Fakten einzutippen: führ ein kurzes Onboarding-Gespräch mit Hermes. Was ihr besprecht, merkt sich das Gedächtnis automatisch — du musst nichts manuell pflegen."})]}),l.jsxs("div",{className:"w-full max-w-lg text-left",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground/60",children:"Sende das an Hermes"}),l.jsx("button",{onClick:le,className:"flex items-center gap-1 text-[10px] font-semibold text-muted-foreground hover:text-foreground transition-colors",children:m?l.jsxs(l.Fragment,{children:[l.jsx(Mt,{className:"h-3 w-3 text-emerald-400"})," Kopiert"]}):l.jsxs(l.Fragment,{children:[l.jsx(pv,{className:"h-3 w-3"})," Kopieren"]})})]}),l.jsx("pre",{className:"w-full rounded-xl border border-border/60 bg-background/40 p-3.5 text-[11px] leading-relaxed text-foreground/90 whitespace-pre-wrap font-mono",children:yk})]}),l.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[l.jsxs("button",{onClick:Z,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",children:[l.jsx(h5,{className:"h-4 w-4"})," Im Terminal starten"]}),l.jsxs("button",{onClick:le,className:"h-9 px-4 rounded-lg border border-border/60 bg-card text-xs font-semibold hover:border-primary/50 transition-all flex items-center gap-1.5 cursor-pointer",children:[m?l.jsx(Mt,{className:"h-4 w-4 text-emerald-400"}):l.jsx(pv,{className:"h-4 w-4"})," Prompt kopieren"]})]}),l.jsxs("p",{className:"text-[11px] text-muted-foreground/70 flex items-center gap-1.5",children:[l.jsx(mI,{className:"h-3 w-3"})," Funktioniert genauso über Telegram —"," ",l.jsx("button",{onClick:()=>w(!0),className:"underline hover:text-foreground",children:"oder lieber manuell anlegen"}),"."]})]}):v==="graph"?l.jsx(UR,{children:l.jsx(x.Suspense,{fallback:l.jsx("div",{className:"h-[480px] rounded-2xl border border-border/60 bg-card/30 flex items-center justify-center text-xs text-muted-foreground",children:"Graph wird geladen…"}),children:l.jsx(WR,{data:W,onDelete:oe})})}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 p-1 bg-card/30 border border-border/40 rounded-xl w-fit",children:[l.jsx("button",{onClick:()=>t(""),className:J("h-7 px-3 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer",e?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"),children:"Alle"}),$d.map(I=>{const M=gg[I]||xk,U=M.icon;return l.jsxs("button",{onClick:()=>t(I),className:J("h-7 px-2.5 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer flex items-center gap-1",e===I?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[l.jsx(U,{className:"h-3 w-3"})," ",M.label]},I)})]}),_.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."}):l.jsx("div",{className:"space-y-5",children:[...$d,"__other"].map(I=>{const M=I==="__other"?ue:ve[I]||[];if(!M.length)return null;const U=gg[I]||xk,ne=U.icon;return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2 px-1",children:[l.jsx(ne,{className:J("h-3.5 w-3.5",U.text)}),l.jsx("span",{className:J("text-[11px] font-bold uppercase tracking-wider",U.text),children:U.label}),l.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/60 bg-card/50 rounded px-1.5 py-0.5",children:M.length}),l.jsx("div",{className:"ml-1 h-px flex-1 bg-border/30"})]}),l.jsx("div",{className:"space-y-2",children:M.map(ee=>{const X=vk.has(ee.source);return l.jsxs("div",{className:J("flex items-start justify-between gap-4 p-3.5 rounded-xl border border-l-4 bg-card/45 backdrop-blur-md border-border/60 hover:border-primary/20 transition-all group",HR[ee.category]||"border-l-muted"),children:[l.jsx("span",{className:"text-xs text-foreground leading-relaxed break-words whitespace-pre-wrap flex-1 min-w-0",children:ee.content}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[typeof ee.score=="number"&&l.jsxs("span",{className:"text-[9px] font-mono text-primary bg-primary/10 px-1.5 py-0.5 rounded",title:"Relevanz der semantischen Suche",children:[Math.round(ee.score*100),"%"]}),l.jsxs("span",{className:J("flex items-center gap-1 text-[9px] font-mono px-1.5 py-0.5 rounded",X?"text-emerald-400 bg-emerald-500/10":"text-muted-foreground/60 bg-background/20"),title:X?"Automatisch gelernt":"Manuell angelegt",children:[X&&l.jsx(hi,{className:"h-2.5 w-2.5"}),ee.source]}),l.jsx("button",{onClick:()=>oe(ee.id),"aria-label":"Eintrag löschen",title:"Eintrag löschen",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",children:l.jsx(Pc,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]},ee.id)})})]},I)})})]}),A]})}const KR=["chat","coding","fast","heavy"];function hE(){const{data:e,error:t}=Gx(5e3),{data:r}=Ei(),{showAlert:n,dialogElement:i}=An(),o=Wr(),c=t?String(t):"",[u,f]=x.useState(!1),h=(r==null?void 0:r.models)??[];async function m(v){try{await xe("/api/agent/brain",{method:"POST",body:JSON.stringify({model:v})}),n("Erledigt",`Hermes-Hirn zeigt jetzt auf das Alias '${v}'. Der Gateway-Dienst wurde neu gestartet.`),o.invalidateQueries({queryKey:$e.agentStatus}),f(!1)}catch(b){n("Fehler",`Wechsel fehlgeschlagen: ${b.message||b}`)}}async function p(v){try{await xe("/api/agent/brain/set",{method:"POST",body:JSON.stringify({model_id:v})}),n("Erledigt","Agent-Hirn gewechselt (warm gehalten). Gateway wurde neugestartet."),o.invalidateQueries({queryKey:$e.agentStatus}),o.invalidateQueries({queryKey:$e.models}),f(!1)}catch(b){n("Fehler",`Wechsel fehlgeschlagen: ${b.message||b}`)}}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:"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."]})]}),(e==null?void 0:e.hermes_ui_url)&&l.jsxs("a",{href:kv(e.hermes_ui_url),target:"_blank",rel:"noopener",className:J("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",e.hermes_ui_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(Mx,{className:"h-4 w-4"}),l.jsx("span",{children:"Hermes-GUI öffnen"})]})]}),c&&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 (",c,")."]}),e&&l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10",children:[l.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[l.jsx(jn,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Agent-Fluss"})]}),l.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-stretch gap-3",children:[l.jsxs("button",{onClick:()=>e.hermes_ui_reachable&&window.open(kv(e.hermes_ui_url),"_blank"),title:e.hermes_ui_reachable?"Hermes-GUI öffnen":"Desktop-Gateway offline",className:"lg:w-40 shrink-0 rounded-xl border border-border/60 bg-background/30 p-3 text-left hover:border-primary/40 transition-all cursor-pointer flex flex-col justify-center",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(mh,{className:J("h-3.5 w-3.5",e.hermes_ui_reachable?"text-emerald-400":"text-amber-500")}),l.jsx("span",{className:"text-xs font-semibold text-foreground",children:"Desktop & GUI"}),l.jsx("span",{className:J("ml-auto h-1.5 w-1.5 rounded-full animate-pulse",e.hermes_ui_reachable?"bg-emerald-500":"bg-amber-500")})]}),l.jsx("span",{className:"text-[10px] text-muted-foreground font-mono mt-0.5",children:"Hermes Desktop · Clients"})]}),l.jsx("div",{className:"hidden lg:flex items-center text-muted-foreground text-lg select-none",children:"→"}),l.jsxs("div",{className:"flex-1 flex flex-col gap-2.5",children:[l.jsxs("div",{className:"rounded-xl border border-primary/40 bg-primary/5 px-3.5 py-2.5 flex items-center gap-2",children:[l.jsx(jn,{className:"h-3.5 w-3.5 text-primary"}),l.jsx("span",{className:"text-xs font-semibold text-primary",children:"Agent Gateway"}),l.jsx("span",{className:"text-[11px] font-mono text-muted-foreground",children:":8642"}),l.jsxs("span",{className:J("ml-auto inline-flex items-center gap-1.5 text-[10px] font-bold uppercase font-mono px-2 py-0.5 rounded-full border",e.gateway_reachable?"bg-emerald-500/10 text-emerald-400 border-emerald-500/20":"bg-red-500/10 text-red-400 border-red-500/20"),children:[l.jsx("span",{className:J("h-1.5 w-1.5 rounded-full",e.gateway_reachable?"bg-emerald-500 animate-pulse":"bg-red-500")}),e.gateway_reachable?"online":"offline"]})]}),l.jsxs("div",{className:"grid gap-2.5 sm:grid-cols-3",children:[l.jsxs("button",{onClick:()=>f(!0),className:"rounded-xl border border-border/60 bg-background/30 p-3 text-left hover:border-primary/45 transition-all cursor-pointer",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[l.jsx(wi,{className:"h-3.5 w-3.5 text-primary"}),l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Hirn"}),l.jsx("span",{className:"ml-auto text-[9px] text-primary/70 font-bold uppercase",children:"wechseln →"})]}),l.jsx("div",{className:"text-[11px] font-mono font-medium text-foreground truncate mt-1",title:e.brain_model,children:e.brain_model||"chat"})]}),l.jsxs("div",{className:"rounded-xl border border-border/60 bg-background/30 p-3",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[l.jsx(ru,{className:"h-3.5 w-3.5 text-primary"}),l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Verdrahtung"})]}),l.jsxs("div",{className:"text-[10px] font-mono mt-1 flex flex-wrap gap-x-2 text-muted-foreground",children:[l.jsxs("span",{children:["Config: ",e.has_config?"✓":"—"]}),l.jsxs("span",{children:["Skills: ",e.has_skills?"✓":"—"]}),l.jsxs("span",{children:["Memory: ",e.has_memories?"✓":"—"]})]})]}),l.jsxs("div",{className:"rounded-xl border border-border/60 bg-background/30 p-3",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[l.jsx(Rw,{className:"h-3.5 w-3.5 text-primary"}),l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"PC"}),l.jsx("span",{className:J("ml-auto h-1.5 w-1.5 rounded-full",e.pc_executor_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")})]}),l.jsxs("div",{className:J("text-[11px] font-mono mt-1",e.pc_executor_reachable?"text-emerald-400":"text-muted-foreground"),children:[":7777 ",e.pc_executor_reachable?"verbunden":"offline"]})]})]})]})]})]}),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 justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Rw,{className:"h-5 w-5 text-primary"}),l.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"PC Verbindung"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:J("h-2 w-2 rounded-full",e.pc_executor_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),l.jsx("span",{className:"text-xs font-semibold text-foreground",children:e.pc_executor_reachable?"Erreichbar":"Nicht verbunden"})]})]}),l.jsxs("div",{className:"grid gap-6 md:grid-cols-2 text-xs text-muted-foreground leading-relaxed text-left",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsxs("p",{children:["Der ",l.jsx("strong",{className:"text-foreground",children:"Hermes PC Executor"})," läuft auf ",l.jsx("code",{className:"text-foreground font-mono px-1 py-0.5 rounded bg-muted/40 border border-border/30",children:"192.168.178.98:7777"})," und ermöglicht Hermes den direkten Zugriff auf deinen Windows-PC — Shell-Befehle, Screenshots, Tastatureingaben."]}),l.jsxs("p",{children:["Hermes erreicht den PC über den MCP-Server ",l.jsx("code",{className:"text-foreground font-mono px-1 py-0.5 rounded bg-muted/40 border border-border/30",children:"hermes-pc-control"}),", der automatisch beim Gateway-Start verbunden wird."]})]}),l.jsx("div",{className:"space-y-3",children:e.pc_executor_reachable?l.jsxs("div",{className:"p-3.5 bg-emerald-500/5 border border-emerald-500/20 rounded-xl space-y-1",children:[l.jsxs("div",{className:"text-emerald-400 font-semibold text-xs flex items-center gap-1.5",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"PC Executor verbunden"]}),l.jsxs("p",{className:"text-[10px]",children:["Hermes kann jetzt per Telegram oder Terminal Befehle auf TobisNicerPC ausführen. Nutze ",l.jsx("code",{className:"text-foreground",children:"pc_shell"}),", ",l.jsx("code",{className:"text-foreground",children:"pc_screenshot"})," oder ",l.jsx("code",{className:"text-foreground",children:"pc_open"}),"."]})]}):l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"text-xs font-bold text-foreground",children:"PC Executor starten"}),l.jsxs("p",{children:["Starte ",l.jsx("code",{className:"text-foreground font-mono",children:"start.bat"})," im Ordner ",l.jsx("code",{className:"text-foreground font-mono",children:"client\\hermes-pc\\"})," auf dem Windows-PC und lasse das Fenster offen."]}),l.jsx("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[9px] text-cyan-300",children:"client\\hermes-pc\\start.bat"})]})})]})]}),!e.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 text-left",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(el,{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-builtin-ui"})]}),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"}),"."]})]})]})]}),e&&u&&l.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4 overscroll-contain",role:"dialog","aria-modal":"true","aria-label":"Hermes-Hirn konfigurieren",children:l.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[l.jsx(wi,{className:"h-4 w-4"}),l.jsx("span",{children:"Hermes-Hirn konfigurieren"})]}),l.jsx("button",{onClick:()=>f(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:l.jsx(nn,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Lane / Gateway-Alias"}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:KR.map(v=>{const b=e.brain_model===v;return l.jsxs("button",{onClick:()=>m(v),className:J("px-3 py-1.5 rounded-lg text-xs font-mono font-semibold border transition-all cursor-pointer flex items-center gap-1.5",b?"border-primary/40 bg-primary/10 text-primary":"border-border/30 bg-background/20 text-foreground hover:bg-accent"),children:[v,b&&l.jsx(Mt,{className:"h-3.5 w-3.5"})]},v)})}),l.jsxs("p",{className:"text-[10px] text-muted-foreground/70",children:["Schlank & flexibel: das Hirn folgt dem Lane-Routing (z.B. ",l.jsx("code",{className:"text-primary",children:"chat"})," = fast↔heavy)."]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Installiertes Modell (warm gehalten)"}),l.jsx("div",{className:"space-y-1.5 max-h-56 overflow-y-auto pr-1",children:h.map(v=>{var S;const b=v.role==="hermes";return l.jsxs("button",{onClick:()=>!b&&p(v.name),disabled:b||v.incomplete,className:J("w-full text-left px-3 py-2.5 rounded-lg text-xs flex items-center justify-between font-mono border transition-all",b?"border-indigo-500/40 bg-indigo-500/10 text-indigo-300":v.incomplete?"border-border/20 bg-background/10 text-muted-foreground/50 cursor-not-allowed":"border-border/30 bg-background/20 text-foreground hover:bg-accent cursor-pointer"),children:[l.jsxs("div",{className:"flex flex-col min-w-0",children:[l.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:(S=v.name.split("/").pop())==null?void 0:S.replace(/\.gguf$/i,"")}),l.jsxs("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:[v.capabilities.params_b?`${v.capabilities.params_b}B`:"?"," · ",v.capabilities.tools!=="no"?"Tools ✓":"ohne Tools",v.role&&` · Rolle: ${v.role}`]})]}),b?l.jsxs("span",{className:"text-[9px] font-bold uppercase text-indigo-300 shrink-0 flex items-center gap-1",children:[l.jsx(Mt,{className:"h-3.5 w-3.5"})," Aktiv"]}):l.jsx("span",{className:"text-[9px] font-bold uppercase text-primary/70 shrink-0",children:"Warm setzen →"})]},v.name)})})]}),l.jsxs("div",{className:"text-[10px] text-amber-400/80 flex items-start gap-1.5 border-t border-border/20 pt-2.5",children:[l.jsx("span",{children:"💡"}),l.jsxs("span",{children:["Für einen ",l.jsx("strong",{children:"Agenten"}),' sind Hermes-Modelle (natives Tool-Calling) meist die robustere Wahl. Neues Modell? Erst über „Modell-Manager → Modelle finden" laden.']})]})]})}),i]})}function GR(){const{data:e}=Gx(5e3),t=e!=null&&e.box_console_url?kv(e.box_console_url):void 0,r=e==null?void 0:e.box_console_reachable;return l.jsxs("div",{className:"flex h-full flex-col gap-4",children:[l.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Konsole"}),l.jsx("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:"Direkte Shell auf der Box — wie ein SSH-Fenster, mitten im Browser."})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground",children:[l.jsx("span",{className:J("h-2 w-2 rounded-full",r?"bg-emerald-500 animate-pulse":"bg-amber-500")}),r?"online":"offline"]}),t&&l.jsxs("a",{href:t,target:"_blank",rel:"noopener",className:"flex h-8 items-center gap-1.5 rounded-lg border border-border/60 bg-background/20 px-3 text-xs font-semibold text-muted-foreground transition-all hover:border-primary/50 hover:text-foreground",children:[l.jsx(Mx,{className:"h-3.5 w-3.5"})," In neuem Tab"]})]})]}),t?l.jsxs("div",{className:"relative min-h-[58vh] flex-1 overflow-hidden rounded-2xl border border-border/60 bg-black/50 shadow-lg shadow-black/25",children:[r===!1&&l.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 bg-black/70 text-center",children:[l.jsx(vr,{className:"h-8 w-8 text-amber-400"}),l.jsx("div",{className:"text-sm font-semibold text-amber-300",children:"Konsole nicht erreichbar"}),l.jsxs("p",{className:"max-w-sm text-[11px] leading-normal text-muted-foreground",children:["Der ",l.jsx("code",{className:"font-mono text-primary",children:"box-console"}),"-Dienst (ttyd) läuft nicht. Auf der Box: ",l.jsx("code",{className:"font-mono",children:"systemctl --user restart box-console"}),"."]})]}),l.jsx("iframe",{src:t,title:"Box-Konsole",className:"h-full w-full border-0",style:{minHeight:"58vh"}})]}):l.jsxs("div",{className:"flex min-h-[58vh] flex-1 items-center justify-center rounded-2xl border border-border/60 bg-background/20 text-xs text-muted-foreground",children:[l.jsx(pf,{className:"mr-2 h-4 w-4"})," Lade Konsole…"]})]})}const bk=[{id:"grundlagen",label:"Grundlagen"},{id:"moe",label:"MoE & Quant"},{id:"lokal",label:"Lokal betreiben"},{id:"modelle",label:"Modell-Landschaft"},{id:"gateway",label:"Gateway-Trick"},{id:"mcp",label:"MCP"},{id:"skills",label:"Skills"},{id:"memory",label:"Gedächtnis & RAG"},{id:"agents",label:"Agenten"},{id:"ide",label:"IDE anbinden"},{id:"tricks",label:"Tricks & Kniffe"},{id:"wartung",label:"Sicherheit & Wartung"},{id:"ressourcen",label:"Ressourcen"},{id:"troubleshooting",label:"Troubleshooting"}];function VR(e){var t;(t=document.getElementById(e))==null||t.scrollIntoView({behavior:"smooth",block:"start"})}function Dr({id:e,icon:t,color:r,title:n,kicker:i,children:o,wide:c}){return l.jsxs("section",{id:e,className:J("scroll-mt-20 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-3",c&&"md:col-span-2"),children:[l.jsxs("div",{className:"flex items-center gap-2.5 border-b border-border/20 pb-3",children:[l.jsx(t,{className:J("h-5 w-5 shrink-0",r)}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:n}),i&&l.jsx("span",{className:J("text-[9px] font-mono",r),children:i})]})]}),l.jsx("div",{className:"text-xs text-muted-foreground space-y-2.5 leading-relaxed",children:o})]})}function Ua({children:e}){return l.jsxs("div",{className:"mt-1 rounded-xl border border-primary/25 bg-primary/[0.06] p-3 text-[11px] leading-relaxed",children:[l.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-primary mb-1",children:[l.jsx(hi,{className:"h-3 w-3"})," Bei dir konkret"]}),l.jsx("div",{className:"text-muted-foreground space-y-1",children:e})]})}function Fe({children:e}){return l.jsx("code",{className:"rounded bg-background/40 border border-border/30 px-1.5 py-0.5 font-mono text-[10px] text-foreground",children:e})}function St({href:e,name:t,note:r}){return l.jsxs("li",{className:"leading-relaxed",children:[l.jsxs("a",{href:e,target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold inline-flex items-center gap-0.5",children:[t,l.jsx(AM,{className:"h-3 w-3 opacity-60"})]}),l.jsxs("span",{className:"text-muted-foreground",children:[" — ",r]})]})}function qR(){const[e,t]=x.useState(!1);return l.jsxs("div",{className:"space-y-7",children:[l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 flex items-start gap-4",children:[l.jsx("div",{className:"h-11 w-11 rounded-xl bg-primary/15 flex items-center justify-center shrink-0",children:l.jsx(hv,{className:"h-6 w-6 text-primary"})}),l.jsxs("div",{className:"space-y-1",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:"Die AI-Bibel"}),l.jsxs("p",{className:"text-sm text-muted-foreground leading-relaxed max-w-2xl",children:["Allgemeines Nachschlagewerk für lokale & agentische AI — Konzepte, Tricks, Kniffe und kuratierte Quellen. ",l.jsx("span",{className:"font-semibold text-foreground",children:"Stand Juni 2026."})," ","Das meiste gilt überall; ",l.jsx("span",{className:"text-primary font-semibold",children:'„Bei dir konkret"'}),"-Kästen zeigen, was dein Stack daraus macht."]})]})]}),l.jsx("div",{className:"sticky top-0 z-10 -mx-1 px-1",children:l.jsx("div",{className:"rounded-xl border border-border/50 bg-card/70 backdrop-blur-xl p-2 shadow-lg shadow-black/20",children:l.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[l.jsx(mv,{className:"h-3.5 w-3.5 text-primary ml-1 mr-0.5 shrink-0"}),(e?bk:bk.slice(0,9)).map(r=>l.jsx("button",{onClick:()=>VR(r.id),className:"rounded-lg px-2.5 py-1 text-[11px] font-semibold text-muted-foreground hover:text-primary hover:bg-primary/10 transition-colors cursor-pointer",children:r.label},r.id)),l.jsx("button",{onClick:()=>t(r=>!r),className:"rounded-lg px-2 py-1 text-[11px] font-semibold text-primary hover:bg-primary/10 transition-colors cursor-pointer",children:e?"weniger":"+ mehr"})]})})}),l.jsxs("div",{className:"grid gap-5 md:grid-cols-2",children:[l.jsxs(Dr,{id:"grundlagen",icon:wi,color:"text-cyan-400",title:"1. Wie LLMs ticken",kicker:"Grundlagen",children:[l.jsxs("p",{children:["Ein LLM ist im Kern ein ",l.jsx("strong",{children:"Wahrscheinlichkeits-Rechner für das nächste Token"}),' (Wortteil). Es „weiß" nichts — es setzt fort, was statistisch am plausibelsten ist. Daraus folgt fast alles andere.']}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Tokens"})," sind die Einheit — ~¾ Wort. Ein- und Ausgabe werden in Tokens gezählt."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Kontextfenster"}),' = wie viele Tokens das Modell gleichzeitig „sehen" kann (Prompt + Antwort). Voll = Anfang fällt raus.']}),l.jsxs("li",{children:[l.jsx("strong",{children:"Parameter"})," = die trainierten Gewichte. Training ist einmalig, ",l.jsx("strong",{children:"Inferenz"})," ist jede Antwort."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Temperatur / Sampling"})," steuert Zufall: niedrig = deterministisch/präzise (Code), hoch = kreativ."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Halluzination"})," ist kein Bug, sondern die Kehrseite des Ratens. Gegenmittel: Grounding via Tools/RAG, Verifikation."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Reasoning-/Thinking-Modelle"}),' „denken" in unsichtbaren Tokens vor der Antwort — besser bei Logik, langsamer/teurer.']})]})]}),l.jsxs(Dr,{id:"moe",icon:a5,color:"text-violet-400",title:"2. MoE & Quantisierung",kicker:"Mehr Modell, weniger Last",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Mixture of Experts (MoE):"})," Statt für jedes Token das ganze Netz zu aktivieren, wählt ein",l.jsx("em",{children:" Router"})," nur ein paar spezialisierte ",l.jsx("em",{children:"Experts"}),' aus. So läuft ein 100B-Modell mit der aktiven Rechenlast eines viel kleineren (z.B. „122B total / 10B aktiv").']}),l.jsxs("p",{children:[l.jsx("strong",{children:"Quantisierung:"})," Gewichte von FP16 auf weniger Bits eindampfen — kleiner & schneller bei minimalem Qualitätsverlust. Faustregel:"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx(Fe,{children:"Q8"})," nahezu verlustfrei, größter Footprint"]}),l.jsxs("li",{children:[l.jsx(Fe,{children:"Q6_K"})," sehr gut, guter Mittelweg"]}),l.jsxs("li",{children:[l.jsx(Fe,{children:"Q4_K_M"})," der Sweet-Spot für lokal — viel Modell pro GB"]})]}),l.jsxs(Ua,{children:["VRAM/RAM ist die harte Grenze — ",l.jsx("strong",{children:"darum"})," ist beides hier zentral: MoE lässt 100B+ überhaupt laufen, Quant entscheidet, was reinpasst. Dein Line-up fährt durchweg ",l.jsx(Fe,{children:"Q4_K_M"}),"/",l.jsx(Fe,{children:"Q6_K"}),"."]})]}),l.jsxs(Dr,{id:"lokal",icon:gh,color:"text-emerald-400",title:"3. Lokal betreiben: Engines & Backends",kicker:"llama.cpp, vLLM & Co.",wide:!0,children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Inference-Engines"})," — was die Modelle ausführt:"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"llama.cpp / GGUF"})," — der De-facto-Standard für lokal, CPU+GPU, läuft überall."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Ollama / LM Studio"})," — bequeme Wrapper mit One-Click-Downloads (LM Studio mit GUI)."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"vLLM / TGI"})," — Server-Engines für maximalen Durchsatz auf dicken GPUs."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"llama-swap"})," — Proxy, der ",l.jsx("em",{children:"mehrere"})," Modelle hinter ",l.jsx("em",{children:"einem"})," Port hält und je nach Anfrage automatisch ein-/aussattelt."]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"GPU-Backends"})," — wie gerechnet wird:"]}),l.jsx("ul",{className:"list-disc pl-4 space-y-1",children:l.jsxs("li",{children:[l.jsx(Fe,{children:"CUDA"})," NVIDIA · ",l.jsx(Fe,{children:"ROCm"})," AMD · ",l.jsx(Fe,{children:"Vulkan"})," herstellerübergreifend · ",l.jsx(Fe,{children:"Metal"})," Apple"]})}),l.jsxs("p",{className:"pt-1",children:[l.jsx("strong",{children:"Begriffe, die immer wiederkommen:"})," Kontext (",l.jsx(Fe,{children:"-c"}),"), Slots/Parallel, KV-Cache, Modell-TTL/Swap, ",l.jsx("strong",{children:"Speculative Decoding"})," (kleines Draft-Modell rät voraus → schneller)."]})]})]}),l.jsxs(Ua,{children:["Deine Box hat eine AMD-APU (gfx1151). ",l.jsx("strong",{children:"Einschränkung & Trick:"})," dort schlägt ",l.jsx(Fe,{children:"Vulkan/RADV"})," das offizielle ",l.jsx(Fe,{children:"ROCm"})," bei Token-Generierung um ~12–22 % — darum läuft die Engine auf Vulkan.",l.jsx(Fe,{children:"llama-swap"})," hält die Alltags-Hirne dauerwarm; ",l.jsx(Fe,{children:"coder"})," nutzt Spec-Decoding."]})]}),l.jsxs(Dr,{id:"modelle",icon:mf,color:"text-sky-400",title:"4. Modell-Landschaft",kicker:"Stand Juni 2026",wide:!0,children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{children:l.jsx("strong",{children:"Open-Weight (lokal nutzbar):"})}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Qwen"})," (Alibaba) — starke Allrounder + Coder + Vision, viele Größen/MoE."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Llama"})," (Meta), ",l.jsx("strong",{children:"Gemma"})," (Google), ",l.jsx("strong",{children:"Phi"})," (Microsoft) — solide Open-Familien."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"DeepSeek"}),", ",l.jsx("strong",{children:"Mistral/Mixtral"})," — kräftige MoE-/Reasoning-Modelle."]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{children:l.jsx("strong",{children:"Frontier (Cloud-API):"})}),l.jsx("ul",{className:"list-disc pl-4 space-y-1",children:l.jsxs("li",{children:[l.jsx("strong",{children:"Claude"})," (Anthropic), ",l.jsx("strong",{children:"GPT"})," (OpenAI), ",l.jsx("strong",{children:"Gemini"})," (Google) — die stärksten Allrounder, aber nicht lokal."]})}),l.jsxs("p",{className:"pt-1",children:[l.jsx("strong",{children:"Modellwahl nach Aufgabe:"})," schnelles Alltags-Hirn · großes Logik-Hirn für harte Tasks · dediziertes Code-Modell · multimodal für Bilder · Embedding-Modell fürs Gedächtnis."]})]})]}),l.jsx("p",{className:"text-[11px] italic",children:'Leaderboards (HF, LMArena) sind grobe Orientierung — der einzige Benchmark, der zählt, ist deine eigene Aufgabe. Vorsicht vor „Benchmaxxing".'}),l.jsxs(Ua,{children:["Dein Line-up via llama-swap: ",l.jsx(Fe,{children:"fast"})," (Alltag/Vision/MoE) · ",l.jsx(Fe,{children:"heavy"})," (schwere Logik) ·",l.jsx(Fe,{children:"coder"})," · ",l.jsx(Fe,{children:"scout"})," · ",l.jsx(Fe,{children:"vision"})," · ",l.jsx(Fe,{children:"embed"})," (fürs Gedächtnis) ·",l.jsx(Fe,{children:"hermes"})," (Agent-Hirn). Verwalten/tauschen im ",l.jsx("strong",{children:"Modell-Manager"}),"-Tab."]})]}),l.jsxs(Dr,{id:"gateway",icon:sI,color:"text-amber-400",title:"5. Der Gateway-Trick",kicker:"OpenAI-kompatibel = überall andocken",children:[l.jsxs("p",{children:["Fast jedes AI-Tool spricht heute das ",l.jsx("strong",{children:"OpenAI-Format"})," (",l.jsx(Fe,{children:"/v1/chat/completions"}),"). Ein",l.jsx("strong",{children:" Gateway"})," davor gibt dir ",l.jsx("em",{children:"einen"})," Endpunkt für alles: zentrales Key-Management, Logging und transparentes ",l.jsx("strong",{children:"Routing"})," — der Client merkt nicht, welches Modell tatsächlich antwortet."]}),l.jsxs("p",{children:["Die ",l.jsx(Fe,{children:"model:auto"}),'-Idee: du sagst „auto", das Gateway wählt das passende Modell je nach Anfrage und lädt es bei Bedarf.']}),l.jsxs(Ua,{children:["Dein Gateway: ",l.jsx(Fe,{children:"http://192.168.178.151:9001/v1"}),", Model ",l.jsx(Fe,{children:"auto"}),", API-Key beliebig. Fertige Configs erzeugt dir der ",l.jsx("strong",{children:"Verbinden"}),"-Tab live — eine Wahrheit, kein Abtippen."]})]}),l.jsxs(Dr,{id:"mcp",icon:Ac,color:"text-violet-400",title:"6. MCP — Werkzeuge für Agenten",kicker:"USB-C für AI-Tools",children:[l.jsxs("p",{children:["Das ",l.jsx("strong",{children:"Model Context Protocol"})," (offen, von Anthropic initiiert) standardisiert, wie ein AI-Client mit externen Tools & Datenquellen spricht. Ein ",l.jsx("strong",{children:"MCP-Server"})," bringt Fähigkeiten: Dateien, Web-Fetch, Git, Datenbanken, eigene APIs."]}),l.jsx("p",{children:"Statt für jeden Editor eigene Tools zu schreiben, bindet jeder MCP-fähige Agent denselben Server an."}),l.jsxs("div",{className:"flex items-start gap-1.5 rounded-xl border border-amber-500/25 bg-amber-500/[0.06] p-2.5 text-[11px]",children:[l.jsx(o5,{className:"h-3.5 w-3.5 text-amber-400 shrink-0 mt-0.5"}),l.jsxs("span",{children:[l.jsx("strong",{children:"Sicherheit:"})," ein MCP-Server hat echten Zugriff (Dateien, Shell). Nur vertrauenswürdige Server laufen lassen, Rechte minimal halten, Quelle prüfen."]})]})]}),l.jsxs(Dr,{id:"skills",icon:cI,color:"text-emerald-400",title:"7. Agent Skills",kicker:"Wiederverwendbare Fähigkeiten",children:[l.jsxs("p",{children:["Ein ",l.jsx("strong",{children:"Skill"})," ist ein Ordner mit einer ",l.jsx(Fe,{children:"SKILL.md"})," (YAML-Kopf + Anleitung, optional Skripte/Beispiele), den der Agent für eine bestimmte Aufgabe lädt — z.B. TDD, Code-Vereinfachung, API-Design."]}),l.jsx("pre",{className:"p-2.5 bg-background/25 rounded-lg border border-border/30 font-mono text-[9px] text-foreground overflow-x-auto whitespace-pre",children:`--- +Zusammenführen?`,async()=>{try{await xe("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!0})}),z()}catch(ne){N("Fehler",`Fehler beim Löschen: ${ne.message}`)}})}catch(I){N("Fehler",`Fehler bei der Deduplizierung: ${I.message}`)}finally{h(!1)}}const te=({value:I,label:M,accent:U})=>l.jsxs("span",{className:J("flex items-center gap-1.5 text-[11px] rounded-lg px-2.5 py-1 border",U==="auto"?"text-emerald-400 bg-emerald-500/[0.07] border-emerald-500/20":"text-muted-foreground bg-card/40 border-border/50"),children:[U==="auto"&&l.jsx(hi,{className:"h-3 w-3"}),l.jsx("b",{className:J("font-semibold",U==="auto"?"":"text-foreground"),children:I})," ",M]});return l.jsxs("div",{className:"space-y-5",children:[l.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between gap-3",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"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Geteilte Konstitution — Hermes, IDEs & Gateway lesen und lernen hier per MCP."})]}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsxs("div",{className:"relative",children:[l.jsx("input",{value:r,onChange:I=>n(I.target.value),"aria-label":"Gedächtnis durchsuchen",type:"search",placeholder:"Semantisch suchen…",className:"w-52 h-9 pl-8 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(Js,{className:"absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),l.jsxs("button",{onClick:()=>w(I=>!I),className:"h-9 px-3 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(Pc,{className:"h-4 w-4"})," Eintrag"]}),l.jsx("div",{className:"flex items-center gap-1 p-1 bg-card/30 border border-border/40 rounded-lg",children:[["liste",rI,"Liste"],["graph",pI,"Graph"]].map(([I,M,U])=>l.jsxs("button",{onClick:()=>b(I),className:J("flex h-7 px-2.5 items-center gap-1.5 text-[11px] font-semibold rounded-md transition-all cursor-pointer",v===I?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[l.jsx(M,{className:"h-3.5 w-3.5"})," ",U]},I))}),l.jsx("button",{onClick:ie,disabled:f,className:"flex h-9 w-9 items-center justify-center rounded-lg border border-border/60 bg-card hover:border-primary/50 transition-all cursor-pointer shadow-md disabled:opacity-50","aria-label":"Duplikate bereinigen",title:"Deduplizieren",children:l.jsx(hi,{className:"h-4 w-4 text-primary","aria-hidden":"true"})})]})]}),!K&&l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx(te,{value:$.total,label:"Fakten"}),l.jsx(te,{value:$.auto,label:"auto gelernt",accent:"auto"}),l.jsx(te,{value:$.manual,label:"manuell"}),l.jsx(te,{value:$.cats,label:"Kategorien"}),l.jsxs("span",{className:"ml-auto text-[11px] text-muted-foreground/70 flex items-center gap-1.5",children:[l.jsx(hi,{className:"h-3 w-3 text-emerald-400"})," lernt automatisch aus Hermes-Gesprächen"]})]}),S&&l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-4 space-y-3",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:"Neuen Eintrag anlegen"}),l.jsx("button",{onClick:()=>w(!1),"aria-label":"Schließen",className:"text-muted-foreground hover:text-foreground",children:l.jsx(nn,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("textarea",{value:i,onChange:I=>o(I.target.value),rows:2,"aria-label":"Eintragstext",placeholder:"Eine Regel, Vorliebe oder einen stabilen Fakt über dich oder das Projekt…",className:"w-full resize-none rounded-xl border border-border/60 bg-background/30 p-3 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground leading-relaxed"}),l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[l.jsx("select",{value:c,onChange:I=>u(I.target.value),"aria-label":"Kategorie",className:"h-8 rounded-lg border border-border/60 bg-background/50 px-2 text-xs outline-none font-semibold text-foreground cursor-pointer",children:zd.map(I=>{var M;return l.jsx("option",{value:I,className:"bg-popover text-foreground",children:((M=vg[I])==null?void 0:M.label)||I},I)})}),l.jsxs("button",{onClick:pe,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",children:[l.jsx(Pc,{className:"h-4 w-4"})," Speichern"]})]})]}),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: ",B]}),K?l.jsxs("div",{className:"rounded-2xl border border-dashed border-border/60 bg-card/20 p-8 sm:p-10 flex flex-col items-center text-center gap-5",children:[l.jsx("div",{className:"h-14 w-14 rounded-2xl bg-primary/10 flex items-center justify-center",children:l.jsx(aI,{className:"h-7 w-7 text-primary"})}),l.jsxs("div",{className:"space-y-1.5 max-w-lg",children:[l.jsx("h3",{className:"text-base font-semibold text-foreground",children:"Lass Hermes dich kennenlernen"}),l.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Statt Fakten einzutippen: führ ein kurzes Onboarding-Gespräch mit Hermes. Was ihr besprecht, merkt sich das Gedächtnis automatisch — du musst nichts manuell pflegen."})]}),l.jsxs("div",{className:"w-full max-w-lg text-left",children:[l.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground/60",children:"Sende das an Hermes"}),l.jsx("button",{onClick:le,className:"flex items-center gap-1 text-[10px] font-semibold text-muted-foreground hover:text-foreground transition-colors",children:m?l.jsxs(l.Fragment,{children:[l.jsx(Mt,{className:"h-3 w-3 text-emerald-400"})," Kopiert"]}):l.jsxs(l.Fragment,{children:[l.jsx(gv,{className:"h-3 w-3"})," Kopieren"]})})]}),l.jsx("pre",{className:"w-full rounded-xl border border-border/60 bg-background/40 p-3.5 text-[11px] leading-relaxed text-foreground/90 whitespace-pre-wrap font-mono",children:bk})]}),l.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[l.jsxs("button",{onClick:Z,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",children:[l.jsx(m5,{className:"h-4 w-4"})," Im Terminal starten"]}),l.jsxs("button",{onClick:le,className:"h-9 px-4 rounded-lg border border-border/60 bg-card text-xs font-semibold hover:border-primary/50 transition-all flex items-center gap-1.5 cursor-pointer",children:[m?l.jsx(Mt,{className:"h-4 w-4 text-emerald-400"}):l.jsx(gv,{className:"h-4 w-4"})," Prompt kopieren"]})]}),l.jsxs("p",{className:"text-[11px] text-muted-foreground/70 flex items-center gap-1.5",children:[l.jsx(mI,{className:"h-3 w-3"})," Funktioniert genauso über Telegram —"," ",l.jsx("button",{onClick:()=>w(!0),className:"underline hover:text-foreground",children:"oder lieber manuell anlegen"}),"."]})]}):v==="graph"?l.jsx(UL,{children:l.jsx(x.Suspense,{fallback:l.jsx("div",{className:"h-[480px] rounded-2xl border border-border/60 bg-card/30 flex items-center justify-center text-xs text-muted-foreground",children:"Graph wird geladen…"}),children:l.jsx(WL,{data:W,onDelete:oe})})}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 p-1 bg-card/30 border border-border/40 rounded-xl w-fit",children:[l.jsx("button",{onClick:()=>t(""),className:J("h-7 px-3 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer",e?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"),children:"Alle"}),zd.map(I=>{const M=vg[I]||yk,U=M.icon;return l.jsxs("button",{onClick:()=>t(I),className:J("h-7 px-2.5 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer flex items-center gap-1",e===I?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[l.jsx(U,{className:"h-3 w-3"})," ",M.label]},I)})]}),_.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."}):l.jsx("div",{className:"space-y-5",children:[...zd,"__other"].map(I=>{const M=I==="__other"?ue:ve[I]||[];if(!M.length)return null;const U=vg[I]||yk,ne=U.icon;return l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2 mb-2 px-1",children:[l.jsx(ne,{className:J("h-3.5 w-3.5",U.text)}),l.jsx("span",{className:J("text-[11px] font-bold uppercase tracking-wider",U.text),children:U.label}),l.jsx("span",{className:"text-[10px] font-mono text-muted-foreground/60 bg-card/50 rounded px-1.5 py-0.5",children:M.length}),l.jsx("div",{className:"ml-1 h-px flex-1 bg-border/30"})]}),l.jsx("div",{className:"space-y-2",children:M.map(ee=>{const X=xk.has(ee.source);return l.jsxs("div",{className:J("flex items-start justify-between gap-4 p-3.5 rounded-xl border border-l-4 bg-card/45 backdrop-blur-md border-border/60 hover:border-primary/20 transition-all group",HL[ee.category]||"border-l-muted"),children:[l.jsx("span",{className:"text-xs text-foreground leading-relaxed break-words whitespace-pre-wrap flex-1 min-w-0",children:ee.content}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[typeof ee.score=="number"&&l.jsxs("span",{className:"text-[9px] font-mono text-primary bg-primary/10 px-1.5 py-0.5 rounded",title:"Relevanz der semantischen Suche",children:[Math.round(ee.score*100),"%"]}),l.jsxs("span",{className:J("flex items-center gap-1 text-[9px] font-mono px-1.5 py-0.5 rounded",X?"text-emerald-400 bg-emerald-500/10":"text-muted-foreground/60 bg-background/20"),title:X?"Automatisch gelernt":"Manuell angelegt",children:[X&&l.jsx(hi,{className:"h-2.5 w-2.5"}),ee.source]}),l.jsx("button",{onClick:()=>oe(ee.id),"aria-label":"Eintrag löschen",title:"Eintrag löschen",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",children:l.jsx(Oc,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]},ee.id)})})]},I)})})]}),A]})}const KL=["chat","coding","fast","heavy"];function mE(){const{data:e,error:t}=Vx(5e3),{data:r}=Ei(),{showAlert:n,dialogElement:i}=An(),o=Wr(),c=t?String(t):"",[u,f]=x.useState(!1),h=(r==null?void 0:r.models)??[];async function m(v){try{await xe("/api/agent/brain",{method:"POST",body:JSON.stringify({model:v})}),n("Erledigt",`Hermes-Hirn zeigt jetzt auf das Alias '${v}'. Der Gateway-Dienst wurde neu gestartet.`),o.invalidateQueries({queryKey:$e.agentStatus}),f(!1)}catch(b){n("Fehler",`Wechsel fehlgeschlagen: ${b.message||b}`)}}async function p(v){try{await xe("/api/agent/brain/set",{method:"POST",body:JSON.stringify({model_id:v})}),n("Erledigt","Agent-Hirn gewechselt (warm gehalten). Gateway wurde neugestartet."),o.invalidateQueries({queryKey:$e.agentStatus}),o.invalidateQueries({queryKey:$e.models}),f(!1)}catch(b){n("Fehler",`Wechsel fehlgeschlagen: ${b.message||b}`)}}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:"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."]})]}),(e==null?void 0:e.hermes_ui_url)&&l.jsxs("a",{href:jv(e.hermes_ui_url),target:"_blank",rel:"noopener",className:J("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",e.hermes_ui_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(Ix,{className:"h-4 w-4"}),l.jsx("span",{children:"Hermes-GUI öffnen"})]})]}),c&&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 (",c,")."]}),e&&l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10",children:[l.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[l.jsx(jn,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Agent-Fluss"})]}),l.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-stretch gap-3",children:[l.jsxs("button",{onClick:()=>e.hermes_ui_reachable&&window.open(jv(e.hermes_ui_url),"_blank"),title:e.hermes_ui_reachable?"Hermes-GUI öffnen":"Desktop-Gateway offline",className:"lg:w-40 shrink-0 rounded-xl border border-border/60 bg-background/30 p-3 text-left hover:border-primary/40 transition-all cursor-pointer flex flex-col justify-center",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(mh,{className:J("h-3.5 w-3.5",e.hermes_ui_reachable?"text-emerald-400":"text-amber-500")}),l.jsx("span",{className:"text-xs font-semibold text-foreground",children:"Desktop & GUI"}),l.jsx("span",{className:J("ml-auto h-1.5 w-1.5 rounded-full animate-pulse",e.hermes_ui_reachable?"bg-emerald-500":"bg-amber-500")})]}),l.jsx("span",{className:"text-[10px] text-muted-foreground font-mono mt-0.5",children:"Hermes Desktop · Clients"})]}),l.jsx("div",{className:"hidden lg:flex items-center text-muted-foreground text-lg select-none",children:"→"}),l.jsxs("div",{className:"flex-1 flex flex-col gap-2.5",children:[l.jsxs("div",{className:"rounded-xl border border-primary/40 bg-primary/5 px-3.5 py-2.5 flex items-center gap-2",children:[l.jsx(jn,{className:"h-3.5 w-3.5 text-primary"}),l.jsx("span",{className:"text-xs font-semibold text-primary",children:"Agent Gateway"}),l.jsx("span",{className:"text-[11px] font-mono text-muted-foreground",children:":8642"}),l.jsxs("span",{className:J("ml-auto inline-flex items-center gap-1.5 text-[10px] font-bold uppercase font-mono px-2 py-0.5 rounded-full border",e.gateway_reachable?"bg-emerald-500/10 text-emerald-400 border-emerald-500/20":"bg-red-500/10 text-red-400 border-red-500/20"),children:[l.jsx("span",{className:J("h-1.5 w-1.5 rounded-full",e.gateway_reachable?"bg-emerald-500 animate-pulse":"bg-red-500")}),e.gateway_reachable?"online":"offline"]})]}),l.jsxs("div",{className:"grid gap-2.5 sm:grid-cols-3",children:[l.jsxs("button",{onClick:()=>f(!0),className:"rounded-xl border border-border/60 bg-background/30 p-3 text-left hover:border-primary/45 transition-all cursor-pointer",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[l.jsx(wi,{className:"h-3.5 w-3.5 text-primary"}),l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Hirn"}),l.jsx("span",{className:"ml-auto text-[9px] text-primary/70 font-bold uppercase",children:"wechseln →"})]}),l.jsx("div",{className:"text-[11px] font-mono font-medium text-foreground truncate mt-1",title:e.brain_model,children:e.brain_model||"chat"})]}),l.jsxs("div",{className:"rounded-xl border border-border/60 bg-background/30 p-3",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[l.jsx(nu,{className:"h-3.5 w-3.5 text-primary"}),l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Verdrahtung"})]}),l.jsxs("div",{className:"text-[10px] font-mono mt-1 flex flex-wrap gap-x-2 text-muted-foreground",children:[l.jsxs("span",{children:["Config: ",e.has_config?"✓":"—"]}),l.jsxs("span",{children:["Skills: ",e.has_skills?"✓":"—"]}),l.jsxs("span",{children:["Memory: ",e.has_memories?"✓":"—"]})]})]}),l.jsxs("div",{className:"rounded-xl border border-border/60 bg-background/30 p-3",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[l.jsx($w,{className:"h-3.5 w-3.5 text-primary"}),l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"PC"}),l.jsx("span",{className:J("ml-auto h-1.5 w-1.5 rounded-full",e.pc_executor_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")})]}),l.jsxs("div",{className:J("text-[11px] font-mono mt-1",e.pc_executor_reachable?"text-emerald-400":"text-muted-foreground"),children:[":7777 ",e.pc_executor_reachable?"verbunden":"offline"]})]})]})]})]})]}),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 justify-between",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx($w,{className:"h-5 w-5 text-primary"}),l.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"PC Verbindung"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:J("h-2 w-2 rounded-full",e.pc_executor_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),l.jsx("span",{className:"text-xs font-semibold text-foreground",children:e.pc_executor_reachable?"Erreichbar":"Nicht verbunden"})]})]}),l.jsxs("div",{className:"grid gap-6 md:grid-cols-2 text-xs text-muted-foreground leading-relaxed text-left",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsxs("p",{children:["Der ",l.jsx("strong",{className:"text-foreground",children:"Hermes PC Executor"})," läuft auf ",l.jsx("code",{className:"text-foreground font-mono px-1 py-0.5 rounded bg-muted/40 border border-border/30",children:"192.168.178.98:7777"})," und ermöglicht Hermes den direkten Zugriff auf deinen Windows-PC — Shell-Befehle, Screenshots, Tastatureingaben."]}),l.jsxs("p",{children:["Hermes erreicht den PC über den MCP-Server ",l.jsx("code",{className:"text-foreground font-mono px-1 py-0.5 rounded bg-muted/40 border border-border/30",children:"hermes-pc-control"}),", der automatisch beim Gateway-Start verbunden wird."]})]}),l.jsx("div",{className:"space-y-3",children:e.pc_executor_reachable?l.jsxs("div",{className:"p-3.5 bg-emerald-500/5 border border-emerald-500/20 rounded-xl space-y-1",children:[l.jsxs("div",{className:"text-emerald-400 font-semibold text-xs flex items-center gap-1.5",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"PC Executor verbunden"]}),l.jsxs("p",{className:"text-[10px]",children:["Hermes kann jetzt per Telegram oder Terminal Befehle auf TobisNicerPC ausführen. Nutze ",l.jsx("code",{className:"text-foreground",children:"pc_shell"}),", ",l.jsx("code",{className:"text-foreground",children:"pc_screenshot"})," oder ",l.jsx("code",{className:"text-foreground",children:"pc_open"}),"."]})]}):l.jsxs("div",{className:"space-y-2",children:[l.jsx("h4",{className:"text-xs font-bold text-foreground",children:"PC Executor starten"}),l.jsxs("p",{children:["Starte ",l.jsx("code",{className:"text-foreground font-mono",children:"start.bat"})," im Ordner ",l.jsx("code",{className:"text-foreground font-mono",children:"client\\hermes-pc\\"})," auf dem Windows-PC und lasse das Fenster offen."]}),l.jsx("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[9px] text-cyan-300",children:"client\\hermes-pc\\start.bat"})]})})]})]}),!e.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 text-left",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(el,{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-builtin-ui"})]}),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"}),"."]})]})]})]}),e&&u&&l.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4 overscroll-contain",role:"dialog","aria-modal":"true","aria-label":"Hermes-Hirn konfigurieren",children:l.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[l.jsx(wi,{className:"h-4 w-4"}),l.jsx("span",{children:"Hermes-Hirn konfigurieren"})]}),l.jsx("button",{onClick:()=>f(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:l.jsx(nn,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Lane / Gateway-Alias"}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:KL.map(v=>{const b=e.brain_model===v;return l.jsxs("button",{onClick:()=>m(v),className:J("px-3 py-1.5 rounded-lg text-xs font-mono font-semibold border transition-all cursor-pointer flex items-center gap-1.5",b?"border-primary/40 bg-primary/10 text-primary":"border-border/30 bg-background/20 text-foreground hover:bg-accent"),children:[v,b&&l.jsx(Mt,{className:"h-3.5 w-3.5"})]},v)})}),l.jsxs("p",{className:"text-[10px] text-muted-foreground/70",children:["Schlank & flexibel: das Hirn folgt dem Lane-Routing (z.B. ",l.jsx("code",{className:"text-primary",children:"chat"})," = fast↔heavy)."]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Installiertes Modell (warm gehalten)"}),l.jsx("div",{className:"space-y-1.5 max-h-56 overflow-y-auto pr-1",children:h.map(v=>{var S;const b=v.role==="hermes";return l.jsxs("button",{onClick:()=>!b&&p(v.name),disabled:b||v.incomplete,className:J("w-full text-left px-3 py-2.5 rounded-lg text-xs flex items-center justify-between font-mono border transition-all",b?"border-indigo-500/40 bg-indigo-500/10 text-indigo-300":v.incomplete?"border-border/20 bg-background/10 text-muted-foreground/50 cursor-not-allowed":"border-border/30 bg-background/20 text-foreground hover:bg-accent cursor-pointer"),children:[l.jsxs("div",{className:"flex flex-col min-w-0",children:[l.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:(S=v.name.split("/").pop())==null?void 0:S.replace(/\.gguf$/i,"")}),l.jsxs("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:[v.capabilities.params_b?`${v.capabilities.params_b}B`:"?"," · ",v.capabilities.tools!=="no"?"Tools ✓":"ohne Tools",v.role&&` · Rolle: ${v.role}`]})]}),b?l.jsxs("span",{className:"text-[9px] font-bold uppercase text-indigo-300 shrink-0 flex items-center gap-1",children:[l.jsx(Mt,{className:"h-3.5 w-3.5"})," Aktiv"]}):l.jsx("span",{className:"text-[9px] font-bold uppercase text-primary/70 shrink-0",children:"Warm setzen →"})]},v.name)})})]}),l.jsxs("div",{className:"text-[10px] text-amber-400/80 flex items-start gap-1.5 border-t border-border/20 pt-2.5",children:[l.jsx("span",{children:"💡"}),l.jsxs("span",{children:["Für einen ",l.jsx("strong",{children:"Agenten"}),' sind Hermes-Modelle (natives Tool-Calling) meist die robustere Wahl. Neues Modell? Erst über „Modell-Manager → Modelle finden" laden.']})]})]})}),i]})}function GL(){const{data:e}=Vx(5e3),t=e!=null&&e.box_console_url?jv(e.box_console_url):void 0,r=e==null?void 0:e.box_console_reachable;return l.jsxs("div",{className:"flex h-full flex-col gap-4",children:[l.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Konsole"}),l.jsx("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:"Direkte Shell auf der Box — wie ein SSH-Fenster, mitten im Browser."})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground",children:[l.jsx("span",{className:J("h-2 w-2 rounded-full",r?"bg-emerald-500 animate-pulse":"bg-amber-500")}),r?"online":"offline"]}),t&&l.jsxs("a",{href:t,target:"_blank",rel:"noopener",className:"flex h-8 items-center gap-1.5 rounded-lg border border-border/60 bg-background/20 px-3 text-xs font-semibold text-muted-foreground transition-all hover:border-primary/50 hover:text-foreground",children:[l.jsx(Ix,{className:"h-3.5 w-3.5"})," In neuem Tab"]})]})]}),t?l.jsxs("div",{className:"relative min-h-[58vh] flex-1 overflow-hidden rounded-2xl border border-border/60 bg-black/50 shadow-lg shadow-black/25",children:[r===!1&&l.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 bg-black/70 text-center",children:[l.jsx(vr,{className:"h-8 w-8 text-amber-400"}),l.jsx("div",{className:"text-sm font-semibold text-amber-300",children:"Konsole nicht erreichbar"}),l.jsxs("p",{className:"max-w-sm text-[11px] leading-normal text-muted-foreground",children:["Der ",l.jsx("code",{className:"font-mono text-primary",children:"box-console"}),"-Dienst (ttyd) läuft nicht. Auf der Box: ",l.jsx("code",{className:"font-mono",children:"systemctl --user restart box-console"}),"."]})]}),l.jsx("iframe",{src:t,title:"Box-Konsole",className:"h-full w-full border-0",style:{minHeight:"58vh"}})]}):l.jsxs("div",{className:"flex min-h-[58vh] flex-1 items-center justify-center rounded-2xl border border-border/60 bg-background/20 text-xs text-muted-foreground",children:[l.jsx(pf,{className:"mr-2 h-4 w-4"})," Lade Konsole…"]})]})}const wk=[{id:"grundlagen",label:"Grundlagen"},{id:"moe",label:"MoE & Quant"},{id:"lokal",label:"Lokal betreiben"},{id:"modelle",label:"Modell-Landschaft"},{id:"gateway",label:"Gateway-Trick"},{id:"mcp",label:"MCP"},{id:"skills",label:"Skills"},{id:"memory",label:"Gedächtnis & RAG"},{id:"agents",label:"Agenten"},{id:"ide",label:"IDE anbinden"},{id:"tricks",label:"Tricks & Kniffe"},{id:"wartung",label:"Sicherheit & Wartung"},{id:"ressourcen",label:"Ressourcen"},{id:"troubleshooting",label:"Troubleshooting"}];function VL(e){var t;(t=document.getElementById(e))==null||t.scrollIntoView({behavior:"smooth",block:"start"})}function Dr({id:e,icon:t,color:r,title:n,kicker:i,children:o,wide:c}){return l.jsxs("section",{id:e,className:J("scroll-mt-20 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-3",c&&"md:col-span-2"),children:[l.jsxs("div",{className:"flex items-center gap-2.5 border-b border-border/20 pb-3",children:[l.jsx(t,{className:J("h-5 w-5 shrink-0",r)}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:n}),i&&l.jsx("span",{className:J("text-[9px] font-mono",r),children:i})]})]}),l.jsx("div",{className:"text-xs text-muted-foreground space-y-2.5 leading-relaxed",children:o})]})}function Ua({children:e}){return l.jsxs("div",{className:"mt-1 rounded-xl border border-primary/25 bg-primary/[0.06] p-3 text-[11px] leading-relaxed",children:[l.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-primary mb-1",children:[l.jsx(hi,{className:"h-3 w-3"})," Bei dir konkret"]}),l.jsx("div",{className:"text-muted-foreground space-y-1",children:e})]})}function Fe({children:e}){return l.jsx("code",{className:"rounded bg-background/40 border border-border/30 px-1.5 py-0.5 font-mono text-[10px] text-foreground",children:e})}function St({href:e,name:t,note:r}){return l.jsxs("li",{className:"leading-relaxed",children:[l.jsxs("a",{href:e,target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold inline-flex items-center gap-0.5",children:[t,l.jsx(CM,{className:"h-3 w-3 opacity-60"})]}),l.jsxs("span",{className:"text-muted-foreground",children:[" — ",r]})]})}function qL(){const[e,t]=x.useState(!1);return l.jsxs("div",{className:"space-y-7",children:[l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 flex items-start gap-4",children:[l.jsx("div",{className:"h-11 w-11 rounded-xl bg-primary/15 flex items-center justify-center shrink-0",children:l.jsx(mv,{className:"h-6 w-6 text-primary"})}),l.jsxs("div",{className:"space-y-1",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:"Die AI-Bibel"}),l.jsxs("p",{className:"text-sm text-muted-foreground leading-relaxed max-w-2xl",children:["Allgemeines Nachschlagewerk für lokale & agentische AI — Konzepte, Tricks, Kniffe und kuratierte Quellen. ",l.jsx("span",{className:"font-semibold text-foreground",children:"Stand Juni 2026."})," ","Das meiste gilt überall; ",l.jsx("span",{className:"text-primary font-semibold",children:'„Bei dir konkret"'}),"-Kästen zeigen, was dein Stack daraus macht."]})]})]}),l.jsx("div",{className:"sticky top-0 z-10 -mx-1 px-1",children:l.jsx("div",{className:"rounded-xl border border-border/50 bg-card/70 backdrop-blur-xl p-2 shadow-lg shadow-black/20",children:l.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[l.jsx(pv,{className:"h-3.5 w-3.5 text-primary ml-1 mr-0.5 shrink-0"}),(e?wk:wk.slice(0,9)).map(r=>l.jsx("button",{onClick:()=>VL(r.id),className:"rounded-lg px-2.5 py-1 text-[11px] font-semibold text-muted-foreground hover:text-primary hover:bg-primary/10 transition-colors cursor-pointer",children:r.label},r.id)),l.jsx("button",{onClick:()=>t(r=>!r),className:"rounded-lg px-2 py-1 text-[11px] font-semibold text-primary hover:bg-primary/10 transition-colors cursor-pointer",children:e?"weniger":"+ mehr"})]})})}),l.jsxs("div",{className:"grid gap-5 md:grid-cols-2",children:[l.jsxs(Dr,{id:"grundlagen",icon:wi,color:"text-cyan-400",title:"1. Wie LLMs ticken",kicker:"Grundlagen",children:[l.jsxs("p",{children:["Ein LLM ist im Kern ein ",l.jsx("strong",{children:"Wahrscheinlichkeits-Rechner für das nächste Token"}),' (Wortteil). Es „weiß" nichts — es setzt fort, was statistisch am plausibelsten ist. Daraus folgt fast alles andere.']}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Tokens"})," sind die Einheit — ~¾ Wort. Ein- und Ausgabe werden in Tokens gezählt."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Kontextfenster"}),' = wie viele Tokens das Modell gleichzeitig „sehen" kann (Prompt + Antwort). Voll = Anfang fällt raus.']}),l.jsxs("li",{children:[l.jsx("strong",{children:"Parameter"})," = die trainierten Gewichte. Training ist einmalig, ",l.jsx("strong",{children:"Inferenz"})," ist jede Antwort."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Temperatur / Sampling"})," steuert Zufall: niedrig = deterministisch/präzise (Code), hoch = kreativ."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Halluzination"})," ist kein Bug, sondern die Kehrseite des Ratens. Gegenmittel: Grounding via Tools/RAG, Verifikation."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Reasoning-/Thinking-Modelle"}),' „denken" in unsichtbaren Tokens vor der Antwort — besser bei Logik, langsamer/teurer.']})]})]}),l.jsxs(Dr,{id:"moe",icon:o5,color:"text-violet-400",title:"2. MoE & Quantisierung",kicker:"Mehr Modell, weniger Last",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Mixture of Experts (MoE):"})," Statt für jedes Token das ganze Netz zu aktivieren, wählt ein",l.jsx("em",{children:" Router"})," nur ein paar spezialisierte ",l.jsx("em",{children:"Experts"}),' aus. So läuft ein 100B-Modell mit der aktiven Rechenlast eines viel kleineren (z.B. „122B total / 10B aktiv").']}),l.jsxs("p",{children:[l.jsx("strong",{children:"Quantisierung:"})," Gewichte von FP16 auf weniger Bits eindampfen — kleiner & schneller bei minimalem Qualitätsverlust. Faustregel:"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx(Fe,{children:"Q8"})," nahezu verlustfrei, größter Footprint"]}),l.jsxs("li",{children:[l.jsx(Fe,{children:"Q6_K"})," sehr gut, guter Mittelweg"]}),l.jsxs("li",{children:[l.jsx(Fe,{children:"Q4_K_M"})," der Sweet-Spot für lokal — viel Modell pro GB"]})]}),l.jsxs(Ua,{children:["VRAM/RAM ist die harte Grenze — ",l.jsx("strong",{children:"darum"})," ist beides hier zentral: MoE lässt 100B+ überhaupt laufen, Quant entscheidet, was reinpasst. Dein Line-up fährt durchweg ",l.jsx(Fe,{children:"Q4_K_M"}),"/",l.jsx(Fe,{children:"Q6_K"}),"."]})]}),l.jsxs(Dr,{id:"lokal",icon:gh,color:"text-emerald-400",title:"3. Lokal betreiben: Engines & Backends",kicker:"llama.cpp, vLLM & Co.",wide:!0,children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Inference-Engines"})," — was die Modelle ausführt:"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"llama.cpp / GGUF"})," — der De-facto-Standard für lokal, CPU+GPU, läuft überall."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Ollama / LM Studio"})," — bequeme Wrapper mit One-Click-Downloads (LM Studio mit GUI)."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"vLLM / TGI"})," — Server-Engines für maximalen Durchsatz auf dicken GPUs."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"llama-swap"})," — Proxy, der ",l.jsx("em",{children:"mehrere"})," Modelle hinter ",l.jsx("em",{children:"einem"})," Port hält und je nach Anfrage automatisch ein-/aussattelt."]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"GPU-Backends"})," — wie gerechnet wird:"]}),l.jsx("ul",{className:"list-disc pl-4 space-y-1",children:l.jsxs("li",{children:[l.jsx(Fe,{children:"CUDA"})," NVIDIA · ",l.jsx(Fe,{children:"ROCm"})," AMD · ",l.jsx(Fe,{children:"Vulkan"})," herstellerübergreifend · ",l.jsx(Fe,{children:"Metal"})," Apple"]})}),l.jsxs("p",{className:"pt-1",children:[l.jsx("strong",{children:"Begriffe, die immer wiederkommen:"})," Kontext (",l.jsx(Fe,{children:"-c"}),"), Slots/Parallel, KV-Cache, Modell-TTL/Swap, ",l.jsx("strong",{children:"Speculative Decoding"})," (kleines Draft-Modell rät voraus → schneller)."]})]})]}),l.jsxs(Ua,{children:["Deine Box hat eine AMD-APU (gfx1151). ",l.jsx("strong",{children:"Einschränkung & Trick:"})," dort schlägt ",l.jsx(Fe,{children:"Vulkan/RADV"})," das offizielle ",l.jsx(Fe,{children:"ROCm"})," bei Token-Generierung um ~12–22 % — darum läuft die Engine auf Vulkan.",l.jsx(Fe,{children:"llama-swap"})," hält die Alltags-Hirne dauerwarm; ",l.jsx(Fe,{children:"coder"})," nutzt Spec-Decoding."]})]}),l.jsxs(Dr,{id:"modelle",icon:mf,color:"text-sky-400",title:"4. Modell-Landschaft",kicker:"Stand Juni 2026",wide:!0,children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{children:l.jsx("strong",{children:"Open-Weight (lokal nutzbar):"})}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Qwen"})," (Alibaba) — starke Allrounder + Coder + Vision, viele Größen/MoE."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Llama"})," (Meta), ",l.jsx("strong",{children:"Gemma"})," (Google), ",l.jsx("strong",{children:"Phi"})," (Microsoft) — solide Open-Familien."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"DeepSeek"}),", ",l.jsx("strong",{children:"Mistral/Mixtral"})," — kräftige MoE-/Reasoning-Modelle."]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{children:l.jsx("strong",{children:"Frontier (Cloud-API):"})}),l.jsx("ul",{className:"list-disc pl-4 space-y-1",children:l.jsxs("li",{children:[l.jsx("strong",{children:"Claude"})," (Anthropic), ",l.jsx("strong",{children:"GPT"})," (OpenAI), ",l.jsx("strong",{children:"Gemini"})," (Google) — die stärksten Allrounder, aber nicht lokal."]})}),l.jsxs("p",{className:"pt-1",children:[l.jsx("strong",{children:"Modellwahl nach Aufgabe:"})," schnelles Alltags-Hirn · großes Logik-Hirn für harte Tasks · dediziertes Code-Modell · multimodal für Bilder · Embedding-Modell fürs Gedächtnis."]})]})]}),l.jsx("p",{className:"text-[11px] italic",children:'Leaderboards (HF, LMArena) sind grobe Orientierung — der einzige Benchmark, der zählt, ist deine eigene Aufgabe. Vorsicht vor „Benchmaxxing".'}),l.jsxs(Ua,{children:["Dein Line-up via llama-swap: ",l.jsx(Fe,{children:"fast"})," (Alltag/Vision/MoE) · ",l.jsx(Fe,{children:"heavy"})," (schwere Logik) ·",l.jsx(Fe,{children:"coder"})," · ",l.jsx(Fe,{children:"scout"})," · ",l.jsx(Fe,{children:"vision"})," · ",l.jsx(Fe,{children:"embed"})," (fürs Gedächtnis) ·",l.jsx(Fe,{children:"hermes"})," (Agent-Hirn). Verwalten/tauschen im ",l.jsx("strong",{children:"Modell-Manager"}),"-Tab."]})]}),l.jsxs(Dr,{id:"gateway",icon:sI,color:"text-amber-400",title:"5. Der Gateway-Trick",kicker:"OpenAI-kompatibel = überall andocken",children:[l.jsxs("p",{children:["Fast jedes AI-Tool spricht heute das ",l.jsx("strong",{children:"OpenAI-Format"})," (",l.jsx(Fe,{children:"/v1/chat/completions"}),"). Ein",l.jsx("strong",{children:" Gateway"})," davor gibt dir ",l.jsx("em",{children:"einen"})," Endpunkt für alles: zentrales Key-Management, Logging und transparentes ",l.jsx("strong",{children:"Routing"})," — der Client merkt nicht, welches Modell tatsächlich antwortet."]}),l.jsxs("p",{children:["Die ",l.jsx(Fe,{children:"model:auto"}),'-Idee: du sagst „auto", das Gateway wählt das passende Modell je nach Anfrage und lädt es bei Bedarf.']}),l.jsxs(Ua,{children:["Dein Gateway: ",l.jsx(Fe,{children:"http://192.168.178.151:9001/v1"}),", Model ",l.jsx(Fe,{children:"auto"}),", API-Key beliebig. Fertige Configs erzeugt dir der ",l.jsx("strong",{children:"Verbinden"}),"-Tab live — eine Wahrheit, kein Abtippen."]})]}),l.jsxs(Dr,{id:"mcp",icon:Cc,color:"text-violet-400",title:"6. MCP — Werkzeuge für Agenten",kicker:"USB-C für AI-Tools",children:[l.jsxs("p",{children:["Das ",l.jsx("strong",{children:"Model Context Protocol"})," (offen, von Anthropic initiiert) standardisiert, wie ein AI-Client mit externen Tools & Datenquellen spricht. Ein ",l.jsx("strong",{children:"MCP-Server"})," bringt Fähigkeiten: Dateien, Web-Fetch, Git, Datenbanken, eigene APIs."]}),l.jsx("p",{children:"Statt für jeden Editor eigene Tools zu schreiben, bindet jeder MCP-fähige Agent denselben Server an."}),l.jsxs("div",{className:"flex items-start gap-1.5 rounded-xl border border-amber-500/25 bg-amber-500/[0.06] p-2.5 text-[11px]",children:[l.jsx(s5,{className:"h-3.5 w-3.5 text-amber-400 shrink-0 mt-0.5"}),l.jsxs("span",{children:[l.jsx("strong",{children:"Sicherheit:"})," ein MCP-Server hat echten Zugriff (Dateien, Shell). Nur vertrauenswürdige Server laufen lassen, Rechte minimal halten, Quelle prüfen."]})]})]}),l.jsxs(Dr,{id:"skills",icon:cI,color:"text-emerald-400",title:"7. Agent Skills",kicker:"Wiederverwendbare Fähigkeiten",children:[l.jsxs("p",{children:["Ein ",l.jsx("strong",{children:"Skill"})," ist ein Ordner mit einer ",l.jsx(Fe,{children:"SKILL.md"})," (YAML-Kopf + Anleitung, optional Skripte/Beispiele), den der Agent für eine bestimmte Aufgabe lädt — z.B. TDD, Code-Vereinfachung, API-Design."]}),l.jsx("pre",{className:"p-2.5 bg-background/25 rounded-lg border border-border/30 font-mono text-[9px] text-foreground overflow-x-auto whitespace-pre",children:`--- name: tdd-pro description: Treibt Entwicklung mit strikter TDD-Praxis --- # Instructions -...`}),l.jsxs("p",{children:["Suchen & installieren über die ",l.jsx("strong",{children:"skills.sh"}),"-Registry: ",l.jsx(Fe,{children:"npx skills find"})," /",l.jsx(Fe,{children:"npx skills add owner/repo"}),". Skills liegen projektweit (vom Agent beim Start gelesen) oder global."]})]}),l.jsxs(Dr,{id:"memory",icon:UM,color:"text-indigo-400",title:"8. Gedächtnis & RAG",kicker:"Modelle vergessen — du nicht",wide:!0,children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:["LLMs sind ",l.jsx("strong",{children:"zustandslos"}),": ohne Hilfe weiß das Modell beim nächsten Turn nichts mehr. Gedächtnis lebt extern."]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Embeddings"})," wandeln Text in Vektoren; ein ",l.jsx("strong",{children:"Vektor-Store"})," (Chroma, …) findet semantisch Ähnliches."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"RAG"})," = relevante Fakten vor dem Turn heraussuchen und einblenden statt alles im Prompt zu halten."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Long-Context vs. RAG:"}),' riesige Fenster sind bequem, aber teuer & „lost in the middle" — gezieltes Abrufen skaliert besser.']})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Auto-lernendes Gedächtnis"})," ist die nächste Stufe:"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:["extrahiert Fakten ",l.jsx("em",{children:"selbst"})," aus Gesprächen, statt nur abzuspeichern"]}),l.jsx("li",{children:"dedupliziert semantisch (kein 10× derselbe Fakt)"}),l.jsxs("li",{children:[l.jsx("strong",{children:"Graph-Sicht"})," = Fakten ",l.jsx("em",{children:"plus"})," ihre Beziehungen, nicht nur eine flache Liste"]})]})]})]}),l.jsxs(Ua,{children:["Dein Gedächtnis (Tab ",l.jsx("strong",{children:"Gedächtnis"}),") ist ",l.jsx("strong",{children:"Mem0"}),"-basiert: auto-lernend & semantisch, ",l.jsx("strong",{children:"graph-first"})," dargestellt, mit 4-Typen-Taxonomie (",l.jsx(Fe,{children:"Identität"})," · ",l.jsx(Fe,{children:"Wissen"})," · ",l.jsx(Fe,{children:"Regeln"})," · ",l.jsx(Fe,{children:"Ereignisse"}),"). Einstieg über ein kurzes ",l.jsx("strong",{children:"Hermes-Onboarding-Gespräch"})," im Terminal — der Agent lernt im Hintergrund nach jedem Turn.",l.jsx("br",{}),l.jsx("strong",{children:"Gotcha:"})," ein gelöschter Fakt kann wieder auftauchen, solange die Original-Nachricht noch im Verlauf steht (additive Extraktion)."]})]}),l.jsxs(Dr,{id:"agents",icon:jn,color:"text-rose-400",title:"9. Autonome Agenten betreiben",kicker:"LLM in der Schleife",wide:!0,children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:["Ein ",l.jsx("strong",{children:"Agent"})," ist ein LLM in einer Schleife mit Tools:",l.jsx("em",{children:" denken → Tool aufrufen → Ergebnis beobachten → weiter"}),", bis das Ziel erreicht ist."]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Guardrails"})," (Hard-Stop, Tool-Limits) verhindern Endlos-Loops, wenn ein Tool fehlt oder hängt."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Kontext-Hygiene"})," ist die wichtigste Disziplin: frische Sessions starten — vollgemüllte Historien werden langsam, driften und halluzinieren."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Kanäle:"})," CLI/Terminal, Chat-UI, Messaging (z.B. Telegram), reine API."]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Least Privilege:"})," gib einem Agenten nur die Tools, die er wirklich braucht. Kritische Aktionen (Shell auf dem Host, Löschen, Geld/Deploys) hinter menschliche Freigabe."]}),l.jsxs("p",{children:[l.jsx("strong",{children:"Was sich vollautomatisch lohnt:"})," Modell-Routing, Hintergrund-Gedächtnis, Recherche. ",l.jsx("strong",{children:"Was Freigabe braucht:"})," Systembefehle, Updates/Reboots, permanentes Löschen."]})]})]}),l.jsxs(Ua,{children:[l.jsx("strong",{children:"Hermes"})," ist dein Box-Agent (Hirn = ",l.jsx(Fe,{children:"fast"}),"). Reden tust du mit ihm im",l.jsx("strong",{children:" Terminal"}),"-Tab (Web-Terminal via ttyd) oder per ",l.jsx("strong",{children:"Telegram"}),". Er hat MCP-Server für Gedächtnis, Stack-Steuerung, Web-Fetch und ",l.jsx("strong",{children:"PC-Steuerung"})," (Executor auf deinem Windows-PC). Status & Verdrahtung im ",l.jsx("strong",{children:"Hermes"}),"-Tab."]})]}),l.jsxs(Dr,{id:"ide",icon:zs,color:"text-cyan-400",title:"10. IDE / Editor anbinden",kicker:"Vibe-Coding lokal",children:[l.jsxs("p",{children:["Jede ",l.jsx("strong",{children:"OpenAI-kompatible"})," IDE oder Extension lässt sich auf einen lokalen Server umbiegen — Base-URL + Model eintragen, fertig:"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Cline"})," & ",l.jsx("strong",{children:"Roo Code"})," (VS-Code-Extensions, voller Agent + MCP)"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Cursor"})," (VS-Code-Fork mit Top-Autocomplete)"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Continue"}),", ",l.jsx("strong",{children:"aider"})," (CLI), ",l.jsx("strong",{children:"OpenCode"})," (Desktop)"]})]}),l.jsxs(Ua,{children:["Tipp den Kram nicht ab: der ",l.jsx("strong",{children:"Verbinden"}),"-Tab generiert die fertige Config (inkl. MCP-Gedächtnis) pro Tool zum Kopieren. Essenz: Base ",l.jsx(Fe,{children:"…:9001/v1"}),", Model ",l.jsx(Fe,{children:"auto"}),", Key beliebig."]})]}),l.jsx(Dr,{id:"tricks",icon:eI,color:"text-amber-400",title:"11. Tricks & Kniffe",kicker:"Was im Alltag wirklich spart",wide:!0,children:l.jsx("div",{className:"grid md:grid-cols-3 gap-3",children:[["Kontext sauber halten","Neue Session statt Mega-Historie. Drift, Tempo und Halluzination hängen direkt am Kontext-Müll."],["Plan-then-Act","Erst Plan/Vorgehen bestätigen lassen, dann ausführen. Spart teure Holzwege."],["Gezielte Edits","Nie ganze Dateien überschreiben für eine Zeile — Such-/Ersetz-Tools nutzen. Weniger Tokens, weniger Fehler."],["Non-interaktive Befehle","Keine interaktiven Prompts im Agent-Terminal; lange Tasks als Background-Job. Sonst hängt der Loop."],["DevTools koppeln","Browser-/Konsolen-Zugriff geben — der Agent liest echte Fehler statt blind zu raten."],["Richtige Modellwahl","Schnelles Hirn für Alltag, großes für harte Logik, Coder fürs Coden. Nicht alles mit der Kanone."],["Akzeptanzkriterien","Sag konkret, woran „fertig“ erkennbar ist. Vage Prompts → vage Ergebnisse."],["Verifizieren statt vertrauen","Tests/Live-Check fordern. „Sollte funktionieren“ ist kein Beweis."],["Regeln ins Gedächtnis","Wiederkehrende Vorlieben/Konventionen einmal ablegen — der Agent zieht sie selbst."]].map(([r,n])=>l.jsxs("div",{className:"space-y-1 p-3 bg-background/10 rounded-xl border border-border/30",children:[l.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-foreground text-[11px]",children:[l.jsx(ka,{className:"h-3 w-3 text-amber-400"})," ",r]}),l.jsx("p",{className:"text-[11px]",children:n})]},r))})}),l.jsx(Dr,{id:"wartung",icon:el,color:"text-emerald-400",title:"12. Sicherheit & Wartung",kicker:"Damit's auch morgen noch läuft",wide:!0,children:l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{className:"flex items-center gap-1.5 font-bold text-foreground",children:[l.jsx(i5,{className:"h-3.5 w-3.5 text-emerald-400"})," Goldene Regeln"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Ein ungetesteter Restore ist kein Backup."})," Wiederherstellung mindestens einmal echt durchspielen."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Updates können Dinge still zerschießen"})," — gerade bei AI-Stacks (Embeddings, Provider-Interna). Versionen pinnen, Smoke-Test, Post-Check."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Least Privilege"})," für Agenten, MCP-Server und PC-Zugriff. Kritisches hinter Freigabe."]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{className:"flex items-center gap-1.5 font-bold text-foreground",children:[l.jsx(ru,{className:"h-3.5 w-3.5 text-emerald-400"})," Bei dir im SystemDrawer"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Backup:"})," tägliches Voll-Zustands-Backup, getesteter ",l.jsx(Fe,{children:"restore.sh"})," (Doku in ",l.jsx(Fe,{children:"docs/BACKUP.md"}),")."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Updates:"})," git-basierter Update-Check; ",l.jsx("strong",{children:"Hermes-Update-Button"})," mit anschließendem ",l.jsx("strong",{children:"Gehirn-Check"})," (rot, falls das Update das Gedächtnis zerschießt) + Engine-Update."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Dienste & Gefahrenzone:"})," Restart/Logs pro Dienst, kritische Eingriffe getrennt."]})]}),l.jsx("p",{className:"text-[10px] italic",children:'Erreichbar über das System-Icon → Tab „Wartung".'})]})]})}),l.jsxs("section",{id:"ressourcen",className:"scroll-mt-20 md:col-span-2 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",{className:"flex items-center gap-2.5 border-b border-border/20 pb-3",children:[l.jsx(mv,{className:"h-5 w-5 text-primary"}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"13. Kuratierte Ressourcen & Links"}),l.jsx("span",{className:"text-[9px] font-mono text-primary",children:"Sauber geordnet — die guten Quellen"})]})]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-5 text-xs",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[l.jsx(mf,{className:"h-3.5 w-3.5 text-sky-400"})," Modelle & Engines"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[l.jsx(St,{href:"https://huggingface.co/models",name:"Hugging Face",note:"das Repository für offene Modelle (GGUF, Embeddings, Datasets)."}),l.jsx(St,{href:"https://github.com/ggml-org/llama.cpp",name:"llama.cpp",note:"die Referenz-Engine für lokale Inferenz."}),l.jsx(St,{href:"https://github.com/mostlygeek/llama-swap",name:"llama-swap",note:"mehrere Modelle hinter einem Port, Auto-Swap."}),l.jsx(St,{href:"https://ollama.com",name:"Ollama",note:"einfachster Einstieg, One-Command-Modelle."}),l.jsx(St,{href:"https://lmstudio.ai",name:"LM Studio",note:"lokale GUI zum Stöbern, Laden & Chatten."}),l.jsx(St,{href:"https://github.com/vllm-project/vllm",name:"vLLM",note:"Hochdurchsatz-Serving auf dicken GPUs."})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[l.jsx(Ac,{className:"h-3.5 w-3.5 text-violet-400"})," MCP & Skills"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[l.jsx(St,{href:"https://modelcontextprotocol.io",name:"MCP — offizielle Doku",note:"Spezifikation & Einstieg."}),l.jsx(St,{href:"https://github.com/modelcontextprotocol/servers",name:"Offizielle MCP-Server",note:"filesystem, git, postgres, fetch & mehr."}),l.jsx(St,{href:"https://smithery.ai",name:"Smithery",note:"Registry zum Suchen & Auto-Installieren von MCP-Servern."}),l.jsx(St,{href:"https://glama.ai/mcp/servers",name:"Glama MCP Registry",note:"kuratierte Community-Datenbank."}),l.jsx(St,{href:"https://skills.sh",name:"skills.sh",note:"Registry & CLI für Agent-Skills."})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[l.jsx(jn,{className:"h-3.5 w-3.5 text-rose-400"})," Agenten & Frameworks"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[l.jsx(St,{href:"https://github.com/NousResearch/hermes-agent",name:"Hermes Agent (Nous)",note:"der Agent, der auf deiner Box läuft."}),l.jsx(St,{href:"https://docs.claude.com",name:"Anthropic / Claude Docs",note:"API, Tool-Use, Agent SDK, MCP."}),l.jsx(St,{href:"https://github.com/cline/cline",name:"Cline",note:"autonomer Coding-Agent für VS Code."}),l.jsx(St,{href:"https://aider.chat",name:"aider",note:"AI-Pair-Programming im Terminal, git-nativ."}),l.jsx(St,{href:"https://continue.dev",name:"Continue",note:"Open-Source-Autopilot für IDEs."})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[l.jsx(hv,{className:"h-3.5 w-3.5 text-amber-400"})," Lernen & Community"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[l.jsx(St,{href:"https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/overview",name:"Prompt-Engineering (Anthropic)",note:"die beste praktische Anleitung."}),l.jsx(St,{href:"https://github.com/anthropics/anthropic-cookbook",name:"Anthropic Cookbook",note:"lauffähige Rezepte für Tools, RAG, Agenten."}),l.jsx(St,{href:"https://www.promptingguide.ai",name:"Prompt Engineering Guide",note:"herstellerneutrales Nachschlagewerk."}),l.jsx(St,{href:"https://github.com/mem0ai/mem0",name:"Mem0",note:"die auto-lernende Memory-Schicht hinter deinem Gedächtnis."}),l.jsx(St,{href:"https://www.reddit.com/r/LocalLLaMA/",name:"r/LocalLLaMA",note:"der Puls der lokalen-LLM-Szene."})]})]})]})]}),l.jsx(Dr,{id:"troubleshooting",icon:JM,color:"text-rose-400",title:"14. Troubleshooting",kicker:"Wenn's hakt",wide:!0,children:l.jsxs("ul",{className:"space-y-2 list-disc pl-4",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Keine Verbindung?"})," Selbes LAN wie die Box? IP/Port stimmen (",l.jsx(Fe,{children:":9001"}),")? Backend-Status in der ",l.jsx("strong",{children:"Zentrale"})," prüfen."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Modell antwortet nicht / langsam?"})," In der ",l.jsx("strong",{children:"Zentrale → Dienste"})," schauen, ob ",l.jsx(Fe,{children:"llama-swap"})," grün ist; sonst Restart. Erstes Token nach Swap dauert (Modell lädt)."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Agent dreht durch / halluziniert?"})," Frische Session im ",l.jsx("strong",{children:"Terminal"})," starten — meist ist es vollgemüllter Kontext."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Gedächtnis findet nichts?"})," Embedding-Dienst online? Semantisch suchen (Sinn statt exaktem Wort). Leeres Gedächtnis → Hermes-Onboarding starten."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Update hat etwas zerschossen?"})," Genau dafür gibt es Backup & ",l.jsx(Fe,{children:"restore.sh"})," — den getesteten Restore fahren, dann Ursache suchen."]})]})})]}),l.jsx("p",{className:"text-center text-[10px] text-muted-foreground/50 pt-2",children:"Mission Control 2 · AI-Bibel · Stand Juni 2026 — lebendes Dokument, wächst mit dem Stack."})]})}function QR({title:e,hint:t}){return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold",children:e}),l.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),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(BM,{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 wk=[{id:"mission-control-2",label:"Mission Control",type:"user",reach:"gateway (integr"},{id:"hermes-gateway",label:"Hermes Gateway",type:"user",reach:"hermes-gateway"},{id:"mem0-service",label:"Mem0 (Gedächtnis)",type:"user",reach:"mem0"},{id:"voice-service",label:"Voice (Sprache)",type:"user",reach:"voice"},{id:"hermes-builtin-ui",label:"Hermes GUI (Desktop-Gateway)",type:"user",reach:"hermes-gui"},{id:"llama-swap",label:"Llama Swap",type:"system",reach:"llama-swap"}];function nc({icon:e,iconClass:t,name:r,status:n,available:i,busy:o,actionLabel:c,onAction:u}){return l.jsxs("div",{className:J("flex items-center gap-3 rounded-lg border px-3 py-2",i?"border-amber-500/30 bg-amber-500/5":"border-border/50 bg-background/20"),children:[l.jsx(e,{className:J("h-4 w-4 shrink-0",t)}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-xs text-foreground truncate",children:r}),l.jsx("div",{className:J("text-[10px] truncate",i?"text-amber-400/90":"text-muted-foreground"),children:n})]}),l.jsx("button",{onClick:u,disabled:!i||o,className:J("text-[11px] font-semibold rounded-lg px-2.5 py-1 transition-colors shrink-0",i?"bg-primary text-primary-foreground hover:opacity-90 cursor-pointer":"border border-border/50 text-muted-foreground/40 cursor-default"),children:o?"…":c})]})}function YR({label:e,ok:t,system:r,busy:n,onRestart:i,onLogs:o}){return l.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg border border-border/50 bg-background/20 px-3 py-2",children:[l.jsx("span",{className:J("w-1.5 h-1.5 rounded-full shrink-0",t===!0?"bg-emerald-500":t===!1?"bg-red-500":"bg-muted-foreground/40")}),l.jsxs("span",{className:"flex-1 text-xs text-foreground truncate",children:[e,r&&l.jsx("span",{className:"text-[9px] text-muted-foreground",children:" (root)"})]}),l.jsx("button",{onClick:i,disabled:n,title:"Neu starten",className:"text-muted-foreground hover:text-primary transition-colors disabled:opacity-50",children:l.jsx(mo,{className:J("h-3.5 w-3.5",n&&"animate-spin")})}),l.jsx("button",{onClick:o,title:"Logs ansehen",className:"text-muted-foreground hover:text-primary transition-colors",children:l.jsx(r5,{className:"h-3.5 w-3.5"})})]})}function vg(e){return e==null?"":e>1024**3?`${(e/1024**3).toFixed(2)} GB`:`${(e/1024**2).toFixed(1)} MB`}const ZR=/\b(error|fehler|fail(ed|ure)?|fatal|critical|crit|panic|traceback|exception|denied|refused|unable|emerg|alert|oom|killed)\b/i,XR=/\b(warn(ing)?|deprecat\w*|retry(ing)?|timeout|timed out|degraded|missing|not found|nicht gefunden)\b/i;function JR(e){return ZR.test(e)?"error":XR.test(e)?"warn":"info"}const eL={error:"text-red-400",warn:"text-amber-300",info:"text-cyan-300/80"};function tL({service:e,text:t,loading:r,logStatus:n,onRefresh:i,onOpenSettings:o}){const[c,u]=x.useState(!1),[f,h]=x.useState(""),m=x.useRef(null),p=x.useMemo(()=>t?t.split(` -`).map(k=>({t:k,level:JR(k)})):[],[t]),v=x.useMemo(()=>p.filter(k=>k.level!=="info").length,[p]),b=f.trim().toLowerCase(),S=p.filter(k=>(!c||k.level!=="info")&&(!b||k.t.toLowerCase().includes(b))),w=n==="password_required"||n==="incorrect_password";return 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-10 items-center justify-between gap-2 px-3 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 shrink-0",children:[l.jsx(h5,{className:"h-3 w-3 text-primary"}),l.jsx("span",{className:"hidden sm:inline",children:"stdout/stderr —"})," ",e]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsxs("div",{className:"relative",children:[l.jsx(Js,{className:"pointer-events-none absolute left-2 top-1/2 h-3 w-3 -translate-y-1/2 text-muted-foreground"}),l.jsx("input",{value:f,onChange:k=>h(k.target.value),placeholder:"filtern…",className:"h-7 w-24 sm:w-36 rounded-md border border-border/50 bg-background/40 pl-6 pr-2 text-[10px] text-foreground outline-none focus:border-primary/50"})]}),l.jsxs("button",{onClick:()=>u(k=>!k),title:"Nur Fehler und Warnungen zeigen",className:J("flex h-7 items-center gap-1 rounded-md border px-2 text-[10px] font-semibold transition-colors",c?"border-amber-500/50 bg-amber-500/15 text-amber-300":"border-border/50 bg-background/20 text-muted-foreground hover:text-foreground"),children:[l.jsx(vr,{className:"h-3 w-3"}),"Nur Probleme",v>0?` (${v})`:""]}),l.jsx("button",{onClick:i,disabled:r,title:"Neu laden",className:"flex h-7 w-7 items-center justify-center rounded-md border border-border/50 bg-background/20 text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50",children:l.jsx(mo,{className:J("h-3 w-3",r&&"animate-spin")})})]})]}),l.jsx("div",{ref:m,className:"flex-1 overflow-y-auto p-3 text-[10px] font-mono leading-relaxed scrollbar-thin select-text",children:w?l.jsxs("div",{className:"flex h-full flex-col items-center justify-center space-y-3 p-6 text-center",children:[l.jsx(vr,{className:"h-8 w-8 text-amber-400 animate-pulse animate-duration-1000"}),l.jsx("div",{className:"text-xs font-semibold text-amber-300",children:n==="incorrect_password"?"Falsches Sudo-Passwort hinterlegt.":"Sudo-Passwort für systemd-Dienste erforderlich."}),l.jsxs("p",{className:"max-w-xs text-[10px] leading-normal text-muted-foreground",children:["Für das Auslesen der systemd-Logs von ",e," werden Root-Rechte benötigt. Hinterlege dein Passwort in den Einstellungen."]}),l.jsx("button",{onClick:o,className:"mt-2 rounded-md bg-primary px-3 py-1.5 text-[10px] font-semibold text-primary-foreground transition-colors hover:bg-primary/95",children:"Sudo-Passwort eintragen"})]}):r&&!t?l.jsx("span",{className:"text-muted-foreground",children:"Lade Logs…"}):p.length===0?l.jsx("span",{className:"text-muted-foreground",children:"Keine Logeinträge vorhanden."}):S.length===0?l.jsx("span",{className:"text-muted-foreground",children:c?"Keine Fehler oder Warnungen — der Dienst läuft sauber. ✓":"Kein Treffer für den Filter."}):S.map((k,N)=>l.jsx("div",{className:J("whitespace-pre-wrap",eL[k.level]),children:k.t||" "},N))})]})}function rL({open:e,showAlert:t}){const[r,n]=x.useState(""),[i,o]=x.useState(""),[c,u]=x.useState(!1),[f,h]=x.useState(!1);return x.useEffect(()=>{e&&(n(localStorage.getItem("mc_sudo_password")||""),o(localStorage.getItem("mc_hf_token")||""))},[e]),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Zugangsdaten & Schlüssel"}),l.jsx("p",{className:"text-[10px] text-muted-foreground leading-normal",children:"Diese Daten werden ausschließlich lokal in deinem Browser (localStorage) gespeichert und bei Bedarf an das Backend übertragen."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[l.jsx(el,{className:"h-4 w-4 text-amber-400"}),"Host Sudo-Passwort"]}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:c?"text":"password",value:r,onChange:m=>n(m.target.value),"aria-label":"Host Sudo-Passwort",name:"sudo-password",autoComplete:"off",spellCheck:!1,placeholder:"Sudo-Passwort für System-Operationen",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),l.jsx("button",{type:"button",onClick:()=>u(!c),"aria-label":c?"Passwort verbergen":"Passwort anzeigen",className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:c?l.jsx(Tw,{className:"h-4 w-4","aria-hidden":"true"}):l.jsx(Ec,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Wird benötigt für systemd-Dienste (Llama Swap logs/restart), OS-Update (apt) und Reboot."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[l.jsx(YM,{className:"h-4 w-4 text-violet-400"}),"HuggingFace API Token"]}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:f?"text":"password",value:i,onChange:m=>o(m.target.value),"aria-label":"HuggingFace API Token",name:"hf-token",autoComplete:"off",spellCheck:!1,placeholder:"hf_…",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),l.jsx("button",{type:"button",onClick:()=>h(!f),"aria-label":f?"Token verbergen":"Token anzeigen",className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:f?l.jsx(Tw,{className:"h-4 w-4","aria-hidden":"true"}):l.jsx(Ec,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Erlaubt das Herunterladen von geschützten oder Gate-restricted Modellen direkt über Mission Control."})]}),l.jsxs("div",{className:"flex gap-3 pt-2",children:[l.jsx("button",{onClick:()=>{localStorage.setItem("mc_sudo_password",r),localStorage.setItem("mc_hf_token",i),t("Erfolgreich","Einstellungen erfolgreich lokal gespeichert.")},className:"flex-1 h-9 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/90 rounded-lg transition-colors shadow shadow-primary/10 cursor-pointer",children:"Speichern"}),l.jsx("button",{onClick:()=>{n(""),o(""),localStorage.removeItem("mc_sudo_password"),localStorage.removeItem("mc_hf_token"),t("Gelöscht","Zugangsdaten gelöscht.")},className:"h-9 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Zurücksetzen"})]})]})}function nL({detail:e,maintenanceJob:t,onClose:r,onApply:n}){var f,h;const i=e.data,o={os:{icon:el,cls:"text-cyan-400",title:"OS-Pakete (apt)"},engine:{icon:gh,cls:"text-violet-400",title:"Inferenz-Engine (llama.cpp)"},swap:{icon:f5,cls:"text-fuchsia-400",title:"Router (llama-swap)"},hermes:{icon:jn,cls:"text-amber-400",title:"Hermes-Agent"}}[e.kind],c=o.icon,u=i?e.kind==="os"?(i.count??0)===0:e.kind==="hermes"?(i.behind??0)===0:i.installed_build!=null&&i.latest_build!=null&&i.latest_build<=i.installed_build:!0;return l.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4",children:[l.jsx("div",{className:"absolute inset-0 bg-black/70 backdrop-blur-sm",onClick:r}),l.jsxs("div",{className:"relative w-full max-w-lg max-h-[80vh] flex flex-col rounded-2xl border border-border/60 bg-card shadow-2xl font-sans text-foreground",children:[l.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between border-b border-border/40 px-5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(c,{className:J("h-4.5 w-4.5",o.cls)}),l.jsx("h3",{className:"text-sm font-semibold",children:o.title})]}),l.jsx("button",{onClick:r,className:"flex h-7 w-7 items-center justify-center rounded-lg border border-border/40 text-muted-foreground hover:bg-accent transition-colors",children:l.jsx(nn,{className:"h-4 w-4"})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-5 text-xs space-y-3 scrollbar-thin",children:e.loading?l.jsxs("div",{className:"flex h-24 items-center justify-center gap-2 text-muted-foreground",children:[l.jsx(mo,{className:"h-4 w-4 animate-spin"})," Details werden geladen…"]}):i!=null&&i.error?l.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/5 p-3 text-red-400",children:i.error}):l.jsxs(l.Fragment,{children:[(i==null?void 0:i.action_needed)!=null&&l.jsxs("div",{className:J("flex items-start gap-2 rounded-lg border p-3",i.action_needed?"border-amber-500/40 bg-amber-500/10":"border-emerald-500/40 bg-emerald-500/10"),children:[i.action_needed?l.jsx(vr,{className:"h-4 w-4 text-amber-400 shrink-0 mt-0.5"}):l.jsx(t5,{className:"h-4 w-4 text-emerald-400 shrink-0 mt-0.5"}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:J("text-xs font-semibold",i.action_needed?"text-amber-300":"text-emerald-300"),children:["Musst du etwas tun? ",i.action_needed?"Ja":"Nein — die Box regelt das (Fangnetz)"]}),i.action_needed&&i.action_text&&l.jsx("div",{className:"mt-0.5 text-[11px] text-foreground/90",children:i.action_text})]})]}),(i==null?void 0:i.summary)&&l.jsxs("div",{className:"rounded-lg border border-primary/25 bg-primary/5 p-3 space-y-1",children:[l.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-primary",children:"Was dieses Update bedeutet (Zusammenfassung der Box)"}),l.jsx("pre",{className:"whitespace-pre-wrap text-[11px] leading-relaxed text-foreground/90 font-sans",children:i.summary})]}),e.kind==="os"?l.jsxs(l.Fragment,{children:[((i==null?void 0:i.count)??0)===0?l.jsx("div",{className:"text-muted-foreground",children:"Keine Pakete zu aktualisieren — System ist aktuell."}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"text-muted-foreground",children:[i.count," Paket(e) werden aktualisiert:"]}),l.jsx("div",{className:"space-y-1",children:i.packages.map(m=>l.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border border-border/40 bg-background/30 px-2.5 py-1.5",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[11px] truncate",children:[l.jsx(Lw,{className:"h-3 w-3 text-cyan-400 shrink-0"}),m.name]}),l.jsxs("span",{className:"flex items-center gap-1 font-mono text-[10px] text-muted-foreground shrink-0",children:[l.jsx("span",{children:m.current}),l.jsx(hf,{className:"h-3 w-3"}),l.jsx("span",{className:"text-emerald-400",children:m.candidate})]})]},m.name))})]}),(((f=i==null?void 0:i.held_back)==null?void 0:f.length)??0)>0&&l.jsxs("div",{className:"space-y-1.5 rounded-lg border border-border/40 bg-background/20 p-3",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground",children:[l.jsx(ph,{className:"h-3.5 w-3.5"})," Vom Hersteller zurückgestellt — kein Handeln nötig"]}),l.jsx("p",{className:"text-[10px] text-muted-foreground leading-normal",children:"Diese Pakete gäbe es bereits, Ubuntu spielt sie aber gestaffelt aus (Phasen-Rollout) bzw. hält sie kurz zurück. Sie kommen bei einem der nächsten automatischen Läufe von selbst — das ist kein Fehler und nichts hängt fest."}),l.jsx("div",{className:"space-y-1",children:i.held_back.map(m=>l.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border border-border/30 bg-background/30 px-2.5 py-1.5",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[11px] truncate",children:[l.jsx(Lw,{className:"h-3 w-3 text-muted-foreground shrink-0"}),m.name]}),l.jsx("span",{className:"text-[9px] text-muted-foreground shrink-0",children:m.reason==="phasing"?"Phasen-Rollout":"vorerst zurückgehalten"})]},m.name))})]})]}):e.kind==="engine"||e.kind==="swap"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px]",children:[l.jsxs("span",{className:"rounded-md border border-border/40 bg-background/30 px-2 py-1",children:["Build ",(i==null?void 0:i.installed_build)??"?"]}),l.jsx(hf,{className:"h-3.5 w-3.5 text-muted-foreground"}),l.jsxs("span",{className:"rounded-md border border-emerald-500/30 bg-emerald-500/5 px-2 py-1 text-emerald-400",children:["Build ",(i==null?void 0:i.latest_build)??"?"]})]}),((i==null?void 0:i.name)||(i==null?void 0:i.latest_tag))&&l.jsxs("div",{className:"text-muted-foreground",children:["Release: ",l.jsx("span",{className:"text-foreground",children:i==null?void 0:i.name}),i!=null&&i.latest_tag?` (${i.latest_tag})`:""]}),(i==null?void 0:i.url)&&l.jsxs("a",{href:i.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-primary hover:underline",children:["Original-Release-Notes auf GitHub ",l.jsx(Mx,{className:"h-3 w-3"})]}),(i==null?void 0:i.body)&&l.jsxs("details",{className:"group",children:[l.jsx("summary",{className:"cursor-pointer text-[10px] text-muted-foreground hover:text-foreground",children:"Original-Notizen (englisch) anzeigen"}),l.jsx("pre",{className:"mt-1.5 whitespace-pre-wrap rounded-lg border border-border/40 bg-background/30 p-3 text-[10px] leading-relaxed text-muted-foreground max-h-60 overflow-y-auto scrollbar-thin",children:i.body})]})]}):(((h=i==null?void 0:i.commits)==null?void 0:h.length)??0)===0?l.jsx("div",{className:"text-muted-foreground",children:"Keine neuen Commits — Hermes-Agent ist bereits aktuell."}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"text-muted-foreground",children:[i.behind," neue Commit(s) auf ",l.jsxs("span",{className:"font-mono text-foreground",children:["origin/",i.branch]}),":"]}),l.jsx("div",{className:"space-y-1",children:i.commits.map(m=>l.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border/40 bg-background/30 px-2.5 py-1.5",children:[l.jsx(GM,{className:"h-3.5 w-3.5 text-primary shrink-0 mt-0.5"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[11px] truncate",children:m.subject}),l.jsxs("div",{className:"font-mono text-[9px] text-muted-foreground",children:[m.hash," · ",m.when]})]})]},m.hash))})]}),e.kind!=="os"&&!u&&l.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-border/40 bg-background/20 p-2.5",children:[l.jsx(d5,{className:"h-3.5 w-3.5 text-emerald-400 shrink-0 mt-0.5"}),l.jsxs("p",{className:"text-[10px] text-muted-foreground leading-normal",children:["Vor dem Update sichert die Box automatisch den alten Stand. Danach prüft sie den ganzen Stack per echter Anfrage — läuft etwas nicht, rollt sie von selbst zurück",e.kind==="hermes"?" und startet den Gateway neu":"","."]})]})]})}),l.jsxs("div",{className:"flex gap-3 border-t border-border/40 p-4 shrink-0",children:[l.jsx("button",{onClick:r,className:"h-9 flex-1 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold text-muted-foreground hover:bg-accent transition-colors cursor-pointer",children:"Schließen"}),l.jsx("button",{onClick:n,disabled:e.loading||u||!!t,title:t?`Update läuft bereits: ${t.label}`:void 0,className:"h-9 flex-1 rounded-lg bg-primary text-xs font-semibold text-primary-foreground hover:opacity-90 transition-all cursor-pointer disabled:opacity-40 disabled:cursor-default",children:t?"Update läuft…":"Jetzt aktualisieren"})]})]})]})}function mE({open:e,onClose:t,defaultTab:r="maintenance"}){var Ti,ml;const[n,i]=x.useState(null),[o,c]=x.useState([]),[u,f]=x.useState("llama-swap"),[h,m]=x.useState(""),[p,v]=x.useState(!1),[b,S]=x.useState(null),[w,k]=x.useState({}),[N,E]=x.useState("maintenance"),[A,C]=x.useState(!1),[_,O]=x.useState(""),[D,B]=x.useState(!1),[z,$]=x.useState(null),[K,W]=x.useState([]),[ve,ue]=x.useState(!1),[pe,oe]=x.useState(null),[le,Z]=x.useState(null);function ie(V,Re,it){Z({type:"alert",title:V,message:Re,onConfirm:()=>{Z(null),it&&it()}})}function te(V,Re,it){Z({type:"confirm",title:V,message:Re,onConfirm:()=>{Z(null),it()},onCancel:()=>Z(null)})}function I(V){return V?new Date(V*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"Nie"}x.useEffect(()=>{e&&r&&E(r)},[e,r]);function M(){xe("/api/maintenance/updates").then(i).catch(V=>console.error("Error loading updates",V))}function U(){xe("/api/jobs").then(V=>c(V.jobs||[])).catch(V=>console.error("Error loading jobs",V))}function ne(){xe("/api/system/services").then($).catch(()=>{})}function ee(){xe("/api/system/backups").then(V=>W(V.backups||[])).catch(()=>{})}function X(V){v(!0),S(null),xe(`/api/maintenance/logs?service=${V}&lines=150`).then(Re=>{Re.ok?m(Re.text):(m(`Fehler beim Laden der Logs: ${Re.err||"Unbekannter Fehler"}`),(Re.status==="incorrect_password"||Re.status==="password_required")&&S(Re.status))}).catch(Re=>m(`Fehler: ${Re.message}`)).finally(()=>v(!1))}x.useEffect(()=>{if(!e)return;M(),U(),ne(),ee();const V=setInterval(()=>{U(),M(),ne()},3e3);return()=>clearInterval(V)},[e]),x.useEffect(()=>{!e||N!=="logs"||X(u)},[e,N,u]);function ae(V){return(V==null?void 0:V.status)==="busy"?(ie("Update läuft bereits",`Es läuft gerade „${V.running}". Bitte warte, bis es fertig ist.`),U(),!0):!1}function me(V){return(V==null?void 0:V.status)==="password_required"||(V==null?void 0:V.status)==="incorrect_password"?(ie("Box-Passwort nötig",(V.status==="incorrect_password"?"Das gespeicherte Box-Passwort stimmt nicht. ":"Für dieses Update braucht die Box dein Passwort. ")+"Bitte oben im Reiter „Einstellungen“ setzen bzw. korrigieren."),!0):V&&V.ok===!1?(ie("Update fehlgeschlagen",V.err||"Unbekannter Fehler."),!0):!1}async function re(){try{const V=await xe("/api/maintenance/os-update",{method:"POST"});if(ae(V)||me(V))return;U(),E("maintenance")}catch(V){ie("Fehler",`Fehler beim Starten des OS-Updates: ${V.message}`)}}async function ye(){try{const V=await xe("/api/maintenance/engine-update",{method:"POST"});if(ae(V)||me(V))return;U(),E("maintenance")}catch(V){ie("Fehler",`Fehler beim Engine-Update: ${V.message}`)}}async function Oe(){try{const V=await xe("/api/maintenance/swap-update",{method:"POST"});if(ae(V)||me(V))return;U(),E("maintenance")}catch(V){ie("Fehler",`Fehler beim Router-Update: ${V.message}`)}}async function fe(){ue(!0);try{const V=await xe("/api/maintenance/hermes-update",{method:"POST"});if(ae(V))return;U()}catch(V){ie("Fehler",`Hermes-Update fehlgeschlagen: ${V.message}`)}finally{ue(!1)}}async function Xe(V){oe({kind:V,loading:!0,data:null});try{const Re=await xe(`/api/maintenance/update-details?kind=${V}`);oe({kind:V,loading:!1,data:Re})}catch(Re){oe({kind:V,loading:!1,data:{kind:V,error:Re.message}})}}function Ue(){const V=pe==null?void 0:pe.kind;oe(null),V==="os"?re():V==="engine"?ye():V==="swap"?Oe():V==="hermes"&&fe()}function _e(){var Re;const V=[n!=null&&n.engine?"Engine":null,n!=null&&n.swap?"Router":null,(Re=n==null?void 0:n.components)!=null&&Re.some(it=>it.update===!0)?"Hermes-Agent":null,n!=null&&n.os?`OS (${n.os} Pakete)`:null].filter(Boolean);te("Alle Updates einspielen?",`Nacheinander in einem Job: ${V.join(" → ")}. Jeder Schritt sichert und prüft sich selbst; schlägt einer fehl, stoppt der Rest. (OS braucht das Box-Passwort aus den Einstellungen — fehlt es, wird OS übersprungen.)`,async()=>{try{const it=await xe("/api/maintenance/update-all",{method:"POST"});if(ae(it)||me(it))return;if((it==null?void 0:it.status)==="nothing"){ie("Nichts zu tun","Es stehen keine Updates aus.");return}U(),E("maintenance")}catch(it){ie("Fehler",`„Alle aktualisieren" konnte nicht starten: ${it.message}`)}})}async function wt(){C(!0);try{await xe("/api/maintenance/check-updates",{method:"POST"}),U(),E("maintenance")}catch(V){ie("Fehler",`Fehler bei der Update-Suche: ${V.message}`)}finally{C(!1)}}async function tr(V,Re){try{await xe("/api/models/install",{method:"POST",body:JSON.stringify({repo:V,role:Re})}),ie("Gestartet",`Modell-Upgrade für '${Re}' (${V}) gestartet.`),U(),E("maintenance")}catch(it){ie("Fehler",`Fehler beim Starten des Modell-Upgrades: ${it.message}`)}}async function G(){te("Reboot bestätigen","Bist du sicher, dass du das gesamte Host-System neu starten willst?",async()=>{try{await xe("/api/maintenance/reboot",{method:"POST"}),ie("Reboot","Reboot ausgelöst. System startet neu...",()=>{t()})}catch(V){ie("Fehler",`Fehler beim Reboot: ${V.message}`)}})}async function Ae(){B(!0),O("Snapshot wird erzeugt...");try{const V=await xe("/api/system/backup",{method:"POST"});O(V.ok?`Snapshot erzeugt: ${V.snapshot} (${V.files.length} Komponenten)`:"Backup fehlgeschlagen."),ee()}catch(V){O(`Fehler: ${V.message}`)}finally{B(!1)}}async function Ce(V){k(Re=>({...Re,[V]:!0}));try{const Re=await xe("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:V})});Re.ok?ie("Dienst neu gestartet",`Dienst ${V} wurde erfolgreich neu gestartet.`,()=>{N==="logs"&&u===V&&X(V)}):ie("Fehler",`Fehler beim Neustart: ${Re.err||"Unbekannter Fehler"}`)}catch(Re){ie("Fehler",`Fehler beim Neustart: ${Re.message}`)}finally{k(Re=>({...Re,[V]:!1}))}}async function Ye(V){try{await xe(`/api/jobs/${V}/cancel`,{method:"POST"}),U()}catch(Re){ie("Fehler",`Fehler beim Abbrechen: ${Re.message}`)}}const et=o.find(V=>(V.state==="running"||V.state==="queued")&&V.group==="maintenance"),dr=(n?(n.os>0?1:0)+(n.engine?1:0)+(n.swap?1:0):0)+(((Ti=n==null?void 0:n.components)==null?void 0:Ti.filter(V=>V.update===!0).length)??0);return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:J("fixed inset-0 bg-black/60 backdrop-blur-sm z-50 transition-opacity duration-300",e?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),onClick:t}),l.jsxs("div",{className:J("fixed inset-y-0 right-0 w-full sm:w-[640px] 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",e?"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(wi,{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:t,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(nn,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex border-b border-border/40 px-6",children:[l.jsx("button",{onClick:()=>E("maintenance"),className:J("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",N==="maintenance"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Wartung"}),l.jsx("button",{onClick:()=>E("logs"),className:J("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",N==="logs"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Logs"}),l.jsx("button",{onClick:()=>E("settings"),className:J("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",N==="settings"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"Einstellungen"})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[N==="maintenance"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-2.5",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:"Updates"}),l.jsxs("div",{className:"flex items-center gap-3",children:[dr>0&&l.jsxs("button",{onClick:_e,disabled:!!et,className:"flex items-center gap-1 rounded-md border border-primary/40 bg-primary/10 px-2 py-1 text-[10px] font-bold text-primary transition-colors hover:bg-primary/20 disabled:opacity-50",children:[l.jsx($M,{className:"h-3 w-3"})," Alle aktualisieren (",dr,")"]}),l.jsxs("button",{onClick:wt,disabled:A||!!et,className:"flex items-center gap-1 text-[10px] font-semibold text-primary hover:text-primary/80 transition-colors disabled:opacity-50",children:[l.jsx(mo,{className:J("h-3 w-3",A&&"animate-spin")})," Nach Updates suchen"]})]})]}),(n==null?void 0:n.last_check)&&l.jsxs("div",{className:"text-[9px] text-muted-foreground -mt-1",children:["Zuletzt gesucht: ",I(n.last_check)]}),et&&l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-[11px] text-amber-300",children:[l.jsx(mo,{className:"h-3.5 w-3.5 shrink-0 animate-spin"}),l.jsxs("span",{children:["Update läuft: ",l.jsx("span",{className:"font-semibold",children:et.label})," — bitte warten. Weitere Updates sind solange gesperrt."]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(nc,{icon:el,iconClass:"text-cyan-400",name:"OS-Pakete (apt)",available:!!(n!=null&&n.os),status:n!=null&&n.os?`${n.os} verfügbar`:"aktuell",actionLabel:"Anzeigen",onAction:()=>Xe("os")}),l.jsx(nc,{icon:gh,iconClass:"text-violet-400",name:"Inferenz-Engine (llama.cpp)",available:!!(n!=null&&n.engine),status:n!=null&&n.engine?"Update verfügbar":"aktuell",actionLabel:"Anzeigen",onAction:()=>Xe("engine")}),l.jsx(nc,{icon:f5,iconClass:"text-fuchsia-400",name:"Router (llama-swap)",available:!!(n!=null&&n.swap),status:n!=null&&n.swap?"Update verfügbar":"aktuell",actionLabel:"Anzeigen",onAction:()=>Xe("swap")}),(()=>{var Re;const V=(Re=n==null?void 0:n.components)==null?void 0:Re.find(it=>it.key==="hermes_agent");return l.jsx(nc,{icon:jn,iconClass:"text-amber-400",name:"Hermes-Agent",available:(V==null?void 0:V.update)===!0,busy:ve,status:(V==null?void 0:V.update)===!0?`Update: ${V.latest}`:(V==null?void 0:V.reachable)===!1?"offline":"aktuell",actionLabel:"Anzeigen",onAction:()=>Xe("hermes")})})(),(ml=n==null?void 0:n.model_list)==null?void 0:ml.map(V=>l.jsx(nc,{icon:OM,iconClass:"text-emerald-400",name:`Modell · ${V.role}`,available:!0,status:V.title,actionLabel:"Upgrade",onAction:()=>tr(V.repo,V.role)},V.role))]})]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Dienste"}),l.jsx("div",{className:"space-y-1.5",children:wk.map(V=>{var Re;return l.jsx(YR,{label:V.label,system:V.type==="system",ok:(Re=z==null?void 0:z.services.find(it=>it.name.toLowerCase().includes(V.reach)))==null?void 0:Re.ok,busy:w[V.id],onRestart:()=>Ce(V.id),onLogs:()=>{f(V.id),E("logs")}},V.id)})})]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Backup"}),l.jsxs("div",{className:"rounded-lg border border-border/50 bg-background/20 px-3 py-2.5 flex items-center gap-3",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-xs text-foreground truncate",children:K[0]?`Letztes: ${K[0].snapshot}`:"Noch kein Backup"}),l.jsxs("div",{className:"text-[10px] text-muted-foreground",children:[K.length," Snapshots · Restore per CLI (restore.sh)"]})]}),l.jsxs("button",{onClick:Ae,disabled:D,className:"flex items-center gap-1.5 text-[11px] font-semibold rounded-lg px-2.5 py-1 bg-primary text-primary-foreground hover:opacity-90 transition-all cursor-pointer disabled:opacity-50 shrink-0",children:[l.jsx(IM,{className:J("h-3.5 w-3.5",D&&"animate-pulse")})," Snapshot"]})]}),_&&l.jsx("div",{className:"text-[10px] font-mono text-primary bg-primary/5 p-2 rounded-lg border border-primary/20 break-all leading-normal",children:_})]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-red-400/80",children:"Gefahrenzone"}),l.jsxs("button",{onClick:G,className:"flex w-full items-center gap-3 p-3 rounded-lg 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(c5,{className:"h-4.5 w-4.5"}),l.jsxs("div",{children:[l.jsx("div",{children:"Host-System neu starten"}),l.jsx("div",{className:"text-[10px] text-red-400/80 font-normal",children:"Startet die ganze Box 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:[o.filter(V=>V.state==="running"||V.state==="queued").length," Aktiv"]})]}),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-xl p-6 text-center",children:"Aktuell keine aktiven Hintergrund-Jobs."}):o.map(V=>{const Re=V.state==="running"||V.state==="queued";return l.jsxs("div",{className:J("p-3 rounded-xl border transition-all duration-300",Re?"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:[Re&&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"})]}),V.label]}),l.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground uppercase flex items-center gap-2",children:[l.jsxs("span",{children:["ID: ",V.id]}),l.jsx("span",{children:"•"}),l.jsx("span",{className:J(V.state==="done"&&"text-emerald-400",V.state==="failed"&&"text-red-400",V.state==="running"&&"text-primary",V.state==="queued"&&"text-amber-400",V.state==="canceled"&&"text-muted-foreground"),children:V.state})]})]}),Re&&l.jsx("button",{onClick:()=>Ye(V.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"})]}),V.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:`${V.progress??0}%`}})}),l.jsxs("div",{className:"flex justify-between items-center text-[9px] font-mono text-muted-foreground",children:[l.jsxs("span",{children:[V.progress??0,"%"]}),V.done_bytes!=null&&V.total_bytes!=null&&l.jsxs("span",{children:[vg(V.done_bytes)," / ",vg(V.total_bytes),V.rate_bps!=null&&` (${vg(V.rate_bps)}/s)`]}),V.eta_s!=null&&l.jsxs("span",{children:["ETA: ",V.eta_s,"s"]})]})]})]},V.id)})})]})]}),N==="logs"&&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:u,onChange:V=>f(V.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:wk.map(V=>l.jsxs("option",{value:V.id,children:[V.label," (",V.type==="system"?"systemd-root":"user",")"]},V.id))}),l.jsxs("button",{onClick:()=>Ce(u),disabled:w[u],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(mo,{className:J("h-3.5 w-3.5",w[u]&&"animate-spin")}),"Restart"]})]}),l.jsx(tL,{service:u,text:h,loading:p,logStatus:b,onRefresh:()=>X(u),onOpenSettings:()=>E("settings")})]}),N==="settings"&&l.jsx(rL,{open:e,showAlert:ie})]})]}),pe&&l.jsx(nL,{detail:pe,maintenanceJob:et,onClose:()=>oe(null),onApply:Ue}),le&&l.jsx(cE,{type:le.type,title:le.title,message:le.message,onConfirm:le.onConfirm,onCancel:le.onCancel})]})}let Av=[],Cv=[];const Pv=new Set,pE=()=>Pv.forEach(e=>e());function gE(e){return Pv.add(e),()=>{Pv.delete(e)}}function iL(e){Av=[...Av,e].slice(-40),pE()}function aL(e){Cv=[...Cv,e].slice(-40),pE()}const oL=()=>x.useSyncExternalStore(gE,()=>Av),sL=()=>x.useSyncExternalStore(gE,()=>Cv);function lL(){const{data:e,dataUpdatedAt:t}=Po(3e3),{data:r,dataUpdatedAt:n}=oE(3e3),i=x.useRef(null);x.useEffect(()=>{var o,c,u,f;e&&iL({t:Date.now(),cpu:((o=e.cpu)==null?void 0:o.percent)??0,ram:((c=e.ram)==null?void 0:c.percent)??0,gpu:((u=e.gpu)==null?void 0:u.busy_percent)??null,disk:((f=e.disk)==null?void 0:f.percent)??null})},[t]),x.useEffect(()=>{if(!r)return;const o=Date.now(),c=r.prompt_tokens,u=r.completion_tokens;if(i.current){const f=Math.max((o-i.current.t)/1e3,.001);aL({t:o,prompt:Math.max(0,(c-i.current.p)/f),completion:Math.max(0,(u-i.current.c)/f)})}i.current={p:c,c:u,t:o}},[n])}function vE(){var C,_,O,D,B,z;const{data:e}=Hx(),{data:t}=aE(),{data:r}=Ei(),{data:n}=Po(),i=!!e&&!!t,o=$=>{var K;return(K=t==null?void 0:t.services.find(W=>W.name.toLowerCase().includes($)))==null?void 0:K.ok},c=e==null?void 0:e.engine_reachable,u=(C=e==null?void 0:e.brain)==null?void 0:C.ready,f=((_=e==null?void 0:e.brain)==null?void 0:_.model)||((O=r==null?void 0:r.models.find($=>$.role==="hermes"))==null?void 0:O.name)||"",h=[];h.push((()=>{const $={id:"brain",label:"Lucys Hirn",icon:Na,critical:!0};return i?c===!1?{...$,status:"down",detail:"Die Motor-Maschine (Engine) läuft nicht — Lucy kann gerade gar nicht denken.",repair:{kind:"restart",service:"llama-swap",label:"Motor neu starten",needsSudo:!0}}:u===!1?{...$,status:"down",detail:"Lucys Hirn ist gerade eingeschlafen — einmal aufwecken.",repair:f?{kind:"loadModel",model:f,label:"Hirn aufwecken"}:void 0}:{...$,status:"ok",detail:"Wach und ansprechbar."}:{...$,status:"loading",detail:"Wird geprüft …"}})()),h.push((()=>{const $={id:"vision",label:"Lucys Augen",icon:Ec,critical:!1};if(!i||!r)return{...$,status:"loading",detail:"Wird geprüft …"};const K=r.models.find(ve=>ve.role==="vision");return K?(r.running??[]).includes(K.name)?{...$,status:"ok",detail:"Sieht gerade zu (geladen, solange Lucy sie nutzt)."}:{...$,status:"ok",detail:"Augen ruhen — sie laden von selbst, sobald Lucy startet oder ein Bild kommt.",repair:{kind:"loadModel",model:K.name,label:"Augen wecken"}}:{...$,status:"warn",detail:"Kein Augen-Modell eingerichtet — Lucy kann keine Bilder ansehen."}})()),h.push((()=>{const $={id:"memory",label:"Lucys Gedächtnis",icon:JN,critical:!0},K=o("mem0");return!i||K===void 0?{...$,status:"loading",detail:"Wird geprüft …"}:K?{...$,status:"ok",detail:"Merkt sich Neues und findet Altes wieder."}:{...$,status:"down",detail:"Lucy kann sich gerade nichts merken — das Gedächtnis antwortet nicht.",repair:{kind:"restart",service:"mem0-service",label:"Gedächtnis neu starten"}}})()),h.push((()=>{const $={id:"gateway",label:"Verbindung (Gateway)",icon:Ac,critical:!0},K=e?e.gateway_reachable:o("integriert");return!i||K===void 0?{...$,status:"loading",detail:"Wird geprüft …"}:K?{...$,status:"ok",detail:"Apps und IDEs können Lucy erreichen."}:{...$,status:"down",detail:"Die Verbindungs-Zentrale antwortet nicht — Apps erreichen Lucy nicht.",repair:{kind:"restart",service:"mission-control-2",label:"Zentrale neu starten"}}})()),h.push((()=>{const $={id:"agent",label:"Lucys Agent (Hermes)",icon:jn,critical:!0},K=o("hermes-gateway");return!i||K===void 0?{...$,status:"loading",detail:"Wird geprüft …"}:K?{...$,status:"ok",detail:"Lucy ist bereit zu reden und zu handeln."}:{...$,status:"down",detail:"Lucys Agent ist offline — sie reagiert gerade nicht.",repair:{kind:"restart",service:"hermes-gateway",label:"Agent neu starten"}}})()),h.push((()=>{const $={id:"voice",label:"Lucys Stimme",icon:oI,critical:!1},K=o("voice");return!i||K===void 0?{...$,status:"loading",detail:"Wird geprüft …"}:K?{...$,status:"ok",detail:"Lucy kann hören und sprechen."}:{...$,status:"warn",detail:"Sprechen ist gerade aus — Tippen geht weiter normal.",repair:{kind:"restart",service:"voice-service",label:"Stimme neu starten"}}})());const m=((D=n==null?void 0:n.gpu)==null?void 0:D.gtt_total)||((B=n==null?void 0:n.gpu)==null?void 0:B.vram_total)||0,p=((z=n==null?void 0:n.gpu)==null?void 0:z.gtt_used)||0,v=m>0?Math.min(100,p/m*100):0,b=1024**3,S=m?v>=90?{status:"full",usedGb:p/b,totalGb:m/b,pct:v,text:"Speicher fast voll — Lucy könnte langsamer werden."}:v>=72?{status:"warn",usedGb:p/b,totalGb:m/b,pct:v,text:"Speicher gut gefüllt — noch okay."}:{status:"ok",usedGb:p/b,totalGb:m/b,pct:v,text:"Genug Speicher frei."}:{status:"unknown",usedGb:0,totalGb:0,pct:0,text:"Speicher-Auslastung unbekannt."},w=h.some($=>$.status==="loading"),k=h.filter($=>$.critical&&$.status==="down"),N=h.filter($=>$.status==="warn"||!$.critical&&$.status==="down"),E=S.status==="full";return{verdict:w&&!k.length?"loading":k.length?"problem":N.length||E?"warn":"gut",checks:h,memory:S,problems:k,warns:N}}const cL={ok:"bg-emerald-500",warn:"bg-amber-500",down:"bg-red-500",loading:"bg-muted-foreground/40"};function uL({frame:e="lucy"}={}){const{verdict:t,checks:r,memory:n,problems:i}=vE(),{showAlert:o,dialogElement:c}=An(),u=Wr(),[f,h]=x.useState({});async function m(k,N){h(E=>({...E,[k]:!0}));try{if(N.kind==="loadModel")await xe(`/api/models/${encodeURIComponent(N.model)}/load`,{method:"POST"});else{const E=await xe("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:N.service})});E.ok||o("Reparatur nicht ganz geklappt",(E.err||"Unbekannter Fehler")+(N.needsSudo?` +...`}),l.jsxs("p",{children:["Suchen & installieren über die ",l.jsx("strong",{children:"skills.sh"}),"-Registry: ",l.jsx(Fe,{children:"npx skills find"})," /",l.jsx(Fe,{children:"npx skills add owner/repo"}),". Skills liegen projektweit (vom Agent beim Start gelesen) oder global."]})]}),l.jsxs(Dr,{id:"memory",icon:WM,color:"text-indigo-400",title:"8. Gedächtnis & RAG",kicker:"Modelle vergessen — du nicht",wide:!0,children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:["LLMs sind ",l.jsx("strong",{children:"zustandslos"}),": ohne Hilfe weiß das Modell beim nächsten Turn nichts mehr. Gedächtnis lebt extern."]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Embeddings"})," wandeln Text in Vektoren; ein ",l.jsx("strong",{children:"Vektor-Store"})," (Chroma, …) findet semantisch Ähnliches."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"RAG"})," = relevante Fakten vor dem Turn heraussuchen und einblenden statt alles im Prompt zu halten."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Long-Context vs. RAG:"}),' riesige Fenster sind bequem, aber teuer & „lost in the middle" — gezieltes Abrufen skaliert besser.']})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Auto-lernendes Gedächtnis"})," ist die nächste Stufe:"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:["extrahiert Fakten ",l.jsx("em",{children:"selbst"})," aus Gesprächen, statt nur abzuspeichern"]}),l.jsx("li",{children:"dedupliziert semantisch (kein 10× derselbe Fakt)"}),l.jsxs("li",{children:[l.jsx("strong",{children:"Graph-Sicht"})," = Fakten ",l.jsx("em",{children:"plus"})," ihre Beziehungen, nicht nur eine flache Liste"]})]})]})]}),l.jsxs(Ua,{children:["Dein Gedächtnis (Tab ",l.jsx("strong",{children:"Gedächtnis"}),") ist ",l.jsx("strong",{children:"Mem0"}),"-basiert: auto-lernend & semantisch, ",l.jsx("strong",{children:"graph-first"})," dargestellt, mit 4-Typen-Taxonomie (",l.jsx(Fe,{children:"Identität"})," · ",l.jsx(Fe,{children:"Wissen"})," · ",l.jsx(Fe,{children:"Regeln"})," · ",l.jsx(Fe,{children:"Ereignisse"}),"). Einstieg über ein kurzes ",l.jsx("strong",{children:"Hermes-Onboarding-Gespräch"})," im Terminal — der Agent lernt im Hintergrund nach jedem Turn.",l.jsx("br",{}),l.jsx("strong",{children:"Gotcha:"})," ein gelöschter Fakt kann wieder auftauchen, solange die Original-Nachricht noch im Verlauf steht (additive Extraktion)."]})]}),l.jsxs(Dr,{id:"agents",icon:jn,color:"text-rose-400",title:"9. Autonome Agenten betreiben",kicker:"LLM in der Schleife",wide:!0,children:[l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:["Ein ",l.jsx("strong",{children:"Agent"})," ist ein LLM in einer Schleife mit Tools:",l.jsx("em",{children:" denken → Tool aufrufen → Ergebnis beobachten → weiter"}),", bis das Ziel erreicht ist."]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Guardrails"})," (Hard-Stop, Tool-Limits) verhindern Endlos-Loops, wenn ein Tool fehlt oder hängt."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Kontext-Hygiene"})," ist die wichtigste Disziplin: frische Sessions starten — vollgemüllte Historien werden langsam, driften und halluzinieren."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Kanäle:"})," CLI/Terminal, Chat-UI, Messaging (z.B. Telegram), reine API."]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{children:[l.jsx("strong",{children:"Least Privilege:"})," gib einem Agenten nur die Tools, die er wirklich braucht. Kritische Aktionen (Shell auf dem Host, Löschen, Geld/Deploys) hinter menschliche Freigabe."]}),l.jsxs("p",{children:[l.jsx("strong",{children:"Was sich vollautomatisch lohnt:"})," Modell-Routing, Hintergrund-Gedächtnis, Recherche. ",l.jsx("strong",{children:"Was Freigabe braucht:"})," Systembefehle, Updates/Reboots, permanentes Löschen."]})]})]}),l.jsxs(Ua,{children:[l.jsx("strong",{children:"Hermes"})," ist dein Box-Agent (Hirn = ",l.jsx(Fe,{children:"fast"}),"). Reden tust du mit ihm im",l.jsx("strong",{children:" Terminal"}),"-Tab (Web-Terminal via ttyd) oder per ",l.jsx("strong",{children:"Telegram"}),". Er hat MCP-Server für Gedächtnis, Stack-Steuerung, Web-Fetch und ",l.jsx("strong",{children:"PC-Steuerung"})," (Executor auf deinem Windows-PC). Status & Verdrahtung im ",l.jsx("strong",{children:"Hermes"}),"-Tab."]})]}),l.jsxs(Dr,{id:"ide",icon:zs,color:"text-cyan-400",title:"10. IDE / Editor anbinden",kicker:"Vibe-Coding lokal",children:[l.jsxs("p",{children:["Jede ",l.jsx("strong",{children:"OpenAI-kompatible"})," IDE oder Extension lässt sich auf einen lokalen Server umbiegen — Base-URL + Model eintragen, fertig:"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Cline"})," & ",l.jsx("strong",{children:"Roo Code"})," (VS-Code-Extensions, voller Agent + MCP)"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Cursor"})," (VS-Code-Fork mit Top-Autocomplete)"]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Continue"}),", ",l.jsx("strong",{children:"aider"})," (CLI), ",l.jsx("strong",{children:"OpenCode"})," (Desktop)"]})]}),l.jsxs(Ua,{children:["Tipp den Kram nicht ab: der ",l.jsx("strong",{children:"Verbinden"}),"-Tab generiert die fertige Config (inkl. MCP-Gedächtnis) pro Tool zum Kopieren. Essenz: Base ",l.jsx(Fe,{children:"…:9001/v1"}),", Model ",l.jsx(Fe,{children:"auto"}),", Key beliebig."]})]}),l.jsx(Dr,{id:"tricks",icon:eI,color:"text-amber-400",title:"11. Tricks & Kniffe",kicker:"Was im Alltag wirklich spart",wide:!0,children:l.jsx("div",{className:"grid md:grid-cols-3 gap-3",children:[["Kontext sauber halten","Neue Session statt Mega-Historie. Drift, Tempo und Halluzination hängen direkt am Kontext-Müll."],["Plan-then-Act","Erst Plan/Vorgehen bestätigen lassen, dann ausführen. Spart teure Holzwege."],["Gezielte Edits","Nie ganze Dateien überschreiben für eine Zeile — Such-/Ersetz-Tools nutzen. Weniger Tokens, weniger Fehler."],["Non-interaktive Befehle","Keine interaktiven Prompts im Agent-Terminal; lange Tasks als Background-Job. Sonst hängt der Loop."],["DevTools koppeln","Browser-/Konsolen-Zugriff geben — der Agent liest echte Fehler statt blind zu raten."],["Richtige Modellwahl","Schnelles Hirn für Alltag, großes für harte Logik, Coder fürs Coden. Nicht alles mit der Kanone."],["Akzeptanzkriterien","Sag konkret, woran „fertig“ erkennbar ist. Vage Prompts → vage Ergebnisse."],["Verifizieren statt vertrauen","Tests/Live-Check fordern. „Sollte funktionieren“ ist kein Beweis."],["Regeln ins Gedächtnis","Wiederkehrende Vorlieben/Konventionen einmal ablegen — der Agent zieht sie selbst."]].map(([r,n])=>l.jsxs("div",{className:"space-y-1 p-3 bg-background/10 rounded-xl border border-border/30",children:[l.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-foreground text-[11px]",children:[l.jsx(ka,{className:"h-3 w-3 text-amber-400"})," ",r]}),l.jsx("p",{className:"text-[11px]",children:n})]},r))})}),l.jsx(Dr,{id:"wartung",icon:el,color:"text-emerald-400",title:"12. Sicherheit & Wartung",kicker:"Damit's auch morgen noch läuft",wide:!0,children:l.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{className:"flex items-center gap-1.5 font-bold text-foreground",children:[l.jsx(a5,{className:"h-3.5 w-3.5 text-emerald-400"})," Goldene Regeln"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Ein ungetesteter Restore ist kein Backup."})," Wiederherstellung mindestens einmal echt durchspielen."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Updates können Dinge still zerschießen"})," — gerade bei AI-Stacks (Embeddings, Provider-Interna). Versionen pinnen, Smoke-Test, Post-Check."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Least Privilege"})," für Agenten, MCP-Server und PC-Zugriff. Kritisches hinter Freigabe."]})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("p",{className:"flex items-center gap-1.5 font-bold text-foreground",children:[l.jsx(nu,{className:"h-3.5 w-3.5 text-emerald-400"})," Bei dir im SystemDrawer"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Backup:"})," tägliches Voll-Zustands-Backup, getesteter ",l.jsx(Fe,{children:"restore.sh"})," (Doku in ",l.jsx(Fe,{children:"docs/BACKUP.md"}),")."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Updates:"})," git-basierter Update-Check; ",l.jsx("strong",{children:"Hermes-Update-Button"})," mit anschließendem ",l.jsx("strong",{children:"Gehirn-Check"})," (rot, falls das Update das Gedächtnis zerschießt) + Engine-Update."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Dienste & Gefahrenzone:"})," Restart/Logs pro Dienst, kritische Eingriffe getrennt."]})]}),l.jsx("p",{className:"text-[10px] italic",children:'Erreichbar über das System-Icon → Tab „Wartung".'})]})]})}),l.jsxs("section",{id:"ressourcen",className:"scroll-mt-20 md:col-span-2 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",{className:"flex items-center gap-2.5 border-b border-border/20 pb-3",children:[l.jsx(pv,{className:"h-5 w-5 text-primary"}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"13. Kuratierte Ressourcen & Links"}),l.jsx("span",{className:"text-[9px] font-mono text-primary",children:"Sauber geordnet — die guten Quellen"})]})]}),l.jsxs("div",{className:"grid md:grid-cols-2 gap-5 text-xs",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[l.jsx(mf,{className:"h-3.5 w-3.5 text-sky-400"})," Modelle & Engines"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[l.jsx(St,{href:"https://huggingface.co/models",name:"Hugging Face",note:"das Repository für offene Modelle (GGUF, Embeddings, Datasets)."}),l.jsx(St,{href:"https://github.com/ggml-org/llama.cpp",name:"llama.cpp",note:"die Referenz-Engine für lokale Inferenz."}),l.jsx(St,{href:"https://github.com/mostlygeek/llama-swap",name:"llama-swap",note:"mehrere Modelle hinter einem Port, Auto-Swap."}),l.jsx(St,{href:"https://ollama.com",name:"Ollama",note:"einfachster Einstieg, One-Command-Modelle."}),l.jsx(St,{href:"https://lmstudio.ai",name:"LM Studio",note:"lokale GUI zum Stöbern, Laden & Chatten."}),l.jsx(St,{href:"https://github.com/vllm-project/vllm",name:"vLLM",note:"Hochdurchsatz-Serving auf dicken GPUs."})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[l.jsx(Cc,{className:"h-3.5 w-3.5 text-violet-400"})," MCP & Skills"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[l.jsx(St,{href:"https://modelcontextprotocol.io",name:"MCP — offizielle Doku",note:"Spezifikation & Einstieg."}),l.jsx(St,{href:"https://github.com/modelcontextprotocol/servers",name:"Offizielle MCP-Server",note:"filesystem, git, postgres, fetch & mehr."}),l.jsx(St,{href:"https://smithery.ai",name:"Smithery",note:"Registry zum Suchen & Auto-Installieren von MCP-Servern."}),l.jsx(St,{href:"https://glama.ai/mcp/servers",name:"Glama MCP Registry",note:"kuratierte Community-Datenbank."}),l.jsx(St,{href:"https://skills.sh",name:"skills.sh",note:"Registry & CLI für Agent-Skills."})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[l.jsx(jn,{className:"h-3.5 w-3.5 text-rose-400"})," Agenten & Frameworks"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[l.jsx(St,{href:"https://github.com/NousResearch/hermes-agent",name:"Hermes Agent (Nous)",note:"der Agent, der auf deiner Box läuft."}),l.jsx(St,{href:"https://docs.claude.com",name:"Anthropic / Claude Docs",note:"API, Tool-Use, Agent SDK, MCP."}),l.jsx(St,{href:"https://github.com/cline/cline",name:"Cline",note:"autonomer Coding-Agent für VS Code."}),l.jsx(St,{href:"https://aider.chat",name:"aider",note:"AI-Pair-Programming im Terminal, git-nativ."}),l.jsx(St,{href:"https://continue.dev",name:"Continue",note:"Open-Source-Autopilot für IDEs."})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[l.jsx(mv,{className:"h-3.5 w-3.5 text-amber-400"})," Lernen & Community"]}),l.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[l.jsx(St,{href:"https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/overview",name:"Prompt-Engineering (Anthropic)",note:"die beste praktische Anleitung."}),l.jsx(St,{href:"https://github.com/anthropics/anthropic-cookbook",name:"Anthropic Cookbook",note:"lauffähige Rezepte für Tools, RAG, Agenten."}),l.jsx(St,{href:"https://www.promptingguide.ai",name:"Prompt Engineering Guide",note:"herstellerneutrales Nachschlagewerk."}),l.jsx(St,{href:"https://github.com/mem0ai/mem0",name:"Mem0",note:"die auto-lernende Memory-Schicht hinter deinem Gedächtnis."}),l.jsx(St,{href:"https://www.reddit.com/r/LocalLLaMA/",name:"r/LocalLLaMA",note:"der Puls der lokalen-LLM-Szene."})]})]})]})]}),l.jsx(Dr,{id:"troubleshooting",icon:JM,color:"text-rose-400",title:"14. Troubleshooting",kicker:"Wenn's hakt",wide:!0,children:l.jsxs("ul",{className:"space-y-2 list-disc pl-4",children:[l.jsxs("li",{children:[l.jsx("strong",{children:"Keine Verbindung?"})," Selbes LAN wie die Box? IP/Port stimmen (",l.jsx(Fe,{children:":9001"}),")? Backend-Status in der ",l.jsx("strong",{children:"Zentrale"})," prüfen."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Modell antwortet nicht / langsam?"})," In der ",l.jsx("strong",{children:"Zentrale → Dienste"})," schauen, ob ",l.jsx(Fe,{children:"llama-swap"})," grün ist; sonst Restart. Erstes Token nach Swap dauert (Modell lädt)."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Agent dreht durch / halluziniert?"})," Frische Session im ",l.jsx("strong",{children:"Terminal"})," starten — meist ist es vollgemüllter Kontext."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Gedächtnis findet nichts?"})," Embedding-Dienst online? Semantisch suchen (Sinn statt exaktem Wort). Leeres Gedächtnis → Hermes-Onboarding starten."]}),l.jsxs("li",{children:[l.jsx("strong",{children:"Update hat etwas zerschossen?"})," Genau dafür gibt es Backup & ",l.jsx(Fe,{children:"restore.sh"})," — den getesteten Restore fahren, dann Ursache suchen."]})]})})]}),l.jsx("p",{className:"text-center text-[10px] text-muted-foreground/50 pt-2",children:"Mission Control 2 · AI-Bibel · Stand Juni 2026 — lebendes Dokument, wächst mit dem Stack."})]})}function QL({title:e,hint:t}){return l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"text-xl font-semibold",children:e}),l.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),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(UM,{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 kk=[{id:"mission-control-2",label:"Mission Control",type:"user",reach:"gateway (integr"},{id:"hermes-gateway",label:"Hermes Gateway",type:"user",reach:"hermes-gateway"},{id:"mem0-service",label:"Mem0 (Gedächtnis)",type:"user",reach:"mem0"},{id:"voice-service",label:"Voice (Sprache)",type:"user",reach:"voice"},{id:"hermes-builtin-ui",label:"Hermes GUI (Desktop-Gateway)",type:"user",reach:"hermes-gui"},{id:"llama-swap",label:"Llama Swap",type:"system",reach:"llama-swap"}];function nc({icon:e,iconClass:t,name:r,status:n,available:i,busy:o,actionLabel:c,onAction:u}){return l.jsxs("div",{className:J("flex items-center gap-3 rounded-lg border px-3 py-2",i?"border-amber-500/30 bg-amber-500/5":"border-border/50 bg-background/20"),children:[l.jsx(e,{className:J("h-4 w-4 shrink-0",t)}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-xs text-foreground truncate",children:r}),l.jsx("div",{className:J("text-[10px] truncate",i?"text-amber-400/90":"text-muted-foreground"),children:n})]}),l.jsx("button",{onClick:u,disabled:!i||o,className:J("text-[11px] font-semibold rounded-lg px-2.5 py-1 transition-colors shrink-0",i?"bg-primary text-primary-foreground hover:opacity-90 cursor-pointer":"border border-border/50 text-muted-foreground/40 cursor-default"),children:o?"…":c})]})}function YL({label:e,ok:t,system:r,busy:n,onRestart:i,onLogs:o}){return l.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg border border-border/50 bg-background/20 px-3 py-2",children:[l.jsx("span",{className:J("w-1.5 h-1.5 rounded-full shrink-0",t===!0?"bg-emerald-500":t===!1?"bg-red-500":"bg-muted-foreground/40")}),l.jsxs("span",{className:"flex-1 text-xs text-foreground truncate",children:[e,r&&l.jsx("span",{className:"text-[9px] text-muted-foreground",children:" (root)"})]}),l.jsx("button",{onClick:i,disabled:n,title:"Neu starten",className:"text-muted-foreground hover:text-primary transition-colors disabled:opacity-50",children:l.jsx(mo,{className:J("h-3.5 w-3.5",n&&"animate-spin")})}),l.jsx("button",{onClick:o,title:"Logs ansehen",className:"text-muted-foreground hover:text-primary transition-colors",children:l.jsx(n5,{className:"h-3.5 w-3.5"})})]})}function xg(e){return e==null?"":e>1024**3?`${(e/1024**3).toFixed(2)} GB`:`${(e/1024**2).toFixed(1)} MB`}const ZL=/\b(error|fehler|fail(ed|ure)?|fatal|critical|crit|panic|traceback|exception|denied|refused|unable|emerg|alert|oom|killed)\b/i,XL=/\b(warn(ing)?|deprecat\w*|retry(ing)?|timeout|timed out|degraded|missing|not found|nicht gefunden)\b/i;function JL(e){return ZL.test(e)?"error":XL.test(e)?"warn":"info"}const eR={error:"text-red-400",warn:"text-amber-300",info:"text-cyan-300/80"};function tR({service:e,text:t,loading:r,logStatus:n,onRefresh:i,onOpenSettings:o}){const[c,u]=x.useState(!1),[f,h]=x.useState(""),m=x.useRef(null),p=x.useMemo(()=>t?t.split(` +`).map(k=>({t:k,level:JL(k)})):[],[t]),v=x.useMemo(()=>p.filter(k=>k.level!=="info").length,[p]),b=f.trim().toLowerCase(),S=p.filter(k=>(!c||k.level!=="info")&&(!b||k.t.toLowerCase().includes(b))),w=n==="password_required"||n==="incorrect_password";return 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-10 items-center justify-between gap-2 px-3 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 shrink-0",children:[l.jsx(m5,{className:"h-3 w-3 text-primary"}),l.jsx("span",{className:"hidden sm:inline",children:"stdout/stderr —"})," ",e]}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsxs("div",{className:"relative",children:[l.jsx(Js,{className:"pointer-events-none absolute left-2 top-1/2 h-3 w-3 -translate-y-1/2 text-muted-foreground"}),l.jsx("input",{value:f,onChange:k=>h(k.target.value),placeholder:"filtern…",className:"h-7 w-24 sm:w-36 rounded-md border border-border/50 bg-background/40 pl-6 pr-2 text-[10px] text-foreground outline-none focus:border-primary/50"})]}),l.jsxs("button",{onClick:()=>u(k=>!k),title:"Nur Fehler und Warnungen zeigen",className:J("flex h-7 items-center gap-1 rounded-md border px-2 text-[10px] font-semibold transition-colors",c?"border-amber-500/50 bg-amber-500/15 text-amber-300":"border-border/50 bg-background/20 text-muted-foreground hover:text-foreground"),children:[l.jsx(vr,{className:"h-3 w-3"}),"Nur Probleme",v>0?` (${v})`:""]}),l.jsx("button",{onClick:i,disabled:r,title:"Neu laden",className:"flex h-7 w-7 items-center justify-center rounded-md border border-border/50 bg-background/20 text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50",children:l.jsx(mo,{className:J("h-3 w-3",r&&"animate-spin")})})]})]}),l.jsx("div",{ref:m,className:"flex-1 overflow-y-auto p-3 text-[10px] font-mono leading-relaxed scrollbar-thin select-text",children:w?l.jsxs("div",{className:"flex h-full flex-col items-center justify-center space-y-3 p-6 text-center",children:[l.jsx(vr,{className:"h-8 w-8 text-amber-400 animate-pulse animate-duration-1000"}),l.jsx("div",{className:"text-xs font-semibold text-amber-300",children:n==="incorrect_password"?"Falsches Sudo-Passwort hinterlegt.":"Sudo-Passwort für systemd-Dienste erforderlich."}),l.jsxs("p",{className:"max-w-xs text-[10px] leading-normal text-muted-foreground",children:["Für das Auslesen der systemd-Logs von ",e," werden Root-Rechte benötigt. Hinterlege dein Passwort in den Einstellungen."]}),l.jsx("button",{onClick:o,className:"mt-2 rounded-md bg-primary px-3 py-1.5 text-[10px] font-semibold text-primary-foreground transition-colors hover:bg-primary/95",children:"Sudo-Passwort eintragen"})]}):r&&!t?l.jsx("span",{className:"text-muted-foreground",children:"Lade Logs…"}):p.length===0?l.jsx("span",{className:"text-muted-foreground",children:"Keine Logeinträge vorhanden."}):S.length===0?l.jsx("span",{className:"text-muted-foreground",children:c?"Keine Fehler oder Warnungen — der Dienst läuft sauber. ✓":"Kein Treffer für den Filter."}):S.map((k,N)=>l.jsx("div",{className:J("whitespace-pre-wrap",eR[k.level]),children:k.t||" "},N))})]})}function rR({open:e,showAlert:t}){const[r,n]=x.useState(""),[i,o]=x.useState(""),[c,u]=x.useState(!1),[f,h]=x.useState(!1);return x.useEffect(()=>{e&&(n(localStorage.getItem("mc_sudo_password")||""),o(localStorage.getItem("mc_hf_token")||""))},[e]),l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Zugangsdaten & Schlüssel"}),l.jsx("p",{className:"text-[10px] text-muted-foreground leading-normal",children:"Diese Daten werden ausschließlich lokal in deinem Browser (localStorage) gespeichert und bei Bedarf an das Backend übertragen."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[l.jsx(el,{className:"h-4 w-4 text-amber-400"}),"Host Sudo-Passwort"]}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:c?"text":"password",value:r,onChange:m=>n(m.target.value),"aria-label":"Host Sudo-Passwort",name:"sudo-password",autoComplete:"off",spellCheck:!1,placeholder:"Sudo-Passwort für System-Operationen",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),l.jsx("button",{type:"button",onClick:()=>u(!c),"aria-label":c?"Passwort verbergen":"Passwort anzeigen",className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:c?l.jsx(Dw,{className:"h-4 w-4","aria-hidden":"true"}):l.jsx(Ac,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Wird benötigt für systemd-Dienste (Llama Swap logs/restart), OS-Update (apt) und Reboot."})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[l.jsx(ZM,{className:"h-4 w-4 text-violet-400"}),"HuggingFace API Token"]}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{type:f?"text":"password",value:i,onChange:m=>o(m.target.value),"aria-label":"HuggingFace API Token",name:"hf-token",autoComplete:"off",spellCheck:!1,placeholder:"hf_…",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),l.jsx("button",{type:"button",onClick:()=>h(!f),"aria-label":f?"Token verbergen":"Token anzeigen",className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:f?l.jsx(Dw,{className:"h-4 w-4","aria-hidden":"true"}):l.jsx(Ac,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Erlaubt das Herunterladen von geschützten oder Gate-restricted Modellen direkt über Mission Control."})]}),l.jsxs("div",{className:"flex gap-3 pt-2",children:[l.jsx("button",{onClick:()=>{localStorage.setItem("mc_sudo_password",r),localStorage.setItem("mc_hf_token",i),t("Erfolgreich","Einstellungen erfolgreich lokal gespeichert.")},className:"flex-1 h-9 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/90 rounded-lg transition-colors shadow shadow-primary/10 cursor-pointer",children:"Speichern"}),l.jsx("button",{onClick:()=>{n(""),o(""),localStorage.removeItem("mc_sudo_password"),localStorage.removeItem("mc_hf_token"),t("Gelöscht","Zugangsdaten gelöscht.")},className:"h-9 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Zurücksetzen"})]})]})}function nR({detail:e,maintenanceJob:t,onClose:r,onApply:n}){var f,h;const i=e.data,o={os:{icon:el,cls:"text-cyan-400",title:"OS-Pakete (apt)"},engine:{icon:gh,cls:"text-violet-400",title:"Inferenz-Engine (llama.cpp)"},swap:{icon:h5,cls:"text-fuchsia-400",title:"Router (llama-swap)"},hermes:{icon:jn,cls:"text-amber-400",title:"Hermes-Agent"}}[e.kind],c=o.icon,u=i?e.kind==="os"?(i.count??0)===0:e.kind==="hermes"?(i.behind??0)===0:i.installed_build!=null&&i.latest_build!=null&&i.latest_build<=i.installed_build:!0;return l.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4",children:[l.jsx("div",{className:"absolute inset-0 bg-black/70 backdrop-blur-sm",onClick:r}),l.jsxs("div",{className:"relative w-full max-w-lg max-h-[80vh] flex flex-col rounded-2xl border border-border/60 bg-card shadow-2xl font-sans text-foreground",children:[l.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between border-b border-border/40 px-5",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(c,{className:J("h-4.5 w-4.5",o.cls)}),l.jsx("h3",{className:"text-sm font-semibold",children:o.title})]}),l.jsx("button",{onClick:r,className:"flex h-7 w-7 items-center justify-center rounded-lg border border-border/40 text-muted-foreground hover:bg-accent transition-colors",children:l.jsx(nn,{className:"h-4 w-4"})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto p-5 text-xs space-y-3 scrollbar-thin",children:e.loading?l.jsxs("div",{className:"flex h-24 items-center justify-center gap-2 text-muted-foreground",children:[l.jsx(mo,{className:"h-4 w-4 animate-spin"})," Details werden geladen…"]}):i!=null&&i.error?l.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/5 p-3 text-red-400",children:i.error}):l.jsxs(l.Fragment,{children:[(i==null?void 0:i.action_needed)!=null&&l.jsxs("div",{className:J("flex items-start gap-2 rounded-lg border p-3",i.action_needed?"border-amber-500/40 bg-amber-500/10":"border-emerald-500/40 bg-emerald-500/10"),children:[i.action_needed?l.jsx(vr,{className:"h-4 w-4 text-amber-400 shrink-0 mt-0.5"}):l.jsx(r5,{className:"h-4 w-4 text-emerald-400 shrink-0 mt-0.5"}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:J("text-xs font-semibold",i.action_needed?"text-amber-300":"text-emerald-300"),children:["Musst du etwas tun? ",i.action_needed?"Ja":"Nein — die Box regelt das (Fangnetz)"]}),i.action_needed&&i.action_text&&l.jsx("div",{className:"mt-0.5 text-[11px] text-foreground/90",children:i.action_text})]})]}),(i==null?void 0:i.summary)&&l.jsxs("div",{className:"rounded-lg border border-primary/25 bg-primary/5 p-3 space-y-1",children:[l.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-primary",children:"Was dieses Update bedeutet (Zusammenfassung der Box)"}),l.jsx("pre",{className:"whitespace-pre-wrap text-[11px] leading-relaxed text-foreground/90 font-sans",children:i.summary})]}),e.kind==="os"?l.jsxs(l.Fragment,{children:[((i==null?void 0:i.count)??0)===0?l.jsx("div",{className:"text-muted-foreground",children:"Keine Pakete zu aktualisieren — System ist aktuell."}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"text-muted-foreground",children:[i.count," Paket(e) werden aktualisiert:"]}),l.jsx("div",{className:"space-y-1",children:i.packages.map(m=>l.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border border-border/40 bg-background/30 px-2.5 py-1.5",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[11px] truncate",children:[l.jsx(zw,{className:"h-3 w-3 text-cyan-400 shrink-0"}),m.name]}),l.jsxs("span",{className:"flex items-center gap-1 font-mono text-[10px] text-muted-foreground shrink-0",children:[l.jsx("span",{children:m.current}),l.jsx(bc,{className:"h-3 w-3"}),l.jsx("span",{className:"text-emerald-400",children:m.candidate})]})]},m.name))})]}),(((f=i==null?void 0:i.held_back)==null?void 0:f.length)??0)>0&&l.jsxs("div",{className:"space-y-1.5 rounded-lg border border-border/40 bg-background/20 p-3",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground",children:[l.jsx(ph,{className:"h-3.5 w-3.5"})," Vom Hersteller zurückgestellt — kein Handeln nötig"]}),l.jsx("p",{className:"text-[10px] text-muted-foreground leading-normal",children:"Diese Pakete gäbe es bereits, Ubuntu spielt sie aber gestaffelt aus (Phasen-Rollout) bzw. hält sie kurz zurück. Sie kommen bei einem der nächsten automatischen Läufe von selbst — das ist kein Fehler und nichts hängt fest."}),l.jsx("div",{className:"space-y-1",children:i.held_back.map(m=>l.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border border-border/30 bg-background/30 px-2.5 py-1.5",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[11px] truncate",children:[l.jsx(zw,{className:"h-3 w-3 text-muted-foreground shrink-0"}),m.name]}),l.jsx("span",{className:"text-[9px] text-muted-foreground shrink-0",children:m.reason==="phasing"?"Phasen-Rollout":"vorerst zurückgehalten"})]},m.name))})]})]}):e.kind==="engine"||e.kind==="swap"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px]",children:[l.jsxs("span",{className:"rounded-md border border-border/40 bg-background/30 px-2 py-1",children:["Build ",(i==null?void 0:i.installed_build)??"?"]}),l.jsx(bc,{className:"h-3.5 w-3.5 text-muted-foreground"}),l.jsxs("span",{className:"rounded-md border border-emerald-500/30 bg-emerald-500/5 px-2 py-1 text-emerald-400",children:["Build ",(i==null?void 0:i.latest_build)??"?"]})]}),((i==null?void 0:i.name)||(i==null?void 0:i.latest_tag))&&l.jsxs("div",{className:"text-muted-foreground",children:["Release: ",l.jsx("span",{className:"text-foreground",children:i==null?void 0:i.name}),i!=null&&i.latest_tag?` (${i.latest_tag})`:""]}),(i==null?void 0:i.url)&&l.jsxs("a",{href:i.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-primary hover:underline",children:["Original-Release-Notes auf GitHub ",l.jsx(Ix,{className:"h-3 w-3"})]}),(i==null?void 0:i.body)&&l.jsxs("details",{className:"group",children:[l.jsx("summary",{className:"cursor-pointer text-[10px] text-muted-foreground hover:text-foreground",children:"Original-Notizen (englisch) anzeigen"}),l.jsx("pre",{className:"mt-1.5 whitespace-pre-wrap rounded-lg border border-border/40 bg-background/30 p-3 text-[10px] leading-relaxed text-muted-foreground max-h-60 overflow-y-auto scrollbar-thin",children:i.body})]})]}):(((h=i==null?void 0:i.commits)==null?void 0:h.length)??0)===0?l.jsx("div",{className:"text-muted-foreground",children:"Keine neuen Commits — Hermes-Agent ist bereits aktuell."}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"text-muted-foreground",children:[i.behind," neue Commit(s) auf ",l.jsxs("span",{className:"font-mono text-foreground",children:["origin/",i.branch]}),":"]}),l.jsx("div",{className:"space-y-1",children:i.commits.map(m=>l.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border/40 bg-background/30 px-2.5 py-1.5",children:[l.jsx(VM,{className:"h-3.5 w-3.5 text-primary shrink-0 mt-0.5"}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[11px] truncate",children:m.subject}),l.jsxs("div",{className:"font-mono text-[9px] text-muted-foreground",children:[m.hash," · ",m.when]})]})]},m.hash))})]}),e.kind!=="os"&&!u&&l.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-border/40 bg-background/20 p-2.5",children:[l.jsx(f5,{className:"h-3.5 w-3.5 text-emerald-400 shrink-0 mt-0.5"}),l.jsxs("p",{className:"text-[10px] text-muted-foreground leading-normal",children:["Vor dem Update sichert die Box automatisch den alten Stand. Danach prüft sie den ganzen Stack per echter Anfrage — läuft etwas nicht, rollt sie von selbst zurück",e.kind==="hermes"?" und startet den Gateway neu":"","."]})]})]})}),l.jsxs("div",{className:"flex gap-3 border-t border-border/40 p-4 shrink-0",children:[l.jsx("button",{onClick:r,className:"h-9 flex-1 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold text-muted-foreground hover:bg-accent transition-colors cursor-pointer",children:"Schließen"}),l.jsx("button",{onClick:n,disabled:e.loading||u||!!t,title:t?`Update läuft bereits: ${t.label}`:void 0,className:"h-9 flex-1 rounded-lg bg-primary text-xs font-semibold text-primary-foreground hover:opacity-90 transition-all cursor-pointer disabled:opacity-40 disabled:cursor-default",children:t?"Update läuft…":"Jetzt aktualisieren"})]})]})]})}function pE({open:e,onClose:t,defaultTab:r="maintenance"}){var Ti,ml;const[n,i]=x.useState(null),[o,c]=x.useState([]),[u,f]=x.useState("llama-swap"),[h,m]=x.useState(""),[p,v]=x.useState(!1),[b,S]=x.useState(null),[w,k]=x.useState({}),[N,E]=x.useState("maintenance"),[A,C]=x.useState(!1),[_,O]=x.useState(""),[D,B]=x.useState(!1),[z,$]=x.useState(null),[K,W]=x.useState([]),[ve,ue]=x.useState(!1),[pe,oe]=x.useState(null),[le,Z]=x.useState(null);function ie(V,Le,it){Z({type:"alert",title:V,message:Le,onConfirm:()=>{Z(null),it&&it()}})}function te(V,Le,it){Z({type:"confirm",title:V,message:Le,onConfirm:()=>{Z(null),it()},onCancel:()=>Z(null)})}function I(V){return V?new Date(V*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"Nie"}x.useEffect(()=>{e&&r&&E(r)},[e,r]);function M(){xe("/api/maintenance/updates").then(i).catch(V=>console.error("Error loading updates",V))}function U(){xe("/api/jobs").then(V=>c(V.jobs||[])).catch(V=>console.error("Error loading jobs",V))}function ne(){xe("/api/system/services").then($).catch(()=>{})}function ee(){xe("/api/system/backups").then(V=>W(V.backups||[])).catch(()=>{})}function X(V){v(!0),S(null),xe(`/api/maintenance/logs?service=${V}&lines=150`).then(Le=>{Le.ok?m(Le.text):(m(`Fehler beim Laden der Logs: ${Le.err||"Unbekannter Fehler"}`),(Le.status==="incorrect_password"||Le.status==="password_required")&&S(Le.status))}).catch(Le=>m(`Fehler: ${Le.message}`)).finally(()=>v(!1))}x.useEffect(()=>{if(!e)return;M(),U(),ne(),ee();const V=setInterval(()=>{U(),M(),ne()},3e3);return()=>clearInterval(V)},[e]),x.useEffect(()=>{!e||N!=="logs"||X(u)},[e,N,u]);function ae(V){return(V==null?void 0:V.status)==="busy"?(ie("Update läuft bereits",`Es läuft gerade „${V.running}". Bitte warte, bis es fertig ist.`),U(),!0):!1}function me(V){return(V==null?void 0:V.status)==="password_required"||(V==null?void 0:V.status)==="incorrect_password"?(ie("Box-Passwort nötig",(V.status==="incorrect_password"?"Das gespeicherte Box-Passwort stimmt nicht. ":"Für dieses Update braucht die Box dein Passwort. ")+"Bitte oben im Reiter „Einstellungen“ setzen bzw. korrigieren."),!0):V&&V.ok===!1?(ie("Update fehlgeschlagen",V.err||"Unbekannter Fehler."),!0):!1}async function re(){try{const V=await xe("/api/maintenance/os-update",{method:"POST"});if(ae(V)||me(V))return;U(),E("maintenance")}catch(V){ie("Fehler",`Fehler beim Starten des OS-Updates: ${V.message}`)}}async function ye(){try{const V=await xe("/api/maintenance/engine-update",{method:"POST"});if(ae(V)||me(V))return;U(),E("maintenance")}catch(V){ie("Fehler",`Fehler beim Engine-Update: ${V.message}`)}}async function Oe(){try{const V=await xe("/api/maintenance/swap-update",{method:"POST"});if(ae(V)||me(V))return;U(),E("maintenance")}catch(V){ie("Fehler",`Fehler beim Router-Update: ${V.message}`)}}async function fe(){ue(!0);try{const V=await xe("/api/maintenance/hermes-update",{method:"POST"});if(ae(V))return;U()}catch(V){ie("Fehler",`Hermes-Update fehlgeschlagen: ${V.message}`)}finally{ue(!1)}}async function Xe(V){oe({kind:V,loading:!0,data:null});try{const Le=await xe(`/api/maintenance/update-details?kind=${V}`);oe({kind:V,loading:!1,data:Le})}catch(Le){oe({kind:V,loading:!1,data:{kind:V,error:Le.message}})}}function Ue(){const V=pe==null?void 0:pe.kind;oe(null),V==="os"?re():V==="engine"?ye():V==="swap"?Oe():V==="hermes"&&fe()}function _e(){var Le;const V=[n!=null&&n.engine?"Engine":null,n!=null&&n.swap?"Router":null,(Le=n==null?void 0:n.components)!=null&&Le.some(it=>it.update===!0)?"Hermes-Agent":null,n!=null&&n.os?`OS (${n.os} Pakete)`:null].filter(Boolean);te("Alle Updates einspielen?",`Nacheinander in einem Job: ${V.join(" → ")}. Jeder Schritt sichert und prüft sich selbst; schlägt einer fehl, stoppt der Rest. (OS braucht das Box-Passwort aus den Einstellungen — fehlt es, wird OS übersprungen.)`,async()=>{try{const it=await xe("/api/maintenance/update-all",{method:"POST"});if(ae(it)||me(it))return;if((it==null?void 0:it.status)==="nothing"){ie("Nichts zu tun","Es stehen keine Updates aus.");return}U(),E("maintenance")}catch(it){ie("Fehler",`„Alle aktualisieren" konnte nicht starten: ${it.message}`)}})}async function wt(){C(!0);try{await xe("/api/maintenance/check-updates",{method:"POST"}),U(),E("maintenance")}catch(V){ie("Fehler",`Fehler bei der Update-Suche: ${V.message}`)}finally{C(!1)}}async function tr(V,Le){try{await xe("/api/models/install",{method:"POST",body:JSON.stringify({repo:V,role:Le})}),ie("Gestartet",`Modell-Upgrade für '${Le}' (${V}) gestartet.`),U(),E("maintenance")}catch(it){ie("Fehler",`Fehler beim Starten des Modell-Upgrades: ${it.message}`)}}async function G(){te("Reboot bestätigen","Bist du sicher, dass du das gesamte Host-System neu starten willst?",async()=>{try{await xe("/api/maintenance/reboot",{method:"POST"}),ie("Reboot","Reboot ausgelöst. System startet neu...",()=>{t()})}catch(V){ie("Fehler",`Fehler beim Reboot: ${V.message}`)}})}async function Ae(){B(!0),O("Snapshot wird erzeugt...");try{const V=await xe("/api/system/backup",{method:"POST"});O(V.ok?`Snapshot erzeugt: ${V.snapshot} (${V.files.length} Komponenten)`:"Backup fehlgeschlagen."),ee()}catch(V){O(`Fehler: ${V.message}`)}finally{B(!1)}}async function Ce(V){k(Le=>({...Le,[V]:!0}));try{const Le=await xe("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:V})});Le.ok?ie("Dienst neu gestartet",`Dienst ${V} wurde erfolgreich neu gestartet.`,()=>{N==="logs"&&u===V&&X(V)}):ie("Fehler",`Fehler beim Neustart: ${Le.err||"Unbekannter Fehler"}`)}catch(Le){ie("Fehler",`Fehler beim Neustart: ${Le.message}`)}finally{k(Le=>({...Le,[V]:!1}))}}async function Ye(V){try{await xe(`/api/jobs/${V}/cancel`,{method:"POST"}),U()}catch(Le){ie("Fehler",`Fehler beim Abbrechen: ${Le.message}`)}}const et=o.find(V=>(V.state==="running"||V.state==="queued")&&V.group==="maintenance"),dr=(n?(n.os>0?1:0)+(n.engine?1:0)+(n.swap?1:0):0)+(((Ti=n==null?void 0:n.components)==null?void 0:Ti.filter(V=>V.update===!0).length)??0);return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:J("fixed inset-0 bg-black/60 backdrop-blur-sm z-50 transition-opacity duration-300",e?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),onClick:t}),l.jsxs("div",{className:J("fixed inset-y-0 right-0 w-full sm:w-[640px] 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",e?"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(wi,{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:t,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(nn,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex border-b border-border/40 px-6",children:[l.jsx("button",{onClick:()=>E("maintenance"),className:J("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",N==="maintenance"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Wartung"}),l.jsx("button",{onClick:()=>E("logs"),className:J("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",N==="logs"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Logs"}),l.jsx("button",{onClick:()=>E("settings"),className:J("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",N==="settings"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"Einstellungen"})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[N==="maintenance"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-2.5",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:"Updates"}),l.jsxs("div",{className:"flex items-center gap-3",children:[dr>0&&l.jsxs("button",{onClick:_e,disabled:!!et,className:"flex items-center gap-1 rounded-md border border-primary/40 bg-primary/10 px-2 py-1 text-[10px] font-bold text-primary transition-colors hover:bg-primary/20 disabled:opacity-50",children:[l.jsx(zM,{className:"h-3 w-3"})," Alle aktualisieren (",dr,")"]}),l.jsxs("button",{onClick:wt,disabled:A||!!et,className:"flex items-center gap-1 text-[10px] font-semibold text-primary hover:text-primary/80 transition-colors disabled:opacity-50",children:[l.jsx(mo,{className:J("h-3 w-3",A&&"animate-spin")})," Nach Updates suchen"]})]})]}),(n==null?void 0:n.last_check)&&l.jsxs("div",{className:"text-[9px] text-muted-foreground -mt-1",children:["Zuletzt gesucht: ",I(n.last_check)]}),et&&l.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-[11px] text-amber-300",children:[l.jsx(mo,{className:"h-3.5 w-3.5 shrink-0 animate-spin"}),l.jsxs("span",{children:["Update läuft: ",l.jsx("span",{className:"font-semibold",children:et.label})," — bitte warten. Weitere Updates sind solange gesperrt."]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(nc,{icon:el,iconClass:"text-cyan-400",name:"OS-Pakete (apt)",available:!!(n!=null&&n.os),status:n!=null&&n.os?`${n.os} verfügbar`:"aktuell",actionLabel:"Anzeigen",onAction:()=>Xe("os")}),l.jsx(nc,{icon:gh,iconClass:"text-violet-400",name:"Inferenz-Engine (llama.cpp)",available:!!(n!=null&&n.engine),status:n!=null&&n.engine?"Update verfügbar":"aktuell",actionLabel:"Anzeigen",onAction:()=>Xe("engine")}),l.jsx(nc,{icon:h5,iconClass:"text-fuchsia-400",name:"Router (llama-swap)",available:!!(n!=null&&n.swap),status:n!=null&&n.swap?"Update verfügbar":"aktuell",actionLabel:"Anzeigen",onAction:()=>Xe("swap")}),(()=>{var Le;const V=(Le=n==null?void 0:n.components)==null?void 0:Le.find(it=>it.key==="hermes_agent");return l.jsx(nc,{icon:jn,iconClass:"text-amber-400",name:"Hermes-Agent",available:(V==null?void 0:V.update)===!0,busy:ve,status:(V==null?void 0:V.update)===!0?`Update: ${V.latest}`:(V==null?void 0:V.reachable)===!1?"offline":"aktuell",actionLabel:"Anzeigen",onAction:()=>Xe("hermes")})})(),(ml=n==null?void 0:n.model_list)==null?void 0:ml.map(V=>l.jsx(nc,{icon:_M,iconClass:"text-emerald-400",name:`Modell · ${V.role}`,available:!0,status:V.title,actionLabel:"Upgrade",onAction:()=>tr(V.repo,V.role)},V.role))]})]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Dienste"}),l.jsx("div",{className:"space-y-1.5",children:kk.map(V=>{var Le;return l.jsx(YL,{label:V.label,system:V.type==="system",ok:(Le=z==null?void 0:z.services.find(it=>it.name.toLowerCase().includes(V.reach)))==null?void 0:Le.ok,busy:w[V.id],onRestart:()=>Ce(V.id),onLogs:()=>{f(V.id),E("logs")}},V.id)})})]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Backup"}),l.jsxs("div",{className:"rounded-lg border border-border/50 bg-background/20 px-3 py-2.5 flex items-center gap-3",children:[l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-xs text-foreground truncate",children:K[0]?`Letztes: ${K[0].snapshot}`:"Noch kein Backup"}),l.jsxs("div",{className:"text-[10px] text-muted-foreground",children:[K.length," Snapshots · Restore per CLI (restore.sh)"]})]}),l.jsxs("button",{onClick:Ae,disabled:D,className:"flex items-center gap-1.5 text-[11px] font-semibold rounded-lg px-2.5 py-1 bg-primary text-primary-foreground hover:opacity-90 transition-all cursor-pointer disabled:opacity-50 shrink-0",children:[l.jsx(TM,{className:J("h-3.5 w-3.5",D&&"animate-pulse")})," Snapshot"]})]}),_&&l.jsx("div",{className:"text-[10px] font-mono text-primary bg-primary/5 p-2 rounded-lg border border-primary/20 break-all leading-normal",children:_})]}),l.jsxs("div",{className:"space-y-2.5",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-red-400/80",children:"Gefahrenzone"}),l.jsxs("button",{onClick:G,className:"flex w-full items-center gap-3 p-3 rounded-lg 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(u5,{className:"h-4.5 w-4.5"}),l.jsxs("div",{children:[l.jsx("div",{children:"Host-System neu starten"}),l.jsx("div",{className:"text-[10px] text-red-400/80 font-normal",children:"Startet die ganze Box 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:[o.filter(V=>V.state==="running"||V.state==="queued").length," Aktiv"]})]}),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-xl p-6 text-center",children:"Aktuell keine aktiven Hintergrund-Jobs."}):o.map(V=>{const Le=V.state==="running"||V.state==="queued";return l.jsxs("div",{className:J("p-3 rounded-xl border transition-all duration-300",Le?"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:[Le&&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"})]}),V.label]}),l.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground uppercase flex items-center gap-2",children:[l.jsxs("span",{children:["ID: ",V.id]}),l.jsx("span",{children:"•"}),l.jsx("span",{className:J(V.state==="done"&&"text-emerald-400",V.state==="failed"&&"text-red-400",V.state==="running"&&"text-primary",V.state==="queued"&&"text-amber-400",V.state==="canceled"&&"text-muted-foreground"),children:V.state})]})]}),Le&&l.jsx("button",{onClick:()=>Ye(V.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"})]}),V.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:`${V.progress??0}%`}})}),l.jsxs("div",{className:"flex justify-between items-center text-[9px] font-mono text-muted-foreground",children:[l.jsxs("span",{children:[V.progress??0,"%"]}),V.done_bytes!=null&&V.total_bytes!=null&&l.jsxs("span",{children:[xg(V.done_bytes)," / ",xg(V.total_bytes),V.rate_bps!=null&&` (${xg(V.rate_bps)}/s)`]}),V.eta_s!=null&&l.jsxs("span",{children:["ETA: ",V.eta_s,"s"]})]})]})]},V.id)})})]})]}),N==="logs"&&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:u,onChange:V=>f(V.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:kk.map(V=>l.jsxs("option",{value:V.id,children:[V.label," (",V.type==="system"?"systemd-root":"user",")"]},V.id))}),l.jsxs("button",{onClick:()=>Ce(u),disabled:w[u],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(mo,{className:J("h-3.5 w-3.5",w[u]&&"animate-spin")}),"Restart"]})]}),l.jsx(tR,{service:u,text:h,loading:p,logStatus:b,onRefresh:()=>X(u),onOpenSettings:()=>E("settings")})]}),N==="settings"&&l.jsx(rR,{open:e,showAlert:ie})]})]}),pe&&l.jsx(nR,{detail:pe,maintenanceJob:et,onClose:()=>oe(null),onApply:Ue}),le&&l.jsx(uE,{type:le.type,title:le.title,message:le.message,onConfirm:le.onConfirm,onCancel:le.onCancel})]})}let Cv=[],Pv=[];const Ov=new Set,gE=()=>Ov.forEach(e=>e());function vE(e){return Ov.add(e),()=>{Ov.delete(e)}}function iR(e){Cv=[...Cv,e].slice(-40),gE()}function aR(e){Pv=[...Pv,e].slice(-40),gE()}const oR=()=>x.useSyncExternalStore(vE,()=>Cv),sR=()=>x.useSyncExternalStore(vE,()=>Pv);function lR(){const{data:e,dataUpdatedAt:t}=Po(3e3),{data:r,dataUpdatedAt:n}=sE(3e3),i=x.useRef(null);x.useEffect(()=>{var o,c,u,f;e&&iR({t:Date.now(),cpu:((o=e.cpu)==null?void 0:o.percent)??0,ram:((c=e.ram)==null?void 0:c.percent)??0,gpu:((u=e.gpu)==null?void 0:u.busy_percent)??null,disk:((f=e.disk)==null?void 0:f.percent)??null})},[t]),x.useEffect(()=>{if(!r)return;const o=Date.now(),c=r.prompt_tokens,u=r.completion_tokens;if(i.current){const f=Math.max((o-i.current.t)/1e3,.001);aR({t:o,prompt:Math.max(0,(c-i.current.p)/f),completion:Math.max(0,(u-i.current.c)/f)})}i.current={p:c,c:u,t:o}},[n])}function xE(){var C,_,O,D,B,z;const{data:e}=Kx(),{data:t}=oE(),{data:r}=Ei(),{data:n}=Po(),i=!!e&&!!t,o=$=>{var K;return(K=t==null?void 0:t.services.find(W=>W.name.toLowerCase().includes($)))==null?void 0:K.ok},c=e==null?void 0:e.engine_reachable,u=(C=e==null?void 0:e.brain)==null?void 0:C.ready,f=((_=e==null?void 0:e.brain)==null?void 0:_.model)||((O=r==null?void 0:r.models.find($=>$.role==="hermes"))==null?void 0:O.name)||"",h=[];h.push((()=>{const $={id:"brain",label:"Lucys Hirn",icon:Na,critical:!0};return i?c===!1?{...$,status:"down",detail:"Die Motor-Maschine (Engine) läuft nicht — Lucy kann gerade gar nicht denken.",repair:{kind:"restart",service:"llama-swap",label:"Motor neu starten",needsSudo:!0}}:u===!1?{...$,status:"down",detail:"Lucys Hirn ist gerade eingeschlafen — einmal aufwecken.",repair:f?{kind:"loadModel",model:f,label:"Hirn aufwecken"}:void 0}:{...$,status:"ok",detail:"Wach und ansprechbar."}:{...$,status:"loading",detail:"Wird geprüft …"}})()),h.push((()=>{const $={id:"vision",label:"Lucys Augen",icon:Ac,critical:!1};if(!i||!r)return{...$,status:"loading",detail:"Wird geprüft …"};const K=r.models.find(ve=>ve.role==="vision");return K?(r.running??[]).includes(K.name)?{...$,status:"ok",detail:"Sieht gerade zu (geladen, solange Lucy sie nutzt)."}:{...$,status:"ok",detail:"Augen ruhen — sie laden von selbst, sobald Lucy startet oder ein Bild kommt.",repair:{kind:"loadModel",model:K.name,label:"Augen wecken"}}:{...$,status:"warn",detail:"Kein Augen-Modell eingerichtet — Lucy kann keine Bilder ansehen."}})()),h.push((()=>{const $={id:"memory",label:"Lucys Gedächtnis",icon:e5,critical:!0},K=o("mem0");return!i||K===void 0?{...$,status:"loading",detail:"Wird geprüft …"}:K?{...$,status:"ok",detail:"Merkt sich Neues und findet Altes wieder."}:{...$,status:"down",detail:"Lucy kann sich gerade nichts merken — das Gedächtnis antwortet nicht.",repair:{kind:"restart",service:"mem0-service",label:"Gedächtnis neu starten"}}})()),h.push((()=>{const $={id:"gateway",label:"Verbindung (Gateway)",icon:Cc,critical:!0},K=e?e.gateway_reachable:o("integriert");return!i||K===void 0?{...$,status:"loading",detail:"Wird geprüft …"}:K?{...$,status:"ok",detail:"Apps und IDEs können Lucy erreichen."}:{...$,status:"down",detail:"Die Verbindungs-Zentrale antwortet nicht — Apps erreichen Lucy nicht.",repair:{kind:"restart",service:"mission-control-2",label:"Zentrale neu starten"}}})()),h.push((()=>{const $={id:"agent",label:"Lucys Agent (Hermes)",icon:jn,critical:!0},K=o("hermes-gateway");return!i||K===void 0?{...$,status:"loading",detail:"Wird geprüft …"}:K?{...$,status:"ok",detail:"Lucy ist bereit zu reden und zu handeln."}:{...$,status:"down",detail:"Lucys Agent ist offline — sie reagiert gerade nicht.",repair:{kind:"restart",service:"hermes-gateway",label:"Agent neu starten"}}})()),h.push((()=>{const $={id:"voice",label:"Lucys Stimme",icon:oI,critical:!1},K=o("voice");return!i||K===void 0?{...$,status:"loading",detail:"Wird geprüft …"}:K?{...$,status:"ok",detail:"Lucy kann hören und sprechen."}:{...$,status:"warn",detail:"Sprechen ist gerade aus — Tippen geht weiter normal.",repair:{kind:"restart",service:"voice-service",label:"Stimme neu starten"}}})());const m=((D=n==null?void 0:n.gpu)==null?void 0:D.gtt_total)||((B=n==null?void 0:n.gpu)==null?void 0:B.vram_total)||0,p=((z=n==null?void 0:n.gpu)==null?void 0:z.gtt_used)||0,v=m>0?Math.min(100,p/m*100):0,b=1024**3,S=m?v>=90?{status:"full",usedGb:p/b,totalGb:m/b,pct:v,text:"Speicher fast voll — Lucy könnte langsamer werden."}:v>=72?{status:"warn",usedGb:p/b,totalGb:m/b,pct:v,text:"Speicher gut gefüllt — noch okay."}:{status:"ok",usedGb:p/b,totalGb:m/b,pct:v,text:"Genug Speicher frei."}:{status:"unknown",usedGb:0,totalGb:0,pct:0,text:"Speicher-Auslastung unbekannt."},w=h.some($=>$.status==="loading"),k=h.filter($=>$.critical&&$.status==="down"),N=h.filter($=>$.status==="warn"||!$.critical&&$.status==="down"),E=S.status==="full";return{verdict:w&&!k.length?"loading":k.length?"problem":N.length||E?"warn":"gut",checks:h,memory:S,problems:k,warns:N}}const cR={ok:"bg-emerald-500",warn:"bg-amber-500",down:"bg-red-500",loading:"bg-muted-foreground/40"};function uR({frame:e="lucy"}={}){const{verdict:t,checks:r,memory:n,problems:i}=xE(),{showAlert:o,dialogElement:c}=An(),u=Wr(),[f,h]=x.useState({});async function m(k,N){h(E=>({...E,[k]:!0}));try{if(N.kind==="loadModel")await xe(`/api/models/${encodeURIComponent(N.model)}/load`,{method:"POST"});else{const E=await xe("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:N.service})});E.ok||o("Reparatur nicht ganz geklappt",(E.err||"Unbekannter Fehler")+(N.needsSudo?` -Tipp: Dafür wird evtl. das Box-Passwort gebraucht (oben rechts hinterlegen).`:""))}u.invalidateQueries({queryKey:$e.health}),u.invalidateQueries({queryKey:$e.services}),u.invalidateQueries({queryKey:$e.models})}catch(E){o("Reparatur fehlgeschlagen",String((E==null?void 0:E.message)||E))}finally{h(E=>({...E,[k]:!1}))}}const p=e==="box"?{loading:"Box wird geprüft …",gut:"Alles okay",warn:"Kleinigkeit an der Box",problem:"Box braucht Hilfe"}:{loading:"Lucy wird geprüft …",gut:"Lucy geht's gut 💚",warn:"Kleinigkeit bei Lucy",problem:"Lucy braucht Hilfe"},v={loading:{ring:"border-border/60 bg-card/45",icon:Bt,iconCls:"text-muted-foreground animate-spin",title:p.loading,sub:"Einen Moment, ich schaue nach dem Rechten."},gut:{ring:"border-emerald-500/40 bg-emerald-500/5",icon:Ix,iconCls:"text-emerald-400",title:p.gut,sub:"Alle wichtigen Fähigkeiten laufen."},warn:{ring:"border-amber-500/40 bg-amber-500/5",icon:vr,iconCls:"text-amber-400",title:p.warn,sub:"Nichts Schlimmes — nur ein Hinweis."},problem:{ring:"border-red-500/50 bg-red-500/5",icon:vr,iconCls:"text-red-400",title:p.problem,sub:`${i.length} wichtige${i.length===1?"s":""} Problem${i.length===1?"":"e"} gefunden.`}}[t],b=v.icon,S={ok:"bg-emerald-500",warn:"bg-amber-500",full:"bg-red-500",unknown:"bg-muted-foreground/40"}[n.status],w={ok:"text-emerald-400",warn:"text-amber-400",full:"text-red-400",unknown:"text-muted-foreground"}[n.status];return l.jsxs("div",{className:J("rounded-2xl border p-5 shadow-lg shadow-black/15 backdrop-blur-md transition-colors",v.ring),children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border border-border/40 bg-background/30",children:l.jsx(b,{className:J("h-6 w-6",v.iconCls)})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"text-base font-bold tracking-tight text-foreground",children:v.title}),l.jsx("p",{className:"text-xs text-muted-foreground",children:v.sub})]})]}),l.jsxs("div",{className:"mt-4 rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsxs("div",{className:"mb-1.5 flex items-center justify-between text-[11px]",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-semibold uppercase tracking-wider text-muted-foreground",children:[l.jsx(xa,{className:"h-3.5 w-3.5"})," Speicher"]}),l.jsx("span",{className:J("font-mono font-bold",w),children:n.status==="unknown"?"—":`${n.usedGb.toFixed(0)} / ${n.totalGb.toFixed(0)} GB`})]}),l.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full border border-border/30 bg-background/50",children:l.jsx("div",{className:J("h-full rounded-full transition-all duration-500",S),style:{width:`${n.pct}%`}})}),l.jsx("p",{className:J("mt-1.5 text-[11px]",w),children:n.text})]}),l.jsx("div",{className:"mt-4 space-y-1.5",children:r.map(k=>l.jsx(dL,{c:k,busy:!!f[k.id],onRepair:()=>k.repair&&m(k.id,k.repair)},k.id))}),c]})}function dL({c:e,busy:t,onRepair:r}){const n=e.icon,i=e.status==="down"||e.status==="warn";return l.jsxs("div",{className:J("flex items-center justify-between gap-3 rounded-xl border p-2.5 transition-colors",e.status==="down"?"border-red-500/25 bg-red-500/5":e.status==="warn"?"border-amber-500/20 bg-amber-500/5":"border-border/30 bg-background/15"),children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[l.jsxs("span",{className:"relative flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-border/40 bg-background/30 text-foreground/80",children:[l.jsx(n,{className:"h-4 w-4"}),l.jsx("span",{className:J("absolute -right-0.5 -top-0.5 h-2.5 w-2.5 rounded-full ring-2 ring-black/40",cL[e.status],e.status==="down"&&"animate-pulse")})]}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-bold text-foreground",children:[e.label,e.status==="ok"&&l.jsx(Mt,{className:"h-3 w-3 text-emerald-400"}),!e.critical&&l.jsx("span",{className:"rounded bg-background/40 px-1 py-0.5 text-[8px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:"optional"})]}),l.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:e.detail})]})]}),i&&e.repair&&l.jsxs("button",{onClick:r,disabled:t,className:J("flex h-8 shrink-0 items-center gap-1.5 rounded-lg border px-2.5 text-[10px] font-bold uppercase tracking-wide transition-all cursor-pointer disabled:opacity-60",e.status==="down"?"border-red-500/40 bg-red-500/10 text-red-300 hover:bg-red-500/20":"border-amber-500/40 bg-amber-500/10 text-amber-300 hover:bg-amber-500/20"),title:e.repair.label,children:[t?l.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(ru,{className:"h-3.5 w-3.5"}),e.repair.label]}),i&&!e.repair&&l.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px] font-semibold text-muted-foreground",title:"Keine Auto-Reparatur bekannt",children:[l.jsx(gI,{className:"h-3.5 w-3.5"})," manuell"]})]})}function fL(){const{data:e,error:t}=Po(3e3),r=oL();return{sys:e,hist:r,error:t}}var hL=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function qx(e){if(typeof e!="string")return!1;var t=hL;return t.includes(e)}var mL=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],pL=new Set(mL);function xE(e){return typeof e!="string"?!1:pL.has(e)}function yE(e){return typeof e=="string"&&e.startsWith("data-")}function Sn(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(xE(r)||yE(r))&&(t[r]=e[r]);return t}function jh(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Sn(t)}return typeof e=="object"&&!Array.isArray(e)?Sn(e):null}function an(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(xE(r)||yE(r)||qx(r))&&(t[r]=e[r]);return t}function gL(e){return e==null?null:x.isValidElement(e)?an(e.props):typeof e=="object"&&!Array.isArray(e)?an(e):null}var vL=["children","width","height","viewBox","className","style","title","desc"];function Ov(){return Ov=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=e.children,n=e.width,i=e.height,o=e.viewBox,c=e.className,u=e.style,f=e.title,h=e.desc,m=xL(e,vL),p=o||{width:n,height:i,x:0,y:0},v=nt("recharts-surface",c);return x.createElement("svg",Ov({},an(m),{className:v,width:n,height:i,style:u,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height),ref:t}),x.createElement("title",null,f),x.createElement("desc",null,h),r)}),bL=["children","className"];function _v(){return _v=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=e.children,n=e.className,i=wL(e,bL),o=nt("recharts-layer",n);return x.createElement("g",_v({className:o},an(i),{ref:t}),r)}),jL=x.createContext(null);function yt(e){return function(){return e}}const Mv=Math.PI,Iv=2*Mv,qa=1e-6,SL=Iv-qa;function wE(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return wE;const r=10**t;return function(n){this._+=n[0];for(let i=1,o=n.length;iqa)if(!(Math.abs(p*f-h*m)>qa)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let b=n-c,S=i-u,w=f*f+h*h,k=b*b+S*S,N=Math.sqrt(w),E=Math.sqrt(v),A=o*Math.tan((Mv-Math.acos((w+v-k)/(2*N*E)))/2),C=A/E,_=A/N;Math.abs(C-1)>qa&&this._append`L${t+C*m},${r+C*p}`,this._append`A${o},${o},0,0,${+(p*b>m*S)},${this._x1=t+_*f},${this._y1=r+_*h}`}}arc(t,r,n,i,o,c){if(t=+t,r=+r,n=+n,c=!!c,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),f=n*Math.sin(i),h=t+u,m=r+f,p=1^c,v=c?i-o:o-i;this._x1===null?this._append`M${h},${m}`:(Math.abs(this._x1-h)>qa||Math.abs(this._y1-m)>qa)&&this._append`L${h},${m}`,n&&(v<0&&(v=v%Iv+Iv),v>SL?this._append`A${n},${n},0,1,${p},${t-u},${r-f}A${n},${n},0,1,${p},${this._x1=h},${this._y1=m}`:v>qa&&this._append`A${n},${n},0,${+(v>=Mv)},${p},${this._x1=t+n*Math.cos(o)},${this._y1=r+n*Math.sin(o)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function kE(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new EL(t)}function Qx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function jE(e){this._context=e}jE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Sh(e){return new jE(e)}function SE(e){return e[0]}function NE(e){return e[1]}function EE(e,t){var r=yt(!0),n=null,i=Sh,o=null,c=kE(u);e=typeof e=="function"?e:e===void 0?SE:yt(e),t=typeof t=="function"?t:t===void 0?NE:yt(t);function u(f){var h,m=(f=Qx(f)).length,p,v=!1,b;for(n==null&&(o=i(b=c())),h=0;h<=m;++h)!(h=b;--S)u.point(A[S],C[S]);u.lineEnd(),u.areaEnd()}N&&(A[v]=+e(k,v,p),C[v]=+t(k,v,p),u.point(n?+n(k,v,p):A[v],r?+r(k,v,p):C[v]))}if(E)return u=null,E+""||null}function m(){return EE().defined(i).curve(c).context(o)}return h.x=function(p){return arguments.length?(e=typeof p=="function"?p:yt(+p),n=null,h):e},h.x0=function(p){return arguments.length?(e=typeof p=="function"?p:yt(+p),h):e},h.x1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:yt(+p),h):n},h.y=function(p){return arguments.length?(t=typeof p=="function"?p:yt(+p),r=null,h):t},h.y0=function(p){return arguments.length?(t=typeof p=="function"?p:yt(+p),h):t},h.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:yt(+p),h):r},h.lineX0=h.lineY0=function(){return m().x(e).y(t)},h.lineY1=function(){return m().x(e).y(r)},h.lineX1=function(){return m().x(n).y(t)},h.defined=function(p){return arguments.length?(i=typeof p=="function"?p:yt(!!p),h):i},h.curve=function(p){return arguments.length?(c=p,o!=null&&(u=c(o)),h):c},h.context=function(p){return arguments.length?(p==null?o=u=null:u=c(o=p),h):o},h}class AE{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function AL(e){return new AE(e,!0)}function CL(e){return new AE(e,!1)}function yf(){}function bf(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function CE(e){this._context=e}CE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:bf(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:bf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function PL(e){return new CE(e)}function PE(e){this._context=e}PE.prototype={areaStart:yf,areaEnd:yf,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:bf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function OL(e){return new PE(e)}function OE(e){this._context=e}OE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:bf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _L(e){return new OE(e)}function _E(e){this._context=e}_E.prototype={areaStart:yf,areaEnd:yf,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function ML(e){return new _E(e)}function kk(e){return e<0?-1:1}function jk(e,t,r){var n=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(n||i<0&&-0),c=(r-e._y1)/(i||n<0&&-0),u=(o*i+c*n)/(n+i);return(kk(o)+kk(c))*Math.min(Math.abs(o),Math.abs(c),.5*Math.abs(u))||0}function Sk(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function xg(e,t,r){var n=e._x0,i=e._y0,o=e._x1,c=e._y1,u=(o-n)/3;e._context.bezierCurveTo(n+u,i+u*t,o-u,c-u*r,o,c)}function wf(e){this._context=e}wf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:xg(this,this._t0,Sk(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,xg(this,Sk(this,r=jk(this,e,t)),r);break;default:xg(this,this._t0,r=jk(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function ME(e){this._context=new IE(e)}(ME.prototype=Object.create(wf.prototype)).point=function(e,t){wf.prototype.point.call(this,t,e)};function IE(e){this._context=e}IE.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,o){this._context.bezierCurveTo(t,e,n,r,o,i)}};function IL(e){return new wf(e)}function TL(e){return new ME(e)}function TE(e){this._context=e}TE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=Nk(e),i=Nk(t),o=0,c=1;c=0;--t)i[t]=(c[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function RL(e){return new Nh(e,.5)}function LL(e){return new Nh(e,0)}function $L(e){return new Nh(e,1)}function bo(e,t){if((c=e.length)>1)for(var r=1,n,i,o=e[t[0]],c,u=o.length;r=0;)r[t]=t;return r}function zL(e,t){return e[t]}function FL(e){const t=[];return t.key=e,t}function BL(){var e=yt([]),t=Tv,r=bo,n=zL;function i(o){var c=Array.from(e.apply(this,arguments),FL),u,f=c.length,h=-1,m;for(const p of o)for(u=0,++h;u0){for(var r,n,i=0,o=e[0].length,c;i0){for(var r=0,n=e[t[0]],i,o=n.length;r0)||!((o=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,o,c;n1&&arguments[1]!==void 0?arguments[1]:GL,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function qt(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{var u=r[c-1];return typeof u=="string"?i+u+o:u!==void 0?i+ga(u)+o:i+o},"")}var en=e=>e===0?0:e>0?1:-1,Gn=e=>typeof e=="number"&&e!=+e,wo=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,Ee=e=>(typeof e=="number"||e instanceof Number)&&!Gn(e),Vn=e=>Ee(e)||typeof e=="string",VL=0,Mc=e=>{var t=++VL;return"".concat(e||"").concat(t)},Sa=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ee(t)&&typeof t!="string")return n;var o;if(wo(t)){if(r==null)return n;var c=t.indexOf("%");o=r*parseFloat(t.slice(0,c))/100}else o=+t;return Gn(o)&&(o=n),i&&r!=null&&o>r&&(o=r),o},LE=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;nn&&(typeof t=="function"?t(n):Oo(n,t))===r)}var Xt=e=>e===null||typeof e>"u",Xx=e=>Xt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Cr(e){return e!=null}function rl(){}var zE=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,Jx=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(x.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(i=>{qx(i)&&typeof r[i]=="function"&&(n[i]=(o=>r[i](r,o)))}),n},qL=(e,t,r)=>n=>(e(t,r,n),null),QL=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(i=>{var o=e[i];qx(i)&&typeof o=="function"&&(n||(n={}),n[i]=qL(o,t,r))}),n};function Ek(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function YL(e){for(var t=1;t(c[u]===void 0&&n[u]!==void 0&&(c[u]=n[u]),c),r);return o}function e$(e,t){const r=new Map;for(let n=0;nObject.prototype.propertyIsEnumerable.call(e,t))}function e0(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const a$="[object RegExp]",BE="[object String]",UE="[object Number]",WE="[object Boolean]",HE="[object Arguments]",o$="[object Symbol]",s$="[object Date]",l$="[object Map]",c$="[object Set]",u$="[object Array]",d$="[object ArrayBuffer]",f$="[object Object]",h$="[object DataView]",m$="[object Uint8Array]",p$="[object Uint8ClampedArray]",g$="[object Uint16Array]",v$="[object Uint32Array]",x$="[object Int8Array]",y$="[object Int16Array]",b$="[object Int32Array]",w$="[object Float32Array]",k$="[object Float64Array]",Ak=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function j$(e){return typeof Ak.Buffer<"u"&&Ak.Buffer.isBuffer(e)}function S$(e,t){return Xa(e,void 0,e,new Map,t)}function Xa(e,t,r,n=new Map,i=void 0){const o=i==null?void 0:i(e,t,r,n);if(o!==void 0)return o;if(Rv(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){const c=new Array(e.length);n.set(e,c);for(let u=0;u{}):Lv(e,t,function n(i,o,c,u,f,h){const m=r(i,o,c,u,f,h);return m!==void 0?!!m:Lv(i,o,n,h,!1)},new Map,!0)}function Lv(e,t,r,n,i=!1){if(t===e)return!0;switch(typeof t){case"object":return A$(e,t,r,n);case"function":return Object.keys(t).length>0?Lv(e,{...t},r,n,i):nf(e,t);default:return KE(e)&&i?typeof t=="string"?t==="":!0:nf(e,t)}}function A$(e,t,r,n){if(t==null)return!0;if(Array.isArray(t))return VE(e,t,r,n);if(t instanceof Map)return C$(e,t,r,n);if(t instanceof Set)return P$(e,t,r,n);const i=Object.keys(t);if(e==null||Rv(e))return i.length===0;if(i.length===0)return!0;if(n!=null&&n.has(t))return n.get(t)===e;n==null||n.set(t,e);try{for(let o=0;o{})}function O$(e){return e=E$(e),t=>qE(t,e)}function _$(e,t){return S$(e,(r,n,i,o)=>{if(typeof e=="object"){if(e0(e)==="[object Object]"&&typeof e.constructor!="function"){const c={};return o.set(e,c),xn(c,e,i,o),c}switch(Object.prototype.toString.call(e)){case UE:case BE:case WE:{const c=new e.constructor(e==null?void 0:e.valueOf());return xn(c,e),c}case HE:{const c={};return xn(c,e),c.length=e.length,c[Symbol.iterator]=e[Symbol.iterator],c}default:return}}})}function M$(e){return _$(e)}const I$=/^(?:0|[1-9]\d*)$/;function QE(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e=0}function YE(e){return e!=null&&typeof e!="function"&&$$(e.length)}function z$(e){return typeof e=="object"&&e!==null}function F$(e){return z$(e)&&YE(e)}function Ck(e,t=FE){return F$(e)?e$(Array.from(e),t$(L$(t),1)):[]}function B$(e,t,r){return t===!0?Ck(e,r):typeof t=="function"?Ck(e,t):e}var yg={exports:{}},bg={},wg={exports:{}},kg={};/** +Tipp: Dafür wird evtl. das Box-Passwort gebraucht (oben rechts hinterlegen).`:""))}u.invalidateQueries({queryKey:$e.health}),u.invalidateQueries({queryKey:$e.services}),u.invalidateQueries({queryKey:$e.models})}catch(E){o("Reparatur fehlgeschlagen",String((E==null?void 0:E.message)||E))}finally{h(E=>({...E,[k]:!1}))}}const p=e==="box"?{loading:"Box wird geprüft …",gut:"Alles okay",warn:"Kleinigkeit an der Box",problem:"Box braucht Hilfe"}:{loading:"Lucy wird geprüft …",gut:"Lucy geht's gut 💚",warn:"Kleinigkeit bei Lucy",problem:"Lucy braucht Hilfe"},v={loading:{ring:"border-border/60 bg-card/45",icon:Bt,iconCls:"text-muted-foreground animate-spin",title:p.loading,sub:"Einen Moment, ich schaue nach dem Rechten."},gut:{ring:"border-emerald-500/40 bg-emerald-500/5",icon:Tx,iconCls:"text-emerald-400",title:p.gut,sub:"Alle wichtigen Fähigkeiten laufen."},warn:{ring:"border-amber-500/40 bg-amber-500/5",icon:vr,iconCls:"text-amber-400",title:p.warn,sub:"Nichts Schlimmes — nur ein Hinweis."},problem:{ring:"border-red-500/50 bg-red-500/5",icon:vr,iconCls:"text-red-400",title:p.problem,sub:`${i.length} wichtige${i.length===1?"s":""} Problem${i.length===1?"":"e"} gefunden.`}}[t],b=v.icon,S={ok:"bg-emerald-500",warn:"bg-amber-500",full:"bg-red-500",unknown:"bg-muted-foreground/40"}[n.status],w={ok:"text-emerald-400",warn:"text-amber-400",full:"text-red-400",unknown:"text-muted-foreground"}[n.status];return l.jsxs("div",{className:J("rounded-2xl border p-5 shadow-lg shadow-black/15 backdrop-blur-md transition-colors",v.ring),children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border border-border/40 bg-background/30",children:l.jsx(b,{className:J("h-6 w-6",v.iconCls)})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"text-base font-bold tracking-tight text-foreground",children:v.title}),l.jsx("p",{className:"text-xs text-muted-foreground",children:v.sub})]})]}),l.jsxs("div",{className:"mt-4 rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsxs("div",{className:"mb-1.5 flex items-center justify-between text-[11px]",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-semibold uppercase tracking-wider text-muted-foreground",children:[l.jsx(xa,{className:"h-3.5 w-3.5"})," Speicher"]}),l.jsx("span",{className:J("font-mono font-bold",w),children:n.status==="unknown"?"—":`${n.usedGb.toFixed(0)} / ${n.totalGb.toFixed(0)} GB`})]}),l.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full border border-border/30 bg-background/50",children:l.jsx("div",{className:J("h-full rounded-full transition-all duration-500",S),style:{width:`${n.pct}%`}})}),l.jsx("p",{className:J("mt-1.5 text-[11px]",w),children:n.text})]}),l.jsx("div",{className:"mt-4 space-y-1.5",children:r.map(k=>l.jsx(dR,{c:k,busy:!!f[k.id],onRepair:()=>k.repair&&m(k.id,k.repair)},k.id))}),c]})}function dR({c:e,busy:t,onRepair:r}){const n=e.icon,i=e.status==="down"||e.status==="warn";return l.jsxs("div",{className:J("flex items-center justify-between gap-3 rounded-xl border p-2.5 transition-colors",e.status==="down"?"border-red-500/25 bg-red-500/5":e.status==="warn"?"border-amber-500/20 bg-amber-500/5":"border-border/30 bg-background/15"),children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[l.jsxs("span",{className:"relative flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-border/40 bg-background/30 text-foreground/80",children:[l.jsx(n,{className:"h-4 w-4"}),l.jsx("span",{className:J("absolute -right-0.5 -top-0.5 h-2.5 w-2.5 rounded-full ring-2 ring-black/40",cR[e.status],e.status==="down"&&"animate-pulse")})]}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-bold text-foreground",children:[e.label,e.status==="ok"&&l.jsx(Mt,{className:"h-3 w-3 text-emerald-400"}),!e.critical&&l.jsx("span",{className:"rounded bg-background/40 px-1 py-0.5 text-[8px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:"optional"})]}),l.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:e.detail})]})]}),i&&e.repair&&l.jsxs("button",{onClick:r,disabled:t,className:J("flex h-8 shrink-0 items-center gap-1.5 rounded-lg border px-2.5 text-[10px] font-bold uppercase tracking-wide transition-all cursor-pointer disabled:opacity-60",e.status==="down"?"border-red-500/40 bg-red-500/10 text-red-300 hover:bg-red-500/20":"border-amber-500/40 bg-amber-500/10 text-amber-300 hover:bg-amber-500/20"),title:e.repair.label,children:[t?l.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(nu,{className:"h-3.5 w-3.5"}),e.repair.label]}),i&&!e.repair&&l.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px] font-semibold text-muted-foreground",title:"Keine Auto-Reparatur bekannt",children:[l.jsx(gI,{className:"h-3.5 w-3.5"})," manuell"]})]})}function fR(){const{data:e,error:t}=Po(3e3),r=oR();return{sys:e,hist:r,error:t}}var hR=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function Qx(e){if(typeof e!="string")return!1;var t=hR;return t.includes(e)}var mR=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],pR=new Set(mR);function yE(e){return typeof e!="string"?!1:pR.has(e)}function bE(e){return typeof e=="string"&&e.startsWith("data-")}function Sn(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(yE(r)||bE(r))&&(t[r]=e[r]);return t}function jh(e){if(e==null)return null;if(x.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Sn(t)}return typeof e=="object"&&!Array.isArray(e)?Sn(e):null}function an(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(yE(r)||bE(r)||Qx(r))&&(t[r]=e[r]);return t}function gR(e){return e==null?null:x.isValidElement(e)?an(e.props):typeof e=="object"&&!Array.isArray(e)?an(e):null}var vR=["children","width","height","viewBox","className","style","title","desc"];function _v(){return _v=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=e.children,n=e.width,i=e.height,o=e.viewBox,c=e.className,u=e.style,f=e.title,h=e.desc,m=xR(e,vR),p=o||{width:n,height:i,x:0,y:0},v=nt("recharts-surface",c);return x.createElement("svg",_v({},an(m),{className:v,width:n,height:i,style:u,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height),ref:t}),x.createElement("title",null,f),x.createElement("desc",null,h),r)}),bR=["children","className"];function Mv(){return Mv=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=e.children,n=e.className,i=wR(e,bR),o=nt("recharts-layer",n);return x.createElement("g",Mv({className:o},an(i),{ref:t}),r)}),jR=x.createContext(null);function yt(e){return function(){return e}}const Iv=Math.PI,Tv=2*Iv,qa=1e-6,SR=Tv-qa;function kE(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return kE;const r=10**t;return function(n){this._+=n[0];for(let i=1,o=n.length;iqa)if(!(Math.abs(p*f-h*m)>qa)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let b=n-c,S=i-u,w=f*f+h*h,k=b*b+S*S,N=Math.sqrt(w),E=Math.sqrt(v),A=o*Math.tan((Iv-Math.acos((w+v-k)/(2*N*E)))/2),C=A/E,_=A/N;Math.abs(C-1)>qa&&this._append`L${t+C*m},${r+C*p}`,this._append`A${o},${o},0,0,${+(p*b>m*S)},${this._x1=t+_*f},${this._y1=r+_*h}`}}arc(t,r,n,i,o,c){if(t=+t,r=+r,n=+n,c=!!c,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),f=n*Math.sin(i),h=t+u,m=r+f,p=1^c,v=c?i-o:o-i;this._x1===null?this._append`M${h},${m}`:(Math.abs(this._x1-h)>qa||Math.abs(this._y1-m)>qa)&&this._append`L${h},${m}`,n&&(v<0&&(v=v%Tv+Tv),v>SR?this._append`A${n},${n},0,1,${p},${t-u},${r-f}A${n},${n},0,1,${p},${this._x1=h},${this._y1=m}`:v>qa&&this._append`A${n},${n},0,${+(v>=Iv)},${p},${this._x1=t+n*Math.cos(o)},${this._y1=r+n*Math.sin(o)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function jE(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new ER(t)}function Yx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function SE(e){this._context=e}SE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Sh(e){return new SE(e)}function NE(e){return e[0]}function EE(e){return e[1]}function AE(e,t){var r=yt(!0),n=null,i=Sh,o=null,c=jE(u);e=typeof e=="function"?e:e===void 0?NE:yt(e),t=typeof t=="function"?t:t===void 0?EE:yt(t);function u(f){var h,m=(f=Yx(f)).length,p,v=!1,b;for(n==null&&(o=i(b=c())),h=0;h<=m;++h)!(h=b;--S)u.point(A[S],C[S]);u.lineEnd(),u.areaEnd()}N&&(A[v]=+e(k,v,p),C[v]=+t(k,v,p),u.point(n?+n(k,v,p):A[v],r?+r(k,v,p):C[v]))}if(E)return u=null,E+""||null}function m(){return AE().defined(i).curve(c).context(o)}return h.x=function(p){return arguments.length?(e=typeof p=="function"?p:yt(+p),n=null,h):e},h.x0=function(p){return arguments.length?(e=typeof p=="function"?p:yt(+p),h):e},h.x1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:yt(+p),h):n},h.y=function(p){return arguments.length?(t=typeof p=="function"?p:yt(+p),r=null,h):t},h.y0=function(p){return arguments.length?(t=typeof p=="function"?p:yt(+p),h):t},h.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:yt(+p),h):r},h.lineX0=h.lineY0=function(){return m().x(e).y(t)},h.lineY1=function(){return m().x(e).y(r)},h.lineX1=function(){return m().x(n).y(t)},h.defined=function(p){return arguments.length?(i=typeof p=="function"?p:yt(!!p),h):i},h.curve=function(p){return arguments.length?(c=p,o!=null&&(u=c(o)),h):c},h.context=function(p){return arguments.length?(p==null?o=u=null:u=c(o=p),h):o},h}class CE{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function AR(e){return new CE(e,!0)}function CR(e){return new CE(e,!1)}function yf(){}function bf(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function PE(e){this._context=e}PE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:bf(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:bf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function PR(e){return new PE(e)}function OE(e){this._context=e}OE.prototype={areaStart:yf,areaEnd:yf,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:bf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function OR(e){return new OE(e)}function _E(e){this._context=e}_E.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:bf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _R(e){return new _E(e)}function ME(e){this._context=e}ME.prototype={areaStart:yf,areaEnd:yf,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function MR(e){return new ME(e)}function jk(e){return e<0?-1:1}function Sk(e,t,r){var n=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(n||i<0&&-0),c=(r-e._y1)/(i||n<0&&-0),u=(o*i+c*n)/(n+i);return(jk(o)+jk(c))*Math.min(Math.abs(o),Math.abs(c),.5*Math.abs(u))||0}function Nk(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function yg(e,t,r){var n=e._x0,i=e._y0,o=e._x1,c=e._y1,u=(o-n)/3;e._context.bezierCurveTo(n+u,i+u*t,o-u,c-u*r,o,c)}function wf(e){this._context=e}wf.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:yg(this,this._t0,Nk(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,yg(this,Nk(this,r=Sk(this,e,t)),r);break;default:yg(this,this._t0,r=Sk(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function IE(e){this._context=new TE(e)}(IE.prototype=Object.create(wf.prototype)).point=function(e,t){wf.prototype.point.call(this,t,e)};function TE(e){this._context=e}TE.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,o){this._context.bezierCurveTo(t,e,n,r,o,i)}};function IR(e){return new wf(e)}function TR(e){return new IE(e)}function DE(e){this._context=e}DE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=Ek(e),i=Ek(t),o=0,c=1;c=0;--t)i[t]=(c[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function LR(e){return new Nh(e,.5)}function RR(e){return new Nh(e,0)}function $R(e){return new Nh(e,1)}function bo(e,t){if((c=e.length)>1)for(var r=1,n,i,o=e[t[0]],c,u=o.length;r=0;)r[t]=t;return r}function zR(e,t){return e[t]}function FR(e){const t=[];return t.key=e,t}function BR(){var e=yt([]),t=Dv,r=bo,n=zR;function i(o){var c=Array.from(e.apply(this,arguments),FR),u,f=c.length,h=-1,m;for(const p of o)for(u=0,++h;u0){for(var r,n,i=0,o=e[0].length,c;i0){for(var r=0,n=e[t[0]],i,o=n.length;r0)||!((o=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,o,c;n1&&arguments[1]!==void 0?arguments[1]:GR,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function qt(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{var u=r[c-1];return typeof u=="string"?i+u+o:u!==void 0?i+ga(u)+o:i+o},"")}var en=e=>e===0?0:e>0?1:-1,Gn=e=>typeof e=="number"&&e!=+e,wo=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,Ee=e=>(typeof e=="number"||e instanceof Number)&&!Gn(e),Vn=e=>Ee(e)||typeof e=="string",VR=0,Ic=e=>{var t=++VR;return"".concat(e||"").concat(t)},Sa=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ee(t)&&typeof t!="string")return n;var o;if(wo(t)){if(r==null)return n;var c=t.indexOf("%");o=r*parseFloat(t.slice(0,c))/100}else o=+t;return Gn(o)&&(o=n),i&&r!=null&&o>r&&(o=r),o},$E=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;nn&&(typeof t=="function"?t(n):Oo(n,t))===r)}var Xt=e=>e===null||typeof e>"u",Jx=e=>Xt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Cr(e){return e!=null}function rl(){}var FE=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,e0=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(x.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(i=>{Qx(i)&&typeof r[i]=="function"&&(n[i]=(o=>r[i](r,o)))}),n},qR=(e,t,r)=>n=>(e(t,r,n),null),QR=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(i=>{var o=e[i];Qx(i)&&typeof o=="function"&&(n||(n={}),n[i]=qR(o,t,r))}),n};function Ak(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function YR(e){for(var t=1;t(c[u]===void 0&&n[u]!==void 0&&(c[u]=n[u]),c),r);return o}function e$(e,t){const r=new Map;for(let n=0;nObject.prototype.propertyIsEnumerable.call(e,t))}function t0(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const a$="[object RegExp]",UE="[object String]",WE="[object Number]",HE="[object Boolean]",KE="[object Arguments]",o$="[object Symbol]",s$="[object Date]",l$="[object Map]",c$="[object Set]",u$="[object Array]",d$="[object ArrayBuffer]",f$="[object Object]",h$="[object DataView]",m$="[object Uint8Array]",p$="[object Uint8ClampedArray]",g$="[object Uint16Array]",v$="[object Uint32Array]",x$="[object Int8Array]",y$="[object Int16Array]",b$="[object Int32Array]",w$="[object Float32Array]",k$="[object Float64Array]",Ck=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function j$(e){return typeof Ck.Buffer<"u"&&Ck.Buffer.isBuffer(e)}function S$(e,t){return Xa(e,void 0,e,new Map,t)}function Xa(e,t,r,n=new Map,i=void 0){const o=i==null?void 0:i(e,t,r,n);if(o!==void 0)return o;if(Rv(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){const c=new Array(e.length);n.set(e,c);for(let u=0;u{}):$v(e,t,function n(i,o,c,u,f,h){const m=r(i,o,c,u,f,h);return m!==void 0?!!m:$v(i,o,n,h,!1)},new Map,!0)}function $v(e,t,r,n,i=!1){if(t===e)return!0;switch(typeof t){case"object":return A$(e,t,r,n);case"function":return Object.keys(t).length>0?$v(e,{...t},r,n,i):af(e,t);default:return GE(e)&&i?typeof t=="string"?t==="":!0:af(e,t)}}function A$(e,t,r,n){if(t==null)return!0;if(Array.isArray(t))return qE(e,t,r,n);if(t instanceof Map)return C$(e,t,r,n);if(t instanceof Set)return P$(e,t,r,n);const i=Object.keys(t);if(e==null||Rv(e))return i.length===0;if(i.length===0)return!0;if(n!=null&&n.has(t))return n.get(t)===e;n==null||n.set(t,e);try{for(let o=0;o{})}function O$(e){return e=E$(e),t=>QE(t,e)}function _$(e,t){return S$(e,(r,n,i,o)=>{if(typeof e=="object"){if(t0(e)==="[object Object]"&&typeof e.constructor!="function"){const c={};return o.set(e,c),xn(c,e,i,o),c}switch(Object.prototype.toString.call(e)){case WE:case UE:case HE:{const c=new e.constructor(e==null?void 0:e.valueOf());return xn(c,e),c}case KE:{const c={};return xn(c,e),c.length=e.length,c[Symbol.iterator]=e[Symbol.iterator],c}default:return}}})}function M$(e){return _$(e)}const I$=/^(?:0|[1-9]\d*)$/;function YE(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e=0}function ZE(e){return e!=null&&typeof e!="function"&&$$(e.length)}function z$(e){return typeof e=="object"&&e!==null}function F$(e){return z$(e)&&ZE(e)}function Pk(e,t=BE){return F$(e)?e$(Array.from(e),t$(R$(t),1)):[]}function B$(e,t,r){return t===!0?Pk(e,r):typeof t=="function"?Pk(e,t):e}var bg={exports:{}},wg={},kg={exports:{}},jg={};/** * @license React * use-sync-external-store-shim.production.js * @@ -675,7 +675,7 @@ Tipp: Dafür wird evtl. das Box-Passwort gebraucht (oben rechts hinterlegen).`:" * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Pk;function U$(){if(Pk)return kg;Pk=1;var e=Xs();function t(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,o=e.useLayoutEffect,c=e.useDebugValue;function u(p,v){var b=v(),S=n({inst:{value:b,getSnapshot:v}}),w=S[0].inst,k=S[1];return o(function(){w.value=b,w.getSnapshot=v,f(w)&&k({inst:w})},[p,b,v]),i(function(){return f(w)&&k({inst:w}),p(function(){f(w)&&k({inst:w})})},[p]),c(b),b}function f(p){var v=p.getSnapshot;p=p.value;try{var b=v();return!r(p,b)}catch{return!0}}function h(p,v){return v()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:u;return kg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,kg}var Ok;function W$(){return Ok||(Ok=1,wg.exports=U$()),wg.exports}/** + */var Ok;function U$(){if(Ok)return jg;Ok=1;var e=Xs();function t(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,o=e.useLayoutEffect,c=e.useDebugValue;function u(p,v){var b=v(),S=n({inst:{value:b,getSnapshot:v}}),w=S[0].inst,k=S[1];return o(function(){w.value=b,w.getSnapshot=v,f(w)&&k({inst:w})},[p,b,v]),i(function(){return f(w)&&k({inst:w}),p(function(){f(w)&&k({inst:w})})},[p]),c(b),b}function f(p){var v=p.getSnapshot;p=p.value;try{var b=v();return!r(p,b)}catch{return!0}}function h(p,v){return v()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:u;return jg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,jg}var _k;function W$(){return _k||(_k=1,kg.exports=U$()),kg.exports}/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -683,12 +683,12 @@ Tipp: Dafür wird evtl. das Box-Passwort gebraucht (oben rechts hinterlegen).`:" * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var _k;function H$(){if(_k)return bg;_k=1;var e=Xs(),t=W$();function r(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var n=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,o=e.useRef,c=e.useEffect,u=e.useMemo,f=e.useDebugValue;return bg.useSyncExternalStoreWithSelector=function(h,m,p,v,b){var S=o(null);if(S.current===null){var w={hasValue:!1,value:null};S.current=w}else w=S.current;S=u(function(){function N(O){if(!E){if(E=!0,A=O,O=v(O),b!==void 0&&w.hasValue){var D=w.value;if(b(D,O))return C=D}return C=O}if(D=C,n(A,O))return D;var B=v(O);return b!==void 0&&b(D,B)?(A=O,D):(A=O,C=B)}var E=!1,A,C,_=p===void 0?null:p;return[function(){return N(m())},_===null?void 0:function(){return N(_())}]},[m,p,v,b]);var k=i(h,S[0],S[1]);return c(function(){w.hasValue=!0,w.value=k},[k]),f(k),k},bg}var Mk;function K$(){return Mk||(Mk=1,yg.exports=H$()),yg.exports}var G$=K$(),t0=x.createContext(null),V$=e=>e,At=()=>{var e=x.useContext(t0);return e?e.store.dispatch:V$},af=()=>{},q$=()=>af,Q$=(e,t)=>e===t;function Me(e){var t=x.useContext(t0),r=x.useMemo(()=>t?n=>{if(n!=null)return e(n)}:af,[t,e]);return G$.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:q$,t?t.store.getState:af,t?t.store.getState:af,r,Q$)}function Y$(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Z$(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var Ik=e=>Array.isArray(e)?e:[e];function X$(e){const t=Array.isArray(e[0])?e[0]:e;return Z$(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function J$(e,t){const r=[],{length:n}=e;for(let i=0;itypeof WeakRef>"u"?e6:WeakRef,ZE=t6(),r6=0,Tk=1;function Fd(){return{s:r6,v:void 0,o:null,p:null}}function n6(e){return e instanceof ZE?e.deref():e}function XE(e,t={}){let r=Fd();const{resultEqualityCheck:n}=t;let i,o=0;function c(){let u=r;const{length:f}=arguments;for(let p=0,v=f;p{r=Fd(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}function i6(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let o=0,c=0,u,f={},h=i.pop();typeof h=="object"&&(f=h,h=i.pop()),Y$(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const m={...r,...f},{memoize:p,memoizeOptions:v=[],argsMemoize:b=XE,argsMemoizeOptions:S=[]}=m,w=Ik(v),k=Ik(S),N=X$(i),E=p(function(){return o++,h.apply(null,arguments)},...w),A=b(function(){c++;const _=J$(N,arguments);return u=E.apply(null,_),u},...k);return Object.assign(A,{resultFunc:h,memoizedResultFunc:E,dependencies:N,dependencyRecomputations:()=>c,resetDependencyRecomputations:()=>{c=0},lastResult:()=>u,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:p,argsMemoize:b})};return Object.assign(n,{withTypes:()=>n}),n}var Q=i6(XE);function a6(e,t=1){const r=[],n=Math.floor(t),i=(o,c)=>{for(let u=0;u{if(e!==t){const n=Dk(e),i=Dk(t);if(n===i&&n===0){if(et)return r==="desc"?-1:1}return r==="desc"?i-n:n-i}return 0};function JE(e){return typeof e=="symbol"||e instanceof Symbol}const s6=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l6=/^\w*$/;function c6(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||JE(e)?!0:typeof e=="string"&&(l6.test(e)||!s6.test(e))||t!=null}function u6(e,t,r,n){if(e==null)return[];r=r,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(r)||(r=r==null?[]:[r]),r=r.map(u=>String(u));const i=(u,f)=>{let h=u;for(let m=0;mf==null||u==null?f:typeof u=="object"&&"key"in u?Object.hasOwn(f,u.key)?f[u.key]:i(f,u.path):typeof u=="function"?u(f):Array.isArray(u)?i(f,u):typeof f=="object"?f[u]:f,c=t.map(u=>(Array.isArray(u)&&u.length===1&&(u=u[0]),u==null||typeof u=="function"||Array.isArray(u)||c6(u)?u:{key:u,path:Zx(u)}));return e.map(u=>({original:u,criteria:c.map(f=>o(f,u))})).slice().sort((u,f)=>{for(let h=0;hu.original)}function Eh(e,...t){const r=t.length;return r>1&&$v(e,t[0],t[1])?t=[]:r>2&&$v(t[0],t[1],t[2])&&(t=[t[0]]),u6(e,a6(t),["asc"])}var eA=e=>e.legend.settings,d6=e=>e.legend.size,f6=e=>e.legend.payload;Q([f6,eA],(e,t)=>{var r=t.itemSorter,n=e.flat(1);return r?Eh(n,r):n});function h6(e,t){return v6(e)||g6(e,t)||p6(e,t)||m6()}function m6(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p6(e,t){if(e){if(typeof e=="string")return Rk(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Rk(e,t):void 0}}function Rk(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);rBd||Math.abs(e.left-t.left)>Bd||Math.abs(e.top-t.top)>Bd||Math.abs(e.width-t.width)>Bd}function $k(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function x6(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=x.useState({height:0,left:0,top:0,width:0}),r=h6(t,2),n=r[0],i=r[1],o=x.useRef(null),c=x.useRef(n);c.current=n;var u=x.useCallback(f=>{if(o.current!=null&&(o.current.disconnect(),o.current=null),f!=null){var h=$k(f);if(Lk(h,c.current)&&i(h),typeof ResizeObserver<"u"){var m=new ResizeObserver(()=>{var p=$k(f);Lk(p,c.current)&&i(p)});m.observe(f),o.current=m}}},[...e]);return x.useEffect(()=>()=>{var f;(f=o.current)===null||f===void 0||f.disconnect()},[]),[n,u]}function Vt(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var y6=typeof Symbol=="function"&&Symbol.observable||"@@observable",zk=y6,jg=()=>Math.random().toString(36).substring(7).split("").join("."),b6={INIT:`@@redux/INIT${jg()}`,REPLACE:`@@redux/REPLACE${jg()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${jg()}`},kf=b6;function r0(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function tA(e,t,r){if(typeof e!="function")throw new Error(Vt(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Vt(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Vt(1));return r(tA)(e,t)}let n=e,i=t,o=new Map,c=o,u=0,f=!1;function h(){c===o&&(c=new Map,o.forEach((k,N)=>{c.set(N,k)}))}function m(){if(f)throw new Error(Vt(3));return i}function p(k){if(typeof k!="function")throw new Error(Vt(4));if(f)throw new Error(Vt(5));let N=!0;h();const E=u++;return c.set(E,k),function(){if(N){if(f)throw new Error(Vt(6));N=!1,h(),c.delete(E),o=null}}}function v(k){if(!r0(k))throw new Error(Vt(7));if(typeof k.type>"u")throw new Error(Vt(8));if(typeof k.type!="string")throw new Error(Vt(17));if(f)throw new Error(Vt(9));try{f=!0,i=n(i,k)}finally{f=!1}return(o=c).forEach(E=>{E()}),k}function b(k){if(typeof k!="function")throw new Error(Vt(10));n=k,v({type:kf.REPLACE})}function S(){const k=p;return{subscribe(N){if(typeof N!="object"||N===null)throw new Error(Vt(11));function E(){const C=N;C.next&&C.next(m())}return E(),{unsubscribe:k(E)}},[zk](){return this}}}return v({type:kf.INIT}),{dispatch:v,subscribe:p,getState:m,replaceReducer:b,[zk]:S}}function w6(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:kf.INIT})>"u")throw new Error(Vt(12));if(typeof r(void 0,{type:kf.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Vt(13))})}function rA(e){const t=Object.keys(e),r={};for(let o=0;o"u")throw u&&u.type,new Error(Vt(14));h[p]=S,f=f||S!==b}return f=f||n.length!==Object.keys(c).length,f?h:c}}function jf(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function k6(...e){return t=>(r,n)=>{const i=t(r,n);let o=()=>{throw new Error(Vt(15))};const c={getState:i.getState,dispatch:(f,...h)=>o(f,...h)},u=e.map(f=>f(c));return o=jf(...u)(i.dispatch),{...i,dispatch:o}}}function nA(e){return r0(e)&&"type"in e&&typeof e.type=="string"}var iA=Symbol.for("immer-nothing"),Fk=Symbol.for("immer-draftable"),xr=Symbol.for("immer-state");function bn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var zr=Object,Ws=zr.getPrototypeOf,Sf="constructor",Ah="prototype",zv="configurable",Nf="enumerable",of="writable",Ic="value",ki=e=>!!e&&!!e[xr];function Nn(e){var t;return e?aA(e)||Ph(e)||!!e[Fk]||!!((t=e[Sf])!=null&&t[Fk])||Oh(e)||_h(e):!1}var j6=zr[Ah][Sf].toString(),Bk=new WeakMap;function aA(e){if(!e||!n0(e))return!1;const t=Ws(e);if(t===null||t===zr[Ah])return!0;const r=zr.hasOwnProperty.call(t,Sf)&&t[Sf];if(r===Object)return!0;if(!xs(r))return!1;let n=Bk.get(r);return n===void 0&&(n=Function.toString.call(r),Bk.set(r,n)),n===j6}function Ch(e,t,r=!0){iu(e)===0?(r?Reflect.ownKeys(e):zr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((n,i)=>t(i,n,e))}function iu(e){const t=e[xr];return t?t.type_:Ph(e)?1:Oh(e)?2:_h(e)?3:0}var Uk=(e,t,r=iu(e))=>r===2?e.has(t):zr[Ah].hasOwnProperty.call(e,t),Fv=(e,t,r=iu(e))=>r===2?e.get(t):e[t],Ef=(e,t,r,n=iu(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function S6(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Ph=Array.isArray,Oh=e=>e instanceof Map,_h=e=>e instanceof Set,n0=e=>typeof e=="object",xs=e=>typeof e=="function",Sg=e=>typeof e=="boolean";function N6(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ci=e=>e.copy_||e.base_,i0=e=>e.modified_?e.copy_:e.base_;function Bv(e,t){if(Oh(e))return new Map(e);if(_h(e))return new Set(e);if(Ph(e))return Array[Ah].slice.call(e);const r=aA(e);if(t===!0||t==="class_only"&&!r){const n=zr.getOwnPropertyDescriptors(e);delete n[xr];let i=Reflect.ownKeys(n);for(let o=0;o1&&zr.defineProperties(e,{set:Ud,add:Ud,clear:Ud,delete:Ud}),zr.freeze(e),t&&Ch(e,(r,n)=>{a0(n,!0)},!1)),e}function E6(){bn(2)}var Ud={[Ic]:E6};function Mh(e){return e===null||!n0(e)?!0:zr.isFrozen(e)}var Af="MapSet",Uv="Patches",Wk="ArrayMethods",oA={};function ko(e){const t=oA[e];return t||bn(0,e),t}var Hk=e=>!!oA[e],Tc,sA=()=>Tc,A6=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Hk(Af)?ko(Af):void 0,arrayMethodsPlugin_:Hk(Wk)?ko(Wk):void 0});function Kk(e,t){t&&(e.patchPlugin_=ko(Uv),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Wv(e){Hv(e),e.drafts_.forEach(C6),e.drafts_=null}function Hv(e){e===Tc&&(Tc=e.parent_)}var Gk=e=>Tc=A6(Tc,e);function C6(e){const t=e[xr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Vk(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[xr].modified_&&(Wv(t),bn(4)),Nn(e)&&(e=qk(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(r[xr].base_,e,t)}else e=qk(t,r);return P6(t,e,!0),Wv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==iA?e:void 0}function qk(e,t){if(Mh(t))return t;const r=t[xr];if(!r)return Cf(t,e.handledSet_,e);if(!Ih(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);uA(r,e)}return r.copy_}function P6(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&a0(t,r)}function lA(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Ih=(e,t)=>e.scope_===t,O6=[];function cA(e,t,r,n){const i=ci(e),o=e.type_;if(n!==void 0&&Fv(i,n,o)===t){Ef(i,n,r,o);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;Ch(i,(f,h)=>{if(ki(h)){const m=u.get(h)||[];m.push(f),u.set(h,m)}})}const c=e.draftLocations_.get(t)??O6;for(const u of c)Ef(i,u,r,o)}function _6(e,t,r){e.callbacks_.push(function(i){var u;const o=t;if(!o||!Ih(o,i))return;(u=i.mapSetPlugin_)==null||u.fixSetContents(o);const c=i0(o);cA(e,o.draft_??o,c,r),uA(o,i)})}function uA(e,t){var n;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((n=e.assigned_)==null?void 0:n.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const o=i.getPath(e);o&&i.generatePatches_(e,o,t)}lA(e)}}function M6(e,t,r){const{scope_:n}=e;if(ki(r)){const i=r[xr];Ih(i,n)&&i.callbacks_.push(function(){sf(e);const c=i0(i);cA(e,r,c,t)})}else Nn(r)&&e.callbacks_.push(function(){const o=ci(e);e.type_===3?o.has(r)&&Cf(r,n.handledSet_,n):Fv(o,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Cf(Fv(e.copy_,t,e.type_),n.handledSet_,n)})}function Cf(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||ki(e)||t.has(e)||!Nn(e)||Mh(e)||(t.add(e),Ch(e,(n,i)=>{if(ki(i)){const o=i[xr];if(Ih(o,r)){const c=i0(o);Ef(e,n,c,e.type_),lA(o)}}else Nn(i)&&Cf(i,t,r)})),e}function I6(e,t){const r=Ph(e),n={type_:r?1:0,scope_:t?t.scope_:sA(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=n,o=Pf;r&&(i=[n],o=Dc);const{revoke:c,proxy:u}=Proxy.revocable(i,o);return n.draft_=u,n.revoke_=c,[u,n]}var Pf={get(e,t){if(t===xr)return e;let r=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof t=="string";if(n&&r!=null&&r.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const i=ci(e);if(!Uk(i,t,e.type_))return T6(e,i,t);const o=i[t];if(e.finalized_||!Nn(o)||n&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&N6(t))return o;if(o===Ng(e.base_,t)){sf(e);const c=e.type_===1?+t:t,u=Gv(e.scope_,o,e,c);return e.copy_[c]=u}return o},has(e,t){return t in ci(e)},ownKeys(e){return Reflect.ownKeys(ci(e))},set(e,t,r){const n=dA(ci(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=Ng(ci(e),t),o=i==null?void 0:i[xr];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(S6(r,i)&&(r!==void 0||Uk(e.base_,t,e.type_)))return!0;sf(e),Kv(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),M6(e,t,r)),!0},deleteProperty(e,t){return sf(e),Ng(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Kv(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=ci(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[of]:!0,[zv]:e.type_!==1||t!=="length",[Nf]:n[Nf],[Ic]:r[t]}},defineProperty(){bn(11)},getPrototypeOf(e){return Ws(e.base_)},setPrototypeOf(){bn(12)}},Dc={};for(let e in Pf){let t=Pf[e];Dc[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Dc.deleteProperty=function(e,t){return Dc.set.call(this,e,t,void 0)};Dc.set=function(e,t,r){return Pf.set.call(this,e[0],t,r,e[0])};function Ng(e,t){const r=e[xr];return(r?ci(r):e)[t]}function T6(e,t,r){var i;const n=dA(t,r);return n?Ic in n?n[Ic]:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function dA(e,t){if(!(t in e))return;let r=Ws(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Ws(r)}}function Kv(e){e.modified_||(e.modified_=!0,e.parent_&&Kv(e.parent_))}function sf(e){e.copy_||(e.assigned_=new Map,e.copy_=Bv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var D6=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,n,i)=>{if(xs(r)&&!xs(n)){const c=n;n=r;const u=this;return function(h=c,...m){return u.produce(h,p=>n.call(this,p,...m))}}xs(n)||bn(6),i!==void 0&&!xs(i)&&bn(7);let o;if(Nn(r)){const c=Gk(this),u=Gv(c,r,void 0);let f=!0;try{o=n(u),f=!1}finally{f?Wv(c):Hv(c)}return Kk(c,i),Vk(o,c)}else if(!r||!n0(r)){if(o=n(r),o===void 0&&(o=r),o===iA&&(o=void 0),this.autoFreeze_&&a0(o,!0),i){const c=[],u=[];ko(Uv).generateReplacementPatches_(r,o,{patches_:c,inversePatches_:u}),i(c,u)}return o}else bn(1,r)},this.produceWithPatches=(r,n)=>{if(xs(r))return(u,...f)=>this.produceWithPatches(u,h=>r(h,...f));let i,o;return[this.produce(r,n,(u,f)=>{i=u,o=f}),i,o]},Sg(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Sg(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Sg(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Nn(t)||bn(8),ki(t)&&(t=tn(t));const r=Gk(this),n=Gv(r,t,void 0);return n[xr].isManual_=!0,Hv(r),n}finishDraft(t,r){const n=t&&t[xr];(!n||!n.isManual_)&&bn(9);const{scope_:i}=n;return Kk(i,r),Vk(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,r){let n;for(n=r.length-1;n>=0;n--){const o=r[n];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}n>-1&&(r=r.slice(n+1));const i=ko(Uv).applyPatches_;return ki(t)?i(t,r):this.produce(t,o=>i(o,r))}};function Gv(e,t,r,n){const[i,o]=Oh(t)?ko(Af).proxyMap_(t,r):_h(t)?ko(Af).proxySet_(t,r):I6(t,r);return((r==null?void 0:r.scope_)??sA()).drafts_.push(i),o.callbacks_=(r==null?void 0:r.callbacks_)??[],o.key_=n,r&&n!==void 0?_6(r,o,n):o.callbacks_.push(function(f){var m;(m=f.mapSetPlugin_)==null||m.fixSetContents(o);const{patchPlugin_:h}=f;o.modified_&&h&&h.generatePatches_(o,[],f)}),i}function tn(e){return ki(e)||bn(10,e),fA(e)}function fA(e){if(!Nn(e)||Mh(e))return e;const t=e[xr];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Bv(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Bv(e,!0);return Ch(r,(i,o)=>{Ef(r,i,fA(o))},n),t&&(t.finalized_=!1),r}var R6=new D6,hA=R6.produce;function mA(e){return({dispatch:r,getState:n})=>i=>o=>typeof o=="function"?o(r,n,e):i(o)}var L6=mA(),$6=mA,z6=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?jf:jf.apply(null,arguments)};function Br(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(Fr(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>nA(n)&&n.type===e,r}var pA=class gc extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,gc.prototype)}static get[Symbol.species](){return gc}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new gc(...t[0].concat(this)):new gc(...t.concat(this))}};function Qk(e){return Nn(e)?hA(e,()=>{}):e}function Wd(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function F6(e){return typeof e=="boolean"}var B6=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let c=new pA;return r&&(F6(r)?c.push(L6):c.push($6(r.extraArgument))),c},gA="RTK_autoBatch",lt=()=>e=>({payload:e,meta:{[gA]:!0}}),Yk=e=>t=>{setTimeout(t,e)},U6=(e,t)=>r=>{let n=!1;const i=()=>{n||(n=!0,cancelAnimationFrame(o),clearTimeout(c),r())},o=e(i),c=setTimeout(i,t)},vA=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let i=!0,o=!1,c=!1;const u=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?U6(window.requestAnimationFrame,100):Yk(10):e.type==="callback"?e.queueNotification:Yk(e.timeout),h=()=>{c=!1,o&&(o=!1,u.forEach(m=>m()))};return Object.assign({},n,{subscribe(m){const p=()=>i&&m(),v=n.subscribe(p);return u.add(m),()=>{v(),u.delete(m)}},dispatch(m){var p;try{return i=!((p=m==null?void 0:m.meta)!=null&&p[gA]),o=!i,o&&(c||(c=!0,f(h))),n.dispatch(m)}finally{i=!0}}})},W6=e=>function(r){const{autoBatch:n=!0}=r??{};let i=new pA(e);return n&&i.push(vA(typeof n=="object"?n:void 0)),i};function H6(e){const t=B6(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:o=void 0,enhancers:c=void 0}=e||{};let u;if(typeof r=="function")u=r;else if(r0(r))u=rA(r);else throw new Error(Fr(1));let f;typeof n=="function"?f=n(t):f=t();let h=jf;i&&(h=z6({trace:!1,...typeof i=="object"&&i}));const m=k6(...f),p=W6(m);let v=typeof c=="function"?c(p):p();const b=h(...v);return tA(u,o,b)}function xA(e){const t={},r=[];let n;const i={addCase(o,c){const u=typeof o=="string"?o:o.type;if(!u)throw new Error(Fr(28));if(u in t)throw new Error(Fr(29));return t[u]=c,i},addAsyncThunk(o,c){return c.pending&&(t[o.pending.type]=c.pending),c.rejected&&(t[o.rejected.type]=c.rejected),c.fulfilled&&(t[o.fulfilled.type]=c.fulfilled),c.settled&&r.push({matcher:o.settled,reducer:c.settled}),i},addMatcher(o,c){return r.push({matcher:o,reducer:c}),i},addDefaultCase(o){return n=o,i}};return e(i),[t,r,n]}function K6(e){return typeof e=="function"}function G6(e,t){let[r,n,i]=xA(t),o;if(K6(e))o=()=>Qk(e());else{const u=Qk(e);o=()=>u}function c(u=o(),f){let h=[r[f.type],...n.filter(({matcher:m})=>m(f)).map(({reducer:m})=>m)];return h.filter(m=>!!m).length===0&&(h=[i]),h.reduce((m,p)=>{if(p)if(ki(m)){const b=p(m,f);return b===void 0?m:b}else{if(Nn(m))return hA(m,v=>p(v,f));{const v=p(m,f);if(v===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}}return m},u)}return c.getInitialState=o,c}var V6="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",q6=(e=21)=>{let t="",r=e;for(;r--;)t+=V6[Math.random()*64|0];return t},Q6=Symbol.for("rtk-slice-createasyncthunk");function Y6(e,t){return`${e}/${t}`}function Z6({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[Q6];return function(i){const{name:o,reducerPath:c=o}=i;if(!o)throw new Error(Fr(11));const u=(typeof i.reducers=="function"?i.reducers(J6()):i.reducers)||{},f=Object.keys(u),h={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(C,_){const O=typeof C=="string"?C:C.type;if(!O)throw new Error(Fr(12));if(O in h.sliceCaseReducersByType)throw new Error(Fr(13));return h.sliceCaseReducersByType[O]=_,m},addMatcher(C,_){return h.sliceMatchers.push({matcher:C,reducer:_}),m},exposeAction(C,_){return h.actionCreators[C]=_,m},exposeCaseReducer(C,_){return h.sliceCaseReducersByName[C]=_,m}};f.forEach(C=>{const _=u[C],O={reducerName:C,type:Y6(o,C),createNotation:typeof i.reducers=="function"};tz(_)?nz(O,_,m,t):ez(O,_,m)});function p(){const[C={},_=[],O=void 0]=typeof i.extraReducers=="function"?xA(i.extraReducers):[i.extraReducers],D={...C,...h.sliceCaseReducersByType};return G6(i.initialState,B=>{for(let z in D)B.addCase(z,D[z]);for(let z of h.sliceMatchers)B.addMatcher(z.matcher,z.reducer);for(let z of _)B.addMatcher(z.matcher,z.reducer);O&&B.addDefaultCase(O)})}const v=C=>C,b=new Map,S=new WeakMap;let w;function k(C,_){return w||(w=p()),w(C,_)}function N(){return w||(w=p()),w.getInitialState()}function E(C,_=!1){function O(B){let z=B[C];return typeof z>"u"&&_&&(z=Wd(S,O,N)),z}function D(B=v){const z=Wd(b,_,()=>new WeakMap);return Wd(z,B,()=>{const $={};for(const[K,W]of Object.entries(i.selectors??{}))$[K]=X6(W,B,()=>Wd(S,B,N),_);return $})}return{reducerPath:C,getSelectors:D,get selectors(){return D(O)},selectSlice:O}}const A={name:o,reducer:k,actions:h.actionCreators,caseReducers:h.sliceCaseReducersByName,getInitialState:N,...E(c),injectInto(C,{reducerPath:_,...O}={}){const D=_??c;return C.inject({reducerPath:D,reducer:k},O),{...A,...E(D,!0)}}};return A}}function X6(e,t,r,n){function i(o,...c){let u=t(o);return typeof u>"u"&&n&&(u=r()),e(u,...c)}return i.unwrapped=e,i}var ur=Z6();function J6(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function ez({type:e,reducerName:t,createNotation:r},n,i){let o,c;if("reducer"in n){if(r&&!rz(n))throw new Error(Fr(17));o=n.reducer,c=n.prepare}else o=n;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,c?Br(e,c):Br(e))}function tz(e){return e._reducerDefinitionType==="asyncThunk"}function rz(e){return e._reducerDefinitionType==="reducerWithPrepare"}function nz({type:e,reducerName:t},r,n,i){if(!i)throw new Error(Fr(18));const{payloadCreator:o,fulfilled:c,pending:u,rejected:f,settled:h,options:m}=r,p=i(e,o,m);n.exposeAction(t,p),c&&n.addCase(p.fulfilled,c),u&&n.addCase(p.pending,u),f&&n.addCase(p.rejected,f),h&&n.addMatcher(p.settled,h),n.exposeCaseReducer(t,{fulfilled:c||Hd,pending:u||Hd,rejected:f||Hd,settled:h||Hd})}function Hd(){}var iz="task",yA="listener",bA="completed",o0="cancelled",az=`task-${o0}`,oz=`task-${bA}`,Vv=`${yA}-${o0}`,sz=`${yA}-${bA}`,Th=class{constructor(e){is(this,"code");is(this,"name","TaskAbortError");is(this,"message");this.code=e,this.message=`${iz} ${o0} (reason: ${e})`}},s0=(e,t)=>{if(typeof e!="function")throw new TypeError(Fr(32))},Of=()=>{},wA=(e,t=Of)=>(e.catch(t),e),kA=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),go=e=>{if(e.aborted)throw new Th(e.reason)};function jA(e,t){let r=Of;return new Promise((n,i)=>{const o=()=>i(new Th(e.reason));if(e.aborted){o();return}r=kA(e,o),t.finally(()=>r()).then(n,i)}).finally(()=>{r=Of})}var lz=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof Th?"cancelled":"rejected",error:r}}finally{t==null||t()}},_f=e=>t=>wA(jA(e,t).then(r=>(go(e),r))),SA=e=>{const t=_f(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:js}=Object,Zk={},Dh="listenerMiddleware",cz=(e,t)=>{const r=n=>kA(e,()=>n.abort(e.reason));return(n,i)=>{s0(n);const o=new AbortController;r(o);const c=lz(async()=>{go(e),go(o.signal);const u=await n({pause:_f(o.signal),delay:SA(o.signal),signal:o.signal});return go(o.signal),u},()=>o.abort(oz));return i!=null&&i.autoJoin&&t.push(c.catch(Of)),{result:_f(e)(c),cancel(){o.abort(az)}}}},uz=(e,t)=>{const r=async(n,i)=>{go(t);let o=()=>{};const u=[new Promise((f,h)=>{let m=e({predicate:n,effect:(p,v)=>{v.unsubscribe(),f([p,v.getState(),v.getOriginalState()])}});o=()=>{m(),h()}})];i!=null&&u.push(new Promise(f=>setTimeout(f,i,null)));try{const f=await jA(t,Promise.race(u));return go(t),f}finally{o()}};return((n,i)=>wA(r(n,i)))},NA=e=>{let{type:t,actionCreator:r,matcher:n,predicate:i,effect:o}=e;if(t)i=Br(t).match;else if(r)t=r.type,i=r.match;else if(n)i=n;else if(!i)throw new Error(Fr(21));return s0(o),{predicate:i,type:t,effect:o}},EA=js(e=>{const{type:t,predicate:r,effect:n}=NA(e);return{id:q6(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Fr(22))}}},{withTypes:()=>EA}),Xk=(e,t)=>{const{type:r,effect:n,predicate:i}=NA(t);return Array.from(e.values()).find(o=>(typeof r=="string"?o.type===r:o.predicate===i)&&o.effect===n)},qv=e=>{e.pending.forEach(t=>{t.abort(Vv)})},dz=(e,t)=>()=>{for(const r of t.keys())qv(r);e.clear()},Jk=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},AA=js(Br(`${Dh}/add`),{withTypes:()=>AA}),fz=Br(`${Dh}/removeAll`),CA=js(Br(`${Dh}/remove`),{withTypes:()=>CA}),hz=(...e)=>{console.error(`${Dh}/error`,...e)},au=(e={})=>{const t=new Map,r=new Map,n=b=>{const S=r.get(b)??0;r.set(b,S+1)},i=b=>{const S=r.get(b)??1;S===1?r.delete(b):r.set(b,S-1)},{extra:o,onError:c=hz}=e;s0(c);const u=b=>(b.unsubscribe=()=>t.delete(b.id),t.set(b.id,b),S=>{b.unsubscribe(),S!=null&&S.cancelActive&&qv(b)}),f=(b=>{const S=Xk(t,b)??EA(b);return u(S)});js(f,{withTypes:()=>f});const h=b=>{const S=Xk(t,b);return S&&(S.unsubscribe(),b.cancelActive&&qv(S)),!!S};js(h,{withTypes:()=>h});const m=async(b,S,w,k)=>{const N=new AbortController,E=uz(f,N.signal),A=[];try{b.pending.add(N),n(b),await Promise.resolve(b.effect(S,js({},w,{getOriginalState:k,condition:(C,_)=>E(C,_).then(Boolean),take:E,delay:SA(N.signal),pause:_f(N.signal),extra:o,signal:N.signal,fork:cz(N.signal,A),unsubscribe:b.unsubscribe,subscribe:()=>{t.set(b.id,b)},cancelActiveListeners:()=>{b.pending.forEach((C,_,O)=>{C!==N&&(C.abort(Vv),O.delete(C))})},cancel:()=>{N.abort(Vv),b.pending.delete(N)},throwIfCancelled:()=>{go(N.signal)}})))}catch(C){C instanceof Th||Jk(c,C,{raisedBy:"effect"})}finally{await Promise.all(A),N.abort(sz),i(b),b.pending.delete(N)}},p=dz(t,r);return{middleware:b=>S=>w=>{if(!nA(w))return S(w);if(AA.match(w))return f(w.payload);if(fz.match(w)){p();return}if(CA.match(w))return h(w.payload);let k=b.getState();const N=()=>{if(k===Zk)throw new Error(Fr(23));return k};let E;try{if(E=S(w),t.size>0){const A=b.getState(),C=Array.from(t.values());for(const _ of C){let O=!1;try{O=_.predicate(w,A,k)}catch(D){O=!1,Jk(c,D,{raisedBy:"predicate"})}O&&m(_,w,b,N)}}}finally{k=Zk}return E},startListening:f,stopListening:h,clearListeners:p}};function Fr(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var mz={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},PA=ur({name:"chartLayout",initialState:mz,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var r,n,i,o;e.margin.top=(r=t.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(n=t.payload.right)!==null&&n!==void 0?n:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(o=t.payload.left)!==null&&o!==void 0?o:0},setScale(e,t){e.scale=t.payload}}}),Rh=PA.actions,pz=Rh.setMargin,gz=Rh.setLayout,vz=Rh.setChartSize,xz=Rh.setScale,yz=PA.reducer;function OA(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function He(e){return Number.isFinite(e)}function qn(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function ej(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ys(e){for(var t=1;t{if(t&&r){var n=r.width,i=r.height,o=t.align,c=t.verticalAlign,u=t.layout;if((u==="vertical"||u==="horizontal"&&c==="middle")&&o!=="center"&&Ee(e[o]))return ys(ys({},e),{},{[o]:e[o]+(n||0)});if((u==="horizontal"||u==="vertical"&&o==="center")&&c!=="middle"&&Ee(e[c]))return ys(ys({},e),{},{[c]:e[c]+(i||0)})}return e},Zn=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",_A=(e,t,r,n)=>{if(n)return e.map(u=>u.coordinate);var i,o,c=e.map(u=>(u.coordinate===t&&(i=!0),u.coordinate===r&&(o=!0),u.coordinate));return i||c.push(t),o||c.push(r),c},MA=(e,t,r)=>{if(!e)return null;var n=e.duplicateDomain,i=e.type,o=e.range,c=e.scale,u=e.realScaleType,f=e.isCategorical,h=e.categoricalDomain,m=e.tickCount,p=e.ticks,v=e.niceTicks,b=e.axisType;if(!c)return null;var S=u==="scaleBand"&&c.bandwidth?c.bandwidth()/2:2,w=i==="category"&&c.bandwidth?c.bandwidth()/S:0;if(w=b==="angleAxis"&&o&&o.length>=2?en(o[0]-o[1])*2*w:w,p||v){var k=(p||v||[]).map((N,E)=>{var A=n?n.indexOf(N):N,C=c.map(A);return He(C)?{coordinate:C+w,value:N,offset:w,index:E}:null}).filter(Cr);return k}return f&&h?h.map((N,E)=>{var A=c.map(N);return He(A)?{coordinate:A+w,value:N,index:E,offset:w}:null}).filter(Cr):c.ticks&&m!=null?c.ticks(m).map((N,E)=>{var A=c.map(N);return He(A)?{coordinate:A+w,value:N,index:E,offset:w}:null}).filter(Cr):c.domain().map((N,E)=>{var A=c.map(N);return He(A)?{coordinate:A+w,value:n?n[N]:N,index:E,offset:w}:null}).filter(Cr)},Sz=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var i=0;i=0?(h[0]=o,o+=v,h[1]=o):(h[0]=c,c+=v,h[1]=c)}}}},Nz=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var i=0;i=0?(f[0]=o,o+=h,f[1]=o):(f[0]=0,f[1]=0)}}}},Ez={sign:Sz,expand:UL,none:bo,silhouette:WL,wiggle:HL,positive:Nz},Az=(e,t,r)=>{var n,i=(n=Ez[r])!==null&&n!==void 0?n:bo,o=BL().keys(t).value((u,f)=>Number(Ft(u,f,0))).order(Tv).offset(i),c=o(e);return c.forEach((u,f)=>{u.forEach((h,m)=>{var p=Ft(e[m],t[f],0);Array.isArray(p)&&p.length===2&&Ee(p[0])&&Ee(p[1])&&(h[0]=p[0],h[1]=p[1])})}),c};function Cz(e){return e==null?void 0:String(e)}function tj(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,o=e.index,c=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Xt(i[t.dataKey])){var u=$E(r,"value",i[t.dataKey]);if(u)return u.coordinate+n/2}return r!=null&&r[o]?r[o].coordinate+n/2:null}var f=Ft(i,Xt(c)?t.dataKey:c),h=t.scale.map(f);return Ee(h)?h:null}var Pz=e=>{var t=e.flat(2).filter(Ee);return[Math.min(...t),Math.max(...t)]},Oz=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],_z=(e,t,r)=>{if(!(e==null||Object.keys(e).length===0))return Oz(Object.keys(e).reduce((n,i)=>{var o=e[i];if(!o)return n;var c=o.stackedData,u=c.reduce((f,h)=>{var m=OA(h,t,r),p=Pz(m);return!He(p[0])||!He(p[1])?f:[Math.min(f[0],p[0]),Math.max(f[1],p[1])]},[1/0,-1/0]);return[Math.min(u[0],n[0]),Math.max(u[1],n[1])]},[1/0,-1/0]))},rj=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,nj=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Mf=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var i=Eh(t,m=>m.coordinate),o=1/0,c=1,u=i.length;c{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},Iz=(e,t)=>t==="centric"?e.angle:e.radius,Ai=e=>e.layout.width,Ci=e=>e.layout.height,Tz=e=>e.layout.scale,TA=e=>e.layout.margin,Lh=Q(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),$h=Q(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),Dz="data-recharts-item-index",Rz="data-recharts-item-id",ou=60;function aj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Kd(e){for(var t=1;te.brush.height;function Bz(e){var t=$h(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:ou;return r+i}return r},0)}function Uz(e){var t=$h(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:ou;return r+i}return r},0)}function Wz(e){var t=Lh(e);return t.reduce((r,n)=>n.orientation==="top"&&!n.mirror&&!n.hide?r+n.height:r,0)}function Hz(e){var t=Lh(e);return t.reduce((r,n)=>n.orientation==="bottom"&&!n.mirror&&!n.hide?r+n.height:r,0)}var er=Q([Ai,Ci,TA,Fz,Bz,Uz,Wz,Hz,eA,d6],(e,t,r,n,i,o,c,u,f,h)=>{var m={left:(r.left||0)+i,right:(r.right||0)+o},p={top:(r.top||0)+c,bottom:(r.bottom||0)+u},v=Kd(Kd({},p),m),b=v.bottom;v.bottom+=n,v=jz(v,f,h);var S=e-v.left-v.right,w=t-v.top-v.bottom;return Kd(Kd({brushBottom:b},v),{},{width:Math.max(S,0),height:Math.max(w,0)})}),Kz=Q(er,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),DA=Q(Ai,Ci,(e,t)=>({x:0,y:0,width:e,height:t})),Gz=x.createContext(null),Or=()=>x.useContext(Gz)!=null,zh=e=>e.brush,Fh=Q([zh,er,TA],(e,t,r)=>({height:e.height,x:Ee(e.x)?e.x:t.left,y:Ee(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:Ee(e.width)?e.width:t.width}));function Vz(e,t,{signal:r,edges:n}={}){let i,o=null;const c=n!=null&&n.includes("leading"),u=n==null||n.includes("trailing"),f=()=>{o!==null&&(e.apply(i,o),i=void 0,o=null)},h=()=>{u&&f(),b()};let m=null;const p=()=>{m!=null&&clearTimeout(m),m=setTimeout(()=>{m=null,h()},t)},v=()=>{m!==null&&(clearTimeout(m),m=null)},b=()=>{v(),i=void 0,o=null},S=()=>{f()},w=function(...k){if(r!=null&&r.aborted)return;i=this,o=k;const N=m==null;p(),c&&N&&f()};return w.schedule=p,w.cancel=b,w.flush=S,r==null||r.addEventListener("abort",b,{once:!0}),w}function qz(e,t=0,r={}){typeof r!="object"&&(r={});const{leading:n=!1,trailing:i=!0,maxWait:o}=r,c=Array(2);n&&(c[0]="leading"),i&&(c[1]="trailing");let u,f=null;const h=Vz(function(...v){u=e.apply(this,v),f=null},t,{edges:c}),m=function(...v){return o!=null&&(f===null&&(f=Date.now()),Date.now()-f>=o)?(u=e.apply(this,v),f=Date.now(),h.cancel(),h.schedule(),u):(h.apply(this,v),u)},p=()=>(h.flush(),u);return m.cancel=h.cancel,m.flush=p,m}function Qz(e,t=0,r={}){const{leading:n=!0,trailing:i=!0}=r;return qz(e,t,{leading:n,maxWait:t,trailing:i})}var If=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;oi[c++]))}},Un={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},RA=(e,t,r)=>{var n=r.width,i=n===void 0?Un.width:n,o=r.height,c=o===void 0?Un.height:o,u=r.aspect,f=r.maxHeight,h=wo(i)?e:Number(i),m=wo(c)?t:Number(c);return u&&u>0&&(h?m=h/u:m&&(h=m*u),f&&m!=null&&m>f&&(m=f)),{calculatedWidth:h,calculatedHeight:m}},Yz={width:0,height:0,overflow:"visible"},Zz={width:0,overflowX:"visible"},Xz={height:0,overflowY:"visible"},Jz={},e8=e=>{var t=e.width,r=e.height,n=wo(t),i=wo(r);return n&&i?Yz:n?Zz:i?Xz:Jz};function t8(e){var t=e.width,r=e.height,n=e.aspect,i=t,o=r;return i===void 0&&o===void 0?(i=Un.width,o=Un.height):i===void 0?i=n&&n>0?void 0:Un.width:o===void 0&&(o=n&&n>0?void 0:Un.height),{width:i,height:o}}var r8=["aspect","initialDimension","width","height","minWidth","minHeight","maxHeight","children","debounce","id","className","onResize","style"];function Tf(){return Tf=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r({width:r,height:n}),[r,n]);return h8(i)?x.createElement(LA.Provider,{value:i},t):null}var l0=()=>x.useContext(LA),m8=x.forwardRef((e,t)=>{var r=e.aspect,n=e.initialDimension,i=n===void 0?Un.initialDimension:n,o=e.width,c=e.height,u=e.minWidth,f=u===void 0?Un.minWidth:u,h=e.minHeight,m=e.maxHeight,p=e.children,v=e.debounce,b=v===void 0?Un.debounce:v,S=e.id,w=e.className,k=e.onResize,N=e.style,E=N===void 0?{}:N,A=d8(e,r8),C=x.useRef(null),_=x.useRef();_.current=k,x.useImperativeHandle(t,()=>C.current);var O=x.useState({containerWidth:i.width,containerHeight:i.height}),D=o8(O,2),B=D[0],z=D[1],$=x.useCallback((oe,le)=>{z(Z=>{var ie=Math.round(oe),te=Math.round(le);return Z.containerWidth===ie&&Z.containerHeight===te?Z:{containerWidth:ie,containerHeight:te}})},[]);x.useEffect(()=>{if(C.current==null||typeof ResizeObserver>"u")return rl;var oe=I=>{var M,U=I[0];if(U!=null){var ne=U.contentRect,ee=ne.width,X=ne.height;$(ee,X),(M=_.current)===null||M===void 0||M.call(_,ee,X)}};b>0&&(oe=Qz(oe,b,{trailing:!0,leading:!1}));var le=new ResizeObserver(oe),Z=C.current.getBoundingClientRect(),ie=Z.width,te=Z.height;return $(ie,te),le.observe(C.current),()=>{le.disconnect()}},[$,b]);var K=B.containerWidth,W=B.containerHeight;If(!r||r>0,"The aspect(%s) must be greater than zero.",r);var ve=RA(K,W,{width:o,height:c,aspect:r,maxHeight:m}),ue=ve.calculatedWidth,pe=ve.calculatedHeight;return If(K<0||W<0||ue!=null&&ue>0||pe!=null&&pe>0,`The width(%s) and height(%s) of chart should be greater than 0, + */var Mk;function H$(){if(Mk)return wg;Mk=1;var e=Xs(),t=W$();function r(h,m){return h===m&&(h!==0||1/h===1/m)||h!==h&&m!==m}var n=typeof Object.is=="function"?Object.is:r,i=t.useSyncExternalStore,o=e.useRef,c=e.useEffect,u=e.useMemo,f=e.useDebugValue;return wg.useSyncExternalStoreWithSelector=function(h,m,p,v,b){var S=o(null);if(S.current===null){var w={hasValue:!1,value:null};S.current=w}else w=S.current;S=u(function(){function N(O){if(!E){if(E=!0,A=O,O=v(O),b!==void 0&&w.hasValue){var D=w.value;if(b(D,O))return C=D}return C=O}if(D=C,n(A,O))return D;var B=v(O);return b!==void 0&&b(D,B)?(A=O,D):(A=O,C=B)}var E=!1,A,C,_=p===void 0?null:p;return[function(){return N(m())},_===null?void 0:function(){return N(_())}]},[m,p,v,b]);var k=i(h,S[0],S[1]);return c(function(){w.hasValue=!0,w.value=k},[k]),f(k),k},wg}var Ik;function K$(){return Ik||(Ik=1,bg.exports=H$()),bg.exports}var G$=K$(),r0=x.createContext(null),V$=e=>e,At=()=>{var e=x.useContext(r0);return e?e.store.dispatch:V$},of=()=>{},q$=()=>of,Q$=(e,t)=>e===t;function Me(e){var t=x.useContext(r0),r=x.useMemo(()=>t?n=>{if(n!=null)return e(n)}:of,[t,e]);return G$.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:q$,t?t.store.getState:of,t?t.store.getState:of,r,Q$)}function Y$(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Z$(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var Tk=e=>Array.isArray(e)?e:[e];function X$(e){const t=Array.isArray(e[0])?e[0]:e;return Z$(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function J$(e,t){const r=[],{length:n}=e;for(let i=0;itypeof WeakRef>"u"?e6:WeakRef,XE=t6(),r6=0,Dk=1;function Bd(){return{s:r6,v:void 0,o:null,p:null}}function n6(e){return e instanceof XE?e.deref():e}function JE(e,t={}){let r=Bd();const{resultEqualityCheck:n}=t;let i,o=0;function c(){let u=r;const{length:f}=arguments;for(let p=0,v=f;p{r=Bd(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}function i6(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let o=0,c=0,u,f={},h=i.pop();typeof h=="object"&&(f=h,h=i.pop()),Y$(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const m={...r,...f},{memoize:p,memoizeOptions:v=[],argsMemoize:b=JE,argsMemoizeOptions:S=[]}=m,w=Tk(v),k=Tk(S),N=X$(i),E=p(function(){return o++,h.apply(null,arguments)},...w),A=b(function(){c++;const _=J$(N,arguments);return u=E.apply(null,_),u},...k);return Object.assign(A,{resultFunc:h,memoizedResultFunc:E,dependencies:N,dependencyRecomputations:()=>c,resetDependencyRecomputations:()=>{c=0},lastResult:()=>u,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:p,argsMemoize:b})};return Object.assign(n,{withTypes:()=>n}),n}var Q=i6(JE);function a6(e,t=1){const r=[],n=Math.floor(t),i=(o,c)=>{for(let u=0;u{if(e!==t){const n=Lk(e),i=Lk(t);if(n===i&&n===0){if(et)return r==="desc"?-1:1}return r==="desc"?i-n:n-i}return 0};function eA(e){return typeof e=="symbol"||e instanceof Symbol}const s6=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,l6=/^\w*$/;function c6(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||eA(e)?!0:typeof e=="string"&&(l6.test(e)||!s6.test(e))||t!=null}function u6(e,t,r,n){if(e==null)return[];r=r,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(r)||(r=r==null?[]:[r]),r=r.map(u=>String(u));const i=(u,f)=>{let h=u;for(let m=0;mf==null||u==null?f:typeof u=="object"&&"key"in u?Object.hasOwn(f,u.key)?f[u.key]:i(f,u.path):typeof u=="function"?u(f):Array.isArray(u)?i(f,u):typeof f=="object"?f[u]:f,c=t.map(u=>(Array.isArray(u)&&u.length===1&&(u=u[0]),u==null||typeof u=="function"||Array.isArray(u)||c6(u)?u:{key:u,path:Xx(u)}));return e.map(u=>({original:u,criteria:c.map(f=>o(f,u))})).slice().sort((u,f)=>{for(let h=0;hu.original)}function Eh(e,...t){const r=t.length;return r>1&&zv(e,t[0],t[1])?t=[]:r>2&&zv(t[0],t[1],t[2])&&(t=[t[0]]),u6(e,a6(t),["asc"])}var tA=e=>e.legend.settings,d6=e=>e.legend.size,f6=e=>e.legend.payload;Q([f6,tA],(e,t)=>{var r=t.itemSorter,n=e.flat(1);return r?Eh(n,r):n});function h6(e,t){return v6(e)||g6(e,t)||p6(e,t)||m6()}function m6(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p6(e,t){if(e){if(typeof e=="string")return Rk(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Rk(e,t):void 0}}function Rk(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);rUd||Math.abs(e.left-t.left)>Ud||Math.abs(e.top-t.top)>Ud||Math.abs(e.width-t.width)>Ud}function zk(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function x6(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=x.useState({height:0,left:0,top:0,width:0}),r=h6(t,2),n=r[0],i=r[1],o=x.useRef(null),c=x.useRef(n);c.current=n;var u=x.useCallback(f=>{if(o.current!=null&&(o.current.disconnect(),o.current=null),f!=null){var h=zk(f);if($k(h,c.current)&&i(h),typeof ResizeObserver<"u"){var m=new ResizeObserver(()=>{var p=zk(f);$k(p,c.current)&&i(p)});m.observe(f),o.current=m}}},[...e]);return x.useEffect(()=>()=>{var f;(f=o.current)===null||f===void 0||f.disconnect()},[]),[n,u]}function Vt(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var y6=typeof Symbol=="function"&&Symbol.observable||"@@observable",Fk=y6,Sg=()=>Math.random().toString(36).substring(7).split("").join("."),b6={INIT:`@@redux/INIT${Sg()}`,REPLACE:`@@redux/REPLACE${Sg()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Sg()}`},kf=b6;function n0(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function rA(e,t,r){if(typeof e!="function")throw new Error(Vt(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Vt(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Vt(1));return r(rA)(e,t)}let n=e,i=t,o=new Map,c=o,u=0,f=!1;function h(){c===o&&(c=new Map,o.forEach((k,N)=>{c.set(N,k)}))}function m(){if(f)throw new Error(Vt(3));return i}function p(k){if(typeof k!="function")throw new Error(Vt(4));if(f)throw new Error(Vt(5));let N=!0;h();const E=u++;return c.set(E,k),function(){if(N){if(f)throw new Error(Vt(6));N=!1,h(),c.delete(E),o=null}}}function v(k){if(!n0(k))throw new Error(Vt(7));if(typeof k.type>"u")throw new Error(Vt(8));if(typeof k.type!="string")throw new Error(Vt(17));if(f)throw new Error(Vt(9));try{f=!0,i=n(i,k)}finally{f=!1}return(o=c).forEach(E=>{E()}),k}function b(k){if(typeof k!="function")throw new Error(Vt(10));n=k,v({type:kf.REPLACE})}function S(){const k=p;return{subscribe(N){if(typeof N!="object"||N===null)throw new Error(Vt(11));function E(){const C=N;C.next&&C.next(m())}return E(),{unsubscribe:k(E)}},[Fk](){return this}}}return v({type:kf.INIT}),{dispatch:v,subscribe:p,getState:m,replaceReducer:b,[Fk]:S}}function w6(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:kf.INIT})>"u")throw new Error(Vt(12));if(typeof r(void 0,{type:kf.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Vt(13))})}function nA(e){const t=Object.keys(e),r={};for(let o=0;o"u")throw u&&u.type,new Error(Vt(14));h[p]=S,f=f||S!==b}return f=f||n.length!==Object.keys(c).length,f?h:c}}function jf(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function k6(...e){return t=>(r,n)=>{const i=t(r,n);let o=()=>{throw new Error(Vt(15))};const c={getState:i.getState,dispatch:(f,...h)=>o(f,...h)},u=e.map(f=>f(c));return o=jf(...u)(i.dispatch),{...i,dispatch:o}}}function iA(e){return n0(e)&&"type"in e&&typeof e.type=="string"}var aA=Symbol.for("immer-nothing"),Bk=Symbol.for("immer-draftable"),xr=Symbol.for("immer-state");function bn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var zr=Object,Ws=zr.getPrototypeOf,Sf="constructor",Ah="prototype",Fv="configurable",Nf="enumerable",sf="writable",Tc="value",ki=e=>!!e&&!!e[xr];function Nn(e){var t;return e?oA(e)||Ph(e)||!!e[Bk]||!!((t=e[Sf])!=null&&t[Bk])||Oh(e)||_h(e):!1}var j6=zr[Ah][Sf].toString(),Uk=new WeakMap;function oA(e){if(!e||!i0(e))return!1;const t=Ws(e);if(t===null||t===zr[Ah])return!0;const r=zr.hasOwnProperty.call(t,Sf)&&t[Sf];if(r===Object)return!0;if(!xs(r))return!1;let n=Uk.get(r);return n===void 0&&(n=Function.toString.call(r),Uk.set(r,n)),n===j6}function Ch(e,t,r=!0){au(e)===0?(r?Reflect.ownKeys(e):zr.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((n,i)=>t(i,n,e))}function au(e){const t=e[xr];return t?t.type_:Ph(e)?1:Oh(e)?2:_h(e)?3:0}var Wk=(e,t,r=au(e))=>r===2?e.has(t):zr[Ah].hasOwnProperty.call(e,t),Bv=(e,t,r=au(e))=>r===2?e.get(t):e[t],Ef=(e,t,r,n=au(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function S6(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Ph=Array.isArray,Oh=e=>e instanceof Map,_h=e=>e instanceof Set,i0=e=>typeof e=="object",xs=e=>typeof e=="function",Ng=e=>typeof e=="boolean";function N6(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ci=e=>e.copy_||e.base_,a0=e=>e.modified_?e.copy_:e.base_;function Uv(e,t){if(Oh(e))return new Map(e);if(_h(e))return new Set(e);if(Ph(e))return Array[Ah].slice.call(e);const r=oA(e);if(t===!0||t==="class_only"&&!r){const n=zr.getOwnPropertyDescriptors(e);delete n[xr];let i=Reflect.ownKeys(n);for(let o=0;o1&&zr.defineProperties(e,{set:Wd,add:Wd,clear:Wd,delete:Wd}),zr.freeze(e),t&&Ch(e,(r,n)=>{o0(n,!0)},!1)),e}function E6(){bn(2)}var Wd={[Tc]:E6};function Mh(e){return e===null||!i0(e)?!0:zr.isFrozen(e)}var Af="MapSet",Wv="Patches",Hk="ArrayMethods",sA={};function ko(e){const t=sA[e];return t||bn(0,e),t}var Kk=e=>!!sA[e],Dc,lA=()=>Dc,A6=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Kk(Af)?ko(Af):void 0,arrayMethodsPlugin_:Kk(Hk)?ko(Hk):void 0});function Gk(e,t){t&&(e.patchPlugin_=ko(Wv),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Hv(e){Kv(e),e.drafts_.forEach(C6),e.drafts_=null}function Kv(e){e===Dc&&(Dc=e.parent_)}var Vk=e=>Dc=A6(Dc,e);function C6(e){const t=e[xr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function qk(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[xr].modified_&&(Hv(t),bn(4)),Nn(e)&&(e=Qk(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(r[xr].base_,e,t)}else e=Qk(t,r);return P6(t,e,!0),Hv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==aA?e:void 0}function Qk(e,t){if(Mh(t))return t;const r=t[xr];if(!r)return Cf(t,e.handledSet_,e);if(!Ih(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);dA(r,e)}return r.copy_}function P6(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&o0(t,r)}function cA(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Ih=(e,t)=>e.scope_===t,O6=[];function uA(e,t,r,n){const i=ci(e),o=e.type_;if(n!==void 0&&Bv(i,n,o)===t){Ef(i,n,r,o);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;Ch(i,(f,h)=>{if(ki(h)){const m=u.get(h)||[];m.push(f),u.set(h,m)}})}const c=e.draftLocations_.get(t)??O6;for(const u of c)Ef(i,u,r,o)}function _6(e,t,r){e.callbacks_.push(function(i){var u;const o=t;if(!o||!Ih(o,i))return;(u=i.mapSetPlugin_)==null||u.fixSetContents(o);const c=a0(o);uA(e,o.draft_??o,c,r),dA(o,i)})}function dA(e,t){var n;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((n=e.assigned_)==null?void 0:n.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const o=i.getPath(e);o&&i.generatePatches_(e,o,t)}cA(e)}}function M6(e,t,r){const{scope_:n}=e;if(ki(r)){const i=r[xr];Ih(i,n)&&i.callbacks_.push(function(){lf(e);const c=a0(i);uA(e,r,c,t)})}else Nn(r)&&e.callbacks_.push(function(){const o=ci(e);e.type_===3?o.has(r)&&Cf(r,n.handledSet_,n):Bv(o,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Cf(Bv(e.copy_,t,e.type_),n.handledSet_,n)})}function Cf(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||ki(e)||t.has(e)||!Nn(e)||Mh(e)||(t.add(e),Ch(e,(n,i)=>{if(ki(i)){const o=i[xr];if(Ih(o,r)){const c=a0(o);Ef(e,n,c,e.type_),cA(o)}}else Nn(i)&&Cf(i,t,r)})),e}function I6(e,t){const r=Ph(e),n={type_:r?1:0,scope_:t?t.scope_:lA(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=n,o=Pf;r&&(i=[n],o=Lc);const{revoke:c,proxy:u}=Proxy.revocable(i,o);return n.draft_=u,n.revoke_=c,[u,n]}var Pf={get(e,t){if(t===xr)return e;let r=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof t=="string";if(n&&r!=null&&r.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const i=ci(e);if(!Wk(i,t,e.type_))return T6(e,i,t);const o=i[t];if(e.finalized_||!Nn(o)||n&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&N6(t))return o;if(o===Eg(e.base_,t)){lf(e);const c=e.type_===1?+t:t,u=Vv(e.scope_,o,e,c);return e.copy_[c]=u}return o},has(e,t){return t in ci(e)},ownKeys(e){return Reflect.ownKeys(ci(e))},set(e,t,r){const n=fA(ci(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=Eg(ci(e),t),o=i==null?void 0:i[xr];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(S6(r,i)&&(r!==void 0||Wk(e.base_,t,e.type_)))return!0;lf(e),Gv(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),M6(e,t,r)),!0},deleteProperty(e,t){return lf(e),Eg(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Gv(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=ci(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[sf]:!0,[Fv]:e.type_!==1||t!=="length",[Nf]:n[Nf],[Tc]:r[t]}},defineProperty(){bn(11)},getPrototypeOf(e){return Ws(e.base_)},setPrototypeOf(){bn(12)}},Lc={};for(let e in Pf){let t=Pf[e];Lc[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Lc.deleteProperty=function(e,t){return Lc.set.call(this,e,t,void 0)};Lc.set=function(e,t,r){return Pf.set.call(this,e[0],t,r,e[0])};function Eg(e,t){const r=e[xr];return(r?ci(r):e)[t]}function T6(e,t,r){var i;const n=fA(t,r);return n?Tc in n?n[Tc]:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function fA(e,t){if(!(t in e))return;let r=Ws(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Ws(r)}}function Gv(e){e.modified_||(e.modified_=!0,e.parent_&&Gv(e.parent_))}function lf(e){e.copy_||(e.assigned_=new Map,e.copy_=Uv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var D6=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,n,i)=>{if(xs(r)&&!xs(n)){const c=n;n=r;const u=this;return function(h=c,...m){return u.produce(h,p=>n.call(this,p,...m))}}xs(n)||bn(6),i!==void 0&&!xs(i)&&bn(7);let o;if(Nn(r)){const c=Vk(this),u=Vv(c,r,void 0);let f=!0;try{o=n(u),f=!1}finally{f?Hv(c):Kv(c)}return Gk(c,i),qk(o,c)}else if(!r||!i0(r)){if(o=n(r),o===void 0&&(o=r),o===aA&&(o=void 0),this.autoFreeze_&&o0(o,!0),i){const c=[],u=[];ko(Wv).generateReplacementPatches_(r,o,{patches_:c,inversePatches_:u}),i(c,u)}return o}else bn(1,r)},this.produceWithPatches=(r,n)=>{if(xs(r))return(u,...f)=>this.produceWithPatches(u,h=>r(h,...f));let i,o;return[this.produce(r,n,(u,f)=>{i=u,o=f}),i,o]},Ng(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Ng(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Ng(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Nn(t)||bn(8),ki(t)&&(t=tn(t));const r=Vk(this),n=Vv(r,t,void 0);return n[xr].isManual_=!0,Kv(r),n}finishDraft(t,r){const n=t&&t[xr];(!n||!n.isManual_)&&bn(9);const{scope_:i}=n;return Gk(i,r),qk(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,r){let n;for(n=r.length-1;n>=0;n--){const o=r[n];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}n>-1&&(r=r.slice(n+1));const i=ko(Wv).applyPatches_;return ki(t)?i(t,r):this.produce(t,o=>i(o,r))}};function Vv(e,t,r,n){const[i,o]=Oh(t)?ko(Af).proxyMap_(t,r):_h(t)?ko(Af).proxySet_(t,r):I6(t,r);return((r==null?void 0:r.scope_)??lA()).drafts_.push(i),o.callbacks_=(r==null?void 0:r.callbacks_)??[],o.key_=n,r&&n!==void 0?_6(r,o,n):o.callbacks_.push(function(f){var m;(m=f.mapSetPlugin_)==null||m.fixSetContents(o);const{patchPlugin_:h}=f;o.modified_&&h&&h.generatePatches_(o,[],f)}),i}function tn(e){return ki(e)||bn(10,e),hA(e)}function hA(e){if(!Nn(e)||Mh(e))return e;const t=e[xr];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Uv(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Uv(e,!0);return Ch(r,(i,o)=>{Ef(r,i,hA(o))},n),t&&(t.finalized_=!1),r}var L6=new D6,mA=L6.produce;function pA(e){return({dispatch:r,getState:n})=>i=>o=>typeof o=="function"?o(r,n,e):i(o)}var R6=pA(),$6=pA,z6=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?jf:jf.apply(null,arguments)};function Br(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(Fr(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>iA(n)&&n.type===e,r}var gA=class gc extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,gc.prototype)}static get[Symbol.species](){return gc}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new gc(...t[0].concat(this)):new gc(...t.concat(this))}};function Yk(e){return Nn(e)?mA(e,()=>{}):e}function Hd(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function F6(e){return typeof e=="boolean"}var B6=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let c=new gA;return r&&(F6(r)?c.push(R6):c.push($6(r.extraArgument))),c},vA="RTK_autoBatch",lt=()=>e=>({payload:e,meta:{[vA]:!0}}),Zk=e=>t=>{setTimeout(t,e)},U6=(e,t)=>r=>{let n=!1;const i=()=>{n||(n=!0,cancelAnimationFrame(o),clearTimeout(c),r())},o=e(i),c=setTimeout(i,t)},xA=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let i=!0,o=!1,c=!1;const u=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?U6(window.requestAnimationFrame,100):Zk(10):e.type==="callback"?e.queueNotification:Zk(e.timeout),h=()=>{c=!1,o&&(o=!1,u.forEach(m=>m()))};return Object.assign({},n,{subscribe(m){const p=()=>i&&m(),v=n.subscribe(p);return u.add(m),()=>{v(),u.delete(m)}},dispatch(m){var p;try{return i=!((p=m==null?void 0:m.meta)!=null&&p[vA]),o=!i,o&&(c||(c=!0,f(h))),n.dispatch(m)}finally{i=!0}}})},W6=e=>function(r){const{autoBatch:n=!0}=r??{};let i=new gA(e);return n&&i.push(xA(typeof n=="object"?n:void 0)),i};function H6(e){const t=B6(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:o=void 0,enhancers:c=void 0}=e||{};let u;if(typeof r=="function")u=r;else if(n0(r))u=nA(r);else throw new Error(Fr(1));let f;typeof n=="function"?f=n(t):f=t();let h=jf;i&&(h=z6({trace:!1,...typeof i=="object"&&i}));const m=k6(...f),p=W6(m);let v=typeof c=="function"?c(p):p();const b=h(...v);return rA(u,o,b)}function yA(e){const t={},r=[];let n;const i={addCase(o,c){const u=typeof o=="string"?o:o.type;if(!u)throw new Error(Fr(28));if(u in t)throw new Error(Fr(29));return t[u]=c,i},addAsyncThunk(o,c){return c.pending&&(t[o.pending.type]=c.pending),c.rejected&&(t[o.rejected.type]=c.rejected),c.fulfilled&&(t[o.fulfilled.type]=c.fulfilled),c.settled&&r.push({matcher:o.settled,reducer:c.settled}),i},addMatcher(o,c){return r.push({matcher:o,reducer:c}),i},addDefaultCase(o){return n=o,i}};return e(i),[t,r,n]}function K6(e){return typeof e=="function"}function G6(e,t){let[r,n,i]=yA(t),o;if(K6(e))o=()=>Yk(e());else{const u=Yk(e);o=()=>u}function c(u=o(),f){let h=[r[f.type],...n.filter(({matcher:m})=>m(f)).map(({reducer:m})=>m)];return h.filter(m=>!!m).length===0&&(h=[i]),h.reduce((m,p)=>{if(p)if(ki(m)){const b=p(m,f);return b===void 0?m:b}else{if(Nn(m))return mA(m,v=>p(v,f));{const v=p(m,f);if(v===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}}return m},u)}return c.getInitialState=o,c}var V6="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",q6=(e=21)=>{let t="",r=e;for(;r--;)t+=V6[Math.random()*64|0];return t},Q6=Symbol.for("rtk-slice-createasyncthunk");function Y6(e,t){return`${e}/${t}`}function Z6({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[Q6];return function(i){const{name:o,reducerPath:c=o}=i;if(!o)throw new Error(Fr(11));const u=(typeof i.reducers=="function"?i.reducers(J6()):i.reducers)||{},f=Object.keys(u),h={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(C,_){const O=typeof C=="string"?C:C.type;if(!O)throw new Error(Fr(12));if(O in h.sliceCaseReducersByType)throw new Error(Fr(13));return h.sliceCaseReducersByType[O]=_,m},addMatcher(C,_){return h.sliceMatchers.push({matcher:C,reducer:_}),m},exposeAction(C,_){return h.actionCreators[C]=_,m},exposeCaseReducer(C,_){return h.sliceCaseReducersByName[C]=_,m}};f.forEach(C=>{const _=u[C],O={reducerName:C,type:Y6(o,C),createNotation:typeof i.reducers=="function"};tz(_)?nz(O,_,m,t):ez(O,_,m)});function p(){const[C={},_=[],O=void 0]=typeof i.extraReducers=="function"?yA(i.extraReducers):[i.extraReducers],D={...C,...h.sliceCaseReducersByType};return G6(i.initialState,B=>{for(let z in D)B.addCase(z,D[z]);for(let z of h.sliceMatchers)B.addMatcher(z.matcher,z.reducer);for(let z of _)B.addMatcher(z.matcher,z.reducer);O&&B.addDefaultCase(O)})}const v=C=>C,b=new Map,S=new WeakMap;let w;function k(C,_){return w||(w=p()),w(C,_)}function N(){return w||(w=p()),w.getInitialState()}function E(C,_=!1){function O(B){let z=B[C];return typeof z>"u"&&_&&(z=Hd(S,O,N)),z}function D(B=v){const z=Hd(b,_,()=>new WeakMap);return Hd(z,B,()=>{const $={};for(const[K,W]of Object.entries(i.selectors??{}))$[K]=X6(W,B,()=>Hd(S,B,N),_);return $})}return{reducerPath:C,getSelectors:D,get selectors(){return D(O)},selectSlice:O}}const A={name:o,reducer:k,actions:h.actionCreators,caseReducers:h.sliceCaseReducersByName,getInitialState:N,...E(c),injectInto(C,{reducerPath:_,...O}={}){const D=_??c;return C.inject({reducerPath:D,reducer:k},O),{...A,...E(D,!0)}}};return A}}function X6(e,t,r,n){function i(o,...c){let u=t(o);return typeof u>"u"&&n&&(u=r()),e(u,...c)}return i.unwrapped=e,i}var ur=Z6();function J6(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function ez({type:e,reducerName:t,createNotation:r},n,i){let o,c;if("reducer"in n){if(r&&!rz(n))throw new Error(Fr(17));o=n.reducer,c=n.prepare}else o=n;i.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,c?Br(e,c):Br(e))}function tz(e){return e._reducerDefinitionType==="asyncThunk"}function rz(e){return e._reducerDefinitionType==="reducerWithPrepare"}function nz({type:e,reducerName:t},r,n,i){if(!i)throw new Error(Fr(18));const{payloadCreator:o,fulfilled:c,pending:u,rejected:f,settled:h,options:m}=r,p=i(e,o,m);n.exposeAction(t,p),c&&n.addCase(p.fulfilled,c),u&&n.addCase(p.pending,u),f&&n.addCase(p.rejected,f),h&&n.addMatcher(p.settled,h),n.exposeCaseReducer(t,{fulfilled:c||Kd,pending:u||Kd,rejected:f||Kd,settled:h||Kd})}function Kd(){}var iz="task",bA="listener",wA="completed",s0="cancelled",az=`task-${s0}`,oz=`task-${wA}`,qv=`${bA}-${s0}`,sz=`${bA}-${wA}`,Th=class{constructor(e){is(this,"code");is(this,"name","TaskAbortError");is(this,"message");this.code=e,this.message=`${iz} ${s0} (reason: ${e})`}},l0=(e,t)=>{if(typeof e!="function")throw new TypeError(Fr(32))},Of=()=>{},kA=(e,t=Of)=>(e.catch(t),e),jA=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),go=e=>{if(e.aborted)throw new Th(e.reason)};function SA(e,t){let r=Of;return new Promise((n,i)=>{const o=()=>i(new Th(e.reason));if(e.aborted){o();return}r=jA(e,o),t.finally(()=>r()).then(n,i)}).finally(()=>{r=Of})}var lz=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof Th?"cancelled":"rejected",error:r}}finally{t==null||t()}},_f=e=>t=>kA(SA(e,t).then(r=>(go(e),r))),NA=e=>{const t=_f(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:js}=Object,Xk={},Dh="listenerMiddleware",cz=(e,t)=>{const r=n=>jA(e,()=>n.abort(e.reason));return(n,i)=>{l0(n);const o=new AbortController;r(o);const c=lz(async()=>{go(e),go(o.signal);const u=await n({pause:_f(o.signal),delay:NA(o.signal),signal:o.signal});return go(o.signal),u},()=>o.abort(oz));return i!=null&&i.autoJoin&&t.push(c.catch(Of)),{result:_f(e)(c),cancel(){o.abort(az)}}}},uz=(e,t)=>{const r=async(n,i)=>{go(t);let o=()=>{};const u=[new Promise((f,h)=>{let m=e({predicate:n,effect:(p,v)=>{v.unsubscribe(),f([p,v.getState(),v.getOriginalState()])}});o=()=>{m(),h()}})];i!=null&&u.push(new Promise(f=>setTimeout(f,i,null)));try{const f=await SA(t,Promise.race(u));return go(t),f}finally{o()}};return((n,i)=>kA(r(n,i)))},EA=e=>{let{type:t,actionCreator:r,matcher:n,predicate:i,effect:o}=e;if(t)i=Br(t).match;else if(r)t=r.type,i=r.match;else if(n)i=n;else if(!i)throw new Error(Fr(21));return l0(o),{predicate:i,type:t,effect:o}},AA=js(e=>{const{type:t,predicate:r,effect:n}=EA(e);return{id:q6(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Fr(22))}}},{withTypes:()=>AA}),Jk=(e,t)=>{const{type:r,effect:n,predicate:i}=EA(t);return Array.from(e.values()).find(o=>(typeof r=="string"?o.type===r:o.predicate===i)&&o.effect===n)},Qv=e=>{e.pending.forEach(t=>{t.abort(qv)})},dz=(e,t)=>()=>{for(const r of t.keys())Qv(r);e.clear()},ej=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},CA=js(Br(`${Dh}/add`),{withTypes:()=>CA}),fz=Br(`${Dh}/removeAll`),PA=js(Br(`${Dh}/remove`),{withTypes:()=>PA}),hz=(...e)=>{console.error(`${Dh}/error`,...e)},ou=(e={})=>{const t=new Map,r=new Map,n=b=>{const S=r.get(b)??0;r.set(b,S+1)},i=b=>{const S=r.get(b)??1;S===1?r.delete(b):r.set(b,S-1)},{extra:o,onError:c=hz}=e;l0(c);const u=b=>(b.unsubscribe=()=>t.delete(b.id),t.set(b.id,b),S=>{b.unsubscribe(),S!=null&&S.cancelActive&&Qv(b)}),f=(b=>{const S=Jk(t,b)??AA(b);return u(S)});js(f,{withTypes:()=>f});const h=b=>{const S=Jk(t,b);return S&&(S.unsubscribe(),b.cancelActive&&Qv(S)),!!S};js(h,{withTypes:()=>h});const m=async(b,S,w,k)=>{const N=new AbortController,E=uz(f,N.signal),A=[];try{b.pending.add(N),n(b),await Promise.resolve(b.effect(S,js({},w,{getOriginalState:k,condition:(C,_)=>E(C,_).then(Boolean),take:E,delay:NA(N.signal),pause:_f(N.signal),extra:o,signal:N.signal,fork:cz(N.signal,A),unsubscribe:b.unsubscribe,subscribe:()=>{t.set(b.id,b)},cancelActiveListeners:()=>{b.pending.forEach((C,_,O)=>{C!==N&&(C.abort(qv),O.delete(C))})},cancel:()=>{N.abort(qv),b.pending.delete(N)},throwIfCancelled:()=>{go(N.signal)}})))}catch(C){C instanceof Th||ej(c,C,{raisedBy:"effect"})}finally{await Promise.all(A),N.abort(sz),i(b),b.pending.delete(N)}},p=dz(t,r);return{middleware:b=>S=>w=>{if(!iA(w))return S(w);if(CA.match(w))return f(w.payload);if(fz.match(w)){p();return}if(PA.match(w))return h(w.payload);let k=b.getState();const N=()=>{if(k===Xk)throw new Error(Fr(23));return k};let E;try{if(E=S(w),t.size>0){const A=b.getState(),C=Array.from(t.values());for(const _ of C){let O=!1;try{O=_.predicate(w,A,k)}catch(D){O=!1,ej(c,D,{raisedBy:"predicate"})}O&&m(_,w,b,N)}}}finally{k=Xk}return E},startListening:f,stopListening:h,clearListeners:p}};function Fr(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var mz={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},OA=ur({name:"chartLayout",initialState:mz,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var r,n,i,o;e.margin.top=(r=t.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(n=t.payload.right)!==null&&n!==void 0?n:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(o=t.payload.left)!==null&&o!==void 0?o:0},setScale(e,t){e.scale=t.payload}}}),Lh=OA.actions,pz=Lh.setMargin,gz=Lh.setLayout,vz=Lh.setChartSize,xz=Lh.setScale,yz=OA.reducer;function _A(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function He(e){return Number.isFinite(e)}function qn(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function tj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ys(e){for(var t=1;t{if(t&&r){var n=r.width,i=r.height,o=t.align,c=t.verticalAlign,u=t.layout;if((u==="vertical"||u==="horizontal"&&c==="middle")&&o!=="center"&&Ee(e[o]))return ys(ys({},e),{},{[o]:e[o]+(n||0)});if((u==="horizontal"||u==="vertical"&&o==="center")&&c!=="middle"&&Ee(e[c]))return ys(ys({},e),{},{[c]:e[c]+(i||0)})}return e},Zn=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",MA=(e,t,r,n)=>{if(n)return e.map(u=>u.coordinate);var i,o,c=e.map(u=>(u.coordinate===t&&(i=!0),u.coordinate===r&&(o=!0),u.coordinate));return i||c.push(t),o||c.push(r),c},IA=(e,t,r)=>{if(!e)return null;var n=e.duplicateDomain,i=e.type,o=e.range,c=e.scale,u=e.realScaleType,f=e.isCategorical,h=e.categoricalDomain,m=e.tickCount,p=e.ticks,v=e.niceTicks,b=e.axisType;if(!c)return null;var S=u==="scaleBand"&&c.bandwidth?c.bandwidth()/2:2,w=i==="category"&&c.bandwidth?c.bandwidth()/S:0;if(w=b==="angleAxis"&&o&&o.length>=2?en(o[0]-o[1])*2*w:w,p||v){var k=(p||v||[]).map((N,E)=>{var A=n?n.indexOf(N):N,C=c.map(A);return He(C)?{coordinate:C+w,value:N,offset:w,index:E}:null}).filter(Cr);return k}return f&&h?h.map((N,E)=>{var A=c.map(N);return He(A)?{coordinate:A+w,value:N,index:E,offset:w}:null}).filter(Cr):c.ticks&&m!=null?c.ticks(m).map((N,E)=>{var A=c.map(N);return He(A)?{coordinate:A+w,value:N,index:E,offset:w}:null}).filter(Cr):c.domain().map((N,E)=>{var A=c.map(N);return He(A)?{coordinate:A+w,value:n?n[N]:N,index:E,offset:w}:null}).filter(Cr)},Sz=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var i=0;i=0?(h[0]=o,o+=v,h[1]=o):(h[0]=c,c+=v,h[1]=c)}}}},Nz=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var i=0;i=0?(f[0]=o,o+=h,f[1]=o):(f[0]=0,f[1]=0)}}}},Ez={sign:Sz,expand:UR,none:bo,silhouette:WR,wiggle:HR,positive:Nz},Az=(e,t,r)=>{var n,i=(n=Ez[r])!==null&&n!==void 0?n:bo,o=BR().keys(t).value((u,f)=>Number(Ft(u,f,0))).order(Dv).offset(i),c=o(e);return c.forEach((u,f)=>{u.forEach((h,m)=>{var p=Ft(e[m],t[f],0);Array.isArray(p)&&p.length===2&&Ee(p[0])&&Ee(p[1])&&(h[0]=p[0],h[1]=p[1])})}),c};function Cz(e){return e==null?void 0:String(e)}function rj(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,o=e.index,c=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Xt(i[t.dataKey])){var u=zE(r,"value",i[t.dataKey]);if(u)return u.coordinate+n/2}return r!=null&&r[o]?r[o].coordinate+n/2:null}var f=Ft(i,Xt(c)?t.dataKey:c),h=t.scale.map(f);return Ee(h)?h:null}var Pz=e=>{var t=e.flat(2).filter(Ee);return[Math.min(...t),Math.max(...t)]},Oz=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],_z=(e,t,r)=>{if(!(e==null||Object.keys(e).length===0))return Oz(Object.keys(e).reduce((n,i)=>{var o=e[i];if(!o)return n;var c=o.stackedData,u=c.reduce((f,h)=>{var m=_A(h,t,r),p=Pz(m);return!He(p[0])||!He(p[1])?f:[Math.min(f[0],p[0]),Math.max(f[1],p[1])]},[1/0,-1/0]);return[Math.min(u[0],n[0]),Math.max(u[1],n[1])]},[1/0,-1/0]))},nj=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ij=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Mf=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var i=Eh(t,m=>m.coordinate),o=1/0,c=1,u=i.length;c{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},Iz=(e,t)=>t==="centric"?e.angle:e.radius,Ai=e=>e.layout.width,Ci=e=>e.layout.height,Tz=e=>e.layout.scale,DA=e=>e.layout.margin,Rh=Q(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),$h=Q(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),Dz="data-recharts-item-index",Lz="data-recharts-item-id",su=60;function oj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Gd(e){for(var t=1;te.brush.height;function Bz(e){var t=$h(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:su;return r+i}return r},0)}function Uz(e){var t=$h(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:su;return r+i}return r},0)}function Wz(e){var t=Rh(e);return t.reduce((r,n)=>n.orientation==="top"&&!n.mirror&&!n.hide?r+n.height:r,0)}function Hz(e){var t=Rh(e);return t.reduce((r,n)=>n.orientation==="bottom"&&!n.mirror&&!n.hide?r+n.height:r,0)}var er=Q([Ai,Ci,DA,Fz,Bz,Uz,Wz,Hz,tA,d6],(e,t,r,n,i,o,c,u,f,h)=>{var m={left:(r.left||0)+i,right:(r.right||0)+o},p={top:(r.top||0)+c,bottom:(r.bottom||0)+u},v=Gd(Gd({},p),m),b=v.bottom;v.bottom+=n,v=jz(v,f,h);var S=e-v.left-v.right,w=t-v.top-v.bottom;return Gd(Gd({brushBottom:b},v),{},{width:Math.max(S,0),height:Math.max(w,0)})}),Kz=Q(er,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),LA=Q(Ai,Ci,(e,t)=>({x:0,y:0,width:e,height:t})),Gz=x.createContext(null),Or=()=>x.useContext(Gz)!=null,zh=e=>e.brush,Fh=Q([zh,er,DA],(e,t,r)=>({height:e.height,x:Ee(e.x)?e.x:t.left,y:Ee(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:Ee(e.width)?e.width:t.width}));function Vz(e,t,{signal:r,edges:n}={}){let i,o=null;const c=n!=null&&n.includes("leading"),u=n==null||n.includes("trailing"),f=()=>{o!==null&&(e.apply(i,o),i=void 0,o=null)},h=()=>{u&&f(),b()};let m=null;const p=()=>{m!=null&&clearTimeout(m),m=setTimeout(()=>{m=null,h()},t)},v=()=>{m!==null&&(clearTimeout(m),m=null)},b=()=>{v(),i=void 0,o=null},S=()=>{f()},w=function(...k){if(r!=null&&r.aborted)return;i=this,o=k;const N=m==null;p(),c&&N&&f()};return w.schedule=p,w.cancel=b,w.flush=S,r==null||r.addEventListener("abort",b,{once:!0}),w}function qz(e,t=0,r={}){typeof r!="object"&&(r={});const{leading:n=!1,trailing:i=!0,maxWait:o}=r,c=Array(2);n&&(c[0]="leading"),i&&(c[1]="trailing");let u,f=null;const h=Vz(function(...v){u=e.apply(this,v),f=null},t,{edges:c}),m=function(...v){return o!=null&&(f===null&&(f=Date.now()),Date.now()-f>=o)?(u=e.apply(this,v),f=Date.now(),h.cancel(),h.schedule(),u):(h.apply(this,v),u)},p=()=>(h.flush(),u);return m.cancel=h.cancel,m.flush=p,m}function Qz(e,t=0,r={}){const{leading:n=!0,trailing:i=!0}=r;return qz(e,t,{leading:n,maxWait:t,trailing:i})}var If=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;oi[c++]))}},Un={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},RA=(e,t,r)=>{var n=r.width,i=n===void 0?Un.width:n,o=r.height,c=o===void 0?Un.height:o,u=r.aspect,f=r.maxHeight,h=wo(i)?e:Number(i),m=wo(c)?t:Number(c);return u&&u>0&&(h?m=h/u:m&&(h=m*u),f&&m!=null&&m>f&&(m=f)),{calculatedWidth:h,calculatedHeight:m}},Yz={width:0,height:0,overflow:"visible"},Zz={width:0,overflowX:"visible"},Xz={height:0,overflowY:"visible"},Jz={},e8=e=>{var t=e.width,r=e.height,n=wo(t),i=wo(r);return n&&i?Yz:n?Zz:i?Xz:Jz};function t8(e){var t=e.width,r=e.height,n=e.aspect,i=t,o=r;return i===void 0&&o===void 0?(i=Un.width,o=Un.height):i===void 0?i=n&&n>0?void 0:Un.width:o===void 0&&(o=n&&n>0?void 0:Un.height),{width:i,height:o}}var r8=["aspect","initialDimension","width","height","minWidth","minHeight","maxHeight","children","debounce","id","className","onResize","style"];function Tf(){return Tf=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r({width:r,height:n}),[r,n]);return h8(i)?x.createElement($A.Provider,{value:i},t):null}var c0=()=>x.useContext($A),m8=x.forwardRef((e,t)=>{var r=e.aspect,n=e.initialDimension,i=n===void 0?Un.initialDimension:n,o=e.width,c=e.height,u=e.minWidth,f=u===void 0?Un.minWidth:u,h=e.minHeight,m=e.maxHeight,p=e.children,v=e.debounce,b=v===void 0?Un.debounce:v,S=e.id,w=e.className,k=e.onResize,N=e.style,E=N===void 0?{}:N,A=d8(e,r8),C=x.useRef(null),_=x.useRef();_.current=k,x.useImperativeHandle(t,()=>C.current);var O=x.useState({containerWidth:i.width,containerHeight:i.height}),D=o8(O,2),B=D[0],z=D[1],$=x.useCallback((oe,le)=>{z(Z=>{var ie=Math.round(oe),te=Math.round(le);return Z.containerWidth===ie&&Z.containerHeight===te?Z:{containerWidth:ie,containerHeight:te}})},[]);x.useEffect(()=>{if(C.current==null||typeof ResizeObserver>"u")return rl;var oe=I=>{var M,U=I[0];if(U!=null){var ne=U.contentRect,ee=ne.width,X=ne.height;$(ee,X),(M=_.current)===null||M===void 0||M.call(_,ee,X)}};b>0&&(oe=Qz(oe,b,{trailing:!0,leading:!1}));var le=new ResizeObserver(oe),Z=C.current.getBoundingClientRect(),ie=Z.width,te=Z.height;return $(ie,te),le.observe(C.current),()=>{le.disconnect()}},[$,b]);var K=B.containerWidth,W=B.containerHeight;If(!r||r>0,"The aspect(%s) must be greater than zero.",r);var ve=RA(K,W,{width:o,height:c,aspect:r,maxHeight:m}),ue=ve.calculatedWidth,pe=ve.calculatedHeight;return If(K<0||W<0||ue!=null&&ue>0||pe!=null&&pe>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,ue,pe,o,c,f,h,r),x.createElement("div",Tf({id:S?"".concat(S):void 0,className:nt("recharts-responsive-container",w),style:sj(sj({},E),{},{width:o,height:c,minWidth:f,minHeight:h,maxHeight:m}),ref:C},A),x.createElement("div",{style:e8({width:o,height:c})},x.createElement($A,{width:ue,height:pe},p)))}),p8=x.forwardRef((e,t)=>{var r=l0();if(qn(r.width)&&qn(r.height))return e.children;var n=t8({width:e.width,height:e.height,aspect:e.aspect}),i=n.width,o=n.height,c=RA(void 0,void 0,{width:i,height:o,aspect:e.aspect,maxHeight:e.maxHeight}),u=c.calculatedWidth,f=c.calculatedHeight;return Ee(u)&&Ee(f)?x.createElement($A,{width:u,height:f},e.children):x.createElement(m8,Tf({},e,{width:i,height:o,ref:t}))});function c0(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var Bh=()=>{var e,t=Or(),r=Me(Kz),n=Me(Fh),i=(e=Me(zh))===null||e===void 0?void 0:e.padding;return!t||!n||!i?r:{width:n.width-i.left-i.right,height:n.height-i.top-i.bottom,x:i.left,y:i.top}},g8={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},zA=()=>{var e;return(e=Me(er))!==null&&e!==void 0?e:g8},FA=()=>Me(Ai),BA=()=>Me(Ci),ht=e=>e.layout.layoutType,nl=()=>Me(ht),u0=()=>{var e=nl();if(e==="horizontal"||e==="vertical")return e},UA=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},v8=()=>{var e=nl();return e!==void 0},su=e=>{var t=At(),r=Or(),n=e.width,i=e.height,o=l0(),c=n,u=i;return o&&(c=o.width>0?o.width:n,u=o.height>0?o.height:i),x.useEffect(()=>{!r&&qn(c)&&qn(u)&&t(vz({width:c,height:u}))},[t,r,c,u]),null},WA=Symbol.for("immer-nothing"),cj=Symbol.for("immer-draftable"),Ur=Symbol.for("immer-state");function wn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Rc=Object.getPrototypeOf;function Hs(e){return!!e&&!!e[Ur]}function jo(e){var t;return e?HA(e)||Array.isArray(e)||!!e[cj]||!!((t=e.constructor)!=null&&t[cj])||lu(e)||Wh(e):!1}var x8=Object.prototype.constructor.toString(),uj=new WeakMap;function HA(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=uj.get(r);return n===void 0&&(n=Function.toString.call(r),uj.set(r,n)),n===x8}function Df(e,t,r=!0){Uh(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((n,i)=>t(i,n,e))}function Uh(e){const t=e[Ur];return t?t.type_:Array.isArray(e)?1:lu(e)?2:Wh(e)?3:0}function Qv(e,t){return Uh(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function KA(e,t,r){const n=Uh(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function y8(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function lu(e){return e instanceof Map}function Wh(e){return e instanceof Set}function Qa(e){return e.copy_||e.base_}function Yv(e,t){if(lu(e))return new Map(e);if(Wh(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=HA(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[Ur];let i=Reflect.ownKeys(n);for(let o=0;o1&&Object.defineProperties(e,{set:Gd,add:Gd,clear:Gd,delete:Gd}),Object.freeze(e),t&&Object.values(e).forEach(r=>d0(r,!0))),e}function b8(){wn(2)}var Gd={value:b8};function Hh(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var w8={};function So(e){const t=w8[e];return t||wn(0,e),t}var Lc;function GA(){return Lc}function k8(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function dj(e,t){t&&(So("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Zv(e){Xv(e),e.drafts_.forEach(j8),e.drafts_=null}function Xv(e){e===Lc&&(Lc=e.parent_)}function fj(e){return Lc=k8(Lc,e)}function j8(e){const t=e[Ur];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function hj(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[Ur].modified_&&(Zv(t),wn(4)),jo(e)&&(e=Rf(t,e),t.parent_||Lf(t,e)),t.patches_&&So("Patches").generateReplacementPatches_(r[Ur].base_,e,t.patches_,t.inversePatches_)):e=Rf(t,r,[]),Zv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==WA?e:void 0}function Rf(e,t,r){if(Hh(t))return t;const n=e.immer_.shouldUseStrictIteration(),i=t[Ur];if(!i)return Df(t,(o,c)=>mj(e,i,t,o,c,r),n),t;if(i.scope_!==e)return t;if(!i.modified_)return Lf(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const o=i.copy_;let c=o,u=!1;i.type_===3&&(c=new Set(o),o.clear(),u=!0),Df(c,(f,h)=>mj(e,i,o,f,h,r,u),n),Lf(e,o,!1),r&&e.patches_&&So("Patches").generatePatches_(i,r,e.patches_,e.inversePatches_)}return i.copy_}function mj(e,t,r,n,i,o,c){if(i==null||typeof i!="object"&&!c)return;const u=Hh(i);if(!(u&&!c)){if(Hs(i)){const f=o&&t&&t.type_!==3&&!Qv(t.assigned_,n)?o.concat(n):void 0,h=Rf(e,i,f);if(KA(r,n,h),Hs(h))e.canAutoFreeze_=!1;else return}else c&&r.add(i);if(jo(i)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===i&&u)return;Rf(e,i),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(lu(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Lf(e,i)}}}function Lf(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&d0(t,r)}function S8(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:GA(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=n,o=f0;r&&(i=[n],o=$c);const{revoke:c,proxy:u}=Proxy.revocable(i,o);return n.draft_=u,n.revoke_=c,u}var f0={get(e,t){if(t===Ur)return e;const r=Qa(e);if(!Qv(r,t))return N8(e,r,t);const n=r[t];return e.finalized_||!jo(n)?n:n===Eg(e.base_,t)?(Ag(e),e.copy_[t]=ex(n,e)):n},has(e,t){return t in Qa(e)},ownKeys(e){return Reflect.ownKeys(Qa(e))},set(e,t,r){const n=VA(Qa(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=Eg(Qa(e),t),o=i==null?void 0:i[Ur];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(y8(r,i)&&(r!==void 0||Qv(e.base_,t)))return!0;Ag(e),Jv(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Eg(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Ag(e),Jv(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Qa(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){wn(11)},getPrototypeOf(e){return Rc(e.base_)},setPrototypeOf(){wn(12)}},$c={};Df(f0,(e,t)=>{$c[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});$c.deleteProperty=function(e,t){return $c.set.call(this,e,t,void 0)};$c.set=function(e,t,r){return f0.set.call(this,e[0],t,r,e[0])};function Eg(e,t){const r=e[Ur];return(r?Qa(r):e)[t]}function N8(e,t,r){var i;const n=VA(t,r);return n?"value"in n?n.value:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function VA(e,t){if(!(t in e))return;let r=Rc(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Rc(r)}}function Jv(e){e.modified_||(e.modified_=!0,e.parent_&&Jv(e.parent_))}function Ag(e){e.copy_||(e.copy_=Yv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var E8=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const o=r;r=t;const c=this;return function(f=o,...h){return c.produce(f,m=>r.call(this,m,...h))}}typeof r!="function"&&wn(6),n!==void 0&&typeof n!="function"&&wn(7);let i;if(jo(t)){const o=fj(this),c=ex(t,void 0);let u=!0;try{i=r(c),u=!1}finally{u?Zv(o):Xv(o)}return dj(o,n),hj(i,o)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===WA&&(i=void 0),this.autoFreeze_&&d0(i,!0),n){const o=[],c=[];So("Patches").generateReplacementPatches_(t,i,o,c),n(o,c)}return i}else wn(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(c,...u)=>this.produceWithPatches(c,f=>t(f,...u));let n,i;return[this.produce(t,r,(c,u)=>{n=c,i=u}),n,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){jo(e)||wn(8),Hs(e)&&(e=A8(e));const t=fj(this),r=ex(e,void 0);return r[Ur].isManual_=!0,Xv(t),r}finishDraft(e,t){const r=e&&e[Ur];(!r||!r.isManual_)&&wn(9);const{scope_:n}=r;return dj(n,t),hj(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));const n=So("Patches").applyPatches_;return Hs(e)?n(e,t):this.produce(e,i=>n(i,t))}};function ex(e,t){const r=lu(e)?So("MapSet").proxyMap_(e,t):Wh(e)?So("MapSet").proxySet_(e,t):S8(e,t);return(t?t.scope_:GA()).drafts_.push(r),r}function A8(e){return Hs(e)||wn(10,e),qA(e)}function qA(e){if(!jo(e)||Hh(e))return e;const t=e[Ur];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Yv(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Yv(e,!0);return Df(r,(i,o)=>{KA(r,i,qA(o))},n),t&&(t.finalized_=!1),r}var C8=new E8;C8.produce;var P8={settings:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemSorter:"value"},size:{width:0,height:0},payload:[]},QA=ur({name:"legend",initialState:P8,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:lt()},replaceLegendPayload:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,o=tn(e).payload.indexOf(n);o>-1&&(e.payload[o]=i)},prepare:lt()},removeLegendPayload:{reducer(e,t){var r=tn(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:lt()}}}),cu=QA.actions;cu.setLegendSize;cu.setLegendSettings;var O8=cu.addLegendPayload,_8=cu.replaceLegendPayload,M8=cu.removeLegendPayload,I8=QA.reducer,Cg={exports:{}},Pg={};/** + height and width.`,ue,pe,o,c,f,h,r),x.createElement("div",Tf({id:S?"".concat(S):void 0,className:nt("recharts-responsive-container",w),style:lj(lj({},E),{},{width:o,height:c,minWidth:f,minHeight:h,maxHeight:m}),ref:C},A),x.createElement("div",{style:e8({width:o,height:c})},x.createElement(zA,{width:ue,height:pe},p)))}),p8=x.forwardRef((e,t)=>{var r=c0();if(qn(r.width)&&qn(r.height))return e.children;var n=t8({width:e.width,height:e.height,aspect:e.aspect}),i=n.width,o=n.height,c=RA(void 0,void 0,{width:i,height:o,aspect:e.aspect,maxHeight:e.maxHeight}),u=c.calculatedWidth,f=c.calculatedHeight;return Ee(u)&&Ee(f)?x.createElement(zA,{width:u,height:f},e.children):x.createElement(m8,Tf({},e,{width:i,height:o,ref:t}))});function u0(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var Bh=()=>{var e,t=Or(),r=Me(Kz),n=Me(Fh),i=(e=Me(zh))===null||e===void 0?void 0:e.padding;return!t||!n||!i?r:{width:n.width-i.left-i.right,height:n.height-i.top-i.bottom,x:i.left,y:i.top}},g8={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},FA=()=>{var e;return(e=Me(er))!==null&&e!==void 0?e:g8},BA=()=>Me(Ai),UA=()=>Me(Ci),ht=e=>e.layout.layoutType,nl=()=>Me(ht),d0=()=>{var e=nl();if(e==="horizontal"||e==="vertical")return e},WA=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},v8=()=>{var e=nl();return e!==void 0},lu=e=>{var t=At(),r=Or(),n=e.width,i=e.height,o=c0(),c=n,u=i;return o&&(c=o.width>0?o.width:n,u=o.height>0?o.height:i),x.useEffect(()=>{!r&&qn(c)&&qn(u)&&t(vz({width:c,height:u}))},[t,r,c,u]),null},HA=Symbol.for("immer-nothing"),uj=Symbol.for("immer-draftable"),Ur=Symbol.for("immer-state");function wn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Rc=Object.getPrototypeOf;function Hs(e){return!!e&&!!e[Ur]}function jo(e){var t;return e?KA(e)||Array.isArray(e)||!!e[uj]||!!((t=e.constructor)!=null&&t[uj])||cu(e)||Wh(e):!1}var x8=Object.prototype.constructor.toString(),dj=new WeakMap;function KA(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=dj.get(r);return n===void 0&&(n=Function.toString.call(r),dj.set(r,n)),n===x8}function Df(e,t,r=!0){Uh(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((n,i)=>t(i,n,e))}function Uh(e){const t=e[Ur];return t?t.type_:Array.isArray(e)?1:cu(e)?2:Wh(e)?3:0}function Yv(e,t){return Uh(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function GA(e,t,r){const n=Uh(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function y8(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function cu(e){return e instanceof Map}function Wh(e){return e instanceof Set}function Qa(e){return e.copy_||e.base_}function Zv(e,t){if(cu(e))return new Map(e);if(Wh(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=KA(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[Ur];let i=Reflect.ownKeys(n);for(let o=0;o1&&Object.defineProperties(e,{set:Vd,add:Vd,clear:Vd,delete:Vd}),Object.freeze(e),t&&Object.values(e).forEach(r=>f0(r,!0))),e}function b8(){wn(2)}var Vd={value:b8};function Hh(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var w8={};function So(e){const t=w8[e];return t||wn(0,e),t}var $c;function VA(){return $c}function k8(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function fj(e,t){t&&(So("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Xv(e){Jv(e),e.drafts_.forEach(j8),e.drafts_=null}function Jv(e){e===$c&&($c=e.parent_)}function hj(e){return $c=k8($c,e)}function j8(e){const t=e[Ur];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function mj(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[Ur].modified_&&(Xv(t),wn(4)),jo(e)&&(e=Lf(t,e),t.parent_||Rf(t,e)),t.patches_&&So("Patches").generateReplacementPatches_(r[Ur].base_,e,t.patches_,t.inversePatches_)):e=Lf(t,r,[]),Xv(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==HA?e:void 0}function Lf(e,t,r){if(Hh(t))return t;const n=e.immer_.shouldUseStrictIteration(),i=t[Ur];if(!i)return Df(t,(o,c)=>pj(e,i,t,o,c,r),n),t;if(i.scope_!==e)return t;if(!i.modified_)return Rf(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const o=i.copy_;let c=o,u=!1;i.type_===3&&(c=new Set(o),o.clear(),u=!0),Df(c,(f,h)=>pj(e,i,o,f,h,r,u),n),Rf(e,o,!1),r&&e.patches_&&So("Patches").generatePatches_(i,r,e.patches_,e.inversePatches_)}return i.copy_}function pj(e,t,r,n,i,o,c){if(i==null||typeof i!="object"&&!c)return;const u=Hh(i);if(!(u&&!c)){if(Hs(i)){const f=o&&t&&t.type_!==3&&!Yv(t.assigned_,n)?o.concat(n):void 0,h=Lf(e,i,f);if(GA(r,n,h),Hs(h))e.canAutoFreeze_=!1;else return}else c&&r.add(i);if(jo(i)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===i&&u)return;Lf(e,i),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(cu(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Rf(e,i)}}}function Rf(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&f0(t,r)}function S8(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:VA(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=n,o=h0;r&&(i=[n],o=zc);const{revoke:c,proxy:u}=Proxy.revocable(i,o);return n.draft_=u,n.revoke_=c,u}var h0={get(e,t){if(t===Ur)return e;const r=Qa(e);if(!Yv(r,t))return N8(e,r,t);const n=r[t];return e.finalized_||!jo(n)?n:n===Ag(e.base_,t)?(Cg(e),e.copy_[t]=tx(n,e)):n},has(e,t){return t in Qa(e)},ownKeys(e){return Reflect.ownKeys(Qa(e))},set(e,t,r){const n=qA(Qa(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=Ag(Qa(e),t),o=i==null?void 0:i[Ur];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(y8(r,i)&&(r!==void 0||Yv(e.base_,t)))return!0;Cg(e),ex(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Ag(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Cg(e),ex(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Qa(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){wn(11)},getPrototypeOf(e){return Rc(e.base_)},setPrototypeOf(){wn(12)}},zc={};Df(h0,(e,t)=>{zc[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});zc.deleteProperty=function(e,t){return zc.set.call(this,e,t,void 0)};zc.set=function(e,t,r){return h0.set.call(this,e[0],t,r,e[0])};function Ag(e,t){const r=e[Ur];return(r?Qa(r):e)[t]}function N8(e,t,r){var i;const n=qA(t,r);return n?"value"in n?n.value:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function qA(e,t){if(!(t in e))return;let r=Rc(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Rc(r)}}function ex(e){e.modified_||(e.modified_=!0,e.parent_&&ex(e.parent_))}function Cg(e){e.copy_||(e.copy_=Zv(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var E8=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const o=r;r=t;const c=this;return function(f=o,...h){return c.produce(f,m=>r.call(this,m,...h))}}typeof r!="function"&&wn(6),n!==void 0&&typeof n!="function"&&wn(7);let i;if(jo(t)){const o=hj(this),c=tx(t,void 0);let u=!0;try{i=r(c),u=!1}finally{u?Xv(o):Jv(o)}return fj(o,n),mj(i,o)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===HA&&(i=void 0),this.autoFreeze_&&f0(i,!0),n){const o=[],c=[];So("Patches").generateReplacementPatches_(t,i,o,c),n(o,c)}return i}else wn(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(c,...u)=>this.produceWithPatches(c,f=>t(f,...u));let n,i;return[this.produce(t,r,(c,u)=>{n=c,i=u}),n,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){jo(e)||wn(8),Hs(e)&&(e=A8(e));const t=hj(this),r=tx(e,void 0);return r[Ur].isManual_=!0,Jv(t),r}finishDraft(e,t){const r=e&&e[Ur];(!r||!r.isManual_)&&wn(9);const{scope_:n}=r;return fj(n,t),mj(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));const n=So("Patches").applyPatches_;return Hs(e)?n(e,t):this.produce(e,i=>n(i,t))}};function tx(e,t){const r=cu(e)?So("MapSet").proxyMap_(e,t):Wh(e)?So("MapSet").proxySet_(e,t):S8(e,t);return(t?t.scope_:VA()).drafts_.push(r),r}function A8(e){return Hs(e)||wn(10,e),QA(e)}function QA(e){if(!jo(e)||Hh(e))return e;const t=e[Ur];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Zv(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Zv(e,!0);return Df(r,(i,o)=>{GA(r,i,QA(o))},n),t&&(t.finalized_=!1),r}var C8=new E8;C8.produce;var P8={settings:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemSorter:"value"},size:{width:0,height:0},payload:[]},YA=ur({name:"legend",initialState:P8,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:lt()},replaceLegendPayload:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,o=tn(e).payload.indexOf(n);o>-1&&(e.payload[o]=i)},prepare:lt()},removeLegendPayload:{reducer(e,t){var r=tn(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:lt()}}}),uu=YA.actions;uu.setLegendSize;uu.setLegendSettings;var O8=uu.addLegendPayload,_8=uu.replaceLegendPayload,M8=uu.removeLegendPayload,I8=YA.reducer,Pg={exports:{}},Og={};/** * @license React * use-sync-external-store-with-selector.production.js * @@ -696,54 +696,54 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var pj;function T8(){if(pj)return Pg;pj=1;var e=Xs();function t(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var r=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,i=e.useRef,o=e.useEffect,c=e.useMemo,u=e.useDebugValue;return Pg.useSyncExternalStoreWithSelector=function(f,h,m,p,v){var b=i(null);if(b.current===null){var S={hasValue:!1,value:null};b.current=S}else S=b.current;b=c(function(){function k(_){if(!N){if(N=!0,E=_,_=p(_),v!==void 0&&S.hasValue){var O=S.value;if(v(O,_))return A=O}return A=_}if(O=A,r(E,_))return O;var D=p(_);return v!==void 0&&v(O,D)?(E=_,O):(E=_,A=D)}var N=!1,E,A,C=m===void 0?null:m;return[function(){return k(h())},C===null?void 0:function(){return k(C())}]},[h,m,p,v]);var w=n(f,b[0],b[1]);return o(function(){S.hasValue=!0,S.value=w},[w]),u(w),w},Pg}var gj;function D8(){return gj||(gj=1,Cg.exports=T8()),Cg.exports}D8();function R8(e){e()}function L8(){let e=null,t=null;return{clear(){e=null,t=null},notify(){R8(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var vj={notify(){},get:()=>[]};function $8(e,t){let r,n=vj,i=0,o=!1;function c(w){m();const k=n.subscribe(w);let N=!1;return()=>{N||(N=!0,k(),p())}}function u(){n.notify()}function f(){S.onStateChange&&S.onStateChange()}function h(){return o}function m(){i++,r||(r=e.subscribe(f),n=L8())}function p(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=vj)}function v(){o||(o=!0,m())}function b(){o&&(o=!1,p())}const S={addNestedSub:c,notifyNestedSubs:u,handleChangeWrapper:f,isSubscribed:h,trySubscribe:v,tryUnsubscribe:b,getListeners:()=>n};return S}var z8=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",F8=z8(),B8=()=>typeof navigator<"u"&&navigator.product==="ReactNative",U8=B8(),W8=()=>F8||U8?x.useLayoutEffect:x.useEffect,H8=W8();function xj(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function K8(e,t){if(xj(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let i=0;i{const f=$8(i);return{store:i,subscription:f,getServerState:n?()=>n:void 0}},[i,n]),c=x.useMemo(()=>i.getState(),[i]);H8(()=>{const{subscription:f}=o;return f.onStateChange=f.notifyNestedSubs,f.trySubscribe(),c!==i.getState()&&f.notifyNestedSubs(),()=>{f.tryUnsubscribe(),f.onStateChange=void 0}},[o,c]);const u=r||V8;return x.createElement(u.Provider,{value:o},t)}var Q8=q8,Y8=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Z8(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Kh(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var n of r)if(Y8.has(n)){if(e[n]==null&&t[n]==null)continue;if(!K8(e[n],t[n]))return!1}else if(!Z8(e[n],t[n]))return!1;return!0}function tx(){return tx=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.separator,r=t===void 0?cs.separator:t,n=e.contentStyle,i=e.itemStyle,o=e.labelStyle,c=o===void 0?cs.labelStyle:o,u=e.payload,f=e.formatter,h=e.itemSorter,m=e.wrapperClassName,p=e.labelClassName,v=e.label,b=e.labelFormatter,S=e.accessibilityLayer,w=S===void 0?cs.accessibilityLayer:S,k=()=>{if(u&&u.length){var B={padding:0,margin:0},z=sF(u,h),$=z.map((K,W)=>{if(!K||K.type==="none")return null;var ve=K.formatter||f||oF,ue=K.value,pe=K.name,oe=ue,le=pe;if(ve){var Z=ve(ue,pe,K,W,u);if(Array.isArray(Z)){var ie=tF(Z,2);oe=ie[0],le=ie[1]}else if(Z!=null)oe=Z;else return null}var te=ic(ic({},cs.itemStyle),{},{color:K.color||cs.itemStyle.color},i);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(W),style:te},Vn(le)?x.createElement("span",{className:"recharts-tooltip-item-name"},le):null,Vn(le)?x.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,x.createElement("span",{className:"recharts-tooltip-item-value"},oe),x.createElement("span",{className:"recharts-tooltip-item-unit"},K.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:B},$)}return null},N=ic(ic({},cs.contentStyle),n),E=ic({margin:0},c),A=!Xt(v),C=A?v:"",_=nt("recharts-default-tooltip",m),O=nt("recharts-tooltip-label",p);A&&b&&u!==void 0&&u!==null&&(C=b(v,u));var D=w?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",tx({className:_,style:N},D),x.createElement("p",{className:O,style:E},x.isValidElement(C)?C:"".concat(C)),k())},ac="recharts-tooltip-wrapper",cF={visibility:"hidden"};function uF(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return nt(ac,{["".concat(ac,"-right")]:Ee(r)&&t&&Ee(t.x)&&r>=t.x,["".concat(ac,"-left")]:Ee(r)&&t&&Ee(t.x)&&r=t.y,["".concat(ac,"-top")]:Ee(n)&&t&&Ee(t.y)&&n0?i:0),p=r[n]+i;if(t[n])return c[n]?m:p;var v=f[n];if(v==null)return 0;if(c[n]){var b=m,S=v;return bk?Math.max(m,v):Math.max(p,v)}function dF(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function fF(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTop,i=e.offsetLeft,o=e.position,c=e.reverseDirection,u=e.tooltipBox,f=e.useTranslate3d,h=e.viewBox,m,p,v;return u.height>0&&u.width>0&&r?(p=wj({allowEscapeViewBox:t,coordinate:r,key:"x",offset:i,position:o,reverseDirection:c,tooltipDimension:u.width,viewBox:h,viewBoxDimension:h.width}),v=wj({allowEscapeViewBox:t,coordinate:r,key:"y",offset:n,position:o,reverseDirection:c,tooltipDimension:u.height,viewBox:h,viewBoxDimension:h.height}),m=dF({translateX:p,translateY:v,useTranslate3d:f})):m=cF,{cssProperties:m,cssClasses:uF({translateX:p,translateY:v,coordinate:r})}}var hF=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),uu={isSsr:hF()};function mF(e,t){return xF(e)||vF(e,t)||gF(e,t)||pF()}function pF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gF(e,t){if(e){if(typeof e=="string")return kj(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?kj(e,t):void 0}}function kj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);ruu.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches),t=mF(e,2),r=t[0],n=t[1];return x.useEffect(()=>{if(window.matchMedia){var i=window.matchMedia("(prefers-reduced-motion: reduce)"),o=()=>{n(i.matches)};return i.addEventListener("change",o),()=>{i.removeEventListener("change",o)}}},[]),r}function jj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function us(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),h=kF(f,2),m=h[0],p=h[1];x.useEffect(()=>{var N=E=>{if(E.key==="Escape"){var A,C,_,O;p({dismissed:!0,dismissedAtCoordinate:{x:(A=(C=e.coordinate)===null||C===void 0?void 0:C.x)!==null&&A!==void 0?A:0,y:(_=(O=e.coordinate)===null||O===void 0?void 0:O.y)!==null&&_!==void 0?_:0}})}};return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(r=e.coordinate)===null||r===void 0?void 0:r.y]),m.dismissed&&(((n=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)!==m.dismissedAtCoordinate.x||((o=(c=e.coordinate)===null||c===void 0?void 0:c.y)!==null&&o!==void 0?o:0)!==m.dismissedAtCoordinate.y)&&p(us(us({},m),{},{dismissed:!1}));var v=fF({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),b=v.cssClasses,S=v.cssProperties,w=e.hasPortalFromProps?{}:us(us({transition:AF({prefersReducedMotion:u,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},S),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),k=us(us({},w),{},{visibility:!m.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return x.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:b,style:k,ref:e.innerRef},e.children)}var PF=x.memo(CF),ZA=()=>{var e;return(e=Me(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function rx(){return rx=Object.assign?Object.assign.bind():function(e){for(var t=1;tHe(e.x)&&He(e.y),Cj=e=>e.base!=null&&$f(e.base)&&$f(e),oc=e=>e.x,sc=e=>e.y,IF=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(Xx(e));if((r==="curveMonotone"||r==="curveBump")&&t){var n=Aj["".concat(r).concat(t==="vertical"?"Y":"X")];if(n)return n}return Aj[r]||Sh},Pj={connectNulls:!1,type:"linear"},TF=e=>{var t=e.type,r=t===void 0?Pj.type:t,n=e.points,i=n===void 0?[]:n,o=e.baseLine,c=e.layout,u=e.connectNulls,f=u===void 0?Pj.connectNulls:u,h=IF(r,c),m=f?i.filter($f):i;if(Array.isArray(o)){var p,v=i.map((N,E)=>Ej(Ej({},N),{},{base:o[E]}));c==="vertical"?p=zd().y(sc).x1(oc).x0(N=>N.base.x):p=zd().x(oc).y1(sc).y0(N=>N.base.y);var b=p.defined(Cj).curve(h),S=f?v.filter(Cj):v;return b(S)}var w;c==="vertical"&&Ee(o)?w=zd().y(sc).x1(oc).x0(o):Ee(o)?w=zd().x(oc).y1(sc).y0(o):w=EE().x(oc).y(sc);var k=w.defined($f).curve(h);return k(m)},lf=e=>{var t=e.className,r=e.points,n=e.path,i=e.pathRef,o=nl();if((!r||!r.length)&&!n)return null;var c={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||o,connectNulls:e.connectNulls},u=r&&r.length?TF(c):n;return x.createElement("path",rx({},Sn(e),Jx(e),{className:nt("recharts-curve",t),d:u===null?void 0:u,ref:i}))},DF=["x","y","top","left","width","height","className"];function nx(){return nx=Object.assign?Object.assign.bind():function(e){for(var t=1;t"M".concat(e,",").concat(i,"v").concat(n,"M").concat(o,",").concat(t,"h").concat(r),WF=e=>{var t=e.x,r=t===void 0?0:t,n=e.y,i=n===void 0?0:n,o=e.top,c=o===void 0?0:o,u=e.left,f=u===void 0?0:u,h=e.width,m=h===void 0?0:h,p=e.height,v=p===void 0?0:p,b=e.className,S=FF(e,DF),w=RF({x:r,y:i,top:c,left:f,width:m,height:v},S);return!Ee(r)||!Ee(i)||!Ee(m)||!Ee(v)||!Ee(c)||!Ee(f)?null:x.createElement("path",nx({},an(w),{className:nt("recharts-cross",b),d:UF(r,i,m,v,c,f)}))};function HF(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-i,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}var zf=1e-4,XA=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],JA=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),_j=(e,t)=>r=>{var n=XA(e,t);return JA(n,r)},KF=(e,t)=>r=>{var n=XA(e,t),i=[...n.map((o,c)=>o*c).slice(1),0];return JA(i,r)},GF=e=>{var t,r=e.split("(");if(r.length!==2||r[0]!=="cubic-bezier")return null;var n=(t=r[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(n==null||n.length!==4)return null;var i=n.map(o=>parseFloat(o));return[i[0],i[1],i[2],i[3]]},VF=function(){for(var t=arguments.length,r=new Array(t),n=0;n{var i=_j(e,r),o=_j(t,n),c=KF(e,r),u=h=>h>1?1:h<0?0:h,f=h=>{for(var m=h>1?1:h,p=m,v=0;v<8;++v){var b=i(p)-m,S=c(p);if(Math.abs(b-m)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,o=i===void 0?8:i,c=t.dt,u=c===void 0?16.67:c,f=1,h=[0],m=0,p=0,v=1e4,b=0;b{var E,A,C;if(N<=0)return 0;if(N>=1)return f;var _=N*k,O=Math.floor(_),D=_-O;return((E=h[O])!==null&&E!==void 0?E:0)+(((A=h[O+1])!==null&&A!==void 0?A:0)-((C=h[O])!==null&&C!==void 0?C:0))*D}},YF=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Mj(e);case"spring":return QF();default:if(e.split("(")[0]==="cubic-bezier")return Mj(e)}return typeof e=="function"?e:null},ZF=(e,t,r)=>{var n,i=o=>{var c=t.tick(o);if(t.getState()==="active"){if(r(t.getInterpolated()),t.getProgress()===1){t.complete(),n=void 0;return}n=e.setTimeout(i,c);return}n=e.setTimeout(i,c)};return n=e.setTimeout(i,0),()=>{var o;return(o=n)===null||o===void 0?void 0:o()}},eC=x.createContext(ZF);eC.Provider;function XF(e){var t=x.useContext(eC);return x.useMemo(()=>e??t,[e,t])}function JF(e,t,r){return(t=e9(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function e9(e){var t=t9(e,"string");return typeof t=="symbol"?t:t+""}function t9(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ij="init",Tj="pending",Dj="active",r9="completed";function Mg(e){return Math.max(0,e)}class n9{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(t){var r;JF(this,"state",Ij),this.animationId=t.animationId,this.onAnimationEnd=t.onAnimationEnd,this.animationDuration=Mg(t.animationDuration),this.animationBegin=Mg(t.animationBegin),this.progress=0,this.from=t.from,this.to=t.to,this.easing=t.easing,(r=t.onAnimationStart)===null||r===void 0||r.call(t)}getState(){return this.state}getEasing(){return this.easing}getAnimationDuration(){return this.animationDuration}tick(t){if(this.getState()===Ij)return this.state=Tj,this.beginStartedTime=t,this.animationBegin;if(this.getState()===Tj){if(this.beginStartedTime==null)throw new Error;var r=t-this.beginStartedTime;return r>=this.animationBegin?(this.state=Dj,this.animationStartedTime=t,this.nextAnimationUpdate(0)):Mg(this.animationBegin-r)}if(this.getState()===Dj){if(this.animationStartedTime==null)throw new Error;var n=t-this.animationStartedTime;return this.setProgress(n/this.animationDuration),this.nextAnimationUpdate(n)}return 0}setProgress(t){this.progress=Math.min(1,Math.max(0,t))}getProgress(){return this.progress}complete(){if(this.progress=1,this.state==="active"){var t;(t=this.onAnimationEnd)===null||t===void 0||t.call(this)}this.state=r9}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}}class i9 extends n9{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(mi(this.getFrom(),this.getTo(),this.getProgress()))}}class a9{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),i=null,o=c=>{c-n>=r?t(c):i=requestAnimationFrame(o)};return i=requestAnimationFrame(o),()=>{i!=null&&cancelAnimationFrame(i)}}}function o9(e,t){return u9(e)||c9(e,t)||l9(e,t)||s9()}function s9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l9(e,t){if(e){if(typeof e=="string")return Rj(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Rj(e,t):void 0}}function Rj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{},onAnimationStart:()=>{}},Lj=0,Ig=1;function tC(e){var t=ln(e,d9),r=t.animationId,n=t.isActive,i=t.canBegin,o=t.duration,c=t.easing,u=t.begin,f=t.onAnimationEnd,h=t.onAnimationStart,m=t.children,p=YA(),v=n==="auto"?!uu.isSsr&&!p:n,b=XF(t.animationController),S=x.useState(v?Lj:Ig),w=o9(S,2),k=w[0],N=w[1];return x.useEffect(()=>{v||N(Ig)},[v]),x.useEffect(()=>{var E=YF(c);if(!v||!i||E==null)return rl;var A=new a9,C=new i9({animationId:r,easing:E,animationDuration:o,animationBegin:u,onAnimationStart:h,onAnimationEnd:f,from:Lj,to:Ig});return b(A,C,N)},[b,r,v,i,o,c,u,h,f]),m(Number(k))}function rC(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=x.useRef(Mc(t)),n=x.useRef(e);return n.current!==e&&(r.current=Mc(t),n.current=e),r.current}var f9=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),h9=(e,t,r)=>e.map(n=>"".concat(f9(n)," ").concat(t,"ms ").concat(r)).join(","),m9=["radius"],p9=["radius"],$j,zj,Fj,Bj,Uj,Wj,Hj,Kj,Gj,Vj;function qj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Qj(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{var o=ga(r),c=ga(n),u=Math.min(Math.abs(o)/2,Math.abs(c)/2),f=c>=0?1:-1,h=o>=0?1:-1,m=c>=0&&o>=0||c<0&&o<0?1:0,p;if(u>0&&Array.isArray(i)){for(var v=[0,0,0,0],b=0,S=4;bu?u:k}p=qt($j||($j=Dn(["M",",",""])),e,t+f*v[0]),v[0]>0&&(p+=qt(zj||(zj=Dn(["A ",",",",0,0,",",",",",""])),v[0],v[0],m,e+h*v[0],t)),p+=qt(Fj||(Fj=Dn(["L ",",",""])),e+r-h*v[1],t),v[1]>0&&(p+=qt(Bj||(Bj=Dn(["A ",",",",0,0,",`, - `,",",""])),v[1],v[1],m,e+r,t+f*v[1])),p+=qt(Uj||(Uj=Dn(["L ",",",""])),e+r,t+n-f*v[2]),v[2]>0&&(p+=qt(Wj||(Wj=Dn(["A ",",",",0,0,",`, - `,",",""])),v[2],v[2],m,e+r-h*v[2],t+n)),p+=qt(Hj||(Hj=Dn(["L ",",",""])),e+h*v[3],t+n),v[3]>0&&(p+=qt(Kj||(Kj=Dn(["A ",",",",0,0,",`, - `,",",""])),v[3],v[3],m,e,t+n-f*v[3])),p+="Z"}else if(u>0&&i===+i&&i>0){var N=Math.min(u,i);p=qt(Gj||(Gj=Dn(["M ",",",` + */var gj;function T8(){if(gj)return Og;gj=1;var e=Xs();function t(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var r=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,i=e.useRef,o=e.useEffect,c=e.useMemo,u=e.useDebugValue;return Og.useSyncExternalStoreWithSelector=function(f,h,m,p,v){var b=i(null);if(b.current===null){var S={hasValue:!1,value:null};b.current=S}else S=b.current;b=c(function(){function k(_){if(!N){if(N=!0,E=_,_=p(_),v!==void 0&&S.hasValue){var O=S.value;if(v(O,_))return A=O}return A=_}if(O=A,r(E,_))return O;var D=p(_);return v!==void 0&&v(O,D)?(E=_,O):(E=_,A=D)}var N=!1,E,A,C=m===void 0?null:m;return[function(){return k(h())},C===null?void 0:function(){return k(C())}]},[h,m,p,v]);var w=n(f,b[0],b[1]);return o(function(){S.hasValue=!0,S.value=w},[w]),u(w),w},Og}var vj;function D8(){return vj||(vj=1,Pg.exports=T8()),Pg.exports}D8();function L8(e){e()}function R8(){let e=null,t=null;return{clear(){e=null,t=null},notify(){L8(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const i=t={callback:r,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!n||e===null||(n=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var xj={notify(){},get:()=>[]};function $8(e,t){let r,n=xj,i=0,o=!1;function c(w){m();const k=n.subscribe(w);let N=!1;return()=>{N||(N=!0,k(),p())}}function u(){n.notify()}function f(){S.onStateChange&&S.onStateChange()}function h(){return o}function m(){i++,r||(r=e.subscribe(f),n=R8())}function p(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=xj)}function v(){o||(o=!0,m())}function b(){o&&(o=!1,p())}const S={addNestedSub:c,notifyNestedSubs:u,handleChangeWrapper:f,isSubscribed:h,trySubscribe:v,tryUnsubscribe:b,getListeners:()=>n};return S}var z8=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",F8=z8(),B8=()=>typeof navigator<"u"&&navigator.product==="ReactNative",U8=B8(),W8=()=>F8||U8?x.useLayoutEffect:x.useEffect,H8=W8();function yj(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function K8(e,t){if(yj(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let i=0;i{const f=$8(i);return{store:i,subscription:f,getServerState:n?()=>n:void 0}},[i,n]),c=x.useMemo(()=>i.getState(),[i]);H8(()=>{const{subscription:f}=o;return f.onStateChange=f.notifyNestedSubs,f.trySubscribe(),c!==i.getState()&&f.notifyNestedSubs(),()=>{f.tryUnsubscribe(),f.onStateChange=void 0}},[o,c]);const u=r||V8;return x.createElement(u.Provider,{value:o},t)}var Q8=q8,Y8=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function Z8(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Kh(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var n of r)if(Y8.has(n)){if(e[n]==null&&t[n]==null)continue;if(!K8(e[n],t[n]))return!1}else if(!Z8(e[n],t[n]))return!1;return!0}function rx(){return rx=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.separator,r=t===void 0?cs.separator:t,n=e.contentStyle,i=e.itemStyle,o=e.labelStyle,c=o===void 0?cs.labelStyle:o,u=e.payload,f=e.formatter,h=e.itemSorter,m=e.wrapperClassName,p=e.labelClassName,v=e.label,b=e.labelFormatter,S=e.accessibilityLayer,w=S===void 0?cs.accessibilityLayer:S,k=()=>{if(u&&u.length){var B={padding:0,margin:0},z=sF(u,h),$=z.map((K,W)=>{if(!K||K.type==="none")return null;var ve=K.formatter||f||oF,ue=K.value,pe=K.name,oe=ue,le=pe;if(ve){var Z=ve(ue,pe,K,W,u);if(Array.isArray(Z)){var ie=tF(Z,2);oe=ie[0],le=ie[1]}else if(Z!=null)oe=Z;else return null}var te=ic(ic({},cs.itemStyle),{},{color:K.color||cs.itemStyle.color},i);return x.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(W),style:te},Vn(le)?x.createElement("span",{className:"recharts-tooltip-item-name"},le):null,Vn(le)?x.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,x.createElement("span",{className:"recharts-tooltip-item-value"},oe),x.createElement("span",{className:"recharts-tooltip-item-unit"},K.unit||""))});return x.createElement("ul",{className:"recharts-tooltip-item-list",style:B},$)}return null},N=ic(ic({},cs.contentStyle),n),E=ic({margin:0},c),A=!Xt(v),C=A?v:"",_=nt("recharts-default-tooltip",m),O=nt("recharts-tooltip-label",p);A&&b&&u!==void 0&&u!==null&&(C=b(v,u));var D=w?{role:"status","aria-live":"assertive"}:{};return x.createElement("div",rx({className:_,style:N},D),x.createElement("p",{className:O,style:E},x.isValidElement(C)?C:"".concat(C)),k())},ac="recharts-tooltip-wrapper",cF={visibility:"hidden"};function uF(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return nt(ac,{["".concat(ac,"-right")]:Ee(r)&&t&&Ee(t.x)&&r>=t.x,["".concat(ac,"-left")]:Ee(r)&&t&&Ee(t.x)&&r=t.y,["".concat(ac,"-top")]:Ee(n)&&t&&Ee(t.y)&&n0?i:0),p=r[n]+i;if(t[n])return c[n]?m:p;var v=f[n];if(v==null)return 0;if(c[n]){var b=m,S=v;return bk?Math.max(m,v):Math.max(p,v)}function dF(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function fF(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTop,i=e.offsetLeft,o=e.position,c=e.reverseDirection,u=e.tooltipBox,f=e.useTranslate3d,h=e.viewBox,m,p,v;return u.height>0&&u.width>0&&r?(p=kj({allowEscapeViewBox:t,coordinate:r,key:"x",offset:i,position:o,reverseDirection:c,tooltipDimension:u.width,viewBox:h,viewBoxDimension:h.width}),v=kj({allowEscapeViewBox:t,coordinate:r,key:"y",offset:n,position:o,reverseDirection:c,tooltipDimension:u.height,viewBox:h,viewBoxDimension:h.height}),m=dF({translateX:p,translateY:v,useTranslate3d:f})):m=cF,{cssProperties:m,cssClasses:uF({translateX:p,translateY:v,coordinate:r})}}var hF=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),du={isSsr:hF()};function mF(e,t){return xF(e)||vF(e,t)||gF(e,t)||pF()}function pF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gF(e,t){if(e){if(typeof e=="string")return jj(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jj(e,t):void 0}}function jj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);rdu.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches),t=mF(e,2),r=t[0],n=t[1];return x.useEffect(()=>{if(window.matchMedia){var i=window.matchMedia("(prefers-reduced-motion: reduce)"),o=()=>{n(i.matches)};return i.addEventListener("change",o),()=>{i.removeEventListener("change",o)}}},[]),r}function Sj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function us(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),h=kF(f,2),m=h[0],p=h[1];x.useEffect(()=>{var N=E=>{if(E.key==="Escape"){var A,C,_,O;p({dismissed:!0,dismissedAtCoordinate:{x:(A=(C=e.coordinate)===null||C===void 0?void 0:C.x)!==null&&A!==void 0?A:0,y:(_=(O=e.coordinate)===null||O===void 0?void 0:O.y)!==null&&_!==void 0?_:0}})}};return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(r=e.coordinate)===null||r===void 0?void 0:r.y]),m.dismissed&&(((n=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)!==m.dismissedAtCoordinate.x||((o=(c=e.coordinate)===null||c===void 0?void 0:c.y)!==null&&o!==void 0?o:0)!==m.dismissedAtCoordinate.y)&&p(us(us({},m),{},{dismissed:!1}));var v=fF({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),b=v.cssClasses,S=v.cssProperties,w=e.hasPortalFromProps?{}:us(us({transition:AF({prefersReducedMotion:u,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},S),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),k=us(us({},w),{},{visibility:!m.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return x.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:b,style:k,ref:e.innerRef},e.children)}var PF=x.memo(CF),XA=()=>{var e;return(e=Me(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function nx(){return nx=Object.assign?Object.assign.bind():function(e){for(var t=1;tHe(e.x)&&He(e.y),Pj=e=>e.base!=null&&$f(e.base)&&$f(e),oc=e=>e.x,sc=e=>e.y,IF=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(Jx(e));if((r==="curveMonotone"||r==="curveBump")&&t){var n=Cj["".concat(r).concat(t==="vertical"?"Y":"X")];if(n)return n}return Cj[r]||Sh},Oj={connectNulls:!1,type:"linear"},TF=e=>{var t=e.type,r=t===void 0?Oj.type:t,n=e.points,i=n===void 0?[]:n,o=e.baseLine,c=e.layout,u=e.connectNulls,f=u===void 0?Oj.connectNulls:u,h=IF(r,c),m=f?i.filter($f):i;if(Array.isArray(o)){var p,v=i.map((N,E)=>Aj(Aj({},N),{},{base:o[E]}));c==="vertical"?p=Fd().y(sc).x1(oc).x0(N=>N.base.x):p=Fd().x(oc).y1(sc).y0(N=>N.base.y);var b=p.defined(Pj).curve(h),S=f?v.filter(Pj):v;return b(S)}var w;c==="vertical"&&Ee(o)?w=Fd().y(sc).x1(oc).x0(o):Ee(o)?w=Fd().x(oc).y1(sc).y0(o):w=AE().x(oc).y(sc);var k=w.defined($f).curve(h);return k(m)},cf=e=>{var t=e.className,r=e.points,n=e.path,i=e.pathRef,o=nl();if((!r||!r.length)&&!n)return null;var c={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||o,connectNulls:e.connectNulls},u=r&&r.length?TF(c):n;return x.createElement("path",nx({},Sn(e),e0(e),{className:nt("recharts-curve",t),d:u===null?void 0:u,ref:i}))},DF=["x","y","top","left","width","height","className"];function ix(){return ix=Object.assign?Object.assign.bind():function(e){for(var t=1;t"M".concat(e,",").concat(i,"v").concat(n,"M").concat(o,",").concat(t,"h").concat(r),WF=e=>{var t=e.x,r=t===void 0?0:t,n=e.y,i=n===void 0?0:n,o=e.top,c=o===void 0?0:o,u=e.left,f=u===void 0?0:u,h=e.width,m=h===void 0?0:h,p=e.height,v=p===void 0?0:p,b=e.className,S=FF(e,DF),w=LF({x:r,y:i,top:c,left:f,width:m,height:v},S);return!Ee(r)||!Ee(i)||!Ee(m)||!Ee(v)||!Ee(c)||!Ee(f)?null:x.createElement("path",ix({},an(w),{className:nt("recharts-cross",b),d:UF(r,i,m,v,c,f)}))};function HF(e,t,r,n){var i=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-i,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}var zf=1e-4,JA=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],eC=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),Mj=(e,t)=>r=>{var n=JA(e,t);return eC(n,r)},KF=(e,t)=>r=>{var n=JA(e,t),i=[...n.map((o,c)=>o*c).slice(1),0];return eC(i,r)},GF=e=>{var t,r=e.split("(");if(r.length!==2||r[0]!=="cubic-bezier")return null;var n=(t=r[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(n==null||n.length!==4)return null;var i=n.map(o=>parseFloat(o));return[i[0],i[1],i[2],i[3]]},VF=function(){for(var t=arguments.length,r=new Array(t),n=0;n{var i=Mj(e,r),o=Mj(t,n),c=KF(e,r),u=h=>h>1?1:h<0?0:h,f=h=>{for(var m=h>1?1:h,p=m,v=0;v<8;++v){var b=i(p)-m,S=c(p);if(Math.abs(b-m)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,o=i===void 0?8:i,c=t.dt,u=c===void 0?16.67:c,f=1,h=[0],m=0,p=0,v=1e4,b=0;b{var E,A,C;if(N<=0)return 0;if(N>=1)return f;var _=N*k,O=Math.floor(_),D=_-O;return((E=h[O])!==null&&E!==void 0?E:0)+(((A=h[O+1])!==null&&A!==void 0?A:0)-((C=h[O])!==null&&C!==void 0?C:0))*D}},YF=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Ij(e);case"spring":return QF();default:if(e.split("(")[0]==="cubic-bezier")return Ij(e)}return typeof e=="function"?e:null},ZF=(e,t,r)=>{var n,i=o=>{var c=t.tick(o);if(t.getState()==="active"){if(r(t.getInterpolated()),t.getProgress()===1){t.complete(),n=void 0;return}n=e.setTimeout(i,c);return}n=e.setTimeout(i,c)};return n=e.setTimeout(i,0),()=>{var o;return(o=n)===null||o===void 0?void 0:o()}},tC=x.createContext(ZF);tC.Provider;function XF(e){var t=x.useContext(tC);return x.useMemo(()=>e??t,[e,t])}function JF(e,t,r){return(t=e9(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function e9(e){var t=t9(e,"string");return typeof t=="symbol"?t:t+""}function t9(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Tj="init",Dj="pending",Lj="active",r9="completed";function Ig(e){return Math.max(0,e)}class n9{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(t){var r;JF(this,"state",Tj),this.animationId=t.animationId,this.onAnimationEnd=t.onAnimationEnd,this.animationDuration=Ig(t.animationDuration),this.animationBegin=Ig(t.animationBegin),this.progress=0,this.from=t.from,this.to=t.to,this.easing=t.easing,(r=t.onAnimationStart)===null||r===void 0||r.call(t)}getState(){return this.state}getEasing(){return this.easing}getAnimationDuration(){return this.animationDuration}tick(t){if(this.getState()===Tj)return this.state=Dj,this.beginStartedTime=t,this.animationBegin;if(this.getState()===Dj){if(this.beginStartedTime==null)throw new Error;var r=t-this.beginStartedTime;return r>=this.animationBegin?(this.state=Lj,this.animationStartedTime=t,this.nextAnimationUpdate(0)):Ig(this.animationBegin-r)}if(this.getState()===Lj){if(this.animationStartedTime==null)throw new Error;var n=t-this.animationStartedTime;return this.setProgress(n/this.animationDuration),this.nextAnimationUpdate(n)}return 0}setProgress(t){this.progress=Math.min(1,Math.max(0,t))}getProgress(){return this.progress}complete(){if(this.progress=1,this.state==="active"){var t;(t=this.onAnimationEnd)===null||t===void 0||t.call(this)}this.state=r9}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}}class i9 extends n9{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(mi(this.getFrom(),this.getTo(),this.getProgress()))}}class a9{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),i=null,o=c=>{c-n>=r?t(c):i=requestAnimationFrame(o)};return i=requestAnimationFrame(o),()=>{i!=null&&cancelAnimationFrame(i)}}}function o9(e,t){return u9(e)||c9(e,t)||l9(e,t)||s9()}function s9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function l9(e,t){if(e){if(typeof e=="string")return Rj(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Rj(e,t):void 0}}function Rj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{},onAnimationStart:()=>{}},$j=0,Tg=1;function rC(e){var t=ln(e,d9),r=t.animationId,n=t.isActive,i=t.canBegin,o=t.duration,c=t.easing,u=t.begin,f=t.onAnimationEnd,h=t.onAnimationStart,m=t.children,p=ZA(),v=n==="auto"?!du.isSsr&&!p:n,b=XF(t.animationController),S=x.useState(v?$j:Tg),w=o9(S,2),k=w[0],N=w[1];return x.useEffect(()=>{v||N(Tg)},[v]),x.useEffect(()=>{var E=YF(c);if(!v||!i||E==null)return rl;var A=new a9,C=new i9({animationId:r,easing:E,animationDuration:o,animationBegin:u,onAnimationStart:h,onAnimationEnd:f,from:$j,to:Tg});return b(A,C,N)},[b,r,v,i,o,c,u,h,f]),m(Number(k))}function nC(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=x.useRef(Ic(t)),n=x.useRef(e);return n.current!==e&&(r.current=Ic(t),n.current=e),r.current}var f9=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),h9=(e,t,r)=>e.map(n=>"".concat(f9(n)," ").concat(t,"ms ").concat(r)).join(","),m9=["radius"],p9=["radius"],zj,Fj,Bj,Uj,Wj,Hj,Kj,Gj,Vj,qj;function Qj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Yj(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{var o=ga(r),c=ga(n),u=Math.min(Math.abs(o)/2,Math.abs(c)/2),f=c>=0?1:-1,h=o>=0?1:-1,m=c>=0&&o>=0||c<0&&o<0?1:0,p;if(u>0&&Array.isArray(i)){for(var v=[0,0,0,0],b=0,S=4;bu?u:k}p=qt(zj||(zj=Dn(["M",",",""])),e,t+f*v[0]),v[0]>0&&(p+=qt(Fj||(Fj=Dn(["A ",",",",0,0,",",",",",""])),v[0],v[0],m,e+h*v[0],t)),p+=qt(Bj||(Bj=Dn(["L ",",",""])),e+r-h*v[1],t),v[1]>0&&(p+=qt(Uj||(Uj=Dn(["A ",",",",0,0,",`, + `,",",""])),v[1],v[1],m,e+r,t+f*v[1])),p+=qt(Wj||(Wj=Dn(["L ",",",""])),e+r,t+n-f*v[2]),v[2]>0&&(p+=qt(Hj||(Hj=Dn(["A ",",",",0,0,",`, + `,",",""])),v[2],v[2],m,e+r-h*v[2],t+n)),p+=qt(Kj||(Kj=Dn(["L ",",",""])),e+h*v[3],t+n),v[3]>0&&(p+=qt(Gj||(Gj=Dn(["A ",",",",0,0,",`, + `,",",""])),v[3],v[3],m,e,t+n-f*v[3])),p+="Z"}else if(u>0&&i===+i&&i>0){var N=Math.min(u,i);p=qt(Vj||(Vj=Dn(["M ",",",` A `,",",",0,0,",",",",",` L `,",",` A `,",",",0,0,",",",",",` L `,",",` A `,",",",0,0,",",",",",` L `,",",` - A `,",",",0,0,",",",","," Z"])),e,t+f*N,N,N,m,e+h*N,t,e+r-h*N,t,N,N,m,e+r,t+f*N,e+r,t+n-f*N,N,N,m,e+r-h*N,t+n,e+h*N,t+n,N,N,m,e,t+n-f*N)}else p=qt(Vj||(Vj=Dn(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return p},Jj={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},N9=e=>{var t=ln(e,Jj),r=x.useRef(null),n=x.useState(-1),i=b9(n,2),o=i[0],c=i[1];x.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var Z=r.current.getTotalLength();Z&&c(Z)}catch{}},[]);var u=t.x,f=t.y,h=t.width,m=t.height,p=t.radius,v=t.className,b=t.animationEasing,S=t.animationDuration,w=t.animationBegin,k=t.isAnimationActive,N=t.isUpdateAnimationActive,E=x.useRef(h),A=x.useRef(m),C=x.useRef(u),_=x.useRef(f),O=x.useMemo(()=>({x:u,y:f,width:h,height:m,radius:p}),[u,f,h,m,p]),D=rC(O,"rectangle-");if(u!==+u||f!==+f||h!==+h||m!==+m||h===0||m===0)return null;var B=nt("recharts-rectangle",v);if(!N){var z=an(t);z.radius;var $=Yj(z,m9);return x.createElement("path",Ff({},$,{x:ga(u),y:ga(f),width:ga(h),height:ga(m),radius:typeof p=="number"?p:void 0,className:B,d:Xj(u,f,h,m,p)}))}var K=E.current,W=A.current,ve=C.current,ue=_.current,pe="0px ".concat(o===-1?1:o,"px"),oe="".concat(o,"px ").concat(o,"px"),le=h9(["strokeDasharray"],S,typeof b=="string"?b:Jj.animationEasing);return x.createElement(tC,{animationId:D,key:D,canBegin:o>0,duration:S,easing:b,isActive:N,begin:w},Z=>{var ie=mi(K,h,Z),te=mi(W,m,Z),I=mi(ve,u,Z),M=mi(ue,f,Z);r.current&&(E.current=ie,A.current=te,C.current=I,_.current=M);var U;k?Z>0?U={transition:le,strokeDasharray:oe}:U={strokeDasharray:pe}:U={strokeDasharray:oe};var ne=an(t);ne.radius;var ee=Yj(ne,p9);return x.createElement("path",Ff({},ee,{radius:typeof p=="number"?p:void 0,className:B,d:Xj(I,M,ie,te,p),ref:r,style:Qj(Qj({},U),t.style)}))})};function e2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function t2(e){for(var t=1;te*180/Math.PI,Zt=(e,t,r,n)=>({x:e+Math.cos(-Bf*n)*r,y:t+Math.sin(-Bf*n)*r}),O9=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},_9=(e,t)=>{var r=e.x,n=e.y,i=t.x,o=t.y;return Math.sqrt((r-i)**2+(n-o)**2)},M9=(e,t)=>{var r=e.x,n=e.y,i=t.cx,o=t.cy,c=_9({x:r,y:n},{x:i,y:o});if(c<=0)return{radius:c,angle:0};var u=(r-i)/c,f=Math.acos(u);return n>o&&(f=2*Math.PI-f),{radius:c,angle:P9(f),angleInRadian:f}},I9=e=>{var t=e.startAngle,r=e.endAngle,n=Math.floor(t/360),i=Math.floor(r/360),o=Math.min(n,i);return{startAngle:t-o*360,endAngle:r-o*360}},T9=(e,t)=>{var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),o=Math.floor(n/360),c=Math.min(i,o);return e+c*360},D9=(e,t)=>{var r=e.relativeX,n=e.relativeY,i=M9({x:r,y:n},t),o=i.radius,c=i.angle,u=t.innerRadius,f=t.outerRadius;if(of||o===0)return null;var h=I9(t),m=h.startAngle,p=h.endAngle,v=c,b;if(m<=p){for(;v>p;)v-=360;for(;v=m&&v<=p}else{for(;v>m;)v-=360;for(;v=p&&v<=m}return b?t2(t2({},t),{},{radius:o,angle:T9(v,t)}):null};function nC(e){var t=e.cx,r=e.cy,n=e.radius,i=e.startAngle,o=e.endAngle,c=Zt(t,r,n,i),u=Zt(t,r,n,o);return{points:[c,u],cx:t,cy:r,radius:n,startAngle:i,endAngle:o}}var r2,n2,i2,a2,o2,s2,l2;function ix(){return ix=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=en(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},Vd=e=>{var t=e.cx,r=e.cy,n=e.radius,i=e.angle,o=e.sign,c=e.isExternal,u=e.cornerRadius,f=e.cornerIsExternal,h=u*(c?1:-1)+n,m=Math.asin(u/h)/Bf,p=f?i:i+o*m,v=Zt(t,r,h,p),b=Zt(t,r,n,p),S=f?i-o*m:i,w=Zt(t,r,h*Math.cos(m*Bf),S);return{center:v,circleTangency:b,lineTangency:w,theta:m}},iC=e=>{var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,o=e.startAngle,c=e.endAngle,u=R9(o,c),f=o+u,h=Zt(t,r,i,o),m=Zt(t,r,i,f),p=qt(r2||(r2=Ja(["M ",",",` + A `,",",",0,0,",",",","," Z"])),e,t+f*N,N,N,m,e+h*N,t,e+r-h*N,t,N,N,m,e+r,t+f*N,e+r,t+n-f*N,N,N,m,e+r-h*N,t+n,e+h*N,t+n,N,N,m,e,t+n-f*N)}else p=qt(qj||(qj=Dn(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return p},e2={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},N9=e=>{var t=ln(e,e2),r=x.useRef(null),n=x.useState(-1),i=b9(n,2),o=i[0],c=i[1];x.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var Z=r.current.getTotalLength();Z&&c(Z)}catch{}},[]);var u=t.x,f=t.y,h=t.width,m=t.height,p=t.radius,v=t.className,b=t.animationEasing,S=t.animationDuration,w=t.animationBegin,k=t.isAnimationActive,N=t.isUpdateAnimationActive,E=x.useRef(h),A=x.useRef(m),C=x.useRef(u),_=x.useRef(f),O=x.useMemo(()=>({x:u,y:f,width:h,height:m,radius:p}),[u,f,h,m,p]),D=nC(O,"rectangle-");if(u!==+u||f!==+f||h!==+h||m!==+m||h===0||m===0)return null;var B=nt("recharts-rectangle",v);if(!N){var z=an(t);z.radius;var $=Zj(z,m9);return x.createElement("path",Ff({},$,{x:ga(u),y:ga(f),width:ga(h),height:ga(m),radius:typeof p=="number"?p:void 0,className:B,d:Jj(u,f,h,m,p)}))}var K=E.current,W=A.current,ve=C.current,ue=_.current,pe="0px ".concat(o===-1?1:o,"px"),oe="".concat(o,"px ").concat(o,"px"),le=h9(["strokeDasharray"],S,typeof b=="string"?b:e2.animationEasing);return x.createElement(rC,{animationId:D,key:D,canBegin:o>0,duration:S,easing:b,isActive:N,begin:w},Z=>{var ie=mi(K,h,Z),te=mi(W,m,Z),I=mi(ve,u,Z),M=mi(ue,f,Z);r.current&&(E.current=ie,A.current=te,C.current=I,_.current=M);var U;k?Z>0?U={transition:le,strokeDasharray:oe}:U={strokeDasharray:pe}:U={strokeDasharray:oe};var ne=an(t);ne.radius;var ee=Zj(ne,p9);return x.createElement("path",Ff({},ee,{radius:typeof p=="number"?p:void 0,className:B,d:Jj(I,M,ie,te,p),ref:r,style:Yj(Yj({},U),t.style)}))})};function t2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function r2(e){for(var t=1;te*180/Math.PI,Zt=(e,t,r,n)=>({x:e+Math.cos(-Bf*n)*r,y:t+Math.sin(-Bf*n)*r}),O9=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},_9=(e,t)=>{var r=e.x,n=e.y,i=t.x,o=t.y;return Math.sqrt((r-i)**2+(n-o)**2)},M9=(e,t)=>{var r=e.x,n=e.y,i=t.cx,o=t.cy,c=_9({x:r,y:n},{x:i,y:o});if(c<=0)return{radius:c,angle:0};var u=(r-i)/c,f=Math.acos(u);return n>o&&(f=2*Math.PI-f),{radius:c,angle:P9(f),angleInRadian:f}},I9=e=>{var t=e.startAngle,r=e.endAngle,n=Math.floor(t/360),i=Math.floor(r/360),o=Math.min(n,i);return{startAngle:t-o*360,endAngle:r-o*360}},T9=(e,t)=>{var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),o=Math.floor(n/360),c=Math.min(i,o);return e+c*360},D9=(e,t)=>{var r=e.relativeX,n=e.relativeY,i=M9({x:r,y:n},t),o=i.radius,c=i.angle,u=t.innerRadius,f=t.outerRadius;if(of||o===0)return null;var h=I9(t),m=h.startAngle,p=h.endAngle,v=c,b;if(m<=p){for(;v>p;)v-=360;for(;v=m&&v<=p}else{for(;v>m;)v-=360;for(;v=p&&v<=m}return b?r2(r2({},t),{},{radius:o,angle:T9(v,t)}):null};function iC(e){var t=e.cx,r=e.cy,n=e.radius,i=e.startAngle,o=e.endAngle,c=Zt(t,r,n,i),u=Zt(t,r,n,o);return{points:[c,u],cx:t,cy:r,radius:n,startAngle:i,endAngle:o}}var n2,i2,a2,o2,s2,l2,c2;function ax(){return ax=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=en(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},qd=e=>{var t=e.cx,r=e.cy,n=e.radius,i=e.angle,o=e.sign,c=e.isExternal,u=e.cornerRadius,f=e.cornerIsExternal,h=u*(c?1:-1)+n,m=Math.asin(u/h)/Bf,p=f?i:i+o*m,v=Zt(t,r,h,p),b=Zt(t,r,n,p),S=f?i-o*m:i,w=Zt(t,r,h*Math.cos(m*Bf),S);return{center:v,circleTangency:b,lineTangency:w,theta:m}},aC=e=>{var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,o=e.startAngle,c=e.endAngle,u=L9(o,c),f=o+u,h=Zt(t,r,i,o),m=Zt(t,r,i,f),p=qt(n2||(n2=Ja(["M ",",",` A `,",",`,0, `,",",`, `,",",` - `])),h.x,h.y,i,i,+(Math.abs(u)>180),+(o>f),m.x,m.y);if(n>0){var v=Zt(t,r,n,o),b=Zt(t,r,n,f);p+=qt(n2||(n2=Ja(["L ",",",` + `])),h.x,h.y,i,i,+(Math.abs(u)>180),+(o>f),m.x,m.y);if(n>0){var v=Zt(t,r,n,o),b=Zt(t,r,n,f);p+=qt(i2||(i2=Ja(["L ",",",` A `,",",`,0, `,",",`, - `,","," Z"])),b.x,b.y,n,n,+(Math.abs(u)>180),+(o<=f),v.x,v.y)}else p+=qt(i2||(i2=Ja(["L ",","," Z"])),t,r);return p},L9=e=>{var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,o=e.cornerRadius,c=e.forceCornerRadius,u=e.cornerIsExternal,f=e.startAngle,h=e.endAngle,m=en(h-f),p=Vd({cx:t,cy:r,radius:i,angle:f,sign:m,cornerRadius:o,cornerIsExternal:u}),v=p.circleTangency,b=p.lineTangency,S=p.theta,w=Vd({cx:t,cy:r,radius:i,angle:h,sign:-m,cornerRadius:o,cornerIsExternal:u}),k=w.circleTangency,N=w.lineTangency,E=w.theta,A=u?Math.abs(f-h):Math.abs(f-h)-S-E;if(A<0)return c?qt(a2||(a2=Ja(["M ",",",` + `,","," Z"])),b.x,b.y,n,n,+(Math.abs(u)>180),+(o<=f),v.x,v.y)}else p+=qt(a2||(a2=Ja(["L ",","," Z"])),t,r);return p},R9=e=>{var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,o=e.cornerRadius,c=e.forceCornerRadius,u=e.cornerIsExternal,f=e.startAngle,h=e.endAngle,m=en(h-f),p=qd({cx:t,cy:r,radius:i,angle:f,sign:m,cornerRadius:o,cornerIsExternal:u}),v=p.circleTangency,b=p.lineTangency,S=p.theta,w=qd({cx:t,cy:r,radius:i,angle:h,sign:-m,cornerRadius:o,cornerIsExternal:u}),k=w.circleTangency,N=w.lineTangency,E=w.theta,A=u?Math.abs(f-h):Math.abs(f-h)-S-E;if(A<0)return c?qt(o2||(o2=Ja(["M ",",",` a`,",",",0,0,1,",`,0 a`,",",",0,0,1,",`,0 - `])),b.x,b.y,o,o,o*2,o,o,-o*2):iC({cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:f,endAngle:h});var C=qt(o2||(o2=Ja(["M ",",",` + `])),b.x,b.y,o,o,o*2,o,o,-o*2):aC({cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:f,endAngle:h});var C=qt(s2||(s2=Ja(["M ",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` A`,",",",0,0,",",",",",` - `])),b.x,b.y,o,o,+(m<0),v.x,v.y,i,i,+(A>180),+(m<0),k.x,k.y,o,o,+(m<0),N.x,N.y);if(n>0){var _=Vd({cx:t,cy:r,radius:n,angle:f,sign:m,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),O=_.circleTangency,D=_.lineTangency,B=_.theta,z=Vd({cx:t,cy:r,radius:n,angle:h,sign:-m,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),$=z.circleTangency,K=z.lineTangency,W=z.theta,ve=u?Math.abs(f-h):Math.abs(f-h)-B-W;if(ve<0&&o===0)return"".concat(C,"L").concat(t,",").concat(r,"Z");C+=qt(s2||(s2=Ja(["L",",",` + `])),b.x,b.y,o,o,+(m<0),v.x,v.y,i,i,+(A>180),+(m<0),k.x,k.y,o,o,+(m<0),N.x,N.y);if(n>0){var _=qd({cx:t,cy:r,radius:n,angle:f,sign:m,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),O=_.circleTangency,D=_.lineTangency,B=_.theta,z=qd({cx:t,cy:r,radius:n,angle:h,sign:-m,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),$=z.circleTangency,K=z.lineTangency,W=z.theta,ve=u?Math.abs(f-h):Math.abs(f-h)-B-W;if(ve<0&&o===0)return"".concat(C,"L").concat(t,",").concat(r,"Z");C+=qt(l2||(l2=Ja(["L",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` - A`,",",",0,0,",",",",","Z"])),K.x,K.y,o,o,+(m<0),$.x,$.y,n,n,+(ve>180),+(m>0),O.x,O.y,o,o,+(m<0),D.x,D.y)}else C+=qt(l2||(l2=Ja(["L",",","Z"])),t,r);return C},$9={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},z9=e=>{var t=ln(e,$9),r=t.cx,n=t.cy,i=t.innerRadius,o=t.outerRadius,c=t.cornerRadius,u=t.forceCornerRadius,f=t.cornerIsExternal,h=t.startAngle,m=t.endAngle,p=t.className;if(o0&&Math.abs(h-m)<360?w=L9({cx:r,cy:n,innerRadius:i,outerRadius:o,cornerRadius:Math.min(S,b/2),forceCornerRadius:u,cornerIsExternal:f,startAngle:h,endAngle:m}):w=iC({cx:r,cy:n,innerRadius:i,outerRadius:o,startAngle:h,endAngle:m}),x.createElement("path",ix({},an(t),{className:v,d:w}))};function F9(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(zE(t)){if(e==="centric"){var n=t.cx,i=t.cy,o=t.innerRadius,c=t.outerRadius,u=t.angle,f=Zt(n,i,o,u),h=Zt(n,i,c,u);return[{x:f.x,y:f.y},{x:h.x,y:h.y}]}return nC(t)}}function B9(e){return JE(e)?NaN:Number(e)}function Tg(e){return e?(e=B9(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function aC(e,t,r){r&&typeof r!="number"&&$v(e,t,r)&&(t=r=void 0),e=Tg(e),t===void 0?(t=e,e=0):t=Tg(t),r=r===void 0?ee.chartData,h0=Q([Cn],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Gh=(e,t,r,n)=>n?h0(e):Cn(e),U9=(e,t,r)=>r?h0(e):Cn(e),W9=Q([Gh],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});Q([h0],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});var H9=Q([Cn],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});function m0(e,t){return q9(e)||V9(e,t)||G9(e,t)||K9()}function K9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function G9(e,t){if(e){if(typeof e=="string")return c2(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c2(e,t):void 0}}function c2(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.e^o.s<0?1:-1;for(n=o.d.length,i=e.d.length,t=0,r=ne.d[t]^o.s<0?1:-1;return n===i?0:n>i^o.s<0?1:-1};je.decimalPlaces=je.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ct;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};je.dividedBy=je.div=function(e){return xi(this,new this.constructor(e))};je.dividedToIntegerBy=je.idiv=function(e){var t=this,r=t.constructor;return tt(xi(t,new r(e),0,1),r.precision)};je.equals=je.eq=function(e){return!this.cmp(e)};je.exponent=function(){return Et(this)};je.greaterThan=je.gt=function(e){return this.cmp(e)>0};je.greaterThanOrEqualTo=je.gte=function(e){return this.cmp(e)>=0};je.isInteger=je.isint=function(){return this.e>this.d.length-2};je.isNegative=je.isneg=function(){return this.s<0};je.isPositive=je.ispos=function(){return this.s>0};je.isZero=function(){return this.s===0};je.lessThan=je.lt=function(e){return this.cmp(e)<0};je.lessThanOrEqualTo=je.lte=function(e){return this.cmp(e)<1};je.logarithm=je.log=function(e){var t,r=this,n=r.constructor,i=n.precision,o=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq($r))throw Error(sn+"NaN");if(r.s<1)throw Error(sn+(r.s?"NaN":"-Infinity"));return r.eq($r)?new n(0):(ft=!1,t=xi(zc(r,o),zc(e,o),o),ft=!0,tt(t,i))};je.minus=je.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?uC(t,e):lC(t,(e.s=-e.s,e))};je.modulo=je.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(sn+"NaN");return r.s?(ft=!1,t=xi(r,e,0,1).times(e),ft=!0,r.minus(t)):tt(new n(r),i)};je.naturalExponential=je.exp=function(){return cC(this)};je.naturalLogarithm=je.ln=function(){return zc(this)};je.negated=je.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};je.plus=je.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?lC(t,e):uC(t,(e.s=-e.s,e))};je.precision=je.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(vo+e);if(t=Et(i)+1,n=i.d.length-1,r=n*ct+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};je.squareRoot=je.sqrt=function(){var e,t,r,n,i,o,c,u=this,f=u.constructor;if(u.s<1){if(!u.s)return new f(0);throw Error(sn+"NaN")}for(e=Et(u),ft=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=Wn(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=al((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new f(t)):n=new f(i.toString()),r=f.precision,i=c=r+3;;)if(o=n,n=o.plus(xi(u,o,c+2)).times(.5),Wn(o.d).slice(0,c)===(t=Wn(n.d)).slice(0,c)){if(t=t.slice(c-3,c+1),i==c&&t=="4999"){if(tt(o,r+1,0),o.times(o).eq(u)){n=o;break}}else if(t!="9999")break;c+=4}return ft=!0,tt(n,r)};je.times=je.mul=function(e){var t,r,n,i,o,c,u,f,h,m=this,p=m.constructor,v=m.d,b=(e=new p(e)).d;if(!m.s||!e.s)return new p(0);for(e.s*=m.s,r=m.e+e.e,f=v.length,h=b.length,f=0;){for(t=0,i=f+n;i>n;)u=o[i]+b[n]*v[i-n-1]+t,o[i--]=u%zt|0,t=u/zt|0;o[i]=(o[i]+t)%zt|0}for(;!o[--c];)o.pop();return t?++r:o.shift(),e.d=o,e.e=r,ft?tt(e,p.precision):e};je.toDecimalPlaces=je.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Qn(e,0,il),t===void 0?t=n.rounding:Qn(t,0,8),tt(r,e+Et(r)+1,t))};je.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=No(n,!0):(Qn(e,0,il),t===void 0?t=i.rounding:Qn(t,0,8),n=tt(new i(n),e+1,t),r=No(n,!0,e+1)),r};je.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?No(i):(Qn(e,0,il),t===void 0?t=o.rounding:Qn(t,0,8),n=tt(new o(i),e+Et(i)+1,t),r=No(n.abs(),!1,e+Et(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};je.toInteger=je.toint=function(){var e=this,t=e.constructor;return tt(new t(e),Et(e)+1,t.rounding)};je.toNumber=function(){return+this};je.toPower=je.pow=function(e){var t,r,n,i,o,c,u=this,f=u.constructor,h=12,m=+(e=new f(e));if(!e.s)return new f($r);if(u=new f(u),!u.s){if(e.s<1)throw Error(sn+"Infinity");return u}if(u.eq($r))return u;if(n=f.precision,e.eq($r))return tt(u,n);if(t=e.e,r=e.d.length-1,c=t>=r,o=u.s,c){if((r=m<0?-m:m)<=sC){for(i=new f($r),t=Math.ceil(n/ct+4),ft=!1;r%2&&(i=i.times(u),f2(i.d,t)),r=al(r/2),r!==0;)u=u.times(u),f2(u.d,t);return ft=!0,e.s<0?new f($r).div(i):tt(i,n)}}else if(o<0)throw Error(sn+"NaN");return o=o<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,ft=!1,i=e.times(zc(u,n+h)),ft=!0,i=cC(i),i.s=o,i};je.toPrecision=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?(r=Et(i),n=No(i,r<=o.toExpNeg||r>=o.toExpPos)):(Qn(e,1,il),t===void 0?t=o.rounding:Qn(t,0,8),i=tt(new o(i),e,t),r=Et(i),n=No(i,e<=r||r<=o.toExpNeg,e)),n};je.toSignificantDigits=je.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Qn(e,1,il),t===void 0?t=n.rounding:Qn(t,0,8)),tt(new n(r),e,t)};je.toString=je.valueOf=je.val=je.toJSON=je[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Et(e),r=e.constructor;return No(e,t<=r.toExpNeg||t>=r.toExpPos)};function lC(e,t){var r,n,i,o,c,u,f,h,m=e.constructor,p=m.precision;if(!e.s||!t.s)return t.s||(t=new m(e)),ft?tt(t,p):t;if(f=e.d,h=t.d,c=e.e,i=t.e,f=f.slice(),o=c-i,o){for(o<0?(n=f,o=-o,u=h.length):(n=h,i=c,u=f.length),c=Math.ceil(p/ct),u=c>u?c+1:u+1,o>u&&(o=u,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(u=f.length,o=h.length,u-o<0&&(o=u,n=h,h=f,f=n),r=0;o;)r=(f[--o]=f[o]+h[o]+r)/zt|0,f[o]%=zt;for(r&&(f.unshift(r),++i),u=f.length;f[--u]==0;)f.pop();return t.d=f,t.e=i,ft?tt(t,p):t}function Qn(e,t,r){if(e!==~~e||er)throw Error(vo+e)}function Wn(e){var t,r,n,i=e.length-1,o="",c=e[0];if(i>0){for(o+=c,t=1;tc?1:-1;else for(u=f=0;ui[u]?1:-1;break}return f}function r(n,i,o){for(var c=0;o--;)n[o]-=c,c=n[o]1;)n.shift()}return function(n,i,o,c){var u,f,h,m,p,v,b,S,w,k,N,E,A,C,_,O,D,B,z=n.constructor,$=n.s==i.s?1:-1,K=n.d,W=i.d;if(!n.s)return new z(n);if(!i.s)throw Error(sn+"Division by zero");for(f=n.e-i.e,D=W.length,_=K.length,b=new z($),S=b.d=[],h=0;W[h]==(K[h]||0);)++h;if(W[h]>(K[h]||0)&&--f,o==null?E=o=z.precision:c?E=o+(Et(n)-Et(i))+1:E=o,E<0)return new z(0);if(E=E/ct+2|0,h=0,D==1)for(m=0,W=W[0],E++;(h<_||m)&&E--;h++)A=m*zt+(K[h]||0),S[h]=A/W|0,m=A%W|0;else{for(m=zt/(W[0]+1)|0,m>1&&(W=e(W,m),K=e(K,m),D=W.length,_=K.length),C=D,w=K.slice(0,D),k=w.length;k=zt/2&&++O;do m=0,u=t(W,w,D,k),u<0?(N=w[0],D!=k&&(N=N*zt+(w[1]||0)),m=N/O|0,m>1?(m>=zt&&(m=zt-1),p=e(W,m),v=p.length,k=w.length,u=t(p,w,v,k),u==1&&(m--,r(p,D16)throw Error(p0+Et(e));if(!e.s)return new m($r);for(ft=!1,u=p,c=new m(.03125);e.abs().gte(.1);)e=e.times(c),h+=5;for(n=Math.log(Ya(2,h))/Math.LN10*2+5|0,u+=n,r=i=o=new m($r),m.precision=u;;){if(i=tt(i.times(e),u),r=r.times(++f),c=o.plus(xi(i,r,u)),Wn(c.d).slice(0,u)===Wn(o.d).slice(0,u)){for(;h--;)o=tt(o.times(o),u);return m.precision=p,t==null?(ft=!0,tt(o,p)):o}o=c}}function Et(e){for(var t=e.e*ct,r=e.d[0];r>=10;r/=10)t++;return t}function Dg(e,t,r){if(t>e.LN10.sd())throw ft=!0,r&&(e.precision=r),Error(sn+"LN10 precision limit exceeded");return tt(new e(e.LN10),t)}function aa(e){for(var t="";e--;)t+="0";return t}function zc(e,t){var r,n,i,o,c,u,f,h,m,p=1,v=10,b=e,S=b.d,w=b.constructor,k=w.precision;if(b.s<1)throw Error(sn+(b.s?"NaN":"-Infinity"));if(b.eq($r))return new w(0);if(t==null?(ft=!1,h=k):h=t,b.eq(10))return t==null&&(ft=!0),Dg(w,h);if(h+=v,w.precision=h,r=Wn(S),n=r.charAt(0),o=Et(b),Math.abs(o)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)b=b.times(e),r=Wn(b.d),n=r.charAt(0),p++;o=Et(b),n>1?(b=new w("0."+r),o++):b=new w(n+"."+r.slice(1))}else return f=Dg(w,h+2,k).times(o+""),b=zc(new w(n+"."+r.slice(1)),h-v).plus(f),w.precision=k,t==null?(ft=!0,tt(b,k)):b;for(u=c=b=xi(b.minus($r),b.plus($r),h),m=tt(b.times(b),h),i=3;;){if(c=tt(c.times(m),h),f=u.plus(xi(c,new w(i),h)),Wn(f.d).slice(0,h)===Wn(u.d).slice(0,h))return u=u.times(2),o!==0&&(u=u.plus(Dg(w,h+2,k).times(o+""))),u=xi(u,new w(p),h),w.precision=k,t==null?(ft=!0,tt(u,k)):u;u=f,i+=2}}function d2(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=al(r/ct),e.d=[],n=(r+1)%ct,r<0&&(n+=ct),nUf||e.e<-Uf))throw Error(p0+r)}else e.s=0,e.e=0,e.d=[0];return e}function tt(e,t,r){var n,i,o,c,u,f,h,m,p=e.d;for(c=1,o=p[0];o>=10;o/=10)c++;if(n=t-c,n<0)n+=ct,i=t,h=p[m=0];else{if(m=Math.ceil((n+1)/ct),o=p.length,m>=o)return e;for(h=o=p[m],c=1;o>=10;o/=10)c++;n%=ct,i=n-ct+c}if(r!==void 0&&(o=Ya(10,c-i-1),u=h/o%10|0,f=t<0||p[m+1]!==void 0||h%o,f=r<4?(u||f)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||f||r==6&&(n>0?i>0?h/Ya(10,c-i):0:p[m-1])%10&1||r==(e.s<0?8:7))),t<1||!p[0])return f?(o=Et(e),p.length=1,t=t-o-1,p[0]=Ya(10,(ct-t%ct)%ct),e.e=al(-t/ct)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(n==0?(p.length=m,o=1,m--):(p.length=m+1,o=Ya(10,ct-n),p[m]=i>0?(h/Ya(10,c-i)%Ya(10,i)|0)*o:0),f)for(;;)if(m==0){(p[0]+=o)==zt&&(p[0]=1,++e.e);break}else{if(p[m]+=o,p[m]!=zt)break;p[m--]=0,o=1}for(n=p.length;p[--n]===0;)p.pop();if(ft&&(e.e>Uf||e.e<-Uf))throw Error(p0+Et(e));return e}function uC(e,t){var r,n,i,o,c,u,f,h,m,p,v=e.constructor,b=v.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new v(e),ft?tt(t,b):t;if(f=e.d,p=t.d,n=t.e,h=e.e,f=f.slice(),c=h-n,c){for(m=c<0,m?(r=f,c=-c,u=p.length):(r=p,n=h,u=f.length),i=Math.max(Math.ceil(b/ct),u)+2,c>i&&(c=i,r.length=1),r.reverse(),i=c;i--;)r.push(0);r.reverse()}else{for(i=f.length,u=p.length,m=i0;--i)f[u++]=0;for(i=p.length;i>c;){if(f[--i]0?o=o.charAt(0)+"."+o.slice(1)+aa(n):c>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+aa(-i-1)+o,r&&(n=r-c)>0&&(o+=aa(n))):i>=c?(o+=aa(i+1-c),r&&(n=r-i-1)>0&&(o=o+"."+aa(n))):((n=i+1)0&&(i+1===c&&(o+="."),o+=aa(n))),e.s<0?"-"+o:o}function f2(e,t){if(e.length>t)return e.length=t,!0}function dC(e){var t,r,n;function i(o){var c=this;if(!(c instanceof i))return new i(o);if(c.constructor=i,o instanceof i){c.s=o.s,c.e=o.e,c.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(vo+o);if(o>0)c.s=1;else if(o<0)o=-o,c.s=-1;else{c.s=0,c.e=0,c.d=[0];return}if(o===~~o&&o<1e7){c.e=0,c.d=[o];return}return d2(c,o.toString())}else if(typeof o!="string")throw Error(vo+o);if(o.charCodeAt(0)===45?(o=o.slice(1),c.s=-1):c.s=1,Z9.test(o))d2(c,o);else throw Error(vo+o)}if(i.prototype=je,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=dC,i.config=i.set=X9,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(vo+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(vo+r+": "+n);return this}var g0=dC(Y9);$r=new g0(1);const Ge=g0;function fC(e){var t;return e===0?t=1:t=Math.floor(new Ge(e).abs().log(10).toNumber())+1,t}function hC(e,t,r){for(var n=new Ge(e),i=0,o=[];n.lt(t)&&i<1e5;)o.push(n.toNumber()),n=n.add(r),i++;return o}function Fc(e,t){return r7(e)||t7(e,t)||e7(e,t)||J9()}function J9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e7(e,t){if(e){if(typeof e=="string")return h2(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h2(e,t):void 0}}function h2(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=Fc(e,2),r=t[0],n=t[1],i=r,o=n;return r>n&&(i=n,o=r),[i,o]},v0=(e,t,r)=>{if(e.lte(0))return new Ge(0);var n=fC(e.toNumber()),i=new Ge(10).pow(n),o=e.div(i),c=n!==1?.05:.1,u=new Ge(Math.ceil(o.div(c).toNumber())).add(r).mul(c),f=u.mul(i);return t?new Ge(f.toNumber()):new Ge(Math.ceil(f.toNumber()))},pC=(e,t,r)=>{var n;if(e.lte(0))return new Ge(0);var i=[1,2,2.5,5],o=e.toNumber(),c=Math.floor(new Ge(o).abs().log(10).toNumber()),u=new Ge(10).pow(c),f=e.div(u).toNumber(),h=i.findIndex(b=>b>=f-1e-10);if(h===-1&&(u=u.mul(10),h=0),h+=r,h>=i.length){var m=Math.floor(h/i.length);h%=i.length,u=u.mul(new Ge(10).pow(m))}var p=(n=i[h])!==null&&n!==void 0?n:1,v=new Ge(p).mul(u);return t?v:new Ge(Math.ceil(v.toNumber()))},n7=(e,t,r)=>{var n=new Ge(1),i=new Ge(e);if(!i.isint()&&r){var o=Math.abs(e);o<1?(n=new Ge(10).pow(fC(e)-1),i=new Ge(Math.floor(i.div(n).toNumber())).mul(n)):o>1&&(i=new Ge(Math.floor(e)))}else e===0?i=new Ge(Math.floor((t-1)/2)):r||(i=new Ge(Math.floor(e)));for(var c=Math.floor((t-1)/2),u=[],f=0;f4&&arguments[4]!==void 0?arguments[4]:0,c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:v0;if(!Number.isFinite((r-t)/(n-1)))return{step:new Ge(0),tickMin:new Ge(0),tickMax:new Ge(0)};var u=c(new Ge(r).sub(t).div(n-1),i,o),f;t<=0&&r>=0?f=new Ge(0):(f=new Ge(t).add(r).div(2),f=f.sub(new Ge(f).mod(u)));var h=Math.ceil(f.sub(t).div(u).toNumber()),m=Math.ceil(new Ge(r).sub(f).div(u).toNumber()),p=h+m+1;return p>n?gC(t,r,n,i,o+1,c):(p0?m+(n-p):m,h=r>0?h:h+(n-p)),{step:u,tickMin:f.sub(new Ge(h).mul(u)),tickMax:f.add(new Ge(m).mul(u))})},m2=function(t){var r=Fc(t,2),n=r[0],i=r[1],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",f=Math.max(o,2),h=mC([n,i]),m=Fc(h,2),p=m[0],v=m[1];if(p===-1/0||v===1/0){var b=v===1/0?[p,...Array(o-1).fill(1/0)]:[...Array(o-1).fill(-1/0),v];return n>i?b.reverse():b}if(p===v)return n7(p,o,c);var S=u==="snap125"?pC:v0,w=gC(p,v,f,c,0,S),k=w.step,N=w.tickMin,E=w.tickMax,A=hC(N,E.add(new Ge(.1).mul(k)),k);return n>i?A.reverse():A},p2=function(t,r){var n=Fc(t,2),i=n[0],o=n[1],c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",f=mC([i,o]),h=Fc(f,2),m=h[0],p=h[1];if(m===-1/0||p===1/0)return[i,o];if(m===p)return[m];var v=u==="snap125"?pC:v0,b=Math.max(r,2),S=v(new Ge(p).sub(m).div(b-1),c,0),w=[...hC(new Ge(m),new Ge(p),S),p];return c===!1&&(w=w.map(k=>Math.round(k))),i>o?w.reverse():w},i7=e=>e.rootProps.barCategoryGap,Vh=e=>e.rootProps.stackOffset,vC=e=>e.rootProps.reverseStackOrder,x0=e=>e.options.chartName,y0=e=>e.rootProps.syncId,xC=e=>e.rootProps.syncMethod,b0=e=>e.options.eventEmitter,a7=e=>e.rootProps.baseValue,pr={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Wa={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Rn={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},qh=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Qh(e,t,r){if(r!=="auto")return r;if(e!=null)return Zn(e,t)?"category":"number"}function g2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Wf(e){for(var t=1;t{if(t!=null)return e.polarAxis.angleAxis[t]},w0=Q([c7,UA],(e,t)=>{var r;if(e!=null)return e;var n=(r=Qh(t,"angleAxis",v2.type))!==null&&r!==void 0?r:"category";return Wf(Wf({},v2),{},{type:n})}),u7=(e,t)=>e.polarAxis.radiusAxis[t],k0=Q([u7,UA],(e,t)=>{var r;if(e!=null)return e;var n=(r=Qh(t,"radiusAxis",x2.type))!==null&&r!==void 0?r:"category";return Wf(Wf({},x2),{},{type:n})}),Yh=e=>e.polarOptions,j0=Q([Ai,Ci,er],O9),yC=Q([Yh,j0],(e,t)=>{if(e!=null)return Sa(e.innerRadius,t,0)}),bC=Q([Yh,j0],(e,t)=>{if(e!=null)return Sa(e.outerRadius,t,t*.8)}),d7=e=>{if(e==null)return[0,0];var t=e.startAngle,r=e.endAngle;return[t,r]},wC=Q([Yh],d7);Q([w0,wC],qh);var kC=Q([j0,yC,bC],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});Q([k0,kC],qh);var jC=Q([ht,Yh,yC,bC,Ai,Ci],(e,t,r,n,i,o)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var c=t.cx,u=t.cy,f=t.startAngle,h=t.endAngle;return{cx:Sa(c,i,i/2),cy:Sa(u,o,o/2),innerRadius:r,outerRadius:n,startAngle:f,endAngle:h,clockWise:!1}}}),Ut=(e,t)=>t,Zh=(e,t,r)=>r;function S0(e){return e==null?void 0:e.id}function SC(e,t,r){var n=t.chartData,i=n===void 0?[]:n,o=r.allowDuplicatedCategory,c=r.dataKey,u=new Map;return e.forEach(f=>{var h,m=(h=f.data)!==null&&h!==void 0?h:i;if(!(m==null||m.length===0)){var p=S0(f);m.forEach((v,b)=>{var S=c==null||o?b:String(Ft(v,c,null)),w=Ft(v,f.dataKey,0),k;u.has(S)?k=u.get(S):k={},Object.assign(k,{[p]:w}),u.set(S,k)})}}),Array.from(u.values())}function N0(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Xh=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Jh(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function f7(e,t){if(e.length===t.length){for(var r=0;r{var t=ht(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},ol=e=>e.tooltip.settings.axisId;function E0(e){if(e!=null){var t=e.ticks,r=e.bandwidth,n=e.range(),i=[Math.min(...n),Math.max(...n)];return{domain:()=>e.domain(),range:(function(o){function c(){return o.apply(this,arguments)}return c.toString=function(){return o.toString()},c})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(o){var c=i[0],u=i[1];return c<=u?o>=c&&o<=u:o>=u&&o<=c},bandwidth:r?()=>r.call(e):void 0,ticks:t?o=>t.call(e,o):void 0,map:(o,c)=>{var u=e(o);if(u!=null){if(e.bandwidth&&c!==null&&c!==void 0&&c.position){var f=e.bandwidth();switch(c.position){case"middle":u+=f/2;break;case"end":u+=f;break}}return u}}}}}var h7=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Hn(t)){for(var r,n,i=0;in)&&(n=o))}return r!==void 0&&n!==void 0?[r,n]:void 0}return t}default:return t}};function ba(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function m7(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function A0(e){let t,r,n;e.length!==2?(t=ba,r=(u,f)=>ba(e(u),f),n=(u,f)=>e(u)-f):(t=e===ba||e===m7?e:p7,r=e,n=e);function i(u,f,h=0,m=u.length){if(h>>1;r(u[p],f)<0?h=p+1:m=p}while(h>>1;r(u[p],f)<=0?h=p+1:m=p}while(hh&&n(u[p-1],f)>-n(u[p],f)?p-1:p}return{left:i,center:c,right:o}}function p7(){return 0}function NC(e){return e===null?NaN:+e}function*g7(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const v7=A0(ba),du=v7.right;A0(NC).center;class y2 extends Map{constructor(t,r=b7){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(b2(this,t))}has(t){return super.has(b2(this,t))}set(t,r){return super.set(x7(this,t),r)}delete(t){return super.delete(y7(this,t))}}function b2({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function x7({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function y7({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function b7(e){return e!==null&&typeof e=="object"?e.valueOf():e}function w7(e=ba){if(e===ba)return EC;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function EC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const k7=Math.sqrt(50),j7=Math.sqrt(10),S7=Math.sqrt(2);function Hf(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),c=o>=k7?10:o>=j7?5:o>=S7?2:1;let u,f,h;return i<0?(h=Math.pow(10,-i)/c,u=Math.round(e*h),f=Math.round(t*h),u/ht&&--f,h=-h):(h=Math.pow(10,i)*c,u=Math.round(e/h),f=Math.round(t/h),u*ht&&--f),f0))return[];if(e===t)return[e];const n=t=i))return[];const u=o-i+1,f=new Array(u);if(n)if(c<0)for(let h=0;h=n)&&(r=n);return r}function k2(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function AC(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?EC:w7(i);n>r;){if(n-r>600){const f=n-r+1,h=t-r+1,m=Math.log(f),p=.5*Math.exp(2*m/3),v=.5*Math.sqrt(m*p*(f-p)/f)*(h-f/2<0?-1:1),b=Math.max(r,Math.floor(t-h*p/f+v)),S=Math.min(n,Math.floor(t+(f-h)*p/f+v));AC(e,t,b,S,i)}const o=e[t];let c=r,u=n;for(lc(e,r,t),i(e[n],o)>0&&lc(e,r,n);c0;)--u}i(e[r],o)===0?lc(e,r,u):(++u,lc(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function lc(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function N7(e,t,r){if(e=Float64Array.from(g7(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return k2(e);if(t>=1)return w2(e);var n,i=(n-1)*t,o=Math.floor(i),c=w2(AC(e,o).subarray(0,o+1)),u=k2(e.subarray(o+1));return c+(u-c)*(i-o)}}function E7(e,t,r=NC){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,o=Math.floor(i),c=+r(e[o],o,e),u=+r(e[o+1],o+1,e);return c+(u-c)*(i-o)}}function A7(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,o=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?qd(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?qd(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=O7.exec(e))?new Pr(t[1],t[2],t[3],1):(t=_7.exec(e))?new Pr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=M7.exec(e))?qd(t[1],t[2],t[3],t[4]):(t=I7.exec(e))?qd(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=T7.exec(e))?P2(t[1],t[2]/100,t[3]/100,1):(t=D7.exec(e))?P2(t[1],t[2]/100,t[3]/100,t[4]):j2.hasOwnProperty(e)?E2(j2[e]):e==="transparent"?new Pr(NaN,NaN,NaN,0):null}function E2(e){return new Pr(e>>16&255,e>>8&255,e&255,1)}function qd(e,t,r,n){return n<=0&&(e=t=r=NaN),new Pr(e,t,r,n)}function $7(e){return e instanceof fu||(e=Wc(e)),e?(e=e.rgb(),new Pr(e.r,e.g,e.b,e.opacity)):new Pr}function cx(e,t,r,n){return arguments.length===1?$7(e):new Pr(e,t,r,n??1)}function Pr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}O0(Pr,cx,PC(fu,{brighter(e){return e=e==null?Kf:Math.pow(Kf,e),new Pr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Bc:Math.pow(Bc,e),new Pr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pr(xo(this.r),xo(this.g),xo(this.b),Gf(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:A2,formatHex:A2,formatHex8:z7,formatRgb:C2,toString:C2}));function A2(){return`#${eo(this.r)}${eo(this.g)}${eo(this.b)}`}function z7(){return`#${eo(this.r)}${eo(this.g)}${eo(this.b)}${eo((isNaN(this.opacity)?1:this.opacity)*255)}`}function C2(){const e=Gf(this.opacity);return`${e===1?"rgb(":"rgba("}${xo(this.r)}, ${xo(this.g)}, ${xo(this.b)}${e===1?")":`, ${e})`}`}function Gf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function xo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function eo(e){return e=xo(e),(e<16?"0":"")+e.toString(16)}function P2(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new kn(e,t,r,n)}function OC(e){if(e instanceof kn)return new kn(e.h,e.s,e.l,e.opacity);if(e instanceof fu||(e=Wc(e)),!e)return new kn;if(e instanceof kn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),c=NaN,u=o-i,f=(o+i)/2;return u?(t===o?c=(r-n)/u+(r0&&f<1?0:c,new kn(c,u,f,e.opacity)}function F7(e,t,r,n){return arguments.length===1?OC(e):new kn(e,t,r,n??1)}function kn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}O0(kn,F7,PC(fu,{brighter(e){return e=e==null?Kf:Math.pow(Kf,e),new kn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Bc:Math.pow(Bc,e),new kn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Pr(Rg(e>=240?e-240:e+120,i,n),Rg(e,i,n),Rg(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new kn(O2(this.h),Qd(this.s),Qd(this.l),Gf(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Gf(this.opacity);return`${e===1?"hsl(":"hsla("}${O2(this.h)}, ${Qd(this.s)*100}%, ${Qd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function O2(e){return e=(e||0)%360,e<0?e+360:e}function Qd(e){return Math.max(0,Math.min(1,e||0))}function Rg(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const _0=e=>()=>e;function B7(e,t){return function(r){return e+r*t}}function U7(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function W7(e){return(e=+e)==1?_C:function(t,r){return r-t?U7(t,r,e):_0(isNaN(t)?r:t)}}function _C(e,t){var r=t-e;return r?B7(e,r):_0(isNaN(e)?t:e)}const _2=(function e(t){var r=W7(t);function n(i,o){var c=r((i=cx(i)).r,(o=cx(o)).r),u=r(i.g,o.g),f=r(i.b,o.b),h=_C(i.opacity,o.opacity);return function(m){return i.r=c(m),i.g=u(m),i.b=f(m),i.opacity=h(m),i+""}}return n.gamma=e,n})(1);function H7(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(o){for(i=0;ir&&(o=t.slice(r,o),u[c]?u[c]+=o:u[++c]=o),(n=n[0])===(i=i[0])?u[c]?u[c]+=i:u[++c]=i:(u[++c]=null,f.push({i:c,x:Vf(n,i)})),r=Lg.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function tB(e,t,r){var n=e[0],i=e[1],o=t[0],c=t[1];return i2?rB:tB,f=h=null,p}function p(v){return v==null||isNaN(v=+v)?o:(f||(f=u(e.map(n),t,r)))(n(c(v)))}return p.invert=function(v){return c(i((h||(h=u(t,e.map(n),Vf)))(v)))},p.domain=function(v){return arguments.length?(e=Array.from(v,qf),m()):e.slice()},p.range=function(v){return arguments.length?(t=Array.from(v),m()):t.slice()},p.rangeRound=function(v){return t=Array.from(v),r=M0,m()},p.clamp=function(v){return arguments.length?(c=v?!0:gr,m()):c!==gr},p.interpolate=function(v){return arguments.length?(r=v,m()):r},p.unknown=function(v){return arguments.length?(o=v,p):o},function(v,b){return n=v,i=b,m()}}function I0(){return em()(gr,gr)}function nB(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Qf(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Ks(e){return e=Qf(Math.abs(e)),e?e[1]:NaN}function iB(e,t){return function(r,n){for(var i=r.length,o=[],c=0,u=e[0],f=0;i>0&&u>0&&(f+u+1>n&&(u=Math.max(1,n-f)),o.push(r.substring(i-=u,i+u)),!((f+=u+1)>n));)u=e[c=(c+1)%e.length];return o.reverse().join(t)}}function aB(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var oB=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Hc(e){if(!(t=oB.exec(e)))throw new Error("invalid format: "+e);var t;return new T0({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Hc.prototype=T0.prototype;function T0(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}T0.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function sB(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var Yf;function lB(e,t){var r=Qf(e,t);if(!r)return Yf=void 0,e.toPrecision(t);var n=r[0],i=r[1],o=i-(Yf=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,c=n.length;return o===c?n:o>c?n+new Array(o-c+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+Qf(e,Math.max(0,t+o-1))[0]}function I2(e,t){var r=Qf(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const T2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:nB,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>I2(e*100,t),r:I2,s:lB,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function D2(e){return e}var R2=Array.prototype.map,L2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function cB(e){var t=e.grouping===void 0||e.thousands===void 0?D2:iB(R2.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?D2:aB(R2.call(e.numerals,String)),c=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function h(p,v){p=Hc(p);var b=p.fill,S=p.align,w=p.sign,k=p.symbol,N=p.zero,E=p.width,A=p.comma,C=p.precision,_=p.trim,O=p.type;O==="n"?(A=!0,O="g"):T2[O]||(C===void 0&&(C=12),_=!0,O="g"),(N||b==="0"&&S==="=")&&(N=!0,b="0",S="=");var D=(v&&v.prefix!==void 0?v.prefix:"")+(k==="$"?r:k==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),B=(k==="$"?n:/[%p]/.test(O)?c:"")+(v&&v.suffix!==void 0?v.suffix:""),z=T2[O],$=/[defgprs%]/.test(O);C=C===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function K(W){var ve=D,ue=B,pe,oe,le;if(O==="c")ue=z(W)+ue,W="";else{W=+W;var Z=W<0||1/W<0;if(W=isNaN(W)?f:z(Math.abs(W),C),_&&(W=sB(W)),Z&&+W==0&&w!=="+"&&(Z=!1),ve=(Z?w==="("?w:u:w==="-"||w==="("?"":w)+ve,ue=(O==="s"&&!isNaN(W)&&Yf!==void 0?L2[8+Yf/3]:"")+ue+(Z&&w==="("?")":""),$){for(pe=-1,oe=W.length;++pele||le>57){ue=(le===46?i+W.slice(pe+1):W.slice(pe))+ue,W=W.slice(0,pe);break}}}A&&!N&&(W=t(W,1/0));var ie=ve.length+W.length+ue.length,te=ie>1)+ve+W+ue+te.slice(ie);break;default:W=te+ve+W+ue;break}return o(W)}return K.toString=function(){return p+""},K}function m(p,v){var b=Math.max(-8,Math.min(8,Math.floor(Ks(v)/3)))*3,S=Math.pow(10,-b),w=h((p=Hc(p),p.type="f",p),{suffix:L2[8+b/3]});return function(k){return w(S*k)}}return{format:h,formatPrefix:m}}var Yd,D0,MC;uB({thousands:",",grouping:[3],currency:["$",""]});function uB(e){return Yd=cB(e),D0=Yd.format,MC=Yd.formatPrefix,Yd}function dB(e){return Math.max(0,-Ks(Math.abs(e)))}function fB(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ks(t)/3)))*3-Ks(Math.abs(e)))}function hB(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ks(t)-Ks(e))+1}function IC(e,t,r,n){var i=sx(e,t,r),o;switch(n=Hc(n??",f"),n.type){case"s":{var c=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=fB(i,c))&&(n.precision=o),MC(n,c)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=hB(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=dB(i))&&(n.precision=o-(n.type==="%")*2);break}}return D0(n)}function Ea(e){var t=e.domain;return e.ticks=function(r){var n=t();return ax(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return IC(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,o=n.length-1,c=n[i],u=n[o],f,h,m=10;for(u0;){if(h=ox(c,u,r),h===f)return n[i]=c,n[o]=u,t(n);if(h>0)c=Math.floor(c/h)*h,u=Math.ceil(u/h)*h;else if(h<0)c=Math.ceil(c*h)/h,u=Math.floor(u*h)/h;else break;f=h}return e},e}function TC(){var e=I0();return e.copy=function(){return hu(e,TC())},cn.apply(e,arguments),Ea(e)}function DC(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,qf),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return DC(e).unknown(t)},e=arguments.length?Array.from(e,qf):[0,1],Ea(r)}function RC(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],o=e[n],c;return oMath.pow(e,t)}function xB(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function F2(e){return(t,r)=>-e(-t,r)}function R0(e){const t=e($2,z2),r=t.domain;let n=10,i,o;function c(){return i=xB(n),o=vB(n),r()[0]<0?(i=F2(i),o=F2(o),e(mB,pB)):e($2,z2),t}return t.base=function(u){return arguments.length?(n=+u,c()):n},t.domain=function(u){return arguments.length?(r(u),c()):r()},t.ticks=u=>{const f=r();let h=f[0],m=f[f.length-1];const p=m0){for(;v<=b;++v)for(S=1;Sm)break;N.push(w)}}else for(;v<=b;++v)for(S=n-1;S>=1;--S)if(w=v>0?S/o(-v):S*o(v),!(wm)break;N.push(w)}N.length*2{if(u==null&&(u=10),f==null&&(f=n===10?"s":","),typeof f!="function"&&(!(n%1)&&(f=Hc(f)).precision==null&&(f.trim=!0),f=D0(f)),u===1/0)return f;const h=Math.max(1,n*u/t.ticks().length);return m=>{let p=m/o(Math.round(i(m)));return p*nr(RC(r(),{floor:u=>o(Math.floor(i(u))),ceil:u=>o(Math.ceil(i(u)))})),t}function LC(){const e=R0(em()).domain([1,10]);return e.copy=()=>hu(e,LC()).base(e.base()),cn.apply(e,arguments),e}function B2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function U2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function L0(e){var t=1,r=e(B2(t),U2(t));return r.constant=function(n){return arguments.length?e(B2(t=+n),U2(t)):t},Ea(r)}function $C(){var e=L0(em());return e.copy=function(){return hu(e,$C()).constant(e.constant())},cn.apply(e,arguments)}function W2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function yB(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function bB(e){return e<0?-e*e:e*e}function $0(e){var t=e(gr,gr),r=1;function n(){return r===1?e(gr,gr):r===.5?e(yB,bB):e(W2(r),W2(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Ea(t)}function z0(){var e=$0(em());return e.copy=function(){return hu(e,z0()).exponent(e.exponent())},cn.apply(e,arguments),e}function wB(){return z0.apply(null,arguments).exponent(.5)}function H2(e){return Math.sign(e)*e*e}function kB(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function zC(){var e=I0(),t=[0,1],r=!1,n;function i(o){var c=kB(e(o));return isNaN(c)?n:r?Math.round(c):c}return i.invert=function(o){return e.invert(H2(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,qf)).map(H2)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(r=!!o,i):r},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return zC(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},cn.apply(i,arguments),Ea(i)}function FC(){var e=[],t=[],r=[],n;function i(){var c=0,u=Math.max(1,t.length);for(r=new Array(u-1);++c0?r[u-1]:e[0],u=r?[n[r-1],t]:[n[h-1],n[h]]},c.unknown=function(f){return arguments.length&&(o=f),c},c.thresholds=function(){return n.slice()},c.copy=function(){return BC().domain([e,t]).range(i).unknown(o)},cn.apply(Ea(c),arguments)}function UC(){var e=[.5],t=[0,1],r,n=1;function i(o){return o!=null&&o<=o?t[du(e,o,0,n)]:r}return i.domain=function(o){return arguments.length?(e=Array.from(o),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var c=t.indexOf(o);return[e[c-1],e[c]]},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return UC().domain(e).range(t).unknown(r)},cn.apply(i,arguments)}const $g=new Date,zg=new Date;function It(e,t,r,n){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const c=i(o),u=i.ceil(o);return o-c(t(o=new Date(+o),c==null?1:Math.floor(c)),o),i.range=(o,c,u)=>{const f=[];if(o=i.ceil(o),u=u==null?1:Math.floor(u),!(o0))return f;let h;do f.push(h=new Date(+o)),t(o,u),e(o);while(hIt(c=>{if(c>=c)for(;e(c),!o(c);)c.setTime(c-1)},(c,u)=>{if(c>=c)if(u<0)for(;++u<=0;)for(;t(c,-1),!o(c););else for(;--u>=0;)for(;t(c,1),!o(c););}),r&&(i.count=(o,c)=>($g.setTime(+o),zg.setTime(+c),e($g),e(zg),Math.floor(r($g,zg))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?c=>n(c)%o===0:c=>i.count(0,c)%o===0):i)),i}const Zf=It(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Zf.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?It(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Zf);Zf.range;const pi=1e3,rn=pi*60,gi=rn*60,ji=gi*24,F0=ji*7,K2=ji*30,Fg=ji*365,to=It(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*pi)},(e,t)=>(t-e)/pi,e=>e.getUTCSeconds());to.range;const B0=It(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*pi)},(e,t)=>{e.setTime(+e+t*rn)},(e,t)=>(t-e)/rn,e=>e.getMinutes());B0.range;const U0=It(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*rn)},(e,t)=>(t-e)/rn,e=>e.getUTCMinutes());U0.range;const W0=It(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*pi-e.getMinutes()*rn)},(e,t)=>{e.setTime(+e+t*gi)},(e,t)=>(t-e)/gi,e=>e.getHours());W0.range;const H0=It(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*gi)},(e,t)=>(t-e)/gi,e=>e.getUTCHours());H0.range;const mu=It(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*rn)/ji,e=>e.getDate()-1);mu.range;const tm=It(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ji,e=>e.getUTCDate()-1);tm.range;const WC=It(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ji,e=>Math.floor(e/ji));WC.range;function _o(e){return It(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*rn)/F0)}const rm=_o(0),Xf=_o(1),jB=_o(2),SB=_o(3),Gs=_o(4),NB=_o(5),EB=_o(6);rm.range;Xf.range;jB.range;SB.range;Gs.range;NB.range;EB.range;function Mo(e){return It(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/F0)}const nm=Mo(0),Jf=Mo(1),AB=Mo(2),CB=Mo(3),Vs=Mo(4),PB=Mo(5),OB=Mo(6);nm.range;Jf.range;AB.range;CB.range;Vs.range;PB.range;OB.range;const K0=It(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());K0.range;const G0=It(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());G0.range;const Si=It(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Si.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:It(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Si.range;const Ni=It(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ni.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:It(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Ni.range;function HC(e,t,r,n,i,o){const c=[[to,1,pi],[to,5,5*pi],[to,15,15*pi],[to,30,30*pi],[o,1,rn],[o,5,5*rn],[o,15,15*rn],[o,30,30*rn],[i,1,gi],[i,3,3*gi],[i,6,6*gi],[i,12,12*gi],[n,1,ji],[n,2,2*ji],[r,1,F0],[t,1,K2],[t,3,3*K2],[e,1,Fg]];function u(h,m,p){const v=mk).right(c,v);if(b===c.length)return e.every(sx(h/Fg,m/Fg,p));if(b===0)return Zf.every(Math.max(sx(h,m,p),1));const[S,w]=c[v/c[b-1][2]53)return null;"w"in fe||(fe.w=1),"Z"in fe?(Ue=Ug(cc(fe.y,0,1)),_e=Ue.getUTCDay(),Ue=_e>4||_e===0?Jf.ceil(Ue):Jf(Ue),Ue=tm.offset(Ue,(fe.V-1)*7),fe.y=Ue.getUTCFullYear(),fe.m=Ue.getUTCMonth(),fe.d=Ue.getUTCDate()+(fe.w+6)%7):(Ue=Bg(cc(fe.y,0,1)),_e=Ue.getDay(),Ue=_e>4||_e===0?Xf.ceil(Ue):Xf(Ue),Ue=mu.offset(Ue,(fe.V-1)*7),fe.y=Ue.getFullYear(),fe.m=Ue.getMonth(),fe.d=Ue.getDate()+(fe.w+6)%7)}else("W"in fe||"U"in fe)&&("w"in fe||(fe.w="u"in fe?fe.u%7:"W"in fe?1:0),_e="Z"in fe?Ug(cc(fe.y,0,1)).getUTCDay():Bg(cc(fe.y,0,1)).getDay(),fe.m=0,fe.d="W"in fe?(fe.w+6)%7+fe.W*7-(_e+5)%7:fe.w+fe.U*7-(_e+6)%7);return"Z"in fe?(fe.H+=fe.Z/100|0,fe.M+=fe.Z%100,Ug(fe)):Bg(fe)}}function B(re,ye,Oe,fe){for(var Xe=0,Ue=ye.length,_e=Oe.length,wt,tr;Xe=_e)return-1;if(wt=ye.charCodeAt(Xe++),wt===37){if(wt=ye.charAt(Xe++),tr=_[wt in G2?ye.charAt(Xe++):wt],!tr||(fe=tr(re,Oe,fe))<0)return-1}else if(wt!=Oe.charCodeAt(fe++))return-1}return fe}function z(re,ye,Oe){var fe=h.exec(ye.slice(Oe));return fe?(re.p=m.get(fe[0].toLowerCase()),Oe+fe[0].length):-1}function $(re,ye,Oe){var fe=b.exec(ye.slice(Oe));return fe?(re.w=S.get(fe[0].toLowerCase()),Oe+fe[0].length):-1}function K(re,ye,Oe){var fe=p.exec(ye.slice(Oe));return fe?(re.w=v.get(fe[0].toLowerCase()),Oe+fe[0].length):-1}function W(re,ye,Oe){var fe=N.exec(ye.slice(Oe));return fe?(re.m=E.get(fe[0].toLowerCase()),Oe+fe[0].length):-1}function ve(re,ye,Oe){var fe=w.exec(ye.slice(Oe));return fe?(re.m=k.get(fe[0].toLowerCase()),Oe+fe[0].length):-1}function ue(re,ye,Oe){return B(re,t,ye,Oe)}function pe(re,ye,Oe){return B(re,r,ye,Oe)}function oe(re,ye,Oe){return B(re,n,ye,Oe)}function le(re){return c[re.getDay()]}function Z(re){return o[re.getDay()]}function ie(re){return f[re.getMonth()]}function te(re){return u[re.getMonth()]}function I(re){return i[+(re.getHours()>=12)]}function M(re){return 1+~~(re.getMonth()/3)}function U(re){return c[re.getUTCDay()]}function ne(re){return o[re.getUTCDay()]}function ee(re){return f[re.getUTCMonth()]}function X(re){return u[re.getUTCMonth()]}function ae(re){return i[+(re.getUTCHours()>=12)]}function me(re){return 1+~~(re.getUTCMonth()/3)}return{format:function(re){var ye=O(re+="",A);return ye.toString=function(){return re},ye},parse:function(re){var ye=D(re+="",!1);return ye.toString=function(){return re},ye},utcFormat:function(re){var ye=O(re+="",C);return ye.toString=function(){return re},ye},utcParse:function(re){var ye=D(re+="",!0);return ye.toString=function(){return re},ye}}}var G2={"-":"",_:" ",0:"0"},Ht=/^\s*\d+/,RB=/^%/,LB=/[\\^$*+?|[\]().{}]/g;function Qe(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o[t.toLowerCase(),r]))}function zB(e,t,r){var n=Ht.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function FB(e,t,r){var n=Ht.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function BB(e,t,r){var n=Ht.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function UB(e,t,r){var n=Ht.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function WB(e,t,r){var n=Ht.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function V2(e,t,r){var n=Ht.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function q2(e,t,r){var n=Ht.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function HB(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function KB(e,t,r){var n=Ht.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function GB(e,t,r){var n=Ht.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Q2(e,t,r){var n=Ht.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function VB(e,t,r){var n=Ht.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Y2(e,t,r){var n=Ht.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function qB(e,t,r){var n=Ht.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function QB(e,t,r){var n=Ht.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function YB(e,t,r){var n=Ht.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function ZB(e,t,r){var n=Ht.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function XB(e,t,r){var n=RB.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function JB(e,t,r){var n=Ht.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function eU(e,t,r){var n=Ht.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function Z2(e,t){return Qe(e.getDate(),t,2)}function tU(e,t){return Qe(e.getHours(),t,2)}function rU(e,t){return Qe(e.getHours()%12||12,t,2)}function nU(e,t){return Qe(1+mu.count(Si(e),e),t,3)}function KC(e,t){return Qe(e.getMilliseconds(),t,3)}function iU(e,t){return KC(e,t)+"000"}function aU(e,t){return Qe(e.getMonth()+1,t,2)}function oU(e,t){return Qe(e.getMinutes(),t,2)}function sU(e,t){return Qe(e.getSeconds(),t,2)}function lU(e){var t=e.getDay();return t===0?7:t}function cU(e,t){return Qe(rm.count(Si(e)-1,e),t,2)}function GC(e){var t=e.getDay();return t>=4||t===0?Gs(e):Gs.ceil(e)}function uU(e,t){return e=GC(e),Qe(Gs.count(Si(e),e)+(Si(e).getDay()===4),t,2)}function dU(e){return e.getDay()}function fU(e,t){return Qe(Xf.count(Si(e)-1,e),t,2)}function hU(e,t){return Qe(e.getFullYear()%100,t,2)}function mU(e,t){return e=GC(e),Qe(e.getFullYear()%100,t,2)}function pU(e,t){return Qe(e.getFullYear()%1e4,t,4)}function gU(e,t){var r=e.getDay();return e=r>=4||r===0?Gs(e):Gs.ceil(e),Qe(e.getFullYear()%1e4,t,4)}function vU(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Qe(t/60|0,"0",2)+Qe(t%60,"0",2)}function X2(e,t){return Qe(e.getUTCDate(),t,2)}function xU(e,t){return Qe(e.getUTCHours(),t,2)}function yU(e,t){return Qe(e.getUTCHours()%12||12,t,2)}function bU(e,t){return Qe(1+tm.count(Ni(e),e),t,3)}function VC(e,t){return Qe(e.getUTCMilliseconds(),t,3)}function wU(e,t){return VC(e,t)+"000"}function kU(e,t){return Qe(e.getUTCMonth()+1,t,2)}function jU(e,t){return Qe(e.getUTCMinutes(),t,2)}function SU(e,t){return Qe(e.getUTCSeconds(),t,2)}function NU(e){var t=e.getUTCDay();return t===0?7:t}function EU(e,t){return Qe(nm.count(Ni(e)-1,e),t,2)}function qC(e){var t=e.getUTCDay();return t>=4||t===0?Vs(e):Vs.ceil(e)}function AU(e,t){return e=qC(e),Qe(Vs.count(Ni(e),e)+(Ni(e).getUTCDay()===4),t,2)}function CU(e){return e.getUTCDay()}function PU(e,t){return Qe(Jf.count(Ni(e)-1,e),t,2)}function OU(e,t){return Qe(e.getUTCFullYear()%100,t,2)}function _U(e,t){return e=qC(e),Qe(e.getUTCFullYear()%100,t,2)}function MU(e,t){return Qe(e.getUTCFullYear()%1e4,t,4)}function IU(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Vs(e):Vs.ceil(e),Qe(e.getUTCFullYear()%1e4,t,4)}function TU(){return"+0000"}function J2(){return"%"}function eS(e){return+e}function tS(e){return Math.floor(+e/1e3)}var ds,QC,YC;DU({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function DU(e){return ds=DB(e),QC=ds.format,ds.parse,YC=ds.utcFormat,ds.utcParse,ds}function RU(e){return new Date(e)}function LU(e){return e instanceof Date?+e:+new Date(+e)}function V0(e,t,r,n,i,o,c,u,f,h){var m=I0(),p=m.invert,v=m.domain,b=h(".%L"),S=h(":%S"),w=h("%I:%M"),k=h("%I %p"),N=h("%a %d"),E=h("%b %d"),A=h("%B"),C=h("%Y");function _(O){return(f(O)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,o)=>N7(e,o/n))},r.copy=function(){return eP(t).domain(e)},Pi.apply(r,arguments)}function am(){var e=0,t=.5,r=1,n=1,i,o,c,u,f,h=gr,m,p=!1,v;function b(w){return isNaN(w=+w)?v:(w=.5+((w=+m(w))-o)*(n*w{if(e!=null){var n=e.scale,i=e.type;if(n==="auto")return i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof n=="string")return HU(n)?n:"point"}};function KU(e,t){for(var r=0,n=e.length,i=e[0]t)?r=o+1:n=o}return r}function oP(e,t){if(e){var r=t??e.domain(),n=r.map(o=>{var c;return(c=e(o))!==null&&c!==void 0?c:0}),i=e.range();if(!(r.length===0||i.length<2))return o=>{var c,u,f=KU(n,o);if(f<=0)return r[0];if(f>=r.length)return r[r.length-1];var h=(c=n[f-1])!==null&&c!==void 0?c:0,m=(u=n[f])!==null&&u!==void 0?u:0;return Math.abs(o-h)<=Math.abs(o-m)?r[f-1]:r[f]}}}function GU(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):oP(e,void 0)}function nS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function eh(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);re.cartesianAxis.xAxis[t],Oi=(e,t)=>{var r=lP(e,t);return r??Ot},_t={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:fx,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:ou},cP=(e,t)=>e.cartesianAxis.yAxis[t],_i=(e,t)=>{var r=cP(e,t);return r??_t},eW={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},Z0=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??eW},yr=(e,t,r)=>{switch(t){case"xAxis":return Oi(e,r);case"yAxis":return _i(e,r);case"zAxis":return Z0(e,r);case"angleAxis":return w0(e,r);case"radiusAxis":return k0(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},tW=(e,t,r)=>{switch(t){case"xAxis":return Oi(e,r);case"yAxis":return _i(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},pu=(e,t,r)=>{switch(t){case"xAxis":return Oi(e,r);case"yAxis":return _i(e,r);case"angleAxis":return w0(e,r);case"radiusAxis":return k0(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},uP=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function dP(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var fP=e=>e.graphicalItems.cartesianItems,rW=Q([Ut,Zh],dP),hP=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),ll=Q([fP,yr,rW],hP,{memoizeOptions:{resultEqualityCheck:Jh}}),mP=Q([ll],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(N0)),pP=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),nW=Q([ll],pP),gP=e=>e.map(t=>t.data).filter(Boolean).flat(1),iW=Q([ll],e=>e.some(t=>!t.data)),vP=Q([ll],gP,{memoizeOptions:{resultEqualityCheck:Jh}}),xP=(e,t)=>{var r=t.chartData,n=r===void 0?[]:r,i=t.dataStartIndex,o=t.dataEndIndex;return e.length>0?e:n.slice(i,o+1)},X0=Q([vP,Gh],xP),aW=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:Ft(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(i=>({value:Ft(i,n)}))):e.map(n=>({value:n})),yP=(e,t,r,n,i,o)=>{var c=n.chartData,u=c===void 0?[]:c,f=n.dataStartIndex,h=n.dataEndIndex,m=aW(e,t,r);if(i&&(t==null?void 0:t.dataKey)!=null&&o.length>0){var p=u.slice(f,h+1),v=p.map(b=>({value:Ft(b,t.dataKey)})).filter(b=>b.value!=null);return[...v,...m]}return m},gu=Q([X0,yr,ll,Gh,iW,vP],yP);function Ns(e){if(Vn(e)||e instanceof Date){var t=Number(e);if(He(t))return t}}function aS(e){if(Array.isArray(e)){var t=[Ns(e[0]),Ns(e[1])];return Hn(t)?t:void 0}var r=Ns(e);if(r!=null)return[r,r]}function Yn(e){return e.map(Ns).filter(Cr)}function oW(e,t){var r=Ns(e),n=Ns(t);return r==null&&n==null?0:r==null?-1:n==null?1:r-n}var sW=Q([gu],e=>e==null?void 0:e.map(t=>t.value).sort(oW));function bP(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function lW(e,t,r){if(!r)return[];if(!r.length)return[];var n;if(typeof t=="number"&&!Gn(t))n=t;else if(Array.isArray(t)){var i=Yn(t);i.length>0&&(n=Math.max(...i))}return n==null?[]:Yn(r.flatMap(o=>{var c=Ft(e,o.dataKey),u,f;if(Array.isArray(c)){var h=sP(c,2);u=h[0],f=h[1]}else u=f=c;if(!(!He(u)||!He(f)))return[n-u,n+f]}))}var Tt=e=>{var t=Wt(e),r=ol(e);return pu(e,t,r)},qs=Q([Tt],e=>e==null?void 0:e.dataKey),cW=Q([mP,Gh,Tt],SC),wP=(e,t,r,n)=>{var i={},o=t.reduce((c,u)=>{if(u.stackId==null)return c;var f=c[u.stackId];return f==null&&(f=[]),f.push(u),c[u.stackId]=f,c},i);return Object.fromEntries(Object.entries(o).map(c=>{var u=sP(c,2),f=u[0],h=u[1],m=n?[...h].reverse():h,p=m.map(S0);return[f,{stackedData:Az(e,p,r),graphicalItems:m}]}))},kP=Q([cW,mP,Vh,vC],wP),jP=(e,t,r,n)=>{var i=t.dataStartIndex,o=t.dataEndIndex;if(n==null&&r!=="zAxis")return _z(e,i,o)},uW=Q([yr],e=>e.allowDataOverflow),J0=e=>{var t;if(e==null||!("domain"in e))return fx;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=Yn(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:fx},SP=Q([yr],J0),NP=Q([SP,uW],oC),dW=Q([kP,Cn,Ut,NP],jP,{memoizeOptions:{resultEqualityCheck:Xh}}),ey=e=>e.errorBars,fW=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>bP(r,n)),th=function(){for(var t=arguments.length,r=new Array(t),n=0;n5&&arguments[5]!==void 0?arguments[5]:[],u,f;if(n.length>0&&n.forEach(h=>{var m,p=h.data!=null?[...h.data]:c,v=(m=i[h.id])===null||m===void 0?void 0:m.filter(b=>bP(o,b));p.forEach(b=>{var S,w=Ft(b,(S=r.dataKey)!==null&&S!==void 0?S:h.dataKey),k=lW(b,w,v);if(k.length>=2){var N=Math.min(...k),E=Math.max(...k);(u==null||Nf)&&(f=E)}var A=aS(w);A!=null&&(u=u==null?A[0]:Math.min(u,A[0]),f=f==null?A[1]:Math.max(f,A[1]))})}),(r==null?void 0:r.dataKey)!=null&&n.length===0&&t.forEach(h=>{var m=aS(Ft(h,r.dataKey));m!=null&&(u=u==null?m[0]:Math.min(u,m[0]),f=f==null?m[1]:Math.max(f,m[1]))}),He(u)&&He(f))return[u,f]},hW=Q([X0,yr,nW,ey,Ut,W9],EP,{memoizeOptions:{resultEqualityCheck:Xh}});function mW(e){var t=e.value;if(Vn(t)||t instanceof Date)return t}var pW=(e,t,r)=>{var n=e.map(mW).filter(i=>i!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&LE(n))?aC(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},AP=e=>e.referenceElements.dots,cl=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),gW=Q([AP,Ut,Zh],cl),CP=e=>e.referenceElements.areas,vW=Q([CP,Ut,Zh],cl),PP=e=>e.referenceElements.lines,xW=Q([PP,Ut,Zh],cl),OP=(e,t)=>{if(e!=null){var r=Yn(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},yW=Q(gW,Ut,OP),_P=(e,t)=>{if(e!=null){var r=Yn(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},bW=Q([vW,Ut],_P);function wW(e){var t;if(e.x!=null)return Yn([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:Yn(r)}function kW(e){var t;if(e.y!=null)return Yn([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:Yn(r)}var MP=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?wW(n):kW(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},jW=Q([xW,Ut],MP),SW=Q(yW,jW,bW,(e,t,r)=>th(e,r,t)),IP=(e,t,r,n,i,o,c,u)=>{if(r!=null)return r;var f=c==="vertical"&&u==="xAxis"||c==="horizontal"&&u==="yAxis",h=f?th(n,o,i):th(o,i);return Q9(t,h,e.allowDataOverflow)},NW=Q([yr,SP,NP,dW,hW,SW,ht,Ut],IP,{memoizeOptions:{resultEqualityCheck:Xh}}),EW=[0,1],TP=(e,t,r,n,i,o,c)=>{if(!((e==null||r==null||r.length===0)&&c===void 0)){var u=e.dataKey,f=e.type,h=Zn(t,o);if(h&&u==null){var m;return aC(0,(m=r==null?void 0:r.length)!==null&&m!==void 0?m:0)}return f==="category"?pW(n,e,h):i==="expand"&&!h?EW:c}},ty=Q([yr,ht,X0,gu,Vh,Ut,NW],TP),ul=Q([yr,uP,x0],aP),DP=(e,t,r)=>{var n=t.niceTicks;if(n!=="none"){var i=J0(t),o=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((n==="snap125"||n==="adaptive")&&t!=null&&t.tickCount&&Hn(e)){if(o)return m2(e,t.tickCount,t.allowDecimals,n);if(t.type==="number")return p2(e,t.tickCount,t.allowDecimals,n)}if(n==="auto"&&r==="linear"&&t!=null&&t.tickCount){if(o&&Hn(e))return m2(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Hn(e))return p2(e,t.tickCount,t.allowDecimals,"adaptive")}}},ry=Q([ty,pu,ul],DP),RP=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Hn(t)&&Array.isArray(r)&&r.length>0){var i,o,c=t[0],u=(i=r[0])!==null&&i!==void 0?i:0,f=t[1],h=(o=r[r.length-1])!==null&&o!==void 0?o:0;return[Math.min(c,u),Math.max(f,h)]}return t},AW=Q([yr,ty,ry,Ut],RP),CW=Q(gu,yr,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(Yn(e.map(p=>p.value))).sort((p,v)=>p-v),i=n[0],o=n[n.length-1];if(i==null||o==null)return 1/0;var c=o-i;if(c===0)return 1/0;for(var u=0;ui,(e,t,r,n,i)=>{if(!He(e))return 0;var o=t==="vertical"?n.height:n.width;if(i==="gap")return e*o/2;if(i==="no-gap"){var c=Sa(r,e*o),u=e*o/2;return u-c-(u-c)/o*c}return 0}),PW=(e,t,r)=>{var n=Oi(e,t);return n==null||typeof n.padding!="string"?0:LP(e,"xAxis",t,r,n.padding)},OW=(e,t,r)=>{var n=_i(e,t);return n==null||typeof n.padding!="string"?0:LP(e,"yAxis",t,r,n.padding)},_W=Q(Oi,PW,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var i=e.padding;return typeof i=="string"?{left:t,right:t}:{left:((r=i.left)!==null&&r!==void 0?r:0)+t,right:((n=i.right)!==null&&n!==void 0?n:0)+t}}),MW=Q(_i,OW,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var i=e.padding;return typeof i=="string"?{top:t,bottom:t}:{top:((r=i.top)!==null&&r!==void 0?r:0)+t,bottom:((n=i.bottom)!==null&&n!==void 0?n:0)+t}}),$P=Q([er,_W,Fh,zh,(e,t,r)=>r],(e,t,r,n,i)=>{var o=n.padding;return i?[o.left,r.width-o.right]:[e.left+t.left,e.left+e.width-t.right]}),zP=Q([er,ht,MW,Fh,zh,(e,t,r)=>r],(e,t,r,n,i,o)=>{var c=i.padding;return o?[n.height-c.bottom,c.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),vu=(e,t,r,n)=>{var i;switch(t){case"xAxis":return $P(e,r,n);case"yAxis":return zP(e,r,n);case"zAxis":return(i=Z0(e,r))===null||i===void 0?void 0:i.range;case"angleAxis":return wC(e);case"radiusAxis":return kC(e,r);default:return}},FP=Q([yr,vu],qh),IW=Q([ul,AW],h7),ny=Q([yr,ul,IW,FP],Y0),BP=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var i=r.type,o=r.scale,c=Zn(e,n);if(c&&(i==="number"||o!=="auto"))return t.map(u=>u.value)}},iy=Q([ht,gu,pu,Ut],BP),om=Q([ny],E0);Q([ny],GU);Q([ny,sW],oP);Q([ll,ey,Ut],fW);function UP(e,t){return e.idt.id?1:0}var sm=(e,t)=>t,lm=(e,t,r)=>r,TW=Q(Lh,sm,lm,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(UP)),DW=Q($h,sm,lm,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(UP)),WP=(e,t)=>({width:e.width,height:t.height}),RW=(e,t)=>{var r=typeof t.width=="number"?t.width:ou;return{width:r,height:e.height}},LW=Q(er,Oi,WP),$W=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},zW=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},FW=Q(Ci,er,TW,sm,lm,(e,t,r,n,i)=>{var o={},c;return r.forEach(u=>{var f=WP(t,u);c==null&&(c=$W(t,n,e));var h=n==="top"&&!i||n==="bottom"&&i;o[u.id]=c-Number(h)*f.height,c+=(h?-1:1)*f.height}),o}),BW=Q(Ai,er,DW,sm,lm,(e,t,r,n,i)=>{var o={},c;return r.forEach(u=>{var f=RW(t,u);c==null&&(c=zW(t,n,e));var h=n==="left"&&!i||n==="right"&&i;o[u.id]=c-Number(h)*f.width,c+=(h?-1:1)*f.width}),o}),UW=(e,t)=>{var r=Oi(e,t);if(r!=null)return FW(e,r.orientation,r.mirror)},WW=Q([er,Oi,UW,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),HW=(e,t)=>{var r=_i(e,t);if(r!=null)return BW(e,r.orientation,r.mirror)},KW=Q([er,_i,HW,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),GW=Q(er,_i,(e,t)=>{var r=typeof t.width=="number"?t.width:ou;return{width:r,height:e.height}}),HP=(e,t,r,n)=>{if(r!=null){var i=r.allowDuplicatedCategory,o=r.type,c=r.dataKey,u=Zn(e,n),f=t.map(m=>m.value),h=f.filter(m=>m!=null);if(c&&u&&o==="category"&&i&&LE(h))return f}},ay=Q([ht,gu,yr,Ut],HP),oS=Q([ht,tW,ul,om,ay,iy,vu,ry,Ut],(e,t,r,n,i,o,c,u,f)=>{if(t!=null){var h=Zn(e,f);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:f,categoricalDomain:o,duplicateDomain:i,isCategorical:h,niceTicks:u,range:c,realScaleType:r,scale:n}}}),VW=(e,t,r,n,i,o,c,u,f)=>{if(!(t==null||n==null)){var h=Zn(e,f),m=t.type,p=t.ticks,v=t.tickCount,b=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,S=m==="category"&&n.bandwidth?n.bandwidth()/b:0;S=f==="angleAxis"&&o!=null&&o.length>=2?en(o[0]-o[1])*2*S:S;var w=p||i;return w?w.map((k,N)=>{var E=c?c.indexOf(k):k,A=n.map(E);return He(A)?{index:N,coordinate:A+S,value:k,offset:S}:null}).filter(Cr):h&&u?u.map((k,N)=>{var E=n.map(k);return He(E)?{coordinate:E+S,value:k,index:N,offset:S}:null}).filter(Cr):n.ticks?n.ticks(v).map((k,N)=>{var E=n.map(k);return He(E)?{coordinate:E+S,value:k,index:N,offset:S}:null}).filter(Cr):n.domain().map((k,N)=>{var E=n.map(k);return He(E)?{coordinate:E+S,value:c?c[k]:k,index:N,offset:S}:null}).filter(Cr)}},KP=Q([ht,pu,ul,om,ry,vu,ay,iy,Ut],VW),qW=(e,t,r,n,i,o,c)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var u=Zn(e,c),f=t.tickCount,h=0;return h=c==="angleAxis"&&(n==null?void 0:n.length)>=2?en(n[0]-n[1])*2*h:h,u&&o?o.map((m,p)=>{var v=r.map(m);return He(v)?{coordinate:v+h,value:m,index:p,offset:h}:null}).filter(Cr):r.ticks?r.ticks(f).map((m,p)=>{var v=r.map(m);return He(v)?{coordinate:v+h,value:m,index:p,offset:h}:null}).filter(Cr):r.domain().map((m,p)=>{var v=r.map(m);return He(v)?{coordinate:v+h,value:i?i[m]:m,index:p,offset:h}:null}).filter(Cr)}},GP=Q([ht,pu,om,vu,ay,iy,Ut],qW),VP=Q(yr,om,(e,t)=>{if(!(e==null||t==null))return eh(eh({},e),{},{scale:t})}),QW=Q([yr,ul,ty,FP],Y0),YW=Q([QW],E0);Q((e,t,r)=>Z0(e,r),YW,(e,t)=>{if(!(e==null||t==null))return eh(eh({},e),{},{scale:t})});var ZW=Q([ht,Lh,$h],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),XW=(e,t,r)=>{var n;return(n=e.renderedTicks[t])===null||n===void 0?void 0:n[r]};Q([XW],e=>{if(!(!e||e.length===0))return t=>{var r,n=1/0,i=e[0];for(var o of e){var c=Math.abs(o.coordinate-t);ce.options.defaultTooltipEventType,QP=e=>e.options.validateTooltipEventTypes;function YP(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function xu(e,t){var r=qP(e),n=QP(e);return YP(t,r,n)}function JW(e){return Me(t=>xu(t,e))}var ZP=(e,t)=>{var r,n=Number(t);if(!(Gn(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},eH=e=>e.tooltip.settings,sa={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},tH={itemInteraction:{click:sa,hover:sa},axisInteraction:{click:sa,hover:sa},keyboardInteraction:sa,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},XP=ur({name:"tooltip",initialState:tH,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:lt()},replaceTooltipEntrySettings:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,o=tn(e).tooltipItemPayloads.indexOf(n);o>-1&&(e.tooltipItemPayloads[o]=i)},prepare:lt()},removeTooltipEntrySettings:{reducer(e,t){var r=tn(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:lt()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),un=XP.actions,rH=un.addTooltipEntrySettings,nH=un.replaceTooltipEntrySettings,iH=un.removeTooltipEntrySettings,aH=un.setTooltipSettingsState,oH=un.setActiveMouseOverItemIndex;un.mouseLeaveItem;var JP=un.mouseLeaveChart;un.setActiveClickItemIndex;var e3=un.setMouseOverAxisIndex,sH=un.setMouseClickAxisIndex,vc=un.setSyncInteraction,rh=un.setKeyboardInteraction,lH=XP.reducer;function sS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Zd(e){for(var t=1;t{if(t==null)return sa;var i=fH(e,t,r);if(i==null)return sa;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var o=e.settings.active===!0;if(hH(i)){if(o)return Zd(Zd({},i),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return Zd(Zd({},sa),{},{coordinate:i.coordinate})};function mH(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var r=Number(e);return Number.isFinite(r)?r:void 0}function pH(e,t){var r=mH(e),n=t[0],i=t[1];if(r===void 0)return!1;var o=Math.min(n,i),c=Math.max(n,i);return r>=o&&r<=c}function gH(e,t,r){if(r==null||t==null)return!0;var n=Ft(e,t);return n==null||!Hn(r)?!0:pH(n,r)}var bc=(e,t,r,n)=>{var i=e==null?void 0:e.index;if(i==null)return null;var o=Number(i);if(!He(o))return i;var c=0,u=1/0;t.length>0&&(u=t.length-1);var f=Math.max(c,Math.min(o,u)),h=t[f];return h==null||gH(h,r,n)?String(f):null},r3=(e,t,r,n,i,o,c)=>{if(o!=null){var u=c[0],f=u==null?void 0:u.getPosition(o);if(f!=null)return f;var h=i==null?void 0:i[Number(o)];if(h)switch(r){case"horizontal":return{x:h.coordinate,y:(n.top+t)/2};default:return{x:(n.left+e)/2,y:h.coordinate}}}},n3=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(r==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(n!=null||e.keyboardInteraction.active)){var o=e.tooltipItemPayloads[0];return o!=null?[o]:[]}return e.tooltipItemPayloads.filter(c=>{var u;return((u=c.settings)===null||u===void 0?void 0:u.graphicalItemId)===i})},i3=e=>e.options.tooltipPayloadSearcher,dl=e=>e.tooltip;function lS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function cS(e){for(var t=1;te(t)}function uS(e){if(typeof e=="string")return e}function jH(e){if(!(e==null||typeof e!="object")){var t="name"in e?bH(e.name):void 0,r="unit"in e?wH(e.unit):void 0,n="dataKey"in e?kH(e.dataKey):void 0,i="payload"in e?e.payload:void 0,o="color"in e?uS(e.color):void 0,c="fill"in e?uS(e.fill):void 0;return{name:t,unit:r,dataKey:n,payload:i,color:o,fill:c}}}function SH(e,t){return e??t}var a3=(e,t,r,n,i,o,c)=>{if(!(t==null||o==null)){var u=r.chartData,f=r.computedData,h=r.dataStartIndex,m=r.dataEndIndex,p=[];return e.reduce((v,b)=>{var S,w=b.dataDefinedOnItem,k=b.settings,N=SH(w,u),E=Array.isArray(N)?OA(N,h,m):N,A=(S=k==null?void 0:k.dataKey)!==null&&S!==void 0?S:n,C=k==null?void 0:k.nameKey,_;if(n&&Array.isArray(E)&&!Array.isArray(E[0])&&c==="axis"?_=$E(E,n,i):_=o(E,t,f,C),Array.isArray(_))_.forEach(D=>{var B,z,$=jH(D),K=$==null?void 0:$.name,W=$==null?void 0:$.dataKey,ve=$==null?void 0:$.payload,ue=cS(cS({},k),{},{name:K,unit:$==null?void 0:$.unit,color:(B=$==null?void 0:$.color)!==null&&B!==void 0?B:k==null?void 0:k.color,fill:(z=$==null?void 0:$.fill)!==null&&z!==void 0?z:k==null?void 0:k.fill});v.push(ij({tooltipEntrySettings:ue,dataKey:W,payload:ve,value:Ft(ve,W),name:K==null?void 0:String(K)}))});else{var O;v.push(ij({tooltipEntrySettings:k,dataKey:A,payload:_,value:Ft(_,A),name:(O=Ft(_,C))!==null&&O!==void 0?O:k==null?void 0:k.name}))}return v},p)}},oy=Q([Tt,uP,x0],aP),NH=Q([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),EH=Q([Wt,ol],dP),Io=Q([NH,Tt,EH],hP,{memoizeOptions:{resultEqualityCheck:Jh}}),AH=Q([Io],e=>e.filter(N0)),o3=Q([Io],gP,{memoizeOptions:{resultEqualityCheck:Jh}}),CH=Q([Io],e=>e.some(t=>!t.data)),Eo=Q([o3,Cn],xP),PH=Q([AH,Cn,Tt],SC),sy=Q([Eo,Tt,Io,Cn,CH,o3],yP),s3=Q([Tt],J0),OH=Q([Tt],e=>e.allowDataOverflow),l3=Q([s3,OH],oC),_H=Q([Io],e=>e.filter(N0)),MH=Q([PH,_H,Vh,vC],wP),IH=Q([MH,Cn,Wt,l3],jP),TH=Q([Io],pP),DH=Q([Eo,Tt,TH,ey,Wt,H9],EP,{memoizeOptions:{resultEqualityCheck:Xh}}),RH=Q([AP,Wt,ol],cl),LH=Q([RH,Wt],OP),$H=Q([CP,Wt,ol],cl),zH=Q([$H,Wt],_P),FH=Q([PP,Wt,ol],cl),BH=Q([FH,Wt],MP),UH=Q([LH,BH,zH],th),WH=Q([Tt,s3,l3,IH,DH,UH,ht,Wt],IP),Qs=Q([Tt,ht,Eo,sy,Vh,Wt,WH],TP),HH=Q([Qs,Tt,oy],DP),KH=Q([Tt,Qs,HH,Wt],RP),c3=e=>{var t=Wt(e),r=ol(e),n=!1;return vu(e,t,r,n)},u3=Q([Tt,c3],qh),GH=Q([Tt,oy,KH,u3],Y0),d3=Q([GH],E0),VH=Q([ht,sy,Tt,Wt],HP),qH=Q([ht,sy,Tt,Wt],BP),QH=(e,t,r,n,i,o,c,u)=>{if(t){var f=t.type,h=Zn(e,u);if(n){var m=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,p=f==="category"&&n.bandwidth?n.bandwidth()/m:0;return p=u==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?en(i[0]-i[1])*2*p:p,h&&c?c.map((v,b)=>{var S=n.map(v);return He(S)?{coordinate:S+p,value:v,index:b,offset:p}:null}).filter(Cr):n.domain().map((v,b)=>{var S=n.map(v);return He(S)?{coordinate:S+p,value:o?o[v]:v,index:b,offset:p}:null}).filter(Cr)}}},Mi=Q([ht,Tt,oy,d3,c3,VH,qH,Wt],QH),ly=Q([qP,QP,eH],(e,t,r)=>YP(r.shared,e,t)),f3=e=>e.tooltip.settings.trigger,cy=e=>e.tooltip.settings.defaultIndex,yu=Q([dl,ly,f3,cy],t3),Kc=Q([yu,Eo,qs,Qs],bc),h3=Q([Mi,Kc],ZP),YH=Q([yu],e=>{if(e)return e.dataKey}),ZH=Q([yu],e=>{if(e)return e.graphicalItemId}),m3=Q([dl,ly,f3,cy],n3),XH=Q([Ai,Ci,ht,er,Mi,cy,m3],r3),JH=Q([yu,XH],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),eK=Q([yu],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),tK=Q([m3,Kc,Cn,qs,h3,i3,ly],a3),rK=Q([tK],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function dS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fS(e){for(var t=1;tMe(Tt),sK=()=>{var e=oK(),t=Me(Mi),r=Me(d3);return Mf(!e||!r?void 0:fS(fS({},e),{},{scale:r}),t)};function hS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fs(e){for(var t=1;t{var i=t.find(o=>o&&o.index===r);if(i){if(e==="horizontal")return{x:i.coordinate,y:n.relativeY};if(e==="vertical")return{x:n.relativeX,y:i.coordinate}}return{x:0,y:0}},fK=(e,t,r,n)=>{var i=t.find(h=>h&&h.index===r);if(i){if(e==="centric"){var o=i.coordinate,c=n.radius;return fs(fs(fs({},n),Zt(n.cx,n.cy,c,o)),{},{angle:o,radius:c})}var u=i.coordinate,f=n.angle;return fs(fs(fs({},n),Zt(n.cx,n.cy,u,f)),{},{angle:f,radius:u})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function hK(e,t){var r=e.relativeX,n=e.relativeY;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}var p3=(e,t,r,n,i)=>{var o,c=(o=t==null?void 0:t.length)!==null&&o!==void 0?o:0;if(c<=1||e==null)return 0;if(n==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var u=0;u0?(f=r[u-1])===null||f===void 0?void 0:f.coordinate:(h=r[c-1])===null||h===void 0?void 0:h.coordinate,S=(m=r[u])===null||m===void 0?void 0:m.coordinate,w=u>=c-1?(p=r[0])===null||p===void 0?void 0:p.coordinate:(v=r[u+1])===null||v===void 0?void 0:v.coordinate,k=void 0;if(!(b==null||S==null||w==null))if(en(S-b)!==en(w-S)){var N=[];if(en(w-S)===en(i[1]-i[0])){k=w;var E=S+i[1]-i[0];N[0]=Math.min(E,(E+b)/2),N[1]=Math.max(E,(E+b)/2)}else{k=b;var A=w+i[1]-i[0];N[0]=Math.min(S,(A+S)/2),N[1]=Math.max(S,(A+S)/2)}var C=[Math.min(S,(k+S)/2),Math.max(S,(k+S)/2)];if(e>C[0]&&e<=C[1]||e>=N[0]&&e<=N[1]){var _;return(_=r[u])===null||_===void 0?void 0:_.index}}else{var O=Math.min(b,w),D=Math.max(b,w);if(e>(O+S)/2&&e<=(D+S)/2){var B;return(B=r[u])===null||B===void 0?void 0:B.index}}}else if(t)for(var z=0;z($.coordinate+W.coordinate)/2||z>0&&z($.coordinate+W.coordinate)/2&&e<=($.coordinate+K.coordinate)/2)return $.index}}return-1},g3=()=>Me(x0),uy=(e,t)=>t,v3=(e,t,r)=>r,dy=(e,t,r,n)=>n,mK=Q(Mi,e=>Eh(e,t=>t.coordinate)),fy=Q([dl,uy,v3,dy],t3),hy=Q([fy,Eo,qs,Qs],bc),pK=(e,t,r)=>{if(t!=null){var n=dl(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},x3=Q([dl,uy,v3,dy],n3),nh=Q([Ai,Ci,ht,er,Mi,dy,x3],r3),gK=Q([fy,nh],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),y3=Q([Mi,hy],ZP),vK=Q([x3,hy,Cn,qs,y3,i3,uy],a3),xK=Q([fy,hy],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),yK=(e,t,r,n,i,o,c)=>{if(!(!e||!r||!n||!i)&&hK(e,c)){var u=Mz(e,t),f=p3(u,o,i,r,n),h=dK(t,i,f,e);return{activeIndex:String(f),activeCoordinate:h}}},bK=(e,t,r,n,i,o,c)=>{if(!(!e||!n||!i||!o||!r)){var u=D9(e,r);if(u){var f=Iz(u,t),h=p3(f,c,o,n,i),m=fK(t,o,h,u);return{activeIndex:String(h),activeCoordinate:m}}}},wK=(e,t,r,n,i,o,c,u)=>{if(!(!e||!t||!n||!i||!o))return t==="horizontal"||t==="vertical"?yK(e,t,n,i,o,c,u):bK(e,t,r,n,i,o,c)},kK=Q(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var n=e[t];if(n!=null)return r?n.panoramaElement:n.element}}),jK=Q(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(pr)),r=Array.from(new Set(t));return r.sort((n,i)=>n-i)},{memoizeOptions:{resultEqualityCheck:f7}});function mS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function pS(e){for(var t=1;tpS(pS({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),AK)},PK=new Set(Object.values(pr));function OK(e){return PK.has(e)}var b3=ur({name:"zIndex",initialState:CK,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:lt()},unregisterZIndexPortal:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!OK(r)&&delete e.zIndexMap[r])},prepare:lt()},registerZIndexPortalElement:{reducer:(e,t)=>{var r=t.payload,n=r.zIndex,i=r.element,o=r.isPanorama;e.zIndexMap[n]?o?e.zIndexMap[n].panoramaElement=i:e.zIndexMap[n].element=i:e.zIndexMap[n]={consumers:0,element:o?void 0:i,panoramaElement:o?i:void 0}},prepare:lt()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:lt()}}}),cm=b3.actions,_K=cm.registerZIndexPortal,Wg=cm.unregisterZIndexPortal,MK=cm.registerZIndexPortalElement,IK=cm.unregisterZIndexPortalElement,TK=b3.reducer;function Ii(e){var t=e.zIndex,r=e.children,n=v8(),i=n&&t!==void 0&&t!==0,o=Or(),c=x.useRef(void 0),u=x.useRef(new Set),f=At(),h=Me(p=>kK(p,t,o));if(x.useLayoutEffect(()=>{if(!i){var p=u.current;p.forEach(b=>{f(Wg({zIndex:b}))}),p.clear(),c.current=void 0;return}if(u.current.has(t)||(f(_K({zIndex:t})),u.current.add(t)),h){c.current=h;var v=u.current;v.forEach(b=>{b!==t&&(f(Wg({zIndex:b})),v.delete(b))})}},[f,t,i,h]),x.useLayoutEffect(()=>{var p=u.current;return()=>{p.forEach(v=>{f(Wg({zIndex:v}))}),p.clear()}},[f]),!i)return r;var m=h??c.current;return m?vh.createPortal(r,m):null}function hx(){return hx=Object.assign?Object.assign.bind():function(e){for(var t=1;tx.useContext(w3),Hg={exports:{}},vS;function UK(){return vS||(vS=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(f,h,m){this.fn=f,this.context=h,this.once=m||!1}function o(f,h,m,p,v){if(typeof m!="function")throw new TypeError("The listener must be a function");var b=new i(m,p||f,v),S=r?r+h:h;return f._events[S]?f._events[S].fn?f._events[S]=[f._events[S],b]:f._events[S].push(b):(f._events[S]=b,f._eventsCount++),f}function c(f,h){--f._eventsCount===0?f._events=new n:delete f._events[h]}function u(){this._events=new n,this._eventsCount=0}u.prototype.eventNames=function(){var h=[],m,p;if(this._eventsCount===0)return h;for(p in m=this._events)t.call(m,p)&&h.push(r?p.slice(1):p);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(m)):h},u.prototype.listeners=function(h){var m=r?r+h:h,p=this._events[m];if(!p)return[];if(p.fn)return[p.fn];for(var v=0,b=p.length,S=new Array(b);v{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Gn(r))return e[r]}},GK={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},k3=ur({name:"options",initialState:GK,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),VK=k3.reducer,qK=k3.actions.createEventEmitter;function QK(e){return e.tooltip.syncInteraction}var YK={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},j3=ur({name:"chartData",initialState:YK,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var r=t.payload,n=r.startIndex,i=r.endIndex;n!=null&&(e.dataStartIndex=n),i!=null&&(e.dataEndIndex=i)}}}),my=j3.actions,yS=my.setChartData,ZK=my.setDataStartEndIndexes;my.setComputedData;var XK=j3.reducer,JK=["x","y"];function bS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hs(e){for(var t=1;tf.rootProps.className);x.useEffect(()=>{if(e==null)return rl;var f=(h,m,p)=>{if(t!==p&&e===h){if(m.payload.active===!1){r(vc({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(n==="index"){var v;if(c&&m!==null&&m!==void 0&&(v=m.payload)!==null&&v!==void 0&&v.coordinate&&m.payload.sourceViewBox){var b=m.payload.coordinate,S=b.x,w=b.y,k=nG(b,JK),N=m.payload.sourceViewBox,E=N.x,A=N.y,C=N.width,_=N.height,O=hs(hs({},k),{},{x:c.x+(C?(S-E)/C:0)*c.width,y:c.y+(_?(w-A)/_:0)*c.height});r(hs(hs({},m),{},{payload:hs(hs({},m.payload),{},{coordinate:O})}))}else r(m);return}if(i!=null){var D;if(typeof n=="function"){var B={activeTooltipIndex:m.payload.index==null?void 0:Number(m.payload.index),isTooltipActive:m.payload.active,activeIndex:m.payload.index==null?void 0:Number(m.payload.index),activeLabel:m.payload.label,activeDataKey:m.payload.dataKey,activeCoordinate:m.payload.coordinate},z=n(i,B);D=i[z]}else n==="value"&&(D=i.find(le=>String(le.value)===m.payload.label));var $=m.payload.coordinate;if($==null||c==null){r(vc({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(D==null){r(vc({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:void 0}));return}var K=$.x,W=$.y,ve=Math.min(K,c.x+c.width),ue=Math.min(W,c.y+c.height),pe={x:o==="horizontal"?D.coordinate:ve,y:o==="horizontal"?ue:D.coordinate},oe=vc({active:m.payload.active,coordinate:pe,dataKey:m.payload.dataKey,index:String(D.index),label:m.payload.label,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:m.payload.graphicalItemId});r(oe)}}};return Gc.on(mx,f),()=>{Gc.off(mx,f)}},[u,r,t,e,n,i,o,c])}function oG(){var e=Me(y0),t=Me(b0),r=At();x.useEffect(()=>{if(e==null)return rl;var n=(i,o,c)=>{t!==c&&e===i&&r(ZK(o))};return Gc.on(xS,n),()=>{Gc.off(xS,n)}},[r,t,e])}function sG(){var e=At();x.useEffect(()=>{e(qK())},[e]),aG(),oG()}function lG(e,t,r,n,i,o){var c=Me(S=>pK(S,e,t)),u=Me(ZH),f=Me(b0),h=Me(y0),m=Me(xC),p=Me(QK),v=(p==null?void 0:p.sourceViewBox)!=null,b=Bh();x.useEffect(()=>{if(!v&&h!=null&&f!=null){var S=vc({active:o,coordinate:r,dataKey:c,index:i,label:typeof n=="number"?String(n):n,sourceViewBox:b,graphicalItemId:u});Gc.emit(mx,h,S,f)}},[v,r,c,u,i,n,f,h,m,o,b])}function wS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function kS(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{D(aH({shared:E,trigger:A,axisId:O,active:i,defaultIndex:B}))},[D,E,A,O,i,B]);var z=Bh(),$=ZA(),K=JW(E),W=(t=Me(Oe=>xK(Oe,K,A,B)))!==null&&t!==void 0?t:{},ve=W.activeIndex,ue=W.isActive,pe=Me(Oe=>vK(Oe,K,A,B)),oe=Me(Oe=>y3(Oe,K,A,B)),le=Me(Oe=>gK(Oe,K,A,B)),Z=pe,ie=BK(),te=(r=i??ue)!==null&&r!==void 0?r:!1,I=x6([Z,te]),M=fG(I,2),U=M[0],ne=M[1],ee=K==="axis"?oe:void 0;lG(K,A,le,ee,ve,te);var X=_??ie;if(X==null||z==null||K==null)return null;var ae=Z??SS;te||(ae=SS),h&&ae.length&&(ae=B$(ae.filter(Oe=>Oe.value!=null&&(Oe.hide!==!0||n.includeHidden)),v,vG));var me=ae.length>0,re=kS(kS({},n),{},{payload:ae,label:ee,active:te,activeIndex:ve,coordinate:le,accessibilityLayer:$}),ye=x.createElement(PF,{allowEscapeViewBox:o,animationDuration:c,animationEasing:u,isAnimationActive:m,active:te,coordinate:le,hasPayload:me,offset:p,position:b,reverseDirection:S,useTranslate3d:w,viewBox:z,wrapperStyle:k,lastBoundingBox:U,innerRef:ne,hasPortalFromProps:!!_},xG(f,re));return x.createElement(x.Fragment,null,vh.createPortal(ye,X),te&&x.createElement(FK,{cursor:N,tooltipEventType:K,coordinate:le,payload:ae,index:ve}))}function wG(e,t,r){return(t=kG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kG(e){var t=jG(e,"string");return typeof t=="symbol"?t:t+""}function jG(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class SG{constructor(t){wG(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function NS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function NG(e){for(var t=1;t{try{var r=document.getElementById(AS);r||(r=document.createElement("span"),r.setAttribute("id",AS),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,OG,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},wc=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||uu.isSsr)return{width:0,height:0};if(!S3.enableCache)return CS(t,r);var n=_G(t,r),i=ES.get(n);if(i)return i;var o=CS(t,r);return ES.set(n,o),o},N3;function ih(e,t){return DG(e)||TG(e,t)||IG(e,t)||MG()}function MG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IG(e,t){if(e){if(typeof e=="string")return PS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?PS(e,t):void 0}}function PS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.children,r=e.breakAll,n=e.style;try{var i=[];Xt(t)||(r?i=t.toString().split(""):i=t.toString().split(A3));var o=i.map(u=>({word:u,width:wc(u,n).width})),c=r?0:wc(" ",n).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}};function P3(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function tV(e){return Xt(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var O3=(e,t,r,n)=>e.reduce((i,o)=>{var c=o.word,u=o.width,f=i[i.length-1];if(f&&u!=null&&(t==null||n||f.width+u+re.reduce((t,r)=>t.width>r.width?t:r),rV="…",RS=(e,t,r,n,i,o,c,u)=>{var f=e.slice(0,t),h=C3({breakAll:r,style:n,children:f+rV});if(!h)return[!1,[]];var m=O3(h.wordsWithComputedWidth,o,c,u),p=m.length>i||_3(m).width>Number(o);return[p,m]},nV=(e,t,r,n,i)=>{var o=e.maxLines,c=e.children,u=e.style,f=e.breakAll,h=Ee(o),m=String(c),p=O3(t,n,r,i);if(!h||i)return p;var v=p.length>o||_3(p).width>Number(n);if(!v)return p;for(var b=0,S=m.length-1,w=0,k;b<=S&&w<=m.length-1;){var N=Math.floor((b+S)/2),E=N-1,A=RS(m,E,f,u,o,n,r,i),C=TS(A,2),_=C[0],O=C[1],D=RS(m,N,f,u,o,n,r,i),B=TS(D,1),z=B[0];if(!_&&!z&&(b=N+1),_&&z&&(S=N-1),!_&&z){k=O;break}w++}return k||p},LS=e=>{var t=Xt(e)?[]:e.toString().split(A3);return[{words:t,width:void 0}]},iV=e=>{var t=e.width,r=e.scaleToFit,n=e.children,i=e.style,o=e.breakAll,c=e.maxLines;if((t||r)&&!uu.isSsr){var u,f,h=C3({breakAll:o,children:n,style:i});if(h){var m=h.wordsWithComputedWidth,p=h.spaceWidth;u=m,f=p}else return LS(n);return nV({breakAll:o,children:n,maxLines:c,style:i},u,f,t,!!r)}return LS(n)},M3="#808080",aV={angle:0,breakAll:!1,capHeight:"0.71em",fill:M3,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},py=x.forwardRef((e,t)=>{var r=ln(e,aV),n=r.x,i=r.y,o=r.lineHeight,c=r.capHeight,u=r.fill,f=r.scaleToFit,h=r.textAnchor,m=r.verticalAnchor,p=IS(r,qG),v=x.useMemo(()=>iV({breakAll:p.breakAll,children:p.children,maxLines:p.maxLines,scaleToFit:f,style:p.style,width:p.width}),[p.breakAll,p.children,p.maxLines,f,p.style,p.width]),b=p.dx,S=p.dy,w=p.angle,k=p.className,N=p.breakAll,E=IS(p,QG);if(!Vn(n)||!Vn(i)||v.length===0)return null;var A=Number(n)+(Ee(b)?b:0),C=Number(i)+(Ee(S)?S:0);if(!He(A)||!He(C))return null;var _;switch(m){case"start":_=Kg("calc(".concat(c,")"));break;case"middle":_=Kg("calc(".concat((v.length-1)/2," * -").concat(o," + (").concat(c," / 2))"));break;default:_=Kg("calc(".concat(v.length-1," * -").concat(o,")"));break}var O=[],D=v[0];if(f&&D!=null){var B=D.width,z=p.width;O.push("scale(".concat(Ee(z)&&Ee(B)?z/B:1,")"))}return w&&O.push("rotate(".concat(w,", ").concat(A,", ").concat(C,")")),O.length&&(E.transform=O.join(" ")),x.createElement("text",px({},an(E),{ref:t,x:A,y:C,className:nt("recharts-text",k),textAnchor:h,fill:u.includes("url")?M3:u}),v.map(($,K)=>{var W=$.words.join(N?"":" ");return x.createElement("tspan",{x:A,dy:K===0?_:o,key:"".concat(W,"-").concat(K)},W)}))});py.displayName="Text";function $S(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ln(e){for(var t=1;t{var t=e.viewBox,r=e.position,n=e.offset,i=n===void 0?0:n,o=e.parentViewBox,c=c0(t),u=c.x,f=c.y,h=c.height,m=c.upperWidth,p=c.lowerWidth,v=u,b=u+(m-p)/2,S=(v+b)/2,w=(m+p)/2,k=v+m/2,N=h>=0?1:-1,E=N*i,A=N>0?"end":"start",C=N>0?"start":"end",_=m>=0?1:-1,O=_*i,D=_>0?"end":"start",B=_>0?"start":"end",z=o;if(r==="top"){var $={x:v+m/2,y:f-E,horizontalAnchor:"middle",verticalAnchor:A};return z&&($.height=Math.max(f-z.y,0),$.width=m),$}if(r==="bottom"){var K={x:b+p/2,y:f+h+E,horizontalAnchor:"middle",verticalAnchor:C};return z&&(K.height=Math.max(z.y+z.height-(f+h),0),K.width=p),K}if(r==="left"){var W={x:S-O,y:f+h/2,horizontalAnchor:D,verticalAnchor:"middle"};return z&&(W.width=Math.max(W.x-z.x,0),W.height=h),W}if(r==="right"){var ve={x:S+w+O,y:f+h/2,horizontalAnchor:B,verticalAnchor:"middle"};return z&&(ve.width=Math.max(z.x+z.width-ve.x,0),ve.height=h),ve}var ue=z?{width:w,height:h}:{};return r==="insideLeft"?Ln({x:S+O,y:f+h/2,horizontalAnchor:B,verticalAnchor:"middle"},ue):r==="insideRight"?Ln({x:S+w-O,y:f+h/2,horizontalAnchor:D,verticalAnchor:"middle"},ue):r==="insideTop"?Ln({x:v+m/2,y:f+E,horizontalAnchor:"middle",verticalAnchor:C},ue):r==="insideBottom"?Ln({x:b+p/2,y:f+h-E,horizontalAnchor:"middle",verticalAnchor:A},ue):r==="insideTopLeft"?Ln({x:v+O,y:f+E,horizontalAnchor:B,verticalAnchor:C},ue):r==="insideTopRight"?Ln({x:v+m-O,y:f+E,horizontalAnchor:D,verticalAnchor:C},ue):r==="insideBottomLeft"?Ln({x:b+O,y:f+h-E,horizontalAnchor:B,verticalAnchor:A},ue):r==="insideBottomRight"?Ln({x:b+p-O,y:f+h-E,horizontalAnchor:D,verticalAnchor:A},ue):r&&typeof r=="object"&&(Ee(r.x)||wo(r.x))&&(Ee(r.y)||wo(r.y))?Ln({x:u+Sa(r.x,w),y:f+Sa(r.y,h),horizontalAnchor:"end",verticalAnchor:"end"},ue):Ln({x:k,y:f+h/2,horizontalAnchor:"middle",verticalAnchor:"middle"},ue)},uV=["labelRef"],dV=["content"];function zS(e,t){if(e==null)return{};var r,n,i=fV(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var t=e.x,r=e.y,n=e.upperWidth,i=e.lowerWidth,o=e.width,c=e.height,u=e.children,f=x.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:i,width:o,height:c}),[t,r,n,i,o,c]);return x.createElement(I3.Provider,{value:f},u)},T3=()=>{var e=x.useContext(I3),t=Bh();return e||(t?c0(t):void 0)},vV=x.createContext(null),xV=()=>{var e=x.useContext(vV),t=Me(jC);return e||t},yV=e=>{var t=e.value,r=e.formatter,n=Xt(e.children)?t:e.children;return typeof r=="function"?r(n):n},gy=e=>e!=null&&typeof e=="function",bV=(e,t)=>{var r=en(t-e),n=Math.min(Math.abs(t-e),360);return r*n},wV=(e,t,r,n,i)=>{var o=e.offset,c=e.className,u=i.cx,f=i.cy,h=i.innerRadius,m=i.outerRadius,p=i.startAngle,v=i.endAngle,b=i.clockWise,S=(h+m)/2,w=bV(p,v),k=w>=0?1:-1,N,E;switch(t){case"insideStart":N=p+k*o,E=b;break;case"insideEnd":N=v-k*o,E=!b;break;case"end":N=v+k*o,E=b;break;default:throw new Error("Unsupported position ".concat(t))}E=w<=0?E:!E;var A=Zt(u,f,S,N),C=Zt(u,f,S,N+(E?1:-1)*359),_="M".concat(A.x,",").concat(A.y,` + A`,",",",0,0,",",",",","Z"])),K.x,K.y,o,o,+(m<0),$.x,$.y,n,n,+(ve>180),+(m>0),O.x,O.y,o,o,+(m<0),D.x,D.y)}else C+=qt(c2||(c2=Ja(["L",",","Z"])),t,r);return C},$9={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},z9=e=>{var t=ln(e,$9),r=t.cx,n=t.cy,i=t.innerRadius,o=t.outerRadius,c=t.cornerRadius,u=t.forceCornerRadius,f=t.cornerIsExternal,h=t.startAngle,m=t.endAngle,p=t.className;if(o0&&Math.abs(h-m)<360?w=R9({cx:r,cy:n,innerRadius:i,outerRadius:o,cornerRadius:Math.min(S,b/2),forceCornerRadius:u,cornerIsExternal:f,startAngle:h,endAngle:m}):w=aC({cx:r,cy:n,innerRadius:i,outerRadius:o,startAngle:h,endAngle:m}),x.createElement("path",ax({},an(t),{className:v,d:w}))};function F9(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(FE(t)){if(e==="centric"){var n=t.cx,i=t.cy,o=t.innerRadius,c=t.outerRadius,u=t.angle,f=Zt(n,i,o,u),h=Zt(n,i,c,u);return[{x:f.x,y:f.y},{x:h.x,y:h.y}]}return iC(t)}}function B9(e){return eA(e)?NaN:Number(e)}function Dg(e){return e?(e=B9(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function oC(e,t,r){r&&typeof r!="number"&&zv(e,t,r)&&(t=r=void 0),e=Dg(e),t===void 0?(t=e,e=0):t=Dg(t),r=r===void 0?ee.chartData,m0=Q([Cn],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Gh=(e,t,r,n)=>n?m0(e):Cn(e),U9=(e,t,r)=>r?m0(e):Cn(e),W9=Q([Gh],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});Q([m0],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});var H9=Q([Cn],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});function p0(e,t){return q9(e)||V9(e,t)||G9(e,t)||K9()}function K9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function G9(e,t){if(e){if(typeof e=="string")return u2(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u2(e,t):void 0}}function u2(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.e^o.s<0?1:-1;for(n=o.d.length,i=e.d.length,t=0,r=ne.d[t]^o.s<0?1:-1;return n===i?0:n>i^o.s<0?1:-1};je.decimalPlaces=je.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ct;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};je.dividedBy=je.div=function(e){return xi(this,new this.constructor(e))};je.dividedToIntegerBy=je.idiv=function(e){var t=this,r=t.constructor;return tt(xi(t,new r(e),0,1),r.precision)};je.equals=je.eq=function(e){return!this.cmp(e)};je.exponent=function(){return Et(this)};je.greaterThan=je.gt=function(e){return this.cmp(e)>0};je.greaterThanOrEqualTo=je.gte=function(e){return this.cmp(e)>=0};je.isInteger=je.isint=function(){return this.e>this.d.length-2};je.isNegative=je.isneg=function(){return this.s<0};je.isPositive=je.ispos=function(){return this.s>0};je.isZero=function(){return this.s===0};je.lessThan=je.lt=function(e){return this.cmp(e)<0};je.lessThanOrEqualTo=je.lte=function(e){return this.cmp(e)<1};je.logarithm=je.log=function(e){var t,r=this,n=r.constructor,i=n.precision,o=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq($r))throw Error(sn+"NaN");if(r.s<1)throw Error(sn+(r.s?"NaN":"-Infinity"));return r.eq($r)?new n(0):(ft=!1,t=xi(Fc(r,o),Fc(e,o),o),ft=!0,tt(t,i))};je.minus=je.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?dC(t,e):cC(t,(e.s=-e.s,e))};je.modulo=je.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(sn+"NaN");return r.s?(ft=!1,t=xi(r,e,0,1).times(e),ft=!0,r.minus(t)):tt(new n(r),i)};je.naturalExponential=je.exp=function(){return uC(this)};je.naturalLogarithm=je.ln=function(){return Fc(this)};je.negated=je.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};je.plus=je.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?cC(t,e):dC(t,(e.s=-e.s,e))};je.precision=je.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(vo+e);if(t=Et(i)+1,n=i.d.length-1,r=n*ct+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};je.squareRoot=je.sqrt=function(){var e,t,r,n,i,o,c,u=this,f=u.constructor;if(u.s<1){if(!u.s)return new f(0);throw Error(sn+"NaN")}for(e=Et(u),ft=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=Wn(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=al((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new f(t)):n=new f(i.toString()),r=f.precision,i=c=r+3;;)if(o=n,n=o.plus(xi(u,o,c+2)).times(.5),Wn(o.d).slice(0,c)===(t=Wn(n.d)).slice(0,c)){if(t=t.slice(c-3,c+1),i==c&&t=="4999"){if(tt(o,r+1,0),o.times(o).eq(u)){n=o;break}}else if(t!="9999")break;c+=4}return ft=!0,tt(n,r)};je.times=je.mul=function(e){var t,r,n,i,o,c,u,f,h,m=this,p=m.constructor,v=m.d,b=(e=new p(e)).d;if(!m.s||!e.s)return new p(0);for(e.s*=m.s,r=m.e+e.e,f=v.length,h=b.length,f=0;){for(t=0,i=f+n;i>n;)u=o[i]+b[n]*v[i-n-1]+t,o[i--]=u%zt|0,t=u/zt|0;o[i]=(o[i]+t)%zt|0}for(;!o[--c];)o.pop();return t?++r:o.shift(),e.d=o,e.e=r,ft?tt(e,p.precision):e};je.toDecimalPlaces=je.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Qn(e,0,il),t===void 0?t=n.rounding:Qn(t,0,8),tt(r,e+Et(r)+1,t))};je.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=No(n,!0):(Qn(e,0,il),t===void 0?t=i.rounding:Qn(t,0,8),n=tt(new i(n),e+1,t),r=No(n,!0,e+1)),r};je.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?No(i):(Qn(e,0,il),t===void 0?t=o.rounding:Qn(t,0,8),n=tt(new o(i),e+Et(i)+1,t),r=No(n.abs(),!1,e+Et(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};je.toInteger=je.toint=function(){var e=this,t=e.constructor;return tt(new t(e),Et(e)+1,t.rounding)};je.toNumber=function(){return+this};je.toPower=je.pow=function(e){var t,r,n,i,o,c,u=this,f=u.constructor,h=12,m=+(e=new f(e));if(!e.s)return new f($r);if(u=new f(u),!u.s){if(e.s<1)throw Error(sn+"Infinity");return u}if(u.eq($r))return u;if(n=f.precision,e.eq($r))return tt(u,n);if(t=e.e,r=e.d.length-1,c=t>=r,o=u.s,c){if((r=m<0?-m:m)<=lC){for(i=new f($r),t=Math.ceil(n/ct+4),ft=!1;r%2&&(i=i.times(u),h2(i.d,t)),r=al(r/2),r!==0;)u=u.times(u),h2(u.d,t);return ft=!0,e.s<0?new f($r).div(i):tt(i,n)}}else if(o<0)throw Error(sn+"NaN");return o=o<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,ft=!1,i=e.times(Fc(u,n+h)),ft=!0,i=uC(i),i.s=o,i};je.toPrecision=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?(r=Et(i),n=No(i,r<=o.toExpNeg||r>=o.toExpPos)):(Qn(e,1,il),t===void 0?t=o.rounding:Qn(t,0,8),i=tt(new o(i),e,t),r=Et(i),n=No(i,e<=r||r<=o.toExpNeg,e)),n};je.toSignificantDigits=je.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Qn(e,1,il),t===void 0?t=n.rounding:Qn(t,0,8)),tt(new n(r),e,t)};je.toString=je.valueOf=je.val=je.toJSON=je[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Et(e),r=e.constructor;return No(e,t<=r.toExpNeg||t>=r.toExpPos)};function cC(e,t){var r,n,i,o,c,u,f,h,m=e.constructor,p=m.precision;if(!e.s||!t.s)return t.s||(t=new m(e)),ft?tt(t,p):t;if(f=e.d,h=t.d,c=e.e,i=t.e,f=f.slice(),o=c-i,o){for(o<0?(n=f,o=-o,u=h.length):(n=h,i=c,u=f.length),c=Math.ceil(p/ct),u=c>u?c+1:u+1,o>u&&(o=u,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(u=f.length,o=h.length,u-o<0&&(o=u,n=h,h=f,f=n),r=0;o;)r=(f[--o]=f[o]+h[o]+r)/zt|0,f[o]%=zt;for(r&&(f.unshift(r),++i),u=f.length;f[--u]==0;)f.pop();return t.d=f,t.e=i,ft?tt(t,p):t}function Qn(e,t,r){if(e!==~~e||er)throw Error(vo+e)}function Wn(e){var t,r,n,i=e.length-1,o="",c=e[0];if(i>0){for(o+=c,t=1;tc?1:-1;else for(u=f=0;ui[u]?1:-1;break}return f}function r(n,i,o){for(var c=0;o--;)n[o]-=c,c=n[o]1;)n.shift()}return function(n,i,o,c){var u,f,h,m,p,v,b,S,w,k,N,E,A,C,_,O,D,B,z=n.constructor,$=n.s==i.s?1:-1,K=n.d,W=i.d;if(!n.s)return new z(n);if(!i.s)throw Error(sn+"Division by zero");for(f=n.e-i.e,D=W.length,_=K.length,b=new z($),S=b.d=[],h=0;W[h]==(K[h]||0);)++h;if(W[h]>(K[h]||0)&&--f,o==null?E=o=z.precision:c?E=o+(Et(n)-Et(i))+1:E=o,E<0)return new z(0);if(E=E/ct+2|0,h=0,D==1)for(m=0,W=W[0],E++;(h<_||m)&&E--;h++)A=m*zt+(K[h]||0),S[h]=A/W|0,m=A%W|0;else{for(m=zt/(W[0]+1)|0,m>1&&(W=e(W,m),K=e(K,m),D=W.length,_=K.length),C=D,w=K.slice(0,D),k=w.length;k=zt/2&&++O;do m=0,u=t(W,w,D,k),u<0?(N=w[0],D!=k&&(N=N*zt+(w[1]||0)),m=N/O|0,m>1?(m>=zt&&(m=zt-1),p=e(W,m),v=p.length,k=w.length,u=t(p,w,v,k),u==1&&(m--,r(p,D16)throw Error(g0+Et(e));if(!e.s)return new m($r);for(ft=!1,u=p,c=new m(.03125);e.abs().gte(.1);)e=e.times(c),h+=5;for(n=Math.log(Ya(2,h))/Math.LN10*2+5|0,u+=n,r=i=o=new m($r),m.precision=u;;){if(i=tt(i.times(e),u),r=r.times(++f),c=o.plus(xi(i,r,u)),Wn(c.d).slice(0,u)===Wn(o.d).slice(0,u)){for(;h--;)o=tt(o.times(o),u);return m.precision=p,t==null?(ft=!0,tt(o,p)):o}o=c}}function Et(e){for(var t=e.e*ct,r=e.d[0];r>=10;r/=10)t++;return t}function Lg(e,t,r){if(t>e.LN10.sd())throw ft=!0,r&&(e.precision=r),Error(sn+"LN10 precision limit exceeded");return tt(new e(e.LN10),t)}function aa(e){for(var t="";e--;)t+="0";return t}function Fc(e,t){var r,n,i,o,c,u,f,h,m,p=1,v=10,b=e,S=b.d,w=b.constructor,k=w.precision;if(b.s<1)throw Error(sn+(b.s?"NaN":"-Infinity"));if(b.eq($r))return new w(0);if(t==null?(ft=!1,h=k):h=t,b.eq(10))return t==null&&(ft=!0),Lg(w,h);if(h+=v,w.precision=h,r=Wn(S),n=r.charAt(0),o=Et(b),Math.abs(o)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)b=b.times(e),r=Wn(b.d),n=r.charAt(0),p++;o=Et(b),n>1?(b=new w("0."+r),o++):b=new w(n+"."+r.slice(1))}else return f=Lg(w,h+2,k).times(o+""),b=Fc(new w(n+"."+r.slice(1)),h-v).plus(f),w.precision=k,t==null?(ft=!0,tt(b,k)):b;for(u=c=b=xi(b.minus($r),b.plus($r),h),m=tt(b.times(b),h),i=3;;){if(c=tt(c.times(m),h),f=u.plus(xi(c,new w(i),h)),Wn(f.d).slice(0,h)===Wn(u.d).slice(0,h))return u=u.times(2),o!==0&&(u=u.plus(Lg(w,h+2,k).times(o+""))),u=xi(u,new w(p),h),w.precision=k,t==null?(ft=!0,tt(u,k)):u;u=f,i+=2}}function f2(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=al(r/ct),e.d=[],n=(r+1)%ct,r<0&&(n+=ct),nUf||e.e<-Uf))throw Error(g0+r)}else e.s=0,e.e=0,e.d=[0];return e}function tt(e,t,r){var n,i,o,c,u,f,h,m,p=e.d;for(c=1,o=p[0];o>=10;o/=10)c++;if(n=t-c,n<0)n+=ct,i=t,h=p[m=0];else{if(m=Math.ceil((n+1)/ct),o=p.length,m>=o)return e;for(h=o=p[m],c=1;o>=10;o/=10)c++;n%=ct,i=n-ct+c}if(r!==void 0&&(o=Ya(10,c-i-1),u=h/o%10|0,f=t<0||p[m+1]!==void 0||h%o,f=r<4?(u||f)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||f||r==6&&(n>0?i>0?h/Ya(10,c-i):0:p[m-1])%10&1||r==(e.s<0?8:7))),t<1||!p[0])return f?(o=Et(e),p.length=1,t=t-o-1,p[0]=Ya(10,(ct-t%ct)%ct),e.e=al(-t/ct)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(n==0?(p.length=m,o=1,m--):(p.length=m+1,o=Ya(10,ct-n),p[m]=i>0?(h/Ya(10,c-i)%Ya(10,i)|0)*o:0),f)for(;;)if(m==0){(p[0]+=o)==zt&&(p[0]=1,++e.e);break}else{if(p[m]+=o,p[m]!=zt)break;p[m--]=0,o=1}for(n=p.length;p[--n]===0;)p.pop();if(ft&&(e.e>Uf||e.e<-Uf))throw Error(g0+Et(e));return e}function dC(e,t){var r,n,i,o,c,u,f,h,m,p,v=e.constructor,b=v.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new v(e),ft?tt(t,b):t;if(f=e.d,p=t.d,n=t.e,h=e.e,f=f.slice(),c=h-n,c){for(m=c<0,m?(r=f,c=-c,u=p.length):(r=p,n=h,u=f.length),i=Math.max(Math.ceil(b/ct),u)+2,c>i&&(c=i,r.length=1),r.reverse(),i=c;i--;)r.push(0);r.reverse()}else{for(i=f.length,u=p.length,m=i0;--i)f[u++]=0;for(i=p.length;i>c;){if(f[--i]0?o=o.charAt(0)+"."+o.slice(1)+aa(n):c>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+aa(-i-1)+o,r&&(n=r-c)>0&&(o+=aa(n))):i>=c?(o+=aa(i+1-c),r&&(n=r-i-1)>0&&(o=o+"."+aa(n))):((n=i+1)0&&(i+1===c&&(o+="."),o+=aa(n))),e.s<0?"-"+o:o}function h2(e,t){if(e.length>t)return e.length=t,!0}function fC(e){var t,r,n;function i(o){var c=this;if(!(c instanceof i))return new i(o);if(c.constructor=i,o instanceof i){c.s=o.s,c.e=o.e,c.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(vo+o);if(o>0)c.s=1;else if(o<0)o=-o,c.s=-1;else{c.s=0,c.e=0,c.d=[0];return}if(o===~~o&&o<1e7){c.e=0,c.d=[o];return}return f2(c,o.toString())}else if(typeof o!="string")throw Error(vo+o);if(o.charCodeAt(0)===45?(o=o.slice(1),c.s=-1):c.s=1,Z9.test(o))f2(c,o);else throw Error(vo+o)}if(i.prototype=je,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=fC,i.config=i.set=X9,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(vo+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(vo+r+": "+n);return this}var v0=fC(Y9);$r=new v0(1);const Ge=v0;function hC(e){var t;return e===0?t=1:t=Math.floor(new Ge(e).abs().log(10).toNumber())+1,t}function mC(e,t,r){for(var n=new Ge(e),i=0,o=[];n.lt(t)&&i<1e5;)o.push(n.toNumber()),n=n.add(r),i++;return o}function Bc(e,t){return r7(e)||t7(e,t)||e7(e,t)||J9()}function J9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e7(e,t){if(e){if(typeof e=="string")return m2(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?m2(e,t):void 0}}function m2(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=Bc(e,2),r=t[0],n=t[1],i=r,o=n;return r>n&&(i=n,o=r),[i,o]},x0=(e,t,r)=>{if(e.lte(0))return new Ge(0);var n=hC(e.toNumber()),i=new Ge(10).pow(n),o=e.div(i),c=n!==1?.05:.1,u=new Ge(Math.ceil(o.div(c).toNumber())).add(r).mul(c),f=u.mul(i);return t?new Ge(f.toNumber()):new Ge(Math.ceil(f.toNumber()))},gC=(e,t,r)=>{var n;if(e.lte(0))return new Ge(0);var i=[1,2,2.5,5],o=e.toNumber(),c=Math.floor(new Ge(o).abs().log(10).toNumber()),u=new Ge(10).pow(c),f=e.div(u).toNumber(),h=i.findIndex(b=>b>=f-1e-10);if(h===-1&&(u=u.mul(10),h=0),h+=r,h>=i.length){var m=Math.floor(h/i.length);h%=i.length,u=u.mul(new Ge(10).pow(m))}var p=(n=i[h])!==null&&n!==void 0?n:1,v=new Ge(p).mul(u);return t?v:new Ge(Math.ceil(v.toNumber()))},n7=(e,t,r)=>{var n=new Ge(1),i=new Ge(e);if(!i.isint()&&r){var o=Math.abs(e);o<1?(n=new Ge(10).pow(hC(e)-1),i=new Ge(Math.floor(i.div(n).toNumber())).mul(n)):o>1&&(i=new Ge(Math.floor(e)))}else e===0?i=new Ge(Math.floor((t-1)/2)):r||(i=new Ge(Math.floor(e)));for(var c=Math.floor((t-1)/2),u=[],f=0;f4&&arguments[4]!==void 0?arguments[4]:0,c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:x0;if(!Number.isFinite((r-t)/(n-1)))return{step:new Ge(0),tickMin:new Ge(0),tickMax:new Ge(0)};var u=c(new Ge(r).sub(t).div(n-1),i,o),f;t<=0&&r>=0?f=new Ge(0):(f=new Ge(t).add(r).div(2),f=f.sub(new Ge(f).mod(u)));var h=Math.ceil(f.sub(t).div(u).toNumber()),m=Math.ceil(new Ge(r).sub(f).div(u).toNumber()),p=h+m+1;return p>n?vC(t,r,n,i,o+1,c):(p0?m+(n-p):m,h=r>0?h:h+(n-p)),{step:u,tickMin:f.sub(new Ge(h).mul(u)),tickMax:f.add(new Ge(m).mul(u))})},p2=function(t){var r=Bc(t,2),n=r[0],i=r[1],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",f=Math.max(o,2),h=pC([n,i]),m=Bc(h,2),p=m[0],v=m[1];if(p===-1/0||v===1/0){var b=v===1/0?[p,...Array(o-1).fill(1/0)]:[...Array(o-1).fill(-1/0),v];return n>i?b.reverse():b}if(p===v)return n7(p,o,c);var S=u==="snap125"?gC:x0,w=vC(p,v,f,c,0,S),k=w.step,N=w.tickMin,E=w.tickMax,A=mC(N,E.add(new Ge(.1).mul(k)),k);return n>i?A.reverse():A},g2=function(t,r){var n=Bc(t,2),i=n[0],o=n[1],c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",f=pC([i,o]),h=Bc(f,2),m=h[0],p=h[1];if(m===-1/0||p===1/0)return[i,o];if(m===p)return[m];var v=u==="snap125"?gC:x0,b=Math.max(r,2),S=v(new Ge(p).sub(m).div(b-1),c,0),w=[...mC(new Ge(m),new Ge(p),S),p];return c===!1&&(w=w.map(k=>Math.round(k))),i>o?w.reverse():w},i7=e=>e.rootProps.barCategoryGap,Vh=e=>e.rootProps.stackOffset,xC=e=>e.rootProps.reverseStackOrder,y0=e=>e.options.chartName,b0=e=>e.rootProps.syncId,yC=e=>e.rootProps.syncMethod,w0=e=>e.options.eventEmitter,a7=e=>e.rootProps.baseValue,pr={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Wa={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Ln={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},qh=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Qh(e,t,r){if(r!=="auto")return r;if(e!=null)return Zn(e,t)?"category":"number"}function v2(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Wf(e){for(var t=1;t{if(t!=null)return e.polarAxis.angleAxis[t]},k0=Q([c7,WA],(e,t)=>{var r;if(e!=null)return e;var n=(r=Qh(t,"angleAxis",x2.type))!==null&&r!==void 0?r:"category";return Wf(Wf({},x2),{},{type:n})}),u7=(e,t)=>e.polarAxis.radiusAxis[t],j0=Q([u7,WA],(e,t)=>{var r;if(e!=null)return e;var n=(r=Qh(t,"radiusAxis",y2.type))!==null&&r!==void 0?r:"category";return Wf(Wf({},y2),{},{type:n})}),Yh=e=>e.polarOptions,S0=Q([Ai,Ci,er],O9),bC=Q([Yh,S0],(e,t)=>{if(e!=null)return Sa(e.innerRadius,t,0)}),wC=Q([Yh,S0],(e,t)=>{if(e!=null)return Sa(e.outerRadius,t,t*.8)}),d7=e=>{if(e==null)return[0,0];var t=e.startAngle,r=e.endAngle;return[t,r]},kC=Q([Yh],d7);Q([k0,kC],qh);var jC=Q([S0,bC,wC],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});Q([j0,jC],qh);var SC=Q([ht,Yh,bC,wC,Ai,Ci],(e,t,r,n,i,o)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var c=t.cx,u=t.cy,f=t.startAngle,h=t.endAngle;return{cx:Sa(c,i,i/2),cy:Sa(u,o,o/2),innerRadius:r,outerRadius:n,startAngle:f,endAngle:h,clockWise:!1}}}),Ut=(e,t)=>t,Zh=(e,t,r)=>r;function N0(e){return e==null?void 0:e.id}function NC(e,t,r){var n=t.chartData,i=n===void 0?[]:n,o=r.allowDuplicatedCategory,c=r.dataKey,u=new Map;return e.forEach(f=>{var h,m=(h=f.data)!==null&&h!==void 0?h:i;if(!(m==null||m.length===0)){var p=N0(f);m.forEach((v,b)=>{var S=c==null||o?b:String(Ft(v,c,null)),w=Ft(v,f.dataKey,0),k;u.has(S)?k=u.get(S):k={},Object.assign(k,{[p]:w}),u.set(S,k)})}}),Array.from(u.values())}function E0(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Xh=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Jh(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function f7(e,t){if(e.length===t.length){for(var r=0;r{var t=ht(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},ol=e=>e.tooltip.settings.axisId;function A0(e){if(e!=null){var t=e.ticks,r=e.bandwidth,n=e.range(),i=[Math.min(...n),Math.max(...n)];return{domain:()=>e.domain(),range:(function(o){function c(){return o.apply(this,arguments)}return c.toString=function(){return o.toString()},c})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(o){var c=i[0],u=i[1];return c<=u?o>=c&&o<=u:o>=u&&o<=c},bandwidth:r?()=>r.call(e):void 0,ticks:t?o=>t.call(e,o):void 0,map:(o,c)=>{var u=e(o);if(u!=null){if(e.bandwidth&&c!==null&&c!==void 0&&c.position){var f=e.bandwidth();switch(c.position){case"middle":u+=f/2;break;case"end":u+=f;break}}return u}}}}}var h7=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Hn(t)){for(var r,n,i=0;in)&&(n=o))}return r!==void 0&&n!==void 0?[r,n]:void 0}return t}default:return t}};function ba(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function m7(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function C0(e){let t,r,n;e.length!==2?(t=ba,r=(u,f)=>ba(e(u),f),n=(u,f)=>e(u)-f):(t=e===ba||e===m7?e:p7,r=e,n=e);function i(u,f,h=0,m=u.length){if(h>>1;r(u[p],f)<0?h=p+1:m=p}while(h>>1;r(u[p],f)<=0?h=p+1:m=p}while(hh&&n(u[p-1],f)>-n(u[p],f)?p-1:p}return{left:i,center:c,right:o}}function p7(){return 0}function EC(e){return e===null?NaN:+e}function*g7(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const v7=C0(ba),fu=v7.right;C0(EC).center;class b2 extends Map{constructor(t,r=b7){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(w2(this,t))}has(t){return super.has(w2(this,t))}set(t,r){return super.set(x7(this,t),r)}delete(t){return super.delete(y7(this,t))}}function w2({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function x7({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function y7({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function b7(e){return e!==null&&typeof e=="object"?e.valueOf():e}function w7(e=ba){if(e===ba)return AC;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function AC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const k7=Math.sqrt(50),j7=Math.sqrt(10),S7=Math.sqrt(2);function Hf(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),c=o>=k7?10:o>=j7?5:o>=S7?2:1;let u,f,h;return i<0?(h=Math.pow(10,-i)/c,u=Math.round(e*h),f=Math.round(t*h),u/ht&&--f,h=-h):(h=Math.pow(10,i)*c,u=Math.round(e/h),f=Math.round(t/h),u*ht&&--f),f0))return[];if(e===t)return[e];const n=t=i))return[];const u=o-i+1,f=new Array(u);if(n)if(c<0)for(let h=0;h=n)&&(r=n);return r}function j2(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function CC(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?AC:w7(i);n>r;){if(n-r>600){const f=n-r+1,h=t-r+1,m=Math.log(f),p=.5*Math.exp(2*m/3),v=.5*Math.sqrt(m*p*(f-p)/f)*(h-f/2<0?-1:1),b=Math.max(r,Math.floor(t-h*p/f+v)),S=Math.min(n,Math.floor(t+(f-h)*p/f+v));CC(e,t,b,S,i)}const o=e[t];let c=r,u=n;for(lc(e,r,t),i(e[n],o)>0&&lc(e,r,n);c0;)--u}i(e[r],o)===0?lc(e,r,u):(++u,lc(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function lc(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function N7(e,t,r){if(e=Float64Array.from(g7(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return j2(e);if(t>=1)return k2(e);var n,i=(n-1)*t,o=Math.floor(i),c=k2(CC(e,o).subarray(0,o+1)),u=j2(e.subarray(o+1));return c+(u-c)*(i-o)}}function E7(e,t,r=EC){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,o=Math.floor(i),c=+r(e[o],o,e),u=+r(e[o+1],o+1,e);return c+(u-c)*(i-o)}}function A7(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,o=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Qd(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Qd(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=O7.exec(e))?new Pr(t[1],t[2],t[3],1):(t=_7.exec(e))?new Pr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=M7.exec(e))?Qd(t[1],t[2],t[3],t[4]):(t=I7.exec(e))?Qd(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=T7.exec(e))?O2(t[1],t[2]/100,t[3]/100,1):(t=D7.exec(e))?O2(t[1],t[2]/100,t[3]/100,t[4]):S2.hasOwnProperty(e)?A2(S2[e]):e==="transparent"?new Pr(NaN,NaN,NaN,0):null}function A2(e){return new Pr(e>>16&255,e>>8&255,e&255,1)}function Qd(e,t,r,n){return n<=0&&(e=t=r=NaN),new Pr(e,t,r,n)}function $7(e){return e instanceof hu||(e=Hc(e)),e?(e=e.rgb(),new Pr(e.r,e.g,e.b,e.opacity)):new Pr}function ux(e,t,r,n){return arguments.length===1?$7(e):new Pr(e,t,r,n??1)}function Pr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}_0(Pr,ux,OC(hu,{brighter(e){return e=e==null?Kf:Math.pow(Kf,e),new Pr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Uc:Math.pow(Uc,e),new Pr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pr(xo(this.r),xo(this.g),xo(this.b),Gf(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:C2,formatHex:C2,formatHex8:z7,formatRgb:P2,toString:P2}));function C2(){return`#${eo(this.r)}${eo(this.g)}${eo(this.b)}`}function z7(){return`#${eo(this.r)}${eo(this.g)}${eo(this.b)}${eo((isNaN(this.opacity)?1:this.opacity)*255)}`}function P2(){const e=Gf(this.opacity);return`${e===1?"rgb(":"rgba("}${xo(this.r)}, ${xo(this.g)}, ${xo(this.b)}${e===1?")":`, ${e})`}`}function Gf(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function xo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function eo(e){return e=xo(e),(e<16?"0":"")+e.toString(16)}function O2(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new kn(e,t,r,n)}function _C(e){if(e instanceof kn)return new kn(e.h,e.s,e.l,e.opacity);if(e instanceof hu||(e=Hc(e)),!e)return new kn;if(e instanceof kn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),c=NaN,u=o-i,f=(o+i)/2;return u?(t===o?c=(r-n)/u+(r0&&f<1?0:c,new kn(c,u,f,e.opacity)}function F7(e,t,r,n){return arguments.length===1?_C(e):new kn(e,t,r,n??1)}function kn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}_0(kn,F7,OC(hu,{brighter(e){return e=e==null?Kf:Math.pow(Kf,e),new kn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Uc:Math.pow(Uc,e),new kn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Pr(Rg(e>=240?e-240:e+120,i,n),Rg(e,i,n),Rg(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new kn(_2(this.h),Yd(this.s),Yd(this.l),Gf(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Gf(this.opacity);return`${e===1?"hsl(":"hsla("}${_2(this.h)}, ${Yd(this.s)*100}%, ${Yd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function _2(e){return e=(e||0)%360,e<0?e+360:e}function Yd(e){return Math.max(0,Math.min(1,e||0))}function Rg(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const M0=e=>()=>e;function B7(e,t){return function(r){return e+r*t}}function U7(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function W7(e){return(e=+e)==1?MC:function(t,r){return r-t?U7(t,r,e):M0(isNaN(t)?r:t)}}function MC(e,t){var r=t-e;return r?B7(e,r):M0(isNaN(e)?t:e)}const M2=(function e(t){var r=W7(t);function n(i,o){var c=r((i=ux(i)).r,(o=ux(o)).r),u=r(i.g,o.g),f=r(i.b,o.b),h=MC(i.opacity,o.opacity);return function(m){return i.r=c(m),i.g=u(m),i.b=f(m),i.opacity=h(m),i+""}}return n.gamma=e,n})(1);function H7(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(o){for(i=0;ir&&(o=t.slice(r,o),u[c]?u[c]+=o:u[++c]=o),(n=n[0])===(i=i[0])?u[c]?u[c]+=i:u[++c]=i:(u[++c]=null,f.push({i:c,x:Vf(n,i)})),r=$g.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function tB(e,t,r){var n=e[0],i=e[1],o=t[0],c=t[1];return i2?rB:tB,f=h=null,p}function p(v){return v==null||isNaN(v=+v)?o:(f||(f=u(e.map(n),t,r)))(n(c(v)))}return p.invert=function(v){return c(i((h||(h=u(t,e.map(n),Vf)))(v)))},p.domain=function(v){return arguments.length?(e=Array.from(v,qf),m()):e.slice()},p.range=function(v){return arguments.length?(t=Array.from(v),m()):t.slice()},p.rangeRound=function(v){return t=Array.from(v),r=I0,m()},p.clamp=function(v){return arguments.length?(c=v?!0:gr,m()):c!==gr},p.interpolate=function(v){return arguments.length?(r=v,m()):r},p.unknown=function(v){return arguments.length?(o=v,p):o},function(v,b){return n=v,i=b,m()}}function T0(){return em()(gr,gr)}function nB(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Qf(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Ks(e){return e=Qf(Math.abs(e)),e?e[1]:NaN}function iB(e,t){return function(r,n){for(var i=r.length,o=[],c=0,u=e[0],f=0;i>0&&u>0&&(f+u+1>n&&(u=Math.max(1,n-f)),o.push(r.substring(i-=u,i+u)),!((f+=u+1)>n));)u=e[c=(c+1)%e.length];return o.reverse().join(t)}}function aB(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var oB=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Kc(e){if(!(t=oB.exec(e)))throw new Error("invalid format: "+e);var t;return new D0({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Kc.prototype=D0.prototype;function D0(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}D0.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function sB(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var Yf;function lB(e,t){var r=Qf(e,t);if(!r)return Yf=void 0,e.toPrecision(t);var n=r[0],i=r[1],o=i-(Yf=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,c=n.length;return o===c?n:o>c?n+new Array(o-c+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+Qf(e,Math.max(0,t+o-1))[0]}function T2(e,t){var r=Qf(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const D2={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:nB,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>T2(e*100,t),r:T2,s:lB,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function L2(e){return e}var R2=Array.prototype.map,$2=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function cB(e){var t=e.grouping===void 0||e.thousands===void 0?L2:iB(R2.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?L2:aB(R2.call(e.numerals,String)),c=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function h(p,v){p=Kc(p);var b=p.fill,S=p.align,w=p.sign,k=p.symbol,N=p.zero,E=p.width,A=p.comma,C=p.precision,_=p.trim,O=p.type;O==="n"?(A=!0,O="g"):D2[O]||(C===void 0&&(C=12),_=!0,O="g"),(N||b==="0"&&S==="=")&&(N=!0,b="0",S="=");var D=(v&&v.prefix!==void 0?v.prefix:"")+(k==="$"?r:k==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),B=(k==="$"?n:/[%p]/.test(O)?c:"")+(v&&v.suffix!==void 0?v.suffix:""),z=D2[O],$=/[defgprs%]/.test(O);C=C===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function K(W){var ve=D,ue=B,pe,oe,le;if(O==="c")ue=z(W)+ue,W="";else{W=+W;var Z=W<0||1/W<0;if(W=isNaN(W)?f:z(Math.abs(W),C),_&&(W=sB(W)),Z&&+W==0&&w!=="+"&&(Z=!1),ve=(Z?w==="("?w:u:w==="-"||w==="("?"":w)+ve,ue=(O==="s"&&!isNaN(W)&&Yf!==void 0?$2[8+Yf/3]:"")+ue+(Z&&w==="("?")":""),$){for(pe=-1,oe=W.length;++pele||le>57){ue=(le===46?i+W.slice(pe+1):W.slice(pe))+ue,W=W.slice(0,pe);break}}}A&&!N&&(W=t(W,1/0));var ie=ve.length+W.length+ue.length,te=ie>1)+ve+W+ue+te.slice(ie);break;default:W=te+ve+W+ue;break}return o(W)}return K.toString=function(){return p+""},K}function m(p,v){var b=Math.max(-8,Math.min(8,Math.floor(Ks(v)/3)))*3,S=Math.pow(10,-b),w=h((p=Kc(p),p.type="f",p),{suffix:$2[8+b/3]});return function(k){return w(S*k)}}return{format:h,formatPrefix:m}}var Zd,L0,IC;uB({thousands:",",grouping:[3],currency:["$",""]});function uB(e){return Zd=cB(e),L0=Zd.format,IC=Zd.formatPrefix,Zd}function dB(e){return Math.max(0,-Ks(Math.abs(e)))}function fB(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ks(t)/3)))*3-Ks(Math.abs(e)))}function hB(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ks(t)-Ks(e))+1}function TC(e,t,r,n){var i=lx(e,t,r),o;switch(n=Kc(n??",f"),n.type){case"s":{var c=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=fB(i,c))&&(n.precision=o),IC(n,c)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=hB(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=dB(i))&&(n.precision=o-(n.type==="%")*2);break}}return L0(n)}function Ea(e){var t=e.domain;return e.ticks=function(r){var n=t();return ox(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return TC(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,o=n.length-1,c=n[i],u=n[o],f,h,m=10;for(u0;){if(h=sx(c,u,r),h===f)return n[i]=c,n[o]=u,t(n);if(h>0)c=Math.floor(c/h)*h,u=Math.ceil(u/h)*h;else if(h<0)c=Math.ceil(c*h)/h,u=Math.floor(u*h)/h;else break;f=h}return e},e}function DC(){var e=T0();return e.copy=function(){return mu(e,DC())},cn.apply(e,arguments),Ea(e)}function LC(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,qf),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return LC(e).unknown(t)},e=arguments.length?Array.from(e,qf):[0,1],Ea(r)}function RC(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],o=e[n],c;return oMath.pow(e,t)}function xB(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function B2(e){return(t,r)=>-e(-t,r)}function R0(e){const t=e(z2,F2),r=t.domain;let n=10,i,o;function c(){return i=xB(n),o=vB(n),r()[0]<0?(i=B2(i),o=B2(o),e(mB,pB)):e(z2,F2),t}return t.base=function(u){return arguments.length?(n=+u,c()):n},t.domain=function(u){return arguments.length?(r(u),c()):r()},t.ticks=u=>{const f=r();let h=f[0],m=f[f.length-1];const p=m0){for(;v<=b;++v)for(S=1;Sm)break;N.push(w)}}else for(;v<=b;++v)for(S=n-1;S>=1;--S)if(w=v>0?S/o(-v):S*o(v),!(wm)break;N.push(w)}N.length*2{if(u==null&&(u=10),f==null&&(f=n===10?"s":","),typeof f!="function"&&(!(n%1)&&(f=Kc(f)).precision==null&&(f.trim=!0),f=L0(f)),u===1/0)return f;const h=Math.max(1,n*u/t.ticks().length);return m=>{let p=m/o(Math.round(i(m)));return p*nr(RC(r(),{floor:u=>o(Math.floor(i(u))),ceil:u=>o(Math.ceil(i(u)))})),t}function $C(){const e=R0(em()).domain([1,10]);return e.copy=()=>mu(e,$C()).base(e.base()),cn.apply(e,arguments),e}function U2(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function W2(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function $0(e){var t=1,r=e(U2(t),W2(t));return r.constant=function(n){return arguments.length?e(U2(t=+n),W2(t)):t},Ea(r)}function zC(){var e=$0(em());return e.copy=function(){return mu(e,zC()).constant(e.constant())},cn.apply(e,arguments)}function H2(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function yB(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function bB(e){return e<0?-e*e:e*e}function z0(e){var t=e(gr,gr),r=1;function n(){return r===1?e(gr,gr):r===.5?e(yB,bB):e(H2(r),H2(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Ea(t)}function F0(){var e=z0(em());return e.copy=function(){return mu(e,F0()).exponent(e.exponent())},cn.apply(e,arguments),e}function wB(){return F0.apply(null,arguments).exponent(.5)}function K2(e){return Math.sign(e)*e*e}function kB(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function FC(){var e=T0(),t=[0,1],r=!1,n;function i(o){var c=kB(e(o));return isNaN(c)?n:r?Math.round(c):c}return i.invert=function(o){return e.invert(K2(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,qf)).map(K2)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(r=!!o,i):r},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return FC(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},cn.apply(i,arguments),Ea(i)}function BC(){var e=[],t=[],r=[],n;function i(){var c=0,u=Math.max(1,t.length);for(r=new Array(u-1);++c0?r[u-1]:e[0],u=r?[n[r-1],t]:[n[h-1],n[h]]},c.unknown=function(f){return arguments.length&&(o=f),c},c.thresholds=function(){return n.slice()},c.copy=function(){return UC().domain([e,t]).range(i).unknown(o)},cn.apply(Ea(c),arguments)}function WC(){var e=[.5],t=[0,1],r,n=1;function i(o){return o!=null&&o<=o?t[fu(e,o,0,n)]:r}return i.domain=function(o){return arguments.length?(e=Array.from(o),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var c=t.indexOf(o);return[e[c-1],e[c]]},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return WC().domain(e).range(t).unknown(r)},cn.apply(i,arguments)}const zg=new Date,Fg=new Date;function It(e,t,r,n){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const c=i(o),u=i.ceil(o);return o-c(t(o=new Date(+o),c==null?1:Math.floor(c)),o),i.range=(o,c,u)=>{const f=[];if(o=i.ceil(o),u=u==null?1:Math.floor(u),!(o0))return f;let h;do f.push(h=new Date(+o)),t(o,u),e(o);while(hIt(c=>{if(c>=c)for(;e(c),!o(c);)c.setTime(c-1)},(c,u)=>{if(c>=c)if(u<0)for(;++u<=0;)for(;t(c,-1),!o(c););else for(;--u>=0;)for(;t(c,1),!o(c););}),r&&(i.count=(o,c)=>(zg.setTime(+o),Fg.setTime(+c),e(zg),e(Fg),Math.floor(r(zg,Fg))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?c=>n(c)%o===0:c=>i.count(0,c)%o===0):i)),i}const Zf=It(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Zf.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?It(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Zf);Zf.range;const pi=1e3,rn=pi*60,gi=rn*60,ji=gi*24,B0=ji*7,G2=ji*30,Bg=ji*365,to=It(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*pi)},(e,t)=>(t-e)/pi,e=>e.getUTCSeconds());to.range;const U0=It(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*pi)},(e,t)=>{e.setTime(+e+t*rn)},(e,t)=>(t-e)/rn,e=>e.getMinutes());U0.range;const W0=It(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*rn)},(e,t)=>(t-e)/rn,e=>e.getUTCMinutes());W0.range;const H0=It(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*pi-e.getMinutes()*rn)},(e,t)=>{e.setTime(+e+t*gi)},(e,t)=>(t-e)/gi,e=>e.getHours());H0.range;const K0=It(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*gi)},(e,t)=>(t-e)/gi,e=>e.getUTCHours());K0.range;const pu=It(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*rn)/ji,e=>e.getDate()-1);pu.range;const tm=It(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ji,e=>e.getUTCDate()-1);tm.range;const HC=It(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ji,e=>Math.floor(e/ji));HC.range;function _o(e){return It(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*rn)/B0)}const rm=_o(0),Xf=_o(1),jB=_o(2),SB=_o(3),Gs=_o(4),NB=_o(5),EB=_o(6);rm.range;Xf.range;jB.range;SB.range;Gs.range;NB.range;EB.range;function Mo(e){return It(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/B0)}const nm=Mo(0),Jf=Mo(1),AB=Mo(2),CB=Mo(3),Vs=Mo(4),PB=Mo(5),OB=Mo(6);nm.range;Jf.range;AB.range;CB.range;Vs.range;PB.range;OB.range;const G0=It(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());G0.range;const V0=It(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());V0.range;const Si=It(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Si.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:It(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Si.range;const Ni=It(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ni.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:It(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Ni.range;function KC(e,t,r,n,i,o){const c=[[to,1,pi],[to,5,5*pi],[to,15,15*pi],[to,30,30*pi],[o,1,rn],[o,5,5*rn],[o,15,15*rn],[o,30,30*rn],[i,1,gi],[i,3,3*gi],[i,6,6*gi],[i,12,12*gi],[n,1,ji],[n,2,2*ji],[r,1,B0],[t,1,G2],[t,3,3*G2],[e,1,Bg]];function u(h,m,p){const v=mk).right(c,v);if(b===c.length)return e.every(lx(h/Bg,m/Bg,p));if(b===0)return Zf.every(Math.max(lx(h,m,p),1));const[S,w]=c[v/c[b-1][2]53)return null;"w"in fe||(fe.w=1),"Z"in fe?(Ue=Wg(cc(fe.y,0,1)),_e=Ue.getUTCDay(),Ue=_e>4||_e===0?Jf.ceil(Ue):Jf(Ue),Ue=tm.offset(Ue,(fe.V-1)*7),fe.y=Ue.getUTCFullYear(),fe.m=Ue.getUTCMonth(),fe.d=Ue.getUTCDate()+(fe.w+6)%7):(Ue=Ug(cc(fe.y,0,1)),_e=Ue.getDay(),Ue=_e>4||_e===0?Xf.ceil(Ue):Xf(Ue),Ue=pu.offset(Ue,(fe.V-1)*7),fe.y=Ue.getFullYear(),fe.m=Ue.getMonth(),fe.d=Ue.getDate()+(fe.w+6)%7)}else("W"in fe||"U"in fe)&&("w"in fe||(fe.w="u"in fe?fe.u%7:"W"in fe?1:0),_e="Z"in fe?Wg(cc(fe.y,0,1)).getUTCDay():Ug(cc(fe.y,0,1)).getDay(),fe.m=0,fe.d="W"in fe?(fe.w+6)%7+fe.W*7-(_e+5)%7:fe.w+fe.U*7-(_e+6)%7);return"Z"in fe?(fe.H+=fe.Z/100|0,fe.M+=fe.Z%100,Wg(fe)):Ug(fe)}}function B(re,ye,Oe,fe){for(var Xe=0,Ue=ye.length,_e=Oe.length,wt,tr;Xe=_e)return-1;if(wt=ye.charCodeAt(Xe++),wt===37){if(wt=ye.charAt(Xe++),tr=_[wt in V2?ye.charAt(Xe++):wt],!tr||(fe=tr(re,Oe,fe))<0)return-1}else if(wt!=Oe.charCodeAt(fe++))return-1}return fe}function z(re,ye,Oe){var fe=h.exec(ye.slice(Oe));return fe?(re.p=m.get(fe[0].toLowerCase()),Oe+fe[0].length):-1}function $(re,ye,Oe){var fe=b.exec(ye.slice(Oe));return fe?(re.w=S.get(fe[0].toLowerCase()),Oe+fe[0].length):-1}function K(re,ye,Oe){var fe=p.exec(ye.slice(Oe));return fe?(re.w=v.get(fe[0].toLowerCase()),Oe+fe[0].length):-1}function W(re,ye,Oe){var fe=N.exec(ye.slice(Oe));return fe?(re.m=E.get(fe[0].toLowerCase()),Oe+fe[0].length):-1}function ve(re,ye,Oe){var fe=w.exec(ye.slice(Oe));return fe?(re.m=k.get(fe[0].toLowerCase()),Oe+fe[0].length):-1}function ue(re,ye,Oe){return B(re,t,ye,Oe)}function pe(re,ye,Oe){return B(re,r,ye,Oe)}function oe(re,ye,Oe){return B(re,n,ye,Oe)}function le(re){return c[re.getDay()]}function Z(re){return o[re.getDay()]}function ie(re){return f[re.getMonth()]}function te(re){return u[re.getMonth()]}function I(re){return i[+(re.getHours()>=12)]}function M(re){return 1+~~(re.getMonth()/3)}function U(re){return c[re.getUTCDay()]}function ne(re){return o[re.getUTCDay()]}function ee(re){return f[re.getUTCMonth()]}function X(re){return u[re.getUTCMonth()]}function ae(re){return i[+(re.getUTCHours()>=12)]}function me(re){return 1+~~(re.getUTCMonth()/3)}return{format:function(re){var ye=O(re+="",A);return ye.toString=function(){return re},ye},parse:function(re){var ye=D(re+="",!1);return ye.toString=function(){return re},ye},utcFormat:function(re){var ye=O(re+="",C);return ye.toString=function(){return re},ye},utcParse:function(re){var ye=D(re+="",!0);return ye.toString=function(){return re},ye}}}var V2={"-":"",_:" ",0:"0"},Ht=/^\s*\d+/,LB=/^%/,RB=/[\\^$*+?|[\]().{}]/g;function Qe(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o[t.toLowerCase(),r]))}function zB(e,t,r){var n=Ht.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function FB(e,t,r){var n=Ht.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function BB(e,t,r){var n=Ht.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function UB(e,t,r){var n=Ht.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function WB(e,t,r){var n=Ht.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function q2(e,t,r){var n=Ht.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Q2(e,t,r){var n=Ht.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function HB(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function KB(e,t,r){var n=Ht.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function GB(e,t,r){var n=Ht.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Y2(e,t,r){var n=Ht.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function VB(e,t,r){var n=Ht.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Z2(e,t,r){var n=Ht.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function qB(e,t,r){var n=Ht.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function QB(e,t,r){var n=Ht.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function YB(e,t,r){var n=Ht.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function ZB(e,t,r){var n=Ht.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function XB(e,t,r){var n=LB.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function JB(e,t,r){var n=Ht.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function eU(e,t,r){var n=Ht.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function X2(e,t){return Qe(e.getDate(),t,2)}function tU(e,t){return Qe(e.getHours(),t,2)}function rU(e,t){return Qe(e.getHours()%12||12,t,2)}function nU(e,t){return Qe(1+pu.count(Si(e),e),t,3)}function GC(e,t){return Qe(e.getMilliseconds(),t,3)}function iU(e,t){return GC(e,t)+"000"}function aU(e,t){return Qe(e.getMonth()+1,t,2)}function oU(e,t){return Qe(e.getMinutes(),t,2)}function sU(e,t){return Qe(e.getSeconds(),t,2)}function lU(e){var t=e.getDay();return t===0?7:t}function cU(e,t){return Qe(rm.count(Si(e)-1,e),t,2)}function VC(e){var t=e.getDay();return t>=4||t===0?Gs(e):Gs.ceil(e)}function uU(e,t){return e=VC(e),Qe(Gs.count(Si(e),e)+(Si(e).getDay()===4),t,2)}function dU(e){return e.getDay()}function fU(e,t){return Qe(Xf.count(Si(e)-1,e),t,2)}function hU(e,t){return Qe(e.getFullYear()%100,t,2)}function mU(e,t){return e=VC(e),Qe(e.getFullYear()%100,t,2)}function pU(e,t){return Qe(e.getFullYear()%1e4,t,4)}function gU(e,t){var r=e.getDay();return e=r>=4||r===0?Gs(e):Gs.ceil(e),Qe(e.getFullYear()%1e4,t,4)}function vU(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Qe(t/60|0,"0",2)+Qe(t%60,"0",2)}function J2(e,t){return Qe(e.getUTCDate(),t,2)}function xU(e,t){return Qe(e.getUTCHours(),t,2)}function yU(e,t){return Qe(e.getUTCHours()%12||12,t,2)}function bU(e,t){return Qe(1+tm.count(Ni(e),e),t,3)}function qC(e,t){return Qe(e.getUTCMilliseconds(),t,3)}function wU(e,t){return qC(e,t)+"000"}function kU(e,t){return Qe(e.getUTCMonth()+1,t,2)}function jU(e,t){return Qe(e.getUTCMinutes(),t,2)}function SU(e,t){return Qe(e.getUTCSeconds(),t,2)}function NU(e){var t=e.getUTCDay();return t===0?7:t}function EU(e,t){return Qe(nm.count(Ni(e)-1,e),t,2)}function QC(e){var t=e.getUTCDay();return t>=4||t===0?Vs(e):Vs.ceil(e)}function AU(e,t){return e=QC(e),Qe(Vs.count(Ni(e),e)+(Ni(e).getUTCDay()===4),t,2)}function CU(e){return e.getUTCDay()}function PU(e,t){return Qe(Jf.count(Ni(e)-1,e),t,2)}function OU(e,t){return Qe(e.getUTCFullYear()%100,t,2)}function _U(e,t){return e=QC(e),Qe(e.getUTCFullYear()%100,t,2)}function MU(e,t){return Qe(e.getUTCFullYear()%1e4,t,4)}function IU(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Vs(e):Vs.ceil(e),Qe(e.getUTCFullYear()%1e4,t,4)}function TU(){return"+0000"}function eS(){return"%"}function tS(e){return+e}function rS(e){return Math.floor(+e/1e3)}var ds,YC,ZC;DU({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function DU(e){return ds=DB(e),YC=ds.format,ds.parse,ZC=ds.utcFormat,ds.utcParse,ds}function LU(e){return new Date(e)}function RU(e){return e instanceof Date?+e:+new Date(+e)}function q0(e,t,r,n,i,o,c,u,f,h){var m=T0(),p=m.invert,v=m.domain,b=h(".%L"),S=h(":%S"),w=h("%I:%M"),k=h("%I %p"),N=h("%a %d"),E=h("%b %d"),A=h("%B"),C=h("%Y");function _(O){return(f(O)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,o)=>N7(e,o/n))},r.copy=function(){return tP(t).domain(e)},Pi.apply(r,arguments)}function am(){var e=0,t=.5,r=1,n=1,i,o,c,u,f,h=gr,m,p=!1,v;function b(w){return isNaN(w=+w)?v:(w=.5+((w=+m(w))-o)*(n*w{if(e!=null){var n=e.scale,i=e.type;if(n==="auto")return i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof n=="string")return HU(n)?n:"point"}};function KU(e,t){for(var r=0,n=e.length,i=e[0]t)?r=o+1:n=o}return r}function sP(e,t){if(e){var r=t??e.domain(),n=r.map(o=>{var c;return(c=e(o))!==null&&c!==void 0?c:0}),i=e.range();if(!(r.length===0||i.length<2))return o=>{var c,u,f=KU(n,o);if(f<=0)return r[0];if(f>=r.length)return r[r.length-1];var h=(c=n[f-1])!==null&&c!==void 0?c:0,m=(u=n[f])!==null&&u!==void 0?u:0;return Math.abs(o-h)<=Math.abs(o-m)?r[f-1]:r[f]}}}function GU(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):sP(e,void 0)}function iS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function eh(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);re.cartesianAxis.xAxis[t],Oi=(e,t)=>{var r=cP(e,t);return r??Ot},_t={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:hx,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:su},uP=(e,t)=>e.cartesianAxis.yAxis[t],_i=(e,t)=>{var r=uP(e,t);return r??_t},eW={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},X0=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??eW},yr=(e,t,r)=>{switch(t){case"xAxis":return Oi(e,r);case"yAxis":return _i(e,r);case"zAxis":return X0(e,r);case"angleAxis":return k0(e,r);case"radiusAxis":return j0(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},tW=(e,t,r)=>{switch(t){case"xAxis":return Oi(e,r);case"yAxis":return _i(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},gu=(e,t,r)=>{switch(t){case"xAxis":return Oi(e,r);case"yAxis":return _i(e,r);case"angleAxis":return k0(e,r);case"radiusAxis":return j0(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},dP=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function fP(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var hP=e=>e.graphicalItems.cartesianItems,rW=Q([Ut,Zh],fP),mP=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),ll=Q([hP,yr,rW],mP,{memoizeOptions:{resultEqualityCheck:Jh}}),pP=Q([ll],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(E0)),gP=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),nW=Q([ll],gP),vP=e=>e.map(t=>t.data).filter(Boolean).flat(1),iW=Q([ll],e=>e.some(t=>!t.data)),xP=Q([ll],vP,{memoizeOptions:{resultEqualityCheck:Jh}}),yP=(e,t)=>{var r=t.chartData,n=r===void 0?[]:r,i=t.dataStartIndex,o=t.dataEndIndex;return e.length>0?e:n.slice(i,o+1)},J0=Q([xP,Gh],yP),aW=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:Ft(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(i=>({value:Ft(i,n)}))):e.map(n=>({value:n})),bP=(e,t,r,n,i,o)=>{var c=n.chartData,u=c===void 0?[]:c,f=n.dataStartIndex,h=n.dataEndIndex,m=aW(e,t,r);if(i&&(t==null?void 0:t.dataKey)!=null&&o.length>0){var p=u.slice(f,h+1),v=p.map(b=>({value:Ft(b,t.dataKey)})).filter(b=>b.value!=null);return[...v,...m]}return m},vu=Q([J0,yr,ll,Gh,iW,xP],bP);function Ns(e){if(Vn(e)||e instanceof Date){var t=Number(e);if(He(t))return t}}function oS(e){if(Array.isArray(e)){var t=[Ns(e[0]),Ns(e[1])];return Hn(t)?t:void 0}var r=Ns(e);if(r!=null)return[r,r]}function Yn(e){return e.map(Ns).filter(Cr)}function oW(e,t){var r=Ns(e),n=Ns(t);return r==null&&n==null?0:r==null?-1:n==null?1:r-n}var sW=Q([vu],e=>e==null?void 0:e.map(t=>t.value).sort(oW));function wP(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function lW(e,t,r){if(!r)return[];if(!r.length)return[];var n;if(typeof t=="number"&&!Gn(t))n=t;else if(Array.isArray(t)){var i=Yn(t);i.length>0&&(n=Math.max(...i))}return n==null?[]:Yn(r.flatMap(o=>{var c=Ft(e,o.dataKey),u,f;if(Array.isArray(c)){var h=lP(c,2);u=h[0],f=h[1]}else u=f=c;if(!(!He(u)||!He(f)))return[n-u,n+f]}))}var Tt=e=>{var t=Wt(e),r=ol(e);return gu(e,t,r)},qs=Q([Tt],e=>e==null?void 0:e.dataKey),cW=Q([pP,Gh,Tt],NC),kP=(e,t,r,n)=>{var i={},o=t.reduce((c,u)=>{if(u.stackId==null)return c;var f=c[u.stackId];return f==null&&(f=[]),f.push(u),c[u.stackId]=f,c},i);return Object.fromEntries(Object.entries(o).map(c=>{var u=lP(c,2),f=u[0],h=u[1],m=n?[...h].reverse():h,p=m.map(N0);return[f,{stackedData:Az(e,p,r),graphicalItems:m}]}))},jP=Q([cW,pP,Vh,xC],kP),SP=(e,t,r,n)=>{var i=t.dataStartIndex,o=t.dataEndIndex;if(n==null&&r!=="zAxis")return _z(e,i,o)},uW=Q([yr],e=>e.allowDataOverflow),ey=e=>{var t;if(e==null||!("domain"in e))return hx;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=Yn(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:hx},NP=Q([yr],ey),EP=Q([NP,uW],sC),dW=Q([jP,Cn,Ut,EP],SP,{memoizeOptions:{resultEqualityCheck:Xh}}),ty=e=>e.errorBars,fW=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>wP(r,n)),th=function(){for(var t=arguments.length,r=new Array(t),n=0;n5&&arguments[5]!==void 0?arguments[5]:[],u,f;if(n.length>0&&n.forEach(h=>{var m,p=h.data!=null?[...h.data]:c,v=(m=i[h.id])===null||m===void 0?void 0:m.filter(b=>wP(o,b));p.forEach(b=>{var S,w=Ft(b,(S=r.dataKey)!==null&&S!==void 0?S:h.dataKey),k=lW(b,w,v);if(k.length>=2){var N=Math.min(...k),E=Math.max(...k);(u==null||Nf)&&(f=E)}var A=oS(w);A!=null&&(u=u==null?A[0]:Math.min(u,A[0]),f=f==null?A[1]:Math.max(f,A[1]))})}),(r==null?void 0:r.dataKey)!=null&&n.length===0&&t.forEach(h=>{var m=oS(Ft(h,r.dataKey));m!=null&&(u=u==null?m[0]:Math.min(u,m[0]),f=f==null?m[1]:Math.max(f,m[1]))}),He(u)&&He(f))return[u,f]},hW=Q([J0,yr,nW,ty,Ut,W9],AP,{memoizeOptions:{resultEqualityCheck:Xh}});function mW(e){var t=e.value;if(Vn(t)||t instanceof Date)return t}var pW=(e,t,r)=>{var n=e.map(mW).filter(i=>i!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&$E(n))?oC(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},CP=e=>e.referenceElements.dots,cl=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),gW=Q([CP,Ut,Zh],cl),PP=e=>e.referenceElements.areas,vW=Q([PP,Ut,Zh],cl),OP=e=>e.referenceElements.lines,xW=Q([OP,Ut,Zh],cl),_P=(e,t)=>{if(e!=null){var r=Yn(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},yW=Q(gW,Ut,_P),MP=(e,t)=>{if(e!=null){var r=Yn(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},bW=Q([vW,Ut],MP);function wW(e){var t;if(e.x!=null)return Yn([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:Yn(r)}function kW(e){var t;if(e.y!=null)return Yn([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:Yn(r)}var IP=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?wW(n):kW(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},jW=Q([xW,Ut],IP),SW=Q(yW,jW,bW,(e,t,r)=>th(e,r,t)),TP=(e,t,r,n,i,o,c,u)=>{if(r!=null)return r;var f=c==="vertical"&&u==="xAxis"||c==="horizontal"&&u==="yAxis",h=f?th(n,o,i):th(o,i);return Q9(t,h,e.allowDataOverflow)},NW=Q([yr,NP,EP,dW,hW,SW,ht,Ut],TP,{memoizeOptions:{resultEqualityCheck:Xh}}),EW=[0,1],DP=(e,t,r,n,i,o,c)=>{if(!((e==null||r==null||r.length===0)&&c===void 0)){var u=e.dataKey,f=e.type,h=Zn(t,o);if(h&&u==null){var m;return oC(0,(m=r==null?void 0:r.length)!==null&&m!==void 0?m:0)}return f==="category"?pW(n,e,h):i==="expand"&&!h?EW:c}},ry=Q([yr,ht,J0,vu,Vh,Ut,NW],DP),ul=Q([yr,dP,y0],oP),LP=(e,t,r)=>{var n=t.niceTicks;if(n!=="none"){var i=ey(t),o=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((n==="snap125"||n==="adaptive")&&t!=null&&t.tickCount&&Hn(e)){if(o)return p2(e,t.tickCount,t.allowDecimals,n);if(t.type==="number")return g2(e,t.tickCount,t.allowDecimals,n)}if(n==="auto"&&r==="linear"&&t!=null&&t.tickCount){if(o&&Hn(e))return p2(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Hn(e))return g2(e,t.tickCount,t.allowDecimals,"adaptive")}}},ny=Q([ry,gu,ul],LP),RP=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Hn(t)&&Array.isArray(r)&&r.length>0){var i,o,c=t[0],u=(i=r[0])!==null&&i!==void 0?i:0,f=t[1],h=(o=r[r.length-1])!==null&&o!==void 0?o:0;return[Math.min(c,u),Math.max(f,h)]}return t},AW=Q([yr,ry,ny,Ut],RP),CW=Q(vu,yr,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(Yn(e.map(p=>p.value))).sort((p,v)=>p-v),i=n[0],o=n[n.length-1];if(i==null||o==null)return 1/0;var c=o-i;if(c===0)return 1/0;for(var u=0;ui,(e,t,r,n,i)=>{if(!He(e))return 0;var o=t==="vertical"?n.height:n.width;if(i==="gap")return e*o/2;if(i==="no-gap"){var c=Sa(r,e*o),u=e*o/2;return u-c-(u-c)/o*c}return 0}),PW=(e,t,r)=>{var n=Oi(e,t);return n==null||typeof n.padding!="string"?0:$P(e,"xAxis",t,r,n.padding)},OW=(e,t,r)=>{var n=_i(e,t);return n==null||typeof n.padding!="string"?0:$P(e,"yAxis",t,r,n.padding)},_W=Q(Oi,PW,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var i=e.padding;return typeof i=="string"?{left:t,right:t}:{left:((r=i.left)!==null&&r!==void 0?r:0)+t,right:((n=i.right)!==null&&n!==void 0?n:0)+t}}),MW=Q(_i,OW,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var i=e.padding;return typeof i=="string"?{top:t,bottom:t}:{top:((r=i.top)!==null&&r!==void 0?r:0)+t,bottom:((n=i.bottom)!==null&&n!==void 0?n:0)+t}}),zP=Q([er,_W,Fh,zh,(e,t,r)=>r],(e,t,r,n,i)=>{var o=n.padding;return i?[o.left,r.width-o.right]:[e.left+t.left,e.left+e.width-t.right]}),FP=Q([er,ht,MW,Fh,zh,(e,t,r)=>r],(e,t,r,n,i,o)=>{var c=i.padding;return o?[n.height-c.bottom,c.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),xu=(e,t,r,n)=>{var i;switch(t){case"xAxis":return zP(e,r,n);case"yAxis":return FP(e,r,n);case"zAxis":return(i=X0(e,r))===null||i===void 0?void 0:i.range;case"angleAxis":return kC(e);case"radiusAxis":return jC(e,r);default:return}},BP=Q([yr,xu],qh),IW=Q([ul,AW],h7),iy=Q([yr,ul,IW,BP],Z0),UP=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var i=r.type,o=r.scale,c=Zn(e,n);if(c&&(i==="number"||o!=="auto"))return t.map(u=>u.value)}},ay=Q([ht,vu,gu,Ut],UP),om=Q([iy],A0);Q([iy],GU);Q([iy,sW],sP);Q([ll,ty,Ut],fW);function WP(e,t){return e.idt.id?1:0}var sm=(e,t)=>t,lm=(e,t,r)=>r,TW=Q(Rh,sm,lm,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(WP)),DW=Q($h,sm,lm,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(WP)),HP=(e,t)=>({width:e.width,height:t.height}),LW=(e,t)=>{var r=typeof t.width=="number"?t.width:su;return{width:r,height:e.height}},RW=Q(er,Oi,HP),$W=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},zW=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},FW=Q(Ci,er,TW,sm,lm,(e,t,r,n,i)=>{var o={},c;return r.forEach(u=>{var f=HP(t,u);c==null&&(c=$W(t,n,e));var h=n==="top"&&!i||n==="bottom"&&i;o[u.id]=c-Number(h)*f.height,c+=(h?-1:1)*f.height}),o}),BW=Q(Ai,er,DW,sm,lm,(e,t,r,n,i)=>{var o={},c;return r.forEach(u=>{var f=LW(t,u);c==null&&(c=zW(t,n,e));var h=n==="left"&&!i||n==="right"&&i;o[u.id]=c-Number(h)*f.width,c+=(h?-1:1)*f.width}),o}),UW=(e,t)=>{var r=Oi(e,t);if(r!=null)return FW(e,r.orientation,r.mirror)},WW=Q([er,Oi,UW,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}}),HW=(e,t)=>{var r=_i(e,t);if(r!=null)return BW(e,r.orientation,r.mirror)},KW=Q([er,_i,HW,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var i=r==null?void 0:r[n];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}}),GW=Q(er,_i,(e,t)=>{var r=typeof t.width=="number"?t.width:su;return{width:r,height:e.height}}),KP=(e,t,r,n)=>{if(r!=null){var i=r.allowDuplicatedCategory,o=r.type,c=r.dataKey,u=Zn(e,n),f=t.map(m=>m.value),h=f.filter(m=>m!=null);if(c&&u&&o==="category"&&i&&$E(h))return f}},oy=Q([ht,vu,yr,Ut],KP),sS=Q([ht,tW,ul,om,oy,ay,xu,ny,Ut],(e,t,r,n,i,o,c,u,f)=>{if(t!=null){var h=Zn(e,f);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:f,categoricalDomain:o,duplicateDomain:i,isCategorical:h,niceTicks:u,range:c,realScaleType:r,scale:n}}}),VW=(e,t,r,n,i,o,c,u,f)=>{if(!(t==null||n==null)){var h=Zn(e,f),m=t.type,p=t.ticks,v=t.tickCount,b=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,S=m==="category"&&n.bandwidth?n.bandwidth()/b:0;S=f==="angleAxis"&&o!=null&&o.length>=2?en(o[0]-o[1])*2*S:S;var w=p||i;return w?w.map((k,N)=>{var E=c?c.indexOf(k):k,A=n.map(E);return He(A)?{index:N,coordinate:A+S,value:k,offset:S}:null}).filter(Cr):h&&u?u.map((k,N)=>{var E=n.map(k);return He(E)?{coordinate:E+S,value:k,index:N,offset:S}:null}).filter(Cr):n.ticks?n.ticks(v).map((k,N)=>{var E=n.map(k);return He(E)?{coordinate:E+S,value:k,index:N,offset:S}:null}).filter(Cr):n.domain().map((k,N)=>{var E=n.map(k);return He(E)?{coordinate:E+S,value:c?c[k]:k,index:N,offset:S}:null}).filter(Cr)}},GP=Q([ht,gu,ul,om,ny,xu,oy,ay,Ut],VW),qW=(e,t,r,n,i,o,c)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var u=Zn(e,c),f=t.tickCount,h=0;return h=c==="angleAxis"&&(n==null?void 0:n.length)>=2?en(n[0]-n[1])*2*h:h,u&&o?o.map((m,p)=>{var v=r.map(m);return He(v)?{coordinate:v+h,value:m,index:p,offset:h}:null}).filter(Cr):r.ticks?r.ticks(f).map((m,p)=>{var v=r.map(m);return He(v)?{coordinate:v+h,value:m,index:p,offset:h}:null}).filter(Cr):r.domain().map((m,p)=>{var v=r.map(m);return He(v)?{coordinate:v+h,value:i?i[m]:m,index:p,offset:h}:null}).filter(Cr)}},VP=Q([ht,gu,om,xu,oy,ay,Ut],qW),qP=Q(yr,om,(e,t)=>{if(!(e==null||t==null))return eh(eh({},e),{},{scale:t})}),QW=Q([yr,ul,ry,BP],Z0),YW=Q([QW],A0);Q((e,t,r)=>X0(e,r),YW,(e,t)=>{if(!(e==null||t==null))return eh(eh({},e),{},{scale:t})});var ZW=Q([ht,Rh,$h],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),XW=(e,t,r)=>{var n;return(n=e.renderedTicks[t])===null||n===void 0?void 0:n[r]};Q([XW],e=>{if(!(!e||e.length===0))return t=>{var r,n=1/0,i=e[0];for(var o of e){var c=Math.abs(o.coordinate-t);ce.options.defaultTooltipEventType,YP=e=>e.options.validateTooltipEventTypes;function ZP(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function yu(e,t){var r=QP(e),n=YP(e);return ZP(t,r,n)}function JW(e){return Me(t=>yu(t,e))}var XP=(e,t)=>{var r,n=Number(t);if(!(Gn(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},eH=e=>e.tooltip.settings,sa={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},tH={itemInteraction:{click:sa,hover:sa},axisInteraction:{click:sa,hover:sa},keyboardInteraction:sa,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},JP=ur({name:"tooltip",initialState:tH,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:lt()},replaceTooltipEntrySettings:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,o=tn(e).tooltipItemPayloads.indexOf(n);o>-1&&(e.tooltipItemPayloads[o]=i)},prepare:lt()},removeTooltipEntrySettings:{reducer(e,t){var r=tn(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:lt()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),un=JP.actions,rH=un.addTooltipEntrySettings,nH=un.replaceTooltipEntrySettings,iH=un.removeTooltipEntrySettings,aH=un.setTooltipSettingsState,oH=un.setActiveMouseOverItemIndex;un.mouseLeaveItem;var e3=un.mouseLeaveChart;un.setActiveClickItemIndex;var t3=un.setMouseOverAxisIndex,sH=un.setMouseClickAxisIndex,vc=un.setSyncInteraction,rh=un.setKeyboardInteraction,lH=JP.reducer;function lS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Xd(e){for(var t=1;t{if(t==null)return sa;var i=fH(e,t,r);if(i==null)return sa;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var o=e.settings.active===!0;if(hH(i)){if(o)return Xd(Xd({},i),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return Xd(Xd({},sa),{},{coordinate:i.coordinate})};function mH(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var r=Number(e);return Number.isFinite(r)?r:void 0}function pH(e,t){var r=mH(e),n=t[0],i=t[1];if(r===void 0)return!1;var o=Math.min(n,i),c=Math.max(n,i);return r>=o&&r<=c}function gH(e,t,r){if(r==null||t==null)return!0;var n=Ft(e,t);return n==null||!Hn(r)?!0:pH(n,r)}var wc=(e,t,r,n)=>{var i=e==null?void 0:e.index;if(i==null)return null;var o=Number(i);if(!He(o))return i;var c=0,u=1/0;t.length>0&&(u=t.length-1);var f=Math.max(c,Math.min(o,u)),h=t[f];return h==null||gH(h,r,n)?String(f):null},n3=(e,t,r,n,i,o,c)=>{if(o!=null){var u=c[0],f=u==null?void 0:u.getPosition(o);if(f!=null)return f;var h=i==null?void 0:i[Number(o)];if(h)switch(r){case"horizontal":return{x:h.coordinate,y:(n.top+t)/2};default:return{x:(n.left+e)/2,y:h.coordinate}}}},i3=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(r==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&i==null)return e.tooltipItemPayloads;if(i==null&&(n!=null||e.keyboardInteraction.active)){var o=e.tooltipItemPayloads[0];return o!=null?[o]:[]}return e.tooltipItemPayloads.filter(c=>{var u;return((u=c.settings)===null||u===void 0?void 0:u.graphicalItemId)===i})},a3=e=>e.options.tooltipPayloadSearcher,dl=e=>e.tooltip;function cS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function uS(e){for(var t=1;te(t)}function dS(e){if(typeof e=="string")return e}function jH(e){if(!(e==null||typeof e!="object")){var t="name"in e?bH(e.name):void 0,r="unit"in e?wH(e.unit):void 0,n="dataKey"in e?kH(e.dataKey):void 0,i="payload"in e?e.payload:void 0,o="color"in e?dS(e.color):void 0,c="fill"in e?dS(e.fill):void 0;return{name:t,unit:r,dataKey:n,payload:i,color:o,fill:c}}}function SH(e,t){return e??t}var o3=(e,t,r,n,i,o,c)=>{if(!(t==null||o==null)){var u=r.chartData,f=r.computedData,h=r.dataStartIndex,m=r.dataEndIndex,p=[];return e.reduce((v,b)=>{var S,w=b.dataDefinedOnItem,k=b.settings,N=SH(w,u),E=Array.isArray(N)?_A(N,h,m):N,A=(S=k==null?void 0:k.dataKey)!==null&&S!==void 0?S:n,C=k==null?void 0:k.nameKey,_;if(n&&Array.isArray(E)&&!Array.isArray(E[0])&&c==="axis"?_=zE(E,n,i):_=o(E,t,f,C),Array.isArray(_))_.forEach(D=>{var B,z,$=jH(D),K=$==null?void 0:$.name,W=$==null?void 0:$.dataKey,ve=$==null?void 0:$.payload,ue=uS(uS({},k),{},{name:K,unit:$==null?void 0:$.unit,color:(B=$==null?void 0:$.color)!==null&&B!==void 0?B:k==null?void 0:k.color,fill:(z=$==null?void 0:$.fill)!==null&&z!==void 0?z:k==null?void 0:k.fill});v.push(aj({tooltipEntrySettings:ue,dataKey:W,payload:ve,value:Ft(ve,W),name:K==null?void 0:String(K)}))});else{var O;v.push(aj({tooltipEntrySettings:k,dataKey:A,payload:_,value:Ft(_,A),name:(O=Ft(_,C))!==null&&O!==void 0?O:k==null?void 0:k.name}))}return v},p)}},sy=Q([Tt,dP,y0],oP),NH=Q([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),EH=Q([Wt,ol],fP),Io=Q([NH,Tt,EH],mP,{memoizeOptions:{resultEqualityCheck:Jh}}),AH=Q([Io],e=>e.filter(E0)),s3=Q([Io],vP,{memoizeOptions:{resultEqualityCheck:Jh}}),CH=Q([Io],e=>e.some(t=>!t.data)),Eo=Q([s3,Cn],yP),PH=Q([AH,Cn,Tt],NC),ly=Q([Eo,Tt,Io,Cn,CH,s3],bP),l3=Q([Tt],ey),OH=Q([Tt],e=>e.allowDataOverflow),c3=Q([l3,OH],sC),_H=Q([Io],e=>e.filter(E0)),MH=Q([PH,_H,Vh,xC],kP),IH=Q([MH,Cn,Wt,c3],SP),TH=Q([Io],gP),DH=Q([Eo,Tt,TH,ty,Wt,H9],AP,{memoizeOptions:{resultEqualityCheck:Xh}}),LH=Q([CP,Wt,ol],cl),RH=Q([LH,Wt],_P),$H=Q([PP,Wt,ol],cl),zH=Q([$H,Wt],MP),FH=Q([OP,Wt,ol],cl),BH=Q([FH,Wt],IP),UH=Q([RH,BH,zH],th),WH=Q([Tt,l3,c3,IH,DH,UH,ht,Wt],TP),Qs=Q([Tt,ht,Eo,ly,Vh,Wt,WH],DP),HH=Q([Qs,Tt,sy],LP),KH=Q([Tt,Qs,HH,Wt],RP),u3=e=>{var t=Wt(e),r=ol(e),n=!1;return xu(e,t,r,n)},d3=Q([Tt,u3],qh),GH=Q([Tt,sy,KH,d3],Z0),f3=Q([GH],A0),VH=Q([ht,ly,Tt,Wt],KP),qH=Q([ht,ly,Tt,Wt],UP),QH=(e,t,r,n,i,o,c,u)=>{if(t){var f=t.type,h=Zn(e,u);if(n){var m=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,p=f==="category"&&n.bandwidth?n.bandwidth()/m:0;return p=u==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?en(i[0]-i[1])*2*p:p,h&&c?c.map((v,b)=>{var S=n.map(v);return He(S)?{coordinate:S+p,value:v,index:b,offset:p}:null}).filter(Cr):n.domain().map((v,b)=>{var S=n.map(v);return He(S)?{coordinate:S+p,value:o?o[v]:v,index:b,offset:p}:null}).filter(Cr)}}},Mi=Q([ht,Tt,sy,f3,u3,VH,qH,Wt],QH),cy=Q([QP,YP,eH],(e,t,r)=>ZP(r.shared,e,t)),h3=e=>e.tooltip.settings.trigger,uy=e=>e.tooltip.settings.defaultIndex,bu=Q([dl,cy,h3,uy],r3),Gc=Q([bu,Eo,qs,Qs],wc),m3=Q([Mi,Gc],XP),YH=Q([bu],e=>{if(e)return e.dataKey}),ZH=Q([bu],e=>{if(e)return e.graphicalItemId}),p3=Q([dl,cy,h3,uy],i3),XH=Q([Ai,Ci,ht,er,Mi,uy,p3],n3),JH=Q([bu,XH],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),eK=Q([bu],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),tK=Q([p3,Gc,Cn,qs,m3,a3,cy],o3),rK=Q([tK],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function fS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hS(e){for(var t=1;tMe(Tt),sK=()=>{var e=oK(),t=Me(Mi),r=Me(f3);return Mf(!e||!r?void 0:hS(hS({},e),{},{scale:r}),t)};function mS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fs(e){for(var t=1;t{var i=t.find(o=>o&&o.index===r);if(i){if(e==="horizontal")return{x:i.coordinate,y:n.relativeY};if(e==="vertical")return{x:n.relativeX,y:i.coordinate}}return{x:0,y:0}},fK=(e,t,r,n)=>{var i=t.find(h=>h&&h.index===r);if(i){if(e==="centric"){var o=i.coordinate,c=n.radius;return fs(fs(fs({},n),Zt(n.cx,n.cy,c,o)),{},{angle:o,radius:c})}var u=i.coordinate,f=n.angle;return fs(fs(fs({},n),Zt(n.cx,n.cy,u,f)),{},{angle:f,radius:u})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function hK(e,t){var r=e.relativeX,n=e.relativeY;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}var g3=(e,t,r,n,i)=>{var o,c=(o=t==null?void 0:t.length)!==null&&o!==void 0?o:0;if(c<=1||e==null)return 0;if(n==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var u=0;u0?(f=r[u-1])===null||f===void 0?void 0:f.coordinate:(h=r[c-1])===null||h===void 0?void 0:h.coordinate,S=(m=r[u])===null||m===void 0?void 0:m.coordinate,w=u>=c-1?(p=r[0])===null||p===void 0?void 0:p.coordinate:(v=r[u+1])===null||v===void 0?void 0:v.coordinate,k=void 0;if(!(b==null||S==null||w==null))if(en(S-b)!==en(w-S)){var N=[];if(en(w-S)===en(i[1]-i[0])){k=w;var E=S+i[1]-i[0];N[0]=Math.min(E,(E+b)/2),N[1]=Math.max(E,(E+b)/2)}else{k=b;var A=w+i[1]-i[0];N[0]=Math.min(S,(A+S)/2),N[1]=Math.max(S,(A+S)/2)}var C=[Math.min(S,(k+S)/2),Math.max(S,(k+S)/2)];if(e>C[0]&&e<=C[1]||e>=N[0]&&e<=N[1]){var _;return(_=r[u])===null||_===void 0?void 0:_.index}}else{var O=Math.min(b,w),D=Math.max(b,w);if(e>(O+S)/2&&e<=(D+S)/2){var B;return(B=r[u])===null||B===void 0?void 0:B.index}}}else if(t)for(var z=0;z($.coordinate+W.coordinate)/2||z>0&&z($.coordinate+W.coordinate)/2&&e<=($.coordinate+K.coordinate)/2)return $.index}}return-1},v3=()=>Me(y0),dy=(e,t)=>t,x3=(e,t,r)=>r,fy=(e,t,r,n)=>n,mK=Q(Mi,e=>Eh(e,t=>t.coordinate)),hy=Q([dl,dy,x3,fy],r3),my=Q([hy,Eo,qs,Qs],wc),pK=(e,t,r)=>{if(t!=null){var n=dl(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},y3=Q([dl,dy,x3,fy],i3),nh=Q([Ai,Ci,ht,er,Mi,fy,y3],n3),gK=Q([hy,nh],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),b3=Q([Mi,my],XP),vK=Q([y3,my,Cn,qs,b3,a3,dy],o3),xK=Q([hy,my],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),yK=(e,t,r,n,i,o,c)=>{if(!(!e||!r||!n||!i)&&hK(e,c)){var u=Mz(e,t),f=g3(u,o,i,r,n),h=dK(t,i,f,e);return{activeIndex:String(f),activeCoordinate:h}}},bK=(e,t,r,n,i,o,c)=>{if(!(!e||!n||!i||!o||!r)){var u=D9(e,r);if(u){var f=Iz(u,t),h=g3(f,c,o,n,i),m=fK(t,o,h,u);return{activeIndex:String(h),activeCoordinate:m}}}},wK=(e,t,r,n,i,o,c,u)=>{if(!(!e||!t||!n||!i||!o))return t==="horizontal"||t==="vertical"?yK(e,t,n,i,o,c,u):bK(e,t,r,n,i,o,c)},kK=Q(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var n=e[t];if(n!=null)return r?n.panoramaElement:n.element}}),jK=Q(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(pr)),r=Array.from(new Set(t));return r.sort((n,i)=>n-i)},{memoizeOptions:{resultEqualityCheck:f7}});function pS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function gS(e){for(var t=1;tgS(gS({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),AK)},PK=new Set(Object.values(pr));function OK(e){return PK.has(e)}var w3=ur({name:"zIndex",initialState:CK,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:lt()},unregisterZIndexPortal:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!OK(r)&&delete e.zIndexMap[r])},prepare:lt()},registerZIndexPortalElement:{reducer:(e,t)=>{var r=t.payload,n=r.zIndex,i=r.element,o=r.isPanorama;e.zIndexMap[n]?o?e.zIndexMap[n].panoramaElement=i:e.zIndexMap[n].element=i:e.zIndexMap[n]={consumers:0,element:o?void 0:i,panoramaElement:o?i:void 0}},prepare:lt()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:lt()}}}),cm=w3.actions,_K=cm.registerZIndexPortal,Hg=cm.unregisterZIndexPortal,MK=cm.registerZIndexPortalElement,IK=cm.unregisterZIndexPortalElement,TK=w3.reducer;function Ii(e){var t=e.zIndex,r=e.children,n=v8(),i=n&&t!==void 0&&t!==0,o=Or(),c=x.useRef(void 0),u=x.useRef(new Set),f=At(),h=Me(p=>kK(p,t,o));if(x.useLayoutEffect(()=>{if(!i){var p=u.current;p.forEach(b=>{f(Hg({zIndex:b}))}),p.clear(),c.current=void 0;return}if(u.current.has(t)||(f(_K({zIndex:t})),u.current.add(t)),h){c.current=h;var v=u.current;v.forEach(b=>{b!==t&&(f(Hg({zIndex:b})),v.delete(b))})}},[f,t,i,h]),x.useLayoutEffect(()=>{var p=u.current;return()=>{p.forEach(v=>{f(Hg({zIndex:v}))}),p.clear()}},[f]),!i)return r;var m=h??c.current;return m?vh.createPortal(r,m):null}function mx(){return mx=Object.assign?Object.assign.bind():function(e){for(var t=1;tx.useContext(k3),Kg={exports:{}},xS;function UK(){return xS||(xS=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(f,h,m){this.fn=f,this.context=h,this.once=m||!1}function o(f,h,m,p,v){if(typeof m!="function")throw new TypeError("The listener must be a function");var b=new i(m,p||f,v),S=r?r+h:h;return f._events[S]?f._events[S].fn?f._events[S]=[f._events[S],b]:f._events[S].push(b):(f._events[S]=b,f._eventsCount++),f}function c(f,h){--f._eventsCount===0?f._events=new n:delete f._events[h]}function u(){this._events=new n,this._eventsCount=0}u.prototype.eventNames=function(){var h=[],m,p;if(this._eventsCount===0)return h;for(p in m=this._events)t.call(m,p)&&h.push(r?p.slice(1):p);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(m)):h},u.prototype.listeners=function(h){var m=r?r+h:h,p=this._events[m];if(!p)return[];if(p.fn)return[p.fn];for(var v=0,b=p.length,S=new Array(b);v{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Gn(r))return e[r]}},GK={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},j3=ur({name:"options",initialState:GK,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),VK=j3.reducer,qK=j3.actions.createEventEmitter;function QK(e){return e.tooltip.syncInteraction}var YK={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},S3=ur({name:"chartData",initialState:YK,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var r=t.payload,n=r.startIndex,i=r.endIndex;n!=null&&(e.dataStartIndex=n),i!=null&&(e.dataEndIndex=i)}}}),py=S3.actions,bS=py.setChartData,ZK=py.setDataStartEndIndexes;py.setComputedData;var XK=S3.reducer,JK=["x","y"];function wS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function hs(e){for(var t=1;tf.rootProps.className);x.useEffect(()=>{if(e==null)return rl;var f=(h,m,p)=>{if(t!==p&&e===h){if(m.payload.active===!1){r(vc({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(n==="index"){var v;if(c&&m!==null&&m!==void 0&&(v=m.payload)!==null&&v!==void 0&&v.coordinate&&m.payload.sourceViewBox){var b=m.payload.coordinate,S=b.x,w=b.y,k=nG(b,JK),N=m.payload.sourceViewBox,E=N.x,A=N.y,C=N.width,_=N.height,O=hs(hs({},k),{},{x:c.x+(C?(S-E)/C:0)*c.width,y:c.y+(_?(w-A)/_:0)*c.height});r(hs(hs({},m),{},{payload:hs(hs({},m.payload),{},{coordinate:O})}))}else r(m);return}if(i!=null){var D;if(typeof n=="function"){var B={activeTooltipIndex:m.payload.index==null?void 0:Number(m.payload.index),isTooltipActive:m.payload.active,activeIndex:m.payload.index==null?void 0:Number(m.payload.index),activeLabel:m.payload.label,activeDataKey:m.payload.dataKey,activeCoordinate:m.payload.coordinate},z=n(i,B);D=i[z]}else n==="value"&&(D=i.find(le=>String(le.value)===m.payload.label));var $=m.payload.coordinate;if($==null||c==null){r(vc({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(D==null){r(vc({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:void 0}));return}var K=$.x,W=$.y,ve=Math.min(K,c.x+c.width),ue=Math.min(W,c.y+c.height),pe={x:o==="horizontal"?D.coordinate:ve,y:o==="horizontal"?ue:D.coordinate},oe=vc({active:m.payload.active,coordinate:pe,dataKey:m.payload.dataKey,index:String(D.index),label:m.payload.label,sourceViewBox:m.payload.sourceViewBox,graphicalItemId:m.payload.graphicalItemId});r(oe)}}};return Vc.on(px,f),()=>{Vc.off(px,f)}},[u,r,t,e,n,i,o,c])}function oG(){var e=Me(b0),t=Me(w0),r=At();x.useEffect(()=>{if(e==null)return rl;var n=(i,o,c)=>{t!==c&&e===i&&r(ZK(o))};return Vc.on(yS,n),()=>{Vc.off(yS,n)}},[r,t,e])}function sG(){var e=At();x.useEffect(()=>{e(qK())},[e]),aG(),oG()}function lG(e,t,r,n,i,o){var c=Me(S=>pK(S,e,t)),u=Me(ZH),f=Me(w0),h=Me(b0),m=Me(yC),p=Me(QK),v=(p==null?void 0:p.sourceViewBox)!=null,b=Bh();x.useEffect(()=>{if(!v&&h!=null&&f!=null){var S=vc({active:o,coordinate:r,dataKey:c,index:i,label:typeof n=="number"?String(n):n,sourceViewBox:b,graphicalItemId:u});Vc.emit(px,h,S,f)}},[v,r,c,u,i,n,f,h,m,o,b])}function kS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function jS(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{D(aH({shared:E,trigger:A,axisId:O,active:i,defaultIndex:B}))},[D,E,A,O,i,B]);var z=Bh(),$=XA(),K=JW(E),W=(t=Me(Oe=>xK(Oe,K,A,B)))!==null&&t!==void 0?t:{},ve=W.activeIndex,ue=W.isActive,pe=Me(Oe=>vK(Oe,K,A,B)),oe=Me(Oe=>b3(Oe,K,A,B)),le=Me(Oe=>gK(Oe,K,A,B)),Z=pe,ie=BK(),te=(r=i??ue)!==null&&r!==void 0?r:!1,I=x6([Z,te]),M=fG(I,2),U=M[0],ne=M[1],ee=K==="axis"?oe:void 0;lG(K,A,le,ee,ve,te);var X=_??ie;if(X==null||z==null||K==null)return null;var ae=Z??NS;te||(ae=NS),h&&ae.length&&(ae=B$(ae.filter(Oe=>Oe.value!=null&&(Oe.hide!==!0||n.includeHidden)),v,vG));var me=ae.length>0,re=jS(jS({},n),{},{payload:ae,label:ee,active:te,activeIndex:ve,coordinate:le,accessibilityLayer:$}),ye=x.createElement(PF,{allowEscapeViewBox:o,animationDuration:c,animationEasing:u,isAnimationActive:m,active:te,coordinate:le,hasPayload:me,offset:p,position:b,reverseDirection:S,useTranslate3d:w,viewBox:z,wrapperStyle:k,lastBoundingBox:U,innerRef:ne,hasPortalFromProps:!!_},xG(f,re));return x.createElement(x.Fragment,null,vh.createPortal(ye,X),te&&x.createElement(FK,{cursor:N,tooltipEventType:K,coordinate:le,payload:ae,index:ve}))}function wG(e,t,r){return(t=kG(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kG(e){var t=jG(e,"string");return typeof t=="symbol"?t:t+""}function jG(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class SG{constructor(t){wG(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function ES(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function NG(e){for(var t=1;t{try{var r=document.getElementById(CS);r||(r=document.createElement("span"),r.setAttribute("id",CS),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,OG,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},kc=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||du.isSsr)return{width:0,height:0};if(!N3.enableCache)return PS(t,r);var n=_G(t,r),i=AS.get(n);if(i)return i;var o=PS(t,r);return AS.set(n,o),o},E3;function ih(e,t){return DG(e)||TG(e,t)||IG(e,t)||MG()}function MG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IG(e,t){if(e){if(typeof e=="string")return OS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?OS(e,t):void 0}}function OS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.children,r=e.breakAll,n=e.style;try{var i=[];Xt(t)||(r?i=t.toString().split(""):i=t.toString().split(C3));var o=i.map(u=>({word:u,width:kc(u,n).width})),c=r?0:kc(" ",n).width;return{wordsWithComputedWidth:o,spaceWidth:c}}catch{return null}};function O3(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function tV(e){return Xt(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var _3=(e,t,r,n)=>e.reduce((i,o)=>{var c=o.word,u=o.width,f=i[i.length-1];if(f&&u!=null&&(t==null||n||f.width+u+re.reduce((t,r)=>t.width>r.width?t:r),rV="…",RS=(e,t,r,n,i,o,c,u)=>{var f=e.slice(0,t),h=P3({breakAll:r,style:n,children:f+rV});if(!h)return[!1,[]];var m=_3(h.wordsWithComputedWidth,o,c,u),p=m.length>i||M3(m).width>Number(o);return[p,m]},nV=(e,t,r,n,i)=>{var o=e.maxLines,c=e.children,u=e.style,f=e.breakAll,h=Ee(o),m=String(c),p=_3(t,n,r,i);if(!h||i)return p;var v=p.length>o||M3(p).width>Number(n);if(!v)return p;for(var b=0,S=m.length-1,w=0,k;b<=S&&w<=m.length-1;){var N=Math.floor((b+S)/2),E=N-1,A=RS(m,E,f,u,o,n,r,i),C=DS(A,2),_=C[0],O=C[1],D=RS(m,N,f,u,o,n,r,i),B=DS(D,1),z=B[0];if(!_&&!z&&(b=N+1),_&&z&&(S=N-1),!_&&z){k=O;break}w++}return k||p},$S=e=>{var t=Xt(e)?[]:e.toString().split(C3);return[{words:t,width:void 0}]},iV=e=>{var t=e.width,r=e.scaleToFit,n=e.children,i=e.style,o=e.breakAll,c=e.maxLines;if((t||r)&&!du.isSsr){var u,f,h=P3({breakAll:o,children:n,style:i});if(h){var m=h.wordsWithComputedWidth,p=h.spaceWidth;u=m,f=p}else return $S(n);return nV({breakAll:o,children:n,maxLines:c,style:i},u,f,t,!!r)}return $S(n)},I3="#808080",aV={angle:0,breakAll:!1,capHeight:"0.71em",fill:I3,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},gy=x.forwardRef((e,t)=>{var r=ln(e,aV),n=r.x,i=r.y,o=r.lineHeight,c=r.capHeight,u=r.fill,f=r.scaleToFit,h=r.textAnchor,m=r.verticalAnchor,p=TS(r,qG),v=x.useMemo(()=>iV({breakAll:p.breakAll,children:p.children,maxLines:p.maxLines,scaleToFit:f,style:p.style,width:p.width}),[p.breakAll,p.children,p.maxLines,f,p.style,p.width]),b=p.dx,S=p.dy,w=p.angle,k=p.className,N=p.breakAll,E=TS(p,QG);if(!Vn(n)||!Vn(i)||v.length===0)return null;var A=Number(n)+(Ee(b)?b:0),C=Number(i)+(Ee(S)?S:0);if(!He(A)||!He(C))return null;var _;switch(m){case"start":_=Gg("calc(".concat(c,")"));break;case"middle":_=Gg("calc(".concat((v.length-1)/2," * -").concat(o," + (").concat(c," / 2))"));break;default:_=Gg("calc(".concat(v.length-1," * -").concat(o,")"));break}var O=[],D=v[0];if(f&&D!=null){var B=D.width,z=p.width;O.push("scale(".concat(Ee(z)&&Ee(B)?z/B:1,")"))}return w&&O.push("rotate(".concat(w,", ").concat(A,", ").concat(C,")")),O.length&&(E.transform=O.join(" ")),x.createElement("text",gx({},an(E),{ref:t,x:A,y:C,className:nt("recharts-text",k),textAnchor:h,fill:u.includes("url")?I3:u}),v.map(($,K)=>{var W=$.words.join(N?"":" ");return x.createElement("tspan",{x:A,dy:K===0?_:o,key:"".concat(W,"-").concat(K)},W)}))});gy.displayName="Text";function zS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Rn(e){for(var t=1;t{var t=e.viewBox,r=e.position,n=e.offset,i=n===void 0?0:n,o=e.parentViewBox,c=u0(t),u=c.x,f=c.y,h=c.height,m=c.upperWidth,p=c.lowerWidth,v=u,b=u+(m-p)/2,S=(v+b)/2,w=(m+p)/2,k=v+m/2,N=h>=0?1:-1,E=N*i,A=N>0?"end":"start",C=N>0?"start":"end",_=m>=0?1:-1,O=_*i,D=_>0?"end":"start",B=_>0?"start":"end",z=o;if(r==="top"){var $={x:v+m/2,y:f-E,horizontalAnchor:"middle",verticalAnchor:A};return z&&($.height=Math.max(f-z.y,0),$.width=m),$}if(r==="bottom"){var K={x:b+p/2,y:f+h+E,horizontalAnchor:"middle",verticalAnchor:C};return z&&(K.height=Math.max(z.y+z.height-(f+h),0),K.width=p),K}if(r==="left"){var W={x:S-O,y:f+h/2,horizontalAnchor:D,verticalAnchor:"middle"};return z&&(W.width=Math.max(W.x-z.x,0),W.height=h),W}if(r==="right"){var ve={x:S+w+O,y:f+h/2,horizontalAnchor:B,verticalAnchor:"middle"};return z&&(ve.width=Math.max(z.x+z.width-ve.x,0),ve.height=h),ve}var ue=z?{width:w,height:h}:{};return r==="insideLeft"?Rn({x:S+O,y:f+h/2,horizontalAnchor:B,verticalAnchor:"middle"},ue):r==="insideRight"?Rn({x:S+w-O,y:f+h/2,horizontalAnchor:D,verticalAnchor:"middle"},ue):r==="insideTop"?Rn({x:v+m/2,y:f+E,horizontalAnchor:"middle",verticalAnchor:C},ue):r==="insideBottom"?Rn({x:b+p/2,y:f+h-E,horizontalAnchor:"middle",verticalAnchor:A},ue):r==="insideTopLeft"?Rn({x:v+O,y:f+E,horizontalAnchor:B,verticalAnchor:C},ue):r==="insideTopRight"?Rn({x:v+m-O,y:f+E,horizontalAnchor:D,verticalAnchor:C},ue):r==="insideBottomLeft"?Rn({x:b+O,y:f+h-E,horizontalAnchor:B,verticalAnchor:A},ue):r==="insideBottomRight"?Rn({x:b+p-O,y:f+h-E,horizontalAnchor:D,verticalAnchor:A},ue):r&&typeof r=="object"&&(Ee(r.x)||wo(r.x))&&(Ee(r.y)||wo(r.y))?Rn({x:u+Sa(r.x,w),y:f+Sa(r.y,h),horizontalAnchor:"end",verticalAnchor:"end"},ue):Rn({x:k,y:f+h/2,horizontalAnchor:"middle",verticalAnchor:"middle"},ue)},uV=["labelRef"],dV=["content"];function FS(e,t){if(e==null)return{};var r,n,i=fV(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var t=e.x,r=e.y,n=e.upperWidth,i=e.lowerWidth,o=e.width,c=e.height,u=e.children,f=x.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:i,width:o,height:c}),[t,r,n,i,o,c]);return x.createElement(T3.Provider,{value:f},u)},D3=()=>{var e=x.useContext(T3),t=Bh();return e||(t?u0(t):void 0)},vV=x.createContext(null),xV=()=>{var e=x.useContext(vV),t=Me(SC);return e||t},yV=e=>{var t=e.value,r=e.formatter,n=Xt(e.children)?t:e.children;return typeof r=="function"?r(n):n},vy=e=>e!=null&&typeof e=="function",bV=(e,t)=>{var r=en(t-e),n=Math.min(Math.abs(t-e),360);return r*n},wV=(e,t,r,n,i)=>{var o=e.offset,c=e.className,u=i.cx,f=i.cy,h=i.innerRadius,m=i.outerRadius,p=i.startAngle,v=i.endAngle,b=i.clockWise,S=(h+m)/2,w=bV(p,v),k=w>=0?1:-1,N,E;switch(t){case"insideStart":N=p+k*o,E=b;break;case"insideEnd":N=v-k*o,E=!b;break;case"end":N=v+k*o,E=b;break;default:throw new Error("Unsupported position ".concat(t))}E=w<=0?E:!E;var A=Zt(u,f,S,N),C=Zt(u,f,S,N+(E?1:-1)*359),_="M".concat(A.x,",").concat(A.y,` A`).concat(S,",").concat(S,",0,1,").concat(E?0:1,`, - `).concat(C.x,",").concat(C.y),O=Xt(e.id)?Mc("recharts-radial-line-"):e.id;return x.createElement("text",fi({},n,{dominantBaseline:"central",className:nt("recharts-radial-bar-label",c)}),x.createElement("defs",null,x.createElement("path",{id:O,d:_})),x.createElement("textPath",{xlinkHref:"#".concat(O)},r))},kV=(e,t,r)=>{var n=e.cx,i=e.cy,o=e.innerRadius,c=e.outerRadius,u=e.startAngle,f=e.endAngle,h=(u+f)/2;if(r==="outside"){var m=Zt(n,i,c+t,h),p=m.x,v=m.y;return{x:p,y:v,textAnchor:p>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"end"};var b=(o+c)/2,S=Zt(n,i,b,h),w=S.x,k=S.y;return{x:w,y:k,textAnchor:"middle",verticalAnchor:"middle"}},cf=e=>e!=null&&"cx"in e&&Ee(e.cx),jV={angle:0,offset:5,zIndex:pr.label,position:"middle",textBreakAll:!1};function SV(e){if(!cf(e))return e;var t=e.cx,r=e.cy,n=e.outerRadius,i=n*2;return{x:t-n,y:r-n,width:i,upperWidth:i,lowerWidth:i,height:i}}function oa(e){var t=ln(e,jV),r=t.viewBox,n=t.parentViewBox,i=t.position,o=t.value,c=t.children,u=t.content,f=t.className,h=f===void 0?"":f,m=t.textBreakAll,p=t.labelRef,v=xV(),b=T3(),S=i==="center"?b:v??b,w,k,N;r==null?w=S:cf(r)?w=r:w=c0(r);var E=SV(w);if(!w||Xt(o)&&Xt(c)&&!x.isValidElement(u)&&typeof u!="function")return null;var A=xc(xc({},t),{},{viewBox:w});if(x.isValidElement(u)){A.labelRef;var C=zS(A,uV);return x.cloneElement(u,C)}if(typeof u=="function"){A.content;var _=zS(A,dV);if(k=x.createElement(u,_),x.isValidElement(k))return k}else k=yV(t);var O=an(t);if(cf(w)){if(i==="insideStart"||i==="insideEnd"||i==="end")return wV(t,i,k,O,w);N=kV(w,t.offset,t.position)}else{if(!E)return null;var D=cV({viewBox:E,position:i,offset:t.offset,parentViewBox:cf(n)?void 0:n});N=xc(xc({x:D.x,y:D.y,textAnchor:D.horizontalAnchor,verticalAnchor:D.verticalAnchor},D.width!==void 0?{width:D.width}:{}),D.height!==void 0?{height:D.height}:{})}return x.createElement(Ii,{zIndex:t.zIndex},x.createElement(py,fi({ref:p,className:nt("recharts-label",h)},O,N,{textAnchor:P3(O.textAnchor)?O.textAnchor:N.textAnchor,breakAll:m}),k))}oa.displayName="Label";var NV=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?x.createElement(oa,fi({key:"label-implicit"},n)):Vn(e)?x.createElement(oa,fi({key:"label-implicit",value:e},n)):x.isValidElement(e)?e.type===oa?x.cloneElement(e,xc({key:"label-implicit"},n)):x.createElement(oa,fi({key:"label-implicit",content:e},n)):gy(e)?x.createElement(oa,fi({key:"label-implicit",content:e},n)):e&&typeof e=="object"?x.createElement(oa,fi({},e,{key:"label-implicit"},n)):null};function EV(e){var t=e.label,r=e.labelRef,n=T3();return NV(t,n,r)||null}var AV=["valueAccessor"],CV=["dataKey","clockWise","id","textBreakAll","zIndex"];function ah(){return ah=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(tV(t))return t},D3=x.createContext(void 0),_V=D3.Provider,R3=x.createContext(void 0);R3.Provider;function MV(){return x.useContext(D3)}function IV(){return x.useContext(R3)}function uf(e){var t=e.valueAccessor,r=t===void 0?OV:t,n=BS(e,AV),i=n.dataKey;n.clockWise;var o=n.id,c=n.textBreakAll,u=n.zIndex,f=BS(n,CV),h=MV(),m=IV(),p=h||m;return!p||!p.length?null:x.createElement(Ii,{zIndex:u??pr.label},x.createElement(on,{className:"recharts-label-list"},p.map((v,b)=>{var S,w=Xt(i)?r(v,b):Ft(v.payload,i),k=Xt(o)?{}:{id:"".concat(o,"-").concat(b)};return x.createElement(oa,ah({key:"label-".concat(b)},an(v),f,k,{fill:(S=n.fill)!==null&&S!==void 0?S:v.fill,parentViewBox:v.parentViewBox,value:w,textBreakAll:c,viewBox:v.viewBox,index:b,zIndex:0}))})))}uf.displayName="LabelList";function TV(e){var t=e.label;return t?t===!0?x.createElement(uf,{key:"labelList-implicit"}):x.isValidElement(t)||gy(t)?x.createElement(uf,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement(uf,ah({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function gx(){return gx=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=e.cx,r=e.cy,n=e.r,i=e.className,o=nt("recharts-dot",i);return Ee(t)&&Ee(r)&&Ee(n)?x.createElement("circle",gx({},Sn(e),Jx(e),{className:o,cx:t,cy:r,r:n})):null},DV={radiusAxis:{},angleAxis:{}},$3=ur({name:"polarAxis",initialState:DV,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),um=$3.actions;um.addRadiusAxis;um.removeRadiusAxis;um.addAngleAxis;um.removeAngleAxis;var RV=$3.reducer;function LV(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var z3=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function US(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function WS(e){for(var t=1;t{n||(i.current===null?r(rH(t)):i.current!==t&&r(nH({prev:i.current,next:t})),i.current=t)},[t,r,n]),x.useLayoutEffect(()=>()=>{i.current&&(r(iH(i.current)),i.current=null)},[r]),null}function VV(e){var t=e.legendPayload,r=At(),n=Or(),i=x.useRef(null);return x.useLayoutEffect(()=>{n||(i.current===null?r(O8(t)):i.current!==t&&r(_8({prev:i.current,next:t})),i.current=t)},[r,n,t]),x.useLayoutEffect(()=>()=>{i.current&&(r(M8(i.current)),i.current=null)},[r]),null}function qV(e,t){return XV(e)||ZV(e,t)||YV(e,t)||QV()}function QV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YV(e,t){if(e){if(typeof e=="string")return HS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?HS(e,t):void 0}}function HS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r2&&arguments[2]!==void 0?arguments[2]:[],n=[];for(var i of r)n.push({status:"removed",prev:i});for(var o=0;oe[Math.floor(o*r)]);return xy(n,t)}function tq(e,t){var r=t.map((n,i)=>e[i]);return xy(r,t)}function rq(e,t){for(var r=new Map,n=0;n{var b=r(p,v);if(b!=null){var S=n.get(b);if(S!==void 0)return i.add(b),S}}),c=[];for(var u of n){var f=qV(u,2),h=f[0],m=f[1];i.has(h)||c.push(m)}return xy(o,t,c)}function vx(e,t,r){return t==null?null:e==null?t.map(n=>({status:"added",next:n})):r===vy?eq(e,t):r===JV?tq(e,t):nq(e,t,r)}function B3(e,t){var r=x.useRef(e),n=x.useRef(t.current),i=x.useRef(!0);r.current!==e&&(r.current=e,n.current=t.current,i.current=!1);var o=x.useCallback(function(c,u){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(u===0){i.current=!0;return}u===1&&(n.current=c),u>0&&i.current&&f&&(t.current=c)},[t]);return{startValue:n.current,syncStepValue:o}}function iq(e,t){return lq(e)||sq(e,t)||oq(e,t)||aq()}function aq(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oq(e,t){if(e){if(typeof e=="string")return KS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?KS(e,t):void 0}}function KS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{typeof e=="function"&&e(),o(!0)},[e]),u=x.useCallback(()=>{typeof t=="function"&&t(),o(!1)},[t]);return{isAnimating:i,handleAnimationStart:c,handleAnimationEnd:u}}function uq(e){var t,r=e.animationInput,n=e.animationIdPrefix,i=e.items,o=e.previousItemsRef,c=e.isAnimationActive,u=e.animationBegin,f=e.animationDuration,h=e.animationEasing,m=e.onAnimationStart,p=e.onAnimationEnd,v=e.animationInterpolateFn,b=e.animationMatchBy,S=e.shouldUpdatePreviousRef,w=e.children,k=e.layout,N=rC(r,n),E=B3(N,o),A=(t=E.startValue)!==null&&t!==void 0?t:null,C=vx(A,i,b??vy);return x.createElement(tC,{animationId:N,begin:u,duration:f,isActive:c,easing:h,onAnimationEnd:p,onAnimationStart:m,key:N},_=>{var O=A==null,D=i==null?i:v(C,_,k),B=S?S(_):_>0;return E.syncStepValue(D,_,B),D==null?null:w(D,_,O)})}var Gg;function dq(e,t){return pq(e)||mq(e,t)||hq(e,t)||fq()}function fq(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hq(e,t){if(e){if(typeof e=="string")return GS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?GS(e,t):void 0}}function GS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var e=x.useState(()=>Mc("uid-")),t=dq(e,1),r=t[0];return r},U3=(Gg=hh.useId)!==null&&Gg!==void 0?Gg:gq;function vq(e,t){var r=U3();return t||(e?"".concat(e,"-").concat(r):r)}var xq=x.createContext(void 0),yq=e=>{var t=e.id,r=e.type,n=e.children,i=vq("recharts-".concat(r),t);return x.createElement(xq.Provider,{value:i},n(i))},bq={cartesianItems:[],polarItems:[]},W3=ur({name:"graphicalItems",initialState:bq,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:lt()},replaceCartesianGraphicalItem:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,o=tn(e).cartesianItems.indexOf(n);o>-1&&(e.cartesianItems[o]=i)},prepare:lt()},removeCartesianGraphicalItem:{reducer(e,t){var r=tn(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:lt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:lt()},removePolarGraphicalItem:{reducer(e,t){var r=tn(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:lt()},replacePolarGraphicalItem:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,o=tn(e).polarItems.indexOf(n);o>-1&&(e.polarItems[o]=i)},prepare:lt()}}}),fl=W3.actions,wq=fl.addCartesianGraphicalItem,kq=fl.replaceCartesianGraphicalItem,jq=fl.removeCartesianGraphicalItem;fl.addPolarGraphicalItem;fl.removePolarGraphicalItem;fl.replacePolarGraphicalItem;var Sq=W3.reducer,Nq=e=>{var t=At(),r=x.useRef(null);return x.useLayoutEffect(()=>{r.current===null?t(wq(e)):r.current!==e&&t(kq({prev:r.current,next:e})),r.current=e},[t,e]),x.useLayoutEffect(()=>()=>{r.current&&(t(jq(r.current)),r.current=null)},[t]),null},Eq=x.memo(Nq),Aq=["points"];function VS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Vg(e){for(var t=1;t{var N,E,A=Vg(Vg(Vg({r:3},c),v),{},{index:k,cx:(N=w.x)!==null&&N!==void 0?N:void 0,cy:(E=w.y)!==null&&E!==void 0?E:void 0,dataKey:o,value:w.value,payload:w.payload,points:t});return x.createElement(Iq,{key:"dot-".concat(k),option:r,dotProps:A,className:i})}),S={};return u&&f!=null&&(S.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(f,")")),x.createElement(Ii,{zIndex:m},x.createElement(on,oh({className:n},S),b))}function qS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function QS(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Qq=Q([qq,Ai,Ci],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),yy=()=>Me(Qq),Yq=()=>Me(rK);function YS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function qg(e){for(var t=1;t{var t=e.point,r=e.childIndex,n=e.mainColor,i=e.activeDot,o=e.dataKey,c=e.clipPath;if(i===!1||t.x==null||t.y==null)return null;var u={index:r,dataKey:o,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},f=qg(qg(qg({},u),jh(i)),Jx(i)),h;return x.isValidElement(i)?h=x.cloneElement(i,f):typeof i=="function"?h=i(f):h=x.createElement(L3,f),x.createElement(on,{className:"recharts-active-dot",clipPath:c},h)};function ZS(e){var t=e.points,r=e.mainColor,n=e.activeDot,i=e.itemDataKey,o=e.clipPath,c=e.zIndex,u=c===void 0?pr.activeDot:c,f=Me(Kc),h=Yq();if(t==null||h==null)return null;var m=t.find(p=>h.includes(p.payload));return Xt(m)?null:x.createElement(Ii,{zIndex:u},x.createElement(eQ,{point:m,childIndex:Number(f),mainColor:r,dataKey:i,activeDot:n,clipPath:o}))}var tQ=e=>{var t=e.chartData,r=At(),n=Or();return x.useEffect(()=>n?()=>{}:(r(yS(t)),()=>{r(yS(void 0))}),[t,r,n]),null},XS={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},G3=ur({name:"brush",initialState:XS,reducers:{setBrushSettings(e,t){return t.payload==null?XS:t.payload}}});G3.actions.setBrushSettings;var rQ=G3.reducer;function nQ(e){return(e%180+180)%180}var iQ=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=nQ(i),c=o*Math.PI/180,u=Math.atan(n/r),f=c>u&&c{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=tn(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=tn(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=tn(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),hl=V3.actions;hl.addDot;hl.removeDot;hl.addArea;hl.removeArea;hl.addLine;hl.removeLine;var oQ=V3.reducer;function sQ(e,t){return dQ(e)||uQ(e,t)||cQ(e,t)||lQ()}function lQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cQ(e,t){if(e){if(typeof e=="string")return JS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?JS(e,t):void 0}}function JS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.children,r=x.useState("".concat(Mc("recharts"),"-clip")),n=sQ(r,1),i=n[0],o=yy();if(o==null)return null;var c=o.x,u=o.y,f=o.width,h=o.height;return x.createElement(fQ.Provider,{value:i},x.createElement("defs",null,x.createElement("clipPath",{id:i},x.createElement("rect",{x:c,y:u,height:h,width:f}))),t)};function q3(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;ne*i)return!1;var o=r();return e*(t-e*o/2-n)>=0&&e*(t+e*o/2-i)<=0}function gQ(e,t){return q3(e,t+1)}function vQ(e,t,r,n,i){for(var o=(n||[]).slice(),c=t.start,u=t.end,f=0,h=1,m=c,p=function(){var S=n==null?void 0:n[f];if(S===void 0)return{v:q3(n,h)};var w=f,k,N=()=>(k===void 0&&(k=r(S,w)),k),E=S.coordinate,A=f===0||Vc(e,E,N,m,u);A||(f=0,m=c,h+=1),A&&(m=E+e*(N()/2+i),f+=h)},v;h<=o.length;)if(v=p(),v)return v.v;return[]}function xQ(e,t,r,n,i){var o=(n||[]).slice(),c=o.length;if(c===0)return[];for(var u=t.start,f=t.end,h=1;h<=c;h++){for(var m=(c-1)%h,p=u,v=!0,b=function(){var C=n[w];if(C==null)return 0;var _=w,O,D=()=>(O===void 0&&(O=r(C,_)),O),B=C.coordinate,z=w===m||Vc(e,B,D,p,f);if(!z)return v=!1,1;z&&(p=B+e*(D()/2+i))},S,w=m;w(w===void 0&&(w=r(b,v)),w);if(v===c-1){var N=e*(S.coordinate+e*k()/2-f);o[v]=S=sr(sr({},S),{},{tickCoord:N>0?S.coordinate-N*e:S.coordinate})}else o[v]=S=sr(sr({},S),{},{tickCoord:S.coordinate});if(S.tickCoord!=null){var E=Vc(e,S.tickCoord,k,u,f);E&&(f=S.tickCoord-e*(k()/2+i),o[v]=sr(sr({},S),{},{isShow:!0}))}},m=c-1;m>=0;m--)h(m);return o}function jQ(e,t,r,n,i,o){var c=(n||[]).slice(),u=c.length,f=t.start,h=t.end;if(o){var m=n[u-1];if(m!=null){var p=r(m,u-1),v=e*(m.coordinate+e*p/2-h);if(c[u-1]=m=sr(sr({},m),{},{tickCoord:v>0?m.coordinate-v*e:m.coordinate}),m.tickCoord!=null){var b=Vc(e,m.tickCoord,()=>p,f,h);b&&(h=m.tickCoord-e*(p/2+i),c[u-1]=sr(sr({},m),{},{isShow:!0}))}}}for(var S=o?u-1:u,w=function(E){var A=c[E];if(A==null)return 1;var C=A,_,O=()=>(_===void 0&&(_=r(A,E)),_);if(E===0){var D=e*(C.coordinate-e*O()/2-f);c[E]=C=sr(sr({},C),{},{tickCoord:D<0?C.coordinate-D*e:C.coordinate})}else c[E]=C=sr(sr({},C),{},{tickCoord:C.coordinate});if(C.tickCoord!=null){var B=Vc(e,C.tickCoord,O,f,h);B&&(f=C.tickCoord+e*(O()/2+i),c[E]=sr(sr({},C),{},{isShow:!0}))}},k=0;k{var D=typeof h=="function"?h(_.value,O):_.value;return S==="width"?mQ(wc(D,{fontSize:t,letterSpacing:r}),w,p):wc(D,{fontSize:t,letterSpacing:r})[S]},N=i[0],E=i[1],A=i.length>=2&&N!=null&&E!=null?en(E.coordinate-N.coordinate):1,C=pQ(o,A,S);return f==="equidistantPreserveStart"?vQ(A,C,k,i,c):f==="equidistantPreserveEnd"?xQ(A,C,k,i,c):(f==="preserveStart"||f==="preserveStartEnd"?b=jQ(A,C,k,i,c,f==="preserveStartEnd"):b=kQ(A,C,k,i,c),b.filter(_=>_.isShow))}var SQ=e=>{var t=e.ticks,r=e.label,n=e.labelGapWithTick,i=n,o=e.tickSize,c=o===void 0?0:o,u=e.tickMargin,f=u===void 0?0:u,h=0;if(t){Array.from(t).forEach(b=>{if(b){var S=b.getBoundingClientRect();S.width>h&&(h=S.width)}});var m=r?r.getBoundingClientRect().width:0,p=c+f,v=h+p+m+(r?i:0);return Math.round(v)}return 0},NQ={xAxis:{},yAxis:{}},Q3=ur({name:"renderedTicks",initialState:NQ,reducers:{setRenderedTicks:(e,t)=>{var r=t.payload,n=r.axisType,i=r.axisId,o=r.ticks;e[n][i]=o},removeRenderedTicks:(e,t)=>{var r=t.payload,n=r.axisType,i=r.axisId;delete e[n][i]}}}),Y3=Q3.actions,EQ=Y3.setRenderedTicks,AQ=Y3.removeRenderedTicks,CQ=Q3.reducer,PQ=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function tN(e,t){return IQ(e)||MQ(e,t)||_Q(e,t)||OQ()}function OQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _Q(e,t){if(e){if(typeof e=="string")return rN(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?rN(e,t):void 0}}function rN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(n==null||r==null)return rl;var o=t.map(c=>({value:c.value,coordinate:c.coordinate,offset:c.offset,index:c.index}));return i(EQ({ticks:o,axisId:n,axisType:r})),()=>{i(AQ({axisId:n,axisType:r}))}},[i,t,n,r]),null}var KQ=x.forwardRef((e,t)=>{var r=e.ticks,n=r===void 0?[]:r,i=e.tick,o=e.tickLine,c=e.stroke,u=e.tickFormatter,f=e.unit,h=e.padding,m=e.tickTextProps,p=e.orientation,v=e.mirror,b=e.x,S=e.y,w=e.width,k=e.height,N=e.tickSize,E=e.tickMargin,A=e.fontSize,C=e.letterSpacing,_=e.getTicksConfig,O=e.events,D=e.axisType,B=e.axisId,z=by(bt(bt({},_),{},{ticks:n}),A,C),$=Sn(_),K=jh(i),W=P3($.textAnchor)?$.textAnchor:BQ(p,v),ve=UQ(p,v),ue={};typeof o=="object"&&(ue=o);var pe=bt(bt({},$),{},{fill:"none"},ue),oe=z.map(ie=>bt({entry:ie},FQ(ie,b,S,w,k,p,N,v,E))),le=oe.map(ie=>{var te=ie.entry,I=ie.line;return x.createElement(on,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(te.value,"-").concat(te.coordinate,"-").concat(te.tickCoord)},o&&x.createElement("line",Ao({},pe,I,{className:nt("recharts-cartesian-axis-tick-line",Oo(o,"className"))})))}),Z=oe.map((ie,te)=>{var I,M,U=ie.entry,ne=ie.tick,ee=bt(bt(bt(bt({verticalAnchor:ve},$),{},{textAnchor:W,stroke:"none",fill:c},ne),{},{index:te,payload:U,visibleTicksCount:z.length,tickFormatter:u,padding:h},m),{},{angle:(I=(M=m==null?void 0:m.angle)!==null&&M!==void 0?M:$.angle)!==null&&I!==void 0?I:0}),X=bt(bt({},ee),K);return x.createElement(on,Ao({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(U.value,"-").concat(U.coordinate,"-").concat(U.tickCoord)},QL(O,U,te)),i&&x.createElement(WQ,{option:i,tickProps:X,value:"".concat(typeof u=="function"?u(U.value,te):U.value).concat(f||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(D,"-ticks")},x.createElement(HQ,{ticks:z,axisId:B,axisType:D}),Z.length>0&&x.createElement(Ii,{zIndex:pr.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(D,"-tick-labels"),ref:t},Z)),le.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(D,"-tick-lines")},le))}),GQ=x.forwardRef((e,t)=>{var r=e.axisLine,n=e.width,i=e.height,o=e.className,c=e.hide,u=e.ticks,f=e.axisType,h=e.axisId,m=TQ(e,PQ),p=x.useState(""),v=tN(p,2),b=v[0],S=v[1],w=x.useState(""),k=tN(w,2),N=k[0],E=k[1],A=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var _;return SQ({ticks:A.current,label:(_=e.labelRef)===null||_===void 0?void 0:_.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var C=x.useCallback(_=>{if(_){var O=_.getElementsByClassName("recharts-cartesian-axis-tick-value");A.current=O;var D=O[0];if(D){var B=window.getComputedStyle(D),z=B.fontSize,$=B.letterSpacing;(z!==b||$!==N)&&(S(z),E($))}}},[b,N]);return c||n!=null&&n<=0||i!=null&&i<=0?null:x.createElement(Ii,{zIndex:e.zIndex},x.createElement(on,{className:nt("recharts-cartesian-axis",o)},x.createElement(zQ,{x:e.x,y:e.y,width:n,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:Sn(e)}),x.createElement(KQ,{ref:C,axisType:f,events:m,fontSize:b,getTicksConfig:e,height:e.height,letterSpacing:N,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:u,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:h}),x.createElement(gV,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(EV,{label:e.label,labelRef:e.labelRef}),e.children)))}),wy=x.forwardRef((e,t)=>{var r=ln(e,yi);return x.createElement(GQ,Ao({},r,{ref:t}))});wy.displayName="CartesianAxis";var VQ=["x1","y1","x2","y2","key"],qQ=["offset"],QQ=["xAxisId","yAxisId"],YQ=["xAxisId","yAxisId"];function iN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function cr(e){for(var t=1;t{var t=e.fill;if(!t||t==="none")return null;var r=e.fillOpacity,n=e.x,i=e.y,o=e.width,c=e.height,u=e.ry;return x.createElement("rect",{x:n,y:i,ry:u,width:o,height:c,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function Z3(e){var t=e.option,r=e.lineItemProps,n;if(x.isValidElement(t))n=x.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var i,o=r.x1,c=r.y1,u=r.x2,f=r.y2,h=r.key,m=sh(r,VQ),p=(i=Sn(m))!==null&&i!==void 0?i:{};p.offset;var v=sh(p,qQ);n=x.createElement("line",ro({},v,{x1:o,y1:c,x2:u,y2:f,fill:"none",key:h}))}return n}function rY(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,o=e.horizontalPoints;if(!i||!o||!o.length)return null;e.xAxisId,e.yAxisId;var c=sh(e,QQ),u=o.map((f,h)=>{var m=cr(cr({},c),{},{x1:t,y1:f,x2:t+r,y2:f,key:"line-".concat(h),index:h});return x.createElement(Z3,{key:"line-".concat(h),option:i,lineItemProps:m})});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},u)}function nY(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,o=e.verticalPoints;if(!i||!o||!o.length)return null;e.xAxisId,e.yAxisId;var c=sh(e,YQ),u=o.map((f,h)=>{var m=cr(cr({},c),{},{x1:f,y1:t,x2:f,y2:t+r,key:"line-".concat(h),index:h});return x.createElement(Z3,{option:i,lineItemProps:m,key:"line-".concat(h)})});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},u)}function iY(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,o=e.width,c=e.height,u=e.horizontalPoints,f=e.horizontal,h=f===void 0?!0:f;if(!h||!t||!t.length||u==null)return null;var m=u.map(v=>Math.round(v+i-i)).sort((v,b)=>v-b);i!==m[0]&&m.unshift(0);var p=m.map((v,b)=>{var S=m[b+1],w=S==null,k=w?i+c-v:S-v;if(k<=0)return null;var N=b%t.length;return x.createElement("rect",{key:"react-".concat(b),y:v,x:n,height:k,width:o,stroke:"none",fill:t[N],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function aY(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,o=e.x,c=e.y,u=e.width,f=e.height,h=e.verticalPoints;if(!r||!n||!n.length)return null;var m=h.map(v=>Math.round(v+o-o)).sort((v,b)=>v-b);o!==m[0]&&m.unshift(0);var p=m.map((v,b)=>{var S=m[b+1],w=S==null,k=w?o+u-v:S-v;if(k<=0)return null;var N=b%n.length;return x.createElement("rect",{key:"react-".concat(b),x:v,y:c,width:k,height:f,stroke:"none",fill:n[N],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var oY=(e,t)=>{var r=e.xAxis,n=e.width,i=e.height,o=e.offset;return _A(by(cr(cr(cr({},yi),r),{},{ticks:MA(r),viewBox:{x:0,y:0,width:n,height:i}})),o.left,o.left+o.width,t)},sY=(e,t)=>{var r=e.yAxis,n=e.width,i=e.height,o=e.offset;return _A(by(cr(cr(cr({},yi),r),{},{ticks:MA(r),viewBox:{x:0,y:0,width:n,height:i}})),o.top,o.top+o.height,t)},lY={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:pr.grid};function X3(e){var t=FA(),r=BA(),n=zA(),i=cr(cr({},ln(e,lY)),{},{x:Ee(e.x)?e.x:n.left,y:Ee(e.y)?e.y:n.top,width:Ee(e.width)?e.width:n.width,height:Ee(e.height)?e.height:n.height}),o=i.xAxisId,c=i.yAxisId,u=i.x,f=i.y,h=i.width,m=i.height,p=i.syncWithTicks,v=i.horizontalValues,b=i.verticalValues,S=Or(),w=Me(z=>oS(z,"xAxis",o,S)),k=Me(z=>oS(z,"yAxis",c,S));if(!qn(h)||!qn(m)||!Ee(u)||!Ee(f))return null;var N=i.verticalCoordinatesGenerator||oY,E=i.horizontalCoordinatesGenerator||sY,A=i.horizontalPoints,C=i.verticalPoints;if((!A||!A.length)&&typeof E=="function"){var _=v&&v.length,O=E({yAxis:k?cr(cr({},k),{},{ticks:_?v:k.ticks}):void 0,width:t??h,height:r??m,offset:n},_?!0:p);If(Array.isArray(O),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof O,"]")),Array.isArray(O)&&(A=O)}if((!C||!C.length)&&typeof N=="function"){var D=b&&b.length,B=N({xAxis:w?cr(cr({},w),{},{ticks:D?b:w.ticks}):void 0,width:t??h,height:r??m,offset:n},D?!0:p);If(Array.isArray(B),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof B,"]")),Array.isArray(B)&&(C=B)}return x.createElement(Ii,{zIndex:i.zIndex},x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(tY,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),x.createElement(iY,ro({},i,{horizontalPoints:A})),x.createElement(aY,ro({},i,{verticalPoints:C})),x.createElement(rY,ro({},i,{offset:n,horizontalPoints:A,xAxis:w,yAxis:k})),x.createElement(nY,ro({},i,{offset:n,verticalPoints:C,xAxis:w,yAxis:k}))))}X3.displayName="CartesianGrid";var cY={},J3=ur({name:"errorBars",initialState:cY,reducers:{addErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,i=r.errorBar;e[n]||(e[n]=[]),e[n].push(i)},replaceErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,i=r.prev,o=r.next;e[n]&&(e[n]=e[n].map(c=>c.dataKey===i.dataKey&&c.direction===i.direction?o:c))},removeErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,i=r.errorBar;e[n]&&(e[n]=e[n].filter(o=>o.dataKey!==i.dataKey||o.direction!==i.direction))}}}),ky=J3.actions;ky.addErrorBar;ky.replaceErrorBar;ky.removeErrorBar;var uY=J3.reducer;function eO(e,t){var r,n,i=Me(h=>Oi(h,e)),o=Me(h=>_i(h,t)),c=(r=i==null?void 0:i.allowDataOverflow)!==null&&r!==void 0?r:Ot.allowDataOverflow,u=(n=o==null?void 0:o.allowDataOverflow)!==null&&n!==void 0?n:_t.allowDataOverflow,f=c||u;return{needClip:f,needClipX:c,needClipY:u}}function dY(e){var t=e.xAxisId,r=e.yAxisId,n=e.clipPathId,i=yy(),o=eO(t,r),c=o.needClipX,u=o.needClipY,f=o.needClip,h=Me(A=>$P(A,t,!1)),m=Me(A=>zP(A,r,!1));if(!f||!i)return null;var p=i.x,v=i.y,b=i.width,S=i.height,w=c&&h?Math.min(h[0],h[1]):p-b/2,k=u&&m?Math.min(m[0],m[1]):v-S/2,N=c&&h?Math.abs(h[1]-h[0]):b*2,E=u&&m?Math.abs(m[1]-m[0]):S*2;return x.createElement("clipPath",{id:"clipPath-".concat(n)},x.createElement("rect",{x:w,y:k,width:N,height:E}))}function fY(e){var t=jh(e),r=3,n=2;if(t!=null){var i=t.r,o=t.strokeWidth,c=Number(i),u=Number(o);return(Number.isNaN(c)||c<0)&&(c=r),(Number.isNaN(u)||u<0)&&(u=n),{r:c,strokeWidth:u}}return{r,strokeWidth:n}}function jy(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||n===void 0?void 0:n.xAxisId)!==null&&r!==void 0?r:H3}function Sy(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||n===void 0?void 0:n.yAxisId)!==null&&r!==void 0?r:H3}var tO=(e,t,r)=>VP(e,"xAxis",jy(e,t),r),rO=(e,t,r)=>GP(e,"xAxis",jy(e,t),r),nO=(e,t,r)=>VP(e,"yAxis",Sy(e,t),r),iO=(e,t,r)=>GP(e,"yAxis",Sy(e,t),r),hY=Q([ht,tO,nO,rO,iO],(e,t,r,n,i)=>Zn(e,"xAxis")?Mf(t,n,!1):Mf(r,i,!1)),mY=(e,t)=>t,aO=Q([fP,mY],(e,t)=>e.filter(r=>r.type==="area").find(r=>r.id===t)),oO=e=>{var t=ht(e),r=Zn(t,"xAxis");return r?"yAxis":"xAxis"},pY=(e,t)=>{var r=oO(e);return r==="yAxis"?Sy(e,t):jy(e,t)},gY=(e,t,r)=>kP(e,oO(e),pY(e,t),r),vY=Q([aO,gY],(e,t)=>{var r;if(!(e==null||t==null)){var n=e.stackId,i=S0(e);if(!(n==null||i==null)){var o=(r=t[n])===null||r===void 0?void 0:r.stackedData,c=o==null?void 0:o.find(u=>u.key===i);if(c!=null)return c.map(u=>[u[0],u[1]])}}}),xY=Q([ht,tO,nO,rO,iO,vY,U9,hY,aO,a7],(e,t,r,n,i,o,c,u,f,h)=>{var m=c.chartData,p=c.dataStartIndex,v=c.dataEndIndex;if(!(f==null||e!=="horizontal"&&e!=="vertical"||t==null||r==null||n==null||i==null||n.length===0||i.length===0||u==null)){var b=f.data,S;if(b&&b.length>0?S=b:S=m==null?void 0:m.slice(p,v+1),S!=null)return HY({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:i,dataStartIndex:p,areaSettings:f,stackedData:o,displayedData:S,chartBaseValue:h,bandSize:u})}}),yY=["animationElapsedTime","isAnimating","isEntrance","layout","isRange","stroke","connectNulls"],bY=["id","baseLine"];function kc(){return kc=Object.assign?Object.assign.bind():function(e){for(var t=1;tp.y||0));return Ee(i)?m=Math.max(i,m):i&&Array.isArray(i)&&i.length&&(m=Math.max(...i.map(p=>p.y||0),m)),Ee(m)?x.createElement("rect",{x:up.x||0));return Ee(i)?m=Math.max(i,m):i&&Array.isArray(i)&&i.length&&(m=Math.max(...i.map(p=>p.x||0),m)),Ee(m)?x.createElement("rect",{x:0,y:ue==null?[]:t===1?e.flatMap(r=>r.status==="removed"?[]:[r.next]):e.flatMap(r=>r.status==="matched"?[Ys(Ys({},r.next),{},{x:mi(r.prev.x,r.next.x,t),y:mi(r.prev.y,r.next.y,t)})]:r.status==="added"?[r.next]:[]),lO={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationMatchBy:vy,animationInterpolateFn:MY,connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,shape:NY,xAxisId:0,yAxisId:0,zIndex:pr.area};function ch(e,t){return e&&e!=="none"?e:t}var IY=e=>{var t=e.dataKey,r=e.name,n=e.stroke,i=e.fill,o=e.legendType,c=e.hide;return[{inactive:c,dataKey:t,type:o,color:ch(n,i),value:IA(r,t),payload:e}]},TY=x.memo(e=>{var t=e.dataKey,r=e.data,n=e.stroke,i=e.strokeWidth,o=e.fill,c=e.name,u=e.hide,f=e.unit,h=e.tooltipType,m=e.id,p={dataDefinedOnItem:r,getPosition:rl,settings:{stroke:n,strokeWidth:i,fill:o,dataKey:t,nameKey:void 0,name:IA(c,t),hide:u,type:h,color:ch(n,o),unit:f,graphicalItemId:m}};return x.createElement(GV,{tooltipEntrySettings:p})});function DY(e){var t=e.clipPathId,r=e.points,n=e.props,i=n.needClip,o=n.dot,c=n.dataKey,u=Sn(n);return x.createElement(Dq,{points:r,dot:o,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:c,baseProps:u,needClip:i,clipPathId:t})}function RY(e){var t=e.showLabels,r=e.children,n=e.points,i=n.map(o=>{var c,u,f={x:(c=o.x)!==null&&c!==void 0?c:0,y:(u=o.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Ys(Ys({},f),{},{value:o.value,payload:o.payload,parentViewBox:void 0,viewBox:f,fill:void 0})});return x.createElement(_V,{value:t?i:void 0},r)}function LY(e){var t=e.points,r=e.baseLine,n=e.needClip,i=e.clipPathId,o=e.props,c=e.animationElapsedTime,u=e.isAnimating,f=e.isEntrance,h=o.layout,m=o.type,p=o.stroke,v=o.connectNulls,b=o.isRange,S=o.shape,w=o.id,k=sO(o,EY),N=an(k),E=Ys(Ys({},N),{},{id:w,points:t,connectNulls:v,type:m,baseLine:r,layout:h,stroke:p,isRange:b,animationElapsedTime:c,isAnimating:u,isEntrance:f});return x.createElement(x.Fragment,null,(t==null?void 0:t.length)>1&&x.createElement(on,{clipPath:n?"url(#clipPath-".concat(i,")"):void 0},x.createElement(KV,{option:S,DefaultShape:lO.shape,shapeProps:E})),x.createElement(DY,{points:t,props:k,clipPathId:i}))}function $Y(e,t,r){if(Ee(e)){var n=Ee(t)?t:void 0;return mi(n,e,r)}if(Xt(e)||Gn(e)){var i=Ee(t)?t:void 0;return mi(i,0,r)}return e}function zY(e){var t=e.needClip,r=e.clipPathId,n=e.props,i=e.previousPointsRef,o=e.previousBaselineRef,c=n.points,u=n.baseLine,f=n.isAnimationActive,h=n.animationBegin,m=n.animationDuration,p=n.animationEasing,v=n.animationMatchBy,b=n.animationInterpolateFn,S=x.useMemo(()=>({points:c,baseLine:u}),[c,u]),w=B3(S,o),k=u0(),N=cq(n.onAnimationStart,n.onAnimationEnd),E=N.isAnimating,A=N.handleAnimationStart,C=N.handleAnimationEnd,_=w.startValue;if(k==null)return null;var O;return Array.isArray(u)&&Array.isArray(_)?O=vx(_,u,v):Array.isArray(u)?O=vx(null,u,v):O=null,x.createElement(uq,{animationInput:S,animationIdPrefix:"recharts-area-",items:c,previousItemsRef:i,isAnimationActive:f,animationBegin:h,animationDuration:m,animationEasing:p,onAnimationStart:A,onAnimationEnd:C,animationInterpolateFn:b,animationMatchBy:v,layout:k},(D,B,z)=>{var $;return B===1?$=u:Array.isArray(u)?$=b(O,B,k):$=z?u:$Y(u,_,B),w.syncStepValue($,B),x.createElement(RY,{showLabels:!E,points:c},n.children,x.createElement(LY,{points:D,baseLine:$,needClip:t,clipPathId:r,props:n,animationElapsedTime:B,isAnimating:E||B<1,isEntrance:z}),x.createElement(TV,{label:n.label}))})}function FY(e){var t=e.needClip,r=e.clipPathId,n=e.props,i=x.useRef(null),o=x.useRef();return x.createElement(zY,{needClip:t,clipPathId:r,props:n,previousPointsRef:i,previousBaselineRef:o})}class BY extends x.PureComponent{render(){var t=this.props,r=t.hide,n=t.dot,i=t.points,o=t.className,c=t.top,u=t.left,f=t.needClip,h=t.xAxisId,m=t.yAxisId,p=t.width,v=t.height,b=t.id,S=t.baseLine,w=t.zIndex;if(r)return null;var k=nt("recharts-area",o),N=b,E=fY(n),A=E.r,C=E.strokeWidth,_=z3(n),O=A*2+C,D=f?"url(#clipPath-".concat(_?"":"dots-").concat(N,")"):void 0;return x.createElement(Ii,{zIndex:w},x.createElement(on,{className:k},f&&x.createElement("defs",null,x.createElement(dY,{clipPathId:N,xAxisId:h,yAxisId:m}),!_&&x.createElement("clipPath",{id:"clipPath-dots-".concat(N)},x.createElement("rect",{x:u-O/2,y:c-O/2,width:p+O,height:v+O}))),x.createElement(FY,{needClip:f,clipPathId:N,props:this.props})),x.createElement(ZS,{points:i,mainColor:ch(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:D}),this.props.isRange&&Array.isArray(S)&&x.createElement(ZS,{points:S,mainColor:ch(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:D}))}}function UY(e){var t,r=e.activeDot,n=e.animationBegin,i=e.animationDuration,o=e.animationEasing,c=e.connectNulls,u=e.dot,f=e.fill,h=e.fillOpacity,m=e.hide,p=e.isAnimationActive,v=e.legendType,b=e.stroke,S=e.xAxisId,w=e.yAxisId,k=sO(e,AY),N=nl(),E=g3(),A=eO(S,w),C=A.needClip,_=Or(),O=(t=Me(pe=>xY(pe,e.id,_)))!==null&&t!==void 0?t:{},D=O.points,B=O.isRange,z=O.baseLine,$=yy();if(N!=="horizontal"&&N!=="vertical"||$==null||E!=="AreaChart"&&E!=="ComposedChart")return null;var K=$.height,W=$.width,ve=$.x,ue=$.y;return!D||!D.length?null:x.createElement(BY,lh({},k,{activeDot:r,animationBegin:n,animationDuration:i,animationEasing:o,baseLine:z,connectNulls:c,dot:u,fill:f,fillOpacity:h,height:K,hide:m,layout:N,isAnimationActive:p,isRange:B,legendType:v,needClip:C,points:D,stroke:b,width:W,left:ve,top:ue,xAxisId:S,yAxisId:w}))}var WY=(e,t,r,n,i)=>{var o=r??t;if(Ee(o))return o;var c=e==="horizontal"?i:n,u=c.scale.domain();if(c.type==="number"){var f=Math.max(u[0],u[1]),h=Math.min(u[0],u[1]);return o==="dataMin"?h:o==="dataMax"||f<0?f:Math.max(Math.min(u[0],u[1]),0)}return o==="dataMin"?u[0]:o==="dataMax"?u[1]:u[0]};function HY(e){var t=e.areaSettings,r=t.connectNulls,n=t.baseValue,i=t.dataKey,o=e.stackedData,c=e.layout,u=e.chartBaseValue,f=e.xAxis,h=e.yAxis,m=e.displayedData,p=e.dataStartIndex,v=e.xAxisTicks,b=e.yAxisTicks,S=e.bandSize,w=o&&o.length,k=WY(c,u,n,f,h),N=c==="horizontal",E=!1,A=m.map((_,O)=>{var D,B,z,$;if(w)$=o[p+O];else{var K=Ft(_,i);Array.isArray(K)?($=K,E=!0):$=[k,K]}var W=(D=(B=$)===null||B===void 0?void 0:B[1])!==null&&D!==void 0?D:null,ve=W==null||w&&!r&&Ft(_,i)==null;if(N){var ue;return{x:tj({axis:f,ticks:v,bandSize:S,entry:_,index:O}),y:ve?null:(ue=h.scale.map(W))!==null&&ue!==void 0?ue:null,value:$,payload:_}}return{x:ve?null:(z=f.scale.map(W))!==null&&z!==void 0?z:null,y:tj({axis:h,ticks:b,bandSize:S,entry:_,index:O}),value:$,payload:_}}),C;return w||E?C=A.map(_=>{var O,D=Array.isArray(_.value)?_.value[0]:null;if(N){var B;return{x:_.x,y:D!=null&&_.y!=null&&(B=h.scale.map(D))!==null&&B!==void 0?B:null,payload:_.payload}}return{x:D!=null&&(O=f.scale.map(D))!==null&&O!==void 0?O:null,y:_.y,payload:_.payload}}):C=N?h.scale.map(k):f.scale.map(k),{points:A,baseLine:C??0,isRange:E}}function KY(e){var t=ln(e,lO),r=Or();return x.createElement(yq,{id:t.id,type:"area"},n=>x.createElement(x.Fragment,null,x.createElement(VV,{legendPayload:IY(t)}),x.createElement(TY,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:n}),x.createElement(Eq,{type:"area",id:n,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:Cz(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:r,connectNulls:t.connectNulls}),x.createElement(UY,lh({},t,{id:n}))))}var cO=x.memo(KY,Kh);cO.displayName="Area";var GY=["domain","range"],VY=["domain","range"];function sN(e,t){if(e==null)return{};var r,n,i=qY(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{if(c!=null)return uN(uN({},o),{},{type:c})},[o,c]);return x.useLayoutEffect(()=>{u!=null&&(r.current===null?t(Fq(u)):r.current!==u&&t(Bq({prev:r.current,next:u})),r.current=u)},[u,t]),x.useLayoutEffect(()=>()=>{r.current&&(t(Uq(r.current)),r.current=null)},[t]),null}var nZ=e=>{var t=e.xAxisId,r=e.className,n=Me(DA),i=Or(),o="xAxis",c=Me(v=>KP(v,o,t,i)),u=Me(v=>LW(v,t)),f=Me(v=>WW(v,t)),h=Me(v=>lP(v,t));if(u==null||f==null||h==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var m=yx(e,YY);h.id,h.scale;var p=yx(h,ZY);return x.createElement(wy,xx({},m,p,{x:f.x,y:f.y,width:u.width,height:u.height,className:nt("recharts-".concat(o," ").concat(o),r),viewBox:n,ticks:c,axisType:o,axisId:t}))},iZ={allowDataOverflow:Ot.allowDataOverflow,allowDecimals:Ot.allowDecimals,allowDuplicatedCategory:Ot.allowDuplicatedCategory,angle:Ot.angle,axisLine:yi.axisLine,height:Ot.height,hide:!1,includeHidden:Ot.includeHidden,interval:Ot.interval,label:!1,minTickGap:Ot.minTickGap,mirror:Ot.mirror,orientation:Ot.orientation,padding:Ot.padding,reversed:Ot.reversed,scale:Ot.scale,tick:Ot.tick,tickCount:Ot.tickCount,tickLine:yi.tickLine,tickSize:yi.tickSize,type:Ot.type,niceTicks:Ot.niceTicks,xAxisId:0},aZ=e=>{var t=ln(e,iZ);return x.createElement(x.Fragment,null,x.createElement(rZ,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),x.createElement(nZ,t))},dO=x.memo(aZ,uO);dO.displayName="XAxis";var oZ=["type"],sZ=["dangerouslySetInnerHTML","ticks","scale"],lZ=["id","scale"];function bx(){return bx=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(c!=null)return fN(fN({},o),{},{type:c})},[c,o]);return x.useLayoutEffect(()=>{u!=null&&(r.current===null?t(Wq(u)):r.current!==u&&t(Hq({prev:r.current,next:u})),r.current=u)},[u,t]),x.useLayoutEffect(()=>()=>{r.current&&(t(Kq(r.current)),r.current=null)},[t]),null}function mZ(e){var t=e.yAxisId,r=e.className,n=e.width,i=e.label,o=x.useRef(null),c=x.useRef(null),u=Me(DA),f=Or(),h=At(),m="yAxis",p=Me(N=>GW(N,t)),v=Me(N=>KW(N,t)),b=Me(N=>KP(N,m,t,f)),S=Me(N=>cP(N,t));if(x.useLayoutEffect(()=>{if(!(n!=="auto"||!p||gy(i)||x.isValidElement(i)||S==null)){var N=o.current;if(N){var E=N.getCalculatedWidth();Math.round(p.width)!==Math.round(E)&&h(Gq({id:t,width:E}))}}},[b,p,h,i,t,n,S]),p==null||v==null||S==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var w=wx(e,sZ);S.id,S.scale;var k=wx(S,lZ);return x.createElement(wy,bx({},w,k,{ref:o,labelRef:c,x:v.x,y:v.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:p.width,height:p.height,className:nt("recharts-".concat(m," ").concat(m),r),viewBox:u,ticks:b,axisType:m,axisId:t}))}var pZ={allowDataOverflow:_t.allowDataOverflow,allowDecimals:_t.allowDecimals,allowDuplicatedCategory:_t.allowDuplicatedCategory,angle:_t.angle,axisLine:yi.axisLine,hide:!1,includeHidden:_t.includeHidden,interval:_t.interval,label:!1,minTickGap:_t.minTickGap,mirror:_t.mirror,orientation:_t.orientation,padding:_t.padding,reversed:_t.reversed,scale:_t.scale,tick:_t.tick,tickCount:_t.tickCount,tickLine:yi.tickLine,tickSize:yi.tickSize,type:_t.type,niceTicks:_t.niceTicks,width:_t.width,yAxisId:0},gZ=e=>{var t=ln(e,pZ);return x.createElement(x.Fragment,null,x.createElement(hZ,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),x.createElement(mZ,t))},fO=x.memo(gZ,uO);fO.displayName="YAxis";var vZ=(e,t)=>t,Ny=Q([vZ,ht,jC,Wt,u3,Mi,mK,er],wK);function xZ(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function Ey(e){var t=e.currentTarget.getBoundingClientRect(),r,n;if(xZ(e)){var i=e.currentTarget.getBBox();r=i.width>0?t.width/i.width:1,n=i.height>0?t.height/i.height:1}else{var o=e.currentTarget;r=o.offsetWidth>0?t.width/o.offsetWidth:1,n=o.offsetHeight>0?t.height/o.offsetHeight:1}var c=(u,f)=>({relativeX:Math.round((u-t.left)/r),relativeY:Math.round((f-t.top)/n)});return"touches"in e?Array.from(e.touches).map(u=>c(u.clientX,u.clientY)):c(e.clientX,e.clientY)}var hO=Br("mouseClick"),mO=au();mO.startListening({actionCreator:hO,effect:(e,t)=>{var r=e.payload,n=Ny(t.getState(),Ey(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(sH({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var kx=Br("mouseMove"),pO=au(),ms=null,Ha=null,Qg=null;pO.startListening({actionCreator:kx,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=n.eventSettings,o=i.throttleDelay,c=i.throttledEvents,u=c==="all"||(c==null?void 0:c.includes("mousemove"));ms!==null&&(cancelAnimationFrame(ms),ms=null),Ha!==null&&(typeof o!="number"||!u)&&(clearTimeout(Ha),Ha=null),Qg=Ey(r);var f=()=>{var h=t.getState(),m=xu(h,h.tooltip.settings.shared);if(!Qg){ms=null,Ha=null;return}if(m==="axis"){var p=Ny(h,Qg);(p==null?void 0:p.activeIndex)!=null?t.dispatch(e3({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(JP())}ms=null,Ha=null};if(!u){f();return}o==="raf"?ms=requestAnimationFrame(f):typeof o=="number"&&Ha===null&&(Ha=setTimeout(f,o))}});function yZ(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<>":t}var hN={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},gO=ur({name:"rootProps",initialState:hN,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:hN.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),bZ=gO.reducer,wZ=gO.actions.updateOptions,kZ=null,jZ={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},vO=ur({name:"polarOptions",initialState:kZ,reducers:jZ});vO.actions.updatePolarOptions;var SZ=vO.reducer,xO=Br("keyDown"),yO=Br("focus"),bO=Br("blur"),dm=au(),ps=null,Ka=null,Jd=null;dm.startListening({actionCreator:xO,effect:(e,t)=>{Jd=e.payload,ps!==null&&(cancelAnimationFrame(ps),ps=null);var r=t.getState(),n=r.eventSettings,i=n.throttleDelay,o=n.throttledEvents,c=o==="all"||o.includes("keydown");Ka!==null&&(typeof i!="number"||!c)&&(clearTimeout(Ka),Ka=null);var u=()=>{try{var f=t.getState(),h=f.rootProps.accessibilityLayer!==!1;if(!h)return;var m=f.tooltip.keyboardInteraction,p=Jd;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var v=bc(m,Eo(f),qs(f),Qs(f)),b=v==null?-1:Number(v),S=!Number.isFinite(b)||b<0,w=Mi(f),k=Eo(f),N=xu(f,f.tooltip.settings.shared);if(p==="Enter"){if(S)return;var E=nh(f,N,"hover",String(m.index));t.dispatch(rh({active:!m.active,activeIndex:m.index,activeCoordinate:E}));return}var A=ZW(f),C=A==="left-to-right"?1:-1,_=p==="ArrowRight"?1:-1,O;if(S){var D=qs(f),B=Qs(f),z=_*C,$=pe=>({active:!1,index:String(pe),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(O=-1,z>0){for(var K=0;K=0;W--)if(bc($(W),k,D,B)!=null){O=W;break}if(O<0)return}else{O=b+_*C;var ve=(w==null?void 0:w.length)||k.length;if(ve===0||O>=ve||O<0)return}var ue=nh(f,N,"hover",String(O));t.dispatch(rh({active:!0,activeIndex:O.toString(),activeCoordinate:ue}))}finally{ps=null,Ka=null}};if(!c){u();return}i==="raf"?ps=requestAnimationFrame(u):typeof i=="number"&&Ka===null&&(u(),Jd=null,Ka=setTimeout(()=>{Jd?u():(Ka=null,ps=null)},i))}});dm.startListening({actionCreator:yO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var i=r.tooltip.keyboardInteraction;if(!i.active&&i.index==null){var o="0",c=xu(r,r.tooltip.settings.shared),u=nh(r,c,"hover",String(o));t.dispatch(rh({active:!0,activeIndex:o,activeCoordinate:u}))}}}});dm.startListening({actionCreator:bO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var i=r.tooltip.keyboardInteraction;i.active&&t.dispatch(rh({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function wO(e){e.persist();var t=e.currentTarget;return new Proxy(e,{get:(r,n)=>{if(n==="currentTarget")return t;var i=Reflect.get(r,n);return typeof i=="function"?i.bind(r):i}})}var Zr=Br("externalEvent"),kO=au(),ef=new Map,fc=new Map,Yg=new Map;kO.startListening({actionCreator:Zr,effect:(e,t)=>{var r=e.payload,n=r.handler,i=r.reactEvent;if(n!=null){var o=i.type,c=wO(i);Yg.set(o,{handler:n,reactEvent:c});var u=ef.get(o);u!==void 0&&(cancelAnimationFrame(u),ef.delete(o));var f=t.getState(),h=f.eventSettings,m=h.throttleDelay,p=h.throttledEvents,v=p,b=v==="all"||(v==null?void 0:v.includes(o)),S=fc.get(o);S!==void 0&&(typeof m!="number"||!b)&&(clearTimeout(S),fc.delete(o));var w=()=>{var E=Yg.get(o);try{if(!E)return;var A=E.handler,C=E.reactEvent,_=t.getState(),O={activeCoordinate:JH(_),activeDataKey:YH(_),activeIndex:Kc(_),activeLabel:h3(_),activeTooltipIndex:Kc(_),isTooltipActive:eK(_)};A&&A(O,C)}finally{ef.delete(o),fc.delete(o),Yg.delete(o)}};if(!b){w();return}if(m==="raf"){var k=requestAnimationFrame(w);ef.set(o,k)}else if(typeof m=="number"){if(!fc.has(o)){w();var N=setTimeout(w,m);fc.set(o,N)}}else w()}}});var NZ=Q([dl],e=>e.tooltipItemPayloads),EZ=Q([NZ,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var n=e.find(o=>o.settings.graphicalItemId===r);if(n!=null){var i=n.getPosition;if(i!=null)return i(t)}}}),jO=Br("touchMove"),SO=au(),Ga=null,ra=null,mN=null,hc=null;SO.startListening({actionCreator:jO,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){hc=wO(r);var n=t.getState(),i=n.eventSettings,o=i.throttleDelay,c=i.throttledEvents,u=c==="all"||c.includes("touchmove");Ga!==null&&(cancelAnimationFrame(Ga),Ga=null),ra!==null&&(typeof o!="number"||!u)&&(clearTimeout(ra),ra=null),mN=Array.from(r.touches).map(h=>Ey({clientX:h.clientX,clientY:h.clientY,currentTarget:r.currentTarget}));var f=()=>{if(hc!=null){var h=t.getState(),m=xu(h,h.tooltip.settings.shared);if(m==="axis"){var p,v=(p=mN)===null||p===void 0?void 0:p[0];if(v==null){Ga=null,ra=null;return}var b=Ny(h,v);(b==null?void 0:b.activeIndex)!=null&&t.dispatch(e3({activeIndex:b.activeIndex,activeDataKey:void 0,activeCoordinate:b.activeCoordinate}))}else if(m==="item"){var S,w=hc.touches[0];if(document.elementFromPoint==null||w==null)return;var k=document.elementFromPoint(w.clientX,w.clientY);if(!k||!k.getAttribute)return;var N=k.getAttribute(Dz),E=(S=k.getAttribute(Rz))!==null&&S!==void 0?S:void 0,A=Io(h).find(O=>O.id===E);if(N==null||A==null||E==null)return;var C=A.dataKey,_=EZ(h,N,E);t.dispatch(oH({activeDataKey:C,activeIndex:N,activeCoordinate:_,activeGraphicalItemId:E}))}Ga=null,ra=null}};if(!u){f();return}o==="raf"?Ga=requestAnimationFrame(f):typeof o=="number"&&ra===null&&(f(),hc=null,ra=setTimeout(()=>{hc?f():(ra=null,Ga=null)},o))}}});var NO={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},EO=ur({name:"eventSettings",initialState:NO,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),AZ=EO.actions.setEventSettings,CZ=EO.reducer,PZ=rA({brush:rQ,cartesianAxis:Vq,chartData:XK,errorBars:uY,eventSettings:CZ,graphicalItems:Sq,layout:yz,legend:I8,options:VK,polarAxis:RV,polarOptions:SZ,referenceElements:oQ,renderedTicks:CQ,rootProps:bZ,tooltip:lH,zIndex:TK}),OZ=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return H6({reducer:PZ,preloadedState:t,middleware:n=>{var i;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([mO.middleware,pO.middleware,dm.middleware,kO.middleware,SO.middleware])},enhancers:n=>{var i=n;return typeof n=="function"&&(i=n()),i.concat(vA({type:"raf"}))},devTools:{serialize:{replacer:yZ},name:"recharts-".concat(r)}})};function _Z(e){var t=e.preloadedState,r=e.children,n=e.reduxStoreName,i=Or(),o=x.useRef(null);if(i)return r;o.current==null&&(o.current=OZ(t,n));var c=t0;return x.createElement(Q8,{context:c,store:o.current},r)}function MZ(e){var t=e.layout,r=e.margin,n=At(),i=Or();return x.useEffect(()=>{i||(n(gz(t)),n(pz(r)))},[n,i,t,r]),null}var IZ=x.memo(MZ,Kh);function TZ(e){var t=At();return x.useEffect(()=>{t(wZ(e))},[t,e]),null}var DZ=e=>{var t=At();return x.useEffect(()=>{t(AZ(e))},[t,e]),null},RZ=x.memo(DZ,Kh);function pN(e){var t=e.zIndex,r=e.isPanorama,n=x.useRef(null),i=At();return x.useLayoutEffect(()=>(n.current&&i(MK({zIndex:t,element:n.current,isPanorama:r})),()=>{i(IK({zIndex:t,isPanorama:r}))}),[i,t,r]),x.createElement("g",{tabIndex:-1,ref:n,className:"recharts-zIndex-layer_".concat(t)})}function gN(e){var t=e.children,r=e.isPanorama,n=Me(jK);if(!n||n.length===0)return t;var i=n.filter(c=>c<0),o=n.filter(c=>c>0);return x.createElement(x.Fragment,null,i.map(c=>x.createElement(pN,{key:c,zIndex:c,isPanorama:r})),t,o.map(c=>x.createElement(pN,{key:c,zIndex:c,isPanorama:r})))}var LZ=["children"];function $Z(e,t){if(e==null)return{};var r,n,i=zZ(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var r=FA(),n=BA(),i=ZA();if(!qn(r)||!qn(n))return null;var o=e.children,c=e.otherAttributes,u=e.title,f=e.desc,h,m;return c!=null&&(typeof c.tabIndex=="number"?h=c.tabIndex:h=i?0:void 0,typeof c.role=="string"?m=c.role:m=i?"application":void 0),x.createElement(bE,uh({},c,{title:u,desc:f,role:m,tabIndex:h,width:r,height:n,style:FZ,ref:t}),o)}),UZ=e=>{var t=e.children,r=Me(Fh);if(!r)return null;var n=r.width,i=r.height,o=r.y,c=r.x;return x.createElement(bE,{width:n,height:i,x:c,y:o},t)},vN=x.forwardRef((e,t)=>{var r=e.children,n=$Z(e,LZ),i=Or();return i?x.createElement(UZ,null,x.createElement(gN,{isPanorama:!0},r)):x.createElement(BZ,uh({ref:t},n),x.createElement(gN,{isPanorama:!1},r))});function WZ(e,t){return VZ(e)||GZ(e,t)||KZ(e,t)||HZ()}function HZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KZ(e,t){if(e){if(typeof e=="string")return xN(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xN(e,t):void 0}}function xN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(n!=null){var c=n.getBoundingClientRect(),u=c.width/n.offsetWidth;He(u)&&u!==o&&e(xz(u))}},[n,e,o]),i}function yN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function QZ(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r(sG(),null);function fh(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var iX=x.forwardRef((e,t)=>{var r,n,i=x.useRef(null),o=x.useState({containerWidth:fh((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:fh((n=e.style)===null||n===void 0?void 0:n.height)}),c=dh(o,2),u=c[0],f=c[1],h=x.useCallback((p,v)=>{f(b=>{var S=Math.round(p),w=Math.round(v);return b.containerWidth===S&&b.containerHeight===w?b:{containerWidth:S,containerHeight:w}})},[]),m=x.useCallback(p=>{if(typeof t=="function"&&t(p),i.current!=null&&(i.current.disconnect(),i.current=null),p!=null&&typeof ResizeObserver<"u"){var v=p.getBoundingClientRect(),b=v.width,S=v.height;h(b,S);var w=N=>{var E=N[0];if(E!=null){var A=E.contentRect,C=A.width,_=A.height;h(C,_)}},k=new ResizeObserver(w);k.observe(p),i.current=k}},[t,h]);return x.useEffect(()=>()=>{var p=i.current;p!=null&&p.disconnect()},[h]),x.createElement(x.Fragment,null,x.createElement(su,{width:u.containerWidth,height:u.containerHeight}),x.createElement("div",wa({ref:m},e)))}),aX=x.forwardRef((e,t)=>{var r=e.width,n=e.height,i=x.useState({containerWidth:fh(r),containerHeight:fh(n)}),o=dh(i,2),c=o[0],u=o[1],f=x.useCallback((m,p)=>{u(v=>{var b=Math.round(m),S=Math.round(p);return v.containerWidth===b&&v.containerHeight===S?v:{containerWidth:b,containerHeight:S}})},[]),h=x.useCallback(m=>{if(typeof t=="function"&&t(m),m!=null){var p=m.getBoundingClientRect(),v=p.width,b=p.height;f(v,b)}},[t,f]);return x.createElement(x.Fragment,null,x.createElement(su,{width:c.containerWidth,height:c.containerHeight}),x.createElement("div",wa({ref:h},e)))}),oX=x.forwardRef((e,t)=>{var r=e.width,n=e.height;return x.createElement(x.Fragment,null,x.createElement(su,{width:r,height:n}),x.createElement("div",wa({ref:t},e)))}),sX=x.forwardRef((e,t)=>{var r=e.width,n=e.height;return typeof r=="string"||typeof n=="string"?x.createElement(aX,wa({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?x.createElement(oX,wa({},e,{width:r,height:n,ref:t})):x.createElement(x.Fragment,null,x.createElement(su,{width:r,height:n}),x.createElement("div",wa({ref:t},e)))});function lX(e){return e?iX:sX}var cX=x.forwardRef((e,t)=>{var r=e.children,n=e.className,i=e.height,o=e.onClick,c=e.onContextMenu,u=e.onDoubleClick,f=e.onMouseDown,h=e.onMouseEnter,m=e.onMouseLeave,p=e.onMouseMove,v=e.onMouseUp,b=e.onTouchEnd,S=e.onTouchMove,w=e.onTouchStart,k=e.style,N=e.width,E=e.responsive,A=e.dispatchTouchEvents,C=A===void 0?!0:A,_=x.useRef(null),O=At(),D=x.useState(null),B=dh(D,2),z=B[0],$=B[1],K=x.useState(null),W=dh(K,2),ve=W[0],ue=W[1],pe=qZ(),oe=l0(),le=(oe==null?void 0:oe.width)>0?oe.width:N,Z=(oe==null?void 0:oe.height)>0?oe.height:i,ie=x.useCallback(_e=>{pe(_e),typeof t=="function"&&t(_e),$(_e),ue(_e),_e!=null&&(_.current=_e)},[pe,t,$,ue]),te=x.useCallback(_e=>{O(hO(_e)),O(Zr({handler:o,reactEvent:_e}))},[O,o]),I=x.useCallback(_e=>{O(kx(_e)),O(Zr({handler:h,reactEvent:_e}))},[O,h]),M=x.useCallback(_e=>{O(JP()),O(Zr({handler:m,reactEvent:_e}))},[O,m]),U=x.useCallback(_e=>{O(kx(_e)),O(Zr({handler:p,reactEvent:_e}))},[O,p]),ne=x.useCallback(()=>{O(yO())},[O]),ee=x.useCallback(()=>{O(bO())},[O]),X=x.useCallback(_e=>{O(xO(_e.key))},[O]),ae=x.useCallback(_e=>{O(Zr({handler:c,reactEvent:_e}))},[O,c]),me=x.useCallback(_e=>{O(Zr({handler:u,reactEvent:_e}))},[O,u]),re=x.useCallback(_e=>{O(Zr({handler:f,reactEvent:_e}))},[O,f]),ye=x.useCallback(_e=>{O(Zr({handler:v,reactEvent:_e}))},[O,v]),Oe=x.useCallback(_e=>{O(Zr({handler:w,reactEvent:_e}))},[O,w]),fe=x.useCallback(_e=>{C&&O(jO(_e)),O(Zr({handler:S,reactEvent:_e}))},[O,C,S]),Xe=x.useCallback(_e=>{O(Zr({handler:b,reactEvent:_e}))},[O,b]),Ue=lX(E);return x.createElement(w3.Provider,{value:z},x.createElement(jL.Provider,{value:ve},x.createElement(Ue,{width:le??(k==null?void 0:k.width),height:Z??(k==null?void 0:k.height),className:nt("recharts-wrapper",n),style:QZ({position:"relative",cursor:"default",width:le,height:Z},k),onClick:te,onContextMenu:ae,onDoubleClick:me,onFocus:ne,onBlur:ee,onKeyDown:X,onMouseDown:re,onMouseEnter:I,onMouseLeave:M,onMouseMove:U,onMouseUp:ye,onTouchEnd:Xe,onTouchMove:fe,onTouchStart:Oe,ref:ie},x.createElement(nX,null),r)))}),uX=["width","height","responsive","children","className","style","compact","title","desc"];function dX(e,t){if(e==null)return{};var r,n,i=fX(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var r=e.width,n=e.height,i=e.responsive,o=e.children,c=e.className,u=e.style,f=e.compact,h=e.title,m=e.desc,p=dX(e,uX),v=Sn(p);return f?x.createElement(x.Fragment,null,x.createElement(su,{width:r,height:n}),x.createElement(vN,{otherAttributes:v,title:h,desc:m},o)):x.createElement(cX,{className:c,style:u,width:r,height:n,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},x.createElement(vN,{otherAttributes:v,title:h,desc:m,ref:t},x.createElement(hQ,null,o)))});function jx(){return jx=Object.assign?Object.assign.bind():function(e){for(var t=1;tx.createElement(bX,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:wX,tooltipPayloadSearcher:KK,categoricalChartProps:e,ref:t}));const jX="rgba(130,130,150,0.14)",kN="rgba(130,130,150,0.85)";function SX(e){if(e<=0)return 10;const t=Math.pow(10,Math.floor(Math.log10(e))),r=e/t;return(r<=1?1:r<=2?2:r<=5?5:10)*t}function AO(e,t){return`${t==="%"?Math.round(e):e>=1e3?`${(e/1e3).toFixed(1)}k`:Math.round(e).toString()}${t}`}function NX({active:e,payload:t,unit:r}){return!e||!(t!=null&&t.length)?null:l.jsx("div",{className:"rounded-lg border border-border/70 bg-popover/95 px-3 py-2 shadow-xl backdrop-blur",children:l.jsx("div",{className:"space-y-1",children:t.map(n=>l.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono",children:[l.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:n.color}}),l.jsx("span",{className:"uppercase tracking-wider text-muted-foreground",children:n.name}),l.jsx("span",{className:"ml-auto pl-3 font-bold tabular-nums text-foreground",children:AO(n.value,r)})]},n.dataKey))})})}function CO({data:e,series:t,unit:r="%",yMode:n="percent",height:i=176}){const o=e.reduce((u,f)=>t.reduce((h,m)=>Math.max(h,Number(f[m.key])||0),u),0),c=n==="percent"?Math.min(100,Math.max(25,Math.ceil(o*1.2/25)*25)):Math.max(SX(o*1.15),10);return l.jsx("div",{style:{height:i},className:"w-full",children:l.jsx(p8,{width:"100%",height:"100%",children:l.jsxs(kX,{data:e,margin:{top:8,right:6,bottom:0,left:-12},children:[l.jsx("defs",{children:t.map(u=>l.jsxs("linearGradient",{id:`grad-${u.key}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[l.jsx("stop",{offset:"0%",stopColor:u.color,stopOpacity:.22}),l.jsx("stop",{offset:"100%",stopColor:u.color,stopOpacity:0})]},u.key))}),l.jsx(X3,{vertical:!1,stroke:jX}),l.jsx(dO,{dataKey:"t",hide:!0}),l.jsx(fO,{domain:[0,c],ticks:[0,c/2,c],tickFormatter:u=>AO(u,r),width:42,axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:kN}}),l.jsx(bG,{content:l.jsx(NX,{unit:r}),cursor:{stroke:kN,strokeOpacity:.4,strokeDasharray:"3 3"}}),t.map(u=>l.jsx(cO,{type:"monotone",dataKey:u.key,name:u.label,stroke:u.color,strokeWidth:2,fill:`url(#grad-${u.key})`,dot:!1,activeDot:{r:3,strokeWidth:0},isAnimationActive:!1,connectNulls:!0},u.key))]})})})}const EX=[{key:"cpu",label:"CPU",color:"#2dd4bf"},{key:"ram",label:"RAM",color:"#38bdf8"},{key:"gpu",label:"GPU",color:"#a78bfa"},{key:"disk",label:"Disk",color:"#fbbf24"}];function PO(){var c,u,f,h;const{sys:e,hist:t}=fL(),r=!!(e!=null&&e.gpu&&e.gpu.busy_percent!=null&&e.gpu.gtt_used!=null&&e.gpu.gtt_total!=null),n=EX.filter(m=>m.key!=="gpu"||r),i={cpu:(c=e==null?void 0:e.cpu)==null?void 0:c.percent,ram:(u=e==null?void 0:e.ram)==null?void 0:u.percent,gpu:r?e.gpu.busy_percent:null,disk:(f=e==null?void 0:e.disk)==null?void 0:f.percent},o={cpu:(h=e==null?void 0:e.cpu)!=null&&h.cores?`${e.cpu.cores} Cores`:"",ram:e?`${Jr(e.ram.used)}/${Jr(e.ram.total)} GB`:"",gpu:r?`${Jr(e.gpu.gtt_used)}/${Jr(e.gpu.gtt_total)} GB`:"",disk:e!=null&&e.disk?`${Jr(e.disk.used)}/${Jr(e.disk.total)} GB`:""};return l.jsxs("div",{className:"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:"mb-3 flex items-center gap-2",children:[l.jsx(wi,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"System-Status"}),l.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]})]}),e?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mb-2 grid grid-cols-2 gap-x-4 gap-y-1.5",children:n.map(m=>l.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[l.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full",style:{background:m.color}}),l.jsx("span",{className:"shrink-0 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:m.label}),l.jsxs("span",{className:"shrink-0 font-mono text-xs font-bold tabular-nums text-foreground",children:[Math.round(i[m.key]??0),"%"]}),o[m.key]&&l.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground/60",children:o[m.key]})]},m.key))}),l.jsx(CO,{data:t,series:n,unit:"%",yMode:"percent",height:176})]}):l.jsx("div",{className:"flex h-44 items-center justify-center text-xs text-muted-foreground",children:"Lade Systemdaten…"})]}),(e==null?void 0:e.temp)&&(e.temp.cpu||e.temp.gpu)&&l.jsxs("div",{className:"mt-3 flex gap-4 border-t border-border/30 pt-3 font-mono text-xs text-muted-foreground/80",children:[e.temp.cpu!=null&&l.jsxs("span",{children:["CPU Temp: ",e.temp.cpu," °C"]}),e.temp.gpu!=null&&l.jsxs("span",{children:["GPU Temp: ",e.temp.gpu," °C"]})]})]})}const jN=[{key:"prompt",label:"Prompt",color:"#f59e0b"},{key:"completion",label:"Antwort",color:"#2dd4bf"}];function OO(){const{data:e}=oE(3e3),t=sL(),r=t[t.length-1],n=r?Math.round(r.prompt+r.completion):0;return l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[l.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(mh,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"Token-Durchsatz"}),l.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]})]}),e&&l.jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[l.jsx("span",{className:"font-space text-3xl font-bold tracking-tight text-foreground tabular-nums",children:n.toLocaleString("de-DE")}),l.jsx("span",{className:"text-xs text-muted-foreground",children:"tok/s aktuell"})]}),e&&l.jsxs("div",{className:"mt-0.5 space-y-0.5 font-mono text-[11px] text-muted-foreground/70",children:[l.jsxs("div",{children:[e.total_tokens.toLocaleString("de-DE")," Tokens gesamt · ",l.jsxs("span",{className:"text-emerald-400/90",children:[e.saved_eur.toLocaleString("de-DE",{minimumFractionDigits:2})," € gespart"]})]}),l.jsxs("div",{className:"text-muted-foreground/55",children:["Input ",e.prompt_tokens.toLocaleString("de-DE")," · Output ",e.completion_tokens.toLocaleString("de-DE")]})]})]}),l.jsx("div",{className:"flex shrink-0 flex-col items-end gap-1.5 pt-1",children:jN.map(i=>l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:i.color}}),l.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:i.label}),l.jsx("span",{className:"font-mono text-xs font-bold tabular-nums text-foreground",children:Math.round((r==null?void 0:r[i.key])??0)})]},i.key))})]}),e?l.jsx(CO,{data:t,series:jN,unit:" tok/s",yMode:"auto",height:150}):l.jsx("div",{className:"flex h-[150px] items-center justify-center text-xs text-muted-foreground",children:"Lade Durchsatz…"}),l.jsx("div",{className:"mt-2 border-t border-border/30 pt-2 text-[10px] text-muted-foreground/70",children:"Durchsatz aus dem Gateway abgeleitet (Prefill vs. Generierung). Flach bei Leerlauf."})]})}function AX(){const{data:e}=kh(3e4),{data:t}=Ei(),r=((e==null?void 0:e.os)||0)+((e==null?void 0:e.engine)||0)+((e==null?void 0:e.swap)||0)+((e==null?void 0:e.models)||0),n=()=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:"maintenance"}})),i=(t==null?void 0:t.models)??[],o=(t==null?void 0:t.running)??[],c=i.find(m=>m.role==="hermes"),u=i.find(m=>m.role==="coder-lite")||i.find(m=>m.role==="coder"),f=m=>m?o.includes(m):!1,h=m=>{var p;return((p=m==null?void 0:m.split("/").pop())==null?void 0:p.replace(/\.gguf$/i,""))||"—"};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:"Basisstation"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Geht's der Box gut, gibt's Updates, was läuft gerade."})]}),l.jsx(uL,{frame:"box"}),l.jsxs("button",{onClick:n,className:J("w-full flex items-center gap-3 rounded-2xl border p-4 text-left transition-all cursor-pointer",r>0?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10":"border-border/60 bg-card/45 hover:border-primary/40"),children:[r>0?l.jsx(DM,{className:"h-6 w-6 shrink-0 text-amber-400"}):l.jsx(Mt,{className:"h-6 w-6 shrink-0 text-emerald-400"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:J("text-sm font-semibold",r>0?"text-amber-400":"text-foreground"),children:r>0?`${r} Update${r===1?"":"s"} verfügbar`:"Alles aktuell"}),l.jsx("div",{className:"text-xs text-muted-foreground",children:r>0?"Antippen, um zu sehen, was genau aktualisiert wird.":"Keine ausstehenden Updates."})]}),r>0&&l.jsxs("span",{className:"shrink-0 flex items-center gap-1 text-xs font-semibold text-amber-400",children:["Ansehen ",l.jsx(bi,{className:"h-4 w-4"})]})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground mb-2",children:"Was gerade läuft"}),l.jsx("div",{className:"rounded-2xl border border-border/60 overflow-hidden",children:[{icon:wi,label:"Lucys Hirn",model:c==null?void 0:c.name,warm:f(c==null?void 0:c.name)},{icon:zs,label:"Coder (Vibe-Coding)",model:u==null?void 0:u.name,warm:f(u==null?void 0:u.name)}].map(m=>l.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border/40 last:border-0",children:[l.jsx("span",{className:J("h-2 w-2 shrink-0 rounded-full",m.warm?"bg-emerald-500 animate-pulse":"bg-muted-foreground/40")}),l.jsx(m.icon,{className:"h-4 w-4 text-muted-foreground shrink-0"}),l.jsx("span",{className:"text-sm text-foreground w-40 shrink-0",children:m.label}),l.jsx("span",{className:"text-xs text-muted-foreground flex-1 truncate font-mono",children:h(m.model)}),l.jsx("span",{className:J("text-xs shrink-0",m.warm?"text-emerald-400":"text-muted-foreground"),children:m.model?m.warm?"warm":"bereit":"nicht gesetzt"})]},m.label))})]}),l.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[l.jsx(PO,{}),l.jsx(OO,{})]})]})}const CX=e=>!!dt(e).protected;function PX({role:e,roleRec:t,models:r,onAssign:n,onClose:i}){var f,h;const o=t&&t.role===e?t:null,c={};o==null||o.models.forEach(m=>{c[m.name]=m});const u=o?o.models.map(m=>r.find(p=>p.name===m.name)).filter(Boolean):r;return l.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4 overscroll-contain",role:"dialog","aria-modal":"true","aria-label":`${dt(e).label} konfigurieren`,children:l.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[l.jsx(po,{role:e})," festlegen"]}),l.jsx("button",{onClick:i,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:l.jsx(nn,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Wähle ein Modell für ",l.jsx("strong",{className:"text-foreground",children:dt(e).label}),l.jsx("span",{className:"block text-[10px] text-muted-foreground/70 mt-0.5",children:dt(e).desc})]}),(o==null?void 0:o.recommended)&&l.jsxs("button",{onClick:()=>n(o.recommended),title:(f=c[o.recommended])==null?void 0:f.reason,className:"shrink-0 h-7 px-3 text-[11px] font-semibold text-primary border border-primary/50 bg-primary/10 hover:bg-primary/20 rounded-lg cursor-pointer flex items-center gap-1",children:[l.jsx(ka,{className:"h-3 w-3"})," Auto: ",(h=o.recommended.split("/").pop())==null?void 0:h.replace(/\.gguf$/i,"")]})]}),l.jsxs("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:[CX(e)?l.jsx("div",{className:"w-full px-3 py-2 rounded-lg text-[11px] text-muted-foreground border border-border/30 bg-background/20 flex items-center gap-1.5",children:"🔒 Diese Rolle ist lebenswichtig und kann nicht leer bleiben — wähle stattdessen ein anderes Modell."}):l.jsx("button",{onClick:()=>n(""),className:"w-full text-left px-3 py-2 rounded-lg text-xs hover:bg-accent text-red-400 font-semibold cursor-pointer border border-red-500/20 bg-red-500/5 flex items-center justify-between",children:l.jsx("span",{children:"Zuweisung entfernen"})}),u.map(m=>{var w;const p=c[m.name],v=m.role===e,b=!!(p!=null&&p.recommended),S=!!p&&!p.suitable;return l.jsxs("button",{onClick:()=>n(m.name),className:J("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border",b?"border-primary/50 bg-primary/10":v?"text-primary font-bold bg-primary/5 border-primary/30":S?"border-border/20 bg-background/10 opacity-60":"text-foreground bg-background/20 border-border/30"),children:[l.jsxs("div",{className:"flex flex-col text-left min-w-0",children:[l.jsxs("span",{className:"truncate max-w-[260px] font-semibold flex items-center gap-1.5",children:[(w=m.name.split("/").pop())==null?void 0:w.replace(/\.gguf$/i,""),b&&l.jsx("span",{className:"text-[8px] font-bold uppercase tracking-wide text-primary bg-primary/15 px-1.5 py-0.5 rounded",children:"Empfohlen"})]}),l.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:p?`${p.params_b}B · ${m.quant} · ${p.reason}`:`${lr(m.size_bytes)} · ${m.quant}`})]}),v&&l.jsx(Mt,{className:"h-4 w-4 shrink-0 text-primary"})]},m.name)})]})]})})}const OX=["fast","heavy","heavy_chars"],_X=["coder_lite","coder","coding_escalate_chars"];function MX(){const e=Wr(),{data:t,isLoading:r}=gR(),[n,i]=x.useState(null),[o,c]=x.useState(!1),[u,f]=x.useState(""),[h,m]=x.useState(0);if(x.useEffect(()=>{t!=null&&t.policy&&!n&&i({...t.policy})},[t,n]),r||!t||!n)return l.jsx("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 text-xs text-muted-foreground",children:"Lade Routing-Policy…"});const p=N=>t.fields.find(E=>E.key===N),v=Object.keys(n).some(N=>n[N]!==t.policy[N]),b=(N,E)=>{i(A=>A&&{...A,[N]:E}),f("")},S=N=>b(N,t.defaults[N]);async function w(){if(!n)return;const N={};for(const E of Object.keys(n))n[E]!==t.policy[E]&&(N[E]=n[E]);if(Object.keys(N).length!==0){c(!0),f("");try{const{policy:E}=await uR(N);i({...E}),e.invalidateQueries({queryKey:$e.routingPolicy}),e.invalidateQueries({queryKey:$e.routing}),m(Date.now()),setTimeout(()=>m(0),2e3)}catch(E){f(E.message||String(E))}finally{c(!1)}}}function k({k:N}){const E=p(N),A=n[N],C=n[N]===t.defaults[N];return l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("label",{className:"text-[10px] font-semibold text-muted-foreground",children:E.label}),!C&&l.jsxs("button",{onClick:()=>S(N),className:"flex items-center gap-0.5 text-[9px] text-muted-foreground/60 hover:text-foreground transition-colors cursor-pointer",title:`Auf Default zurücksetzen (${String(t.defaults[N])||"leer"})`,children:[l.jsx(Rx,{className:"h-2.5 w-2.5"})," Default"]})]}),E.type==="bool"?l.jsxs("button",{onClick:()=>b(N,!A),className:J("flex h-8 w-full items-center justify-between rounded-lg border px-3 text-[11px] font-semibold transition-all cursor-pointer",A?"border-emerald-500/40 bg-emerald-500/10 text-emerald-300":"border-border/40 bg-background/40 text-muted-foreground"),children:[l.jsx("span",{children:A?"An":"Aus"}),l.jsx("span",{className:J("h-3.5 w-3.5 rounded-full transition-colors",A?"bg-emerald-400":"bg-muted-foreground/40")})]}):E.type==="int"?l.jsx("input",{type:"number",value:A,min:E.min,max:E.max,"aria-label":E.label,onChange:_=>b(N,Number(_.target.value)),className:"h-8 w-full rounded-lg border border-border/40 bg-background/40 px-3 font-mono text-[11px] text-foreground outline-none focus:border-primary/50"}):l.jsx("input",{type:"text",value:A,"aria-label":E.label,spellCheck:!1,placeholder:N==="coder_lite"?"(leer = aus)":"",onChange:_=>b(N,_.target.value),className:"h-8 w-full rounded-lg border border-border/40 bg-background/40 px-3 font-mono text-[11px] text-foreground outline-none focus:border-primary/50"})]})}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 gap-3 flex-wrap",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(xI,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Lane-Routing & Policy"}),l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded bg-emerald-500/10 text-emerald-300 border border-emerald-500/20",children:"hot-reload"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[u&&l.jsx("span",{className:"text-[10px] text-red-400 max-w-[280px] truncate",title:u,children:u}),h>0&&l.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-emerald-400",children:[l.jsx(Mt,{className:"h-3.5 w-3.5"})," gespeichert"]}),l.jsxs("button",{onClick:w,disabled:!v||o,className:J("h-8 px-4 rounded-lg text-[10px] font-bold uppercase tracking-wide transition-all flex items-center gap-1.5",v&&!o?"bg-primary text-primary-foreground hover:opacity-90 cursor-pointer shadow-md shadow-primary/10":"bg-background/40 text-muted-foreground/50 border border-border/40 cursor-not-allowed"),children:[o?l.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):null,"Speichern"]})]})]}),l.jsxs("p",{className:"text-[10px] text-muted-foreground/70 leading-relaxed -mt-1",children:["Welches echte Modell hinter den virtuellen Lanes ",l.jsx("code",{className:"text-cyan-300",children:"chat"})," und"," ",l.jsx("code",{className:"text-cyan-300",children:"coding"})," steckt. Änderungen greifen sofort (kein Neustart). Die Keyword-Heuristiken bleiben im Code."]}),l.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[l.jsxs("div",{className:"rounded-xl border border-border/40 bg-background/25 p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 border-b border-border/30 pb-2",children:[l.jsx(iI,{className:"h-4 w-4 text-teal-400"}),l.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider text-foreground",children:"chat"}),l.jsx("span",{className:"text-[9px] text-muted-foreground/60 font-mono",children:"(= auto)"})]}),OX.map(N=>l.jsx(k,{k:N},N))]}),l.jsxs("div",{className:"rounded-xl border border-border/40 bg-background/25 p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 border-b border-border/30 pb-2",children:[l.jsx(zM,{className:"h-4 w-4 text-indigo-400"}),l.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider text-foreground",children:"coding"}),l.jsx("span",{className:"text-[9px] text-muted-foreground/60 font-mono",children:"(agentisch → immer Coder)"})]}),_X.map(N=>l.jsx(k,{k:N},N))]})]}),l.jsx("div",{className:"rounded-xl border border-border/40 bg-background/25 p-4",children:l.jsx("div",{className:"max-w-xs",children:l.jsx(k,{k:"fast_no_think"})})})]})}function IX(){var ve,ue,pe;const e=Wr(),{data:t}=Ei(4e3),{data:r}=Kx(),{data:n}=Po(),{data:i}=sE(),{showAlert:o,dialogElement:c}=An(),[u,f]=x.useState(!1),[h,m]=x.useState(!1),p=(t==null?void 0:t.models)??[],v=(t==null?void 0:t.running)??[],b=(ve=r==null?void 0:r.groups)==null?void 0:ve.brains,S=(b==null?void 0:b.members)??[],w=oe=>p.find(le=>le.name===oe),k=oe=>{var le;return((le=oe.split("/").pop())==null?void 0:le.replace(/\.gguf$/i,""))||oe},N=S.map(w).filter(Boolean),E=1024**3,A=i==null?void 0:i.budget,C=N.reduce((oe,le)=>oe+(le.size_bytes||0),0)/E,_=((ue=n==null?void 0:n.gpu)==null?void 0:ue.gtt_total)||((pe=n==null?void 0:n.gpu)==null?void 0:pe.vram_total)||0,O=(A==null?void 0:A.gtt_gb)||(_?_/E:0),D=(A==null?void 0:A.warm_projected_gb)??C,B=O>0?Math.min(100,D/O*100):0,z=p.filter(oe=>!S.includes(oe.name)&&!oe.incomplete);async function $(oe){m(!0);try{await rE("brains",oe,(b==null?void 0:b.swap)??!1,(b==null?void 0:b.persist)??!0),e.invalidateQueries({queryKey:$e.groups}),e.invalidateQueries({queryKey:$e.models}),e.invalidateQueries({queryKey:$e.hermesBrain})}catch(le){o("Fehler",`Immer-bereit-Set konnte nicht geändert werden: ${(le==null?void 0:le.message)||le}`)}finally{m(!1)}}function K(oe){const le=w(oe);if(le&&dt(le.role).protected){o("Geschützt",`„${dt(le.role).label}" ist lebenswichtig und bleibt immer bereit.`);return}$(S.filter(Z=>Z!==oe))}function W(oe){f(!1),$([...S,oe])}return b?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(SN,{}),l.jsxs("div",{className:"space-y-1.5",children:[N.length===0&&l.jsx("div",{className:"text-xs text-muted-foreground",children:"Noch keine Modelle im Set."}),N.map(oe=>{const le=v.includes(oe.name),Z=dt(oe.role).protected;return l.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-xl border border-border/30 bg-background/20 p-2.5",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[l.jsx("span",{className:J("h-2 w-2 shrink-0 rounded-full ring-2 ring-black/40",le?"bg-emerald-500 animate-pulse":"bg-muted-foreground/40"),title:le?"Gerade warm (bereit)":"Reserviert — lädt bei Bedarf sofort"}),oe.role&&l.jsx(po,{role:oe.role,dense:!0,className:"shrink-0"}),l.jsx("span",{className:"truncate font-mono text-xs font-semibold text-foreground",title:oe.name,children:k(oe.name)}),l.jsx("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:lr(oe.size_bytes)})]}),Z?l.jsx("span",{className:"shrink-0 text-[10px] font-semibold text-muted-foreground",title:"Lebenswichtig — bleibt immer im Set.",children:"🔒"}):l.jsx("button",{onClick:()=>K(oe.name),disabled:h,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border border-border/40 text-muted-foreground transition-colors hover:bg-red-500/5 hover:text-red-400 cursor-pointer disabled:opacity-50",title:"Aus dem Immer-bereit-Set nehmen (lädt dann nur noch bei Bedarf)",children:l.jsx(nn,{className:"h-3.5 w-3.5"})})]},oe.name)})]}),l.jsxs("button",{onClick:()=>f(!0),disabled:h||z.length===0,className:"flex h-8 w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-border/50 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground transition-colors hover:border-primary/40 hover:text-primary cursor-pointer disabled:opacity-50",children:[l.jsx(Cc,{className:"h-3.5 w-3.5"})," Modell dauerhaft bereithalten"]}),l.jsxs("div",{className:"rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsxs("div",{className:"mb-1.5 flex items-center justify-between text-[11px]",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-semibold uppercase tracking-wider text-muted-foreground",title:"Modellgewichte + KV-Cache, berechnet aus den echten Architektur-Daten jedes Modells (Layer × KV-Köpfe × Kontext) und seiner KV-Quantisierung. So viel legt llama.cpp beim Laden wirklich für den eingestellten Kontext an — kein Aufschlag mehr.",children:[l.jsx(xa,{className:"h-3.5 w-3.5"})," Reserviert fürs Set"]}),l.jsxs("span",{className:"font-mono font-bold text-foreground",children:[D.toFixed(1),O>0?` / ${O.toFixed(0)}`:""," GB"]})]}),l.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full border border-border/30 bg-background/50",children:l.jsx("div",{className:J("h-full rounded-full transition-all duration-500",B>=85?"bg-red-500":B>=65?"bg-amber-500":"bg-teal-500"),style:{width:`${B}%`}})}),A&&!A.fits&&l.jsxs("p",{className:"mt-2 flex items-start gap-1.5 text-[11px] text-amber-400",children:[l.jsx(vr,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),l.jsxs("span",{children:["Zusammen mit dem größten Gelegenheits-Modell (~",A.largest_ondemand_gb," GB) wird der Speicher knapp. Das Set bleibt dabei immer geladen — wird es wirklich eng, schlägt das Laden des großen Modells fehl (es wartet dann, statt das Set zu verdrängen)."]})]}),A&&A.fits&&l.jsxs("p",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-emerald-400",children:[l.jsx(Mt,{className:"h-3.5 w-3.5 shrink-0"})," Passt auch neben dem größten Gelegenheits-Modell — nichts wird verdrängt."]})]}),u&&l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",role:"dialog","aria-modal":"true","aria-label":"Modell zum Immer-bereit-Set hinzufügen",children:l.jsxs("div",{className:"w-full max-w-md space-y-3 rounded-2xl border border-border/80 bg-card p-6 shadow-2xl animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:"Dauerhaft bereithalten"}),l.jsx("button",{onClick:()=>f(!1),className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground cursor-pointer",children:l.jsx(nn,{className:"h-4 w-4"})})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Wähle ein Modell, das ohne Ladezeit bereitstehen soll:"}),l.jsx("div",{className:"max-h-60 space-y-1.5 overflow-y-auto pr-1",children:z.map(oe=>l.jsxs("button",{onClick:()=>W(oe.name),className:"flex w-full items-center justify-between gap-2 rounded-lg border border-border/30 bg-background/20 px-3 py-2.5 text-left transition-colors hover:bg-accent cursor-pointer",children:[l.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[oe.role&&l.jsx(po,{role:oe.role,dense:!0,className:"shrink-0"}),l.jsx("span",{className:"truncate font-mono text-xs font-semibold text-foreground",children:k(oe.name)})]}),l.jsx("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:lr(oe.size_bytes)})]},oe.name))})]})}),c]}):l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10",children:[l.jsx(SN,{}),l.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:"Es gibt noch kein Immer-bereit-Set. Es entsteht automatisch, sobald Lucys Hirn zugewiesen ist."}),c]})}function SN(){return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ka,{className:"h-4.5 w-4.5 text-primary"}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-bold uppercase tracking-wide text-foreground",children:"Immer-bereit-Set"}),l.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Diese Modelle hält Lucy immer bereit — sie antworten ohne Ladezeit."})]})]})}function TX(){var Ue,_e,wt,tr;const e=Wr(),{data:t,isLoading:r,error:n}=Ei(4e3),{data:i}=kh(4e3),{data:o}=sE(),{data:c}=Po(),{data:u}=Kx(),{showAlert:f,showConfirm:h,showPrompt:m,dialogElement:p}=An(),v=Ux(),b=G=>!!dt(G).protected,S=(t==null?void 0:t.models)??[],w=(t==null?void 0:t.running)??[],k=n?String(n):"",N=()=>{e.invalidateQueries({queryKey:$e.models}),e.invalidateQueries({queryKey:$e.routing})},E=(Ue=u==null?void 0:u.groups)==null?void 0:Ue.brains,A=(E==null?void 0:E.members)??[],C=G=>A.includes(G),_=A.some(G=>w.includes(G));async function O(G){if(!E){f("Keine brains-Gruppe","Es existiert noch keine Ko-Residenz-Gruppe „brains“ in der Engine-Konfiguration. Lege sie erst über die Gruppen-Verwaltung an.");return}const Ce=A.includes(G)?A.filter(Ye=>Ye!==G):[...A,G];try{await rE("brains",Ce,E.swap??!1,E.persist??!0),e.invalidateQueries({queryKey:$e.groups}),N()}catch(Ye){f("Fehler",`Ko-Residenz konnte nicht geändert werden: ${Ye.message||Ye}`)}}const[D,B]=x.useState(null),[z,$]=x.useState(null),[K,W]=x.useState(null),[ve,ue]=x.useState("grid"),[pe,oe]=x.useState("all"),le=S.filter(G=>pe==="in_use"?!!G.role||w.includes(G.name):!0);async function Z(G){try{await xe(`/api/models/${encodeURIComponent(G)}/load`,{method:"POST"}),N()}catch(Ae){f("Fehler",`Fehler beim Laden des Modells: ${Ae.message}`)}}async function ie(G){if(E&&_&&!C(G)){const Ae=A.filter(Ce=>w.includes(Ce)).map(Ce=>Ce.split("/").pop()).join(", ");h("Verdrängt das Hirn?",`„${G.split("/").pop()}“ ist nicht in der Ko-Residenz-Gruppe „brains“. Beim Laden wirft es das aktuell warme Hirn (${Ae}) raus — Lucy verliert Hirn bzw. Augen. + `).concat(C.x,",").concat(C.y),O=Xt(e.id)?Ic("recharts-radial-line-"):e.id;return x.createElement("text",fi({},n,{dominantBaseline:"central",className:nt("recharts-radial-bar-label",c)}),x.createElement("defs",null,x.createElement("path",{id:O,d:_})),x.createElement("textPath",{xlinkHref:"#".concat(O)},r))},kV=(e,t,r)=>{var n=e.cx,i=e.cy,o=e.innerRadius,c=e.outerRadius,u=e.startAngle,f=e.endAngle,h=(u+f)/2;if(r==="outside"){var m=Zt(n,i,c+t,h),p=m.x,v=m.y;return{x:p,y:v,textAnchor:p>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:i,textAnchor:"middle",verticalAnchor:"end"};var b=(o+c)/2,S=Zt(n,i,b,h),w=S.x,k=S.y;return{x:w,y:k,textAnchor:"middle",verticalAnchor:"middle"}},uf=e=>e!=null&&"cx"in e&&Ee(e.cx),jV={angle:0,offset:5,zIndex:pr.label,position:"middle",textBreakAll:!1};function SV(e){if(!uf(e))return e;var t=e.cx,r=e.cy,n=e.outerRadius,i=n*2;return{x:t-n,y:r-n,width:i,upperWidth:i,lowerWidth:i,height:i}}function oa(e){var t=ln(e,jV),r=t.viewBox,n=t.parentViewBox,i=t.position,o=t.value,c=t.children,u=t.content,f=t.className,h=f===void 0?"":f,m=t.textBreakAll,p=t.labelRef,v=xV(),b=D3(),S=i==="center"?b:v??b,w,k,N;r==null?w=S:uf(r)?w=r:w=u0(r);var E=SV(w);if(!w||Xt(o)&&Xt(c)&&!x.isValidElement(u)&&typeof u!="function")return null;var A=xc(xc({},t),{},{viewBox:w});if(x.isValidElement(u)){A.labelRef;var C=FS(A,uV);return x.cloneElement(u,C)}if(typeof u=="function"){A.content;var _=FS(A,dV);if(k=x.createElement(u,_),x.isValidElement(k))return k}else k=yV(t);var O=an(t);if(uf(w)){if(i==="insideStart"||i==="insideEnd"||i==="end")return wV(t,i,k,O,w);N=kV(w,t.offset,t.position)}else{if(!E)return null;var D=cV({viewBox:E,position:i,offset:t.offset,parentViewBox:uf(n)?void 0:n});N=xc(xc({x:D.x,y:D.y,textAnchor:D.horizontalAnchor,verticalAnchor:D.verticalAnchor},D.width!==void 0?{width:D.width}:{}),D.height!==void 0?{height:D.height}:{})}return x.createElement(Ii,{zIndex:t.zIndex},x.createElement(gy,fi({ref:p,className:nt("recharts-label",h)},O,N,{textAnchor:O3(O.textAnchor)?O.textAnchor:N.textAnchor,breakAll:m}),k))}oa.displayName="Label";var NV=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?x.createElement(oa,fi({key:"label-implicit"},n)):Vn(e)?x.createElement(oa,fi({key:"label-implicit",value:e},n)):x.isValidElement(e)?e.type===oa?x.cloneElement(e,xc({key:"label-implicit"},n)):x.createElement(oa,fi({key:"label-implicit",content:e},n)):vy(e)?x.createElement(oa,fi({key:"label-implicit",content:e},n)):e&&typeof e=="object"?x.createElement(oa,fi({},e,{key:"label-implicit"},n)):null};function EV(e){var t=e.label,r=e.labelRef,n=D3();return NV(t,n,r)||null}var AV=["valueAccessor"],CV=["dataKey","clockWise","id","textBreakAll","zIndex"];function ah(){return ah=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(tV(t))return t},L3=x.createContext(void 0),_V=L3.Provider,R3=x.createContext(void 0);R3.Provider;function MV(){return x.useContext(L3)}function IV(){return x.useContext(R3)}function df(e){var t=e.valueAccessor,r=t===void 0?OV:t,n=US(e,AV),i=n.dataKey;n.clockWise;var o=n.id,c=n.textBreakAll,u=n.zIndex,f=US(n,CV),h=MV(),m=IV(),p=h||m;return!p||!p.length?null:x.createElement(Ii,{zIndex:u??pr.label},x.createElement(on,{className:"recharts-label-list"},p.map((v,b)=>{var S,w=Xt(i)?r(v,b):Ft(v.payload,i),k=Xt(o)?{}:{id:"".concat(o,"-").concat(b)};return x.createElement(oa,ah({key:"label-".concat(b)},an(v),f,k,{fill:(S=n.fill)!==null&&S!==void 0?S:v.fill,parentViewBox:v.parentViewBox,value:w,textBreakAll:c,viewBox:v.viewBox,index:b,zIndex:0}))})))}df.displayName="LabelList";function TV(e){var t=e.label;return t?t===!0?x.createElement(df,{key:"labelList-implicit"}):x.isValidElement(t)||vy(t)?x.createElement(df,{key:"labelList-implicit",content:t}):typeof t=="object"?x.createElement(df,ah({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function vx(){return vx=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=e.cx,r=e.cy,n=e.r,i=e.className,o=nt("recharts-dot",i);return Ee(t)&&Ee(r)&&Ee(n)?x.createElement("circle",vx({},Sn(e),e0(e),{className:o,cx:t,cy:r,r:n})):null},DV={radiusAxis:{},angleAxis:{}},z3=ur({name:"polarAxis",initialState:DV,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),um=z3.actions;um.addRadiusAxis;um.removeRadiusAxis;um.addAngleAxis;um.removeAngleAxis;var LV=z3.reducer;function RV(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var F3=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function WS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function HS(e){for(var t=1;t{n||(i.current===null?r(rH(t)):i.current!==t&&r(nH({prev:i.current,next:t})),i.current=t)},[t,r,n]),x.useLayoutEffect(()=>()=>{i.current&&(r(iH(i.current)),i.current=null)},[r]),null}function VV(e){var t=e.legendPayload,r=At(),n=Or(),i=x.useRef(null);return x.useLayoutEffect(()=>{n||(i.current===null?r(O8(t)):i.current!==t&&r(_8({prev:i.current,next:t})),i.current=t)},[r,n,t]),x.useLayoutEffect(()=>()=>{i.current&&(r(M8(i.current)),i.current=null)},[r]),null}function qV(e,t){return XV(e)||ZV(e,t)||YV(e,t)||QV()}function QV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YV(e,t){if(e){if(typeof e=="string")return KS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?KS(e,t):void 0}}function KS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r2&&arguments[2]!==void 0?arguments[2]:[],n=[];for(var i of r)n.push({status:"removed",prev:i});for(var o=0;oe[Math.floor(o*r)]);return yy(n,t)}function tq(e,t){var r=t.map((n,i)=>e[i]);return yy(r,t)}function rq(e,t){for(var r=new Map,n=0;n{var b=r(p,v);if(b!=null){var S=n.get(b);if(S!==void 0)return i.add(b),S}}),c=[];for(var u of n){var f=qV(u,2),h=f[0],m=f[1];i.has(h)||c.push(m)}return yy(o,t,c)}function xx(e,t,r){return t==null?null:e==null?t.map(n=>({status:"added",next:n})):r===xy?eq(e,t):r===JV?tq(e,t):nq(e,t,r)}function U3(e,t){var r=x.useRef(e),n=x.useRef(t.current),i=x.useRef(!0);r.current!==e&&(r.current=e,n.current=t.current,i.current=!1);var o=x.useCallback(function(c,u){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(u===0){i.current=!0;return}u===1&&(n.current=c),u>0&&i.current&&f&&(t.current=c)},[t]);return{startValue:n.current,syncStepValue:o}}function iq(e,t){return lq(e)||sq(e,t)||oq(e,t)||aq()}function aq(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oq(e,t){if(e){if(typeof e=="string")return GS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?GS(e,t):void 0}}function GS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{typeof e=="function"&&e(),o(!0)},[e]),u=x.useCallback(()=>{typeof t=="function"&&t(),o(!1)},[t]);return{isAnimating:i,handleAnimationStart:c,handleAnimationEnd:u}}function uq(e){var t,r=e.animationInput,n=e.animationIdPrefix,i=e.items,o=e.previousItemsRef,c=e.isAnimationActive,u=e.animationBegin,f=e.animationDuration,h=e.animationEasing,m=e.onAnimationStart,p=e.onAnimationEnd,v=e.animationInterpolateFn,b=e.animationMatchBy,S=e.shouldUpdatePreviousRef,w=e.children,k=e.layout,N=nC(r,n),E=U3(N,o),A=(t=E.startValue)!==null&&t!==void 0?t:null,C=xx(A,i,b??xy);return x.createElement(rC,{animationId:N,begin:u,duration:f,isActive:c,easing:h,onAnimationEnd:p,onAnimationStart:m,key:N},_=>{var O=A==null,D=i==null?i:v(C,_,k),B=S?S(_):_>0;return E.syncStepValue(D,_,B),D==null?null:w(D,_,O)})}var Vg;function dq(e,t){return pq(e)||mq(e,t)||hq(e,t)||fq()}function fq(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hq(e,t){if(e){if(typeof e=="string")return VS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?VS(e,t):void 0}}function VS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var e=x.useState(()=>Ic("uid-")),t=dq(e,1),r=t[0];return r},W3=(Vg=hh.useId)!==null&&Vg!==void 0?Vg:gq;function vq(e,t){var r=W3();return t||(e?"".concat(e,"-").concat(r):r)}var xq=x.createContext(void 0),yq=e=>{var t=e.id,r=e.type,n=e.children,i=vq("recharts-".concat(r),t);return x.createElement(xq.Provider,{value:i},n(i))},bq={cartesianItems:[],polarItems:[]},H3=ur({name:"graphicalItems",initialState:bq,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:lt()},replaceCartesianGraphicalItem:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,o=tn(e).cartesianItems.indexOf(n);o>-1&&(e.cartesianItems[o]=i)},prepare:lt()},removeCartesianGraphicalItem:{reducer(e,t){var r=tn(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:lt()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:lt()},removePolarGraphicalItem:{reducer(e,t){var r=tn(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:lt()},replacePolarGraphicalItem:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,o=tn(e).polarItems.indexOf(n);o>-1&&(e.polarItems[o]=i)},prepare:lt()}}}),fl=H3.actions,wq=fl.addCartesianGraphicalItem,kq=fl.replaceCartesianGraphicalItem,jq=fl.removeCartesianGraphicalItem;fl.addPolarGraphicalItem;fl.removePolarGraphicalItem;fl.replacePolarGraphicalItem;var Sq=H3.reducer,Nq=e=>{var t=At(),r=x.useRef(null);return x.useLayoutEffect(()=>{r.current===null?t(wq(e)):r.current!==e&&t(kq({prev:r.current,next:e})),r.current=e},[t,e]),x.useLayoutEffect(()=>()=>{r.current&&(t(jq(r.current)),r.current=null)},[t]),null},Eq=x.memo(Nq),Aq=["points"];function qS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function qg(e){for(var t=1;t{var N,E,A=qg(qg(qg({r:3},c),v),{},{index:k,cx:(N=w.x)!==null&&N!==void 0?N:void 0,cy:(E=w.y)!==null&&E!==void 0?E:void 0,dataKey:o,value:w.value,payload:w.payload,points:t});return x.createElement(Iq,{key:"dot-".concat(k),option:r,dotProps:A,className:i})}),S={};return u&&f!=null&&(S.clipPath="url(#clipPath-".concat(p?"":"dots-").concat(f,")")),x.createElement(Ii,{zIndex:m},x.createElement(on,oh({className:n},S),b))}function QS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function YS(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Qq=Q([qq,Ai,Ci],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),by=()=>Me(Qq),Yq=()=>Me(rK);function ZS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Qg(e){for(var t=1;t{var t=e.point,r=e.childIndex,n=e.mainColor,i=e.activeDot,o=e.dataKey,c=e.clipPath;if(i===!1||t.x==null||t.y==null)return null;var u={index:r,dataKey:o,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},f=Qg(Qg(Qg({},u),jh(i)),e0(i)),h;return x.isValidElement(i)?h=x.cloneElement(i,f):typeof i=="function"?h=i(f):h=x.createElement($3,f),x.createElement(on,{className:"recharts-active-dot",clipPath:c},h)};function XS(e){var t=e.points,r=e.mainColor,n=e.activeDot,i=e.itemDataKey,o=e.clipPath,c=e.zIndex,u=c===void 0?pr.activeDot:c,f=Me(Gc),h=Yq();if(t==null||h==null)return null;var m=t.find(p=>h.includes(p.payload));return Xt(m)?null:x.createElement(Ii,{zIndex:u},x.createElement(eQ,{point:m,childIndex:Number(f),mainColor:r,dataKey:i,activeDot:n,clipPath:o}))}var tQ=e=>{var t=e.chartData,r=At(),n=Or();return x.useEffect(()=>n?()=>{}:(r(bS(t)),()=>{r(bS(void 0))}),[t,r,n]),null},JS={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},V3=ur({name:"brush",initialState:JS,reducers:{setBrushSettings(e,t){return t.payload==null?JS:t.payload}}});V3.actions.setBrushSettings;var rQ=V3.reducer;function nQ(e){return(e%180+180)%180}var iQ=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=nQ(i),c=o*Math.PI/180,u=Math.atan(n/r),f=c>u&&c{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=tn(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=tn(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=tn(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),hl=q3.actions;hl.addDot;hl.removeDot;hl.addArea;hl.removeArea;hl.addLine;hl.removeLine;var oQ=q3.reducer;function sQ(e,t){return dQ(e)||uQ(e,t)||cQ(e,t)||lQ()}function lQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cQ(e,t){if(e){if(typeof e=="string")return eN(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?eN(e,t):void 0}}function eN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.children,r=x.useState("".concat(Ic("recharts"),"-clip")),n=sQ(r,1),i=n[0],o=by();if(o==null)return null;var c=o.x,u=o.y,f=o.width,h=o.height;return x.createElement(fQ.Provider,{value:i},x.createElement("defs",null,x.createElement("clipPath",{id:i},x.createElement("rect",{x:c,y:u,height:h,width:f}))),t)};function Q3(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;ne*i)return!1;var o=r();return e*(t-e*o/2-n)>=0&&e*(t+e*o/2-i)<=0}function gQ(e,t){return Q3(e,t+1)}function vQ(e,t,r,n,i){for(var o=(n||[]).slice(),c=t.start,u=t.end,f=0,h=1,m=c,p=function(){var S=n==null?void 0:n[f];if(S===void 0)return{v:Q3(n,h)};var w=f,k,N=()=>(k===void 0&&(k=r(S,w)),k),E=S.coordinate,A=f===0||qc(e,E,N,m,u);A||(f=0,m=c,h+=1),A&&(m=E+e*(N()/2+i),f+=h)},v;h<=o.length;)if(v=p(),v)return v.v;return[]}function xQ(e,t,r,n,i){var o=(n||[]).slice(),c=o.length;if(c===0)return[];for(var u=t.start,f=t.end,h=1;h<=c;h++){for(var m=(c-1)%h,p=u,v=!0,b=function(){var C=n[w];if(C==null)return 0;var _=w,O,D=()=>(O===void 0&&(O=r(C,_)),O),B=C.coordinate,z=w===m||qc(e,B,D,p,f);if(!z)return v=!1,1;z&&(p=B+e*(D()/2+i))},S,w=m;w(w===void 0&&(w=r(b,v)),w);if(v===c-1){var N=e*(S.coordinate+e*k()/2-f);o[v]=S=sr(sr({},S),{},{tickCoord:N>0?S.coordinate-N*e:S.coordinate})}else o[v]=S=sr(sr({},S),{},{tickCoord:S.coordinate});if(S.tickCoord!=null){var E=qc(e,S.tickCoord,k,u,f);E&&(f=S.tickCoord-e*(k()/2+i),o[v]=sr(sr({},S),{},{isShow:!0}))}},m=c-1;m>=0;m--)h(m);return o}function jQ(e,t,r,n,i,o){var c=(n||[]).slice(),u=c.length,f=t.start,h=t.end;if(o){var m=n[u-1];if(m!=null){var p=r(m,u-1),v=e*(m.coordinate+e*p/2-h);if(c[u-1]=m=sr(sr({},m),{},{tickCoord:v>0?m.coordinate-v*e:m.coordinate}),m.tickCoord!=null){var b=qc(e,m.tickCoord,()=>p,f,h);b&&(h=m.tickCoord-e*(p/2+i),c[u-1]=sr(sr({},m),{},{isShow:!0}))}}}for(var S=o?u-1:u,w=function(E){var A=c[E];if(A==null)return 1;var C=A,_,O=()=>(_===void 0&&(_=r(A,E)),_);if(E===0){var D=e*(C.coordinate-e*O()/2-f);c[E]=C=sr(sr({},C),{},{tickCoord:D<0?C.coordinate-D*e:C.coordinate})}else c[E]=C=sr(sr({},C),{},{tickCoord:C.coordinate});if(C.tickCoord!=null){var B=qc(e,C.tickCoord,O,f,h);B&&(f=C.tickCoord+e*(O()/2+i),c[E]=sr(sr({},C),{},{isShow:!0}))}},k=0;k{var D=typeof h=="function"?h(_.value,O):_.value;return S==="width"?mQ(kc(D,{fontSize:t,letterSpacing:r}),w,p):kc(D,{fontSize:t,letterSpacing:r})[S]},N=i[0],E=i[1],A=i.length>=2&&N!=null&&E!=null?en(E.coordinate-N.coordinate):1,C=pQ(o,A,S);return f==="equidistantPreserveStart"?vQ(A,C,k,i,c):f==="equidistantPreserveEnd"?xQ(A,C,k,i,c):(f==="preserveStart"||f==="preserveStartEnd"?b=jQ(A,C,k,i,c,f==="preserveStartEnd"):b=kQ(A,C,k,i,c),b.filter(_=>_.isShow))}var SQ=e=>{var t=e.ticks,r=e.label,n=e.labelGapWithTick,i=n,o=e.tickSize,c=o===void 0?0:o,u=e.tickMargin,f=u===void 0?0:u,h=0;if(t){Array.from(t).forEach(b=>{if(b){var S=b.getBoundingClientRect();S.width>h&&(h=S.width)}});var m=r?r.getBoundingClientRect().width:0,p=c+f,v=h+p+m+(r?i:0);return Math.round(v)}return 0},NQ={xAxis:{},yAxis:{}},Y3=ur({name:"renderedTicks",initialState:NQ,reducers:{setRenderedTicks:(e,t)=>{var r=t.payload,n=r.axisType,i=r.axisId,o=r.ticks;e[n][i]=o},removeRenderedTicks:(e,t)=>{var r=t.payload,n=r.axisType,i=r.axisId;delete e[n][i]}}}),Z3=Y3.actions,EQ=Z3.setRenderedTicks,AQ=Z3.removeRenderedTicks,CQ=Y3.reducer,PQ=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function rN(e,t){return IQ(e)||MQ(e,t)||_Q(e,t)||OQ()}function OQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _Q(e,t){if(e){if(typeof e=="string")return nN(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?nN(e,t):void 0}}function nN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(n==null||r==null)return rl;var o=t.map(c=>({value:c.value,coordinate:c.coordinate,offset:c.offset,index:c.index}));return i(EQ({ticks:o,axisId:n,axisType:r})),()=>{i(AQ({axisId:n,axisType:r}))}},[i,t,n,r]),null}var KQ=x.forwardRef((e,t)=>{var r=e.ticks,n=r===void 0?[]:r,i=e.tick,o=e.tickLine,c=e.stroke,u=e.tickFormatter,f=e.unit,h=e.padding,m=e.tickTextProps,p=e.orientation,v=e.mirror,b=e.x,S=e.y,w=e.width,k=e.height,N=e.tickSize,E=e.tickMargin,A=e.fontSize,C=e.letterSpacing,_=e.getTicksConfig,O=e.events,D=e.axisType,B=e.axisId,z=wy(bt(bt({},_),{},{ticks:n}),A,C),$=Sn(_),K=jh(i),W=O3($.textAnchor)?$.textAnchor:BQ(p,v),ve=UQ(p,v),ue={};typeof o=="object"&&(ue=o);var pe=bt(bt({},$),{},{fill:"none"},ue),oe=z.map(ie=>bt({entry:ie},FQ(ie,b,S,w,k,p,N,v,E))),le=oe.map(ie=>{var te=ie.entry,I=ie.line;return x.createElement(on,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(te.value,"-").concat(te.coordinate,"-").concat(te.tickCoord)},o&&x.createElement("line",Ao({},pe,I,{className:nt("recharts-cartesian-axis-tick-line",Oo(o,"className"))})))}),Z=oe.map((ie,te)=>{var I,M,U=ie.entry,ne=ie.tick,ee=bt(bt(bt(bt({verticalAnchor:ve},$),{},{textAnchor:W,stroke:"none",fill:c},ne),{},{index:te,payload:U,visibleTicksCount:z.length,tickFormatter:u,padding:h},m),{},{angle:(I=(M=m==null?void 0:m.angle)!==null&&M!==void 0?M:$.angle)!==null&&I!==void 0?I:0}),X=bt(bt({},ee),K);return x.createElement(on,Ao({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(U.value,"-").concat(U.coordinate,"-").concat(U.tickCoord)},QR(O,U,te)),i&&x.createElement(WQ,{option:i,tickProps:X,value:"".concat(typeof u=="function"?u(U.value,te):U.value).concat(f||"")}))});return x.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(D,"-ticks")},x.createElement(HQ,{ticks:z,axisId:B,axisType:D}),Z.length>0&&x.createElement(Ii,{zIndex:pr.label},x.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(D,"-tick-labels"),ref:t},Z)),le.length>0&&x.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(D,"-tick-lines")},le))}),GQ=x.forwardRef((e,t)=>{var r=e.axisLine,n=e.width,i=e.height,o=e.className,c=e.hide,u=e.ticks,f=e.axisType,h=e.axisId,m=TQ(e,PQ),p=x.useState(""),v=rN(p,2),b=v[0],S=v[1],w=x.useState(""),k=rN(w,2),N=k[0],E=k[1],A=x.useRef(null);x.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var _;return SQ({ticks:A.current,label:(_=e.labelRef)===null||_===void 0?void 0:_.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var C=x.useCallback(_=>{if(_){var O=_.getElementsByClassName("recharts-cartesian-axis-tick-value");A.current=O;var D=O[0];if(D){var B=window.getComputedStyle(D),z=B.fontSize,$=B.letterSpacing;(z!==b||$!==N)&&(S(z),E($))}}},[b,N]);return c||n!=null&&n<=0||i!=null&&i<=0?null:x.createElement(Ii,{zIndex:e.zIndex},x.createElement(on,{className:nt("recharts-cartesian-axis",o)},x.createElement(zQ,{x:e.x,y:e.y,width:n,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:Sn(e)}),x.createElement(KQ,{ref:C,axisType:f,events:m,fontSize:b,getTicksConfig:e,height:e.height,letterSpacing:N,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:u,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:h}),x.createElement(gV,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},x.createElement(EV,{label:e.label,labelRef:e.labelRef}),e.children)))}),ky=x.forwardRef((e,t)=>{var r=ln(e,yi);return x.createElement(GQ,Ao({},r,{ref:t}))});ky.displayName="CartesianAxis";var VQ=["x1","y1","x2","y2","key"],qQ=["offset"],QQ=["xAxisId","yAxisId"],YQ=["xAxisId","yAxisId"];function aN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function cr(e){for(var t=1;t{var t=e.fill;if(!t||t==="none")return null;var r=e.fillOpacity,n=e.x,i=e.y,o=e.width,c=e.height,u=e.ry;return x.createElement("rect",{x:n,y:i,ry:u,width:o,height:c,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function X3(e){var t=e.option,r=e.lineItemProps,n;if(x.isValidElement(t))n=x.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var i,o=r.x1,c=r.y1,u=r.x2,f=r.y2,h=r.key,m=sh(r,VQ),p=(i=Sn(m))!==null&&i!==void 0?i:{};p.offset;var v=sh(p,qQ);n=x.createElement("line",ro({},v,{x1:o,y1:c,x2:u,y2:f,fill:"none",key:h}))}return n}function rY(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,o=e.horizontalPoints;if(!i||!o||!o.length)return null;e.xAxisId,e.yAxisId;var c=sh(e,QQ),u=o.map((f,h)=>{var m=cr(cr({},c),{},{x1:t,y1:f,x2:t+r,y2:f,key:"line-".concat(h),index:h});return x.createElement(X3,{key:"line-".concat(h),option:i,lineItemProps:m})});return x.createElement("g",{className:"recharts-cartesian-grid-horizontal"},u)}function nY(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,o=e.verticalPoints;if(!i||!o||!o.length)return null;e.xAxisId,e.yAxisId;var c=sh(e,YQ),u=o.map((f,h)=>{var m=cr(cr({},c),{},{x1:f,y1:t,x2:f,y2:t+r,key:"line-".concat(h),index:h});return x.createElement(X3,{option:i,lineItemProps:m,key:"line-".concat(h)})});return x.createElement("g",{className:"recharts-cartesian-grid-vertical"},u)}function iY(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,o=e.width,c=e.height,u=e.horizontalPoints,f=e.horizontal,h=f===void 0?!0:f;if(!h||!t||!t.length||u==null)return null;var m=u.map(v=>Math.round(v+i-i)).sort((v,b)=>v-b);i!==m[0]&&m.unshift(0);var p=m.map((v,b)=>{var S=m[b+1],w=S==null,k=w?i+c-v:S-v;if(k<=0)return null;var N=b%t.length;return x.createElement("rect",{key:"react-".concat(b),y:v,x:n,height:k,width:o,stroke:"none",fill:t[N],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function aY(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,o=e.x,c=e.y,u=e.width,f=e.height,h=e.verticalPoints;if(!r||!n||!n.length)return null;var m=h.map(v=>Math.round(v+o-o)).sort((v,b)=>v-b);o!==m[0]&&m.unshift(0);var p=m.map((v,b)=>{var S=m[b+1],w=S==null,k=w?o+u-v:S-v;if(k<=0)return null;var N=b%n.length;return x.createElement("rect",{key:"react-".concat(b),x:v,y:c,width:k,height:f,stroke:"none",fill:n[N],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return x.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var oY=(e,t)=>{var r=e.xAxis,n=e.width,i=e.height,o=e.offset;return MA(wy(cr(cr(cr({},yi),r),{},{ticks:IA(r),viewBox:{x:0,y:0,width:n,height:i}})),o.left,o.left+o.width,t)},sY=(e,t)=>{var r=e.yAxis,n=e.width,i=e.height,o=e.offset;return MA(wy(cr(cr(cr({},yi),r),{},{ticks:IA(r),viewBox:{x:0,y:0,width:n,height:i}})),o.top,o.top+o.height,t)},lY={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:pr.grid};function J3(e){var t=BA(),r=UA(),n=FA(),i=cr(cr({},ln(e,lY)),{},{x:Ee(e.x)?e.x:n.left,y:Ee(e.y)?e.y:n.top,width:Ee(e.width)?e.width:n.width,height:Ee(e.height)?e.height:n.height}),o=i.xAxisId,c=i.yAxisId,u=i.x,f=i.y,h=i.width,m=i.height,p=i.syncWithTicks,v=i.horizontalValues,b=i.verticalValues,S=Or(),w=Me(z=>sS(z,"xAxis",o,S)),k=Me(z=>sS(z,"yAxis",c,S));if(!qn(h)||!qn(m)||!Ee(u)||!Ee(f))return null;var N=i.verticalCoordinatesGenerator||oY,E=i.horizontalCoordinatesGenerator||sY,A=i.horizontalPoints,C=i.verticalPoints;if((!A||!A.length)&&typeof E=="function"){var _=v&&v.length,O=E({yAxis:k?cr(cr({},k),{},{ticks:_?v:k.ticks}):void 0,width:t??h,height:r??m,offset:n},_?!0:p);If(Array.isArray(O),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof O,"]")),Array.isArray(O)&&(A=O)}if((!C||!C.length)&&typeof N=="function"){var D=b&&b.length,B=N({xAxis:w?cr(cr({},w),{},{ticks:D?b:w.ticks}):void 0,width:t??h,height:r??m,offset:n},D?!0:p);If(Array.isArray(B),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof B,"]")),Array.isArray(B)&&(C=B)}return x.createElement(Ii,{zIndex:i.zIndex},x.createElement("g",{className:"recharts-cartesian-grid"},x.createElement(tY,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),x.createElement(iY,ro({},i,{horizontalPoints:A})),x.createElement(aY,ro({},i,{verticalPoints:C})),x.createElement(rY,ro({},i,{offset:n,horizontalPoints:A,xAxis:w,yAxis:k})),x.createElement(nY,ro({},i,{offset:n,verticalPoints:C,xAxis:w,yAxis:k}))))}J3.displayName="CartesianGrid";var cY={},eO=ur({name:"errorBars",initialState:cY,reducers:{addErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,i=r.errorBar;e[n]||(e[n]=[]),e[n].push(i)},replaceErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,i=r.prev,o=r.next;e[n]&&(e[n]=e[n].map(c=>c.dataKey===i.dataKey&&c.direction===i.direction?o:c))},removeErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,i=r.errorBar;e[n]&&(e[n]=e[n].filter(o=>o.dataKey!==i.dataKey||o.direction!==i.direction))}}}),jy=eO.actions;jy.addErrorBar;jy.replaceErrorBar;jy.removeErrorBar;var uY=eO.reducer;function tO(e,t){var r,n,i=Me(h=>Oi(h,e)),o=Me(h=>_i(h,t)),c=(r=i==null?void 0:i.allowDataOverflow)!==null&&r!==void 0?r:Ot.allowDataOverflow,u=(n=o==null?void 0:o.allowDataOverflow)!==null&&n!==void 0?n:_t.allowDataOverflow,f=c||u;return{needClip:f,needClipX:c,needClipY:u}}function dY(e){var t=e.xAxisId,r=e.yAxisId,n=e.clipPathId,i=by(),o=tO(t,r),c=o.needClipX,u=o.needClipY,f=o.needClip,h=Me(A=>zP(A,t,!1)),m=Me(A=>FP(A,r,!1));if(!f||!i)return null;var p=i.x,v=i.y,b=i.width,S=i.height,w=c&&h?Math.min(h[0],h[1]):p-b/2,k=u&&m?Math.min(m[0],m[1]):v-S/2,N=c&&h?Math.abs(h[1]-h[0]):b*2,E=u&&m?Math.abs(m[1]-m[0]):S*2;return x.createElement("clipPath",{id:"clipPath-".concat(n)},x.createElement("rect",{x:w,y:k,width:N,height:E}))}function fY(e){var t=jh(e),r=3,n=2;if(t!=null){var i=t.r,o=t.strokeWidth,c=Number(i),u=Number(o);return(Number.isNaN(c)||c<0)&&(c=r),(Number.isNaN(u)||u<0)&&(u=n),{r:c,strokeWidth:u}}return{r,strokeWidth:n}}function Sy(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||n===void 0?void 0:n.xAxisId)!==null&&r!==void 0?r:K3}function Ny(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||n===void 0?void 0:n.yAxisId)!==null&&r!==void 0?r:K3}var rO=(e,t,r)=>qP(e,"xAxis",Sy(e,t),r),nO=(e,t,r)=>VP(e,"xAxis",Sy(e,t),r),iO=(e,t,r)=>qP(e,"yAxis",Ny(e,t),r),aO=(e,t,r)=>VP(e,"yAxis",Ny(e,t),r),hY=Q([ht,rO,iO,nO,aO],(e,t,r,n,i)=>Zn(e,"xAxis")?Mf(t,n,!1):Mf(r,i,!1)),mY=(e,t)=>t,oO=Q([hP,mY],(e,t)=>e.filter(r=>r.type==="area").find(r=>r.id===t)),sO=e=>{var t=ht(e),r=Zn(t,"xAxis");return r?"yAxis":"xAxis"},pY=(e,t)=>{var r=sO(e);return r==="yAxis"?Ny(e,t):Sy(e,t)},gY=(e,t,r)=>jP(e,sO(e),pY(e,t),r),vY=Q([oO,gY],(e,t)=>{var r;if(!(e==null||t==null)){var n=e.stackId,i=N0(e);if(!(n==null||i==null)){var o=(r=t[n])===null||r===void 0?void 0:r.stackedData,c=o==null?void 0:o.find(u=>u.key===i);if(c!=null)return c.map(u=>[u[0],u[1]])}}}),xY=Q([ht,rO,iO,nO,aO,vY,U9,hY,oO,a7],(e,t,r,n,i,o,c,u,f,h)=>{var m=c.chartData,p=c.dataStartIndex,v=c.dataEndIndex;if(!(f==null||e!=="horizontal"&&e!=="vertical"||t==null||r==null||n==null||i==null||n.length===0||i.length===0||u==null)){var b=f.data,S;if(b&&b.length>0?S=b:S=m==null?void 0:m.slice(p,v+1),S!=null)return HY({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:i,dataStartIndex:p,areaSettings:f,stackedData:o,displayedData:S,chartBaseValue:h,bandSize:u})}}),yY=["animationElapsedTime","isAnimating","isEntrance","layout","isRange","stroke","connectNulls"],bY=["id","baseLine"];function jc(){return jc=Object.assign?Object.assign.bind():function(e){for(var t=1;tp.y||0));return Ee(i)?m=Math.max(i,m):i&&Array.isArray(i)&&i.length&&(m=Math.max(...i.map(p=>p.y||0),m)),Ee(m)?x.createElement("rect",{x:up.x||0));return Ee(i)?m=Math.max(i,m):i&&Array.isArray(i)&&i.length&&(m=Math.max(...i.map(p=>p.x||0),m)),Ee(m)?x.createElement("rect",{x:0,y:ue==null?[]:t===1?e.flatMap(r=>r.status==="removed"?[]:[r.next]):e.flatMap(r=>r.status==="matched"?[Ys(Ys({},r.next),{},{x:mi(r.prev.x,r.next.x,t),y:mi(r.prev.y,r.next.y,t)})]:r.status==="added"?[r.next]:[]),cO={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationMatchBy:xy,animationInterpolateFn:MY,connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,shape:NY,xAxisId:0,yAxisId:0,zIndex:pr.area};function ch(e,t){return e&&e!=="none"?e:t}var IY=e=>{var t=e.dataKey,r=e.name,n=e.stroke,i=e.fill,o=e.legendType,c=e.hide;return[{inactive:c,dataKey:t,type:o,color:ch(n,i),value:TA(r,t),payload:e}]},TY=x.memo(e=>{var t=e.dataKey,r=e.data,n=e.stroke,i=e.strokeWidth,o=e.fill,c=e.name,u=e.hide,f=e.unit,h=e.tooltipType,m=e.id,p={dataDefinedOnItem:r,getPosition:rl,settings:{stroke:n,strokeWidth:i,fill:o,dataKey:t,nameKey:void 0,name:TA(c,t),hide:u,type:h,color:ch(n,o),unit:f,graphicalItemId:m}};return x.createElement(GV,{tooltipEntrySettings:p})});function DY(e){var t=e.clipPathId,r=e.points,n=e.props,i=n.needClip,o=n.dot,c=n.dataKey,u=Sn(n);return x.createElement(Dq,{points:r,dot:o,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:c,baseProps:u,needClip:i,clipPathId:t})}function LY(e){var t=e.showLabels,r=e.children,n=e.points,i=n.map(o=>{var c,u,f={x:(c=o.x)!==null&&c!==void 0?c:0,y:(u=o.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Ys(Ys({},f),{},{value:o.value,payload:o.payload,parentViewBox:void 0,viewBox:f,fill:void 0})});return x.createElement(_V,{value:t?i:void 0},r)}function RY(e){var t=e.points,r=e.baseLine,n=e.needClip,i=e.clipPathId,o=e.props,c=e.animationElapsedTime,u=e.isAnimating,f=e.isEntrance,h=o.layout,m=o.type,p=o.stroke,v=o.connectNulls,b=o.isRange,S=o.shape,w=o.id,k=lO(o,EY),N=an(k),E=Ys(Ys({},N),{},{id:w,points:t,connectNulls:v,type:m,baseLine:r,layout:h,stroke:p,isRange:b,animationElapsedTime:c,isAnimating:u,isEntrance:f});return x.createElement(x.Fragment,null,(t==null?void 0:t.length)>1&&x.createElement(on,{clipPath:n?"url(#clipPath-".concat(i,")"):void 0},x.createElement(KV,{option:S,DefaultShape:cO.shape,shapeProps:E})),x.createElement(DY,{points:t,props:k,clipPathId:i}))}function $Y(e,t,r){if(Ee(e)){var n=Ee(t)?t:void 0;return mi(n,e,r)}if(Xt(e)||Gn(e)){var i=Ee(t)?t:void 0;return mi(i,0,r)}return e}function zY(e){var t=e.needClip,r=e.clipPathId,n=e.props,i=e.previousPointsRef,o=e.previousBaselineRef,c=n.points,u=n.baseLine,f=n.isAnimationActive,h=n.animationBegin,m=n.animationDuration,p=n.animationEasing,v=n.animationMatchBy,b=n.animationInterpolateFn,S=x.useMemo(()=>({points:c,baseLine:u}),[c,u]),w=U3(S,o),k=d0(),N=cq(n.onAnimationStart,n.onAnimationEnd),E=N.isAnimating,A=N.handleAnimationStart,C=N.handleAnimationEnd,_=w.startValue;if(k==null)return null;var O;return Array.isArray(u)&&Array.isArray(_)?O=xx(_,u,v):Array.isArray(u)?O=xx(null,u,v):O=null,x.createElement(uq,{animationInput:S,animationIdPrefix:"recharts-area-",items:c,previousItemsRef:i,isAnimationActive:f,animationBegin:h,animationDuration:m,animationEasing:p,onAnimationStart:A,onAnimationEnd:C,animationInterpolateFn:b,animationMatchBy:v,layout:k},(D,B,z)=>{var $;return B===1?$=u:Array.isArray(u)?$=b(O,B,k):$=z?u:$Y(u,_,B),w.syncStepValue($,B),x.createElement(LY,{showLabels:!E,points:c},n.children,x.createElement(RY,{points:D,baseLine:$,needClip:t,clipPathId:r,props:n,animationElapsedTime:B,isAnimating:E||B<1,isEntrance:z}),x.createElement(TV,{label:n.label}))})}function FY(e){var t=e.needClip,r=e.clipPathId,n=e.props,i=x.useRef(null),o=x.useRef();return x.createElement(zY,{needClip:t,clipPathId:r,props:n,previousPointsRef:i,previousBaselineRef:o})}class BY extends x.PureComponent{render(){var t=this.props,r=t.hide,n=t.dot,i=t.points,o=t.className,c=t.top,u=t.left,f=t.needClip,h=t.xAxisId,m=t.yAxisId,p=t.width,v=t.height,b=t.id,S=t.baseLine,w=t.zIndex;if(r)return null;var k=nt("recharts-area",o),N=b,E=fY(n),A=E.r,C=E.strokeWidth,_=F3(n),O=A*2+C,D=f?"url(#clipPath-".concat(_?"":"dots-").concat(N,")"):void 0;return x.createElement(Ii,{zIndex:w},x.createElement(on,{className:k},f&&x.createElement("defs",null,x.createElement(dY,{clipPathId:N,xAxisId:h,yAxisId:m}),!_&&x.createElement("clipPath",{id:"clipPath-dots-".concat(N)},x.createElement("rect",{x:u-O/2,y:c-O/2,width:p+O,height:v+O}))),x.createElement(FY,{needClip:f,clipPathId:N,props:this.props})),x.createElement(XS,{points:i,mainColor:ch(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:D}),this.props.isRange&&Array.isArray(S)&&x.createElement(XS,{points:S,mainColor:ch(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:D}))}}function UY(e){var t,r=e.activeDot,n=e.animationBegin,i=e.animationDuration,o=e.animationEasing,c=e.connectNulls,u=e.dot,f=e.fill,h=e.fillOpacity,m=e.hide,p=e.isAnimationActive,v=e.legendType,b=e.stroke,S=e.xAxisId,w=e.yAxisId,k=lO(e,AY),N=nl(),E=v3(),A=tO(S,w),C=A.needClip,_=Or(),O=(t=Me(pe=>xY(pe,e.id,_)))!==null&&t!==void 0?t:{},D=O.points,B=O.isRange,z=O.baseLine,$=by();if(N!=="horizontal"&&N!=="vertical"||$==null||E!=="AreaChart"&&E!=="ComposedChart")return null;var K=$.height,W=$.width,ve=$.x,ue=$.y;return!D||!D.length?null:x.createElement(BY,lh({},k,{activeDot:r,animationBegin:n,animationDuration:i,animationEasing:o,baseLine:z,connectNulls:c,dot:u,fill:f,fillOpacity:h,height:K,hide:m,layout:N,isAnimationActive:p,isRange:B,legendType:v,needClip:C,points:D,stroke:b,width:W,left:ve,top:ue,xAxisId:S,yAxisId:w}))}var WY=(e,t,r,n,i)=>{var o=r??t;if(Ee(o))return o;var c=e==="horizontal"?i:n,u=c.scale.domain();if(c.type==="number"){var f=Math.max(u[0],u[1]),h=Math.min(u[0],u[1]);return o==="dataMin"?h:o==="dataMax"||f<0?f:Math.max(Math.min(u[0],u[1]),0)}return o==="dataMin"?u[0]:o==="dataMax"?u[1]:u[0]};function HY(e){var t=e.areaSettings,r=t.connectNulls,n=t.baseValue,i=t.dataKey,o=e.stackedData,c=e.layout,u=e.chartBaseValue,f=e.xAxis,h=e.yAxis,m=e.displayedData,p=e.dataStartIndex,v=e.xAxisTicks,b=e.yAxisTicks,S=e.bandSize,w=o&&o.length,k=WY(c,u,n,f,h),N=c==="horizontal",E=!1,A=m.map((_,O)=>{var D,B,z,$;if(w)$=o[p+O];else{var K=Ft(_,i);Array.isArray(K)?($=K,E=!0):$=[k,K]}var W=(D=(B=$)===null||B===void 0?void 0:B[1])!==null&&D!==void 0?D:null,ve=W==null||w&&!r&&Ft(_,i)==null;if(N){var ue;return{x:rj({axis:f,ticks:v,bandSize:S,entry:_,index:O}),y:ve?null:(ue=h.scale.map(W))!==null&&ue!==void 0?ue:null,value:$,payload:_}}return{x:ve?null:(z=f.scale.map(W))!==null&&z!==void 0?z:null,y:rj({axis:h,ticks:b,bandSize:S,entry:_,index:O}),value:$,payload:_}}),C;return w||E?C=A.map(_=>{var O,D=Array.isArray(_.value)?_.value[0]:null;if(N){var B;return{x:_.x,y:D!=null&&_.y!=null&&(B=h.scale.map(D))!==null&&B!==void 0?B:null,payload:_.payload}}return{x:D!=null&&(O=f.scale.map(D))!==null&&O!==void 0?O:null,y:_.y,payload:_.payload}}):C=N?h.scale.map(k):f.scale.map(k),{points:A,baseLine:C??0,isRange:E}}function KY(e){var t=ln(e,cO),r=Or();return x.createElement(yq,{id:t.id,type:"area"},n=>x.createElement(x.Fragment,null,x.createElement(VV,{legendPayload:IY(t)}),x.createElement(TY,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:n}),x.createElement(Eq,{type:"area",id:n,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:Cz(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:r,connectNulls:t.connectNulls}),x.createElement(UY,lh({},t,{id:n}))))}var uO=x.memo(KY,Kh);uO.displayName="Area";var GY=["domain","range"],VY=["domain","range"];function lN(e,t){if(e==null)return{};var r,n,i=qY(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{if(c!=null)return dN(dN({},o),{},{type:c})},[o,c]);return x.useLayoutEffect(()=>{u!=null&&(r.current===null?t(Fq(u)):r.current!==u&&t(Bq({prev:r.current,next:u})),r.current=u)},[u,t]),x.useLayoutEffect(()=>()=>{r.current&&(t(Uq(r.current)),r.current=null)},[t]),null}var nZ=e=>{var t=e.xAxisId,r=e.className,n=Me(LA),i=Or(),o="xAxis",c=Me(v=>GP(v,o,t,i)),u=Me(v=>RW(v,t)),f=Me(v=>WW(v,t)),h=Me(v=>cP(v,t));if(u==null||f==null||h==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var m=bx(e,YY);h.id,h.scale;var p=bx(h,ZY);return x.createElement(ky,yx({},m,p,{x:f.x,y:f.y,width:u.width,height:u.height,className:nt("recharts-".concat(o," ").concat(o),r),viewBox:n,ticks:c,axisType:o,axisId:t}))},iZ={allowDataOverflow:Ot.allowDataOverflow,allowDecimals:Ot.allowDecimals,allowDuplicatedCategory:Ot.allowDuplicatedCategory,angle:Ot.angle,axisLine:yi.axisLine,height:Ot.height,hide:!1,includeHidden:Ot.includeHidden,interval:Ot.interval,label:!1,minTickGap:Ot.minTickGap,mirror:Ot.mirror,orientation:Ot.orientation,padding:Ot.padding,reversed:Ot.reversed,scale:Ot.scale,tick:Ot.tick,tickCount:Ot.tickCount,tickLine:yi.tickLine,tickSize:yi.tickSize,type:Ot.type,niceTicks:Ot.niceTicks,xAxisId:0},aZ=e=>{var t=ln(e,iZ);return x.createElement(x.Fragment,null,x.createElement(rZ,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),x.createElement(nZ,t))},fO=x.memo(aZ,dO);fO.displayName="XAxis";var oZ=["type"],sZ=["dangerouslySetInnerHTML","ticks","scale"],lZ=["id","scale"];function wx(){return wx=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(c!=null)return hN(hN({},o),{},{type:c})},[c,o]);return x.useLayoutEffect(()=>{u!=null&&(r.current===null?t(Wq(u)):r.current!==u&&t(Hq({prev:r.current,next:u})),r.current=u)},[u,t]),x.useLayoutEffect(()=>()=>{r.current&&(t(Kq(r.current)),r.current=null)},[t]),null}function mZ(e){var t=e.yAxisId,r=e.className,n=e.width,i=e.label,o=x.useRef(null),c=x.useRef(null),u=Me(LA),f=Or(),h=At(),m="yAxis",p=Me(N=>GW(N,t)),v=Me(N=>KW(N,t)),b=Me(N=>GP(N,m,t,f)),S=Me(N=>uP(N,t));if(x.useLayoutEffect(()=>{if(!(n!=="auto"||!p||vy(i)||x.isValidElement(i)||S==null)){var N=o.current;if(N){var E=N.getCalculatedWidth();Math.round(p.width)!==Math.round(E)&&h(Gq({id:t,width:E}))}}},[b,p,h,i,t,n,S]),p==null||v==null||S==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var w=kx(e,sZ);S.id,S.scale;var k=kx(S,lZ);return x.createElement(ky,wx({},w,k,{ref:o,labelRef:c,x:v.x,y:v.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:p.width,height:p.height,className:nt("recharts-".concat(m," ").concat(m),r),viewBox:u,ticks:b,axisType:m,axisId:t}))}var pZ={allowDataOverflow:_t.allowDataOverflow,allowDecimals:_t.allowDecimals,allowDuplicatedCategory:_t.allowDuplicatedCategory,angle:_t.angle,axisLine:yi.axisLine,hide:!1,includeHidden:_t.includeHidden,interval:_t.interval,label:!1,minTickGap:_t.minTickGap,mirror:_t.mirror,orientation:_t.orientation,padding:_t.padding,reversed:_t.reversed,scale:_t.scale,tick:_t.tick,tickCount:_t.tickCount,tickLine:yi.tickLine,tickSize:yi.tickSize,type:_t.type,niceTicks:_t.niceTicks,width:_t.width,yAxisId:0},gZ=e=>{var t=ln(e,pZ);return x.createElement(x.Fragment,null,x.createElement(hZ,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),x.createElement(mZ,t))},hO=x.memo(gZ,dO);hO.displayName="YAxis";var vZ=(e,t)=>t,Ey=Q([vZ,ht,SC,Wt,d3,Mi,mK,er],wK);function xZ(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function Ay(e){var t=e.currentTarget.getBoundingClientRect(),r,n;if(xZ(e)){var i=e.currentTarget.getBBox();r=i.width>0?t.width/i.width:1,n=i.height>0?t.height/i.height:1}else{var o=e.currentTarget;r=o.offsetWidth>0?t.width/o.offsetWidth:1,n=o.offsetHeight>0?t.height/o.offsetHeight:1}var c=(u,f)=>({relativeX:Math.round((u-t.left)/r),relativeY:Math.round((f-t.top)/n)});return"touches"in e?Array.from(e.touches).map(u=>c(u.clientX,u.clientY)):c(e.clientX,e.clientY)}var mO=Br("mouseClick"),pO=ou();pO.startListening({actionCreator:mO,effect:(e,t)=>{var r=e.payload,n=Ey(t.getState(),Ay(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(sH({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var jx=Br("mouseMove"),gO=ou(),ms=null,Ha=null,Yg=null;gO.startListening({actionCreator:jx,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=n.eventSettings,o=i.throttleDelay,c=i.throttledEvents,u=c==="all"||(c==null?void 0:c.includes("mousemove"));ms!==null&&(cancelAnimationFrame(ms),ms=null),Ha!==null&&(typeof o!="number"||!u)&&(clearTimeout(Ha),Ha=null),Yg=Ay(r);var f=()=>{var h=t.getState(),m=yu(h,h.tooltip.settings.shared);if(!Yg){ms=null,Ha=null;return}if(m==="axis"){var p=Ey(h,Yg);(p==null?void 0:p.activeIndex)!=null?t.dispatch(t3({activeIndex:p.activeIndex,activeDataKey:void 0,activeCoordinate:p.activeCoordinate})):t.dispatch(e3())}ms=null,Ha=null};if(!u){f();return}o==="raf"?ms=requestAnimationFrame(f):typeof o=="number"&&Ha===null&&(Ha=setTimeout(f,o))}});function yZ(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<>":t}var mN={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},vO=ur({name:"rootProps",initialState:mN,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:mN.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),bZ=vO.reducer,wZ=vO.actions.updateOptions,kZ=null,jZ={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},xO=ur({name:"polarOptions",initialState:kZ,reducers:jZ});xO.actions.updatePolarOptions;var SZ=xO.reducer,yO=Br("keyDown"),bO=Br("focus"),wO=Br("blur"),dm=ou(),ps=null,Ka=null,ef=null;dm.startListening({actionCreator:yO,effect:(e,t)=>{ef=e.payload,ps!==null&&(cancelAnimationFrame(ps),ps=null);var r=t.getState(),n=r.eventSettings,i=n.throttleDelay,o=n.throttledEvents,c=o==="all"||o.includes("keydown");Ka!==null&&(typeof i!="number"||!c)&&(clearTimeout(Ka),Ka=null);var u=()=>{try{var f=t.getState(),h=f.rootProps.accessibilityLayer!==!1;if(!h)return;var m=f.tooltip.keyboardInteraction,p=ef;if(p!=="ArrowRight"&&p!=="ArrowLeft"&&p!=="Enter")return;var v=wc(m,Eo(f),qs(f),Qs(f)),b=v==null?-1:Number(v),S=!Number.isFinite(b)||b<0,w=Mi(f),k=Eo(f),N=yu(f,f.tooltip.settings.shared);if(p==="Enter"){if(S)return;var E=nh(f,N,"hover",String(m.index));t.dispatch(rh({active:!m.active,activeIndex:m.index,activeCoordinate:E}));return}var A=ZW(f),C=A==="left-to-right"?1:-1,_=p==="ArrowRight"?1:-1,O;if(S){var D=qs(f),B=Qs(f),z=_*C,$=pe=>({active:!1,index:String(pe),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(O=-1,z>0){for(var K=0;K=0;W--)if(wc($(W),k,D,B)!=null){O=W;break}if(O<0)return}else{O=b+_*C;var ve=(w==null?void 0:w.length)||k.length;if(ve===0||O>=ve||O<0)return}var ue=nh(f,N,"hover",String(O));t.dispatch(rh({active:!0,activeIndex:O.toString(),activeCoordinate:ue}))}finally{ps=null,Ka=null}};if(!c){u();return}i==="raf"?ps=requestAnimationFrame(u):typeof i=="number"&&Ka===null&&(u(),ef=null,Ka=setTimeout(()=>{ef?u():(Ka=null,ps=null)},i))}});dm.startListening({actionCreator:bO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var i=r.tooltip.keyboardInteraction;if(!i.active&&i.index==null){var o="0",c=yu(r,r.tooltip.settings.shared),u=nh(r,c,"hover",String(o));t.dispatch(rh({active:!0,activeIndex:o,activeCoordinate:u}))}}}});dm.startListening({actionCreator:wO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var i=r.tooltip.keyboardInteraction;i.active&&t.dispatch(rh({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function kO(e){e.persist();var t=e.currentTarget;return new Proxy(e,{get:(r,n)=>{if(n==="currentTarget")return t;var i=Reflect.get(r,n);return typeof i=="function"?i.bind(r):i}})}var Zr=Br("externalEvent"),jO=ou(),tf=new Map,fc=new Map,Zg=new Map;jO.startListening({actionCreator:Zr,effect:(e,t)=>{var r=e.payload,n=r.handler,i=r.reactEvent;if(n!=null){var o=i.type,c=kO(i);Zg.set(o,{handler:n,reactEvent:c});var u=tf.get(o);u!==void 0&&(cancelAnimationFrame(u),tf.delete(o));var f=t.getState(),h=f.eventSettings,m=h.throttleDelay,p=h.throttledEvents,v=p,b=v==="all"||(v==null?void 0:v.includes(o)),S=fc.get(o);S!==void 0&&(typeof m!="number"||!b)&&(clearTimeout(S),fc.delete(o));var w=()=>{var E=Zg.get(o);try{if(!E)return;var A=E.handler,C=E.reactEvent,_=t.getState(),O={activeCoordinate:JH(_),activeDataKey:YH(_),activeIndex:Gc(_),activeLabel:m3(_),activeTooltipIndex:Gc(_),isTooltipActive:eK(_)};A&&A(O,C)}finally{tf.delete(o),fc.delete(o),Zg.delete(o)}};if(!b){w();return}if(m==="raf"){var k=requestAnimationFrame(w);tf.set(o,k)}else if(typeof m=="number"){if(!fc.has(o)){w();var N=setTimeout(w,m);fc.set(o,N)}}else w()}}});var NZ=Q([dl],e=>e.tooltipItemPayloads),EZ=Q([NZ,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var n=e.find(o=>o.settings.graphicalItemId===r);if(n!=null){var i=n.getPosition;if(i!=null)return i(t)}}}),SO=Br("touchMove"),NO=ou(),Ga=null,ra=null,pN=null,hc=null;NO.startListening({actionCreator:SO,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){hc=kO(r);var n=t.getState(),i=n.eventSettings,o=i.throttleDelay,c=i.throttledEvents,u=c==="all"||c.includes("touchmove");Ga!==null&&(cancelAnimationFrame(Ga),Ga=null),ra!==null&&(typeof o!="number"||!u)&&(clearTimeout(ra),ra=null),pN=Array.from(r.touches).map(h=>Ay({clientX:h.clientX,clientY:h.clientY,currentTarget:r.currentTarget}));var f=()=>{if(hc!=null){var h=t.getState(),m=yu(h,h.tooltip.settings.shared);if(m==="axis"){var p,v=(p=pN)===null||p===void 0?void 0:p[0];if(v==null){Ga=null,ra=null;return}var b=Ey(h,v);(b==null?void 0:b.activeIndex)!=null&&t.dispatch(t3({activeIndex:b.activeIndex,activeDataKey:void 0,activeCoordinate:b.activeCoordinate}))}else if(m==="item"){var S,w=hc.touches[0];if(document.elementFromPoint==null||w==null)return;var k=document.elementFromPoint(w.clientX,w.clientY);if(!k||!k.getAttribute)return;var N=k.getAttribute(Dz),E=(S=k.getAttribute(Lz))!==null&&S!==void 0?S:void 0,A=Io(h).find(O=>O.id===E);if(N==null||A==null||E==null)return;var C=A.dataKey,_=EZ(h,N,E);t.dispatch(oH({activeDataKey:C,activeIndex:N,activeCoordinate:_,activeGraphicalItemId:E}))}Ga=null,ra=null}};if(!u){f();return}o==="raf"?Ga=requestAnimationFrame(f):typeof o=="number"&&ra===null&&(f(),hc=null,ra=setTimeout(()=>{hc?f():(ra=null,Ga=null)},o))}}});var EO={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},AO=ur({name:"eventSettings",initialState:EO,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),AZ=AO.actions.setEventSettings,CZ=AO.reducer,PZ=nA({brush:rQ,cartesianAxis:Vq,chartData:XK,errorBars:uY,eventSettings:CZ,graphicalItems:Sq,layout:yz,legend:I8,options:VK,polarAxis:LV,polarOptions:SZ,referenceElements:oQ,renderedTicks:CQ,rootProps:bZ,tooltip:lH,zIndex:TK}),OZ=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return H6({reducer:PZ,preloadedState:t,middleware:n=>{var i;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([pO.middleware,gO.middleware,dm.middleware,jO.middleware,NO.middleware])},enhancers:n=>{var i=n;return typeof n=="function"&&(i=n()),i.concat(xA({type:"raf"}))},devTools:{serialize:{replacer:yZ},name:"recharts-".concat(r)}})};function _Z(e){var t=e.preloadedState,r=e.children,n=e.reduxStoreName,i=Or(),o=x.useRef(null);if(i)return r;o.current==null&&(o.current=OZ(t,n));var c=r0;return x.createElement(Q8,{context:c,store:o.current},r)}function MZ(e){var t=e.layout,r=e.margin,n=At(),i=Or();return x.useEffect(()=>{i||(n(gz(t)),n(pz(r)))},[n,i,t,r]),null}var IZ=x.memo(MZ,Kh);function TZ(e){var t=At();return x.useEffect(()=>{t(wZ(e))},[t,e]),null}var DZ=e=>{var t=At();return x.useEffect(()=>{t(AZ(e))},[t,e]),null},LZ=x.memo(DZ,Kh);function gN(e){var t=e.zIndex,r=e.isPanorama,n=x.useRef(null),i=At();return x.useLayoutEffect(()=>(n.current&&i(MK({zIndex:t,element:n.current,isPanorama:r})),()=>{i(IK({zIndex:t,isPanorama:r}))}),[i,t,r]),x.createElement("g",{tabIndex:-1,ref:n,className:"recharts-zIndex-layer_".concat(t)})}function vN(e){var t=e.children,r=e.isPanorama,n=Me(jK);if(!n||n.length===0)return t;var i=n.filter(c=>c<0),o=n.filter(c=>c>0);return x.createElement(x.Fragment,null,i.map(c=>x.createElement(gN,{key:c,zIndex:c,isPanorama:r})),t,o.map(c=>x.createElement(gN,{key:c,zIndex:c,isPanorama:r})))}var RZ=["children"];function $Z(e,t){if(e==null)return{};var r,n,i=zZ(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var r=BA(),n=UA(),i=XA();if(!qn(r)||!qn(n))return null;var o=e.children,c=e.otherAttributes,u=e.title,f=e.desc,h,m;return c!=null&&(typeof c.tabIndex=="number"?h=c.tabIndex:h=i?0:void 0,typeof c.role=="string"?m=c.role:m=i?"application":void 0),x.createElement(wE,uh({},c,{title:u,desc:f,role:m,tabIndex:h,width:r,height:n,style:FZ,ref:t}),o)}),UZ=e=>{var t=e.children,r=Me(Fh);if(!r)return null;var n=r.width,i=r.height,o=r.y,c=r.x;return x.createElement(wE,{width:n,height:i,x:c,y:o},t)},xN=x.forwardRef((e,t)=>{var r=e.children,n=$Z(e,RZ),i=Or();return i?x.createElement(UZ,null,x.createElement(vN,{isPanorama:!0},r)):x.createElement(BZ,uh({ref:t},n),x.createElement(vN,{isPanorama:!1},r))});function WZ(e,t){return VZ(e)||GZ(e,t)||KZ(e,t)||HZ()}function HZ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KZ(e,t){if(e){if(typeof e=="string")return yN(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?yN(e,t):void 0}}function yN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(n!=null){var c=n.getBoundingClientRect(),u=c.width/n.offsetWidth;He(u)&&u!==o&&e(xz(u))}},[n,e,o]),i}function bN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function QZ(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r(sG(),null);function fh(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var iX=x.forwardRef((e,t)=>{var r,n,i=x.useRef(null),o=x.useState({containerWidth:fh((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:fh((n=e.style)===null||n===void 0?void 0:n.height)}),c=dh(o,2),u=c[0],f=c[1],h=x.useCallback((p,v)=>{f(b=>{var S=Math.round(p),w=Math.round(v);return b.containerWidth===S&&b.containerHeight===w?b:{containerWidth:S,containerHeight:w}})},[]),m=x.useCallback(p=>{if(typeof t=="function"&&t(p),i.current!=null&&(i.current.disconnect(),i.current=null),p!=null&&typeof ResizeObserver<"u"){var v=p.getBoundingClientRect(),b=v.width,S=v.height;h(b,S);var w=N=>{var E=N[0];if(E!=null){var A=E.contentRect,C=A.width,_=A.height;h(C,_)}},k=new ResizeObserver(w);k.observe(p),i.current=k}},[t,h]);return x.useEffect(()=>()=>{var p=i.current;p!=null&&p.disconnect()},[h]),x.createElement(x.Fragment,null,x.createElement(lu,{width:u.containerWidth,height:u.containerHeight}),x.createElement("div",wa({ref:m},e)))}),aX=x.forwardRef((e,t)=>{var r=e.width,n=e.height,i=x.useState({containerWidth:fh(r),containerHeight:fh(n)}),o=dh(i,2),c=o[0],u=o[1],f=x.useCallback((m,p)=>{u(v=>{var b=Math.round(m),S=Math.round(p);return v.containerWidth===b&&v.containerHeight===S?v:{containerWidth:b,containerHeight:S}})},[]),h=x.useCallback(m=>{if(typeof t=="function"&&t(m),m!=null){var p=m.getBoundingClientRect(),v=p.width,b=p.height;f(v,b)}},[t,f]);return x.createElement(x.Fragment,null,x.createElement(lu,{width:c.containerWidth,height:c.containerHeight}),x.createElement("div",wa({ref:h},e)))}),oX=x.forwardRef((e,t)=>{var r=e.width,n=e.height;return x.createElement(x.Fragment,null,x.createElement(lu,{width:r,height:n}),x.createElement("div",wa({ref:t},e)))}),sX=x.forwardRef((e,t)=>{var r=e.width,n=e.height;return typeof r=="string"||typeof n=="string"?x.createElement(aX,wa({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?x.createElement(oX,wa({},e,{width:r,height:n,ref:t})):x.createElement(x.Fragment,null,x.createElement(lu,{width:r,height:n}),x.createElement("div",wa({ref:t},e)))});function lX(e){return e?iX:sX}var cX=x.forwardRef((e,t)=>{var r=e.children,n=e.className,i=e.height,o=e.onClick,c=e.onContextMenu,u=e.onDoubleClick,f=e.onMouseDown,h=e.onMouseEnter,m=e.onMouseLeave,p=e.onMouseMove,v=e.onMouseUp,b=e.onTouchEnd,S=e.onTouchMove,w=e.onTouchStart,k=e.style,N=e.width,E=e.responsive,A=e.dispatchTouchEvents,C=A===void 0?!0:A,_=x.useRef(null),O=At(),D=x.useState(null),B=dh(D,2),z=B[0],$=B[1],K=x.useState(null),W=dh(K,2),ve=W[0],ue=W[1],pe=qZ(),oe=c0(),le=(oe==null?void 0:oe.width)>0?oe.width:N,Z=(oe==null?void 0:oe.height)>0?oe.height:i,ie=x.useCallback(_e=>{pe(_e),typeof t=="function"&&t(_e),$(_e),ue(_e),_e!=null&&(_.current=_e)},[pe,t,$,ue]),te=x.useCallback(_e=>{O(mO(_e)),O(Zr({handler:o,reactEvent:_e}))},[O,o]),I=x.useCallback(_e=>{O(jx(_e)),O(Zr({handler:h,reactEvent:_e}))},[O,h]),M=x.useCallback(_e=>{O(e3()),O(Zr({handler:m,reactEvent:_e}))},[O,m]),U=x.useCallback(_e=>{O(jx(_e)),O(Zr({handler:p,reactEvent:_e}))},[O,p]),ne=x.useCallback(()=>{O(bO())},[O]),ee=x.useCallback(()=>{O(wO())},[O]),X=x.useCallback(_e=>{O(yO(_e.key))},[O]),ae=x.useCallback(_e=>{O(Zr({handler:c,reactEvent:_e}))},[O,c]),me=x.useCallback(_e=>{O(Zr({handler:u,reactEvent:_e}))},[O,u]),re=x.useCallback(_e=>{O(Zr({handler:f,reactEvent:_e}))},[O,f]),ye=x.useCallback(_e=>{O(Zr({handler:v,reactEvent:_e}))},[O,v]),Oe=x.useCallback(_e=>{O(Zr({handler:w,reactEvent:_e}))},[O,w]),fe=x.useCallback(_e=>{C&&O(SO(_e)),O(Zr({handler:S,reactEvent:_e}))},[O,C,S]),Xe=x.useCallback(_e=>{O(Zr({handler:b,reactEvent:_e}))},[O,b]),Ue=lX(E);return x.createElement(k3.Provider,{value:z},x.createElement(jR.Provider,{value:ve},x.createElement(Ue,{width:le??(k==null?void 0:k.width),height:Z??(k==null?void 0:k.height),className:nt("recharts-wrapper",n),style:QZ({position:"relative",cursor:"default",width:le,height:Z},k),onClick:te,onContextMenu:ae,onDoubleClick:me,onFocus:ne,onBlur:ee,onKeyDown:X,onMouseDown:re,onMouseEnter:I,onMouseLeave:M,onMouseMove:U,onMouseUp:ye,onTouchEnd:Xe,onTouchMove:fe,onTouchStart:Oe,ref:ie},x.createElement(nX,null),r)))}),uX=["width","height","responsive","children","className","style","compact","title","desc"];function dX(e,t){if(e==null)return{};var r,n,i=fX(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var r=e.width,n=e.height,i=e.responsive,o=e.children,c=e.className,u=e.style,f=e.compact,h=e.title,m=e.desc,p=dX(e,uX),v=Sn(p);return f?x.createElement(x.Fragment,null,x.createElement(lu,{width:r,height:n}),x.createElement(xN,{otherAttributes:v,title:h,desc:m},o)):x.createElement(cX,{className:c,style:u,width:r,height:n,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},x.createElement(xN,{otherAttributes:v,title:h,desc:m,ref:t},x.createElement(hQ,null,o)))});function Sx(){return Sx=Object.assign?Object.assign.bind():function(e){for(var t=1;tx.createElement(bX,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:wX,tooltipPayloadSearcher:KK,categoricalChartProps:e,ref:t}));const jX="rgba(130,130,150,0.14)",jN="rgba(130,130,150,0.85)";function SX(e){if(e<=0)return 10;const t=Math.pow(10,Math.floor(Math.log10(e))),r=e/t;return(r<=1?1:r<=2?2:r<=5?5:10)*t}function CO(e,t){return`${t==="%"?Math.round(e):e>=1e3?`${(e/1e3).toFixed(1)}k`:Math.round(e).toString()}${t}`}function NX({active:e,payload:t,unit:r}){return!e||!(t!=null&&t.length)?null:l.jsx("div",{className:"rounded-lg border border-border/70 bg-popover/95 px-3 py-2 shadow-xl backdrop-blur",children:l.jsx("div",{className:"space-y-1",children:t.map(n=>l.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono",children:[l.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:n.color}}),l.jsx("span",{className:"uppercase tracking-wider text-muted-foreground",children:n.name}),l.jsx("span",{className:"ml-auto pl-3 font-bold tabular-nums text-foreground",children:CO(n.value,r)})]},n.dataKey))})})}function PO({data:e,series:t,unit:r="%",yMode:n="percent",height:i=176}){const o=e.reduce((u,f)=>t.reduce((h,m)=>Math.max(h,Number(f[m.key])||0),u),0),c=n==="percent"?Math.min(100,Math.max(25,Math.ceil(o*1.2/25)*25)):Math.max(SX(o*1.15),10);return l.jsx("div",{style:{height:i},className:"w-full",children:l.jsx(p8,{width:"100%",height:"100%",children:l.jsxs(kX,{data:e,margin:{top:8,right:6,bottom:0,left:-12},children:[l.jsx("defs",{children:t.map(u=>l.jsxs("linearGradient",{id:`grad-${u.key}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[l.jsx("stop",{offset:"0%",stopColor:u.color,stopOpacity:.22}),l.jsx("stop",{offset:"100%",stopColor:u.color,stopOpacity:0})]},u.key))}),l.jsx(J3,{vertical:!1,stroke:jX}),l.jsx(fO,{dataKey:"t",hide:!0}),l.jsx(hO,{domain:[0,c],ticks:[0,c/2,c],tickFormatter:u=>CO(u,r),width:42,axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:jN}}),l.jsx(bG,{content:l.jsx(NX,{unit:r}),cursor:{stroke:jN,strokeOpacity:.4,strokeDasharray:"3 3"}}),t.map(u=>l.jsx(uO,{type:"monotone",dataKey:u.key,name:u.label,stroke:u.color,strokeWidth:2,fill:`url(#grad-${u.key})`,dot:!1,activeDot:{r:3,strokeWidth:0},isAnimationActive:!1,connectNulls:!0},u.key))]})})})}const EX=[{key:"cpu",label:"CPU",color:"#2dd4bf"},{key:"ram",label:"RAM",color:"#38bdf8"},{key:"gpu",label:"GPU",color:"#a78bfa"},{key:"disk",label:"Disk",color:"#fbbf24"}];function OO(){var c,u,f,h;const{sys:e,hist:t}=fR(),r=!!(e!=null&&e.gpu&&e.gpu.busy_percent!=null&&e.gpu.gtt_used!=null&&e.gpu.gtt_total!=null),n=EX.filter(m=>m.key!=="gpu"||r),i={cpu:(c=e==null?void 0:e.cpu)==null?void 0:c.percent,ram:(u=e==null?void 0:e.ram)==null?void 0:u.percent,gpu:r?e.gpu.busy_percent:null,disk:(f=e==null?void 0:e.disk)==null?void 0:f.percent},o={cpu:(h=e==null?void 0:e.cpu)!=null&&h.cores?`${e.cpu.cores} Cores`:"",ram:e?`${Jr(e.ram.used)}/${Jr(e.ram.total)} GB`:"",gpu:r?`${Jr(e.gpu.gtt_used)}/${Jr(e.gpu.gtt_total)} GB`:"",disk:e!=null&&e.disk?`${Jr(e.disk.used)}/${Jr(e.disk.total)} GB`:""};return l.jsxs("div",{className:"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:"mb-3 flex items-center gap-2",children:[l.jsx(wi,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"System-Status"}),l.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]})]}),e?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"mb-2 grid grid-cols-2 gap-x-4 gap-y-1.5",children:n.map(m=>l.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[l.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full",style:{background:m.color}}),l.jsx("span",{className:"shrink-0 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:m.label}),l.jsxs("span",{className:"shrink-0 font-mono text-xs font-bold tabular-nums text-foreground",children:[Math.round(i[m.key]??0),"%"]}),o[m.key]&&l.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground/60",children:o[m.key]})]},m.key))}),l.jsx(PO,{data:t,series:n,unit:"%",yMode:"percent",height:176})]}):l.jsx("div",{className:"flex h-44 items-center justify-center text-xs text-muted-foreground",children:"Lade Systemdaten…"})]}),(e==null?void 0:e.temp)&&(e.temp.cpu||e.temp.gpu)&&l.jsxs("div",{className:"mt-3 flex gap-4 border-t border-border/30 pt-3 font-mono text-xs text-muted-foreground/80",children:[e.temp.cpu!=null&&l.jsxs("span",{children:["CPU Temp: ",e.temp.cpu," °C"]}),e.temp.gpu!=null&&l.jsxs("span",{children:["GPU Temp: ",e.temp.gpu," °C"]})]})]})}const SN=[{key:"prompt",label:"Prompt",color:"#f59e0b"},{key:"completion",label:"Antwort",color:"#2dd4bf"}];function _O(){const{data:e}=sE(3e3),t=sR(),r=t[t.length-1],n=r?Math.round(r.prompt+r.completion):0;return l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[l.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(mh,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"Token-Durchsatz"}),l.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]})]}),e&&l.jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[l.jsx("span",{className:"font-space text-3xl font-bold tracking-tight text-foreground tabular-nums",children:n.toLocaleString("de-DE")}),l.jsx("span",{className:"text-xs text-muted-foreground",children:"tok/s aktuell"})]}),e&&l.jsxs("div",{className:"mt-0.5 space-y-0.5 font-mono text-[11px] text-muted-foreground/70",children:[l.jsxs("div",{children:[e.total_tokens.toLocaleString("de-DE")," Tokens gesamt · ",l.jsxs("span",{className:"text-emerald-400/90",children:[e.saved_eur.toLocaleString("de-DE",{minimumFractionDigits:2})," € gespart"]})]}),l.jsxs("div",{className:"text-muted-foreground/55",children:["Input ",e.prompt_tokens.toLocaleString("de-DE")," · Output ",e.completion_tokens.toLocaleString("de-DE")]})]})]}),l.jsx("div",{className:"flex shrink-0 flex-col items-end gap-1.5 pt-1",children:SN.map(i=>l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:i.color}}),l.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:i.label}),l.jsx("span",{className:"font-mono text-xs font-bold tabular-nums text-foreground",children:Math.round((r==null?void 0:r[i.key])??0)})]},i.key))})]}),e?l.jsx(PO,{data:t,series:SN,unit:" tok/s",yMode:"auto",height:150}):l.jsx("div",{className:"flex h-[150px] items-center justify-center text-xs text-muted-foreground",children:"Lade Durchsatz…"}),l.jsx("div",{className:"mt-2 border-t border-border/30 pt-2 text-[10px] text-muted-foreground/70",children:"Durchsatz aus dem Gateway abgeleitet (Prefill vs. Generierung). Flach bei Leerlauf."})]})}function AX(){const{data:e}=kh(3e4),{data:t}=Ei(),r=((e==null?void 0:e.os)||0)+((e==null?void 0:e.engine)||0)+((e==null?void 0:e.swap)||0)+((e==null?void 0:e.models)||0),n=()=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:"maintenance"}})),i=(t==null?void 0:t.models)??[],o=(t==null?void 0:t.running)??[],c=i.find(m=>m.role==="hermes"),u=i.find(m=>m.role==="coder-lite")||i.find(m=>m.role==="coder"),f=m=>m?o.includes(m):!1,h=m=>{var p;return((p=m==null?void 0:m.split("/").pop())==null?void 0:p.replace(/\.gguf$/i,""))||"—"};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:"Basisstation"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Geht's der Box gut, gibt's Updates, was läuft gerade."})]}),l.jsx(uR,{frame:"box"}),l.jsxs("button",{onClick:n,className:J("w-full flex items-center gap-3 rounded-2xl border p-4 text-left transition-all cursor-pointer",r>0?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10":"border-border/60 bg-card/45 hover:border-primary/40"),children:[r>0?l.jsx(LM,{className:"h-6 w-6 shrink-0 text-amber-400"}):l.jsx(Mt,{className:"h-6 w-6 shrink-0 text-emerald-400"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:J("text-sm font-semibold",r>0?"text-amber-400":"text-foreground"),children:r>0?`${r} Update${r===1?"":"s"} verfügbar`:"Alles aktuell"}),l.jsx("div",{className:"text-xs text-muted-foreground",children:r>0?"Antippen, um zu sehen, was genau aktualisiert wird.":"Keine ausstehenden Updates."})]}),r>0&&l.jsxs("span",{className:"shrink-0 flex items-center gap-1 text-xs font-semibold text-amber-400",children:["Ansehen ",l.jsx(bi,{className:"h-4 w-4"})]})]}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs text-muted-foreground mb-2",children:"Was gerade läuft"}),l.jsx("div",{className:"rounded-2xl border border-border/60 overflow-hidden",children:[{icon:wi,label:"Lucys Hirn",model:c==null?void 0:c.name,warm:f(c==null?void 0:c.name)},{icon:zs,label:"Coder (Vibe-Coding)",model:u==null?void 0:u.name,warm:f(u==null?void 0:u.name)}].map(m=>l.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border/40 last:border-0",children:[l.jsx("span",{className:J("h-2 w-2 shrink-0 rounded-full",m.warm?"bg-emerald-500 animate-pulse":"bg-muted-foreground/40")}),l.jsx(m.icon,{className:"h-4 w-4 text-muted-foreground shrink-0"}),l.jsx("span",{className:"text-sm text-foreground w-40 shrink-0",children:m.label}),l.jsx("span",{className:"text-xs text-muted-foreground flex-1 truncate font-mono",children:h(m.model)}),l.jsx("span",{className:J("text-xs shrink-0",m.warm?"text-emerald-400":"text-muted-foreground"),children:m.model?m.warm?"warm":"bereit":"nicht gesetzt"})]},m.label))})]}),l.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[l.jsx(OO,{}),l.jsx(_O,{})]})]})}const CX=e=>!!dt(e).protected;function PX({role:e,roleRec:t,models:r,onAssign:n,onClose:i}){var f,h;const o=t&&t.role===e?t:null,c={};o==null||o.models.forEach(m=>{c[m.name]=m});const u=o?o.models.map(m=>r.find(p=>p.name===m.name)).filter(Boolean):r;return l.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4 overscroll-contain",role:"dialog","aria-modal":"true","aria-label":`${dt(e).label} konfigurieren`,children:l.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[l.jsx(po,{role:e})," festlegen"]}),l.jsx("button",{onClick:i,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:l.jsx(nn,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Wähle ein Modell für ",l.jsx("strong",{className:"text-foreground",children:dt(e).label}),l.jsx("span",{className:"block text-[10px] text-muted-foreground/70 mt-0.5",children:dt(e).desc})]}),(o==null?void 0:o.recommended)&&l.jsxs("button",{onClick:()=>n(o.recommended),title:(f=c[o.recommended])==null?void 0:f.reason,className:"shrink-0 h-7 px-3 text-[11px] font-semibold text-primary border border-primary/50 bg-primary/10 hover:bg-primary/20 rounded-lg cursor-pointer flex items-center gap-1",children:[l.jsx(ka,{className:"h-3 w-3"})," Auto: ",(h=o.recommended.split("/").pop())==null?void 0:h.replace(/\.gguf$/i,"")]})]}),l.jsxs("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:[CX(e)?l.jsx("div",{className:"w-full px-3 py-2 rounded-lg text-[11px] text-muted-foreground border border-border/30 bg-background/20 flex items-center gap-1.5",children:"🔒 Diese Rolle ist lebenswichtig und kann nicht leer bleiben — wähle stattdessen ein anderes Modell."}):l.jsx("button",{onClick:()=>n(""),className:"w-full text-left px-3 py-2 rounded-lg text-xs hover:bg-accent text-red-400 font-semibold cursor-pointer border border-red-500/20 bg-red-500/5 flex items-center justify-between",children:l.jsx("span",{children:"Zuweisung entfernen"})}),u.map(m=>{var w;const p=c[m.name],v=m.role===e,b=!!(p!=null&&p.recommended),S=!!p&&!p.suitable;return l.jsxs("button",{onClick:()=>n(m.name),className:J("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border",b?"border-primary/50 bg-primary/10":v?"text-primary font-bold bg-primary/5 border-primary/30":S?"border-border/20 bg-background/10 opacity-60":"text-foreground bg-background/20 border-border/30"),children:[l.jsxs("div",{className:"flex flex-col text-left min-w-0",children:[l.jsxs("span",{className:"truncate max-w-[260px] font-semibold flex items-center gap-1.5",children:[(w=m.name.split("/").pop())==null?void 0:w.replace(/\.gguf$/i,""),b&&l.jsx("span",{className:"text-[8px] font-bold uppercase tracking-wide text-primary bg-primary/15 px-1.5 py-0.5 rounded",children:"Empfohlen"})]}),l.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:p?`${p.params_b}B · ${m.quant} · ${p.reason}`:`${lr(m.size_bytes)} · ${m.quant}`})]}),v&&l.jsx(Mt,{className:"h-4 w-4 shrink-0 text-primary"})]},m.name)})]})]})})}const OX=["fast","heavy","heavy_chars"],_X=["coder_lite","coder","coding_escalate_chars"];function MX(){const e=Wr(),{data:t,isLoading:r}=gL(),[n,i]=x.useState(null),[o,c]=x.useState(!1),[u,f]=x.useState(""),[h,m]=x.useState(0);if(x.useEffect(()=>{t!=null&&t.policy&&!n&&i({...t.policy})},[t,n]),r||!t||!n)return l.jsx("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 text-xs text-muted-foreground",children:"Lade Routing-Policy…"});const p=N=>t.fields.find(E=>E.key===N),v=Object.keys(n).some(N=>n[N]!==t.policy[N]),b=(N,E)=>{i(A=>A&&{...A,[N]:E}),f("")},S=N=>b(N,t.defaults[N]);async function w(){if(!n)return;const N={};for(const E of Object.keys(n))n[E]!==t.policy[E]&&(N[E]=n[E]);if(Object.keys(N).length!==0){c(!0),f("");try{const{policy:E}=await uL(N);i({...E}),e.invalidateQueries({queryKey:$e.routingPolicy}),e.invalidateQueries({queryKey:$e.routing}),m(Date.now()),setTimeout(()=>m(0),2e3)}catch(E){f(E.message||String(E))}finally{c(!1)}}}function k({k:N}){const E=p(N),A=n[N],C=n[N]===t.defaults[N];return l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("label",{className:"text-[10px] font-semibold text-muted-foreground",children:E.label}),!C&&l.jsxs("button",{onClick:()=>S(N),className:"flex items-center gap-0.5 text-[9px] text-muted-foreground/60 hover:text-foreground transition-colors cursor-pointer",title:`Auf Default zurücksetzen (${String(t.defaults[N])||"leer"})`,children:[l.jsx(Rx,{className:"h-2.5 w-2.5"})," Default"]})]}),E.type==="bool"?l.jsxs("button",{onClick:()=>b(N,!A),className:J("flex h-8 w-full items-center justify-between rounded-lg border px-3 text-[11px] font-semibold transition-all cursor-pointer",A?"border-emerald-500/40 bg-emerald-500/10 text-emerald-300":"border-border/40 bg-background/40 text-muted-foreground"),children:[l.jsx("span",{children:A?"An":"Aus"}),l.jsx("span",{className:J("h-3.5 w-3.5 rounded-full transition-colors",A?"bg-emerald-400":"bg-muted-foreground/40")})]}):E.type==="int"?l.jsx("input",{type:"number",value:A,min:E.min,max:E.max,"aria-label":E.label,onChange:_=>b(N,Number(_.target.value)),className:"h-8 w-full rounded-lg border border-border/40 bg-background/40 px-3 font-mono text-[11px] text-foreground outline-none focus:border-primary/50"}):l.jsx("input",{type:"text",value:A,"aria-label":E.label,spellCheck:!1,placeholder:N==="coder_lite"?"(leer = aus)":"",onChange:_=>b(N,_.target.value),className:"h-8 w-full rounded-lg border border-border/40 bg-background/40 px-3 font-mono text-[11px] text-foreground outline-none focus:border-primary/50"})]})}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 gap-3 flex-wrap",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(xI,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Lane-Routing & Policy"}),l.jsx("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded bg-emerald-500/10 text-emerald-300 border border-emerald-500/20",children:"hot-reload"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[u&&l.jsx("span",{className:"text-[10px] text-red-400 max-w-[280px] truncate",title:u,children:u}),h>0&&l.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-emerald-400",children:[l.jsx(Mt,{className:"h-3.5 w-3.5"})," gespeichert"]}),l.jsxs("button",{onClick:w,disabled:!v||o,className:J("h-8 px-4 rounded-lg text-[10px] font-bold uppercase tracking-wide transition-all flex items-center gap-1.5",v&&!o?"bg-primary text-primary-foreground hover:opacity-90 cursor-pointer shadow-md shadow-primary/10":"bg-background/40 text-muted-foreground/50 border border-border/40 cursor-not-allowed"),children:[o?l.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):null,"Speichern"]})]})]}),l.jsxs("p",{className:"text-[10px] text-muted-foreground/70 leading-relaxed -mt-1",children:["Welches echte Modell hinter den virtuellen Lanes ",l.jsx("code",{className:"text-cyan-300",children:"chat"})," und"," ",l.jsx("code",{className:"text-cyan-300",children:"coding"})," steckt. Änderungen greifen sofort (kein Neustart). Die Keyword-Heuristiken bleiben im Code."]}),l.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[l.jsxs("div",{className:"rounded-xl border border-border/40 bg-background/25 p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 border-b border-border/30 pb-2",children:[l.jsx(iI,{className:"h-4 w-4 text-teal-400"}),l.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider text-foreground",children:"chat"}),l.jsx("span",{className:"text-[9px] text-muted-foreground/60 font-mono",children:"(= auto)"})]}),OX.map(N=>l.jsx(k,{k:N},N))]}),l.jsxs("div",{className:"rounded-xl border border-border/40 bg-background/25 p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center gap-2 border-b border-border/30 pb-2",children:[l.jsx(FM,{className:"h-4 w-4 text-indigo-400"}),l.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider text-foreground",children:"coding"}),l.jsx("span",{className:"text-[9px] text-muted-foreground/60 font-mono",children:"(agentisch → immer Coder)"})]}),_X.map(N=>l.jsx(k,{k:N},N))]})]}),l.jsx("div",{className:"rounded-xl border border-border/40 bg-background/25 p-4",children:l.jsx("div",{className:"max-w-xs",children:l.jsx(k,{k:"fast_no_think"})})})]})}function IX(){var ve,ue,pe;const e=Wr(),{data:t}=Ei(4e3),{data:r}=Gx(),{data:n}=Po(),{data:i}=lE(),{showAlert:o,dialogElement:c}=An(),[u,f]=x.useState(!1),[h,m]=x.useState(!1),p=(t==null?void 0:t.models)??[],v=(t==null?void 0:t.running)??[],b=(ve=r==null?void 0:r.groups)==null?void 0:ve.brains,S=(b==null?void 0:b.members)??[],w=oe=>p.find(le=>le.name===oe),k=oe=>{var le;return((le=oe.split("/").pop())==null?void 0:le.replace(/\.gguf$/i,""))||oe},N=S.map(w).filter(Boolean),E=1024**3,A=i==null?void 0:i.budget,C=N.reduce((oe,le)=>oe+(le.size_bytes||0),0)/E,_=((ue=n==null?void 0:n.gpu)==null?void 0:ue.gtt_total)||((pe=n==null?void 0:n.gpu)==null?void 0:pe.vram_total)||0,O=(A==null?void 0:A.gtt_gb)||(_?_/E:0),D=(A==null?void 0:A.warm_projected_gb)??C,B=O>0?Math.min(100,D/O*100):0,z=p.filter(oe=>!S.includes(oe.name)&&!oe.incomplete);async function $(oe){m(!0);try{await nE("brains",oe,(b==null?void 0:b.swap)??!1,(b==null?void 0:b.persist)??!0),e.invalidateQueries({queryKey:$e.groups}),e.invalidateQueries({queryKey:$e.models}),e.invalidateQueries({queryKey:$e.hermesBrain})}catch(le){o("Fehler",`Immer-bereit-Set konnte nicht geändert werden: ${(le==null?void 0:le.message)||le}`)}finally{m(!1)}}function K(oe){const le=w(oe);if(le&&dt(le.role).protected){o("Geschützt",`„${dt(le.role).label}" ist lebenswichtig und bleibt immer bereit.`);return}$(S.filter(Z=>Z!==oe))}function W(oe){f(!1),$([...S,oe])}return b?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(NN,{}),l.jsxs("div",{className:"space-y-1.5",children:[N.length===0&&l.jsx("div",{className:"text-xs text-muted-foreground",children:"Noch keine Modelle im Set."}),N.map(oe=>{const le=v.includes(oe.name),Z=dt(oe.role).protected;return l.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-xl border border-border/30 bg-background/20 p-2.5",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[l.jsx("span",{className:J("h-2 w-2 shrink-0 rounded-full ring-2 ring-black/40",le?"bg-emerald-500 animate-pulse":"bg-muted-foreground/40"),title:le?"Gerade warm (bereit)":"Reserviert — lädt bei Bedarf sofort"}),oe.role&&l.jsx(po,{role:oe.role,dense:!0,className:"shrink-0"}),l.jsx("span",{className:"truncate font-mono text-xs font-semibold text-foreground",title:oe.name,children:k(oe.name)}),l.jsx("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:lr(oe.size_bytes)})]}),Z?l.jsx("span",{className:"shrink-0 text-[10px] font-semibold text-muted-foreground",title:"Lebenswichtig — bleibt immer im Set.",children:"🔒"}):l.jsx("button",{onClick:()=>K(oe.name),disabled:h,className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border border-border/40 text-muted-foreground transition-colors hover:bg-red-500/5 hover:text-red-400 cursor-pointer disabled:opacity-50",title:"Aus dem Immer-bereit-Set nehmen (lädt dann nur noch bei Bedarf)",children:l.jsx(nn,{className:"h-3.5 w-3.5"})})]},oe.name)})]}),l.jsxs("button",{onClick:()=>f(!0),disabled:h||z.length===0,className:"flex h-8 w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-border/50 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground transition-colors hover:border-primary/40 hover:text-primary cursor-pointer disabled:opacity-50",children:[l.jsx(Pc,{className:"h-3.5 w-3.5"})," Modell dauerhaft bereithalten"]}),l.jsxs("div",{className:"rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsxs("div",{className:"mb-1.5 flex items-center justify-between text-[11px]",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-semibold uppercase tracking-wider text-muted-foreground",title:"Modellgewichte + KV-Cache, berechnet aus den echten Architektur-Daten jedes Modells (Layer × KV-Köpfe × Kontext) und seiner KV-Quantisierung. So viel legt llama.cpp beim Laden wirklich für den eingestellten Kontext an — kein Aufschlag mehr.",children:[l.jsx(xa,{className:"h-3.5 w-3.5"})," Reserviert fürs Set"]}),l.jsxs("span",{className:"font-mono font-bold text-foreground",children:[D.toFixed(1),O>0?` / ${O.toFixed(0)}`:""," GB"]})]}),l.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full border border-border/30 bg-background/50",children:l.jsx("div",{className:J("h-full rounded-full transition-all duration-500",B>=85?"bg-red-500":B>=65?"bg-amber-500":"bg-teal-500"),style:{width:`${B}%`}})}),A&&!A.fits&&l.jsxs("p",{className:"mt-2 flex items-start gap-1.5 text-[11px] text-amber-400",children:[l.jsx(vr,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),l.jsxs("span",{children:["Zusammen mit dem größten Gelegenheits-Modell (~",A.largest_ondemand_gb," GB) wird der Speicher knapp. Das Set bleibt dabei immer geladen — wird es wirklich eng, schlägt das Laden des großen Modells fehl (es wartet dann, statt das Set zu verdrängen)."]})]}),A&&A.fits&&l.jsxs("p",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-emerald-400",children:[l.jsx(Mt,{className:"h-3.5 w-3.5 shrink-0"})," Passt auch neben dem größten Gelegenheits-Modell — nichts wird verdrängt."]})]}),u&&l.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4 backdrop-blur-sm",role:"dialog","aria-modal":"true","aria-label":"Modell zum Immer-bereit-Set hinzufügen",children:l.jsxs("div",{className:"w-full max-w-md space-y-3 rounded-2xl border border-border/80 bg-card p-6 shadow-2xl animate-in fade-in zoom-in-95 duration-200",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[l.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:"Dauerhaft bereithalten"}),l.jsx("button",{onClick:()=>f(!1),className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground cursor-pointer",children:l.jsx(nn,{className:"h-4 w-4"})})]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Wähle ein Modell, das ohne Ladezeit bereitstehen soll:"}),l.jsx("div",{className:"max-h-60 space-y-1.5 overflow-y-auto pr-1",children:z.map(oe=>l.jsxs("button",{onClick:()=>W(oe.name),className:"flex w-full items-center justify-between gap-2 rounded-lg border border-border/30 bg-background/20 px-3 py-2.5 text-left transition-colors hover:bg-accent cursor-pointer",children:[l.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[oe.role&&l.jsx(po,{role:oe.role,dense:!0,className:"shrink-0"}),l.jsx("span",{className:"truncate font-mono text-xs font-semibold text-foreground",children:k(oe.name)})]}),l.jsx("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:lr(oe.size_bytes)})]},oe.name))})]})}),c]}):l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10",children:[l.jsx(NN,{}),l.jsx("p",{className:"mt-3 text-xs text-muted-foreground",children:"Es gibt noch kein Immer-bereit-Set. Es entsteht automatisch, sobald Lucys Hirn zugewiesen ist."}),c]})}function NN(){return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ka,{className:"h-4.5 w-4.5 text-primary"}),l.jsxs("div",{children:[l.jsx("h2",{className:"text-sm font-bold uppercase tracking-wide text-foreground",children:"Immer-bereit-Set"}),l.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Diese Modelle hält Lucy immer bereit — sie antworten ohne Ladezeit."})]})]})}function TX(){var Ue,_e,wt,tr;const e=Wr(),{data:t,isLoading:r,error:n}=Ei(4e3),{data:i}=kh(4e3),{data:o}=lE(),{data:c}=Po(),{data:u}=Gx(),{showAlert:f,showConfirm:h,showPrompt:m,dialogElement:p}=An(),v=Wx(),b=G=>!!dt(G).protected,S=(t==null?void 0:t.models)??[],w=(t==null?void 0:t.running)??[],k=n?String(n):"",N=()=>{e.invalidateQueries({queryKey:$e.models}),e.invalidateQueries({queryKey:$e.routing})},E=(Ue=u==null?void 0:u.groups)==null?void 0:Ue.brains,A=(E==null?void 0:E.members)??[],C=G=>A.includes(G),_=A.some(G=>w.includes(G));async function O(G){if(!E){f("Keine brains-Gruppe","Es existiert noch keine Ko-Residenz-Gruppe „brains“ in der Engine-Konfiguration. Lege sie erst über die Gruppen-Verwaltung an.");return}const Ce=A.includes(G)?A.filter(Ye=>Ye!==G):[...A,G];try{await nE("brains",Ce,E.swap??!1,E.persist??!0),e.invalidateQueries({queryKey:$e.groups}),N()}catch(Ye){f("Fehler",`Ko-Residenz konnte nicht geändert werden: ${Ye.message||Ye}`)}}const[D,B]=x.useState(null),[z,$]=x.useState(null),[K,W]=x.useState(null),[ve,ue]=x.useState("grid"),[pe,oe]=x.useState("all"),le=S.filter(G=>pe==="in_use"?!!G.role||w.includes(G.name):!0);async function Z(G){try{await xe(`/api/models/${encodeURIComponent(G)}/load`,{method:"POST"}),N()}catch(Ae){f("Fehler",`Fehler beim Laden des Modells: ${Ae.message}`)}}async function ie(G){if(E&&_&&!C(G)){const Ae=A.filter(Ce=>w.includes(Ce)).map(Ce=>Ce.split("/").pop()).join(", ");h("Verdrängt das Hirn?",`„${G.split("/").pop()}“ ist nicht in der Ko-Residenz-Gruppe „brains“. Beim Laden wirft es das aktuell warme Hirn (${Ae}) raus — Lucy verliert Hirn bzw. Augen. Trotzdem exklusiv laden? Tipp: Mit dem 🧠-Schalter machst du das Modell dauerhaft ko-resident, dann bleiben beide warm.`,()=>Z(G));return}Z(G)}async function te(G){const Ae=S.find(Ce=>Ce.name===G);if(Ae&&b(Ae.role)){f("Geschützt",`„${dt(Ae.role).label}" ist lebenswichtig für Lucy und bleibt geladen. Zum Entladen erst im Experten-Modus die Rolle einem anderen Modell geben.`);return}try{await xe(`/api/models/${encodeURIComponent(G)}/unload`,{method:"POST"}),N()}catch(Ce){f("Fehler",`Fehler beim Entladen des Modells: ${Ce.message}`)}}async function I(){try{await xe("/api/models/unload",{method:"POST"}),N()}catch(G){f("Fehler",`Fehler beim Entladen aller Modelle: ${G.message}`)}}async function M(G,Ae){try{const Ce=await xe(`/api/models/${encodeURIComponent(Ae)}/role`,{method:"POST",body:JSON.stringify({role:G||null})});N(),Ce!=null&&Ce.warning&&f("Hirn gesetzt — Hinweis",Ce.warning)}catch(Ce){f("Fehler",`Fehler beim Zuweisen der Rolle: ${Ce.message||Ce}`)}}function U(G){B(G),$(null),xe(`/api/roles/${encodeURIComponent(G)}/recommend`).then(Ae=>$(Ae)).catch(()=>{})}async function ne(G,Ae){let Ce=null;try{Ce=await xe(`/api/models/${encodeURIComponent(G)}/ctx/auto`)}catch{}const Ye=Ce?`Optimal für dein Setup: ${(Ce.ctx/1024).toFixed(0)}k (${Ce.ctx}) — GTT ${Ce.gtt_gb} GB − reserviert ${Ce.reserved_gb} GB (${Ce.mode}) → ${Ce.budget_gb} GB frei. »Auto« trägt diesen Wert ein.`:"Gib die gewünschte Kontextlänge in Tokens an:";m("Kontextlänge anpassen",Ye,String(Ae||32768),async et=>{if(et)try{await xe(`/api/models/${encodeURIComponent(G)}/ctx`,{method:"POST",body:JSON.stringify({ctx:parseInt(et,10)})}),N()}catch(dr){f("Fehler",`Fehler beim Setzen des Kontexts: ${dr.message||dr}`)}},void 0,Ce?{autoValue:String(Ce.ctx),autoLabel:`Auto (${(Ce.ctx/1024).toFixed(0)}k)`}:void 0)}async function ee(G){const Ae=S.find(Ce=>Ce.name===G);if(Ae&&b(Ae.role)){f("Geschützt",`„${dt(Ae.role).label}" ist lebenswichtig für Lucy und kann nicht gelöscht werden. Weise die Rolle zuerst einem anderen Modell zu.`);return}h("Modell löschen?",`Modell '${G}' und alle zugehörigen GGUF-Dateien unwiderruflich von der Box löschen?`,async()=>{try{await xe(`/api/models/${encodeURIComponent(G)}`,{method:"DELETE"}),N()}catch(Ce){f("Fehler",`Fehler beim Löschen: ${Ce.message||Ce}`)}})}async function X(G,Ae,Ce,Ye){try{await xe("/api/models/install",{method:"POST",body:JSON.stringify({repo:G,role:Ae,quant:Ce,jinja:Ye})}),f("Herunterladen gestartet",`Download für '${G}' gestartet! Der Fortschritt wird oben angezeigt.`)}catch(et){f("Fehler",`Fehler beim Starten des Upgrades: ${et.message||et}`)}}async function ae(G){const Ae=o==null?void 0:o.budget,Ce=Ae&&!Ae.fits?` @@ -757,14 +757,14 @@ Trotzdem exklusiv laden? Tipp: Mit dem 🧠-Schalter machst du das Modell dauerh stroke-dasharray: 4 6; animation: flow-dash 1s 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(xa,{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("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["Speicher-Pool: ",lr(re)," Gewichte",Oe>0?` · ${lr(Oe)} real belegt (inkl. KV)`:""," / ",lr(Xe)]}),v&&w.length>0&&l.jsx("button",{onClick:I,className:"h-6 px-2.5 rounded border border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10 text-amber-400 text-[9px] font-bold uppercase transition-all cursor-pointer",children:"Alle entladen"})]})]}),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:me.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"}):me.map((G,Ae)=>{var et;const Ce=(G.size_bytes||0)/Xe*100,Ye=["from-teal-500 to-emerald-500","from-indigo-500 to-blue-500","from-purple-500 to-pink-500","from-cyan-500 to-sky-500"][Ae%4];return l.jsxs("div",{style:{width:`${Ce}%`},className:J("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",Ye),title:`${G.name} (${lr(G.size_bytes)})`,children:[l.jsxs("span",{className:"text-[9px] font-bold truncate max-w-[120px] font-space tracking-wide",children:[G.role?`[${dt(G.role).short}] `:"",(et=G.name.split("/").pop())==null?void 0:et.replace(".gguf","")]}),l.jsx("span",{className:"text-[8px] font-mono opacity-80",children:lr(G.size_bytes)})]},G.name)})})]}),l.jsx(IX,{}),v&&l.jsx(MX,{}),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.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground px-1",children:v?"Gateway Steckplatz-Belegung (Slot-Zuweisung)":"Wer macht was bei Lucy — zum Ändern antippen"}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3",children:jR.map(G=>{var Ye;const Ae=S.find(et=>et.role===G),Ce=Ae?w.includes(Ae.name):!1;return l.jsxs("div",{onClick:()=>U(G),className:J("rounded-xl border p-3 flex flex-col justify-between gap-2.5 transition-all cursor-pointer select-none text-left bg-background/25 hover:border-primary/45 hover:bg-background/40 group min-h-[90px]",Ce?"border-emerald-500/40 shadow-sm shadow-emerald-500/5":Ae?"border-primary/20 bg-primary/5":"border-border/30 border-dashed opacity-75"),children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(po,{role:G}),Ce&&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 text-foreground/90 pr-1 font-space",title:Ae==null?void 0:Ae.name,children:Ae?(Ye=Ae.name.split("/").pop())==null?void 0:Ye.replace(/\.gguf$/i,""):"nicht zugewiesen"}),l.jsx("div",{className:"text-[8px] text-primary/70 group-hover:text-primary font-bold uppercase tracking-wider transition-colors font-space",children:"Ändern ➔"})]},G)})})]}),(o==null?void 0:o.current)&&l.jsxs("div",{className:"rounded-2xl border border-indigo-500/30 bg-indigo-500/5 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[l.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(jn,{className:"h-4.5 w-4.5 text-indigo-400"}),l.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Agent-Hirn (Hermes)"}),o.current.version!=null&&l.jsxs("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded bg-indigo-500/15 text-indigo-300 border border-indigo-500/25",children:["v",o.current.version]})]}),l.jsx("button",{onClick:()=>window.dispatchEvent(new CustomEvent("mc-navigate",{detail:{view:"agent"}})),className:"h-7 px-3 rounded-lg border border-indigo-500/30 bg-indigo-500/5 text-indigo-300 text-[9px] font-bold uppercase hover:bg-indigo-500/15 transition-all cursor-pointer",title:"Hirn-Wechsel passiert jetzt zentral im Hermes-Tab",children:"Im Hermes-Tab wechseln →"})]}),l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-xl bg-background/30 border border-border/30 p-3.5",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:o.current.name,children:o.current.name.split("/").pop()}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 mt-0.5",children:[l.jsx("span",{children:o.current.params_b?`${o.current.params_b}B`:"—"}),l.jsx("span",{children:"•"}),l.jsx("span",{children:o.current.quant||"GGUF"}),l.jsx("span",{children:"•"}),l.jsx("span",{children:lr(o.current.size_bytes||0)})]})]}),o.update_available&&o.recommended?l.jsxs("button",{onClick:()=>ae(o.recommended.repo),className:J("h-8 px-3 shrink-0 flex items-center justify-center gap-1.5 rounded-lg text-[10px] font-bold uppercase transition-all cursor-pointer shadow-md",o.budget&&!o.budget.fits?"bg-red-500 text-white hover:bg-red-400 shadow-red-500/10":"bg-amber-500 text-black hover:bg-amber-400 shadow-amber-500/10"),children:[l.jsx(Fs,{className:"h-3.5 w-3.5"})," Aktualisieren"]}):l.jsxs("span",{className:"h-8 px-3 shrink-0 flex items-center gap-1.5 text-[10px] font-bold text-emerald-400 uppercase tracking-wide bg-emerald-500/5 border border-emerald-500/15 rounded-lg select-none",children:[l.jsx(Mt,{className:"h-4 w-4"})," Neueste Generation"]})]}),o.update_available&&o.recommended&&l.jsxs("div",{className:"text-[10px] text-amber-400/90 flex items-center gap-1.5",children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),"Neuere Generation verfügbar: ",l.jsx("span",{className:"font-mono font-bold",children:o.recommended.name.replace(/-GGUF$/i,"")}),"(v",o.recommended.version,", ",o.recommended.params_b,"B) — von NousResearch."]}),o.budget&&l.jsxs("div",{className:J("text-[10px] flex items-start gap-1.5 leading-relaxed",o.budget.fits?"text-muted-foreground/80":"text-red-400 font-semibold"),children:[l.jsx(xa,{className:"h-3 w-3 shrink-0 mt-0.5"}),l.jsxs("span",{children:["Always-On-Brain ~",o.budget.brain_gb," GB + größtes on-demand (~",o.budget.largest_ondemand_gb," GB) = ",(o.budget.brain_gb+o.budget.largest_ondemand_gb).toFixed(1)," / ",o.budget.gtt_gb," GB",o.budget.fits?" · passt gleichzeitig ✓":" · passt NICHT gleichzeitig ⚠ — heavy/coder würden das Brain verdrängen. Kleineres Brain oder weniger Kontext."]})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 px-1",children:[l.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:["Installierte Modell-Bibliothek (",le.length," von ",S.length,")"]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[l.jsx("button",{onClick:()=>oe("all"),className:J("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",pe==="all"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Vorhanden"}),l.jsx("button",{onClick:()=>oe("in_use"),className:J("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",pe==="in_use"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"In Benutzung"})]}),l.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[l.jsx("button",{onClick:()=>ue("grid"),className:J("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",ve==="grid"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Grid"}),l.jsx("button",{onClick:()=>ue("list"),className:J("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",ve==="list"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"List"})]})]})]}),ve==="grid"?l.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:le.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:pe==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):le.map(G=>{const Ae=w.includes(G.name),Ce=i==null?void 0:i.model_list.find(et=>et.role===G.role),Ye=vf(G.name);return l.jsxs("div",{className:J("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-4 transition-all duration-300 hover:border-primary/40 group relative overflow-hidden",Ae?"border-primary/45 shadow-primary/5":G.role?"border-primary/30 bg-primary/5 shadow-inner":"border-border/60"),children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx("div",{className:"flex items-start justify-between gap-3",children:l.jsxs("div",{className:"flex gap-2.5 min-w-0",children:[l.jsx("div",{className:J("w-7 h-7 rounded-lg border flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",Ye.color),title:Ye.name,children:Ye.initial}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h3",{className:"text-xs font-bold tracking-tight text-foreground line-clamp-2 break-all font-mono",title:G.name,children:G.name.split("/").pop()}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap mt-1",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:G.quant||"GGUF"}),Ae&&l.jsxs("span",{className:"flex items-center gap-1 text-[9px] font-semibold text-emerald-400 uppercase tracking-wider",children:[l.jsx(mh,{className:"h-3 w-3 animate-pulse"})," Warm"]}),G.role&&l.jsx(po,{role:G.role,dense:!0}),b(G.role)&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-background/40 border border-border/40 text-[9px] font-semibold text-muted-foreground",title:"Lebenswichtig für Lucy — geschützt vor Löschen/Entladen.",children:"🔒 geschützt"}),v&&C(G.name)&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-fuchsia-500/10 border border-fuchsia-500/30 text-[9px] font-mono text-fuchsia-300 font-bold uppercase",title:"Ko-resident in der brains-Gruppe — bleibt mit dem Hirn gemeinsam warm, verdrängt es nicht.",children:"🧠 Ko-resident"}),v&&G.prompt_cache&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-cyan-500/10 border border-cyan-500/20 text-[9px] font-mono text-cyan-400 font-bold uppercase",title:"Prompt Caching aktiv",children:"PC"}),v&&(G.spec_active?l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-[9px] font-mono text-emerald-400 font-bold uppercase",title:`Speculative Decoding aktiv (Draft: ${G.spec_draft_model})`,children:"SPEC"}):G.spec_draft_model?l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[9px] font-mono text-amber-400 font-bold uppercase",title:`Draft gesetzt (${G.spec_draft_model}), aber INAKTIV — --spec-type fehlt oder Vocab inkompatibel. Über 'Spec' neu konfigurieren.`,children:"SPEC?"}):null),v&&G.parallel_slots>1&&l.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-violet-500/10 border border-violet-500/20 text-[9px] font-mono text-violet-400 font-bold uppercase",title:`${G.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",G.parallel_slots]}),G.incomplete&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[9px] font-mono text-amber-400 font-bold uppercase",title:"GGUF-Datei fehlt — Modell kann nicht geladen werden",children:"⚠ Datei fehlt"})]})]})]})}),l.jsx("div",{className:"border-t border-border/30 pt-3 flex flex-wrap gap-1",children:l.jsx(Ev,{caps:G.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(xa,{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:lr(G.size_bytes)})]})]}),l.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[l.jsx(l5,{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:Nv(G.ctx)})]})]})]}),Ce&&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: ",Ce.repo.split("/").pop()]})]}),l.jsxs("button",{onClick:()=>X(Ce.repo,G.role,G.quant||"Q4_K_M",G.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(Fs,{className:"h-3 w-3"})," Smart-Swap starten"]})]}),l.jsxs("div",{className:"flex items-center gap-1.5 border-t border-border/20 pt-3 mt-auto",children:[(()=>{const et=b(G.role),dr=Ae&&et,Ti=G.incomplete&&!Ae||dr;return l.jsx("button",{onClick:()=>Ae?te(G.name):ie(G.name),disabled:Ti,title:dr?`„${dt(G.role).label}" bleibt geladen (geschützt).`:void 0,className:J("flex-1 h-7 rounded-lg text-[9px] font-bold uppercase transition-all border flex items-center justify-center gap-1",Ti?"border-border/30 bg-background/10 text-muted-foreground/50 cursor-not-allowed":Ae?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400 cursor-pointer":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary cursor-pointer"),children:dr?"🔒 geladen":Ae?"Entladen":"Laden"})})(),v&&l.jsx("button",{onClick:()=>ne(G.name,G.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),v&&E&&l.jsx("button",{onClick:()=>O(G.name),className:J("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-colors cursor-pointer",C(G.name)?"border-fuchsia-500/40 bg-fuchsia-500/10 text-fuchsia-300 hover:bg-fuchsia-500/20":"border-border/40 text-muted-foreground hover:bg-accent"),title:C(G.name)?"Ko-resident (brains): bleibt mit dem Hirn gemeinsam warm. Klick = aus der Gruppe nehmen.":"Zur brains-Gruppe hinzufügen — lädt dann ko-resident neben dem Hirn, statt es zu verdrängen.",children:"🧠"}),v&&l.jsxs("button",{onClick:()=>W(G),className:J("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-colors cursor-pointer flex items-center gap-1",G.spec_active?"border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10":G.spec_draft_model?"border-amber-500/30 text-amber-400 hover:bg-amber-500/10":"border-border/40 text-muted-foreground hover:bg-accent"),title:"Speculative Draft konfigurieren (Vocab-geprüft)",children:[l.jsx(ka,{className:"h-3 w-3"})," Spec"]}),l.jsx("button",{onClick:()=>ee(G.name),disabled:b(G.role),className:J("h-7 w-7 rounded-lg border border-border/40 flex items-center justify-center transition-colors",b(G.role)?"text-muted-foreground/40 cursor-not-allowed":"text-muted-foreground hover:text-red-400 hover:bg-red-500/5 cursor-pointer"),"aria-label":"Modell löschen",title:b(G.role)?`„${dt(G.role).label}" ist geschützt und kann nicht gelöscht werden.`:"Modell löschen",children:l.jsx(Pc,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]},G.name)})}):l.jsx("div",{className:"space-y-2",children:le.length===0?l.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:pe==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):le.map(G=>{const Ae=w.includes(G.name),Ce=vf(G.name);return l.jsxs("div",{className:J("rounded-xl border bg-card/45 backdrop-blur-md p-3.5 shadow-lg shadow-black/5 flex flex-col sm:flex-row sm:items-center justify-between gap-3 hover:border-primary/40 transition-all",Ae?"border-primary/45":G.role?"border-primary/30 bg-primary/5":"border-border/60"),children:[l.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[l.jsx("div",{className:J("w-8 h-8 rounded-lg border border-border/40 flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",Ce.color),title:Ce.name,children:Ce.initial}),l.jsxs("div",{className:"min-w-0 text-left",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("h4",{className:"text-xs font-bold text-foreground truncate max-w-[250px] sm:max-w-[400px] break-all font-mono",title:G.name,children:G.name.split("/").pop()}),G.role&&l.jsx(po,{role:G.role,dense:!0,className:"shrink-0"}),b(G.role)&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-background/40 border border-border/40 text-[8px] font-semibold text-muted-foreground shrink-0",title:"Lebenswichtig für Lucy — geschützt vor Löschen/Entladen.",children:"🔒 geschützt"}),v&&C(G.name)&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-fuchsia-500/10 border border-fuchsia-500/30 text-[8px] font-mono text-fuchsia-300 font-bold uppercase shrink-0",title:"Ko-resident in der brains-Gruppe — bleibt mit dem Hirn gemeinsam warm.",children:"🧠 Ko-resident"}),v&&G.prompt_cache&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-cyan-500/10 border border-cyan-500/20 text-[8px] font-mono text-cyan-400 font-bold uppercase shrink-0",title:"Prompt Caching aktiv",children:"PC"}),v&&(G.spec_active?l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-[8px] font-mono text-emerald-400 font-bold uppercase shrink-0",title:`Speculative Decoding aktiv (Draft: ${G.spec_draft_model})`,children:"SPEC"}):G.spec_draft_model?l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[8px] font-mono text-amber-400 font-bold uppercase shrink-0",title:`Draft gesetzt (${G.spec_draft_model}), aber INAKTIV — --spec-type fehlt oder Vocab inkompatibel.`,children:"SPEC?"}):null),v&&G.parallel_slots>1&&l.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-violet-500/10 border border-violet-500/20 text-[8px] font-mono text-violet-400 font-bold uppercase shrink-0",title:`${G.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",G.parallel_slots]}),G.incomplete&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[8px] font-mono text-amber-400 font-bold uppercase shrink-0",title:"GGUF-Datei fehlt",children:"⚠ Datei fehlt"}),Ae&&l.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider shrink-0",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]})]}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 mt-0.5",children:[l.jsxs("span",{children:["Größe: ",lr(G.size_bytes)]}),l.jsx("span",{children:"•"}),l.jsxs("span",{children:["Kontext: ",Nv(G.ctx)]}),l.jsx("span",{children:"•"}),l.jsx("span",{className:"font-mono text-[9px]",children:G.quant||"GGUF"})]})]})]}),l.jsxs("div",{className:"flex items-center gap-3 shrink-0 self-end sm:self-auto",children:[l.jsx("div",{className:"hidden lg:flex flex-wrap gap-1",children:l.jsx(Ev,{caps:G.capabilities})}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[(()=>{const Ye=b(G.role),et=Ae&&Ye,dr=G.incomplete&&!Ae||et;return l.jsx("button",{onClick:()=>Ae?te(G.name):ie(G.name),disabled:dr,title:et?`„${dt(G.role).label}" bleibt geladen (geschützt).`:void 0,className:J("h-7 px-3 rounded-lg text-[9px] font-bold uppercase transition-all border flex items-center gap-1",dr?"border-border/30 bg-background/10 text-muted-foreground/50 cursor-not-allowed":Ae?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400 cursor-pointer":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary cursor-pointer"),children:et?"🔒 geladen":Ae?"Entladen":"Laden"})})(),v&&l.jsx("button",{onClick:()=>ne(G.name,G.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-all cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),v&&E&&l.jsx("button",{onClick:()=>O(G.name),className:J("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-colors cursor-pointer",C(G.name)?"border-fuchsia-500/40 bg-fuchsia-500/10 text-fuchsia-300 hover:bg-fuchsia-500/20":"border-border/40 text-muted-foreground hover:bg-accent"),title:C(G.name)?"Ko-resident (brains): bleibt mit dem Hirn gemeinsam warm. Klick = aus der Gruppe nehmen.":"Zur brains-Gruppe hinzufügen — lädt dann ko-resident neben dem Hirn, statt es zu verdrängen.",children:"🧠"}),v&&l.jsxs("button",{onClick:()=>W(G),className:J("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-all cursor-pointer flex items-center gap-1",G.spec_active?"border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10":G.spec_draft_model?"border-amber-500/30 text-amber-400 hover:bg-amber-500/10":"border-border/40 text-muted-foreground hover:bg-accent"),title:"Speculative Draft konfigurieren (Vocab-geprüft)",children:[l.jsx(ka,{className:"h-3 w-3"})," Spec"]}),l.jsx("button",{onClick:()=>ee(G.name),disabled:b(G.role),className:J("h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 transition-all",b(G.role)?"text-muted-foreground/40 cursor-not-allowed":"text-muted-foreground hover:text-red-400 hover:bg-red-500/5 cursor-pointer"),"aria-label":"Modell löschen",title:b(G.role)?`„${dt(G.role).label}" ist geschützt und kann nicht gelöscht werden.`:"Modell löschen",children:l.jsx(Pc,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]},G.name)})})]}),D&&l.jsx(PX,{role:D,roleRec:z,models:S,onAssign:G=>{M(D,G),B(null)},onClose:()=>B(null)}),K&&l.jsx(uE,{model:K,onClose:()=>W(null),onChanged:N}),p]})}function Zg({icon:e,title:t,sub:r,onClick:n}){return l.jsxs("button",{onClick:n,className:"w-full flex items-center gap-4 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 text-left transition-all hover:border-primary/40 cursor-pointer",children:[l.jsx(e,{className:"h-6 w-6 text-muted-foreground shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm text-foreground",children:t}),l.jsx("div",{className:"text-xs text-muted-foreground",children:r})]}),l.jsx(bi,{className:"h-5 w-5 text-muted-foreground shrink-0"})]})}function DX(){const[e,t]=x.useState(null);return e?l.jsxs("div",{className:"space-y-4",children:[l.jsxs("button",{onClick:()=>t(null),className:"flex items-center gap-1.5 text-xs font-semibold text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[l.jsx(XN,{className:"h-4 w-4"})," Maschinenraum"]}),e==="modelle"?l.jsx(TX,{}):l.jsx(hE,{})]}):l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",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:"Maschinenraum"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Nur nötig, wenn du wirklich was ändern willst."})]}),l.jsx(tE,{})]}),l.jsx(Zg,{icon:wi,title:"Modelle",sub:"Hirne, Coder, Immer-bereit-Set, Bibliothek",onClick:()=>t("modelle")}),l.jsx(Zg,{icon:d5,title:"Wartung und Logs",sub:"Updates, Backup, Dienste, Logs, Zugangsdaten",onClick:()=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:"maintenance"}}))}),l.jsx(Zg,{icon:jn,title:"Hermes und Verdrahtung",sub:"Agent, Gehirn-Modell, PC-Verbindung",onClick:()=>t("hermes")})]})}const RX=[{id:"start",label:"Start",icon:mh},{id:"vibe",label:"Vibe-Coding",icon:zs},{id:"konstitution",label:"Konstitution",icon:PM},{id:"maschinenraum",label:"Maschinenraum",icon:ru}];function LX(){const[e,t]=x.useState("start"),[r,n]=x.useState(!1),[i,o]=x.useState("maintenance"),{data:c}=Hx();x.useEffect(()=>{const f=h=>{var m;o(((m=h.detail)==null?void 0:m.tab)||"maintenance"),n(!0)};return window.addEventListener("open-system-drawer",f),()=>window.removeEventListener("open-system-drawer",f)},[]);const u=c&&c.engine_reachable&&(c.brain?c.brain.ready:!0);return l.jsxs("div",{className:"flex h-full relative",children:[l.jsx("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-30 animate-aurora bg-gradient-to-tr from-teal-500/15 via-indigo-500/10 to-purple-500/15 blur-[130px]"})}),l.jsx(mE,{open:r,onClose:()=>n(!1),defaultTab:i}),l.jsxs("aside",{className:"flex w-56 shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md",children:[l.jsxs("div",{className:"flex items-center gap-2 px-5 py-4 border-b border-border/40",children:[l.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20"}),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-[10px] text-muted-foreground",children:"3 · Prototyp"})]})]}),l.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4",children:RX.map(f=>l.jsxs("button",{onClick:()=>t(f.id),className:J("flex w-full items-center gap-3 rounded-md px-3 py-2 text-sm transition-all cursor-pointer",e===f.id?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[l.jsx(f.icon,{className:"h-4.5 w-4.5 shrink-0"})," ",f.label]},f.id))}),l.jsxs("div",{className:"px-3 py-3 border-t border-border/40 space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2 px-2 text-xs text-muted-foreground",children:[l.jsx("span",{className:J("h-2 w-2 rounded-full",u?"bg-emerald-500 animate-pulse":"bg-amber-500")}),u?"Box läuft":"prüfen"]}),l.jsxs("a",{href:"#dashboard",className:"flex items-center gap-1.5 rounded-md px-2 py-1.5 text-[11px] text-muted-foreground hover:text-foreground transition-colors",children:[l.jsx(XN,{className:"h-3.5 w-3.5"})," zurück zu MC2"]})]})]}),l.jsxs("main",{className:"flex-1 min-w-0 overflow-y-auto p-6 scrollbar-thin",children:[e==="start"&&l.jsx(AX,{}),e==="vibe"&&l.jsx(dE,{}),e==="konstitution"&&l.jsx(fE,{}),e==="maschinenraum"&&l.jsx(DX,{})]})]})}const $X={ok:"bg-emerald-500",warn:"bg-amber-500",alert:"bg-red-500",muted:"bg-muted-foreground/40",loading:"bg-muted-foreground/40 animate-pulse"},zX={ok:"hover:border-emerald-500/40",warn:"hover:border-amber-500/50",alert:"hover:border-red-500/50",muted:"hover:border-primary/40",loading:"hover:border-border/60"};function Yr({icon:e,title:t,value:r,unit:n,tone:i="muted",hint:o,onClick:c}){return l.jsxs("button",{onClick:c,className:J("group relative flex flex-col items-start rounded-2xl border border-border/60 bg-card/45 p-5 text-left shadow-lg shadow-black/15 backdrop-blur-md transition-all duration-200 cursor-pointer hover:bg-card/70 hover:shadow-xl",zX[i]),children:[l.jsxs("div",{className:"mb-4 flex w-full items-center justify-between",children:[l.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-xl border border-border/40 bg-background/30 text-foreground/80 transition-colors group-hover:text-primary",children:l.jsx(e,{className:"h-5 w-5"})}),l.jsx("span",{className:J("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",$X[i]),title:o})]}),l.jsxs("div",{className:"flex items-baseline gap-1.5",children:[l.jsx("span",{className:"text-2xl font-bold tracking-tight text-foreground font-space tabular-nums",children:r}),n&&l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n})]}),l.jsxs("div",{className:"mt-1 flex w-full items-center justify-between",children:[l.jsx("span",{className:"text-sm font-semibold text-foreground/90",children:t}),l.jsx(bi,{className:"h-4 w-4 text-muted-foreground/40 transition-all group-hover:translate-x-0.5 group-hover:text-primary"})]}),o&&l.jsx("span",{className:"mt-0.5 text-[11px] text-muted-foreground",children:o})]})}function FX(){var c;const{data:e=[]}=iE(150,6e4),[t,r]=x.useState(!1),n=e.find(u=>u.source==="chef-gutachter");if(!n)return null;const i=new Date(n.ts*1e3).toLocaleString("de-DE",{weekday:"long",day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"}),o=(c=n.text.split(` -`).find(u=>u.trim().startsWith("VERDIKT:")))==null?void 0:c.replace(/^\s*VERDIKT:\s*/,"");return l.jsxs("div",{className:"rounded-2xl border border-violet-500/25 bg-violet-500/[0.05] p-4 shadow-lg shadow-black/15 backdrop-blur-md",children:[l.jsxs("button",{onClick:()=>r(u=>!u),className:"flex w-full items-center gap-3 text-left cursor-pointer",children:[l.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl border border-violet-500/30 bg-background/30 text-violet-300",children:l.jsx(s5,{className:"h-4.5 w-4.5"})}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"block text-sm font-bold text-foreground",children:"Morgenlage"}),l.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o||n.subject||"Nächtliches Gutachten über die autonome Arbeit"})]}),l.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground/60",children:i}),t?l.jsx(eu,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):l.jsx(bi,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]}),t&&l.jsxs("div",{className:"mt-3 border-t border-violet-500/15 pt-3",children:[n.subject&&l.jsx("p",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wider text-violet-300/80",children:n.subject}),l.jsx("p",{className:"whitespace-pre-wrap text-xs leading-relaxed text-foreground/85",children:n.text})]})]})}const NN={"":"einmalig",daily:"täglich",weekdays:"werktags",weekly:"wöchentlich"};function BX(){const{data:e=[],isLoading:t}=hR(),r=Wr(),{showAlert:n,showConfirm:i,dialogElement:o}=An(),[c,u]=x.useState(!1),[f,h]=x.useState(""),[m,p]=x.useState(""),[v,b]=x.useState(""),[S,w]=x.useState(!1),k=()=>r.invalidateQueries({queryKey:$e.reminders});async function N(){if(!(!f.trim()||!m)){w(!0);try{await xe("/api/reminders",{method:"POST",body:JSON.stringify({text:f,when:m,repeat:v})}),h(""),p(""),b(""),u(!1),k()}catch(C){n("Anlegen fehlgeschlagen",String((C==null?void 0:C.message)||C))}finally{w(!1)}}}function E(C,_){i("Erinnerung löschen?",`„${_}" wird entfernt.`,async()=>{try{await xe(`/api/reminders/${C}`,{method:"DELETE"}),k()}catch(O){n("Fehler",String((O==null?void 0:O.message)||O))}})}const A=[...e].sort((C,_)=>C.next_ts-_.next_ts);return l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-4 shadow-lg shadow-black/15 backdrop-blur-md",children:[l.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[l.jsxs("span",{className:"flex items-center gap-2 text-sm font-bold text-foreground",children:[l.jsx("span",{className:"flex h-8 w-8 items-center justify-center rounded-lg border border-border/40 bg-background/30 text-amber-300",children:l.jsx(ZN,{className:"h-4 w-4"})}),"Anstehendes"]}),l.jsxs("button",{onClick:()=>u(C=>!C),className:"flex h-8 items-center gap-1 rounded-lg border border-border/60 bg-background/30 px-2.5 text-[11px] font-semibold text-muted-foreground hover:text-foreground hover:border-primary/40 transition-all cursor-pointer",children:[c?l.jsx(nn,{className:"h-3.5 w-3.5"}):l.jsx(Cc,{className:"h-3.5 w-3.5"})," ",c?"Abbrechen":"Neu"]})]}),c&&l.jsxs("div",{className:"mb-3 space-y-2 rounded-xl border border-border/50 bg-background/30 p-3",children:[l.jsx("input",{value:f,onChange:C=>h(C.target.value),placeholder:"Woran soll Lucy erinnern?","aria-label":"Erinnerungstext",className:"h-9 w-full rounded-lg border border-border/60 bg-card/45 px-3 text-xs text-foreground outline-none focus:ring-1 focus:ring-primary/50"}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("input",{type:"datetime-local",value:m,onChange:C=>p(C.target.value),"aria-label":"Zeitpunkt",className:"h-9 rounded-lg border border-border/60 bg-card/45 px-2 text-xs text-foreground outline-none focus:ring-1 focus:ring-primary/50 [color-scheme:dark]"}),l.jsx("select",{value:v,onChange:C=>b(C.target.value),"aria-label":"Wiederholung",className:"h-9 cursor-pointer rounded-lg border border-border/60 bg-card/45 px-2 text-xs font-semibold text-foreground outline-none",children:Object.entries(NN).map(([C,_])=>l.jsx("option",{value:C,className:"bg-popover",children:_},C))}),l.jsxs("button",{onClick:N,disabled:S||!f.trim()||!m,className:"ml-auto flex h-9 items-center gap-1.5 rounded-lg bg-primary px-3 text-xs font-semibold text-primary-foreground hover:opacity-90 transition-all cursor-pointer disabled:opacity-50",children:[S?l.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(Cc,{className:"h-3.5 w-3.5"})," Anlegen"]})]})]}),t?l.jsx("p",{className:"text-xs text-muted-foreground",children:"Wird geladen …"}):A.length===0?l.jsx("p",{className:"text-xs text-muted-foreground",children:"Keine Erinnerungen. Lucy sagt dir hier (und per Stimme) Bescheid, wenn etwas ansteht."}):l.jsxs("div",{className:"space-y-1.5",children:[A.slice(0,6).map(C=>{const _=C.next_ts*1e3E(C.id,C.text),"aria-label":"Erinnerung löschen",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border border-border/40 text-muted-foreground opacity-0 transition-all hover:bg-red-500/5 hover:text-red-400 group-hover:opacity-100 cursor-pointer",children:l.jsx(Pc,{className:"h-3.5 w-3.5"})})]},C.id)}),A.length>6&&l.jsxs("p",{className:"text-[10px] text-muted-foreground/60",children:["+",A.length-6," weitere"]})]}),o]})}const Zs=[{key:"stt_ms",label:"STT",color:"#f59e0b"},{key:"vision_ms",label:"Sehen",color:"#a78bfa"},{key:"hirn_ms",label:"Hirn",color:"#2dd4bf"},{key:"gen_ms",label:"Antwort",color:"#60a5fa"}],no=e=>e==null?"–":`${(e/1e3).toLocaleString("de-DE",{minimumFractionDigits:1,maximumFractionDigits:1})} s`;function UX(e){const t=Math.max(0,Date.now()/1e3-e);return t<60?`vor ${Math.round(t)} s`:t<3600?`vor ${Math.round(t/60)} min`:`vor ${Math.round(t/3600)} h`}function Sx(e){return Zs.reduce((t,r)=>t+(e[r.key]??0),0)}function WX(e){let t=null;for(const r of Zs){const n=e[r.key];n!=null&&(t==null||n>t.ms)&&(t={label:r.label,color:r.color,ms:n})}return t}function HX({t:e,scale:t}){const r=Zs.map(n=>`${n.label} ${no(e[n.key])}`).join(" · ")+(e.mem0_ms!=null?` (davon Mem0 ${no(e.mem0_ms)})`:"");return l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx("span",{className:"w-14 shrink-0 text-right font-mono text-[10px] text-muted-foreground/60",children:UX(e.ts)}),l.jsxs("div",{className:"relative h-4 flex-1 overflow-hidden rounded-sm bg-muted/25",title:r,children:[l.jsx("div",{className:"absolute inset-0 flex",children:Zs.map(n=>{const i=e[n.key];return!i||i<=0?null:l.jsx("div",{style:{width:`${i/t*100}%`,background:n.color},className:"h-full first:rounded-l-sm"},n.key)})}),e.error&&l.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-rose-500/15 text-[10px] font-semibold text-rose-300",children:"Fehler"})]}),l.jsx("span",{className:"w-12 shrink-0 text-right font-mono text-[11px] font-semibold tabular-nums text-foreground",children:e.error?"–":no(Sx(e))})]})}function KX(){const{data:e}=mR(12),t=e??[],r=Math.max(1,...t.map(o=>Sx(o))),n=t[0],i=n?WX(n):null;return l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[l.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(i5,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"Latenz je Turn"}),l.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]})]}),n?l.jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[l.jsx("span",{className:`font-space text-3xl font-bold tracking-tight tabular-nums ${n.error?"text-rose-400":"text-foreground"}`,children:n.error?"Fehler":no(Sx(n))}),l.jsxs("span",{className:"text-xs text-muted-foreground",children:["letzter Turn",!n.error&&i&&l.jsxs(l.Fragment,{children:[" · Täter: ",l.jsx("span",{style:{color:i.color},className:"font-semibold",children:i.label})," ",no(i.ms)]})]})]}):l.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Noch kein Voice-Turn aufgezeichnet."}),n&&!n.error&&l.jsxs("div",{className:"mt-0.5 font-mono text-[11px] text-muted-foreground/70",children:[Zs.filter(o=>n[o.key]!=null).map(o=>`${o.label} ${no(n[o.key])}`).join(" · "),n.mem0_ms!=null&&l.jsxs("span",{className:"text-muted-foreground/50",children:[" · davon Mem0 ",no(n.mem0_ms)]})]})]}),l.jsx("div",{className:"flex shrink-0 flex-col items-end gap-1 pt-1",children:Zs.map(o=>l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:o.color}}),l.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:o.label})]},o.key))})]}),t.length>0?l.jsx("div",{className:"space-y-1.5",children:t.map(o=>l.jsx(HX,{t:o,scale:r},o.id))}):l.jsx("div",{className:"flex h-[120px] items-center justify-center px-6 text-center text-xs text-muted-foreground",children:"Sprich einmal mit Lucy — dann erscheint hier der Zeit-Wasserfall pro Turn, damit man den einen Hänger sofort sieht."}),l.jsx("div",{className:"mt-3 border-t border-border/30 pt-2 text-[10px] leading-relaxed text-muted-foreground/70",children:'„Hirn" = Zeit bis zum ersten Wort (Agent + Mem0-Suche + Modell); Tool-Runden stecken in „Antwort". Reine Telegram-Turns laufen an MC2 vorbei und erscheinen hier nicht.'})]})}const df=e=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:e}}));function GX({onNavigate:e}){var D,B;const{data:t}=Ei(4e3),{data:r}=aE(4e3),{data:n}=kh(8e3),{data:i}=jv(),{data:o}=Gx(),{data:c}=lE(),{data:u}=nE(2e4),f=vE(),{showAlert:h,dialogElement:m}=An(),p=Wr(),[v,b]=x.useState({});async function S(z,$){b(K=>({...K,[z]:!0}));try{if($.kind==="loadModel")await xe(`/api/models/${encodeURIComponent($.model)}/load`,{method:"POST"});else{const K=await xe("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:$.service})});K.ok||h("Reparatur nicht ganz geklappt",(K.err||"Unbekannter Fehler")+($.needsSudo?` + `}),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(xa,{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("div",{className:"flex items-center gap-3",children:[l.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["Speicher-Pool: ",lr(re)," Gewichte",Oe>0?` · ${lr(Oe)} real belegt (inkl. KV)`:""," / ",lr(Xe)]}),v&&w.length>0&&l.jsx("button",{onClick:I,className:"h-6 px-2.5 rounded border border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10 text-amber-400 text-[9px] font-bold uppercase transition-all cursor-pointer",children:"Alle entladen"})]})]}),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:me.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"}):me.map((G,Ae)=>{var et;const Ce=(G.size_bytes||0)/Xe*100,Ye=["from-teal-500 to-emerald-500","from-indigo-500 to-blue-500","from-purple-500 to-pink-500","from-cyan-500 to-sky-500"][Ae%4];return l.jsxs("div",{style:{width:`${Ce}%`},className:J("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",Ye),title:`${G.name} (${lr(G.size_bytes)})`,children:[l.jsxs("span",{className:"text-[9px] font-bold truncate max-w-[120px] font-space tracking-wide",children:[G.role?`[${dt(G.role).short}] `:"",(et=G.name.split("/").pop())==null?void 0:et.replace(".gguf","")]}),l.jsx("span",{className:"text-[8px] font-mono opacity-80",children:lr(G.size_bytes)})]},G.name)})})]}),l.jsx(IX,{}),v&&l.jsx(MX,{}),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.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground px-1",children:v?"Gateway Steckplatz-Belegung (Slot-Zuweisung)":"Wer macht was bei Lucy — zum Ändern antippen"}),l.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3",children:jL.map(G=>{var Ye;const Ae=S.find(et=>et.role===G),Ce=Ae?w.includes(Ae.name):!1;return l.jsxs("div",{onClick:()=>U(G),className:J("rounded-xl border p-3 flex flex-col justify-between gap-2.5 transition-all cursor-pointer select-none text-left bg-background/25 hover:border-primary/45 hover:bg-background/40 group min-h-[90px]",Ce?"border-emerald-500/40 shadow-sm shadow-emerald-500/5":Ae?"border-primary/20 bg-primary/5":"border-border/30 border-dashed opacity-75"),children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx(po,{role:G}),Ce&&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 text-foreground/90 pr-1 font-space",title:Ae==null?void 0:Ae.name,children:Ae?(Ye=Ae.name.split("/").pop())==null?void 0:Ye.replace(/\.gguf$/i,""):"nicht zugewiesen"}),l.jsx("div",{className:"text-[8px] text-primary/70 group-hover:text-primary font-bold uppercase tracking-wider transition-colors font-space",children:"Ändern ➔"})]},G)})})]}),(o==null?void 0:o.current)&&l.jsxs("div",{className:"rounded-2xl border border-indigo-500/30 bg-indigo-500/5 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[l.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(jn,{className:"h-4.5 w-4.5 text-indigo-400"}),l.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Agent-Hirn (Hermes)"}),o.current.version!=null&&l.jsxs("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded bg-indigo-500/15 text-indigo-300 border border-indigo-500/25",children:["v",o.current.version]})]}),l.jsx("button",{onClick:()=>window.dispatchEvent(new CustomEvent("mc-navigate",{detail:{view:"agent"}})),className:"h-7 px-3 rounded-lg border border-indigo-500/30 bg-indigo-500/5 text-indigo-300 text-[9px] font-bold uppercase hover:bg-indigo-500/15 transition-all cursor-pointer",title:"Hirn-Wechsel passiert jetzt zentral im Hermes-Tab",children:"Im Hermes-Tab wechseln →"})]}),l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-xl bg-background/30 border border-border/30 p-3.5",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:o.current.name,children:o.current.name.split("/").pop()}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 mt-0.5",children:[l.jsx("span",{children:o.current.params_b?`${o.current.params_b}B`:"—"}),l.jsx("span",{children:"•"}),l.jsx("span",{children:o.current.quant||"GGUF"}),l.jsx("span",{children:"•"}),l.jsx("span",{children:lr(o.current.size_bytes||0)})]})]}),o.update_available&&o.recommended?l.jsxs("button",{onClick:()=>ae(o.recommended.repo),className:J("h-8 px-3 shrink-0 flex items-center justify-center gap-1.5 rounded-lg text-[10px] font-bold uppercase transition-all cursor-pointer shadow-md",o.budget&&!o.budget.fits?"bg-red-500 text-white hover:bg-red-400 shadow-red-500/10":"bg-amber-500 text-black hover:bg-amber-400 shadow-amber-500/10"),children:[l.jsx(Fs,{className:"h-3.5 w-3.5"})," Aktualisieren"]}):l.jsxs("span",{className:"h-8 px-3 shrink-0 flex items-center gap-1.5 text-[10px] font-bold text-emerald-400 uppercase tracking-wide bg-emerald-500/5 border border-emerald-500/15 rounded-lg select-none",children:[l.jsx(Mt,{className:"h-4 w-4"})," Neueste Generation"]})]}),o.update_available&&o.recommended&&l.jsxs("div",{className:"text-[10px] text-amber-400/90 flex items-center gap-1.5",children:[l.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),"Neuere Generation verfügbar: ",l.jsx("span",{className:"font-mono font-bold",children:o.recommended.name.replace(/-GGUF$/i,"")}),"(v",o.recommended.version,", ",o.recommended.params_b,"B) — von NousResearch."]}),o.budget&&l.jsxs("div",{className:J("text-[10px] flex items-start gap-1.5 leading-relaxed",o.budget.fits?"text-muted-foreground/80":"text-red-400 font-semibold"),children:[l.jsx(xa,{className:"h-3 w-3 shrink-0 mt-0.5"}),l.jsxs("span",{children:["Always-On-Brain ~",o.budget.brain_gb," GB + größtes on-demand (~",o.budget.largest_ondemand_gb," GB) = ",(o.budget.brain_gb+o.budget.largest_ondemand_gb).toFixed(1)," / ",o.budget.gtt_gb," GB",o.budget.fits?" · passt gleichzeitig ✓":" · passt NICHT gleichzeitig ⚠ — heavy/coder würden das Brain verdrängen. Kleineres Brain oder weniger Kontext."]})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 px-1",children:[l.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:["Installierte Modell-Bibliothek (",le.length," von ",S.length,")"]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[l.jsx("button",{onClick:()=>oe("all"),className:J("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",pe==="all"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Vorhanden"}),l.jsx("button",{onClick:()=>oe("in_use"),className:J("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",pe==="in_use"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"In Benutzung"})]}),l.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[l.jsx("button",{onClick:()=>ue("grid"),className:J("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",ve==="grid"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Grid"}),l.jsx("button",{onClick:()=>ue("list"),className:J("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",ve==="list"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"List"})]})]})]}),ve==="grid"?l.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:le.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:pe==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):le.map(G=>{const Ae=w.includes(G.name),Ce=i==null?void 0:i.model_list.find(et=>et.role===G.role),Ye=vf(G.name);return l.jsxs("div",{className:J("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-4 transition-all duration-300 hover:border-primary/40 group relative overflow-hidden",Ae?"border-primary/45 shadow-primary/5":G.role?"border-primary/30 bg-primary/5 shadow-inner":"border-border/60"),children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx("div",{className:"flex items-start justify-between gap-3",children:l.jsxs("div",{className:"flex gap-2.5 min-w-0",children:[l.jsx("div",{className:J("w-7 h-7 rounded-lg border flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",Ye.color),title:Ye.name,children:Ye.initial}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h3",{className:"text-xs font-bold tracking-tight text-foreground line-clamp-2 break-all font-mono",title:G.name,children:G.name.split("/").pop()}),l.jsxs("div",{className:"flex items-center gap-2 flex-wrap mt-1",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:G.quant||"GGUF"}),Ae&&l.jsxs("span",{className:"flex items-center gap-1 text-[9px] font-semibold text-emerald-400 uppercase tracking-wider",children:[l.jsx(mh,{className:"h-3 w-3 animate-pulse"})," Warm"]}),G.role&&l.jsx(po,{role:G.role,dense:!0}),b(G.role)&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-background/40 border border-border/40 text-[9px] font-semibold text-muted-foreground",title:"Lebenswichtig für Lucy — geschützt vor Löschen/Entladen.",children:"🔒 geschützt"}),v&&C(G.name)&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-fuchsia-500/10 border border-fuchsia-500/30 text-[9px] font-mono text-fuchsia-300 font-bold uppercase",title:"Ko-resident in der brains-Gruppe — bleibt mit dem Hirn gemeinsam warm, verdrängt es nicht.",children:"🧠 Ko-resident"}),v&&G.prompt_cache&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-cyan-500/10 border border-cyan-500/20 text-[9px] font-mono text-cyan-400 font-bold uppercase",title:"Prompt Caching aktiv",children:"PC"}),v&&(G.spec_active?l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-[9px] font-mono text-emerald-400 font-bold uppercase",title:`Speculative Decoding aktiv (Draft: ${G.spec_draft_model})`,children:"SPEC"}):G.spec_draft_model?l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[9px] font-mono text-amber-400 font-bold uppercase",title:`Draft gesetzt (${G.spec_draft_model}), aber INAKTIV — --spec-type fehlt oder Vocab inkompatibel. Über 'Spec' neu konfigurieren.`,children:"SPEC?"}):null),v&&G.parallel_slots>1&&l.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-violet-500/10 border border-violet-500/20 text-[9px] font-mono text-violet-400 font-bold uppercase",title:`${G.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",G.parallel_slots]}),G.incomplete&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[9px] font-mono text-amber-400 font-bold uppercase",title:"GGUF-Datei fehlt — Modell kann nicht geladen werden",children:"⚠ Datei fehlt"})]})]})]})}),l.jsx("div",{className:"border-t border-border/30 pt-3 flex flex-wrap gap-1",children:l.jsx(Av,{caps:G.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(xa,{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:lr(G.size_bytes)})]})]}),l.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[l.jsx(c5,{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:Ev(G.ctx)})]})]})]}),Ce&&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: ",Ce.repo.split("/").pop()]})]}),l.jsxs("button",{onClick:()=>X(Ce.repo,G.role,G.quant||"Q4_K_M",G.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(Fs,{className:"h-3 w-3"})," Smart-Swap starten"]})]}),l.jsxs("div",{className:"flex items-center gap-1.5 border-t border-border/20 pt-3 mt-auto",children:[(()=>{const et=b(G.role),dr=Ae&&et,Ti=G.incomplete&&!Ae||dr;return l.jsx("button",{onClick:()=>Ae?te(G.name):ie(G.name),disabled:Ti,title:dr?`„${dt(G.role).label}" bleibt geladen (geschützt).`:void 0,className:J("flex-1 h-7 rounded-lg text-[9px] font-bold uppercase transition-all border flex items-center justify-center gap-1",Ti?"border-border/30 bg-background/10 text-muted-foreground/50 cursor-not-allowed":Ae?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400 cursor-pointer":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary cursor-pointer"),children:dr?"🔒 geladen":Ae?"Entladen":"Laden"})})(),v&&l.jsx("button",{onClick:()=>ne(G.name,G.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),v&&E&&l.jsx("button",{onClick:()=>O(G.name),className:J("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-colors cursor-pointer",C(G.name)?"border-fuchsia-500/40 bg-fuchsia-500/10 text-fuchsia-300 hover:bg-fuchsia-500/20":"border-border/40 text-muted-foreground hover:bg-accent"),title:C(G.name)?"Ko-resident (brains): bleibt mit dem Hirn gemeinsam warm. Klick = aus der Gruppe nehmen.":"Zur brains-Gruppe hinzufügen — lädt dann ko-resident neben dem Hirn, statt es zu verdrängen.",children:"🧠"}),v&&l.jsxs("button",{onClick:()=>W(G),className:J("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-colors cursor-pointer flex items-center gap-1",G.spec_active?"border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10":G.spec_draft_model?"border-amber-500/30 text-amber-400 hover:bg-amber-500/10":"border-border/40 text-muted-foreground hover:bg-accent"),title:"Speculative Draft konfigurieren (Vocab-geprüft)",children:[l.jsx(ka,{className:"h-3 w-3"})," Spec"]}),l.jsx("button",{onClick:()=>ee(G.name),disabled:b(G.role),className:J("h-7 w-7 rounded-lg border border-border/40 flex items-center justify-center transition-colors",b(G.role)?"text-muted-foreground/40 cursor-not-allowed":"text-muted-foreground hover:text-red-400 hover:bg-red-500/5 cursor-pointer"),"aria-label":"Modell löschen",title:b(G.role)?`„${dt(G.role).label}" ist geschützt und kann nicht gelöscht werden.`:"Modell löschen",children:l.jsx(Oc,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]},G.name)})}):l.jsx("div",{className:"space-y-2",children:le.length===0?l.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:pe==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):le.map(G=>{const Ae=w.includes(G.name),Ce=vf(G.name);return l.jsxs("div",{className:J("rounded-xl border bg-card/45 backdrop-blur-md p-3.5 shadow-lg shadow-black/5 flex flex-col sm:flex-row sm:items-center justify-between gap-3 hover:border-primary/40 transition-all",Ae?"border-primary/45":G.role?"border-primary/30 bg-primary/5":"border-border/60"),children:[l.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[l.jsx("div",{className:J("w-8 h-8 rounded-lg border border-border/40 flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",Ce.color),title:Ce.name,children:Ce.initial}),l.jsxs("div",{className:"min-w-0 text-left",children:[l.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l.jsx("h4",{className:"text-xs font-bold text-foreground truncate max-w-[250px] sm:max-w-[400px] break-all font-mono",title:G.name,children:G.name.split("/").pop()}),G.role&&l.jsx(po,{role:G.role,dense:!0,className:"shrink-0"}),b(G.role)&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-background/40 border border-border/40 text-[8px] font-semibold text-muted-foreground shrink-0",title:"Lebenswichtig für Lucy — geschützt vor Löschen/Entladen.",children:"🔒 geschützt"}),v&&C(G.name)&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-fuchsia-500/10 border border-fuchsia-500/30 text-[8px] font-mono text-fuchsia-300 font-bold uppercase shrink-0",title:"Ko-resident in der brains-Gruppe — bleibt mit dem Hirn gemeinsam warm.",children:"🧠 Ko-resident"}),v&&G.prompt_cache&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-cyan-500/10 border border-cyan-500/20 text-[8px] font-mono text-cyan-400 font-bold uppercase shrink-0",title:"Prompt Caching aktiv",children:"PC"}),v&&(G.spec_active?l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-[8px] font-mono text-emerald-400 font-bold uppercase shrink-0",title:`Speculative Decoding aktiv (Draft: ${G.spec_draft_model})`,children:"SPEC"}):G.spec_draft_model?l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[8px] font-mono text-amber-400 font-bold uppercase shrink-0",title:`Draft gesetzt (${G.spec_draft_model}), aber INAKTIV — --spec-type fehlt oder Vocab inkompatibel.`,children:"SPEC?"}):null),v&&G.parallel_slots>1&&l.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-violet-500/10 border border-violet-500/20 text-[8px] font-mono text-violet-400 font-bold uppercase shrink-0",title:`${G.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",G.parallel_slots]}),G.incomplete&&l.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[8px] font-mono text-amber-400 font-bold uppercase shrink-0",title:"GGUF-Datei fehlt",children:"⚠ Datei fehlt"}),Ae&&l.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider shrink-0",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]})]}),l.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 mt-0.5",children:[l.jsxs("span",{children:["Größe: ",lr(G.size_bytes)]}),l.jsx("span",{children:"•"}),l.jsxs("span",{children:["Kontext: ",Ev(G.ctx)]}),l.jsx("span",{children:"•"}),l.jsx("span",{className:"font-mono text-[9px]",children:G.quant||"GGUF"})]})]})]}),l.jsxs("div",{className:"flex items-center gap-3 shrink-0 self-end sm:self-auto",children:[l.jsx("div",{className:"hidden lg:flex flex-wrap gap-1",children:l.jsx(Av,{caps:G.capabilities})}),l.jsxs("div",{className:"flex items-center gap-1.5",children:[(()=>{const Ye=b(G.role),et=Ae&&Ye,dr=G.incomplete&&!Ae||et;return l.jsx("button",{onClick:()=>Ae?te(G.name):ie(G.name),disabled:dr,title:et?`„${dt(G.role).label}" bleibt geladen (geschützt).`:void 0,className:J("h-7 px-3 rounded-lg text-[9px] font-bold uppercase transition-all border flex items-center gap-1",dr?"border-border/30 bg-background/10 text-muted-foreground/50 cursor-not-allowed":Ae?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400 cursor-pointer":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary cursor-pointer"),children:et?"🔒 geladen":Ae?"Entladen":"Laden"})})(),v&&l.jsx("button",{onClick:()=>ne(G.name,G.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-all cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),v&&E&&l.jsx("button",{onClick:()=>O(G.name),className:J("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-colors cursor-pointer",C(G.name)?"border-fuchsia-500/40 bg-fuchsia-500/10 text-fuchsia-300 hover:bg-fuchsia-500/20":"border-border/40 text-muted-foreground hover:bg-accent"),title:C(G.name)?"Ko-resident (brains): bleibt mit dem Hirn gemeinsam warm. Klick = aus der Gruppe nehmen.":"Zur brains-Gruppe hinzufügen — lädt dann ko-resident neben dem Hirn, statt es zu verdrängen.",children:"🧠"}),v&&l.jsxs("button",{onClick:()=>W(G),className:J("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-all cursor-pointer flex items-center gap-1",G.spec_active?"border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10":G.spec_draft_model?"border-amber-500/30 text-amber-400 hover:bg-amber-500/10":"border-border/40 text-muted-foreground hover:bg-accent"),title:"Speculative Draft konfigurieren (Vocab-geprüft)",children:[l.jsx(ka,{className:"h-3 w-3"})," Spec"]}),l.jsx("button",{onClick:()=>ee(G.name),disabled:b(G.role),className:J("h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 transition-all",b(G.role)?"text-muted-foreground/40 cursor-not-allowed":"text-muted-foreground hover:text-red-400 hover:bg-red-500/5 cursor-pointer"),"aria-label":"Modell löschen",title:b(G.role)?`„${dt(G.role).label}" ist geschützt und kann nicht gelöscht werden.`:"Modell löschen",children:l.jsx(Oc,{className:"h-3.5 w-3.5","aria-hidden":"true"})})]})]})]},G.name)})})]}),D&&l.jsx(PX,{role:D,roleRec:z,models:S,onAssign:G=>{M(D,G),B(null)},onClose:()=>B(null)}),K&&l.jsx(dE,{model:K,onClose:()=>W(null),onChanged:N}),p]})}function Xg({icon:e,title:t,sub:r,onClick:n}){return l.jsxs("button",{onClick:n,className:"w-full flex items-center gap-4 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 text-left transition-all hover:border-primary/40 cursor-pointer",children:[l.jsx(e,{className:"h-6 w-6 text-muted-foreground shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm text-foreground",children:t}),l.jsx("div",{className:"text-xs text-muted-foreground",children:r})]}),l.jsx(bi,{className:"h-5 w-5 text-muted-foreground shrink-0"})]})}function DX(){const[e,t]=x.useState(null);return e?l.jsxs("div",{className:"space-y-4",children:[l.jsxs("button",{onClick:()=>t(null),className:"flex items-center gap-1.5 text-xs font-semibold text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[l.jsx(JN,{className:"h-4 w-4"})," Maschinenraum"]}),e==="modelle"?l.jsx(TX,{}):l.jsx(mE,{})]}):l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",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:"Maschinenraum"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Nur nötig, wenn du wirklich was ändern willst."})]}),l.jsx(rE,{})]}),l.jsx(Xg,{icon:wi,title:"Modelle",sub:"Hirne, Coder, Immer-bereit-Set, Bibliothek",onClick:()=>t("modelle")}),l.jsx(Xg,{icon:f5,title:"Wartung und Logs",sub:"Updates, Backup, Dienste, Logs, Zugangsdaten",onClick:()=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:"maintenance"}}))}),l.jsx(Xg,{icon:jn,title:"Hermes und Verdrahtung",sub:"Agent, Gehirn-Modell, PC-Verbindung",onClick:()=>t("hermes")})]})}const LX=[{id:"start",label:"Start",icon:mh},{id:"vibe",label:"Vibe-Coding",icon:zs},{id:"konstitution",label:"Konstitution",icon:OM},{id:"maschinenraum",label:"Maschinenraum",icon:nu}];function RX(){const[e,t]=x.useState("start"),[r,n]=x.useState(!1),[i,o]=x.useState("maintenance"),{data:c}=Kx();x.useEffect(()=>{const f=h=>{var m;o(((m=h.detail)==null?void 0:m.tab)||"maintenance"),n(!0)};return window.addEventListener("open-system-drawer",f),()=>window.removeEventListener("open-system-drawer",f)},[]);const u=c&&c.engine_reachable&&(c.brain?c.brain.ready:!0);return l.jsxs("div",{className:"flex h-full relative",children:[l.jsx("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-30 animate-aurora bg-gradient-to-tr from-teal-500/15 via-indigo-500/10 to-purple-500/15 blur-[130px]"})}),l.jsx(pE,{open:r,onClose:()=>n(!1),defaultTab:i}),l.jsxs("aside",{className:"flex w-56 shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md",children:[l.jsxs("div",{className:"flex items-center gap-2 px-5 py-4 border-b border-border/40",children:[l.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20"}),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-[10px] text-muted-foreground",children:"3 · Prototyp"})]})]}),l.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4",children:LX.map(f=>l.jsxs("button",{onClick:()=>t(f.id),className:J("flex w-full items-center gap-3 rounded-md px-3 py-2 text-sm transition-all cursor-pointer",e===f.id?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[l.jsx(f.icon,{className:"h-4.5 w-4.5 shrink-0"})," ",f.label]},f.id))}),l.jsxs("div",{className:"px-3 py-3 border-t border-border/40 space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2 px-2 text-xs text-muted-foreground",children:[l.jsx("span",{className:J("h-2 w-2 rounded-full",u?"bg-emerald-500 animate-pulse":"bg-amber-500")}),u?"Box läuft":"prüfen"]}),l.jsxs("a",{href:"#dashboard",className:"flex items-center gap-1.5 rounded-md px-2 py-1.5 text-[11px] text-muted-foreground hover:text-foreground transition-colors",children:[l.jsx(JN,{className:"h-3.5 w-3.5"})," zurück zu MC2"]})]})]}),l.jsxs("main",{className:"flex-1 min-w-0 overflow-y-auto p-6 scrollbar-thin",children:[e==="start"&&l.jsx(AX,{}),e==="vibe"&&l.jsx(fE,{}),e==="konstitution"&&l.jsx(hE,{}),e==="maschinenraum"&&l.jsx(DX,{})]})]})}const $X={ok:"bg-emerald-500",warn:"bg-amber-500",alert:"bg-red-500",muted:"bg-muted-foreground/40",loading:"bg-muted-foreground/40 animate-pulse"},zX={ok:"hover:border-emerald-500/40",warn:"hover:border-amber-500/50",alert:"hover:border-red-500/50",muted:"hover:border-primary/40",loading:"hover:border-border/60"};function Yr({icon:e,title:t,value:r,unit:n,tone:i="muted",hint:o,onClick:c}){return l.jsxs("button",{onClick:c,className:J("group relative flex flex-col items-start rounded-2xl border border-border/60 bg-card/45 p-5 text-left shadow-lg shadow-black/15 backdrop-blur-md transition-all duration-200 cursor-pointer hover:bg-card/70 hover:shadow-xl",zX[i]),children:[l.jsxs("div",{className:"mb-4 flex w-full items-center justify-between",children:[l.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-xl border border-border/40 bg-background/30 text-foreground/80 transition-colors group-hover:text-primary",children:l.jsx(e,{className:"h-5 w-5"})}),l.jsx("span",{className:J("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",$X[i]),title:o})]}),l.jsxs("div",{className:"flex items-baseline gap-1.5",children:[l.jsx("span",{className:"text-2xl font-bold tracking-tight text-foreground font-space tabular-nums",children:r}),n&&l.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:n})]}),l.jsxs("div",{className:"mt-1 flex w-full items-center justify-between",children:[l.jsx("span",{className:"text-sm font-semibold text-foreground/90",children:t}),l.jsx(bi,{className:"h-4 w-4 text-muted-foreground/40 transition-all group-hover:translate-x-0.5 group-hover:text-primary"})]}),o&&l.jsx("span",{className:"mt-0.5 text-[11px] text-muted-foreground",children:o})]})}function FX(){var c;const{data:e=[]}=aE(150,6e4),[t,r]=x.useState(!1),n=e.find(u=>u.source==="chef-gutachter");if(!n)return null;const i=new Date(n.ts*1e3).toLocaleString("de-DE",{weekday:"long",day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"}),o=(c=n.text.split(` +`).find(u=>u.trim().startsWith("VERDIKT:")))==null?void 0:c.replace(/^\s*VERDIKT:\s*/,"");return l.jsxs("div",{className:"rounded-2xl border border-violet-500/25 bg-violet-500/[0.05] p-4 shadow-lg shadow-black/15 backdrop-blur-md",children:[l.jsxs("button",{onClick:()=>r(u=>!u),className:"flex w-full items-center gap-3 text-left cursor-pointer",children:[l.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-xl border border-violet-500/30 bg-background/30 text-violet-300",children:l.jsx(l5,{className:"h-4.5 w-4.5"})}),l.jsxs("span",{className:"min-w-0 flex-1",children:[l.jsx("span",{className:"block text-sm font-bold text-foreground",children:"Morgenlage"}),l.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:o||n.subject||"Nächtliches Gutachten über die autonome Arbeit"})]}),l.jsx("span",{className:"shrink-0 text-[10px] text-muted-foreground/60",children:i}),t?l.jsx(tu,{className:"h-4 w-4 shrink-0 text-muted-foreground"}):l.jsx(bi,{className:"h-4 w-4 shrink-0 text-muted-foreground"})]}),t&&l.jsxs("div",{className:"mt-3 border-t border-violet-500/15 pt-3",children:[n.subject&&l.jsx("p",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wider text-violet-300/80",children:n.subject}),l.jsx("p",{className:"whitespace-pre-wrap text-xs leading-relaxed text-foreground/85",children:n.text})]})]})}const EN={"":"einmalig",daily:"täglich",weekdays:"werktags",weekly:"wöchentlich"};function BX(){const{data:e=[],isLoading:t}=hL(),r=Wr(),{showAlert:n,showConfirm:i,dialogElement:o}=An(),[c,u]=x.useState(!1),[f,h]=x.useState(""),[m,p]=x.useState(""),[v,b]=x.useState(""),[S,w]=x.useState(!1),k=()=>r.invalidateQueries({queryKey:$e.reminders});async function N(){if(!(!f.trim()||!m)){w(!0);try{await xe("/api/reminders",{method:"POST",body:JSON.stringify({text:f,when:m,repeat:v})}),h(""),p(""),b(""),u(!1),k()}catch(C){n("Anlegen fehlgeschlagen",String((C==null?void 0:C.message)||C))}finally{w(!1)}}}function E(C,_){i("Erinnerung löschen?",`„${_}" wird entfernt.`,async()=>{try{await xe(`/api/reminders/${C}`,{method:"DELETE"}),k()}catch(O){n("Fehler",String((O==null?void 0:O.message)||O))}})}const A=[...e].sort((C,_)=>C.next_ts-_.next_ts);return l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-4 shadow-lg shadow-black/15 backdrop-blur-md",children:[l.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[l.jsxs("span",{className:"flex items-center gap-2 text-sm font-bold text-foreground",children:[l.jsx("span",{className:"flex h-8 w-8 items-center justify-center rounded-lg border border-border/40 bg-background/30 text-amber-300",children:l.jsx(XN,{className:"h-4 w-4"})}),"Anstehendes"]}),l.jsxs("button",{onClick:()=>u(C=>!C),className:"flex h-8 items-center gap-1 rounded-lg border border-border/60 bg-background/30 px-2.5 text-[11px] font-semibold text-muted-foreground hover:text-foreground hover:border-primary/40 transition-all cursor-pointer",children:[c?l.jsx(nn,{className:"h-3.5 w-3.5"}):l.jsx(Pc,{className:"h-3.5 w-3.5"})," ",c?"Abbrechen":"Neu"]})]}),c&&l.jsxs("div",{className:"mb-3 space-y-2 rounded-xl border border-border/50 bg-background/30 p-3",children:[l.jsx("input",{value:f,onChange:C=>h(C.target.value),placeholder:"Woran soll Lucy erinnern?","aria-label":"Erinnerungstext",className:"h-9 w-full rounded-lg border border-border/60 bg-card/45 px-3 text-xs text-foreground outline-none focus:ring-1 focus:ring-primary/50"}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("input",{type:"datetime-local",value:m,onChange:C=>p(C.target.value),"aria-label":"Zeitpunkt",className:"h-9 rounded-lg border border-border/60 bg-card/45 px-2 text-xs text-foreground outline-none focus:ring-1 focus:ring-primary/50 [color-scheme:dark]"}),l.jsx("select",{value:v,onChange:C=>b(C.target.value),"aria-label":"Wiederholung",className:"h-9 cursor-pointer rounded-lg border border-border/60 bg-card/45 px-2 text-xs font-semibold text-foreground outline-none",children:Object.entries(EN).map(([C,_])=>l.jsx("option",{value:C,className:"bg-popover",children:_},C))}),l.jsxs("button",{onClick:N,disabled:S||!f.trim()||!m,className:"ml-auto flex h-9 items-center gap-1.5 rounded-lg bg-primary px-3 text-xs font-semibold text-primary-foreground hover:opacity-90 transition-all cursor-pointer disabled:opacity-50",children:[S?l.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(Pc,{className:"h-3.5 w-3.5"})," Anlegen"]})]})]}),t?l.jsx("p",{className:"text-xs text-muted-foreground",children:"Wird geladen …"}):A.length===0?l.jsx("p",{className:"text-xs text-muted-foreground",children:"Keine Erinnerungen. Lucy sagt dir hier (und per Stimme) Bescheid, wenn etwas ansteht."}):l.jsxs("div",{className:"space-y-1.5",children:[A.slice(0,6).map(C=>{const _=C.next_ts*1e3E(C.id,C.text),"aria-label":"Erinnerung löschen",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border border-border/40 text-muted-foreground opacity-0 transition-all hover:bg-red-500/5 hover:text-red-400 group-hover:opacity-100 cursor-pointer",children:l.jsx(Oc,{className:"h-3.5 w-3.5"})})]},C.id)}),A.length>6&&l.jsxs("p",{className:"text-[10px] text-muted-foreground/60",children:["+",A.length-6," weitere"]})]}),o]})}const Zs=[{key:"stt_ms",label:"STT",color:"#f59e0b"},{key:"vision_ms",label:"Sehen",color:"#a78bfa"},{key:"hirn_ms",label:"Hirn",color:"#2dd4bf"},{key:"gen_ms",label:"Antwort",color:"#60a5fa"}],no=e=>e==null?"–":`${(e/1e3).toLocaleString("de-DE",{minimumFractionDigits:1,maximumFractionDigits:1})} s`;function UX(e){const t=Math.max(0,Date.now()/1e3-e);return t<60?`vor ${Math.round(t)} s`:t<3600?`vor ${Math.round(t/60)} min`:`vor ${Math.round(t/3600)} h`}function Nx(e){return Zs.reduce((t,r)=>t+(e[r.key]??0),0)}function WX(e){let t=null;for(const r of Zs){const n=e[r.key];n!=null&&(t==null||n>t.ms)&&(t={label:r.label,color:r.color,ms:n})}return t}function HX({t:e,scale:t}){const r=Zs.map(n=>`${n.label} ${no(e[n.key])}`).join(" · ")+(e.mem0_ms!=null?` (davon Mem0 ${no(e.mem0_ms)})`:"");return l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx("span",{className:"w-14 shrink-0 text-right font-mono text-[10px] text-muted-foreground/60",children:UX(e.ts)}),l.jsxs("div",{className:"relative h-4 flex-1 overflow-hidden rounded-sm bg-muted/25",title:r,children:[l.jsx("div",{className:"absolute inset-0 flex",children:Zs.map(n=>{const i=e[n.key];return!i||i<=0?null:l.jsx("div",{style:{width:`${i/t*100}%`,background:n.color},className:"h-full first:rounded-l-sm"},n.key)})}),e.error&&l.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-rose-500/15 text-[10px] font-semibold text-rose-300",children:"Fehler"})]}),l.jsx("span",{className:"w-12 shrink-0 text-right font-mono text-[11px] font-semibold tabular-nums text-foreground",children:e.error?"–":no(Nx(e))})]})}function KX(){const{data:e}=mL(12),t=e??[],r=Math.max(1,...t.map(o=>Nx(o))),n=t[0],i=n?WX(n):null;return l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[l.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(a5,{className:"h-4.5 w-4.5 text-primary"}),l.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"Latenz je Turn"}),l.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[l.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]})]}),n?l.jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[l.jsx("span",{className:`font-space text-3xl font-bold tracking-tight tabular-nums ${n.error?"text-rose-400":"text-foreground"}`,children:n.error?"Fehler":no(Nx(n))}),l.jsxs("span",{className:"text-xs text-muted-foreground",children:["letzter Turn",!n.error&&i&&l.jsxs(l.Fragment,{children:[" · Täter: ",l.jsx("span",{style:{color:i.color},className:"font-semibold",children:i.label})," ",no(i.ms)]})]})]}):l.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Noch kein Voice-Turn aufgezeichnet."}),n&&!n.error&&l.jsxs("div",{className:"mt-0.5 font-mono text-[11px] text-muted-foreground/70",children:[Zs.filter(o=>n[o.key]!=null).map(o=>`${o.label} ${no(n[o.key])}`).join(" · "),n.mem0_ms!=null&&l.jsxs("span",{className:"text-muted-foreground/50",children:[" · davon Mem0 ",no(n.mem0_ms)]})]})]}),l.jsx("div",{className:"flex shrink-0 flex-col items-end gap-1 pt-1",children:Zs.map(o=>l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:o.color}}),l.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:o.label})]},o.key))})]}),t.length>0?l.jsx("div",{className:"space-y-1.5",children:t.map(o=>l.jsx(HX,{t:o,scale:r},o.id))}):l.jsx("div",{className:"flex h-[120px] items-center justify-center px-6 text-center text-xs text-muted-foreground",children:"Sprich einmal mit Lucy — dann erscheint hier der Zeit-Wasserfall pro Turn, damit man den einen Hänger sofort sieht."}),l.jsx("div",{className:"mt-3 border-t border-border/30 pt-2 text-[10px] leading-relaxed text-muted-foreground/70",children:'„Hirn" = Zeit bis zum ersten Wort (Agent + Mem0-Suche + Modell); Tool-Runden stecken in „Antwort". Reine Telegram-Turns laufen an MC2 vorbei und erscheinen hier nicht.'})]})}const ff=e=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:e}}));function GX({onNavigate:e}){var D,B;const{data:t}=Ei(4e3),{data:r}=oE(4e3),{data:n}=kh(8e3),{data:i}=Sv(),{data:o}=Vx(),{data:c}=cE(),{data:u}=iE(2e4),f=xE(),{showAlert:h,dialogElement:m}=An(),p=Wr(),[v,b]=x.useState({});async function S(z,$){b(K=>({...K,[z]:!0}));try{if($.kind==="loadModel")await xe(`/api/models/${encodeURIComponent($.model)}/load`,{method:"POST"});else{const K=await xe("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:$.service})});K.ok||h("Reparatur nicht ganz geklappt",(K.err||"Unbekannter Fehler")+($.needsSudo?` -Tipp: Dafür wird evtl. das Box-Passwort gebraucht (oben rechts hinterlegen).`:""))}p.invalidateQueries({queryKey:$e.health}),p.invalidateQueries({queryKey:$e.services}),p.invalidateQueries({queryKey:$e.models})}catch(K){h("Reparatur fehlgeschlagen",String((K==null?void 0:K.message)||K))}finally{b(K=>({...K,[z]:!1}))}}const w=((D=t==null?void 0:t.running)==null?void 0:D.length)??0,k=(r==null?void 0:r.services.filter(z=>z.ok).length)??0,N=(r==null?void 0:r.services.length)??0,E=N-k,A=(i==null?void 0:i.length)??0,C=(n?(n.os>0?1:0)+(n.engine>0?1:0)+(n.swap>0?1:0)+(n.models>0?1:0):0)+(((B=n==null?void 0:n.components)==null?void 0:B.filter(z=>z.update===!0).length)??0),_=(c==null?void 0:c.gateway.ok)&&(c==null?void 0:c.memory.ok),O=u!=null&&u.available?u.open_count:0;return l.jsxs("div",{className:"space-y-7",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Cockpit"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Deine Box auf einen Blick — Details hinter jeder Kachel."})]}),l.jsx(VX,{verdict:f.verdict,memory:f.memory,warns:f.warns}),l.jsx(FX,{}),l.jsx(qX,{problems:f.problems,pendingCount:C,openAuftraege:O,busy:v,onRepair:S,onNavigate:e}),l.jsxs("section",{children:[l.jsx(yc,{children:"Bereiche"}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[l.jsx(Yr,{icon:tu,title:"Auftragsbuch",value:u!=null&&u.available?O:"—",unit:O===1?"Vorschlag":"Vorschläge",tone:u?O>0?"warn":"ok":"loading",hint:"Annehmen oder ablehnen",onClick:()=>e("auftraege")}),l.jsx(Yr,{icon:mf,title:"Modelle",value:w,unit:"warm",tone:w>0?"ok":"muted",hint:"Speicher, laden & Rollen",onClick:()=>e("models")}),l.jsx(Yr,{icon:Na,title:"Gedächtnis",value:i?A:"…",unit:"Notizen",tone:i?"ok":"loading",hint:"Lucys geteiltes Wissen",onClick:()=>e("memory")}),l.jsx(Yr,{icon:gh,title:"Dienste",value:r?`${k}/${N}`:"…",unit:"laufen",tone:r?E>0?"warn":"ok":"loading",hint:"Status & Neustart",onClick:()=>df("maintenance")}),l.jsx(Yr,{icon:Lx,title:"Updates",value:n?C>0?C:"0":"…",unit:C>0?"bereit":"aktuell",tone:n?C>0?"warn":"ok":"loading",hint:"Prüfen & einspielen",onClick:()=>df("maintenance")}),l.jsx(Yr,{icon:Ac,title:"Verbinden",value:"Zed",unit:_?"· bereit":"",tone:c?_?"ok":"warn":"loading",hint:"IDE- & Agent-Configs",onClick:()=>e("connect")}),l.jsx(Yr,{icon:fI,title:"Logs",value:r?E:"…",unit:"Fehler",tone:r?E>0?"alert":"ok":"loading",hint:"Verlauf & Diagnose",onClick:()=>df("logs")})]})]}),l.jsxs("section",{children:[l.jsx(yc,{children:"Anstehendes"}),l.jsx(BX,{})]}),l.jsxs("section",{children:[l.jsx(yc,{children:"Leistung"}),l.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[l.jsx(PO,{}),l.jsx(OO,{})]}),l.jsx("div",{className:"mt-4",children:l.jsx(KX,{})})]}),l.jsxs("section",{children:[l.jsx(yc,{children:"Mehr"}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[l.jsx(Yr,{icon:jn,title:"Hermes",value:o?o.gateway_reachable?"bereit":"offline":"…",tone:o?o.gateway_reachable?"ok":"alert":"loading",hint:"Agent-Status & Verdrahtung",onClick:()=>e("agent")}),l.jsx(Yr,{icon:pf,title:"Terminal",value:"öffnen",tone:"muted",hint:"Interaktives Agent-Terminal",onClick:()=>e("terminal")}),l.jsx(Yr,{icon:pf,title:"Konsole",value:o?o.box_console_reachable?"bereit":"offline":"…",tone:o?o.box_console_reachable?"ok":"warn":"loading",hint:"Direkte Box-Shell (SSH)",onClick:()=>e("konsole")}),l.jsx(Yr,{icon:Dx,title:"Wissen",value:"öffnen",tone:"muted",hint:"Lucys Wissens-Vault (Traum-Notizen)",onClick:()=>e("wissen")}),l.jsx(Yr,{icon:Tx,title:"Chronik",value:"öffnen",tone:"muted",hint:"Autonome Taten + Zeitmaschine",onClick:()=>e("chronik")})]})]}),m]})}function yc({children:e}){return l.jsx("p",{className:"mb-2 ml-0.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:e})}function VX({verdict:e,memory:t,warns:r}){const n=r.length?`${r[0].label}: ${r[0].detail}${r.length>1?` (+${r.length-1} weitere)`:""}`:t.status==="full"?t.text:"Nichts Schlimmes — nur ein Hinweis.",i={loading:{ring:"border-border/60 bg-card/45",icon:Bt,iconCls:"text-muted-foreground animate-spin",title:"Box wird geprüft …",sub:"Einen Moment."},gut:{ring:"border-emerald-500/40 bg-emerald-500/5",icon:Ix,iconCls:"text-emerald-400",title:"Box gesund",sub:"Alle wichtigen Dienste laufen."},warn:{ring:"border-amber-500/40 bg-amber-500/5",icon:vr,iconCls:"text-amber-400",title:"Kleinigkeit an der Box",sub:n},problem:{ring:"border-red-500/50 bg-red-500/5",icon:vr,iconCls:"text-red-400",title:"Box braucht Hilfe",sub:"Ein wichtiger Dienst hakt."}}[e],o=i.icon,c={ok:"text-emerald-400",warn:"text-amber-400",full:"text-red-400",unknown:"text-muted-foreground"}[t.status],u={ok:"bg-emerald-500",warn:"bg-amber-500",full:"bg-red-500",unknown:"bg-muted-foreground/40"}[t.status];return l.jsxs("div",{className:J("flex flex-col gap-4 rounded-2xl border p-5 shadow-lg shadow-black/15 backdrop-blur-md transition-colors sm:flex-row sm:items-center sm:justify-between",i.ring),children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border border-border/40 bg-background/30",children:l.jsx(o,{className:J("h-6 w-6",i.iconCls)})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"text-base font-bold tracking-tight text-foreground",children:i.title}),l.jsx("p",{className:"text-xs text-muted-foreground",children:i.sub})]})]}),l.jsxs("div",{className:"w-full max-w-[16rem] rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsxs("div",{className:"mb-1.5 flex items-center justify-between text-[11px]",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-semibold uppercase tracking-wider text-muted-foreground",children:[l.jsx(xa,{className:"h-3.5 w-3.5"})," Speicher"]}),l.jsx("span",{className:J("font-mono font-bold",c),children:t.status==="unknown"?"—":`${t.usedGb.toFixed(0)} / ${t.totalGb.toFixed(0)} GB`})]}),l.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full border border-border/30 bg-background/50",children:l.jsx("div",{className:J("h-full rounded-full transition-all duration-500",u),style:{width:`${t.pct}%`}})})]})]})}function qX({problems:e,pendingCount:t,openAuftraege:r,busy:n,onRepair:i,onNavigate:o}){const c=t>0,u=r>0,f=e.length===0&&!c&&!u;return l.jsxs("section",{children:[l.jsx(yc,{children:"Braucht dich"}),f?l.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-emerald-500/25 bg-emerald-500/5 p-4",children:[l.jsx(Mt,{className:"h-5 w-5 shrink-0 text-emerald-400"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Nichts zu tun"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Alles läuft. Du musst gerade nichts abnicken."})]})]}):l.jsxs("div",{className:"space-y-2",children:[e.map(h=>l.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-2xl border border-red-500/25 bg-red-500/5 p-4",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[l.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-red-500/30 bg-background/30 text-red-300",children:l.jsx(h.icon,{className:"h-4.5 w-4.5"})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-sm font-bold text-foreground",children:h.label}),l.jsx("p",{className:"truncate text-xs text-muted-foreground",children:h.detail})]})]}),h.repair&&l.jsxs("button",{onClick:()=>h.repair&&i(h.id,h.repair),disabled:!!n[h.id],className:"flex h-9 shrink-0 items-center gap-1.5 rounded-lg border border-red-500/40 bg-red-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300 transition-all hover:bg-red-500/20 cursor-pointer disabled:opacity-60",children:[n[h.id]?l.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(ru,{className:"h-3.5 w-3.5"}),h.repair.label]})]},h.id)),u&&l.jsxs("button",{onClick:()=>o("auftraege"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-primary/30 bg-primary/5 p-4 text-left transition-all hover:bg-primary/10 cursor-pointer",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-primary/30 bg-background/30 text-primary",children:l.jsx(tu,{className:"h-4.5 w-4.5"})}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-sm font-bold text-foreground",children:[r," Vorschl",r===1?"ag":"äge"," im Auftragsbuch"]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Die Box hat etwas gebaut oder sich ausgedacht — annehmen oder ablehnen."})]})]}),l.jsx(bi,{className:"h-4 w-4 shrink-0 text-primary/70"})]}),c&&l.jsxs("button",{onClick:()=>df("maintenance"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-left transition-all hover:bg-amber-500/10 cursor-pointer",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-amber-500/30 bg-background/30 text-amber-300",children:l.jsx(Lx,{className:"h-4.5 w-4.5"})}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-sm font-bold text-foreground",children:[t," Update",t===1?"":"s"," bereit"]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Ansehen und entscheiden, ob du es einspielst."})]})]}),l.jsx(bi,{className:"h-4 w-4 shrink-0 text-amber-300/70"})]})]})]})}const QX={wartung:"Werkstatt",orchestrator:"Orchestrator",doku:"Doku",feature:"Feature"},YX={laeuft:{label:"wird eingespielt …",cls:"text-sky-300 border-sky-500/40 bg-sky-500/10",spin:!0},rollback:{label:"Rollback läuft …",cls:"text-amber-300 border-amber-500/40 bg-amber-500/10",spin:!0},eingespielt:{label:"eingespielt ✓",cls:"text-emerald-300 border-emerald-500/40 bg-emerald-500/10"},fehlgeschlagen:{label:"fehlgeschlagen",cls:"text-red-300 border-red-500/40 bg-red-500/10"},zurueckgerollt:{label:"zurückgerollt",cls:"text-amber-300 border-amber-500/40 bg-amber-500/10"},kritisch:{label:"KRITISCH — Box prüfen",cls:"text-red-200 border-red-500/60 bg-red-500/20"},abgelehnt:{label:"abgelehnt",cls:"text-muted-foreground border-border/60 bg-background/30"}};function _O(e){return e?new Date(e*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"}):"—"}function ZX(){const{data:e,isLoading:t,refetch:r,isFetching:n}=nE(),i=Wr(),{showAlert:o,showConfirm:c,dialogElement:u}=An(),[f,h]=x.useState({}),m=()=>i.invalidateQueries({queryKey:$e.auftragsbuch});async function p(w,k,N,E){h(A=>({...A,[w]:!0}));try{await xe(k,{method:"POST",body:JSON.stringify(N)}),E&&o("Erledigt",E),m()}catch(A){o("Das hat nicht geklappt",String((A==null?void 0:A.message)||A))}finally{h(A=>({...A,[w]:!1}))}}const v=(e==null?void 0:e.items)??[],b=(e==null?void 0:e.skill_kandidaten)??[],S=v.length===0&&b.length===0;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Auftragsbuch"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Was die Box gebaut oder sich ausgedacht hat — du entscheidest. Annehmen spielt es mit Fangnetz ein (Health-Check, automatischer Rollback)."})]}),l.jsxs("button",{onClick:()=>r(),className:"flex h-9 items-center gap-1.5 rounded-lg border border-border/60 bg-card/45 px-3 text-xs font-semibold text-muted-foreground hover:text-foreground hover:border-primary/40 transition-all cursor-pointer",children:[l.jsx(mo,{className:J("h-3.5 w-3.5",n&&"animate-spin")})," Aktualisieren"]})]}),e&&!e.available&&l.jsx("div",{className:"rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-xs text-amber-300",children:"Das Auftragsbuch lebt auf der Box (liest die Gitea-Branches dort). Im lokalen Dev-Modus ist hier nichts zu sehen."}),t&&l.jsxs("div",{className:"flex items-center gap-2 rounded-2xl border border-border/60 bg-card/30 p-6 text-xs text-muted-foreground",children:[l.jsx(Bt,{className:"h-4 w-4 animate-spin"})," Vorschläge werden geladen …"]}),(e==null?void 0:e.available)&&S&&l.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-emerald-500/25 bg-emerald-500/5 p-5",children:[l.jsx(Mt,{className:"h-5 w-5 shrink-0 text-emerald-400"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Nichts zu entscheiden"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Keine offenen Vorschläge. Werkstatt, Orchestrator und Traum melden sich hier, sobald es etwas gibt."})]})]}),v.length>0&&l.jsxs("section",{className:"space-y-3",children:[l.jsxs(EN,{icon:KM,children:["Fertige Patches (",v.length,")"]}),v.map(w=>l.jsx(JX,{item:w,busy:f,onAct:p,showConfirm:c},w.branch))]}),b.length>0&&l.jsxs("section",{className:"space-y-3",children:[l.jsxs(EN,{icon:hi,children:["Skill-Kandidaten aus dem Traum (",b.length,")"]}),b.map(w=>l.jsx(eJ,{k:w,busy:f,onAct:p,showConfirm:c},w.file))]}),u]})}function EN({icon:e,children:t}){return l.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:[l.jsx(e,{className:"h-3.5 w-3.5"})," ",t]})}function XX({item:e}){const t=e.status;if(!t)return null;const r=YX[t.state];return r?l.jsxs("span",{className:J("flex items-center gap-1.5 rounded-lg border px-2 py-0.5 text-[10px] font-bold",r.cls),title:t.detail,children:[r.spin&&l.jsx(Bt,{className:"h-3 w-3 animate-spin"}),r.label]}):null}function JX({item:e,busy:t,onAct:r,showConfirm:n}){var b,S,w;const[i,o]=x.useState(!1),[c,u]=x.useState(null),[f,h]=x.useState(!1),m=((b=e.status)==null?void 0:b.state)==="laeuft"||((S=e.status)==null?void 0:S.state)==="rollback",p=((w=e.status)==null?void 0:w.state)==="eingespielt";async function v(){const k=!i;if(o(k),k&&c===null){h(!0);try{const N=await xe(`/api/auftragsbuch/diff?branch=${encodeURIComponent(e.branch)}`);u(N.diff+(N.truncated?` -… (gekürzt)`:""))}catch(N){u(`(Diff nicht ladbar: ${(N==null?void 0:N.message)||N})`)}finally{h(!1)}}}return l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-4 shadow-lg shadow-black/15 backdrop-blur-md space-y-3",children:[l.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("span",{className:"rounded-md border border-primary/30 bg-primary/10 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-primary",children:QX[e.kind]??e.kind}),l.jsx("span",{className:"font-mono text-[11px] text-muted-foreground truncate",title:e.branch,children:e.branch}),l.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground/70",children:[l.jsx(ph,{className:"h-3 w-3"}),_O(e.ts)]}),l.jsx(XX,{item:e})]}),l.jsx("p",{className:"mt-1.5 text-sm font-semibold text-foreground",children:e.subject||"(ohne Titel)"}),e.body&&l.jsx("p",{className:"mt-1 whitespace-pre-wrap text-xs leading-relaxed text-muted-foreground line-clamp-6",children:e.body})]}),!m&&!p&&l.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[l.jsxs("button",{disabled:!!t[e.branch],onClick:()=>n("Vorschlag annehmen?",`'${e.branch}' wird auf main gemergt und live eingespielt. Die Zentrale startet dabei kurz neu. Geht der Health-Check danach rot, rollt die Box automatisch zurück.${e.frontend_ohne_build?` +Tipp: Dafür wird evtl. das Box-Passwort gebraucht (oben rechts hinterlegen).`:""))}p.invalidateQueries({queryKey:$e.health}),p.invalidateQueries({queryKey:$e.services}),p.invalidateQueries({queryKey:$e.models})}catch(K){h("Reparatur fehlgeschlagen",String((K==null?void 0:K.message)||K))}finally{b(K=>({...K,[z]:!1}))}}const w=((D=t==null?void 0:t.running)==null?void 0:D.length)??0,k=(r==null?void 0:r.services.filter(z=>z.ok).length)??0,N=(r==null?void 0:r.services.length)??0,E=N-k,A=(i==null?void 0:i.length)??0,C=(n?(n.os>0?1:0)+(n.engine>0?1:0)+(n.swap>0?1:0)+(n.models>0?1:0):0)+(((B=n==null?void 0:n.components)==null?void 0:B.filter(z=>z.update===!0).length)??0),_=(c==null?void 0:c.gateway.ok)&&(c==null?void 0:c.memory.ok),O=u!=null&&u.available?u.open_count:0;return l.jsxs("div",{className:"space-y-7",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Cockpit"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Deine Box auf einen Blick — Details hinter jeder Kachel."})]}),l.jsx(VX,{verdict:f.verdict,memory:f.memory,warns:f.warns}),l.jsx(FX,{}),l.jsx(qX,{problems:f.problems,pendingCount:C,openAuftraege:O,busy:v,onRepair:S,onNavigate:e}),l.jsxs("section",{children:[l.jsx(yc,{children:"Bereiche"}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[l.jsx(Yr,{icon:ru,title:"Auftragsbuch",value:u!=null&&u.available?O:"—",unit:O===1?"Vorschlag":"Vorschläge",tone:u?O>0?"warn":"ok":"loading",hint:"Annehmen oder ablehnen",onClick:()=>e("auftraege")}),l.jsx(Yr,{icon:mf,title:"Modelle",value:w,unit:"warm",tone:w>0?"ok":"muted",hint:"Speicher, laden & Rollen",onClick:()=>e("models")}),l.jsx(Yr,{icon:Na,title:"Gedächtnis",value:i?A:"…",unit:"Notizen",tone:i?"ok":"loading",hint:"Lucys geteiltes Wissen",onClick:()=>e("memory")}),l.jsx(Yr,{icon:gh,title:"Dienste",value:r?`${k}/${N}`:"…",unit:"laufen",tone:r?E>0?"warn":"ok":"loading",hint:"Status & Neustart",onClick:()=>ff("maintenance")}),l.jsx(Yr,{icon:$x,title:"Updates",value:n?C>0?C:"0":"…",unit:C>0?"bereit":"aktuell",tone:n?C>0?"warn":"ok":"loading",hint:"Prüfen & einspielen",onClick:()=>ff("maintenance")}),l.jsx(Yr,{icon:Cc,title:"Verbinden",value:"Zed",unit:_?"· bereit":"",tone:c?_?"ok":"warn":"loading",hint:"IDE- & Agent-Configs",onClick:()=>e("connect")}),l.jsx(Yr,{icon:fI,title:"Logs",value:r?E:"…",unit:"Fehler",tone:r?E>0?"alert":"ok":"loading",hint:"Verlauf & Diagnose",onClick:()=>ff("logs")})]})]}),l.jsxs("section",{children:[l.jsx(yc,{children:"Anstehendes"}),l.jsx(BX,{})]}),l.jsxs("section",{children:[l.jsx(yc,{children:"Leistung"}),l.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[l.jsx(OO,{}),l.jsx(_O,{})]}),l.jsx("div",{className:"mt-4",children:l.jsx(KX,{})})]}),l.jsxs("section",{children:[l.jsx(yc,{children:"Mehr"}),l.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:[l.jsx(Yr,{icon:jn,title:"Hermes",value:o?o.gateway_reachable?"bereit":"offline":"…",tone:o?o.gateway_reachable?"ok":"alert":"loading",hint:"Agent-Status & Verdrahtung",onClick:()=>e("agent")}),l.jsx(Yr,{icon:pf,title:"Terminal",value:"öffnen",tone:"muted",hint:"Interaktives Agent-Terminal",onClick:()=>e("terminal")}),l.jsx(Yr,{icon:pf,title:"Konsole",value:o?o.box_console_reachable?"bereit":"offline":"…",tone:o?o.box_console_reachable?"ok":"warn":"loading",hint:"Direkte Box-Shell (SSH)",onClick:()=>e("konsole")}),l.jsx(Yr,{icon:Lx,title:"Wissen",value:"öffnen",tone:"muted",hint:"Lucys Wissens-Vault (Traum-Notizen)",onClick:()=>e("wissen")}),l.jsx(Yr,{icon:Dx,title:"Chronik",value:"öffnen",tone:"muted",hint:"Autonome Taten + Zeitmaschine",onClick:()=>e("chronik")})]})]}),m]})}function yc({children:e}){return l.jsx("p",{className:"mb-2 ml-0.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:e})}function VX({verdict:e,memory:t,warns:r}){const n=r.length?`${r[0].label}: ${r[0].detail}${r.length>1?` (+${r.length-1} weitere)`:""}`:t.status==="full"?t.text:"Nichts Schlimmes — nur ein Hinweis.",i={loading:{ring:"border-border/60 bg-card/45",icon:Bt,iconCls:"text-muted-foreground animate-spin",title:"Box wird geprüft …",sub:"Einen Moment."},gut:{ring:"border-emerald-500/40 bg-emerald-500/5",icon:Tx,iconCls:"text-emerald-400",title:"Box gesund",sub:"Alle wichtigen Dienste laufen."},warn:{ring:"border-amber-500/40 bg-amber-500/5",icon:vr,iconCls:"text-amber-400",title:"Kleinigkeit an der Box",sub:n},problem:{ring:"border-red-500/50 bg-red-500/5",icon:vr,iconCls:"text-red-400",title:"Box braucht Hilfe",sub:"Ein wichtiger Dienst hakt."}}[e],o=i.icon,c={ok:"text-emerald-400",warn:"text-amber-400",full:"text-red-400",unknown:"text-muted-foreground"}[t.status],u={ok:"bg-emerald-500",warn:"bg-amber-500",full:"bg-red-500",unknown:"bg-muted-foreground/40"}[t.status];return l.jsxs("div",{className:J("flex flex-col gap-4 rounded-2xl border p-5 shadow-lg shadow-black/15 backdrop-blur-md transition-colors sm:flex-row sm:items-center sm:justify-between",i.ring),children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-xl border border-border/40 bg-background/30",children:l.jsx(o,{className:J("h-6 w-6",i.iconCls)})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h2",{className:"text-base font-bold tracking-tight text-foreground",children:i.title}),l.jsx("p",{className:"text-xs text-muted-foreground",children:i.sub})]})]}),l.jsxs("div",{className:"w-full max-w-[16rem] rounded-xl border border-border/30 bg-background/20 p-3",children:[l.jsxs("div",{className:"mb-1.5 flex items-center justify-between text-[11px]",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-semibold uppercase tracking-wider text-muted-foreground",children:[l.jsx(xa,{className:"h-3.5 w-3.5"})," Speicher"]}),l.jsx("span",{className:J("font-mono font-bold",c),children:t.status==="unknown"?"—":`${t.usedGb.toFixed(0)} / ${t.totalGb.toFixed(0)} GB`})]}),l.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full border border-border/30 bg-background/50",children:l.jsx("div",{className:J("h-full rounded-full transition-all duration-500",u),style:{width:`${t.pct}%`}})})]})]})}function qX({problems:e,pendingCount:t,openAuftraege:r,busy:n,onRepair:i,onNavigate:o}){const c=t>0,u=r>0,f=e.length===0&&!c&&!u;return l.jsxs("section",{children:[l.jsx(yc,{children:"Braucht dich"}),f?l.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-emerald-500/25 bg-emerald-500/5 p-4",children:[l.jsx(Mt,{className:"h-5 w-5 shrink-0 text-emerald-400"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Nichts zu tun"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Alles läuft. Du musst gerade nichts abnicken."})]})]}):l.jsxs("div",{className:"space-y-2",children:[e.map(h=>l.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-2xl border border-red-500/25 bg-red-500/5 p-4",children:[l.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[l.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-red-500/30 bg-background/30 text-red-300",children:l.jsx(h.icon,{className:"h-4.5 w-4.5"})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("p",{className:"text-sm font-bold text-foreground",children:h.label}),l.jsx("p",{className:"truncate text-xs text-muted-foreground",children:h.detail})]})]}),h.repair&&l.jsxs("button",{onClick:()=>h.repair&&i(h.id,h.repair),disabled:!!n[h.id],className:"flex h-9 shrink-0 items-center gap-1.5 rounded-lg border border-red-500/40 bg-red-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300 transition-all hover:bg-red-500/20 cursor-pointer disabled:opacity-60",children:[n[h.id]?l.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(nu,{className:"h-3.5 w-3.5"}),h.repair.label]})]},h.id)),u&&l.jsxs("button",{onClick:()=>o("auftraege"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-primary/30 bg-primary/5 p-4 text-left transition-all hover:bg-primary/10 cursor-pointer",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-primary/30 bg-background/30 text-primary",children:l.jsx(ru,{className:"h-4.5 w-4.5"})}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-sm font-bold text-foreground",children:[r," Vorschl",r===1?"ag":"äge"," im Auftragsbuch"]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Die Box hat etwas gebaut oder sich ausgedacht — annehmen oder ablehnen."})]})]}),l.jsx(bi,{className:"h-4 w-4 shrink-0 text-primary/70"})]}),c&&l.jsxs("button",{onClick:()=>ff("maintenance"),className:"flex w-full items-center justify-between gap-3 rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-left transition-all hover:bg-amber-500/10 cursor-pointer",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("span",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-amber-500/30 bg-background/30 text-amber-300",children:l.jsx($x,{className:"h-4.5 w-4.5"})}),l.jsxs("div",{children:[l.jsxs("p",{className:"text-sm font-bold text-foreground",children:[t," Update",t===1?"":"s"," bereit"]}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Ansehen und entscheiden, ob du es einspielst."})]})]}),l.jsx(bi,{className:"h-4 w-4 shrink-0 text-amber-300/70"})]})]})]})}const QX={wartung:"Werkstatt",orchestrator:"Orchestrator",doku:"Doku",feature:"Feature"},YX={laeuft:{label:"wird eingespielt …",cls:"text-sky-300 border-sky-500/40 bg-sky-500/10",spin:!0},rollback:{label:"Rollback läuft …",cls:"text-amber-300 border-amber-500/40 bg-amber-500/10",spin:!0},eingespielt:{label:"eingespielt ✓",cls:"text-emerald-300 border-emerald-500/40 bg-emerald-500/10"},fehlgeschlagen:{label:"fehlgeschlagen",cls:"text-red-300 border-red-500/40 bg-red-500/10"},zurueckgerollt:{label:"zurückgerollt",cls:"text-amber-300 border-amber-500/40 bg-amber-500/10"},kritisch:{label:"KRITISCH — Box prüfen",cls:"text-red-200 border-red-500/60 bg-red-500/20"},abgelehnt:{label:"abgelehnt",cls:"text-muted-foreground border-border/60 bg-background/30"}};function MO(e){return e?new Date(e*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"}):"—"}function ZX(){const{data:e,isLoading:t,refetch:r,isFetching:n}=iE(),i=Wr(),{showAlert:o,showConfirm:c,dialogElement:u}=An(),[f,h]=x.useState({}),m=()=>i.invalidateQueries({queryKey:$e.auftragsbuch});async function p(w,k,N,E){h(A=>({...A,[w]:!0}));try{await xe(k,{method:"POST",body:JSON.stringify(N)}),E&&o("Erledigt",E),m()}catch(A){o("Das hat nicht geklappt",String((A==null?void 0:A.message)||A))}finally{h(A=>({...A,[w]:!1}))}}const v=(e==null?void 0:e.items)??[],b=(e==null?void 0:e.skill_kandidaten)??[],S=v.length===0&&b.length===0;return l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Auftragsbuch"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Was die Box gebaut oder sich ausgedacht hat — du entscheidest. Annehmen spielt es mit Fangnetz ein (Health-Check, automatischer Rollback)."})]}),l.jsxs("button",{onClick:()=>r(),className:"flex h-9 items-center gap-1.5 rounded-lg border border-border/60 bg-card/45 px-3 text-xs font-semibold text-muted-foreground hover:text-foreground hover:border-primary/40 transition-all cursor-pointer",children:[l.jsx(mo,{className:J("h-3.5 w-3.5",n&&"animate-spin")})," Aktualisieren"]})]}),e&&!e.available&&l.jsx("div",{className:"rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-xs text-amber-300",children:"Das Auftragsbuch lebt auf der Box (liest die Gitea-Branches dort). Im lokalen Dev-Modus ist hier nichts zu sehen."}),t&&l.jsxs("div",{className:"flex items-center gap-2 rounded-2xl border border-border/60 bg-card/30 p-6 text-xs text-muted-foreground",children:[l.jsx(Bt,{className:"h-4 w-4 animate-spin"})," Vorschläge werden geladen …"]}),(e==null?void 0:e.available)&&S&&l.jsxs("div",{className:"flex items-center gap-3 rounded-2xl border border-emerald-500/25 bg-emerald-500/5 p-5",children:[l.jsx(Mt,{className:"h-5 w-5 shrink-0 text-emerald-400"}),l.jsxs("div",{children:[l.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Nichts zu entscheiden"}),l.jsx("p",{className:"text-xs text-muted-foreground",children:"Keine offenen Vorschläge. Werkstatt, Orchestrator und Traum melden sich hier, sobald es etwas gibt."})]})]}),v.length>0&&l.jsxs("section",{className:"space-y-3",children:[l.jsxs(AN,{icon:GM,children:["Fertige Patches (",v.length,")"]}),v.map(w=>l.jsx(JX,{item:w,busy:f,onAct:p,showConfirm:c},w.branch))]}),b.length>0&&l.jsxs("section",{className:"space-y-3",children:[l.jsxs(AN,{icon:hi,children:["Skill-Kandidaten aus dem Traum (",b.length,")"]}),b.map(w=>l.jsx(eJ,{k:w,busy:f,onAct:p,showConfirm:c},w.file))]}),u]})}function AN({icon:e,children:t}){return l.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:[l.jsx(e,{className:"h-3.5 w-3.5"})," ",t]})}function XX({item:e}){const t=e.status;if(!t)return null;const r=YX[t.state];return r?l.jsxs("span",{className:J("flex items-center gap-1.5 rounded-lg border px-2 py-0.5 text-[10px] font-bold",r.cls),title:t.detail,children:[r.spin&&l.jsx(Bt,{className:"h-3 w-3 animate-spin"}),r.label]}):null}function JX({item:e,busy:t,onAct:r,showConfirm:n}){var b,S,w;const[i,o]=x.useState(!1),[c,u]=x.useState(null),[f,h]=x.useState(!1),m=((b=e.status)==null?void 0:b.state)==="laeuft"||((S=e.status)==null?void 0:S.state)==="rollback",p=((w=e.status)==null?void 0:w.state)==="eingespielt";async function v(){const k=!i;if(o(k),k&&c===null){h(!0);try{const N=await xe(`/api/auftragsbuch/diff?branch=${encodeURIComponent(e.branch)}`);u(N.diff+(N.truncated?` +… (gekürzt)`:""))}catch(N){u(`(Diff nicht ladbar: ${(N==null?void 0:N.message)||N})`)}finally{h(!1)}}}return l.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-4 shadow-lg shadow-black/15 backdrop-blur-md space-y-3",children:[l.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("span",{className:"rounded-md border border-primary/30 bg-primary/10 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-primary",children:QX[e.kind]??e.kind}),l.jsx("span",{className:"font-mono text-[11px] text-muted-foreground truncate",title:e.branch,children:e.branch}),l.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground/70",children:[l.jsx(ph,{className:"h-3 w-3"}),MO(e.ts)]}),l.jsx(XX,{item:e})]}),l.jsx("p",{className:"mt-1.5 text-sm font-semibold text-foreground",children:e.subject||"(ohne Titel)"}),e.body&&l.jsx("p",{className:"mt-1 whitespace-pre-wrap text-xs leading-relaxed text-muted-foreground line-clamp-6",children:e.body})]}),!m&&!p&&l.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[l.jsxs("button",{disabled:!!t[e.branch],onClick:()=>n("Vorschlag annehmen?",`'${e.branch}' wird auf main gemergt und live eingespielt. Die Zentrale startet dabei kurz neu. Geht der Health-Check danach rot, rollt die Box automatisch zurück.${e.frontend_ohne_build?` -Achtung: Enthält Frontend-Quelltext ohne gebautes Bundle — die Oberfläche bleibt alt, bis am PC gebaut wird.`:""}`,()=>r(e.branch,"/api/auftragsbuch/annehmen",{branch:e.branch})),className:"flex h-9 items-center gap-1.5 rounded-lg border border-emerald-500/40 bg-emerald-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-emerald-300 transition-all hover:bg-emerald-500/20 cursor-pointer disabled:opacity-50",children:[t[e.branch]?l.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(Mt,{className:"h-3.5 w-3.5"})," Annehmen"]}),l.jsxs("button",{disabled:!!t["ab:"+e.branch],onClick:()=>n("Vorschlag ablehnen?",`Der Branch '${e.branch}' wird auf Gitea gelöscht. Die Arbeit bleibt in der Historie, aber die Karte verschwindet.`,()=>r("ab:"+e.branch,"/api/auftragsbuch/ablehnen",{branch:e.branch})),className:"flex h-9 items-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/5 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300/90 transition-all hover:bg-red-500/15 cursor-pointer disabled:opacity-50",children:[t["ab:"+e.branch]?l.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(nn,{className:"h-3.5 w-3.5"})," Ablehnen"]})]})]}),e.status&&(m||!p)&&e.status.detail&&l.jsx("p",{className:"text-[11px] text-muted-foreground",children:e.status.detail}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[l.jsxs("span",{className:"rounded bg-background/40 px-1.5 py-0.5 font-mono",children:[e.ahead," Commit",e.ahead===1?"":"s"]}),e.shortstat&&l.jsx("span",{className:"rounded bg-background/40 px-1.5 py-0.5 font-mono",children:e.shortstat.trim()}),e.behind>0&&l.jsxs("span",{className:"flex items-center gap-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-300",title:"main ist seit diesem Vorschlag weitergelaufen",children:[l.jsx(vr,{className:"h-3 w-3"})," ",e.behind," hinter main"]}),e.frontend_ohne_build&&l.jsxs("span",{className:"flex items-center gap-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-300",title:"Die Box kann kein Frontend bauen (kein Node) — nach dem Annehmen bleibt die Oberfläche alt, bis am PC gebaut wird.",children:[l.jsx(vr,{className:"h-3 w-3"})," Frontend ohne Build"]})]}),l.jsxs("div",{children:[l.jsxs("button",{onClick:v,className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[i?l.jsx(eu,{className:"h-3.5 w-3.5"}):l.jsx(bi,{className:"h-3.5 w-3.5"}),l.jsx(WM,{className:"h-3.5 w-3.5"})," ",e.files.length," Datei",e.files.length===1?"":"en"," — Änderungen ansehen"]}),i&&l.jsxs("div",{className:"mt-2 space-y-2",children:[l.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.files.map(k=>l.jsxs("span",{className:"rounded bg-background/40 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:[l.jsx("b",{className:J(k.status.startsWith("A")&&"text-emerald-400",k.status.startsWith("D")&&"text-red-400",k.status.startsWith("M")&&"text-sky-400"),children:k.status})," ",k.path]},k.path)),e.files_truncated&&l.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"…"})]}),l.jsx("div",{className:"max-h-96 overflow-auto rounded-xl border border-border/50 bg-background/50 p-3",children:f?l.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Diff wird geladen …"}):l.jsx("pre",{className:"text-[10px] leading-relaxed text-foreground/80 whitespace-pre",children:(c??"").split(` -`).map((k,N)=>l.jsx("span",{className:J("block",k.startsWith("+")&&!k.startsWith("+++")&&"text-emerald-300/90 bg-emerald-500/5",k.startsWith("-")&&!k.startsWith("---")&&"text-red-300/90 bg-red-500/5",(k.startsWith("@@")||k.startsWith("diff "))&&"text-sky-300/90"),children:k||" "},N))})})]})]})]})}function eJ({k:e,busy:t,onAct:r,showConfirm:n}){const[i,o]=x.useState(!1);return l.jsxs("div",{className:"rounded-2xl border border-violet-500/25 bg-violet-500/[0.04] p-4 shadow-lg shadow-black/15 backdrop-blur-md space-y-3",children:[l.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("span",{className:"rounded-md border border-violet-500/30 bg-violet-500/10 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-violet-300",children:"Traum-Idee"}),l.jsx("span",{className:"font-mono text-[11px] text-muted-foreground truncate",children:e.file}),l.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground/70",children:[l.jsx(ph,{className:"h-3 w-3"}),_O(e.mtime)]})]}),l.jsx("p",{className:"mt-1.5 text-sm font-semibold text-foreground",children:e.title})]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[l.jsxs("button",{disabled:!!t["sk:"+e.file],onClick:()=>n("Werkstatt beauftragen?",`Der Kandidat '${e.title}' geht als Auftrag an die Werkstatt (Orchestrator, propose-only). Das Ergebnis erscheint später als neuer Patch-Vorschlag hier im Auftragsbuch — nichts geht ungefragt live.`,()=>r("sk:"+e.file,"/api/auftragsbuch/skill/annehmen",{file:e.file},"Die Werkstatt arbeitet. Das Ergebnis taucht als neuer Vorschlag im Auftragsbuch auf (das kann einige Minuten dauern).")),className:"flex h-9 items-center gap-1.5 rounded-lg border border-violet-500/40 bg-violet-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-violet-300 transition-all hover:bg-violet-500/20 cursor-pointer disabled:opacity-50",children:[t["sk:"+e.file]?l.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(qM,{className:"h-3.5 w-3.5"})," Beauftragen"]}),l.jsxs("button",{disabled:!!t["skab:"+e.file],onClick:()=>n("Kandidat verwerfen?",`'${e.title}' wandert ins Archiv des Wissens-Vaults (verworfen/). Der Traum schlägt ihn nicht erneut vor.`,()=>r("skab:"+e.file,"/api/auftragsbuch/skill/ablehnen",{file:e.file})),className:"flex h-9 items-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/5 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300/90 transition-all hover:bg-red-500/15 cursor-pointer disabled:opacity-50",children:[t["skab:"+e.file]?l.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(nn,{className:"h-3.5 w-3.5"})," Verwerfen"]})]})]}),l.jsxs("button",{onClick:()=>o(c=>!c),className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[i?l.jsx(eu,{className:"h-3.5 w-3.5"}):l.jsx(bi,{className:"h-3.5 w-3.5"}),l.jsx(tu,{className:"h-3.5 w-3.5"})," Vorschlag lesen"]}),i&&l.jsx("pre",{className:"max-h-72 overflow-auto rounded-xl border border-border/50 bg-background/50 p-3 text-[11px] leading-relaxed text-foreground/85 whitespace-pre-wrap",children:e.preview})]})}const tJ={sentry:{icon:Ix,label:"Health-Wächter",cls:"text-red-300 bg-red-500/10 border-red-500/25"},alarm:{icon:Lx,label:"Alarm",cls:"text-red-200 bg-red-500/15 border-red-500/40"},notify:{icon:CM,label:"Meldung",cls:"text-sky-300 bg-sky-500/10 border-sky-500/25"},"chef-gutachter":{icon:s5,label:"Morgenlage",cls:"text-violet-300 bg-violet-500/10 border-violet-500/25"},radar:{icon:uI,label:"Radar",cls:"text-teal-300 bg-teal-500/10 border-teal-500/25"},auftragsbuch:{icon:tu,label:"Auftragsbuch",cls:"text-primary bg-primary/10 border-primary/25"},zeitmaschine:{icon:Rx,label:"Zeitmaschine",cls:"text-amber-300 bg-amber-500/10 border-amber-500/25"},reminder:{icon:ZN,label:"Erinnerung",cls:"text-amber-300 bg-amber-500/10 border-amber-500/25"},traum:{icon:hi,label:"Traum",cls:"text-violet-300 bg-violet-500/10 border-violet-500/25"}},rJ={icon:nI,label:"Box",cls:"text-muted-foreground bg-background/40 border-border/50"};function nJ(e){return new Date(e*1e3).toLocaleDateString("de-DE",{weekday:"long",day:"2-digit",month:"long"})}function iJ(){const{data:e=[],isLoading:t}=iE(),[r,n]=x.useState(!0),i=x.useMemo(()=>{const o=[];for(const c of e){const u=nJ(c.ts),f=o[o.length-1];f&&f.day===u?f.items.push(c):o.push({day:u,items:[c]})}return o},[e]);return l.jsxs("div",{className:"space-y-7",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Chronik"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Was deine Box von allein getan und gemeldet hat — und die Zeitmaschine, falls du zu einem früheren Stand zurück willst."})]}),l.jsx(aJ,{}),l.jsxs("section",{className:"space-y-4",children:[l.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:[l.jsx(Tx,{className:"h-3.5 w-3.5"})," Verlauf"]}),t&&l.jsxs("div",{className:"flex items-center gap-2 rounded-2xl border border-border/60 bg-card/30 p-6 text-xs text-muted-foreground",children:[l.jsx(Bt,{className:"h-4 w-4 animate-spin"})," Chronik wird geladen …"]}),!t&&e.length===0&&l.jsx("div",{className:"rounded-2xl border border-dashed border-border/60 bg-card/20 p-8 text-center text-xs text-muted-foreground",children:"Noch keine Einträge. Sobald die Box etwas von allein tut oder meldet (Updates, Wächter, Träume), steht es hier."}),i.map(({day:o,items:c})=>l.jsxs("div",{children:[l.jsx("p",{className:"mb-2 text-xs font-bold text-foreground/70",children:o}),l.jsxs("div",{className:"space-y-2 border-l-2 border-border/40 pl-4",children:[(r?c.slice(0,8):c).map(u=>{const f=tJ[u.source]??rJ,h=f.icon;return l.jsxs("div",{className:"relative rounded-xl border border-border/50 bg-card/40 p-3 backdrop-blur-sm",children:[l.jsx("span",{className:"absolute -left-[23px] top-4 h-2.5 w-2.5 rounded-full bg-border ring-4 ring-background/60"}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs("span",{className:J("flex items-center gap-1 rounded-md border px-1.5 py-0.5 text-[10px] font-bold",f.cls),children:[l.jsx(h,{className:"h-3 w-3"})," ",f.label]}),u.subject&&l.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:u.subject}),l.jsx("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground/60",children:new Date(u.ts*1e3).toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})})]}),l.jsx("p",{className:"mt-1.5 whitespace-pre-wrap text-xs leading-relaxed text-foreground/85",children:u.text})]},u.id)}),r&&c.length>8&&l.jsxs("button",{onClick:()=>n(!1),className:"text-[11px] text-muted-foreground underline hover:text-foreground",children:[c.length-8," weitere anzeigen"]})]})]},o))]})]})}function aJ(){const{data:e}=fR(),t=Wr(),{showAlert:r,showConfirm:n,dialogElement:i}=An(),[o,c]=x.useState(null),[u,f]=x.useState(!1),[h,m]=x.useState(!1),p=(e==null?void 0:e.backups)??[],v=h?p:p.slice(0,4);function b(k){const N=k.snapshot.match(/^(\d{4})-?(\d{2})-?(\d{2})[T_-](\d{2})[-:]?(\d{2})/);return N?`${N[3]}.${N[2]}.${N[1]}, ${N[4]}:${N[5]} Uhr`:k.snapshot}async function S(k){c(k.file);try{await xe("/api/zeitmaschine/restore",{method:"POST",body:JSON.stringify({file:k.file})}),r("Zeitmaschine läuft","Die Wiederherstellung wurde gestartet. Die Dienste starten gleich neu — die Zentrale ist kurz weg und meldet sich von selbst zurück. Vorher wurde automatisch ein Sicherheits-Backup des jetzigen Zustands gemacht.")}catch(N){r("Start fehlgeschlagen",String((N==null?void 0:N.message)||N))}finally{c(null)}}async function w(){f(!0);try{const k=await xe("/api/system/backup",{method:"POST"});k.ok?r("Gesichert",`Snapshot ${k.snapshot} wurde angelegt.`):r("Backup fehlgeschlagen",k.error||"Unbekannter Fehler"),t.invalidateQueries({queryKey:$e.zeitmaschine})}catch(k){r("Backup fehlgeschlagen",String((k==null?void 0:k.message)||k))}finally{f(!1)}}return l.jsxs("section",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:[l.jsx(Iw,{className:"h-3.5 w-3.5"})," Zeitmaschine — gesicherte Stände"]}),l.jsxs("button",{onClick:w,disabled:u||!(e!=null&&e.available),className:"flex h-8 items-center gap-1.5 rounded-lg border border-border/60 bg-card/45 px-2.5 text-[11px] font-semibold text-muted-foreground hover:text-foreground hover:border-primary/40 transition-all cursor-pointer disabled:opacity-50",children:[u?l.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(Iw,{className:"h-3.5 w-3.5"})," Jetzt sichern"]})]}),e&&!e.available&&l.jsx("div",{className:"rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-xs text-amber-300",children:"Die Snapshots liegen auf der Box — im lokalen Dev-Modus nicht verfügbar."}),(e==null?void 0:e.available)&&p.length===0&&l.jsx("div",{className:"rounded-2xl border border-dashed border-border/60 bg-card/20 p-5 text-center text-xs text-muted-foreground",children:'Noch keine Snapshots. Das nächtliche Backup (03:30) legt sie automatisch an — oder „Jetzt sichern".'}),v.length>0&&l.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:v.map((k,N)=>l.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl border border-border/50 bg-card/40 p-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("p",{className:"text-xs font-semibold text-foreground",children:[b(k)," ",N===0&&l.jsx("span",{className:"ml-1 rounded bg-emerald-500/10 px-1.5 py-0.5 text-[9px] font-bold text-emerald-300",children:"neuester"})]}),l.jsxs("p",{className:"font-mono text-[10px] text-muted-foreground/70 truncate",title:k.file,children:[k.size_mb.toLocaleString("de-DE")," MB · ",k.file]})]}),l.jsxs("button",{disabled:o!==null,onClick:()=>n("Wirklich zu diesem Stand zurück?",`Die Box wird auf den Snapshot vom ${b(k)} zurückgesetzt (Gedächtnis, Hermes-Config, Modell-Router). Der JETZIGE Zustand wird vorher automatisch gesichert — der Schritt ist also umkehrbar. Die Dienste starten neu, die Zentrale ist kurz weg.`,()=>S(k)),className:"flex h-8 shrink-0 items-center gap-1.5 rounded-lg border border-amber-500/40 bg-amber-500/10 px-2.5 text-[10px] font-bold uppercase tracking-wide text-amber-300 transition-all hover:bg-amber-500/20 cursor-pointer disabled:opacity-50",children:[o===k.file?l.jsx(Bt,{className:"h-3 w-3 animate-spin"}):l.jsx(Rx,{className:"h-3 w-3"})," Zurück"]})]},k.file))}),p.length>4&&!h&&l.jsxs("button",{onClick:()=>m(!0),className:"text-[11px] text-muted-foreground underline hover:text-foreground",children:["Alle ",p.length," Snapshots anzeigen"]}),i]})}const oJ={"":"Allgemein",traeume:"Träume",muster:"Muster","skill-kandidaten":"Skill-Kandidaten","skill-kandidaten/beauftragt":"Skill-Kandidaten · beauftragt","skill-kandidaten/verworfen":"Skill-Kandidaten · verworfen"};function sJ(){const{data:e,isLoading:t}=dR(),[r,n]=x.useState(null),[i,o]=x.useState(null),[c,u]=x.useState(!1),[f,h]=x.useState(""),m=x.useMemo(()=>(e==null?void 0:e.files)??[],[e]),p=x.useMemo(()=>{const w=new Map;for(const k of m)w.set(k.name.toLowerCase(),k.path);return w},[m]),v=x.useMemo(()=>{if(!f.trim())return m;const w=f.toLowerCase();return m.filter(k=>k.title.toLowerCase().includes(w)||k.path.toLowerCase().includes(w))},[m,f]),b=x.useMemo(()=>{const w=[];for(const k of v){const N=w.find(E=>E.dir===k.dir);N?N.files.push(k):w.push({dir:k.dir,files:[k]})}return w.sort((k,N)=>k.dir===""?-1:N.dir===""?1:k.dir.localeCompare(N.dir))},[v]);x.useEffect(()=>{if(!r&&m.length){const w=m.find(k=>k.path.toLowerCase()==="index.md");n((w==null?void 0:w.path)??m[0].path)}},[m,r]),x.useEffect(()=>{r&&(u(!0),xe(`/api/wissen/datei?pfad=${encodeURIComponent(r)}`).then(o).catch(()=>o({path:r,content:"*(Notiz nicht ladbar)*",mtime:0})).finally(()=>u(!1)))},[r]);const S=w=>{const k=p.get(w.toLowerCase());k&&n(k)};return l.jsxs("div",{className:"space-y-5",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Wissen"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Was sich die Box nachts erschließt — Traum-Notizen, Muster und Skill-Ideen aus dem Wissens-Vault, verlinkt wie ein Wiki."})]}),e&&!e.available&&l.jsx("div",{className:"rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-xs text-amber-300",children:"Der Wissens-Vault liegt auf der Box (~/wissens-vault) — im lokalen Dev-Modus nicht verfügbar."}),t&&l.jsxs("div",{className:"flex items-center gap-2 rounded-2xl border border-border/60 bg-card/30 p-6 text-xs text-muted-foreground",children:[l.jsx(Bt,{className:"h-4 w-4 animate-spin"})," Vault wird geladen …"]}),(e==null?void 0:e.available)&&m.length===0&&l.jsx("div",{className:"rounded-2xl border border-dashed border-border/60 bg-card/20 p-8 text-center text-xs text-muted-foreground",children:"Noch keine Notizen. Der nächtliche Traum (03:15) legt sie an — morgen früh steht hier die erste."}),m.length>0&&l.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row",children:[l.jsxs("aside",{className:"w-full shrink-0 space-y-3 lg:w-72",children:[l.jsxs("div",{className:"relative",children:[l.jsx("input",{value:f,onChange:w=>h(w.target.value),type:"search",placeholder:"Notizen durchsuchen…","aria-label":"Notizen durchsuchen",className:"h-9 w-full rounded-lg border border-border/60 bg-card/45 pl-8 pr-3 text-xs text-foreground outline-none focus:ring-1 focus:ring-primary/50"}),l.jsx(Js,{className:"absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),l.jsx("div",{className:"max-h-[70vh] space-y-3 overflow-y-auto pr-1 scrollbar-thin",children:b.map(({dir:w,files:k})=>l.jsxs("div",{children:[l.jsxs("p",{className:"mb-1 flex items-center gap-1 text-[10px] font-bold uppercase tracking-wider text-muted-foreground/60",children:[l.jsx(n5,{className:"h-3 w-3"})," ",oJ[w]??w]}),l.jsx("div",{className:"space-y-0.5",children:k.map(N=>l.jsxs("button",{onClick:()=>n(N.path),className:J("flex w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-left text-xs transition-all cursor-pointer",r===N.path?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:[l.jsx(r5,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{className:"truncate",title:N.title,children:N.name}),N.neu&&l.jsxs("span",{className:"ml-auto flex items-center gap-0.5 rounded bg-violet-500/15 px-1 py-0.5 text-[8px] font-bold uppercase text-violet-300",children:[l.jsx(hi,{className:"h-2.5 w-2.5"}),"neu"]})]},N.path))})]},w||"__root"))})]}),l.jsx("div",{className:"min-w-0 flex-1 rounded-2xl border border-border/60 bg-card/45 p-5 shadow-lg shadow-black/15 backdrop-blur-md",children:c?l.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[l.jsx(Bt,{className:"h-4 w-4 animate-spin"})," Notiz wird geladen …"]}):i?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"mb-3 flex items-center justify-between border-b border-border/40 pb-2",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[l.jsx(Dx,{className:"h-3.5 w-3.5"})," ",i.path]}),i.mtime>0&&l.jsxs("span",{className:"text-[10px] text-muted-foreground/60",children:["Stand ",new Date(i.mtime*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"})]})]}),l.jsx(lJ,{text:i.content,onWikiLink:S,known:p})]}):null})]})]})}function lJ({text:e,onWikiLink:t,known:r}){const n=e.split(` +Achtung: Enthält Frontend-Quelltext ohne gebautes Bundle — die Oberfläche bleibt alt, bis am PC gebaut wird.`:""}`,()=>r(e.branch,"/api/auftragsbuch/annehmen",{branch:e.branch})),className:"flex h-9 items-center gap-1.5 rounded-lg border border-emerald-500/40 bg-emerald-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-emerald-300 transition-all hover:bg-emerald-500/20 cursor-pointer disabled:opacity-50",children:[t[e.branch]?l.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(Mt,{className:"h-3.5 w-3.5"})," Annehmen"]}),l.jsxs("button",{disabled:!!t["ab:"+e.branch],onClick:()=>n("Vorschlag ablehnen?",`Der Branch '${e.branch}' wird auf Gitea gelöscht. Die Arbeit bleibt in der Historie, aber die Karte verschwindet.`,()=>r("ab:"+e.branch,"/api/auftragsbuch/ablehnen",{branch:e.branch})),className:"flex h-9 items-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/5 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300/90 transition-all hover:bg-red-500/15 cursor-pointer disabled:opacity-50",children:[t["ab:"+e.branch]?l.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(nn,{className:"h-3.5 w-3.5"})," Ablehnen"]})]})]}),e.status&&(m||!p)&&e.status.detail&&l.jsx("p",{className:"text-[11px] text-muted-foreground",children:e.status.detail}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[l.jsxs("span",{className:"rounded bg-background/40 px-1.5 py-0.5 font-mono",children:[e.ahead," Commit",e.ahead===1?"":"s"]}),e.shortstat&&l.jsx("span",{className:"rounded bg-background/40 px-1.5 py-0.5 font-mono",children:e.shortstat.trim()}),e.behind>0&&l.jsxs("span",{className:"flex items-center gap-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-300",title:"main ist seit diesem Vorschlag weitergelaufen",children:[l.jsx(vr,{className:"h-3 w-3"})," ",e.behind," hinter main"]}),e.frontend_ohne_build&&l.jsxs("span",{className:"flex items-center gap-1 rounded bg-amber-500/10 px-1.5 py-0.5 text-amber-300",title:"Die Box kann kein Frontend bauen (kein Node) — nach dem Annehmen bleibt die Oberfläche alt, bis am PC gebaut wird.",children:[l.jsx(vr,{className:"h-3 w-3"})," Frontend ohne Build"]})]}),l.jsxs("div",{children:[l.jsxs("button",{onClick:v,className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[i?l.jsx(tu,{className:"h-3.5 w-3.5"}):l.jsx(bi,{className:"h-3.5 w-3.5"}),l.jsx(HM,{className:"h-3.5 w-3.5"})," ",e.files.length," Datei",e.files.length===1?"":"en"," — Änderungen ansehen"]}),i&&l.jsxs("div",{className:"mt-2 space-y-2",children:[l.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.files.map(k=>l.jsxs("span",{className:"rounded bg-background/40 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:[l.jsx("b",{className:J(k.status.startsWith("A")&&"text-emerald-400",k.status.startsWith("D")&&"text-red-400",k.status.startsWith("M")&&"text-sky-400"),children:k.status})," ",k.path]},k.path)),e.files_truncated&&l.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:"…"})]}),l.jsx("div",{className:"max-h-96 overflow-auto rounded-xl border border-border/50 bg-background/50 p-3",children:f?l.jsx("span",{className:"text-[11px] text-muted-foreground",children:"Diff wird geladen …"}):l.jsx("pre",{className:"text-[10px] leading-relaxed text-foreground/80 whitespace-pre",children:(c??"").split(` +`).map((k,N)=>l.jsx("span",{className:J("block",k.startsWith("+")&&!k.startsWith("+++")&&"text-emerald-300/90 bg-emerald-500/5",k.startsWith("-")&&!k.startsWith("---")&&"text-red-300/90 bg-red-500/5",(k.startsWith("@@")||k.startsWith("diff "))&&"text-sky-300/90"),children:k||" "},N))})})]})]})]})}function eJ({k:e,busy:t,onAct:r,showConfirm:n}){const[i,o]=x.useState(!1);return l.jsxs("div",{className:"rounded-2xl border border-violet-500/25 bg-violet-500/[0.04] p-4 shadow-lg shadow-black/15 backdrop-blur-md space-y-3",children:[l.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("span",{className:"rounded-md border border-violet-500/30 bg-violet-500/10 px-1.5 py-0.5 text-[10px] font-bold uppercase tracking-wider text-violet-300",children:"Traum-Idee"}),l.jsx("span",{className:"font-mono text-[11px] text-muted-foreground truncate",children:e.file}),l.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground/70",children:[l.jsx(ph,{className:"h-3 w-3"}),MO(e.mtime)]})]}),l.jsx("p",{className:"mt-1.5 text-sm font-semibold text-foreground",children:e.title})]}),l.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[l.jsxs("button",{disabled:!!t["sk:"+e.file],onClick:()=>n("Werkstatt beauftragen?",`Der Kandidat '${e.title}' geht als Auftrag an die Werkstatt (Orchestrator, propose-only). Das Ergebnis erscheint später als neuer Patch-Vorschlag hier im Auftragsbuch — nichts geht ungefragt live.`,()=>r("sk:"+e.file,"/api/auftragsbuch/skill/annehmen",{file:e.file},"Die Werkstatt arbeitet. Das Ergebnis taucht als neuer Vorschlag im Auftragsbuch auf (das kann einige Minuten dauern).")),className:"flex h-9 items-center gap-1.5 rounded-lg border border-violet-500/40 bg-violet-500/10 px-3 text-[11px] font-bold uppercase tracking-wide text-violet-300 transition-all hover:bg-violet-500/20 cursor-pointer disabled:opacity-50",children:[t["sk:"+e.file]?l.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(QM,{className:"h-3.5 w-3.5"})," Beauftragen"]}),l.jsxs("button",{disabled:!!t["skab:"+e.file],onClick:()=>n("Kandidat verwerfen?",`'${e.title}' wandert ins Archiv des Wissens-Vaults (verworfen/). Der Traum schlägt ihn nicht erneut vor.`,()=>r("skab:"+e.file,"/api/auftragsbuch/skill/ablehnen",{file:e.file})),className:"flex h-9 items-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/5 px-3 text-[11px] font-bold uppercase tracking-wide text-red-300/90 transition-all hover:bg-red-500/15 cursor-pointer disabled:opacity-50",children:[t["skab:"+e.file]?l.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(nn,{className:"h-3.5 w-3.5"})," Verwerfen"]})]})]}),l.jsxs("button",{onClick:()=>o(c=>!c),className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[i?l.jsx(tu,{className:"h-3.5 w-3.5"}):l.jsx(bi,{className:"h-3.5 w-3.5"}),l.jsx(ru,{className:"h-3.5 w-3.5"})," Vorschlag lesen"]}),i&&l.jsx("pre",{className:"max-h-72 overflow-auto rounded-xl border border-border/50 bg-background/50 p-3 text-[11px] leading-relaxed text-foreground/85 whitespace-pre-wrap",children:e.preview})]})}const tJ={sentry:{icon:Tx,label:"Health-Wächter",cls:"text-red-300 bg-red-500/10 border-red-500/25"},alarm:{icon:$x,label:"Alarm",cls:"text-red-200 bg-red-500/15 border-red-500/40"},notify:{icon:PM,label:"Meldung",cls:"text-sky-300 bg-sky-500/10 border-sky-500/25"},"chef-gutachter":{icon:l5,label:"Morgenlage",cls:"text-violet-300 bg-violet-500/10 border-violet-500/25"},radar:{icon:uI,label:"Radar",cls:"text-teal-300 bg-teal-500/10 border-teal-500/25"},auftragsbuch:{icon:ru,label:"Auftragsbuch",cls:"text-primary bg-primary/10 border-primary/25"},zeitmaschine:{icon:Rx,label:"Zeitmaschine",cls:"text-amber-300 bg-amber-500/10 border-amber-500/25"},reminder:{icon:XN,label:"Erinnerung",cls:"text-amber-300 bg-amber-500/10 border-amber-500/25"},traum:{icon:hi,label:"Traum",cls:"text-violet-300 bg-violet-500/10 border-violet-500/25"}},rJ={icon:nI,label:"Box",cls:"text-muted-foreground bg-background/40 border-border/50"};function nJ(e){return new Date(e*1e3).toLocaleDateString("de-DE",{weekday:"long",day:"2-digit",month:"long"})}function iJ(){const{data:e=[],isLoading:t}=aE(),[r,n]=x.useState(!0),i=x.useMemo(()=>{const o=[];for(const c of e){const u=nJ(c.ts),f=o[o.length-1];f&&f.day===u?f.items.push(c):o.push({day:u,items:[c]})}return o},[e]);return l.jsxs("div",{className:"space-y-7",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Chronik"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Was deine Box von allein getan und gemeldet hat — und die Zeitmaschine, falls du zu einem früheren Stand zurück willst."})]}),l.jsx(aJ,{}),l.jsxs("section",{className:"space-y-4",children:[l.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:[l.jsx(Dx,{className:"h-3.5 w-3.5"})," Verlauf"]}),t&&l.jsxs("div",{className:"flex items-center gap-2 rounded-2xl border border-border/60 bg-card/30 p-6 text-xs text-muted-foreground",children:[l.jsx(Bt,{className:"h-4 w-4 animate-spin"})," Chronik wird geladen …"]}),!t&&e.length===0&&l.jsx("div",{className:"rounded-2xl border border-dashed border-border/60 bg-card/20 p-8 text-center text-xs text-muted-foreground",children:"Noch keine Einträge. Sobald die Box etwas von allein tut oder meldet (Updates, Wächter, Träume), steht es hier."}),i.map(({day:o,items:c})=>l.jsxs("div",{children:[l.jsx("p",{className:"mb-2 text-xs font-bold text-foreground/70",children:o}),l.jsxs("div",{className:"space-y-2 border-l-2 border-border/40 pl-4",children:[(r?c.slice(0,8):c).map(u=>{const f=tJ[u.source]??rJ,h=f.icon;return l.jsxs("div",{className:"relative rounded-xl border border-border/50 bg-card/40 p-3 backdrop-blur-sm",children:[l.jsx("span",{className:"absolute -left-[23px] top-4 h-2.5 w-2.5 rounded-full bg-border ring-4 ring-background/60"}),l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsxs("span",{className:J("flex items-center gap-1 rounded-md border px-1.5 py-0.5 text-[10px] font-bold",f.cls),children:[l.jsx(h,{className:"h-3 w-3"})," ",f.label]}),u.subject&&l.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:u.subject}),l.jsx("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground/60",children:new Date(u.ts*1e3).toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})})]}),l.jsx("p",{className:"mt-1.5 whitespace-pre-wrap text-xs leading-relaxed text-foreground/85",children:u.text})]},u.id)}),r&&c.length>8&&l.jsxs("button",{onClick:()=>n(!1),className:"text-[11px] text-muted-foreground underline hover:text-foreground",children:[c.length-8," weitere anzeigen"]})]})]},o))]})]})}function aJ(){const{data:e}=fL(),t=Wr(),{showAlert:r,showConfirm:n,dialogElement:i}=An(),[o,c]=x.useState(null),[u,f]=x.useState(!1),[h,m]=x.useState(!1),p=(e==null?void 0:e.backups)??[],v=h?p:p.slice(0,4);function b(k){const N=k.snapshot.match(/^(\d{4})-?(\d{2})-?(\d{2})[T_-](\d{2})[-:]?(\d{2})/);return N?`${N[3]}.${N[2]}.${N[1]}, ${N[4]}:${N[5]} Uhr`:k.snapshot}async function S(k){c(k.file);try{await xe("/api/zeitmaschine/restore",{method:"POST",body:JSON.stringify({file:k.file})}),r("Zeitmaschine läuft","Die Wiederherstellung wurde gestartet. Die Dienste starten gleich neu — die Zentrale ist kurz weg und meldet sich von selbst zurück. Vorher wurde automatisch ein Sicherheits-Backup des jetzigen Zustands gemacht.")}catch(N){r("Start fehlgeschlagen",String((N==null?void 0:N.message)||N))}finally{c(null)}}async function w(){f(!0);try{const k=await xe("/api/system/backup",{method:"POST"});k.ok?r("Gesichert",`Snapshot ${k.snapshot} wurde angelegt.`):r("Backup fehlgeschlagen",k.error||"Unbekannter Fehler"),t.invalidateQueries({queryKey:$e.zeitmaschine})}catch(k){r("Backup fehlgeschlagen",String((k==null?void 0:k.message)||k))}finally{f(!1)}}return l.jsxs("section",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:[l.jsx(Tw,{className:"h-3.5 w-3.5"})," Zeitmaschine — gesicherte Stände"]}),l.jsxs("button",{onClick:w,disabled:u||!(e!=null&&e.available),className:"flex h-8 items-center gap-1.5 rounded-lg border border-border/60 bg-card/45 px-2.5 text-[11px] font-semibold text-muted-foreground hover:text-foreground hover:border-primary/40 transition-all cursor-pointer disabled:opacity-50",children:[u?l.jsx(Bt,{className:"h-3.5 w-3.5 animate-spin"}):l.jsx(Tw,{className:"h-3.5 w-3.5"})," Jetzt sichern"]})]}),e&&!e.available&&l.jsx("div",{className:"rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-xs text-amber-300",children:"Die Snapshots liegen auf der Box — im lokalen Dev-Modus nicht verfügbar."}),(e==null?void 0:e.available)&&p.length===0&&l.jsx("div",{className:"rounded-2xl border border-dashed border-border/60 bg-card/20 p-5 text-center text-xs text-muted-foreground",children:'Noch keine Snapshots. Das nächtliche Backup (03:30) legt sie automatisch an — oder „Jetzt sichern".'}),v.length>0&&l.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:v.map((k,N)=>l.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl border border-border/50 bg-card/40 p-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("p",{className:"text-xs font-semibold text-foreground",children:[b(k)," ",N===0&&l.jsx("span",{className:"ml-1 rounded bg-emerald-500/10 px-1.5 py-0.5 text-[9px] font-bold text-emerald-300",children:"neuester"})]}),l.jsxs("p",{className:"font-mono text-[10px] text-muted-foreground/70 truncate",title:k.file,children:[k.size_mb.toLocaleString("de-DE")," MB · ",k.file]})]}),l.jsxs("button",{disabled:o!==null,onClick:()=>n("Wirklich zu diesem Stand zurück?",`Die Box wird auf den Snapshot vom ${b(k)} zurückgesetzt (Gedächtnis, Hermes-Config, Modell-Router). Der JETZIGE Zustand wird vorher automatisch gesichert — der Schritt ist also umkehrbar. Die Dienste starten neu, die Zentrale ist kurz weg.`,()=>S(k)),className:"flex h-8 shrink-0 items-center gap-1.5 rounded-lg border border-amber-500/40 bg-amber-500/10 px-2.5 text-[10px] font-bold uppercase tracking-wide text-amber-300 transition-all hover:bg-amber-500/20 cursor-pointer disabled:opacity-50",children:[o===k.file?l.jsx(Bt,{className:"h-3 w-3 animate-spin"}):l.jsx(Rx,{className:"h-3 w-3"})," Zurück"]})]},k.file))}),p.length>4&&!h&&l.jsxs("button",{onClick:()=>m(!0),className:"text-[11px] text-muted-foreground underline hover:text-foreground",children:["Alle ",p.length," Snapshots anzeigen"]}),i]})}const oJ={"":"Allgemein",traeume:"Träume",muster:"Muster","skill-kandidaten":"Skill-Kandidaten","skill-kandidaten/beauftragt":"Skill-Kandidaten · beauftragt","skill-kandidaten/verworfen":"Skill-Kandidaten · verworfen"};function sJ(){const{data:e,isLoading:t}=dL(),[r,n]=x.useState(null),[i,o]=x.useState(null),[c,u]=x.useState(!1),[f,h]=x.useState(""),m=x.useMemo(()=>(e==null?void 0:e.files)??[],[e]),p=x.useMemo(()=>{const w=new Map;for(const k of m)w.set(k.name.toLowerCase(),k.path);return w},[m]),v=x.useMemo(()=>{if(!f.trim())return m;const w=f.toLowerCase();return m.filter(k=>k.title.toLowerCase().includes(w)||k.path.toLowerCase().includes(w))},[m,f]),b=x.useMemo(()=>{const w=[];for(const k of v){const N=w.find(E=>E.dir===k.dir);N?N.files.push(k):w.push({dir:k.dir,files:[k]})}return w.sort((k,N)=>k.dir===""?-1:N.dir===""?1:k.dir.localeCompare(N.dir))},[v]);x.useEffect(()=>{if(!r&&m.length){const w=m.find(k=>k.path.toLowerCase()==="index.md");n((w==null?void 0:w.path)??m[0].path)}},[m,r]),x.useEffect(()=>{r&&(u(!0),xe(`/api/wissen/datei?pfad=${encodeURIComponent(r)}`).then(o).catch(()=>o({path:r,content:"*(Notiz nicht ladbar)*",mtime:0})).finally(()=>u(!1)))},[r]);const S=w=>{const k=p.get(w.toLowerCase());k&&n(k)};return l.jsxs("div",{className:"space-y-5",children:[l.jsxs("div",{children:[l.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Wissen"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"Was sich die Box nachts erschließt — Traum-Notizen, Muster und Skill-Ideen aus dem Wissens-Vault, verlinkt wie ein Wiki."})]}),e&&!e.available&&l.jsx("div",{className:"rounded-2xl border border-amber-500/30 bg-amber-500/5 p-4 text-xs text-amber-300",children:"Der Wissens-Vault liegt auf der Box (~/wissens-vault) — im lokalen Dev-Modus nicht verfügbar."}),t&&l.jsxs("div",{className:"flex items-center gap-2 rounded-2xl border border-border/60 bg-card/30 p-6 text-xs text-muted-foreground",children:[l.jsx(Bt,{className:"h-4 w-4 animate-spin"})," Vault wird geladen …"]}),(e==null?void 0:e.available)&&m.length===0&&l.jsx("div",{className:"rounded-2xl border border-dashed border-border/60 bg-card/20 p-8 text-center text-xs text-muted-foreground",children:"Noch keine Notizen. Der nächtliche Traum (03:15) legt sie an — morgen früh steht hier die erste."}),m.length>0&&l.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row",children:[l.jsxs("aside",{className:"w-full shrink-0 space-y-3 lg:w-72",children:[l.jsxs("div",{className:"relative",children:[l.jsx("input",{value:f,onChange:w=>h(w.target.value),type:"search",placeholder:"Notizen durchsuchen…","aria-label":"Notizen durchsuchen",className:"h-9 w-full rounded-lg border border-border/60 bg-card/45 pl-8 pr-3 text-xs text-foreground outline-none focus:ring-1 focus:ring-primary/50"}),l.jsx(Js,{className:"absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),l.jsx("div",{className:"max-h-[70vh] space-y-3 overflow-y-auto pr-1 scrollbar-thin",children:b.map(({dir:w,files:k})=>l.jsxs("div",{children:[l.jsxs("p",{className:"mb-1 flex items-center gap-1 text-[10px] font-bold uppercase tracking-wider text-muted-foreground/60",children:[l.jsx(i5,{className:"h-3 w-3"})," ",oJ[w]??w]}),l.jsx("div",{className:"space-y-0.5",children:k.map(N=>l.jsxs("button",{onClick:()=>n(N.path),className:J("flex w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-left text-xs transition-all cursor-pointer",r===N.path?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:[l.jsx(n5,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{className:"truncate",title:N.title,children:N.name}),N.neu&&l.jsxs("span",{className:"ml-auto flex items-center gap-0.5 rounded bg-violet-500/15 px-1 py-0.5 text-[8px] font-bold uppercase text-violet-300",children:[l.jsx(hi,{className:"h-2.5 w-2.5"}),"neu"]})]},N.path))})]},w||"__root"))})]}),l.jsx("div",{className:"min-w-0 flex-1 rounded-2xl border border-border/60 bg-card/45 p-5 shadow-lg shadow-black/15 backdrop-blur-md",children:c?l.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[l.jsx(Bt,{className:"h-4 w-4 animate-spin"})," Notiz wird geladen …"]}):i?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"mb-3 flex items-center justify-between border-b border-border/40 pb-2",children:[l.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[l.jsx(Lx,{className:"h-3.5 w-3.5"})," ",i.path]}),i.mtime>0&&l.jsxs("span",{className:"text-[10px] text-muted-foreground/60",children:["Stand ",new Date(i.mtime*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"})]})]}),l.jsx(lJ,{text:i.content,onWikiLink:S,known:p})]}):null})]})]})}function lJ({text:e,onWikiLink:t,known:r}){const n=e.split(` `),i=[];let o=[],c=null;const u=f=>{o.length&&(i.push(l.jsx("ul",{className:"mb-3 ml-4 list-disc space-y-1",children:o},f)),o=[])};return n.forEach((f,h)=>{const m=`l${h}`;if(c!==null){f.trimEnd()==="```"?(i.push(l.jsx("pre",{className:"mb-3 overflow-x-auto rounded-xl border border-border/50 bg-background/50 p-3 font-mono text-[11px] leading-relaxed text-foreground/85",children:c.join(` -`)},m)),c=null):c.push(f);return}if(f.trimStart().startsWith("```")){u(m),c=[];return}const p=f.trimEnd();if(!p.trim()){u(m);return}const v=p.match(/^(#{1,4})\s+(.*)$/);if(v){u(m);const S=v[1].length,w=S===1?"text-lg font-bold mt-1 mb-3":S===2?"text-base font-bold mt-4 mb-2":"text-sm font-bold mt-3 mb-1.5";i.push(l.jsx("p",{className:J(w,"font-space text-foreground"),children:Xg(v[2],t,r,m)},m));return}const b=p.match(/^\s*[-*•]\s+(.*)$/);if(b){o.push(l.jsx("li",{className:"text-xs leading-relaxed text-foreground/85",children:Xg(b[1],t,r,m)},m));return}u(m),i.push(l.jsx("p",{className:"mb-2 text-xs leading-relaxed text-foreground/85",children:Xg(p,t,r,m)},m))}),u("end"),c!==null&&i.push(l.jsx("pre",{className:"mb-3 overflow-x-auto rounded-xl border border-border/50 bg-background/50 p-3 font-mono text-[11px]",children:c.join(` -`)},"code-end")),l.jsx("div",{className:"max-w-3xl",children:i})}function Xg(e,t,r,n){return e.split(/(\[\[[^\]]+\]\]|\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`)/g).map((o,c)=>{const u=`${n}-${c}`,f=o.match(/^\[\[([^\]|]+)(?:\|([^\]]+))?\]\]$/);if(f){const h=f[1].trim(),m=(f[2]??f[1]).trim();return r.has(h.toLowerCase())?l.jsx("button",{onClick:()=>t(h),className:"rounded bg-primary/10 px-1 text-primary underline decoration-primary/40 underline-offset-2 hover:bg-primary/20 cursor-pointer",children:m},u):l.jsx("span",{className:"rounded bg-background/40 px-1 text-muted-foreground",title:"Notiz existiert (noch) nicht",children:m},u)}return o.startsWith("**")&&o.endsWith("**")?l.jsx("b",{className:"font-semibold text-foreground",children:o.slice(2,-2)},u):o.startsWith("*")&&o.endsWith("*")&&o.length>2?l.jsx("i",{children:o.slice(1,-1)},u):o.startsWith("`")&&o.endsWith("`")?l.jsx("code",{className:"rounded bg-background/50 px-1 font-mono text-[11px] text-teal-300",children:o.slice(1,-1)},u):l.jsx("span",{children:o},u)})}function cJ(){var S,w,k,N,E;lL();const[e,t]=x.useState(()=>{const A=window.location.hash.slice(1);return pc.some(C=>C.id===A)?A:"dashboard"}),r=x.useCallback(A=>{window.location.hash.slice(1)===A?t(A):window.location.hash=A},[]),[n,i]=x.useState(()=>localStorage.getItem("mc_sidebar_collapsed")==="true"),[o,c]=x.useState(!1),[u,f]=x.useState("maintenance"),[h,m]=x.useState(()=>window.location.hash==="#mc3"),{data:p}=Hx(),{data:v}=Po(2e4);x.useEffect(()=>{document.documentElement.classList.add("dark")},[]),x.useEffect(()=>{const A=C=>{var O;f(((O=C.detail)==null?void 0:O.tab)||"maintenance"),c(!0)};return window.addEventListener("open-system-drawer",A),()=>window.removeEventListener("open-system-drawer",A)},[]),x.useEffect(()=>{const A=C=>{var O;const _=(O=C.detail)==null?void 0:O.view;_&&r(_)};return window.addEventListener("mc-navigate",A),()=>window.removeEventListener("mc-navigate",A)},[r]),x.useEffect(()=>{const A=()=>{m(window.location.hash==="#mc3");const C=window.location.hash.slice(1);pc.some(_=>_.id===C)&&t(C)};return window.addEventListener("hashchange",A),()=>window.removeEventListener("hashchange",A)},[]);const b=pc.find(A=>A.id===e);return h?l.jsx(LX,{}):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(PD,{onNavigate:r}),l.jsx(mE,{open:o,onClose:()=>c(!1),defaultTab:u}),l.jsxs("aside",{className:J("flex shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md transition-all duration-300 ease-in-out",n?"w-16":"w-60"),children:[l.jsxs("div",{className:J("flex items-center py-4 border-b border-border/40 shrink-0",n?"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"}),!n&&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:()=>{i(A=>{const C=!A;return localStorage.setItem("mc_sidebar_collapsed",C.toString()),C})},className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":n?"Seitenleiste ausklappen":"Seitenleiste einklappen",title:n?"Maximieren":"Minimieren",children:n?l.jsx(bi,{className:"h-4 w-4","aria-hidden":"true"}):l.jsx(TM,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4 overflow-y-auto",children:pc.map(A=>l.jsxs("a",{href:`#${A.id}`,"aria-current":e===A.id?"page":void 0,className:J("flex w-full items-center rounded-md text-sm transition-all cursor-pointer",n?"justify-center p-2.5":"gap-3 px-3 py-2",e===A.id?"bg-primary/15 text-primary shadow-sm shadow-primary/5":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),title:n?A.label:void 0,"aria-label":n?A.label:void 0,children:[l.jsx(A.icon,{className:"h-4.5 w-4.5 shrink-0","aria-hidden":"true"}),!n&&l.jsx("span",{className:"truncate",children:A.label})]},A.id))}),l.jsx("div",{className:J("py-3 text-xs text-muted-foreground border-t border-border/40 shrink-0",n?"px-2 text-center":"px-5"),children:n?l.jsx("div",{className:"flex justify-center",children:l.jsx("span",{className:J("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",p?p.engine_reachable?p.brain&&!p.brain.ready?"bg-amber-500 animate-pulse":"bg-emerald-500 animate-pulse":"bg-amber-500":"bg-red-500"),title:p?p.engine_reachable?p.brain&&!p.brain.ready?`Hirn offline (${p.brain.model??"fast"})`:"Engine + Hirn online":"Engine offline":"Backend offline"})}):l.jsxs("div",{className:"space-y-2 text-left",children:[p?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:J("h-2 w-2 rounded-full animate-pulse",p.engine_reachable?"bg-emerald-500":"bg-amber-500")}),l.jsxs("span",{className:"truncate",children:["Engine ",p.engine_reachable?"online":"offline"]})]}),p.brain&&!p.brain.ready&&l.jsxs("span",{className:"flex items-center gap-2 text-amber-400",title:`Agent-Hirn '${p.brain.model??"fast"}' lädt nicht/abgestürzt`,children:[l.jsx("span",{className:"h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),l.jsxs("span",{className:"truncate",children:["Hirn offline",p.brain.model?` (${p.brain.model})`:""]})]})]}):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"})]}),(v==null?void 0:v.versions)&&l.jsxs("div",{className:"space-y-1 text-[9px] text-muted-foreground/60 mt-2 pt-2 border-t border-border/30",children:[l.jsxs("div",{className:"truncate",title:v.versions.mc2?`${v.versions.mc2.branch}-${v.versions.mc2.hash}${v.versions.mc2.dirty?"*":""} (${v.versions.mc2.date})`:"nicht gefunden",children:[l.jsx("strong",{children:"MC2:"})," ",v.versions.mc2?`${v.versions.mc2.hash}${v.versions.mc2.dirty?"*":""}`:"—"]}),l.jsxs("div",{className:"truncate",title:((S=v.versions.engine)==null?void 0:S.type)==="git"?`${v.versions.engine.branch}-${v.versions.engine.hash}${v.versions.engine.dirty?"*":""} (${v.versions.engine.date})`:((w=v.versions.engine)==null?void 0:w.version_text)||"unbekannt",children:[l.jsx("strong",{children:"Engine:"})," ",((k=v.versions.engine)==null?void 0:k.type)==="git"?`${v.versions.engine.hash}${v.versions.engine.dirty?"*":""}`:((E=(N=v.versions.engine)==null?void 0:N.version_text)==null?void 0:E.split(" ").pop())||"—"]}),l.jsxs("div",{className:"truncate",title:v.versions.hermes_agent?`${v.versions.hermes_agent.branch}-${v.versions.hermes_agent.hash}${v.versions.hermes_agent.dirty?"*":""} (${v.versions.hermes_agent.date})`:"nicht gefunden",children:[l.jsx("strong",{children:"Hermes Agent:"})," ",v.versions.hermes_agent?`${v.versions.hermes_agent.hash}${v.versions.hermes_agent.dirty?"*":""}`:"—"]})]})]})})]}),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:b.hint}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(tE,{}),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.jsxs("button",{onClick:()=>{const A=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(A)},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(FM,{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:[e==="dashboard"&&l.jsx(GX,{onNavigate:A=>r(A)}),e==="auftraege"&&l.jsx(ZX,{}),e==="models"&&l.jsx(LR,{}),e==="connect"&&l.jsx(dE,{}),e==="memory"&&l.jsx(fE,{}),e==="wissen"&&l.jsx(sJ,{}),e==="chronik"&&l.jsx(iJ,{}),e==="agent"&&l.jsx(hE,{}),e==="konsole"&&l.jsx(GR,{}),e==="guide"&&l.jsx(qR,{}),!["dashboard","auftraege","models","connect","memory","wissen","chronik","agent","konsole","guide"].includes(e)&&l.jsx(QR,{title:b.label,hint:b.hint})]})]})]})}class uJ extends Ax.Component{constructor(){super(...arguments);is(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,n){console.error("Unbehandelter UI-Fehler:",r,n.componentStack)}render(){return this.state.error?l.jsx("div",{className:"min-h-screen flex items-center justify-center bg-neutral-950 text-neutral-200 p-8",children:l.jsxs("div",{className:"max-w-lg space-y-4 text-center",children:[l.jsx("div",{className:"text-2xl",children:"Da ist etwas schiefgelaufen."}),l.jsx("div",{className:"text-sm text-neutral-400 break-all",children:this.state.error.message}),l.jsx("button",{className:"px-4 py-2 rounded-lg bg-neutral-800 hover:bg-neutral-700 border border-neutral-700",onClick:()=>window.location.reload(),children:"Neu laden"})]})}):this.props.children}}const dJ=new dM({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5e3}}});z4.createRoot(document.getElementById("root")).render(l.jsx(Ax.StrictMode,{children:l.jsx(uJ,{children:l.jsx(fM,{client:dJ,children:l.jsx(cJ,{})})})}));export{mo as R,hi as S,Pc as T,pI as a,Ex as g,l as j,x as r}; +`)},m)),c=null):c.push(f);return}if(f.trimStart().startsWith("```")){u(m),c=[];return}const p=f.trimEnd();if(!p.trim()){u(m);return}const v=p.match(/^(#{1,4})\s+(.*)$/);if(v){u(m);const S=v[1].length,w=S===1?"text-lg font-bold mt-1 mb-3":S===2?"text-base font-bold mt-4 mb-2":"text-sm font-bold mt-3 mb-1.5";i.push(l.jsx("p",{className:J(w,"font-space text-foreground"),children:Jg(v[2],t,r,m)},m));return}const b=p.match(/^\s*[-*•]\s+(.*)$/);if(b){o.push(l.jsx("li",{className:"text-xs leading-relaxed text-foreground/85",children:Jg(b[1],t,r,m)},m));return}u(m),i.push(l.jsx("p",{className:"mb-2 text-xs leading-relaxed text-foreground/85",children:Jg(p,t,r,m)},m))}),u("end"),c!==null&&i.push(l.jsx("pre",{className:"mb-3 overflow-x-auto rounded-xl border border-border/50 bg-background/50 p-3 font-mono text-[11px]",children:c.join(` +`)},"code-end")),l.jsx("div",{className:"max-w-3xl",children:i})}function Jg(e,t,r,n){return e.split(/(\[\[[^\]]+\]\]|\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`)/g).map((o,c)=>{const u=`${n}-${c}`,f=o.match(/^\[\[([^\]|]+)(?:\|([^\]]+))?\]\]$/);if(f){const h=f[1].trim(),m=(f[2]??f[1]).trim();return r.has(h.toLowerCase())?l.jsx("button",{onClick:()=>t(h),className:"rounded bg-primary/10 px-1 text-primary underline decoration-primary/40 underline-offset-2 hover:bg-primary/20 cursor-pointer",children:m},u):l.jsx("span",{className:"rounded bg-background/40 px-1 text-muted-foreground",title:"Notiz existiert (noch) nicht",children:m},u)}return o.startsWith("**")&&o.endsWith("**")?l.jsx("b",{className:"font-semibold text-foreground",children:o.slice(2,-2)},u):o.startsWith("*")&&o.endsWith("*")&&o.length>2?l.jsx("i",{children:o.slice(1,-1)},u):o.startsWith("`")&&o.endsWith("`")?l.jsx("code",{className:"rounded bg-background/50 px-1 font-mono text-[11px] text-teal-300",children:o.slice(1,-1)},u):l.jsx("span",{children:o},u)})}function cJ(){var S,w,k,N,E;lR();const[e,t]=x.useState(()=>{const A=window.location.hash.slice(1);return pc.some(C=>C.id===A)?A:"dashboard"}),r=x.useCallback(A=>{window.location.hash.slice(1)===A?t(A):window.location.hash=A},[]),[n,i]=x.useState(()=>localStorage.getItem("mc_sidebar_collapsed")==="true"),[o,c]=x.useState(!1),[u,f]=x.useState("maintenance"),[h,m]=x.useState(()=>window.location.hash==="#mc3"),{data:p}=Kx(),{data:v}=Po(2e4);x.useEffect(()=>{document.documentElement.classList.add("dark")},[]),x.useEffect(()=>{const A=C=>{var O;f(((O=C.detail)==null?void 0:O.tab)||"maintenance"),c(!0)};return window.addEventListener("open-system-drawer",A),()=>window.removeEventListener("open-system-drawer",A)},[]),x.useEffect(()=>{const A=C=>{var O;const _=(O=C.detail)==null?void 0:O.view;_&&r(_)};return window.addEventListener("mc-navigate",A),()=>window.removeEventListener("mc-navigate",A)},[r]),x.useEffect(()=>{const A=()=>{m(window.location.hash==="#mc3");const C=window.location.hash.slice(1);pc.some(_=>_.id===C)&&t(C)};return window.addEventListener("hashchange",A),()=>window.removeEventListener("hashchange",A)},[]);const b=pc.find(A=>A.id===e);return h?l.jsx(RX,{}):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(PD,{onNavigate:r}),l.jsx(pE,{open:o,onClose:()=>c(!1),defaultTab:u}),l.jsxs("aside",{className:J("flex shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md transition-all duration-300 ease-in-out",n?"w-16":"w-60"),children:[l.jsxs("div",{className:J("flex items-center py-4 border-b border-border/40 shrink-0",n?"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"}),!n&&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:()=>{i(A=>{const C=!A;return localStorage.setItem("mc_sidebar_collapsed",C.toString()),C})},className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer","aria-label":n?"Seitenleiste ausklappen":"Seitenleiste einklappen",title:n?"Maximieren":"Minimieren",children:n?l.jsx(bi,{className:"h-4 w-4","aria-hidden":"true"}):l.jsx(DM,{className:"h-4 w-4","aria-hidden":"true"})})]}),l.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4 overflow-y-auto",children:pc.map(A=>l.jsxs("a",{href:`#${A.id}`,"aria-current":e===A.id?"page":void 0,className:J("flex w-full items-center rounded-md text-sm transition-all cursor-pointer",n?"justify-center p-2.5":"gap-3 px-3 py-2",e===A.id?"bg-primary/15 text-primary shadow-sm shadow-primary/5":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),title:n?A.label:void 0,"aria-label":n?A.label:void 0,children:[l.jsx(A.icon,{className:"h-4.5 w-4.5 shrink-0","aria-hidden":"true"}),!n&&l.jsx("span",{className:"truncate",children:A.label})]},A.id))}),l.jsx("div",{className:J("py-3 text-xs text-muted-foreground border-t border-border/40 shrink-0",n?"px-2 text-center":"px-5"),children:n?l.jsx("div",{className:"flex justify-center",children:l.jsx("span",{className:J("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",p?p.engine_reachable?p.brain&&!p.brain.ready?"bg-amber-500 animate-pulse":"bg-emerald-500 animate-pulse":"bg-amber-500":"bg-red-500"),title:p?p.engine_reachable?p.brain&&!p.brain.ready?`Hirn offline (${p.brain.model??"fast"})`:"Engine + Hirn online":"Engine offline":"Backend offline"})}):l.jsxs("div",{className:"space-y-2 text-left",children:[p?l.jsxs(l.Fragment,{children:[l.jsxs("span",{className:"flex items-center gap-2",children:[l.jsx("span",{className:J("h-2 w-2 rounded-full animate-pulse",p.engine_reachable?"bg-emerald-500":"bg-amber-500")}),l.jsxs("span",{className:"truncate",children:["Engine ",p.engine_reachable?"online":"offline"]})]}),p.brain&&!p.brain.ready&&l.jsxs("span",{className:"flex items-center gap-2 text-amber-400",title:`Agent-Hirn '${p.brain.model??"fast"}' lädt nicht/abgestürzt`,children:[l.jsx("span",{className:"h-2 w-2 rounded-full bg-amber-500 animate-pulse"}),l.jsxs("span",{className:"truncate",children:["Hirn offline",p.brain.model?` (${p.brain.model})`:""]})]})]}):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"})]}),(v==null?void 0:v.versions)&&l.jsxs("div",{className:"space-y-1 text-[9px] text-muted-foreground/60 mt-2 pt-2 border-t border-border/30",children:[l.jsxs("div",{className:"truncate",title:v.versions.mc2?`${v.versions.mc2.branch}-${v.versions.mc2.hash}${v.versions.mc2.dirty?"*":""} (${v.versions.mc2.date})`:"nicht gefunden",children:[l.jsx("strong",{children:"MC2:"})," ",v.versions.mc2?`${v.versions.mc2.hash}${v.versions.mc2.dirty?"*":""}`:"—"]}),l.jsxs("div",{className:"truncate",title:((S=v.versions.engine)==null?void 0:S.type)==="git"?`${v.versions.engine.branch}-${v.versions.engine.hash}${v.versions.engine.dirty?"*":""} (${v.versions.engine.date})`:((w=v.versions.engine)==null?void 0:w.version_text)||"unbekannt",children:[l.jsx("strong",{children:"Engine:"})," ",((k=v.versions.engine)==null?void 0:k.type)==="git"?`${v.versions.engine.hash}${v.versions.engine.dirty?"*":""}`:((E=(N=v.versions.engine)==null?void 0:N.version_text)==null?void 0:E.split(" ").pop())||"—"]}),l.jsxs("div",{className:"truncate",title:v.versions.hermes_agent?`${v.versions.hermes_agent.branch}-${v.versions.hermes_agent.hash}${v.versions.hermes_agent.dirty?"*":""} (${v.versions.hermes_agent.date})`:"nicht gefunden",children:[l.jsx("strong",{children:"Hermes Agent:"})," ",v.versions.hermes_agent?`${v.versions.hermes_agent.hash}${v.versions.hermes_agent.dirty?"*":""}`:"—"]})]})]})})]}),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:b.hint}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(rE,{}),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.jsxs("button",{onClick:()=>{const A=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(A)},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(BM,{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:[e==="dashboard"&&l.jsx(GX,{onNavigate:A=>r(A)}),e==="auftraege"&&l.jsx(ZX,{}),e==="models"&&l.jsx(RL,{}),e==="connect"&&l.jsx(fE,{}),e==="memory"&&l.jsx(hE,{}),e==="wissen"&&l.jsx(sJ,{}),e==="chronik"&&l.jsx(iJ,{}),e==="agent"&&l.jsx(mE,{}),e==="konsole"&&l.jsx(GL,{}),e==="guide"&&l.jsx(qL,{}),!["dashboard","auftraege","models","connect","memory","wissen","chronik","agent","konsole","guide"].includes(e)&&l.jsx(QL,{title:b.label,hint:b.hint})]})]})]})}class uJ extends Cx.Component{constructor(){super(...arguments);is(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}componentDidCatch(r,n){console.error("Unbehandelter UI-Fehler:",r,n.componentStack)}render(){return this.state.error?l.jsx("div",{className:"min-h-screen flex items-center justify-center bg-neutral-950 text-neutral-200 p-8",children:l.jsxs("div",{className:"max-w-lg space-y-4 text-center",children:[l.jsx("div",{className:"text-2xl",children:"Da ist etwas schiefgelaufen."}),l.jsx("div",{className:"text-sm text-neutral-400 break-all",children:this.state.error.message}),l.jsx("button",{className:"px-4 py-2 rounded-lg bg-neutral-800 hover:bg-neutral-700 border border-neutral-700",onClick:()=>window.location.reload(),children:"Neu laden"})]})}):this.props.children}}const dJ=new fM({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5e3}}});F4.createRoot(document.getElementById("root")).render(l.jsx(Cx.StrictMode,{children:l.jsx(uJ,{children:l.jsx(hM,{client:dJ,children:l.jsx(cJ,{})})})}));export{mo as R,hi as S,Oc as T,pI as a,Ax as g,l as j,x as r}; diff --git a/frontend/dist/assets/index-C7eDy97i.css b/frontend/dist/assets/index-DndftNG6.css similarity index 59% rename from frontend/dist/assets/index-C7eDy97i.css rename to frontend/dist/assets/index-DndftNG6.css index 7d21249..00f04d2 100644 --- a/frontend/dist/assets/index-C7eDy97i.css +++ b/frontend/dist/assets/index-DndftNG6.css @@ -1 +1 @@ -@import"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap";/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:"Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-lime-400:oklch(84.1% .238 128.85);--color-lime-500:oklch(76.8% .233 130.85);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-teal-300:oklch(85.5% .138 181.071);--color-teal-400:oklch(77.7% .152 181.912);--color-teal-500:oklch(70.4% .14 182.503);--color-cyan-200:oklch(91.7% .08 205.041);--color-cyan-300:oklch(86.5% .127 207.078);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-sky-300:oklch(82.8% .111 230.318);--color-sky-400:oklch(74.6% .16 232.661);--color-sky-500:oklch(68.5% .169 237.323);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-500:oklch(62.3% .214 259.815);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-violet-200:oklch(89.4% .057 293.283);--color-violet-300:oklch(81.1% .111 293.571);--color-violet-400:oklch(70.2% .183 293.541);--color-violet-500:oklch(60.6% .25 292.717);--color-purple-300:oklch(82.7% .119 306.383);--color-purple-500:oklch(62.7% .265 303.9);--color-fuchsia-300:oklch(83.3% .145 321.434);--color-fuchsia-400:oklch(74% .238 322.16);--color-fuchsia-500:oklch(66.7% .295 322.15);--color-pink-400:oklch(71.8% .202 349.761);--color-pink-500:oklch(65.6% .241 354.308);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-neutral-200:oklch(92.2% 0 0);--color-neutral-400:oklch(70.8% 0 0);--color-neutral-700:oklch(37.1% 0 0);--color-neutral-800:oklch(26.9% 0 0);--color-neutral-950:oklch(14.5% 0 0);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-normal:1.5;--leading-relaxed:1.625;--radius-xl:.75rem;--radius-2xl:1rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--blur-md:12px;--blur-xl:24px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:"Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;--default-mono-font-family:"JetBrains Mono", ui-monospace, SFMono-Regular, monospace}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{inset-block:0}.-top-0\.5{top:calc(var(--spacing) * -.5)}.top-0{top:0}.top-1\/2{top:50%}.top-2\.5{top:calc(var(--spacing) * 2.5)}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.top-\[-10\%\]{top:-10%}.top-\[30\%\]{top:30%}.-right-0\.5{right:calc(var(--spacing) * -.5)}.right-0{right:0}.right-3{right:calc(var(--spacing) * 3)}.right-\[-10\%\]{right:-10%}.right-\[20\%\]{right:20%}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-\[-10\%\]{bottom:-10%}.-left-\[23px\]{left:-23px}.left-2{left:calc(var(--spacing) * 2)}.left-2\.5{left:calc(var(--spacing) * 2.5)}.left-3{left:calc(var(--spacing) * 3)}.left-\[-10\%\]{left:-10%}.isolate{isolation:isolate}.isolation-auto{isolation:auto}.-z-50{z-index:-50}.z-10{z-index:10}.z-50{z-index:50}.z-\[60\]{z-index:60}.z-\[99\]{z-index:99}.col-span-full{grid-column:1/-1}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.mx-auto{margin-inline:auto}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-3\.5{margin-top:calc(var(--spacing) * 3.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.mr-0\.5{margin-right:calc(var(--spacing) * .5)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-1{margin-bottom:var(--spacing)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-1{margin-left:var(--spacing)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-6{-webkit-line-clamp:6;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.flow-root{display:flow-root}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.inline-table{display:inline-table}.list-item{display:list-item}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-column{display:table-column}.table-column-group{display:table-column-group}.table-footer-group{display:table-footer-group}.table-header-group{display:table-header-group}.table-row{display:table-row}.table-row-group{display:table-row-group}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-4\.5{height:calc(var(--spacing) * 4.5)}.h-5{height:calc(var(--spacing) * 5)}.h-5\.5{height:calc(var(--spacing) * 5.5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-24{height:calc(var(--spacing) * 24)}.h-28{height:calc(var(--spacing) * 28)}.h-44{height:calc(var(--spacing) * 44)}.h-\[40\%\]{height:40%}.h-\[50\%\]{height:50%}.h-\[120px\]{height:120px}.h-\[150px\]{height:150px}.h-\[480px\]{height:480px}.h-\[calc\(100vh-13rem\)\]{height:calc(100vh - 13rem)}.h-full{height:100%}.h-px{height:1px}.max-h-20{max-height:calc(var(--spacing) * 20)}.max-h-36{max-height:calc(var(--spacing) * 36)}.max-h-56{max-height:calc(var(--spacing) * 56)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[60vh\]{max-height:60vh}.max-h-\[70vh\]{max-height:70vh}.max-h-\[80vh\]{max-height:80vh}.min-h-\[16rem\]{min-height:16rem}.min-h-\[58vh\]{min-height:58vh}.min-h-\[90px\]{min-height:90px}.min-h-\[300px\]{min-height:300px}.min-h-\[560px\]{min-height:560px}.min-h-screen{min-height:100vh}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-4\.5{width:calc(var(--spacing) * 4.5)}.w-5{width:calc(var(--spacing) * 5)}.w-5\.5{width:calc(var(--spacing) * 5.5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-24{width:calc(var(--spacing) * 24)}.w-40{width:calc(var(--spacing) * 40)}.w-52{width:calc(var(--spacing) * 52)}.w-56{width:calc(var(--spacing) * 56)}.w-60{width:calc(var(--spacing) * 60)}.w-\[40\%\]{width:40%}.w-\[50\%\]{width:50%}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[16rem\]{max-width:16rem}.max-w-\[120px\]{max-width:120px}.max-w-\[180px\]{max-width:180px}.max-w-\[250px\]{max-width:250px}.max-w-\[260px\]{max-width:260px}.max-w-\[280px\]{max-width:280px}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-\[2\.5rem\]{min-width:2.5rem}.min-w-\[2rem\]{min-width:2rem}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.translate-x-0{--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-full{--tw-translate-x:100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-pinch-zoom{--tw-pinch-zoom:pinch-zoom;touch-action:var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)}.resize{resize:both}.resize-none{resize:none}.scroll-mt-20{scroll-margin-top:calc(var(--spacing) * 20)}.scrollbar-thin{scrollbar-width:thin}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-7>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 7) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 7) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-reverse>:not(:last-child)){--tw-space-y-reverse:1}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}:where(.space-x-reverse>:not(:last-child)){--tw-space-x-reverse:1}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px * var(--tw-divide-x-reverse));border-inline-end-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-y-reverse>:not(:last-child)){--tw-divide-y-reverse:1}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-s{border-start-start-radius:.25rem;border-end-start-radius:.25rem}.rounded-ss{border-start-start-radius:.25rem}.rounded-e{border-start-end-radius:.25rem;border-end-end-radius:.25rem}.rounded-se{border-start-end-radius:.25rem}.rounded-ee{border-end-end-radius:.25rem}.rounded-es{border-end-start-radius:.25rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-tl{border-top-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-tr{border-top-right-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-br{border-bottom-right-radius:.25rem}.rounded-bl{border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-2{border-top-style:var(--tw-border-style);border-top-width:2px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-amber-500\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/20{border-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.border-amber-500\/25{border-color:#f99c0040}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/25{border-color:color-mix(in oklab,var(--color-amber-500) 25%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500) 30%,transparent)}}.border-amber-500\/40{border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/40{border-color:color-mix(in oklab,var(--color-amber-500) 40%,transparent)}}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500) 50%,transparent)}}.border-blue-500\/30{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/30{border-color:color-mix(in oklab,var(--color-blue-500) 30%,transparent)}}.border-border,.border-border\/20{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/20{border-color:color-mix(in oklab,hsl(var(--border)) 20%,transparent)}}.border-border\/30{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/30{border-color:color-mix(in oklab,hsl(var(--border)) 30%,transparent)}}.border-border\/40{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/40{border-color:color-mix(in oklab,hsl(var(--border)) 40%,transparent)}}.border-border\/50{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,hsl(var(--border)) 50%,transparent)}}.border-border\/60{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/60{border-color:color-mix(in oklab,hsl(var(--border)) 60%,transparent)}}.border-border\/70{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/70{border-color:color-mix(in oklab,hsl(var(--border)) 70%,transparent)}}.border-border\/80{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/80{border-color:color-mix(in oklab,hsl(var(--border)) 80%,transparent)}}.border-cyan-500\/20{border-color:#00b7d733}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/20{border-color:color-mix(in oklab,var(--color-cyan-500) 20%,transparent)}}.border-cyan-500\/25{border-color:#00b7d740}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/25{border-color:color-mix(in oklab,var(--color-cyan-500) 25%,transparent)}}.border-cyan-500\/30{border-color:#00b7d74d}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/30{border-color:color-mix(in oklab,var(--color-cyan-500) 30%,transparent)}}.border-emerald-500\/10{border-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/10{border-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.border-emerald-500\/15{border-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/15{border-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.border-emerald-500\/20{border-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/20{border-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.border-emerald-500\/25{border-color:#00bb7f40}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/25{border-color:color-mix(in oklab,var(--color-emerald-500) 25%,transparent)}}.border-emerald-500\/30{border-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/30{border-color:color-mix(in oklab,var(--color-emerald-500) 30%,transparent)}}.border-emerald-500\/40{border-color:#00bb7f66}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/40{border-color:color-mix(in oklab,var(--color-emerald-500) 40%,transparent)}}.border-fuchsia-500\/25{border-color:#e12afb40}@supports (color:color-mix(in lab,red,red)){.border-fuchsia-500\/25{border-color:color-mix(in oklab,var(--color-fuchsia-500) 25%,transparent)}}.border-fuchsia-500\/30{border-color:#e12afb4d}@supports (color:color-mix(in lab,red,red)){.border-fuchsia-500\/30{border-color:color-mix(in oklab,var(--color-fuchsia-500) 30%,transparent)}}.border-fuchsia-500\/40{border-color:#e12afb66}@supports (color:color-mix(in lab,red,red)){.border-fuchsia-500\/40{border-color:color-mix(in oklab,var(--color-fuchsia-500) 40%,transparent)}}.border-indigo-500\/25{border-color:#625fff40}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/25{border-color:color-mix(in oklab,var(--color-indigo-500) 25%,transparent)}}.border-indigo-500\/30{border-color:#625fff4d}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/30{border-color:color-mix(in oklab,var(--color-indigo-500) 30%,transparent)}}.border-indigo-500\/40{border-color:#625fff66}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/40{border-color:color-mix(in oklab,var(--color-indigo-500) 40%,transparent)}}.border-lime-500\/25{border-color:#80cd0040}@supports (color:color-mix(in lab,red,red)){.border-lime-500\/25{border-color:color-mix(in oklab,var(--color-lime-500) 25%,transparent)}}.border-neutral-700{border-color:var(--color-neutral-700)}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/30{border-color:color-mix(in oklab,var(--color-orange-500) 30%,transparent)}}.border-pink-500\/25{border-color:#f6339a40}@supports (color:color-mix(in lab,red,red)){.border-pink-500\/25{border-color:color-mix(in oklab,var(--color-pink-500) 25%,transparent)}}.border-primary,.border-primary\/20{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/20{border-color:color-mix(in oklab,hsl(var(--primary)) 20%,transparent)}}.border-primary\/25{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/25{border-color:color-mix(in oklab,hsl(var(--primary)) 25%,transparent)}}.border-primary\/30{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/30{border-color:color-mix(in oklab,hsl(var(--primary)) 30%,transparent)}}.border-primary\/40{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/40{border-color:color-mix(in oklab,hsl(var(--primary)) 40%,transparent)}}.border-primary\/45{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/45{border-color:color-mix(in oklab,hsl(var(--primary)) 45%,transparent)}}.border-primary\/50{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/50{border-color:color-mix(in oklab,hsl(var(--primary)) 50%,transparent)}}.border-primary\/60{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/60{border-color:color-mix(in oklab,hsl(var(--primary)) 60%,transparent)}}.border-purple-500\/30{border-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/30{border-color:color-mix(in oklab,var(--color-purple-500) 30%,transparent)}}.border-red-500\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\/20{border-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.border-red-500\/25{border-color:#fb2c3640}@supports (color:color-mix(in lab,red,red)){.border-red-500\/25{border-color:color-mix(in oklab,var(--color-red-500) 25%,transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500) 30%,transparent)}}.border-red-500\/40{border-color:#fb2c3666}@supports (color:color-mix(in lab,red,red)){.border-red-500\/40{border-color:color-mix(in oklab,var(--color-red-500) 40%,transparent)}}.border-red-500\/50{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.border-red-500\/50{border-color:color-mix(in oklab,var(--color-red-500) 50%,transparent)}}.border-red-500\/60{border-color:#fb2c3699}@supports (color:color-mix(in lab,red,red)){.border-red-500\/60{border-color:color-mix(in oklab,var(--color-red-500) 60%,transparent)}}.border-sky-500\/25{border-color:#00a5ef40}@supports (color:color-mix(in lab,red,red)){.border-sky-500\/25{border-color:color-mix(in oklab,var(--color-sky-500) 25%,transparent)}}.border-sky-500\/40{border-color:#00a5ef66}@supports (color:color-mix(in lab,red,red)){.border-sky-500\/40{border-color:color-mix(in oklab,var(--color-sky-500) 40%,transparent)}}.border-slate-500\/25{border-color:#62748e40}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/25{border-color:color-mix(in oklab,var(--color-slate-500) 25%,transparent)}}.border-slate-500\/30{border-color:#62748e4d}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/30{border-color:color-mix(in oklab,var(--color-slate-500) 30%,transparent)}}.border-teal-500\/25{border-color:#00baa740}@supports (color:color-mix(in lab,red,red)){.border-teal-500\/25{border-color:color-mix(in oklab,var(--color-teal-500) 25%,transparent)}}.border-transparent{border-color:#0000}.border-violet-500\/15{border-color:#8d54ff26}@supports (color:color-mix(in lab,red,red)){.border-violet-500\/15{border-color:color-mix(in oklab,var(--color-violet-500) 15%,transparent)}}.border-violet-500\/20{border-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.border-violet-500\/20{border-color:color-mix(in oklab,var(--color-violet-500) 20%,transparent)}}.border-violet-500\/25{border-color:#8d54ff40}@supports (color:color-mix(in lab,red,red)){.border-violet-500\/25{border-color:color-mix(in oklab,var(--color-violet-500) 25%,transparent)}}.border-violet-500\/30{border-color:#8d54ff4d}@supports (color:color-mix(in lab,red,red)){.border-violet-500\/30{border-color:color-mix(in oklab,var(--color-violet-500) 30%,transparent)}}.border-violet-500\/40{border-color:#8d54ff66}@supports (color:color-mix(in lab,red,red)){.border-violet-500\/40{border-color:color-mix(in oklab,var(--color-violet-500) 40%,transparent)}}.border-t-primary\/70{border-top-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-t-primary\/70{border-top-color:color-mix(in oklab,hsl(var(--primary)) 70%,transparent)}}.border-t-violet-500\/70{border-top-color:#8d54ffb3}@supports (color:color-mix(in lab,red,red)){.border-t-violet-500\/70{border-top-color:color-mix(in oklab,var(--color-violet-500) 70%,transparent)}}.border-l-amber-500\/80{border-left-color:#f99c00cc}@supports (color:color-mix(in lab,red,red)){.border-l-amber-500\/80{border-left-color:color-mix(in oklab,var(--color-amber-500) 80%,transparent)}}.border-l-cyan-500\/80{border-left-color:#00b7d7cc}@supports (color:color-mix(in lab,red,red)){.border-l-cyan-500\/80{border-left-color:color-mix(in oklab,var(--color-cyan-500) 80%,transparent)}}.border-l-indigo-500\/80{border-left-color:#625fffcc}@supports (color:color-mix(in lab,red,red)){.border-l-indigo-500\/80{border-left-color:color-mix(in oklab,var(--color-indigo-500) 80%,transparent)}}.border-l-muted{border-left-color:hsl(var(--muted))}.border-l-violet-500\/80{border-left-color:#8d54ffcc}@supports (color:color-mix(in lab,red,red)){.border-l-violet-500\/80{border-left-color:color-mix(in oklab,var(--color-violet-500) 80%,transparent)}}.bg-\[\#070a0f\]{background-color:#070a0f}.bg-\[hsl\(224\,30\%\,6\%\)\]{background-color:#0b0d14}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/5{background-color:#f99c000d}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/5{background-color:color-mix(in oklab,var(--color-amber-500) 5%,transparent)}}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500) 10%,transparent)}}.bg-amber-500\/15{background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/15{background-color:color-mix(in oklab,var(--color-amber-500) 15%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.bg-amber-500\/80{background-color:#f99c00cc}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/80{background-color:color-mix(in oklab,var(--color-amber-500) 80%,transparent)}}.bg-amber-500\/\[0\.06\]{background-color:#f99c000f}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/\[0\.06\]{background-color:color-mix(in oklab,var(--color-amber-500) 6%,transparent)}}.bg-background\/10{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/10{background-color:color-mix(in oklab,hsl(var(--background)) 10%,transparent)}}.bg-background\/15{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/15{background-color:color-mix(in oklab,hsl(var(--background)) 15%,transparent)}}.bg-background\/20{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/20{background-color:color-mix(in oklab,hsl(var(--background)) 20%,transparent)}}.bg-background\/25{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/25{background-color:color-mix(in oklab,hsl(var(--background)) 25%,transparent)}}.bg-background\/30{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/30{background-color:color-mix(in oklab,hsl(var(--background)) 30%,transparent)}}.bg-background\/35{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/35{background-color:color-mix(in oklab,hsl(var(--background)) 35%,transparent)}}.bg-background\/40{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/40{background-color:color-mix(in oklab,hsl(var(--background)) 40%,transparent)}}.bg-background\/50{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/50{background-color:color-mix(in oklab,hsl(var(--background)) 50%,transparent)}}.bg-black\/10{background-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.bg-black\/10{background-color:color-mix(in oklab,var(--color-black) 10%,transparent)}}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black) 30%,transparent)}}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\/70{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500) 20%,transparent)}}.bg-border,.bg-border\/30{background-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.bg-border\/30{background-color:color-mix(in oklab,hsl(var(--border)) 30%,transparent)}}.bg-card,.bg-card\/20{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/20{background-color:color-mix(in oklab,hsl(var(--card)) 20%,transparent)}}.bg-card\/30{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/30{background-color:color-mix(in oklab,hsl(var(--card)) 30%,transparent)}}.bg-card\/40{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/40{background-color:color-mix(in oklab,hsl(var(--card)) 40%,transparent)}}.bg-card\/45{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/45{background-color:color-mix(in oklab,hsl(var(--card)) 45%,transparent)}}.bg-card\/50{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/50{background-color:color-mix(in oklab,hsl(var(--card)) 50%,transparent)}}.bg-card\/70{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/70{background-color:color-mix(in oklab,hsl(var(--card)) 70%,transparent)}}.bg-card\/85{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/85{background-color:color-mix(in oklab,hsl(var(--card)) 85%,transparent)}}.bg-cyan-500{background-color:var(--color-cyan-500)}.bg-cyan-500\/10{background-color:#00b7d71a}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/10{background-color:color-mix(in oklab,var(--color-cyan-500) 10%,transparent)}}.bg-cyan-500\/15{background-color:#00b7d726}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/15{background-color:color-mix(in oklab,var(--color-cyan-500) 15%,transparent)}}.bg-cyan-500\/20{background-color:#00b7d733}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/20{background-color:color-mix(in oklab,var(--color-cyan-500) 20%,transparent)}}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-500\/5{background-color:#00bb7f0d}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/5{background-color:color-mix(in oklab,var(--color-emerald-500) 5%,transparent)}}.bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/10{background-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.bg-emerald-500\/80{background-color:#00bb7fcc}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/80{background-color:color-mix(in oklab,var(--color-emerald-500) 80%,transparent)}}.bg-emerald-500\/\[0\.07\]{background-color:#00bb7f12}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/\[0\.07\]{background-color:color-mix(in oklab,var(--color-emerald-500) 7%,transparent)}}.bg-fuchsia-500{background-color:var(--color-fuchsia-500)}.bg-fuchsia-500\/10{background-color:#e12afb1a}@supports (color:color-mix(in lab,red,red)){.bg-fuchsia-500\/10{background-color:color-mix(in oklab,var(--color-fuchsia-500) 10%,transparent)}}.bg-fuchsia-500\/15{background-color:#e12afb26}@supports (color:color-mix(in lab,red,red)){.bg-fuchsia-500\/15{background-color:color-mix(in oklab,var(--color-fuchsia-500) 15%,transparent)}}.bg-indigo-500{background-color:var(--color-indigo-500)}.bg-indigo-500\/5{background-color:#625fff0d}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/5{background-color:color-mix(in oklab,var(--color-indigo-500) 5%,transparent)}}.bg-indigo-500\/10{background-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/10{background-color:color-mix(in oklab,var(--color-indigo-500) 10%,transparent)}}.bg-indigo-500\/15{background-color:#625fff26}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/15{background-color:color-mix(in oklab,var(--color-indigo-500) 15%,transparent)}}.bg-lime-500{background-color:var(--color-lime-500)}.bg-lime-500\/15{background-color:#80cd0026}@supports (color:color-mix(in lab,red,red)){.bg-lime-500\/15{background-color:color-mix(in oklab,var(--color-lime-500) 15%,transparent)}}.bg-muted{background-color:hsl(var(--muted))}.bg-muted-foreground\/40{background-color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.bg-muted-foreground\/40{background-color:color-mix(in oklab,hsl(var(--muted-foreground)) 40%,transparent)}}.bg-muted\/10{background-color:hsl(var(--muted))}@supports (color:color-mix(in lab,red,red)){.bg-muted\/10{background-color:color-mix(in oklab,hsl(var(--muted)) 10%,transparent)}}.bg-muted\/20{background-color:hsl(var(--muted))}@supports (color:color-mix(in lab,red,red)){.bg-muted\/20{background-color:color-mix(in oklab,hsl(var(--muted)) 20%,transparent)}}.bg-muted\/25{background-color:hsl(var(--muted))}@supports (color:color-mix(in lab,red,red)){.bg-muted\/25{background-color:color-mix(in oklab,hsl(var(--muted)) 25%,transparent)}}.bg-muted\/40{background-color:hsl(var(--muted))}@supports (color:color-mix(in lab,red,red)){.bg-muted\/40{background-color:color-mix(in oklab,hsl(var(--muted)) 40%,transparent)}}.bg-neutral-800{background-color:var(--color-neutral-800)}.bg-neutral-950{background-color:var(--color-neutral-950)}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500) 20%,transparent)}}.bg-pink-500{background-color:var(--color-pink-500)}.bg-pink-500\/15{background-color:#f6339a26}@supports (color:color-mix(in lab,red,red)){.bg-pink-500\/15{background-color:color-mix(in oklab,var(--color-pink-500) 15%,transparent)}}.bg-popover,.bg-popover\/95{background-color:hsl(var(--popover))}@supports (color:color-mix(in lab,red,red)){.bg-popover\/95{background-color:color-mix(in oklab,hsl(var(--popover)) 95%,transparent)}}.bg-primary,.bg-primary\/5{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.bg-primary\/5{background-color:color-mix(in oklab,hsl(var(--primary)) 5%,transparent)}}.bg-primary\/10{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.bg-primary\/10{background-color:color-mix(in oklab,hsl(var(--primary)) 10%,transparent)}}.bg-primary\/15{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.bg-primary\/15{background-color:color-mix(in oklab,hsl(var(--primary)) 15%,transparent)}}.bg-primary\/\[0\.06\]{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.bg-primary\/\[0\.06\]{background-color:color-mix(in oklab,hsl(var(--primary)) 6%,transparent)}}.bg-purple-500\/15{background-color:#ac4bff26}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/15{background-color:color-mix(in oklab,var(--color-purple-500) 15%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500) 20%,transparent)}}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\/5{background-color:#fb2c360d}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/5{background-color:color-mix(in oklab,var(--color-red-500) 5%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.bg-red-500\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/15{background-color:color-mix(in oklab,var(--color-red-500) 15%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.bg-red-500\/80{background-color:#fb2c36cc}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/80{background-color:color-mix(in oklab,var(--color-red-500) 80%,transparent)}}.bg-rose-500\/15{background-color:#ff235726}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/15{background-color:color-mix(in oklab,var(--color-rose-500) 15%,transparent)}}.bg-sky-500\/10{background-color:#00a5ef1a}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/10{background-color:color-mix(in oklab,var(--color-sky-500) 10%,transparent)}}.bg-slate-400{background-color:var(--color-slate-400)}.bg-slate-500\/15{background-color:#62748e26}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/15{background-color:color-mix(in oklab,var(--color-slate-500) 15%,transparent)}}.bg-slate-500\/20{background-color:#62748e33}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/20{background-color:color-mix(in oklab,var(--color-slate-500) 20%,transparent)}}.bg-teal-500{background-color:var(--color-teal-500)}.bg-teal-500\/10{background-color:#00baa71a}@supports (color:color-mix(in lab,red,red)){.bg-teal-500\/10{background-color:color-mix(in oklab,var(--color-teal-500) 10%,transparent)}}.bg-teal-500\/15{background-color:#00baa726}@supports (color:color-mix(in lab,red,red)){.bg-teal-500\/15{background-color:color-mix(in oklab,var(--color-teal-500) 15%,transparent)}}.bg-transparent{background-color:#0000}.bg-violet-500{background-color:var(--color-violet-500)}.bg-violet-500\/5{background-color:#8d54ff0d}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/5{background-color:color-mix(in oklab,var(--color-violet-500) 5%,transparent)}}.bg-violet-500\/10{background-color:#8d54ff1a}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/10{background-color:color-mix(in oklab,var(--color-violet-500) 10%,transparent)}}.bg-violet-500\/15{background-color:#8d54ff26}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/15{background-color:color-mix(in oklab,var(--color-violet-500) 15%,transparent)}}.bg-violet-500\/\[0\.04\]{background-color:#8d54ff0a}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/\[0\.04\]{background-color:color-mix(in oklab,var(--color-violet-500) 4%,transparent)}}.bg-violet-500\/\[0\.05\]{background-color:#8d54ff0d}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/\[0\.05\]{background-color:color-mix(in oklab,var(--color-violet-500) 5%,transparent)}}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-tr{--tw-gradient-position:to top right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-cyan-500{--tw-gradient-from:var(--color-cyan-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-foreground{--tw-gradient-from:hsl(var(--foreground));--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-500{--tw-gradient-from:var(--color-indigo-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-500{--tw-gradient-from:var(--color-purple-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-teal-500{--tw-gradient-from:var(--color-teal-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-teal-500\/15{--tw-gradient-from:#00baa726}@supports (color:color-mix(in lab,red,red)){.from-teal-500\/15{--tw-gradient-from:color-mix(in oklab, var(--color-teal-500) 15%, transparent)}}.from-teal-500\/15{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-teal-500\/20{--tw-gradient-from:#00baa733}@supports (color:color-mix(in lab,red,red)){.from-teal-500\/20{--tw-gradient-from:color-mix(in oklab, var(--color-teal-500) 20%, transparent)}}.from-teal-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.via-foreground{--tw-gradient-via:hsl(var(--foreground));--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-indigo-500\/10{--tw-gradient-via:#625fff1a}@supports (color:color-mix(in lab,red,red)){.via-indigo-500\/10{--tw-gradient-via:color-mix(in oklab, var(--color-indigo-500) 10%, transparent)}}.via-indigo-500\/10{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-indigo-500\/15{--tw-gradient-via:#625fff26}@supports (color:color-mix(in lab,red,red)){.via-indigo-500\/15{--tw-gradient-via:color-mix(in oklab, var(--color-indigo-500) 15%, transparent)}}.via-indigo-500\/15{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-blue-500{--tw-gradient-to:var(--color-blue-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-emerald-500{--tw-gradient-to:var(--color-emerald-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-pink-500{--tw-gradient-to:var(--color-pink-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-primary{--tw-gradient-to:hsl(var(--primary));--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-500\/15{--tw-gradient-to:#ac4bff26}@supports (color:color-mix(in lab,red,red)){.to-purple-500\/15{--tw-gradient-to:color-mix(in oklab, var(--color-purple-500) 15%, transparent)}}.to-purple-500\/15{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-500\/20{--tw-gradient-to:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.to-purple-500\/20{--tw-gradient-to:color-mix(in oklab, var(--color-purple-500) 20%, transparent)}}.to-purple-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-sky-500{--tw-gradient-to:var(--color-sky-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.bg-repeat{background-repeat:repeat}.fill-primary\/20{fill:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.fill-primary\/20{fill:color-mix(in oklab,hsl(var(--primary)) 20%,transparent)}}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\.5{padding:calc(var(--spacing) * 3.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-12{padding:calc(var(--spacing) * 12)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-20{padding-block:calc(var(--spacing) * 20)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-24{padding-top:calc(var(--spacing) * 24)}.pt-\[12vh\]{padding-top:12vh}.pr-1{padding-right:var(--spacing)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-6{padding-left:calc(var(--spacing) * 6)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:JetBrains Mono,ui-monospace,SFMono-Regular,monospace}.font-sans{font-family:Inter,ui-sans-serif,system-ui,-apple-system,sans-serif}.font-space{font-family:Space Grotesk,sans-serif}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[7px\]{font-size:7px}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-wrap{text-wrap:wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-clip{text-overflow:clip}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-300{color:var(--color-amber-300)}.text-amber-300\/70{color:#ffd236b3}@supports (color:color-mix(in lab,red,red)){.text-amber-300\/70{color:color-mix(in oklab,var(--color-amber-300) 70%,transparent)}}.text-amber-400{color:var(--color-amber-400)}.text-amber-400\/80{color:#fcbb00cc}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/80{color:color-mix(in oklab,var(--color-amber-400) 80%,transparent)}}.text-amber-400\/90{color:#fcbb00e6}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/90{color:color-mix(in oklab,var(--color-amber-400) 90%,transparent)}}.text-amber-500{color:var(--color-amber-500)}.text-black{color:var(--color-black)}.text-blue-300{color:var(--color-blue-300)}.text-cyan-200\/90{color:#a2f4fde6}@supports (color:color-mix(in lab,red,red)){.text-cyan-200\/90{color:color-mix(in oklab,var(--color-cyan-200) 90%,transparent)}}.text-cyan-300{color:var(--color-cyan-300)}.text-cyan-300\/80{color:#53eafdcc}@supports (color:color-mix(in lab,red,red)){.text-cyan-300\/80{color:color-mix(in oklab,var(--color-cyan-300) 80%,transparent)}}.text-cyan-400{color:var(--color-cyan-400)}.text-emerald-300{color:var(--color-emerald-300)}.text-emerald-300\/90{color:#5ee9b5e6}@supports (color:color-mix(in lab,red,red)){.text-emerald-300\/90{color:color-mix(in oklab,var(--color-emerald-300) 90%,transparent)}}.text-emerald-400{color:var(--color-emerald-400)}.text-emerald-400\/90{color:#00d294e6}@supports (color:color-mix(in lab,red,red)){.text-emerald-400\/90{color:color-mix(in oklab,var(--color-emerald-400) 90%,transparent)}}.text-foreground,.text-foreground\/70{color:hsl(var(--foreground))}@supports (color:color-mix(in lab,red,red)){.text-foreground\/70{color:color-mix(in oklab,hsl(var(--foreground)) 70%,transparent)}}.text-foreground\/80{color:hsl(var(--foreground))}@supports (color:color-mix(in lab,red,red)){.text-foreground\/80{color:color-mix(in oklab,hsl(var(--foreground)) 80%,transparent)}}.text-foreground\/85{color:hsl(var(--foreground))}@supports (color:color-mix(in lab,red,red)){.text-foreground\/85{color:color-mix(in oklab,hsl(var(--foreground)) 85%,transparent)}}.text-foreground\/90{color:hsl(var(--foreground))}@supports (color:color-mix(in lab,red,red)){.text-foreground\/90{color:color-mix(in oklab,hsl(var(--foreground)) 90%,transparent)}}.text-fuchsia-300{color:var(--color-fuchsia-300)}.text-fuchsia-400{color:var(--color-fuchsia-400)}.text-indigo-300{color:var(--color-indigo-300)}.text-indigo-400{color:var(--color-indigo-400)}.text-lime-400{color:var(--color-lime-400)}.text-muted-foreground,.text-muted-foreground\/40{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/40{color:color-mix(in oklab,hsl(var(--muted-foreground)) 40%,transparent)}}.text-muted-foreground\/50{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/50{color:color-mix(in oklab,hsl(var(--muted-foreground)) 50%,transparent)}}.text-muted-foreground\/55{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/55{color:color-mix(in oklab,hsl(var(--muted-foreground)) 55%,transparent)}}.text-muted-foreground\/60{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/60{color:color-mix(in oklab,hsl(var(--muted-foreground)) 60%,transparent)}}.text-muted-foreground\/70{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/70{color:color-mix(in oklab,hsl(var(--muted-foreground)) 70%,transparent)}}.text-muted-foreground\/75{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/75{color:color-mix(in oklab,hsl(var(--muted-foreground)) 75%,transparent)}}.text-muted-foreground\/80{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/80{color:color-mix(in oklab,hsl(var(--muted-foreground)) 80%,transparent)}}.text-neutral-200{color:var(--color-neutral-200)}.text-neutral-400{color:var(--color-neutral-400)}.text-orange-300{color:var(--color-orange-300)}.text-pink-400{color:var(--color-pink-400)}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary\/70{color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.text-primary\/70{color:color-mix(in oklab,hsl(var(--primary)) 70%,transparent)}}.text-primary\/80{color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.text-primary\/80{color:color-mix(in oklab,hsl(var(--primary)) 80%,transparent)}}.text-purple-300{color:var(--color-purple-300)}.text-red-200{color:var(--color-red-200)}.text-red-300{color:var(--color-red-300)}.text-red-300\/90{color:#ffa3a3e6}@supports (color:color-mix(in lab,red,red)){.text-red-300\/90{color:color-mix(in oklab,var(--color-red-300) 90%,transparent)}}.text-red-400{color:var(--color-red-400)}.text-red-400\/80{color:#ff6568cc}@supports (color:color-mix(in lab,red,red)){.text-red-400\/80{color:color-mix(in oklab,var(--color-red-400) 80%,transparent)}}.text-rose-300{color:var(--color-rose-300)}.text-rose-400{color:var(--color-rose-400)}.text-sky-300{color:var(--color-sky-300)}.text-sky-300\/90{color:#77d4ffe6}@supports (color:color-mix(in lab,red,red)){.text-sky-300\/90{color:color-mix(in oklab,var(--color-sky-300) 90%,transparent)}}.text-sky-400{color:var(--color-sky-400)}.text-slate-300{color:var(--color-slate-300)}.text-teal-300{color:var(--color-teal-300)}.text-teal-400{color:var(--color-teal-400)}.text-transparent{color:#0000}.text-violet-200\/90{color:#ddd6ffe6}@supports (color:color-mix(in lab,red,red)){.text-violet-200\/90{color:color-mix(in oklab,var(--color-violet-200) 90%,transparent)}}.text-violet-300{color:var(--color-violet-300)}.text-violet-300\/80{color:#c4b4ffcc}@supports (color:color-mix(in lab,red,red)){.text-violet-300\/80{color:color-mix(in oklab,var(--color-violet-300) 80%,transparent)}}.text-violet-400{color:var(--color-violet-400)}.text-violet-400\/70{color:#a685ffb3}@supports (color:color-mix(in lab,red,red)){.text-violet-400\/70{color:color-mix(in oklab,var(--color-violet-400) 70%,transparent)}}.text-white{color:var(--color-white)}.text-white\/95{color:#fffffff2}@supports (color:color-mix(in lab,red,red)){.text-white\/95{color:color-mix(in oklab,var(--color-white) 95%,transparent)}}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.diagonal-fractions{--tw-numeric-fraction:diagonal-fractions;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.stacked-fractions{--tw-numeric-fraction:stacked-fractions;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.normal-nums{font-variant-numeric:normal}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.overline{text-decoration-line:overline}.underline{text-decoration-line:underline}.decoration-primary\/40{-webkit-text-decoration-color:hsl(var(--primary));text-decoration-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.decoration-primary\/40{-webkit-text-decoration-color:color-mix(in oklab,hsl(var(--primary)) 40%,transparent);text-decoration-color:color-mix(in oklab,hsl(var(--primary)) 40%,transparent)}}.underline-offset-2{text-underline-offset:2px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.subpixel-antialiased{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.\[color-scheme\:dark\]{color-scheme:dark}.opacity-0{opacity:0}.opacity-30{opacity:.3}.opacity-35{opacity:.35}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.opacity-85{opacity:.85}.opacity-90{opacity:.9}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-4{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-amber-500\/10{--tw-shadow-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.shadow-amber-500\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-amber-500) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/5{--tw-shadow-color:#0000000d}@supports (color:color-mix(in lab,red,red)){.shadow-black\/5{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 5%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/10{--tw-shadow-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.shadow-black\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/15{--tw-shadow-color:#00000026}@supports (color:color-mix(in lab,red,red)){.shadow-black\/15{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 15%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/20{--tw-shadow-color:#0003}@supports (color:color-mix(in lab,red,red)){.shadow-black\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/25{--tw-shadow-color:#00000040}@supports (color:color-mix(in lab,red,red)){.shadow-black\/25{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 25%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-500\/5{--tw-shadow-color:#00bb7f0d}@supports (color:color-mix(in lab,red,red)){.shadow-emerald-500\/5{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-emerald-500) 5%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-primary\/5{--tw-shadow-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.shadow-primary\/5{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, hsl(var(--primary)) 5%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-primary\/10{--tw-shadow-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.shadow-primary\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, hsl(var(--primary)) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-primary\/20{--tw-shadow-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.shadow-primary\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, hsl(var(--primary)) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-red-500\/10{--tw-shadow-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.shadow-red-500\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-red-500) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-background\/60{--tw-ring-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.ring-background\/60{--tw-ring-color:color-mix(in oklab, hsl(var(--background)) 60%, transparent)}}.ring-black\/40{--tw-ring-color:#0006}@supports (color:color-mix(in lab,red,red)){.ring-black\/40{--tw-ring-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.ring-white\/70{--tw-ring-color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.ring-white\/70{--tw-ring-color:color-mix(in oklab, var(--color-white) 70%, transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[130px\]{--tw-blur:blur(130px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[140px\]{--tw-blur:blur(140px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[160px\]{--tw-blur:blur(160px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a)) drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a) drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.sepia{--tw-sepia:sepia(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.\!filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)!important}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-grayscale{--tw-backdrop-grayscale:grayscale(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-invert{--tw-backdrop-invert:invert(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-sepia{--tw-backdrop-sepia:sepia(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition\!{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events!important;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))!important;transition-duration:var(--tw-duration,var(--default-transition-duration))!important}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.select-text{-webkit-user-select:text;user-select:text}:where(.divide-x-reverse>:not(:last-child)){--tw-divide-x-reverse:1}.ring-inset{--tw-ring-inset:inset}@media(hover:hover){.group-hover\:translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:text-primary:is(:where(.group):hover *){color:hsl(var(--primary))}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-muted-foreground::placeholder,.placeholder\:text-muted-foreground\/50::placeholder{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.placeholder\:text-muted-foreground\/50::placeholder{color:color-mix(in oklab,hsl(var(--muted-foreground)) 50%,transparent)}}.first\:rounded-l-sm:first-child{border-top-left-radius:calc(var(--radius) - 4px);border-bottom-left-radius:calc(var(--radius) - 4px)}.last\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}@media(hover:hover){.hover\:border-amber-500\/50:hover{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.hover\:border-amber-500\/50:hover{border-color:color-mix(in oklab,var(--color-amber-500) 50%,transparent)}}.hover\:border-border:hover,.hover\:border-border\/60:hover{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.hover\:border-border\/60:hover{border-color:color-mix(in oklab,hsl(var(--border)) 60%,transparent)}}.hover\:border-emerald-500\/40:hover{border-color:#00bb7f66}@supports (color:color-mix(in lab,red,red)){.hover\:border-emerald-500\/40:hover{border-color:color-mix(in oklab,var(--color-emerald-500) 40%,transparent)}}.hover\:border-primary\/20:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/20:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 20%,transparent)}}.hover\:border-primary\/30:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/30:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 30%,transparent)}}.hover\:border-primary\/40:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/40:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 40%,transparent)}}.hover\:border-primary\/45:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/45:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 45%,transparent)}}.hover\:border-primary\/50:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/50:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 50%,transparent)}}.hover\:border-red-500\/50:hover{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.hover\:border-red-500\/50:hover{border-color:color-mix(in oklab,var(--color-red-500) 50%,transparent)}}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-amber-400:hover{background-color:var(--color-amber-400)}.hover\:bg-amber-500\/10:hover{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/10:hover{background-color:color-mix(in oklab,var(--color-amber-500) 10%,transparent)}}.hover\:bg-amber-500\/15:hover{background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/15:hover{background-color:color-mix(in oklab,var(--color-amber-500) 15%,transparent)}}.hover\:bg-amber-500\/20:hover{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/20:hover{background-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.hover\:bg-background\/30:hover{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-background\/30:hover{background-color:color-mix(in oklab,hsl(var(--background)) 30%,transparent)}}.hover\:bg-background\/40:hover{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-background\/40:hover{background-color:color-mix(in oklab,hsl(var(--background)) 40%,transparent)}}.hover\:bg-background\/60:hover{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-background\/60:hover{background-color:color-mix(in oklab,hsl(var(--background)) 60%,transparent)}}.hover\:bg-background\/80:hover{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-background\/80:hover{background-color:color-mix(in oklab,hsl(var(--background)) 80%,transparent)}}.hover\:bg-card\/70:hover{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/70:hover{background-color:color-mix(in oklab,hsl(var(--card)) 70%,transparent)}}.hover\:bg-emerald-500\/10:hover{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-emerald-500\/10:hover{background-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.hover\:bg-emerald-500\/15:hover{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.hover\:bg-emerald-500\/15:hover{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.hover\:bg-emerald-500\/20:hover{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-emerald-500\/20:hover{background-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.hover\:bg-fuchsia-500\/20:hover{background-color:#e12afb33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-fuchsia-500\/20:hover{background-color:color-mix(in oklab,var(--color-fuchsia-500) 20%,transparent)}}.hover\:bg-indigo-500\/15:hover{background-color:#625fff26}@supports (color:color-mix(in lab,red,red)){.hover\:bg-indigo-500\/15:hover{background-color:color-mix(in oklab,var(--color-indigo-500) 15%,transparent)}}.hover\:bg-neutral-700:hover{background-color:var(--color-neutral-700)}.hover\:bg-primary\/5:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/5:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 5%,transparent)}}.hover\:bg-primary\/10:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/10:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 10%,transparent)}}.hover\:bg-primary\/15:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/15:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 15%,transparent)}}.hover\:bg-primary\/20:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/20:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 20%,transparent)}}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 90%,transparent)}}.hover\:bg-primary\/95:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/95:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 95%,transparent)}}.hover\:bg-red-400:hover{background-color:var(--color-red-400)}.hover\:bg-red-500\/5:hover{background-color:#fb2c360d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/5:hover{background-color:color-mix(in oklab,var(--color-red-500) 5%,transparent)}}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.hover\:bg-red-500\/15:hover{background-color:#fb2c3626}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/15:hover{background-color:color-mix(in oklab,var(--color-red-500) 15%,transparent)}}.hover\:bg-red-500\/20:hover{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/20:hover{background-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.hover\:bg-violet-500\/20:hover{background-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-violet-500\/20:hover{background-color:color-mix(in oklab,var(--color-violet-500) 20%,transparent)}}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-primary:hover,.hover\:text-primary\/80:hover{color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:text-primary\/80:hover{color:color-mix(in oklab,hsl(var(--primary)) 80%,transparent)}}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-red-400:hover{color:var(--color-red-400)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-90:hover{opacity:.9}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\:border-primary:focus,.focus\:border-primary\/50:focus{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.focus\:border-primary\/50:focus{border-color:color-mix(in oklab,hsl(var(--primary)) 50%,transparent)}}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-primary:focus,.focus\:ring-primary\/50:focus{--tw-ring-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.focus\:ring-primary\/50:focus{--tw-ring-color:color-mix(in oklab, hsl(var(--primary)) 50%, transparent)}}.focus\:ring-violet-500\/50:focus{--tw-ring-color:#8d54ff80}@supports (color:color-mix(in lab,red,red)){.focus\:ring-violet-500\/50:focus{--tw-ring-color:color-mix(in oklab, var(--color-violet-500) 50%, transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:hsl(var(--ring))}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:cursor-default:disabled{cursor:default}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}.aria-selected\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.aria-selected\:text-accent-foreground[aria-selected=true]{color:hsl(var(--accent-foreground))}@media(min-width:40rem){.sm\:inline{display:inline}.sm\:w-36{width:calc(var(--spacing) * 36)}.sm\:w-\[640px\]{width:640px}.sm\:max-w-\[400px\]{max-width:400px}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:self-auto{align-self:auto}.sm\:p-10{padding:calc(var(--spacing) * 10)}}@media(min-width:48rem){.md\:col-span-2{grid-column:span 2/span 2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-\[170px_1fr\]{grid-template-columns:170px 1fr}}@media(min-width:64rem){.lg\:flex{display:flex}.lg\:w-40{width:calc(var(--spacing) * 40)}.lg\:w-72{width:calc(var(--spacing) * 72)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:grid-cols-\[1fr_300px\]{grid-template-columns:1fr 300px}.lg\:grid-cols-\[minmax\(0\,1fr\)_minmax\(0\,1\.3fr\)\]{grid-template-columns:minmax(0,1fr) minmax(0,1.3fr)}.lg\:flex-row{flex-direction:row}.lg\:items-center{align-items:center}.lg\:items-stretch{align-items:stretch}}}:root{--background:224 30% 6%;--foreground:210 20% 92%;--card:224 25% 10%;--card-foreground:210 20% 94%;--popover:224 28% 9%;--popover-foreground:210 20% 94%;--primary:172 72% 50%;--primary-foreground:224 47% 8%;--muted:220 16% 14%;--muted-foreground:215 14% 64%;--accent:220 16% 16%;--accent-foreground:210 20% 94%;--border:222 18% 23%;--input:222 18% 23%;--ring:172 72% 50%;--radius:.75rem;color-scheme:dark}.light{--background:0 0% 100%;--foreground:222 22% 12%;--card:0 0% 100%;--card-foreground:222 22% 12%;--popover:0 0% 100%;--popover-foreground:222 22% 12%;--primary:172 70% 38%;--primary-foreground:0 0% 100%;--muted:220 14% 95%;--muted-foreground:220 9% 42%;--accent:220 14% 94%;--accent-foreground:222 22% 12%;--border:220 13% 88%;--input:220 13% 88%;--ring:172 66% 50%;color-scheme:light}@keyframes aurora{0%{background-position:0%}50%{background-position:100%}to{background-position:0%}}.animate-aurora{background-size:200% 200%;animation:25s infinite aurora}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:hsl(var(--border));border-radius:9999px}*{border-color:hsl(var(--border) / .85);outline-color:hsl(var(--primary) / .5)}:focus-visible{outline:2px solid hsl(var(--primary) / .7);outline-offset:2px}@media(prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}html,body,#root{height:100%;overflow:hidden}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-family:var(--font-sans);-webkit-font-smoothing:antialiased;margin:0}@keyframes flow-cyan{0%{stroke-dasharray:6 3;stroke-dashoffset:18px}to{stroke-dasharray:6 3;stroke-dashoffset:0}}.animate-flow-cyan{animation:1.2s linear infinite flow-cyan}.rounded-2xl.border.bg-card\/45{position:relative;overflow:hidden;background-color:hsl(var(--card) / .85)!important;border-color:hsl(var(--border) / .95)!important;transition:transform .3s cubic-bezier(.4,0,.2,1),background-color .3s cubic-bezier(.4,0,.2,1),border-color .3s cubic-bezier(.4,0,.2,1),box-shadow .3s cubic-bezier(.4,0,.2,1)!important;box-shadow:0 10px 30px -15px #00000073,inset 0 1px #ffffff0d!important}.rounded-2xl.border.bg-card\/45:before{content:"";background:linear-gradient(90deg,hsl(var(--primary)),#6366f1,#a855f7);opacity:.75;height:3.5px;position:absolute;top:0;left:0;right:0;transition:opacity .3s!important}.rounded-2xl.border.bg-card\/45:hover{transform:translateY(-3px);background-color:hsl(var(--card) / .92)!important;border-color:hsl(var(--primary) / .35)!important;box-shadow:0 20px 40px -20px #000000a6,0 0 18px 2px hsl(var(--primary) / .05)!important}.rounded-2xl.border.bg-card\/45:hover:before{opacity:1}.rounded-xl.border.bg-card\/45{background-color:hsl(var(--card) / .88)!important;border-color:hsl(var(--border) / .9)!important;transition:background-color .2s,border-color .2s!important}.rounded-xl.border.bg-card\/45:hover{background-color:hsl(var(--card) / .95)!important;border-color:hsl(var(--primary) / .3)!important}aside nav a[class*="bg-primary/15"]:not([class*=justify-center]){background:linear-gradient(90deg,hsl(var(--primary) / .18),#6366f11f)!important;color:hsl(var(--primary))!important;border-left:3.5px solid hsl(var(--primary))!important;border-radius:0 var(--radius) var(--radius) 0!important;padding-left:calc(.75rem - 3.5px)!important;box-shadow:inset 0 1px #ffffff05!important}aside nav a[class*="bg-primary/15"][class*=justify-center]{background:hsl(var(--primary) / .18)!important;color:hsl(var(--primary))!important;box-shadow:0 0 12px 1px hsl(var(--primary) / .1)!important;border:1px solid hsl(var(--primary) / .3)!important}::-webkit-scrollbar-thumb{border-radius:9999px;background:hsl(var(--primary) / .25)!important}::-webkit-scrollbar-thumb:hover{background:hsl(var(--primary) / .5)!important}input:focus,textarea:focus,select:focus{outline:none;border-color:hsl(var(--primary))!important;box-shadow:0 0 0 2px hsl(var(--primary) / .15)!important}@media(min-width:1440px){html{font-size:16.5px}}@media(min-width:1920px){html{font-size:17.5px}}@media(min-width:2560px){html{font-size:19px}}@media(min-width:3440px){html{font-size:20px}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}} +@import"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap";/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-sans:"Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-lime-400:oklch(84.1% .238 128.85);--color-lime-500:oklch(76.8% .233 130.85);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-teal-300:oklch(85.5% .138 181.071);--color-teal-400:oklch(77.7% .152 181.912);--color-teal-500:oklch(70.4% .14 182.503);--color-cyan-200:oklch(91.7% .08 205.041);--color-cyan-300:oklch(86.5% .127 207.078);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-sky-300:oklch(82.8% .111 230.318);--color-sky-400:oklch(74.6% .16 232.661);--color-sky-500:oklch(68.5% .169 237.323);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-500:oklch(62.3% .214 259.815);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-violet-200:oklch(89.4% .057 293.283);--color-violet-300:oklch(81.1% .111 293.571);--color-violet-400:oklch(70.2% .183 293.541);--color-violet-500:oklch(60.6% .25 292.717);--color-purple-300:oklch(82.7% .119 306.383);--color-purple-500:oklch(62.7% .265 303.9);--color-fuchsia-300:oklch(83.3% .145 321.434);--color-fuchsia-400:oklch(74% .238 322.16);--color-fuchsia-500:oklch(66.7% .295 322.15);--color-pink-400:oklch(71.8% .202 349.761);--color-pink-500:oklch(65.6% .241 354.308);--color-rose-300:oklch(81% .117 11.638);--color-rose-400:oklch(71.2% .194 13.428);--color-rose-500:oklch(64.5% .246 16.439);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-400:oklch(70.4% .04 256.788);--color-slate-500:oklch(55.4% .046 257.417);--color-neutral-200:oklch(92.2% 0 0);--color-neutral-400:oklch(70.8% 0 0);--color-neutral-700:oklch(37.1% 0 0);--color-neutral-800:oklch(26.9% 0 0);--color-neutral-950:oklch(14.5% 0 0);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-normal:1.5;--leading-relaxed:1.625;--radius-xl:.75rem;--radius-2xl:1rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--blur-md:12px;--blur-xl:24px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:"Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;--default-mono-font-family:"JetBrains Mono", ui-monospace, SFMono-Regular, monospace}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{inset-block:0}.-top-0\.5{top:calc(var(--spacing) * -.5)}.top-0{top:0}.top-1\/2{top:50%}.top-2\.5{top:calc(var(--spacing) * 2.5)}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.top-\[-10\%\]{top:-10%}.top-\[30\%\]{top:30%}.-right-0\.5{right:calc(var(--spacing) * -.5)}.right-0{right:0}.right-3{right:calc(var(--spacing) * 3)}.right-\[-10\%\]{right:-10%}.right-\[20\%\]{right:20%}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-\[-10\%\]{bottom:-10%}.-left-\[23px\]{left:-23px}.left-2{left:calc(var(--spacing) * 2)}.left-2\.5{left:calc(var(--spacing) * 2.5)}.left-3{left:calc(var(--spacing) * 3)}.left-\[-10\%\]{left:-10%}.isolate{isolation:isolate}.isolation-auto{isolation:auto}.-z-50{z-index:-50}.z-10{z-index:10}.z-50{z-index:50}.z-\[60\]{z-index:60}.z-\[99\]{z-index:99}.col-span-full{grid-column:1/-1}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.-mx-1{margin-inline:calc(var(--spacing) * -1)}.mx-auto{margin-inline:auto}.-mt-1{margin-top:calc(var(--spacing) * -1)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-3\.5{margin-top:calc(var(--spacing) * 3.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.mr-0\.5{margin-right:calc(var(--spacing) * .5)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-1{margin-bottom:var(--spacing)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-1{margin-left:var(--spacing)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-6{-webkit-line-clamp:6;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.flow-root{display:flow-root}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.inline-table{display:inline-table}.list-item{display:list-item}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-column{display:table-column}.table-column-group{display:table-column-group}.table-footer-group{display:table-footer-group}.table-header-group{display:table-header-group}.table-row{display:table-row}.table-row-group{display:table-row-group}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-4\.5{height:calc(var(--spacing) * 4.5)}.h-5{height:calc(var(--spacing) * 5)}.h-5\.5{height:calc(var(--spacing) * 5.5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-12{height:calc(var(--spacing) * 12)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-24{height:calc(var(--spacing) * 24)}.h-28{height:calc(var(--spacing) * 28)}.h-44{height:calc(var(--spacing) * 44)}.h-\[40\%\]{height:40%}.h-\[50\%\]{height:50%}.h-\[120px\]{height:120px}.h-\[150px\]{height:150px}.h-\[480px\]{height:480px}.h-\[calc\(100vh-13rem\)\]{height:calc(100vh - 13rem)}.h-full{height:100%}.h-px{height:1px}.max-h-20{max-height:calc(var(--spacing) * 20)}.max-h-36{max-height:calc(var(--spacing) * 36)}.max-h-56{max-height:calc(var(--spacing) * 56)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-80{max-height:calc(var(--spacing) * 80)}.max-h-96{max-height:calc(var(--spacing) * 96)}.max-h-\[60vh\]{max-height:60vh}.max-h-\[70vh\]{max-height:70vh}.max-h-\[80vh\]{max-height:80vh}.min-h-\[16rem\]{min-height:16rem}.min-h-\[58vh\]{min-height:58vh}.min-h-\[90px\]{min-height:90px}.min-h-\[300px\]{min-height:300px}.min-h-\[560px\]{min-height:560px}.min-h-screen{min-height:100vh}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-4\.5{width:calc(var(--spacing) * 4.5)}.w-5{width:calc(var(--spacing) * 5)}.w-5\.5{width:calc(var(--spacing) * 5.5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-24{width:calc(var(--spacing) * 24)}.w-40{width:calc(var(--spacing) * 40)}.w-52{width:calc(var(--spacing) * 52)}.w-56{width:calc(var(--spacing) * 56)}.w-60{width:calc(var(--spacing) * 60)}.w-\[40\%\]{width:40%}.w-\[50\%\]{width:50%}.w-fit{width:fit-content}.w-full{width:100%}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-\[16rem\]{max-width:16rem}.max-w-\[120px\]{max-width:120px}.max-w-\[180px\]{max-width:180px}.max-w-\[250px\]{max-width:250px}.max-w-\[260px\]{max-width:260px}.max-w-\[280px\]{max-width:280px}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.min-w-\[2\.5rem\]{min-width:2.5rem}.min-w-\[2rem\]{min-width:2rem}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.translate-x-0{--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-full{--tw-translate-x:100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-pinch-zoom{--tw-pinch-zoom:pinch-zoom;touch-action:var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)}.resize{resize:both}.resize-none{resize:none}.scroll-mt-20{scroll-margin-top:calc(var(--spacing) * 20)}.scrollbar-thin{scrollbar-width:thin}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-7>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 7) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 7) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-reverse>:not(:last-child)){--tw-space-y-reverse:1}.gap-x-2{column-gap:calc(var(--spacing) * 2)}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}:where(.space-x-reverse>:not(:last-child)){--tw-space-x-reverse:1}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px * var(--tw-divide-x-reverse));border-inline-end-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-y-reverse>:not(:last-child)){--tw-divide-y-reverse:1}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-s{border-start-start-radius:.25rem;border-end-start-radius:.25rem}.rounded-ss{border-start-start-radius:.25rem}.rounded-e{border-start-end-radius:.25rem;border-end-end-radius:.25rem}.rounded-se{border-start-end-radius:.25rem}.rounded-ee{border-end-end-radius:.25rem}.rounded-es{border-end-start-radius:.25rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-tl{border-top-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-tr{border-top-right-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-br{border-bottom-right-radius:.25rem}.rounded-bl{border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-2{border-top-style:var(--tw-border-style);border-top-width:2px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-amber-500\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/20{border-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.border-amber-500\/25{border-color:#f99c0040}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/25{border-color:color-mix(in oklab,var(--color-amber-500) 25%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500) 30%,transparent)}}.border-amber-500\/40{border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/40{border-color:color-mix(in oklab,var(--color-amber-500) 40%,transparent)}}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/50{border-color:color-mix(in oklab,var(--color-amber-500) 50%,transparent)}}.border-blue-500\/30{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/30{border-color:color-mix(in oklab,var(--color-blue-500) 30%,transparent)}}.border-border,.border-border\/20{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/20{border-color:color-mix(in oklab,hsl(var(--border)) 20%,transparent)}}.border-border\/30{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/30{border-color:color-mix(in oklab,hsl(var(--border)) 30%,transparent)}}.border-border\/40{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/40{border-color:color-mix(in oklab,hsl(var(--border)) 40%,transparent)}}.border-border\/50{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,hsl(var(--border)) 50%,transparent)}}.border-border\/60{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/60{border-color:color-mix(in oklab,hsl(var(--border)) 60%,transparent)}}.border-border\/70{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/70{border-color:color-mix(in oklab,hsl(var(--border)) 70%,transparent)}}.border-border\/80{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/80{border-color:color-mix(in oklab,hsl(var(--border)) 80%,transparent)}}.border-cyan-500\/20{border-color:#00b7d733}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/20{border-color:color-mix(in oklab,var(--color-cyan-500) 20%,transparent)}}.border-cyan-500\/25{border-color:#00b7d740}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/25{border-color:color-mix(in oklab,var(--color-cyan-500) 25%,transparent)}}.border-cyan-500\/30{border-color:#00b7d74d}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/30{border-color:color-mix(in oklab,var(--color-cyan-500) 30%,transparent)}}.border-emerald-500\/10{border-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/10{border-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.border-emerald-500\/15{border-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/15{border-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.border-emerald-500\/20{border-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/20{border-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.border-emerald-500\/25{border-color:#00bb7f40}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/25{border-color:color-mix(in oklab,var(--color-emerald-500) 25%,transparent)}}.border-emerald-500\/30{border-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/30{border-color:color-mix(in oklab,var(--color-emerald-500) 30%,transparent)}}.border-emerald-500\/40{border-color:#00bb7f66}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/40{border-color:color-mix(in oklab,var(--color-emerald-500) 40%,transparent)}}.border-fuchsia-500\/25{border-color:#e12afb40}@supports (color:color-mix(in lab,red,red)){.border-fuchsia-500\/25{border-color:color-mix(in oklab,var(--color-fuchsia-500) 25%,transparent)}}.border-fuchsia-500\/30{border-color:#e12afb4d}@supports (color:color-mix(in lab,red,red)){.border-fuchsia-500\/30{border-color:color-mix(in oklab,var(--color-fuchsia-500) 30%,transparent)}}.border-fuchsia-500\/40{border-color:#e12afb66}@supports (color:color-mix(in lab,red,red)){.border-fuchsia-500\/40{border-color:color-mix(in oklab,var(--color-fuchsia-500) 40%,transparent)}}.border-indigo-500\/25{border-color:#625fff40}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/25{border-color:color-mix(in oklab,var(--color-indigo-500) 25%,transparent)}}.border-indigo-500\/30{border-color:#625fff4d}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/30{border-color:color-mix(in oklab,var(--color-indigo-500) 30%,transparent)}}.border-indigo-500\/40{border-color:#625fff66}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/40{border-color:color-mix(in oklab,var(--color-indigo-500) 40%,transparent)}}.border-lime-500\/25{border-color:#80cd0040}@supports (color:color-mix(in lab,red,red)){.border-lime-500\/25{border-color:color-mix(in oklab,var(--color-lime-500) 25%,transparent)}}.border-neutral-700{border-color:var(--color-neutral-700)}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/30{border-color:color-mix(in oklab,var(--color-orange-500) 30%,transparent)}}.border-pink-500\/25{border-color:#f6339a40}@supports (color:color-mix(in lab,red,red)){.border-pink-500\/25{border-color:color-mix(in oklab,var(--color-pink-500) 25%,transparent)}}.border-primary,.border-primary\/20{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/20{border-color:color-mix(in oklab,hsl(var(--primary)) 20%,transparent)}}.border-primary\/25{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/25{border-color:color-mix(in oklab,hsl(var(--primary)) 25%,transparent)}}.border-primary\/30{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/30{border-color:color-mix(in oklab,hsl(var(--primary)) 30%,transparent)}}.border-primary\/40{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/40{border-color:color-mix(in oklab,hsl(var(--primary)) 40%,transparent)}}.border-primary\/45{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/45{border-color:color-mix(in oklab,hsl(var(--primary)) 45%,transparent)}}.border-primary\/50{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/50{border-color:color-mix(in oklab,hsl(var(--primary)) 50%,transparent)}}.border-primary\/60{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/60{border-color:color-mix(in oklab,hsl(var(--primary)) 60%,transparent)}}.border-purple-500\/30{border-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/30{border-color:color-mix(in oklab,var(--color-purple-500) 30%,transparent)}}.border-red-500\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\/20{border-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.border-red-500\/25{border-color:#fb2c3640}@supports (color:color-mix(in lab,red,red)){.border-red-500\/25{border-color:color-mix(in oklab,var(--color-red-500) 25%,transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500) 30%,transparent)}}.border-red-500\/40{border-color:#fb2c3666}@supports (color:color-mix(in lab,red,red)){.border-red-500\/40{border-color:color-mix(in oklab,var(--color-red-500) 40%,transparent)}}.border-red-500\/50{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.border-red-500\/50{border-color:color-mix(in oklab,var(--color-red-500) 50%,transparent)}}.border-red-500\/60{border-color:#fb2c3699}@supports (color:color-mix(in lab,red,red)){.border-red-500\/60{border-color:color-mix(in oklab,var(--color-red-500) 60%,transparent)}}.border-sky-500\/25{border-color:#00a5ef40}@supports (color:color-mix(in lab,red,red)){.border-sky-500\/25{border-color:color-mix(in oklab,var(--color-sky-500) 25%,transparent)}}.border-sky-500\/40{border-color:#00a5ef66}@supports (color:color-mix(in lab,red,red)){.border-sky-500\/40{border-color:color-mix(in oklab,var(--color-sky-500) 40%,transparent)}}.border-slate-500\/25{border-color:#62748e40}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/25{border-color:color-mix(in oklab,var(--color-slate-500) 25%,transparent)}}.border-slate-500\/30{border-color:#62748e4d}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/30{border-color:color-mix(in oklab,var(--color-slate-500) 30%,transparent)}}.border-teal-500\/25{border-color:#00baa740}@supports (color:color-mix(in lab,red,red)){.border-teal-500\/25{border-color:color-mix(in oklab,var(--color-teal-500) 25%,transparent)}}.border-transparent{border-color:#0000}.border-violet-500\/15{border-color:#8d54ff26}@supports (color:color-mix(in lab,red,red)){.border-violet-500\/15{border-color:color-mix(in oklab,var(--color-violet-500) 15%,transparent)}}.border-violet-500\/20{border-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.border-violet-500\/20{border-color:color-mix(in oklab,var(--color-violet-500) 20%,transparent)}}.border-violet-500\/25{border-color:#8d54ff40}@supports (color:color-mix(in lab,red,red)){.border-violet-500\/25{border-color:color-mix(in oklab,var(--color-violet-500) 25%,transparent)}}.border-violet-500\/30{border-color:#8d54ff4d}@supports (color:color-mix(in lab,red,red)){.border-violet-500\/30{border-color:color-mix(in oklab,var(--color-violet-500) 30%,transparent)}}.border-violet-500\/40{border-color:#8d54ff66}@supports (color:color-mix(in lab,red,red)){.border-violet-500\/40{border-color:color-mix(in oklab,var(--color-violet-500) 40%,transparent)}}.border-t-primary\/70{border-top-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-t-primary\/70{border-top-color:color-mix(in oklab,hsl(var(--primary)) 70%,transparent)}}.border-t-violet-500\/70{border-top-color:#8d54ffb3}@supports (color:color-mix(in lab,red,red)){.border-t-violet-500\/70{border-top-color:color-mix(in oklab,var(--color-violet-500) 70%,transparent)}}.border-l-amber-500\/80{border-left-color:#f99c00cc}@supports (color:color-mix(in lab,red,red)){.border-l-amber-500\/80{border-left-color:color-mix(in oklab,var(--color-amber-500) 80%,transparent)}}.border-l-cyan-500\/80{border-left-color:#00b7d7cc}@supports (color:color-mix(in lab,red,red)){.border-l-cyan-500\/80{border-left-color:color-mix(in oklab,var(--color-cyan-500) 80%,transparent)}}.border-l-indigo-500\/80{border-left-color:#625fffcc}@supports (color:color-mix(in lab,red,red)){.border-l-indigo-500\/80{border-left-color:color-mix(in oklab,var(--color-indigo-500) 80%,transparent)}}.border-l-muted{border-left-color:hsl(var(--muted))}.border-l-violet-500\/80{border-left-color:#8d54ffcc}@supports (color:color-mix(in lab,red,red)){.border-l-violet-500\/80{border-left-color:color-mix(in oklab,var(--color-violet-500) 80%,transparent)}}.bg-\[\#070a0f\]{background-color:#070a0f}.bg-\[hsl\(224\,30\%\,6\%\)\]{background-color:#0b0d14}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/5{background-color:#f99c000d}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/5{background-color:color-mix(in oklab,var(--color-amber-500) 5%,transparent)}}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500) 10%,transparent)}}.bg-amber-500\/15{background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/15{background-color:color-mix(in oklab,var(--color-amber-500) 15%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.bg-amber-500\/80{background-color:#f99c00cc}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/80{background-color:color-mix(in oklab,var(--color-amber-500) 80%,transparent)}}.bg-amber-500\/\[0\.06\]{background-color:#f99c000f}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/\[0\.06\]{background-color:color-mix(in oklab,var(--color-amber-500) 6%,transparent)}}.bg-background\/10{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/10{background-color:color-mix(in oklab,hsl(var(--background)) 10%,transparent)}}.bg-background\/15{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/15{background-color:color-mix(in oklab,hsl(var(--background)) 15%,transparent)}}.bg-background\/20{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/20{background-color:color-mix(in oklab,hsl(var(--background)) 20%,transparent)}}.bg-background\/25{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/25{background-color:color-mix(in oklab,hsl(var(--background)) 25%,transparent)}}.bg-background\/30{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/30{background-color:color-mix(in oklab,hsl(var(--background)) 30%,transparent)}}.bg-background\/35{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/35{background-color:color-mix(in oklab,hsl(var(--background)) 35%,transparent)}}.bg-background\/40{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/40{background-color:color-mix(in oklab,hsl(var(--background)) 40%,transparent)}}.bg-background\/50{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/50{background-color:color-mix(in oklab,hsl(var(--background)) 50%,transparent)}}.bg-black\/10{background-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.bg-black\/10{background-color:color-mix(in oklab,var(--color-black) 10%,transparent)}}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black) 30%,transparent)}}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\/70{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500) 20%,transparent)}}.bg-border,.bg-border\/30{background-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.bg-border\/30{background-color:color-mix(in oklab,hsl(var(--border)) 30%,transparent)}}.bg-card,.bg-card\/20{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/20{background-color:color-mix(in oklab,hsl(var(--card)) 20%,transparent)}}.bg-card\/30{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/30{background-color:color-mix(in oklab,hsl(var(--card)) 30%,transparent)}}.bg-card\/40{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/40{background-color:color-mix(in oklab,hsl(var(--card)) 40%,transparent)}}.bg-card\/45{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/45{background-color:color-mix(in oklab,hsl(var(--card)) 45%,transparent)}}.bg-card\/50{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/50{background-color:color-mix(in oklab,hsl(var(--card)) 50%,transparent)}}.bg-card\/70{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/70{background-color:color-mix(in oklab,hsl(var(--card)) 70%,transparent)}}.bg-card\/85{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/85{background-color:color-mix(in oklab,hsl(var(--card)) 85%,transparent)}}.bg-cyan-500{background-color:var(--color-cyan-500)}.bg-cyan-500\/10{background-color:#00b7d71a}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/10{background-color:color-mix(in oklab,var(--color-cyan-500) 10%,transparent)}}.bg-cyan-500\/15{background-color:#00b7d726}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/15{background-color:color-mix(in oklab,var(--color-cyan-500) 15%,transparent)}}.bg-cyan-500\/20{background-color:#00b7d733}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/20{background-color:color-mix(in oklab,var(--color-cyan-500) 20%,transparent)}}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-500\/5{background-color:#00bb7f0d}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/5{background-color:color-mix(in oklab,var(--color-emerald-500) 5%,transparent)}}.bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/10{background-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.bg-emerald-500\/80{background-color:#00bb7fcc}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/80{background-color:color-mix(in oklab,var(--color-emerald-500) 80%,transparent)}}.bg-emerald-500\/\[0\.07\]{background-color:#00bb7f12}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/\[0\.07\]{background-color:color-mix(in oklab,var(--color-emerald-500) 7%,transparent)}}.bg-fuchsia-500{background-color:var(--color-fuchsia-500)}.bg-fuchsia-500\/10{background-color:#e12afb1a}@supports (color:color-mix(in lab,red,red)){.bg-fuchsia-500\/10{background-color:color-mix(in oklab,var(--color-fuchsia-500) 10%,transparent)}}.bg-fuchsia-500\/15{background-color:#e12afb26}@supports (color:color-mix(in lab,red,red)){.bg-fuchsia-500\/15{background-color:color-mix(in oklab,var(--color-fuchsia-500) 15%,transparent)}}.bg-indigo-500{background-color:var(--color-indigo-500)}.bg-indigo-500\/5{background-color:#625fff0d}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/5{background-color:color-mix(in oklab,var(--color-indigo-500) 5%,transparent)}}.bg-indigo-500\/10{background-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/10{background-color:color-mix(in oklab,var(--color-indigo-500) 10%,transparent)}}.bg-indigo-500\/15{background-color:#625fff26}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/15{background-color:color-mix(in oklab,var(--color-indigo-500) 15%,transparent)}}.bg-lime-500{background-color:var(--color-lime-500)}.bg-lime-500\/15{background-color:#80cd0026}@supports (color:color-mix(in lab,red,red)){.bg-lime-500\/15{background-color:color-mix(in oklab,var(--color-lime-500) 15%,transparent)}}.bg-muted{background-color:hsl(var(--muted))}.bg-muted-foreground\/40{background-color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.bg-muted-foreground\/40{background-color:color-mix(in oklab,hsl(var(--muted-foreground)) 40%,transparent)}}.bg-muted\/10{background-color:hsl(var(--muted))}@supports (color:color-mix(in lab,red,red)){.bg-muted\/10{background-color:color-mix(in oklab,hsl(var(--muted)) 10%,transparent)}}.bg-muted\/20{background-color:hsl(var(--muted))}@supports (color:color-mix(in lab,red,red)){.bg-muted\/20{background-color:color-mix(in oklab,hsl(var(--muted)) 20%,transparent)}}.bg-muted\/25{background-color:hsl(var(--muted))}@supports (color:color-mix(in lab,red,red)){.bg-muted\/25{background-color:color-mix(in oklab,hsl(var(--muted)) 25%,transparent)}}.bg-muted\/40{background-color:hsl(var(--muted))}@supports (color:color-mix(in lab,red,red)){.bg-muted\/40{background-color:color-mix(in oklab,hsl(var(--muted)) 40%,transparent)}}.bg-neutral-800{background-color:var(--color-neutral-800)}.bg-neutral-950{background-color:var(--color-neutral-950)}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500) 20%,transparent)}}.bg-pink-500{background-color:var(--color-pink-500)}.bg-pink-500\/15{background-color:#f6339a26}@supports (color:color-mix(in lab,red,red)){.bg-pink-500\/15{background-color:color-mix(in oklab,var(--color-pink-500) 15%,transparent)}}.bg-popover,.bg-popover\/95{background-color:hsl(var(--popover))}@supports (color:color-mix(in lab,red,red)){.bg-popover\/95{background-color:color-mix(in oklab,hsl(var(--popover)) 95%,transparent)}}.bg-primary,.bg-primary\/5{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.bg-primary\/5{background-color:color-mix(in oklab,hsl(var(--primary)) 5%,transparent)}}.bg-primary\/10{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.bg-primary\/10{background-color:color-mix(in oklab,hsl(var(--primary)) 10%,transparent)}}.bg-primary\/15{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.bg-primary\/15{background-color:color-mix(in oklab,hsl(var(--primary)) 15%,transparent)}}.bg-primary\/\[0\.06\]{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.bg-primary\/\[0\.06\]{background-color:color-mix(in oklab,hsl(var(--primary)) 6%,transparent)}}.bg-purple-500\/15{background-color:#ac4bff26}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/15{background-color:color-mix(in oklab,var(--color-purple-500) 15%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500) 20%,transparent)}}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\/5{background-color:#fb2c360d}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/5{background-color:color-mix(in oklab,var(--color-red-500) 5%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.bg-red-500\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/15{background-color:color-mix(in oklab,var(--color-red-500) 15%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.bg-red-500\/80{background-color:#fb2c36cc}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/80{background-color:color-mix(in oklab,var(--color-red-500) 80%,transparent)}}.bg-rose-500\/15{background-color:#ff235726}@supports (color:color-mix(in lab,red,red)){.bg-rose-500\/15{background-color:color-mix(in oklab,var(--color-rose-500) 15%,transparent)}}.bg-sky-500\/10{background-color:#00a5ef1a}@supports (color:color-mix(in lab,red,red)){.bg-sky-500\/10{background-color:color-mix(in oklab,var(--color-sky-500) 10%,transparent)}}.bg-slate-400{background-color:var(--color-slate-400)}.bg-slate-500\/15{background-color:#62748e26}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/15{background-color:color-mix(in oklab,var(--color-slate-500) 15%,transparent)}}.bg-slate-500\/20{background-color:#62748e33}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/20{background-color:color-mix(in oklab,var(--color-slate-500) 20%,transparent)}}.bg-teal-500{background-color:var(--color-teal-500)}.bg-teal-500\/10{background-color:#00baa71a}@supports (color:color-mix(in lab,red,red)){.bg-teal-500\/10{background-color:color-mix(in oklab,var(--color-teal-500) 10%,transparent)}}.bg-teal-500\/15{background-color:#00baa726}@supports (color:color-mix(in lab,red,red)){.bg-teal-500\/15{background-color:color-mix(in oklab,var(--color-teal-500) 15%,transparent)}}.bg-transparent{background-color:#0000}.bg-violet-500{background-color:var(--color-violet-500)}.bg-violet-500\/5{background-color:#8d54ff0d}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/5{background-color:color-mix(in oklab,var(--color-violet-500) 5%,transparent)}}.bg-violet-500\/10{background-color:#8d54ff1a}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/10{background-color:color-mix(in oklab,var(--color-violet-500) 10%,transparent)}}.bg-violet-500\/15{background-color:#8d54ff26}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/15{background-color:color-mix(in oklab,var(--color-violet-500) 15%,transparent)}}.bg-violet-500\/\[0\.04\]{background-color:#8d54ff0a}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/\[0\.04\]{background-color:color-mix(in oklab,var(--color-violet-500) 4%,transparent)}}.bg-violet-500\/\[0\.05\]{background-color:#8d54ff0d}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/\[0\.05\]{background-color:color-mix(in oklab,var(--color-violet-500) 5%,transparent)}}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-tr{--tw-gradient-position:to top right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-cyan-500{--tw-gradient-from:var(--color-cyan-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-foreground{--tw-gradient-from:hsl(var(--foreground));--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-500{--tw-gradient-from:var(--color-indigo-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-500{--tw-gradient-from:var(--color-purple-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-teal-500{--tw-gradient-from:var(--color-teal-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-teal-500\/15{--tw-gradient-from:#00baa726}@supports (color:color-mix(in lab,red,red)){.from-teal-500\/15{--tw-gradient-from:color-mix(in oklab, var(--color-teal-500) 15%, transparent)}}.from-teal-500\/15{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-teal-500\/20{--tw-gradient-from:#00baa733}@supports (color:color-mix(in lab,red,red)){.from-teal-500\/20{--tw-gradient-from:color-mix(in oklab, var(--color-teal-500) 20%, transparent)}}.from-teal-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.via-foreground{--tw-gradient-via:hsl(var(--foreground));--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-indigo-500\/10{--tw-gradient-via:#625fff1a}@supports (color:color-mix(in lab,red,red)){.via-indigo-500\/10{--tw-gradient-via:color-mix(in oklab, var(--color-indigo-500) 10%, transparent)}}.via-indigo-500\/10{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-indigo-500\/15{--tw-gradient-via:#625fff26}@supports (color:color-mix(in lab,red,red)){.via-indigo-500\/15{--tw-gradient-via:color-mix(in oklab, var(--color-indigo-500) 15%, transparent)}}.via-indigo-500\/15{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-blue-500{--tw-gradient-to:var(--color-blue-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-emerald-500{--tw-gradient-to:var(--color-emerald-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-pink-500{--tw-gradient-to:var(--color-pink-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-primary{--tw-gradient-to:hsl(var(--primary));--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-500\/15{--tw-gradient-to:#ac4bff26}@supports (color:color-mix(in lab,red,red)){.to-purple-500\/15{--tw-gradient-to:color-mix(in oklab, var(--color-purple-500) 15%, transparent)}}.to-purple-500\/15{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-500\/20{--tw-gradient-to:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.to-purple-500\/20{--tw-gradient-to:color-mix(in oklab, var(--color-purple-500) 20%, transparent)}}.to-purple-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-sky-500{--tw-gradient-to:var(--color-sky-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.bg-repeat{background-repeat:repeat}.fill-primary\/20{fill:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.fill-primary\/20{fill:color-mix(in oklab,hsl(var(--primary)) 20%,transparent)}}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\.5{padding:calc(var(--spacing) * 3.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-12{padding:calc(var(--spacing) * 12)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-3\.5{padding-inline:calc(var(--spacing) * 3.5)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-20{padding-block:calc(var(--spacing) * 20)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-24{padding-top:calc(var(--spacing) * 24)}.pt-\[12vh\]{padding-top:12vh}.pr-1{padding-right:var(--spacing)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-6{padding-left:calc(var(--spacing) * 6)}.pl-8{padding-left:calc(var(--spacing) * 8)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:JetBrains Mono,ui-monospace,SFMono-Regular,monospace}.font-sans{font-family:Inter,ui-sans-serif,system-ui,-apple-system,sans-serif}.font-space{font-family:Space Grotesk,sans-serif}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[7px\]{font-size:7px}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-wrap{text-wrap:wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-clip{text-overflow:clip}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-300{color:var(--color-amber-300)}.text-amber-300\/70{color:#ffd236b3}@supports (color:color-mix(in lab,red,red)){.text-amber-300\/70{color:color-mix(in oklab,var(--color-amber-300) 70%,transparent)}}.text-amber-400{color:var(--color-amber-400)}.text-amber-400\/80{color:#fcbb00cc}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/80{color:color-mix(in oklab,var(--color-amber-400) 80%,transparent)}}.text-amber-400\/90{color:#fcbb00e6}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/90{color:color-mix(in oklab,var(--color-amber-400) 90%,transparent)}}.text-amber-500{color:var(--color-amber-500)}.text-black{color:var(--color-black)}.text-blue-300{color:var(--color-blue-300)}.text-cyan-200\/90{color:#a2f4fde6}@supports (color:color-mix(in lab,red,red)){.text-cyan-200\/90{color:color-mix(in oklab,var(--color-cyan-200) 90%,transparent)}}.text-cyan-300{color:var(--color-cyan-300)}.text-cyan-300\/80{color:#53eafdcc}@supports (color:color-mix(in lab,red,red)){.text-cyan-300\/80{color:color-mix(in oklab,var(--color-cyan-300) 80%,transparent)}}.text-cyan-400{color:var(--color-cyan-400)}.text-emerald-300{color:var(--color-emerald-300)}.text-emerald-300\/80{color:#5ee9b5cc}@supports (color:color-mix(in lab,red,red)){.text-emerald-300\/80{color:color-mix(in oklab,var(--color-emerald-300) 80%,transparent)}}.text-emerald-300\/90{color:#5ee9b5e6}@supports (color:color-mix(in lab,red,red)){.text-emerald-300\/90{color:color-mix(in oklab,var(--color-emerald-300) 90%,transparent)}}.text-emerald-400{color:var(--color-emerald-400)}.text-emerald-400\/90{color:#00d294e6}@supports (color:color-mix(in lab,red,red)){.text-emerald-400\/90{color:color-mix(in oklab,var(--color-emerald-400) 90%,transparent)}}.text-foreground,.text-foreground\/70{color:hsl(var(--foreground))}@supports (color:color-mix(in lab,red,red)){.text-foreground\/70{color:color-mix(in oklab,hsl(var(--foreground)) 70%,transparent)}}.text-foreground\/80{color:hsl(var(--foreground))}@supports (color:color-mix(in lab,red,red)){.text-foreground\/80{color:color-mix(in oklab,hsl(var(--foreground)) 80%,transparent)}}.text-foreground\/85{color:hsl(var(--foreground))}@supports (color:color-mix(in lab,red,red)){.text-foreground\/85{color:color-mix(in oklab,hsl(var(--foreground)) 85%,transparent)}}.text-foreground\/90{color:hsl(var(--foreground))}@supports (color:color-mix(in lab,red,red)){.text-foreground\/90{color:color-mix(in oklab,hsl(var(--foreground)) 90%,transparent)}}.text-fuchsia-300{color:var(--color-fuchsia-300)}.text-fuchsia-400{color:var(--color-fuchsia-400)}.text-indigo-300{color:var(--color-indigo-300)}.text-indigo-400{color:var(--color-indigo-400)}.text-lime-400{color:var(--color-lime-400)}.text-muted-foreground,.text-muted-foreground\/40{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/40{color:color-mix(in oklab,hsl(var(--muted-foreground)) 40%,transparent)}}.text-muted-foreground\/50{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/50{color:color-mix(in oklab,hsl(var(--muted-foreground)) 50%,transparent)}}.text-muted-foreground\/55{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/55{color:color-mix(in oklab,hsl(var(--muted-foreground)) 55%,transparent)}}.text-muted-foreground\/60{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/60{color:color-mix(in oklab,hsl(var(--muted-foreground)) 60%,transparent)}}.text-muted-foreground\/70{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/70{color:color-mix(in oklab,hsl(var(--muted-foreground)) 70%,transparent)}}.text-muted-foreground\/75{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/75{color:color-mix(in oklab,hsl(var(--muted-foreground)) 75%,transparent)}}.text-muted-foreground\/80{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/80{color:color-mix(in oklab,hsl(var(--muted-foreground)) 80%,transparent)}}.text-neutral-200{color:var(--color-neutral-200)}.text-neutral-400{color:var(--color-neutral-400)}.text-orange-300{color:var(--color-orange-300)}.text-pink-400{color:var(--color-pink-400)}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary\/70{color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.text-primary\/70{color:color-mix(in oklab,hsl(var(--primary)) 70%,transparent)}}.text-primary\/80{color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.text-primary\/80{color:color-mix(in oklab,hsl(var(--primary)) 80%,transparent)}}.text-purple-300{color:var(--color-purple-300)}.text-red-200{color:var(--color-red-200)}.text-red-300{color:var(--color-red-300)}.text-red-300\/90{color:#ffa3a3e6}@supports (color:color-mix(in lab,red,red)){.text-red-300\/90{color:color-mix(in oklab,var(--color-red-300) 90%,transparent)}}.text-red-400{color:var(--color-red-400)}.text-red-400\/80{color:#ff6568cc}@supports (color:color-mix(in lab,red,red)){.text-red-400\/80{color:color-mix(in oklab,var(--color-red-400) 80%,transparent)}}.text-rose-300{color:var(--color-rose-300)}.text-rose-400{color:var(--color-rose-400)}.text-sky-300{color:var(--color-sky-300)}.text-sky-300\/90{color:#77d4ffe6}@supports (color:color-mix(in lab,red,red)){.text-sky-300\/90{color:color-mix(in oklab,var(--color-sky-300) 90%,transparent)}}.text-sky-400{color:var(--color-sky-400)}.text-slate-300{color:var(--color-slate-300)}.text-teal-300{color:var(--color-teal-300)}.text-teal-400{color:var(--color-teal-400)}.text-transparent{color:#0000}.text-violet-200\/90{color:#ddd6ffe6}@supports (color:color-mix(in lab,red,red)){.text-violet-200\/90{color:color-mix(in oklab,var(--color-violet-200) 90%,transparent)}}.text-violet-300{color:var(--color-violet-300)}.text-violet-300\/80{color:#c4b4ffcc}@supports (color:color-mix(in lab,red,red)){.text-violet-300\/80{color:color-mix(in oklab,var(--color-violet-300) 80%,transparent)}}.text-violet-400{color:var(--color-violet-400)}.text-violet-400\/70{color:#a685ffb3}@supports (color:color-mix(in lab,red,red)){.text-violet-400\/70{color:color-mix(in oklab,var(--color-violet-400) 70%,transparent)}}.text-white{color:var(--color-white)}.text-white\/95{color:#fffffff2}@supports (color:color-mix(in lab,red,red)){.text-white\/95{color:color-mix(in oklab,var(--color-white) 95%,transparent)}}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.diagonal-fractions{--tw-numeric-fraction:diagonal-fractions;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.stacked-fractions{--tw-numeric-fraction:stacked-fractions;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.normal-nums{font-variant-numeric:normal}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.overline{text-decoration-line:overline}.underline{text-decoration-line:underline}.decoration-primary\/40{-webkit-text-decoration-color:hsl(var(--primary));text-decoration-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.decoration-primary\/40{-webkit-text-decoration-color:color-mix(in oklab,hsl(var(--primary)) 40%,transparent);text-decoration-color:color-mix(in oklab,hsl(var(--primary)) 40%,transparent)}}.underline-offset-2{text-underline-offset:2px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.subpixel-antialiased{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.\[color-scheme\:dark\]{color-scheme:dark}.opacity-0{opacity:0}.opacity-30{opacity:.3}.opacity-35{opacity:.35}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.opacity-85{opacity:.85}.opacity-90{opacity:.9}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-4{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-amber-500\/10{--tw-shadow-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.shadow-amber-500\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-amber-500) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/5{--tw-shadow-color:#0000000d}@supports (color:color-mix(in lab,red,red)){.shadow-black\/5{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 5%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/10{--tw-shadow-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.shadow-black\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/15{--tw-shadow-color:#00000026}@supports (color:color-mix(in lab,red,red)){.shadow-black\/15{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 15%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/20{--tw-shadow-color:#0003}@supports (color:color-mix(in lab,red,red)){.shadow-black\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/25{--tw-shadow-color:#00000040}@supports (color:color-mix(in lab,red,red)){.shadow-black\/25{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 25%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-500\/5{--tw-shadow-color:#00bb7f0d}@supports (color:color-mix(in lab,red,red)){.shadow-emerald-500\/5{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-emerald-500) 5%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-primary\/5{--tw-shadow-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.shadow-primary\/5{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, hsl(var(--primary)) 5%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-primary\/10{--tw-shadow-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.shadow-primary\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, hsl(var(--primary)) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-primary\/20{--tw-shadow-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.shadow-primary\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, hsl(var(--primary)) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-red-500\/10{--tw-shadow-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.shadow-red-500\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-red-500) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-background\/60{--tw-ring-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.ring-background\/60{--tw-ring-color:color-mix(in oklab, hsl(var(--background)) 60%, transparent)}}.ring-black\/40{--tw-ring-color:#0006}@supports (color:color-mix(in lab,red,red)){.ring-black\/40{--tw-ring-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.ring-white\/70{--tw-ring-color:#ffffffb3}@supports (color:color-mix(in lab,red,red)){.ring-white\/70{--tw-ring-color:color-mix(in oklab, var(--color-white) 70%, transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[130px\]{--tw-blur:blur(130px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[140px\]{--tw-blur:blur(140px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[160px\]{--tw-blur:blur(160px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a)) drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a) drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.sepia{--tw-sepia:sepia(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.\!filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)!important}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-grayscale{--tw-backdrop-grayscale:grayscale(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-invert{--tw-backdrop-invert:invert(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-sepia{--tw-backdrop-sepia:sepia(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition\!{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events!important;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))!important;transition-duration:var(--tw-duration,var(--default-transition-duration))!important}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.select-text{-webkit-user-select:text;user-select:text}:where(.divide-x-reverse>:not(:last-child)){--tw-divide-x-reverse:1}.ring-inset{--tw-ring-inset:inset}@media(hover:hover){.group-hover\:translate-x-0\.5:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:text-primary:is(:where(.group):hover *){color:hsl(var(--primary))}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-muted-foreground::placeholder,.placeholder\:text-muted-foreground\/50::placeholder{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.placeholder\:text-muted-foreground\/50::placeholder{color:color-mix(in oklab,hsl(var(--muted-foreground)) 50%,transparent)}}.first\:rounded-l-sm:first-child{border-top-left-radius:calc(var(--radius) - 4px);border-bottom-left-radius:calc(var(--radius) - 4px)}.last\:border-0:last-child{border-style:var(--tw-border-style);border-width:0}@media(hover:hover){.hover\:border-amber-500\/50:hover{border-color:#f99c0080}@supports (color:color-mix(in lab,red,red)){.hover\:border-amber-500\/50:hover{border-color:color-mix(in oklab,var(--color-amber-500) 50%,transparent)}}.hover\:border-border:hover,.hover\:border-border\/60:hover{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.hover\:border-border\/60:hover{border-color:color-mix(in oklab,hsl(var(--border)) 60%,transparent)}}.hover\:border-emerald-500\/40:hover{border-color:#00bb7f66}@supports (color:color-mix(in lab,red,red)){.hover\:border-emerald-500\/40:hover{border-color:color-mix(in oklab,var(--color-emerald-500) 40%,transparent)}}.hover\:border-primary\/20:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/20:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 20%,transparent)}}.hover\:border-primary\/30:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/30:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 30%,transparent)}}.hover\:border-primary\/40:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/40:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 40%,transparent)}}.hover\:border-primary\/45:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/45:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 45%,transparent)}}.hover\:border-primary\/50:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/50:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 50%,transparent)}}.hover\:border-red-500\/50:hover{border-color:#fb2c3680}@supports (color:color-mix(in lab,red,red)){.hover\:border-red-500\/50:hover{border-color:color-mix(in oklab,var(--color-red-500) 50%,transparent)}}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-amber-400:hover{background-color:var(--color-amber-400)}.hover\:bg-amber-500\/10:hover{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/10:hover{background-color:color-mix(in oklab,var(--color-amber-500) 10%,transparent)}}.hover\:bg-amber-500\/15:hover{background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/15:hover{background-color:color-mix(in oklab,var(--color-amber-500) 15%,transparent)}}.hover\:bg-amber-500\/20:hover{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/20:hover{background-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.hover\:bg-background\/30:hover{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-background\/30:hover{background-color:color-mix(in oklab,hsl(var(--background)) 30%,transparent)}}.hover\:bg-background\/40:hover{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-background\/40:hover{background-color:color-mix(in oklab,hsl(var(--background)) 40%,transparent)}}.hover\:bg-background\/60:hover{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-background\/60:hover{background-color:color-mix(in oklab,hsl(var(--background)) 60%,transparent)}}.hover\:bg-background\/80:hover{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-background\/80:hover{background-color:color-mix(in oklab,hsl(var(--background)) 80%,transparent)}}.hover\:bg-card\/70:hover{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/70:hover{background-color:color-mix(in oklab,hsl(var(--card)) 70%,transparent)}}.hover\:bg-emerald-500\/10:hover{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-emerald-500\/10:hover{background-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.hover\:bg-emerald-500\/15:hover{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.hover\:bg-emerald-500\/15:hover{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.hover\:bg-emerald-500\/20:hover{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-emerald-500\/20:hover{background-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.hover\:bg-fuchsia-500\/20:hover{background-color:#e12afb33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-fuchsia-500\/20:hover{background-color:color-mix(in oklab,var(--color-fuchsia-500) 20%,transparent)}}.hover\:bg-indigo-500\/15:hover{background-color:#625fff26}@supports (color:color-mix(in lab,red,red)){.hover\:bg-indigo-500\/15:hover{background-color:color-mix(in oklab,var(--color-indigo-500) 15%,transparent)}}.hover\:bg-neutral-700:hover{background-color:var(--color-neutral-700)}.hover\:bg-primary\/5:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/5:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 5%,transparent)}}.hover\:bg-primary\/10:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/10:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 10%,transparent)}}.hover\:bg-primary\/15:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/15:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 15%,transparent)}}.hover\:bg-primary\/20:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/20:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 20%,transparent)}}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 90%,transparent)}}.hover\:bg-primary\/95:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/95:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 95%,transparent)}}.hover\:bg-red-400:hover{background-color:var(--color-red-400)}.hover\:bg-red-500\/5:hover{background-color:#fb2c360d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/5:hover{background-color:color-mix(in oklab,var(--color-red-500) 5%,transparent)}}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.hover\:bg-red-500\/15:hover{background-color:#fb2c3626}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/15:hover{background-color:color-mix(in oklab,var(--color-red-500) 15%,transparent)}}.hover\:bg-red-500\/20:hover{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/20:hover{background-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.hover\:bg-violet-500\/20:hover{background-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.hover\:bg-violet-500\/20:hover{background-color:color-mix(in oklab,var(--color-violet-500) 20%,transparent)}}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-primary:hover,.hover\:text-primary\/80:hover{color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:text-primary\/80:hover{color:color-mix(in oklab,hsl(var(--primary)) 80%,transparent)}}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-red-400:hover{color:var(--color-red-400)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-90:hover{opacity:.9}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\:border-primary:focus,.focus\:border-primary\/50:focus{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.focus\:border-primary\/50:focus{border-color:color-mix(in oklab,hsl(var(--primary)) 50%,transparent)}}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-primary:focus,.focus\:ring-primary\/50:focus{--tw-ring-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.focus\:ring-primary\/50:focus{--tw-ring-color:color-mix(in oklab, hsl(var(--primary)) 50%, transparent)}}.focus\:ring-violet-500\/50:focus{--tw-ring-color:#8d54ff80}@supports (color:color-mix(in lab,red,red)){.focus\:ring-violet-500\/50:focus{--tw-ring-color:color-mix(in oklab, var(--color-violet-500) 50%, transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:hsl(var(--ring))}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:cursor-default:disabled{cursor:default}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}.aria-selected\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.aria-selected\:text-accent-foreground[aria-selected=true]{color:hsl(var(--accent-foreground))}@media(min-width:40rem){.sm\:inline{display:inline}.sm\:w-36{width:calc(var(--spacing) * 36)}.sm\:w-\[640px\]{width:640px}.sm\:max-w-\[400px\]{max-width:400px}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}.sm\:self-auto{align-self:auto}.sm\:p-10{padding:calc(var(--spacing) * 10)}}@media(min-width:48rem){.md\:col-span-2{grid-column:span 2/span 2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-\[170px_1fr\]{grid-template-columns:170px 1fr}}@media(min-width:64rem){.lg\:flex{display:flex}.lg\:w-40{width:calc(var(--spacing) * 40)}.lg\:w-72{width:calc(var(--spacing) * 72)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:grid-cols-\[1fr_300px\]{grid-template-columns:1fr 300px}.lg\:grid-cols-\[minmax\(0\,1fr\)_minmax\(0\,1\.3fr\)\]{grid-template-columns:minmax(0,1fr) minmax(0,1.3fr)}.lg\:flex-row{flex-direction:row}.lg\:items-center{align-items:center}.lg\:items-stretch{align-items:stretch}}}:root{--background:224 30% 6%;--foreground:210 20% 92%;--card:224 25% 10%;--card-foreground:210 20% 94%;--popover:224 28% 9%;--popover-foreground:210 20% 94%;--primary:172 72% 50%;--primary-foreground:224 47% 8%;--muted:220 16% 14%;--muted-foreground:215 14% 64%;--accent:220 16% 16%;--accent-foreground:210 20% 94%;--border:222 18% 23%;--input:222 18% 23%;--ring:172 72% 50%;--radius:.75rem;color-scheme:dark}.light{--background:0 0% 100%;--foreground:222 22% 12%;--card:0 0% 100%;--card-foreground:222 22% 12%;--popover:0 0% 100%;--popover-foreground:222 22% 12%;--primary:172 70% 38%;--primary-foreground:0 0% 100%;--muted:220 14% 95%;--muted-foreground:220 9% 42%;--accent:220 14% 94%;--accent-foreground:222 22% 12%;--border:220 13% 88%;--input:220 13% 88%;--ring:172 66% 50%;color-scheme:light}@keyframes aurora{0%{background-position:0%}50%{background-position:100%}to{background-position:0%}}.animate-aurora{background-size:200% 200%;animation:25s infinite aurora}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:hsl(var(--border));border-radius:9999px}*{border-color:hsl(var(--border) / .85);outline-color:hsl(var(--primary) / .5)}:focus-visible{outline:2px solid hsl(var(--primary) / .7);outline-offset:2px}@media(prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}html,body,#root{height:100%;overflow:hidden}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-family:var(--font-sans);-webkit-font-smoothing:antialiased;margin:0}@keyframes flow-cyan{0%{stroke-dasharray:6 3;stroke-dashoffset:18px}to{stroke-dasharray:6 3;stroke-dashoffset:0}}.animate-flow-cyan{animation:1.2s linear infinite flow-cyan}.rounded-2xl.border.bg-card\/45{position:relative;overflow:hidden;background-color:hsl(var(--card) / .85)!important;border-color:hsl(var(--border) / .95)!important;transition:transform .3s cubic-bezier(.4,0,.2,1),background-color .3s cubic-bezier(.4,0,.2,1),border-color .3s cubic-bezier(.4,0,.2,1),box-shadow .3s cubic-bezier(.4,0,.2,1)!important;box-shadow:0 10px 30px -15px #00000073,inset 0 1px #ffffff0d!important}.rounded-2xl.border.bg-card\/45:before{content:"";background:linear-gradient(90deg,hsl(var(--primary)),#6366f1,#a855f7);opacity:.75;height:3.5px;position:absolute;top:0;left:0;right:0;transition:opacity .3s!important}.rounded-2xl.border.bg-card\/45:hover{transform:translateY(-3px);background-color:hsl(var(--card) / .92)!important;border-color:hsl(var(--primary) / .35)!important;box-shadow:0 20px 40px -20px #000000a6,0 0 18px 2px hsl(var(--primary) / .05)!important}.rounded-2xl.border.bg-card\/45:hover:before{opacity:1}.rounded-xl.border.bg-card\/45{background-color:hsl(var(--card) / .88)!important;border-color:hsl(var(--border) / .9)!important;transition:background-color .2s,border-color .2s!important}.rounded-xl.border.bg-card\/45:hover{background-color:hsl(var(--card) / .95)!important;border-color:hsl(var(--primary) / .3)!important}aside nav a[class*="bg-primary/15"]:not([class*=justify-center]){background:linear-gradient(90deg,hsl(var(--primary) / .18),#6366f11f)!important;color:hsl(var(--primary))!important;border-left:3.5px solid hsl(var(--primary))!important;border-radius:0 var(--radius) var(--radius) 0!important;padding-left:calc(.75rem - 3.5px)!important;box-shadow:inset 0 1px #ffffff05!important}aside nav a[class*="bg-primary/15"][class*=justify-center]{background:hsl(var(--primary) / .18)!important;color:hsl(var(--primary))!important;box-shadow:0 0 12px 1px hsl(var(--primary) / .1)!important;border:1px solid hsl(var(--primary) / .3)!important}::-webkit-scrollbar-thumb{border-radius:9999px;background:hsl(var(--primary) / .25)!important}::-webkit-scrollbar-thumb:hover{background:hsl(var(--primary) / .5)!important}input:focus,textarea:focus,select:focus{outline:none;border-color:hsl(var(--primary))!important;box-shadow:0 0 0 2px hsl(var(--primary) / .15)!important}@media(min-width:1440px){html{font-size:16.5px}}@media(min-width:1920px){html{font-size:17.5px}}@media(min-width:2560px){html{font-size:19px}}@media(min-width:3440px){html{font-size:20px}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}} diff --git a/frontend/dist/index.html b/frontend/dist/index.html index ee040a4..e3f69ef 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -7,8 +7,8 @@ Mission Control 2.0 - - + +
diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index 7b5835d..28e7668 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -338,6 +338,7 @@ export interface ConnectLine { export interface ConnectHealth { gateway: ConnectLine memory: ConnectLine + desktop_gateway: ConnectLine } export interface Memory { diff --git a/frontend/src/views/ConnectView.tsx b/frontend/src/views/ConnectView.tsx index 9272230..0b14a0b 100644 --- a/frontend/src/views/ConnectView.tsx +++ b/frontend/src/views/ConnectView.tsx @@ -111,8 +111,8 @@ export function ConnectView() { Verbindung & Integration

- Binde deinen lokalen Agenten an die Box an — über zwei getrennte Leitungen: - das Modell (Gateway) und das geteilte Gedächtnis (MCP). + Binde deinen lokalen Agenten an die Box an — über drei getrennte Leitungen: + das Modell (Gateway), das geteilte Gedächtnis (MCP) und das Desktop-Gateway.

@@ -158,11 +158,27 @@ export function ConnectView() { + {/* Leitung 3 — Desktop-Gateway */} +
+ +
+
+
+ Leitung 3 — Desktop-Gateway +
+ +
+
+ Desktop-Gateway · :9119 · API-Status +
+
+

Der Gateway liefert nur das LLM. Das geteilte Gedächtnis läuft über einen - eigenen MCP-Server — beide werden unabhängig eingerichtet. + eigenen MCP-Server und das Desktop-Gateway bietet die Agenten-Schnittstelle — + alle drei Leitungen werden unabhängig eingerichtet.