diff --git a/backend/routers/boxwart.py b/backend/routers/boxwart.py index da0c274..c698e95 100644 --- a/backend/routers/boxwart.py +++ b/backend/routers/boxwart.py @@ -176,3 +176,9 @@ def nutzung() -> dict: @router.get("/zeitplan") def zeitplan_route() -> dict: return zeitplan.flugplan() + + +@router.get("/updates/verlauf") +def updates_verlauf(anzahl: int = 8) -> dict: + """Die letzten Läufe des Sonntags-Updates (Hermes-Cron, executions.db nur lesend).""" + return {"laeufe": waechter.update_laeufe(max(1, min(anzahl, 30)))} diff --git a/backend/services/waechter.py b/backend/services/waechter.py index 193f7c4..6771b84 100644 --- a/backend/services/waechter.py +++ b/backend/services/waechter.py @@ -235,6 +235,28 @@ def _letzter_lauf(job_id: str) -> dict | None: return {"status": row[0], "started_at": row[1], "finished_at": row[2], "error": row[3]} +def update_laeufe(anzahl: int = 8) -> list[dict]: + """Letzte Läufe aller Update-Jobs (Name enthält „update“), neueste zuerst.""" + ids = {str(j.get("id")): str(j.get("name", "")) for j in _hermes_jobs() + if "update" in str(j.get("name", "")).lower()} + if not ids or not HERMES_EXEC_DB.exists(): + return [] + platz = ",".join("?" * len(ids)) + try: + con = sqlite3.connect(f"file:{HERMES_EXEC_DB}?mode=ro", uri=True, timeout=2) + try: + rows = con.execute( + f"select job_id, status, started_at, finished_at, error from executions " + f"where job_id in ({platz}) order by started_at desc limit ?", + (*ids, anzahl)).fetchall() + finally: + con.close() + except sqlite3.Error: + return [] + return [{"job": ids.get(r[0], r[0]), "status": r[1], "start": r[2], "ende": r[3], + "fehler": (r[4] or None)} for r in rows] + + def werkzeugfehler_im_lauf(zeilen: list[str], job_id: str, start_iso: str) -> tuple[int, str]: """Zählt 'Tool X returned error'-Zeilen eines Laufs in errors.log. Hermes markiert jede Zeile mit [cron___]; der Tag des Laufstarts reicht zur Zuordnung.""" diff --git a/frontend/components.json b/frontend/components.json new file mode 100644 index 0000000..5c23ec4 --- /dev/null +++ b/frontend/components.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "radix-nova", + "rsc": false, + "tsx": true, + "tailwind": { + "config": "", + "css": "src/index.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "iconLibrary": "lucide", + "rtl": false, + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + }, + "menuColor": "default", + "menuAccent": "subtle", + "registries": {} +} diff --git a/frontend/dist/assets/AgentView-Ddy3G6Cn.js b/frontend/dist/assets/AgentView-Ddy3G6Cn.js deleted file mode 100644 index 10d799e..0000000 --- a/frontend/dist/assets/AgentView-Ddy3G6Cn.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as B,M as T,j as e,N as p,W as g,b as n,J as D,T as G,z as L,O as $,f as R,k as F,u as I,r as q,P as y,Q as v,t as w,X as U,C as k,n as _,q as u}from"./index-DMY9lUCb.js";import{S}from"./SectionLabel-B7ySrBs7.js";import{C as K}from"./clock-Bth-s5Y3.js";import{E as O}from"./external-link-DcJao8h4.js";import{S as Q}from"./shield-BtE9Fxv6.js";/** - * @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 C=B("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"}]]),h=l=>l.slice(11,19);function z(l){return l<1?`${Math.round(l*1e3)} ms`:`${l.toFixed(1)} s`}function V(){const{data:l,isLoading:s}=T();if(s)return e.jsxs("section",{className:"space-y-3",children:[e.jsx(S,{icon:p,children:"Werkzeug-Verlauf"}),e.jsx("div",{className:"mc-card-sm p-4 text-xs text-muted-foreground",children:"Lese Hermes' Log …"})]});if(!(l!=null&&l.verfuegbar))return null;const{rufe:o,werkzeuge:c,laeufe:i}=l,x=c.filter(r=>r.fehler>0);return e.jsxs("section",{className:"space-y-3",children:[e.jsxs(S,{icon:p,children:["Werkzeug-Verlauf · ",o.length," Rufe",x.length>0&&` · ${x.reduce((r,d)=>r+d.fehler,0)} Fehler`]}),e.jsxs("p",{className:"max-w-2xl text-[11px] leading-relaxed text-muted-foreground",children:["Gelesen aus Hermes' eigenem Log — Mission Control schaut zu, greift aber nicht ein. Was dort ",e.jsx("em",{children:"nicht"})," steht, steht auch hier nicht: Lucys Gedankengang und die Argumente eines Werkzeug-Rufs bleiben unsichtbar."]}),e.jsx("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:c.map(r=>{const d=r.fehler>0&&r.fehler===r.rufe;return e.jsxs("div",{className:n("mc-card-sm space-y-1.5 p-3",d&&"border-red-500/40 bg-red-500/5"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{className:n("h-3.5 w-3.5 shrink-0",d?"text-red-400":r.fehler?"text-amber-400":"text-primary"),"aria-hidden":"true"}),e.jsx("span",{className:"truncate font-mono text-xs font-semibold text-foreground",children:r.werkzeug}),d&&e.jsx("span",{className:"ml-auto shrink-0 rounded bg-red-500/15 px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wide text-red-300",children:"immer rot"})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-0.5 font-mono text-[10px] text-muted-foreground",children:[e.jsxs("span",{className:"tabular-nums",children:[r.rufe," Rufe"]}),e.jsxs("span",{className:n("tabular-nums",r.fehler>0&&"font-semibold text-red-400"),children:[r.fehler," Fehler"]}),e.jsxs("span",{className:"tabular-nums",children:["Ø ",z(r.dauer_schnitt_s)]})]}),r.letzter_fehler&&e.jsx("p",{className:"border-t border-border/30 pt-1.5 text-[10px] leading-relaxed text-red-300/90",children:r.letzter_fehler})]},r.werkzeug)})}),i.length>0&&e.jsx("div",{className:"mc-card-sm divide-y divide-border/30",children:i.map(r=>e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 px-3 py-2 font-mono text-[10px]",children:[e.jsx(K,{className:"h-3 w-3 shrink-0 text-muted-foreground","aria-hidden":"true"}),e.jsx("span",{className:"truncate font-semibold text-foreground",children:r.lauf}),e.jsxs("span",{className:"tabular-nums text-muted-foreground",children:[h(r.von),"–",h(r.bis)]}),e.jsxs("span",{className:"ml-auto tabular-nums text-muted-foreground",children:[r.rufe," Rufe"]}),r.fehler>0&&e.jsxs("span",{className:"tabular-nums font-semibold text-red-400",children:[r.fehler," Fehler"]})]},r.lauf))}),e.jsxs("details",{className:"mc-card-sm",children:[e.jsxs("summary",{className:"cursor-pointer px-3 py-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground hover:text-foreground",children:["Einzelne Rufe (",o.length,")"]}),e.jsx("ul",{className:"max-h-72 divide-y divide-border/20 overflow-y-auto scrollbar-thin border-t border-border/30",children:[...o].reverse().map((r,d)=>e.jsxs("li",{className:"flex items-start gap-2 px-3 py-1.5 font-mono text-[10px]",children:[r.ok?e.jsx(D,{className:"mt-px h-3 w-3 shrink-0 text-emerald-500","aria-hidden":"true"}):e.jsx(G,{className:"mt-px h-3 w-3 shrink-0 text-red-400","aria-hidden":"true"}),e.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:h(r.zeit)}),e.jsx("span",{className:"shrink-0 font-semibold text-foreground",children:r.werkzeug}),e.jsx("span",{className:"shrink-0 tabular-nums text-muted-foreground",children:z(r.dauer_s)}),r.zeichen!=null&&e.jsxs("span",{className:"shrink-0 tabular-nums text-muted-foreground/60",children:[r.zeichen," Z."]}),r.fehler&&e.jsx("span",{className:"min-w-0 flex-1 truncate text-red-300/90",title:r.fehler,children:r.fehler})]},`${r.zeit}-${r.werkzeug}-${d}`))})]})]})}const J=["chat","coding","fast","heavy"];function se(){const l=L(),{data:s,error:o}=$(),{data:c}=R(),{showAlert:i,dialogElement:x}=F(),r=I(),d=o?String(o):"",[H,m]=q.useState(!1),E=(c==null?void 0:c.models)??[],f=t=>{var a;return((a=t==null?void 0:t.match(/:(\d+)/))==null?void 0:a[1])??""},b=f(s==null?void 0:s.gateway_url)||"8642",j=(s==null?void 0:s.pc_executor_url)??"",A=j.replace(/^https?:\/\//,""),P=f(j)||"7777";async function W(t){try{await _("/api/agent/brain",{method:"POST",body:JSON.stringify({model:t})}),i("Erledigt",`Hermes-Hirn zeigt jetzt auf das Alias '${t}'. Der Gateway-Dienst wurde neu gestartet.`),r.invalidateQueries({queryKey:u.agentStatus}),m(!1)}catch(a){i("Fehler",`Wechsel fehlgeschlagen: ${a.message||a}`)}}async function M(t){try{await _("/api/agent/brain/set",{method:"POST",body:JSON.stringify({model_id:t})}),i("Erledigt","Agent-Hirn gewechselt (warm gehalten). Gateway wurde neugestartet."),r.invalidateQueries({queryKey:u.agentStatus}),r.invalidateQueries({queryKey:u.models}),m(!1)}catch(a){i("Fehler",`Wechsel fehlgeschlagen: ${a.message||a}`)}}return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[e.jsxs("div",{children:[e.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"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Hermes ist ein autonomer Agent, der im Hintergrund der Box läuft (Port ",e.jsxs("code",{children:[":",b]}),") und seine eigene UI besitzt."]})]}),(s==null?void 0:s.hermes_ui_url)&&e.jsxs("a",{href:y(s.hermes_ui_url),target:"_blank",rel:"noopener",className:n("flex h-9 px-4 items-center gap-1.5 text-xs font-semibold rounded-lg transition-all cursor-pointer shadow-md shrink-0 self-start",s.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:[e.jsx(O,{className:"h-4 w-4"}),e.jsx("span",{children:"Hermes-GUI öffnen"})]})]}),d&&e.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 (",d,")."]}),s&&e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"mc-card p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[e.jsx(v,{className:"h-4.5 w-4.5 text-primary"}),e.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Agent-Fluss"})]}),e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-stretch gap-3",children:[e.jsxs("button",{onClick:()=>s.hermes_ui_reachable&&window.open(y(s.hermes_ui_url),"_blank"),title:s.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:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(p,{className:n("h-3.5 w-3.5",s.hermes_ui_reachable?"text-emerald-400":"text-amber-500")}),e.jsx("span",{className:"text-xs font-semibold text-foreground",children:"Desktop & GUI"}),e.jsx("span",{className:n("ml-auto h-1.5 w-1.5 rounded-full animate-pulse",s.hermes_ui_reachable?"bg-emerald-500":"bg-amber-500")})]}),e.jsx("span",{className:"text-[10px] text-muted-foreground font-mono mt-0.5",children:"Hermes Desktop · Clients"})]}),e.jsx("div",{className:"hidden lg:flex items-center text-muted-foreground text-lg select-none",children:"→"}),e.jsxs("div",{className:"flex-1 flex flex-col gap-2.5",children:[e.jsxs("div",{className:"rounded-xl border border-primary/40 bg-primary/5 px-3.5 py-2.5 flex items-center gap-2",children:[e.jsx(v,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("span",{className:"text-xs font-semibold text-primary",children:"Agent Gateway"}),e.jsxs("span",{className:"text-[11px] font-mono text-muted-foreground",children:[":",b]}),e.jsxs("span",{className:n("ml-auto inline-flex items-center gap-1.5 text-[10px] font-bold uppercase font-mono px-2 py-0.5 rounded-full border",s.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:[e.jsx("span",{className:n("h-1.5 w-1.5 rounded-full",s.gateway_reachable?"bg-emerald-500 animate-pulse":"bg-red-500")}),s.gateway_reachable?"online":"offline"]})]}),e.jsxs("div",{className:"grid gap-2.5 sm:grid-cols-3",children:[e.jsxs("button",{onClick:()=>m(!0),className:"rounded-xl border border-border/60 bg-background/30 p-3 text-left hover:border-primary/45 transition-all cursor-pointer",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[e.jsx(w,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Hirn"}),e.jsx("span",{className:"ml-auto text-[9px] text-primary/70 font-bold uppercase",children:"wechseln →"})]}),e.jsx("div",{className:"text-[11px] font-mono font-medium text-foreground truncate mt-1",title:s.brain_model,children:s.brain_model||"chat"})]}),e.jsxs("div",{className:"rounded-xl border border-border/60 bg-background/30 p-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[e.jsx(g,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Verdrahtung"})]}),e.jsxs("div",{className:"text-[10px] font-mono mt-1 flex flex-wrap gap-x-2 text-muted-foreground",children:[e.jsxs("span",{children:["Config: ",s.has_config?"✓":"—"]}),e.jsxs("span",{children:["Skills: ",s.has_skills?"✓":"—"]}),e.jsxs("span",{children:["Memory: ",s.has_memories?"✓":"—"]})]})]}),e.jsxs("div",{className:"rounded-xl border border-border/60 bg-background/30 p-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-muted-foreground",children:[e.jsx(C,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"PC"}),e.jsx("span",{className:n("ml-auto h-1.5 w-1.5 rounded-full",s.pc_executor_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")})]}),e.jsxs("div",{className:n("text-[11px] font-mono mt-1",s.pc_executor_reachable?"text-emerald-400":"text-muted-foreground"),children:[":",P," ",s.pc_executor_reachable?"verbunden":"offline"]})]})]})]})]})]}),e.jsxs("div",{className:"mc-card p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(C,{className:"h-5 w-5 text-primary"}),e.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"PC Verbindung"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:n("h-2 w-2 rounded-full",s.pc_executor_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),e.jsx("span",{className:"text-xs font-semibold text-foreground",children:s.pc_executor_reachable?"Erreichbar":"Nicht verbunden"})]})]}),e.jsxs("div",{className:"grid gap-6 md:grid-cols-2 text-xs text-muted-foreground leading-relaxed text-left",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("p",{children:["Der ",e.jsx("strong",{className:"text-foreground",children:"Hermes PC Executor"})," läuft auf ",e.jsx("code",{className:"text-foreground font-mono px-1 py-0.5 rounded bg-muted/40 border border-border/30",children:A||"deinem Windows-PC"})," und ermöglicht Hermes den direkten Zugriff auf deinen Windows-PC — Shell-Befehle, Screenshots, Tastatureingaben."]}),e.jsxs("p",{children:["Hermes erreicht den PC über den MCP-Server ",e.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."]})]}),e.jsx("div",{className:"space-y-3",children:s.pc_executor_reachable?e.jsxs("div",{className:"p-3.5 bg-emerald-500/5 border border-emerald-500/20 rounded-xl space-y-1",children:[e.jsxs("div",{className:"text-emerald-400 font-semibold text-xs flex items-center gap-1.5",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"PC Executor verbunden"]}),e.jsxs("p",{className:"text-[10px]",children:["Hermes kann jetzt per Telegram oder Terminal Befehle auf TobisNicerPC ausführen. Nutze ",e.jsx("code",{className:"text-foreground",children:"pc_shell"}),", ",e.jsx("code",{className:"text-foreground",children:"pc_screenshot"})," oder ",e.jsx("code",{className:"text-foreground",children:"pc_open"}),"."]})]}):e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"text-xs font-bold text-foreground",children:"PC Executor starten"}),e.jsxs("p",{children:["Starte ",e.jsx("code",{className:"text-foreground font-mono",children:"start.bat"})," im Ordner ",e.jsx("code",{className:"text-foreground font-mono",children:"client\\hermes-pc\\"})," auf dem Windows-PC und lasse das Fenster offen."]}),e.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"})]})})]})]}),!s.gateway_reachable&&e.jsxs("div",{className:"mc-card p-6 space-y-4 text-left",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Q,{className:"h-5 w-5 text-amber-500"}),e.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"Hermes-Agent Diagnostics"})]}),e.jsxs("div",{className:"text-xs text-muted-foreground space-y-3 leading-relaxed",children:[e.jsx("p",{children:"Der Hermes-Dienst ist auf der Box derzeit offline oder kann sich nicht mit dem lokalen llama-swap verbinden."}),e.jsxs("p",{children:["Am schnellsten: In der System-Schublade unter ",e.jsx("strong",{children:"Dienste"})," den Eintrag"," ",e.jsx("strong",{children:"Hermes-Gateway"})," mit einem Klick neu starten (dort gibt es auch die Logs dazu)."]}),e.jsxs("button",{onClick:()=>l({to:".",search:t=>({...t,system:"wartung"})}),className:"flex h-9 items-center gap-1.5 rounded-lg border border-primary/40 bg-primary/10 px-4 text-[11px] font-bold uppercase tracking-wide text-primary transition-all hover:bg-primary/20 cursor-pointer",children:[e.jsx(g,{className:"h-3.5 w-3.5"})," Dienste-Übersicht öffnen"]}),e.jsxs("p",{children:["Weitere Einrichtungsdetails (Brain-Konfiguration, MCP-Kopplungen, SSH-Tunneling und Such-Engines) findest du in der Dokumentationsdatei:",e.jsx("code",{className:"ml-1 px-1.5 py-0.5 rounded bg-muted/40 text-foreground border border-border/30",children:"docs/HERMES_SETUP.md"}),"."]})]})]})]}),s&&H&&e.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:e.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:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[e.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[e.jsx(w,{className:"h-4 w-4"}),e.jsx("span",{children:"Hermes-Hirn konfigurieren"})]}),e.jsx("button",{onClick:()=>m(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(U,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Lane / Gateway-Alias"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:J.map(t=>{const a=s.brain_model===t;return e.jsxs("button",{onClick:()=>W(t),className:n("px-3 py-1.5 rounded-lg text-xs font-mono font-semibold border transition-all cursor-pointer flex items-center gap-1.5",a?"border-primary/40 bg-primary/10 text-primary":"border-border/30 bg-background/20 text-foreground hover:bg-accent"),children:[t,a&&e.jsx(k,{className:"h-3.5 w-3.5"})]},t)})}),e.jsxs("p",{className:"text-[10px] text-muted-foreground/70",children:["Schlank & flexibel: das Hirn folgt dem Lane-Routing (z.B. ",e.jsx("code",{className:"text-primary",children:"chat"})," = fast↔heavy)."]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Installiertes Modell (warm gehalten)"}),e.jsx("div",{className:"space-y-1.5 max-h-56 overflow-y-auto pr-1",children:E.map(t=>{var N;const a=t.role==="hermes";return e.jsxs("button",{onClick:()=>!a&&M(t.name),disabled:a||t.incomplete,className:n("w-full text-left px-3 py-2.5 rounded-lg text-xs flex items-center justify-between font-mono border transition-all",a?"border-indigo-500/40 bg-indigo-500/10 text-indigo-300":t.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:[e.jsxs("div",{className:"flex flex-col min-w-0",children:[e.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:(N=t.name.split("/").pop())==null?void 0:N.replace(/\.gguf$/i,"")}),e.jsxs("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:[t.capabilities.params_b?`${t.capabilities.params_b}B`:"?"," · ",t.capabilities.tools!=="no"?"Tools ✓":"ohne Tools",t.role&&` · Rolle: ${t.role}`]})]}),a?e.jsxs("span",{className:"text-[9px] font-bold uppercase text-indigo-300 shrink-0 flex items-center gap-1",children:[e.jsx(k,{className:"h-3.5 w-3.5"})," Aktiv"]}):e.jsx("span",{className:"text-[9px] font-bold uppercase text-primary/70 shrink-0",children:"Warm setzen →"})]},t.name)})})]}),e.jsxs("div",{className:"text-[10px] text-amber-400/80 flex items-start gap-1.5 border-t border-border/20 pt-2.5",children:[e.jsx("span",{children:"💡"}),e.jsxs("span",{children:["Für einen ",e.jsx("strong",{children:"Agenten"}),' sind Hermes-Modelle (natives Tool-Calling) meist die robustere Wahl. Neues Modell? Erst über „Modell-Manager → Modelle finden" laden.']})]})]})}),e.jsx(V,{}),x]})}export{se as AgentView}; diff --git a/frontend/dist/assets/ChronikView-79MqWZGv.js b/frontend/dist/assets/ChronikView-79MqWZGv.js deleted file mode 100644 index 9085659..0000000 --- a/frontend/dist/assets/ChronikView-79MqWZGv.js +++ /dev/null @@ -1,36 +0,0 @@ -import{c as b,r as p,j as e,b as w,ag as z,z as C,A as D,ah as A,L as y,a1 as E,R as N,ai as B,aj as L,ak as Z,u as q,k as $,n as j,q as R}from"./index-DMY9lUCb.js";import{S as T}from"./search-D_8DnBvS.js";/** - * @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 U=b("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 v=b("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 H=b("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 V=b("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 O=b("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** - * @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 P=b("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. - * See the LICENSE file in the root directory of this source tree. - */const W=b("Radar",[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]]),F=3600,k=48;function I({items:t,aktiv:m}){const{balken:d,von:x,bis:g,max:c}=p.useMemo(()=>{if(!t.length)return{balken:[],von:0,bis:0,max:0};const a=t.map(l=>l.ts),u=Math.min(...a),r=Math.max(...a),o=Math.max(r-u,F),n=new Array(k).fill(0);for(const l of a){const f=Math.min(k-1,Math.floor((l-u)/o*k));n[f]++}return{balken:n,von:u,bis:r,max:Math.max(...n,1)}},[t]);if(d.length===0)return null;const h=a=>new Date(a*1e3).toLocaleDateString("de-DE",{day:"2-digit",month:"2-digit",...g-x<2*86400?{hour:"2-digit",minute:"2-digit"}:{}});return e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"flex h-8 items-end gap-px",role:"img","aria-label":`Aktivitätsdichte: ${t.length} Einträge zwischen ${h(x)} und ${h(g)}`,children:d.map((a,u)=>e.jsx("div",{title:a===1?"1 Eintrag":`${a} Einträge`,className:w("min-w-px flex-1 rounded-t-sm transition-colors",a===0?"bg-border/25":m?"bg-primary/70":"bg-primary/40"),style:{height:a===0?"2px":`${Math.max(12,a/c*100)}%`}},u))}),e.jsxs("div",{className:"flex justify-between font-mono text-[9px] text-muted-foreground/60",children:[e.jsx("span",{children:h(x)}),e.jsxs("span",{className:"tabular-nums",children:[t.length," Einträge"]}),e.jsx("span",{children:h(g)})]})]})}const J={sentry:{icon:L,label:"Health-Wächter",cls:"text-red-300 bg-red-500/10 border-red-500/25"},alarm:{icon:B,label:"Alarm",cls:"text-red-200 bg-red-500/15 border-red-500/40"},notify:{icon:H,label:"Meldung",cls:"text-sky-300 bg-sky-500/10 border-sky-500/25"},"chef-gutachter":{icon:P,label:"Morgenlage",cls:"text-violet-300 bg-violet-500/10 border-violet-500/25"},radar:{icon:W,label:"Radar",cls:"text-teal-300 bg-teal-500/10 border-teal-500/25"},auftragsbuch:{icon:V,label:"Auftragsbuch",cls:"text-primary bg-primary/10 border-primary/25"},zeitmaschine:{icon:N,label:"Zeitmaschine",cls:"text-amber-300 bg-amber-500/10 border-amber-500/25"},reminder:{icon:U,label:"Erinnerung",cls:"text-amber-300 bg-amber-500/10 border-amber-500/25"},traum:{icon:E,label:"Traum",cls:"text-violet-300 bg-violet-500/10 border-violet-500/25"}},_={icon:O,label:"Box",cls:"text-muted-foreground bg-background/40 border-border/50"};function G(t){return new Date(t*1e3).toLocaleDateString("de-DE",{weekday:"long",day:"2-digit",month:"long"})}function Y(){const{data:t=[],isLoading:m}=z(),[d,x]=p.useState(!0),g=C(),{q:c=""}=D({from:"/chronik"}),h=r=>g({to:"/chronik",search:r?{q:r}:{},replace:!0}),a=p.useMemo(()=>{const r=c.trim().toLowerCase();return r?t.filter(o=>o.subject.toLowerCase().includes(r)||o.text.toLowerCase().includes(r)||o.source.toLowerCase().includes(r)):t},[t,c]),u=p.useMemo(()=>{const r=[];for(const o of a){const n=G(o.ts),l=r[r.length-1];l&&l.day===n?l.items.push(o):r.push({day:n,items:[o]})}return r},[a]);return e.jsxs("div",{className:"space-y-7",children:[e.jsxs("div",{children:[e.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"}),e.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."})]}),e.jsx(K,{}),e.jsxs("section",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:[e.jsx(A,{className:"h-3.5 w-3.5"})," Verlauf",c&&e.jsxs("span",{className:"normal-case text-primary",children:["· ",a.length," von ",t.length]})]}),e.jsxs("div",{className:"relative ml-auto w-full sm:w-64",children:[e.jsx(T,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground","aria-hidden":"true"}),e.jsx("input",{type:"search",value:c,onChange:r=>h(r.target.value),placeholder:"Verlauf durchsuchen …","aria-label":"Chronik durchsuchen",className:"h-8 w-full rounded-lg border border-border/60 bg-background/40 pl-8 pr-3 text-xs text-foreground outline-none transition-colors focus:border-primary"})]})]}),!m&&a.length>0&&e.jsx(I,{items:a,aktiv:!!c}),m&&e.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:[e.jsx(y,{className:"h-4 w-4 animate-spin"})," Chronik wird geladen …"]}),!m&&a.length===0&&e.jsx("div",{className:"rounded-2xl border border-dashed border-border/60 bg-card/20 p-8 text-center text-xs text-muted-foreground",children:c?e.jsxs(e.Fragment,{children:["Nichts zu „",c,'" im Verlauf. ',e.jsx("button",{onClick:()=>h(""),className:"cursor-pointer text-primary underline underline-offset-2",children:"Filter aufheben"})]}):"Noch keine Einträge. Sobald die Box etwas von allein tut oder meldet (Updates, Wächter, Träume), steht es hier."}),u.map(({day:r,items:o})=>e.jsxs("div",{children:[e.jsx("p",{className:"mb-2 text-xs font-bold text-foreground/70",children:r}),e.jsxs("div",{className:"space-y-2 border-l-2 border-border/40 pl-4",children:[(d?o.slice(0,8):o).map(n=>{const l=J[n.source]??_,f=l.icon;return e.jsxs("div",{className:"relative rounded-xl border border-border/50 bg-card/40 p-3 backdrop-blur-sm",children:[e.jsx("span",{className:"absolute -left-[23px] top-4 h-2.5 w-2.5 rounded-full bg-border ring-4 ring-background/60"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("span",{className:w("flex items-center gap-1 rounded-md border px-1.5 py-0.5 text-[10px] font-bold",l.cls),children:[e.jsx(f,{className:"h-3 w-3"})," ",l.label]}),n.subject&&e.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground",children:n.subject}),e.jsx("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground/60",children:new Date(n.ts*1e3).toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})})]}),e.jsx("p",{className:"mt-1.5 whitespace-pre-wrap text-xs leading-relaxed text-foreground/85",children:n.text})]},n.id)}),d&&o.length>8&&e.jsxs("button",{onClick:()=>x(!1),className:"text-[11px] text-muted-foreground underline hover:text-foreground",children:[o.length-8," weitere anzeigen"]})]})]},r))]})]})}function K(){const{data:t}=Z(),m=q(),{showAlert:d,showConfirm:x,dialogElement:g}=$(),[c,h]=p.useState(null),[a,u]=p.useState(!1),[r,o]=p.useState(!1),n=(t==null?void 0:t.backups)??[],l=r?n:n.slice(0,4);function f(s){const i=s.snapshot.match(/^(\d{4})-?(\d{2})-?(\d{2})[T_-](\d{2})[-:]?(\d{2})/);return i?`${i[3]}.${i[2]}.${i[1]}, ${i[4]}:${i[5]} Uhr`:s.snapshot}async function M(s){h(s.file);try{await j("/api/zeitmaschine/restore",{method:"POST",body:JSON.stringify({file:s.file})}),d("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(i){d("Start fehlgeschlagen",String((i==null?void 0:i.message)||i))}finally{h(null)}}async function S(){u(!0);try{const s=await j("/api/system/backup",{method:"POST"});s.ok?d("Gesichert",`Snapshot ${s.snapshot} wurde angelegt.`):d("Backup fehlgeschlagen",s.error||"Unbekannter Fehler"),m.invalidateQueries({queryKey:R.zeitmaschine})}catch(s){d("Backup fehlgeschlagen",String((s==null?void 0:s.message)||s))}finally{u(!1)}}return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:[e.jsx(v,{className:"h-3.5 w-3.5"})," Zeitmaschine — gesicherte Stände"]}),e.jsxs("button",{onClick:S,disabled:a||!(t!=null&&t.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:[a?e.jsx(y,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(v,{className:"h-3.5 w-3.5"})," Jetzt sichern"]})]}),t&&!t.available&&e.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."}),(t==null?void 0:t.available)&&n.length===0&&e.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".'}),l.length>0&&e.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:l.map((s,i)=>e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl border border-border/50 bg-card/40 p-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("p",{className:"text-xs font-semibold text-foreground",children:[f(s)," ",i===0&&e.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"})]}),e.jsxs("p",{className:"font-mono text-[10px] text-muted-foreground/70 truncate",title:s.file,children:[s.size_mb.toLocaleString("de-DE")," MB · ",s.file]})]}),e.jsxs("button",{disabled:c!==null,onClick:()=>x("Wirklich zu diesem Stand zurück?",`Die Box wird auf den Snapshot vom ${f(s)} 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.`,()=>M(s)),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:[c===s.file?e.jsx(y,{className:"h-3 w-3 animate-spin"}):e.jsx(N,{className:"h-3 w-3"})," Zurück"]})]},s.file))}),n.length>4&&!r&&e.jsxs("button",{onClick:()=>o(!0),className:"text-[11px] text-muted-foreground underline hover:text-foreground",children:["Alle ",n.length," Snapshots anzeigen"]}),g]})}export{Y as ChronikView}; diff --git a/frontend/dist/assets/CommandPalette-CUaikJDv.js b/frontend/dist/assets/CommandPalette-CUaikJDv.js deleted file mode 100644 index 3729c47..0000000 --- a/frontend/dist/assets/CommandPalette-CUaikJDv.js +++ /dev/null @@ -1,51 +0,0 @@ -import{c as It,r as a,j as E,ar as be,W as In,as as An,$ as _n,at as Mn,au as ht,z as Tn,n as Ln,T as Fn,b as jn}from"./index-DMY9lUCb.js";import{r as At}from"./index-CVfMhtws.js";import{C as $n,a as Wn}from"./cloud-download-BGirmHxu.js";import{R as Un}from"./refresh-cw-hAcZthO8.js";import{S as Bn}from"./search-D_8DnBvS.js";import{F as Vn}from"./file-text-BSQuFPZM.js";/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const zn=It("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);/** - * @license lucide-react v0.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 Kn=It("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);var gt=1,Hn=.9,Yn=.8,Gn=.17,Me=.1,Te=.999,Xn=.9999,qn=.99,Zn=/[\\\/_+.#"@\[\(\{&]/,Jn=/[\\\/_+.#"@\[\(\{&]/g,Qn=/[\s-]/,_t=/[\s-]/g;function Ve(e,t,n,r,o,s,i){if(s===t.length)return o===e.length?gt:qn;var c=`${o},${s}`;if(i[c]!==void 0)return i[c];for(var u=r.charAt(s),d=n.indexOf(u,o),f=0,l,v,b,h;d>=0;)l=Ve(e,t,n,r,d+1,s+1,i),l>f&&(d===o?l*=gt:Zn.test(e.charAt(d-1))?(l*=Yn,b=e.slice(o,d-1).match(Jn),b&&o>0&&(l*=Math.pow(Te,b.length))):Qn.test(e.charAt(d-1))?(l*=Hn,h=e.slice(o,d-1).match(_t),h&&o>0&&(l*=Math.pow(Te,h.length))):(l*=Gn,o>0&&(l*=Math.pow(Te,d-o))),e.charAt(d)!==t.charAt(s)&&(l*=Xn)),(ll&&(l=v*Me)),l>f&&(f=l),d=n.indexOf(u,d+1);return i[c]=f,f}function bt(e){return e.toLowerCase().replace(_t," ")}function er(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Ve(e,t,bt(e),bt(t),0,0,{})}var tr=Object.defineProperty,me=(e,t)=>tr(e,"name",{value:t,configurable:!0}),Mt=!!(typeof window<"u"&&window.document&&window.document.createElement);function Q(e,t,{checkForDefaultPrevented:n=!0}={}){return me(function(o){if(e==null||e(o),n===!1||!o||!o.defaultPrevented)return t==null?void 0:t(o)},"handleEvent")}me(Q,"composeEventHandlers");function nr(e){var t;if(!Mt)throw new Error("Cannot access window outside of the DOM");return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)??window}me(nr,"getOwnerWindow");function ze(e){if(!Mt)throw new Error("Cannot access document outside of the DOM");return(e==null?void 0:e.ownerDocument)??document}me(ze,"getOwnerDocument");function Tt(e,t=!1){const{activeElement:n}=ze(e);if(!(n!=null&&n.nodeName))return null;if(Lt(n)&&n.contentDocument)return Tt(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=ze(n).getElementById(r);if(o)return o}}return n}me(Tt,"getActiveElement");function Lt(e){return e.tagName==="IFRAME"}me(Lt,"isFrame");var rr=Object.defineProperty,nt=(e,t)=>rr(e,"name",{value:t,configurable:!0});function Ke(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}nt(Ke,"setRef");function ee(...e){return t=>{let n=!1;const r=e.map(o=>{const s=Ke(o,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let o=0;oor(e,"name",{value:t,configurable:!0});function ar(e,t){const n=a.createContext(t);n.displayName=e+"Context";const r=j(s=>{const{children:i,...c}=s,u=a.useMemo(()=>c,Object.values(c));return E.jsx(n.Provider,{value:u,children:i})},"Provider");r.displayName=e+"Provider";function o(s,i={}){const{optional:c=!1}=i,u=a.useContext(n);if(u)return u;if(t!==void 0)return t;if(!c)throw new Error(`\`${s}\` must be used within \`${e}\``)}return j(o,"useContext"),[r,o]}j(ar,"createContext");function Ft(e,t=[]){let n=[];function r(s,i){const c=a.createContext(i);c.displayName=s+"Context";const u=n.length;n=[...n,i];const d=j(l=>{var w;const{scope:v,children:b,...h}=l,p=((w=v==null?void 0:v[e])==null?void 0:w[u])||c,g=a.useMemo(()=>h,Object.values(h));return E.jsx(p.Provider,{value:g,children:b})},"Provider");d.displayName=s+"Provider";function f(l,v,b={}){var w;const{optional:h=!1}=b,p=((w=v==null?void 0:v[e])==null?void 0:w[u])||c,g=a.useContext(p);if(g)return g;if(i!==void 0)return i;if(!h)throw new Error(`\`${l}\` must be used within \`${s}\``)}return j(f,"useContext"),[d,f]}j(r,"createContext");const o=j(()=>{const s=n.map(i=>a.createContext(i));return j(function(c){const u=(c==null?void 0:c[e])||s;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])},"useScope")},"createScope");return o.scopeName=e,[r,jt(o,...t)]}j(Ft,"createContextScope");function jt(...e){const t=e[0];if(e.length===1)return t;const n=j(()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return j(function(s){const i=r.reduce((c,{useScope:u,scopeName:d})=>{const l=u(s)[`__scope${d}`];return{...c,...l}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}j(jt,"composeContextScopes");var fe=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},ir=Object.defineProperty,sr=(e,t)=>ir(e,"name",{value:t,configurable:!0}),cr=be[" useId ".trim().toString()]||(()=>{}),ur=0;function V(e){const[t,n]=a.useState(cr());return fe(()=>{e||n(r=>r??String(ur++))},[e]),e||(t?`radix-${t}`:"")}sr(V,"useId");var lr=Object.defineProperty,dr=(e,t)=>lr(e,"name",{value:t,configurable:!0}),yt=be[" useEffectEvent ".trim().toString()],Et=be[" useInsertionEffect ".trim().toString()];function $t(e){if(typeof yt=="function")return yt(e);const t=a.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof Et=="function"?Et(()=>{t.current=e}):fe(()=>{t.current=e}),a.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}dr($t,"useEffectEvent");var fr=Object.defineProperty,ye=(e,t)=>fr(e,"name",{value:t,configurable:!0}),vr=be[" useInsertionEffect ".trim().toString()]||fe;function Wt({prop:e,defaultProp:t,onChange:n=ye(()=>{},"onChange"),caller:r}){const[o,s,i]=Ut({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:o,d=a.useCallback(f=>{var l;if(c){const v=Bt(f)?f(e):f;v!==e&&((l=i.current)==null||l.call(i,v))}else s(f)},[c,e,s,i]);return[u,d]}ye(Wt,"useControllableState");function Ut({defaultProp:e,onChange:t}){const[n,r]=a.useState(e),o=a.useRef(n),s=a.useRef(t);return vr(()=>{s.current=t},[t]),a.useEffect(()=>{var i;o.current!==n&&((i=s.current)==null||i.call(s,n),o.current=n)},[n,o]),[n,r,s]}ye(Ut,"useUncontrolledState");function Bt(e){return typeof e=="function"}ye(Bt,"isFunction");var wt=Symbol("RADIX:SYNC_STATE");function mr(e,t,n,r){const{prop:o,defaultProp:s,onChange:i,caller:c}=t,u=o!==void 0,d=$t(i),f=[{...n,state:s}];r&&f.push(r);const[l,v]=a.useReducer((g,w)=>{if(w.type===wt)return{...g,state:w.state};const S=e(g,w);return u&&!Object.is(S.state,g.state)&&d(S.state),S},...f),b=l.state,h=a.useRef(b);a.useEffect(()=>{h.current!==b&&(h.current=b,u||d(b))},[b,h,u]);const p=a.useMemo(()=>o!==void 0?{...l,state:o}:l,[l,o]);return a.useEffect(()=>{u&&!Object.is(o,l.state)&&v({type:wt,state:o})},[o,l.state,u]),[p,v]}ye(mr,"useControllableStateReducer");var pr=Object.defineProperty,W=(e,t)=>pr(e,"name",{value:t,configurable:!0});function rt(e){const t=a.forwardRef((n,r)=>{let{children:o,...s}=n,i=null,c=!1;const u=[];He(o)&&typeof Se=="function"&&(o=Se(o._payload)),a.Children.forEach(o,v=>{var b;if(Ht(v)){c=!0;const h=v;let p="child"in h.props?h.props.child:h.props.children;He(p)&&typeof Se=="function"&&(p=Se(p._payload)),i=gr(h,p),u.push((b=i==null?void 0:i.props)==null?void 0:b.children)}else u.push(v)}),i?i=a.cloneElement(i,void 0,u):!c&&a.Children.count(o)===1&&a.isValidElement(o)&&(i=o);const d=i?Kt(i):void 0,f=pe(r,d);if(!i){if(o||o===0)throw new Error(c?Er(e):yr(e));return o}const l=zt(s,i.props??{});return i.type!==a.Fragment&&(l.ref=r?f:d),a.cloneElement(i,l)});return t.displayName=`${e}.Slot`,t}W(rt,"createSlot");var Vt=Symbol.for("radix.slottable");function hr(e){const t=W(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=Vt,t}W(hr,"createSlottable");var gr=W((e,t)=>{if("child"in e.props){const n=e.props.child;return a.isValidElement(n)?a.cloneElement(n,void 0,e.props.children(n.props.children)):null}return a.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function zt(e,t){const n={...t};for(const r in t){const o=e[r],s=t[r];/^on[A-Z]/.test(r)?o&&s?n[r]=(...c)=>{const u=s(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...s}:r==="className"&&(n[r]=[o,s].filter(Boolean).join(" "))}return{...e,...n}}W(zt,"mergeProps");function Kt(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}W(Kt,"getElementRef");function Ht(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vt}W(Ht,"isSlottable");var br=Symbol.for("react.lazy");function He(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===br&&"_payload"in e&&Yt(e._payload)}W(He,"isLazyComponent");function Yt(e){return typeof e=="object"&&e!==null&&"then"in e}W(Yt,"isPromiseLike");var yr=W(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),Er=W(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Se=be[" use ".trim().toString()],wr=Object.defineProperty,Sr=(e,t)=>wr(e,"name",{value:t,configurable:!0}),Cr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$=Cr.reduce((e,t)=>{const n=rt(`Primitive.${t}`),r=a.forwardRef((o,s)=>{const{asChild:i,...c}=o,u=i?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),E.jsx(u,{...c,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Gt(e,t){e&&At.flushSync(()=>e.dispatchEvent(t))}Sr(Gt,"dispatchDiscreteCustomEvent");var xr=Object.defineProperty,Pr=(e,t)=>xr(e,"name",{value:t,configurable:!0});function ve(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}Pr(ve,"useCallbackRef");var Rr=Object.defineProperty,_=(e,t)=>Rr(e,"name",{value:t,configurable:!0}),Ye="dismissableLayer.update",Or="dismissableLayer.pointerDownOutside",Dr="dismissableLayer.focusOutside",St,Xt=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),kr=a.forwardRef(_(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:s,onPointerDownOutside:i,onFocusOutside:c,onInteractOutside:u,onDismiss:d,...f}=t,l=a.useContext(Xt),[v,b]=a.useState(null),h=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=a.useState({}),g=pe(n,b),w=Array.from(l.layers),[S]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),x=S?w.indexOf(S):-1,O=v?w.indexOf(v):-1,R=l.layersWithOutsidePointerEventsDisabled.size>0,P=O>=x,N=a.useRef(!1),X=Zt(I=>{i==null||i(I),u==null||u(I),I.defaultPrevented||d==null||d()},{ownerDocument:h,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:N,dismissableSurfaces:l.dismissableSurfaces,shouldHandlePointerDownOutside:a.useCallback(I=>{if(!(I instanceof Node))return!1;const re=[...l.branches].some(K=>K.contains(I));return P&&!re},[l.branches,P])}),z=Jt(I=>{if(o&&N.current)return;const re=I.target;[...l.branches].some(J=>J.contains(re))||(c==null||c(I),u==null||u(I),I.defaultPrevented||d==null||d())},h),q=v?O===w.length-1:!1,F=ve(I=>{I.key==="Escape"&&(s==null||s(I),!I.defaultPrevented&&d&&(I.preventDefault(),d()))});return a.useEffect(()=>{if(q)return h.addEventListener("keydown",F,{capture:!0}),()=>h.removeEventListener("keydown",F,{capture:!0})},[h,q,F]),a.useEffect(()=>{if(v)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(St=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(v)),l.layers.add(v),Ge(),()=>{r&&(l.layersWithOutsidePointerEventsDisabled.delete(v),l.layersWithOutsidePointerEventsDisabled.size===0&&(h.body.style.pointerEvents=St))}},[v,h,r,l]),a.useEffect(()=>()=>{v&&(l.layers.delete(v),l.layersWithOutsidePointerEventsDisabled.delete(v),Ge())},[v,l]),a.useEffect(()=>{const I=_(()=>p({}),"handleUpdate");return document.addEventListener(Ye,I),()=>document.removeEventListener(Ye,I)},[]),E.jsx($.div,{...f,ref:g,style:{pointerEvents:R?P?"auto":"none":void 0,...t.style},onFocusCapture:Q(t.onFocusCapture,z.onFocusCapture),onBlurCapture:Q(t.onBlurCapture,z.onBlurCapture),onPointerDownCapture:Q(t.onPointerDownCapture,X.onPointerDownCapture)})},"DismissableLayer"));function qt(){const e=a.useContext(Xt),[t,n]=a.useState(null);return a.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}_(qt,"useDismissableLayerSurface");var Nr=_(()=>!0,"IS_TRUE");function Zt(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:s,shouldHandlePointerDownOutside:i=Nr}=t,c=ve(e),u=a.useRef(!1),d=a.useRef(!1),f=a.useRef(new Map),l=a.useRef(()=>{});return a.useEffect(()=>{function v(){d.current=!1,o.current=!1,f.current.clear()}_(v,"resetOutsideInteraction");function b(){return Array.from(f.current.values()).some(Boolean)}_(b,"isOutsideInteractionIntercepted");function h(x){if(!d.current)return;const O=x.target;O instanceof Node&&[...s].some(P=>P.contains(O))||f.current.set(x.type,!0),x.type==="click"&&window.setTimeout(()=>{d.current&&l.current()},0)}_(h,"handleInteractionCapture");function p(x){d.current&&f.current.set(x.type,!1)}_(p,"handleInteractionBubble");const g=_(x=>{if(x.target&&!u.current){let O=function(){n.removeEventListener("click",l.current);const P=b();v(),P||ot(Or,c,R,{discrete:!0})};if(_(O,"handleAndDispatchPointerDownOutsideEvent"),!i(x.target)){n.removeEventListener("click",l.current),v(),u.current=!1;return}const R={originalEvent:x};d.current=!0,o.current=r&&x.button===0,f.current.clear(),!r||x.button!==0?O():(n.removeEventListener("click",l.current),l.current=O,n.addEventListener("click",l.current,{once:!0}))}else n.removeEventListener("click",l.current),v();u.current=!1},"handlePointerDown"),w=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const x of w)n.addEventListener(x,h,!0),n.addEventListener(x,p);const S=window.setTimeout(()=>{n.addEventListener("pointerdown",g)},0);return()=>{window.clearTimeout(S),n.removeEventListener("pointerdown",g),n.removeEventListener("click",l.current);for(const x of w)n.removeEventListener(x,h,!0),n.removeEventListener(x,p)}},[n,c,r,o,s,i]),{onPointerDownCapture:_(()=>u.current=!0,"onPointerDownCapture")}}_(Zt,"usePointerDownOutside");function Jt(e,t=globalThis==null?void 0:globalThis.document){const n=ve(e),r=a.useRef(!1);return a.useEffect(()=>{const o=_(s=>{s.target&&!r.current&&ot(Dr,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:_(()=>r.current=!0,"onFocusCapture"),onBlurCapture:_(()=>r.current=!1,"onBlurCapture")}}_(Jt,"useFocusOutside");function Ge(){const e=new CustomEvent(Ye);document.dispatchEvent(e)}_(Ge,"dispatchUpdate");function ot(e,t,n,{discrete:r}){const o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Gt(o,s):o.dispatchEvent(s)}_(ot,"handleAndDispatchCustomEvent");var Ir=Object.defineProperty,T=(e,t)=>Ir(e,"name",{value:t,configurable:!0}),Le="focusScope.autoFocusOnMount",Fe="focusScope.autoFocusOnUnmount",Ct={bubbles:!1,cancelable:!0},Ar=a.forwardRef(T(function(t,n){const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:i,...c}=t,[u,d]=a.useState(null),f=ve(s),l=ve(i),v=a.useRef(null),b=pe(n,d),h=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(o){let g=function(O){if(h.paused||!u)return;const R=O.target;u.contains(R)?v.current=R:H(v.current,{select:!0})},w=function(O){if(h.paused||!u)return;const R=O.relatedTarget;R!==null&&(u.contains(R)||H(v.current,{select:!0}))},S=function(O){if(document.activeElement===document.body)for(const P of O)P.removedNodes.length>0&&H(u)};T(g,"handleFocusIn"),T(w,"handleFocusOut"),T(S,"handleMutations"),document.addEventListener("focusin",g),document.addEventListener("focusout",w);const x=new MutationObserver(S);return u&&x.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",w),x.disconnect()}}},[o,u,h.paused]),a.useEffect(()=>{if(u){xt.add(h);const g=document.activeElement;if(!u.contains(g)){const S=new CustomEvent(Le,Ct);u.addEventListener(Le,f),u.dispatchEvent(S),S.defaultPrevented||(Qt(on(at(u)),{select:!0}),document.activeElement===g&&H(u))}return()=>{u.removeEventListener(Le,f),setTimeout(()=>{const S=new CustomEvent(Fe,Ct);u.addEventListener(Fe,l),u.dispatchEvent(S),S.defaultPrevented||H(g??document.body,{select:!0}),u.removeEventListener(Fe,l),xt.remove(h)},0)}}},[u,f,l,h]);const p=a.useCallback(g=>{if(!r&&!o||h.paused)return;const w=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,S=document.activeElement;if(w&&S){const x=g.currentTarget,[O,R]=en(x);O&&R?!g.shiftKey&&S===R?(g.preventDefault(),r&&H(O,{select:!0})):g.shiftKey&&S===O&&(g.preventDefault(),r&&H(R,{select:!0})):S===x&&g.preventDefault()}},[r,o,h.paused]);return E.jsx($.div,{tabIndex:-1,...c,ref:b,onKeyDown:p})},"FocusScope"));function Qt(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(H(r,{select:t}),document.activeElement!==n)return}T(Qt,"focusFirst");function en(e){const t=at(e),n=Xe(t,e),r=Xe(t.reverse(),e);return[n,r]}T(en,"getTabbableEdges");function at(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:T(r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}T(at,"getTabbableCandidates");function Xe(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):tn(r,{upTo:t})))return r}T(Xe,"findVisible");function tn(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}T(tn,"isHidden");function nn(e){return e instanceof HTMLInputElement&&"select"in e}T(nn,"isSelectableInput");function H(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&nn(e)&&t&&e.select()}}T(H,"focus");var xt=rn();function rn(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=qe(e,t),e.unshift(t)},remove(t){var n;e=qe(e,t),(n=e[0])==null||n.resume()}}}T(rn,"createFocusScopesStack");function qe(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}T(qe,"arrayRemove");function on(e){return e.filter(t=>t.tagName!=="A")}T(on,"removeLinks");var _r=Object.defineProperty,Mr=(e,t)=>_r(e,"name",{value:t,configurable:!0}),Tr=a.forwardRef(Mr(function(t,n){var u;const{container:r,...o}=t,[s,i]=a.useState(!1);fe(()=>i(!0),[]);const c=r||s&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return c?At.createPortal(E.jsx($.div,{...o,ref:n}),c):null},"Portal")),Lr=Object.defineProperty,Y=(e,t)=>Lr(e,"name",{value:t,configurable:!0});function an(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}Y(an,"useStateMachine");var it=Y(e=>{const{present:t,children:n}=e,r=sn(t),o=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),s=cn(r.ref,un(o));return typeof n=="function"||r.isPresent?a.cloneElement(o,{ref:s}):null},"Presence");function sn(e){const[t,n]=a.useState(),r=a.useRef(null),o=a.useRef(e),s=a.useRef("none"),i=a.useRef(void 0),c=e?"mounted":"unmounted",[u,d]=an(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{u==="mounted"?(s.current=i.current??ce(r.current),i.current=void 0):s.current="none"},[u]),fe(()=>{const f=r.current,l=o.current;if(l!==e){const b=s.current,h=ce(f);e?(i.current=h,d("MOUNT")):h==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(l&&b!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),fe(()=>{if(t){let f;const l=t.ownerDocument.defaultView??window,v=Y(h=>{const g=ce(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&g&&(d("ANIMATION_END"),!o.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",f=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},"handleAnimationEnd"),b=Y(h=>{h.target===t&&(s.current=ce(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",b),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{l.clearTimeout(f),t.removeEventListener("animationstart",b),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:a.useCallback(f=>{if(f){const l=getComputedStyle(f);r.current=l,i.current=ce(l)}else r.current=null;n(f)},[])}}Y(sn,"usePresence");function Ze(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Y(Ze,"setRef");function cn(...e){const t=a.useRef(e);return t.current=e,a.useCallback(n=>{const r=t.current;let o=!1;const s=r.map(i=>{const c=Ze(i,n);return!o&&typeof c=="function"&&(o=!0),c});if(o)return()=>{for(let i=0;iFr(e,"name",{value:t,configurable:!0}),Ce=0,U=null;function jr(e){return ct(),e.children}st(jr,"FocusGuards");function ct(){a.useEffect(()=>{U||(U={start:Je(),end:Je()});const{start:e,end:t}=U;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Ce++,()=>{Ce===1&&(U==null||U.start.remove(),U==null||U.end.remove(),U=null),Ce=Math.max(0,Ce-1)}},[])}st(ct,"useFocusGuards");function Je(){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}st(Je,"createFocusGuard");var B=function(){return B=Object.assign||function(t){for(var n,r=1,o=arguments.length;r"u")return to;var t=no(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},oo=vn(),de="data-scroll-locked",ao=function(e,t,n,r){var o=e.left,s=e.top,i=e.right,c=e.gap;return n===void 0&&(n="margin"),` - .`.concat(Wr,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(c,"px ").concat(r,`; - } - body[`).concat(de,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(o,`px; - padding-top: `).concat(s,`px; - padding-right: `).concat(i,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(c,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(De,` { - right: `).concat(c,"px ").concat(r,`; - } - - .`).concat(ke,` { - margin-right: `).concat(c,"px ").concat(r,`; - } - - .`).concat(De," .").concat(De,` { - right: 0 `).concat(r,`; - } - - .`).concat(ke," .").concat(ke,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat(de,`] { - `).concat(Ur,": ").concat(c,`px; - } -`)},Rt=function(){var e=parseInt(document.body.getAttribute(de)||"0",10);return isFinite(e)?e:0},io=function(){a.useEffect(function(){return document.body.setAttribute(de,(Rt()+1).toString()),function(){var e=Rt()-1;e<=0?document.body.removeAttribute(de):document.body.setAttribute(de,e.toString())}},[])},so=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;io();var s=a.useMemo(function(){return ro(o)},[o]);return a.createElement(oo,{styles:ao(s,!t,o,n?"":"!important")})},Qe=!1;if(typeof window<"u")try{var xe=Object.defineProperty({},"passive",{get:function(){return Qe=!0,!0}});window.addEventListener("test",xe,xe),window.removeEventListener("test",xe,xe)}catch{Qe=!1}var oe=Qe?{passive:!1}:!1,co=function(e){return e.tagName==="TEXTAREA"},mn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!co(e)&&n[t]==="visible")},uo=function(e){return mn(e,"overflowY")},lo=function(e){return mn(e,"overflowX")},Ot=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=pn(e,r);if(o){var s=hn(e,r),i=s[1],c=s[2];if(i>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},fo=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},vo=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},pn=function(e,t){return e==="v"?uo(t):lo(t)},hn=function(e,t){return e==="v"?fo(t):vo(t)},mo=function(e,t){return e==="h"&&t==="rtl"?-1:1},po=function(e,t,n,r,o){var s=mo(e,window.getComputedStyle(t).direction),i=s*r,c=n.target,u=t.contains(c),d=!1,f=i>0,l=0,v=0;do{if(!c)break;var b=hn(e,c),h=b[0],p=b[1],g=b[2],w=p-g-s*h;(h||w)&&pn(e,c)&&(l+=w,v+=h);var S=c.parentNode;c=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(f&&Math.abs(l)<1||!f&&Math.abs(v)<1)&&(d=!0),d},Pe=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Dt=function(e){return[e.deltaX,e.deltaY]},kt=function(e){return e&&"current"in e?e.current:e},ho=function(e,t){return e[0]===t[0]&&e[1]===t[1]},go=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},bo=0,ae=[];function yo(e){var t=a.useRef([]),n=a.useRef([0,0]),r=a.useRef(),o=a.useState(bo++)[0],s=a.useState(vn)[0],i=a.useRef(e);a.useEffect(function(){i.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var p=$r([e.lockRef.current],(e.shards||[]).map(kt),!0).filter(Boolean);return p.forEach(function(g){return g.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),p.forEach(function(g){return g.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=a.useCallback(function(p,g){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!i.current.allowPinchZoom;var w=Pe(p),S=n.current,x="deltaX"in p?p.deltaX:S[0]-w[0],O="deltaY"in p?p.deltaY:S[1]-w[1],R,P=p.target,N=Math.abs(x)>Math.abs(O)?"h":"v";if("touches"in p&&N==="h"&&P.type==="range")return!1;var X=window.getSelection(),z=X&&X.anchorNode,q=z?z===P||z.contains(P):!1;if(q)return!1;var F=Ot(N,P);if(!F)return!0;if(F?R=N:(R=N==="v"?"h":"v",F=Ot(N,P)),!F)return!1;if(!r.current&&"changedTouches"in p&&(x||O)&&(r.current=R),!R)return!0;var I=r.current||R;return po(I,g,p,I==="h"?x:O)},[]),u=a.useCallback(function(p){var g=p;if(!(!ae.length||ae[ae.length-1]!==s)){var w="deltaY"in g?Dt(g):Pe(g),S=t.current.filter(function(R){return R.name===g.type&&(R.target===g.target||g.target===R.shadowParent)&&ho(R.delta,w)})[0];if(S&&S.should){g.cancelable&&g.preventDefault();return}if(!S){var x=(i.current.shards||[]).map(kt).filter(Boolean).filter(function(R){return R.contains(g.target)}),O=x.length>0?c(g,x[0]):!i.current.noIsolation;O&&g.cancelable&&g.preventDefault()}}},[]),d=a.useCallback(function(p,g,w,S){var x={name:p,delta:g,target:w,should:S,shadowParent:Eo(w)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(O){return O!==x})},1)},[]),f=a.useCallback(function(p){n.current=Pe(p),r.current=void 0},[]),l=a.useCallback(function(p){d(p.type,Dt(p),p.target,c(p,e.lockRef.current))},[]),v=a.useCallback(function(p){d(p.type,Pe(p),p.target,c(p,e.lockRef.current))},[]);a.useEffect(function(){return ae.push(s),e.setCallbacks({onScrollCapture:l,onWheelCapture:l,onTouchMoveCapture:v}),document.addEventListener("wheel",u,oe),document.addEventListener("touchmove",u,oe),document.addEventListener("touchstart",f,oe),function(){ae=ae.filter(function(p){return p!==s}),document.removeEventListener("wheel",u,oe),document.removeEventListener("touchmove",u,oe),document.removeEventListener("touchstart",f,oe)}},[]);var b=e.removeScrollBar,h=e.inert;return a.createElement(a.Fragment,null,h?a.createElement(s,{styles:go(o)}):null,b?a.createElement(so,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Eo(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const wo=Gr(fn,yo);var gn=a.forwardRef(function(e,t){return a.createElement(Ne,B({},e,{ref:t,sideCar:wo}))});gn.classNames=Ne.classNames;var So=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ie=new WeakMap,Re=new WeakMap,Oe={},Ue=0,bn=function(e){return e&&(e.host||bn(e.parentNode))},Co=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=bn(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},xo=function(e,t,n,r){var o=Co(t,Array.isArray(e)?e:[e]);Oe[n]||(Oe[n]=new WeakMap);var s=Oe[n],i=[],c=new Set,u=new Set(o),d=function(l){!l||c.has(l)||(c.add(l),d(l.parentNode))};o.forEach(d);var f=function(l){!l||u.has(l)||Array.prototype.forEach.call(l.children,function(v){if(c.has(v))f(v);else try{var b=v.getAttribute(r),h=b!==null&&b!=="false",p=(ie.get(v)||0)+1,g=(s.get(v)||0)+1;ie.set(v,p),s.set(v,g),i.push(v),p===1&&h&&Re.set(v,!0),g===1&&v.setAttribute(n,"true"),h||v.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",v,w)}})};return f(t),c.clear(),Ue++,function(){i.forEach(function(l){var v=ie.get(l)-1,b=s.get(l)-1;ie.set(l,v),s.set(l,b),v||(Re.has(l)||l.removeAttribute(r),Re.delete(l)),b||l.removeAttribute(n)}),Ue--,Ue||(ie=new WeakMap,ie=new WeakMap,Re=new WeakMap,Oe={})}},Po=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=So(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),xo(r,o,n,"aria-hidden")):function(){return null}},Ro=Object.defineProperty,G=(e,t)=>Ro(e,"name",{value:t,configurable:!0}),ut="Dialog",[yn,da]=Ft(ut),[Oo,ne]=yn(ut),Do=G(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:s,modal:i=!0}=e,c=a.useRef(null),u=a.useRef(null),[d,f]=Wt({prop:r,defaultProp:o??!1,onChange:s,caller:ut}),[l,v]=a.useState(0),[b,h]=a.useState(0);return E.jsx(Oo,{scope:t,triggerRef:c,contentRef:u,contentId:V(),titleId:V(),descriptionId:V(),titlePresent:l>0,descriptionPresent:b>0,setTitleCount:v,setDescriptionCount:h,open:d,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(p=>!p),[f]),modal:i,children:n})},"Dialog"),En="DialogPortal",[ko,wn]=yn(En,{forceMount:void 0}),No=G(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,s=ne(En,t);return E.jsx(ko,{scope:t,forceMount:n,children:a.Children.map(r,i=>E.jsx(it,{present:n||s.open,children:E.jsx(Tr,{asChild:!0,container:o,children:i})}))})},"DialogPortal"),et="DialogOverlay",Io=a.forwardRef(G(function(t,n){const r=wn(et,t.__scopeDialog),{forceMount:o=r.forceMount,...s}=t,i=ne(et,t.__scopeDialog);return i.modal?E.jsx(it,{present:o||i.open,children:E.jsx(_o,{...s,ref:n})}):null},"DialogOverlay")),Ao=rt("DialogOverlay.RemoveScroll"),_o=a.forwardRef(G(function(t,n){const{__scopeDialog:r,...o}=t,s=ne(et,r),i=qt(),c=pe(n,i);return E.jsx(gn,{as:Ao,allowPinchZoom:!0,shards:[s.contentRef],children:E.jsx($.div,{"data-state":lt(s.open),...o,ref:c,style:{pointerEvents:"auto",...o.style}})})},"DialogOverlayImpl")),ge="DialogContent",Mo=a.forwardRef(G(function(t,n){const r=wn(ge,t.__scopeDialog),{forceMount:o=r.forceMount,...s}=t,i=ne(ge,t.__scopeDialog);return E.jsx(it,{present:o||i.open,children:i.modal?E.jsx(To,{...s,ref:n}):E.jsx(Lo,{...s,ref:n})})},"DialogContent")),To=a.forwardRef(G(function(t,n){const r=ne(ge,t.__scopeDialog),o=a.useRef(null),s=pe(n,r.contentRef,o);return a.useEffect(()=>{const i=o.current;if(i)return Po(i)},[]),E.jsx(Sn,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Q(t.onCloseAutoFocus,i=>{var c;i.preventDefault(),(c=r.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Q(t.onPointerDownOutside,i=>{const c=i.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0;(c.button===2||u)&&i.preventDefault()}),onFocusOutside:Q(t.onFocusOutside,i=>i.preventDefault())})},"DialogContentModal")),Lo=a.forwardRef(G(function(t,n){const r=ne(ge,t.__scopeDialog),o=a.useRef(!1),s=a.useRef(!1);return E.jsx(Sn,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var c,u;(c=t.onCloseAutoFocus)==null||c.call(t,i),i.defaultPrevented||(o.current||(u=r.triggerRef.current)==null||u.focus(),i.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:i=>{var d,f;(d=t.onInteractOutside)==null||d.call(t,i),i.defaultPrevented||(o.current=!0,i.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=i.target;((f=r.triggerRef.current)==null?void 0:f.contains(c))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&s.current&&i.preventDefault()}})},"DialogContentNonModal")),Sn=a.forwardRef(G(function(t,n){const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:s,onCloseAutoFocus:i,...c}=t,u=ne(ge,r);return ct(),E.jsx(E.Fragment,{children:E.jsx(Ar,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:s,onUnmountAutoFocus:i,children:E.jsx(kr,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionPresent?u.descriptionId:void 0,"aria-labelledby":u.titlePresent?u.titleId:void 0,"data-state":lt(u.open),...c,ref:n,deferPointerDownOutside:!0,onDismiss:()=>u.onOpenChange(!1)})})})},"DialogContentImpl"));function lt(e){return e?"open":"closed"}G(lt,"getState");var he='[cmdk-group=""]',Be='[cmdk-group-items=""]',Fo='[cmdk-group-heading=""]',Cn='[cmdk-item=""]',Nt=`${Cn}:not([aria-disabled="true"])`,tt="cmdk-item-select",ue="data-value",jo=(e,t,n)=>er(e,t,n),xn=a.createContext(void 0),Ee=()=>a.useContext(xn),Pn=a.createContext(void 0),dt=()=>a.useContext(Pn),Rn=a.createContext(void 0),On=a.forwardRef((e,t)=>{let n=le(()=>{var m,C;return{search:"",value:(C=(m=e.value)!=null?m:e.defaultValue)!=null?C:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=le(()=>new Set),o=le(()=>new Map),s=le(()=>new Map),i=le(()=>new Set),c=Dn(e),{label:u,children:d,value:f,onValueChange:l,filter:v,shouldFilter:b,loop:h,disablePointerSelection:p=!1,vimBindings:g=!0,...w}=e,S=V(),x=V(),O=V(),R=a.useRef(null),P=Xo();te(()=>{if(f!==void 0){let m=f.trim();n.current.value=m,N.emit()}},[f]),te(()=>{P(6,re)},[]);let N=a.useMemo(()=>({subscribe:m=>(i.current.add(m),()=>i.current.delete(m)),snapshot:()=>n.current,setState:(m,C,D)=>{var y,k,A,L;if(!Object.is(n.current[m],C)){if(n.current[m]=C,m==="search")I(),q(),P(1,F);else if(m==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let M=document.getElementById(O);M?M.focus():(y=document.getElementById(S))==null||y.focus()}if(P(7,()=>{var M;n.current.selectedItemId=(M=K())==null?void 0:M.id,N.emit()}),D||P(5,re),((k=c.current)==null?void 0:k.value)!==void 0){let M=C??"";(L=(A=c.current).onValueChange)==null||L.call(A,M);return}}N.emit()}},emit:()=>{i.current.forEach(m=>m())}}),[]),X=a.useMemo(()=>({value:(m,C,D)=>{var y;C!==((y=s.current.get(m))==null?void 0:y.value)&&(s.current.set(m,{value:C,keywords:D}),n.current.filtered.items.set(m,z(C,D)),P(2,()=>{q(),N.emit()}))},item:(m,C)=>(r.current.add(m),C&&(o.current.has(C)?o.current.get(C).add(m):o.current.set(C,new Set([m]))),P(3,()=>{I(),q(),n.current.value||F(),N.emit()}),()=>{s.current.delete(m),r.current.delete(m),n.current.filtered.items.delete(m);let D=K();P(4,()=>{I(),(D==null?void 0:D.getAttribute("id"))===m&&F(),N.emit()})}),group:m=>(o.current.has(m)||o.current.set(m,new Set),()=>{s.current.delete(m),o.current.delete(m)}),filter:()=>c.current.shouldFilter,label:u||e["aria-label"],getDisablePointerSelection:()=>c.current.disablePointerSelection,listId:S,inputId:O,labelId:x,listInnerRef:R}),[]);function z(m,C){var D,y;let k=(y=(D=c.current)==null?void 0:D.filter)!=null?y:jo;return m?k(m,n.current.search,C):0}function q(){if(!n.current.search||c.current.shouldFilter===!1)return;let m=n.current.filtered.items,C=[];n.current.filtered.groups.forEach(y=>{let k=o.current.get(y),A=0;k.forEach(L=>{let M=m.get(L);A=Math.max(M,A)}),C.push([y,A])});let D=R.current;J().sort((y,k)=>{var A,L;let M=y.getAttribute("id"),we=k.getAttribute("id");return((A=m.get(we))!=null?A:0)-((L=m.get(M))!=null?L:0)}).forEach(y=>{let k=y.closest(Be);k?k.appendChild(y.parentElement===k?y:y.closest(`${Be} > *`)):D.appendChild(y.parentElement===D?y:y.closest(`${Be} > *`))}),C.sort((y,k)=>k[1]-y[1]).forEach(y=>{var k;let A=(k=R.current)==null?void 0:k.querySelector(`${he}[${ue}="${encodeURIComponent(y[0])}"]`);A==null||A.parentElement.appendChild(A)})}function F(){let m=J().find(D=>D.getAttribute("aria-disabled")!=="true"),C=m==null?void 0:m.getAttribute(ue);N.setState("value",C||void 0)}function I(){var m,C,D,y;if(!n.current.search||c.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let k=0;for(let A of r.current){let L=(C=(m=s.current.get(A))==null?void 0:m.value)!=null?C:"",M=(y=(D=s.current.get(A))==null?void 0:D.keywords)!=null?y:[],we=z(L,M);n.current.filtered.items.set(A,we),we>0&&k++}for(let[A,L]of o.current)for(let M of L)if(n.current.filtered.items.get(M)>0){n.current.filtered.groups.add(A);break}n.current.filtered.count=k}function re(){var m,C,D;let y=K();y&&(((m=y.parentElement)==null?void 0:m.firstChild)===y&&((D=(C=y.closest(he))==null?void 0:C.querySelector(Fo))==null||D.scrollIntoView({block:"nearest"})),y.scrollIntoView({block:"nearest"}))}function K(){var m;return(m=R.current)==null?void 0:m.querySelector(`${Cn}[aria-selected="true"]`)}function J(){var m;return Array.from(((m=R.current)==null?void 0:m.querySelectorAll(Nt))||[])}function Ae(m){let C=J()[m];C&&N.setState("value",C.getAttribute(ue))}function _e(m){var C;let D=K(),y=J(),k=y.findIndex(L=>L===D),A=y[k+m];(C=c.current)!=null&&C.loop&&(A=k+m<0?y[y.length-1]:k+m===y.length?y[0]:y[k+m]),A&&N.setState("value",A.getAttribute(ue))}function ft(m){let C=K(),D=C==null?void 0:C.closest(he),y;for(;D&&!y;)D=m>0?Yo(D,he):Go(D,he),y=D==null?void 0:D.querySelector(Nt);y?N.setState("value",y.getAttribute(ue)):_e(m)}let vt=()=>Ae(J().length-1),mt=m=>{m.preventDefault(),m.metaKey?vt():m.altKey?ft(1):_e(1)},pt=m=>{m.preventDefault(),m.metaKey?Ae(0):m.altKey?ft(-1):_e(-1)};return a.createElement($.div,{ref:t,tabIndex:-1,...w,"cmdk-root":"",onKeyDown:m=>{var C;(C=w.onKeyDown)==null||C.call(w,m);let D=m.nativeEvent.isComposing||m.keyCode===229;if(!(m.defaultPrevented||D))switch(m.key){case"n":case"j":{g&&m.ctrlKey&&mt(m);break}case"ArrowDown":{mt(m);break}case"p":case"k":{g&&m.ctrlKey&&pt(m);break}case"ArrowUp":{pt(m);break}case"Home":{m.preventDefault(),Ae(0);break}case"End":{m.preventDefault(),vt();break}case"Enter":{m.preventDefault();let y=K();if(y){let k=new Event(tt);y.dispatchEvent(k)}}}}},a.createElement("label",{"cmdk-label":"",htmlFor:X.inputId,id:X.labelId,style:Zo},u),Ie(e,m=>a.createElement(Pn.Provider,{value:N},a.createElement(xn.Provider,{value:X},m))))}),$o=a.forwardRef((e,t)=>{var n,r;let o=V(),s=a.useRef(null),i=a.useContext(Rn),c=Ee(),u=Dn(e),d=(r=(n=u.current)==null?void 0:n.forceMount)!=null?r:i==null?void 0:i.forceMount;te(()=>{if(!d)return c.item(o,i==null?void 0:i.id)},[d]);let f=kn(o,s,[e.value,e.children,s],e.keywords),l=dt(),v=Z(P=>P.value&&P.value===f.current),b=Z(P=>d||c.filter()===!1?!0:P.search?P.filtered.items.get(o)>0:!0);a.useEffect(()=>{let P=s.current;if(!(!P||e.disabled))return P.addEventListener(tt,h),()=>P.removeEventListener(tt,h)},[b,e.onSelect,e.disabled]);function h(){var P,N;p(),(N=(P=u.current).onSelect)==null||N.call(P,f.current)}function p(){l.setState("value",f.current,!0)}if(!b)return null;let{disabled:g,value:w,onSelect:S,forceMount:x,keywords:O,...R}=e;return a.createElement($.div,{ref:ee(s,t),...R,id:o,"cmdk-item":"",role:"option","aria-disabled":!!g,"aria-selected":!!v,"data-disabled":!!g,"data-selected":!!v,onPointerMove:g||c.getDisablePointerSelection()?void 0:p,onClick:g?void 0:h},e.children)}),Wo=a.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,i=V(),c=a.useRef(null),u=a.useRef(null),d=V(),f=Ee(),l=Z(b=>o||f.filter()===!1?!0:b.search?b.filtered.groups.has(i):!0);te(()=>f.group(i),[]),kn(i,c,[e.value,e.heading,u]);let v=a.useMemo(()=>({id:i,forceMount:o}),[o]);return a.createElement($.div,{ref:ee(c,t),...s,"cmdk-group":"",role:"presentation",hidden:l?void 0:!0},n&&a.createElement("div",{ref:u,"cmdk-group-heading":"","aria-hidden":!0,id:d},n),Ie(e,b=>a.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?d:void 0},a.createElement(Rn.Provider,{value:v},b))))}),Uo=a.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=a.useRef(null),s=Z(i=>!i.search);return!n&&!s?null:a.createElement($.div,{ref:ee(o,t),...r,"cmdk-separator":"",role:"separator"})}),Bo=a.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,s=dt(),i=Z(d=>d.search),c=Z(d=>d.selectedItemId),u=Ee();return a.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),a.createElement($.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":u.listId,"aria-labelledby":u.labelId,"aria-activedescendant":c,id:u.inputId,type:"text",value:o?e.value:i,onChange:d=>{o||s.setState("search",d.target.value),n==null||n(d.target.value)}})}),Vo=a.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=a.useRef(null),i=a.useRef(null),c=Z(d=>d.selectedItemId),u=Ee();return a.useEffect(()=>{if(i.current&&s.current){let d=i.current,f=s.current,l,v=new ResizeObserver(()=>{l=requestAnimationFrame(()=>{let b=d.offsetHeight;f.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return v.observe(d),()=>{cancelAnimationFrame(l),v.unobserve(d)}}},[]),a.createElement($.div,{ref:ee(s,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":c,"aria-label":r,id:u.listId},Ie(e,d=>a.createElement("div",{ref:ee(i,u.listInnerRef),"cmdk-list-sizer":""},d)))}),zo=a.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:i,...c}=e;return a.createElement(Do,{open:n,onOpenChange:r},a.createElement(No,{container:i},a.createElement(Io,{"cmdk-overlay":"",className:o}),a.createElement(Mo,{"aria-label":e.label,"cmdk-dialog":"",className:s},a.createElement(On,{ref:t,...c}))))}),Ko=a.forwardRef((e,t)=>Z(n=>n.filtered.count===0)?a.createElement($.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Ho=a.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return a.createElement($.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Ie(e,i=>a.createElement("div",{"aria-hidden":!0},i)))}),se=Object.assign(On,{List:Vo,Item:$o,Input:Bo,Group:Wo,Separator:Uo,Dialog:zo,Empty:Ko,Loading:Ho});function Yo(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Go(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Dn(e){let t=a.useRef(e);return te(()=>{t.current=e}),t}var te=typeof window>"u"?a.useEffect:a.useLayoutEffect;function le(e){let t=a.useRef();return t.current===void 0&&(t.current=e()),t}function Z(e){let t=dt(),n=()=>e(t.snapshot());return a.useSyncExternalStore(t.subscribe,n,n)}function kn(e,t,n,r=[]){let o=a.useRef(),s=Ee();return te(()=>{var i;let c=(()=>{var d;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(d=f.current.textContent)==null?void 0:d.trim():o.current}})(),u=r.map(d=>d.trim());s.value(e,c,u),(i=t.current)==null||i.setAttribute(ue,c),o.current=c}),o}var Xo=()=>{let[e,t]=a.useState(),n=le(()=>new Map);return te(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function qo(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Ie({asChild:e,children:t},n){return e&&a.isValidElement(t)?a.cloneElement(qo(t),{ref:t.ref},n(t.props.children)):n(t)}var Zo={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Nn={gehe:"Gehe zu",tun:"Tun",finden:"Finden",lucy:"An Lucy"},Jo=An.map(e=>({id:`gehe:${e.id}`,gruppe:"gehe",label:e.label,hinweis:e.hint,icon:e.icon,ausfuehren:({navigate:t})=>t(e.pfad)})),Qo=[{id:"tun:wartung",gruppe:"tun",label:"System-Wartung öffnen",hinweis:"Dienste, Updates, Snapshot",icon:In,stichworte:"pflege dienste neustart update",ausfuehren:({schublade:e})=>e("wartung")},{id:"tun:logs",gruppe:"tun",label:"System-Logs öffnen",hinweis:"Diagnose je Dienst",icon:Kn,stichworte:"fehler journal diagnose",ausfuehren:({schublade:e})=>e("logs")},{id:"tun:updates",gruppe:"tun",label:"Nach Updates suchen",hinweis:"apt + Engine + Agent prüfen",icon:$n,stichworte:"aktualisieren apt engine",ausfuehren:async({api:e,melden:t})=>{await e("/api/maintenance/check-updates",{method:"POST"}),t("info","Update-Suche läuft — das Ergebnis erscheint in der Wartung.")}},{id:"tun:snapshot",gruppe:"tun",label:"Snapshot anlegen",hinweis:"Sicherung vor riskanten Schritten",icon:Wn,stichworte:"backup sicherung zeitmaschine",ausfuehren:async({api:e,melden:t})=>{await e("/api/system/backup",{method:"POST"}),t("erfolg","Snapshot angestoßen.")}},{id:"tun:engine-neustart",gruppe:"tun",label:"Motor neu starten",hinweis:"llama-swap — alle Modelle fallen kurz weg",icon:Un,stichworte:"engine llama swap modell neu starten",rueckfrage:"Der Motor (llama-swap) wird neu gestartet. Alle geladenen Modelle fallen dabei aus dem Speicher und müssen neu aufwärmen — das dauert je nach Modell über 20 Sekunden. Laufende Antworten brechen ab.",ausfuehren:async({api:e,melden:t})=>{const n=await e("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:"llama-swap"})});t(n.ok?"erfolg":"fehler",n.ok?"Motor neu gestartet.":`Neustart fehlgeschlagen: ${n.err||"Unbekannter Fehler"}`)}}],ea=e=>{const t=e.trim();return t?[{id:"finden:chronik",gruppe:"finden",label:`„${t}“ in der Chronik`,hinweis:"Was die Box getan hat",icon:Bn,ausfuehren:({navigate:n})=>n(`/chronik?q=${encodeURIComponent(t)}`)},{id:"finden:wissen",gruppe:"finden",label:`„${t}“ im Wissens-Vault`,hinweis:"Lucys Notizen",icon:Vn,ausfuehren:({navigate:n})=>n(`/wissen?suche=${encodeURIComponent(t)}`)}]:[]},ta=e=>{const t=e.trim();return t.length<8?[]:[{id:"lucy:idee",gruppe:"lucy",label:`Als Idee erfassen: „${t.length>60?t.slice(0,57)+"…":t}“`,hinweis:"Wird nur notiert — gebaut wird erst auf deinen Klick",icon:_n,ausfuehren:async({api:n,melden:r,navigate:o})=>{await n("/api/ideen",{method:"POST",body:JSON.stringify({titel:t.length>160?t.slice(0,157)+"…":t,notiz:t.length>160?t:"",welt:"ide",tiefe:"",ziel:"",art:"idee"})}),r("erfolg","Als Idee erfasst."),o("/ideen")}}]};function na(e){return[...Jo,...Qo,...ea(e),...ta(e)]}const ra=e=>[e.label,e.hinweis,e.stichworte,Nn[e.gruppe]].filter(Boolean).join(" "),oa=["gehe","tun","finden","lucy"];function fa(){const e=Mn(),t=ht(b=>b.palette),n=ht(b=>b.melden),r=Tn(),[o,s]=a.useState(""),[i,c]=a.useState(null),[u,d]=a.useState(!1),f=a.useCallback(()=>{t(!1),s(""),c(null)},[t]),l=a.useCallback(async b=>{d(!0);try{await b.ausfuehren({text:o,navigate:h=>r({to:h}),schublade:h=>r({to:".",search:p=>({...p,system:h})}),melden:n,api:Ln}),f()}catch(h){n("fehler",h instanceof Error?h.message:String(h)),c(null)}finally{d(!1)}},[o,r,n,f]),v=a.useMemo(()=>na(o),[o]);return E.jsx(se.Dialog,{open:e,onOpenChange:b=>b?t(!0):f(),label:"Befehlspalette",className:"fixed inset-0 z-50 flex items-start justify-center overscroll-contain bg-black/50 p-4 pt-[12vh]",onClick:f,shouldFilter:!i,children:E.jsx("div",{className:"w-full max-w-xl overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-2xl",onClick:b=>b.stopPropagation(),children:i?E.jsxs("div",{className:"space-y-4 p-5",children:[E.jsxs("div",{className:"flex items-center gap-2.5",children:[E.jsx(Fn,{className:"h-5 w-5 shrink-0 text-amber-400","aria-hidden":"true"}),E.jsx("h2",{className:"font-space text-sm font-bold tracking-tight",children:i.label})]}),E.jsx("p",{className:"text-xs leading-relaxed text-muted-foreground",children:i.rueckfrage}),E.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[E.jsx("button",{onClick:()=>c(null),className:"h-9 cursor-pointer rounded-lg border border-border/60 bg-background/20 px-4 text-xs font-semibold text-muted-foreground transition-colors hover:bg-accent",children:"Abbrechen"}),E.jsx("button",{autoFocus:!0,disabled:u,onClick:()=>l(i),className:"h-9 cursor-pointer rounded-lg bg-amber-500/90 px-4 text-xs font-bold text-black transition-colors hover:bg-amber-500 disabled:opacity-50",children:u?"Läuft …":"Ja, ausführen"})]})]}):E.jsxs(E.Fragment,{children:[E.jsx(se.Input,{autoFocus:!0,value:o,onValueChange:s,placeholder:"Springen, tun, finden — oder schreib eine Idee …",className:"w-full border-b border-border bg-transparent px-4 py-3 text-sm outline-none placeholder:text-muted-foreground"}),E.jsxs(se.List,{className:"max-h-[26rem] overflow-y-auto p-2 scrollbar-thin",children:[E.jsx(se.Empty,{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Nichts gefunden."}),oa.map(b=>{const h=v.filter(p=>p.gruppe===b);return h.length?E.jsx(se.Group,{heading:Nn[b],className:"px-1 py-1 text-[10px] font-bold uppercase tracking-widest text-muted-foreground/50",children:h.map(p=>E.jsxs(se.Item,{value:ra(p),onSelect:()=>p.rueckfrage?c(p):l(p),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:[E.jsx(p.icon,{className:jn("h-4 w-4 shrink-0",p.rueckfrage?"text-amber-400":"text-primary"),"aria-hidden":"true"}),E.jsx("span",{className:"truncate",children:p.label}),p.rueckfrage&&E.jsx("span",{className:"shrink-0 rounded bg-amber-500/15 px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wide text-amber-300",children:"fragt nach"}),p.hinweis&&E.jsx("span",{className:"ml-auto truncate pl-3 text-xs text-muted-foreground",children:p.hinweis})]},p.id))},b):null})]}),E.jsxs("div",{className:"flex items-center gap-3 border-t border-border/50 px-4 py-2 font-mono text-[10px] text-muted-foreground",children:[E.jsx("span",{className:"flex items-center gap-1",children:"↑↓ wählen"}),E.jsxs("span",{className:"flex items-center gap-1",children:[E.jsx(zn,{className:"h-3 w-3","aria-hidden":"true"})," ausführen"]}),E.jsx("span",{className:"ml-auto",children:"esc schließt"})]})]})})})}export{fa as CommandPalette}; diff --git a/frontend/dist/assets/ConnectView-CdvOrseN.js b/frontend/dist/assets/ConnectView-CdvOrseN.js deleted file mode 100644 index 965077d..0000000 --- a/frontend/dist/assets/ConnectView-CdvOrseN.js +++ /dev/null @@ -1,16 +0,0 @@ -import{c as f,r as m,D as G,F as H,j as e,t as I,B as M,I as y,G as z,b as S,L as B,J as _,K as E,C as P}from"./index-DMY9lUCb.js";import{A as u}from"./arrow-right-CNrCtUoh.js";import{C as K}from"./chevron-down-1Vx9W9jM.js";/** - * @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 T=f("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const F=f("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 g=f("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"}]]),k={hermes_desktop:"Hermes Desktop: Browser-Login",kilo:"Kilo: Einstellungen → API Provider",claude_code:"env / Übersetzer"};function h({line:t,loading:n}){return n||!t?e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold text-muted-foreground",children:[e.jsx(B,{className:"h-3 w-3 animate-spin"})," prüfe…"]}):t.ok?e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold text-emerald-400",children:[e.jsx(_,{className:"h-3 w-3"})," ",t.detail]}):e.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold text-red-400",children:[e.jsx(E,{className:"h-3 w-3"})," ",t.detail]})}function C({tool:t,fileName:n,accent:o,copied:i,onCopy:c}){return e.jsxs("div",{className:"flex flex-col border border-border/60 bg-black/60 rounded-2xl overflow-hidden shadow-2xl",children:[e.jsxs("div",{className:"flex h-11 items-center justify-between px-4 border-b border-border/40 bg-black/40 shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"h-3 w-3 rounded-full bg-red-500/80"}),e.jsx("span",{className:"h-3 w-3 rounded-full bg-amber-500/80"}),e.jsx("span",{className:"h-3 w-3 rounded-full bg-emerald-500/80"})]}),e.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:e.jsx("span",{children:n})}),e.jsxs("button",{onClick:c,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:[i?e.jsx(P,{className:"h-3.5 w-3.5 text-emerald-400"}):e.jsx(T,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:i?"Kopiert":"Kopieren"})]})]}),e.jsx("pre",{className:S("p-5 overflow-x-auto text-xs font-mono whitespace-pre leading-relaxed scrollbar-thin select-text bg-black/10",o==="teal"?"text-cyan-200/90":"text-violet-200/90"),children:e.jsx("code",{children:t.snippet})})]})}function R(){const t=window.location.hostname;return t&&t!=="localhost"&&t!=="127.0.0.1"?t:"192.168.178.151"}function Z(){const[t,n]=m.useState(localStorage.getItem("mc_host")||R()),[o,i]=m.useState("kilo"),[c,L]=m.useState(!1),[b,j]=m.useState(null),A=new URLSearchParams({host:t}),{data:a,error:N}=G(A.toString()),{data:r,isLoading:p}=H(),v=N?String(N):"";function D(s){n(s),s&&localStorage.setItem("mc_host",s)}const d=a==null?void 0:a.tools.hermes_desktop,l=a==null?void 0:a.tools[o];async function w(s,x){x&&(await navigator.clipboard.writeText(x),j(s),setTimeout(()=>j(null),1500))}return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.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"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx("span",{className:"text-foreground",children:"Hermes Desktop"})," ist die Tür zur Box — einmal verbinden, fertig. Für Spezialfälle gibt es darunter den rohen Gateway-Zugang ( /v1) für sonstige Tools."]})]}),e.jsxs("div",{className:"p-5 mc-card",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-[170px_1fr] items-center",children:[e.jsxs("div",{className:"rounded-2xl border border-border/60 bg-background/40 p-4 text-center",children:[e.jsx(g,{className:"h-7 w-7 mx-auto text-muted-foreground"}),e.jsx("div",{className:"mt-2 text-sm font-semibold text-foreground",children:"Dein lokaler Agent"}),e.jsx("div",{className:"text-[11px] text-muted-foreground",children:"Hermes Desktop · Kilo Code · Claude Code …"})]}),e.jsxs("div",{className:"flex flex-col gap-2.5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(u,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsxs("div",{className:"flex-1 rounded-xl border border-primary/25 bg-primary/5 px-3.5 py-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-primary",children:[e.jsx(I,{className:"h-3.5 w-3.5"})," Leitung 1 — Modell"]}),e.jsx(h,{line:r==null?void 0:r.gateway,loading:p})]}),e.jsx("div",{className:"mt-1 text-[11px] font-mono text-primary/80",children:"Gateway · :9001/v1 · Modelle coder / heavy / vision"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(u,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsxs("div",{className:"flex-1 rounded-xl border border-violet-500/25 bg-violet-500/5 px-3.5 py-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-violet-300",children:[e.jsx(M,{className:"h-3.5 w-3.5"})," Leitung 2 — Gedächtnis"]}),e.jsx(h,{line:r==null?void 0:r.memory,loading:p})]}),e.jsx("div",{className:"mt-1 text-[11px] font-mono text-violet-300/80",children:"Hermes-nativ · im Agenten · nichts einzurichten"})]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(u,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsxs("div",{className:"flex-1 rounded-xl border border-emerald-500/25 bg-emerald-500/5 px-3.5 py-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs font-semibold text-emerald-300",children:[e.jsx(g,{className:"h-3.5 w-3.5"})," Leitung 3 — Desktop-Gateway"]}),e.jsx(h,{line:r==null?void 0:r.desktop_gateway,loading:p})]}),e.jsx("div",{className:"mt-1 text-[11px] font-mono text-emerald-300/80",children:"Desktop-Gateway · :9119 · API-Status"})]})]})]})]}),e.jsxs("p",{className:"mt-3.5 text-[11px] text-muted-foreground leading-relaxed",children:["Der Gateway liefert ",e.jsx("span",{className:"text-foreground",children:"nur das LLM"}),". Das Gedächtnis führt",e.jsx("span",{className:"text-foreground",children:" Hermes selbst"})," (nichts einzurichten — die Kachel zeigt nur, ob es lebt), und das Desktop-Gateway bietet die Agenten-Schnittstelle. IDEs wählen die ",e.jsx("span",{className:"text-foreground",children:"echten Modelle"})," ","(coder · heavy · vision); daneben gibt es die virtuellen Lanes ",e.jsx("span",{className:"text-foreground",children:"chat"})," und"," ",e.jsx("span",{className:"text-foreground",children:"coding"}),", die je Anfrage selbst das passende Modell wählen (Alltags-Chat, simple Tools)."]})]}),e.jsx("div",{className:"p-5 mc-card",children:e.jsxs("div",{className:"space-y-1.5 max-w-md",children:[e.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[e.jsx(F,{className:"h-3.5 w-3.5 text-primary"})," Box LAN IP-Adresse",e.jsx("span",{className:"normal-case font-semibold tracking-normal text-muted-foreground/60",children:"— vorbefüllt aus der Adresse dieser Seite"})]}),e.jsx("input",{value:t,onChange:s=>D(s.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"}),e.jsx("p",{className:"text-[10px] text-muted-foreground/70",children:"Wird in alle Snippets eingebacken. Ändern musst du sie nur, wenn die Box eine neue IP bekommt."})]})}),v&&e.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: ",v]}),a&&e.jsxs("div",{className:"space-y-5",children:[d&&e.jsxs("div",{className:"space-y-3 rounded-2xl border border-border/60 border-t-2 border-t-emerald-500/70 bg-card/30 p-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-space font-bold text-foreground",children:[e.jsx(g,{className:"h-4 w-4 text-emerald-400"}),"Hermes Desktop anbinden",e.jsx("span",{className:"text-[10px] font-medium text-emerald-400/90 normal-case",children:"der Hauptweg"})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"Die Desktop-App dockt remote an die Box an — volle Agent-Oberfläche, Projekte, Review, Gedächtnis inklusive."})]}),d.note&&e.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-emerald-500/5 border border-emerald-500/20 text-[11px] text-muted-foreground leading-relaxed",children:[e.jsx(y,{className:"h-4 w-4 text-emerald-400 shrink-0 mt-0.5"}),e.jsx("span",{children:d.note})]}),e.jsx(C,{tool:d,fileName:k.hermes_desktop,accent:"teal",copied:b==="desktop",onCopy:()=>w("desktop",d.snippet)})]}),e.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/30",children:[e.jsxs("button",{onClick:()=>L(s=>!s),className:"flex w-full items-center gap-2 p-4 text-sm font-space font-bold text-foreground cursor-pointer hover:text-primary transition-colors",children:[c?e.jsx(K,{className:"h-4 w-4"}):e.jsx(z,{className:"h-4 w-4"}),"Sonstige Tools (roher /v1-Zugang)",e.jsx("span",{className:"text-[10px] font-medium text-muted-foreground normal-case",children:"Kilo Code · Claude Code · Eigenbau"})]}),c&&e.jsx("div",{className:"grid gap-5 p-4 pt-0",children:e.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:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-space font-bold text-foreground",children:[e.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"]}),e.jsx("p",{className:"text-[11px] text-muted-foreground mt-0.5",children:"Wähle dein Tool — das Snippet zeigt auf den Gateway."})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(a.tools).filter(([s])=>s!=="hermes_desktop").map(([s,x])=>e.jsx("button",{onClick:()=>i(s),className:S("rounded-lg px-3 py-1.5 text-[11px] font-semibold tracking-wide transition-all cursor-pointer",o===s?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"border border-border/50 text-muted-foreground hover:text-foreground"),children:x.label},s))}),l&&e.jsxs(e.Fragment,{children:[l.note&&e.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:[e.jsx(y,{className:"h-4 w-4 text-primary shrink-0 mt-0.5"}),e.jsx("span",{children:l.note})]}),e.jsx(C,{tool:l,fileName:k[o]||"config.json",accent:"teal",copied:b==="model",onCopy:()=>w("model",l.snippet)})]})]})})]})]})]})}export{Z as ConnectView}; diff --git a/frontend/dist/assets/Dienste-D4Tr6Z-Y.js b/frontend/dist/assets/Dienste-D4Tr6Z-Y.js new file mode 100644 index 0000000..a401661 --- /dev/null +++ b/frontend/dist/assets/Dienste-D4Tr6Z-Y.js @@ -0,0 +1 @@ +import{c as e,f as t,i as n,t as r,u as i}from"./button-Dd8hfusv.js";import{D as a,O as o,P as s,g as c,u as l}from"./index-Dd2BxC7X.js";import{a as u,i as d,n as f,r as p,t as m}from"./sheet-DWG2Q04V.js";var h=t(i(),1),g=e();function _({offen:e,onSchliessen:t}){let i=s(),_=l(),[v,y]=(0,h.useState)(null),[b,x]=(0,h.useState)(null),S=c(v);async function C(e){x(null);try{let t=await a(`/api/maintenance/restart`,{service:e});t.ok?o(`erfolg`,`${e} startet neu.`):o(`fehler`,t.err||`${e} ließ sich nicht neu starten.`),i.invalidateQueries({queryKey:[`dienste`]})}catch(e){o(`fehler`,e.message)}}return(0,g.jsx)(m,{open:e,onOpenChange:e=>!e&&t(),children:(0,g.jsxs)(f,{side:`right`,className:`w-full gap-3 overflow-y-auto border-linie bg-panel sm:max-w-2xl`,children:[(0,g.jsxs)(d,{children:[(0,g.jsx)(u,{className:`schild text-lg`,children:`Dienste und Protokolle`}),(0,g.jsx)(p,{className:`text-text-2`,children:`Welcher Dienst läuft, was er zuletzt geschrieben hat.`})]}),(0,g.jsx)(`ul`,{className:`m-0 flex list-none flex-col px-4 pb-2`,children:(_.data?.services??[]).map(e=>(0,g.jsxs)(`li`,{className:`flex flex-wrap items-center justify-between gap-2 border-t border-linie py-2.5`,children:[(0,g.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,g.jsx)(`span`,{className:n(`size-2.5 shrink-0 rounded-full`,e.ok?`bg-gruen`:`bg-rot`),"aria-hidden":!0}),(0,g.jsxs)(`span`,{className:`min-w-0`,children:[(0,g.jsx)(`span`,{className:`block text-[15px]`,children:e.name}),(0,g.jsxs)(`span`,{className:`ziffern text-xs text-text-3`,children:[e.unit,` · `,e.ok?`läuft`:`antwortet nicht`]})]})]}),(0,g.jsxs)(`span`,{className:`flex gap-2`,children:[(0,g.jsx)(r,{variant:v===e.unit?`info`:`ghost`,size:`sm`,onClick:()=>y(e.unit),children:`Protokoll`}),b===e.unit?(0,g.jsx)(r,{variant:`gefahr`,size:`sm`,onClick:()=>C(e.unit),children:`Wirklich neu starten?`}):(0,g.jsx)(r,{variant:`outline`,size:`sm`,onClick:()=>x(e.unit),children:`Neu starten`})]})]},e.unit))}),v&&(0,g.jsx)(`pre`,{className:`ziffern mx-4 mb-4 max-h-[50vh] overflow-auto rounded-lg border border-linie bg-[#0b0d0f] p-3 text-xs leading-relaxed whitespace-pre-wrap text-text-2`,children:S.isFetching?`Wird gelesen …`:S.data?.text||S.data?.err||`Kein Protokoll.`})]})})}export{_ as Dienste}; \ No newline at end of file diff --git a/frontend/dist/assets/Einstellungen-PGljNxC2.js b/frontend/dist/assets/Einstellungen-PGljNxC2.js new file mode 100644 index 0000000..3b289c2 --- /dev/null +++ b/frontend/dist/assets/Einstellungen-PGljNxC2.js @@ -0,0 +1 @@ +import{c as e,f as t,t as n,u as r}from"./button-Dd8hfusv.js";import{D as i,E as a,M as o,N as s,O as c,P as l}from"./index-Dd2BxC7X.js";import{a as u,i as d,n as f,r as p,t as m}from"./sheet-DWG2Q04V.js";var h=t(r(),1),g=e();function _({offen:e,onSchliessen:t}){let r=l(),_=s({queryKey:[`geheimnisse`],queryFn:()=>a(`/api/maintenance/geheimnisse`),enabled:e}),[v,y]=(0,h.useState)(``);async function b(e){try{await i(`/api/maintenance/geheimnisse`,{schluessel:`hf_token`,wert:e}),c(`erfolg`,e?`Hugging-Face-Zugang gespeichert.`:`Hugging-Face-Zugang gelöscht.`),y(``),r.invalidateQueries({queryKey:[`geheimnisse`]})}catch(e){c(`fehler`,e.message)}}let x=_.data;return(0,g.jsx)(m,{open:e,onOpenChange:e=>!e&&t(),children:(0,g.jsxs)(f,{side:`right`,className:`w-full gap-3 overflow-y-auto border-linie bg-panel sm:max-w-lg`,children:[(0,g.jsxs)(d,{children:[(0,g.jsx)(u,{className:`schild text-lg`,children:`Einstellungen`}),(0,g.jsx)(p,{className:`text-text-2`,children:`Was die Box sich merkt.`})]}),(0,g.jsxs)(`section`,{className:`flex flex-col gap-3 border-t border-linie px-4 pt-4`,children:[(0,g.jsx)(`h3`,{className:`schild text-sm text-text-3`,children:`Hugging-Face-Zugang`}),(0,g.jsxs)(`p`,{className:`text-sm text-text-2`,children:[x?.hf_token_gesetzt?`Ist hinterlegt.`:`Fehlt.`,` Nötig für gesperrte Modelle und schnellere Downloads.`,x?.hf_token_aus_env?` Er kommt aus der Dienst-Einstellung und lässt sich hier nicht löschen.`:``]}),(0,g.jsxs)(`form`,{className:`flex gap-2`,onSubmit:e=>{e.preventDefault(),v.trim()&&b(v.trim())},children:[(0,g.jsx)(`label`,{htmlFor:`hf-token`,className:`sr-only`,children:`Hugging-Face-Zugang`}),(0,g.jsx)(`input`,{id:`hf-token`,type:`password`,autoComplete:`off`,value:v,onChange:e=>y(e.target.value),placeholder:`hf_…`,className:`h-11 min-w-0 flex-1 rounded-lg border border-linie-stark bg-erhaben px-3 text-[15px] outline-none focus:border-cyan`}),(0,g.jsx)(n,{type:`submit`,disabled:!v.trim()||x?.schreibbar===!1,children:`Speichern`})]}),x?.hf_token_gesetzt&&!x.hf_token_aus_env&&(0,g.jsx)(n,{variant:`ghost`,size:`sm`,className:`self-start`,onClick:()=>b(null),children:`Zugang löschen`})]}),(0,g.jsxs)(`section`,{className:`flex flex-col gap-2 border-t border-linie px-4 pt-4`,children:[(0,g.jsx)(`h3`,{className:`schild text-sm text-text-3`,children:`Hinweise`}),(0,g.jsx)(`p`,{className:`text-sm text-text-2`,children:`Dringende Hinweise gehen zusätzlich per Telegram raus, alles andere bleibt hier. Einfache Probleme wie einen abgestürzten Dienst behebt der Wächter selbst und schreibt es in den Verlauf.`})]}),(0,g.jsxs)(`section`,{className:`flex flex-col gap-2 border-t border-linie px-4 pt-4 pb-4`,children:[(0,g.jsx)(`h3`,{className:`schild text-sm text-text-3`,children:`Hermes`}),(0,g.jsxs)(`a`,{href:`/hermes-ui/`,target:`_blank`,rel:`noopener`,className:`flex h-11 items-center gap-2 self-start rounded-lg border border-linie-stark bg-erhaben px-4 text-[15px] hover:border-text-3`,children:[(0,g.jsx)(o,{className:`size-4`,"aria-hidden":!0}),` Hermes-Dashboard öffnen`]}),(0,g.jsx)(`p`,{className:`text-xs text-text-3`,children:`Chat, Sitzungen und Cron-Jobs verwaltet Hermes selbst. Es fragt nach seiner eigenen Anmeldung.`})]})]})})}export{_ as Einstellungen}; \ No newline at end of file diff --git a/frontend/dist/assets/GuideView-CxJU6Qxs.js b/frontend/dist/assets/GuideView-CxJU6Qxs.js deleted file mode 100644 index 666a5ae..0000000 --- a/frontend/dist/assets/GuideView-CxJU6Qxs.js +++ /dev/null @@ -1,36 +0,0 @@ -import{c as u,j as e,r as M,t as C,Y as z,Z as k,_ as y,Q as v,$ as L,a0 as G,W as D,b as f,a1 as T}from"./index-DMY9lUCb.js";import{a as w,L as B,C as P,Z as E}from"./zap-2yha4rs4.js";import{L as I}from"./layers-CcL78b5Q.js";import{S as R}from"./shield-BtE9Fxv6.js";/** - * @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 K=u("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 S=u("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 V=u("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. - * See the LICENSE file in the root directory of this source tree. - */const W=u("LifeBuoy",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]]);/** - * @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 N=u("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** - * @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 H=u("Puzzle",[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]]),i={text:"hsl(var(--foreground))",mut:"hsl(var(--muted-foreground))",border:"hsl(var(--border))",card:"hsl(var(--card) / 0.9)",bg:"hsl(var(--background) / 0.4)",primary:"hsl(var(--primary))",teal:"#2dd4bf",sky:"#38bdf8",violet:"#a78bfa",rose:"#fb7185",amber:"#fbbf24",emerald:"#34d399",indigo:"#818cf8"};function o({x:n,y:r,w:t,h:c,color:h,title:g,sub:d,sub2:x,strong:p}){const b=n+t/2;return e.jsxs("g",{children:[e.jsx("rect",{x:n,y:r,width:t,height:c,rx:12,fill:i.card,stroke:h,strokeOpacity:p?.9:.45,strokeWidth:p?2:1.25}),e.jsx("rect",{x:n,y:r,width:t,height:3,rx:1.5,fill:h,opacity:.8}),e.jsx("text",{x:b,y:r+(d?24:c/2+4),textAnchor:"middle",fill:i.text,fontSize:12.5,fontWeight:700,children:g}),d&&e.jsx("text",{x:b,y:r+40,textAnchor:"middle",fill:i.mut,fontSize:10,children:d}),x&&e.jsx("text",{x:b,y:r+53,textAnchor:"middle",fill:i.mut,fontSize:10,children:x})]})}function j({from:n,to:r,color:t=i.border,dash:c}){const[h,g]=n,[d,x]=r,p=(h+d)/2;return e.jsxs("g",{stroke:t,strokeOpacity:.7,fill:"none",strokeWidth:1.5,strokeDasharray:c?"5 4":void 0,children:[e.jsx("path",{d:`M ${h} ${g} C ${p} ${g}, ${p} ${x}, ${d} ${x}`}),e.jsx("path",{d:`M ${d-6} ${x-4} L ${d} ${x} L ${d-6} ${x+4}`,fill:t,fillOpacity:.7,stroke:"none"})]})}function F(){const n=[{y:34,title:"Diese Oberfläche",sub:"Browser · Cockpit & Klick-Gates",color:i.teal},{y:128,title:"Lucy",sub:"Stimme & Begleiterin am PC",color:i.rose},{y:222,title:"Hermes Desktop",sub:"IDE für Projekte (PC + remote)",color:i.violet},{y:316,title:"Telegram",sub:"unterwegs, gleiche Erinnerung",color:i.sky}];return e.jsxs("svg",{viewBox:"0 0 880 432",role:"img","aria-label":"Landkarte: Du erreichst die Box über vier Türen; in der Box arbeiten Mission Control, der Hermes-Agent, der Modell-Stall, das Gedächtnis und der Wissens-Vault.",style:{width:"100%",height:"auto",fontFamily:"var(--font-sans)"},children:[e.jsx(o,{x:16,y:150,w:120,h:92,color:i.primary,strong:!0,title:"Du",sub:"entscheidest —",sub2:"die Box arbeitet"}),e.jsx(o,{x:16,y:330,w:150,h:68,color:i.emerald,title:"PC-Executor",sub:"baut & startet Lucy",sub2:"nach deiner Annahme"}),n.map(r=>e.jsx(o,{x:196,y:r.y,w:186,h:64,color:r.color,title:r.title,sub:r.sub},r.title)),n.map(r=>e.jsx(j,{from:[136,196],to:[196,r.y+32]},r.title)),e.jsx("rect",{x:420,y:14,width:444,height:404,rx:16,fill:i.bg,stroke:i.border,strokeOpacity:.7}),e.jsx("text",{x:642,y:38,textAnchor:"middle",fill:i.text,fontSize:13,fontWeight:800,letterSpacing:.5,children:"DIE BOX · 192.168.178.151"}),e.jsx(o,{x:444,y:54,w:396,h:62,color:i.teal,title:"Mission Control (:9001)",sub:"Cockpit · Ideen · Chronik · Wissen"}),e.jsx(o,{x:444,y:126,w:396,h:62,color:i.rose,title:"Hermes-Agent",sub:"denkt, nutzt Werkzeuge, betreibt die Werkstatt & Nacht-Crons"}),e.jsx(o,{x:444,y:198,w:396,h:78,color:i.sky,title:"Modell-Stall (llama-swap)",sub:"Hirn · Groß · Coder · Augen · Späher · Kritiker",sub2:"+ Embedding & Sortierer fürs Gedächtnis"}),e.jsx(o,{x:444,y:286,w:190,h:56,color:i.indigo,title:"Natives Gedächtnis",sub:"Hermes v0.20 SQLite & Embed"}),e.jsx(o,{x:650,y:286,w:190,h:56,color:i.amber,title:"Wissens-Vault",sub:"Träume & Notizen (git)"}),e.jsx(o,{x:444,y:352,w:396,h:52,color:i.emerald,title:"Selbstheilung & Backups",sub:"Health-Checks · Auto-Revert bei Rot · PBS-Sicherung"}),n.map(r=>e.jsx(j,{from:[382,r.y+32],to:[420,r.y+46]},r.title)),e.jsx(j,{from:[420,396],to:[166,364],color:i.emerald,dash:!0}),e.jsx("text",{x:272,y:412,textAnchor:"middle",fill:i.mut,fontSize:9.5,fontStyle:"italic",children:"Lucy-Karte angenommen → PC baut neu"})]})}function O(){const n=[{x:14,color:i.amber,title:"Idee",sub:"von dir oder vom",sub2:"Nacht-Radar"},{x:158,color:i.violet,title:"Ideen-Queue",sub:"Kanban sammelt,",sub2:"Specifier plant"},{x:302,color:i.rose,title:"IDE am PC",sub:"Agent baut den",sub2:"Branch (Gitea)"},{x:446,color:i.sky,title:"Ampel",sub:"CI prüft Build",sub2:"und Tests"},{x:590,color:i.primary,title:"DEIN Merge",sub:"nur du bringst",sub2:"es auf main",strong:!0},{x:734,color:i.emerald,title:"Live",sub:"deploy.sh,",sub2:"Zeitmaschine = Rückweg"}];return e.jsxs("svg",{viewBox:"0 0 880 246",role:"img","aria-label":"Kreislauf: Idee, Ideen-Queue, IDE am PC, Ampel, dein Merge, live — Chronik und Morgenlage berichten zurück.",style:{width:"100%",height:"auto",fontFamily:"var(--font-sans)"},children:[n.map(r=>e.jsx(o,{x:r.x,y:38,w:132,h:66,color:r.color,title:r.title,sub:r.sub,sub2:r.sub2,strong:r.strong},r.title)),n.slice(0,-1).map((r,t)=>e.jsx(j,{from:[r.x+132,71],to:[n[t+1].x,71]},r.title)),e.jsxs("g",{stroke:i.border,strokeOpacity:.7,fill:"none",strokeWidth:1.5,strokeDasharray:"5 4",children:[e.jsx("path",{d:"M 800 104 C 800 150, 720 150, 440 150 C 160 150, 80 150, 80 112"}),e.jsx("path",{d:"M 76 118 L 80 108 L 84 118",fill:i.border,fillOpacity:.7,stroke:"none"})]}),e.jsx("text",{x:440,y:144,textAnchor:"middle",fill:i.mut,fontSize:10,fontStyle:"italic",children:"Chronik & Morgenlage berichten · Ablehnungs-Gründe werden Lern-Futter"}),e.jsx("rect",{x:14,y:176,width:852,height:54,rx:12,fill:i.bg,stroke:i.border,strokeOpacity:.5}),e.jsx("text",{x:440,y:198,textAnchor:"middle",fill:i.text,fontSize:11,fontWeight:700,children:"Nachts, ganz allein:"}),e.jsx("text",{x:440,y:216,textAnchor:"middle",fill:i.mut,fontSize:10,children:"03:15 Traum · 03:35 Selbst-Inventur · 03:45 Idle-Radar · 04:00 Karten-Gutachter · 04:10 Bagatellen · 04:30 Morgenlage · Mo 05:15 Release-Radar"})]})}function U(){return e.jsxs("div",{className:"space-y-5",children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsx("div",{className:"min-w-[680px]",children:e.jsx(F,{})})}),e.jsx("div",{className:"border-t border-border/20 pt-4 overflow-x-auto",children:e.jsx("div",{className:"min-w-[680px]",children:e.jsx(O,{})})})]})}const A=[{id:"system",label:"Dein System"},{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 Q(n){var r;(r=document.getElementById(n))==null||r.scrollIntoView({behavior:"smooth",block:"start"})}function a({id:n,icon:r,color:t,title:c,kicker:h,children:g,wide:d}){return e.jsxs("section",{id:n,className:f("scroll-mt-20 mc-card p-6 space-y-3",d&&"md:col-span-2"),children:[e.jsxs("div",{className:"flex items-center gap-2.5 border-b border-border/20 pb-3",children:[e.jsx(r,{className:f("h-5 w-5 shrink-0",t)}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:c}),h&&e.jsx("span",{className:f("text-[9px] font-mono",t),children:h})]})]}),e.jsx("div",{className:"text-xs text-muted-foreground space-y-2.5 leading-relaxed",children:g})]})}function m({children:n}){return e.jsxs("div",{className:"mt-1 rounded-xl border border-primary/25 bg-primary/[0.06] p-3 text-[11px] leading-relaxed",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-primary mb-1",children:[e.jsx(T,{className:"h-3 w-3"})," Bei dir konkret"]}),e.jsx("div",{className:"text-muted-foreground space-y-1",children:n})]})}function s({children:n}){return e.jsx("code",{className:"rounded bg-background/40 border border-border/30 px-1.5 py-0.5 font-mono text-[10px] text-foreground",children:n})}function l({href:n,name:r,note:t}){return e.jsxs("li",{className:"leading-relaxed",children:[e.jsxs("a",{href:n,target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold inline-flex items-center gap-0.5",children:[r,e.jsx(K,{className:"h-3 w-3 opacity-60"})]}),e.jsxs("span",{className:"text-muted-foreground",children:[" — ",t]})]})}function J(){const[n,r]=M.useState(!1);return e.jsxs("div",{className:"space-y-7",children:[e.jsxs("div",{className:"mc-card p-6 flex items-start gap-4",children:[e.jsx("div",{className:"h-11 w-11 rounded-xl bg-primary/15 flex items-center justify-center shrink-0",children:e.jsx(S,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{className:"space-y-1",children:[e.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"}),e.jsxs("p",{className:"text-sm text-muted-foreground leading-relaxed max-w-2xl",children:["Erst ",e.jsx("span",{className:"font-semibold text-foreground",children:"dein System auf einen Blick"}),", dann das allgemeine Nachschlagewerk für lokale & agentische AI — Konzepte, Tricks, Kniffe und kuratierte Quellen. ",e.jsx("span",{className:"font-semibold text-foreground",children:"Stand Juli 2026."})," ",e.jsx("span",{className:"text-primary font-semibold",children:'„Bei dir konkret"'}),"-Kästen zeigen, was dein Stack daraus macht."]})]})]}),e.jsx("div",{className:"sticky top-0 z-10 -mx-1 px-1",children:e.jsx("div",{className:"rounded-xl border border-border/50 bg-card/70 backdrop-blur-xl p-2 shadow-lg shadow-black/20",children:e.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[e.jsx(w,{className:"h-3.5 w-3.5 text-primary ml-1 mr-0.5 shrink-0"}),(n?A:A.slice(0,9)).map(t=>e.jsx("button",{onClick:()=>Q(t.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:t.label},t.id)),e.jsx("button",{onClick:()=>r(t=>!t),className:"rounded-lg px-2 py-1 text-[11px] font-semibold text-primary hover:bg-primary/10 transition-colors cursor-pointer",children:n?"weniger":"+ mehr"})]})})}),e.jsxs("section",{id:"system",className:"scroll-mt-20 mc-card p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2.5 border-b border-border/20 pb-3",children:[e.jsx(N,{className:"h-5 w-5 text-primary"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"So funktioniert dein System"}),e.jsx("span",{className:"text-[9px] font-mono text-primary",children:"Landkarte & Kreislauf — das große Bild"})]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed max-w-3xl",children:["Vier Türen führen zur selben Box: ",e.jsx("strong",{className:"text-foreground",children:"diese Oberfläche"})," zum Steuern und Abnicken, ",e.jsx("strong",{className:"text-foreground",children:"Lucy"})," für Zurufe per Stimme,",e.jsx("strong",{className:"text-foreground",children:" Hermes Desktop"})," für richtige Projekte und",e.jsx("strong",{className:"text-foreground",children:" Telegram"})," für unterwegs. In der Box denken die Modelle, das Gedächtnis lernt automatisch mit — und nachts arbeitet sie allein: Sie träumt, inventarisiert sich selbst, entwickelt Ideen zu Konzepten. Gebaut wird am PC in der IDE, jede Änderung geht als Branch nach Gitea.",e.jsx("strong",{className:"text-primary",children:" Nichts geht live ohne deinen Merge"})," — die Ampel-CI muss grün sein, danach spielt ",e.jsx("code",{children:"deploy.sh"})," den Stand ein."]}),e.jsx(U,{})]}),e.jsxs("div",{className:"grid gap-5 md:grid-cols-2",children:[e.jsxs(a,{id:"grundlagen",icon:C,color:"text-cyan-400",title:"1. Wie LLMs ticken",kicker:"Grundlagen",children:[e.jsxs("p",{children:["Ein LLM ist im Kern ein ",e.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.']}),e.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Tokens"})," sind die Einheit — ~¾ Wort. Ein- und Ausgabe werden in Tokens gezählt."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Kontextfenster"}),' = wie viele Tokens das Modell gleichzeitig „sehen" kann (Prompt + Antwort). Voll = Anfang fällt raus.']}),e.jsxs("li",{children:[e.jsx("strong",{children:"Parameter"})," = die trainierten Gewichte. Training ist einmalig, ",e.jsx("strong",{children:"Inferenz"})," ist jede Antwort."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Temperatur / Sampling"})," steuert Zufall: niedrig = deterministisch/präzise (Code), hoch = kreativ."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Halluzination"})," ist kein Bug, sondern die Kehrseite des Ratens. Gegenmittel: Grounding via Tools/RAG, Verifikation."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Reasoning-/Thinking-Modelle"}),' „denken" in unsichtbaren Tokens vor der Antwort — besser bei Logik, langsamer/teurer.']})]})]}),e.jsxs(a,{id:"moe",icon:I,color:"text-violet-400",title:"2. MoE & Quantisierung",kicker:"Mehr Modell, weniger Last",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Mixture of Experts (MoE):"})," Statt für jedes Token das ganze Netz zu aktivieren, wählt ein",e.jsx("em",{children:" Router"})," nur ein paar spezialisierte ",e.jsx("em",{children:"Experts"}),' aus. So läuft ein 100B-Modell mit der aktiven Rechenlast eines viel kleineren (z.B. „122B total / 10B aktiv").']}),e.jsxs("p",{children:[e.jsx("strong",{children:"Quantisierung:"})," Gewichte von FP16 auf weniger Bits eindampfen — kleiner & schneller bei minimalem Qualitätsverlust. Faustregel:"]}),e.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[e.jsxs("li",{children:[e.jsx(s,{children:"Q8"})," nahezu verlustfrei, größter Footprint"]}),e.jsxs("li",{children:[e.jsx(s,{children:"Q6_K"})," sehr gut, guter Mittelweg"]}),e.jsxs("li",{children:[e.jsx(s,{children:"Q4_K_M"})," der Sweet-Spot für lokal — viel Modell pro GB"]})]}),e.jsxs(m,{children:["VRAM/RAM ist die harte Grenze — ",e.jsx("strong",{children:"darum"})," ist beides hier zentral: MoE lässt 100B+ überhaupt laufen, Quant entscheidet, was reinpasst. Dein Line-up fährt durchweg ",e.jsx(s,{children:"Q4_K_M"}),"/",e.jsx(s,{children:"Q6_K"}),"."]})]}),e.jsxs(a,{id:"lokal",icon:z,color:"text-emerald-400",title:"3. Lokal betreiben: Engines & Backends",kicker:"llama.cpp, vLLM & Co.",wide:!0,children:[e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Inference-Engines"})," — was die Modelle ausführt:"]}),e.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"llama.cpp / GGUF"})," — der De-facto-Standard für lokal, CPU+GPU, läuft überall."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Ollama / LM Studio"})," — bequeme Wrapper mit One-Click-Downloads (LM Studio mit GUI)."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"vLLM / TGI"})," — Server-Engines für maximalen Durchsatz auf dicken GPUs."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"llama-swap"})," — Proxy, der ",e.jsx("em",{children:"mehrere"})," Modelle hinter ",e.jsx("em",{children:"einem"})," Port hält und je nach Anfrage automatisch ein-/aussattelt."]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"GPU-Backends"})," — wie gerechnet wird:"]}),e.jsx("ul",{className:"list-disc pl-4 space-y-1",children:e.jsxs("li",{children:[e.jsx(s,{children:"CUDA"})," NVIDIA · ",e.jsx(s,{children:"ROCm"})," AMD · ",e.jsx(s,{children:"Vulkan"})," herstellerübergreifend · ",e.jsx(s,{children:"Metal"})," Apple"]})}),e.jsxs("p",{className:"pt-1",children:[e.jsx("strong",{children:"Begriffe, die immer wiederkommen:"})," Kontext (",e.jsx(s,{children:"-c"}),"), Slots/Parallel, KV-Cache, Modell-TTL/Swap, ",e.jsx("strong",{children:"Speculative Decoding"})," (kleines Draft-Modell rät voraus → schneller)."]})]})]}),e.jsxs(m,{children:["Deine Box hat eine AMD-APU (gfx1151). ",e.jsx("strong",{children:"Einschränkung & Trick:"})," dort schlägt ",e.jsx(s,{children:"Vulkan/RADV"})," das offizielle ",e.jsx(s,{children:"ROCm"})," bei Token-Generierung um ~12–22 % — darum läuft die Engine auf Vulkan.",e.jsx(s,{children:"llama-swap"})," hält die Alltags-Hirne dauerwarm; ",e.jsx(s,{children:"coder"})," nutzt Spec-Decoding."]})]}),e.jsxs(a,{id:"modelle",icon:k,color:"text-sky-400",title:"4. Modell-Landschaft",kicker:"Stand Juni 2026",wide:!0,children:[e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{children:e.jsx("strong",{children:"Open-Weight (lokal nutzbar):"})}),e.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Qwen"})," (Alibaba) — starke Allrounder + Coder + Vision, viele Größen/MoE."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Llama"})," (Meta), ",e.jsx("strong",{children:"Gemma"})," (Google), ",e.jsx("strong",{children:"Phi"})," (Microsoft) — solide Open-Familien."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"DeepSeek"}),", ",e.jsx("strong",{children:"Mistral/Mixtral"})," — kräftige MoE-/Reasoning-Modelle."]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{children:e.jsx("strong",{children:"Frontier (Cloud-API):"})}),e.jsx("ul",{className:"list-disc pl-4 space-y-1",children:e.jsxs("li",{children:[e.jsx("strong",{children:"Claude"})," (Anthropic), ",e.jsx("strong",{children:"GPT"})," (OpenAI), ",e.jsx("strong",{children:"Gemini"})," (Google) — die stärksten Allrounder, aber nicht lokal."]})}),e.jsxs("p",{className:"pt-1",children:[e.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."]})]})]}),e.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".'}),e.jsxs(m,{children:["Dein Line-up via llama-swap (Klartext-Rollen): ",e.jsx(s,{children:"Hirn"})," (Agent, dauerwarm) · ",e.jsx(s,{children:"Groß"})," (schwere Logik) · ",e.jsx(s,{children:"Coder"})," · ",e.jsx(s,{children:"Augen"})," (Bilder) · ",e.jsx(s,{children:"Späher"})," (schnelle Recherche) ·",e.jsx(s,{children:"Kritiker"})," (Fremdblick/Review) · ",e.jsx(s,{children:"Gedächtnis"})," + ",e.jsx(s,{children:"Sortierer"})," (Embedding & Reranking). Verwalten/tauschen im ",e.jsx("strong",{children:"Modelle"}),"-Tab."]})]}),e.jsxs(a,{id:"gateway",icon:N,color:"text-amber-400",title:"5. Der Gateway-Trick",kicker:"OpenAI-kompatibel = überall andocken",children:[e.jsxs("p",{children:["Fast jedes AI-Tool spricht heute das ",e.jsx("strong",{children:"OpenAI-Format"})," (",e.jsx(s,{children:"/v1/chat/completions"}),"). Ein",e.jsx("strong",{children:" Gateway"})," davor gibt dir ",e.jsx("em",{children:"einen"})," Endpunkt für alles: zentrales Key-Management, Logging und transparentes ",e.jsx("strong",{children:"Routing"})," — der Client merkt nicht, welches Modell tatsächlich antwortet."]}),e.jsxs("p",{children:["Die Lane-Idee: du wählst ",e.jsx(s,{children:"chat"})," (Alltag, ",e.jsx(s,{children:"auto"})," geht als Alias weiter) oder"," ",e.jsx(s,{children:"coding"})," (agentisch), das Gateway pickt das passende echte Modell und lädt es bei Bedarf."]}),e.jsxs(m,{children:["Dein Gateway: ",e.jsx(s,{children:"http://192.168.178.151:9001/v1"}),", Model ",e.jsx(s,{children:"chat"})," oder ",e.jsx(s,{children:"coding"}),", API-Key beliebig. Fertige Configs erzeugt dir der ",e.jsx("strong",{children:"Verbinden"}),"-Tab live — eine Wahrheit, kein Abtippen."]})]}),e.jsxs(a,{id:"mcp",icon:y,color:"text-violet-400",title:"6. MCP — Werkzeuge für Agenten",kicker:"USB-C für AI-Tools",children:[e.jsxs("p",{children:["Das ",e.jsx("strong",{children:"Model Context Protocol"})," (offen, von Anthropic initiiert) standardisiert, wie ein AI-Client mit externen Tools & Datenquellen spricht. Ein ",e.jsx("strong",{children:"MCP-Server"})," bringt Fähigkeiten: Dateien, Web-Fetch, Git, Datenbanken, eigene APIs."]}),e.jsx("p",{children:"Statt für jeden Editor eigene Tools zu schreiben, bindet jeder MCP-fähige Agent denselben Server an."}),e.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:[e.jsx(B,{className:"h-3.5 w-3.5 text-amber-400 shrink-0 mt-0.5"}),e.jsxs("span",{children:[e.jsx("strong",{children:"Sicherheit:"})," ein MCP-Server hat echten Zugriff (Dateien, Shell). Nur vertrauenswürdige Server laufen lassen, Rechte minimal halten, Quelle prüfen."]})]})]}),e.jsxs(a,{id:"skills",icon:H,color:"text-emerald-400",title:"7. Agent Skills",kicker:"Wiederverwendbare Fähigkeiten",children:[e.jsxs("p",{children:["Ein ",e.jsx("strong",{children:"Skill"})," ist ein Ordner mit einer ",e.jsx(s,{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."]}),e.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 -...`}),e.jsxs("p",{children:["Suchen & installieren über die ",e.jsx("strong",{children:"skills.sh"}),"-Registry: ",e.jsx(s,{children:"npx skills find"})," /",e.jsx(s,{children:"npx skills add owner/repo"}),". Skills liegen projektweit (vom Agent beim Start gelesen) oder global."]})]}),e.jsxs(a,{id:"memory",icon:V,color:"text-indigo-400",title:"8. Gedächtnis & RAG",kicker:"Modelle vergessen — du nicht",wide:!0,children:[e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{children:["LLMs sind ",e.jsx("strong",{children:"zustandslos"}),": ohne Hilfe weiß das Modell beim nächsten Turn nichts mehr. Gedächtnis lebt extern."]}),e.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Embeddings"})," wandeln Text in Vektoren; ein ",e.jsx("strong",{children:"Vektor-Store"})," (Chroma, …) findet semantisch Ähnliches."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"RAG"})," = relevante Fakten vor dem Turn heraussuchen und einblenden statt alles im Prompt zu halten."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Long-Context vs. RAG:"}),' riesige Fenster sind bequem, aber teuer & „lost in the middle" — gezieltes Abrufen skaliert besser.']})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{children:[e.jsx("strong",{children:"Auto-lernendes Gedächtnis"})," ist die nächste Stufe:"]}),e.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[e.jsxs("li",{children:["extrahiert Fakten ",e.jsx("em",{children:"selbst"})," aus Gesprächen, statt nur abzuspeichern"]}),e.jsx("li",{children:"dedupliziert semantisch (kein 10× derselbe Fakt)"}),e.jsxs("li",{children:[e.jsx("strong",{children:"Graph-Sicht"})," = Fakten ",e.jsx("em",{children:"plus"})," ihre Beziehungen, nicht nur eine flache Liste"]})]})]})]}),e.jsxs(m,{children:["Dein Gedächtnis führt ",e.jsx("strong",{children:"Hermes"})," selbst — auto-lernend und semantisch. Der Agent lernt im Hintergrund nach jedem Turn, egal ob du per Desktop, Konsole, Telegram oder Lucy mit ihm sprichst.",e.jsx("br",{}),"Deshalb hat das Steuerpult ",e.jsx("strong",{children:"keinen eigenen Gedächtnis-Tab"}),": bis August 2026 lag das Gedächtnis in einem MC2-Sidecar, seit dessen Ablösung ist Hermes die einzige Quelle — angesehen und gepflegt wird es dort, nicht hier. Unter ",e.jsx("strong",{children:"Wissen"})," findest du weiterhin die Graph-Sicht auf Lucys Wissens-Vault.",e.jsx("br",{}),e.jsx("strong",{children:"Gotcha:"})," ein gelöschter Fakt kann wieder auftauchen, solange die Original-Nachricht noch im Verlauf steht (additive Extraktion)."]})]}),e.jsxs(a,{id:"agents",icon:v,color:"text-rose-400",title:"9. Autonome Agenten betreiben",kicker:"LLM in der Schleife",wide:!0,children:[e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{children:["Ein ",e.jsx("strong",{children:"Agent"})," ist ein LLM in einer Schleife mit Tools:",e.jsx("em",{children:" denken → Tool aufrufen → Ergebnis beobachten → weiter"}),", bis das Ziel erreicht ist."]}),e.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Guardrails"})," (Hard-Stop, Tool-Limits) verhindern Endlos-Loops, wenn ein Tool fehlt oder hängt."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Kontext-Hygiene"})," ist die wichtigste Disziplin: frische Sessions starten — vollgemüllte Historien werden langsam, driften und halluzinieren."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Kanäle:"})," CLI/Terminal, Chat-UI, Messaging (z.B. Telegram), reine API."]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{children:[e.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."]}),e.jsxs("p",{children:[e.jsx("strong",{children:"Was sich vollautomatisch lohnt:"})," Modell-Routing, Hintergrund-Gedächtnis, Recherche. ",e.jsx("strong",{children:"Was Freigabe braucht:"})," Systembefehle, Updates/Reboots, permanentes Löschen."]})]})]}),e.jsxs(m,{children:[e.jsx("strong",{children:"Hermes"})," ist dein Box-Agent mit eigenem Agent-Hirn (Rolle ",e.jsx(s,{children:"Hirn"}),", dauerwarm). Reden tust du mit ihm über ",e.jsx("strong",{children:"Hermes Desktop"})," (am PC, remote via ",e.jsx(s,{children:"/hermes-ui"}),"), die ",e.jsx("strong",{children:"Konsole"})," (Box-Shell im Browser), ",e.jsx("strong",{children:"Telegram"})," — oder per Stimme über",e.jsx("strong",{children:" Lucy"}),". Er hat MCP-Server für Gedächtnis, Stack-Steuerung, Web-Fetch und",e.jsx("strong",{children:" PC-Steuerung"})," (Executor auf deinem Windows-PC). Nachts betreibt er Radar-Crons und meldet Funde in Chronik, Briefkasten und Telegram. Status & Verdrahtung im ",e.jsx("strong",{children:"Hermes"}),"-Tab."]})]}),e.jsxs(a,{id:"ide",icon:P,color:"text-cyan-400",title:"10. IDE / Editor anbinden",kicker:"Vibe-Coding lokal",children:[e.jsxs("p",{children:["Jede ",e.jsx("strong",{children:"OpenAI-kompatible"})," IDE oder Extension lässt sich auf einen lokalen Server umbiegen — Base-URL + Model eintragen, fertig:"]}),e.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Cline"})," & ",e.jsx("strong",{children:"Roo Code"})," (VS-Code-Extensions, voller Agent + MCP)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Cursor"})," (VS-Code-Fork mit Top-Autocomplete)"]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Continue"}),", ",e.jsx("strong",{children:"aider"})," (CLI), ",e.jsx("strong",{children:"OpenCode"})," (Desktop)"]})]}),e.jsxs(m,{children:["Deine Haupt-IDE ist inzwischen ",e.jsx("strong",{children:"Hermes Desktop"})," — sie ist ab Werk mit Box, Gedächtnis und Skills verdrahtet, da ist nichts zu konfigurieren. Für alles andere gilt: Tipp den Kram nicht ab — der",e.jsx("strong",{children:" Verbinden"}),"-Tab generiert die fertige Config (inkl. MCP-Gedächtnis) pro Tool zum Kopieren. Essenz: Base ",e.jsx(s,{children:"…:9001/v1"}),", Model ",e.jsx(s,{children:"coder"})," (bauen) / ",e.jsx(s,{children:"heavy"})," (denken) /"," ",e.jsx(s,{children:"vision"})," (Bilder); für simple Chat-Tools tut es die Lane ",e.jsx(s,{children:"chat"}),". Key beliebig."]})]}),e.jsx(a,{id:"tricks",icon:L,color:"text-amber-400",title:"11. Tricks & Kniffe",kicker:"Was im Alltag wirklich spart",wide:!0,children:e.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(([t,c])=>e.jsxs("div",{className:"space-y-1 p-3 bg-background/10 rounded-xl border border-border/30",children:[e.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-foreground text-[11px]",children:[e.jsx(E,{className:"h-3 w-3 text-amber-400"})," ",t]}),e.jsx("p",{className:"text-[11px]",children:c})]},t))})}),e.jsx(a,{id:"wartung",icon:R,color:"text-emerald-400",title:"12. Sicherheit & Wartung",kicker:"Damit's auch morgen noch läuft",wide:!0,children:e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{className:"flex items-center gap-1.5 font-bold text-foreground",children:[e.jsx(G,{className:"h-3.5 w-3.5 text-emerald-400"})," Goldene Regeln"]}),e.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Ein ungetesteter Restore ist kein Backup."})," Wiederherstellung mindestens einmal echt durchspielen."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Updates können Dinge still zerschießen"})," — gerade bei AI-Stacks (Embeddings, Provider-Interna). Versionen pinnen, Smoke-Test, Post-Check."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Least Privilege"})," für Agenten, MCP-Server und PC-Zugriff. Kritisches hinter Freigabe."]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{className:"flex items-center gap-1.5 font-bold text-foreground",children:[e.jsx(D,{className:"h-3.5 w-3.5 text-emerald-400"})," Bei dir im SystemDrawer"]}),e.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Backup:"})," PBS-Backup-Zentrum (Sicherung auf den Proxmox-Server) + tägliche Tarball-Sicherung; Restore echt durchgespielt (",e.jsx(s,{children:"restore.sh"}),", Doku in ",e.jsx(s,{children:"docs/BACKUP.md"}),")."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Updates:"})," git-basierter Update-Check; ",e.jsx("strong",{children:"Update-Buttons"})," mit anschließendem ",e.jsx("strong",{children:"Gehirn-Check"})," (rot, falls ein Update das Gedächtnis zerschießt)."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Deploy-Sicherheit:"})," ",e.jsx("code",{children:"deploy.sh"})," sichert vorher und prüft danach die Gesundheit; die Zeitmaschine in der Chronik ist der Rückweg."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Dienste & Gefahrenzone:"})," Restart/Logs pro Dienst, kritische Eingriffe getrennt."]})]}),e.jsx("p",{className:"text-[10px] italic",children:'Erreichbar über das System-Icon → Tab „Wartung".'})]})]})}),e.jsxs("section",{id:"ressourcen",className:"scroll-mt-20 md:col-span-2 mc-card p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2.5 border-b border-border/20 pb-3",children:[e.jsx(w,{className:"h-5 w-5 text-primary"}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"13. Kuratierte Ressourcen & Links"}),e.jsx("span",{className:"text-[9px] font-mono text-primary",children:"Sauber geordnet — die guten Quellen"})]})]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-5 text-xs",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[e.jsx(k,{className:"h-3.5 w-3.5 text-sky-400"})," Modelle & Engines"]}),e.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[e.jsx(l,{href:"https://huggingface.co/models",name:"Hugging Face",note:"das Repository für offene Modelle (GGUF, Embeddings, Datasets)."}),e.jsx(l,{href:"https://github.com/ggml-org/llama.cpp",name:"llama.cpp",note:"die Referenz-Engine für lokale Inferenz."}),e.jsx(l,{href:"https://github.com/mostlygeek/llama-swap",name:"llama-swap",note:"mehrere Modelle hinter einem Port, Auto-Swap."}),e.jsx(l,{href:"https://ollama.com",name:"Ollama",note:"einfachster Einstieg, One-Command-Modelle."}),e.jsx(l,{href:"https://lmstudio.ai",name:"LM Studio",note:"lokale GUI zum Stöbern, Laden & Chatten."}),e.jsx(l,{href:"https://github.com/vllm-project/vllm",name:"vLLM",note:"Hochdurchsatz-Serving auf dicken GPUs."})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[e.jsx(y,{className:"h-3.5 w-3.5 text-violet-400"})," MCP & Skills"]}),e.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[e.jsx(l,{href:"https://modelcontextprotocol.io",name:"MCP — offizielle Doku",note:"Spezifikation & Einstieg."}),e.jsx(l,{href:"https://github.com/modelcontextprotocol/servers",name:"Offizielle MCP-Server",note:"filesystem, git, postgres, fetch & mehr."}),e.jsx(l,{href:"https://smithery.ai",name:"Smithery",note:"Registry zum Suchen & Auto-Installieren von MCP-Servern."}),e.jsx(l,{href:"https://glama.ai/mcp/servers",name:"Glama MCP Registry",note:"kuratierte Community-Datenbank."}),e.jsx(l,{href:"https://skills.sh",name:"skills.sh",note:"Registry & CLI für Agent-Skills."})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[e.jsx(v,{className:"h-3.5 w-3.5 text-rose-400"})," Agenten & Frameworks"]}),e.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[e.jsx(l,{href:"https://github.com/NousResearch/hermes-agent",name:"Hermes Agent (Nous)",note:"der Agent, der auf deiner Box läuft."}),e.jsx(l,{href:"https://docs.claude.com",name:"Anthropic / Claude Docs",note:"API, Tool-Use, Agent SDK, MCP."}),e.jsx(l,{href:"https://github.com/cline/cline",name:"Cline",note:"autonomer Coding-Agent für VS Code."}),e.jsx(l,{href:"https://aider.chat",name:"aider",note:"AI-Pair-Programming im Terminal, git-nativ."}),e.jsx(l,{href:"https://continue.dev",name:"Continue",note:"Open-Source-Autopilot für IDEs."})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"font-bold text-foreground flex items-center gap-1.5",children:[e.jsx(S,{className:"h-3.5 w-3.5 text-amber-400"})," Lernen & Community"]}),e.jsxs("ul",{className:"list-disc pl-4 space-y-1.5",children:[e.jsx(l,{href:"https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/overview",name:"Prompt-Engineering (Anthropic)",note:"die beste praktische Anleitung."}),e.jsx(l,{href:"https://github.com/anthropics/anthropic-cookbook",name:"Anthropic Cookbook",note:"lauffähige Rezepte für Tools, RAG, Agenten."}),e.jsx(l,{href:"https://www.promptingguide.ai",name:"Prompt Engineering Guide",note:"herstellerneutrales Nachschlagewerk."}),e.jsx(l,{href:"https://hermes-agent.nousresearch.com",name:"Hermes Agent",note:"die autonome Open-Source Agenten-Plattform unserer Box."}),e.jsx(l,{href:"https://www.reddit.com/r/LocalLLaMA/",name:"r/LocalLLaMA",note:"der Puls der lokalen-LLM-Szene."})]})]})]})]}),e.jsx(a,{id:"troubleshooting",icon:W,color:"text-rose-400",title:"14. Troubleshooting",kicker:"Wenn's hakt",wide:!0,children:e.jsxs("ul",{className:"space-y-2 list-disc pl-4",children:[e.jsxs("li",{children:[e.jsx("strong",{children:"Keine Verbindung?"})," Selbes LAN wie die Box? IP/Port stimmen (",e.jsx(s,{children:":9001"}),")? Backend-Status im ",e.jsx("strong",{children:"Cockpit"})," prüfen."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Modell antwortet nicht / langsam?"})," Im ",e.jsx("strong",{children:"Cockpit → Dienste"})," schauen, ob ",e.jsx(s,{children:"llama-swap"})," grün ist; sonst Restart. Erstes Token nach Swap dauert (Modell lädt)."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Agent dreht durch / halluziniert?"})," Frische Session starten (Hermes Desktop oder ",e.jsx("strong",{children:"Konsole"}),") — meist ist es vollgemüllter Kontext."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Gedächtnis findet nichts?"})," Embedding-Dienst online? Semantisch suchen (Sinn statt exaktem Wort)."]}),e.jsxs("li",{children:[e.jsx("strong",{children:"Angenommene Karte hat etwas zerschossen?"})," Meist fängt es der Auto-Revert; sonst ",e.jsx("strong",{children:"Chronik → Zeitmaschine"})," (Stand von gestern) oder Backup & ",e.jsx(s,{children:"restore.sh"}),"."]})]})})]}),e.jsx("p",{className:"text-center text-[10px] text-muted-foreground/50 pt-2",children:"Mission Control 2 · AI-Bibel · Stand Juli 2026 — lebendes Dokument, wächst mit dem Stack."})]})}export{J as GuideView}; diff --git a/frontend/dist/assets/IdeenAnsicht-Cy8yw2ZX.js b/frontend/dist/assets/IdeenAnsicht-Cy8yw2ZX.js deleted file mode 100644 index a5330e8..0000000 --- a/frontend/dist/assets/IdeenAnsicht-Cy8yw2ZX.js +++ /dev/null @@ -1,40 +0,0 @@ -import{c as L,$ as O,r as u,n as z,j as e,b as S,L as D,G as T,X as Q,a2 as Se,u as De,k as Ce,z as Ke,A as ze,a3 as Ee,a4 as xe,C as Ae,T as Le,a5 as Pe,R as We,q as $e}from"./index-DMY9lUCb.js";import{S as Re}from"./SectionLabel-B7ySrBs7.js";import{C as ee}from"./code-xml-Bf-y5tB9.js";import{R as ge}from"./refresh-cw-hAcZthO8.js";import{F as fe}from"./file-text-BSQuFPZM.js";import{L as Be}from"./layers-CcL78b5Q.js";import{C as X}from"./chevron-down-1Vx9W9jM.js";import{C as he}from"./clock-Bth-s5Y3.js";/** - * @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 Ie=L("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** - * @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 Oe=L("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** - * @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 Te=L("ClipboardCheck",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/** - * @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 U=L("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/** - * @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 Y=L("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. - * See the LICENSE file in the root directory of this source tree. - */const me=L("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** - * @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 Ve=L("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),qe={triage:{label:"wird ausgearbeitet …",cls:"text-violet-300 border-violet-500/40 bg-violet-500/10",spin:!0},todo:{label:"wartet",cls:"text-muted-foreground border-border/60 bg-background/30"},scheduled:{label:"geplant",cls:"text-muted-foreground border-border/60 bg-background/30"},ready:{label:"gleich dran",cls:"text-sky-300/80 border-sky-500/30 bg-sky-500/5"},running:{label:"in Arbeit …",cls:"text-sky-300 border-sky-500/40 bg-sky-500/10",spin:!0},review:{label:"im Review",cls:"text-amber-300 border-amber-500/40 bg-amber-500/10"},blocked:{label:"hängt — braucht dich",cls:"text-red-300 border-red-500/40 bg-red-500/10"},done:{label:"fertig ✓",cls:"text-emerald-300 border-emerald-500/40 bg-emerald-500/10"}},_e={box:{label:"BOX",icon:Y,cls:"border-border/60 bg-background/40 text-muted-foreground",title:"Box-Welt: die Werkstatt baut das selbst. Das Ergebnis kommt als Patch-Vorschlag zurück — nichts geht ohne deinen Klick live."},idee:{label:"IDEE",icon:O,cls:"border-sky-500/40 bg-sky-500/10 text-sky-300",title:"Nur durchdacht: die Box hat die Produkt-Idee mit voller Denk-Kaskade zu einem Konzept ausgearbeitet. Kein Gerüst, kein Bau — du liest es und entscheidest, ob ein Projekt draus wird."},projekt:{label:"IDE",icon:ee,cls:"border-violet-500/40 bg-violet-500/10 text-violet-300",title:"IDE-Welt: die Box bereitet nur vor (Konzept + Repo + Doku, kein Code). Gebaut wird von dir in der Agentic IDE."}},Ge={needs_input:"Die Box hat eine Frage:",capability:"Die Box kam hier nicht weiter:",transient:"Die Aufgabe hakt:"},R={blocked:0,running:1,review:2,ready:3,triage:4},be="mc_ideen_quote";function ke(){try{const r=JSON.parse(localStorage.getItem(be)||"{}");return{gesendet:Number(r.gesendet)||0,geaendert:Number(r.geaendert)||0}}catch{return{gesendet:0,geaendert:0}}}function pe(r){try{const d=ke();d[r]+=1,localStorage.setItem(be,JSON.stringify(d))}catch{}}function Fe({id:r}){const[d,k]=u.useState(null),[n,m]=u.useState(!1),[p,h]=u.useState(0);u.useEffect(()=>{let o=!1;return m(!1),k(null),z(`/api/ideen/${r}/ergebnis`).then(i=>{o||k(i)}).catch(()=>{o||m(!0)}),()=>{o=!0}},[r,p]);const g=d?d.summary||d.result:"";return e.jsx("div",{className:"ml-2 -mt-1",children:e.jsxs("div",{className:"rounded-lg border border-emerald-500/25 bg-emerald-500/5 p-2.5",children:[e.jsxs("p",{className:"mb-1 flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wide text-emerald-300",children:[e.jsx(Te,{className:"h-3 w-3"})," Ergebnis des Workers"]}),n?e.jsx("button",{type:"button",onClick:()=>h(o=>o+1),className:"text-[10px] text-red-400 underline decoration-dotted underline-offset-2 hover:text-red-300",children:"Ergebnis nicht ladbar — nochmal versuchen"}):d===null?e.jsx("p",{className:"text-[10px] text-muted-foreground animate-pulse",children:"Wird geladen …"}):g?e.jsx("p",{className:"max-h-64 overflow-y-auto whitespace-pre-wrap text-xs leading-relaxed text-foreground/85",children:g}):e.jsx("p",{className:"text-[10px] text-muted-foreground italic",children:"Der Worker hat keine Abschluss-Zusammenfassung hinterlassen (ältere Karte oder Protokollverstoß)."})]})})}function Ze({text:r,className:d}){const k=(r||"").split(` -`),n=[];let m=[],p=null;const h=g=>{m.length&&(n.push(e.jsx("ul",{className:"mb-3 ml-4 list-disc space-y-1",children:m},g)),m=[])};return k.forEach((g,o)=>{const i=`l${o}`;if(p!==null){g.trimEnd()==="```"?(n.push(e.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:p.join(` -`)},i)),p=null):p.push(g);return}if(g.trimStart().startsWith("```")){h(i),p=[];return}const j=g.trimEnd();if(!j.trim()){h(i);return}const w=j.match(/^(#{1,4})\s+(.*)$/);if(w){h(i);const N=w[1].length,c=N===1?"text-base font-bold mt-1 mb-2":N===2?"text-sm font-bold mt-4 mb-1.5":"text-xs font-bold mt-3 mb-1 uppercase tracking-wide text-muted-foreground";n.push(e.jsx("p",{className:S(c,"font-space text-foreground"),children:G(w[2],i)},i));return}const y=j.match(/^\s*[-*•]\s+(.*)$/);if(y){m.push(e.jsx("li",{className:"text-xs leading-relaxed text-foreground/85",children:G(y[1],i)},i));return}const l=j.match(/^\s*\d+\.\s+(.*)$/);if(l){m.push(e.jsx("li",{className:"text-xs leading-relaxed text-foreground/85",children:G(l[1],i)},i));return}h(i),n.push(e.jsx("p",{className:"mb-2 text-xs leading-relaxed text-foreground/85",children:G(j,i)},i))}),h("end"),p!==null&&n.push(e.jsx("pre",{className:"mb-3 overflow-x-auto rounded-xl border border-border/50 bg-background/50 p-3 font-mono text-[11px]",children:p.join(` -`)},"code-end")),e.jsx("div",{className:S("max-w-3xl",d),children:n})}function G(r,d){return r.split(/(\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`)/g).map((n,m)=>{const p=`${d}-${m}`;return/^\*\*[^*]+\*\*$/.test(n)?e.jsx("b",{className:"font-semibold text-foreground",children:n.slice(2,-2)},p):/^\*[^*]+\*$/.test(n)?e.jsx("i",{children:n.slice(1,-1)},p):/^`[^`]+`$/.test(n)?e.jsx("code",{className:"rounded bg-background/50 px-1 font-mono text-[11px] text-foreground/90",children:n.slice(1,-1)},p):e.jsx("span",{children:n},p)})}function He({id:r,onFertig:d}){const[k,n]=u.useState("lxc"),[m,p]=u.useState("simpel"),[h,g]=u.useState(!1),[o,i]=u.useState(null),[j,w]=u.useState(""),[y,l]=u.useState(""),N=async(c,P,V)=>{g(!0),w("");try{const C=await z(c,{method:"POST",body:JSON.stringify(P)});i({id:C.id,art:V}),d==null||d()}catch(C){w(String((C==null?void 0:C.message)||C))}finally{g(!1)}};return o?e.jsx("p",{className:"mt-3 border-t border-violet-500/20 pt-2 text-[11px] text-emerald-300",children:o.art==="projekt"?e.jsxs(e.Fragment,{children:["Projekt-Karte ",e.jsx("span",{className:"font-mono",children:o.id})," ist angelegt — die Box bereitet das Repo vor (Konzept übernimmt sie, sie denkt es nicht neu). Danach öffnest du es in der Agentic IDE."]}):e.jsxs(e.Fragment,{children:["Überarbeitung ",e.jsx("span",{className:"font-mono",children:o.id}),' läuft — die Box arbeitet deine Rückmeldung ein und schreibt die neue Fassung an dieselbe Stelle. Danach hier wieder „Konzept" öffnen.']})}):e.jsxs("div",{className:"mt-3 space-y-3 border-t border-violet-500/20 pt-2.5",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[e.jsx("b",{className:"text-sky-300/90",children:"Passt etwas nicht?"})," Schreib hin, was anders werden soll — die Box arbeitet es ein und lässt den Rest stehen. Beliebig oft wiederholbar."]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:y,onChange:c=>l(c.target.value),onKeyDown:c=>{c.key==="Enter"&&y.trim().length>=3&&!h&&N("/api/ideen/nachschaerfen",{id:r,hinweis:y},"runde")},placeholder:"z. B. „Punkt 3: kein WebSocket, das ist mir zu fragil — nimm Polling“",maxLength:2e3,className:"h-8 min-w-0 flex-1 rounded-lg border border-border/60 bg-background/60 px-2.5 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-sky-400/50 focus:outline-none"}),e.jsxs("button",{onClick:()=>N("/api/ideen/nachschaerfen",{id:r,hinweis:y},"runde"),disabled:h||y.trim().length<3,className:"flex h-8 shrink-0 items-center gap-1.5 rounded-lg border border-sky-500/40 bg-sky-500/10 px-3 text-[10px] font-bold uppercase tracking-wide text-sky-300 transition-all hover:bg-sky-500/20 cursor-pointer disabled:opacity-50",children:[h?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(ge,{className:"h-3.5 w-3.5"}),"Nachschärfen"]})]})]}),e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:[e.jsx("b",{className:"text-violet-300/90",children:"Passt es so?"})," Dann macht die Box daraus ein startklares Repo — Konzept wird übernommen (nicht neu gedacht), dazu Roadmap, AGENTS.md & Co. Gebaut wird danach von dir in der Agentic IDE."]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"Ziel"}),e.jsx("div",{className:"flex rounded-lg border border-border/40 p-0.5",children:["lxc","docker"].map(c=>e.jsx("button",{onClick:()=>n(c),title:c==="lxc"?"Dienst in einem eigenen Proxmox-LXC (systemd, kein Docker) — wird automatisch mitgesichert.":"Natives Docker: Dockerfile + compose, portabel und pipeline-tauglich.",className:S("rounded px-2 py-0.5 text-[10px] font-semibold transition-all cursor-pointer",k===c?"bg-foreground/10 text-foreground":"text-muted-foreground/50 hover:text-foreground/80"),children:c==="lxc"?"LXC":"Docker"},c))}),e.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"Aufwand"}),e.jsx("div",{className:"flex rounded-lg border border-border/40 p-0.5",children:["simpel","gruendlich"].map(c=>e.jsx("button",{onClick:()=>p(c),title:c==="simpel"?"Konzept ist schon gehärtet — nur kurz auf die Bau-Sicht nachschärfen (empfohlen).":"Nochmal volle Kaskade über die Bau-Sicht: mehrere Rollen, Härtetests. Dauert entsprechend.",className:S("rounded px-2 py-0.5 text-[10px] font-semibold transition-all cursor-pointer",m===c?"bg-foreground/10 text-foreground":"text-muted-foreground/50 hover:text-foreground/80"),children:c==="simpel"?"schlank":"gründlich"},c))}),e.jsxs("button",{onClick:()=>N("/api/ideen/weiterfuehren",{id:r,ziel:k,tiefe:m},"projekt"),disabled:h,className:"ml-auto flex h-8 shrink-0 items-center gap-1.5 rounded-lg border border-violet-500/40 bg-violet-500/10 px-3 text-[10px] font-bold uppercase tracking-wide text-violet-300 transition-all hover:bg-violet-500/20 cursor-pointer disabled:opacity-50",children:[h?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(ee,{className:"h-3.5 w-3.5"}),"Gefällt mir — Projekt daraus machen"]})]}),j&&e.jsx("p",{className:"text-[11px] text-red-400",children:j})]})}function Je({id:r,istIdee:d,onWeiter:k}){const[n,m]=u.useState(null),[p,h]=u.useState(!1),[g,o]=u.useState(0);return u.useEffect(()=>{let i=!1;return m(null),h(!1),z(`/api/ideen/${r}/konzept`).then(j=>{i||m(j)}).catch(()=>{i||h(!0)}),()=>{i=!0}},[r,g]),e.jsx("div",{className:"ml-2 -mt-1",children:e.jsxs("div",{className:"rounded-lg border border-violet-500/25 bg-violet-500/[0.04] p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsxs("p",{className:"flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wide text-violet-300",children:[e.jsx(fe,{className:"h-3 w-3"})," Konzept"]}),(n==null?void 0:n.repo)&&e.jsxs("a",{href:`https://git.tobisniceshomelab.ddnsfree.com/${n.repo}`,className:"flex items-center gap-1 text-[10px] text-violet-300/70 hover:text-violet-200",children:[e.jsx(U,{className:"h-3 w-3"})," ",n.repo]}),!(n!=null&&n.repo)&&(n==null?void 0:n.quelle)==="datei"&&e.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground/70",title:"Der Worker hat kein Repo angelegt — das Konzept liegt als Datei auf der Box.",children:n.pfad}),e.jsx("button",{onClick:()=>o(i=>i+1),title:"Neu laden",className:"ml-auto rounded p-0.5 text-muted-foreground/50 hover:text-foreground cursor-pointer",children:e.jsx(ge,{className:"h-3 w-3"})})]}),p?e.jsx("p",{className:"text-[11px] text-red-400",children:"Konzept nicht ladbar — später nochmal versuchen."}):n===null?e.jsx("p",{className:"text-[10px] text-muted-foreground animate-pulse",children:"Konzept wird geladen …"}):n.konzept?e.jsx("div",{className:"max-h-[28rem] overflow-y-auto pr-1",children:e.jsx(Ze,{text:n.konzept})}):e.jsx("p",{className:"text-[11px] text-muted-foreground italic",children:n.error||"Noch kein Konzept — das Projekt wird gerade vorbereitet."}),d&&(n==null?void 0:n.konzept)&&e.jsx(He,{id:r,onFertig:k})]})})}function Me({projekt:r,karten:d,zeile:k,onArchivAlle:n,raeumt:m}){const[p,h]=u.useState(!1),[g,o]=u.useState(!1),i=d.filter(l=>R[l.status]!==void 0).sort((l,N)=>R[l.status]-R[N.status]||(l.erstellt??0)-(N.erstellt??0)),j=d.filter(l=>l.status==="todo"||l.status==="scheduled").sort((l,N)=>{var c,P;return((c=l.wartet_auf)!=null&&c.length?1:0)-((P=N.wartet_auf)!=null&&P.length?1:0)||(l.erstellt??0)-(N.erstellt??0)}),w=d.filter(l=>l.status==="done").sort((l,N)=>(N.fertig??0)-(l.fertig??0)),y=r.gesamt>0?Math.round(r.fertig/r.gesamt*100):0;return e.jsxs("div",{className:"space-y-2 rounded-xl border border-border/50 bg-background/20 p-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Be,{className:"h-4 w-4 shrink-0 text-primary/70"}),e.jsx("p",{className:"min-w-0 flex-1 truncate text-xs font-semibold text-foreground",title:r.titel,children:r.titel}),e.jsxs("span",{className:"shrink-0 text-[10px] text-muted-foreground",children:[r.fertig," von ",r.gesamt," fertig"]})]}),e.jsx("div",{className:"h-1 overflow-hidden rounded-full bg-background/60",title:`${y}%`,children:e.jsx("div",{className:"h-1 rounded-full bg-primary/70 transition-all",style:{width:`${y}%`}})}),i.length>0&&e.jsx("ul",{className:"space-y-1.5",children:i.map(l=>k(l))}),j.length>0&&e.jsxs("div",{children:[e.jsxs("button",{onClick:()=>h(l=>!l),className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:[p?e.jsx(X,{className:"h-3.5 w-3.5"}):e.jsx(T,{className:"h-3.5 w-3.5"}),j.length," Karte",j.length===1?"":"n"," in der Kette — laufen automatisch der Reihe nach"]}),p&&e.jsx("ul",{className:"mt-1.5 space-y-1.5",children:j.map(l=>k(l))})]}),w.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("button",{onClick:()=>o(l=>!l),className:"flex items-center gap-1.5 text-[11px] font-semibold text-emerald-300/70 hover:text-emerald-300 transition-colors cursor-pointer",children:[g?e.jsx(X,{className:"h-3.5 w-3.5"}):e.jsx(T,{className:"h-3.5 w-3.5"}),w.length," fertig"]}),n&&e.jsxs("button",{disabled:m,onClick:()=>n(r.key,w.length,`„${r.titel}"`),title:"Räumt die fertigen Karten dieser Kette weg (Archiv, nichts wird gelöscht).",className:"flex items-center gap-1 text-[11px] text-muted-foreground/60 transition-colors hover:text-foreground disabled:opacity-50 cursor-pointer",children:[m?e.jsx(D,{className:"h-3 w-3 animate-spin"}):e.jsx(Q,{className:"h-3 w-3"}),"wegräumen"]})]}),g&&e.jsx("ul",{className:"mt-1.5 space-y-1.5",children:w.map(l=>k(l))})]})]})}function F({k:r,aktiv:d,onWahl:k}){return e.jsxs("button",{onClick:k,className:S("rounded-xl border p-3 text-left transition-all cursor-pointer",d?"border-primary/60 bg-primary/5":"border-border/50 hover:border-border"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(r.icon,{className:S("h-4 w-4 shrink-0",d?"text-primary":"text-muted-foreground")}),e.jsx("span",{className:"text-xs font-semibold text-foreground",children:r.titel})]}),e.jsx("p",{className:"mt-1 text-[11px] leading-relaxed text-muted-foreground",children:r.text})]})}function Qe(){var ie,le;const{data:r,isLoading:d}=Se(),k=De(),{showAlert:n,showConfirm:m,dialogElement:p}=Ce(),[h,g]=u.useState(""),[o,i]=u.useState("denken"),[j,w]=u.useState("schlank"),[y,l]=u.useState(!1),[N,c]=u.useState(!1),P=o!=="box",V=o==="repo",[C,je]=u.useState("lxc"),[Z,te]=u.useState(!1),[v,E]=u.useState({}),Ne=Ke(),B=ze({from:"/ideen"}).offen??null,we=t=>Ne({to:"/ideen",search:s=>({...s,offen:t??void 0}),replace:!0}),[H,ye]=u.useState(null),[J,re]=u.useState({}),W=(r==null?void 0:r.items)??[],$=()=>k.invalidateQueries({queryKey:$e.ideen});u.useEffect(()=>{const t=h.trim();if(t.length<12){c(!1);return}let s=!1;const x=setTimeout(async()=>{try{const f=await z("/api/ideen/einordnen",{method:"POST",body:JSON.stringify({text:t})});if(s||!(f!=null&&f.ok))return;i(f.nur_denken?"denken":f.wer==="ide"?"repo":"box"),f.tiefe&&w(f.tiefe),c(!0)}catch{}},700);return()=>{s=!0,clearTimeout(x)}},[h]);const se=B!==null&&(((ie=r==null?void 0:r.items.find(t=>t.id===B))==null?void 0:ie.status)==="triage"||((le=r==null?void 0:r.items.find(t=>t.id===B))==null?void 0:le.status)==="running"),I=Ee(B??"",se);async function ne(){const t=h.trim();if(!(t.length<3||Z)){te(!0);try{const s=t.length>160?t.slice(0,157)+"…":t;await z("/api/ideen",{method:"POST",body:JSON.stringify({titel:s,notiz:t.length>160?t:"",welt:P?"ide":"box",tiefe:V?j==="gruendlich"?"gruendlich":"simpel":"",ziel:V?C:"",art:o==="denken"?"idee":"projekt"})}),pe("gesendet"),g(""),c(!1),l(!1),$()}catch(s){n("Das hat nicht geklappt",String((s==null?void 0:s.message)||s))}finally{te(!1)}}}function ae(t,s,x){m(`${s} fertige Karte${s===1?"":"n"} wegräumen?`,`${x} verschwindet aus der Liste. Gelöscht wird nichts — die Karten wandern ins Archiv der Queue und bleiben dort lesbar. Laufende, hängende und wartende Karten bleiben unberührt.`,async()=>{var b;const f="arch:"+(t||"*");E(a=>({...a,[f]:!0}));try{const a=await z("/api/ideen/archivieren-alle",{method:"POST",body:JSON.stringify({projekt:t})});(b=a.fehlgeschlagen)!=null&&b.length&&n("Teilweise erledigt",`${a.archiviert} weggeräumt, ${a.fehlgeschlagen.length} nicht: `+a.fehlgeschlagen.map(A=>A.titel).join(", ")),$()}catch(a){n("Das hat nicht geklappt",String((a==null?void 0:a.message)||a))}finally{E(a=>({...a,[f]:!1}))}})}async function ve(t){E(s=>({...s,[t]:!0}));try{await z("/api/ideen/archivieren",{method:"POST",body:JSON.stringify({id:t})}),$()}catch(s){n("Das hat nicht geklappt",String((s==null?void 0:s.message)||s))}finally{E(s=>({...s,[t]:!1}))}}async function q(t,s,x,f){E(b=>({...b,[t+s]:!0}));try{await z(x,{method:"POST",body:JSON.stringify(f)}),$()}catch(b){n("Das hat nicht geklappt",String((b==null?void 0:b.message)||b))}finally{E(b=>({...b,[t+s]:!1}))}}async function oe(t){const s=(J[t]||"").trim();if(!(s.length<1||v["ans:"+t])){E(x=>({...x,["ans:"+t]:!0}));try{await z("/api/ideen/antwort",{method:"POST",body:JSON.stringify({id:t,antwort:s})}),re(x=>({...x,[t]:""})),$()}catch(x){n("Das hat nicht geklappt",String((x==null?void 0:x.message)||x))}finally{E(x=>({...x,["ans:"+t]:!1}))}}}const _=t=>{var ce,ue;const s=qe[t.status]??{label:t.status,cls:"text-muted-foreground border-border/60 bg-background/30"},x=B===t.id,f=t.status==="triage"||t.status==="running"||t.status==="done",b=t.status==="blocked",a=!!v["ans:"+t.id],A=t.status==="running"&&(t.puls_alter??0)>600,de=t.status==="todo"||t.status==="ready"||t.status==="scheduled";return e.jsxs("li",{className:S("flex flex-col gap-2 rounded-xl border bg-background/30 px-3 py-2",b?"border-red-500/30":A?"border-amber-500/40":"border-border/40"),children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:S("flex shrink-0 items-center gap-1.5 rounded-lg border px-2 py-0.5 text-[10px] font-bold",s.cls),children:[s.spin&&e.jsx(D,{className:"h-3 w-3 animate-spin"}),s.label]}),A&&e.jsxs("span",{className:"flex shrink-0 items-center gap-1 rounded-lg border border-amber-500/40 bg-amber-500/10 px-2 py-0.5 text-[10px] font-bold text-amber-300",title:"Der Worker lebt, gibt aber kein Lebenszeichen mehr — vermutlich wartet er auf etwas, das nie kommt. „Neuer Versuch“ startet die Karte frisch.",children:[e.jsx(Le,{className:"h-3 w-3"})," ",Math.round((t.puls_alter??0)/60)," min ohne Regung"]}),(t.prio??0)!==0&&e.jsxs("span",{className:"shrink-0 rounded bg-background/50 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",title:"Priorität — höher kommt zuerst dran (bei gleicher Prio: Erstellzeit)",children:["P",t.prio]}),(()=>{const K=_e[t.art||(t.welt==="ide"?"projekt":"box")];if(!K)return null;const M=K.icon;return e.jsxs("span",{className:S("flex shrink-0 items-center gap-1 rounded-lg border px-2 py-0.5 text-[10px] font-bold",K.cls),title:K.title,children:[e.jsx(M,{className:"h-3 w-3"})," ",K.label]})})(),e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-foreground",title:t.titel,children:t.titel}),e.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px] text-muted-foreground/70",children:[e.jsx(he,{className:"h-3 w-3"}),Pe(t.erstellt)]}),de&&e.jsxs("span",{className:"flex shrink-0 items-center",children:[e.jsx("button",{disabled:!!v["pr:"+t.id],onClick:()=>q("pr:",t.id,"/api/ideen/prio",{id:t.id,richtung:"hoch"}),title:"Vorziehen (Prio +1)",className:"rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer disabled:opacity-50",children:e.jsx(Oe,{className:"h-3.5 w-3.5"})}),e.jsx("button",{disabled:!!v["pr:"+t.id],onClick:()=>q("pr:",t.id,"/api/ideen/prio",{id:t.id,richtung:"runter"}),title:"Zurückstellen (Prio −1)",className:"rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer disabled:opacity-50",children:e.jsx(Ie,{className:"h-3.5 w-3.5"})})]}),(t.status==="running"||b)&&e.jsx("button",{disabled:!!v["rt:"+t.id],onClick:()=>m("Neuer Versuch?",t.status==="running"?`Der laufende Worker von '${t.titel.slice(0,60)}' wird beendet (samt gestarteter Test-Prozesse) und die Karte frisch gestartet. Bisheriger Zwischenstand im Workspace bleibt liegen.`:`Die Karte '${t.titel.slice(0,60)}' wird entsperrt und läuft weiter, sobald ein Platz frei ist.`,()=>q("rt:",t.id,"/api/ideen/retry",{id:t.id})),title:"Neuer Versuch — Karte frisch starten",className:S("shrink-0 rounded-md p-1 transition-colors cursor-pointer disabled:opacity-50",A?"text-amber-300 hover:text-amber-200":"text-muted-foreground/60 hover:text-foreground"),children:v["rt:"+t.id]?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(We,{className:"h-3.5 w-3.5"})}),(t.status==="running"||de||t.status==="triage")&&e.jsx("button",{disabled:!!v["st:"+t.id],onClick:()=>m("Karte stoppen?",`'${t.titel.slice(0,60)}' wird angehalten${t.status==="running"?" und der laufende Worker beendet":""}. Sie bleibt als gestoppt im Board und kann jederzeit per „Neuer Versuch“ weiterlaufen.`,()=>q("st:",t.id,"/api/ideen/stopp",{id:t.id})),title:"Stoppen — Karte anhalten",className:"shrink-0 rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-red-300 cursor-pointer disabled:opacity-50",children:v["st:"+t.id]?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Ve,{className:"h-3.5 w-3.5"})}),(t.status==="done"||b)&&e.jsx("button",{disabled:!!v[t.id],onClick:()=>ve(t.id),title:b?"Aufgeben und aus der Liste räumen (wandert ins Kanban-Archiv)":"Aus der Liste räumen (wandert ins Kanban-Archiv)",className:"shrink-0 rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer disabled:opacity-50",children:v[t.id]?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Q,{className:"h-3.5 w-3.5"})}),t.welt==="ide"&&(t.status==="running"||t.status==="done")&&e.jsxs("button",{onClick:()=>ye(H===t.id?null:t.id),title:"Konzept ansehen (das ausgearbeitete KONZEPT.md)",className:S("flex shrink-0 items-center gap-1 rounded-md px-1.5 py-1 text-[10px] font-bold transition-colors cursor-pointer",H===t.id?"text-violet-300":"text-violet-300/70 hover:text-violet-200"),children:[e.jsx(fe,{className:"h-3.5 w-3.5"})," Konzept"]}),f&&e.jsx("button",{onClick:()=>we(x?null:t.id),title:t.status==="done"?"Ergebnis anzeigen":"Worker-Log anzeigen",className:"shrink-0 rounded-md p-1 text-muted-foreground/60 transition-colors hover:text-foreground cursor-pointer",children:x?e.jsx(X,{className:"h-3.5 w-3.5"}):e.jsx(T,{className:"h-3.5 w-3.5"})})]}),H===t.id&&e.jsx(Je,{id:t.id,istIdee:t.art==="idee"&&t.status==="done",onWeiter:$}),t.status==="running"&&t.notiz&&e.jsxs("p",{className:"-mt-1 ml-1 text-[11px] italic leading-relaxed text-sky-200/80",title:"Jüngste Zwischenmeldung des Workers (Heartbeat)",children:["„",t.notiz,"“"]}),(t.status==="todo"||t.status==="scheduled"||t.status==="ready")&&(((ce=t.wartet_auf)==null?void 0:ce.length)??0)>0&&e.jsxs("p",{className:"-mt-1 ml-1 text-[10px] text-muted-foreground/70",children:["→ wartet auf: ",t.wartet_auf.join(" · ")]}),b&&e.jsxs("div",{className:"space-y-2 border-t border-red-500/20 pt-2",children:[e.jsxs("p",{className:"flex items-start gap-1.5 text-[11px] leading-relaxed text-red-200/90",children:[e.jsx(xe,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-red-300"}),e.jsxs("span",{children:[e.jsx("b",{children:Ge[t.frage_kind||""]??"Die Aufgabe hängt und wartet auf dich:"})," ",t.frage?e.jsx("span",{className:"text-foreground/90",children:t.frage}):e.jsx("span",{className:"text-muted-foreground italic",children:"kein genauer Grund hinterlegt — antworte einfach mit einer Entscheidung, dann läuft sie weiter."})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:J[t.id]||"",onChange:K=>re(M=>({...M,[t.id]:K.target.value})),onKeyDown:K=>{K.key==="Enter"&&oe(t.id)},placeholder:"Deine Antwort — die Box macht damit weiter",maxLength:2e3,className:"h-8 min-w-0 flex-1 rounded-lg border border-border/60 bg-background/60 px-2.5 text-xs text-foreground placeholder:text-muted-foreground/50 focus:border-red-400/50 focus:outline-none"}),e.jsxs("button",{onClick:()=>oe(t.id),disabled:a||(J[t.id]||"").trim().length<1,className:"flex h-8 shrink-0 items-center gap-1.5 rounded-lg border border-emerald-500/40 bg-emerald-500/10 px-3 text-[10px] font-bold uppercase tracking-wide text-emerald-300 transition-all hover:bg-emerald-500/20 cursor-pointer disabled:opacity-50",children:[a?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(me,{className:"h-3.5 w-3.5"})," Antworten & weiter"]})]})]}),x&&f&&t.status!=="done"&&e.jsx("div",{className:"ml-2 -mt-1",children:e.jsx("div",{className:"rounded-lg border border-border/50 bg-background/50 p-2",children:se&&I.isLoading?e.jsx("p",{className:"text-[10px] text-muted-foreground animate-pulse",children:"Log wird geladen …"}):I.error?e.jsx("p",{className:"text-[10px] text-red-400",children:"Log nicht ladbar"}):(ue=I.data)!=null&&ue.available&&I.data.lines.length>0?e.jsx("pre",{className:"max-h-64 overflow-auto font-mono text-[10px] leading-relaxed text-foreground/80 whitespace-pre-wrap",children:I.data.lines.join(` -`)}):e.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Kein Log verfügbar"})})}),x&&t.status==="done"&&e.jsx(Fe,{id:t.id})]},t.id)};return r&&!r.available?null:e.jsxs("section",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(Re,{icon:O,children:(()=>{if(!r)return"Ideen-Queue";const t=x=>W.filter(f=>x.includes(f.status)).length,s=[t(["blocked"])>0?`${t(["blocked"])} braucht dich`:"",t(["running","triage","review"])>0?`${t(["running","triage","review"])} in Arbeit`:"",t(["todo","scheduled","ready"])>0?`${t(["todo","scheduled","ready"])} wartet`:"",t(["done"])>0?`${t(["done"])} fertig`:""].filter(Boolean);return s.length?s.join(" · "):"noch nichts in der Queue"})()}),(()=>{const t=W.filter(s=>s.status==="done").length;return t===0?null:e.jsxs("button",{disabled:!!v["arch:*"],onClick:()=>ae("",t,`Alle ${t} fertigen Karten`),title:"Räumt ALLE fertigen Karten weg — auch die in abgeschlossenen Projekt-Ketten. Laufende, hängende und wartende bleiben unberührt.",className:"flex shrink-0 items-center gap-1.5 rounded-lg border border-border/60 px-2.5 py-1 text-[11px] font-semibold text-muted-foreground transition-all hover:border-primary/40 hover:text-foreground disabled:opacity-50 cursor-pointer",children:[v["arch:*"]?e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Q,{className:"h-3.5 w-3.5"}),t," fertige wegräumen"]})})()]}),e.jsxs("div",{className:"mc-card p-4 space-y-4",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:h,onChange:t=>{g(t.target.value),c(!1)},onKeyDown:t=>{t.key==="Enter"&&ne()},placeholder:"Was soll entstehen?",className:"h-10 min-w-0 flex-1 rounded-lg border border-border/60 bg-background/50 px-3 text-sm text-foreground placeholder:text-muted-foreground/50 focus:border-primary/50 focus:outline-none"}),e.jsxs("button",{onClick:ne,disabled:Z||h.trim().length<3,className:"flex h-10 shrink-0 items-center gap-1.5 rounded-lg border border-primary/40 bg-primary/10 px-4 text-xs font-semibold text-primary transition-all hover:bg-primary/20 disabled:opacity-40 cursor-pointer",children:[Z?e.jsx(D,{className:"h-4 w-4 animate-spin"}):e.jsx(me,{className:"h-4 w-4"}),"Los"]})]}),y?e.jsxs("div",{className:"space-y-3 rounded-xl border border-border/40 bg-background/20 p-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"mb-1.5 text-[11px] text-muted-foreground/70",children:"Wer baut das?"}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsx(F,{aktiv:o!=="box",onWahl:()=>i(o==="box"?"denken":o),k:{id:"ide",icon:ee,titel:"Ich, in der Agentic IDE",text:"Du bekommst Konzept und Repo — den Code schreibst du selbst."}}),e.jsx(F,{aktiv:o==="box",onWahl:()=>i("box"),k:{id:"box",icon:Y,titel:"Die Box, allein",text:"Für dein Heimlabor. Das Ergebnis kommt als Branch nach Gitea — mergen tust du."}})]})]}),o!=="box"&&e.jsxs("div",{className:"border-l-2 border-primary/40 pl-3",children:[e.jsx("p",{className:"mb-1.5 text-[11px] text-muted-foreground/70",children:"Und wie startest du?"}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsx(F,{aktiv:o==="denken",onWahl:()=>i("denken"),k:{id:"denken",icon:O,titel:"Erst durchdenken",text:"Konzept zuerst — auf dein Ja wird ein Repo daraus."}}),e.jsx(F,{aktiv:o==="repo",onWahl:()=>i("repo"),k:{id:"repo",icon:U,titel:"Direkt ein Repo",text:"Konzept und Gitea-Repo in einem Zug."}})]}),o==="repo"?e.jsxs("div",{className:"mt-2.5 flex flex-wrap items-center gap-x-3 gap-y-2",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"Wie gründlich?"}),e.jsx("div",{className:"flex rounded-lg border border-border/60 p-0.5",children:[["schlank","schlank"],["gruendlich","gründlich"]].map(([t,s])=>e.jsx("button",{onClick:()=>w(t),className:S("rounded px-2.5 py-1 text-[10px] font-bold uppercase tracking-wide transition-all cursor-pointer",j===t?"bg-primary/15 text-primary":"text-muted-foreground/60 hover:text-foreground"),children:s},t))}),e.jsxs("span",{className:"ml-auto flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground/70",children:"Läuft als"}),e.jsx("div",{className:"flex rounded-lg border border-border/40 p-0.5",children:[["lxc","LXC"],["docker","Docker"]].map(([t,s])=>e.jsx("button",{onClick:()=>je(t),title:t==="lxc"?"Dienst in einem eigenen Proxmox-LXC (systemd, kein Docker). Wird vom Backup-Server mitgesichert.":"Natives Docker: Dockerfile + compose, portabel und pipeline-tauglich.",className:S("rounded px-2 py-0.5 text-[10px] font-semibold transition-all cursor-pointer",C===t?"bg-foreground/10 text-foreground":"text-muted-foreground/50 hover:text-foreground/80"),children:s},t))})]})]}):e.jsxs("p",{className:"mt-2 flex items-start gap-1.5 text-[10px] leading-relaxed text-muted-foreground/60",children:[e.jsx(xe,{className:"mt-px h-3 w-3 shrink-0"}),'Wie gründlich und wo es läuft, fragt die Box erst beim „gefällt mir" — dann weißt du mehr.']})]}),(()=>{const t=ke();return t.gesendet<3?null:e.jsxs("p",{className:"border-t border-border/30 pt-2 text-[10px] text-muted-foreground/50",children:["Du hast ",t.geaendert," von ",t.gesendet," Vorschlägen geändert. Wird das die Regel, bauen wir hier einen richtigen Schritt-für-Schritt-Assistenten."]})})()]}):e.jsxs("div",{className:"flex flex-wrap items-center gap-2 rounded-xl border border-border/40 bg-background/20 px-3 py-2.5 text-xs",children:[o==="box"?e.jsx(Y,{className:"h-4 w-4 shrink-0 text-primary"}):o==="repo"?e.jsx(U,{className:"h-4 w-4 shrink-0 text-primary"}):e.jsx(O,{className:"h-4 w-4 shrink-0 text-primary"}),!N&&e.jsx("span",{className:"shrink-0 text-[10px] uppercase tracking-wider text-muted-foreground/50",children:"Voreingestellt"}),e.jsx("span",{className:"text-muted-foreground",children:o==="box"?"Ich baue das selbst und lege dir das Ergebnis als Vorschlag hin.":o==="repo"?"Du baust selbst — ich lege dir Konzept und Repo an.":"Du baust selbst — ich arbeite erst ein Konzept aus."}),N&&e.jsx("span",{className:"shrink-0 rounded border border-primary/40 bg-primary/10 px-1.5 py-0.5 text-[10px] font-bold text-primary",children:"gelesen"}),e.jsx("button",{onClick:()=>{l(!0),pe("geaendert")},className:"ml-auto shrink-0 text-[11px] text-muted-foreground/60 underline underline-offset-2 transition-colors hover:text-foreground cursor-pointer",children:"anders"})]}),d&&e.jsxs("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(D,{className:"h-3.5 w-3.5 animate-spin"})," Queue wird geladen …"]}),(r==null?void 0:r.fehler)&&e.jsx("p",{className:"text-xs text-amber-300",children:"Queue gerade nicht lesbar — neuer Versuch läuft."}),W.length>0&&e.jsxs("div",{className:"space-y-3",children:[((r==null?void 0:r.projekte)??[]).map(t=>e.jsx(Me,{projekt:t,karten:W.filter(s=>s.projekt===t.key),zeile:_,onArchivAlle:ae,raeumt:!!v["arch:"+t.key]},t.key)),(()=>{const t=new Set(((r==null?void 0:r.projekte)??[]).map(a=>a.key)),s=W.filter(a=>!a.projekt||!t.has(a.projekt));if(s.length===0)return null;const x=s.filter(a=>R[a.status]!==void 0).sort((a,A)=>R[a.status]-R[A.status]||(a.erstellt??0)-(A.erstellt??0)),f=s.filter(a=>["todo","scheduled"].includes(a.status)),b=s.filter(a=>a.status==="done");return e.jsxs("div",{className:"space-y-2",children:[x.length>0&&e.jsx("ul",{className:"space-y-1.5",children:x.map(a=>_(a))}),f.length>0&&e.jsxs("details",{className:"group",children:[e.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 py-1 text-[11px] text-muted-foreground/70 hover:text-foreground",children:[e.jsx(T,{className:"h-3 w-3 transition-transform group-open:rotate-90"}),e.jsx(he,{className:"h-3 w-3"})," Wartet (",f.length,")"]}),e.jsx("ul",{className:"mt-1.5 space-y-1.5",children:f.map(a=>_(a))})]}),b.length>0&&e.jsxs("details",{className:"group",children:[e.jsxs("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 py-1 text-[11px] text-muted-foreground/70 hover:text-foreground",children:[e.jsx(T,{className:"h-3 w-3 transition-transform group-open:rotate-90"}),e.jsx(Ae,{className:"h-3 w-3 text-emerald-400/70"})," Fertig (",b.length,")"]}),e.jsx("ul",{className:"mt-1.5 space-y-1.5",children:b.map(a=>_(a))})]})]})})()]}),(r==null?void 0:r.available)&&!d&&W.length===0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-[11px] text-muted-foreground/70",children:"Noch nichts hier. Zum Beispiel:"}),["Ein kleines Werkzeug, das meine Fotos nach Aufnahmedatum in Ordner sortiert","Rippy soll die Untertitel-Spur automatisch auswählen statt zu fragen","Lohnt sich ein Dashboard für die Stromzähler, oder reicht Home Assistant?"].map(t=>e.jsxs("button",{onClick:()=>g(t),className:"flex w-full items-center gap-2 rounded-lg border border-border/40 bg-background/20 px-3 py-2 text-left text-xs text-muted-foreground transition-all hover:border-primary/40 hover:text-foreground cursor-pointer",children:[e.jsx(O,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground/50"}),t]},t))]})]}),p]})}function ot(){return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.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:"Ideen"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Schreib hin, was entstehen soll. Die Box liest mit und schlägt vor, wie es weitergeht — ändern kannst du das immer."})]}),e.jsx(Qe,{})]})}export{ot as IdeenView}; diff --git a/frontend/dist/assets/JobsBar-95gsUJZs.js b/frontend/dist/assets/JobsBar-95gsUJZs.js deleted file mode 100644 index c5549ec..0000000 --- a/frontend/dist/assets/JobsBar-95gsUJZs.js +++ /dev/null @@ -1 +0,0 @@ -import{u,ae as m,k as x,j as s,y as n,af as b,b as p,n as f,q as h}from"./index-DMY9lUCb.js";function y(){const d=u(),{data:t=[]}=m(),{showAlert:l,dialogElement:o}=x();async function i(e){try{await f(`/api/jobs/${e}/cancel`,{method:"POST"}),d.invalidateQueries({queryKey:h.jobs})}catch(c){l("Fehler",c.message)}}const a=t.filter(e=>e.state==="running"||e.state==="queued"),r=t.filter(e=>e.state!=="running"&&e.state!=="queued").slice(-3);return a.length===0&&r.length===0?null:s.jsxs("div",{className:"space-y-3 mc-card p-4",children:[s.jsx("div",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Aktive Downloads"}),a.map(e=>s.jsxs("div",{className:"space-y-1.5 p-3 rounded-xl bg-background/20 border border-border/40",children:[s.jsxs("div",{className:"flex justify-between items-center text-xs",children:[s.jsx("span",{className:"font-semibold truncate max-w-[250px]",children:e.label}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("span",{className:"text-muted-foreground font-mono",children:[e.progress??0,"% • ",n(e.done_bytes),"/",n(e.total_bytes),e.eta_s?` • ETA ${b(e.eta_s)}`:""]}),s.jsx("button",{onClick:()=>i(e.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"})]})]}),s.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted",children:s.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-500",style:{width:`${e.progress??0}%`}})})]},e.id)),r.map(e=>s.jsxs("div",{className:"flex justify-between items-center text-xs text-muted-foreground px-1",children:[s.jsx("span",{className:"truncate",children:e.label}),s.jsx("span",{className:p("font-semibold text-[10px] px-1.5 py-0.5 rounded uppercase font-mono",e.state==="done"?"bg-emerald-500/10 text-emerald-400":"bg-amber-500/10 text-amber-400"),children:e.state})]},e.id)),o]})}export{y as J}; diff --git a/frontend/dist/assets/KonsoleView-CSxygCPx.js b/frontend/dist/assets/KonsoleView-CSxygCPx.js deleted file mode 100644 index 493977e..0000000 --- a/frontend/dist/assets/KonsoleView-CSxygCPx.js +++ /dev/null @@ -1 +0,0 @@ -import{O as h,u as g,P as p,r as d,j as e,b as x,T as j,S as N,n as v,U as m,V as w,q as f}from"./index-DMY9lUCb.js";import{E as k}from"./external-link-DcJao8h4.js";import{R as y}from"./refresh-cw-hAcZthO8.js";function K(){const{data:t}=h(),u=g(),a=t!=null&&t.box_console_url?p(t.box_console_url):void 0,n=t==null?void 0:t.box_console_reachable,[o,i]=d.useState(!1),[c,l]=d.useState("");async function b(){i(!0),l("");try{const s=await v("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:"box-console"})}),r=s.ok?"Konsolen-Dienst neu gestartet — einen Moment, dann lädt das Terminal.":`Neustart fehlgeschlagen: ${s.err||"Unbekannter Fehler"}`;l(r),m(s.ok?"erfolg":"fehler",r),w(u,f.agentStatus,f.services)}catch(s){const r=`Neustart fehlgeschlagen: ${(s==null?void 0:s.message)||s}`;l(r),m("fehler",r)}finally{i(!1)}}return e.jsxs("div",{className:"flex h-full flex-col gap-4",children:[e.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[e.jsxs("div",{children:[e.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"}),e.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."})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground",children:[e.jsx("span",{className:x("h-2 w-2 rounded-full",n?"bg-emerald-500 animate-pulse":"bg-amber-500")}),n?"online":"offline"]}),a&&e.jsxs("a",{href:a,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:[e.jsx(k,{className:"h-3.5 w-3.5"})," In neuem Tab"]})]})]}),a?e.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:[n===!1&&e.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 bg-black/70 text-center",children:[e.jsx(j,{className:"h-8 w-8 text-amber-400"}),e.jsx("div",{className:"text-sm font-semibold text-amber-300",children:"Konsole nicht erreichbar"}),e.jsxs("p",{className:"max-w-sm text-[11px] leading-normal text-muted-foreground",children:["Der Terminal-Dienst (",e.jsx("code",{className:"font-mono text-primary",children:"box-console"}),") läuft gerade nicht."]}),e.jsxs("button",{onClick:b,disabled:o,className:"flex h-9 items-center gap-1.5 rounded-lg border border-amber-500/40 bg-amber-500/10 px-4 text-[11px] font-bold uppercase tracking-wide text-amber-300 transition-all hover:bg-amber-500/20 cursor-pointer disabled:opacity-50",children:[e.jsx(y,{className:x("h-3.5 w-3.5",o&&"animate-spin")})," Dienst neu starten"]}),c&&e.jsx("p",{className:"max-w-sm text-[11px] text-muted-foreground",children:c})]}),e.jsx("iframe",{src:a,title:"Box-Konsole",className:"h-full w-full border-0",style:{minHeight:"58vh"}})]}):e.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:[e.jsx(N,{className:"mr-2 h-4 w-4"})," Lade Konsole…"]})]})}export{K as KonsoleView}; diff --git a/frontend/dist/assets/LiveAreaChartImpl-CUepOhWM.js b/frontend/dist/assets/LiveAreaChartImpl-CUepOhWM.js deleted file mode 100644 index f4b0942..0000000 --- a/frontend/dist/assets/LiveAreaChartImpl-CUepOhWM.js +++ /dev/null @@ -1,61 +0,0 @@ -var Wy=Object.defineProperty;var Uy=(e,t,r)=>t in e?Wy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Hn=(e,t,r)=>Uy(e,typeof t!="symbol"?t+"":t,r);import{r as h,av as ee,aw as Ky,ax as Hy,am as Yy,ar as Gy,j as oe}from"./index-DMY9lUCb.js";import{m as Yl,d as Gl,o as Dd,e as ot,f as Vy,i as Ao,c as Vl,a as ql,b as qy,g as Tt,h as Xy}from"./string-DoZi9Vij.js";import{r as $d}from"./index-CVfMhtws.js";var Zy=["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 pu(e){if(typeof e!="string")return!1;var t=Zy;return t.includes(e)}var Qy=["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"],Jy=new Set(Qy);function Nd(e){return typeof e!="string"?!1:Jy.has(e)}function Ld(e){return typeof e=="string"&&e.startsWith("data-")}function it(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Nd(r)||Ld(r))&&(t[r]=e[r]);return t}function ia(e){if(e==null)return null;if(h.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return it(t)}return typeof e=="object"&&!Array.isArray(e)?it(e):null}function Ve(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Nd(r)||Ld(r)||pu(r))&&(t[r]=e[r]);return t}function eg(e){return e==null?null:h.isValidElement(e)?Ve(e.props):typeof e=="object"&&!Array.isArray(e)?Ve(e):null}var tg=["children","width","height","viewBox","className","style","title","desc"];function Oo(){return Oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=e.children,n=e.width,i=e.height,a=e.viewBox,o=e.className,u=e.style,l=e.title,c=e.desc,s=rg(e,tg),f=a||{width:n,height:i,x:0,y:0},d=ee("recharts-surface",o);return h.createElement("svg",Oo({},Ve(s),{className:d,width:n,height:i,style:u,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),h.createElement("title",null,l),h.createElement("desc",null,c),r)}),ig=["children","className"];function Po(){return Po=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=e.children,n=e.className,i=ag(e,ig),a=ee("recharts-layer",n);return h.createElement("g",Po({className:a},Ve(i),{ref:t}),r)}),ug=h.createContext(null);function ne(e){return function(){return e}}const So=Math.PI,Eo=2*So,er=1e-6,lg=Eo-er;function zd(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return zd;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;ier)if(!(Math.abs(f*l-c*s)>er)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let v=n-o,p=i-u,m=l*l+c*c,y=v*v+p*p,g=Math.sqrt(m),w=Math.sqrt(d),x=a*Math.tan((So-Math.acos((m+d-y)/(2*g*w)))/2),A=x/w,O=x/g;Math.abs(A-1)>er&&this._append`L${t+A*s},${r+A*f}`,this._append`A${a},${a},0,0,${+(f*v>s*p)},${this._x1=t+O*l},${this._y1=r+O*c}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),l=n*Math.sin(i),c=t+u,s=r+l,f=1^o,d=o?i-a:a-i;this._x1===null?this._append`M${c},${s}`:(Math.abs(this._x1-c)>er||Math.abs(this._y1-s)>er)&&this._append`L${c},${s}`,n&&(d<0&&(d=d%Eo+Eo),d>lg?this._append`A${n},${n},0,1,${f},${t-u},${r-l}A${n},${n},0,1,${f},${this._x1=c},${this._y1=s}`:d>er&&this._append`A${n},${n},0,${+(d>=So)},${f},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}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 Bd(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 sg(t)}function mu(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Fd(e){this._context=e}Fd.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 aa(e){return new Fd(e)}function Wd(e){return e[0]}function Ud(e){return e[1]}function Kd(e,t){var r=ne(!0),n=null,i=aa,a=null,o=Bd(u);e=typeof e=="function"?e:e===void 0?Wd:ne(e),t=typeof t=="function"?t:t===void 0?Ud:ne(t);function u(l){var c,s=(l=mu(l)).length,f,d=!1,v;for(n==null&&(a=i(v=o())),c=0;c<=s;++c)!(c=v;--p)u.point(x[p],A[p]);u.lineEnd(),u.areaEnd()}g&&(x[d]=+e(y,d,f),A[d]=+t(y,d,f),u.point(n?+n(y,d,f):x[d],r?+r(y,d,f):A[d]))}if(w)return u=null,w+""||null}function s(){return Kd().defined(i).curve(o).context(a)}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:ne(+f),n=null,c):e},c.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ne(+f),c):e},c.x1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ne(+f),c):n},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:ne(+f),r=null,c):t},c.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ne(+f),c):t},c.y1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ne(+f),c):r},c.lineX0=c.lineY0=function(){return s().x(e).y(t)},c.lineY1=function(){return s().x(e).y(r)},c.lineX1=function(){return s().x(n).y(t)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:ne(!!f),c):i},c.curve=function(f){return arguments.length?(o=f,a!=null&&(u=o(a)),c):o},c.context=function(f){return arguments.length?(f==null?a=u=null:u=o(a=f),c):a},c}class Hd{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 fg(e){return new Hd(e,!0)}function dg(e){return new Hd(e,!1)}function vi(){}function hi(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 Yd(e){this._context=e}Yd.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:hi(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:hi(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function vg(e){return new Yd(e)}function Gd(e){this._context=e}Gd.prototype={areaStart:vi,areaEnd:vi,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:hi(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hg(e){return new Gd(e)}function Vd(e){this._context=e}Vd.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:hi(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function pg(e){return new Vd(e)}function qd(e){this._context=e}qd.prototype={areaStart:vi,areaEnd:vi,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 mg(e){return new qd(e)}function Xl(e){return e<0?-1:1}function Zl(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),u=(a*i+o*n)/(n+i);return(Xl(a)+Xl(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function Ql(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ga(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,u=(a-n)/3;e._context.bezierCurveTo(n+u,i+u*t,a-u,o-u*r,a,o)}function pi(e){this._context=e}pi.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:Ga(this,this._t0,Ql(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,Ga(this,Ql(this,r=Zl(this,e,t)),r);break;default:Ga(this,this._t0,r=Zl(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function Xd(e){this._context=new Zd(e)}(Xd.prototype=Object.create(pi.prototype)).point=function(e,t){pi.prototype.point.call(this,t,e)};function Zd(e){this._context=e}Zd.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,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function yg(e){return new pi(e)}function gg(e){return new Xd(e)}function Qd(e){this._context=e}Qd.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=Jl(e),i=Jl(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[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 wg(e){return new oa(e,.5)}function xg(e){return new oa(e,0)}function Ag(e){return new oa(e,1)}function cr(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,u=a.length;r=0;)r[t]=t;return r}function Og(e,t){return e[t]}function Pg(e){const t=[];return t.key=e,t}function Sg(){var e=ne([]),t=_o,r=cr,n=Og;function i(a){var o=Array.from(e.apply(this,arguments),Pg),u,l=o.length,c=-1,s;for(const f of a)for(u=0,++c;u0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n1&&arguments[1]!==void 0?arguments[1]:kg,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function we(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{var u=r[o-1];return typeof u=="string"?i+u+a:u!==void 0?i+Ut(u)+a:i+a},"")}var He=e=>e===0?0:e>0?1:-1,ht=e=>typeof e=="number"&&e!=+e,sr=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,D=e=>(typeof e=="number"||e instanceof Number)&&!ht(e),pt=e=>D(e)||typeof e=="string",jg=0,yn=e=>{var t=++jg;return"".concat(e||"").concat(t)},Yt=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(!D(t)&&typeof t!="string")return n;var a;if(sr(t)){if(r==null)return n;var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return ht(a)&&(a=n),i&&r!=null&&a>r&&(a=r),a},tv=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;nn&&(typeof t=="function"?t(n):yr(n,t))===r)}var Oe=e=>e===null||typeof e>"u",bu=e=>Oe(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function De(e){return e!=null}function Fr(){}var nv=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,wu=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(h.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(i=>{pu(i)&&typeof r[i]=="function"&&(n[i]=(a=>r[i](r,a)))}),n},Tg=(e,t,r)=>n=>(e(t,r,n),null),Mg=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(i=>{var a=e[i];pu(i)&&typeof a=="function"&&(n||(n={}),n[i]=Tg(a,t,r))}),n};function ec(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 Dg(e){for(var t=1;t(o[u]===void 0&&n[u]!==void 0&&(o[u]=n[u]),o),r);return a}function Rg(e,t){const r=new Map;for(let n=0;nObject.prototype.propertyIsEnumerable.call(e,t))}function xu(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Ug="[object RegExp]",av="[object String]",ov="[object Number]",uv="[object Boolean]",lv="[object Arguments]",Kg="[object Symbol]",Hg="[object Date]",Yg="[object Map]",Gg="[object Set]",Vg="[object Array]",qg="[object ArrayBuffer]",Xg="[object Object]",Zg="[object DataView]",Qg="[object Uint8Array]",Jg="[object Uint8ClampedArray]",e0="[object Uint16Array]",t0="[object Uint32Array]",r0="[object Int8Array]",n0="[object Int16Array]",i0="[object Int32Array]",a0="[object Float32Array]",o0="[object Float64Array]",tc=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function u0(e){return typeof tc.Buffer<"u"&&tc.Buffer.isBuffer(e)}function l0(e,t){return nr(e,void 0,e,new Map,t)}function nr(e,t,r,n=new Map,i=void 0){const a=i==null?void 0:i(e,t,r,n);if(a!==void 0)return a;if(Co(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){const o=new Array(e.length);n.set(e,o);for(let u=0;u{}):ko(e,t,function n(i,a,o,u,l,c){const s=r(i,a,o,u,l,c);return s!==void 0?!!s:ko(i,a,n,c,!1)},new Map,!0)}function ko(e,t,r,n,i=!1){if(t===e)return!0;switch(typeof t){case"object":return f0(e,t,r,n);case"function":return Object.keys(t).length>0?ko(e,{...t},r,n,i):oi(e,t);default:return cv(e)&&i?typeof t=="string"?t==="":!0:oi(e,t)}}function f0(e,t,r,n){if(t==null)return!0;if(Array.isArray(t))return fv(e,t,r,n);if(t instanceof Map)return d0(e,t,r,n);if(t instanceof Set)return v0(e,t,r,n);const i=Object.keys(t);if(e==null||Co(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 a=0;a{})}function h0(e){return e=s0(e),t=>dv(t,e)}function p0(e,t){return l0(e,(r,n,i,a)=>{if(typeof e=="object"){if(xu(e)==="[object Object]"&&typeof e.constructor!="function"){const o={};return a.set(e,o),tt(o,e,i,a),o}switch(Object.prototype.toString.call(e)){case ov:case av:case uv:{const o=new e.constructor(e==null?void 0:e.valueOf());return tt(o,e),o}case lv:{const o={};return tt(o,e),o.length=e.length,o[Symbol.iterator]=e[Symbol.iterator],o}default:return}}})}function m0(e){return p0(e)}const y0=/^(?:0|[1-9]\d*)$/;function vv(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e=0}function hv(e){return e!=null&&typeof e!="function"&&A0(e.length)}function O0(e){return typeof e=="object"&&e!==null}function P0(e){return O0(e)&&hv(e)}function rc(e,t=iv){return P0(e)?Rg(Array.from(e),zg(x0(t),1)):[]}function S0(e,t,r){return t===!0?rc(e,r):typeof t=="function"?rc(e,t):e}var Au=h.createContext(null),E0=e=>e,le=()=>{var e=h.useContext(Au);return e?e.store.dispatch:E0},ui=()=>{},_0=()=>ui,I0=(e,t)=>e===t;function N(e){var t=h.useContext(Au),r=h.useMemo(()=>t?n=>{if(n!=null)return e(n)}:ui,[t,e]);return Ky.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:_0,t?t.store.getState:ui,t?t.store.getState:ui,r,I0)}function C0(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function k0(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 nc=e=>Array.isArray(e)?e:[e];function j0(e){const t=Array.isArray(e[0])?e[0]:e;return k0(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function T0(e,t){const r=[],{length:n}=e;for(let i=0;itypeof WeakRef>"u"?M0:WeakRef,pv=D0(),$0=0,ic=1;function Gn(){return{s:$0,v:void 0,o:null,p:null}}function N0(e){return e instanceof pv?e.deref():e}function mv(e,t={}){let r=Gn();const{resultEqualityCheck:n}=t;let i,a=0;function o(){let u=r;const{length:l}=arguments;for(let f=0,d=l;f{r=Gn(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function L0(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...i)=>{let a=0,o=0,u,l={},c=i.pop();typeof c=="object"&&(l=c,c=i.pop()),C0(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const s={...r,...l},{memoize:f,memoizeOptions:d=[],argsMemoize:v=mv,argsMemoizeOptions:p=[]}=s,m=nc(d),y=nc(p),g=j0(i),w=f(function(){return a++,c.apply(null,arguments)},...m),x=v(function(){o++;const O=T0(g,arguments);return u=w.apply(null,O),u},...y);return Object.assign(x,{resultFunc:c,memoizedResultFunc:w,dependencies:g,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>u,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:f,argsMemoize:v})};return Object.assign(n,{withTypes:()=>n}),n}var P=L0(mv);function R0(e,t=1){const r=[],n=Math.floor(t),i=(a,o)=>{for(let u=0;u{if(e!==t){const n=ac(e),i=ac(t);if(n===i&&n===0){if(et)return r==="desc"?-1:1}return r==="desc"?i-n:n-i}return 0};function yv(e){return typeof e=="symbol"||e instanceof Symbol}const B0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,F0=/^\w*$/;function W0(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||yv(e)?!0:typeof e=="string"&&(F0.test(e)||!B0.test(e))||t!=null}function U0(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,l)=>{let c=u;for(let s=0;sl==null||u==null?l:typeof u=="object"&&"key"in u?Object.hasOwn(l,u.key)?l[u.key]:i(l,u.path):typeof u=="function"?u(l):Array.isArray(u)?i(l,u):typeof l=="object"?l[u]:l,o=t.map(u=>(Array.isArray(u)&&u.length===1&&(u=u[0]),u==null||typeof u=="function"||Array.isArray(u)||W0(u)?u:{key:u,path:gu(u)}));return e.map(u=>({original:u,criteria:o.map(l=>a(l,u))})).slice().sort((u,l)=>{for(let c=0;cu.original)}function ua(e,...t){const r=t.length;return r>1&&jo(e,t[0],t[1])?t=[]:r>2&&jo(t[0],t[1],t[2])&&(t=[t[0]]),U0(e,R0(t),["asc"])}var gv=e=>e.legend.settings,K0=e=>e.legend.size,H0=e=>e.legend.payload;P([H0,gv],(e,t)=>{var r=t.itemSorter,n=e.flat(1);return r?ua(n,r):n});function Y0(e,t){return X0(e)||q0(e,t)||V0(e,t)||G0()}function G0(){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 V0(e,t){if(e){if(typeof e=="string")return oc(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)?oc(e,t):void 0}}function oc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);rVn||Math.abs(e.left-t.left)>Vn||Math.abs(e.top-t.top)>Vn||Math.abs(e.width-t.width)>Vn}function lc(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function Z0(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=h.useState({height:0,left:0,top:0,width:0}),r=Y0(t,2),n=r[0],i=r[1],a=h.useRef(null),o=h.useRef(n);o.current=n;var u=h.useCallback(l=>{if(a.current!=null&&(a.current.disconnect(),a.current=null),l!=null){var c=lc(l);if(uc(c,o.current)&&i(c),typeof ResizeObserver<"u"){var s=new ResizeObserver(()=>{var f=lc(l);uc(f,o.current)&&i(f)});s.observe(l),a.current=s}}},[...e]);return h.useEffect(()=>()=>{var l;(l=a.current)===null||l===void 0||l.disconnect()},[]),[n,u]}function be(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 Q0=typeof Symbol=="function"&&Symbol.observable||"@@observable",cc=Q0,Va=()=>Math.random().toString(36).substring(7).split("").join("."),J0={INIT:`@@redux/INIT${Va()}`,REPLACE:`@@redux/REPLACE${Va()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Va()}`},mi=J0;function Ou(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 bv(e,t,r){if(typeof e!="function")throw new Error(be(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(be(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(be(1));return r(bv)(e,t)}let n=e,i=t,a=new Map,o=a,u=0,l=!1;function c(){o===a&&(o=new Map,a.forEach((y,g)=>{o.set(g,y)}))}function s(){if(l)throw new Error(be(3));return i}function f(y){if(typeof y!="function")throw new Error(be(4));if(l)throw new Error(be(5));let g=!0;c();const w=u++;return o.set(w,y),function(){if(g){if(l)throw new Error(be(6));g=!1,c(),o.delete(w),a=null}}}function d(y){if(!Ou(y))throw new Error(be(7));if(typeof y.type>"u")throw new Error(be(8));if(typeof y.type!="string")throw new Error(be(17));if(l)throw new Error(be(9));try{l=!0,i=n(i,y)}finally{l=!1}return(a=o).forEach(w=>{w()}),y}function v(y){if(typeof y!="function")throw new Error(be(10));n=y,d({type:mi.REPLACE})}function p(){const y=f;return{subscribe(g){if(typeof g!="object"||g===null)throw new Error(be(11));function w(){const A=g;A.next&&A.next(s())}return w(),{unsubscribe:y(w)}},[cc](){return this}}}return d({type:mi.INIT}),{dispatch:d,subscribe:f,getState:s,replaceReducer:v,[cc]:p}}function eb(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:mi.INIT})>"u")throw new Error(be(12));if(typeof r(void 0,{type:mi.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(be(13))})}function wv(e){const t=Object.keys(e),r={};for(let a=0;a"u")throw u&&u.type,new Error(be(14));c[f]=p,l=l||p!==v}return l=l||n.length!==Object.keys(o).length,l?c:o}}function yi(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function tb(...e){return t=>(r,n)=>{const i=t(r,n);let a=()=>{throw new Error(be(15))};const o={getState:i.getState,dispatch:(l,...c)=>a(l,...c)},u=e.map(l=>l(o));return a=yi(...u)(i.dispatch),{...i,dispatch:a}}}function xv(e){return Ou(e)&&"type"in e&&typeof e.type=="string"}var Av=Symbol.for("immer-nothing"),sc=Symbol.for("immer-draftable"),Te=Symbol.for("immer-state");function rt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Be=Object,Mr=Be.getPrototypeOf,gi="constructor",la="prototype",To="configurable",bi="enumerable",li="writable",gn="value",It=e=>!!e&&!!e[Te];function at(e){var t;return e?Ov(e)||sa(e)||!!e[sc]||!!((t=e[gi])!=null&&t[sc])||fa(e)||da(e):!1}var rb=Be[la][gi].toString(),fc=new WeakMap;function Ov(e){if(!e||!Pu(e))return!1;const t=Mr(e);if(t===null||t===Be[la])return!0;const r=Be.hasOwnProperty.call(t,gi)&&t[gi];if(r===Object)return!0;if(!Ir(r))return!1;let n=fc.get(r);return n===void 0&&(n=Function.toString.call(r),fc.set(r,n)),n===rb}function ca(e,t,r=!0){kn(e)===0?(r?Reflect.ownKeys(e):Be.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((n,i)=>t(i,n,e))}function kn(e){const t=e[Te];return t?t.type_:sa(e)?1:fa(e)?2:da(e)?3:0}var dc=(e,t,r=kn(e))=>r===2?e.has(t):Be[la].hasOwnProperty.call(e,t),Mo=(e,t,r=kn(e))=>r===2?e.get(t):e[t],wi=(e,t,r,n=kn(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function nb(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var sa=Array.isArray,fa=e=>e instanceof Map,da=e=>e instanceof Set,Pu=e=>typeof e=="object",Ir=e=>typeof e=="function",qa=e=>typeof e=="boolean";function ib(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var xt=e=>e.copy_||e.base_,Su=e=>e.modified_?e.copy_:e.base_;function Do(e,t){if(fa(e))return new Map(e);if(da(e))return new Set(e);if(sa(e))return Array[la].slice.call(e);const r=Ov(e);if(t===!0||t==="class_only"&&!r){const n=Be.getOwnPropertyDescriptors(e);delete n[Te];let i=Reflect.ownKeys(n);for(let a=0;a1&&Be.defineProperties(e,{set:qn,add:qn,clear:qn,delete:qn}),Be.freeze(e),t&&ca(e,(r,n)=>{Eu(n,!0)},!1)),e}function ab(){rt(2)}var qn={[gn]:ab};function va(e){return e===null||!Pu(e)?!0:Be.isFrozen(e)}var xi="MapSet",$o="Patches",vc="ArrayMethods",Pv={};function fr(e){const t=Pv[e];return t||rt(0,e),t}var hc=e=>!!Pv[e],bn,Sv=()=>bn,ob=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:hc(xi)?fr(xi):void 0,arrayMethodsPlugin_:hc(vc)?fr(vc):void 0});function pc(e,t){t&&(e.patchPlugin_=fr($o),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function No(e){Lo(e),e.drafts_.forEach(ub),e.drafts_=null}function Lo(e){e===bn&&(bn=e.parent_)}var mc=e=>bn=ob(bn,e);function ub(e){const t=e[Te];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function yc(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[Te].modified_&&(No(t),rt(4)),at(e)&&(e=gc(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(r[Te].base_,e,t)}else e=gc(t,r);return lb(t,e,!0),No(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Av?e:void 0}function gc(e,t){if(va(t))return t;const r=t[Te];if(!r)return Ai(t,e.handledSet_,e);if(!ha(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);Iv(r,e)}return r.copy_}function lb(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Eu(t,r)}function Ev(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var ha=(e,t)=>e.scope_===t,cb=[];function _v(e,t,r,n){const i=xt(e),a=e.type_;if(n!==void 0&&Mo(i,n,a)===t){wi(i,n,r,a);return}if(!e.draftLocations_){const u=e.draftLocations_=new Map;ca(i,(l,c)=>{if(It(c)){const s=u.get(c)||[];s.push(l),u.set(c,s)}})}const o=e.draftLocations_.get(t)??cb;for(const u of o)wi(i,u,r,a)}function sb(e,t,r){e.callbacks_.push(function(i){var u;const a=t;if(!a||!ha(a,i))return;(u=i.mapSetPlugin_)==null||u.fixSetContents(a);const o=Su(a);_v(e,a.draft_??a,o,r),Iv(a,i)})}function Iv(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 a=i.getPath(e);a&&i.generatePatches_(e,a,t)}Ev(e)}}function fb(e,t,r){const{scope_:n}=e;if(It(r)){const i=r[Te];ha(i,n)&&i.callbacks_.push(function(){ci(e);const o=Su(i);_v(e,r,o,t)})}else at(r)&&e.callbacks_.push(function(){const a=xt(e);e.type_===3?a.has(r)&&Ai(r,n.handledSet_,n):Mo(a,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Ai(Mo(e.copy_,t,e.type_),n.handledSet_,n)})}function Ai(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||It(e)||t.has(e)||!at(e)||va(e)||(t.add(e),ca(e,(n,i)=>{if(It(i)){const a=i[Te];if(ha(a,r)){const o=Su(a);wi(e,n,o,e.type_),Ev(a)}}else at(i)&&Ai(i,t,r)})),e}function db(e,t){const r=sa(e),n={type_:r?1:0,scope_:t?t.scope_:Sv(),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,a=Oi;r&&(i=[n],a=wn);const{revoke:o,proxy:u}=Proxy.revocable(i,a);return n.draft_=u,n.revoke_=o,[u,n]}var Oi={get(e,t){if(t===Te)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=xt(e);if(!dc(i,t,e.type_))return vb(e,i,t);const a=i[t];if(e.finalized_||!at(a)||n&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&ib(t))return a;if(a===Xa(e.base_,t)){ci(e);const o=e.type_===1?+t:t,u=zo(e.scope_,a,e,o);return e.copy_[o]=u}return a},has(e,t){return t in xt(e)},ownKeys(e){return Reflect.ownKeys(xt(e))},set(e,t,r){const n=Cv(xt(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=Xa(xt(e),t),a=i==null?void 0:i[Te];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(nb(r,i)&&(r!==void 0||dc(e.base_,t,e.type_)))return!0;ci(e),Ro(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),fb(e,t,r)),!0},deleteProperty(e,t){return ci(e),Xa(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Ro(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=xt(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[li]:!0,[To]:e.type_!==1||t!=="length",[bi]:n[bi],[gn]:r[t]}},defineProperty(){rt(11)},getPrototypeOf(e){return Mr(e.base_)},setPrototypeOf(){rt(12)}},wn={};for(let e in Oi){let t=Oi[e];wn[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}wn.deleteProperty=function(e,t){return wn.set.call(this,e,t,void 0)};wn.set=function(e,t,r){return Oi.set.call(this,e[0],t,r,e[0])};function Xa(e,t){const r=e[Te];return(r?xt(r):e)[t]}function vb(e,t,r){var i;const n=Cv(t,r);return n?gn in n?n[gn]:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function Cv(e,t){if(!(t in e))return;let r=Mr(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Mr(r)}}function Ro(e){e.modified_||(e.modified_=!0,e.parent_&&Ro(e.parent_))}function ci(e){e.copy_||(e.assigned_=new Map,e.copy_=Do(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var hb=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,n,i)=>{if(Ir(r)&&!Ir(n)){const o=n;n=r;const u=this;return function(c=o,...s){return u.produce(c,f=>n.call(this,f,...s))}}Ir(n)||rt(6),i!==void 0&&!Ir(i)&&rt(7);let a;if(at(r)){const o=mc(this),u=zo(o,r,void 0);let l=!0;try{a=n(u),l=!1}finally{l?No(o):Lo(o)}return pc(o,i),yc(a,o)}else if(!r||!Pu(r)){if(a=n(r),a===void 0&&(a=r),a===Av&&(a=void 0),this.autoFreeze_&&Eu(a,!0),i){const o=[],u=[];fr($o).generateReplacementPatches_(r,a,{patches_:o,inversePatches_:u}),i(o,u)}return a}else rt(1,r)},this.produceWithPatches=(r,n)=>{if(Ir(r))return(u,...l)=>this.produceWithPatches(u,c=>r(c,...l));let i,a;return[this.produce(r,n,(u,l)=>{i=u,a=l}),i,a]},qa(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),qa(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),qa(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){at(t)||rt(8),It(t)&&(t=Ye(t));const r=mc(this),n=zo(r,t,void 0);return n[Te].isManual_=!0,Lo(r),n}finishDraft(t,r){const n=t&&t[Te];(!n||!n.isManual_)&&rt(9);const{scope_:i}=n;return pc(i,r),yc(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 a=r[n];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}n>-1&&(r=r.slice(n+1));const i=fr($o).applyPatches_;return It(t)?i(t,r):this.produce(t,a=>i(a,r))}};function zo(e,t,r,n){const[i,a]=fa(t)?fr(xi).proxyMap_(t,r):da(t)?fr(xi).proxySet_(t,r):db(t,r);return((r==null?void 0:r.scope_)??Sv()).drafts_.push(i),a.callbacks_=(r==null?void 0:r.callbacks_)??[],a.key_=n,r&&n!==void 0?sb(r,a,n):a.callbacks_.push(function(l){var s;(s=l.mapSetPlugin_)==null||s.fixSetContents(a);const{patchPlugin_:c}=l;a.modified_&&c&&c.generatePatches_(a,[],l)}),i}function Ye(e){return It(e)||rt(10,e),kv(e)}function kv(e){if(!at(e)||va(e))return e;const t=e[Te];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Do(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Do(e,!0);return ca(r,(i,a)=>{wi(r,i,kv(a))},n),t&&(t.finalized_=!1),r}var pb=new hb,jv=pb.produce;function Tv(e){return({dispatch:r,getState:n})=>i=>a=>typeof a=="function"?a(r,n,e):i(a)}var mb=Tv(),yb=Tv,gb=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?yi:yi.apply(null,arguments)};function We(e,t){function r(...n){if(t){let i=t(...n);if(!i)throw new Error(Fe(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=>xv(n)&&n.type===e,r}var Mv=class fn extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,fn.prototype)}static get[Symbol.species](){return fn}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new fn(...t[0].concat(this)):new fn(...t.concat(this))}};function bc(e){return at(e)?jv(e,()=>{}):e}function Xn(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function bb(e){return typeof e=="boolean"}var wb=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new Mv;return r&&(bb(r)?o.push(mb):o.push(yb(r.extraArgument))),o},Dv="RTK_autoBatch",Q=()=>e=>({payload:e,meta:{[Dv]:!0}}),wc=e=>t=>{setTimeout(t,e)},xb=(e,t)=>r=>{let n=!1;const i=()=>{n||(n=!0,cancelAnimationFrame(a),clearTimeout(o),r())},a=e(i),o=setTimeout(i,t)},$v=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let i=!0,a=!1,o=!1;const u=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?xb(window.requestAnimationFrame,100):wc(10):e.type==="callback"?e.queueNotification:wc(e.timeout),c=()=>{o=!1,a&&(a=!1,u.forEach(s=>s()))};return Object.assign({},n,{subscribe(s){const f=()=>i&&s(),d=n.subscribe(f);return u.add(s),()=>{d(),u.delete(s)}},dispatch(s){var f;try{return i=!((f=s==null?void 0:s.meta)!=null&&f[Dv]),a=!i,a&&(o||(o=!0,l(c))),n.dispatch(s)}finally{i=!0}}})},Ab=e=>function(r){const{autoBatch:n=!0}=r??{};let i=new Mv(e);return n&&i.push($v(typeof n=="object"?n:void 0)),i};function Ob(e){const t=wb(),{reducer:r=void 0,middleware:n,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let u;if(typeof r=="function")u=r;else if(Ou(r))u=wv(r);else throw new Error(Fe(1));let l;typeof n=="function"?l=n(t):l=t();let c=yi;i&&(c=gb({trace:!1,...typeof i=="object"&&i}));const s=tb(...l),f=Ab(s);let d=typeof o=="function"?o(f):f();const v=c(...d);return bv(u,a,v)}function Nv(e){const t={},r=[];let n;const i={addCase(a,o){const u=typeof a=="string"?a:a.type;if(!u)throw new Error(Fe(28));if(u in t)throw new Error(Fe(29));return t[u]=o,i},addAsyncThunk(a,o){return o.pending&&(t[a.pending.type]=o.pending),o.rejected&&(t[a.rejected.type]=o.rejected),o.fulfilled&&(t[a.fulfilled.type]=o.fulfilled),o.settled&&r.push({matcher:a.settled,reducer:o.settled}),i},addMatcher(a,o){return r.push({matcher:a,reducer:o}),i},addDefaultCase(a){return n=a,i}};return e(i),[t,r,n]}function Pb(e){return typeof e=="function"}function Sb(e,t){let[r,n,i]=Nv(t),a;if(Pb(e))a=()=>bc(e());else{const u=bc(e);a=()=>u}function o(u=a(),l){let c=[r[l.type],...n.filter(({matcher:s})=>s(l)).map(({reducer:s})=>s)];return c.filter(s=>!!s).length===0&&(c=[i]),c.reduce((s,f)=>{if(f)if(It(s)){const v=f(s,l);return v===void 0?s:v}else{if(at(s))return jv(s,d=>f(d,l));{const d=f(s,l);if(d===void 0){if(s===null)return s;throw Error("A case reducer on a non-draftable value must not return undefined")}return d}}return s},u)}return o.getInitialState=a,o}var Eb="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",_b=(e=21)=>{let t="",r=e;for(;r--;)t+=Eb[Math.random()*64|0];return t},Ib=Symbol.for("rtk-slice-createasyncthunk");function Cb(e,t){return`${e}/${t}`}function kb({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[Ib];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error(Fe(11));const u=(typeof i.reducers=="function"?i.reducers(Tb()):i.reducers)||{},l=Object.keys(u),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(A,O){const b=typeof A=="string"?A:A.type;if(!b)throw new Error(Fe(12));if(b in c.sliceCaseReducersByType)throw new Error(Fe(13));return c.sliceCaseReducersByType[b]=O,s},addMatcher(A,O){return c.sliceMatchers.push({matcher:A,reducer:O}),s},exposeAction(A,O){return c.actionCreators[A]=O,s},exposeCaseReducer(A,O){return c.sliceCaseReducersByName[A]=O,s}};l.forEach(A=>{const O=u[A],b={reducerName:A,type:Cb(a,A),createNotation:typeof i.reducers=="function"};Db(O)?Nb(b,O,s,t):Mb(b,O,s)});function f(){const[A={},O=[],b=void 0]=typeof i.extraReducers=="function"?Nv(i.extraReducers):[i.extraReducers],S={...A,...c.sliceCaseReducersByType};return Sb(i.initialState,_=>{for(let I in S)_.addCase(I,S[I]);for(let I of c.sliceMatchers)_.addMatcher(I.matcher,I.reducer);for(let I of O)_.addMatcher(I.matcher,I.reducer);b&&_.addDefaultCase(b)})}const d=A=>A,v=new Map,p=new WeakMap;let m;function y(A,O){return m||(m=f()),m(A,O)}function g(){return m||(m=f()),m.getInitialState()}function w(A,O=!1){function b(_){let I=_[A];return typeof I>"u"&&O&&(I=Xn(p,b,g)),I}function S(_=d){const I=Xn(v,O,()=>new WeakMap);return Xn(I,_,()=>{const C={};for(const[j,E]of Object.entries(i.selectors??{}))C[j]=jb(E,_,()=>Xn(p,_,g),O);return C})}return{reducerPath:A,getSelectors:S,get selectors(){return S(b)},selectSlice:b}}const x={name:a,reducer:y,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:g,...w(o),injectInto(A,{reducerPath:O,...b}={}){const S=O??o;return A.inject({reducerPath:S,reducer:y},b),{...x,...w(S,!0)}}};return x}}function jb(e,t,r,n){function i(a,...o){let u=t(a);return typeof u>"u"&&n&&(u=r()),e(u,...o)}return i.unwrapped=e,i}var Ce=kb();function Tb(){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 Mb({type:e,reducerName:t,createNotation:r},n,i){let a,o;if("reducer"in n){if(r&&!$b(n))throw new Error(Fe(17));a=n.reducer,o=n.prepare}else a=n;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?We(e,o):We(e))}function Db(e){return e._reducerDefinitionType==="asyncThunk"}function $b(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Nb({type:e,reducerName:t},r,n,i){if(!i)throw new Error(Fe(18));const{payloadCreator:a,fulfilled:o,pending:u,rejected:l,settled:c,options:s}=r,f=i(e,a,s);n.exposeAction(t,f),o&&n.addCase(f.fulfilled,o),u&&n.addCase(f.pending,u),l&&n.addCase(f.rejected,l),c&&n.addMatcher(f.settled,c),n.exposeCaseReducer(t,{fulfilled:o||Zn,pending:u||Zn,rejected:l||Zn,settled:c||Zn})}function Zn(){}var Lb="task",Lv="listener",Rv="completed",_u="cancelled",Rb=`task-${_u}`,zb=`task-${Rv}`,Bo=`${Lv}-${_u}`,Bb=`${Lv}-${Rv}`,pa=class{constructor(e){Hn(this,"code");Hn(this,"name","TaskAbortError");Hn(this,"message");this.code=e,this.message=`${Lb} ${_u} (reason: ${e})`}},Iu=(e,t)=>{if(typeof e!="function")throw new TypeError(Fe(32))},Pi=()=>{},zv=(e,t=Pi)=>(e.catch(t),e),Bv=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),ur=e=>{if(e.aborted)throw new pa(e.reason)};function Fv(e,t){let r=Pi;return new Promise((n,i)=>{const a=()=>i(new pa(e.reason));if(e.aborted){a();return}r=Bv(e,a),t.finally(()=>r()).then(n,i)}).finally(()=>{r=Pi})}var Fb=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof pa?"cancelled":"rejected",error:r}}finally{t==null||t()}},Si=e=>t=>zv(Fv(e,t).then(r=>(ur(e),r))),Wv=e=>{const t=Si(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:jr}=Object,xc={},ma="listenerMiddleware",Wb=(e,t)=>{const r=n=>Bv(e,()=>n.abort(e.reason));return(n,i)=>{Iu(n);const a=new AbortController;r(a);const o=Fb(async()=>{ur(e),ur(a.signal);const u=await n({pause:Si(a.signal),delay:Wv(a.signal),signal:a.signal});return ur(a.signal),u},()=>a.abort(zb));return i!=null&&i.autoJoin&&t.push(o.catch(Pi)),{result:Si(e)(o),cancel(){a.abort(Rb)}}}},Ub=(e,t)=>{const r=async(n,i)=>{ur(t);let a=()=>{};const u=[new Promise((l,c)=>{let s=e({predicate:n,effect:(f,d)=>{d.unsubscribe(),l([f,d.getState(),d.getOriginalState()])}});a=()=>{s(),c()}})];i!=null&&u.push(new Promise(l=>setTimeout(l,i,null)));try{const l=await Fv(t,Promise.race(u));return ur(t),l}finally{a()}};return((n,i)=>zv(r(n,i)))},Uv=e=>{let{type:t,actionCreator:r,matcher:n,predicate:i,effect:a}=e;if(t)i=We(t).match;else if(r)t=r.type,i=r.match;else if(n)i=n;else if(!i)throw new Error(Fe(21));return Iu(a),{predicate:i,type:t,effect:a}},Kv=jr(e=>{const{type:t,predicate:r,effect:n}=Uv(e);return{id:_b(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Fe(22))}}},{withTypes:()=>Kv}),Ac=(e,t)=>{const{type:r,effect:n,predicate:i}=Uv(t);return Array.from(e.values()).find(a=>(typeof r=="string"?a.type===r:a.predicate===i)&&a.effect===n)},Fo=e=>{e.pending.forEach(t=>{t.abort(Bo)})},Kb=(e,t)=>()=>{for(const r of t.keys())Fo(r);e.clear()},Oc=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},Hv=jr(We(`${ma}/add`),{withTypes:()=>Hv}),Hb=We(`${ma}/removeAll`),Yv=jr(We(`${ma}/remove`),{withTypes:()=>Yv}),Yb=(...e)=>{console.error(`${ma}/error`,...e)},jn=(e={})=>{const t=new Map,r=new Map,n=v=>{const p=r.get(v)??0;r.set(v,p+1)},i=v=>{const p=r.get(v)??1;p===1?r.delete(v):r.set(v,p-1)},{extra:a,onError:o=Yb}=e;Iu(o);const u=v=>(v.unsubscribe=()=>t.delete(v.id),t.set(v.id,v),p=>{v.unsubscribe(),p!=null&&p.cancelActive&&Fo(v)}),l=(v=>{const p=Ac(t,v)??Kv(v);return u(p)});jr(l,{withTypes:()=>l});const c=v=>{const p=Ac(t,v);return p&&(p.unsubscribe(),v.cancelActive&&Fo(p)),!!p};jr(c,{withTypes:()=>c});const s=async(v,p,m,y)=>{const g=new AbortController,w=Ub(l,g.signal),x=[];try{v.pending.add(g),n(v),await Promise.resolve(v.effect(p,jr({},m,{getOriginalState:y,condition:(A,O)=>w(A,O).then(Boolean),take:w,delay:Wv(g.signal),pause:Si(g.signal),extra:a,signal:g.signal,fork:Wb(g.signal,x),unsubscribe:v.unsubscribe,subscribe:()=>{t.set(v.id,v)},cancelActiveListeners:()=>{v.pending.forEach((A,O,b)=>{A!==g&&(A.abort(Bo),b.delete(A))})},cancel:()=>{g.abort(Bo),v.pending.delete(g)},throwIfCancelled:()=>{ur(g.signal)}})))}catch(A){A instanceof pa||Oc(o,A,{raisedBy:"effect"})}finally{await Promise.all(x),g.abort(Bb),i(v),v.pending.delete(g)}},f=Kb(t,r);return{middleware:v=>p=>m=>{if(!xv(m))return p(m);if(Hv.match(m))return l(m.payload);if(Hb.match(m)){f();return}if(Yv.match(m))return c(m.payload);let y=v.getState();const g=()=>{if(y===xc)throw new Error(Fe(23));return y};let w;try{if(w=p(m),t.size>0){const x=v.getState(),A=Array.from(t.values());for(const O of A){let b=!1;try{b=O.predicate(m,x,y)}catch(S){b=!1,Oc(o,S,{raisedBy:"predicate"})}b&&s(O,m,v,g)}}}finally{y=xc}return w},startListening:l,stopListening:c,clearListeners:f}};function Fe(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 Gb={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},Gv=Ce({name:"chartLayout",initialState:Gb,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,a;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=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),ya=Gv.actions,Vb=ya.setMargin,qb=ya.setLayout,Xb=ya.setChartSize,Zb=ya.setScale,Qb=Gv.reducer;function Vv(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function U(e){return Number.isFinite(e)}function mt(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function Pc(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{if(t&&r){var n=r.width,i=r.height,a=t.align,o=t.verticalAlign,u=t.layout;if((u==="vertical"||u==="horizontal"&&o==="middle")&&a!=="center"&&D(e[a]))return Cr(Cr({},e),{},{[a]:e[a]+(n||0)});if((u==="horizontal"||u==="vertical"&&a==="center")&&o!=="middle"&&D(e[o]))return Cr(Cr({},e),{},{[o]:e[o]+(i||0)})}return e},bt=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",qv=(e,t,r,n)=>{if(n)return e.map(u=>u.coordinate);var i,a,o=e.map(u=>(u.coordinate===t&&(i=!0),u.coordinate===r&&(a=!0),u.coordinate));return i||o.push(t),a||o.push(r),o},Xv=(e,t,r)=>{if(!e)return null;var n=e.duplicateDomain,i=e.type,a=e.range,o=e.scale,u=e.realScaleType,l=e.isCategorical,c=e.categoricalDomain,s=e.tickCount,f=e.ticks,d=e.niceTicks,v=e.axisType;if(!o)return null;var p=u==="scaleBand"&&o.bandwidth?o.bandwidth()/2:2,m=i==="category"&&o.bandwidth?o.bandwidth()/p:0;if(m=v==="angleAxis"&&a&&a.length>=2?He(a[0]-a[1])*2*m:m,f||d){var y=(f||d||[]).map((g,w)=>{var x=n?n.indexOf(g):g,A=o.map(x);return U(A)?{coordinate:A+m,value:g,offset:m,index:w}:null}).filter(De);return y}return l&&c?c.map((g,w)=>{var x=o.map(g);return U(x)?{coordinate:x+m,value:g,index:w,offset:m}:null}).filter(De):o.ticks&&s!=null?o.ticks(s).map((g,w)=>{var x=o.map(g);return U(x)?{coordinate:x+m,value:g,index:w,offset:m}:null}).filter(De):o.domain().map((g,w)=>{var x=o.map(g);return U(x)?{coordinate:x+m,value:n?n[g]:g,index:w,offset:m}:null}).filter(De)},nw=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?(c[0]=a,a+=d,c[1]=a):(c[0]=o,o+=d,c[1]=o)}}}},iw=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?(l[0]=a,a+=c,l[1]=a):(l[0]=0,l[1]=0)}}}},aw={sign:nw,expand:Eg,none:cr,silhouette:_g,wiggle:Ig,positive:iw},ow=(e,t,r)=>{var n,i=(n=aw[r])!==null&&n!==void 0?n:cr,a=Sg().keys(t).value((u,l)=>Number(he(u,l,0))).order(_o).offset(i),o=a(e);return o.forEach((u,l)=>{u.forEach((c,s)=>{var f=he(e[s],t[l],0);Array.isArray(f)&&f.length===2&&D(f[0])&&D(f[1])&&(c[0]=f[0],c[1]=f[1])})}),o};function uw(e){return e==null?void 0:String(e)}function Sc(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Oe(i[t.dataKey])){var u=rv(r,"value",i[t.dataKey]);if(u)return u.coordinate+n/2}return r!=null&&r[a]?r[a].coordinate+n/2:null}var l=he(i,Oe(o)?t.dataKey:o),c=t.scale.map(l);return D(c)?c:null}var lw=e=>{var t=e.flat(2).filter(D);return[Math.min(...t),Math.max(...t)]},cw=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],sw=(e,t,r)=>{if(!(e==null||Object.keys(e).length===0))return cw(Object.keys(e).reduce((n,i)=>{var a=e[i];if(!a)return n;var o=a.stackedData,u=o.reduce((l,c)=>{var s=Vv(c,t,r),f=lw(s);return!U(f[0])||!U(f[1])?l:[Math.min(l[0],f[0]),Math.max(l[1],f[1])]},[1/0,-1/0]);return[Math.min(u[0],n[0]),Math.max(u[1],n[1])]},[1/0,-1/0]))},Ec=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,_c=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Ei=(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=ua(t,s=>s.coordinate),a=1/0,o=1,u=i.length;o{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},dw=(e,t)=>t==="centric"?e.angle:e.radius,Mt=e=>e.layout.width,Dt=e=>e.layout.height,vw=e=>e.layout.scale,Qv=e=>e.layout.margin,ga=P(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),ba=P(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),hw="data-recharts-item-index",pw="data-recharts-item-id",Tn=60;function Cc(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 Qn(e){for(var t=1;te.brush.height;function ww(e){var t=ba(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:Tn;return r+i}return r},0)}function xw(e){var t=ba(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var i=typeof n.width=="number"?n.width:Tn;return r+i}return r},0)}function Aw(e){var t=ga(e);return t.reduce((r,n)=>n.orientation==="top"&&!n.mirror&&!n.hide?r+n.height:r,0)}function Ow(e){var t=ga(e);return t.reduce((r,n)=>n.orientation==="bottom"&&!n.mirror&&!n.hide?r+n.height:r,0)}var Pe=P([Mt,Dt,Qv,bw,ww,xw,Aw,Ow,gv,K0],(e,t,r,n,i,a,o,u,l,c)=>{var s={left:(r.left||0)+i,right:(r.right||0)+a},f={top:(r.top||0)+o,bottom:(r.bottom||0)+u},d=Qn(Qn({},f),s),v=d.bottom;d.bottom+=n,d=rw(d,l,c);var p=e-d.left-d.right,m=t-d.top-d.bottom;return Qn(Qn({brushBottom:v},d),{},{width:Math.max(p,0),height:Math.max(m,0)})}),Pw=P(Pe,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),Jv=P(Mt,Dt,(e,t)=>({x:0,y:0,width:e,height:t})),Sw=h.createContext(null),$e=()=>h.useContext(Sw)!=null,wa=e=>e.brush,xa=P([wa,Pe,Qv],(e,t,r)=>({height:e.height,x:D(e.x)?e.x:t.left,y:D(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:D(e.width)?e.width:t.width}));function Ew(e,t,{signal:r,edges:n}={}){let i,a=null;const o=n!=null&&n.includes("leading"),u=n==null||n.includes("trailing"),l=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},c=()=>{u&&l(),v()};let s=null;const f=()=>{s!=null&&clearTimeout(s),s=setTimeout(()=>{s=null,c()},t)},d=()=>{s!==null&&(clearTimeout(s),s=null)},v=()=>{d(),i=void 0,a=null},p=()=>{l()},m=function(...y){if(r!=null&&r.aborted)return;i=this,a=y;const g=s==null;f(),o&&g&&l()};return m.schedule=f,m.cancel=v,m.flush=p,r==null||r.addEventListener("abort",v,{once:!0}),m}function _w(e,t=0,r={}){typeof r!="object"&&(r={});const{leading:n=!1,trailing:i=!0,maxWait:a}=r,o=Array(2);n&&(o[0]="leading"),i&&(o[1]="trailing");let u,l=null;const c=Ew(function(...d){u=e.apply(this,d),l=null},t,{edges:o}),s=function(...d){return a!=null&&(l===null&&(l=Date.now()),Date.now()-l>=a)?(u=e.apply(this,d),l=Date.now(),c.cancel(),c.schedule(),u):(c.apply(this,d),u)},f=()=>(c.flush(),u);return s.cancel=c.cancel,s.flush=f,s}function Iw(e,t=0,r={}){const{leading:n=!0,trailing:i=!0}=r;return _w(e,t,{leading:n,maxWait:t,trailing:i})}var _i=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai[o++]))}},ft={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},eh=(e,t,r)=>{var n=r.width,i=n===void 0?ft.width:n,a=r.height,o=a===void 0?ft.height:a,u=r.aspect,l=r.maxHeight,c=sr(i)?e:Number(i),s=sr(o)?t:Number(o);return u&&u>0&&(c?s=c/u:s&&(c=s*u),l&&s!=null&&s>l&&(s=l)),{calculatedWidth:c,calculatedHeight:s}},Cw={width:0,height:0,overflow:"visible"},kw={width:0,overflowX:"visible"},jw={height:0,overflowY:"visible"},Tw={},Mw=e=>{var t=e.width,r=e.height,n=sr(t),i=sr(r);return n&&i?Cw:n?kw:i?jw:Tw};function Dw(e){var t=e.width,r=e.height,n=e.aspect,i=t,a=r;return i===void 0&&a===void 0?(i=ft.width,a=ft.height):i===void 0?i=n&&n>0?void 0:ft.width:a===void 0&&(a=n&&n>0?void 0:ft.height),{width:i,height:a}}var $w=["aspect","initialDimension","width","height","minWidth","minHeight","maxHeight","children","debounce","id","className","onResize","style"];function Ii(){return Ii=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 Yw(i)?h.createElement(th.Provider,{value:i},t):null}var Cu=()=>h.useContext(th),Gw=h.forwardRef((e,t)=>{var r=e.aspect,n=e.initialDimension,i=n===void 0?ft.initialDimension:n,a=e.width,o=e.height,u=e.minWidth,l=u===void 0?ft.minWidth:u,c=e.minHeight,s=e.maxHeight,f=e.children,d=e.debounce,v=d===void 0?ft.debounce:d,p=e.id,m=e.className,y=e.onResize,g=e.style,w=g===void 0?{}:g,x=Kw(e,$w),A=h.useRef(null),O=h.useRef();O.current=y,h.useImperativeHandle(t,()=>A.current);var b=h.useState({containerWidth:i.width,containerHeight:i.height}),S=zw(b,2),_=S[0],I=S[1],C=h.useCallback((H,Y)=>{I(B=>{var q=Math.round(H),W=Math.round(Y);return B.containerWidth===q&&B.containerHeight===W?B:{containerWidth:q,containerHeight:W}})},[]);h.useEffect(()=>{if(A.current==null||typeof ResizeObserver>"u")return Fr;var H=Se=>{var ge,ae=Se[0];if(ae!=null){var Ne=ae.contentRect,Le=Ne.width,Je=Ne.height;C(Le,Je),(ge=O.current)===null||ge===void 0||ge.call(O,Le,Je)}};v>0&&(H=Iw(H,v,{trailing:!0,leading:!1}));var Y=new ResizeObserver(H),B=A.current.getBoundingClientRect(),q=B.width,W=B.height;return C(q,W),Y.observe(A.current),()=>{Y.disconnect()}},[C,v]);var j=_.containerWidth,E=_.containerHeight;_i(!r||r>0,"The aspect(%s) must be greater than zero.",r);var R=eh(j,E,{width:a,height:o,aspect:r,maxHeight:s}),$=R.calculatedWidth,V=R.calculatedHeight;return _i(j<0||E<0||$!=null&&$>0||V!=null&&V>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.`,$,V,a,o,l,c,r),h.createElement("div",Ii({id:p?"".concat(p):void 0,className:ee("recharts-responsive-container",m),style:jc(jc({},w),{},{width:a,height:o,minWidth:l,minHeight:c,maxHeight:s}),ref:A},x),h.createElement("div",{style:Mw({width:a,height:o})},h.createElement(rh,{width:$,height:V},f)))}),Vw=h.forwardRef((e,t)=>{var r=Cu();if(mt(r.width)&&mt(r.height))return e.children;var n=Dw({width:e.width,height:e.height,aspect:e.aspect}),i=n.width,a=n.height,o=eh(void 0,void 0,{width:i,height:a,aspect:e.aspect,maxHeight:e.maxHeight}),u=o.calculatedWidth,l=o.calculatedHeight;return D(u)&&D(l)?h.createElement(rh,{width:u,height:l},e.children):h.createElement(Gw,Ii({},e,{width:i,height:a,ref:t}))});function ku(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 Aa=()=>{var e,t=$e(),r=N(Pw),n=N(xa),i=(e=N(wa))===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}},qw={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},nh=()=>{var e;return(e=N(Pe))!==null&&e!==void 0?e:qw},ih=()=>N(Mt),ah=()=>N(Dt),re=e=>e.layout.layoutType,Wr=()=>N(re),ju=()=>{var e=Wr();if(e==="horizontal"||e==="vertical")return e},oh=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Xw=()=>{var e=Wr();return e!==void 0},Mn=e=>{var t=le(),r=$e(),n=e.width,i=e.height,a=Cu(),o=n,u=i;return a&&(o=a.width>0?a.width:n,u=a.height>0?a.height:i),h.useEffect(()=>{!r&&mt(o)&&mt(u)&&t(Xb({width:o,height:u}))},[t,r,o,u]),null},uh=Symbol.for("immer-nothing"),Mc=Symbol.for("immer-draftable"),Ue=Symbol.for("immer-state");function nt(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var xn=Object.getPrototypeOf;function Dr(e){return!!e&&!!e[Ue]}function dr(e){var t;return e?lh(e)||Array.isArray(e)||!!e[Mc]||!!((t=e.constructor)!=null&&t[Mc])||Dn(e)||Pa(e):!1}var Zw=Object.prototype.constructor.toString(),Dc=new WeakMap;function lh(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=Dc.get(r);return n===void 0&&(n=Function.toString.call(r),Dc.set(r,n)),n===Zw}function Ci(e,t,r=!0){Oa(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 Oa(e){const t=e[Ue];return t?t.type_:Array.isArray(e)?1:Dn(e)?2:Pa(e)?3:0}function Wo(e,t){return Oa(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ch(e,t,r){const n=Oa(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Qw(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Dn(e){return e instanceof Map}function Pa(e){return e instanceof Set}function tr(e){return e.copy_||e.base_}function Uo(e,t){if(Dn(e))return new Map(e);if(Pa(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=lh(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[Ue];let i=Reflect.ownKeys(n);for(let a=0;a1&&Object.defineProperties(e,{set:Jn,add:Jn,clear:Jn,delete:Jn}),Object.freeze(e),t&&Object.values(e).forEach(r=>Tu(r,!0))),e}function Jw(){nt(2)}var Jn={value:Jw};function Sa(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var ex={};function vr(e){const t=ex[e];return t||nt(0,e),t}var An;function sh(){return An}function tx(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function $c(e,t){t&&(vr("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ko(e){Ho(e),e.drafts_.forEach(rx),e.drafts_=null}function Ho(e){e===An&&(An=e.parent_)}function Nc(e){return An=tx(An,e)}function rx(e){const t=e[Ue];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Lc(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[Ue].modified_&&(Ko(t),nt(4)),dr(e)&&(e=ki(t,e),t.parent_||ji(t,e)),t.patches_&&vr("Patches").generateReplacementPatches_(r[Ue].base_,e,t.patches_,t.inversePatches_)):e=ki(t,r,[]),Ko(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==uh?e:void 0}function ki(e,t,r){if(Sa(t))return t;const n=e.immer_.shouldUseStrictIteration(),i=t[Ue];if(!i)return Ci(t,(a,o)=>Rc(e,i,t,a,o,r),n),t;if(i.scope_!==e)return t;if(!i.modified_)return ji(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let o=a,u=!1;i.type_===3&&(o=new Set(a),a.clear(),u=!0),Ci(o,(l,c)=>Rc(e,i,a,l,c,r,u),n),ji(e,a,!1),r&&e.patches_&&vr("Patches").generatePatches_(i,r,e.patches_,e.inversePatches_)}return i.copy_}function Rc(e,t,r,n,i,a,o){if(i==null||typeof i!="object"&&!o)return;const u=Sa(i);if(!(u&&!o)){if(Dr(i)){const l=a&&t&&t.type_!==3&&!Wo(t.assigned_,n)?a.concat(n):void 0,c=ki(e,i,l);if(ch(r,n,c),Dr(c))e.canAutoFreeze_=!1;else return}else o&&r.add(i);if(dr(i)&&!u){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===i&&u)return;ki(e,i),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Dn(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&ji(e,i)}}}function ji(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Tu(t,r)}function nx(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:sh(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=n,a=Mu;r&&(i=[n],a=On);const{revoke:o,proxy:u}=Proxy.revocable(i,a);return n.draft_=u,n.revoke_=o,u}var Mu={get(e,t){if(t===Ue)return e;const r=tr(e);if(!Wo(r,t))return ix(e,r,t);const n=r[t];return e.finalized_||!dr(n)?n:n===Za(e.base_,t)?(Qa(e),e.copy_[t]=Go(n,e)):n},has(e,t){return t in tr(e)},ownKeys(e){return Reflect.ownKeys(tr(e))},set(e,t,r){const n=fh(tr(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const i=Za(tr(e),t),a=i==null?void 0:i[Ue];if(a&&a.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Qw(r,i)&&(r!==void 0||Wo(e.base_,t)))return!0;Qa(e),Yo(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 Za(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Qa(e),Yo(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=tr(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){nt(11)},getPrototypeOf(e){return xn(e.base_)},setPrototypeOf(){nt(12)}},On={};Ci(Mu,(e,t)=>{On[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});On.deleteProperty=function(e,t){return On.set.call(this,e,t,void 0)};On.set=function(e,t,r){return Mu.set.call(this,e[0],t,r,e[0])};function Za(e,t){const r=e[Ue];return(r?tr(r):e)[t]}function ix(e,t,r){var i;const n=fh(t,r);return n?"value"in n?n.value:(i=n.get)==null?void 0:i.call(e.draft_):void 0}function fh(e,t){if(!(t in e))return;let r=xn(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=xn(r)}}function Yo(e){e.modified_||(e.modified_=!0,e.parent_&&Yo(e.parent_))}function Qa(e){e.copy_||(e.copy_=Uo(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var ax=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 a=r;r=t;const o=this;return function(l=a,...c){return o.produce(l,s=>r.call(this,s,...c))}}typeof r!="function"&&nt(6),n!==void 0&&typeof n!="function"&&nt(7);let i;if(dr(t)){const a=Nc(this),o=Go(t,void 0);let u=!0;try{i=r(o),u=!1}finally{u?Ko(a):Ho(a)}return $c(a,n),Lc(i,a)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===uh&&(i=void 0),this.autoFreeze_&&Tu(i,!0),n){const a=[],o=[];vr("Patches").generateReplacementPatches_(t,i,a,o),n(a,o)}return i}else nt(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(o,...u)=>this.produceWithPatches(o,l=>t(l,...u));let n,i;return[this.produce(t,r,(o,u)=>{n=o,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){dr(e)||nt(8),Dr(e)&&(e=ox(e));const t=Nc(this),r=Go(e,void 0);return r[Ue].isManual_=!0,Ho(t),r}finishDraft(e,t){const r=e&&e[Ue];(!r||!r.isManual_)&&nt(9);const{scope_:n}=r;return $c(n,t),Lc(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=vr("Patches").applyPatches_;return Dr(e)?n(e,t):this.produce(e,i=>n(i,t))}};function Go(e,t){const r=Dn(e)?vr("MapSet").proxyMap_(e,t):Pa(e)?vr("MapSet").proxySet_(e,t):nx(e,t);return(t?t.scope_:sh()).drafts_.push(r),r}function ox(e){return Dr(e)||nt(10,e),dh(e)}function dh(e){if(!dr(e)||Sa(e))return e;const t=e[Ue];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Uo(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Uo(e,!0);return Ci(r,(i,a)=>{ch(r,i,dh(a))},n),t&&(t.finalized_=!1),r}var ux=new ax;ux.produce;var lx={settings:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemSorter:"value"},size:{width:0,height:0},payload:[]},vh=Ce({name:"legend",initialState:lx,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:Q()},replaceLegendPayload:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,a=Ye(e).payload.indexOf(n);a>-1&&(e.payload[a]=i)},prepare:Q()},removeLegendPayload:{reducer(e,t){var r=Ye(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:Q()}}}),$n=vh.actions;$n.setLegendSize;$n.setLegendSettings;var cx=$n.addLegendPayload,sx=$n.replaceLegendPayload,fx=$n.removeLegendPayload,dx=vh.reducer,Ja={exports:{}},eo={};/** - * @license React - * use-sync-external-store-with-selector.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var zc;function vx(){if(zc)return eo;zc=1;var e=Hy();function t(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}var r=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,i=e.useRef,a=e.useEffect,o=e.useMemo,u=e.useDebugValue;return eo.useSyncExternalStoreWithSelector=function(l,c,s,f,d){var v=i(null);if(v.current===null){var p={hasValue:!1,value:null};v.current=p}else p=v.current;v=o(function(){function y(O){if(!g){if(g=!0,w=O,O=f(O),d!==void 0&&p.hasValue){var b=p.value;if(d(b,O))return x=b}return x=O}if(b=x,r(w,O))return b;var S=f(O);return d!==void 0&&d(b,S)?(w=O,b):(w=O,x=S)}var g=!1,w,x,A=s===void 0?null:s;return[function(){return y(c())},A===null?void 0:function(){return y(A())}]},[c,s,f,d]);var m=n(l,v[0],v[1]);return a(function(){p.hasValue=!0,p.value=m},[m]),u(m),m},eo}var Bc;function hx(){return Bc||(Bc=1,Ja.exports=vx()),Ja.exports}hx();function px(e){e()}function mx(){let e=null,t=null;return{clear(){e=null,t=null},notify(){px(()=>{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 Fc={notify(){},get:()=>[]};function yx(e,t){let r,n=Fc,i=0,a=!1;function o(m){s();const y=n.subscribe(m);let g=!1;return()=>{g||(g=!0,y(),f())}}function u(){n.notify()}function l(){p.onStateChange&&p.onStateChange()}function c(){return a}function s(){i++,r||(r=e.subscribe(l),n=mx())}function f(){i--,r&&i===0&&(r(),r=void 0,n.clear(),n=Fc)}function d(){a||(a=!0,s())}function v(){a&&(a=!1,f())}const p={addNestedSub:o,notifyNestedSubs:u,handleChangeWrapper:l,isSubscribed:c,trySubscribe:d,tryUnsubscribe:v,getListeners:()=>n};return p}var gx=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",bx=gx(),wx=()=>typeof navigator<"u"&&navigator.product==="ReactNative",xx=wx(),Ax=()=>bx||xx?h.useLayoutEffect:h.useEffect,Ox=Ax();function Wc(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Px(e,t){if(Wc(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 l=yx(i);return{store:i,subscription:l,getServerState:n?()=>n:void 0}},[i,n]),o=h.useMemo(()=>i.getState(),[i]);Ox(()=>{const{subscription:l}=a;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),o!==i.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[a,o]);const u=r||Ex;return h.createElement(u.Provider,{value:a},t)}var Ix=_x,Cx=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function kx(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Ea(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var n of r)if(Cx.has(n)){if(e[n]==null&&t[n]==null)continue;if(!Px(e[n],t[n]))return!1}else if(!kx(e[n],t[n]))return!1;return!0}function Vo(){return Vo=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?xr.separator:t,n=e.contentStyle,i=e.itemStyle,a=e.labelStyle,o=a===void 0?xr.labelStyle:a,u=e.payload,l=e.formatter,c=e.itemSorter,s=e.wrapperClassName,f=e.labelClassName,d=e.label,v=e.labelFormatter,p=e.accessibilityLayer,m=p===void 0?xr.accessibilityLayer:p,y=()=>{if(u&&u.length){var _={padding:0,margin:0},I=Bx(u,c),C=I.map((j,E)=>{if(!j||j.type==="none")return null;var R=j.formatter||l||zx,$=j.value,V=j.name,H=$,Y=V;if(R){var B=R($,V,j,E,u);if(Array.isArray(B)){var q=Dx(B,2);H=q[0],Y=q[1]}else if(B!=null)H=B;else return null}var W=en(en({},xr.itemStyle),{},{color:j.color||xr.itemStyle.color},i);return h.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(E),style:W},pt(Y)?h.createElement("span",{className:"recharts-tooltip-item-name"},Y):null,pt(Y)?h.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,h.createElement("span",{className:"recharts-tooltip-item-value"},H),h.createElement("span",{className:"recharts-tooltip-item-unit"},j.unit||""))});return h.createElement("ul",{className:"recharts-tooltip-item-list",style:_},C)}return null},g=en(en({},xr.contentStyle),n),w=en({margin:0},o),x=!Oe(d),A=x?d:"",O=ee("recharts-default-tooltip",s),b=ee("recharts-tooltip-label",f);x&&v&&u!==void 0&&u!==null&&(A=v(d,u));var S=m?{role:"status","aria-live":"assertive"}:{};return h.createElement("div",Vo({className:O,style:g},S),h.createElement("p",{className:b,style:w},h.isValidElement(A)?A:"".concat(A)),y())},tn="recharts-tooltip-wrapper",Wx={visibility:"hidden"};function Ux(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return ee(tn,{["".concat(tn,"-right")]:D(r)&&t&&D(t.x)&&r>=t.x,["".concat(tn,"-left")]:D(r)&&t&&D(t.x)&&r=t.y,["".concat(tn,"-top")]:D(n)&&t&&D(t.y)&&n0?i:0),f=r[n]+i;if(t[n])return o[n]?s:f;var d=l[n];if(d==null)return 0;if(o[n]){var v=s,p=d;return vy?Math.max(s,d):Math.max(f,d)}function Kx(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 Hx(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTop,i=e.offsetLeft,a=e.position,o=e.reverseDirection,u=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,s,f,d;return u.height>0&&u.width>0&&r?(f=Hc({allowEscapeViewBox:t,coordinate:r,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:u.width,viewBox:c,viewBoxDimension:c.width}),d=Hc({allowEscapeViewBox:t,coordinate:r,key:"y",offset:n,position:a,reverseDirection:o,tooltipDimension:u.height,viewBox:c,viewBoxDimension:c.height}),s=Kx({translateX:f,translateY:d,useTranslate3d:l})):s=Wx,{cssProperties:s,cssClasses:Ux({translateX:f,translateY:d,coordinate:r})}}var Yx=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Nn={isSsr:Yx()};function Gx(e,t){return Zx(e)||Xx(e,t)||qx(e,t)||Vx()}function Vx(){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 qx(e,t){if(e){if(typeof e=="string")return Yc(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)?Yc(e,t):void 0}}function Yc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);rNn.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches),t=Gx(e,2),r=t[0],n=t[1];return h.useEffect(()=>{if(window.matchMedia){var i=window.matchMedia("(prefers-reduced-motion: reduce)"),a=()=>{n(i.matches)};return i.addEventListener("change",a),()=>{i.removeEventListener("change",a)}}},[]),r}function Gc(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 Ar(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}})),c=tA(l,2),s=c[0],f=c[1];h.useEffect(()=>{var g=w=>{if(w.key==="Escape"){var x,A,O,b;f({dismissed:!0,dismissedAtCoordinate:{x:(x=(A=e.coordinate)===null||A===void 0?void 0:A.x)!==null&&x!==void 0?x:0,y:(O=(b=e.coordinate)===null||b===void 0?void 0:b.y)!==null&&O!==void 0?O:0}})}};return document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(r=e.coordinate)===null||r===void 0?void 0:r.y]),s.dismissed&&(((n=(i=e.coordinate)===null||i===void 0?void 0:i.x)!==null&&n!==void 0?n:0)!==s.dismissedAtCoordinate.x||((a=(o=e.coordinate)===null||o===void 0?void 0:o.y)!==null&&a!==void 0?a:0)!==s.dismissedAtCoordinate.y)&&f(Ar(Ar({},s),{},{dismissed:!1}));var d=Hx({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}),v=d.cssClasses,p=d.cssProperties,m=e.hasPortalFromProps?{}:Ar(Ar({transition:oA({prefersReducedMotion:u,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},p),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),y=Ar(Ar({},m),{},{visibility:!s.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return h.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:v,style:y,ref:e.innerRef},e.children)}var lA=h.memo(uA),ph=()=>{var e;return(e=N(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function qo(){return qo=Object.assign?Object.assign.bind():function(e){for(var t=1;tU(e.x)&&U(e.y),Qc=e=>e.base!=null&&Ti(e.base)&&Ti(e),rn=e=>e.x,nn=e=>e.y,dA=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(bu(e));if((r==="curveMonotone"||r==="curveBump")&&t){var n=Zc["".concat(r).concat(t==="vertical"?"Y":"X")];if(n)return n}return Zc[r]||aa},Jc={connectNulls:!1,type:"linear"},vA=e=>{var t=e.type,r=t===void 0?Jc.type:t,n=e.points,i=n===void 0?[]:n,a=e.baseLine,o=e.layout,u=e.connectNulls,l=u===void 0?Jc.connectNulls:u,c=dA(r,o),s=l?i.filter(Ti):i;if(Array.isArray(a)){var f,d=i.map((g,w)=>Xc(Xc({},g),{},{base:a[w]}));o==="vertical"?f=Yn().y(nn).x1(rn).x0(g=>g.base.x):f=Yn().x(rn).y1(nn).y0(g=>g.base.y);var v=f.defined(Qc).curve(c),p=l?d.filter(Qc):d;return v(p)}var m;o==="vertical"&&D(a)?m=Yn().y(nn).x1(rn).x0(a):D(a)?m=Yn().x(rn).y1(nn).y0(a):m=Kd().x(rn).y(nn);var y=m.defined(Ti).curve(c);return y(s)},si=e=>{var t=e.className,r=e.points,n=e.path,i=e.pathRef,a=Wr();if((!r||!r.length)&&!n)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},u=r&&r.length?vA(o):n;return h.createElement("path",qo({},it(e),wu(e),{className:ee("recharts-curve",t),d:u===null?void 0:u,ref:i}))},hA=["x","y","top","left","width","height","className"];function Xo(){return Xo=Object.assign?Object.assign.bind():function(e){for(var t=1;t"M".concat(e,",").concat(i,"v").concat(n,"M").concat(a,",").concat(t,"h").concat(r),AA=e=>{var t=e.x,r=t===void 0?0:t,n=e.y,i=n===void 0?0:n,a=e.top,o=a===void 0?0:a,u=e.left,l=u===void 0?0:u,c=e.width,s=c===void 0?0:c,f=e.height,d=f===void 0?0:f,v=e.className,p=bA(e,hA),m=pA({x:r,y:i,top:o,left:l,width:s,height:d},p);return!D(r)||!D(i)||!D(s)||!D(d)||!D(o)||!D(l)?null:h.createElement("path",Xo({},Ve(m),{className:ee("recharts-cross",v),d:xA(r,i,s,d,o,l)}))};function OA(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 Mi=1e-4,mh=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],yh=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),ts=(e,t)=>r=>{var n=mh(e,t);return yh(n,r)},PA=(e,t)=>r=>{var n=mh(e,t),i=[...n.map((a,o)=>a*o).slice(1),0];return yh(i,r)},SA=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(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},EA=function(){for(var t=arguments.length,r=new Array(t),n=0;n{var i=ts(e,r),a=ts(t,n),o=PA(e,r),u=c=>c>1?1:c<0?0:c,l=c=>{for(var s=c>1?1:c,f=s,d=0;d<8;++d){var v=i(f)-s,p=o(f);if(Math.abs(v-s)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,u=o===void 0?16.67:o,l=1,c=[0],s=0,f=0,d=1e4,v=0;v{var w,x,A;if(g<=0)return 0;if(g>=1)return l;var O=g*y,b=Math.floor(O),S=O-b;return((w=c[b])!==null&&w!==void 0?w:0)+(((x=c[b+1])!==null&&x!==void 0?x:0)-((A=c[b])!==null&&A!==void 0?A:0))*S}},CA=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return rs(e);case"spring":return IA();default:if(e.split("(")[0]==="cubic-bezier")return rs(e)}return typeof e=="function"?e:null},kA=(e,t,r)=>{var n,i=a=>{var o=t.tick(a);if(t.getState()==="active"){if(r(t.getInterpolated()),t.getProgress()===1){t.complete(),n=void 0;return}n=e.setTimeout(i,o);return}n=e.setTimeout(i,o)};return n=e.setTimeout(i,0),()=>{var a;return(a=n)===null||a===void 0?void 0:a()}},gh=h.createContext(kA);gh.Provider;function jA(e){var t=h.useContext(gh);return h.useMemo(()=>e??t,[e,t])}function TA(e,t,r){return(t=MA(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function MA(e){var t=DA(e,"string");return typeof t=="symbol"?t:t+""}function DA(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 ns="init",is="pending",as="active",$A="completed";function no(e){return Math.max(0,e)}class NA{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(t){var r;TA(this,"state",ns),this.animationId=t.animationId,this.onAnimationEnd=t.onAnimationEnd,this.animationDuration=no(t.animationDuration),this.animationBegin=no(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()===ns)return this.state=is,this.beginStartedTime=t,this.animationBegin;if(this.getState()===is){if(this.beginStartedTime==null)throw new Error;var r=t-this.beginStartedTime;return r>=this.animationBegin?(this.state=as,this.animationStartedTime=t,this.nextAnimationUpdate(0)):no(this.animationBegin-r)}if(this.getState()===as){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=$A}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}}class LA extends NA{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(Ot(this.getFrom(),this.getTo(),this.getProgress()))}}class RA{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),i=null,a=o=>{o-n>=r?t(o):i=requestAnimationFrame(a)};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function zA(e,t){return UA(e)||WA(e,t)||FA(e,t)||BA()}function BA(){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 FA(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);r{},onAnimationStart:()=>{}},us=0,io=1;function bh(e){var t=Ze(e,KA),r=t.animationId,n=t.isActive,i=t.canBegin,a=t.duration,o=t.easing,u=t.begin,l=t.onAnimationEnd,c=t.onAnimationStart,s=t.children,f=hh(),d=n==="auto"?!Nn.isSsr&&!f:n,v=jA(t.animationController),p=h.useState(d?us:io),m=zA(p,2),y=m[0],g=m[1];return h.useEffect(()=>{d||g(io)},[d]),h.useEffect(()=>{var w=CA(o);if(!d||!i||w==null)return Fr;var x=new RA,A=new LA({animationId:r,easing:w,animationDuration:a,animationBegin:u,onAnimationStart:c,onAnimationEnd:l,from:us,to:io});return v(x,A,g)},[v,r,d,i,a,o,u,c,l]),s(Number(y))}function wh(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=h.useRef(yn(t)),n=h.useRef(e);return n.current!==e&&(r.current=yn(t),n.current=e),r.current}var HA=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),YA=(e,t,r)=>e.map(n=>"".concat(HA(n)," ").concat(t,"ms ").concat(r)).join(","),GA=["radius"],VA=["radius"],ls,cs,ss,fs,ds,vs,hs,ps,ms,ys;function gs(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 bs(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{var a=Ut(r),o=Ut(n),u=Math.min(Math.abs(a)/2,Math.abs(o)/2),l=o>=0?1:-1,c=a>=0?1:-1,s=o>=0&&a>=0||o<0&&a<0?1:0,f;if(u>0&&Array.isArray(i)){for(var d=[0,0,0,0],v=0,p=4;vu?u:y}f=we(ls||(ls=lt(["M",",",""])),e,t+l*d[0]),d[0]>0&&(f+=we(cs||(cs=lt(["A ",",",",0,0,",",",",",""])),d[0],d[0],s,e+c*d[0],t)),f+=we(ss||(ss=lt(["L ",",",""])),e+r-c*d[1],t),d[1]>0&&(f+=we(fs||(fs=lt(["A ",",",",0,0,",`, - `,",",""])),d[1],d[1],s,e+r,t+l*d[1])),f+=we(ds||(ds=lt(["L ",",",""])),e+r,t+n-l*d[2]),d[2]>0&&(f+=we(vs||(vs=lt(["A ",",",",0,0,",`, - `,",",""])),d[2],d[2],s,e+r-c*d[2],t+n)),f+=we(hs||(hs=lt(["L ",",",""])),e+c*d[3],t+n),d[3]>0&&(f+=we(ps||(ps=lt(["A ",",",",0,0,",`, - `,",",""])),d[3],d[3],s,e,t+n-l*d[3])),f+="Z"}else if(u>0&&i===+i&&i>0){var g=Math.min(u,i);f=we(ms||(ms=lt(["M ",",",` - A `,",",",0,0,",",",",",` - L `,",",` - A `,",",",0,0,",",",",",` - L `,",",` - A `,",",",0,0,",",",",",` - L `,",",` - A `,",",",0,0,",",",","," Z"])),e,t+l*g,g,g,s,e+c*g,t,e+r-c*g,t,g,g,s,e+r,t+l*g,e+r,t+n-l*g,g,g,s,e+r-c*g,t+n,e+c*g,t+n,g,g,s,e,t+n-l*g)}else f=we(ys||(ys=lt(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return f},Os={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},i1=e=>{var t=Ze(e,Os),r=h.useRef(null),n=h.useState(-1),i=JA(n,2),a=i[0],o=i[1];h.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var B=r.current.getTotalLength();B&&o(B)}catch{}},[]);var u=t.x,l=t.y,c=t.width,s=t.height,f=t.radius,d=t.className,v=t.animationEasing,p=t.animationDuration,m=t.animationBegin,y=t.isAnimationActive,g=t.isUpdateAnimationActive,w=h.useRef(c),x=h.useRef(s),A=h.useRef(u),O=h.useRef(l),b=h.useMemo(()=>({x:u,y:l,width:c,height:s,radius:f}),[u,l,c,s,f]),S=wh(b,"rectangle-");if(u!==+u||l!==+l||c!==+c||s!==+s||c===0||s===0)return null;var _=ee("recharts-rectangle",d);if(!g){var I=Ve(t);I.radius;var C=ws(I,GA);return h.createElement("path",Di({},C,{x:Ut(u),y:Ut(l),width:Ut(c),height:Ut(s),radius:typeof f=="number"?f:void 0,className:_,d:As(u,l,c,s,f)}))}var j=w.current,E=x.current,R=A.current,$=O.current,V="0px ".concat(a===-1?1:a,"px"),H="".concat(a,"px ").concat(a,"px"),Y=YA(["strokeDasharray"],p,typeof v=="string"?v:Os.animationEasing);return h.createElement(bh,{animationId:S,key:S,canBegin:a>0,duration:p,easing:v,isActive:g,begin:m},B=>{var q=Ot(j,c,B),W=Ot(E,s,B),Se=Ot(R,u,B),ge=Ot($,l,B);r.current&&(w.current=q,x.current=W,A.current=Se,O.current=ge);var ae;y?B>0?ae={transition:Y,strokeDasharray:H}:ae={strokeDasharray:V}:ae={strokeDasharray:H};var Ne=Ve(t);Ne.radius;var Le=ws(Ne,VA);return h.createElement("path",Di({},Le,{radius:typeof f=="number"?f:void 0,className:_,d:As(Se,ge,q,W,f),ref:r,style:bs(bs({},ae),t.style)}))})};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 Ss(e){for(var t=1;te*180/Math.PI,Ae=(e,t,r,n)=>({x:e+Math.cos(-$i*n)*r,y:t+Math.sin(-$i*n)*r}),c1=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},s1=(e,t)=>{var r=e.x,n=e.y,i=t.x,a=t.y;return Math.sqrt((r-i)**2+(n-a)**2)},f1=(e,t)=>{var r=e.x,n=e.y,i=t.cx,a=t.cy,o=s1({x:r,y:n},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var u=(r-i)/o,l=Math.acos(u);return n>a&&(l=2*Math.PI-l),{radius:o,angle:l1(l),angleInRadian:l}},d1=e=>{var t=e.startAngle,r=e.endAngle,n=Math.floor(t/360),i=Math.floor(r/360),a=Math.min(n,i);return{startAngle:t-a*360,endAngle:r-a*360}},v1=(e,t)=>{var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return e+o*360},h1=(e,t)=>{var r=e.relativeX,n=e.relativeY,i=f1({x:r,y:n},t),a=i.radius,o=i.angle,u=t.innerRadius,l=t.outerRadius;if(al||a===0)return null;var c=d1(t),s=c.startAngle,f=c.endAngle,d=o,v;if(s<=f){for(;d>f;)d-=360;for(;d=s&&d<=f}else{for(;d>s;)d-=360;for(;d=f&&d<=s}return v?Ss(Ss({},t),{},{radius:a,angle:v1(d,t)}):null};function xh(e){var t=e.cx,r=e.cy,n=e.radius,i=e.startAngle,a=e.endAngle,o=Ae(t,r,n,i),u=Ae(t,r,n,a);return{points:[o,u],cx:t,cy:r,radius:n,startAngle:i,endAngle:a}}var Es,_s,Is,Cs,ks,js,Ts;function Zo(){return Zo=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=He(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},ei=e=>{var t=e.cx,r=e.cy,n=e.radius,i=e.angle,a=e.sign,o=e.isExternal,u=e.cornerRadius,l=e.cornerIsExternal,c=u*(o?1:-1)+n,s=Math.asin(u/c)/$i,f=l?i:i+a*s,d=Ae(t,r,c,f),v=Ae(t,r,n,f),p=l?i-a*s:i,m=Ae(t,r,c*Math.cos(s*$i),p);return{center:d,circleTangency:v,lineTangency:m,theta:s}},Ah=e=>{var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,a=e.startAngle,o=e.endAngle,u=p1(a,o),l=a+u,c=Ae(t,r,i,a),s=Ae(t,r,i,l),f=we(Es||(Es=ir(["M ",",",` - A `,",",`,0, - `,",",`, - `,",",` - `])),c.x,c.y,i,i,+(Math.abs(u)>180),+(a>l),s.x,s.y);if(n>0){var d=Ae(t,r,n,a),v=Ae(t,r,n,l);f+=we(_s||(_s=ir(["L ",",",` - A `,",",`,0, - `,",",`, - `,","," Z"])),v.x,v.y,n,n,+(Math.abs(u)>180),+(a<=l),d.x,d.y)}else f+=we(Is||(Is=ir(["L ",","," Z"])),t,r);return f},m1=e=>{var t=e.cx,r=e.cy,n=e.innerRadius,i=e.outerRadius,a=e.cornerRadius,o=e.forceCornerRadius,u=e.cornerIsExternal,l=e.startAngle,c=e.endAngle,s=He(c-l),f=ei({cx:t,cy:r,radius:i,angle:l,sign:s,cornerRadius:a,cornerIsExternal:u}),d=f.circleTangency,v=f.lineTangency,p=f.theta,m=ei({cx:t,cy:r,radius:i,angle:c,sign:-s,cornerRadius:a,cornerIsExternal:u}),y=m.circleTangency,g=m.lineTangency,w=m.theta,x=u?Math.abs(l-c):Math.abs(l-c)-p-w;if(x<0)return o?we(Cs||(Cs=ir(["M ",",",` - a`,",",",0,0,1,",`,0 - a`,",",",0,0,1,",`,0 - `])),v.x,v.y,a,a,a*2,a,a,-a*2):Ah({cx:t,cy:r,innerRadius:n,outerRadius:i,startAngle:l,endAngle:c});var A=we(ks||(ks=ir(["M ",",",` - A`,",",",0,0,",",",",",` - A`,",",",0,",",",",",",",` - A`,",",",0,0,",",",",",` - `])),v.x,v.y,a,a,+(s<0),d.x,d.y,i,i,+(x>180),+(s<0),y.x,y.y,a,a,+(s<0),g.x,g.y);if(n>0){var O=ei({cx:t,cy:r,radius:n,angle:l,sign:s,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),b=O.circleTangency,S=O.lineTangency,_=O.theta,I=ei({cx:t,cy:r,radius:n,angle:c,sign:-s,isExternal:!0,cornerRadius:a,cornerIsExternal:u}),C=I.circleTangency,j=I.lineTangency,E=I.theta,R=u?Math.abs(l-c):Math.abs(l-c)-_-E;if(R<0&&a===0)return"".concat(A,"L").concat(t,",").concat(r,"Z");A+=we(js||(js=ir(["L",",",` - A`,",",",0,0,",",",",",` - A`,",",",0,",",",",",",",` - A`,",",",0,0,",",",",","Z"])),j.x,j.y,a,a,+(s<0),C.x,C.y,n,n,+(R>180),+(s>0),b.x,b.y,a,a,+(s<0),S.x,S.y)}else A+=we(Ts||(Ts=ir(["L",",","Z"])),t,r);return A},y1={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},g1=e=>{var t=Ze(e,y1),r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,u=t.forceCornerRadius,l=t.cornerIsExternal,c=t.startAngle,s=t.endAngle,f=t.className;if(a0&&Math.abs(c-s)<360?m=m1({cx:r,cy:n,innerRadius:i,outerRadius:a,cornerRadius:Math.min(p,v/2),forceCornerRadius:u,cornerIsExternal:l,startAngle:c,endAngle:s}):m=Ah({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:c,endAngle:s}),h.createElement("path",Zo({},Ve(t),{className:d,d:m}))};function b1(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(nv(t)){if(e==="centric"){var n=t.cx,i=t.cy,a=t.innerRadius,o=t.outerRadius,u=t.angle,l=Ae(n,i,a,u),c=Ae(n,i,o,u);return[{x:l.x,y:l.y},{x:c.x,y:c.y}]}return xh(t)}}function w1(e){return yv(e)?NaN:Number(e)}function ao(e){return e?(e=w1(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function Oh(e,t,r){r&&typeof r!="number"&&jo(e,t,r)&&(t=r=void 0),e=ao(e),t===void 0?(t=e,e=0):t=ao(t),r=r===void 0?ee.chartData,Du=P([ut],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),_a=(e,t,r,n)=>n?Du(e):ut(e),x1=(e,t,r)=>r?Du(e):ut(e),A1=P([_a],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});P([Du],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});var O1=P([ut],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});function $u(e,t){return _1(e)||E1(e,t)||S1(e,t)||P1()}function P1(){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 S1(e,t){if(e){if(typeof e=="string")return Ms(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)?Ms(e,t):void 0}}function Ms(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};M.decimalPlaces=M.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*J;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};M.dividedBy=M.div=function(e){return Et(this,new this.constructor(e))};M.dividedToIntegerBy=M.idiv=function(e){var t=this,r=t.constructor;return Z(Et(t,new r(e),0,1),r.precision)};M.equals=M.eq=function(e){return!this.cmp(e)};M.exponent=function(){return ue(this)};M.greaterThan=M.gt=function(e){return this.cmp(e)>0};M.greaterThanOrEqualTo=M.gte=function(e){return this.cmp(e)>=0};M.isInteger=M.isint=function(){return this.e>this.d.length-2};M.isNegative=M.isneg=function(){return this.s<0};M.isPositive=M.ispos=function(){return this.s>0};M.isZero=function(){return this.s===0};M.lessThan=M.lt=function(e){return this.cmp(e)<0};M.lessThanOrEqualTo=M.lte=function(e){return this.cmp(e)<1};M.logarithm=M.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(ze))throw Error(Xe+"NaN");if(r.s<1)throw Error(Xe+(r.s?"NaN":"-Infinity"));return r.eq(ze)?new n(0):(te=!1,t=Et(Pn(r,a),Pn(e,a),a),te=!0,Z(t,i))};M.minus=M.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Ih(t,e):Eh(t,(e.s=-e.s,e))};M.modulo=M.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Xe+"NaN");return r.s?(te=!1,t=Et(r,e,0,1).times(e),te=!0,r.minus(t)):Z(new n(r),i)};M.naturalExponential=M.exp=function(){return _h(this)};M.naturalLogarithm=M.ln=function(){return Pn(this)};M.negated=M.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};M.plus=M.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Eh(t,e):Ih(t,(e.s=-e.s,e))};M.precision=M.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(lr+e);if(t=ue(i)+1,n=i.d.length-1,r=n*J+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};M.squareRoot=M.sqrt=function(){var e,t,r,n,i,a,o,u=this,l=u.constructor;if(u.s<1){if(!u.s)return new l(0);throw Error(Xe+"NaN")}for(e=ue(u),te=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=dt(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Kr((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 l(t)):n=new l(i.toString()),r=l.precision,i=o=r+3;;)if(a=n,n=a.plus(Et(u,a,o+2)).times(.5),dt(a.d).slice(0,o)===(t=dt(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Z(a,r+1,0),a.times(a).eq(u)){n=a;break}}else if(t!="9999")break;o+=4}return te=!0,Z(n,r)};M.times=M.mul=function(e){var t,r,n,i,a,o,u,l,c,s=this,f=s.constructor,d=s.d,v=(e=new f(e)).d;if(!s.s||!e.s)return new f(0);for(e.s*=s.s,r=s.e+e.e,l=d.length,c=v.length,l=0;){for(t=0,i=l+n;i>n;)u=a[i]+v[n]*d[i-n-1]+t,a[i--]=u%ve|0,t=u/ve|0;a[i]=(a[i]+t)%ve|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,te?Z(e,f.precision):e};M.toDecimalPlaces=M.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(yt(e,0,Ur),t===void 0?t=n.rounding:yt(t,0,8),Z(r,e+ue(r)+1,t))};M.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=hr(n,!0):(yt(e,0,Ur),t===void 0?t=i.rounding:yt(t,0,8),n=Z(new i(n),e+1,t),r=hr(n,!0,e+1)),r};M.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?hr(i):(yt(e,0,Ur),t===void 0?t=a.rounding:yt(t,0,8),n=Z(new a(i),e+ue(i)+1,t),r=hr(n.abs(),!1,e+ue(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};M.toInteger=M.toint=function(){var e=this,t=e.constructor;return Z(new t(e),ue(e)+1,t.rounding)};M.toNumber=function(){return+this};M.toPower=M.pow=function(e){var t,r,n,i,a,o,u=this,l=u.constructor,c=12,s=+(e=new l(e));if(!e.s)return new l(ze);if(u=new l(u),!u.s){if(e.s<1)throw Error(Xe+"Infinity");return u}if(u.eq(ze))return u;if(n=l.precision,e.eq(ze))return Z(u,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=u.s,o){if((r=s<0?-s:s)<=Sh){for(i=new l(ze),t=Math.ceil(n/J+4),te=!1;r%2&&(i=i.times(u),Ns(i.d,t)),r=Kr(r/2),r!==0;)u=u.times(u),Ns(u.d,t);return te=!0,e.s<0?new l(ze).div(i):Z(i,n)}}else if(a<0)throw Error(Xe+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,te=!1,i=e.times(Pn(u,n+c)),te=!0,i=_h(i),i.s=a,i};M.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=ue(i),n=hr(i,r<=a.toExpNeg||r>=a.toExpPos)):(yt(e,1,Ur),t===void 0?t=a.rounding:yt(t,0,8),i=Z(new a(i),e,t),r=ue(i),n=hr(i,e<=r||r<=a.toExpNeg,e)),n};M.toSignificantDigits=M.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(yt(e,1,Ur),t===void 0?t=n.rounding:yt(t,0,8)),Z(new n(r),e,t)};M.toString=M.valueOf=M.val=M.toJSON=M[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=ue(e),r=e.constructor;return hr(e,t<=r.toExpNeg||t>=r.toExpPos)};function Eh(e,t){var r,n,i,a,o,u,l,c,s=e.constructor,f=s.precision;if(!e.s||!t.s)return t.s||(t=new s(e)),te?Z(t,f):t;if(l=e.d,c=t.d,o=e.e,i=t.e,l=l.slice(),a=o-i,a){for(a<0?(n=l,a=-a,u=c.length):(n=c,i=o,u=l.length),o=Math.ceil(f/J),u=o>u?o+1:u+1,a>u&&(a=u,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(u=l.length,a=c.length,u-a<0&&(a=u,n=c,c=l,l=n),r=0;a;)r=(l[--a]=l[a]+c[a]+r)/ve|0,l[a]%=ve;for(r&&(l.unshift(r),++i),u=l.length;l[--u]==0;)l.pop();return t.d=l,t.e=i,te?Z(t,f):t}function yt(e,t,r){if(e!==~~e||er)throw Error(lr+e)}function dt(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(u=l=0;ui[u]?1:-1;break}return l}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var u,l,c,s,f,d,v,p,m,y,g,w,x,A,O,b,S,_,I=n.constructor,C=n.s==i.s?1:-1,j=n.d,E=i.d;if(!n.s)return new I(n);if(!i.s)throw Error(Xe+"Division by zero");for(l=n.e-i.e,S=E.length,O=j.length,v=new I(C),p=v.d=[],c=0;E[c]==(j[c]||0);)++c;if(E[c]>(j[c]||0)&&--l,a==null?w=a=I.precision:o?w=a+(ue(n)-ue(i))+1:w=a,w<0)return new I(0);if(w=w/J+2|0,c=0,S==1)for(s=0,E=E[0],w++;(c1&&(E=e(E,s),j=e(j,s),S=E.length,O=j.length),A=S,m=j.slice(0,S),y=m.length;y=ve/2&&++b;do s=0,u=t(E,m,S,y),u<0?(g=m[0],S!=y&&(g=g*ve+(m[1]||0)),s=g/b|0,s>1?(s>=ve&&(s=ve-1),f=e(E,s),d=f.length,y=m.length,u=t(f,m,d,y),u==1&&(s--,r(f,S16)throw Error(Nu+ue(e));if(!e.s)return new s(ze);for(te=!1,u=f,o=new s(.03125);e.abs().gte(.1);)e=e.times(o),c+=5;for(n=Math.log(rr(2,c))/Math.LN10*2+5|0,u+=n,r=i=a=new s(ze),s.precision=u;;){if(i=Z(i.times(e),u),r=r.times(++l),o=a.plus(Et(i,r,u)),dt(o.d).slice(0,u)===dt(a.d).slice(0,u)){for(;c--;)a=Z(a.times(a),u);return s.precision=f,t==null?(te=!0,Z(a,f)):a}a=o}}function ue(e){for(var t=e.e*J,r=e.d[0];r>=10;r/=10)t++;return t}function oo(e,t,r){if(t>e.LN10.sd())throw te=!0,r&&(e.precision=r),Error(Xe+"LN10 precision limit exceeded");return Z(new e(e.LN10),t)}function Bt(e){for(var t="";e--;)t+="0";return t}function Pn(e,t){var r,n,i,a,o,u,l,c,s,f=1,d=10,v=e,p=v.d,m=v.constructor,y=m.precision;if(v.s<1)throw Error(Xe+(v.s?"NaN":"-Infinity"));if(v.eq(ze))return new m(0);if(t==null?(te=!1,c=y):c=t,v.eq(10))return t==null&&(te=!0),oo(m,c);if(c+=d,m.precision=c,r=dt(p),n=r.charAt(0),a=ue(v),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)v=v.times(e),r=dt(v.d),n=r.charAt(0),f++;a=ue(v),n>1?(v=new m("0."+r),a++):v=new m(n+"."+r.slice(1))}else return l=oo(m,c+2,y).times(a+""),v=Pn(new m(n+"."+r.slice(1)),c-d).plus(l),m.precision=y,t==null?(te=!0,Z(v,y)):v;for(u=o=v=Et(v.minus(ze),v.plus(ze),c),s=Z(v.times(v),c),i=3;;){if(o=Z(o.times(s),c),l=u.plus(Et(o,new m(i),c)),dt(l.d).slice(0,c)===dt(u.d).slice(0,c))return u=u.times(2),a!==0&&(u=u.plus(oo(m,c+2,y).times(a+""))),u=Et(u,new m(f),c),m.precision=y,t==null?(te=!0,Z(u,y)):u;u=l,i+=2}}function $s(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=Kr(r/J),e.d=[],n=(r+1)%J,r<0&&(n+=J),nNi||e.e<-Ni))throw Error(Nu+r)}else e.s=0,e.e=0,e.d=[0];return e}function Z(e,t,r){var n,i,a,o,u,l,c,s,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=J,i=t,c=f[s=0];else{if(s=Math.ceil((n+1)/J),a=f.length,s>=a)return e;for(c=a=f[s],o=1;a>=10;a/=10)o++;n%=J,i=n-J+o}if(r!==void 0&&(a=rr(10,o-i-1),u=c/a%10|0,l=t<0||f[s+1]!==void 0||c%a,l=r<4?(u||l)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||l||r==6&&(n>0?i>0?c/rr(10,o-i):0:f[s-1])%10&1||r==(e.s<0?8:7))),t<1||!f[0])return l?(a=ue(e),f.length=1,t=t-a-1,f[0]=rr(10,(J-t%J)%J),e.e=Kr(-t/J)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(n==0?(f.length=s,a=1,s--):(f.length=s+1,a=rr(10,J-n),f[s]=i>0?(c/rr(10,o-i)%rr(10,i)|0)*a:0),l)for(;;)if(s==0){(f[0]+=a)==ve&&(f[0]=1,++e.e);break}else{if(f[s]+=a,f[s]!=ve)break;f[s--]=0,a=1}for(n=f.length;f[--n]===0;)f.pop();if(te&&(e.e>Ni||e.e<-Ni))throw Error(Nu+ue(e));return e}function Ih(e,t){var r,n,i,a,o,u,l,c,s,f,d=e.constructor,v=d.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new d(e),te?Z(t,v):t;if(l=e.d,f=t.d,n=t.e,c=e.e,l=l.slice(),o=c-n,o){for(s=o<0,s?(r=l,o=-o,u=f.length):(r=f,n=c,u=l.length),i=Math.max(Math.ceil(v/J),u)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=l.length,u=f.length,s=i0;--i)l[u++]=0;for(i=f.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+Bt(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Bt(-i-1)+a,r&&(n=r-o)>0&&(a+=Bt(n))):i>=o?(a+=Bt(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Bt(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=Bt(n))),e.s<0?"-"+a:a}function Ns(e,t){if(e.length>t)return e.length=t,!0}function Ch(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(lr+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return $s(o,a.toString())}else if(typeof a!="string")throw Error(lr+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,k1.test(a))$s(o,a);else throw Error(lr+a)}if(i.prototype=M,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=Ch,i.config=i.set=j1,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(lr+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(lr+r+": "+n);return this}var Lu=Ch(C1);ze=new Lu(1);const K=Lu;function kh(e){var t;return e===0?t=1:t=Math.floor(new K(e).abs().log(10).toNumber())+1,t}function jh(e,t,r){for(var n=new K(e),i=0,a=[];n.lt(t)&&i<1e5;)a.push(n.toNumber()),n=n.add(r),i++;return a}function Sn(e,t){return $1(e)||D1(e,t)||M1(e,t)||T1()}function T1(){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 M1(e,t){if(e){if(typeof e=="string")return Ls(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)?Ls(e,t):void 0}}function Ls(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=Sn(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]},Ru=(e,t,r)=>{if(e.lte(0))return new K(0);var n=kh(e.toNumber()),i=new K(10).pow(n),a=e.div(i),o=n!==1?.05:.1,u=new K(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=u.mul(i);return t?new K(l.toNumber()):new K(Math.ceil(l.toNumber()))},Mh=(e,t,r)=>{var n;if(e.lte(0))return new K(0);var i=[1,2,2.5,5],a=e.toNumber(),o=Math.floor(new K(a).abs().log(10).toNumber()),u=new K(10).pow(o),l=e.div(u).toNumber(),c=i.findIndex(v=>v>=l-1e-10);if(c===-1&&(u=u.mul(10),c=0),c+=r,c>=i.length){var s=Math.floor(c/i.length);c%=i.length,u=u.mul(new K(10).pow(s))}var f=(n=i[c])!==null&&n!==void 0?n:1,d=new K(f).mul(u);return t?d:new K(Math.ceil(d.toNumber()))},N1=(e,t,r)=>{var n=new K(1),i=new K(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new K(10).pow(kh(e)-1),i=new K(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new K(Math.floor(e)))}else e===0?i=new K(Math.floor((t-1)/2)):r||(i=new K(Math.floor(e)));for(var o=Math.floor((t-1)/2),u=[],l=0;l4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Ru;if(!Number.isFinite((r-t)/(n-1)))return{step:new K(0),tickMin:new K(0),tickMax:new K(0)};var u=o(new K(r).sub(t).div(n-1),i,a),l;t<=0&&r>=0?l=new K(0):(l=new K(t).add(r).div(2),l=l.sub(new K(l).mod(u)));var c=Math.ceil(l.sub(t).div(u).toNumber()),s=Math.ceil(new K(r).sub(l).div(u).toNumber()),f=c+s+1;return f>n?Dh(t,r,n,i,a+1,o):(f0?s+(n-f):s,c=r>0?c:c+(n-f)),{step:u,tickMin:l.sub(new K(c).mul(u)),tickMax:l.add(new K(s).mul(u))})},Rs=function(t){var r=Sn(t,2),n=r[0],i=r[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",l=Math.max(a,2),c=Th([n,i]),s=Sn(c,2),f=s[0],d=s[1];if(f===-1/0||d===1/0){var v=d===1/0?[f,...Array(a-1).fill(1/0)]:[...Array(a-1).fill(-1/0),d];return n>i?v.reverse():v}if(f===d)return N1(f,a,o);var p=u==="snap125"?Mh:Ru,m=Dh(f,d,l,o,0,p),y=m.step,g=m.tickMin,w=m.tickMax,x=jh(g,w.add(new K(.1).mul(y)),y);return n>i?x.reverse():x},zs=function(t,r){var n=Sn(t,2),i=n[0],a=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",l=Th([i,a]),c=Sn(l,2),s=c[0],f=c[1];if(s===-1/0||f===1/0)return[i,a];if(s===f)return[s];var d=u==="snap125"?Mh:Ru,v=Math.max(r,2),p=d(new K(f).sub(s).div(v-1),o,0),m=[...jh(new K(s),new K(f),p),f];return o===!1&&(m=m.map(y=>Math.round(y))),i>a?m.reverse():m},L1=e=>e.rootProps.barCategoryGap,Ia=e=>e.rootProps.stackOffset,$h=e=>e.rootProps.reverseStackOrder,zu=e=>e.options.chartName,Bu=e=>e.rootProps.syncId,Nh=e=>e.rootProps.syncMethod,Fu=e=>e.options.eventEmitter,R1=e=>e.rootProps.baseValue,ke={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Xt={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},ct={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Ca=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function ka(e,t,r){if(r!=="auto")return r;if(e!=null)return bt(e,t)?"category":"number"}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 Li(e){for(var t=1;t{if(t!=null)return e.polarAxis.angleAxis[t]},Wu=P([W1,oh],(e,t)=>{var r;if(e!=null)return e;var n=(r=ka(t,"angleAxis",Fs.type))!==null&&r!==void 0?r:"category";return Li(Li({},Fs),{},{type:n})}),U1=(e,t)=>e.polarAxis.radiusAxis[t],Uu=P([U1,oh],(e,t)=>{var r;if(e!=null)return e;var n=(r=ka(t,"radiusAxis",Ws.type))!==null&&r!==void 0?r:"category";return Li(Li({},Ws),{},{type:n})}),ja=e=>e.polarOptions,Ku=P([Mt,Dt,Pe],c1),Lh=P([ja,Ku],(e,t)=>{if(e!=null)return Yt(e.innerRadius,t,0)}),Rh=P([ja,Ku],(e,t)=>{if(e!=null)return Yt(e.outerRadius,t,t*.8)}),K1=e=>{if(e==null)return[0,0];var t=e.startAngle,r=e.endAngle;return[t,r]},zh=P([ja],K1);P([Wu,zh],Ca);var Bh=P([Ku,Lh,Rh],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});P([Uu,Bh],Ca);var Fh=P([re,ja,Lh,Rh,Mt,Dt],(e,t,r,n,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var o=t.cx,u=t.cy,l=t.startAngle,c=t.endAngle;return{cx:Yt(o,i,i/2),cy:Yt(u,a,a/2),innerRadius:r,outerRadius:n,startAngle:l,endAngle:c,clockWise:!1}}}),pe=(e,t)=>t,Ta=(e,t,r)=>r;function Hu(e){return e==null?void 0:e.id}function Wh(e,t,r){var n=t.chartData,i=n===void 0?[]:n,a=r.allowDuplicatedCategory,o=r.dataKey,u=new Map;return e.forEach(l=>{var c,s=(c=l.data)!==null&&c!==void 0?c:i;if(!(s==null||s.length===0)){var f=Hu(l);s.forEach((d,v)=>{var p=o==null||a?v:String(he(d,o,null)),m=he(d,l.dataKey,0),y;u.has(p)?y=u.get(p):y={},Object.assign(y,{[f]:m}),u.set(p,y)})}}),Array.from(u.values())}function Yu(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Ma=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Da(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function H1(e,t){if(e.length===t.length){for(var r=0;r{var t=re(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Hr=e=>e.tooltip.settings.axisId;function Gu(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(a){function o(){return a.apply(this,arguments)}return o.toString=function(){return a.toString()},o})(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var o=i[0],u=i[1];return o<=u?a>=o&&a<=u:a>=u&&a<=o},bandwidth:r?()=>r.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,o)=>{var u=e(a);if(u!=null){if(e.bandwidth&&o!==null&&o!==void 0&&o.position){var l=e.bandwidth();switch(o.position){case"middle":u+=l/2;break;case"end":u+=l;break}}return u}}}}}var Y1=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!vt(t)){for(var r,n,i=0;in)&&(n=a))}return r!==void 0&&n!==void 0?[r,n]:void 0}return t}default:return t}};function Kt(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function G1(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Vu(e){let t,r,n;e.length!==2?(t=Kt,r=(u,l)=>Kt(e(u),l),n=(u,l)=>e(u)-l):(t=e===Kt||e===G1?e:V1,r=e,n=e);function i(u,l,c=0,s=u.length){if(c>>1;r(u[f],l)<0?c=f+1:s=f}while(c>>1;r(u[f],l)<=0?c=f+1:s=f}while(cc&&n(u[f-1],l)>-n(u[f],l)?f-1:f}return{left:i,center:o,right:a}}function V1(){return 0}function Uh(e){return e===null?NaN:+e}function*q1(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const X1=Vu(Kt),Ln=X1.right;Vu(Uh).center;function Z1(e=Kt){if(e===Kt)return Kh;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 Kh(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const Q1=Math.sqrt(50),J1=Math.sqrt(10),eO=Math.sqrt(2);function Ri(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=Q1?10:a>=J1?5:a>=eO?2:1;let u,l,c;return i<0?(c=Math.pow(10,-i)/o,u=Math.round(e*c),l=Math.round(t*c),u/ct&&--l,c=-c):(c=Math.pow(10,i)*o,u=Math.round(e/c),l=Math.round(t/c),u*ct&&--l),l0))return[];if(e===t)return[e];const n=t=i))return[];const u=a-i+1,l=new Array(u);if(n)if(o<0)for(let c=0;cr;){if(n-r>600){const l=n-r+1,c=t-r+1,s=Math.log(l),f=.5*Math.exp(2*s/3),d=.5*Math.sqrt(s*f*(l-f)/l)*(c-l/2<0?-1:1),v=Math.max(r,Math.floor(t-c*f/l+d)),p=Math.min(n,Math.floor(t+(l-c)*f/l+d));Hh(e,t,v,p,i)}const a=e[t];let o=r,u=n;for(an(e,r,t),i(e[n],a)>0&&an(e,r,n);o0;)--u}i(e[r],a)===0?an(e,r,u):(++u,an(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function an(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function tO(e,t,r){if(e=Float64Array.from(q1(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return Yl(e);if(t>=1)return Gl(e);var n,i=(n-1)*t,a=Math.floor(i),o=Gl(Hh(e,a).subarray(0,a+1)),u=Yl(e.subarray(a+1));return o+(u-o)*(i-a)}}function rO(e,t,r=Uh){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,a=Math.floor(i),o=+r(e[a],a,e),u=+r(e[a+1],a+1,e);return o+(u-o)*(i-a)}}function nO(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,a=new Array(i);++nt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function vO(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?hO:vO,l=c=null,f}function f(d){return d==null||isNaN(d=+d)?a:(l||(l=u(e.map(n),t,r)))(n(o(d)))}return f.invert=function(d){return o(i((c||(c=u(t,e.map(n),Ao)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,zi),s()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),s()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),r=Xu,s()},f.clamp=function(d){return arguments.length?(o=d?!0:je,s()):o!==je},f.interpolate=function(d){return arguments.length?(r=d,s()):r},f.unknown=function(d){return arguments.length?(a=d,f):a},function(d,v){return n=d,i=v,s()}}function Zu(){return $a()(je,je)}function pO(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Bi(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 $r(e){return e=Bi(Math.abs(e)),e?e[1]:NaN}function mO(e,t){return function(r,n){for(var i=r.length,a=[],o=0,u=e[0],l=0;i>0&&u>0&&(l+u+1>n&&(u=Math.max(1,n-l)),a.push(r.substring(i-=u,i+u)),!((l+=u+1)>n));)u=e[o=(o+1)%e.length];return a.reverse().join(t)}}function yO(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var gO=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function En(e){if(!(t=gO.exec(e)))throw new Error("invalid format: "+e);var t;return new Qu({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]})}En.prototype=Qu.prototype;function Qu(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+""}Qu.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 bO(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 Fi;function wO(e,t){var r=Bi(e,t);if(!r)return Fi=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(Fi=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+Bi(e,Math.max(0,t+a-1))[0]}function Ks(e,t){var r=Bi(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 Hs={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:pO,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)=>Ks(e*100,t),r:Ks,s:wO,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Ys(e){return e}var Gs=Array.prototype.map,Vs=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function xO(e){var t=e.grouping===void 0||e.thousands===void 0?Ys:mO(Gs.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+"",a=e.numerals===void 0?Ys:yO(Gs.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(f,d){f=En(f);var v=f.fill,p=f.align,m=f.sign,y=f.symbol,g=f.zero,w=f.width,x=f.comma,A=f.precision,O=f.trim,b=f.type;b==="n"?(x=!0,b="g"):Hs[b]||(A===void 0&&(A=12),O=!0,b="g"),(g||v==="0"&&p==="=")&&(g=!0,v="0",p="=");var S=(d&&d.prefix!==void 0?d.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(b)?"0"+b.toLowerCase():""),_=(y==="$"?n:/[%p]/.test(b)?o:"")+(d&&d.suffix!==void 0?d.suffix:""),I=Hs[b],C=/[defgprs%]/.test(b);A=A===void 0?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function j(E){var R=S,$=_,V,H,Y;if(b==="c")$=I(E)+$,E="";else{E=+E;var B=E<0||1/E<0;if(E=isNaN(E)?l:I(Math.abs(E),A),O&&(E=bO(E)),B&&+E==0&&m!=="+"&&(B=!1),R=(B?m==="("?m:u:m==="-"||m==="("?"":m)+R,$=(b==="s"&&!isNaN(E)&&Fi!==void 0?Vs[8+Fi/3]:"")+$+(B&&m==="("?")":""),C){for(V=-1,H=E.length;++VY||Y>57){$=(Y===46?i+E.slice(V+1):E.slice(V))+$,E=E.slice(0,V);break}}}x&&!g&&(E=t(E,1/0));var q=R.length+E.length+$.length,W=q>1)+R+E+$+W.slice(q);break;default:E=W+R+E+$;break}return a(E)}return j.toString=function(){return f+""},j}function s(f,d){var v=Math.max(-8,Math.min(8,Math.floor($r(d)/3)))*3,p=Math.pow(10,-v),m=c((f=En(f),f.type="f",f),{suffix:Vs[8+v/3]});return function(y){return m(p*y)}}return{format:c,formatPrefix:s}}var ti,Ju,Gh;AO({thousands:",",grouping:[3],currency:["$",""]});function AO(e){return ti=xO(e),Ju=ti.format,Gh=ti.formatPrefix,ti}function OO(e){return Math.max(0,-$r(Math.abs(e)))}function PO(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor($r(t)/3)))*3-$r(Math.abs(e)))}function SO(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,$r(t)-$r(e))+1}function Vh(e,t,r,n){var i=eu(e,t,r),a;switch(n=En(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=PO(i,o))&&(n.precision=a),Gh(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=SO(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=OO(i))&&(n.precision=a-(n.type==="%")*2);break}}return Ju(n)}function Gt(e){var t=e.domain;return e.ticks=function(r){var n=t();return Qo(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return Vh(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],u=n[a],l,c,s=10;for(u0;){if(c=Jo(o,u,r),c===l)return n[i]=o,n[a]=u,t(n);if(c>0)o=Math.floor(o/c)*c,u=Math.ceil(u/c)*c;else if(c<0)o=Math.ceil(o*c)/c,u=Math.floor(u*c)/c;else break;l=c}return e},e}function qh(){var e=Zu();return e.copy=function(){return Rn(e,qh())},ot.apply(e,arguments),Gt(e)}function Xh(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,zi),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return Xh(e).unknown(t)},e=arguments.length?Array.from(e,zi):[0,1],Gt(r)}function Zh(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function kO(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 Zs(e){return(t,r)=>-e(-t,r)}function el(e){const t=e(qs,Xs),r=t.domain;let n=10,i,a;function o(){return i=kO(n),a=CO(n),r()[0]<0?(i=Zs(i),a=Zs(a),e(EO,_O)):e(qs,Xs),t}return t.base=function(u){return arguments.length?(n=+u,o()):n},t.domain=function(u){return arguments.length?(r(u),o()):r()},t.ticks=u=>{const l=r();let c=l[0],s=l[l.length-1];const f=s0){for(;d<=v;++d)for(p=1;ps)break;g.push(m)}}else for(;d<=v;++d)for(p=n-1;p>=1;--p)if(m=d>0?p/a(-d):p*a(d),!(ms)break;g.push(m)}g.length*2{if(u==null&&(u=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=En(l)).precision==null&&(l.trim=!0),l=Ju(l)),u===1/0)return l;const c=Math.max(1,n*u/t.ticks().length);return s=>{let f=s/a(Math.round(i(s)));return f*nr(Zh(r(),{floor:u=>a(Math.floor(i(u))),ceil:u=>a(Math.ceil(i(u)))})),t}function Qh(){const e=el($a()).domain([1,10]);return e.copy=()=>Rn(e,Qh()).base(e.base()),ot.apply(e,arguments),e}function Qs(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Js(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function tl(e){var t=1,r=e(Qs(t),Js(t));return r.constant=function(n){return arguments.length?e(Qs(t=+n),Js(t)):t},Gt(r)}function Jh(){var e=tl($a());return e.copy=function(){return Rn(e,Jh()).constant(e.constant())},ot.apply(e,arguments)}function ef(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function jO(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function TO(e){return e<0?-e*e:e*e}function rl(e){var t=e(je,je),r=1;function n(){return r===1?e(je,je):r===.5?e(jO,TO):e(ef(r),ef(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Gt(t)}function nl(){var e=rl($a());return e.copy=function(){return Rn(e,nl()).exponent(e.exponent())},ot.apply(e,arguments),e}function MO(){return nl.apply(null,arguments).exponent(.5)}function tf(e){return Math.sign(e)*e*e}function DO(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function ep(){var e=Zu(),t=[0,1],r=!1,n;function i(a){var o=DO(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(tf(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,zi)).map(tf)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return ep(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},ot.apply(i,arguments),Gt(i)}function tp(){var e=[],t=[],r=[],n;function i(){var o=0,u=Math.max(1,t.length);for(r=new Array(u-1);++o0?r[u-1]:e[0],u=r?[n[r-1],t]:[n[c-1],n[c]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return rp().domain([e,t]).range(i).unknown(a)},ot.apply(Gt(o),arguments)}function np(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[Ln(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return np().domain(e).range(t).unknown(r)},ot.apply(i,arguments)}const uo=new Date,lo=new Date;function fe(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),u=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,u)=>{const l=[];if(a=i.ceil(a),u=u==null?1:Math.floor(u),!(a0))return l;let c;do l.push(c=new Date(+a)),t(a,u),e(a);while(cfe(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,u)=>{if(o>=o)if(u<0)for(;++u<=0;)for(;t(o,-1),!a(o););else for(;--u>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(uo.setTime(+a),lo.setTime(+o),e(uo),e(lo),Math.floor(r(uo,lo))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const Wi=fe(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Wi.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?fe(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Wi);Wi.range;const Pt=1e3,Ge=Pt*60,St=Ge*60,Ct=St*24,il=Ct*7,rf=Ct*30,co=Ct*365,ar=fe(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Pt)},(e,t)=>(t-e)/Pt,e=>e.getUTCSeconds());ar.range;const al=fe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Pt)},(e,t)=>{e.setTime(+e+t*Ge)},(e,t)=>(t-e)/Ge,e=>e.getMinutes());al.range;const ol=fe(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Ge)},(e,t)=>(t-e)/Ge,e=>e.getUTCMinutes());ol.range;const ul=fe(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Pt-e.getMinutes()*Ge)},(e,t)=>{e.setTime(+e+t*St)},(e,t)=>(t-e)/St,e=>e.getHours());ul.range;const ll=fe(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*St)},(e,t)=>(t-e)/St,e=>e.getUTCHours());ll.range;const zn=fe(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Ge)/Ct,e=>e.getDate()-1);zn.range;const Na=fe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ct,e=>e.getUTCDate()-1);Na.range;const ip=fe(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ct,e=>Math.floor(e/Ct));ip.range;function gr(e){return fe(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())*Ge)/il)}const La=gr(0),Ui=gr(1),$O=gr(2),NO=gr(3),Nr=gr(4),LO=gr(5),RO=gr(6);La.range;Ui.range;$O.range;NO.range;Nr.range;LO.range;RO.range;function br(e){return fe(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)/il)}const Ra=br(0),Ki=br(1),zO=br(2),BO=br(3),Lr=br(4),FO=br(5),WO=br(6);Ra.range;Ki.range;zO.range;BO.range;Lr.range;FO.range;WO.range;const cl=fe(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());cl.range;const sl=fe(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());sl.range;const kt=fe(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());kt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:fe(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)});kt.range;const jt=fe(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());jt.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:fe(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)});jt.range;function ap(e,t,r,n,i,a){const o=[[ar,1,Pt],[ar,5,5*Pt],[ar,15,15*Pt],[ar,30,30*Pt],[a,1,Ge],[a,5,5*Ge],[a,15,15*Ge],[a,30,30*Ge],[i,1,St],[i,3,3*St],[i,6,6*St],[i,12,12*St],[n,1,Ct],[n,2,2*Ct],[r,1,il],[t,1,rf],[t,3,3*rf],[e,1,co]];function u(c,s,f){const d=sy).right(o,d);if(v===o.length)return e.every(eu(c/co,s/co,f));if(v===0)return Wi.every(Math.max(eu(c,s,f),1));const[p,m]=o[d/o[v-1][2]53)return null;"w"in k||(k.w=1),"Z"in k?(X=fo(on(k.y,0,1)),L=X.getUTCDay(),X=L>4||L===0?Ki.ceil(X):Ki(X),X=Na.offset(X,(k.V-1)*7),k.y=X.getUTCFullYear(),k.m=X.getUTCMonth(),k.d=X.getUTCDate()+(k.w+6)%7):(X=so(on(k.y,0,1)),L=X.getDay(),X=L>4||L===0?Ui.ceil(X):Ui(X),X=zn.offset(X,(k.V-1)*7),k.y=X.getFullYear(),k.m=X.getMonth(),k.d=X.getDate()+(k.w+6)%7)}else("W"in k||"U"in k)&&("w"in k||(k.w="u"in k?k.u%7:"W"in k?1:0),L="Z"in k?fo(on(k.y,0,1)).getUTCDay():so(on(k.y,0,1)).getDay(),k.m=0,k.d="W"in k?(k.w+6)%7+k.W*7-(L+5)%7:k.w+k.U*7-(L+6)%7);return"Z"in k?(k.H+=k.Z/100|0,k.M+=k.Z%100,fo(k)):so(k)}}function _(T,F,z,k){for(var Ee=0,X=F.length,L=z.length,Re,qt;Ee=L)return-1;if(Re=F.charCodeAt(Ee++),Re===37){if(Re=F.charAt(Ee++),qt=O[Re in nf?F.charAt(Ee++):Re],!qt||(k=qt(T,z,k))<0)return-1}else if(Re!=z.charCodeAt(k++))return-1}return k}function I(T,F,z){var k=c.exec(F.slice(z));return k?(T.p=s.get(k[0].toLowerCase()),z+k[0].length):-1}function C(T,F,z){var k=v.exec(F.slice(z));return k?(T.w=p.get(k[0].toLowerCase()),z+k[0].length):-1}function j(T,F,z){var k=f.exec(F.slice(z));return k?(T.w=d.get(k[0].toLowerCase()),z+k[0].length):-1}function E(T,F,z){var k=g.exec(F.slice(z));return k?(T.m=w.get(k[0].toLowerCase()),z+k[0].length):-1}function R(T,F,z){var k=m.exec(F.slice(z));return k?(T.m=y.get(k[0].toLowerCase()),z+k[0].length):-1}function $(T,F,z){return _(T,t,F,z)}function V(T,F,z){return _(T,r,F,z)}function H(T,F,z){return _(T,n,F,z)}function Y(T){return o[T.getDay()]}function B(T){return a[T.getDay()]}function q(T){return l[T.getMonth()]}function W(T){return u[T.getMonth()]}function Se(T){return i[+(T.getHours()>=12)]}function ge(T){return 1+~~(T.getMonth()/3)}function ae(T){return o[T.getUTCDay()]}function Ne(T){return a[T.getUTCDay()]}function Le(T){return l[T.getUTCMonth()]}function Je(T){return u[T.getUTCMonth()]}function et(T){return i[+(T.getUTCHours()>=12)]}function Jr(T){return 1+~~(T.getUTCMonth()/3)}return{format:function(T){var F=b(T+="",x);return F.toString=function(){return T},F},parse:function(T){var F=S(T+="",!1);return F.toString=function(){return T},F},utcFormat:function(T){var F=b(T+="",A);return F.toString=function(){return T},F},utcParse:function(T){var F=S(T+="",!0);return F.toString=function(){return T},F}}}var nf={"-":"",_:" ",0:"0"},ye=/^\s*\d+/,VO=/^%/,qO=/[\\^$*+?|[\]().{}]/g;function G(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function ZO(e,t,r){var n=ye.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function QO(e,t,r){var n=ye.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function JO(e,t,r){var n=ye.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function eP(e,t,r){var n=ye.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function tP(e,t,r){var n=ye.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function af(e,t,r){var n=ye.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function of(e,t,r){var n=ye.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function rP(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 nP(e,t,r){var n=ye.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function iP(e,t,r){var n=ye.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function uf(e,t,r){var n=ye.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function aP(e,t,r){var n=ye.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function lf(e,t,r){var n=ye.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function oP(e,t,r){var n=ye.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function uP(e,t,r){var n=ye.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function lP(e,t,r){var n=ye.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function cP(e,t,r){var n=ye.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function sP(e,t,r){var n=VO.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function fP(e,t,r){var n=ye.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function dP(e,t,r){var n=ye.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function cf(e,t){return G(e.getDate(),t,2)}function vP(e,t){return G(e.getHours(),t,2)}function hP(e,t){return G(e.getHours()%12||12,t,2)}function pP(e,t){return G(1+zn.count(kt(e),e),t,3)}function op(e,t){return G(e.getMilliseconds(),t,3)}function mP(e,t){return op(e,t)+"000"}function yP(e,t){return G(e.getMonth()+1,t,2)}function gP(e,t){return G(e.getMinutes(),t,2)}function bP(e,t){return G(e.getSeconds(),t,2)}function wP(e){var t=e.getDay();return t===0?7:t}function xP(e,t){return G(La.count(kt(e)-1,e),t,2)}function up(e){var t=e.getDay();return t>=4||t===0?Nr(e):Nr.ceil(e)}function AP(e,t){return e=up(e),G(Nr.count(kt(e),e)+(kt(e).getDay()===4),t,2)}function OP(e){return e.getDay()}function PP(e,t){return G(Ui.count(kt(e)-1,e),t,2)}function SP(e,t){return G(e.getFullYear()%100,t,2)}function EP(e,t){return e=up(e),G(e.getFullYear()%100,t,2)}function _P(e,t){return G(e.getFullYear()%1e4,t,4)}function IP(e,t){var r=e.getDay();return e=r>=4||r===0?Nr(e):Nr.ceil(e),G(e.getFullYear()%1e4,t,4)}function CP(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+G(t/60|0,"0",2)+G(t%60,"0",2)}function sf(e,t){return G(e.getUTCDate(),t,2)}function kP(e,t){return G(e.getUTCHours(),t,2)}function jP(e,t){return G(e.getUTCHours()%12||12,t,2)}function TP(e,t){return G(1+Na.count(jt(e),e),t,3)}function lp(e,t){return G(e.getUTCMilliseconds(),t,3)}function MP(e,t){return lp(e,t)+"000"}function DP(e,t){return G(e.getUTCMonth()+1,t,2)}function $P(e,t){return G(e.getUTCMinutes(),t,2)}function NP(e,t){return G(e.getUTCSeconds(),t,2)}function LP(e){var t=e.getUTCDay();return t===0?7:t}function RP(e,t){return G(Ra.count(jt(e)-1,e),t,2)}function cp(e){var t=e.getUTCDay();return t>=4||t===0?Lr(e):Lr.ceil(e)}function zP(e,t){return e=cp(e),G(Lr.count(jt(e),e)+(jt(e).getUTCDay()===4),t,2)}function BP(e){return e.getUTCDay()}function FP(e,t){return G(Ki.count(jt(e)-1,e),t,2)}function WP(e,t){return G(e.getUTCFullYear()%100,t,2)}function UP(e,t){return e=cp(e),G(e.getUTCFullYear()%100,t,2)}function KP(e,t){return G(e.getUTCFullYear()%1e4,t,4)}function HP(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Lr(e):Lr.ceil(e),G(e.getUTCFullYear()%1e4,t,4)}function YP(){return"+0000"}function ff(){return"%"}function df(e){return+e}function vf(e){return Math.floor(+e/1e3)}var Or,sp,fp;GP({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 GP(e){return Or=GO(e),sp=Or.format,Or.parse,fp=Or.utcFormat,Or.utcParse,Or}function VP(e){return new Date(e)}function qP(e){return e instanceof Date?+e:+new Date(+e)}function fl(e,t,r,n,i,a,o,u,l,c){var s=Zu(),f=s.invert,d=s.domain,v=c(".%L"),p=c(":%S"),m=c("%I:%M"),y=c("%I %p"),g=c("%a %d"),w=c("%b %d"),x=c("%B"),A=c("%Y");function O(b){return(l(b)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>tO(e,a/n))},r.copy=function(){return pp(t).domain(e)},Tt.apply(r,arguments)}function Ba(){var e=0,t=.5,r=1,n=1,i,a,o,u,l,c=je,s,f=!1,d;function v(m){return isNaN(m=+m)?d:(m=.5+((m=+s(m))-a)*(n*m{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 rS(n)?n:"point"}};function nS(e,t){for(var r=0,n=e.length,i=e[0]t)?r=a+1:n=a}return r}function xp(e,t){if(e){var r=t??e.domain(),n=r.map(a=>{var o;return(o=e(a))!==null&&o!==void 0?o:0}),i=e.range();if(!(r.length===0||i.length<2))return a=>{var o,u,l=nS(n,a);if(l<=0)return r[0];if(l>=r.length)return r[r.length-1];var c=(o=n[l-1])!==null&&o!==void 0?o:0,s=(u=n[l])!==null&&u!==void 0?u:0;return Math.abs(a-c)<=Math.abs(a-s)?r[l-1]:r[l]}}}function iS(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):xp(e,void 0)}function pf(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 Hi(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);re.cartesianAxis.xAxis[t],$t=(e,t)=>{var r=Op(e,t);return r??ce},se={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:ru,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:Tn},Pp=(e,t)=>e.cartesianAxis.yAxis[t],Nt=(e,t)=>{var r=Pp(e,t);return r??se},dS={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:""},pl=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??dS},Me=(e,t,r)=>{switch(t){case"xAxis":return $t(e,r);case"yAxis":return Nt(e,r);case"zAxis":return pl(e,r);case"angleAxis":return Wu(e,r);case"radiusAxis":return Uu(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},vS=(e,t,r)=>{switch(t){case"xAxis":return $t(e,r);case"yAxis":return Nt(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},Bn=(e,t,r)=>{switch(t){case"xAxis":return $t(e,r);case"yAxis":return Nt(e,r);case"angleAxis":return Wu(e,r);case"radiusAxis":return Uu(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},Sp=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function Ep(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 _p=e=>e.graphicalItems.cartesianItems,hS=P([pe,Ta],Ep),Ip=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),Gr=P([_p,Me,hS],Ip,{memoizeOptions:{resultEqualityCheck:Da}}),Cp=P([Gr],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Yu)),kp=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),pS=P([Gr],kp),jp=e=>e.map(t=>t.data).filter(Boolean).flat(1),mS=P([Gr],e=>e.some(t=>!t.data)),Tp=P([Gr],jp,{memoizeOptions:{resultEqualityCheck:Da}}),Mp=(e,t)=>{var r=t.chartData,n=r===void 0?[]:r,i=t.dataStartIndex,a=t.dataEndIndex;return e.length>0?e:n.slice(i,a+1)},ml=P([Tp,_a],Mp),yS=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:he(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(i=>({value:he(i,n)}))):e.map(n=>({value:n})),Dp=(e,t,r,n,i,a)=>{var o=n.chartData,u=o===void 0?[]:o,l=n.dataStartIndex,c=n.dataEndIndex,s=yS(e,t,r);if(i&&(t==null?void 0:t.dataKey)!=null&&a.length>0){var f=u.slice(l,c+1),d=f.map(v=>({value:he(v,t.dataKey)})).filter(v=>v.value!=null);return[...d,...s]}return s},Fn=P([ml,Me,Gr,_a,mS,Tp],Dp);function Tr(e){if(pt(e)||e instanceof Date){var t=Number(e);if(U(t))return t}}function yf(e){if(Array.isArray(e)){var t=[Tr(e[0]),Tr(e[1])];return vt(t)?t:void 0}var r=Tr(e);if(r!=null)return[r,r]}function gt(e){return e.map(Tr).filter(De)}function gS(e,t){var r=Tr(e),n=Tr(t);return r==null&&n==null?0:r==null?-1:n==null?1:r-n}var bS=P([Fn],e=>e==null?void 0:e.map(t=>t.value).sort(gS));function $p(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function wS(e,t,r){if(!r)return[];if(!r.length)return[];var n;if(typeof t=="number"&&!ht(t))n=t;else if(Array.isArray(t)){var i=gt(t);i.length>0&&(n=Math.max(...i))}return n==null?[]:gt(r.flatMap(a=>{var o=he(e,a.dataKey),u,l;if(Array.isArray(o)){var c=Ap(o,2);u=c[0],l=c[1]}else u=l=o;if(!(!U(u)||!U(l)))return[n-u,n+l]}))}var de=e=>{var t=me(e),r=Hr(e);return Bn(e,t,r)},Rr=P([de],e=>e==null?void 0:e.dataKey),xS=P([Cp,_a,de],Wh),Np=(e,t,r,n)=>{var i={},a=t.reduce((o,u)=>{if(u.stackId==null)return o;var l=o[u.stackId];return l==null&&(l=[]),l.push(u),o[u.stackId]=l,o},i);return Object.fromEntries(Object.entries(a).map(o=>{var u=Ap(o,2),l=u[0],c=u[1],s=n?[...c].reverse():c,f=s.map(Hu);return[l,{stackedData:ow(e,f,r),graphicalItems:s}]}))},Lp=P([xS,Cp,Ia,$h],Np),Rp=(e,t,r,n)=>{var i=t.dataStartIndex,a=t.dataEndIndex;if(n==null&&r!=="zAxis")return sw(e,i,a)},AS=P([Me],e=>e.allowDataOverflow),yl=e=>{var t;if(e==null||!("domain"in e))return ru;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=gt(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:ru},zp=P([Me],yl),Bp=P([zp,AS],Ph),OS=P([Lp,ut,pe,Bp],Rp,{memoizeOptions:{resultEqualityCheck:Ma}}),gl=e=>e.errorBars,PS=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>$p(r,n)),Yi=function(){for(var t=arguments.length,r=new Array(t),n=0;n5&&arguments[5]!==void 0?arguments[5]:[],u,l;if(n.length>0&&n.forEach(c=>{var s,f=c.data!=null?[...c.data]:o,d=(s=i[c.id])===null||s===void 0?void 0:s.filter(v=>$p(a,v));f.forEach(v=>{var p,m=he(v,(p=r.dataKey)!==null&&p!==void 0?p:c.dataKey),y=wS(v,m,d);if(y.length>=2){var g=Math.min(...y),w=Math.max(...y);(u==null||gl)&&(l=w)}var x=yf(m);x!=null&&(u=u==null?x[0]:Math.min(u,x[0]),l=l==null?x[1]:Math.max(l,x[1]))})}),(r==null?void 0:r.dataKey)!=null&&n.length===0&&t.forEach(c=>{var s=yf(he(c,r.dataKey));s!=null&&(u=u==null?s[0]:Math.min(u,s[0]),l=l==null?s[1]:Math.max(l,s[1]))}),U(u)&&U(l))return[u,l]},SS=P([ml,Me,pS,gl,pe,A1],Fp,{memoizeOptions:{resultEqualityCheck:Ma}});function ES(e){var t=e.value;if(pt(t)||t instanceof Date)return t}var _S=(e,t,r)=>{var n=e.map(ES).filter(i=>i!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&tv(n))?Oh(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},Wp=e=>e.referenceElements.dots,Vr=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),IS=P([Wp,pe,Ta],Vr),Up=e=>e.referenceElements.areas,CS=P([Up,pe,Ta],Vr),Kp=e=>e.referenceElements.lines,kS=P([Kp,pe,Ta],Vr),Hp=(e,t)=>{if(e!=null){var r=gt(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},jS=P(IS,pe,Hp),Yp=(e,t)=>{if(e!=null){var r=gt(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)]}},TS=P([CS,pe],Yp);function MS(e){var t;if(e.x!=null)return gt([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:gt(r)}function DS(e){var t;if(e.y!=null)return gt([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:gt(r)}var Gp=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?MS(n):DS(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},$S=P([kS,pe],Gp),NS=P(jS,$S,TS,(e,t,r)=>Yi(e,r,t)),Vp=(e,t,r,n,i,a,o,u)=>{if(r!=null)return r;var l=o==="vertical"&&u==="xAxis"||o==="horizontal"&&u==="yAxis",c=l?Yi(n,a,i):Yi(a,i);return I1(t,c,e.allowDataOverflow)},LS=P([Me,zp,Bp,OS,SS,NS,re,pe],Vp,{memoizeOptions:{resultEqualityCheck:Ma}}),RS=[0,1],qp=(e,t,r,n,i,a,o)=>{if(!((e==null||r==null||r.length===0)&&o===void 0)){var u=e.dataKey,l=e.type,c=bt(t,a);if(c&&u==null){var s;return Oh(0,(s=r==null?void 0:r.length)!==null&&s!==void 0?s:0)}return l==="category"?_S(n,e,c):i==="expand"&&!c?RS:o}},bl=P([Me,re,ml,Fn,Ia,pe,LS],qp),qr=P([Me,Sp,zu],wp),Xp=(e,t,r)=>{var n=t.niceTicks;if(n!=="none"){var i=yl(t),a=Array.isArray(i)&&(i[0]==="auto"||i[1]==="auto");if((n==="snap125"||n==="adaptive")&&t!=null&&t.tickCount&&vt(e)){if(a)return Rs(e,t.tickCount,t.allowDecimals,n);if(t.type==="number")return zs(e,t.tickCount,t.allowDecimals,n)}if(n==="auto"&&r==="linear"&&t!=null&&t.tickCount){if(a&&vt(e))return Rs(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&vt(e))return zs(e,t.tickCount,t.allowDecimals,"adaptive")}}},wl=P([bl,Bn,qr],Xp),Zp=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&vt(t)&&Array.isArray(r)&&r.length>0){var i,a,o=t[0],u=(i=r[0])!==null&&i!==void 0?i:0,l=t[1],c=(a=r[r.length-1])!==null&&a!==void 0?a:0;return[Math.min(o,u),Math.max(l,c)]}return t},zS=P([Me,bl,wl,pe],Zp),BS=P(Fn,Me,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(gt(e.map(f=>f.value))).sort((f,d)=>f-d),i=n[0],a=n[n.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var u=0;ui,(e,t,r,n,i)=>{if(!U(e))return 0;var a=t==="vertical"?n.height:n.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=Yt(r,e*a),u=e*a/2;return u-o-(u-o)/a*o}return 0}),FS=(e,t,r)=>{var n=$t(e,t);return n==null||typeof n.padding!="string"?0:Qp(e,"xAxis",t,r,n.padding)},WS=(e,t,r)=>{var n=Nt(e,t);return n==null||typeof n.padding!="string"?0:Qp(e,"yAxis",t,r,n.padding)},US=P($t,FS,(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}}),KS=P(Nt,WS,(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}}),Jp=P([Pe,US,xa,wa,(e,t,r)=>r],(e,t,r,n,i)=>{var a=n.padding;return i?[a.left,r.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),em=P([Pe,re,KS,xa,wa,(e,t,r)=>r],(e,t,r,n,i,a)=>{var o=i.padding;return a?[n.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),Wn=(e,t,r,n)=>{var i;switch(t){case"xAxis":return Jp(e,r,n);case"yAxis":return em(e,r,n);case"zAxis":return(i=pl(e,r))===null||i===void 0?void 0:i.range;case"angleAxis":return zh(e);case"radiusAxis":return Bh(e,r);default:return}},tm=P([Me,Wn],Ca),HS=P([qr,zS],Y1),xl=P([Me,qr,HS,tm],hl),rm=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var i=r.type,a=r.scale,o=bt(e,n);if(o&&(i==="number"||a!=="auto"))return t.map(u=>u.value)}},Al=P([re,Fn,Bn,pe],rm),Fa=P([xl],Gu);P([xl],iS);P([xl,bS],xp);P([Gr,gl,pe],PS);function nm(e,t){return e.idt.id?1:0}var Wa=(e,t)=>t,Ua=(e,t,r)=>r,YS=P(ga,Wa,Ua,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(nm)),GS=P(ba,Wa,Ua,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(nm)),im=(e,t)=>({width:e.width,height:t.height}),VS=(e,t)=>{var r=typeof t.width=="number"?t.width:Tn;return{width:r,height:e.height}},qS=P(Pe,$t,im),XS=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},ZS=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},QS=P(Dt,Pe,YS,Wa,Ua,(e,t,r,n,i)=>{var a={},o;return r.forEach(u=>{var l=im(t,u);o==null&&(o=XS(t,n,e));var c=n==="top"&&!i||n==="bottom"&&i;a[u.id]=o-Number(c)*l.height,o+=(c?-1:1)*l.height}),a}),JS=P(Mt,Pe,GS,Wa,Ua,(e,t,r,n,i)=>{var a={},o;return r.forEach(u=>{var l=VS(t,u);o==null&&(o=ZS(t,n,e));var c=n==="left"&&!i||n==="right"&&i;a[u.id]=o-Number(c)*l.width,o+=(c?-1:1)*l.width}),a}),eE=(e,t)=>{var r=$t(e,t);if(r!=null)return QS(e,r.orientation,r.mirror)},tE=P([Pe,$t,eE,(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}}}),rE=(e,t)=>{var r=Nt(e,t);if(r!=null)return JS(e,r.orientation,r.mirror)},nE=P([Pe,Nt,rE,(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}}}),iE=P(Pe,Nt,(e,t)=>{var r=typeof t.width=="number"?t.width:Tn;return{width:r,height:e.height}}),am=(e,t,r,n)=>{if(r!=null){var i=r.allowDuplicatedCategory,a=r.type,o=r.dataKey,u=bt(e,n),l=t.map(s=>s.value),c=l.filter(s=>s!=null);if(o&&u&&a==="category"&&i&&tv(c))return l}},Ol=P([re,Fn,Me,pe],am),gf=P([re,vS,qr,Fa,Ol,Al,Wn,wl,pe],(e,t,r,n,i,a,o,u,l)=>{if(t!=null){var c=bt(e,l);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:l,categoricalDomain:a,duplicateDomain:i,isCategorical:c,niceTicks:u,range:o,realScaleType:r,scale:n}}}),aE=(e,t,r,n,i,a,o,u,l)=>{if(!(t==null||n==null)){var c=bt(e,l),s=t.type,f=t.ticks,d=t.tickCount,v=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,p=s==="category"&&n.bandwidth?n.bandwidth()/v:0;p=l==="angleAxis"&&a!=null&&a.length>=2?He(a[0]-a[1])*2*p:p;var m=f||i;return m?m.map((y,g)=>{var w=o?o.indexOf(y):y,x=n.map(w);return U(x)?{index:g,coordinate:x+p,value:y,offset:p}:null}).filter(De):c&&u?u.map((y,g)=>{var w=n.map(y);return U(w)?{coordinate:w+p,value:y,index:g,offset:p}:null}).filter(De):n.ticks?n.ticks(d).map((y,g)=>{var w=n.map(y);return U(w)?{coordinate:w+p,value:y,index:g,offset:p}:null}).filter(De):n.domain().map((y,g)=>{var w=n.map(y);return U(w)?{coordinate:w+p,value:o?o[y]:y,index:g,offset:p}:null}).filter(De)}},om=P([re,Bn,qr,Fa,wl,Wn,Ol,Al,pe],aE),oE=(e,t,r,n,i,a,o)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var u=bt(e,o),l=t.tickCount,c=0;return c=o==="angleAxis"&&(n==null?void 0:n.length)>=2?He(n[0]-n[1])*2*c:c,u&&a?a.map((s,f)=>{var d=r.map(s);return U(d)?{coordinate:d+c,value:s,index:f,offset:c}:null}).filter(De):r.ticks?r.ticks(l).map((s,f)=>{var d=r.map(s);return U(d)?{coordinate:d+c,value:s,index:f,offset:c}:null}).filter(De):r.domain().map((s,f)=>{var d=r.map(s);return U(d)?{coordinate:d+c,value:i?i[s]:s,index:f,offset:c}:null}).filter(De)}},um=P([re,Bn,Fa,Wn,Ol,Al,pe],oE),lm=P(Me,Fa,(e,t)=>{if(!(e==null||t==null))return Hi(Hi({},e),{},{scale:t})}),uE=P([Me,qr,bl,tm],hl),lE=P([uE],Gu);P((e,t,r)=>pl(e,r),lE,(e,t)=>{if(!(e==null||t==null))return Hi(Hi({},e),{},{scale:t})});var cE=P([re,ga,ba],(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}}),sE=(e,t,r)=>{var n;return(n=e.renderedTicks[t])===null||n===void 0?void 0:n[r]};P([sE],e=>{if(!(!e||e.length===0))return t=>{var r,n=1/0,i=e[0];for(var a of e){var o=Math.abs(a.coordinate-t);oe.options.defaultTooltipEventType,sm=e=>e.options.validateTooltipEventTypes;function fm(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function Un(e,t){var r=cm(e),n=sm(e);return fm(t,r,n)}function fE(e){return N(t=>Un(t,e))}var dm=(e,t)=>{var r,n=Number(t);if(!(ht(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},dE=e=>e.tooltip.settings,Wt={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},vE={itemInteraction:{click:Wt,hover:Wt},axisInteraction:{click:Wt,hover:Wt},keyboardInteraction:Wt,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}},vm=Ce({name:"tooltip",initialState:vE,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Q()},replaceTooltipEntrySettings:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,a=Ye(e).tooltipItemPayloads.indexOf(n);a>-1&&(e.tooltipItemPayloads[a]=i)},prepare:Q()},removeTooltipEntrySettings:{reducer(e,t){var r=Ye(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:Q()},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}}}),Qe=vm.actions,hE=Qe.addTooltipEntrySettings,pE=Qe.replaceTooltipEntrySettings,mE=Qe.removeTooltipEntrySettings,yE=Qe.setTooltipSettingsState,gE=Qe.setActiveMouseOverItemIndex;Qe.mouseLeaveItem;var hm=Qe.mouseLeaveChart;Qe.setActiveClickItemIndex;var pm=Qe.setMouseOverAxisIndex,bE=Qe.setMouseClickAxisIndex,dn=Qe.setSyncInteraction,Gi=Qe.setKeyboardInteraction,wE=vm.reducer;function bf(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 ri(e){for(var t=1;t{if(t==null)return Wt;var i=PE(e,t,r);if(i==null)return Wt;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(SE(i)){if(a)return ri(ri({},i),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return ri(ri({},Wt),{},{coordinate:i.coordinate})};function EE(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 _E(e,t){var r=EE(e),n=t[0],i=t[1];if(r===void 0)return!1;var a=Math.min(n,i),o=Math.max(n,i);return r>=a&&r<=o}function IE(e,t,r){if(r==null||t==null)return!0;var n=he(e,t);return n==null||!vt(r)?!0:_E(n,r)}var hn=(e,t,r,n)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!U(a))return i;var o=0,u=1/0;t.length>0&&(u=t.length-1);var l=Math.max(o,Math.min(a,u)),c=t[l];return c==null||IE(c,r,n)?String(l):null},ym=(e,t,r,n,i,a,o)=>{if(a!=null){var u=o[0],l=u==null?void 0:u.getPosition(a);if(l!=null)return l;var c=i==null?void 0:i[Number(a)];if(c)switch(r){case"horizontal":return{x:c.coordinate,y:(n.top+t)/2};default:return{x:(n.left+e)/2,y:c.coordinate}}}},gm=(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 a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(o=>{var u;return((u=o.settings)===null||u===void 0?void 0:u.graphicalItemId)===i})},bm=e=>e.options.tooltipPayloadSearcher,Xr=e=>e.tooltip;function wf(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 xf(e){for(var t=1;te(t)}function Af(e){if(typeof e=="string")return e}function $E(e){if(!(e==null||typeof e!="object")){var t="name"in e?TE(e.name):void 0,r="unit"in e?ME(e.unit):void 0,n="dataKey"in e?DE(e.dataKey):void 0,i="payload"in e?e.payload:void 0,a="color"in e?Af(e.color):void 0,o="fill"in e?Af(e.fill):void 0;return{name:t,unit:r,dataKey:n,payload:i,color:a,fill:o}}}function NE(e,t){return e??t}var wm=(e,t,r,n,i,a,o)=>{if(!(t==null||a==null)){var u=r.chartData,l=r.computedData,c=r.dataStartIndex,s=r.dataEndIndex,f=[];return e.reduce((d,v)=>{var p,m=v.dataDefinedOnItem,y=v.settings,g=NE(m,u),w=Array.isArray(g)?Vv(g,c,s):g,x=(p=y==null?void 0:y.dataKey)!==null&&p!==void 0?p:n,A=y==null?void 0:y.nameKey,O;if(n&&Array.isArray(w)&&!Array.isArray(w[0])&&o==="axis"?O=rv(w,n,i):O=a(w,t,l,A),Array.isArray(O))O.forEach(S=>{var _,I,C=$E(S),j=C==null?void 0:C.name,E=C==null?void 0:C.dataKey,R=C==null?void 0:C.payload,$=xf(xf({},y),{},{name:j,unit:C==null?void 0:C.unit,color:(_=C==null?void 0:C.color)!==null&&_!==void 0?_:y==null?void 0:y.color,fill:(I=C==null?void 0:C.fill)!==null&&I!==void 0?I:y==null?void 0:y.fill});d.push(Ic({tooltipEntrySettings:$,dataKey:E,payload:R,value:he(R,E),name:j==null?void 0:String(j)}))});else{var b;d.push(Ic({tooltipEntrySettings:y,dataKey:x,payload:O,value:he(O,x),name:(b=he(O,A))!==null&&b!==void 0?b:y==null?void 0:y.name}))}return d},f)}},Pl=P([de,Sp,zu],wp),LE=P([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),RE=P([me,Hr],Ep),wr=P([LE,de,RE],Ip,{memoizeOptions:{resultEqualityCheck:Da}}),zE=P([wr],e=>e.filter(Yu)),xm=P([wr],jp,{memoizeOptions:{resultEqualityCheck:Da}}),BE=P([wr],e=>e.some(t=>!t.data)),pr=P([xm,ut],Mp),FE=P([zE,ut,de],Wh),Sl=P([pr,de,wr,ut,BE,xm],Dp),Am=P([de],yl),WE=P([de],e=>e.allowDataOverflow),Om=P([Am,WE],Ph),UE=P([wr],e=>e.filter(Yu)),KE=P([FE,UE,Ia,$h],Np),HE=P([KE,ut,me,Om],Rp),YE=P([wr],kp),GE=P([pr,de,YE,gl,me,O1],Fp,{memoizeOptions:{resultEqualityCheck:Ma}}),VE=P([Wp,me,Hr],Vr),qE=P([VE,me],Hp),XE=P([Up,me,Hr],Vr),ZE=P([XE,me],Yp),QE=P([Kp,me,Hr],Vr),JE=P([QE,me],Gp),e_=P([qE,JE,ZE],Yi),t_=P([de,Am,Om,HE,GE,e_,re,me],Vp),zr=P([de,re,pr,Sl,Ia,me,t_],qp),r_=P([zr,de,Pl],Xp),n_=P([de,zr,r_,me],Zp),Pm=e=>{var t=me(e),r=Hr(e),n=!1;return Wn(e,t,r,n)},Sm=P([de,Pm],Ca),i_=P([de,Pl,n_,Sm],hl),Em=P([i_],Gu),a_=P([re,Sl,de,me],am),o_=P([re,Sl,de,me],rm),u_=(e,t,r,n,i,a,o,u)=>{if(t){var l=t.type,c=bt(e,u);if(n){var s=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,f=l==="category"&&n.bandwidth?n.bandwidth()/s:0;return f=u==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?He(i[0]-i[1])*2*f:f,c&&o?o.map((d,v)=>{var p=n.map(d);return U(p)?{coordinate:p+f,value:d,index:v,offset:f}:null}).filter(De):n.domain().map((d,v)=>{var p=n.map(d);return U(p)?{coordinate:p+f,value:a?a[d]:d,index:v,offset:f}:null}).filter(De)}}},Lt=P([re,de,Pl,Em,Pm,a_,o_,me],u_),El=P([cm,sm,dE],(e,t,r)=>fm(r.shared,e,t)),_m=e=>e.tooltip.settings.trigger,_l=e=>e.tooltip.settings.defaultIndex,Kn=P([Xr,El,_m,_l],mm),_n=P([Kn,pr,Rr,zr],hn),Im=P([Lt,_n],dm),l_=P([Kn],e=>{if(e)return e.dataKey}),c_=P([Kn],e=>{if(e)return e.graphicalItemId}),Cm=P([Xr,El,_m,_l],gm),s_=P([Mt,Dt,re,Pe,Lt,_l,Cm],ym),f_=P([Kn,s_],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),d_=P([Kn],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),v_=P([Cm,_n,ut,Rr,Im,bm,El],wm),h_=P([v_],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function Of(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 Pf(e){for(var t=1;tN(de),b_=()=>{var e=g_(),t=N(Lt),r=N(Em);return Ei(!e||!r?void 0:Pf(Pf({},e),{},{scale:r}),t)};function Sf(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 Pr(e){for(var t=1;t{var i=t.find(a=>a&&a.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}},P_=(e,t,r,n)=>{var i=t.find(c=>c&&c.index===r);if(i){if(e==="centric"){var a=i.coordinate,o=n.radius;return Pr(Pr(Pr({},n),Ae(n.cx,n.cy,o,a)),{},{angle:a,radius:o})}var u=i.coordinate,l=n.angle;return Pr(Pr(Pr({},n),Ae(n.cx,n.cy,u,l)),{},{angle:l,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 S_(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 km=(e,t,r,n,i)=>{var a,o=(a=t==null?void 0:t.length)!==null&&a!==void 0?a:0;if(o<=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?(l=r[u-1])===null||l===void 0?void 0:l.coordinate:(c=r[o-1])===null||c===void 0?void 0:c.coordinate,p=(s=r[u])===null||s===void 0?void 0:s.coordinate,m=u>=o-1?(f=r[0])===null||f===void 0?void 0:f.coordinate:(d=r[u+1])===null||d===void 0?void 0:d.coordinate,y=void 0;if(!(v==null||p==null||m==null))if(He(p-v)!==He(m-p)){var g=[];if(He(m-p)===He(i[1]-i[0])){y=m;var w=p+i[1]-i[0];g[0]=Math.min(w,(w+v)/2),g[1]=Math.max(w,(w+v)/2)}else{y=v;var x=m+i[1]-i[0];g[0]=Math.min(p,(x+p)/2),g[1]=Math.max(p,(x+p)/2)}var A=[Math.min(p,(y+p)/2),Math.max(p,(y+p)/2)];if(e>A[0]&&e<=A[1]||e>=g[0]&&e<=g[1]){var O;return(O=r[u])===null||O===void 0?void 0:O.index}}else{var b=Math.min(v,m),S=Math.max(v,m);if(e>(b+p)/2&&e<=(S+p)/2){var _;return(_=r[u])===null||_===void 0?void 0:_.index}}}else if(t)for(var I=0;I(C.coordinate+E.coordinate)/2||I>0&&I(C.coordinate+E.coordinate)/2&&e<=(C.coordinate+j.coordinate)/2)return C.index}}return-1},jm=()=>N(zu),Il=(e,t)=>t,Tm=(e,t,r)=>r,Cl=(e,t,r,n)=>n,E_=P(Lt,e=>ua(e,t=>t.coordinate)),kl=P([Xr,Il,Tm,Cl],mm),jl=P([kl,pr,Rr,zr],hn),__=(e,t,r)=>{if(t!=null){var n=Xr(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},Mm=P([Xr,Il,Tm,Cl],gm),Vi=P([Mt,Dt,re,Pe,Lt,Cl,Mm],ym),I_=P([kl,Vi],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),Dm=P([Lt,jl],dm),C_=P([Mm,jl,ut,Rr,Dm,bm,Il],wm),k_=P([kl,jl],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),j_=(e,t,r,n,i,a,o)=>{if(!(!e||!r||!n||!i)&&S_(e,o)){var u=fw(e,t),l=km(u,a,i,r,n),c=O_(t,i,l,e);return{activeIndex:String(l),activeCoordinate:c}}},T_=(e,t,r,n,i,a,o)=>{if(!(!e||!n||!i||!a||!r)){var u=h1(e,r);if(u){var l=dw(u,t),c=km(l,o,a,n,i),s=P_(t,a,c,u);return{activeIndex:String(c),activeCoordinate:s}}}},M_=(e,t,r,n,i,a,o,u)=>{if(!(!e||!t||!n||!i||!a))return t==="horizontal"||t==="vertical"?j_(e,t,n,i,a,o,u):T_(e,t,r,n,i,a,o)},D_=P(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}}),$_=P(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(ke)),r=Array.from(new Set(t));return r.sort((n,i)=>n-i)},{memoizeOptions:{resultEqualityCheck:H1}});function Ef(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 _f(e){for(var t=1;t_f(_f({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),z_)},F_=new Set(Object.values(ke));function W_(e){return F_.has(e)}var $m=Ce({name:"zIndex",initialState:B_,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:Q()},unregisterZIndexPortal:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!W_(r)&&delete e.zIndexMap[r])},prepare:Q()},registerZIndexPortalElement:{reducer:(e,t)=>{var r=t.payload,n=r.zIndex,i=r.element,a=r.isPanorama;e.zIndexMap[n]?a?e.zIndexMap[n].panoramaElement=i:e.zIndexMap[n].element=i:e.zIndexMap[n]={consumers:0,element:a?void 0:i,panoramaElement:a?i:void 0}},prepare:Q()},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:Q()}}}),Ka=$m.actions,U_=Ka.registerZIndexPortal,vo=Ka.unregisterZIndexPortal,K_=Ka.registerZIndexPortalElement,H_=Ka.unregisterZIndexPortalElement,Y_=$m.reducer;function Rt(e){var t=e.zIndex,r=e.children,n=Xw(),i=n&&t!==void 0&&t!==0,a=$e(),o=h.useRef(void 0),u=h.useRef(new Set),l=le(),c=N(f=>D_(f,t,a));if(h.useLayoutEffect(()=>{if(!i){var f=u.current;f.forEach(v=>{l(vo({zIndex:v}))}),f.clear(),o.current=void 0;return}if(u.current.has(t)||(l(U_({zIndex:t})),u.current.add(t)),c){o.current=c;var d=u.current;d.forEach(v=>{v!==t&&(l(vo({zIndex:v})),d.delete(v))})}},[l,t,i,c]),h.useLayoutEffect(()=>{var f=u.current;return()=>{f.forEach(d=>{l(vo({zIndex:d}))}),f.clear()}},[l]),!i)return r;var s=c??o.current;return s?$d.createPortal(r,s):null}function nu(){return nu=Object.assign?Object.assign.bind():function(e){for(var t=1;th.useContext(Nm),ho={exports:{}},Cf;function eI(){return Cf||(Cf=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(l,c,s){this.fn=l,this.context=c,this.once=s||!1}function a(l,c,s,f,d){if(typeof s!="function")throw new TypeError("The listener must be a function");var v=new i(s,f||l,d),p=r?r+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],v]:l._events[p].push(v):(l._events[p]=v,l._eventsCount++),l}function o(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function u(){this._events=new n,this._eventsCount=0}u.prototype.eventNames=function(){var c=[],s,f;if(this._eventsCount===0)return c;for(f in s=this._events)t.call(s,f)&&c.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(s)):c},u.prototype.listeners=function(c){var s=r?r+c:c,f=this._events[s];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,v=f.length,p=new Array(v);d{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!ht(r))return e[r]}},iI={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},Lm=Ce({name:"options",initialState:iI,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),aI=Lm.reducer,oI=Lm.actions.createEventEmitter;function uI(e){return e.tooltip.syncInteraction}var lI={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},Rm=Ce({name:"chartData",initialState:lI,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)}}}),Tl=Rm.actions,jf=Tl.setChartData,cI=Tl.setDataStartEndIndexes;Tl.setComputedData;var sI=Rm.reducer,fI=["x","y"];function Tf(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 Sr(e){for(var t=1;tl.rootProps.className);h.useEffect(()=>{if(e==null)return Fr;var l=(c,s,f)=>{if(t!==f&&e===c){if(s.payload.active===!1){r(dn({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(n==="index"){var d;if(o&&s!==null&&s!==void 0&&(d=s.payload)!==null&&d!==void 0&&d.coordinate&&s.payload.sourceViewBox){var v=s.payload.coordinate,p=v.x,m=v.y,y=pI(v,fI),g=s.payload.sourceViewBox,w=g.x,x=g.y,A=g.width,O=g.height,b=Sr(Sr({},y),{},{x:o.x+(A?(p-w)/A:0)*o.width,y:o.y+(O?(m-x)/O:0)*o.height});r(Sr(Sr({},s),{},{payload:Sr(Sr({},s.payload),{},{coordinate:b})}))}else r(s);return}if(i!=null){var S;if(typeof n=="function"){var _={activeTooltipIndex:s.payload.index==null?void 0:Number(s.payload.index),isTooltipActive:s.payload.active,activeIndex:s.payload.index==null?void 0:Number(s.payload.index),activeLabel:s.payload.label,activeDataKey:s.payload.dataKey,activeCoordinate:s.payload.coordinate},I=n(i,_);S=i[I]}else n==="value"&&(S=i.find(Y=>String(Y.value)===s.payload.label));var C=s.payload.coordinate;if(C==null||o==null){r(dn({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(S==null){r(dn({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:s.payload.sourceViewBox,graphicalItemId:void 0}));return}var j=C.x,E=C.y,R=Math.min(j,o.x+o.width),$=Math.min(E,o.y+o.height),V={x:a==="horizontal"?S.coordinate:R,y:a==="horizontal"?$:S.coordinate},H=dn({active:s.payload.active,coordinate:V,dataKey:s.payload.dataKey,index:String(S.index),label:s.payload.label,sourceViewBox:s.payload.sourceViewBox,graphicalItemId:s.payload.graphicalItemId});r(H)}}};return In.on(iu,l),()=>{In.off(iu,l)}},[u,r,t,e,n,i,a,o])}function gI(){var e=N(Bu),t=N(Fu),r=le();h.useEffect(()=>{if(e==null)return Fr;var n=(i,a,o)=>{t!==o&&e===i&&r(cI(a))};return In.on(kf,n),()=>{In.off(kf,n)}},[r,t,e])}function bI(){var e=le();h.useEffect(()=>{e(oI())},[e]),yI(),gI()}function wI(e,t,r,n,i,a){var o=N(p=>__(p,e,t)),u=N(c_),l=N(Fu),c=N(Bu),s=N(Nh),f=N(uI),d=(f==null?void 0:f.sourceViewBox)!=null,v=Aa();h.useEffect(()=>{if(!d&&c!=null&&l!=null){var p=dn({active:a,coordinate:r,dataKey:o,index:i,label:typeof n=="number"?String(n):n,sourceViewBox:v,graphicalItemId:u});In.emit(iu,c,p,l)}},[d,r,o,u,i,n,l,c,s,a,v])}function Mf(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 Df(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{S(yE({shared:w,trigger:x,axisId:b,active:i,defaultIndex:_}))},[S,w,x,b,i,_]);var I=Aa(),C=ph(),j=fE(w),E=(t=N(z=>k_(z,j,x,_)))!==null&&t!==void 0?t:{},R=E.activeIndex,$=E.isActive,V=N(z=>C_(z,j,x,_)),H=N(z=>Dm(z,j,x,_)),Y=N(z=>I_(z,j,x,_)),B=V,q=J_(),W=(r=i??$)!==null&&r!==void 0?r:!1,Se=Z0([B,W]),ge=PI(Se,2),ae=ge[0],Ne=ge[1],Le=j==="axis"?H:void 0;wI(j,x,Y,Le,R,W);var Je=O??q;if(Je==null||I==null||j==null)return null;var et=B??Nf;W||(et=Nf),c&&et.length&&(et=S0(et.filter(z=>z.value!=null&&(z.hide!==!0||n.includeHidden)),d,CI));var Jr=et.length>0,T=Df(Df({},n),{},{payload:et,label:Le,active:W,activeIndex:R,coordinate:Y,accessibilityLayer:C}),F=h.createElement(lA,{allowEscapeViewBox:a,animationDuration:o,animationEasing:u,isAnimationActive:s,active:W,coordinate:Y,hasPayload:Jr,offset:f,position:v,reverseDirection:p,useTranslate3d:m,viewBox:I,wrapperStyle:y,lastBoundingBox:ae,innerRef:Ne,hasPortalFromProps:!!O},kI(l,T));return h.createElement(h.Fragment,null,$d.createPortal(F,Je),W&&h.createElement(Q_,{cursor:g,tooltipEventType:j,coordinate:Y,payload:et,index:R}))}function MI(e,t,r){return(t=DI(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DI(e){var t=$I(e,"string");return typeof t=="symbol"?t:t+""}function $I(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 NI{constructor(t){MI(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 Lf(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 LI(e){for(var t=1;t{try{var r=document.getElementById(zf);r||(r=document.createElement("span"),r.setAttribute("id",zf),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,WI,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},pn=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Nn.isSsr)return{width:0,height:0};if(!zm.enableCache)return Bf(t,r);var n=UI(t,r),i=Rf.get(n);if(i)return i;var a=Bf(t,r);return Rf.set(n,a),a},Bm;function qi(e,t){return GI(e)||YI(e,t)||HI(e,t)||KI()}function KI(){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 HI(e,t){if(e){if(typeof e=="string")return Ff(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)?Ff(e,t):void 0}}function Ff(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=[];Oe(t)||(r?i=t.toString().split(""):i=t.toString().split(Wm));var a=i.map(u=>({word:u,width:pn(u,n).width})),o=r?0:pn(" ",n).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function Km(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function vC(e){return Oe(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var Hm=(e,t,r,n)=>e.reduce((i,a)=>{var o=a.word,u=a.width,l=i[i.length-1];if(l&&u!=null&&(t==null||n||l.width+u+re.reduce((t,r)=>t.width>r.width?t:r),hC="…",Vf=(e,t,r,n,i,a,o,u)=>{var l=e.slice(0,t),c=Um({breakAll:r,style:n,children:l+hC});if(!c)return[!1,[]];var s=Hm(c.wordsWithComputedWidth,a,o,u),f=s.length>i||Ym(s).width>Number(a);return[f,s]},pC=(e,t,r,n,i)=>{var a=e.maxLines,o=e.children,u=e.style,l=e.breakAll,c=D(a),s=String(o),f=Hm(t,n,r,i);if(!c||i)return f;var d=f.length>a||Ym(f).width>Number(n);if(!d)return f;for(var v=0,p=s.length-1,m=0,y;v<=p&&m<=s.length-1;){var g=Math.floor((v+p)/2),w=g-1,x=Vf(s,w,l,u,a,n,r,i),A=Yf(x,2),O=A[0],b=A[1],S=Vf(s,g,l,u,a,n,r,i),_=Yf(S,1),I=_[0];if(!O&&!I&&(v=g+1),O&&I&&(p=g-1),!O&&I){y=b;break}m++}return y||f},qf=e=>{var t=Oe(e)?[]:e.toString().split(Wm);return[{words:t,width:void 0}]},mC=e=>{var t=e.width,r=e.scaleToFit,n=e.children,i=e.style,a=e.breakAll,o=e.maxLines;if((t||r)&&!Nn.isSsr){var u,l,c=Um({breakAll:a,children:n,style:i});if(c){var s=c.wordsWithComputedWidth,f=c.spaceWidth;u=s,l=f}else return qf(n);return pC({breakAll:a,children:n,maxLines:o,style:i},u,l,t,!!r)}return qf(n)},Gm="#808080",yC={angle:0,breakAll:!1,capHeight:"0.71em",fill:Gm,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Ml=h.forwardRef((e,t)=>{var r=Ze(e,yC),n=r.x,i=r.y,a=r.lineHeight,o=r.capHeight,u=r.fill,l=r.scaleToFit,c=r.textAnchor,s=r.verticalAnchor,f=Hf(r,oC),d=h.useMemo(()=>mC({breakAll:f.breakAll,children:f.children,maxLines:f.maxLines,scaleToFit:l,style:f.style,width:f.width}),[f.breakAll,f.children,f.maxLines,l,f.style,f.width]),v=f.dx,p=f.dy,m=f.angle,y=f.className,g=f.breakAll,w=Hf(f,uC);if(!pt(n)||!pt(i)||d.length===0)return null;var x=Number(n)+(D(v)?v:0),A=Number(i)+(D(p)?p:0);if(!U(x)||!U(A))return null;var O;switch(s){case"start":O=po("calc(".concat(o,")"));break;case"middle":O=po("calc(".concat((d.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:O=po("calc(".concat(d.length-1," * -").concat(a,")"));break}var b=[],S=d[0];if(l&&S!=null){var _=S.width,I=f.width;b.push("scale(".concat(D(I)&&D(_)?I/_:1,")"))}return m&&b.push("rotate(".concat(m,", ").concat(x,", ").concat(A,")")),b.length&&(w.transform=b.join(" ")),h.createElement("text",au({},Ve(w),{ref:t,x,y:A,className:ee("recharts-text",y),textAnchor:c,fill:u.includes("url")?Gm:u}),d.map((C,j)=>{var E=C.words.join(g?"":" ");return h.createElement("tspan",{x,dy:j===0?O:a,key:"".concat(E,"-").concat(j)},E)}))});Ml.displayName="Text";function Xf(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 st(e){for(var t=1;t{var t=e.viewBox,r=e.position,n=e.offset,i=n===void 0?0:n,a=e.parentViewBox,o=ku(t),u=o.x,l=o.y,c=o.height,s=o.upperWidth,f=o.lowerWidth,d=u,v=u+(s-f)/2,p=(d+v)/2,m=(s+f)/2,y=d+s/2,g=c>=0?1:-1,w=g*i,x=g>0?"end":"start",A=g>0?"start":"end",O=s>=0?1:-1,b=O*i,S=O>0?"end":"start",_=O>0?"start":"end",I=a;if(r==="top"){var C={x:d+s/2,y:l-w,horizontalAnchor:"middle",verticalAnchor:x};return I&&(C.height=Math.max(l-I.y,0),C.width=s),C}if(r==="bottom"){var j={x:v+f/2,y:l+c+w,horizontalAnchor:"middle",verticalAnchor:A};return I&&(j.height=Math.max(I.y+I.height-(l+c),0),j.width=f),j}if(r==="left"){var E={x:p-b,y:l+c/2,horizontalAnchor:S,verticalAnchor:"middle"};return I&&(E.width=Math.max(E.x-I.x,0),E.height=c),E}if(r==="right"){var R={x:p+m+b,y:l+c/2,horizontalAnchor:_,verticalAnchor:"middle"};return I&&(R.width=Math.max(I.x+I.width-R.x,0),R.height=c),R}var $=I?{width:m,height:c}:{};return r==="insideLeft"?st({x:p+b,y:l+c/2,horizontalAnchor:_,verticalAnchor:"middle"},$):r==="insideRight"?st({x:p+m-b,y:l+c/2,horizontalAnchor:S,verticalAnchor:"middle"},$):r==="insideTop"?st({x:d+s/2,y:l+w,horizontalAnchor:"middle",verticalAnchor:A},$):r==="insideBottom"?st({x:v+f/2,y:l+c-w,horizontalAnchor:"middle",verticalAnchor:x},$):r==="insideTopLeft"?st({x:d+b,y:l+w,horizontalAnchor:_,verticalAnchor:A},$):r==="insideTopRight"?st({x:d+s-b,y:l+w,horizontalAnchor:S,verticalAnchor:A},$):r==="insideBottomLeft"?st({x:v+b,y:l+c-w,horizontalAnchor:_,verticalAnchor:x},$):r==="insideBottomRight"?st({x:v+f-b,y:l+c-w,horizontalAnchor:S,verticalAnchor:x},$):r&&typeof r=="object"&&(D(r.x)||sr(r.x))&&(D(r.y)||sr(r.y))?st({x:u+Yt(r.x,m),y:l+Yt(r.y,c),horizontalAnchor:"end",verticalAnchor:"end"},$):st({x:y,y:l+c/2,horizontalAnchor:"middle",verticalAnchor:"middle"},$)},AC=["labelRef"],OC=["content"];function Zf(e,t){if(e==null)return{};var r,n,i=PC(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n{var t=e.x,r=e.y,n=e.upperWidth,i=e.lowerWidth,a=e.width,o=e.height,u=e.children,l=h.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:i,width:a,height:o}),[t,r,n,i,a,o]);return h.createElement(Vm.Provider,{value:l},u)},qm=()=>{var e=h.useContext(Vm),t=Aa();return e||(t?ku(t):void 0)},CC=h.createContext(null),kC=()=>{var e=h.useContext(CC),t=N(Fh);return e||t},jC=e=>{var t=e.value,r=e.formatter,n=Oe(e.children)?t:e.children;return typeof r=="function"?r(n):n},Dl=e=>e!=null&&typeof e=="function",TC=(e,t)=>{var r=He(t-e),n=Math.min(Math.abs(t-e),360);return r*n},MC=(e,t,r,n,i)=>{var a=e.offset,o=e.className,u=i.cx,l=i.cy,c=i.innerRadius,s=i.outerRadius,f=i.startAngle,d=i.endAngle,v=i.clockWise,p=(c+s)/2,m=TC(f,d),y=m>=0?1:-1,g,w;switch(t){case"insideStart":g=f+y*a,w=v;break;case"insideEnd":g=d-y*a,w=!v;break;case"end":g=d+y*a,w=v;break;default:throw new Error("Unsupported position ".concat(t))}w=m<=0?w:!w;var x=Ae(u,l,p,g),A=Ae(u,l,p,g+(w?1:-1)*359),O="M".concat(x.x,",").concat(x.y,` - A`).concat(p,",").concat(p,",0,1,").concat(w?0:1,`, - `).concat(A.x,",").concat(A.y),b=Oe(e.id)?yn("recharts-radial-line-"):e.id;return h.createElement("text",At({},n,{dominantBaseline:"central",className:ee("recharts-radial-bar-label",o)}),h.createElement("defs",null,h.createElement("path",{id:b,d:O})),h.createElement("textPath",{xlinkHref:"#".concat(b)},r))},DC=(e,t,r)=>{var n=e.cx,i=e.cy,a=e.innerRadius,o=e.outerRadius,u=e.startAngle,l=e.endAngle,c=(u+l)/2;if(r==="outside"){var s=Ae(n,i,o+t,c),f=s.x,d=s.y;return{x:f,y:d,textAnchor:f>=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 v=(a+o)/2,p=Ae(n,i,v,c),m=p.x,y=p.y;return{x:m,y,textAnchor:"middle",verticalAnchor:"middle"}},fi=e=>e!=null&&"cx"in e&&D(e.cx),$C={angle:0,offset:5,zIndex:ke.label,position:"middle",textBreakAll:!1};function NC(e){if(!fi(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 Ft(e){var t=Ze(e,$C),r=t.viewBox,n=t.parentViewBox,i=t.position,a=t.value,o=t.children,u=t.content,l=t.className,c=l===void 0?"":l,s=t.textBreakAll,f=t.labelRef,d=kC(),v=qm(),p=i==="center"?v:d??v,m,y,g;r==null?m=p:fi(r)?m=r:m=ku(r);var w=NC(m);if(!m||Oe(a)&&Oe(o)&&!h.isValidElement(u)&&typeof u!="function")return null;var x=vn(vn({},t),{},{viewBox:m});if(h.isValidElement(u)){x.labelRef;var A=Zf(x,AC);return h.cloneElement(u,A)}if(typeof u=="function"){x.content;var O=Zf(x,OC);if(y=h.createElement(u,O),h.isValidElement(y))return y}else y=jC(t);var b=Ve(t);if(fi(m)){if(i==="insideStart"||i==="insideEnd"||i==="end")return MC(t,i,y,b,m);g=DC(m,t.offset,t.position)}else{if(!w)return null;var S=xC({viewBox:w,position:i,offset:t.offset,parentViewBox:fi(n)?void 0:n});g=vn(vn({x:S.x,y:S.y,textAnchor:S.horizontalAnchor,verticalAnchor:S.verticalAnchor},S.width!==void 0?{width:S.width}:{}),S.height!==void 0?{height:S.height}:{})}return h.createElement(Rt,{zIndex:t.zIndex},h.createElement(Ml,At({ref:f,className:ee("recharts-label",c)},b,g,{textAnchor:Km(b.textAnchor)?b.textAnchor:g.textAnchor,breakAll:s}),y))}Ft.displayName="Label";var LC=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?h.createElement(Ft,At({key:"label-implicit"},n)):pt(e)?h.createElement(Ft,At({key:"label-implicit",value:e},n)):h.isValidElement(e)?e.type===Ft?h.cloneElement(e,vn({key:"label-implicit"},n)):h.createElement(Ft,At({key:"label-implicit",content:e},n)):Dl(e)?h.createElement(Ft,At({key:"label-implicit",content:e},n)):e&&typeof e=="object"?h.createElement(Ft,At({},e,{key:"label-implicit"},n)):null};function RC(e){var t=e.label,r=e.labelRef,n=qm();return LC(t,n,r)||null}var zC=["valueAccessor"],BC=["dataKey","clockWise","id","textBreakAll","zIndex"];function Xi(){return Xi=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(vC(t))return t},Xm=h.createContext(void 0),UC=Xm.Provider,Zm=h.createContext(void 0);Zm.Provider;function KC(){return h.useContext(Xm)}function HC(){return h.useContext(Zm)}function di(e){var t=e.valueAccessor,r=t===void 0?WC:t,n=Jf(e,zC),i=n.dataKey;n.clockWise;var a=n.id,o=n.textBreakAll,u=n.zIndex,l=Jf(n,BC),c=KC(),s=HC(),f=c||s;return!f||!f.length?null:h.createElement(Rt,{zIndex:u??ke.label},h.createElement(qe,{className:"recharts-label-list"},f.map((d,v)=>{var p,m=Oe(i)?r(d,v):he(d.payload,i),y=Oe(a)?{}:{id:"".concat(a,"-").concat(v)};return h.createElement(Ft,Xi({key:"label-".concat(v)},Ve(d),l,y,{fill:(p=n.fill)!==null&&p!==void 0?p:d.fill,parentViewBox:d.parentViewBox,value:m,textBreakAll:o,viewBox:d.viewBox,index:v,zIndex:0}))})))}di.displayName="LabelList";function YC(e){var t=e.label;return t?t===!0?h.createElement(di,{key:"labelList-implicit"}):h.isValidElement(t)||Dl(t)?h.createElement(di,{key:"labelList-implicit",content:t}):typeof t=="object"?h.createElement(di,Xi({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function ou(){return ou=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,a=ee("recharts-dot",i);return D(t)&&D(r)&&D(n)?h.createElement("circle",ou({},it(e),wu(e),{className:a,cx:t,cy:r,r:n})):null},GC={radiusAxis:{},angleAxis:{}},Jm=Ce({name:"polarAxis",initialState:GC,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]}}}),Ha=Jm.actions;Ha.addRadiusAxis;Ha.removeRadiusAxis;Ha.addAngleAxis;Ha.removeAngleAxis;var VC=Jm.reducer;function qC(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var ey=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function ed(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 td(e){for(var t=1;t{n||(i.current===null?r(hE(t)):i.current!==t&&r(pE({prev:i.current,next:t})),i.current=t)},[t,r,n]),h.useLayoutEffect(()=>()=>{i.current&&(r(mE(i.current)),i.current=null)},[r]),null}function ak(e){var t=e.legendPayload,r=le(),n=$e(),i=h.useRef(null);return h.useLayoutEffect(()=>{n||(i.current===null?r(cx(t)):i.current!==t&&r(sx({prev:i.current,next:t})),i.current=t)},[r,n,t]),h.useLayoutEffect(()=>()=>{i.current&&(r(fx(i.current)),i.current=null)},[r]),null}function ok(e,t){return sk(e)||ck(e,t)||lk(e,t)||uk()}function uk(){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 lk(e,t){if(e){if(typeof e=="string")return rd(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)?rd(e,t):void 0}}function rd(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 a=0;ae[Math.floor(a*r)]);return Nl(n,t)}function vk(e,t){var r=t.map((n,i)=>e[i]);return Nl(r,t)}function hk(e,t){for(var r=new Map,n=0;n{var v=r(f,d);if(v!=null){var p=n.get(v);if(p!==void 0)return i.add(v),p}}),o=[];for(var u of n){var l=ok(u,2),c=l[0],s=l[1];i.has(c)||o.push(s)}return Nl(a,t,o)}function uu(e,t,r){return t==null?null:e==null?t.map(n=>({status:"added",next:n})):r===$l?dk(e,t):r===fk?vk(e,t):pk(e,t,r)}function ry(e,t){var r=h.useRef(e),n=h.useRef(t.current),i=h.useRef(!0);r.current!==e&&(r.current=e,n.current=t.current,i.current=!1);var a=h.useCallback(function(o,u){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(u===0){i.current=!0;return}u===1&&(n.current=o),u>0&&i.current&&l&&(t.current=o)},[t]);return{startValue:n.current,syncStepValue:a}}function mk(e,t){return wk(e)||bk(e,t)||gk(e,t)||yk()}function yk(){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 gk(e,t){if(e){if(typeof e=="string")return nd(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)?nd(e,t):void 0}}function nd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{typeof e=="function"&&e(),a(!0)},[e]),u=h.useCallback(()=>{typeof t=="function"&&t(),a(!1)},[t]);return{isAnimating:i,handleAnimationStart:o,handleAnimationEnd:u}}function Ak(e){var t,r=e.animationInput,n=e.animationIdPrefix,i=e.items,a=e.previousItemsRef,o=e.isAnimationActive,u=e.animationBegin,l=e.animationDuration,c=e.animationEasing,s=e.onAnimationStart,f=e.onAnimationEnd,d=e.animationInterpolateFn,v=e.animationMatchBy,p=e.shouldUpdatePreviousRef,m=e.children,y=e.layout,g=wh(r,n),w=ry(g,a),x=(t=w.startValue)!==null&&t!==void 0?t:null,A=uu(x,i,v??$l);return h.createElement(bh,{animationId:g,begin:u,duration:l,isActive:o,easing:c,onAnimationEnd:f,onAnimationStart:s,key:g},O=>{var b=x==null,S=i==null?i:d(A,O,y),_=p?p(O):O>0;return w.syncStepValue(S,O,_),S==null?null:m(S,O,b)})}var mo;function Ok(e,t){return _k(e)||Ek(e,t)||Sk(e,t)||Pk()}function Pk(){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 Sk(e,t){if(e){if(typeof e=="string")return id(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)?id(e,t):void 0}}function id(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var e=h.useState(()=>yn("uid-")),t=Ok(e,1),r=t[0];return r},ny=(mo=Gy.useId)!==null&&mo!==void 0?mo:Ik;function Ck(e,t){var r=ny();return t||(e?"".concat(e,"-").concat(r):r)}var kk=h.createContext(void 0),jk=e=>{var t=e.id,r=e.type,n=e.children,i=Ck("recharts-".concat(r),t);return h.createElement(kk.Provider,{value:i},n(i))},Tk={cartesianItems:[],polarItems:[]},iy=Ce({name:"graphicalItems",initialState:Tk,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Q()},replaceCartesianGraphicalItem:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,a=Ye(e).cartesianItems.indexOf(n);a>-1&&(e.cartesianItems[a]=i)},prepare:Q()},removeCartesianGraphicalItem:{reducer(e,t){var r=Ye(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:Q()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Q()},removePolarGraphicalItem:{reducer(e,t){var r=Ye(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:Q()},replacePolarGraphicalItem:{reducer(e,t){var r=t.payload,n=r.prev,i=r.next,a=Ye(e).polarItems.indexOf(n);a>-1&&(e.polarItems[a]=i)},prepare:Q()}}}),Zr=iy.actions,Mk=Zr.addCartesianGraphicalItem,Dk=Zr.replaceCartesianGraphicalItem,$k=Zr.removeCartesianGraphicalItem;Zr.addPolarGraphicalItem;Zr.removePolarGraphicalItem;Zr.replacePolarGraphicalItem;var Nk=iy.reducer,Lk=e=>{var t=le(),r=h.useRef(null);return h.useLayoutEffect(()=>{r.current===null?t(Mk(e)):r.current!==e&&t(Dk({prev:r.current,next:e})),r.current=e},[t,e]),h.useLayoutEffect(()=>()=>{r.current&&(t($k(r.current)),r.current=null)},[t]),null},Rk=h.memo(Lk),zk=["points"];function ad(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 yo(e){for(var t=1;t{var g,w,x=yo(yo(yo({r:3},o),d),{},{index:y,cx:(g=m.x)!==null&&g!==void 0?g:void 0,cy:(w=m.y)!==null&&w!==void 0?w:void 0,dataKey:a,value:m.value,payload:m.payload,points:t});return h.createElement(Hk,{key:"dot-".concat(y),option:r,dotProps:x,className:i})}),p={};return u&&l!=null&&(p.clipPath="url(#clipPath-".concat(f?"":"dots-").concat(l,")")),h.createElement(Rt,{zIndex:s},h.createElement(qe,Zi({className:n},p),v))}function od(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 ud(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),uj=P([oj,Mt,Dt],(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)}}),Ll=()=>N(uj),lj=()=>N(h_);function ld(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 go(e){for(var t=1;t{var t=e.point,r=e.childIndex,n=e.mainColor,i=e.activeDot,a=e.dataKey,o=e.clipPath;if(i===!1||t.x==null||t.y==null)return null;var u={index:r,dataKey:a,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},l=go(go(go({},u),ia(i)),wu(i)),c;return h.isValidElement(i)?c=h.cloneElement(i,l):typeof i=="function"?c=i(l):c=h.createElement(Qm,l),h.createElement(qe,{className:"recharts-active-dot",clipPath:o},c)};function cd(e){var t=e.points,r=e.mainColor,n=e.activeDot,i=e.itemDataKey,a=e.clipPath,o=e.zIndex,u=o===void 0?ke.activeDot:o,l=N(_n),c=lj();if(t==null||c==null)return null;var s=t.find(f=>c.includes(f.payload));return Oe(s)?null:h.createElement(Rt,{zIndex:u},h.createElement(dj,{point:s,childIndex:Number(l),mainColor:r,dataKey:i,activeDot:n,clipPath:a}))}var vj=e=>{var t=e.chartData,r=le(),n=$e();return h.useEffect(()=>n?()=>{}:(r(jf(t)),()=>{r(jf(void 0))}),[t,r,n]),null},sd={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},uy=Ce({name:"brush",initialState:sd,reducers:{setBrushSettings(e,t){return t.payload==null?sd:t.payload}}});uy.actions.setBrushSettings;var hj=uy.reducer;function pj(e){return(e%180+180)%180}var mj=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=pj(i),o=a*Math.PI/180,u=Math.atan(n/r),l=o>u&&o{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=Ye(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=Ye(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=Ye(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),Qr=ly.actions;Qr.addDot;Qr.removeDot;Qr.addArea;Qr.removeArea;Qr.addLine;Qr.removeLine;var gj=ly.reducer;function bj(e,t){return Oj(e)||Aj(e,t)||xj(e,t)||wj()}function wj(){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 xj(e,t){if(e){if(typeof e=="string")return fd(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)?fd(e,t):void 0}}function fd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.children,r=h.useState("".concat(yn("recharts"),"-clip")),n=bj(r,1),i=n[0],a=Ll();if(a==null)return null;var o=a.x,u=a.y,l=a.width,c=a.height;return h.createElement(Pj.Provider,{value:i},h.createElement("defs",null,h.createElement("clipPath",{id:i},h.createElement("rect",{x:o,y:u,height:c,width:l}))),t)};function cy(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;ne*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function Ij(e,t){return cy(e,t+1)}function Cj(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,u=t.end,l=0,c=1,s=o,f=function(){var p=n==null?void 0:n[l];if(p===void 0)return{v:cy(n,c)};var m=l,y,g=()=>(y===void 0&&(y=r(p,m)),y),w=p.coordinate,x=l===0||Cn(e,w,g,s,u);x||(l=0,s=o,c+=1),x&&(s=w+e*(g()/2+i),l+=c)},d;c<=a.length;)if(d=f(),d)return d.v;return[]}function kj(e,t,r,n,i){var a=(n||[]).slice(),o=a.length;if(o===0)return[];for(var u=t.start,l=t.end,c=1;c<=o;c++){for(var s=(o-1)%c,f=u,d=!0,v=function(){var A=n[m];if(A==null)return 0;var O=m,b,S=()=>(b===void 0&&(b=r(A,O)),b),_=A.coordinate,I=m===s||Cn(e,_,S,f,l);if(!I)return d=!1,1;I&&(f=_+e*(S()/2+i))},p,m=s;m(m===void 0&&(m=r(v,d)),m);if(d===o-1){var g=e*(p.coordinate+e*y()/2-l);a[d]=p=_e(_e({},p),{},{tickCoord:g>0?p.coordinate-g*e:p.coordinate})}else a[d]=p=_e(_e({},p),{},{tickCoord:p.coordinate});if(p.tickCoord!=null){var w=Cn(e,p.tickCoord,y,u,l);w&&(l=p.tickCoord-e*(y()/2+i),a[d]=_e(_e({},p),{},{isShow:!0}))}},s=o-1;s>=0;s--)c(s);return a}function $j(e,t,r,n,i,a){var o=(n||[]).slice(),u=o.length,l=t.start,c=t.end;if(a){var s=n[u-1];if(s!=null){var f=r(s,u-1),d=e*(s.coordinate+e*f/2-c);if(o[u-1]=s=_e(_e({},s),{},{tickCoord:d>0?s.coordinate-d*e:s.coordinate}),s.tickCoord!=null){var v=Cn(e,s.tickCoord,()=>f,l,c);v&&(c=s.tickCoord-e*(f/2+i),o[u-1]=_e(_e({},s),{},{isShow:!0}))}}}for(var p=a?u-1:u,m=function(w){var x=o[w];if(x==null)return 1;var A=x,O,b=()=>(O===void 0&&(O=r(x,w)),O);if(w===0){var S=e*(A.coordinate-e*b()/2-l);o[w]=A=_e(_e({},A),{},{tickCoord:S<0?A.coordinate-S*e:A.coordinate})}else o[w]=A=_e(_e({},A),{},{tickCoord:A.coordinate});if(A.tickCoord!=null){var _=Cn(e,A.tickCoord,b,l,c);_&&(l=A.tickCoord+e*(b()/2+i),o[w]=_e(_e({},A),{},{isShow:!0}))}},y=0;y{var S=typeof c=="function"?c(O.value,b):O.value;return p==="width"?Ej(pn(S,{fontSize:t,letterSpacing:r}),m,f):pn(S,{fontSize:t,letterSpacing:r})[p]},g=i[0],w=i[1],x=i.length>=2&&g!=null&&w!=null?He(w.coordinate-g.coordinate):1,A=_j(a,x,p);return l==="equidistantPreserveStart"?Cj(x,A,y,i,o):l==="equidistantPreserveEnd"?kj(x,A,y,i,o):(l==="preserveStart"||l==="preserveStartEnd"?v=$j(x,A,y,i,o,l==="preserveStartEnd"):v=Dj(x,A,y,i,o),v.filter(O=>O.isShow))}var Nj=e=>{var t=e.ticks,r=e.label,n=e.labelGapWithTick,i=n,a=e.tickSize,o=a===void 0?0:a,u=e.tickMargin,l=u===void 0?0:u,c=0;if(t){Array.from(t).forEach(v=>{if(v){var p=v.getBoundingClientRect();p.width>c&&(c=p.width)}});var s=r?r.getBoundingClientRect().width:0,f=o+l,d=c+f+s+(r?i:0);return Math.round(d)}return 0},Lj={xAxis:{},yAxis:{}},sy=Ce({name:"renderedTicks",initialState:Lj,reducers:{setRenderedTicks:(e,t)=>{var r=t.payload,n=r.axisType,i=r.axisId,a=r.ticks;e[n][i]=a},removeRenderedTicks:(e,t)=>{var r=t.payload,n=r.axisType,i=r.axisId;delete e[n][i]}}}),fy=sy.actions,Rj=fy.setRenderedTicks,zj=fy.removeRenderedTicks,Bj=sy.reducer,Fj=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function vd(e,t){return Hj(e)||Kj(e,t)||Uj(e,t)||Wj()}function Wj(){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 Uj(e,t){if(e){if(typeof e=="string")return hd(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)?hd(e,t):void 0}}function hd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(n==null||r==null)return Fr;var a=t.map(o=>({value:o.value,coordinate:o.coordinate,offset:o.offset,index:o.index}));return i(Rj({ticks:a,axisId:n,axisType:r})),()=>{i(zj({axisId:n,axisType:r}))}},[i,t,n,r]),null}var nT=h.forwardRef((e,t)=>{var r=e.ticks,n=r===void 0?[]:r,i=e.tick,a=e.tickLine,o=e.stroke,u=e.tickFormatter,l=e.unit,c=e.padding,s=e.tickTextProps,f=e.orientation,d=e.mirror,v=e.x,p=e.y,m=e.width,y=e.height,g=e.tickSize,w=e.tickMargin,x=e.fontSize,A=e.letterSpacing,O=e.getTicksConfig,b=e.events,S=e.axisType,_=e.axisId,I=Rl(ie(ie({},O),{},{ticks:n}),x,A),C=it(O),j=ia(i),E=Km(C.textAnchor)?C.textAnchor:Jj(f,d),R=eT(f,d),$={};typeof a=="object"&&($=a);var V=ie(ie({},C),{},{fill:"none"},$),H=I.map(q=>ie({entry:q},Qj(q,v,p,m,y,f,g,d,w))),Y=H.map(q=>{var W=q.entry,Se=q.line;return h.createElement(qe,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(W.value,"-").concat(W.coordinate,"-").concat(W.tickCoord)},a&&h.createElement("line",mr({},V,Se,{className:ee("recharts-cartesian-axis-tick-line",yr(a,"className"))})))}),B=H.map((q,W)=>{var Se,ge,ae=q.entry,Ne=q.tick,Le=ie(ie(ie(ie({verticalAnchor:R},C),{},{textAnchor:E,stroke:"none",fill:o},Ne),{},{index:W,payload:ae,visibleTicksCount:I.length,tickFormatter:u,padding:c},s),{},{angle:(Se=(ge=s==null?void 0:s.angle)!==null&&ge!==void 0?ge:C.angle)!==null&&Se!==void 0?Se:0}),Je=ie(ie({},Le),j);return h.createElement(qe,mr({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(ae.value,"-").concat(ae.coordinate,"-").concat(ae.tickCoord)},Mg(b,ae,W)),i&&h.createElement(tT,{option:i,tickProps:Je,value:"".concat(typeof u=="function"?u(ae.value,W):ae.value).concat(l||"")}))});return h.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(S,"-ticks")},h.createElement(rT,{ticks:I,axisId:_,axisType:S}),B.length>0&&h.createElement(Rt,{zIndex:ke.label},h.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(S,"-tick-labels"),ref:t},B)),Y.length>0&&h.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(S,"-tick-lines")},Y))}),iT=h.forwardRef((e,t)=>{var r=e.axisLine,n=e.width,i=e.height,a=e.className,o=e.hide,u=e.ticks,l=e.axisType,c=e.axisId,s=Yj(e,Fj),f=h.useState(""),d=vd(f,2),v=d[0],p=d[1],m=h.useState(""),y=vd(m,2),g=y[0],w=y[1],x=h.useRef(null);h.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var O;return Nj({ticks:x.current,label:(O=e.labelRef)===null||O===void 0?void 0:O.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var A=h.useCallback(O=>{if(O){var b=O.getElementsByClassName("recharts-cartesian-axis-tick-value");x.current=b;var S=b[0];if(S){var _=window.getComputedStyle(S),I=_.fontSize,C=_.letterSpacing;(I!==v||C!==g)&&(p(I),w(C))}}},[v,g]);return o||n!=null&&n<=0||i!=null&&i<=0?null:h.createElement(Rt,{zIndex:e.zIndex},h.createElement(qe,{className:ee("recharts-cartesian-axis",a)},h.createElement(Zj,{x:e.x,y:e.y,width:n,height:i,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:it(e)}),h.createElement(nT,{ref:A,axisType:l,events:s,fontSize:v,getTicksConfig:e,height:e.height,letterSpacing:g,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:c}),h.createElement(IC,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},h.createElement(RC,{label:e.label,labelRef:e.labelRef}),e.children)))}),zl=h.forwardRef((e,t)=>{var r=Ze(e,_t);return h.createElement(iT,mr({},r,{ref:t}))});zl.displayName="CartesianAxis";var aT=["x1","y1","x2","y2","key"],oT=["offset"],uT=["xAxisId","yAxisId"],lT=["xAxisId","yAxisId"];function md(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 Ie(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,a=e.width,o=e.height,u=e.ry;return h.createElement("rect",{x:n,y:i,ry:u,width:a,height:o,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function dy(e){var t=e.option,r=e.lineItemProps,n;if(h.isValidElement(t))n=h.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var i,a=r.x1,o=r.y1,u=r.x2,l=r.y2,c=r.key,s=Qi(r,aT),f=(i=it(s))!==null&&i!==void 0?i:{};f.offset;var d=Qi(f,oT);n=h.createElement("line",or({},d,{x1:a,y1:o,x2:u,y2:l,fill:"none",key:c}))}return n}function hT(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,a=e.horizontalPoints;if(!i||!a||!a.length)return null;e.xAxisId,e.yAxisId;var o=Qi(e,uT),u=a.map((l,c)=>{var s=Ie(Ie({},o),{},{x1:t,y1:l,x2:t+r,y2:l,key:"line-".concat(c),index:c});return h.createElement(dy,{key:"line-".concat(c),option:i,lineItemProps:s})});return h.createElement("g",{className:"recharts-cartesian-grid-horizontal"},u)}function pT(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,a=e.verticalPoints;if(!i||!a||!a.length)return null;e.xAxisId,e.yAxisId;var o=Qi(e,lT),u=a.map((l,c)=>{var s=Ie(Ie({},o),{},{x1:l,y1:t,x2:l,y2:t+r,key:"line-".concat(c),index:c});return h.createElement(dy,{option:i,lineItemProps:s,key:"line-".concat(c)})});return h.createElement("g",{className:"recharts-cartesian-grid-vertical"},u)}function mT(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,a=e.width,o=e.height,u=e.horizontalPoints,l=e.horizontal,c=l===void 0?!0:l;if(!c||!t||!t.length||u==null)return null;var s=u.map(d=>Math.round(d+i-i)).sort((d,v)=>d-v);i!==s[0]&&s.unshift(0);var f=s.map((d,v)=>{var p=s[v+1],m=p==null,y=m?i+o-d:p-d;if(y<=0)return null;var g=v%t.length;return h.createElement("rect",{key:"react-".concat(v),y:d,x:n,height:y,width:a,stroke:"none",fill:t[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return h.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function yT(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,u=e.width,l=e.height,c=e.verticalPoints;if(!r||!n||!n.length)return null;var s=c.map(d=>Math.round(d+a-a)).sort((d,v)=>d-v);a!==s[0]&&s.unshift(0);var f=s.map((d,v)=>{var p=s[v+1],m=p==null,y=m?a+u-d:p-d;if(y<=0)return null;var g=v%n.length;return h.createElement("rect",{key:"react-".concat(v),x:d,y:o,width:y,height:l,stroke:"none",fill:n[g],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return h.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var gT=(e,t)=>{var r=e.xAxis,n=e.width,i=e.height,a=e.offset;return qv(Rl(Ie(Ie(Ie({},_t),r),{},{ticks:Xv(r),viewBox:{x:0,y:0,width:n,height:i}})),a.left,a.left+a.width,t)},bT=(e,t)=>{var r=e.yAxis,n=e.width,i=e.height,a=e.offset;return qv(Rl(Ie(Ie(Ie({},_t),r),{},{ticks:Xv(r),viewBox:{x:0,y:0,width:n,height:i}})),a.top,a.top+a.height,t)},wT={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:ke.grid};function vy(e){var t=ih(),r=ah(),n=nh(),i=Ie(Ie({},Ze(e,wT)),{},{x:D(e.x)?e.x:n.left,y:D(e.y)?e.y:n.top,width:D(e.width)?e.width:n.width,height:D(e.height)?e.height:n.height}),a=i.xAxisId,o=i.yAxisId,u=i.x,l=i.y,c=i.width,s=i.height,f=i.syncWithTicks,d=i.horizontalValues,v=i.verticalValues,p=$e(),m=N(I=>gf(I,"xAxis",a,p)),y=N(I=>gf(I,"yAxis",o,p));if(!mt(c)||!mt(s)||!D(u)||!D(l))return null;var g=i.verticalCoordinatesGenerator||gT,w=i.horizontalCoordinatesGenerator||bT,x=i.horizontalPoints,A=i.verticalPoints;if((!x||!x.length)&&typeof w=="function"){var O=d&&d.length,b=w({yAxis:y?Ie(Ie({},y),{},{ticks:O?d:y.ticks}):void 0,width:t??c,height:r??s,offset:n},O?!0:f);_i(Array.isArray(b),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof b,"]")),Array.isArray(b)&&(x=b)}if((!A||!A.length)&&typeof g=="function"){var S=v&&v.length,_=g({xAxis:m?Ie(Ie({},m),{},{ticks:S?v:m.ticks}):void 0,width:t??c,height:r??s,offset:n},S?!0:f);_i(Array.isArray(_),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof _,"]")),Array.isArray(_)&&(A=_)}return h.createElement(Rt,{zIndex:i.zIndex},h.createElement("g",{className:"recharts-cartesian-grid"},h.createElement(vT,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),h.createElement(mT,or({},i,{horizontalPoints:x})),h.createElement(yT,or({},i,{verticalPoints:A})),h.createElement(hT,or({},i,{offset:n,horizontalPoints:x,xAxis:m,yAxis:y})),h.createElement(pT,or({},i,{offset:n,verticalPoints:A,xAxis:m,yAxis:y}))))}vy.displayName="CartesianGrid";var xT={},hy=Ce({name:"errorBars",initialState:xT,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,a=r.next;e[n]&&(e[n]=e[n].map(o=>o.dataKey===i.dataKey&&o.direction===i.direction?a:o))},removeErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,i=r.errorBar;e[n]&&(e[n]=e[n].filter(a=>a.dataKey!==i.dataKey||a.direction!==i.direction))}}}),Bl=hy.actions;Bl.addErrorBar;Bl.replaceErrorBar;Bl.removeErrorBar;var AT=hy.reducer;function py(e,t){var r,n,i=N(c=>$t(c,e)),a=N(c=>Nt(c,t)),o=(r=i==null?void 0:i.allowDataOverflow)!==null&&r!==void 0?r:ce.allowDataOverflow,u=(n=a==null?void 0:a.allowDataOverflow)!==null&&n!==void 0?n:se.allowDataOverflow,l=o||u;return{needClip:l,needClipX:o,needClipY:u}}function OT(e){var t=e.xAxisId,r=e.yAxisId,n=e.clipPathId,i=Ll(),a=py(t,r),o=a.needClipX,u=a.needClipY,l=a.needClip,c=N(x=>Jp(x,t,!1)),s=N(x=>em(x,r,!1));if(!l||!i)return null;var f=i.x,d=i.y,v=i.width,p=i.height,m=o&&c?Math.min(c[0],c[1]):f-v/2,y=u&&s?Math.min(s[0],s[1]):d-p/2,g=o&&c?Math.abs(c[1]-c[0]):v*2,w=u&&s?Math.abs(s[1]-s[0]):p*2;return h.createElement("clipPath",{id:"clipPath-".concat(n)},h.createElement("rect",{x:m,y,width:g,height:w}))}function PT(e){var t=ia(e),r=3,n=2;if(t!=null){var i=t.r,a=t.strokeWidth,o=Number(i),u=Number(a);return(Number.isNaN(o)||o<0)&&(o=r),(Number.isNaN(u)||u<0)&&(u=n),{r:o,strokeWidth:u}}return{r,strokeWidth:n}}function Fl(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:ay}function Wl(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:ay}var my=(e,t,r)=>lm(e,"xAxis",Fl(e,t),r),yy=(e,t,r)=>um(e,"xAxis",Fl(e,t),r),gy=(e,t,r)=>lm(e,"yAxis",Wl(e,t),r),by=(e,t,r)=>um(e,"yAxis",Wl(e,t),r),ST=P([re,my,gy,yy,by],(e,t,r,n,i)=>bt(e,"xAxis")?Ei(t,n,!1):Ei(r,i,!1)),ET=(e,t)=>t,wy=P([_p,ET],(e,t)=>e.filter(r=>r.type==="area").find(r=>r.id===t)),xy=e=>{var t=re(e),r=bt(t,"xAxis");return r?"yAxis":"xAxis"},_T=(e,t)=>{var r=xy(e);return r==="yAxis"?Wl(e,t):Fl(e,t)},IT=(e,t,r)=>Lp(e,xy(e),_T(e,t),r),CT=P([wy,IT],(e,t)=>{var r;if(!(e==null||t==null)){var n=e.stackId,i=Hu(e);if(!(n==null||i==null)){var a=(r=t[n])===null||r===void 0?void 0:r.stackedData,o=a==null?void 0:a.find(u=>u.key===i);if(o!=null)return o.map(u=>[u[0],u[1]])}}}),kT=P([re,my,gy,yy,by,CT,x1,ST,wy,R1],(e,t,r,n,i,a,o,u,l,c)=>{var s=o.chartData,f=o.dataStartIndex,d=o.dataEndIndex;if(!(l==null||e!=="horizontal"&&e!=="vertical"||t==null||r==null||n==null||i==null||n.length===0||i.length===0||u==null)){var v=l.data,p;if(v&&v.length>0?p=v:p=s==null?void 0:s.slice(f,d+1),p!=null)return rM({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:i,dataStartIndex:f,areaSettings:l,stackedData:a,displayedData:p,chartBaseValue:c,bandSize:u})}}),jT=["animationElapsedTime","isAnimating","isEntrance","layout","isRange","stroke","connectNulls"],TT=["id","baseLine"];function mn(){return mn=Object.assign?Object.assign.bind():function(e){for(var t=1;tf.y||0));return D(i)?s=Math.max(i,s):i&&Array.isArray(i)&&i.length&&(s=Math.max(...i.map(f=>f.y||0),s)),D(s)?h.createElement("rect",{x:uf.x||0));return D(i)?s=Math.max(i,s):i&&Array.isArray(i)&&i.length&&(s=Math.max(...i.map(f=>f.x||0),s)),D(s)?h.createElement("rect",{x:0,y:ue==null?[]:t===1?e.flatMap(r=>r.status==="removed"?[]:[r.next]):e.flatMap(r=>r.status==="matched"?[Br(Br({},r.next),{},{x:Ot(r.prev.x,r.next.x,t),y:Ot(r.prev.y,r.next.y,t)})]:r.status==="added"?[r.next]:[]),Oy={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationMatchBy:$l,animationInterpolateFn:KT,connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,shape:LT,xAxisId:0,yAxisId:0,zIndex:ke.area};function ea(e,t){return e&&e!=="none"?e:t}var HT=e=>{var t=e.dataKey,r=e.name,n=e.stroke,i=e.fill,a=e.legendType,o=e.hide;return[{inactive:o,dataKey:t,type:a,color:ea(n,i),value:Zv(r,t),payload:e}]},YT=h.memo(e=>{var t=e.dataKey,r=e.data,n=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,u=e.hide,l=e.unit,c=e.tooltipType,s=e.id,f={dataDefinedOnItem:r,getPosition:Fr,settings:{stroke:n,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Zv(o,t),hide:u,type:c,color:ea(n,a),unit:l,graphicalItemId:s}};return h.createElement(ik,{tooltipEntrySettings:f})});function GT(e){var t=e.clipPathId,r=e.points,n=e.props,i=n.needClip,a=n.dot,o=n.dataKey,u=it(n);return h.createElement(Gk,{points:r,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:o,baseProps:u,needClip:i,clipPathId:t})}function VT(e){var t=e.showLabels,r=e.children,n=e.points,i=n.map(a=>{var o,u,l={x:(o=a.x)!==null&&o!==void 0?o:0,y:(u=a.y)!==null&&u!==void 0?u:0,width:0,lowerWidth:0,upperWidth:0,height:0};return Br(Br({},l),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:l,fill:void 0})});return h.createElement(UC,{value:t?i:void 0},r)}function qT(e){var t=e.points,r=e.baseLine,n=e.needClip,i=e.clipPathId,a=e.props,o=e.animationElapsedTime,u=e.isAnimating,l=e.isEntrance,c=a.layout,s=a.type,f=a.stroke,d=a.connectNulls,v=a.isRange,p=a.shape,m=a.id,y=Ay(a,RT),g=Ve(y),w=Br(Br({},g),{},{id:m,points:t,connectNulls:d,type:s,baseLine:r,layout:c,stroke:f,isRange:v,animationElapsedTime:o,isAnimating:u,isEntrance:l});return h.createElement(h.Fragment,null,(t==null?void 0:t.length)>1&&h.createElement(qe,{clipPath:n?"url(#clipPath-".concat(i,")"):void 0},h.createElement(nk,{option:p,DefaultShape:Oy.shape,shapeProps:w})),h.createElement(GT,{points:t,props:y,clipPathId:i}))}function XT(e,t,r){if(D(e)){var n=D(t)?t:void 0;return Ot(n,e,r)}if(Oe(e)||ht(e)){var i=D(t)?t:void 0;return Ot(i,0,r)}return e}function ZT(e){var t=e.needClip,r=e.clipPathId,n=e.props,i=e.previousPointsRef,a=e.previousBaselineRef,o=n.points,u=n.baseLine,l=n.isAnimationActive,c=n.animationBegin,s=n.animationDuration,f=n.animationEasing,d=n.animationMatchBy,v=n.animationInterpolateFn,p=h.useMemo(()=>({points:o,baseLine:u}),[o,u]),m=ry(p,a),y=ju(),g=xk(n.onAnimationStart,n.onAnimationEnd),w=g.isAnimating,x=g.handleAnimationStart,A=g.handleAnimationEnd,O=m.startValue;if(y==null)return null;var b;return Array.isArray(u)&&Array.isArray(O)?b=uu(O,u,d):Array.isArray(u)?b=uu(null,u,d):b=null,h.createElement(Ak,{animationInput:p,animationIdPrefix:"recharts-area-",items:o,previousItemsRef:i,isAnimationActive:l,animationBegin:c,animationDuration:s,animationEasing:f,onAnimationStart:x,onAnimationEnd:A,animationInterpolateFn:v,animationMatchBy:d,layout:y},(S,_,I)=>{var C;return _===1?C=u:Array.isArray(u)?C=v(b,_,y):C=I?u:XT(u,O,_),m.syncStepValue(C,_),h.createElement(VT,{showLabels:!w,points:o},n.children,h.createElement(qT,{points:S,baseLine:C,needClip:t,clipPathId:r,props:n,animationElapsedTime:_,isAnimating:w||_<1,isEntrance:I}),h.createElement(YC,{label:n.label}))})}function QT(e){var t=e.needClip,r=e.clipPathId,n=e.props,i=h.useRef(null),a=h.useRef();return h.createElement(ZT,{needClip:t,clipPathId:r,props:n,previousPointsRef:i,previousBaselineRef:a})}class JT extends h.PureComponent{render(){var t=this.props,r=t.hide,n=t.dot,i=t.points,a=t.className,o=t.top,u=t.left,l=t.needClip,c=t.xAxisId,s=t.yAxisId,f=t.width,d=t.height,v=t.id,p=t.baseLine,m=t.zIndex;if(r)return null;var y=ee("recharts-area",a),g=v,w=PT(n),x=w.r,A=w.strokeWidth,O=ey(n),b=x*2+A,S=l?"url(#clipPath-".concat(O?"":"dots-").concat(g,")"):void 0;return h.createElement(Rt,{zIndex:m},h.createElement(qe,{className:y},l&&h.createElement("defs",null,h.createElement(OT,{clipPathId:g,xAxisId:c,yAxisId:s}),!O&&h.createElement("clipPath",{id:"clipPath-dots-".concat(g)},h.createElement("rect",{x:u-b/2,y:o-b/2,width:f+b,height:d+b}))),h.createElement(QT,{needClip:l,clipPathId:g,props:this.props})),h.createElement(cd,{points:i,mainColor:ea(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}),this.props.isRange&&Array.isArray(p)&&h.createElement(cd,{points:p,mainColor:ea(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:S}))}}function eM(e){var t,r=e.activeDot,n=e.animationBegin,i=e.animationDuration,a=e.animationEasing,o=e.connectNulls,u=e.dot,l=e.fill,c=e.fillOpacity,s=e.hide,f=e.isAnimationActive,d=e.legendType,v=e.stroke,p=e.xAxisId,m=e.yAxisId,y=Ay(e,zT),g=Wr(),w=jm(),x=py(p,m),A=x.needClip,O=$e(),b=(t=N(V=>kT(V,e.id,O)))!==null&&t!==void 0?t:{},S=b.points,_=b.isRange,I=b.baseLine,C=Ll();if(g!=="horizontal"&&g!=="vertical"||C==null||w!=="AreaChart"&&w!=="ComposedChart")return null;var j=C.height,E=C.width,R=C.x,$=C.y;return!S||!S.length?null:h.createElement(JT,Ji({},y,{activeDot:r,animationBegin:n,animationDuration:i,animationEasing:a,baseLine:I,connectNulls:o,dot:u,fill:l,fillOpacity:c,height:j,hide:s,layout:g,isAnimationActive:f,isRange:_,legendType:d,needClip:A,points:S,stroke:v,width:E,left:R,top:$,xAxisId:p,yAxisId:m}))}var tM=(e,t,r,n,i)=>{var a=r??t;if(D(a))return a;var o=e==="horizontal"?i:n,u=o.scale.domain();if(o.type==="number"){var l=Math.max(u[0],u[1]),c=Math.min(u[0],u[1]);return a==="dataMin"?c:a==="dataMax"||l<0?l:Math.max(Math.min(u[0],u[1]),0)}return a==="dataMin"?u[0]:a==="dataMax"?u[1]:u[0]};function rM(e){var t=e.areaSettings,r=t.connectNulls,n=t.baseValue,i=t.dataKey,a=e.stackedData,o=e.layout,u=e.chartBaseValue,l=e.xAxis,c=e.yAxis,s=e.displayedData,f=e.dataStartIndex,d=e.xAxisTicks,v=e.yAxisTicks,p=e.bandSize,m=a&&a.length,y=tM(o,u,n,l,c),g=o==="horizontal",w=!1,x=s.map((O,b)=>{var S,_,I,C;if(m)C=a[f+b];else{var j=he(O,i);Array.isArray(j)?(C=j,w=!0):C=[y,j]}var E=(S=(_=C)===null||_===void 0?void 0:_[1])!==null&&S!==void 0?S:null,R=E==null||m&&!r&&he(O,i)==null;if(g){var $;return{x:Sc({axis:l,ticks:d,bandSize:p,entry:O,index:b}),y:R?null:($=c.scale.map(E))!==null&&$!==void 0?$:null,value:C,payload:O}}return{x:R?null:(I=l.scale.map(E))!==null&&I!==void 0?I:null,y:Sc({axis:c,ticks:v,bandSize:p,entry:O,index:b}),value:C,payload:O}}),A;return m||w?A=x.map(O=>{var b,S=Array.isArray(O.value)?O.value[0]:null;if(g){var _;return{x:O.x,y:S!=null&&O.y!=null&&(_=c.scale.map(S))!==null&&_!==void 0?_:null,payload:O.payload}}return{x:S!=null&&(b=l.scale.map(S))!==null&&b!==void 0?b:null,y:O.y,payload:O.payload}}):A=g?c.scale.map(y):l.scale.map(y),{points:x,baseLine:A??0,isRange:w}}function nM(e){var t=Ze(e,Oy),r=$e();return h.createElement(jk,{id:t.id,type:"area"},n=>h.createElement(h.Fragment,null,h.createElement(ak,{legendPayload:HT(t)}),h.createElement(YT,{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}),h.createElement(Rk,{type:"area",id:n,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:uw(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:r,connectNulls:t.connectNulls}),h.createElement(eM,Ji({},t,{id:n}))))}var Py=h.memo(nM,Ea);Py.displayName="Area";var iM=["domain","range"],aM=["domain","range"];function bd(e,t){if(e==null)return{};var r,n,i=oM(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n{if(o!=null)return Ad(Ad({},a),{},{type:o})},[a,o]);return h.useLayoutEffect(()=>{u!=null&&(r.current===null?t(Qk(u)):r.current!==u&&t(Jk({prev:r.current,next:u})),r.current=u)},[u,t]),h.useLayoutEffect(()=>()=>{r.current&&(t(ej(r.current)),r.current=null)},[t]),null}var pM=e=>{var t=e.xAxisId,r=e.className,n=N(Jv),i=$e(),a="xAxis",o=N(d=>om(d,a,t,i)),u=N(d=>qS(d,t)),l=N(d=>tE(d,t)),c=N(d=>Op(d,t));if(u==null||l==null||c==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var s=cu(e,lM);c.id,c.scale;var f=cu(c,cM);return h.createElement(zl,lu({},s,f,{x:l.x,y:l.y,width:u.width,height:u.height,className:ee("recharts-".concat(a," ").concat(a),r),viewBox:n,ticks:o,axisType:a,axisId:t}))},mM={allowDataOverflow:ce.allowDataOverflow,allowDecimals:ce.allowDecimals,allowDuplicatedCategory:ce.allowDuplicatedCategory,angle:ce.angle,axisLine:_t.axisLine,height:ce.height,hide:!1,includeHidden:ce.includeHidden,interval:ce.interval,label:!1,minTickGap:ce.minTickGap,mirror:ce.mirror,orientation:ce.orientation,padding:ce.padding,reversed:ce.reversed,scale:ce.scale,tick:ce.tick,tickCount:ce.tickCount,tickLine:_t.tickLine,tickSize:_t.tickSize,type:ce.type,niceTicks:ce.niceTicks,xAxisId:0},yM=e=>{var t=Ze(e,mM);return h.createElement(h.Fragment,null,h.createElement(hM,{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}),h.createElement(pM,t))},su=h.memo(yM,Sy);su.displayName="XAxis";var gM=["type"],bM=["dangerouslySetInnerHTML","ticks","scale"],wM=["id","scale"];function fu(){return fu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(o!=null)return Pd(Pd({},a),{},{type:o})},[o,a]);return h.useLayoutEffect(()=>{u!=null&&(r.current===null?t(tj(u)):r.current!==u&&t(rj({prev:r.current,next:u})),r.current=u)},[u,t]),h.useLayoutEffect(()=>()=>{r.current&&(t(nj(r.current)),r.current=null)},[t]),null}function EM(e){var t=e.yAxisId,r=e.className,n=e.width,i=e.label,a=h.useRef(null),o=h.useRef(null),u=N(Jv),l=$e(),c=le(),s="yAxis",f=N(g=>iE(g,t)),d=N(g=>nE(g,t)),v=N(g=>om(g,s,t,l)),p=N(g=>Pp(g,t));if(h.useLayoutEffect(()=>{if(!(n!=="auto"||!f||Dl(i)||h.isValidElement(i)||p==null)){var g=a.current;if(g){var w=g.getCalculatedWidth();Math.round(f.width)!==Math.round(w)&&c(ij({id:t,width:w}))}}},[v,f,c,i,t,n,p]),f==null||d==null||p==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var m=du(e,bM);p.id,p.scale;var y=du(p,wM);return h.createElement(zl,fu({},m,y,{ref:a,labelRef:o,x:d.x,y:d.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:f.width,height:f.height,className:ee("recharts-".concat(s," ").concat(s),r),viewBox:u,ticks:v,axisType:s,axisId:t}))}var _M={allowDataOverflow:se.allowDataOverflow,allowDecimals:se.allowDecimals,allowDuplicatedCategory:se.allowDuplicatedCategory,angle:se.angle,axisLine:_t.axisLine,hide:!1,includeHidden:se.includeHidden,interval:se.interval,label:!1,minTickGap:se.minTickGap,mirror:se.mirror,orientation:se.orientation,padding:se.padding,reversed:se.reversed,scale:se.scale,tick:se.tick,tickCount:se.tickCount,tickLine:_t.tickLine,tickSize:_t.tickSize,type:se.type,niceTicks:se.niceTicks,width:se.width,yAxisId:0},IM=e=>{var t=Ze(e,_M);return h.createElement(h.Fragment,null,h.createElement(SM,{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}),h.createElement(EM,t))},Ey=h.memo(IM,Sy);Ey.displayName="YAxis";var CM=(e,t)=>t,Ul=P([CM,re,Fh,me,Sm,Lt,E_,Pe],M_);function kM(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function Kl(e){var t=e.currentTarget.getBoundingClientRect(),r,n;if(kM(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 a=e.currentTarget;r=a.offsetWidth>0?t.width/a.offsetWidth:1,n=a.offsetHeight>0?t.height/a.offsetHeight:1}var o=(u,l)=>({relativeX:Math.round((u-t.left)/r),relativeY:Math.round((l-t.top)/n)});return"touches"in e?Array.from(e.touches).map(u=>o(u.clientX,u.clientY)):o(e.clientX,e.clientY)}var _y=We("mouseClick"),Iy=jn();Iy.startListening({actionCreator:_y,effect:(e,t)=>{var r=e.payload,n=Ul(t.getState(),Kl(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(bE({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var vu=We("mouseMove"),Cy=jn(),Er=null,Zt=null,bo=null;Cy.startListening({actionCreator:vu,effect:(e,t)=>{var r=e.payload,n=t.getState(),i=n.eventSettings,a=i.throttleDelay,o=i.throttledEvents,u=o==="all"||(o==null?void 0:o.includes("mousemove"));Er!==null&&(cancelAnimationFrame(Er),Er=null),Zt!==null&&(typeof a!="number"||!u)&&(clearTimeout(Zt),Zt=null),bo=Kl(r);var l=()=>{var c=t.getState(),s=Un(c,c.tooltip.settings.shared);if(!bo){Er=null,Zt=null;return}if(s==="axis"){var f=Ul(c,bo);(f==null?void 0:f.activeIndex)!=null?t.dispatch(pm({activeIndex:f.activeIndex,activeDataKey:void 0,activeCoordinate:f.activeCoordinate})):t.dispatch(hm())}Er=null,Zt=null};if(!u){l();return}a==="raf"?Er=requestAnimationFrame(l):typeof a=="number"&&Zt===null&&(Zt=setTimeout(l,a))}});function jM(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 Sd={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},ky=Ce({name:"rootProps",initialState:Sd,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:Sd.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}}}),TM=ky.reducer,MM=ky.actions.updateOptions,DM=null,$M={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)},jy=Ce({name:"polarOptions",initialState:DM,reducers:$M});jy.actions.updatePolarOptions;var NM=jy.reducer,Ty=We("keyDown"),My=We("focus"),Dy=We("blur"),Ya=jn(),_r=null,Qt=null,ii=null;Ya.startListening({actionCreator:Ty,effect:(e,t)=>{ii=e.payload,_r!==null&&(cancelAnimationFrame(_r),_r=null);var r=t.getState(),n=r.eventSettings,i=n.throttleDelay,a=n.throttledEvents,o=a==="all"||a.includes("keydown");Qt!==null&&(typeof i!="number"||!o)&&(clearTimeout(Qt),Qt=null);var u=()=>{try{var l=t.getState(),c=l.rootProps.accessibilityLayer!==!1;if(!c)return;var s=l.tooltip.keyboardInteraction,f=ii;if(f!=="ArrowRight"&&f!=="ArrowLeft"&&f!=="Enter")return;var d=hn(s,pr(l),Rr(l),zr(l)),v=d==null?-1:Number(d),p=!Number.isFinite(v)||v<0,m=Lt(l),y=pr(l),g=Un(l,l.tooltip.settings.shared);if(f==="Enter"){if(p)return;var w=Vi(l,g,"hover",String(s.index));t.dispatch(Gi({active:!s.active,activeIndex:s.index,activeCoordinate:w}));return}var x=cE(l),A=x==="left-to-right"?1:-1,O=f==="ArrowRight"?1:-1,b;if(p){var S=Rr(l),_=zr(l),I=O*A,C=V=>({active:!1,index:String(V),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(b=-1,I>0){for(var j=0;j=0;E--)if(hn(C(E),y,S,_)!=null){b=E;break}if(b<0)return}else{b=v+O*A;var R=(m==null?void 0:m.length)||y.length;if(R===0||b>=R||b<0)return}var $=Vi(l,g,"hover",String(b));t.dispatch(Gi({active:!0,activeIndex:b.toString(),activeCoordinate:$}))}finally{_r=null,Qt=null}};if(!o){u();return}i==="raf"?_r=requestAnimationFrame(u):typeof i=="number"&&Qt===null&&(u(),ii=null,Qt=setTimeout(()=>{ii?u():(Qt=null,_r=null)},i))}});Ya.startListening({actionCreator:My,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 a="0",o=Un(r,r.tooltip.settings.shared),u=Vi(r,o,"hover",String(a));t.dispatch(Gi({active:!0,activeIndex:a,activeCoordinate:u}))}}}});Ya.startListening({actionCreator:Dy,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var i=r.tooltip.keyboardInteraction;i.active&&t.dispatch(Gi({active:!1,activeIndex:i.index,activeCoordinate:i.coordinate}))}}});function $y(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 Ke=We("externalEvent"),Ny=jn(),ai=new Map,cn=new Map,wo=new Map;Ny.startListening({actionCreator:Ke,effect:(e,t)=>{var r=e.payload,n=r.handler,i=r.reactEvent;if(n!=null){var a=i.type,o=$y(i);wo.set(a,{handler:n,reactEvent:o});var u=ai.get(a);u!==void 0&&(cancelAnimationFrame(u),ai.delete(a));var l=t.getState(),c=l.eventSettings,s=c.throttleDelay,f=c.throttledEvents,d=f,v=d==="all"||(d==null?void 0:d.includes(a)),p=cn.get(a);p!==void 0&&(typeof s!="number"||!v)&&(clearTimeout(p),cn.delete(a));var m=()=>{var w=wo.get(a);try{if(!w)return;var x=w.handler,A=w.reactEvent,O=t.getState(),b={activeCoordinate:f_(O),activeDataKey:l_(O),activeIndex:_n(O),activeLabel:Im(O),activeTooltipIndex:_n(O),isTooltipActive:d_(O)};x&&x(b,A)}finally{ai.delete(a),cn.delete(a),wo.delete(a)}};if(!v){m();return}if(s==="raf"){var y=requestAnimationFrame(m);ai.set(a,y)}else if(typeof s=="number"){if(!cn.has(a)){m();var g=setTimeout(m,s);cn.set(a,g)}}else m()}}});var LM=P([Xr],e=>e.tooltipItemPayloads),RM=P([LM,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var n=e.find(a=>a.settings.graphicalItemId===r);if(n!=null){var i=n.getPosition;if(i!=null)return i(t)}}}),Ly=We("touchMove"),Ry=jn(),Jt=null,zt=null,Ed=null,sn=null;Ry.startListening({actionCreator:Ly,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){sn=$y(r);var n=t.getState(),i=n.eventSettings,a=i.throttleDelay,o=i.throttledEvents,u=o==="all"||o.includes("touchmove");Jt!==null&&(cancelAnimationFrame(Jt),Jt=null),zt!==null&&(typeof a!="number"||!u)&&(clearTimeout(zt),zt=null),Ed=Array.from(r.touches).map(c=>Kl({clientX:c.clientX,clientY:c.clientY,currentTarget:r.currentTarget}));var l=()=>{if(sn!=null){var c=t.getState(),s=Un(c,c.tooltip.settings.shared);if(s==="axis"){var f,d=(f=Ed)===null||f===void 0?void 0:f[0];if(d==null){Jt=null,zt=null;return}var v=Ul(c,d);(v==null?void 0:v.activeIndex)!=null&&t.dispatch(pm({activeIndex:v.activeIndex,activeDataKey:void 0,activeCoordinate:v.activeCoordinate}))}else if(s==="item"){var p,m=sn.touches[0];if(document.elementFromPoint==null||m==null)return;var y=document.elementFromPoint(m.clientX,m.clientY);if(!y||!y.getAttribute)return;var g=y.getAttribute(hw),w=(p=y.getAttribute(pw))!==null&&p!==void 0?p:void 0,x=wr(c).find(b=>b.id===w);if(g==null||x==null||w==null)return;var A=x.dataKey,O=RM(c,g,w);t.dispatch(gE({activeDataKey:A,activeIndex:g,activeCoordinate:O,activeGraphicalItemId:w}))}Jt=null,zt=null}};if(!u){l();return}a==="raf"?Jt=requestAnimationFrame(l):typeof a=="number"&&zt===null&&(l(),sn=null,zt=setTimeout(()=>{sn?l():(zt=null,Jt=null)},a))}}});var zy={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},By=Ce({name:"eventSettings",initialState:zy,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),zM=By.actions.setEventSettings,BM=By.reducer,FM=wv({brush:hj,cartesianAxis:aj,chartData:sI,errorBars:AT,eventSettings:BM,graphicalItems:Nk,layout:Qb,legend:dx,options:aI,polarAxis:VC,polarOptions:NM,referenceElements:gj,renderedTicks:Bj,rootProps:TM,tooltip:wE,zIndex:Y_}),WM=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return Ob({reducer:FM,preloadedState:t,middleware:n=>{var i;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([Iy.middleware,Cy.middleware,Ya.middleware,Ny.middleware,Ry.middleware])},enhancers:n=>{var i=n;return typeof n=="function"&&(i=n()),i.concat($v({type:"raf"}))},devTools:{serialize:{replacer:jM},name:"recharts-".concat(r)}})};function UM(e){var t=e.preloadedState,r=e.children,n=e.reduxStoreName,i=$e(),a=h.useRef(null);if(i)return r;a.current==null&&(a.current=WM(t,n));var o=Au;return h.createElement(Ix,{context:o,store:a.current},r)}function KM(e){var t=e.layout,r=e.margin,n=le(),i=$e();return h.useEffect(()=>{i||(n(qb(t)),n(Vb(r)))},[n,i,t,r]),null}var HM=h.memo(KM,Ea);function YM(e){var t=le();return h.useEffect(()=>{t(MM(e))},[t,e]),null}var GM=e=>{var t=le();return h.useEffect(()=>{t(zM(e))},[t,e]),null},VM=h.memo(GM,Ea);function _d(e){var t=e.zIndex,r=e.isPanorama,n=h.useRef(null),i=le();return h.useLayoutEffect(()=>(n.current&&i(K_({zIndex:t,element:n.current,isPanorama:r})),()=>{i(H_({zIndex:t,isPanorama:r}))}),[i,t,r]),h.createElement("g",{tabIndex:-1,ref:n,className:"recharts-zIndex-layer_".concat(t)})}function Id(e){var t=e.children,r=e.isPanorama,n=N($_);if(!n||n.length===0)return t;var i=n.filter(o=>o<0),a=n.filter(o=>o>0);return h.createElement(h.Fragment,null,i.map(o=>h.createElement(_d,{key:o,zIndex:o,isPanorama:r})),t,a.map(o=>h.createElement(_d,{key:o,zIndex:o,isPanorama:r})))}var qM=["children"];function XM(e,t){if(e==null)return{};var r,n,i=ZM(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n{var r=ih(),n=ah(),i=ph();if(!mt(r)||!mt(n))return null;var a=e.children,o=e.otherAttributes,u=e.title,l=e.desc,c,s;return o!=null&&(typeof o.tabIndex=="number"?c=o.tabIndex:c=i?0:void 0,typeof o.role=="string"?s=o.role:s=i?"application":void 0),h.createElement(Rd,ta({},o,{title:u,desc:l,role:s,tabIndex:c,width:r,height:n,style:QM,ref:t}),a)}),eD=e=>{var t=e.children,r=N(xa);if(!r)return null;var n=r.width,i=r.height,a=r.y,o=r.x;return h.createElement(Rd,{width:n,height:i,x:o,y:a},t)},Cd=h.forwardRef((e,t)=>{var r=e.children,n=XM(e,qM),i=$e();return i?h.createElement(eD,null,h.createElement(Id,{isPanorama:!0},r)):h.createElement(JM,ta({ref:t},n),h.createElement(Id,{isPanorama:!1},r))});function tD(e,t){return aD(e)||iD(e,t)||nD(e,t)||rD()}function rD(){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 nD(e,t){if(e){if(typeof e=="string")return kd(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)?kd(e,t):void 0}}function kd(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(n!=null){var o=n.getBoundingClientRect(),u=o.width/n.offsetWidth;U(u)&&u!==a&&e(Zb(u))}},[n,e,a]),i}function jd(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 uD(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r(bI(),null);function na(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var mD=h.forwardRef((e,t)=>{var r,n,i=h.useRef(null),a=h.useState({containerWidth:na((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:na((n=e.style)===null||n===void 0?void 0:n.height)}),o=ra(a,2),u=o[0],l=o[1],c=h.useCallback((f,d)=>{l(v=>{var p=Math.round(f),m=Math.round(d);return v.containerWidth===p&&v.containerHeight===m?v:{containerWidth:p,containerHeight:m}})},[]),s=h.useCallback(f=>{if(typeof t=="function"&&t(f),i.current!=null&&(i.current.disconnect(),i.current=null),f!=null&&typeof ResizeObserver<"u"){var d=f.getBoundingClientRect(),v=d.width,p=d.height;c(v,p);var m=g=>{var w=g[0];if(w!=null){var x=w.contentRect,A=x.width,O=x.height;c(A,O)}},y=new ResizeObserver(m);y.observe(f),i.current=y}},[t,c]);return h.useEffect(()=>()=>{var f=i.current;f!=null&&f.disconnect()},[c]),h.createElement(h.Fragment,null,h.createElement(Mn,{width:u.containerWidth,height:u.containerHeight}),h.createElement("div",Ht({ref:s},e)))}),yD=h.forwardRef((e,t)=>{var r=e.width,n=e.height,i=h.useState({containerWidth:na(r),containerHeight:na(n)}),a=ra(i,2),o=a[0],u=a[1],l=h.useCallback((s,f)=>{u(d=>{var v=Math.round(s),p=Math.round(f);return d.containerWidth===v&&d.containerHeight===p?d:{containerWidth:v,containerHeight:p}})},[]),c=h.useCallback(s=>{if(typeof t=="function"&&t(s),s!=null){var f=s.getBoundingClientRect(),d=f.width,v=f.height;l(d,v)}},[t,l]);return h.createElement(h.Fragment,null,h.createElement(Mn,{width:o.containerWidth,height:o.containerHeight}),h.createElement("div",Ht({ref:c},e)))}),gD=h.forwardRef((e,t)=>{var r=e.width,n=e.height;return h.createElement(h.Fragment,null,h.createElement(Mn,{width:r,height:n}),h.createElement("div",Ht({ref:t},e)))}),bD=h.forwardRef((e,t)=>{var r=e.width,n=e.height;return typeof r=="string"||typeof n=="string"?h.createElement(yD,Ht({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?h.createElement(gD,Ht({},e,{width:r,height:n,ref:t})):h.createElement(h.Fragment,null,h.createElement(Mn,{width:r,height:n}),h.createElement("div",Ht({ref:t},e)))});function wD(e){return e?mD:bD}var xD=h.forwardRef((e,t)=>{var r=e.children,n=e.className,i=e.height,a=e.onClick,o=e.onContextMenu,u=e.onDoubleClick,l=e.onMouseDown,c=e.onMouseEnter,s=e.onMouseLeave,f=e.onMouseMove,d=e.onMouseUp,v=e.onTouchEnd,p=e.onTouchMove,m=e.onTouchStart,y=e.style,g=e.width,w=e.responsive,x=e.dispatchTouchEvents,A=x===void 0?!0:x,O=h.useRef(null),b=le(),S=h.useState(null),_=ra(S,2),I=_[0],C=_[1],j=h.useState(null),E=ra(j,2),R=E[0],$=E[1],V=oD(),H=Cu(),Y=(H==null?void 0:H.width)>0?H.width:g,B=(H==null?void 0:H.height)>0?H.height:i,q=h.useCallback(L=>{V(L),typeof t=="function"&&t(L),C(L),$(L),L!=null&&(O.current=L)},[V,t,C,$]),W=h.useCallback(L=>{b(_y(L)),b(Ke({handler:a,reactEvent:L}))},[b,a]),Se=h.useCallback(L=>{b(vu(L)),b(Ke({handler:c,reactEvent:L}))},[b,c]),ge=h.useCallback(L=>{b(hm()),b(Ke({handler:s,reactEvent:L}))},[b,s]),ae=h.useCallback(L=>{b(vu(L)),b(Ke({handler:f,reactEvent:L}))},[b,f]),Ne=h.useCallback(()=>{b(My())},[b]),Le=h.useCallback(()=>{b(Dy())},[b]),Je=h.useCallback(L=>{b(Ty(L.key))},[b]),et=h.useCallback(L=>{b(Ke({handler:o,reactEvent:L}))},[b,o]),Jr=h.useCallback(L=>{b(Ke({handler:u,reactEvent:L}))},[b,u]),T=h.useCallback(L=>{b(Ke({handler:l,reactEvent:L}))},[b,l]),F=h.useCallback(L=>{b(Ke({handler:d,reactEvent:L}))},[b,d]),z=h.useCallback(L=>{b(Ke({handler:m,reactEvent:L}))},[b,m]),k=h.useCallback(L=>{A&&b(Ly(L)),b(Ke({handler:p,reactEvent:L}))},[b,A,p]),Ee=h.useCallback(L=>{b(Ke({handler:v,reactEvent:L}))},[b,v]),X=wD(w);return h.createElement(Nm.Provider,{value:I},h.createElement(ug.Provider,{value:R},h.createElement(X,{width:Y??(y==null?void 0:y.width),height:B??(y==null?void 0:y.height),className:ee("recharts-wrapper",n),style:uD({position:"relative",cursor:"default",width:Y,height:B},y),onClick:W,onContextMenu:et,onDoubleClick:Jr,onFocus:Ne,onBlur:Le,onKeyDown:Je,onMouseDown:T,onMouseEnter:Se,onMouseLeave:ge,onMouseMove:ae,onMouseUp:F,onTouchEnd:Ee,onTouchMove:k,onTouchStart:z,ref:q},h.createElement(pD,null),r)))}),AD=["width","height","responsive","children","className","style","compact","title","desc"];function OD(e,t){if(e==null)return{};var r,n,i=PD(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n{var r=e.width,n=e.height,i=e.responsive,a=e.children,o=e.className,u=e.style,l=e.compact,c=e.title,s=e.desc,f=OD(e,AD),d=it(f);return l?h.createElement(h.Fragment,null,h.createElement(Mn,{width:r,height:n}),h.createElement(Cd,{otherAttributes:d,title:c,desc:s},a)):h.createElement(xD,{className:o,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},h.createElement(Cd,{otherAttributes:d,title:c,desc:s,ref:t},h.createElement(Sj,null,a)))});function hu(){return hu=Object.assign?Object.assign.bind():function(e){for(var t=1;th.createElement(TD,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:MD,tooltipPayloadSearcher:nI,categoricalChartProps:e,ref:t}));const $D="rgba(130,130,150,0.14)",xo="rgba(130,130,150,0.85)";function ND(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 Fy(e,t){return`${t==="%"?Math.round(e):e>=1e3?`${(e/1e3).toFixed(1)}k`:Math.round(e).toString()}${t}`}function LD({active:e,payload:t,unit:r,label:n}){return!e||!(t!=null&&t.length)?null:oe.jsxs("div",{className:"rounded-lg border border-border/70 bg-popover/95 px-3 py-2 shadow-xl backdrop-blur",children:[Number.isFinite(n)&&oe.jsx("div",{className:"mb-1 border-b border-border/40 pb-1 font-mono text-[10px] text-muted-foreground/80",children:new Date(n).toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit",second:"2-digit"})}),oe.jsx("div",{className:"space-y-1",children:t.map(i=>oe.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono",children:[oe.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:i.color}}),oe.jsx("span",{className:"uppercase tracking-wider text-muted-foreground",children:i.name}),oe.jsx("span",{className:"ml-auto pl-3 font-bold tabular-nums text-foreground",children:Fy(i.value,r)})]},i.dataKey))})]})}function UD({data:e,series:t,unit:r="%",yMode:n="percent",height:i=176,showTime:a=!1}){var s,f;const o=e.reduce((d,v)=>t.reduce((p,m)=>Math.max(p,Number(v[m.key])||0),d),0),u=n==="percent"?Math.min(100,Math.max(25,Math.ceil(o*1.2/25)*25)):Math.max(ND(o*1.15),10),l=e.length>1?Number((s=e[e.length-1])==null?void 0:s.t)-Number((f=e[0])==null?void 0:f.t):0,c=d=>new Date(d).toLocaleTimeString("de-DE",l<=10*6e4?{hour:"2-digit",minute:"2-digit",second:"2-digit"}:{hour:"2-digit",minute:"2-digit"});return oe.jsx("div",{style:{height:i},className:"w-full",children:oe.jsx(Vw,{width:"100%",height:"100%",children:oe.jsxs(DD,{data:e,margin:{top:8,right:6,bottom:0,left:-12},children:[oe.jsx("defs",{children:t.map(d=>oe.jsxs("linearGradient",{id:`grad-${d.key}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[oe.jsx("stop",{offset:"0%",stopColor:d.color,stopOpacity:.22}),oe.jsx("stop",{offset:"100%",stopColor:d.color,stopOpacity:0})]},d.key))}),oe.jsx(vy,{vertical:!1,stroke:$D}),a?oe.jsx(su,{dataKey:"t",type:"number",domain:["dataMin","dataMax"],tickFormatter:c,tickCount:5,minTickGap:40,interval:"preserveStartEnd",axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:xo},height:18}):oe.jsx(su,{dataKey:"t",hide:!0}),oe.jsx(Ey,{domain:[0,u],ticks:[0,u/2,u],tickFormatter:d=>Fy(d,r),width:42,axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:xo}}),oe.jsx(TI,{content:oe.jsx(LD,{unit:r}),cursor:{stroke:xo,strokeOpacity:.4,strokeDasharray:"3 3"}}),t.map(d=>oe.jsx(Py,{type:"monotone",dataKey:d.key,name:d.label,stroke:d.color,strokeWidth:2,fill:`url(#grad-${d.key})`,dot:!1,activeDot:{r:3,strokeWidth:0},isAnimationActive:!1,connectNulls:!0},d.key))]})})})}export{UD as default}; diff --git a/frontend/dist/assets/MehrMenue-9EJ_I5Is.js b/frontend/dist/assets/MehrMenue-9EJ_I5Is.js new file mode 100644 index 0000000..a4fc976 --- /dev/null +++ b/frontend/dist/assets/MehrMenue-9EJ_I5Is.js @@ -0,0 +1 @@ +import{c as e,s as t}from"./button-Dd8hfusv.js";import{A as n,M as r,j as i}from"./index-Dd2BxC7X.js";import{a,i as o,n as s,r as c,t as l}from"./sheet-DWG2Q04V.js";var u=t(),d=e();function f(e){let t=(0,u.c)(17),{verbindung:f,onDienste:p,onEinstellungen:m,onSchliessen:h}=e,g;t[0]===h?g=t[1]:(g=e=>!e&&h(),t[0]=h,t[1]=g);let _;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,d.jsxs)(o,{children:[(0,d.jsx)(a,{className:`schild text-lg`,children:`Mehr`}),(0,d.jsx)(c,{className:`sr-only`,children:`Weitere Bereiche`})]}),t[2]=_):_=t[2];let v;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,d.jsxs)(`a`,{href:`/hermes-ui/`,target:`_blank`,rel:`noopener`,className:`flex h-12 items-center gap-3 rounded-lg border border-linie px-4 text-base`,children:[(0,d.jsx)(r,{className:`size-5`,"aria-hidden":!0}),` Hermes-Dashboard öffnen`]}),t[3]=v):v=t[3];let y;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,d.jsx)(i,{className:`size-5`,"aria-hidden":!0}),t[4]=y):y=t[4];let b;t[5]===p?b=t[6]:(b=(0,d.jsxs)(`button`,{type:`button`,onClick:p,className:`flex h-12 items-center gap-3 rounded-lg border border-linie px-4 text-left text-base`,children:[y,` Dienste und Protokolle`]}),t[5]=p,t[6]=b);let x;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,d.jsx)(n,{className:`size-5`,"aria-hidden":!0}),t[7]=x):x=t[7];let S;t[8]===m?S=t[9]:(S=(0,d.jsxs)(`button`,{type:`button`,onClick:m,className:`flex h-12 items-center gap-3 rounded-lg border border-linie px-4 text-left text-base`,children:[x,` Einstellungen`]}),t[8]=m,t[9]=S);let C;t[10]!==b||t[11]!==S||t[12]!==f?(C=(0,d.jsxs)(s,{side:`bottom`,className:`border-linie bg-panel pb-[calc(1rem+env(safe-area-inset-bottom))]`,children:[_,(0,d.jsxs)(`div`,{className:`flex flex-col gap-2 px-4`,children:[f,v,b,S]})]}),t[10]=b,t[11]=S,t[12]=f,t[13]=C):C=t[13];let w;return t[14]!==g||t[15]!==C?(w=(0,d.jsx)(l,{open:!0,onOpenChange:g,children:C}),t[14]=g,t[15]=C,t[16]=w):w=t[16],w}export{f as MehrMenue}; \ No newline at end of file diff --git a/frontend/dist/assets/Modelle-tXYT-9PF.js b/frontend/dist/assets/Modelle-tXYT-9PF.js new file mode 100644 index 0000000..a6b2a7e --- /dev/null +++ b/frontend/dist/assets/Modelle-tXYT-9PF.js @@ -0,0 +1 @@ +import{c as e,f as t,o as n,s as r,t as i,u as a}from"./button-Dd8hfusv.js";import{D as o,E as s,N as c,O as l,P as u,_ as d,a as f,c as p,h as m,i as h,k as g,l as _,m as v,n as y,o as b,p as x,s as S,t as C,v as w,x as T,y as E}from"./index-Dd2BxC7X.js";import{a as D,i as O,n as k,r as A,t as j}from"./sheet-DWG2Q04V.js";var M={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};M.node;var N=n(M),P=r(),F=t(a(),1),I=e();function L({offen:e,onSchliessen:t}){let n=u(),[r,a]=(0,F.useState)(``),[d,f]=(0,F.useState)(``),[p,m]=(0,F.useState)(null),[h,g]=(0,F.useState)(``),v=c({queryKey:[`hf-suche`,d],queryFn:()=>s(`/api/hf/search?q=${encodeURIComponent(d)}`),enabled:d.length>1}),y=c({queryKey:[`hf-quants`,p],queryFn:()=>s(`/api/hf/quants?repo=${encodeURIComponent(p??``)}`),enabled:!!p});async function b(e){if(p)try{await o(`/api/models/install`,{repo:p,quant:e,role:h||null}),l(`erfolg`,`${p} (${e}) wird heruntergeladen. Den Fortschritt siehst du unter Updates.`),n.invalidateQueries({queryKey:[`jobs`]}),n.invalidateQueries({queryKey:[`models`]}),t()}catch(e){l(`fehler`,e.message)}}let x=(y.data?.quants??[]).map(e=>typeof e==`string`?{quant:e}:e);return(0,I.jsx)(j,{open:e,onOpenChange:e=>!e&&t(),children:(0,I.jsxs)(k,{side:`right`,className:`w-full gap-3 overflow-y-auto border-linie bg-panel sm:max-w-xl`,children:[(0,I.jsxs)(O,{children:[(0,I.jsx)(D,{className:`schild text-lg`,children:`Modelle selbst suchen`}),(0,I.jsx)(A,{className:`text-text-2`,children:`Auf Hugging Face suchen, Quantisierung wählen, installieren.`})]}),(0,I.jsxs)(`form`,{className:`flex gap-2 px-4`,onSubmit:e=>{e.preventDefault(),m(null),f(r.trim())},children:[(0,I.jsx)(`label`,{htmlFor:`hf-suche`,className:`sr-only`,children:`Suchbegriff`}),(0,I.jsx)(`input`,{id:`hf-suche`,value:r,onChange:e=>a(e.target.value),placeholder:`z. B. Qwen3.8 GGUF`,className:`h-11 min-w-0 flex-1 rounded-lg border border-linie-stark bg-erhaben px-3 text-[15px] outline-none focus:border-cyan`}),(0,I.jsx)(i,{type:`submit`,children:`Suchen`})]}),(0,I.jsxs)(`div`,{className:`flex flex-col px-4 pb-4`,children:[v.isFetching&&(0,I.jsx)(`p`,{className:`py-3 text-sm text-text-2`,children:`Suche läuft …`}),!p&&v.data?.results.map(e=>(0,I.jsxs)(`button`,{type:`button`,onClick:()=>m(e.repo),className:`flex min-h-11 items-center justify-between gap-3 border-t border-linie py-2 text-left hover:text-cyan`,children:[(0,I.jsx)(`span`,{className:`ziffern min-w-0 text-sm break-all`,children:e.repo}),(0,I.jsxs)(`span`,{className:`ziffern shrink-0 text-xs text-text-3`,children:[_(e.downloads),` ↓`]})]},e.repo)),p&&(0,I.jsxs)(`div`,{className:`flex flex-col gap-3 pt-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(`span`,{className:`ziffern text-sm break-all`,children:p}),(0,I.jsx)(i,{variant:`ghost`,size:`sm`,onClick:()=>m(null),children:`Zurück`})]}),(0,I.jsxs)(`label`,{className:`flex items-center gap-3 text-sm text-text-2`,children:[`Rolle`,(0,I.jsxs)(`select`,{value:h,onChange:e=>g(e.target.value),className:`h-11 rounded-lg border border-linie-stark bg-erhaben px-3 text-foreground`,children:[(0,I.jsx)(`option`,{value:``,children:`ohne Rolle (nur installieren)`}),(0,I.jsx)(`option`,{value:`coder`,children:`Coder`})]})]}),y.isFetching&&(0,I.jsx)(`p`,{className:`text-sm text-text-2`,children:`Quantisierungen werden gelesen …`}),x.map(e=>{let t=e.quant??e.name??`?`,n=e.total_bytes??e.size_bytes;return(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-t border-linie py-2`,children:[(0,I.jsx)(`span`,{className:`ziffern text-sm`,children:t}),(0,I.jsxs)(`span`,{className:`flex items-center gap-3`,children:[n?(0,I.jsxs)(`span`,{className:`ziffern text-xs text-text-3`,children:[(n/1024**3).toFixed(1).replace(`.`,`,`),` GB`]}):null,(0,I.jsx)(i,{variant:`outline`,size:`sm`,onClick:()=>b(t),children:`Installieren`})]})]},t)})]})]})]})})}var R=115;function z(e){let t=(0,P.c)(55),{modelle:n,laufend:r}=e,i=g(),a=T(),o,s,c,l,u,d,f,p,m,h;if(t[0]!==r||t[1]!==i?.ram_total||t[2]!==i?.ram_used||t[3]!==n||t[4]!==a){let e=S(i?.ram_total??a.data?.box.ram_total)??122.7,g=S(i?.ram_used??a.data?.box.ram_used)??0,_;t[15]===r?_=t[16]:(_=e=>r.includes(e.name),t[15]=r,t[16]=_);let v=n.filter(_).reduce(B,0);s=Math.max(0,g-v);let y=t=>`${Math.min(100,t/e*100)}%`;o=C,p=`Speicher`,m=(0,I.jsxs)(`span`,{className:`ziffern text-sm text-text-2`,children:[Math.round(g),` von `,Math.round(e),` GB belegt · Grenze ~`,R,` GB`]});let b=`Speicher: ${Math.round(g)} von ${Math.round(e)} GB belegt`,x=y(g),w;t[17]===x?w=t[18]:(w={width:x},t[17]=x,t[18]=w);let T=`${g?v/g*100:0}%`,E;t[19]===T?E=t[20]:(E=(0,I.jsx)(`div`,{className:`h-full bg-cyan`,style:{width:T}}),t[19]=T,t[20]=E);let D=`${g?s/g*100:0}%`,O;t[21]===D?O=t[22]:(O=(0,I.jsx)(`div`,{className:`h-full bg-cyan/35`,style:{width:D}}),t[21]=D,t[22]=O);let k;t[23]!==w||t[24]!==E||t[25]!==O?(k=(0,I.jsxs)(`div`,{className:`absolute inset-y-0 left-0 flex overflow-hidden rounded-lg`,style:w,children:[E,O]}),t[23]=w,t[24]=E,t[25]=O,t[26]=k):k=t[26];let A=y(R),j;t[27]===A?j=t[28]:(j=(0,I.jsx)(`div`,{className:`absolute -top-1.5 -bottom-1.5 w-0.5 bg-bernstein`,style:{left:A}}),t[27]=A,t[28]=j),t[29]!==b||t[30]!==k||t[31]!==j?(h=(0,I.jsxs)(`div`,{className:`relative h-8 rounded-lg bg-erhaben`,role:`img`,"aria-label":b,children:[k,j]}),t[29]=b,t[30]=k,t[31]=j,t[32]=h):h=t[32],f=`flex flex-wrap gap-x-6 gap-y-2 text-sm text-text-2`,c=`flex items-center gap-2`,t[33]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,I.jsx)(`span`,{className:`size-2.5 rounded-sm bg-cyan`}),t[33]=l):l=t[33],u=` Geladene Modelle: `,d=Math.round(v),t[0]=r,t[1]=i?.ram_total,t[2]=i?.ram_used,t[3]=n,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=d,t[11]=f,t[12]=p,t[13]=m,t[14]=h}else o=t[5],s=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11],p=t[12],m=t[13],h=t[14];let _;t[34]!==c||t[35]!==l||t[36]!==u||t[37]!==d?(_=(0,I.jsxs)(`span`,{className:c,children:[l,u,d,` GB Dateien`]}),t[34]=c,t[35]=l,t[36]=u,t[37]=d,t[38]=_):_=t[38];let v;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,I.jsx)(`span`,{className:`size-2.5 rounded-sm bg-cyan/35`}),t[39]=v):v=t[39];let y;t[40]===s?y=t[41]:(y=Math.round(s),t[40]=s,t[41]=y);let b;t[42]===y?b=t[43]:(b=(0,I.jsxs)(`span`,{className:`flex items-center gap-2`,children:[v,` Cache, Dienste, System: `,y,` GB`]}),t[42]=y,t[43]=b);let x;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,I.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`h-3 w-0.5 bg-bernstein`}),` Ab hier wird es eng`]}),t[44]=x):x=t[44];let w;t[45]!==b||t[46]!==f||t[47]!==_?(w=(0,I.jsxs)(`div`,{className:f,children:[_,b,x]}),t[45]=b,t[46]=f,t[47]=_,t[48]=w):w=t[48];let E;return t[49]!==o||t[50]!==w||t[51]!==p||t[52]!==m||t[53]!==h?(E=(0,I.jsxs)(o,{titel:p,rechts:m,children:[h,w]}),t[49]=o,t[50]=w,t[51]=p,t[52]=m,t[53]=h,t[54]=E):E=t[54],E}function B(e,t){return e+(S(t.size_bytes)??0)}function V(e){let t=(0,P.c)(7),{name:n,wert:r}=e,i;t[0]===n?i=t[1]:(i=(0,I.jsx)(`dt`,{className:`text-xs text-text-3`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=(0,I.jsx)(`dd`,{className:`ziffern m-0 text-lg`,children:r}),t[2]=r,t[3]=a);let o;return t[4]!==i||t[5]!==a?(o=(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[i,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6],o}function H(e){let t=(0,P.c)(47),{titel:n,modell:r,laeuft:a,nutzer:o}=e,s=x();if(!r){let e;t[0]===n?e=t[1]:(e=(0,I.jsx)(`span`,{className:`schild text-sm text-text-3`,children:n}),t[0]=n,t[1]=e);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,I.jsx)(h,{children:`Frei`}),t[2]=r):r=t[2];let i;t[3]===e?i=t[4]:(i=(0,I.jsxs)(`div`,{className:`flex items-center justify-between`,children:[e,r]}),t[3]=e,t[4]=i);let a,o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,I.jsx)(`h3`,{className:`font-anzeige text-xl font-semibold text-text-2`,children:`Nicht belegt`}),o=(0,I.jsx)(`p`,{className:`text-sm text-text-2`,children:`Nur belegen, wenn ein Modell hier echten Mehrwert bringt. Das Radar meldet Kandidaten.`}),t[5]=a,t[6]=o):(a=t[5],o=t[6]);let s;return t[7]===i?s=t[8]:(s=(0,I.jsxs)(`article`,{className:`flex flex-col gap-3.5 rounded-2xl border border-dashed border-linie-stark p-5`,children:[i,a,o]}),t[7]=i,t[8]=s),s}let c;t[9]!==r.ctx||t[10]!==r.parallel_slots?(c=r.ctx?Math.round(r.ctx/Math.max(1,r.parallel_slots)/1024):null,t[9]=r.ctx,t[10]=r.parallel_slots,t[11]=c):c=t[11];let l=c,u=!!r.capabilities?.vision,d;t[12]===n?d=t[13]:(d=(0,I.jsx)(`span`,{className:`schild text-sm text-text-3`,children:n}),t[12]=n,t[13]=d);let f=a?`gruen`:`grau`,m=a?`Geladen`:`Auf Abruf`,g;t[14]!==f||t[15]!==m?(g=(0,I.jsx)(h,{art:f,children:m}),t[14]=f,t[15]=m,t[16]=g):g=t[16];let _;t[17]!==d||t[18]!==g?(_=(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[d,g]}),t[17]=d,t[18]=g,t[19]=_):_=t[19];let v;t[20]===r.name?v=t[21]:(v=(0,I.jsx)(`h3`,{className:`ziffern m-0 text-lg font-medium break-all`,children:r.name}),t[20]=r.name,t[21]=v);let y;t[22]===r.size_bytes?y=t[23]:(y=p(r.size_bytes),t[22]=r.size_bytes,t[23]=y);let b;t[24]===y?b=t[25]:(b=(0,I.jsx)(V,{name:`Größe`,wert:y}),t[24]=y,t[25]=b);let S=l?`${l}k`:`–`,C;t[26]===S?C=t[27]:(C=(0,I.jsx)(V,{name:`Kontext`,wert:S}),t[26]=S,t[27]=C);let w=u?`ja`:`nein`,T;t[28]===w?T=t[29]:(T=(0,I.jsx)(V,{name:`Bilder`,wert:w}),t[28]=w,t[29]=T);let E;t[30]!==C||t[31]!==T||t[32]!==b?(E=(0,I.jsxs)(`dl`,{className:`m-0 grid grid-cols-3 gap-3`,children:[b,C,T]}),t[30]=C,t[31]=T,t[32]=b,t[33]=E):E=t[33];let D=r.spec_active?` Mit Draft-Beschleunigung.`:``,O;t[34]!==o||t[35]!==D?(O=(0,I.jsxs)(`p`,{className:`text-sm text-text-2`,children:[`Genutzt von `,o,`.`,D]}),t[34]=o,t[35]=D,t[36]=O):O=t[36];let k;t[37]!==s||t[38]!==a||t[39]!==r.name?(k=!a&&(0,I.jsx)(i,{variant:`outline`,size:`sm`,className:`mt-auto self-start`,onClick:()=>s.mutate(r.name),disabled:s.isPending,children:`Jetzt laden`}),t[37]=s,t[38]=a,t[39]=r.name,t[40]=k):k=t[40];let A;return t[41]!==E||t[42]!==O||t[43]!==k||t[44]!==_||t[45]!==v?(A=(0,I.jsxs)(`article`,{className:`flex flex-col gap-3.5 rounded-2xl border border-linie bg-panel p-5`,children:[_,v,E,O,k]}),t[41]=E,t[42]=O,t[43]=k,t[44]=_,t[45]=v,t[46]=A):A=t[46],A}function U(e){let t=(0,P.c)(51),{nutzung:n}=e;if(!n)return null;let r;t[0]===n.absender?r=t[1]:(r=Math.max(1,...n.absender.map(q)),t[0]=n.absender,t[1]=r);let i=r,a,o,s,c,l,u,d,f,p,m,h,g;if(t[2]!==i||t[3]!==n.absender||t[4]!==n.letzte_24h||t[5]!==n.tage){let e=n.letzte_24h.map(G),r=Math.max(1,...e);a=C,g=`Wer nutzt die Modelle`,t[18]===n.tage?o=t[19]:(o=(0,I.jsxs)(`span`,{className:`ziffern text-xs text-text-3`,children:[`letzte `,n.tage,` Tage`]}),t[18]=n.tage,t[19]=o),t[20]===n.absender.length?s=t[21]:(s=n.absender.length===0&&(0,I.jsx)(`p`,{className:`text-[15px] text-text-2`,children:`Keine Anfragen aufgezeichnet.`}),t[20]=n.absender.length,t[21]=s);let v;if(t[22]!==i||t[23]!==n.absender){let e;t[25]===i?e=t[26]:(e=e=>(0,I.jsxs)(`li`,{className:`flex flex-col gap-1.5`,children:[(0,I.jsxs)(`div`,{className:`flex justify-between gap-3 text-sm`,children:[(0,I.jsx)(`span`,{children:e.name}),(0,I.jsx)(`span`,{className:`ziffern`,children:_(e.anfragen)})]}),(0,I.jsx)(`div`,{className:`h-2 rounded-full bg-erhaben`,children:(0,I.jsx)(`div`,{className:`h-2 rounded-full bg-cyan`,style:{width:`${e.anfragen/i*100}%`}})})]},e.name),t[25]=i,t[26]=e),v=n.absender.map(e),t[22]=i,t[23]=n.absender,t[24]=v}else v=t[24];t[27]===v?c=t[28]:(c=(0,I.jsx)(`ul`,{className:`m-0 flex list-none flex-col gap-3.5 p-0`,children:v}),t[27]=v,t[28]=c),m=`flex flex-col gap-1.5`,t[29]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,I.jsx)(`span`,{className:`schild text-xs text-text-3`,children:`Anfragen je Stunde, letzte 24 h`}),t[29]=h):h=t[29],l=`0 0 240 64`,u=`h-16 w-full`,d=`img`,f=`Anfragen je Stunde in den letzten 24 Stunden`;let y;t[30]===r?y=t[31]:(y=(e,t)=>{let n=e?Math.max(3,e/r*50):2;return(0,I.jsx)(`rect`,{x:t*10+1.5,y:52-n,width:7,height:n,rx:1.5,fill:e?`var(--cyan)`:`var(--linie)`},t)},t[30]=r,t[31]=y),p=e.map(y),t[2]=i,t[3]=n.absender,t[4]=n.letzte_24h,t[5]=n.tage,t[6]=a,t[7]=o,t[8]=s,t[9]=c,t[10]=l,t[11]=u,t[12]=d,t[13]=f,t[14]=p,t[15]=m,t[16]=h,t[17]=g}else a=t[6],o=t[7],s=t[8],c=t[9],l=t[10],u=t[11],d=t[12],f=t[13],p=t[14],m=t[15],h=t[16],g=t[17];let v;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(v=[0,6,12,18].map(W),t[32]=v):v=t[32];let y;t[33]!==l||t[34]!==u||t[35]!==d||t[36]!==f||t[37]!==p?(y=(0,I.jsxs)(`svg`,{viewBox:l,className:u,role:d,"aria-label":f,children:[p,v]}),t[33]=l,t[34]=u,t[35]=d,t[36]=f,t[37]=p,t[38]=y):y=t[38];let b;t[39]!==y||t[40]!==m||t[41]!==h?(b=(0,I.jsxs)(`div`,{className:m,children:[h,y]}),t[39]=y,t[40]=m,t[41]=h,t[42]=b):b=t[42];let x;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,I.jsx)(`p`,{className:`text-xs text-text-3`,children:`Anfragen an llama-swap. NerdQuiz geht direkt dorthin, alles andere über MC2.`}),t[43]=x):x=t[43];let S;return t[44]!==a||t[45]!==o||t[46]!==s||t[47]!==c||t[48]!==b||t[49]!==g?(S=(0,I.jsxs)(a,{titel:g,rechts:o,children:[s,c,b,x]}),t[44]=a,t[45]=o,t[46]=s,t[47]=c,t[48]=b,t[49]=g,t[50]=S):S=t[50],S}function W(e){return(0,I.jsx)(`text`,{x:e*10+5,y:63,textAnchor:`middle`,style:{fontSize:9,fill:`var(--text-3)`,fontFamily:`var(--font-mono)`},children:e},e)}function G(e){return Object.values(e.je_absender).reduce(K,0)}function K(e,t){return e+t}function q(e){return e.anfragen}var J={bestanden:`gruen`,durchgefallen:`rot`,wartet:`cyan`,neu:`cyan`,getestet:`grau`,uebernommen:`gruen`,verworfen:`grau`};function Y(e){let t=(0,P.c)(31),{k:n}=e,r=w(),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=[`bestanden`,`wartet`,`neu`],t[0]=a):a=t[0];let o=a.includes(n.status),s;t[1]===n.name?s=t[2]:(s=(0,I.jsx)(`span`,{className:`ziffern text-[15px] font-medium`,children:n.name}),t[1]=n.name,t[2]=s);let c=n.rolle===`hirn`?`fürs Hirn`:`fürs Coden`,l;t[3]===c?l=t[4]:(l=(0,I.jsx)(h,{art:`cyan`,children:c}),t[3]=c,t[4]=l);let u=n.eng?`bernstein`:n.passt?`gruen`:`rot`,d=n.eng?`passt knapp`:n.passt?`passt`:`passt nicht`,f;t[5]!==u||t[6]!==d?(f=(0,I.jsx)(h,{art:u,children:d}),t[5]=u,t[6]=d,t[7]=f):f=t[7];let p=J[n.status]??`grau`,m;t[8]!==n.status||t[9]!==p?(m=(0,I.jsx)(h,{art:p,children:n.status}),t[8]=n.status,t[9]=p,t[10]=m):m=t[10];let g;t[11]!==s||t[12]!==l||t[13]!==f||t[14]!==m?(g=(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[s,l,f,m]}),t[11]=s,t[12]=l,t[13]=f,t[14]=m,t[15]=g):g=t[15];let _;t[16]===n.groesse_gb?_=t[17]:(_=n.groesse_gb==null?``:`${n.groesse_gb.toLocaleString(`de-DE`)} GB. `,t[16]=n.groesse_gb,t[17]=_);let v;t[18]!==n.begruendung||t[19]!==_?(v=(0,I.jsxs)(`p`,{className:`text-sm text-text-2`,children:[_,n.begruendung]}),t[18]=n.begruendung,t[19]=_,t[20]=v):v=t[20];let y;t[21]!==r||t[22]!==n.id||t[23]!==n.name||t[24]!==n.status||t[25]!==o?(y=o&&(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[n.status===`bestanden`&&(0,I.jsx)(i,{size:`sm`,disabled:r.isPending,onClick:()=>r.mutate({id:n.id,aktion:`uebernehmen`,name:n.name}),children:`Übernehmen`}),(0,I.jsx)(i,{variant:`outline`,size:`sm`,disabled:r.isPending,onClick:()=>r.mutate({id:n.id,aktion:`verwerfen`,name:n.name}),children:`Verwerfen`})]}),t[21]=r,t[22]=n.id,t[23]=n.name,t[24]=n.status,t[25]=o,t[26]=y):y=t[26];let b;return t[27]!==g||t[28]!==v||t[29]!==y?(b=(0,I.jsxs)(`li`,{className:`flex flex-col gap-2 border-t border-linie py-3.5`,children:[g,v,y]}),t[27]=g,t[28]=v,t[29]=y,t[30]=b):b=t[30],b}function X(){let e=(0,P.c)(18),t=d(),n=E();if(t.isError){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,I.jsx)(C,{titel:`Modell-Radar`,id:`radar`,children:(0,I.jsx)(`p`,{className:`text-[15px] text-text-2`,children:`Das Radar ist auf dieser Box noch nicht eingerichtet.`})}),e[0]=t):t=e[0],t}let r=t.data,a;e[1]===n?a=e[2]:(a=()=>n.mutate(void 0),e[1]=n,e[2]=a);let o;e[3]!==n.isPending||e[4]!==a?(o=(0,I.jsx)(i,{variant:`info`,size:`sm`,onClick:a,disabled:n.isPending,children:`Jetzt suchen`}),e[3]=n.isPending,e[4]=a,e[5]=o):o=e[5];let s;e[6]===r?s=e[7]:(s=r?.naechster_test?` Nächster Test: ${b(r.naechster_test)}.`:``,e[6]=r,e[7]=s);let c;e[8]===s?c=e[9]:(c=(0,I.jsxs)(`p`,{className:`-mt-2 text-sm text-text-2`,children:[`Testet nachts zwischen 00:30 und 02:30 selbst, höchstens einen Kandidaten pro Woche.`,s]}),e[8]=s,e[9]=c);let l,u;e[10]===r?(l=e[11],u=e[12]):(l=r?r.kandidaten.length===0?(0,I.jsx)(`p`,{className:`text-[15px] text-text-2`,children:`Nichts Besseres in Sicht.`}):(0,I.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:r.kandidaten.map(Q)}):(0,I.jsx)(`p`,{className:`text-[15px] text-text-2`,children:`Wird gelesen …`}),u=r&&r.tests.length>0&&(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsx)(`h3`,{className:`schild text-xs text-text-3`,children:`Letzte Tests`}),r.tests.slice(0,3).map(Z)]}),e[10]=r,e[11]=l,e[12]=u);let f;return e[13]!==o||e[14]!==c||e[15]!==l||e[16]!==u?(f=(0,I.jsxs)(C,{titel:`Modell-Radar`,id:`radar`,rechts:o,children:[c,l,u]}),e[13]=o,e[14]=c,e[15]=l,e[16]=u,e[17]=f):f=e[17],f}function Z(e){return(0,I.jsxs)(`p`,{className:`text-sm text-text-2`,children:[(0,I.jsx)(`span`,{className:`ziffern text-text-3`,children:b(e.datum)}),` · `,e.zusammenfassung]},e.id)}function Q(e){return(0,I.jsx)(Y,{k:e},e.id)}function $(){let e=(0,P.c)(52),t=v(),n=m(),[r,a]=(0,F.useState)(!1);if(t.isPending){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,I.jsx)(f,{text:`Modelle werden gelesen …`}),e[0]=t):t=e[0],t}if(t.error||!t.data){let n=`Die Modell-Liste fehlt: ${t.error?.message??`keine Daten`}`,r;return e[1]===n?r=e[2]:(r=(0,I.jsx)(f,{fehler:!0,text:n}),e[1]=n,e[2]=r),r}let o=t.data.models,s=t.data.running,c,l,u,d,h,g,_,y;if(e[3]!==s||e[4]!==o||e[5]!==n.data){let t=o.find(te),r=o.find(ee),f=o.filter(e=>e!==t&&e!==r),m;e[14]===n.data?.zuletzt_geladen?m=e[15]:(m=n.data?.zuletzt_geladen??{},e[14]=n.data?.zuletzt_geladen,e[15]=m);let v=m;e[16]!==s||e[17]!==o?(g=(0,I.jsx)(z,{modelle:o,laufend:s}),e[16]=s,e[17]=o,e[18]=g):g=e[18];let x=(0,I.jsx)(H,{titel:`Hirn`,modell:t,laeuft:!!t&&s.includes(t.name),nutzer:`Lucy, NerdQuiz und OpenChamber für Kleinkram`}),S=!!r&&s.includes(r.name),w;e[19]!==r||e[20]!==S?(w=(0,I.jsx)(H,{titel:`Coder`,modell:r,laeuft:S,nutzer:`OpenChamber zum Planen und Bauen und Lucys Delegation`}),e[19]=r,e[20]=S,e[21]=w):w=e[21];let T;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,I.jsx)(H,{titel:`Dritte Rolle`,laeuft:!1,nutzer:``}),e[22]=T):T=e[22],e[23]!==w||e[24]!==x?(_=(0,I.jsxs)(`section`,{"aria-label":`Rollen`,className:`grid gap-5 md:grid-cols-3 md:gap-6`,children:[x,w,T]}),e[23]=w,e[24]=x,e[25]=_):_=e[25];let E;e[26]===n.data?E=e[27]:(E=(0,I.jsx)(U,{nutzung:n.data}),e[26]=n.data,e[27]=E);let D;e[28]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,I.jsx)(X,{}),e[28]=D):D=e[28],e[29]===E?y=e[30]:(y=(0,I.jsxs)(`div`,{className:`grid gap-5 md:gap-6 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.3fr)]`,children:[E,D]}),e[29]=E,e[30]=y),c=C,d=`Weitere Einträge`,e[31]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,I.jsxs)(i,{variant:`outline`,size:`sm`,onClick:()=>a(!0),children:[(0,I.jsx)(N,{"aria-hidden":!0}),` Modelle selbst suchen`]}),e[31]=h):h=e[31],l=`m-0 flex list-none flex-col p-0`;let O;e[32]!==s||e[33]!==v?(O=e=>(0,I.jsxs)(`li`,{className:`grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3 border-t border-linie py-2.5 sm:grid-cols-[minmax(0,1fr)_120px_160px]`,children:[(0,I.jsxs)(`span`,{className:`min-w-0`,children:[(0,I.jsx)(`span`,{className:`ziffern block text-sm break-all`,children:e.name}),(0,I.jsx)(`span`,{className:`text-xs text-text-3`,children:e.aliases.length?e.aliases.join(`, `):`ohne Rolle`})]}),(0,I.jsx)(`span`,{className:`ziffern text-sm text-text-2`,children:p(e.size_bytes)}),(0,I.jsx)(`span`,{className:`ziffern hidden text-xs text-text-3 sm:block`,children:s.includes(e.name)?`geladen`:v[e.name]?`zuletzt ${b(v[e.name])}`:`länger nicht geladen`})]},e.name),e[32]=s,e[33]=v,e[34]=O):O=e[34],u=f.map(O),e[3]=s,e[4]=o,e[5]=n.data,e[6]=c,e[7]=l,e[8]=u,e[9]=d,e[10]=h,e[11]=g,e[12]=_,e[13]=y}else c=e[6],l=e[7],u=e[8],d=e[9],h=e[10],g=e[11],_=e[12],y=e[13];let x;e[35]!==l||e[36]!==u?(x=(0,I.jsx)(`ul`,{className:l,children:u}),e[35]=l,e[36]=u,e[37]=x):x=e[37];let S;e[38]!==c||e[39]!==d||e[40]!==h||e[41]!==x?(S=(0,I.jsx)(c,{titel:d,rechts:h,children:x}),e[38]=c,e[39]=d,e[40]=h,e[41]=x,e[42]=S):S=e[42];let w;e[43]===Symbol.for(`react.memo_cache_sentinel`)?(w=()=>a(!1),e[43]=w):w=e[43];let T;e[44]===r?T=e[45]:(T=(0,I.jsx)(L,{offen:r,onSchliessen:w}),e[44]=r,e[45]=T);let E;return e[46]!==T||e[47]!==g||e[48]!==_||e[49]!==y||e[50]!==S?(E=(0,I.jsxs)(I.Fragment,{children:[g,_,y,S,T]}),e[46]=T,e[47]=g,e[48]=_,e[49]=y,e[50]=S,e[51]=E):E=e[51],E}function ee(e){return y(e)===`coder`}function te(e){return y(e)===`hirn`}export{$ as ModelleSeite}; \ No newline at end of file diff --git a/frontend/dist/assets/ModelsView-dw81nBmA.js b/frontend/dist/assets/ModelsView-dw81nBmA.js deleted file mode 100644 index 91a5a96..0000000 --- a/frontend/dist/assets/ModelsView-dw81nBmA.js +++ /dev/null @@ -1,83 +0,0 @@ -import{c as E,u as he,a as qe,r as v,j as e,C as Y,L as Fe,b as k,d as Re,q as V,R as Ie,B as re,e as Pe,E as ze,f as le,g as Be,h as Ae,i as Oe,k as Ge,l as ee,X as xe,H as be,T as se,s as Te,m as He,n as q,o as U,p as Qe,t as Ue,v as Ve,w as We,x as Ze,y as Je,z as Xe,A as Ye}from"./index-DMY9lUCb.js";import{J as et}from"./JobsBar-95gsUJZs.js";import{C as tt}from"./code-xml-Bf-y5tB9.js";import{C as ue,Z as ie,L as rt,a as st}from"./zap-2yha4rs4.js";import{S as ge}from"./search-D_8DnBvS.js";import{P as nt}from"./power-DsvD9qMX.js";import{C as $e}from"./chevron-down-1Vx9W9jM.js";import{L as at}from"./layers-CcL78b5Q.js";/** - * @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 ot=E("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 lt=E("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. - * See the LICENSE file in the root directory of this source tree. - */const De=E("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 ae=E("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const it=E("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 dt=E("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 ct=E("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/** - * @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 mt=E("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** - * @license lucide-react v0.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 xt=E("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 ut=E("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pt=E("PowerOff",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["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 Ee=E("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. - * See the LICENSE file in the root directory of this source tree. - */const ht=E("SlidersVertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/** - * @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 bt=E("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** - * @license lucide-react v0.460.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gt=E("Telescope",[["path",{d:"m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44",key:"k4qptu"}],["path",{d:"m13.56 11.747 4.332-.924",key:"19l80z"}],["path",{d:"m16 21-3.105-6.21",key:"7oh9d"}],["path",{d:"M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z",key:"m7xp4m"}],["path",{d:"m6.158 8.633 1.114 4.456",key:"74o979"}],["path",{d:"m8 21 3.105-6.21",key:"1fvxut"}],["circle",{cx:"12",cy:"13",r:"2",key:"1c1ljs"}]]);/** - * @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 ft=E("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"}]]),yt=["fast","heavy","heavy_chars"],jt=["coder_lite","coder","coding_escalate_chars"];function vt(){const t=he(),{data:r,isLoading:b}=qe(),[n,i]=v.useState(null),[M,w]=v.useState(!1),[N,S]=v.useState(""),[g,z]=v.useState(0);if(v.useEffect(()=>{r!=null&&r.policy&&!n&&i({...r.policy})},[r,n]),b||!r||!n)return e.jsx("div",{className:"mc-card p-5 text-xs text-muted-foreground",children:"Lade Routing-Policy…"});const m=s=>r.fields.find(o=>o.key===s),f=Object.keys(n).some(s=>n[s]!==r.policy[s]),p=(s,o)=>{i(d=>d&&{...d,[s]:o}),S("")},c=s=>p(s,r.defaults[s]);async function L(){if(!n)return;const s={};for(const o of Object.keys(n))n[o]!==r.policy[o]&&(s[o]=n[o]);if(Object.keys(s).length!==0){w(!0),S("");try{const{policy:o}=await Re(s);i({...o}),t.invalidateQueries({queryKey:V.routingPolicy}),t.invalidateQueries({queryKey:V.routing}),z(Date.now()),setTimeout(()=>z(0),2e3)}catch(o){S(o.message||String(o))}finally{w(!1)}}}function A({k:s}){const o=m(s),d=n[s],G=n[s]===r.defaults[s];return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("label",{className:"text-[10px] font-semibold text-muted-foreground",children:o.label}),!G&&e.jsxs("button",{onClick:()=>c(s),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(r.defaults[s])||"leer"})`,children:[e.jsx(Ie,{className:"h-2.5 w-2.5"})," Default"]})]}),o.type==="bool"?e.jsxs("button",{onClick:()=>p(s,!d),className:k("flex h-8 w-full items-center justify-between rounded-lg border px-3 text-[11px] font-semibold transition-all cursor-pointer",d?"border-emerald-500/40 bg-emerald-500/10 text-emerald-300":"border-border/40 bg-background/40 text-muted-foreground"),children:[e.jsx("span",{children:d?"An":"Aus"}),e.jsx("span",{className:k("h-3.5 w-3.5 rounded-full transition-colors",d?"bg-emerald-400":"bg-muted-foreground/40")})]}):o.type==="int"?e.jsx("input",{type:"number",value:d,min:o.min,max:o.max,"aria-label":o.label,onChange:B=>p(s,Number(B.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"}):e.jsx("input",{type:"text",value:d,"aria-label":o.label,spellCheck:!1,placeholder:s==="coder_lite"?"(leer = aus)":"",onChange:B=>p(s,B.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 e.jsxs("div",{className:"mc-card p-5 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ht,{className:"h-4.5 w-4.5 text-primary"}),e.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Lane-Routing & Policy"}),e.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"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[N&&e.jsx("span",{className:"text-[10px] text-red-400 max-w-[280px] truncate",title:N,children:N}),g>0&&e.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-emerald-400",children:[e.jsx(Y,{className:"h-3.5 w-3.5"})," gespeichert"]}),e.jsxs("button",{onClick:L,disabled:!f||M,className:k("h-8 px-4 rounded-lg text-[10px] font-bold uppercase tracking-wide transition-all flex items-center gap-1.5",f&&!M?"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:[M?e.jsx(Fe,{className:"h-3.5 w-3.5 animate-spin"}):null,"Speichern"]})]})]}),e.jsxs("p",{className:"text-[10px] text-muted-foreground/70 leading-relaxed -mt-1",children:["Welches echte Modell hinter den virtuellen Lanes ",e.jsx("code",{className:"text-cyan-300",children:"chat"})," und"," ",e.jsx("code",{className:"text-cyan-300",children:"coding"})," steckt. Änderungen greifen sofort (kein Neustart). Die Keyword-Heuristiken bleiben im Code."]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"rounded-xl border border-border/40 bg-background/25 p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-border/30 pb-2",children:[e.jsx(mt,{className:"h-4 w-4 text-teal-400"}),e.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider text-foreground",children:"chat"}),e.jsx("span",{className:"text-[9px] text-muted-foreground/60 font-mono",children:"(= auto)"})]}),yt.map(s=>e.jsx(A,{k:s},s))]}),e.jsxs("div",{className:"rounded-xl border border-border/40 bg-background/25 p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 border-b border-border/30 pb-2",children:[e.jsx(tt,{className:"h-4 w-4 text-indigo-400"}),e.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider text-foreground",children:"coding"}),e.jsx("span",{className:"text-[9px] text-muted-foreground/60 font-mono",children:"(agentisch → immer Coder)"})]}),jt.map(s=>e.jsx(A,{k:s},s))]})]}),e.jsx("div",{className:"rounded-xl border border-border/40 bg-background/25 p-4",children:e.jsx("div",{className:"max-w-xs",children:e.jsx(A,{k:"fast_no_think"})})})]})}const fe=[{role:"hermes",label:"Lucys Hirn",short:"Hirn",icon:re,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:Pe,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:ct,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:ze,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:lt,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:ue,desc:"Schnelles Programmieren im Alltag.",tone:"bg-violet-500/15 text-violet-400 border-violet-500/25"},{role:"coder",label:"Programmierer",short:"Code",icon:ue,desc:"Baut und plant. Der Kopf der Coding-Mannschaft — er hält den Faden und verteilt Zuarbeit.",tone:"bg-fuchsia-500/15 text-fuchsia-400 border-fuchsia-500/25",protected:!0},{role:"scout",label:"Späher",short:"Späher",icon:gt,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:Ee,desc:"Liest dem Programmierer nach jeder Etappe gegen — bewusst aus einer FREMDEN Modellfamilie (Mistral statt Qwen), damit er andere blinde Flecken hat.",tone:"bg-cyan-500/15 text-cyan-400 border-cyan-500/25"}];fe.map(t=>t.role);const je=Object.fromEntries(fe.map(t=>[t.role,t])),ve=t=>({role:t||"?",label:t||"unbekannt",short:t||"?",icon:re,desc:"Rolle ohne hinterlegten Klartext-Namen.",tone:"bg-slate-500/15 text-slate-300 border-slate-500/25"}),Nt={fast:"hermes",coder_lite:"coder-lite"};function F(t){return t&&(je[t]||je[Nt[t]])||ve(t)}function pe({role:t,dense:r=!1,className:b}){const n=F(t),i=n.icon;return e.jsxs("span",{className:k("inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-[10px] font-semibold border tracking-wide",n.tone,b),title:`${n.desc} (${n.role})`,children:[e.jsx(i,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}),r?n.short:n.label]})}function kt({fit:t}){const r={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"}[t.level];return e.jsxs("span",{className:k("rounded px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider font-mono",r),children:[t.text," • ",t.req_gb," GB RAM"]})}function Ke(t){const r=t.toLowerCase();return r.includes("qwen")?{name:"Qwen",color:"bg-purple-500/20 text-purple-300 border-purple-500/30",initial:"Q"}:r.includes("gemma")?{name:"Gemma",color:"bg-blue-500/20 text-blue-300 border-blue-500/30",initial:"G"}:r.includes("llama")?{name:"Llama",color:"bg-red-500/20 text-red-300 border-red-500/30",initial:"🦙"}:r.includes("mistral")||r.includes("mixtral")?{name:"Mistral",color:"bg-orange-500/20 text-orange-300 border-orange-500/30",initial:"M"}:r.includes("deepseek")?{name:"DeepSeek",color:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30",initial:"D"}:r.includes("hermes")||r.includes("nous")?{name:"Hermes",color:"bg-amber-500/20 text-amber-300 border-amber-500/30",initial:"H"}:r.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 wt(){var te,T,$;const t=he(),{data:r}=le(),{data:b}=Be(),{data:n}=Ae(),{data:i}=Oe(),{showAlert:M,dialogElement:w}=Ge(),[N,S]=v.useState(!1),[g,z]=v.useState(!1),m=(r==null?void 0:r.models)??[],f=(r==null?void 0:r.running)??[],p=(te=b==null?void 0:b.groups)==null?void 0:te.brains,c=(p==null?void 0:p.members)??[],L=u=>m.find(_=>_.name===u),A=u=>{var _;return((_=u.split("/").pop())==null?void 0:_.replace(/\.gguf$/i,""))||u},s=c.map(L).filter(Boolean),o=1024**3,d=i==null?void 0:i.budget,G=s.reduce((u,_)=>u+(_.size_bytes||0),0)/o,B=((T=n==null?void 0:n.gpu)==null?void 0:T.gtt_total)||(($=n==null?void 0:n.gpu)==null?void 0:$.vram_total)||0,C=(d==null?void 0:d.gtt_gb)||(B?B/o:0),j=(d==null?void 0:d.warm_projected_gb)??G,R=C>0?Math.min(100,j/C*100):0,K=m.filter(u=>!c.includes(u.name)&&!u.incomplete);async function I(u){z(!0);try{await Te("brains",u,(p==null?void 0:p.swap)??!1,(p==null?void 0:p.persist)??!0),t.invalidateQueries({queryKey:V.groups}),t.invalidateQueries({queryKey:V.models}),t.invalidateQueries({queryKey:V.hermesBrain})}catch(_){M("Fehler",`Immer-bereit-Set konnte nicht geändert werden: ${(_==null?void 0:_.message)||_}`)}finally{z(!1)}}function O(u){const _=L(u);if(_&&F(_.role).protected){M("Geschützt",`„${F(_.role).label}" ist lebenswichtig und bleibt immer bereit.`);return}I(c.filter(H=>H!==u))}function W(u){S(!1),I([...c,u])}return p?e.jsxs("div",{className:"mc-card p-5 space-y-4",children:[e.jsx(Ne,{}),e.jsxs("div",{className:"space-y-1.5",children:[s.length===0&&e.jsx("div",{className:"text-xs text-muted-foreground",children:"Noch keine Modelle im Set."}),s.map(u=>{const _=f.includes(u.name),H=F(u.role).protected;return e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-xl border border-border/30 bg-background/20 p-2.5",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[e.jsx("span",{className:k("h-2 w-2 shrink-0 rounded-full ring-2 ring-black/40",_?"bg-emerald-500 animate-pulse":"bg-muted-foreground/40"),title:_?"Gerade warm (bereit)":"Reserviert — lädt bei Bedarf sofort"}),u.role&&e.jsx(pe,{role:u.role,dense:!0,className:"shrink-0"}),e.jsx("span",{className:"truncate font-mono text-xs font-semibold text-foreground",title:u.name,children:A(u.name)}),e.jsx("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:ee(u.size_bytes)})]}),H?e.jsx("span",{className:"shrink-0 text-[10px] font-semibold text-muted-foreground",title:"Lebenswichtig — bleibt immer im Set.",children:"🔒"}):e.jsx("button",{onClick:()=>O(u.name),disabled:g,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:e.jsx(xe,{className:"h-3.5 w-3.5"})})]},u.name)})]}),e.jsxs("button",{onClick:()=>S(!0),disabled:g||K.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:[e.jsx(ut,{className:"h-3.5 w-3.5"})," Modell dauerhaft bereithalten"]}),e.jsxs("div",{className:"rounded-xl border border-border/30 bg-background/20 p-3",children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between text-[11px]",children:[e.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:[e.jsx(be,{className:"h-3.5 w-3.5"})," Reserviert fürs Set"]}),e.jsxs("span",{className:"font-mono font-bold text-foreground",children:[j.toFixed(1),C>0?` / ${C.toFixed(0)}`:""," GB"]})]}),e.jsx("div",{className:"h-2 w-full overflow-hidden rounded-full border border-border/30 bg-background/50",children:e.jsx("div",{className:k("h-full rounded-full transition-all duration-500",R>=85?"bg-red-500":R>=65?"bg-amber-500":"bg-teal-500"),style:{width:`${R}%`}})}),d&&!d.fits&&e.jsxs("p",{className:"mt-2 flex items-start gap-1.5 text-[11px] text-amber-400",children:[e.jsx(se,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),e.jsxs("span",{children:["Zusammen mit dem größten Gelegenheits-Modell (~",d.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)."]})]}),d&&d.fits&&e.jsxs("p",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-emerald-400",children:[e.jsx(Y,{className:"h-3.5 w-3.5 shrink-0"})," Passt auch neben dem größten Gelegenheits-Modell — nichts wird verdrängt."]})]}),N&&e.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:e.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:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[e.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:"Dauerhaft bereithalten"}),e.jsx("button",{onClick:()=>S(!1),className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground cursor-pointer",children:e.jsx(xe,{className:"h-4 w-4"})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Wähle ein Modell, das ohne Ladezeit bereitstehen soll:"}),e.jsx("div",{className:"max-h-60 space-y-1.5 overflow-y-auto pr-1",children:K.map(u=>e.jsxs("button",{onClick:()=>W(u.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:[e.jsxs("span",{className:"flex min-w-0 items-center gap-2",children:[u.role&&e.jsx(pe,{role:u.role,dense:!0,className:"shrink-0"}),e.jsx("span",{className:"truncate font-mono text-xs font-semibold text-foreground",children:A(u.name)})]}),e.jsx("span",{className:"shrink-0 font-mono text-[10px] text-muted-foreground/70",children:ee(u.size_bytes)})]},u.name))})]})}),w]}):e.jsxs("div",{className:"mc-card p-5",children:[e.jsx(Ne,{}),e.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."}),w]})}function Ne(){return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ie,{className:"h-4.5 w-4.5 text-primary"}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-bold uppercase tracking-wide text-foreground",children:"Immer-bereit-Set"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Diese Modelle hält Lucy immer bereit — sie antworten ohne Ladezeit."})]})]})}function J({children:t,tone:r="muted"}){const b={muted:"bg-muted text-muted-foreground",primary:"bg-primary/15 text-primary",warn:"bg-amber-500/15 text-amber-500"};return e.jsx("span",{className:`rounded px-1.5 py-0.5 text-[11px] font-medium ${b[r]}`,children:t})}function Mt({caps:t}){return t?e.jsxs("span",{className:"inline-flex flex-wrap gap-1",children:[t.coder&&e.jsx(J,{children:"💻 Code"}),t.vision&&e.jsx(J,{children:"👁 Bild"}),t.reasoning&&e.jsx(J,{children:"🧠 Reason"}),t.moe&&e.jsxs(J,{tone:"primary",children:["🧩 MoE",t.active_b?`·${t.active_b}b`:""]}),t.tools==="yes"&&e.jsx(J,{tone:"primary",children:"🛠 Tools"}),t.tools==="likely"&&e.jsx(J,{tone:"warn",children:"🛠 Tools?"}),t.embedding&&e.jsx(J,{children:"🔢 Embed"})]}):null}function St({model:t,onClose:r,onChanged:b}){var L,A;const{data:n,isLoading:i}=He(t.gguf_path),[M,w]=v.useState(null),[N,S]=v.useState(""),g=n==null?void 0:n.target_vocab,z=(n==null?void 0:n.drafts)??[],m=z.filter(s=>s.compatible===!0),f=t.spec_draft_model;async function p(s){w(s??"__clear__"),S("");try{await q(`/api/models/${encodeURIComponent(t.name)}/draft`,{method:"POST",body:JSON.stringify({draft_path:s})}),b(),r()}catch(o){S(String((o==null?void 0:o.message)||o)),w(null)}}const c=s=>{var o;return s?`${s.pre??"?"} · ${((o=s.n_vocab)==null?void 0:o.toLocaleString())??"?"} Tokens`:"—"};return e.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:e.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:[e.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[e.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-2",children:[e.jsx(ie,{className:"h-4 w-4"})," Speculative Draft"]}),e.jsx("button",{onClick:r,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(xe,{className:"h-4 w-4"})})]}),e.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 ',e.jsx("strong",{className:"text-foreground",children:"exakt gleichen Tokenizer (Vocab)"})," haben wie das Modell — sonst lehnt llama.cpp es ab."]}),e.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:[e.jsx("span",{className:"text-muted-foreground",children:(L=t.name.split("/").pop())==null?void 0:L.replace(/\.gguf$/i,"")}),e.jsxs("span",{className:"text-foreground",children:["Vocab: ",c(g)]})]}),t.spec_active&&f&&e.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:[e.jsxs("span",{className:"text-[11px] text-emerald-400 font-mono flex items-center gap-1.5 truncate",children:[e.jsx(Y,{className:"h-3.5 w-3.5 shrink-0"})," Aktiv: ",f]}),e.jsx("button",{onClick:()=>p(null),disabled:M!==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)&&e.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:[e.jsx(se,{className:"h-3.5 w-3.5 shrink-0"}),"Modell-GGUF noch nicht vorhanden — Spec-Draft ist nach dem Download konfigurierbar."]}),e.jsx("div",{className:"space-y-1.5 max-h-64 overflow-y-auto pr-1",children:i?e.jsx("div",{className:"text-xs text-muted-foreground py-6 text-center",children:"Prüfe Vocab-Kompatibilität…"}):z.length===0?e.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 ",e.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."]}):z.map(s=>{var G,B;const o=s.filename===f,d=s.compatible===!0;return e.jsxs("div",{className:k("rounded-lg border px-3 py-2 flex items-center justify-between gap-2 text-left",d?"border-border/40 bg-background/20":"border-border/20 bg-background/10 opacity-60",o&&"border-primary/40 bg-primary/10"),children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"text-[11px] font-mono font-semibold text-foreground truncate flex items-center gap-1.5",children:[s.filename,s.mtp&&e.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"})]}),e.jsxs("div",{className:"text-[9px] text-muted-foreground font-mono",children:[ee(s.size_bytes)," · Vocab: ",c(s.vocab)]})]}),d?o?e.jsxs("span",{className:"text-[9px] font-bold uppercase text-primary flex items-center gap-1 shrink-0",children:[e.jsx(Y,{className:"h-3.5 w-3.5"})," Aktiv"]}):e.jsx("button",{onClick:()=>p(s.path),disabled:M!==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"}):e.jsxs("span",{className:"text-[9px] font-bold uppercase text-amber-400/80 flex items-center gap-1 shrink-0",title:s.compatible===!1?`Inkompatibel: Tokenizer/Vocab weicht ab (Draft ${(G=s.vocab)==null?void 0:G.pre}/${(B=s.vocab)==null?void 0:B.n_vocab} ≠ Modell ${g==null?void 0:g.pre}/${g==null?void 0:g.n_vocab}).`:"Kompatibilität nicht prüfbar (Datei fehlt).",children:[e.jsx(se,{className:"h-3.5 w-3.5"})," ",s.compatible===!1?"Vocab ≠":"n/a"]})]},s.path)})}),!i&&(n==null?void 0:n.target_exists)&&z.length>0&&m.length===0&&e.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=",e.jsx("span",{className:"font-mono",children:g==null?void 0:g.pre}),", n_vocab=",e.jsx("span",{className:"font-mono",children:(A=g==null?void 0:g.n_vocab)==null?void 0:A.toLocaleString()}),")."]}),N&&e.jsx("div",{className:"text-[10px] text-red-400 font-mono",children:N})]})})}const ke={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"}},Ct={fast:"hermes",coder_lite:"coder-lite"},we={bar:"bg-slate-400",dot:"bg-slate-400",text:"text-slate-300"};function oe(t){return t&&(ke[t]||ke[Ct[t]])||we}const Me=1024**3,Se=t=>{var r;return((r=t.split("/").pop())==null?void 0:r.replace(/\.gguf$/i,""))??t};function _t({running:t,capacityBytes:r,realUsedBytes:b,selected:n,onSelect:i}){const M=r>2*Me?r:124*Me,w=t.reduce((m,f)=>m+(f.size_bytes||0),0),N=Math.max(0,b-w),S=Math.max(0,M-Math.max(w,b)),g=S/M*100,z=N/M*100;return e.jsxs("div",{className:"mc-card p-5",children:[e.jsxs("div",{className:"mb-3 flex flex-wrap items-end justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(be,{className:"h-5 w-5 text-primary"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Modell-Speicher (GPU-Pool)"}),e.jsxs("div",{className:"font-space text-xl font-bold tracking-tight text-foreground",children:[U(M)," GB ",e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"gesamt"})]})]})]}),e.jsxs("div",{className:"text-right text-[11px] font-mono text-muted-foreground",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"font-bold text-foreground",children:[U(w)," GB"]})," Modell-Gewichte"]}),N>0&&e.jsxs("div",{children:[U(N)," GB KV-Cache & Betrieb"]}),e.jsxs("div",{className:"text-emerald-400",children:[U(S)," GB frei"]})]})]}),e.jsx("div",{className:"flex h-12 w-full overflow-hidden rounded-xl border border-border/40 bg-background/50 p-1",children:t.length===0?e.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."}):e.jsxs(e.Fragment,{children:[t.map(m=>{const f=(m.size_bytes||0)/M*100,p=oe(m.role),c=n===m.name;return e.jsxs("button",{onClick:()=>i==null?void 0:i(m.name),style:{width:`${f}%`},title:`${F(m.role).label} · ${Se(m.name)} · ${ee(m.size_bytes)}`,className:k("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,c?"ring-2 ring-white/70":"opacity-90 hover:opacity-100"),children:[e.jsx("span",{className:"truncate font-space text-[10px] font-bold leading-tight tracking-wide",children:F(m.role).short}),e.jsx("span",{className:"truncate font-mono text-[9px] leading-tight opacity-85",children:ee(m.size_bytes)})]},m.name)}),z>1.5&&e.jsx("div",{style:{width:`${z}%`},className:"flex h-full min-w-[2rem] items-center justify-center rounded-lg border border-dashed border-border/60 bg-background/40 text-[9px] font-mono text-muted-foreground/70",title:`${U(N)} GB KV-Cache & Betrieb (reale Belegung über den Modell-Gewichten)`,children:"KV"}),g>1.5&&e.jsx("div",{style:{width:`${g}%`},className:"flex h-full min-w-[2rem] items-center justify-center rounded-lg text-[9px] font-mono text-muted-foreground/50",title:`${U(S)} GB frei`,children:"frei"})]})}),t.length>0&&e.jsxs("div",{className:"mt-3 flex flex-wrap gap-x-4 gap-y-1.5",children:[t.map(m=>{const f=oe(m.role);return e.jsxs("button",{onClick:()=>i==null?void 0:i(m.name),className:"flex items-center gap-1.5 text-[11px] text-muted-foreground transition-colors hover:text-foreground",children:[e.jsx("span",{className:k("h-2.5 w-2.5 rounded-sm",f.dot)}),e.jsx("span",{className:k("font-semibold",f.text),children:F(m.role).short}),e.jsx("span",{className:"font-mono text-muted-foreground/70",children:Se(m.name)})]},m.name)}),N>0&&e.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground/60",title:"Reale Belegung über den Modell-Gewichten (Kontext-Speicher der laufenden Modelle)",children:[e.jsx("span",{className:"h-2.5 w-2.5 rounded-sm border border-dashed border-border/60 bg-background/40"})," KV-Cache & Betrieb · ",U(N)," GB"]}),e.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground/60",children:[e.jsx("span",{className:"h-2.5 w-2.5 rounded-sm border border-border/50 bg-background/50"})," frei · ",U(S)," GB"]})]})]})}const Ce=1024**3,X=t=>{var r;return((r=t.split("/").pop())==null?void 0:r.replace(/\.gguf$/i,""))??t};function Lt(){var a,h,D,Q;const t=he(),{data:r,isLoading:b,error:n}=le(),{data:i}=Ae(),{data:M}=Be(),{showAlert:w,showConfirm:N,showPrompt:S,dialogElement:g}=Ge(),z=Qe(),m=(r==null?void 0:r.models)??[],f=(r==null?void 0:r.running)??[],p=l=>!!F(l).protected,c=(a=M==null?void 0:M.groups)==null?void 0:a.brains,L=(c==null?void 0:c.members)??[],A=l=>L.includes(l),[s,o]=v.useState(null),[d,G]=v.useState(""),[B,C]=v.useState("all"),[j,R]=v.useState(null),K=()=>{t.invalidateQueries({queryKey:V.models}),t.invalidateQueries({queryKey:V.routing}),t.invalidateQueries({queryKey:V.groups})},I=m.filter(l=>f.includes(l.name)),O=((h=i==null?void 0:i.gpu)==null?void 0:h.gtt_total)||((D=i==null?void 0:i.gpu)==null?void 0:D.vram_total)||0,W=((Q=i==null?void 0:i.gpu)==null?void 0:Q.gtt_used)||0,te=O>2*Ce?O:124*Ce,T=v.useMemo(()=>{const l=d.trim().toLowerCase();return m.filter(x=>B==="in_use"?!!x.role||f.includes(x.name):!0).filter(x=>l?x.name.toLowerCase().includes(l):!0).sort((x,y)=>{const P=f.includes(x.name)?0:1,Z=f.includes(y.name)?0:1;return P!==Z?P-Z:X(x.name).localeCompare(X(y.name))})},[m,f,B,d]),$=m.find(l=>l.name===s)??null;async function u(l){try{await q(`/api/models/${encodeURIComponent(l)}/load`,{method:"POST"}),K()}catch(x){w("Fehler",`Laden fehlgeschlagen: ${x.message||x}`)}}async function _(l){const x=L.some(y=>f.includes(y));if(c&&x&&!A(l)){const y=L.filter(P=>f.includes(P)).map(X).join(", ");N("Verdrängt das Hirn?",`„${X(l)}" ist nicht ko-resident. Beim Laden wirft es das warme Hirn (${y}) raus — Lucy verliert Hirn bzw. Augen. - -Trotzdem exklusiv laden?`,()=>u(l));return}u(l)}async function H(l){const x=m.find(y=>y.name===l);if(x&&p(x.role)){w("Geschützt",`„${F(x.role).label}" ist lebenswichtig und bleibt geladen.`);return}try{await q(`/api/models/${encodeURIComponent(l)}/unload`,{method:"POST"}),K()}catch(y){w("Fehler",`Entladen fehlgeschlagen: ${y.message||y}`)}}async function de(l,x){try{const y=await q(`/api/models/${encodeURIComponent(x)}/role`,{method:"POST",body:JSON.stringify({role:l||null})});K(),y!=null&&y.warning&&w("Rolle gesetzt — Hinweis",y.warning)}catch(y){w("Fehler",`Rolle zuweisen fehlgeschlagen: ${y.message||y}`)}}async function ce(l,x){let y=null;try{y=await q(`/api/models/${encodeURIComponent(l)}/ctx/auto`)}catch{}const P=y?`Optimal für dein Setup: ${(y.ctx/1024).toFixed(0)}k (${y.ctx}). »Auto« trägt diesen Wert ein.`:"Gib die gewünschte Kontextlänge in Tokens an:";S("Kontextlänge anpassen",P,String(x||32768),async Z=>{if(Z)try{await q(`/api/models/${encodeURIComponent(l)}/ctx`,{method:"POST",body:JSON.stringify({ctx:parseInt(Z,10)})}),K()}catch(ye){w("Fehler",`Kontext setzen fehlgeschlagen: ${ye.message||ye}`)}},void 0,y?{autoValue:String(y.ctx),autoLabel:`Auto (${(y.ctx/1024).toFixed(0)}k)`}:void 0)}async function me(l){const x=m.find(y=>y.name===l);if(x&&p(x.role)){w("Geschützt",`„${F(x.role).label}" kann nicht gelöscht werden. Weise die Rolle zuerst einem anderen Modell zu.`);return}N("Modell löschen?",`„${X(l)}" und alle GGUF-Dateien unwiderruflich von der Box löschen?`,async()=>{try{await q(`/api/models/${encodeURIComponent(l)}`,{method:"DELETE"}),s===l&&o(null),K()}catch(y){w("Fehler",`Löschen fehlgeschlagen: ${y.message||y}`)}})}return b?e.jsx("div",{className:"py-16 text-center text-xs text-muted-foreground",children:"Werkbank wird geladen …"}):n?e.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),")."]}):e.jsxs("div",{className:"space-y-5",children:[e.jsx(_t,{running:I,capacityBytes:te,realUsedBytes:W,selected:s,onSelect:o}),e.jsxs("div",{className:"grid gap-5 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.3fr)]",children:[e.jsxs("div",{className:"mc-card p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(ge,{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"}),e.jsx("input",{value:d,onChange:l=>G(l.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"})]}),e.jsx("div",{className:"flex rounded-lg border border-border/40 bg-background/30 p-0.5",children:["all","in_use"].map(l=>e.jsx("button",{onClick:()=>C(l),className:k("rounded-md px-2 py-1 text-[9px] font-bold uppercase transition-all cursor-pointer",B===l?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:l==="all"?"Alle":"In Benutzung"},l))})]}),e.jsx("div",{className:"max-h-[60vh] space-y-1.5 overflow-y-auto scrollbar-thin pr-1",children:T.length===0?e.jsx("div",{className:"rounded-xl border border-dashed border-border/50 p-8 text-center text-xs text-muted-foreground",children:"Keine Modelle."}):T.map(l=>{const x=f.includes(l.name),y=s===l.name,P=Ke(l.name),Z=oe(l.role);return e.jsxs("button",{onClick:()=>o(l.name),className:k("flex w-full items-center gap-2.5 rounded-xl border p-2.5 text-left transition-all cursor-pointer",y?"border-primary/60 bg-primary/10":"border-border/40 bg-background/20 hover:border-primary/30 hover:bg-background/40"),children:[e.jsx("span",{className:k("flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border text-[10px] font-bold",P.color),children:P.initial}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate font-mono text-xs font-semibold text-foreground",children:X(l.name)}),e.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5",children:[l.role&&e.jsx("span",{className:k("h-2 w-2 rounded-sm",Z.dot)}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:l.role?F(l.role).short:"keine Rolle"}),e.jsxs("span",{className:"text-[10px] text-muted-foreground/50",children:["· ",ee(l.size_bytes)]})]})]}),x?e.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[9px] font-bold uppercase text-emerald-400",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"warm"]}):l.incomplete?e.jsx("span",{className:"shrink-0 text-[9px] font-bold uppercase text-amber-400",children:"⚠ fehlt"}):e.jsx("span",{className:"shrink-0 text-[9px] font-semibold uppercase text-muted-foreground/50",children:"bereit"})]},l.name)})})]}),e.jsx("div",{className:"mc-card p-5",children:$?e.jsx(zt,{m:$,warm:f.includes($.name),expert:z,protectedRole:p($.role),coresident:A($.name),onLoad:()=>_($.name),onUnload:()=>H($.name),onRole:l=>de(l,$.name),onCtx:()=>ce($.name,$.ctx),onSpec:()=>R($),onDelete:()=>me($.name)}):e.jsxs("div",{className:"flex h-full min-h-[16rem] flex-col items-center justify-center gap-2 text-center text-muted-foreground",children:[e.jsx(Ue,{className:"h-8 w-8 opacity-40"}),e.jsx("p",{className:"text-sm font-semibold",children:"Links ein Modell wählen"}),e.jsx("p",{className:"text-xs",children:"Dann verwaltest du es hier — laden, Rolle, Kontext, löschen."})]})})]}),j&&e.jsx(St,{model:j,onClose:()=>R(null),onChanged:K}),g]})}function zt({m:t,warm:r,expert:b,protectedRole:n,coresident:i,onLoad:M,onUnload:w,onRole:N,onCtx:S,onSpec:g,onDelete:z}){const m=Ke(t.name),f=r&&n;return e.jsxs("div",{className:"flex h-full flex-col gap-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:k("flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border text-sm font-bold",m.color),children:m.initial}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"break-all font-mono text-sm font-bold text-foreground",children:X(t.name)}),e.jsxs("div",{className:"mt-1.5 flex flex-wrap items-center gap-1.5",children:[t.role?e.jsx(pe,{role:t.role}):e.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&&e.jsxs("span",{className:"rounded bg-background/40 px-1.5 py-0.5 text-[10px] text-muted-foreground",title:"Lebenswichtig — geschützt",children:[e.jsx(rt,{className:"mr-0.5 inline h-3 w-3"}),"geschützt"]}),i&&e.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:[e.jsx(re,{className:"mr-0.5 inline h-3 w-3"}),"Ko-resident"]}),r&&e.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-bold uppercase text-emerald-400",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"warm"]})]})]})]}),e.jsxs("button",{onClick:r?w:M,disabled:t.incomplete&&!r||f,className:k("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",r?"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:f?`„${F(t.role).label}" bleibt geladen (geschützt).`:void 0,children:[r?e.jsx(pt,{className:"h-4 w-4"}):e.jsx(nt,{className:"h-4 w-4"}),f?"🔒 bleibt geladen":r?"Entladen":"Ins Warm-Set laden"]}),e.jsxs("div",{className:"rounded-xl border border-border/30 bg-background/20 p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:[e.jsx("span",{children:"Rolle"}),n&&e.jsx("span",{className:"normal-case font-medium tracking-normal text-muted-foreground/70",children:"🔒 lebenswichtig — zum Tausch die Rolle woanders zuweisen"})]}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.jsx(_e,{active:!t.role,onClick:()=>N(""),dot:"bg-slate-400",label:"keine",disabled:n}),fe.map(p=>e.jsx(_e,{active:t.role===p.role,onClick:()=>N(p.role),dot:oe(p.role).dot,label:p.short,disabled:n&&t.role!==p.role},p.role))]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsx(Bt,{icon:be,label:"Größe",value:ee(t.size_bytes)}),e.jsxs("button",{onClick:S,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:[e.jsx(xt,{className:"h-4 w-4 text-primary/80"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:"Kontext · ändern"}),e.jsx("div",{className:"font-semibold text-foreground",children:Ve(t.ctx)})]})]})]}),e.jsxs("div",{className:"rounded-xl border border-border/30 bg-background/20 p-3",children:[e.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[e.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Beschleuniger"}),b&&e.jsxs("button",{onClick:g,className:k("flex h-6 items-center gap-1 rounded-lg border px-2 text-[9px] font-bold uppercase transition-colors cursor-pointer",t.spec_active?"border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10":t.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:[e.jsx(ie,{className:"h-3 w-3"})," Spec"]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[t.spec_active&&e.jsx(ne,{tone:"emerald",label:"Spec-Decoding aktiv"}),!t.spec_active&&t.spec_draft_model&&e.jsx(ne,{tone:"amber",label:"Spec inaktiv"}),t.prompt_cache&&e.jsx(ne,{tone:"cyan",label:"Prompt-Cache"}),t.parallel_slots>1&&e.jsx(ne,{tone:"violet",label:`${t.parallel_slots} Slots`}),!t.spec_active&&!t.spec_draft_model&&!t.prompt_cache&&t.parallel_slots<=1&&e.jsx("span",{className:"text-[11px] text-muted-foreground/60",children:"keine aktiv"})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:e.jsx(Mt,{caps:t.capabilities})}),e.jsxs("button",{onClick:z,disabled:n,className:k("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:[e.jsx(ft,{className:"h-3.5 w-3.5"})," ",n?"geschützt — nicht löschbar":"Modell löschen"]})]})}function _e({active:t,onClick:r,dot:b,label:n,disabled:i}){return e.jsxs("button",{onClick:r,disabled:i,title:i?"Gesperrt: dieses Modell hält eine lebenswichtige Rolle.":void 0,className:k("flex items-center gap-1.5 rounded-lg border px-2 py-1 text-[10px] font-semibold transition-all",i?"cursor-not-allowed opacity-40 border-border/40 bg-background/20 text-muted-foreground":t?"cursor-pointer border-primary/60 bg-primary/15 text-foreground":"cursor-pointer border-border/40 bg-background/20 text-muted-foreground hover:border-primary/30"),children:[e.jsx("span",{className:k("h-2 w-2 rounded-sm",b)}),n,t&&e.jsx(Y,{className:"h-3 w-3 text-primary"})]})}function Bt({icon:t,label:r,value:b}){return e.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-border/30 bg-background/20 p-2.5",children:[e.jsx(t,{className:"h-4 w-4 text-primary/80"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[9px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:r}),e.jsx("div",{className:"font-semibold text-foreground",children:b})]})]})}function ne({tone:t,label:r}){const b={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"}[t];return e.jsx("span",{className:k("rounded border px-1.5 py-0.5 text-[10px] font-semibold",b),children:r})}const At=[{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"}],Gt=["fast","heavy","coder","vision","hermes","scout"],$t=new Intl.NumberFormat(void 0,{notation:"compact",maximumFractionDigits:1});function Le(t){return $t.format(t)}function Dt(){const{data:t}=le(),r=(t==null?void 0:t.models)??[],[b,n]=v.useState(""),[i,M]=v.useState([]),[w,N]=v.useState(!1),[S,g]=v.useState(""),[z,m]=v.useState("popular"),[f,p]=v.useState(""),[c,L]=v.useState(null),[A,s]=v.useState([]),[o,d]=v.useState("Q4_K_M"),[G,B]=v.useState(""),[C,j]=v.useState(null),[R,K]=v.useState(!1),[I,O]=v.useState({});async function W(a){N(!0),g("");try{const h=await q(`/api/hf/search?q=${encodeURIComponent(a)}`);M(h.results),h.results.length||g("Keine Ergebnisse.")}catch(h){g(`Suche fehlgeschlagen: ${h}`)}finally{N(!1)}}v.useEffect(()=>{W("")},[]);function te(a){m(a.key),n(""),W(a.q)}function T(){m(""),W(b)}async function $(a,h,D){K(!1);try{const Q=await q(`/api/fit?params_b=0&quant=${encodeURIComponent(h)}&ctx=8192&name=${encodeURIComponent(a)}&role=${encodeURIComponent(D)}`);j(Q)}catch{j(null)}}async function u(a){if(c===a){L(null);return}L(a),s([]),j(null),B(""),K(!1),g("Analysiere Repository…");try{const h=await q(`/api/hf/quants?repo=${encodeURIComponent(a)}`);s(h.quants);const D=h.quants.includes("Q4_K_M")?"Q4_K_M":h.quants[0]||"Q4_K_M";d(D),g(h.quants.length?"":"Keine GGUF-Dateien in diesem Repo gefunden."),h.quants.length&&$(h.repo,D,"")}catch(h){g(`Fehler: ${h}`)}}function _(){const a=f.trim();a&&(M(h=>h.some(D=>D.repo===a)?h:[{repo:a,downloads:0,likes:0},...h]),p(""),u(a))}const H=G?r.find(a=>(a.role||"").toLowerCase()===G):void 0;async function de(a){if((C==null?void 0:C.fit.level)==="too_tight"&&!R){K(!0);return}O(h=>({...h,[a]:"Starte…"}));try{await q("/api/models/install",{method:"POST",body:JSON.stringify({repo:a,quant:o,role:G||void 0,jinja:!0})}),O(h=>({...h,[a]:"Download läuft"})),K(!1)}catch(h){O(D=>({...D,[a]:`Fehler: ${h instanceof Error?h.message:String(h)}`}))}}const ce=a=>{var D;const h=((D=a.split("/").pop())==null?void 0:D.toLowerCase().replace(/-gguf$/i,""))||"";return h.length>3&&r.some(Q=>Q.name.toLowerCase().includes(h))},me=a=>a==="perfect"?"text-emerald-400 border-emerald-500/40 bg-emerald-500/10":a==="marginal"?"text-amber-400 border-amber-500/40 bg-amber-500/10":"text-red-400 border-red-500/40 bg-red-500/10";return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(ge,{className:"absolute left-3 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx("input",{value:b,onChange:a=>n(a.target.value),onKeyDown:a=>a.key==="Enter"&&T(),"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"})]}),e.jsx("button",{onClick:T,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"})]}),e.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:At.map(a=>e.jsxs("button",{onClick:()=>te(a),className:k("flex items-center gap-1.5 rounded-full px-3 py-1.5 text-[11px] font-semibold transition-all cursor-pointer border",z===a.key?"bg-primary/15 text-primary border-primary/30":"border-border/50 text-muted-foreground hover:text-foreground hover:border-border"),children:[a.key==="popular"&&e.jsx(it,{className:"h-3 w-3"}),a.label]},a.key))}),w?e.jsx("div",{className:"text-xs text-muted-foreground py-10 text-center",children:"Lade GGUF-Modelle von HuggingFace…"}):e.jsxs("div",{className:"space-y-2",children:[i.map(a=>{const h=c===a.repo,D=ce(a.repo),Q=a.repo.includes("/")?a.repo.split("/")[0]:"—",l=a.repo.split("/").pop();return e.jsxs("div",{className:k("mc-card-sm",h?"border-primary/40 shadow-lg shadow-primary/5":"border-border/50 hover:border-primary/30"),children:[e.jsxs("button",{onClick:()=>u(a.repo),className:"w-full flex items-center gap-3 p-3.5 text-left cursor-pointer",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("span",{className:"text-xs font-bold font-mono text-foreground truncate max-w-[280px]",title:a.repo,children:l}),D&&e.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:[e.jsx(Y,{className:"h-2.5 w-2.5"})," installiert"]})]}),e.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-3 mt-0.5 font-mono",children:[e.jsx("span",{children:Q}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ae,{className:"h-3 w-3"})," ",Le(a.downloads)]}),a.likes>0&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(dt,{className:"h-3 w-3"})," ",Le(a.likes)]})]})]}),h?e.jsx(De,{className:"h-4 w-4 text-muted-foreground shrink-0"}):e.jsx($e,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),h&&e.jsx("div",{className:"border-t border-border/30 p-3.5 space-y-3",children:A.length===0?e.jsx("div",{className:"text-[11px] text-muted-foreground font-mono",children:S||"Lade Quants…"}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:"Quant"}),e.jsx("select",{value:o,onChange:x=>{d(x.target.value),$(a.repo,x.target.value,G)},"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:A.map(x=>e.jsx("option",{value:x,className:"bg-popover text-foreground",children:x},x))}),e.jsx("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground ml-1",children:"Rolle"}),e.jsxs("select",{value:G,onChange:x=>{B(x.target.value),$(a.repo,o,x.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:[e.jsx("option",{value:"",className:"bg-popover text-foreground",children:"keine"}),Gt.map(x=>e.jsx("option",{value:x,className:"bg-popover text-foreground",children:x},x))]}),e.jsx("button",{onClick:()=>de(a.repo),disabled:!!I[a.repo]&&I[a.repo]==="Download läuft",className:k("h-8 px-3.5 ml-auto rounded-lg text-xs font-semibold transition-all cursor-pointer flex items-center gap-1.5",R?"bg-red-500 text-white hover:opacity-90":"bg-primary text-primary-foreground hover:opacity-90"),children:I[a.repo]?I[a.repo]:R?e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"h-3.5 w-3.5"})," OOM — trotzdem laden"]}):e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"h-3.5 w-3.5"})," Herunterladen"]})})]}),C&&e.jsxs("div",{className:k("flex flex-wrap items-center gap-x-3 gap-y-1 rounded-lg border px-3 py-2 text-[11px] font-medium",me(C.fit.level)),children:[e.jsx("span",{className:"font-bold uppercase tracking-wide",children:C.fit.text}),e.jsxs("span",{className:"font-mono opacity-90",children:["~",C.params_b,"B · ~",C.fit.req_gb," GB / ",C.sys_ram_gb," GB · ~",C.fit.tps," t/s"]}),C.fit.level!=="too_tight"?e.jsxs("span",{className:"font-mono opacity-80",children:["ctx → ",(C.assigned_ctx/1024).toFixed(0),"k"]}):e.jsx("span",{className:"opacity-90",children:"— passt nicht, würde beim Laden abstürzen (OOM)."})]}),H&&e.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:[e.jsx(se,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),e.jsxs("span",{children:["Rolle ",e.jsxs("strong",{children:["„",G,'"']})," hält aktuell ",e.jsx("strong",{children:H.name.split("/").pop()})," — wird beim Download übernommen."]})]})]})})]},a.repo)}),!i.length&&!w&&e.jsx("div",{className:"text-xs text-muted-foreground py-10 text-center",children:S||"Keine Ergebnisse."})]}),e.jsxs("div",{className:"border-t border-border/30 pt-4 flex flex-col sm:flex-row gap-2 items-stretch sm:items-center",children:[e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground shrink-0",children:"Direkt:"}),e.jsx("input",{value:f,onChange:a=>p(a.target.value),onKeyDown:a=>a.key==="Enter"&&_(),"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"}),e.jsx("button",{onClick:_,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 Et={fast:{title:"Schnelles Alltags-Hirn",desc:"Schnelle MoE-Antworten für Chat, Zusammenfassungen und alltägliche Aufgaben.",icon:ie},heavy:{title:"Schweres Reasoning",desc:"Große Modelle für komplexe Logik, Mathematik und tiefgründiges Planen.",icon:re},coder:{title:"Coden & Entwicklung",desc:"Autovervollständigung, Refactoring und Codegenerierung direkt in deiner IDE.",icon:ue},vision:{title:"Bilder & Vision",desc:"Verarbeitet Bilder, Screenshots und visuelle Diagramme in multimodalen Chats.",icon:ze},hermes:{title:"Lucys Hirn (Agent)",desc:"Lucys dauer-warmes Agent-Hirn mit Tool-Calling — bleibt ko-resident, lädt nie kalt nach.",icon:ot},scout:{title:"Multimodal-Allrounder",desc:"Multimodaler Allrounder für schnelle Antworten, Übersetzungen und Alltag.",icon:st},kritiker:{title:"Kritisches Prüf-Hirn",desc:"Schärfer Blick für Fehler, Schwachstellen und Sicherheitslücken — denkt skeptisch, bevor du deployst.",icon:Ee},reranker:{title:"Gedächtnis-Sortierer",desc:"Sortiert und gewichtet gespeicherte Fakten nach Relevanz — damit die richtige Info sofort da ist.",icon:ge},debugger:{title:"Debugger & Selbstheiler",desc:"Agentisches Debugging, multimodale Fehleranalyse und Selbstreparatur (z.B. Muse-Glimmer).",icon:re}};function Kt(){const{data:t,isLoading:r,error:b}=We(),{data:n}=le(),{data:i}=Ze(),M=(n==null?void 0:n.models)??[],w=b?String(b):"",[N,S]=v.useState({}),[g,z]=v.useState({}),[m,f]=v.useState("recommended");async function p(c,L,A,s){S(o=>({...o,[c]:"Starte..."}));try{await q("/api/models/install",{method:"POST",body:JSON.stringify({repo:c,role:L,quant:A,jinja:s})}),S(o=>({...o,[c]:"Download läuft"}))}catch(o){S(d=>({...d,[c]:`Fehler: ${o instanceof Error?o.message:String(o)}`}))}}return e.jsxs("div",{className:"space-y-6",children:[e.jsx("div",{className:"flex mc-card-sm p-1 w-fit",children:[["recommended","Empfohlen"],["browse","Stöbern & Suchen"]].map(([c,L])=>e.jsx("button",{onClick:()=>f(c),className:k("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide transition-all cursor-pointer",m===c?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:L},c))}),m==="browse"?e.jsx(Dt,{}):r?e.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Analysiere Hardware und suche passende GGUF-Empfehlungen…"}):w||!t?e.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 (",w,")."]}):e.jsxs("div",{className:"space-y-8",children:[e.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:[e.jsxs("div",{children:["Modell-Registry geladen für ",e.jsxs("span",{className:"text-foreground font-bold",children:[t.sys_ram_gb," GB"]})," System-RAM."]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(bt,{className:"h-3.5 w-3.5 text-primary fill-primary/20"}),e.jsx("span",{children:"Empfehlungen sind automatisch auf deine Box-Hardware optimiert."})]})]}),e.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:t.categories.map(c=>{const L=Et[c.role]||{title:c.title||c.role,desc:"Spezifisches Modell für diese Systemrolle.",icon:at},A=L.icon,s=M.find(j=>j.role===c.role||(j.aliases||[]).includes(c.role)),o=i==null?void 0:i.model_list.find(j=>j.role===c.role),d=c.models.find(j=>j.repo===c.recommended)||c.models[0];if(!d)return null;const G=N[d.repo],B=c.models.filter(j=>j.repo!==c.recommended),C=!!g[c.role];return e.jsxs("div",{className:k("mc-card p-5 flex flex-col justify-between gap-5",s?"border-border/60":"border-primary/20 shadow-primary/5"),children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.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:e.jsx(A,{className:"h-5.5 w-5.5"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-bold tracking-tight text-foreground",children:L.title}),e.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: ",c.role]})]})]}),s?e.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:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"Aktiviert"]}):e.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"})]}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:L.desc}),e.jsx("div",{className:"p-3.5 rounded-xl bg-background/35 border border-border/30 space-y-2.5",children:s?e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-muted-foreground/60",children:"Aktive GGUF-Belegung"}),e.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:s.name,children:s.name.split("/").pop()}),e.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2",children:[e.jsxs("span",{children:["Größe: ",Je(s.size_bytes||0)]}),e.jsx("span",{children:"•"}),e.jsxs("span",{children:["Quant: ",s.quant||"GGUF"]})]})]}):e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-primary/80",children:"Empfohlenes Modell"}),e.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:d.name,children:d.name}),e.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 flex-wrap",children:[e.jsxs("span",{children:["Ersteller: ",d.author]}),e.jsx("span",{children:"•"}),e.jsxs("span",{children:["Quant: ",d.quant]})]}),e.jsx("div",{className:"flex items-center gap-1.5 pt-0.5",children:e.jsx(kt,{fit:d.fit})})]})}),e.jsx("div",{className:"pt-1",children:s?o?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),e.jsxs("span",{children:["Bessere Version in der Registry: ",o.repo.split("/").pop()]})]}),e.jsxs("button",{onClick:()=>p(o.repo,c.role,o.repo===d.repo&&d.quant||"Q4_K_M",d.caps.tools!=="no"),disabled:!!N[o.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:[e.jsx(ae,{className:"h-3.5 w-3.5"}),N[o.repo]||"Auf neue Version aktualisieren"]})]}):e.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:[e.jsx(Y,{className:"h-4 w-4"})," Auf neuestem Stand"]}):e.jsxs("button",{onClick:()=>p(d.repo,c.role,d.quant||"Q4_K_M",d.caps.tools!=="no"),disabled:!!G,className:k("h-8 w-full flex items-center justify-center gap-1.5 rounded-lg text-xs font-bold transition-all cursor-pointer border",G?"border-primary/40 bg-primary/5 text-primary":"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/10"),children:[e.jsx(ae,{className:"h-3.5 w-3.5"}),G||"Optimales Modell einsetzen"]})})]}),B.length>0&&e.jsxs("div",{className:"border-t border-border/20 pt-3",children:[e.jsxs("button",{onClick:()=>z(j=>({...j,[c.role]:!C})),className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/80 hover:text-foreground transition-colors cursor-pointer",children:[C?e.jsx(De,{className:"h-3 w-3"}):e.jsx($e,{className:"h-3 w-3"}),e.jsxs("span",{children:["Alternative Empfehlungen anzeigen (",B.length,")"]})]}),C&&e.jsx("div",{className:"mt-2.5 space-y-2 max-h-36 overflow-y-auto pr-1 scrollbar-thin",children:B.map(j=>e.jsxs("div",{className:"p-2 rounded-lg bg-background/25 border border-border/20 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[10px] font-mono font-bold text-foreground truncate",title:j.name,children:j.name}),e.jsxs("div",{className:"text-[9px] text-muted-foreground flex items-center gap-1.5 mt-0.5",children:[e.jsxs("span",{children:["Quant: ",j.quant]}),e.jsx("span",{children:"•"}),e.jsx("span",{children:j.fit.text})]})]}),e.jsx("button",{onClick:()=>p(j.repo,c.role,j.quant||"Q4_K_M",j.caps.tools!=="no"),disabled:!!N[j.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:N[j.repo]||"Installieren"})]},j.repo))})]})]},c.role)})})]})]})}const qt=[{id:"werkbank",label:"Werkbank"},{id:"routing",label:"Routing & Warm-Set"},{id:"discover",label:"Modelle finden"}];function Ut(){const t=Xe(),{reiter:r}=Ye({from:"/modelle"}),b=r??"werkbank",n=i=>t({to:"/modelle",search:M=>({...M,reiter:i}),replace:!0});return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[e.jsxs("div",{children:[e.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"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Modelle verwalten, das Lane-Routing einstellen und Neues von HuggingFace holen."})]}),e.jsx("div",{className:"flex mc-card-sm p-1 self-start",children:qt.map(i=>e.jsx("button",{onClick:()=>n(i.id),className:k("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",b===i.id?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:i.label},i.id))})]}),e.jsx(et,{}),e.jsxs("div",{className:"transition-all duration-300",children:[b==="werkbank"&&e.jsx(Lt,{}),b==="routing"&&e.jsxs("div",{className:"space-y-5",children:[e.jsx(vt,{}),e.jsx(wt,{})]}),b==="discover"&&e.jsx(Kt,{})]})]})}export{Ut as ModelsView}; diff --git a/frontend/dist/assets/Protokollfenster-CDb28asU.js b/frontend/dist/assets/Protokollfenster-CDb28asU.js new file mode 100644 index 0000000..7953af6 --- /dev/null +++ b/frontend/dist/assets/Protokollfenster-CDb28asU.js @@ -0,0 +1 @@ +import{c as e,s as t}from"./button-Dd8hfusv.js";import{a as n,i as r,n as i,r as a,t as o}from"./sheet-DWG2Q04V.js";var s=t(),c=e();function l(e){let t=(0,s.c)(14),{offen:l,titel:u,text:d,onSchliessen:f}=e,p;t[0]===f?p=t[1]:(p=e=>!e&&f(),t[0]=f,t[1]=p);let m;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,c.jsx)(n,{className:`schild text-lg`,children:`Protokoll`}),t[2]=m):m=t[2];let h;t[3]===u?h=t[4]:(h=(0,c.jsxs)(r,{children:[m,(0,c.jsx)(a,{className:`text-text-2`,children:u})]}),t[3]=u,t[4]=h);let g;t[5]===d?g=t[6]:(g=(0,c.jsx)(`pre`,{className:`ziffern mx-4 mb-4 flex-1 overflow-auto rounded-lg border border-linie bg-[#0b0d0f] p-3 text-xs leading-relaxed whitespace-pre-wrap text-text-2`,children:d}),t[5]=d,t[6]=g);let _;t[7]!==h||t[8]!==g?(_=(0,c.jsxs)(i,{side:`right`,className:`w-full border-linie bg-panel sm:max-w-2xl`,children:[h,g]}),t[7]=h,t[8]=g,t[9]=_):_=t[9];let v;return t[10]!==l||t[11]!==p||t[12]!==_?(v=(0,c.jsx)(o,{open:l,onOpenChange:p,children:_}),t[10]=l,t[11]=p,t[12]=_,t[13]=v):v=t[13],v}export{l as Protokollfenster}; \ No newline at end of file diff --git a/frontend/dist/assets/SectionLabel-B7ySrBs7.js b/frontend/dist/assets/SectionLabel-B7ySrBs7.js deleted file mode 100644 index 9fb6652..0000000 --- a/frontend/dist/assets/SectionLabel-B7ySrBs7.js +++ /dev/null @@ -1 +0,0 @@ -import{j as e}from"./index-DMY9lUCb.js";function n({icon:t,children:s}){return e.jsxs("p",{className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:[e.jsx(t,{className:"h-3.5 w-3.5"})," ",s]})}export{n as S}; diff --git a/frontend/dist/assets/SkillsView-DqlZxdwQ.js b/frontend/dist/assets/SkillsView-DqlZxdwQ.js deleted file mode 100644 index f167048..0000000 --- a/frontend/dist/assets/SkillsView-DqlZxdwQ.js +++ /dev/null @@ -1,6 +0,0 @@ -var E=r=>{throw TypeError(r)};var O=(r,e,t)=>e.has(r)||E("Cannot "+t);var a=(r,e,t)=>(O(r,e,"read from private field"),t?t.call(r):e.get(r)),y=(r,e,t)=>e.has(r)?E("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),v=(r,e,t,n)=>(O(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),j=(r,e,t)=>(O(r,e,"access private method"),t);import{a6 as Q,a7 as A,a8 as M,a9 as B,aa as P,u as J,r as f,ab as F,ac as I,c as T,ad as U,j as s,J as D,T as H,b as K,L,Q as V,q as _,n as R}from"./index-DMY9lUCb.js";import{J as z}from"./JobsBar-95gsUJZs.js";var c,g,o,h,m,w,C,q,G=(q=class extends Q{constructor(e,t){super();y(this,m);y(this,c);y(this,g);y(this,o);y(this,h);v(this,c,e),this.setOptions(t),this.bindMethods(),j(this,m,w).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){var n;const t=this.options;this.options=a(this,c).defaultMutationOptions(e),A(this.options,t)||a(this,c).getMutationCache().notify({type:"observerOptionsUpdated",mutation:a(this,o),observer:this}),t!=null&&t.mutationKey&&this.options.mutationKey&&M(t.mutationKey)!==M(this.options.mutationKey)?this.reset():((n=a(this,o))==null?void 0:n.state.status)==="pending"&&a(this,o).setOptions(this.options)}onUnsubscribe(){var e;this.hasListeners()||(e=a(this,o))==null||e.removeObserver(this)}onMutationUpdate(e){j(this,m,w).call(this),j(this,m,C).call(this,e)}getCurrentResult(){return a(this,g)}reset(){var e;(e=a(this,o))==null||e.removeObserver(this),v(this,o,void 0),j(this,m,w).call(this),j(this,m,C).call(this)}mutate(e,t){var n;return v(this,h,t),(n=a(this,o))==null||n.removeObserver(this),v(this,o,a(this,c).getMutationCache().build(a(this,c),this.options)),a(this,o).addObserver(this),a(this,o).execute(e)}},c=new WeakMap,g=new WeakMap,o=new WeakMap,h=new WeakMap,m=new WeakSet,w=function(){var t;const e=((t=a(this,o))==null?void 0:t.state)??B();v(this,g,{...e,isPending:e.status==="pending",isSuccess:e.status==="success",isError:e.status==="error",isIdle:e.status==="idle",mutate:this.mutate,reset:this.reset})},C=function(e){P.batch(()=>{var t,n,l,x,d,p,k,i;if(a(this,h)&&this.hasListeners()){const u=a(this,g).variables,N=a(this,g).context,S={client:a(this,c),meta:this.options.meta,mutationKey:this.options.mutationKey};if((e==null?void 0:e.type)==="success"){try{(n=(t=a(this,h)).onSuccess)==null||n.call(t,e.data,u,N,S)}catch(b){Promise.reject(b)}try{(x=(l=a(this,h)).onSettled)==null||x.call(l,e.data,null,u,N,S)}catch(b){Promise.reject(b)}}else if((e==null?void 0:e.type)==="error"){try{(p=(d=a(this,h)).onError)==null||p.call(d,e.error,u,N,S)}catch(b){Promise.reject(b)}try{(i=(k=a(this,h)).onSettled)==null||i.call(k,void 0,e.error,u,N,S)}catch(b){Promise.reject(b)}}}this.listeners.forEach(u=>{u(a(this,g))})})},q);function W(r,e){const t=J(),[n]=f.useState(()=>new G(t,r));f.useEffect(()=>{n.setOptions(r)},[n,r]);const l=f.useSyncExternalStore(f.useCallback(d=>n.subscribe(P.batchCalls(d)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),x=f.useCallback((d,p)=>{n.mutate(d,p).catch(F)},[n]);if(l.error&&I(n.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:x,mutateAsync:l.mutate}}/** - * @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 X=T("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);function ee(){const r=J(),{data:e,isLoading:t,isError:n}=U({queryKey:["skills-list"],queryFn:()=>R("/api/skills"),refetchInterval:5e3}),[l,x]=f.useState(null),[d,p]=f.useState(null),k=W({mutationFn:i=>R("/api/skills/run",{method:"POST",body:JSON.stringify({skill_name:i})}),onMutate:i=>{x(i),p(null)},onSuccess:(i,u)=>{x(null),p({name:u,ok:i.ok,msg:i.msg||i.err||"Unbekannter Fehler"}),r.invalidateQueries({queryKey:_.jobs}),r.invalidateQueries({queryKey:["skills-list"]})},onError:(i,u)=>{x(null),p({name:u,ok:!1,msg:String(i)})}});return s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:s.jsxs("div",{children:[s.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:"Skills & Jobs"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Löst autonome Agent-Skills manuell auf der Box aus. Die Ausführung erfolgt im Hintergrund durch Hermes."})]})}),s.jsx(z,{}),d&&s.jsxs("div",{className:K("p-4 rounded-lg border flex gap-3 items-start",d.ok?"bg-emerald-500/10 border-emerald-500/20 text-emerald-600 dark:text-emerald-400":"bg-red-500/10 border-red-500/20 text-red-600 dark:text-red-400"),children:[d.ok?s.jsx(D,{className:"h-5 w-5 mt-0.5 shrink-0"}):s.jsx(H,{className:"h-5 w-5 mt-0.5 shrink-0"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-semibold text-sm",children:d.name}),s.jsx("div",{className:"text-sm opacity-90",children:d.msg})]})]}),t&&s.jsx("div",{className:"flex h-32 items-center justify-center",children:s.jsx(L,{className:"h-6 w-6 animate-spin text-muted-foreground"})}),n&&s.jsx("div",{className:"text-red-500 p-4 mc-card text-sm",children:"Fehler beim Laden der Skills. Ist das Backend erreichbar?"}),(e==null?void 0:e.skills)&&s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:[e.skills.map(i=>s.jsxs("div",{className:"mc-card p-5 flex flex-col hover:border-primary/40 transition-colors group",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3 mb-2",children:[s.jsxs("div",{className:"flex items-center gap-2 font-semibold text-base font-space",children:[s.jsx(V,{className:"h-5 w-5 text-primary/80"}),i.name]}),s.jsxs("button",{onClick:()=>k.mutate(i.name),disabled:l===i.name||i.running||k.isPending,className:K("shrink-0 h-8 px-3 rounded-md text-xs font-semibold uppercase tracking-wider flex items-center gap-1.5 transition-all cursor-pointer",l===i.name||i.running?"bg-sky-500/10 border border-sky-500/40 text-sky-400 cursor-not-allowed":"bg-primary/10 text-primary hover:bg-primary hover:text-primary-foreground group-hover:shadow-md group-hover:shadow-primary/20"),children:[l===i.name||i.running?s.jsx(L,{className:"h-3.5 w-3.5 animate-spin"}):s.jsx(X,{className:"h-3.5 w-3.5"}),l===i.name||i.running?"Läuft …":"Starten"]})]}),s.jsx("div",{className:"text-sm text-muted-foreground flex-1",children:i.description})]},i.name)),e.skills.length===0&&s.jsxs("div",{className:"col-span-full p-8 text-center text-muted-foreground mc-card border-dashed border-2",children:["Keine Skills im Ordner ",s.jsx("code",{className:"text-xs text-foreground bg-muted px-1.5 py-0.5 rounded",children:"deploy/skills"})," gefunden."]})]})]})}export{ee as SkillsView}; diff --git a/frontend/dist/assets/SystemDrawer-CpUj62ev.js b/frontend/dist/assets/SystemDrawer-CpUj62ev.js deleted file mode 100644 index 34b27b1..0000000 --- a/frontend/dist/assets/SystemDrawer-CpUj62ev.js +++ /dev/null @@ -1,42 +0,0 @@ -import{c as v,j as e,b as c,r as l,T as W,L as ae,E as ve,n as b,Q as le,Y as oe,X as de,J as Se,u as _e,k as Ce,x as ze,aq as Fe,ae as Le,ak as Ue,V as P,t as Ae,y as q,q as N}from"./index-DMY9lUCb.js";import{R as F}from"./refresh-cw-hAcZthO8.js";import{F as Pe}from"./file-text-BSQuFPZM.js";import{S as Be}from"./search-D_8DnBvS.js";import{S as ce}from"./shield-BtE9Fxv6.js";import{A as ne}from"./arrow-right-CNrCtUoh.js";import{C as Re}from"./clock-Bth-s5Y3.js";import{E as $e}from"./external-link-DcJao8h4.js";import{C as De,a as Ee}from"./cloud-download-BGirmHxu.js";import{P as Oe}from"./power-DsvD9qMX.js";/** - * @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 Te=v("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. - * See the LICENSE file in the root directory of this source tree. - */const Me=v("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 He=v("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 qe=v("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 ie=v("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 me=v("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. - * See the LICENSE file in the root directory of this source tree. - */const xe=v("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. - * See the LICENSE file in the root directory of this source tree. - */const We=v("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);function B({icon:n,iconClass:d,name:i,status:m,available:s,busy:u,actionLabel:f,onAction:r}){return e.jsxs("div",{className:c("flex items-center gap-3 rounded-lg border px-3 py-2",s?"border-amber-500/30 bg-amber-500/5":"border-border/50 bg-background/20"),children:[e.jsx(n,{className:c("h-4 w-4 shrink-0",d)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs text-foreground truncate",children:i}),e.jsx("div",{className:c("text-[10px] truncate",s?"text-amber-400/90":"text-muted-foreground"),children:m})]}),e.jsx("button",{onClick:r,disabled:!s||u,className:c("text-[11px] font-semibold rounded-lg px-2.5 py-1 transition-colors shrink-0",s?"bg-primary text-primary-foreground hover:opacity-90 cursor-pointer":"border border-border/50 text-muted-foreground/40 cursor-default"),children:u?"…":f})]})}function Ge({label:n,ok:d,system:i,busy:m,onRestart:s,onLogs:u}){return e.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg border border-border/50 bg-background/20 px-3 py-2",children:[e.jsx("span",{className:c("w-1.5 h-1.5 rounded-full shrink-0",d===!0?"bg-emerald-500":d===!1?"bg-red-500":"bg-muted-foreground/40")}),e.jsxs("span",{className:"flex-1 text-xs text-foreground truncate",children:[n,i&&e.jsx("span",{className:"text-[9px] text-muted-foreground",children:" (root)"})]}),e.jsx("button",{onClick:s,disabled:m,title:"Neu starten",className:"text-muted-foreground hover:text-primary transition-colors disabled:opacity-50",children:e.jsx(F,{className:c("h-3.5 w-3.5",m&&"animate-spin")})}),e.jsx("button",{onClick:u,title:"Logs ansehen",className:"text-muted-foreground hover:text-primary transition-colors",children:e.jsx(Pe,{className:"h-3.5 w-3.5"})})]})}const Je=/\b(error|fehler|fail(ed|ure)?|fatal|critical|crit|panic|traceback|exception|denied|refused|unable|emerg|alert|oom|killed)\b/i,Ke=/\b(warn(ing)?|deprecat\w*|retry(ing)?|timeout|timed out|degraded|missing|not found|nicht gefunden)\b/i;function Ve(n){return Je.test(n)?"error":Ke.test(n)?"warn":"info"}const Ze={error:"text-red-400",warn:"text-amber-300",info:"text-cyan-300/80"};function Qe({service:n,text:d,loading:i,logStatus:m,onRefresh:s,onOpenSettings:u}){const[f,r]=l.useState(!1),[j,y]=l.useState(""),o=l.useRef(null),h=l.useMemo(()=>d?d.split(` -`).map(p=>({t:p,level:Ve(p)})):[],[d]),S=l.useMemo(()=>h.filter(p=>p.level!=="info").length,[h]),_=j.trim().toLowerCase(),g=h.filter(p=>(!f||p.level!=="info")&&(!_||p.t.toLowerCase().includes(_))),k=m==="password_required"||m==="incorrect_password";return e.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:[e.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:[e.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground shrink-0",children:[e.jsx(We,{className:"h-3 w-3 text-primary"}),e.jsx("span",{className:"hidden sm:inline",children:"stdout/stderr —"})," ",n]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Be,{className:"pointer-events-none absolute left-2 top-1/2 h-3 w-3 -translate-y-1/2 text-muted-foreground"}),e.jsx("input",{value:j,onChange:p=>y(p.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"})]}),e.jsxs("button",{onClick:()=>r(p=>!p),title:"Nur Fehler und Warnungen zeigen",className:c("flex h-7 items-center gap-1 rounded-md border px-2 text-[10px] font-semibold transition-colors",f?"border-amber-500/50 bg-amber-500/15 text-amber-300":"border-border/50 bg-background/20 text-muted-foreground hover:text-foreground"),children:[e.jsx(W,{className:"h-3 w-3"}),"Nur Probleme",S>0?` (${S})`:""]}),e.jsx("button",{onClick:s,disabled:i,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:e.jsx(F,{className:c("h-3 w-3",i&&"animate-spin")})})]})]}),e.jsx("div",{ref:o,className:"flex-1 overflow-y-auto p-3 text-[10px] font-mono leading-relaxed scrollbar-thin select-text",children:k?e.jsxs("div",{className:"flex h-full flex-col items-center justify-center space-y-3 p-6 text-center",children:[e.jsx(W,{className:"h-8 w-8 text-amber-400 animate-pulse animate-duration-1000"}),e.jsx("div",{className:"text-xs font-semibold text-amber-300",children:m==="incorrect_password"?"Falsches Sudo-Passwort hinterlegt.":"Sudo-Passwort für systemd-Dienste erforderlich."}),e.jsxs("p",{className:"max-w-xs text-[10px] leading-normal text-muted-foreground",children:["Für das Auslesen der systemd-Logs von ",n," werden Root-Rechte benötigt. Hinterlege dein Passwort in den Einstellungen."]}),e.jsx("button",{onClick:u,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"})]}):i&&!d?e.jsx("span",{className:"text-muted-foreground",children:"Lade Logs…"}):h.length===0?e.jsx("span",{className:"text-muted-foreground",children:"Keine Logeinträge vorhanden."}):g.length===0?e.jsx("span",{className:"text-muted-foreground",children:f?"Keine Fehler oder Warnungen — der Dienst läuft sauber. ✓":"Kein Treffer für den Filter."}):g.map((p,$)=>e.jsx("div",{className:c("whitespace-pre-wrap",Ze[p.level]),children:p.t||" "},$))})]})}function Xe({open:n,showAlert:d}){const[i,m]=l.useState(null),[s,u]=l.useState(""),[f,r]=l.useState(!1),[j,y]=l.useState(!1),[o,h]=l.useState(!1);async function S(){y(!0);try{m(await b("/api/maintenance/geheimnisse"))}catch(g){d("Nicht erreichbar",`Der Geheimnis-Zustand konnte nicht geladen werden: ${(g==null?void 0:g.message)||g}`)}finally{y(!1)}}l.useEffect(()=>{n&&(u(""),r(!1),S())},[n]);async function _(g){h(!0);try{const k=await b("/api/maintenance/geheimnisse",{method:"POST",body:JSON.stringify({schluessel:"hf_token",wert:g})});m(k),u(""),d(g?"Gespeichert":"Gelöscht",g?"Der Token liegt jetzt auf der Box — der Browser behält ihn nicht.":"Der Token wurde von der Box entfernt.")}catch(k){d("Fehlgeschlagen",(k==null?void 0:k.message)||String(k))}finally{h(!1)}}return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Zugangsdaten & Schlüssel"}),e.jsx("p",{className:"text-[10px] leading-normal text-muted-foreground",children:"Geheimnisse liegen auf der Box (Datei mit Rechten 0600), nicht im Browser. Diese Seite zeigt nur, ob etwas gesetzt ist — den Wert bekommt sie nie zurück."})]}),e.jsxs("div",{className:"mc-card-sm space-y-1.5 p-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-semibold",children:[e.jsx(me,{className:"h-4 w-4 text-emerald-400","aria-hidden":"true"}),"Box-Sudo-Passwort — nicht mehr nötig"]}),e.jsxs("p",{className:"text-[10px] leading-normal text-muted-foreground",children:["Systemdienste, OS-Update und Neustart laufen passwortlos (",e.jsx("code",{className:"font-mono text-primary",children:"NOPASSWD"})," in",e.jsx("code",{className:"font-mono",children:" /etc/sudoers"}),"). Das frühere Feld hat nie etwas bewirkt und lag dabei im Browser-Speicher — es ist am 28.08.2026 ersatzlos entfallen. Verlangt ",e.jsx("code",{className:"font-mono",children:"sudo"})," auf der Box je doch ein Passwort, sagt die Wartung das im Klartext; das ist dann dort zu lösen."]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("label",{htmlFor:"hf-token",className:"flex items-center gap-1.5 text-xs font-semibold",children:[e.jsx(qe,{className:"h-4 w-4 text-violet-400","aria-hidden":"true"}),"HuggingFace-Token"]}),e.jsx("div",{className:"flex items-center gap-2 text-[11px]",children:j?e.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[e.jsx(ae,{className:"h-3 w-3 animate-spin","aria-hidden":"true"})," Zustand wird geladen …"]}):i!=null&&i.hf_token_gesetzt?e.jsxs("span",{className:"flex items-center gap-1.5 font-semibold text-emerald-400",children:[e.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500","aria-hidden":"true"}),"Gesetzt",i.hf_token_aus_env?" (aus der Dienst-Umgebung)":""]}):e.jsxs("span",{className:"flex items-center gap-1.5 text-muted-foreground",children:[e.jsx("span",{className:"h-2 w-2 rounded-full bg-muted-foreground/50","aria-hidden":"true"}),"Nicht gesetzt"]})}),(i==null?void 0:i.hf_token_aus_env)&&e.jsxs("p",{className:"text-[9px] leading-normal text-amber-400/90",children:["Der Token kommt aus der Umgebung des Dienstes und hat Vorrang. Hier gespeicherte Werte bleiben wirkungslos, solange ",e.jsx("code",{className:"font-mono",children:"HF_TOKEN"})," gesetzt ist."]}),i&&!i.schreibbar&&e.jsx("p",{className:"text-[9px] leading-normal text-amber-400/90",children:"Die Ablage ist nicht beschreibbar — auf einem Entwicklungsrechner ohne den Modell-Ordner der Box ist das normal. Speichern würde hier ins Leere laufen."}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{id:"hf-token",type:f?"text":"password",value:s,onChange:g=>u(g.target.value),autoComplete:"off",spellCheck:!1,placeholder:i!=null&&i.hf_token_gesetzt?"Neuen Token eingeben, um zu ersetzen":"hf_…",className:"h-10 w-full rounded-lg border border-border/60 bg-background/40 pl-3 pr-10 text-xs text-foreground outline-none transition-colors focus:border-primary"}),e.jsx("button",{type:"button",onClick:()=>r(!f),"aria-label":f?"Token verbergen":"Token anzeigen",className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground transition-colors hover:text-foreground",children:f?e.jsx(Me,{className:"h-4 w-4","aria-hidden":"true"}):e.jsx(ve,{className:"h-4 w-4","aria-hidden":"true"})})]}),e.jsxs("p",{className:"text-[9px] leading-normal text-muted-foreground",children:["Nötig für Modelle mit Zugangsschranke. Wird beim Download als",e.jsx("code",{className:"font-mono",children:" HF_TOKEN"})," an den Job gereicht und verlässt die Box nicht."]})]}),e.jsxs("div",{className:"flex gap-3 pt-2",children:[e.jsxs("button",{onClick:()=>_(s.trim()),disabled:o||!s.trim(),className:"flex h-9 flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-lg bg-primary text-xs font-semibold text-primary-foreground shadow shadow-primary/10 transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-40",children:[o&&e.jsx(ae,{className:"h-3.5 w-3.5 animate-spin","aria-hidden":"true"}),"Auf der Box speichern"]}),e.jsx("button",{onClick:()=>_(null),disabled:o||!(i!=null&&i.hf_token_gesetzt),className:"flex h-9 cursor-pointer items-center justify-center rounded-lg border border-border/60 bg-background/20 px-4 text-xs font-semibold text-muted-foreground transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-40",children:"Löschen"})]})]})}function Ye({detail:n,maintenanceJob:d,onClose:i,onApply:m}){var j,y;const s=n.data,u={os:{icon:ce,cls:"text-cyan-400",title:"OS-Pakete (apt)"},engine:{icon:oe,cls:"text-violet-400",title:"Inferenz-Engine (llama.cpp)"},swap:{icon:xe,cls:"text-fuchsia-400",title:"Router (llama-swap)"},hermes:{icon:le,cls:"text-amber-400",title:"Hermes-Agent"}}[n.kind],f=u.icon,r=s?n.kind==="os"?(s.count??0)===0:n.kind==="hermes"?(s.behind??0)===0:s.installed_build!=null&&s.latest_build!=null&&s.latest_build<=s.installed_build:!0;return e.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-black/70 backdrop-blur-sm",onClick:i}),e.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:[e.jsxs("div",{className:"flex h-14 shrink-0 items-center justify-between border-b border-border/40 px-5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{className:c("h-4.5 w-4.5",u.cls)}),e.jsx("h3",{className:"text-sm font-semibold",children:u.title})]}),e.jsx("button",{onClick:i,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:e.jsx(de,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-5 text-xs space-y-3 scrollbar-thin",children:n.loading?e.jsxs("div",{className:"flex h-24 items-center justify-center gap-2 text-muted-foreground",children:[e.jsx(F,{className:"h-4 w-4 animate-spin"})," Details werden geladen…"]}):s!=null&&s.error?e.jsx("div",{className:"rounded-lg border border-red-500/30 bg-red-500/5 p-3 text-red-400",children:s.error}):e.jsxs(e.Fragment,{children:[(s==null?void 0:s.action_needed)!=null&&e.jsxs("div",{className:c("flex items-start gap-2 rounded-lg border p-3",s.action_needed?"border-amber-500/40 bg-amber-500/10":"border-emerald-500/40 bg-emerald-500/10"),children:[s.action_needed?e.jsx(W,{className:"h-4 w-4 text-amber-400 shrink-0 mt-0.5"}):e.jsx(Se,{className:"h-4 w-4 text-emerald-400 shrink-0 mt-0.5"}),e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:c("text-xs font-semibold",s.action_needed?"text-amber-300":"text-emerald-300"),children:["Musst du etwas tun? ",s.action_needed?"Ja":"Nein — die Box regelt das (Fangnetz)"]}),s.action_needed&&s.action_text&&e.jsx("div",{className:"mt-0.5 text-[11px] text-foreground/90",children:s.action_text})]})]}),(s==null?void 0:s.summary)&&e.jsxs("div",{className:"rounded-lg border border-primary/25 bg-primary/5 p-3 space-y-1",children:[e.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider text-primary",children:"Was dieses Update bedeutet (Zusammenfassung der Box)"}),e.jsx("pre",{className:"whitespace-pre-wrap text-[11px] leading-relaxed text-foreground/90 font-sans",children:s.summary})]}),n.kind==="os"?e.jsxs(e.Fragment,{children:[((s==null?void 0:s.count)??0)===0?e.jsx("div",{className:"text-muted-foreground",children:"Keine Pakete zu aktualisieren — System ist aktuell."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-muted-foreground",children:[s.count," Paket(e) werden aktualisiert:"]}),e.jsx("div",{className:"space-y-1",children:s.packages.map(o=>e.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:[e.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[11px] truncate",children:[e.jsx(ie,{className:"h-3 w-3 text-cyan-400 shrink-0"}),o.name]}),e.jsxs("span",{className:"flex items-center gap-1 font-mono text-[10px] text-muted-foreground shrink-0",children:[e.jsx("span",{children:o.current}),e.jsx(ne,{className:"h-3 w-3"}),e.jsx("span",{className:"text-emerald-400",children:o.candidate})]})]},o.name))})]}),(((j=s==null?void 0:s.held_back)==null?void 0:j.length)??0)>0&&e.jsxs("div",{className:"space-y-1.5 rounded-lg border border-border/40 bg-background/20 p-3",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] font-semibold text-muted-foreground",children:[e.jsx(Re,{className:"h-3.5 w-3.5"})," Vom Hersteller zurückgestellt — kein Handeln nötig"]}),e.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."}),e.jsx("div",{className:"space-y-1",children:s.held_back.map(o=>e.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:[e.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[11px] truncate",children:[e.jsx(ie,{className:"h-3 w-3 text-muted-foreground shrink-0"}),o.name]}),e.jsx("span",{className:"text-[9px] text-muted-foreground shrink-0",children:o.reason==="phasing"?"Phasen-Rollout":"vorerst zurückgehalten"})]},o.name))})]})]}):n.kind==="engine"||n.kind==="swap"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2 font-mono text-[11px]",children:[e.jsxs("span",{className:"rounded-md border border-border/40 bg-background/30 px-2 py-1",children:["Build ",(s==null?void 0:s.installed_build)??"?"]}),e.jsx(ne,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsxs("span",{className:"rounded-md border border-emerald-500/30 bg-emerald-500/5 px-2 py-1 text-emerald-400",children:["Build ",(s==null?void 0:s.latest_build)??"?"]})]}),((s==null?void 0:s.name)||(s==null?void 0:s.latest_tag))&&e.jsxs("div",{className:"text-muted-foreground",children:["Release: ",e.jsx("span",{className:"text-foreground",children:s==null?void 0:s.name}),s!=null&&s.latest_tag?` (${s.latest_tag})`:""]}),(s==null?void 0:s.url)&&e.jsxs("a",{href:s.url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-primary hover:underline",children:["Original-Release-Notes auf GitHub ",e.jsx($e,{className:"h-3 w-3"})]}),(s==null?void 0:s.body)&&e.jsxs("details",{className:"group",children:[e.jsx("summary",{className:"cursor-pointer text-[10px] text-muted-foreground hover:text-foreground",children:"Original-Notizen (englisch) anzeigen"}),e.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:s.body})]})]}):(((y=s==null?void 0:s.commits)==null?void 0:y.length)??0)===0?e.jsx("div",{className:"text-muted-foreground",children:"Keine neuen Commits — Hermes-Agent ist bereits aktuell."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"text-muted-foreground",children:[s.behind," neue Commit(s) auf ",e.jsxs("span",{className:"font-mono text-foreground",children:["origin/",s.branch]}),":"]}),e.jsx("div",{className:"space-y-1",children:s.commits.map(o=>e.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-border/40 bg-background/30 px-2.5 py-1.5",children:[e.jsx(He,{className:"h-3.5 w-3.5 text-primary shrink-0 mt-0.5"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] truncate",children:o.subject}),e.jsxs("div",{className:"font-mono text-[9px] text-muted-foreground",children:[o.hash," · ",o.when]})]})]},o.hash))})]}),n.kind!=="os"&&!r&&e.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-border/40 bg-background/20 p-2.5",children:[e.jsx(me,{className:"h-3.5 w-3.5 text-emerald-400 shrink-0 mt-0.5"}),e.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",n.kind==="hermes"?" und startet den Gateway neu":"","."]})]})]})}),e.jsxs("div",{className:"flex gap-3 border-t border-border/40 p-4 shrink-0",children:[e.jsx("button",{onClick:i,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"}),e.jsx("button",{onClick:m,disabled:n.loading||r||!!d,title:d?`Update läuft bereits: ${d.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:d?"Update läuft…":"Jetzt aktualisieren"})]})]})]})}function dt({open:n,onClose:d,defaultTab:i="maintenance"}){var se,re;const m=_e(),{showAlert:s,showConfirm:u,dialogElement:f}=Ce(),{data:r}=ze(),{data:j}=Fe(),y=Le(3e3,n).data??[],{data:o}=Ue(void 0,n),[h,S]=l.useState("llama-swap"),[_,g]=l.useState(""),[k,p]=l.useState(!1),[$,G]=l.useState(null),[D,J]=l.useState({}),[C,w]=l.useState("maintenance"),[K,V]=l.useState(!1),[Z,E]=l.useState(""),[Q,X]=l.useState(!1),[ue,Y]=l.useState(!1),[L,U]=l.useState(null),O=(j==null?void 0:j.services)??[],z=()=>P(m,N.jobs);function he(t){return t?new Date(t*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"Nie"}l.useEffect(()=>{n&&i&&w(i)},[n,i]),l.useEffect(()=>{n&&P(m,N.updates,N.services,N.jobs,N.zeitmaschine)},[n]);function T(t){p(!0),G(null),b(`/api/maintenance/logs?service=${t}&lines=150`).then(a=>{a.ok?g(a.text):(g(`Fehler beim Laden der Logs: ${a.err||"Unbekannter Fehler"}`),(a.status==="incorrect_password"||a.status==="password_required")&&G(a.status))}).catch(a=>g(`Fehler: ${a.message}`)).finally(()=>p(!1))}l.useEffect(()=>{!n||C!=="logs"||T(h)},[n,C,h]);function M(t){return(t==null?void 0:t.status)==="busy"?(s("Update läuft bereits",`Es läuft gerade „${t.running}". Bitte warte, bis es fertig ist.`),z(),!0):!1}function I(t){return(t==null?void 0:t.status)==="password_required"||(t==null?void 0:t.status)==="incorrect_password"?(s("Box-Passwort nötig",(t.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):t&&t.ok===!1?(s("Update fehlgeschlagen",t.err||"Unbekannter Fehler."),!0):!1}async function ge(t){const a={os:"os-update",engine:"engine-update",swap:"swap-update"}[t];try{const x=await b(`/api/maintenance/${a}`,{method:"POST"});if(M(x)||I(x))return;z(),w("maintenance")}catch(x){s("Fehler",`Update konnte nicht starten: ${x.message}`)}}async function pe(){Y(!0);try{const t=await b("/api/maintenance/hermes-update",{method:"POST"});if(M(t))return;z()}catch(t){s("Fehler",`Hermes-Update fehlgeschlagen: ${t.message}`)}finally{Y(!1)}}async function R(t){U({kind:t,loading:!0,data:null});try{const a=await b(`/api/maintenance/update-details?kind=${t}`);U({kind:t,loading:!1,data:a})}catch(a){U({kind:t,loading:!1,data:{kind:t,error:a.message}})}}function fe(){const t=L==null?void 0:L.kind;U(null),t==="os"||t==="engine"||t==="swap"?ge(t):t==="hermes"&&pe()}function be(){var a;const t=[r!=null&&r.engine?"Engine":null,r!=null&&r.swap?"Router":null,(a=r==null?void 0:r.components)!=null&&a.some(x=>x.update===!0)?"Hermes-Agent":null,r!=null&&r.os?`OS (${r.os} Pakete)`:null].filter(Boolean);u("Alle Updates einspielen?",`Nacheinander in einem Job: ${t.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 x=await b("/api/maintenance/update-all",{method:"POST"});if(M(x)||I(x))return;if((x==null?void 0:x.status)==="nothing"){s("Nichts zu tun","Es stehen keine Updates aus.");return}z(),w("maintenance")}catch(x){s("Fehler",`„Alle aktualisieren" konnte nicht starten: ${x.message}`)}})}async function ye(){V(!0);try{await b("/api/maintenance/check-updates",{method:"POST"}),P(m,N.jobs,N.updates),w("maintenance")}catch(t){s("Fehler",`Fehler bei der Update-Suche: ${t.message}`)}finally{V(!1)}}async function je(t,a){try{await b("/api/models/install",{method:"POST",body:JSON.stringify({repo:t,role:a})}),s("Gestartet",`Modell-Upgrade für '${a}' (${t}) gestartet.`),z(),w("maintenance")}catch(x){s("Fehler",`Fehler beim Starten des Modell-Upgrades: ${x.message}`)}}async function Ne(){u("Reboot bestätigen","Bist du sicher, dass du das gesamte Host-System neu starten willst?",async()=>{try{await b("/api/maintenance/reboot",{method:"POST"}),s("Reboot","Reboot ausgelöst. System startet neu...",()=>d())}catch(t){s("Fehler",`Fehler beim Reboot: ${t.message}`)}})}async function ke(){X(!0),E("Snapshot wird erzeugt...");try{const t=await b("/api/system/backup",{method:"POST"});E(t.ok?`Snapshot erzeugt: ${t.snapshot} (${t.files.length} Komponenten)`:"Backup fehlgeschlagen."),P(m,N.zeitmaschine)}catch(t){E(`Fehler: ${t.message}`)}finally{X(!1)}}async function ee(t){J(a=>({...a,[t]:!0}));try{const a=await b("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:t})});a.ok?(s("Dienst neu gestartet",`Dienst ${t} wurde erfolgreich neu gestartet.`,()=>{C==="logs"&&h===t&&T(t)}),P(m,N.services,N.health,N.models)):s("Fehler",`Fehler beim Neustart: ${a.err||"Unbekannter Fehler"}`)}catch(a){s("Fehler",`Fehler beim Neustart: ${a.message}`)}finally{J(a=>({...a,[t]:!1}))}}async function we(t){try{await b(`/api/jobs/${t}/cancel`,{method:"POST"}),z()}catch(a){s("Fehler",`Fehler beim Abbrechen: ${a.message}`)}}const A=y.find(t=>(t.state==="running"||t.state==="queued")&&t.group==="maintenance"),te=(r?(r.os>0?1:0)+(r.engine?1:0)+(r.swap?1:0):0)+(((se=r==null?void 0:r.components)==null?void 0:se.filter(t=>t.update===!0).length)??0),H=(o==null?void 0:o.backups)??[];return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:c("fixed inset-0 bg-black/60 backdrop-blur-sm z-50 transition-opacity duration-300",n?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),onClick:d}),e.jsxs("div",{className:c("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",n?"translate-x-0":"translate-x-full"),children:[e.jsxs("div",{className:"flex h-16 shrink-0 items-center justify-between border-b border-border/40 px-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ae,{className:"h-4.5 w-4.5 text-primary"}),e.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase font-space",children:"OS-Zentrale & Pflege"})]}),e.jsx("button",{onClick:d,"aria-label":"System-Schublade schließen",className:"flex h-8 w-8 items-center justify-center rounded-lg border border-border/40 text-muted-foreground hover:bg-accent transition-colors cursor-pointer",children:e.jsx(de,{className:"h-4 w-4","aria-hidden":"true"})})]}),e.jsx("div",{className:"flex border-b border-border/40 px-6",children:["maintenance","logs","settings"].map(t=>e.jsx("button",{onClick:()=>w(t),className:c("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",C===t?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:t==="maintenance"?"System-Wartung":t==="logs"?"System-Logs":"Einstellungen"},t))}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[C==="maintenance"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Updates"}),e.jsxs("div",{className:"flex items-center gap-3",children:[te>0&&e.jsxs("button",{onClick:be,disabled:!!A,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:[e.jsx(De,{className:"h-3 w-3"})," Alle aktualisieren (",te,")"]}),e.jsxs("button",{onClick:ye,disabled:K||!!A,className:"flex items-center gap-1 text-[10px] font-semibold text-primary hover:text-primary/80 transition-colors disabled:opacity-50",children:[e.jsx(F,{className:c("h-3 w-3",K&&"animate-spin")})," Nach Updates suchen"]})]})]}),(r==null?void 0:r.last_check)&&e.jsxs("div",{className:"text-[9px] text-muted-foreground -mt-1",children:["Zuletzt gesucht: ",he(r.last_check)]}),A&&e.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:[e.jsx(F,{className:"h-3.5 w-3.5 shrink-0 animate-spin"}),e.jsxs("span",{children:["Update läuft: ",e.jsx("span",{className:"font-semibold",children:A.label})," — bitte warten. Weitere Updates sind solange gesperrt."]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(B,{icon:ce,iconClass:"text-cyan-400",name:"OS-Pakete (apt)",available:!!(r!=null&&r.os),status:r!=null&&r.os?`${r.os} verfügbar`:"aktuell",actionLabel:"Anzeigen",onAction:()=>R("os")}),e.jsx(B,{icon:oe,iconClass:"text-violet-400",name:"Inferenz-Engine (llama.cpp)",available:!!(r!=null&&r.engine),status:r!=null&&r.engine?"Update verfügbar":"aktuell",actionLabel:"Anzeigen",onAction:()=>R("engine")}),e.jsx(B,{icon:xe,iconClass:"text-fuchsia-400",name:"Router (llama-swap)",available:!!(r!=null&&r.swap),status:r!=null&&r.swap?"Update verfügbar":"aktuell",actionLabel:"Anzeigen",onAction:()=>R("swap")}),(()=>{var a;const t=(a=r==null?void 0:r.components)==null?void 0:a.find(x=>x.key==="hermes_agent");return e.jsx(B,{icon:le,iconClass:"text-amber-400",name:"Hermes-Agent",available:(t==null?void 0:t.update)===!0,busy:ue,status:(t==null?void 0:t.update)===!0?`Update: ${t.latest}`:(t==null?void 0:t.reachable)===!1?"offline":"aktuell",actionLabel:"Anzeigen",onAction:()=>R("hermes")})})(),(re=r==null?void 0:r.model_list)==null?void 0:re.map(t=>e.jsx(B,{icon:Te,iconClass:"text-emerald-400",name:`Modell · ${t.role}`,available:!0,status:t.title,actionLabel:"Upgrade",onAction:()=>je(t.repo,t.role)},t.role))]})]}),e.jsxs("div",{className:"space-y-2.5",children:[e.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Dienste"}),e.jsxs("div",{className:"space-y-1.5",children:[O.length===0&&e.jsx("div",{className:"rounded-lg border border-dashed border-border/50 p-4 text-center text-xs text-muted-foreground",children:"Dienste-Liste wird geladen …"}),O.map(t=>e.jsx(Ge,{label:t.name,system:t.scope==="system",ok:t.ok,busy:D[t.unit],onRestart:()=>ee(t.unit),onLogs:()=>{S(t.unit),w("logs")}},t.unit))]})]}),e.jsxs("div",{className:"space-y-2.5",children:[e.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Backup"}),e.jsxs("div",{className:"rounded-lg border border-border/50 bg-background/20 px-3 py-2.5 flex items-center gap-3",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("div",{className:"text-xs text-foreground truncate",children:H[0]?`Letztes: ${H[0].snapshot}`:"Noch kein Backup"}),e.jsxs("div",{className:"text-[10px] text-muted-foreground",children:[H.length," Snapshots · Wiederherstellen: Chronik → Zeitmaschine"]})]}),e.jsxs("button",{onClick:ke,disabled:Q,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:[e.jsx(Ee,{className:c("h-3.5 w-3.5",Q&&"animate-pulse")})," Snapshot"]})]}),Z&&e.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:Z})]}),e.jsxs("div",{className:"space-y-2.5",children:[e.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-red-400/80",children:"Gefahrenzone"}),e.jsxs("button",{onClick:Ne,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:[e.jsx(Oe,{className:"h-4.5 w-4.5"}),e.jsxs("div",{children:[e.jsx("div",{children:"Host-System neu starten"}),e.jsx("div",{className:"text-[10px] text-red-400/80 font-normal",children:"Startet die ganze Box neu"})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Hintergrund-Aufgaben"}),e.jsxs("span",{className:"text-[10px] font-mono bg-primary/10 text-primary px-1.5 py-0.5 rounded-full",children:[y.filter(t=>t.state==="running"||t.state==="queued").length," Aktiv"]})]}),e.jsx("div",{className:"space-y-3",children:y.length===0?e.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."}):y.map(t=>{const a=t.state==="running"||t.state==="queued";return e.jsxs("div",{className:c("p-3 rounded-xl border transition-all duration-300",a?"border-primary/40 bg-primary/5 shadow-md shadow-primary/5":"border-border/40 bg-background/20 opacity-80"),children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"text-xs font-semibold flex items-center gap-1.5",children:[a&&e.jsxs("span",{className:"flex h-2 w-2 relative",children:[e.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),e.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),t.label]}),e.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground uppercase flex items-center gap-2",children:[e.jsxs("span",{children:["ID: ",t.id]}),e.jsx("span",{children:"•"}),e.jsx("span",{className:c(t.state==="done"&&"text-emerald-400",t.state==="failed"&&"text-red-400",t.state==="running"&&"text-primary",t.state==="queued"&&"text-amber-400",t.state==="canceled"&&"text-muted-foreground"),children:t.state})]})]}),a&&e.jsx("button",{onClick:()=>we(t.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"})]}),t.state==="running"&&e.jsxs("div",{className:"mt-3 space-y-1",children:[e.jsx("div",{className:"w-full h-1.5 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary transition-all duration-500",style:{width:`${t.progress??0}%`}})}),e.jsxs("div",{className:"flex justify-between items-center text-[9px] font-mono text-muted-foreground",children:[e.jsxs("span",{children:[t.progress??0,"%"]}),t.done_bytes!=null&&t.total_bytes!=null&&e.jsxs("span",{children:[q(t.done_bytes)," / ",q(t.total_bytes),t.rate_bps!=null&&` (${q(t.rate_bps)}/s)`]}),t.eta_s!=null&&e.jsxs("span",{children:["ETA: ",t.eta_s,"s"]})]})]})]},t.id)})})]})]}),C==="logs"&&e.jsxs("div",{className:"flex flex-col h-full space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("select",{value:h,onChange:t=>S(t.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:O.map(t=>e.jsxs("option",{value:t.unit,children:[t.name," (",t.scope==="system"?"systemd-root":"user",")"]},t.unit))}),e.jsxs("button",{onClick:()=>ee(h),disabled:D[h],className:"flex h-9 px-3 items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-background/20 hover:border-primary/50 transition-colors disabled:opacity-50",title:"Dienst neu starten",children:[e.jsx(F,{className:c("h-3.5 w-3.5",D[h]&&"animate-spin")}),"Restart"]})]}),e.jsx(Qe,{service:h,text:_,loading:k,logStatus:$,onRefresh:()=>T(h),onOpenSettings:()=>w("settings")})]}),C==="settings"&&e.jsx(Xe,{open:n,showAlert:s})]})]}),L&&e.jsx(Ye,{detail:L,maintenanceJob:A,onClose:()=>U(null),onApply:fe}),f]})}export{dt as SystemDrawer}; diff --git a/frontend/dist/assets/Updates-BJL5TrHW.js b/frontend/dist/assets/Updates-BJL5TrHW.js new file mode 100644 index 0000000..bc4cee0 --- /dev/null +++ b/frontend/dist/assets/Updates-BJL5TrHW.js @@ -0,0 +1,2 @@ +import{a as e,c as t,f as n,i as r,s as i,t as a,u as o}from"./button-Dd8hfusv.js";import{a as s,i as c,n as l,o as u,r as d,s as f,t as p}from"./dist-CgRgLCFz.js";import{C as m,S as h,T as g,a as _,b as v,d as y,f as b,i as x,o as S,r as C,t as w,w as T,x as E}from"./index-Dd2BxC7X.js";var D=i(),O=n(o(),1),k=t();function A(e){let t=(0,D.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,k.jsx)(p,{"data-slot":`dialog`,...n}),t[2]=n,t[3]=r),r}function j(e){let t=(0,D.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,k.jsx)(u,{"data-slot":`dialog-portal`,...n}),t[2]=n,t[3]=r),r}function M(e){let t=(0,D.c)(8),n,i;t[0]===e?(n=t[1],i=t[2]):({className:n,...i}=e,t[0]=e,t[1]=n,t[2]=i);let a;t[3]===n?a=t[4]:(a=r(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,n),t[3]=n,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,k.jsx)(s,{"data-slot":`dialog-overlay`,className:a,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function N(t){let n=(0,D.c)(15),i,o,s,c;n[0]===t?(i=n[1],o=n[2],s=n[3],c=n[4]):({className:o,children:i,showCloseButton:c,...s}=t,n[0]=t,n[1]=i,n[2]=o,n[3]=s,n[4]=c);let u=c===void 0||c,f;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,k.jsx)(M,{}),n[5]=f):f=n[5];let p;n[6]===o?p=n[7]:(p=r(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,o),n[6]=o,n[7]=p);let m;n[8]===u?m=n[9]:(m=u&&(0,k.jsx)(l,{"data-slot":`dialog-close`,asChild:!0,children:(0,k.jsxs)(a,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`,children:[(0,k.jsx)(e,{}),(0,k.jsx)(`span`,{className:`sr-only`,children:`Schließen`})]})}),n[8]=u,n[9]=m);let h;return n[10]!==i||n[11]!==s||n[12]!==p||n[13]!==m?(h=(0,k.jsxs)(j,{children:[f,(0,k.jsxs)(d,{"data-slot":`dialog-content`,className:p,...s,children:[i,m]})]}),n[10]=i,n[11]=s,n[12]=p,n[13]=m,n[14]=h):h=n[14],h}function P(e){let t=(0,D.c)(8),n,i;t[0]===e?(n=t[1],i=t[2]):({className:n,...i}=e,t[0]=e,t[1]=n,t[2]=i);let a;t[3]===n?a=t[4]:(a=r(`flex flex-col gap-2`,n),t[3]=n,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,k.jsx)(`div`,{"data-slot":`dialog-header`,className:a,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function F(e){let t=(0,D.c)(14),n,i,o,s;t[0]===e?(n=t[1],i=t[2],o=t[3],s=t[4]):({className:i,showCloseButton:s,children:n,...o}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=o,t[4]=s);let c=s!==void 0&&s,u;t[5]===i?u=t[6]:(u=r(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,i),t[5]=i,t[6]=u);let d;t[7]===c?d=t[8]:(d=c&&(0,k.jsx)(l,{asChild:!0,children:(0,k.jsx)(a,{variant:`outline`,children:`Schließen`})}),t[7]=c,t[8]=d);let f;return t[9]!==n||t[10]!==o||t[11]!==u||t[12]!==d?(f=(0,k.jsxs)(`div`,{"data-slot":`dialog-footer`,className:u,...o,children:[n,d]}),t[9]=n,t[10]=o,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function I(e){let t=(0,D.c)(8),n,i;t[0]===e?(n=t[1],i=t[2]):({className:n,...i}=e,t[0]=e,t[1]=n,t[2]=i);let a;t[3]===n?a=t[4]:(a=r(`font-heading text-base leading-none font-medium`,n),t[3]=n,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,k.jsx)(f,{"data-slot":`dialog-title`,className:a,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function L(e){let t=(0,D.c)(8),n,i;t[0]===e?(n=t[1],i=t[2]):({className:n,...i}=e,t[0]=e,t[1]=n,t[2]=i);let a;t[3]===n?a=t[4]:(a=r(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,n),t[3]=n,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,k.jsx)(c,{"data-slot":`dialog-description`,className:a,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function R(e){let t=(0,D.c)(26),{offen:n,titel:r,text:i,knopf:o,gefahr:s,onJa:c,onNein:l,children:u}=e,d;t[0]===l?d=t[1]:(d=e=>!e&&l(),t[0]=l,t[1]=d);let f;t[2]===r?f=t[3]:(f=(0,k.jsx)(I,{className:`schild text-xl`,children:r}),t[2]=r,t[3]=f);let p;t[4]===i?p=t[5]:(p=(0,k.jsx)(L,{className:`text-[15px] leading-relaxed text-text-2`,children:i}),t[4]=i,t[5]=p);let m;t[6]!==f||t[7]!==p?(m=(0,k.jsxs)(P,{children:[f,p]}),t[6]=f,t[7]=p,t[8]=m):m=t[8];let h;t[9]===l?h=t[10]:(h=(0,k.jsx)(a,{variant:`outline`,onClick:l,children:`Abbrechen`}),t[9]=l,t[10]=h);let g=s?`gefahr`:`default`,_;t[11]!==o||t[12]!==c||t[13]!==g?(_=(0,k.jsx)(a,{variant:g,onClick:c,children:o}),t[11]=o,t[12]=c,t[13]=g,t[14]=_):_=t[14];let v;t[15]!==h||t[16]!==_?(v=(0,k.jsxs)(F,{className:`gap-2 sm:gap-2`,children:[h,_]}),t[15]=h,t[16]=_,t[17]=v):v=t[17];let y;t[18]!==u||t[19]!==m||t[20]!==v?(y=(0,k.jsxs)(N,{className:`border-linie bg-panel sm:max-w-lg`,children:[m,u,v]}),t[18]=u,t[19]=m,t[20]=v,t[21]=y):y=t[21];let b;return t[22]!==n||t[23]!==d||t[24]!==y?(b=(0,k.jsx)(A,{open:n,onOpenChange:d,children:y}),t[22]=n,t[23]=d,t[24]=y,t[25]=b):b=t[25],b}var z=[{id:`os`,name:`Betriebssystem`},{id:`engine`,name:`Motor (llama.cpp)`},{id:`swap`,name:`llama-swap`},{id:`hermes`,name:`Hermes`}];function B(e){let t=(0,D.c)(29),{id:n,name:r,hatUpdate:i,onStart:o,laeuftGerade:s}=e,{data:c,isPending:l}=h(n),u;t[0]!==c||t[1]!==n?(u=C(n,c),t[0]=c,t[1]=n,t[2]=u):u=t[2];let d=u,f=i?d.neu??`neu`:null,p;t[3]!==c?.count||t[4]!==c?.summary||t[5]!==i||t[6]!==n||t[7]!==l?(p=i?c?.summary?.trim()||(n===`os`&&c?.count?`Paketliste unten in den Details.`:l?`Wird gelesen …`:``):`Aktuell.`,t[3]=c?.count,t[4]=c?.summary,t[5]=i,t[6]=n,t[7]=l,t[8]=p):p=t[8];let m=p,g;t[9]===r?g=t[10]:(g=(0,k.jsx)(`th`,{scope:`row`,className:`py-3.5 pr-4 text-left font-sans text-[15px] font-semibold`,children:r}),t[9]=r,t[10]=g);let _;t[11]===d.laeuft?_=t[12]:(_=(0,k.jsx)(`td`,{className:`ziffern py-3.5 pr-4 text-sm text-text-2`,children:d.laeuft}),t[11]=d.laeuft,t[12]=_);let v;t[13]===f?v=t[14]:(v=(0,k.jsx)(`td`,{className:`ziffern py-3.5 pr-4 text-sm`,children:f?(0,k.jsx)(`span`,{className:`text-cyan`,children:f}):(0,k.jsx)(`span`,{className:`text-text-3`,children:`–`})}),t[13]=f,t[14]=v);let y;t[15]===m?y=t[16]:(y=(0,k.jsx)(`td`,{className:`py-3.5 pr-4 text-sm leading-relaxed text-text-2`,children:(0,k.jsx)(`span`,{className:`line-clamp-3 whitespace-pre-line`,children:m})}),t[15]=m,t[16]=y);let b;t[17]!==i||t[18]!==s||t[19]!==o?(b=i&&(0,k.jsx)(a,{variant:`outline`,size:`sm`,onClick:o,disabled:s,children:`Aktualisieren`}),t[17]=i,t[18]=s,t[19]=o,t[20]=b):b=t[20];let x;t[21]===b?x=t[22]:(x=(0,k.jsx)(`td`,{className:`py-2.5 text-right`,children:b}),t[21]=b,t[22]=x);let S;return t[23]!==g||t[24]!==_||t[25]!==v||t[26]!==y||t[27]!==x?(S=(0,k.jsxs)(`tr`,{className:`border-t border-linie align-top`,children:[g,_,v,y,x]}),t[23]=g,t[24]=_,t[25]=v,t[26]=y,t[27]=x,t[28]=S):S=t[28],S}function V(e){let t=(0,D.c)(13),{job:n}=e,r=n.state===`done`?`gruen`:n.state===`failed`?`rot`:`cyan`,i=n.state===`done`?`Fertig`:n.state===`failed`?`Fehler`:n.state===`queued`?`Wartet`:`Läuft`,a;t[0]===n.label?a=t[1]:(a=(0,k.jsx)(`span`,{className:`text-[15px] font-semibold`,children:n.label}),t[0]=n.label,t[1]=a);let o;t[2]!==r||t[3]!==i?(o=(0,k.jsx)(x,{art:r,children:i}),t[2]=r,t[3]=i,t[4]=o):o=t[4];let s;t[5]!==a||t[6]!==o?(s=(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[a,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7];let c;t[8]===n.log?c=t[9]:(c=n.log&&n.log.length>0&&(0,k.jsx)(`pre`,{className:`ziffern max-h-40 overflow-auto rounded-md bg-[#0b0d0f] p-2 text-xs whitespace-pre-wrap text-text-2`,children:n.log.slice(-8).join(` +`)}),t[8]=n.log,t[9]=c);let l;return t[10]!==s||t[11]!==c?(l=(0,k.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl border border-linie bg-erhaben/50 p-3`,children:[s,c]}),t[10]=s,t[11]=c,t[12]=l):l=t[12],l}function H(e){return e.mtime?S(new Date(e.mtime*1e3).toISOString()):e.snapshot}function U(){let e=(0,D.c)(55),t=E(),n=b(),r=T(),i=v(),o=m(),s=y(),c=g(),[l,u]=(0,O.useState)(null),d;e[0]===t.data?.updates.bausteine?d=e[1]:(d=new Set(t.data?.updates.bausteine.map(J)??[]),e[0]=t.data?.updates.bausteine,e[1]=d);let f=d,p;if(e[2]!==n.data?.jobs||e[3]!==f||e[4]!==t.isPending||e[5]!==o){let r=(n.data?.jobs??[]).filter(q),i=r.some(K),s;e[7]===o?s=e[8]:(s=()=>o.mutate(`pruefen`),e[7]=o,e[8]=s);let c;e[9]!==s||e[10]!==o.isPending?(c=(0,k.jsx)(a,{variant:`outline`,onClick:s,disabled:o.isPending,children:`Nach Neuem suchen`}),e[9]=s,e[10]=o.isPending,e[11]=c):c=e[11];let l;e[12]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>u({art:`alle`}),e[12]=l):l=e[12];let d;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,k.jsx)(`p`,{className:`-mt-2 text-[15px] text-text-2`,children:`Jeden Sonntag um 04:30 automatisch. Vorher wird gesichert, danach geprüft.`}),e[13]=d):d=e[13],p=(0,k.jsxs)(w,{titel:`Updates`,rechts:(0,k.jsxs)(`div`,{className:`flex flex-wrap gap-2.5`,children:[c,(0,k.jsx)(a,{onClick:l,disabled:i||f.size===0,children:`Alles jetzt aktualisieren`})]}),children:[d,t.isPending?(0,k.jsx)(_,{text:`Updates werden gelesen …`}):(0,k.jsx)(`div`,{className:`overflow-x-auto`,children:(0,k.jsxs)(`table`,{className:`w-full min-w-[680px] border-collapse`,children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{className:`schild text-left text-xs text-text-3`,children:[(0,k.jsx)(`th`,{scope:`col`,className:`pb-2 font-semibold`,children:`Baustein`}),(0,k.jsx)(`th`,{scope:`col`,className:`pb-2 font-semibold`,children:`Läuft`}),(0,k.jsx)(`th`,{scope:`col`,className:`pb-2 font-semibold`,children:`Neu`}),(0,k.jsx)(`th`,{scope:`col`,className:`pb-2 font-semibold`,children:`Was sich ändert`}),(0,k.jsx)(`th`,{scope:`col`,className:`pb-2 text-right font-semibold`,children:(0,k.jsx)(`span`,{className:`sr-only`,children:`Aktion`})})]})}),(0,k.jsx)(`tbody`,{children:z.map(e=>(0,k.jsx)(B,{id:e.id,name:e.name,hatUpdate:f.has(e.id),laeuftGerade:i,onStart:()=>o.mutate(e.id)},e.id))})]})}),r.length>0&&(0,k.jsxs)(`div`,{className:`flex flex-col gap-2.5`,children:[(0,k.jsx)(`h3`,{className:`schild text-sm text-text-3`,children:`Laufende und letzte Aufträge`}),r.slice(-3).reverse().map(G)]})]}),e[2]=n.data?.jobs,e[3]=f,e[4]=t.isPending,e[5]=o,e[6]=p}else p=e[6];let h;e[14]!==r.data||e[15]!==r.isPending?(h=(0,k.jsx)(w,{titel:`Verlauf`,children:r.data?.laeufe.length?(0,k.jsx)(`ol`,{className:`m-0 flex list-none flex-col p-0`,children:r.data.laeufe.map(W)}):(0,k.jsx)(`p`,{className:`text-[15px] text-text-2`,children:r.isPending?`Wird gelesen …`:`Noch keine Update-Läufe aufgezeichnet.`})}),e[14]=r.data,e[15]=r.isPending,e[16]=h):h=e[16];let x;e[17]===s?x=e[18]:(x=()=>s.mutate(void 0),e[17]=s,e[18]=x);let S;e[19]!==s.isPending||e[20]!==x?(S=(0,k.jsx)(a,{variant:`outline`,size:`sm`,onClick:x,disabled:s.isPending,children:`Jetzt sichern`}),e[19]=s.isPending,e[20]=x,e[21]=S):S=e[21];let C;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,k.jsx)(`p`,{className:`-mt-2 text-[15px] text-text-2`,children:`Täglich um 03:35, mit Kopie auf einem zweiten Gerät.`}),e[22]=C):C=e[22];let A;if(e[23]!==i.data?.available||e[24]!==i.data?.backups){let t;e[26]===i.data?.available?t=e[27]:(t=e=>(0,k.jsxs)(`li`,{className:`flex items-center justify-between gap-3 border-t border-linie py-2.5`,children:[(0,k.jsx)(`span`,{className:`ziffern text-sm`,children:H(e)}),(0,k.jsxs)(`span`,{className:`flex items-center gap-3`,children:[(0,k.jsxs)(`span`,{className:`ziffern text-xs text-text-3`,children:[e.size_mb.toLocaleString(`de-DE`),` MB`]}),(0,k.jsx)(a,{variant:`ghost`,size:`sm`,disabled:!i.data?.available,onClick:()=>u({art:`zurueck`,datei:e.file,zeit:H(e)}),children:`Zurückspielen`})]})]},e.file),e[26]=i.data?.available,e[27]=t),A=(i.data?.backups??[]).slice(0,5).map(t),e[23]=i.data?.available,e[24]=i.data?.backups,e[25]=A}else A=e[25];let j;e[28]===A?j=e[29]:(j=(0,k.jsx)(`ul`,{className:`m-0 flex list-none flex-col p-0`,children:A}),e[28]=A,e[29]=j);let M;e[30]!==S||e[31]!==j?(M=(0,k.jsxs)(w,{titel:`Sicherungen`,rechts:S,children:[C,j]}),e[30]=S,e[31]=j,e[32]=M):M=e[32];let N;e[33]!==h||e[34]!==M?(N=(0,k.jsxs)(`div`,{className:`grid gap-5 md:gap-6 lg:grid-cols-[minmax(0,1.4fr)_minmax(0,1fr)]`,children:[h,M]}),e[33]=h,e[34]=M,e[35]=N):N=e[35];let P=l?.art===`alle`,F;e[36]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>u(null),e[36]=F):F=e[36];let I;e[37]===o?I=e[38]:(I=()=>{o.mutate(`alle`),u(null)},e[37]=o,e[38]=I);let L;e[39]!==P||e[40]!==I?(L=(0,k.jsx)(R,{offen:P,titel:`Alles jetzt aktualisieren?`,text:`Betriebssystem, Motor, llama-swap und Hermes werden nacheinander aktualisiert. Vorher wird gesichert, danach geprüft. Lucy ist dabei ein paar Minuten nicht erreichbar.`,knopf:`Aktualisieren`,onNein:F,onJa:I}),e[39]=P,e[40]=I,e[41]=L):L=e[41];let V=l?.art===`zurueck`,U=`Die Einstellungen von Hermes und llama-swap werden auf den Stand von ${l?.art===`zurueck`?l.zeit:``} gesetzt. Vorher wird der jetzige Stand gesichert. Die Dienste starten danach neu.`,Y;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(Y=()=>u(null),e[42]=Y):Y=e[42];let X;e[43]!==l||e[44]!==c?(X=()=>{l?.art===`zurueck`&&c.mutate(l.datei),u(null)},e[43]=l,e[44]=c,e[45]=X):X=e[45];let Z;e[46]!==V||e[47]!==U||e[48]!==X?(Z=(0,k.jsx)(R,{offen:V,gefahr:!0,titel:`Sicherung zurückspielen?`,text:U,knopf:`Zurückspielen`,onNein:Y,onJa:X}),e[46]=V,e[47]=U,e[48]=X,e[49]=Z):Z=e[49];let Q;return e[50]!==p||e[51]!==L||e[52]!==Z||e[53]!==N?(Q=(0,k.jsxs)(k.Fragment,{children:[p,N,L,Z]}),e[50]=p,e[51]=L,e[52]=Z,e[53]=N,e[54]=Q):Q=e[54],Q}function W(e){let t=e.status===`completed`,n=t?`gruen`:e.status===`failed`?`rot`:`cyan`;return(0,k.jsxs)(`li`,{className:`grid grid-cols-[112px_minmax(0,1fr)_auto] items-start gap-3 border-t border-linie py-3`,children:[(0,k.jsx)(`span`,{className:`ziffern text-sm text-text-3`,children:e.start?S(e.start):`–`}),(0,k.jsxs)(`span`,{className:`min-w-0 text-[15px]`,children:[e.job,e.fehler&&(0,k.jsx)(`span`,{className:`block text-sm text-rot-text`,children:e.fehler})]}),(0,k.jsx)(x,{art:n,children:t?`Durchgelaufen`:e.status===`failed`?`Fehlgeschlagen`:`Läuft`})]},`${e.start}-${e.job}`)}function G(e){return(0,k.jsx)(V,{job:e},e.id)}function K(e){return e.state===`running`||e.state===`queued`}function q(e){return e.group===`maintenance`}function J(e){return e.id}export{U as UpdatesSeite}; \ No newline at end of file diff --git a/frontend/dist/assets/WissenView-BoYalgKN.js b/frontend/dist/assets/WissenView-BoYalgKN.js deleted file mode 100644 index 342cf81..0000000 --- a/frontend/dist/assets/WissenView-BoYalgKN.js +++ /dev/null @@ -1,52 +0,0 @@ -var to=Object.defineProperty;var eo=(e,n,r)=>n in e?to(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var Bn=(e,n,r)=>eo(e,typeof n!="symbol"?n+"":n,r);import{c as no,r as W,al as ro,am as io,j as $,an as oo,z as ao,A as so,ao as uo,n as lo,b as Ae,L as Ke,a1 as co,ap as fo}from"./index-DMY9lUCb.js";import{i as Ft,c as Xn,a as Yn,b as ho,o as po,m as Zn,d as Kn}from"./string-DoZi9Vij.js";import{R as go}from"./refresh-cw-hAcZthO8.js";import{S as yo}from"./search-D_8DnBvS.js";import{F as _o}from"./file-text-BSQuFPZM.js";/** - * @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 vo=no("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"}]]);function mo(e,n){let r=0;for(let i of e)(i=+i)&&(r+=i);return r}var Qn=180/Math.PI,fn={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Yr(e,n,r,i,o,a){var s,u,c;return(s=Math.sqrt(e*e+n*n))&&(e/=s,n/=s),(c=e*r+n*i)&&(r-=e*c,i-=n*c),(u=Math.sqrt(r*r+i*i))&&(r/=u,i/=u,c/=u),e*i180?f+=360:f-l>180&&(l+=360),d.push({i:h.push(o(h)+"rotate(",null,i)-2,x:Ft(l,f)})):f&&h.push(o(h)+"rotate("+f+i)}function u(l,f,h,d){l!==f?d.push({i:h.push(o(h)+"skewX(",null,i)-2,x:Ft(l,f)}):f&&h.push(o(h)+"skewX("+f+i)}function c(l,f,h,d,p,y){if(l!==h||f!==d){var m=p.push(o(p)+"scale(",null,",",null,")");y.push({i:m-4,x:Ft(l,h)},{i:m-2,x:Ft(f,d)})}else(h!==1||d!==1)&&p.push(o(p)+"scale("+h+","+d+")")}return function(l,f){var h=[],d=[];return l=e(l),f=e(f),a(l.translateX,l.translateY,f.translateX,f.translateY,h,d),s(l.rotate,f.rotate,h,d),u(l.skewX,f.skewX,h,d),c(l.scaleX,l.scaleY,f.scaleX,f.scaleY,h,d),l=f=null,function(p){for(var y=-1,m=d.length,v;++ye.length)&&(n=e.length);for(var r=0,i=new Array(n);ra,methodNames:i=[],initPropNames:o=[]}={}){return W.forwardRef((a,s)=>{const u=W.useRef(),c=W.useMemo(()=>{const h=Object.fromEntries(o.filter(d=>a.hasOwnProperty(d)).map(d=>[d,a[d]]));return e(h)},[]);er(()=>{c(r(u.current))},W.useLayoutEffect),er(()=>c._destructor instanceof Function?c._destructor:void 0);const l=W.useCallback((h,...d)=>c[h]instanceof Function?c[h](...d):void 0,[c]),f=W.useRef({});return Object.keys($o(a,[...i,...o])).filter(h=>f.current[h]!==a[h]).forEach(h=>l(h,a[h])),f.current=a,W.useImperativeHandle(s,()=>Object.fromEntries(i.map(h=>[h,(...d)=>l(h,...d)])),[l]),ro.createElement(n,{ref:u})})}function er(e,n=W.useEffect){const r=W.useRef(),i=W.useRef(!1),o=W.useRef(!1),[a,s]=W.useState(0);i.current&&(o.current=!0),n(()=>(i.current||(r.current=e(),i.current=!0),s(u=>u+1),()=>{o.current&&(r.current&&r.current(),r.current=void 0,i.current=!1,o.current=!1)}),[])}var dn="http://www.w3.org/1999/xhtml";const nr={svg:"http://www.w3.org/2000/svg",xhtml:dn,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function We(e){var n=e+="",r=n.indexOf(":");return r>=0&&(n=e.slice(0,r))!=="xmlns"&&(e=e.slice(r+1)),nr.hasOwnProperty(n)?{space:nr[n],local:e}:e}function Fo(e){return function(){var n=this.ownerDocument,r=this.namespaceURI;return r===dn&&n.documentElement.namespaceURI===dn?n.createElement(e):n.createElementNS(r,e)}}function Uo(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Qr(e){var n=We(e);return(n.local?Uo:Fo)(n)}function Ho(){}function Tn(e){return e==null?Ho:function(){return this.querySelector(e)}}function qo(e){typeof e!="function"&&(e=Tn(e));for(var n=this._groups,r=n.length,i=new Array(r),o=0;o=M&&(M=k+1);!(_=v[M])&&++M=0;)(s=i[o])&&(a&&s.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(s,a),a=s);return this}function pa(e){e||(e=ga);function n(h,d){return h&&d?e(h.__data__,d.__data__):!h-!d}for(var r=this._groups,i=r.length,o=new Array(i),a=0;an?1:e>=n?0:NaN}function ya(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function _a(){return Array.from(this)}function va(){for(var e=this._groups,n=0,r=e.length;n1?this.each((n==null?Pa:typeof n=="function"?Ea:Oa)(e,n,r??"")):Bt(this.node(),e)}function Bt(e,n){return e.style.getPropertyValue(n)||ri(e).getComputedStyle(e,null).getPropertyValue(n)}function Na(e){return function(){delete this[e]}}function Ra(e,n){return function(){this[e]=n}}function ja(e,n){return function(){var r=n.apply(this,arguments);r==null?delete this[e]:this[e]=r}}function Da(e,n){return arguments.length>1?this.each((n==null?Na:typeof n=="function"?ja:Ra)(e,n)):this.node()[e]}function ii(e){return e.trim().split(/^|\s+/)}function Pn(e){return e.classList||new oi(e)}function oi(e){this._node=e,this._names=ii(e.getAttribute("class")||"")}oi.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function ai(e,n){for(var r=Pn(e),i=-1,o=n.length;++i=0&&(r=n.slice(i+1),n=n.slice(0,i)),{type:n,name:r}})}function cs(e){return function(){var n=this.__on;if(n){for(var r=0,i=-1,o=n.length,a;r{}};function ve(){for(var e=0,n=arguments.length,r={},i;e=0&&(i=r.slice(o+1),r=r.slice(0,o)),r&&!n.hasOwnProperty(r))throw new Error("unknown type: "+r);return{type:r,name:i}})}Se.prototype=ve.prototype={constructor:Se,on:function(e,n){var r=this._,i=xs(e+"",r),o,a=-1,s=i.length;if(arguments.length<2){for(;++a0)for(var r=new Array(o),i=0,o,a;i()=>e;function pn(e,{sourceEvent:n,subject:r,target:i,identifier:o,active:a,x:s,y:u,dx:c,dy:l,dispatch:f}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:f}})}pn.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function ks(e){return!e.ctrlKey&&!e.button}function Cs(){return this.parentNode}function As(e,n){return n??{x:e.x,y:e.y}}function Ss(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ms(){var e=ks,n=Cs,r=As,i=Ss,o={},a=ve("start","drag","end"),s=0,u,c,l,f,h=0;function d(b){b.on("mousedown.drag",p).filter(i).on("touchstart.drag",v).on("touchmove.drag",g,ws).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(b,_){if(!(f||!e.call(this,b,_))){var w=M(this,n.call(this,b,_),b,_,"mouse");w&&(pt(b.view).on("mousemove.drag",y,pe).on("mouseup.drag",m,pe),ci(b.view),Qe(b),l=!1,u=b.clientX,c=b.clientY,w("start",b))}}function y(b){if(Vt(b),!l){var _=b.clientX-u,w=b.clientY-c;l=_*_+w*w>h}o.mouse("drag",b)}function m(b){pt(b.view).on("mousemove.drag mouseup.drag",null),fi(b.view,l),Vt(b),o.mouse("end",b)}function v(b,_){if(e.call(this,b,_)){var w=b.changedTouches,A=n.call(this,b,_),T=w.length,R,P;for(R=0;R=0&&e._call.call(void 0,n),e=e._next;--Xt}function ir(){Ht=(Re=ge.now())+Ge,Xt=ae=0;try{Ps()}finally{Xt=0,Es(),Ht=0}}function Os(){var e=ge.now(),n=e-Re;n>hi&&(Ge-=n,Re=e)}function Es(){for(var e,n=Ne,r,i=1/0;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(r=n._next,n._next=null,n=e?e._next=r:Ne=r);se=e,gn(i)}function gn(e){if(!Xt){ae&&(ae=clearTimeout(ae));var n=e-Ht;n>24?(e<1/0&&(ae=setTimeout(ir,e-ge.now()-Ge)),Qt&&(Qt=clearInterval(Qt))):(Qt||(Re=ge.now(),Qt=setInterval(Os,hi)),Xt=1,di(ir))}}function or(e,n,r){var i=new je;return n=n==null?0:+n,i.restart(o=>{i.stop(),e(o+n)},n,r),i}var zs=ve("start","end","cancel","interrupt"),Ns=[],pi=0,ar=1,yn=2,Me=3,sr=4,_n=5,Te=6;function Ve(e,n,r,i,o,a){var s=e.__transition;if(!s)e.__transition={};else if(r in s)return;Rs(e,r,{name:n,index:i,group:o,on:zs,tween:Ns,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:pi})}function zn(e,n){var r=vt(e,n);if(r.state>pi)throw new Error("too late; already scheduled");return r}function Ct(e,n){var r=vt(e,n);if(r.state>Me)throw new Error("too late; already running");return r}function vt(e,n){var r=e.__transition;if(!r||!(r=r[n]))throw new Error("transition not found");return r}function Rs(e,n,r){var i=e.__transition,o;i[n]=r,r.timer=En(a,0,r.time);function a(l){r.state=ar,r.timer.restart(s,r.delay,r.time),r.delay<=l&&s(l-r.delay)}function s(l){var f,h,d,p;if(r.state!==ar)return c();for(f in i)if(p=i[f],p.name===r.name){if(p.state===Me)return or(s);p.state===sr?(p.state=Te,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete i[f]):+fyn&&i.state<_n,i.state=Te,i.timer.stop(),i.on.call(o?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete r[s]}a&&delete e.__transition}}function js(e){return this.each(function(){Pe(this,e)})}function Ds(e,n){var r,i;return function(){var o=Ct(this,e),a=o.tween;if(a!==r){i=r=a;for(var s=0,u=i.length;s=0&&(n=n.slice(0,r)),!n||n==="start"})}function cu(e,n,r){var i,o,a=lu(n)?zn:Ct;return function(){var s=a(this,e),u=s.on;u!==i&&(o=(i=u).copy()).on(n,r),s.on=o}}function fu(e,n){var r=this._id;return arguments.length<2?vt(this.node(),r).on.on(e):this.each(cu(r,e,n))}function hu(e){return function(){var n=this.parentNode;for(var r in this.__transition)if(+r!==e)return;n&&n.removeChild(this)}}function du(){return this.on("end.remove",hu(this._id))}function pu(e){var n=this._name,r=this._id;typeof e!="function"&&(e=Tn(e));for(var i=this._groups,o=i.length,a=new Array(o),s=0;s()=>e;function Lu(e,{sourceEvent:n,target:r,transform:i,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:o}})}function Et(e,n,r){this.k=e,this.x=n,this.y=r}Et.prototype={constructor:Et,scale:function(e){return e===1?this:new Et(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Et(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Rn=new Et(1,0,0);mt.prototype=Et.prototype;function mt(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Rn;return e.__zoom}function Je(e){e.stopImmediatePropagation()}function Jt(e){e.preventDefault(),e.stopImmediatePropagation()}function Fu(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Uu(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function ur(){return this.__zoom||Rn}function Hu(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function qu(){return navigator.maxTouchPoints||"ontouchstart"in this}function Wu(e,n,r){var i=e.invertX(n[0][0])-r[0][0],o=e.invertX(n[1][0])-r[1][0],a=e.invertY(n[0][1])-r[0][1],s=e.invertY(n[1][1])-r[1][1];return e.translate(o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o),s>a?(a+s)/2:Math.min(0,a)||Math.max(0,s))}function Gu(){var e=Fu,n=Uu,r=Wu,i=Hu,o=qu,a=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],u=250,c=Mo,l=ve("start","zoom","end"),f,h,d,p=500,y=150,m=0,v=10;function g(S){S.property("__zoom",ur).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",P).filter(o).on("touchstart.zoom",N).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",U).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(S,j,E,C){var O=S.selection?S.selection():S;O.property("__zoom",ur),S!==O?_(S,j,E,C):O.interrupt().each(function(){w(this,arguments).event(C).start().zoom(null,typeof j=="function"?j.apply(this,arguments):j).end()})},g.scaleBy=function(S,j,E,C){g.scaleTo(S,function(){var O=this.__zoom.k,I=typeof j=="function"?j.apply(this,arguments):j;return O*I},E,C)},g.scaleTo=function(S,j,E,C){g.transform(S,function(){var O=n.apply(this,arguments),I=this.__zoom,L=E==null?b(O):typeof E=="function"?E.apply(this,arguments):E,H=I.invert(L),F=typeof j=="function"?j.apply(this,arguments):j;return r(M(k(I,F),L,H),O,s)},E,C)},g.translateBy=function(S,j,E,C){g.transform(S,function(){return r(this.__zoom.translate(typeof j=="function"?j.apply(this,arguments):j,typeof E=="function"?E.apply(this,arguments):E),n.apply(this,arguments),s)},null,C)},g.translateTo=function(S,j,E,C,O){g.transform(S,function(){var I=n.apply(this,arguments),L=this.__zoom,H=C==null?b(I):typeof C=="function"?C.apply(this,arguments):C;return r(Rn.translate(H[0],H[1]).scale(L.k).translate(typeof j=="function"?-j.apply(this,arguments):-j,typeof E=="function"?-E.apply(this,arguments):-E),I,s)},C,O)};function k(S,j){return j=Math.max(a[0],Math.min(a[1],j)),j===S.k?S:new Et(j,S.x,S.y)}function M(S,j,E){var C=j[0]-E[0]*S.k,O=j[1]-E[1]*S.k;return C===S.x&&O===S.y?S:new Et(S.k,C,O)}function b(S){return[(+S[0][0]+ +S[1][0])/2,(+S[0][1]+ +S[1][1])/2]}function _(S,j,E,C){S.on("start.zoom",function(){w(this,arguments).event(C).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(C).end()}).tween("zoom",function(){var O=this,I=arguments,L=w(O,I).event(C),H=n.apply(O,I),F=E==null?b(H):typeof E=="function"?E.apply(O,I):E,G=Math.max(H[1][0]-H[0][0],H[1][1]-H[0][1]),V=O.__zoom,X=typeof j=="function"?j.apply(O,I):j,tt=c(V.invert(F).concat(G/V.k),X.invert(F).concat(G/X.k));return function(Z){if(Z===1)Z=X;else{var st=tt(Z),et=G/st[2];Z=new Et(et,F[0]-st[0]*et,F[1]-st[1]*et)}L.zoom(null,Z)}})}function w(S,j,E){return!E&&S.__zooming||new A(S,j)}function A(S,j){this.that=S,this.args=j,this.active=0,this.sourceEvent=null,this.extent=n.apply(S,j),this.taps=0}A.prototype={event:function(S){return S&&(this.sourceEvent=S),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(S,j){return this.mouse&&S!=="mouse"&&(this.mouse[1]=j.invert(this.mouse[0])),this.touch0&&S!=="touch"&&(this.touch0[1]=j.invert(this.touch0[0])),this.touch1&&S!=="touch"&&(this.touch1[1]=j.invert(this.touch1[0])),this.that.__zoom=j,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(S){var j=pt(this.that).datum();l.call(S,this.that,new Lu(S,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:l}),j)}};function T(S,...j){if(!e.apply(this,arguments))return;var E=w(this,j).event(S),C=this.__zoom,O=Math.max(a[0],Math.min(a[1],C.k*Math.pow(2,i.apply(this,arguments)))),I=xt(S);if(E.wheel)(E.mouse[0][0]!==I[0]||E.mouse[0][1]!==I[1])&&(E.mouse[1]=C.invert(E.mouse[0]=I)),clearTimeout(E.wheel);else{if(C.k===O)return;E.mouse=[I,C.invert(I)],Pe(this),E.start()}Jt(S),E.wheel=setTimeout(L,y),E.zoom("mouse",r(M(k(C,O),E.mouse[0],E.mouse[1]),E.extent,s));function L(){E.wheel=null,E.end()}}function R(S,...j){if(d||!e.apply(this,arguments))return;var E=S.currentTarget,C=w(this,j,!0).event(S),O=pt(S.view).on("mousemove.zoom",F,!0).on("mouseup.zoom",G,!0),I=xt(S,E),L=S.clientX,H=S.clientY;ci(S.view),Je(S),C.mouse=[I,this.__zoom.invert(I)],Pe(this),C.start();function F(V){if(Jt(V),!C.moved){var X=V.clientX-L,tt=V.clientY-H;C.moved=X*X+tt*tt>m}C.event(V).zoom("mouse",r(M(C.that.__zoom,C.mouse[0]=xt(V,E),C.mouse[1]),C.extent,s))}function G(V){O.on("mousemove.zoom mouseup.zoom",null),fi(V.view,C.moved),Jt(V),C.event(V).end()}}function P(S,...j){if(e.apply(this,arguments)){var E=this.__zoom,C=xt(S.changedTouches?S.changedTouches[0]:S,this),O=E.invert(C),I=E.k*(S.shiftKey?.5:2),L=r(M(k(E,I),C,O),n.apply(this,j),s);Jt(S),u>0?pt(this).transition().duration(u).call(_,L,C,S):pt(this).call(g.transform,L,C,S)}}function N(S,...j){if(e.apply(this,arguments)){var E=S.touches,C=E.length,O=w(this,j,S.changedTouches.length===C).event(S),I,L,H,F;for(Je(S),L=0;L=n||A<0||h&&T>=a}function g(){var w=tn();if(v(w))return k(w);u=setTimeout(g,m(w))}function k(w){return u=void 0,d&&i?p(w):(i=o=void 0,s)}function M(){u!==void 0&&clearTimeout(u),l=0,i=c=o=u=void 0}function b(){return u===void 0?s:k(tn())}function _(){var w=tn(),A=v(w);if(i=arguments,o=this,c=w,A){if(u===void 0)return y(c);if(h)return clearTimeout(u),u=setTimeout(g,n),p(c)}return u===void 0&&(u=setTimeout(g,n)),s}return _.cancel=M,_.flush=b,_}var _l="Expected a function";function vl(e,n,r){var i=!0,o=!0;if(typeof e!="function")throw new TypeError(_l);return Ie(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),xi(e,n,{leading:i,maxWait:n,trailing:o})}var Ut=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var n=1.70158;return e===1?1:e*e*((n+1)*e-n)},Out:function(e){var n=1.70158;return e===0?0:--e*e*((n+1)*e+n)+1},InOut:function(e){var n=2.5949095;return(e*=2)<1?.5*(e*e*((n+1)*e-n)):.5*((e-=2)*e*((n+1)*e+n)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Ut.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?Ut.Bounce.In(e*2)*.5:Ut.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e1e4?1e4:e,{In:function(n){return Math.pow(n,e)},Out:function(n){return 1-Math.pow(1-n,e)},InOut:function(n){return n<.5?Math.pow(n*2,e)/2:(1-Math.pow(2-n*2,e))/2+.5}}}}),ue=function(){return performance.now()},bi=(function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var n=this;return Object.keys(this._tweens).map(function(r){return n._tweens[r]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(n){this._tweens[n.getId()]=n,this._tweensAddedDuringUpdate[n.getId()]=n},e.prototype.remove=function(n){delete this._tweens[n.getId()],delete this._tweensAddedDuringUpdate[n.getId()]},e.prototype.update=function(n,r){n===void 0&&(n=ue()),r===void 0&&(r=!1);var i=Object.keys(this._tweens);if(i.length===0)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o1?a(e[r],e[r-1],r-i):a(e[o],e[o+1>r?r:o+1],i-o)},Utils:{Linear:function(e,n,r){return(n-e)*r+e}}},wi=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),mn=new bi,hr=(function(){function e(n,r){r===void 0&&(r=mn),this._object=n,this._group=r,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Ut.Linear.None,this._interpolationFunction=vn.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=wi.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(n,r){if(r===void 0&&(r=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=n,this._propertiesAreSetUp=!1,this._duration=r<0?0:r,this},e.prototype.duration=function(n){return n===void 0&&(n=1e3),this._duration=n<0?0:n,this},e.prototype.dynamic=function(n){return n===void 0&&(n=!1),this._isDynamic=n,this},e.prototype.start=function(n,r){if(n===void 0&&(n=ue()),r===void 0&&(r=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=n,this._startTime+=this._delayTime,!this._propertiesAreSetUp||r){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var a in this._valuesEnd)o[a]=this._valuesEnd[a];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,r)}return this},e.prototype.startFromCurrentValues=function(n){return this.start(n,!0)},e.prototype._setupProperties=function(n,r,i,o,a){for(var s in i){var u=n[s],c=Array.isArray(u),l=c?"array":typeof u,f=!c&&Array.isArray(i[s]);if(!(l==="undefined"||l==="function")){if(f){var h=i[s];if(h.length===0)continue;for(var d=[u],p=0,y=h.length;p"u"||a)&&(r[s]=u),c||(r[s]*=1),f?o[s]=i[s].slice().reverse():o[s]=r[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(n){return n===void 0&&(n=ue()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=n,this._group&&this._group.remove(this),this)},e.prototype.resume=function(n){return n===void 0&&(n=ue()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=n-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},e.prototype.stopChainedTweens=function(){for(var n=0,r=this._chainedTweens.length;ns)return!1;r&&this.start(n,!0)}if(this._goToEnd=!1,nl)return 1;var v=Math.trunc(u/c),g=u-v*c,k=Math.min(g/i._duration,1);return k===0&&u===i._duration?1:k},h=f(),d=this._easingFunction(h);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,h),this._duration===0||u>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((u-this._duration)/c)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(a in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[a]=="string"&&(this._valuesStartRepeat[a]=this._valuesStartRepeat[a]+parseFloat(this._valuesEnd[a])),this._yoyo&&this._swapEndStartRepeatValues(a),this._valuesStart[a]=this._valuesStartRepeat[a];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=c*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var y=0,m=this._chainedTweens.length;ye.length)&&(n=e.length);for(var r=0,i=Array(n);r=0,a=!r&&o&&(n==="hex"||n==="hex6"||n==="hex3"||n==="hex4"||n==="hex8"||n==="name");return a?n==="name"&&this._a===0?this.toName():this.toRgbString():(n==="rgb"&&(i=this.toRgbString()),n==="prgb"&&(i=this.toPercentageRgbString()),(n==="hex"||n==="hex6")&&(i=this.toHexString()),n==="hex3"&&(i=this.toHexString(!0)),n==="hex4"&&(i=this.toHex8String(!0)),n==="hex8"&&(i=this.toHex8String()),n==="name"&&(i=this.toName()),n==="hsl"&&(i=this.toHslString()),n==="hsv"&&(i=this.toHsvString()),i||this.toHexString())},clone:function(){return q(this.toString())},_applyModification:function(n,r){var i=n.apply(null,[this].concat([].slice.call(r)));return this._r=i._r,this._g=i._g,this._b=i._b,this.setAlpha(i._a),this},lighten:function(){return this._applyModification(Il,arguments)},brighten:function(){return this._applyModification($l,arguments)},darken:function(){return this._applyModification(Ll,arguments)},desaturate:function(){return this._applyModification(Rl,arguments)},saturate:function(){return this._applyModification(jl,arguments)},greyscale:function(){return this._applyModification(Dl,arguments)},spin:function(){return this._applyModification(Fl,arguments)},_applyCombination:function(n,r){return n.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(ql,arguments)},complement:function(){return this._applyCombination(Ul,arguments)},monochromatic:function(){return this._applyCombination(Wl,arguments)},splitcomplement:function(){return this._applyCombination(Hl,arguments)},triad:function(){return this._applyCombination(vr,[3])},tetrad:function(){return this._applyCombination(vr,[4])}};q.fromRatio=function(e,n){if($e(e)=="object"){var r={};for(var i in e)e.hasOwnProperty(i)&&(i==="a"?r[i]=e[i]:r[i]=le(e[i]));e=r}return q(e,n)};function Pl(e){var n={r:0,g:0,b:0},r=1,i=null,o=null,a=null,s=!1,u=!1;return typeof e=="string"&&(e=Yl(e)),$e(e)=="object"&&(Mt(e.r)&&Mt(e.g)&&Mt(e.b)?(n=Ol(e.r,e.g,e.b),s=!0,u=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Mt(e.h)&&Mt(e.s)&&Mt(e.v)?(i=le(e.s),o=le(e.v),n=zl(e.h,i,o),s=!0,u="hsv"):Mt(e.h)&&Mt(e.s)&&Mt(e.l)&&(i=le(e.s),a=le(e.l),n=El(e.h,i,a),s=!0,u="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=ki(r),{ok:s,format:e.format||u,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:r}}function Ol(e,n,r){return{r:Q(e,255)*255,g:Q(n,255)*255,b:Q(r,255)*255}}function pr(e,n,r){e=Q(e,255),n=Q(n,255),r=Q(r,255);var i=Math.max(e,n,r),o=Math.min(e,n,r),a,s,u=(i+o)/2;if(i==o)a=s=0;else{var c=i-o;switch(s=u>.5?c/(2-i-o):c/(i+o),i){case e:a=(n-r)/c+(n1&&(h-=1),h<1/6?l+(f-l)*6*h:h<1/2?f:h<2/3?l+(f-l)*(2/3-h)*6:l}if(n===0)i=o=a=r;else{var u=r<.5?r*(1+n):r+n-r*n,c=2*r-u;i=s(c,u,e+1/3),o=s(c,u,e),a=s(c,u,e-1/3)}return{r:i*255,g:o*255,b:a*255}}function gr(e,n,r){e=Q(e,255),n=Q(n,255),r=Q(r,255);var i=Math.max(e,n,r),o=Math.min(e,n,r),a,s,u=i,c=i-o;if(s=i===0?0:c/i,i==o)a=0;else{switch(i){case e:a=(n-r)/c+(n>1)+720)%360;--n;)i.h=(i.h+o)%360,a.push(q(i));return a}function Wl(e,n){n=n||6;for(var r=q(e).toHsv(),i=r.h,o=r.s,a=r.v,s=[],u=1/n;n--;)s.push(q({h:i,s:o,v:a})),a=(a+u)%1;return s}q.mix=function(e,n,r){r=r===0?0:r||50;var i=q(e).toRgb(),o=q(n).toRgb(),a=r/100,s={r:(o.r-i.r)*a+i.r,g:(o.g-i.g)*a+i.g,b:(o.b-i.b)*a+i.b,a:(o.a-i.a)*a+i.a};return q(s)};q.readability=function(e,n){var r=q(e),i=q(n);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)};q.isReadable=function(e,n,r){var i=q.readability(e,n),o,a;switch(a=!1,o=Zl(r),o.level+o.size){case"AAsmall":case"AAAlarge":a=i>=4.5;break;case"AAlarge":a=i>=3;break;case"AAAsmall":a=i>=7;break}return a};q.mostReadable=function(e,n,r){var i=null,o=0,a,s,u,c;r=r||{},s=r.includeFallbackColors,u=r.level,c=r.size;for(var l=0;lo&&(o=a,i=q(n[l]));return q.isReadable(e,i,{level:u,size:c})||!s?i:(r.includeFallbackColors=!1,q.mostReadable(e,["#fff","#000"],r))};var xn=q.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Gl=q.hexNames=Vl(xn);function Vl(e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[e[r]]=r);return n}function ki(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Q(e,n){Bl(e)&&(e="100%");var r=Xl(e);return e=Math.min(n,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*n,10)/100),Math.abs(e-n)<1e-6?1:e%n/parseFloat(n)}function Be(e){return Math.min(1,Math.max(0,e))}function ct(e){return parseInt(e,16)}function Bl(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function Xl(e){return typeof e=="string"&&e.indexOf("%")!=-1}function _t(e){return e.length==1?"0"+e:""+e}function le(e){return e<=1&&(e=e*100+"%"),e}function Ci(e){return Math.round(parseFloat(e)*255).toString(16)}function mr(e){return ct(e)/255}var yt=(function(){var e="[-\\+]?\\d+%?",n="[-\\+]?\\d*\\.\\d+%?",r="(?:"+n+")|(?:"+e+")",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",o="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+i),rgba:new RegExp("rgba"+o),hsl:new RegExp("hsl"+i),hsla:new RegExp("hsla"+o),hsv:new RegExp("hsv"+i),hsva:new RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}})();function Mt(e){return!!yt.CSS_UNIT.exec(e)}function Yl(e){e=e.replace(Ml,"").replace(Tl,"").toLowerCase();var n=!1;if(xn[e])e=xn[e],n=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=yt.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=yt.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=yt.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=yt.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=yt.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=yt.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=yt.hex8.exec(e))?{r:ct(r[1]),g:ct(r[2]),b:ct(r[3]),a:mr(r[4]),format:n?"name":"hex8"}:(r=yt.hex6.exec(e))?{r:ct(r[1]),g:ct(r[2]),b:ct(r[3]),format:n?"name":"hex"}:(r=yt.hex4.exec(e))?{r:ct(r[1]+""+r[1]),g:ct(r[2]+""+r[2]),b:ct(r[3]+""+r[3]),a:mr(r[4]+""+r[4]),format:n?"name":"hex8"}:(r=yt.hex3.exec(e))?{r:ct(r[1]+""+r[1]),g:ct(r[2]+""+r[2]),b:ct(r[3]+""+r[3]),format:n?"name":"hex"}:!1}function Zl(e){var n,r;return e=e||{level:"AA",size:"small"},n=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),n!=="AA"&&n!=="AAA"&&(n="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:n,size:r}}function bn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r0&&arguments[0]!==void 0?arguments[0]:6;Jl(this,e),xr(this,Lt,void 0),xr(this,Tt,void 0),br(Tt,this,n),this.reset()}return ec(e,[{key:"reset",value:function(){br(Lt,this,["__reserved for background__"])}},{key:"register",value:function(r){if(ht(Lt,this).length>=Math.pow(2,24-ht(Tt,this)))return null;var i=ht(Lt,this).length,o=wr(i,ht(Tt,this)),a=lc(i+(o<<24-ht(Tt,this)));return ht(Lt,this).push(r),a}},{key:"lookup",value:function(r){if(!r)return null;var i=typeof r=="string"?cc(r):Si.apply(void 0,ic(r));if(!i)return null;var o=i&Math.pow(2,24-ht(Tt,this))-1,a=i>>24-ht(Tt,this)&Math.pow(2,ht(Tt,this))-1;return wr(o,ht(Tt,this))!==a||o>=ht(Lt,this).length?null:ht(Lt,this)[o]}}])})(),me,J,Mi,Ti,$t,kr,Pi,Oi,en,Oe,ce,Ei,Dn,wn,kn,Le={},Fe=[],hc=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Xe=Array.isArray;function bt(e,n){for(var r in n)e[r]=n[r];return e}function In(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function dc(e,n,r){var i,o,a,s={};for(a in n)a=="key"?i=n[a]:a=="ref"?o=n[a]:s[a]=n[a];if(arguments.length>2&&(s.children=arguments.length>3?me.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)s[a]===void 0&&(s[a]=e.defaultProps[a]);return fe(e,s,i,o,null)}function fe(e,n,r,i,o){var a={type:e,props:n,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++Mi,__i:-1,__u:0};return o==null&&J.vnode!=null&&J.vnode(a),a}function Ye(e){return e.children}function Ee(e,n){this.props=e,this.context=n}function Yt(e,n){if(n==null)return e.__?Yt(e.__,e.__i+1):null;for(var r;nn&&$t.sort(Oi),e=$t.shift(),n=$t.length,pc(e)}finally{$t.length=Ue.__r=0}}function Ni(e,n,r,i,o,a,s,u,c,l,f){var h,d,p,y,m,v,g,k=i&&i.__k||Fe,M=n.length;for(c=gc(r,n,k,c,M),h=0;h0?s=e.__k[a]=fe(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):e.__k[a]=s,c=a+d,s.__=e,s.__b=e.__b+1,u=null,(l=s.__i=yc(s,r,c,h))!=-1&&(h--,(u=r[l])&&(u.__u|=2)),u==null||u.__v==null?(l==-1&&(o>f?d--:oc?d--:d++,s.__u|=4))):e.__k[a]=null;if(h)for(a=0;a(f?1:0)){for(o=r-1,a=r+1;o>=0||a=0?o--:a++])!=null&&(2&l.__u)==0&&u==l.key&&c==l.type)return s}return-1}function Ar(e,n,r){n[0]=="-"?e.setProperty(n,r??""):e[n]=r==null?"":typeof r!="number"||hc.test(n)?r:r+"px"}function ke(e,n,r,i,o){var a,s;t:if(n=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof i=="string"&&(e.style.cssText=i=""),i)for(n in i)r&&n in r||Ar(e.style,n,"");if(r)for(n in r)i&&r[n]==i[n]||Ar(e.style,n,r[n])}else if(n[0]=="o"&&n[1]=="n")a=n!=(n=n.replace(Ei,"$1")),s=n.toLowerCase(),n=s in e||n=="onFocusOut"||n=="onFocusIn"?s.slice(2):n.slice(2),e.l||(e.l={}),e.l[n+a]=r,r?i?r[ce]=i[ce]:(r[ce]=Dn,e.addEventListener(n,a?kn:wn,a)):e.removeEventListener(n,a?kn:wn,a);else{if(o=="http://www.w3.org/2000/svg")n=n.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(n!="width"&&n!="height"&&n!="href"&&n!="list"&&n!="form"&&n!="tabIndex"&&n!="download"&&n!="rowSpan"&&n!="colSpan"&&n!="role"&&n!="popover"&&n in e)try{e[n]=r??"";break t}catch{}typeof r=="function"||(r==null||r===!1&&n[4]!="-"?e.removeAttribute(n):e.setAttribute(n,n=="popover"&&r==1?"":r))}}function Sr(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n[Oe]==null)n[Oe]=Dn++;else if(n[Oe]0?e:Xe(e)?e.map(Ii):e.constructor!==void 0?null:bt({},e)}function _c(e,n,r,i,o,a,s,u,c){var l,f,h,d,p,y,m,v=r.props||Le,g=n.props,k=n.type;if(k=="svg"?o="http://www.w3.org/2000/svg":k=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),a!=null){for(l=0;l2&&(u.children=arguments.length>3?me.call(arguments,2):r),fe(e.type,u,i||e.key,o||e.ref,null)}me=Fe.slice,J={__e:function(e,n,r,i){for(var o,a,s;n=n.__;)if((o=n.__c)&&!o.__)try{if((a=o.constructor)&&a.getDerivedStateFromError!=null&&(o.setState(a.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,i||{}),s=o.__d),s)return o.__E=o}catch(u){e=u}throw e}},Mi=0,Ti=function(e){return e!=null&&e.constructor===void 0},Ee.prototype.setState=function(e,n){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=bt({},this.state),typeof e=="function"&&(e=e(bt({},r),this.props)),e&&bt(r,e),e!=null&&this.__v&&(n&&this._sb.push(n),Cr(this))},Ee.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Cr(this))},Ee.prototype.render=Ye,$t=[],Pi=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Oi=function(e,n){return e.__v.__b-n.__v.__b},Ue.__r=0,en=Math.random().toString(8),Oe="__d"+en,ce="__a"+en,Ei=/(PointerCapture)$|Capture$/i,Dn=0,wn=Sr(!1),kn=Sr(!0);function Mr(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r"u")){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",r==="top"&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var zc=`.float-tooltip-kap { - position: absolute; - width: max-content; /* prevent shrinking near right edge */ - max-width: max(50%, 150px); - padding: 3px 5px; - border-radius: 3px; - font: 12px sans-serif; - color: #eee; - background: rgba(0,0,0,0.6); - pointer-events: none; -} -`;Ec(zc);var Nc=jn({props:{content:{default:!1},offsetX:{triggerUpdate:!1},offsetY:{triggerUpdate:!1}},init:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=i.style,a=o===void 0?{}:o,s=!!n&&He(n)==="object"&&!!n.node&&typeof n.node=="function",u=pt(s?n.node():n);u.style("position")==="static"&&u.style("position","relative"),r.tooltipEl=u.append("div").attr("class","float-tooltip-kap"),Object.entries(a).forEach(function(l){var f=Ac(l,2),h=f[0],d=f[1];return r.tooltipEl.style(h,d)}),r.tooltipEl.style("left","-10000px").style("display","none");var c="tooltip-".concat(Math.round(Math.random()*1e12));r.mouseInside=!1,u.on("mousemove.".concat(c),function(l){r.mouseInside=!0;var f=xt(l),h=u.node(),d=h.offsetWidth,p=h.offsetHeight,y=[r.offsetX===null||r.offsetX===void 0?"-".concat(f[0]/d*100,"%"):typeof r.offsetX=="number"?"calc(-50% + ".concat(r.offsetX,"px)"):r.offsetX,r.offsetY===null||r.offsetY===void 0?p>130&&p-f[1]<100?"calc(-100% - 6px)":"21px":typeof r.offsetY=="number"?r.offsetY<0?"calc(-100% - ".concat(Math.abs(r.offsetY),"px)"):"".concat(r.offsetY,"px"):r.offsetY];r.tooltipEl.style("left",f[0]+"px").style("top",f[1]+"px").style("transform","translate(".concat(y.join(","),")")),r.content&&r.tooltipEl.style("display","inline")}),u.on("mouseover.".concat(c),function(){r.mouseInside=!0,r.content&&r.tooltipEl.style("display","inline")}),u.on("mouseout.".concat(c),function(){r.mouseInside=!1,r.tooltipEl.style("display","none")})},update:function(n){n.tooltipEl.style("display",n.content&&n.mouseInside?"inline":"none"),n.content?n.content instanceof HTMLElement?(n.tooltipEl.text(""),n.tooltipEl.append(function(){return n.content})):typeof n.content=="string"?n.tooltipEl.html(n.content):Pc(n.content)?(n.tooltipEl.text(""),Oc(n.content,n.tooltipEl.node())):(n.tooltipEl.style("display","none"),console.warn("Tooltip content is invalid, skipping.",n.content,n.content.toString())):n.tooltipEl.text("")}});function Rc(e,n,r){var i,o=1;e==null&&(e=0),n==null&&(n=0),r==null&&(r=0);function a(){var s,u=i.length,c,l=0,f=0,h=0;for(s=0;s=(c=(s+u)/2))?s=c:u=c,i=o,!(o=o[h=+f]))return i[h]=a,e;if(l=+e._x.call(null,o.data),n===l)return a.next=o,i?i[h]=a:e._root=a,e;do i=i?i[h]=new Array(2):e._root=new Array(2),(f=n>=(c=(s+u)/2))?s=c:u=c;while((h=+f)==(d=+(l>=c)));return i[d]=o,i[h]=a,e}function Dc(e){Array.isArray(e)||(e=Array.from(e));const n=e.length,r=new Float64Array(n);let i=1/0,o=-1/0;for(let a=0,s;ao&&(o=s));if(i>o)return this;this.cover(i).cover(o);for(let a=0;ae||e>=r;)switch(s=+(es||(a=l.x1)=h))&&(l=u[u.length-1],u[u.length-1]=u[u.length-1-f],u[u.length-1-f]=l)}else{var d=Math.abs(e-+this._x.call(null,c.data));d=(l=(s+u)/2))?s=l:u=l,n=r,!(r=r[h=+f]))return this;if(!r.length)break;n[h+1&1]&&(i=n,d=h)}for(;r.data!==e;)if(o=r,!(r=r.next))return this;return(a=r.next)&&delete r.next,o?(a?o.next=a:delete o.next,this):n?(a?n[h]=a:delete n[h],(r=n[0]||n[1])&&r===(n[1]||n[0])&&!r.length&&(i?i[d]=r:this._root=r),this):(this._root=a,this)}function Hc(e){for(var n=0,r=e.length;n=(h=(u+l)/2))?u=h:l=h,(v=r>=(d=(c+f)/2))?c=d:f=d,o=a,!(a=a[g=v<<1|m]))return o[g]=s,e;if(p=+e._x.call(null,a.data),y=+e._y.call(null,a.data),n===p&&r===y)return s.next=a,o?o[g]=s:e._root=s,e;do o=o?o[g]=new Array(4):e._root=new Array(4),(m=n>=(h=(u+l)/2))?u=h:l=h,(v=r>=(d=(c+f)/2))?c=d:f=d;while((g=v<<1|m)===(k=(y>=d)<<1|p>=h));return o[k]=a,o[g]=s,e}function Zc(e){var n,r,i=e.length,o,a,s=new Array(i),u=new Array(i),c=1/0,l=1/0,f=-1/0,h=-1/0;for(r=0;rf&&(f=o),ah&&(h=a));if(c>f||l>h)return this;for(this.cover(c,l).cover(f,h),r=0;re||e>=o||i>n||n>=a;)switch(l=(nf||(u=y.y0)>h||(c=y.x1)=g)<<1|e>=v)&&(y=d[d.length-1],d[d.length-1]=d[d.length-1-m],d[d.length-1-m]=y)}else{var k=e-+this._x.call(null,p.data),M=n-+this._y.call(null,p.data),b=k*k+M*M;if(b=(d=(s+c)/2))?s=d:c=d,(m=h>=(p=(u+l)/2))?u=p:l=p,n=r,!(r=r[v=m<<1|y]))return this;if(!r.length)break;(n[v+1&3]||n[v+2&3]||n[v+3&3])&&(i=n,g=v)}for(;r.data!==e;)if(o=r,!(r=r.next))return this;return(a=r.next)&&delete r.next,o?(a?o.next=a:delete o.next,this):n?(a?n[v]=a:delete n[v],(r=n[0]||n[1]||n[2]||n[3])&&r===(n[3]||n[2]||n[1]||n[0])&&!r.length&&(i?i[g]=r:this._root=r),this):(this._root=a,this)}function nf(e){for(var n=0,r=e.length;n=(y=(c+h)/2))?c=y:h=y,(_=r>=(m=(l+d)/2))?l=m:d=m,(w=i>=(v=(f+p)/2))?f=v:p=v,a=s,!(s=s[A=w<<2|_<<1|b]))return a[A]=u,e;if(g=+e._x.call(null,s.data),k=+e._y.call(null,s.data),M=+e._z.call(null,s.data),n===g&&r===k&&i===M)return u.next=s,a?a[A]=u:e._root=u,e;do a=a?a[A]=new Array(8):e._root=new Array(8),(b=n>=(y=(c+h)/2))?c=y:h=y,(_=r>=(m=(l+d)/2))?l=m:d=m,(w=i>=(v=(f+p)/2))?f=v:p=v;while((A=w<<2|_<<1|b)===(T=(M>=v)<<2|(k>=m)<<1|g>=y));return a[T]=s,a[A]=u,e}function df(e){Array.isArray(e)||(e=Array.from(e));const n=e.length,r=new Float64Array(n),i=new Float64Array(n),o=new Float64Array(n);let a=1/0,s=1/0,u=1/0,c=-1/0,l=-1/0,f=-1/0;for(let h=0,d,p,y,m;hc&&(c=p),yl&&(l=y),mf&&(f=m));if(a>c||s>l||u>f)return this;this.cover(a,s,u).cover(c,l,f);for(let h=0;he||e>=s||o>n||n>=u||a>r||r>=c;)switch(d=(ry||(l=M.y0)>m||(f=M.z0)>v||(h=M.x1)=A)<<2|(n>=w)<<1|e>=_)&&(M=g[g.length-1],g[g.length-1]=g[g.length-1-b],g[g.length-1-b]=M)}else{var T=e-+this._x.call(null,k.data),R=n-+this._y.call(null,k.data),P=r-+this._z.call(null,k.data),N=T*T+R*R+P*P;if(NMath.sqrt((e-i)**2+(n-o)**2+(r-a)**2);function mf(e,n,r,i){const o=[],a=e-i,s=n-i,u=r-i,c=e+i,l=n+i,f=r+i;return this.visit((h,d,p,y,m,v,g)=>{if(!h.length)do{const k=h.data;vf(e,n,r,this._x(k),this._y(k),this._z(k))<=i&&o.push(k)}while(h=h.next);return d>c||p>l||y>f||m=(m=(s+l)/2))?s=m:l=m,(M=p>=(v=(u+f)/2))?u=v:f=v,(b=y>=(g=(c+h)/2))?c=g:h=g,n=r,!(r=r[_=b<<2|M<<1|k]))return this;if(!r.length)break;(n[_+1&7]||n[_+2&7]||n[_+3&7]||n[_+4&7]||n[_+5&7]||n[_+6&7]||n[_+7&7])&&(i=n,w=_)}for(;r.data!==e;)if(o=r,!(r=r.next))return this;return(a=r.next)&&delete r.next,o?(a?o.next=a:delete o.next,this):n?(a?n[_]=a:delete n[_],(r=n[0]||n[1]||n[2]||n[3]||n[4]||n[5]||n[6]||n[7])&&r===(n[7]||n[6]||n[5]||n[4]||n[3]||n[2]||n[1]||n[0])&&!r.length&&(i?i[w]=r:this._root=r),this):(this._root=a,this)}function bf(e){for(var n=0,r=e.length;n1&&(R=A.y+A.vy-w.y-w.vy||Ot(f)),u>2&&(P=A.z+A.vz-w.z-w.vz||Ot(f)),N=Math.sqrt(T*T+R*R+P*P),N=(N-a[b])/N*g*i[b],T*=N,R*=N,P*=N,A.vx-=T*(D=l[b]),u>1&&(A.vy-=R*D),u>2&&(A.vz-=P*D),w.vx+=T*(D=1-D),u>1&&(w.vy+=R*D),u>2&&(w.vz+=P*D)}function y(){if(s){var g,k=s.length,M=e.length,b=new Map(s.map((w,A)=>[n(w,A,s),w])),_;for(g=0,c=new Array(k);gtypeof M=="function")||Math.random,u=k.find(M=>[1,2,3].includes(M))||2,y()},p.links=function(g){return arguments.length?(e=g,y(),p):e},p.id=function(g){return arguments.length?(n=g,p):n},p.iterations=function(g){return arguments.length?(h=+g,p):h},p.strength=function(g){return arguments.length?(r=typeof g=="function"?g:zt(+g),m(),p):r},p.distance=function(g){return arguments.length?(o=typeof g=="function"?g:zt(+g),v(),p):o},p}const Rf=1664525,jf=1013904223,Nr=4294967296;function Df(){let e=1;return()=>(e=(Rf*e+jf)%Nr)/Nr}var Rr=3;function nn(e){return e.x}function jr(e){return e.y}function If(e){return e.z}var $f=10,Lf=Math.PI*(3-Math.sqrt(5)),Ff=Math.PI*20/(9+Math.sqrt(221));function Uf(e,n){n=n||2;var r=Math.min(Rr,Math.max(1,Math.round(n))),i,o=1,a=.001,s=1-Math.pow(a,1/300),u=0,c=.6,l=new Map,f=En(p),h=ve("tick","end"),d=Df();e==null&&(e=[]);function p(){y(),h.call("tick",i),o1&&(b.fy==null?b.y+=b.vy*=c:(b.y=b.fy,b.vy=0)),r>2&&(b.fz==null?b.z+=b.vz*=c:(b.z=b.fz,b.vz=0));return i}function m(){for(var g=0,k=e.length,M;g1&&isNaN(M.y)||r>2&&isNaN(M.z)){var b=$f*(r>2?Math.cbrt(.5+g):r>1?Math.sqrt(.5+g):g),_=g*Lf,w=g*Ff;r===1?M.x=b:r===2?(M.x=b*Math.cos(_),M.y=b*Math.sin(_)):(M.x=b*Math.sin(_)*Math.cos(w),M.y=b*Math.cos(_),M.z=b*Math.sin(_)*Math.sin(w))}(isNaN(M.vx)||r>1&&isNaN(M.vy)||r>2&&isNaN(M.vz))&&(M.vx=0,r>1&&(M.vy=0),r>2&&(M.vz=0))}}function v(g){return g.initialize&&g.initialize(e,d,r),g}return m(),i={tick:y,restart:function(){return f.restart(p),i},stop:function(){return f.stop(),i},numDimensions:function(g){return arguments.length?(r=Math.min(Rr,Math.max(1,Math.round(g))),l.forEach(v),i):r},nodes:function(g){return arguments.length?(e=g,m(),l.forEach(v),i):e},alpha:function(g){return arguments.length?(o=+g,i):o},alphaMin:function(g){return arguments.length?(a=+g,i):a},alphaDecay:function(g){return arguments.length?(s=+g,i):+s},alphaTarget:function(g){return arguments.length?(u=+g,i):u},velocityDecay:function(g){return arguments.length?(c=1-g,i):1-c},randomSource:function(g){return arguments.length?(d=g,l.forEach(v),i):d},force:function(g,k){return arguments.length>1?(k==null?l.delete(g):l.set(g,v(k)),i):l.get(g)},find:function(){var g=Array.prototype.slice.call(arguments),k=g.shift()||0,M=(r>1?g.shift():null)||0,b=(r>2?g.shift():null)||0,_=g.shift()||1/0,w=0,A=e.length,T,R,P,N,D,U;for(_*=_,w=0;w1?(h.on(g,k),i):h.on(g)}}}function Hf(){var e,n,r,i,o,a=zt(-30),s,u=1,c=1/0,l=.81;function f(y){var m,v=e.length,g=(n===1?Ui(e,nn):n===2?Un(e,nn,jr):n===3?Wi(e,nn,jr,If):null).visitAfter(d);for(o=y,m=0;m1&&(y.y=b/k),n>2&&(y.z=_/k)}else{v=y,v.x=v.data.x,n>1&&(v.y=v.data.y),n>2&&(v.z=v.data.z);do m+=s[v.data.index];while(v=v.next)}y.value=m}function p(y,m,v,g,k){if(!y.value)return!0;var M=[v,g,k][n-1],b=y.x-r.x,_=n>1?y.y-r.y:0,w=n>2?y.z-r.z:0,A=M-m,T=b*b+_*_+w*w;if(A*A/l1&&_===0&&(_=Ot(i),T+=_*_),n>2&&w===0&&(w=Ot(i),T+=w*w),T1&&(r.vy+=_*y.value*o/T),n>2&&(r.vz+=w*y.value*o/T)),!0;if(y.length||T>=c)return;(y.data!==r||y.next)&&(b===0&&(b=Ot(i),T+=b*b),n>1&&_===0&&(_=Ot(i),T+=_*_),n>2&&w===0&&(w=Ot(i),T+=w*w),T1&&(r.vy+=_*A),n>2&&(r.vz+=w*A));while(y=y.next)}return f.initialize=function(y,...m){e=y,i=m.find(v=>typeof v=="function")||Math.random,n=m.find(v=>[1,2,3].includes(v))||2,h()},f.strength=function(y){return arguments.length?(a=typeof y=="function"?y:zt(+y),h(),f):a},f.distanceMin=function(y){return arguments.length?(u=y*y,f):Math.sqrt(u)},f.distanceMax=function(y){return arguments.length?(c=y*y,f):Math.sqrt(c)},f.theta=function(y){return arguments.length?(l=y*y,f):Math.sqrt(l)},f}function qf(e,n,r,i){var o,a,s=zt(.1),u,c;typeof e!="function"&&(e=zt(+e)),n==null&&(n=0),r==null&&(r=0),i==null&&(i=0);function l(h){for(var d=0,p=o.length;d1&&(y.vy+=v*M),a>2&&(y.vz+=g*M)}}function f(){if(o){var h,d=o.length;for(u=new Array(d),c=new Array(d),h=0;h[1,2,3].includes(p))||2,f()},l.strength=function(h){return arguments.length?(s=typeof h=="function"?h:zt(+h),f(),l):s},l.radius=function(h){return arguments.length?(e=typeof h=="function"?h:zt(+h),f(),l):e},l.x=function(h){return arguments.length?(n=+h,l):n},l.y=function(h){return arguments.length?(r=+h,l):r},l.z=function(h){return arguments.length?(i=+h,l):i},l}const{abs:ee,cos:Pt,sin:Wt,acos:Wf,atan2:ne,sqrt:Dt,pow:dt}=Math;function re(e){return e<0?-dt(-e,1/3):dt(e,1/3)}const Gi=Math.PI,Ce=2*Gi,It=Gi/2,Gf=1e-6,rn=Number.MAX_SAFE_INTEGER||9007199254740991,on=Number.MIN_SAFE_INTEGER||-9007199254740991,Vf={x:0,y:0,z:0},z={Tvalues:[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213],Cvalues:[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872],arcfn:function(e,n){const r=n(e);let i=r.x*r.x+r.y*r.y;return typeof r.z<"u"&&(i+=r.z*r.z),Dt(i)},compute:function(e,n,r){if(e===0)return n[0].t=0,n[0];const i=n.length-1;if(e===1)return n[i].t=1,n[i];const o=1-e;let a=n;if(i===0)return n[0].t=e,n[0];if(i===1){const u={x:o*a[0].x+e*a[1].x,y:o*a[0].y+e*a[1].y,t:e};return r&&(u.z=o*a[0].z+e*a[1].z),u}if(i<4){let u=o*o,c=e*e,l,f,h,d=0;i===2?(a=[a[0],a[1],a[2],Vf],l=u,f=o*e*2,h=c):i===3&&(l=u*o,f=u*e*3,h=o*c*3,d=e*c);const p={x:l*a[0].x+f*a[1].x+h*a[2].x+d*a[3].x,y:l*a[0].y+f*a[1].y+h*a[2].y+d*a[3].y,t:e};return r&&(p.z=l*a[0].z+f*a[1].z+h*a[2].z+d*a[3].z),p}const s=JSON.parse(JSON.stringify(n));for(;s.length>1;){for(let u=0;u1;o--,a--){const s=[];for(let u=0,c;u"u")e=.5;else if(e===0||e===1)return e;const r=dt(e,n)+dt(1-e,n),i=r-1;return ee(i/r)},projectionratio:function(e,n){if(n!==2&&n!==3)return!1;if(typeof e>"u")e=.5;else if(e===0||e===1)return e;const r=dt(1-e,n),i=dt(e,n)+r;return r/i},lli8:function(e,n,r,i,o,a,s,u){const c=(e*i-n*r)*(o-s)-(e-r)*(o*u-a*s),l=(e*i-n*r)*(a-u)-(n-i)*(o*u-a*s),f=(e-r)*(a-u)-(n-i)*(o-s);return f==0?!1:{x:c/f,y:l/f}},lli4:function(e,n,r,i){const o=e.x,a=e.y,s=n.x,u=n.y,c=r.x,l=r.y,f=i.x,h=i.y;return z.lli8(o,a,s,u,c,l,f,h)},lli:function(e,n){return z.lli4(e,e.c,n,n.c)},makeline:function(e,n){return new K(e.x,e.y,(e.x+n.x)/2,(e.y+n.y)/2,n.x,n.y)},findbbox:function(e){let n=rn,r=rn,i=on,o=on;return e.forEach(function(a){const s=a.bbox();n>s.x.min&&(n=s.x.min),r>s.y.min&&(r=s.y.min),i0&&(f.c1=c,f.c2=l,f.s1=e,f.s2=r,a.push(f))})}),a},makeshape:function(e,n,r){const i=n.points.length,o=e.points.length,a=z.makeline(n.points[i-1],e.points[0]),s=z.makeline(e.points[o-1],n.points[0]),u={startcap:a,forward:e,back:n,endcap:s,bbox:z.findbbox([a,e,n,s])};return u.intersections=function(c){return z.shapeintersections(u,u.bbox,c,c.bbox,r)},u},getminmax:function(e,n,r){if(!r)return{min:0,max:0};let i=rn,o=on,a,s;r.indexOf(0)===-1&&(r=[0].concat(r)),r.indexOf(1)===-1&&r.push(1);for(let u=0,c=r.length;uo&&(o=s[n]);return{min:i,mid:(i+o)/2,max:o,size:o-i}},align:function(e,n){const r=n.p1.x,i=n.p1.y,o=-ne(n.p2.y-i,n.p2.x-r),a=function(s){return{x:(s.x-r)*Pt(o)-(s.y-i)*Wt(o),y:(s.x-r)*Wt(o)+(s.y-i)*Pt(o)}};return e.map(a)},roots:function(e,n){n=n||{p1:{x:0,y:0},p2:{x:1,y:0}};const r=e.length-1,i=z.align(e,n),o=function(A){return 0<=A&&A<=1};if(r===2){const A=i[0].y,T=i[1].y,R=i[2].y,P=A-2*T+R;if(P!==0){const N=-Dt(T*T-A*R),D=-A+T,U=-(N+D)/P,S=-(-N+D)/P;return[U,S].filter(o)}else if(T!==R&&P===0)return[(2*T-R)/(2*T-2*R)].filter(o);return[]}const a=i[0].y,s=i[1].y,u=i[2].y,c=i[3].y;let l=-a+3*s-3*u+c,f=3*a-6*s+3*u,h=-3*a+3*s,d=a;if(z.approximately(l,0)){if(z.approximately(f,0))return z.approximately(h,0)?[]:[-d/h].filter(o);const A=Dt(h*h-4*f*d),T=2*f;return[(A-h)/T,(-h-A)/T].filter(o)}f/=l,h/=l,d/=l;const p=(3*h-f*f)/3,y=p/3,m=(2*f*f*f-9*f*h+27*d)/27,v=m/2,g=v*v+y*y*y;let k,M,b,_,w;if(g<0){const A=-p/3,T=A*A*A,R=Dt(T),P=-m/(2*R),N=P<-1?-1:P>1?1:P,D=Wf(N),U=re(R),S=2*U;return b=S*Pt(D/3)-f/3,_=S*Pt((D+Ce)/3)-f/3,w=S*Pt((D+2*Ce)/3)-f/3,[b,_,w].filter(o)}else{if(g===0)return k=v<0?re(-v):-re(v),b=2*k-f/3,_=-k-f/3,[b,_].filter(o);{const A=Dt(g);return k=re(-v+A),M=re(v+A),[k-M-f/3].filter(o)}}},droots:function(e){if(e.length===3){const n=e[0],r=e[1],i=e[2],o=n-2*r+i;if(o!==0){const a=-Dt(r*r-n*i),s=-n+r,u=-(a+s)/o,c=-(-a+s)/o;return[u,c]}else if(r!==i&&o===0)return[(2*r-i)/(2*(r-i))];return[]}if(e.length===2){const n=e[0],r=e[1];return n!==r?[n/(n-r)]:[]}return[]},curvature:function(e,n,r,i,o){let a,s,u,c,l=0,f=0;const h=z.compute(e,n),d=z.compute(e,r),p=h.x*h.x+h.y*h.y;if(i?(a=Dt(dt(h.y*d.z-d.y*h.z,2)+dt(h.z*d.x-d.z*h.x,2)+dt(h.x*d.y-d.x*h.y,2)),s=dt(p+h.z*h.z,3/2)):(a=h.x*d.y-h.y*d.x,s=dt(p,3/2)),a===0||s===0)return{k:0,r:0};if(l=a/s,f=s/a,!o){const y=z.curvature(e-.001,n,r,i,!0).k,m=z.curvature(e+.001,n,r,i,!0).k;c=(m-l+(l-y))/2,u=(ee(m-l)+ee(l-y))/2}return{k:l,r:f,dk:c,adk:u}},inflections:function(e){if(e.length<4)return[];const n=z.align(e,{p1:e[0],p2:e.slice(-1)[0]}),r=n[2].x*n[1].y,i=n[3].x*n[1].y,o=n[1].x*n[2].y,a=n[3].x*n[2].y,s=18*(-3*r+2*i+3*o-a),u=18*(3*r-i-3*o),c=18*(o-r);if(z.approximately(s,0)){if(!z.approximately(u,0)){let d=-c/u;if(0<=d&&d<=1)return[d]}return[]}const l=2*s;if(z.approximately(l,0))return[];const f=u*u-4*s*c;if(f<0)return[];const h=Math.sqrt(f);return[(h-u)/l,-(u+h)/l].filter(function(d){return 0<=d&&d<=1})},bboxoverlap:function(e,n){const r=["x","y"],i=r.length;for(let o=0,a,s,u,c;o=c)return!1;return!0},expandbox:function(e,n){n.x.mine.x.max&&(e.x.max=n.x.max),n.y.max>e.y.max&&(e.y.max=n.y.max),n.z&&n.z.max>e.z.max&&(e.z.max=n.z.max),e.x.mid=(e.x.min+e.x.max)/2,e.y.mid=(e.y.min+e.y.max)/2,e.z&&(e.z.mid=(e.z.min+e.z.max)/2),e.x.size=e.x.max-e.x.min,e.y.size=e.y.max-e.y.min,e.z&&(e.z.size=e.z.max-e.z.min)},pairiteration:function(e,n,r){const i=e.bbox(),o=n.bbox(),a=1e5,s=r||.5;if(i.x.size+i.y.sizew||w>A)&&(_+=Ce),_>A&&(T=A,A=_,_=T)):A4){if(arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");o=!0}}else if(a!==6&&a!==8&&a!==9&&a!==12&&arguments.length!==1)throw new Error("Only new Bezier(point[]) is accepted for 4th and higher order curves");const s=this._3d=!o&&(a===9||a===12)||n&&n[0]&&typeof n[0].z<"u",u=this.points=[];for(let p=0,y=s?3:2;pp+ie(y.y),0)"u"&&(o=.5),o===0)return new K(r,r,i);if(o===1)return new K(n,r,r);const a=K.getABC(2,n,r,i,o);return new K(n,a.A,i)}static cubicFromPoints(n,r,i,o,a){typeof o>"u"&&(o=.5);const s=K.getABC(3,n,r,i,o);typeof a>"u"&&(a=z.dist(r,s.C));const u=a*(1-o)/o,c=z.dist(n,i),l=(i.x-n.x)/c,f=(i.y-n.y)/c,h=a*l,d=a*f,p=u*l,y=u*f,m={x:r.x-h,y:r.y-d},v={x:r.x+p,y:r.y+y},g=s.A,k={x:g.x+(m.x-g.x)/(1-o),y:g.y+(m.y-g.y)/(1-o)},M={x:g.x+(v.x-g.x)/o,y:g.y+(v.y-g.y)/o},b={x:n.x+(k.x-n.x)/o,y:n.y+(k.y-n.y)/o},_={x:i.x+(M.x-i.x)/(1-o),y:i.y+(M.y-i.y)/(1-o)};return new K(n,b,_,i)}static getUtils(){return z}getUtils(){return K.getUtils()}static get PolyBezier(){return he}valueOf(){return this.toString()}toString(){return z.pointsToString(this.points)}toSVG(){if(this._3d)return!1;const n=this.points,r=n[0].x,i=n[0].y,o=["M",r,i,this.order===2?"Q":"C"];for(let a=1,s=n.length;a0}length(){return z.length(this.derivative.bind(this))}static getABC(n=2,r,i,o,a=.5){const s=z.projectionratio(a,n),u=1-s,c={x:s*r.x+u*o.x,y:s*r.y+u*o.y},l=z.abcratio(a,n);return{A:{x:i.x+(i.x-c.x)/l,y:i.y+(i.y-c.y)/l},B:i,C:c,S:r,E:o}}getABC(n,r){r=r||this.get(n);let i=this.points[0],o=this.points[this.order];return K.getABC(this.order,i,r,o,n)}getLUT(n){if(this.verify(),n=n||100,this._lut.length===n+1)return this._lut;this._lut=[],n++,this._lut=[];for(let r=0,i,o;r1?1:h,d=this.compute(h),d.t=h,d.d=l,d}get(n){return this.compute(n)}point(n){return this.points[n]}compute(n){return this.ratios?z.computeWithRatios(n,this.points,this.ratios,this._3d):z.compute(n,this.points,this._3d,this.ratios)}raise(){const n=this.points,r=[n[0]],i=n.length;for(let o=1,a,s;o1;){i=[];for(let s=0,u,c=r.length-1;s=0&&s<=1}),r=r.concat(n[i].sort(z.numberSort))}).bind(this)),n.values=r.sort(z.numberSort).filter(function(i,o){return r.indexOf(i)===o}),n}bbox(){const n=this.extrema(),r={};return this.dims.forEach((function(i){r[i]=z.getminmax(this,i,n[i])}).bind(this)),r}overlaps(n){const r=this.bbox(),i=n.bbox();return z.bboxoverlap(r,i)}offset(n,r){if(typeof r<"u"){const i=this.get(n),o=this.normal(n),a={c:i,n:o,x:i.x+o.x*r,y:i.y+o.y*r};return this._3d&&(a.z=i.z+o.z*r),a}if(this._linear){const i=this.normal(0),o=this.points.map(function(a){const s={x:a.x+n*i.x,y:a.y+n*i.y};return a.z&&i.z&&(s.z=a.z+n*i.z),s});return[new K(o)]}return this.reduce().map(function(i){return i._linear?i.offset(n)[0]:i.scale(n)})}simple(){if(this.order===3){const o=z.angle(this.points[0],this.points[3],this.points[1]),a=z.angle(this.points[0],this.points[3],this.points[2]);if(o>0&&a<0||o<0&&a>0)return!1}const n=this.normal(0),r=this.normal(1);let i=n.x*r.x+n.y*r.y;return this._3d&&(i+=n.z*r.z),ie(Yf(i))(1-u/o)*r+u/o*i);return new K(this.points.map((s,u)=>({x:s.x+n.x*a[u],y:s.y+n.y*a[u]})))}scale(n){const r=this.order;let i=!1;if(typeof n=="function"&&(i=n),i&&r===2)return this.raise().scale(i);const o=this.clockwise,a=this.points;if(this._linear)return this.translate(this.normal(0),i?i(0):n,i?i(1):n);const s=i?i(0):n,u=i?i(1):n,c=[this.offset(0,10),this.offset(1,10)],l=[],f=z.lli4(c[0],c[0].c,c[1],c[1].c);if(!f)throw new Error("cannot scale this curve. Try reducing it first.");return[0,1].forEach(function(h){const d=l[h*r]=z.copy(a[h*r]);d.x+=(h?u:s)*c[h].n.x,d.y+=(h?u:s)*c[h].n.y}),i?([0,1].forEach(function(h){if(!(r===2&&h)){var d=a[h+1],p={x:d.x-f.x,y:d.y-f.y},y=i?i((h+1)/r):n;i&&!o&&(y=-y);var m=oe(p.x*p.x+p.y*p.y);p.x/=m,p.y/=m,l[h+1]={x:d.x+y*p.x,y:d.y+y*p.y}}}),new K(l)):([0,1].forEach(h=>{if(r===2&&h)return;const d=l[h*r],p=this.derivative(h),y={x:d.x+p.x,y:d.y+p.y};l[h+1]=z.lli4(d,y,f,a[h+1])}),new K(l))}outline(n,r,i,o){if(r=r===void 0?n:r,this._linear){const _=this.normal(0),w=this.points[0],A=this.points[this.points.length-1];let T,R,P;i===void 0&&(i=n,o=r),T={x:w.x+_.x*n,y:w.y+_.y*n},P={x:A.x+_.x*i,y:A.y+_.y*i},R={x:(T.x+P.x)/2,y:(T.y+P.y)/2};const N=[T,R,P];T={x:w.x-_.x*r,y:w.y-_.y*r},P={x:A.x-_.x*o,y:A.y-_.y*o},R={x:(T.x+P.x)/2,y:(T.y+P.y)/2};const D=[P,R,T],U=z.makeline(D[2],N[0]),S=z.makeline(N[2],D[0]),j=[U,new K(N),S,new K(D)];return new he(j)}const a=this.reduce(),s=a.length,u=[];let c=[],l,f=0,h=this.length();const d=typeof i<"u"&&typeof o<"u";function p(_,w,A,T,R){return function(P){const N=T/A,D=(T+R)/A,U=w-_;return z.map(P,0,1,_+N*U,_+D*U)}}a.forEach(function(_){const w=_.length();d?(u.push(_.scale(p(n,i,h,f,w))),c.push(_.scale(p(-r,-o,h,f,w)))):(u.push(_.scale(n)),c.push(_.scale(-r))),f+=w}),c=c.map(function(_){return l=_.points,l[3]?_.points=[l[3],l[2],l[1],l[0]]:_.points=[l[2],l[1],l[0]],_}).reverse();const y=u[0].points[0],m=u[s-1].points[u[s-1].points.length-1],v=c[s-1].points[c[s-1].points.length-1],g=c[0].points[0],k=z.makeline(v,y),M=z.makeline(m,g),b=[k].concat(u).concat([M]).concat(c);return new he(b)}outlineshapes(n,r,i){r=r||n;const o=this.outline(n,r).curves,a=[];for(let s=1,u=o.length;s1,c.endcap.virtual=s{var u=this.get(s);return z.between(u.x,r,o)&&z.between(u.y,i,a)})}selfintersects(n){const r=this.reduce(),i=r.length-2,o=[];for(let a=0,s,u,c;a0&&(a=a.concat(u))}),a}arcs(n){return n=n||.5,this._iterate(n,[])}_error(n,r,i,o){const a=(o-i)/4,s=this.get(i+a),u=this.get(o-a),c=z.dist(n,r),l=z.dist(n,s),f=z.dist(n,u);return ie(l-c)+ie(f-c)}_iterate(n,r){let i=0,o=1,a;do{a=0,o=1;let s=this.get(i),u,c,l,f,h=!1,d=!1,p,y=o,m=1;do if(d=h,f=l,y=(i+o)/2,u=this.get(y),c=this.get(o),l=z.getccenter(s,u,c),l.interval={start:i,end:o},h=this._error(l,s,i,o)<=n,p=d&&!h,p||(m=o),h){if(o>=1){if(l.interval.end=m=1,f=l,o>1){let g={x:l.x+l.r*Bf(l.e),y:l.y+l.r*Xf(l.e)};l.e+=z.angle({x:l.x,y:l.y},g,this.get(1))}break}o=o+(o-i)/2}else o=y;while(!p&&a++<100);if(a>=100)break;f=f||l,r.push(f),i=m}while(o<1);return r}}function An(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,o=(n instanceof Array?n.length?n:[void 0]:[n]).map(function(u){return{keyAccessor:u,isProp:!(u instanceof Function)}}),a=e.reduce(function(u,c){var l=u,f=c;return o.forEach(function(h,d){var p=h.keyAccessor,y=h.isProp,m;if(y){var v=f,g=v[p],k=rh(v,[p].map(uh));m=g,f=k}else m=p(f,d);d+11&&arguments[1]!==void 0?arguments[1]:1;l===o.length?Object.keys(c).forEach(function(f){return c[f]=r(c[f])}):Object.values(c).forEach(function(f){return u(f,l+1)})})(a);var s=a;return i&&(s=[],(function u(c){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];l.length===o.length?s.push({keys:l,vals:c}):Object.entries(c).forEach(function(f){var h=oh(f,2),d=h[0],p=h[1];return u(p,[].concat(ah(l),[d]))})})(a),n instanceof Array&&n.length===0&&s.length===1&&(s[0].keys=[])),s});function ch(e){for(var n=e.length/6|0,r=new Array(n),i=0;i"u")){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",r==="top"&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}var dh=`.force-graph-container canvas { - display: block; - user-select: none; - outline: none; - -webkit-tap-highlight-color: transparent; -} - -.force-graph-container .clickable { - cursor: pointer; -} - -.force-graph-container .grabbable { - cursor: move; - cursor: grab; - cursor: -moz-grab; - cursor: -webkit-grab; -} - -.force-graph-container .grabbable:active { - cursor: grabbing; - cursor: -moz-grabbing; - cursor: -webkit-grabbing; -} -`;hh(dh);function Sn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r2&&arguments[2]!==void 0?arguments[2]:{},a=o.nodeFilter,s=a===void 0?function(){return!0}:a,u=o.onLoopError,c=u===void 0?function(p){throw"Invalid DAG structure! Found cycle in node path: ".concat(p.join(" -> "),".")}:u,l={};r.forEach(function(p){return l[n(p)]={data:p,out:[],depth:-1,skip:!s(p)}}),i.forEach(function(p){var y=p.source,m=p.target,v=b(y),g=b(m);if(!l.hasOwnProperty(v))throw"Missing source node with id: ".concat(v);if(!l.hasOwnProperty(g))throw"Missing target node with id: ".concat(g);var k=l[v],M=l[g];k.out.push(M);function b(_){return Mn(_)==="object"?n(_):_}});var f=[];d(Object.values(l));var h=Object.assign.apply(Object,[{}].concat(gt(Object.entries(l).filter(function(p){var y=de(p,2),m=y[1];return!m.skip}).map(function(p){var y=de(p,2),m=y[0],v=y[1];return ye({},m,v.depth)}))));return h;function d(p){for(var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,v=function(){var b=p[g];if(y.indexOf(b)!==-1){var _=[].concat(gt(y.slice(y.indexOf(b))),[b]).map(function(w){return n(w.data)});return f.some(function(w){return w.length===_.length&&w.every(function(A,T){return A===_[T]})})||(f.push(_),c(_)),1}m>b.depth&&(b.depth=m,d(b.out,[].concat(gt(y),[b]),m+(b.skip?0:1)))},g=0,k=p.length;gn.cooldownTicks||new Date-n.startTickTime>n.cooldownTime||n.d3AlphaMin>0&&n.forceLayout.alpha()0){var D=Math.atan2(P.y-R.y,P.x-R.x),U=N*T,S={x:(R.x+P.x)/2+U*Math.cos(D-Math.PI/2),y:(R.y+P.y)/2+U*Math.sin(D-Math.PI/2)};A.__controlPoints=[S.x,S.y]}else{var j=T*70;A.__controlPoints=[P.x,P.y-j,P.x+j,P.y]}}}}function a(){var u=1.6,c=.2,l=B(n.linkDirectionalArrowLength),f=B(n.linkDirectionalArrowRelPos),h=B(n.linkVisibility),d=B(n.linkDirectionalArrowColor||n.linkColor),p=B(n.nodeVal),y=n.ctx;y.save(),n.graphData.links.filter(h).forEach(function(m){var v=l(m);if(!(!v||v<0)){var g=m.source,k=m.target;if(!(!g||!k||!g.hasOwnProperty("x")||!k.hasOwnProperty("x"))){var M=Math.sqrt(Math.max(0,p(g)||1))*n.nodeRelSize,b=Math.sqrt(Math.max(0,p(k)||1))*n.nodeRelSize,_=Math.min(1,Math.max(0,f(m))),w=d(m)||"rgba(0,0,0,0.28)",A=v/u/2,T=m.__controlPoints&&$r(K,[g.x,g.y].concat(gt(m.__controlPoints),[k.x,k.y])),R=T?function(E){return T.get(E)}:function(E){return{x:g.x+(k.x-g.x)*E||0,y:g.y+(k.y-g.y)*E||0}},P=T?T.length():Math.sqrt(Math.pow(k.x-g.x,2)+Math.pow(k.y-g.y,2)),N=M+v+(P-M-b-v)*_,D=R(N/P),U=R((N-v)/P),S=R((N-v*(1-c))/P),j=Math.atan2(D.y-U.y,D.x-U.x)-Math.PI/2;y.beginPath(),y.moveTo(D.x,D.y),y.lineTo(U.x+A*Math.cos(j),U.y+A*Math.sin(j)),y.lineTo(S.x,S.y),y.lineTo(U.x-A*Math.cos(j),U.y-A*Math.sin(j)),y.fillStyle=w,y.fill()}}}),y.restore()}function s(){var u=B(n.linkDirectionalParticles),c=B(n.linkDirectionalParticleSpeed),l=B(n.linkDirectionalParticleOffset),f=B(n.linkDirectionalParticleWidth),h=B(n.linkVisibility),d=B(n.linkDirectionalParticleColor||n.linkColor),p=n.ctx;p.save(),n.graphData.links.filter(h).forEach(function(y){var m=u(y);if(!(!y.hasOwnProperty("__photons")||!y.__photons.length)){var v=y.source,g=y.target;if(!(!v||!g||!v.hasOwnProperty("x")||!g.hasOwnProperty("x"))){var k=c(y),M=Math.abs(l(y)),b=y.__photons||[],_=Math.max(0,f(y)/2)/Math.sqrt(n.globalScale),w=d(y)||"rgba(0,0,0,0.28)";p.fillStyle=w;var A=y.__controlPoints?$r(K,[v.x,v.y].concat(gt(y.__controlPoints),[g.x,g.y])):null,T=0,R=!1;b.forEach(function(P){var N=!!P.__singleHop;if(P.hasOwnProperty("__progressRatio")||(P.__progressRatio=N?k<0?1:0:(T+M)/m),!N&&T++,P.__progressRatio+=k,P.__progressRatio>=1||P.__progressRatio<0)if(!N)P.__progressRatio=P.__progressRatio%1,P.__progressRatio<0&&P.__progressRatio++;else{R=!0;return}var D=P.__progressRatio,U=A?A.get(D):{x:v.x+(g.x-v.x)*D||0,y:v.y+(g.y-v.y)*D||0};n.linkDirectionalParticleCanvasObject?n.linkDirectionalParticleCanvasObject(U.x,U.y,y,p,n.globalScale):(p.beginPath(),p.arc(U.x,U.y,_,0,2*Math.PI,!1),p.fill())}),R&&(y.__photons=y.__photons.filter(function(P){return!P.__singleHop||P.__progressRatio<=1&&P.__progressRatio>=0}))}}}),p.restore()}},emitParticle:function(n,r){return r&&(!r.__photons&&(r.__photons=[]),r.__photons.push({__singleHop:!0})),this}},stateInit:function(){return{forceLayout:Uf().force("link",Nf()).force("charge",Hf()).force("center",Rc()).force("dagRadial",null).stop(),engineRunning:!1}},init:function(n,r){r.ctx=n},update:function(n,r){n.engineRunning=!1,n.onUpdate(),n.nodeAutoColorBy!==null&&Fr(n.graphData.nodes,B(n.nodeAutoColorBy),n.nodeColor),n.linkAutoColorBy!==null&&Fr(n.graphData.links,B(n.linkAutoColorBy),n.linkColor),n.graphData.links.forEach(function(d){d.source=d[n.linkSource],d.target=d[n.linkTarget]}),n.forceLayout.stop().alpha(1).nodes(n.graphData.nodes);var i=n.forceLayout.force("link");i&&i.id(function(d){return d[n.nodeId]}).links(n.graphData.links);var o=n.dagMode&&kh(n.graphData,function(d){return d[n.nodeId]},{nodeFilter:n.dagNodeFilter,onLoopError:n.onDagError||void 0}),a=Math.max.apply(Math,gt(Object.values(o||[]))),s=n.dagLevelDistance||n.graphData.nodes.length/(a||1)*Ch*(["radialin","radialout"].indexOf(n.dagMode)!==-1?.7:1);if(["lr","rl","td","bu"].includes(r.dagMode)){var u=["lr","rl"].includes(r.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(d){return delete d[u]})}if(["lr","rl","td","bu"].includes(n.dagMode)){var c=["rl","bu"].includes(n.dagMode),l=function(p){return(o[p[n.nodeId]]-a/2)*s*(c?-1:1)},f=["lr","rl"].includes(n.dagMode)?"fx":"fy";n.graphData.nodes.filter(n.dagNodeFilter).forEach(function(d){return d[f]=l(d)})}n.forceLayout.force("dagRadial",["radialin","radialout"].indexOf(n.dagMode)!==-1?qf(function(d){var p=o[d[n.nodeId]]||-1;return(n.dagMode==="radialin"?a-p:p)*s}).strength(function(d){return n.dagNodeFilter(d)?1:0}):null);for(var h=0;h0&&n.forceLayout.alpha()1?u-1:0),l=1;l1&&arguments[1]!==void 0?arguments[1]:0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:10,o=arguments.length,a=new Array(o>3?o-3:0),s=3;s1&&arguments[1]!==void 0?arguments[1]:function(){return!0},i=B(n.nodeVal),o=function(u){return Math.sqrt(Math.max(0,i(u)||1))*n.nodeRelSize},a=n.graphData.nodes.filter(r).map(function(s){return{x:s.x,y:s.y,r:o(s)}});return a.length?{x:[Zn(a,function(s){return s.x-s.r}),Kn(a,function(s){return s.x+s.r})],y:[Zn(a,function(s){return s.y-s.r}),Kn(a,function(s){return s.y+s.r})]}:null},pauseAnimation:function(n){return n.animationFrameRequestId&&(cancelAnimationFrame(n.animationFrameRequestId),n.animationFrameRequestId=null),this},resumeAnimation:function(n){return n.animationFrameRequestId||this._animationCycle(),this},_destructor:function(){this.pauseAnimation(),this.graphData({nodes:[],links:[]})}},Oh),stateInit:function(){return{lastSetZoom:1,zoom:Gu(),forceGraph:new qe,shadowGraph:new qe().cooldownTicks(0).nodeColor("__indexColor").linkColor("__indexColor").isShadow(!0),colorTracker:new fc,tweenGroup:new bi}},init:function(n,r){var i=this;n.innerHTML="";var o=document.createElement("div");o.classList.add("force-graph-container"),o.style.position="relative",n.appendChild(o),r.canvas=document.createElement("canvas"),r.backgroundColor&&(r.canvas.style.background=r.backgroundColor),o.appendChild(r.canvas),r.shadowCanvas=document.createElement("canvas");var a=r.canvas.getContext("2d"),s=r.shadowCanvas.getContext("2d",{willReadFrequently:!0}),u={x:-1e12,y:-1e12},c=function(){var h=null,d=window.devicePixelRatio,p=u.x>0&&u.y>0?s.getImageData(u.x*d,u.y*d,1,1):null;return p&&(h=r.colorTracker.lookup(p.data)),h};pt(r.canvas).call(Ms().subject(function(){if(!r.enableNodeDrag)return null;var f=c();return f&&f.type==="Node"?f.d:null}).on("start",function(f){var h=f.subject;h.__initialDragPos={x:h.x,y:h.y,fx:h.fx,fy:h.fy},f.active||(h.fx=h.x,h.fy=h.y),r.canvas.classList.add("grabbable")}).on("drag",function(f){var h=f.subject,d=h.__initialDragPos,p=f,y=mt(r.canvas).k,m={x:d.x+(p.x-d.x)/y-h.x,y:d.y+(p.y-d.y)/y-h.y};["x","y"].forEach(function(v){return h["f".concat(v)]=h[v]=d[v]+(p[v]-d[v])/y}),!(!h.__dragged&&Mh>=Math.sqrt(mo(["x","y"].map(function(v){return Math.pow(f[v]-d[v],2)}))))&&(r.forceGraph.d3AlphaTarget(.3).resetCountdown(),r.isPointerDragging=!0,h.__dragged=!0,r.onNodeDrag(h,m))}).on("end",function(f){var h=f.subject,d=h.__initialDragPos,p={x:h.x-d.x,y:h.y-d.y};d.fx===void 0&&(h.fx=void 0),d.fy===void 0&&(h.fy=void 0),delete h.__initialDragPos,r.forceGraph.d3AlphaTarget()&&r.forceGraph.d3AlphaTarget(0).resetCountdown(),r.canvas.classList.remove("grabbable"),r.isPointerDragging=!1,h.__dragged&&(delete h.__dragged,r.onNodeDragEnd(h,p))})),r.zoom(r.zoom.__baseElem=pt(r.canvas)),r.zoom.__baseElem.on("dblclick.zoom",null),r.zoom.filter(function(f){return!f.button&&r.enableZoomPanInteraction&&(f.type!=="wheel"||B(r.enableZoomInteraction)(f))&&(f.type==="wheel"||B(r.enablePanInteraction)(f))}).on("zoom",function(f){var h=f.transform;[a,s].forEach(function(d){Ki(d),d.translate(h.x,h.y),d.scale(h.k,h.k)}),r.isPointerDragging=!0,r.onZoom&&r.onZoom(Gt(Gt({},h),i.centerAt())),r.needsRedraw=!0}).on("end",function(f){r.isPointerDragging=!1,r.onZoomEnd&&r.onZoomEnd(Gt(Gt({},f.transform),i.centerAt()))}),an(r),r.forceGraph.onNeedsRedraw(function(){return r.needsRedraw=!0}).onFinishUpdate(function(){mt(r.canvas).k===r.lastSetZoom&&r.graphData.nodes.length&&(r.zoom.scaleTo(r.zoom.__baseElem,r.lastSetZoom=Sh/Math.cbrt(r.graphData.nodes.length)),r.needsRedraw=!0)}),r.tooltip=new Nc(o),["pointermove","pointerdown"].forEach(function(f){return o.addEventListener(f,function(h){f==="pointerdown"&&(r.isPointerPressed=!0,r.pointerDownEvent=h),!r.isPointerDragging&&h.type==="pointermove"&&r.onBackgroundClick&&(h.pressure>0||r.isPointerPressed)&&(h.pointerType==="mouse"||h.movementX===void 0||[h.movementX,h.movementY].some(function(y){return Math.abs(y)>1}))&&(r.isPointerDragging=!0);var d=p(o);u.x=h.pageX-d.left,u.y=h.pageY-d.top;function p(y){var m=y.getBoundingClientRect(),v=window.pageXOffset||document.documentElement.scrollLeft,g=window.pageYOffset||document.documentElement.scrollTop;return{top:m.top+g,left:m.left+v}}},{passive:!0})}),o.addEventListener("pointerup",function(f){if(r.isPointerPressed){if(r.isPointerPressed=!1,r.isPointerDragging){r.isPointerDragging=!1;return}var h=[f,r.pointerDownEvent];requestAnimationFrame(function(){if(f.button===0)if(r.hoverObj){var d=r["on".concat(r.hoverObj.type,"Click")];d&&d.apply(void 0,[r.hoverObj.d].concat(h))}else r.onBackgroundClick&&r.onBackgroundClick.apply(r,h);if(f.button===2)if(r.hoverObj){var p=r["on".concat(r.hoverObj.type,"RightClick")];p&&p.apply(void 0,[r.hoverObj.d].concat(h))}else r.onBackgroundRightClick&&r.onBackgroundRightClick.apply(r,h)})}},{passive:!0}),o.addEventListener("contextmenu",function(f){return!r.onBackgroundRightClick&&!r.onNodeRightClick&&!r.onLinkRightClick?!0:(f.preventDefault(),!1)}),r.forceGraph(a),r.shadowGraph(s);var l=vl(function(){Hr(s,r.width,r.height),r.shadowGraph.linkWidth(function(h){return B(r.linkWidth)(h)+r.linkHoverPrecision});var f=mt(r.canvas);r.shadowGraph.globalScale(f.k).tickFrame()},Ah);r.flushShadowCanvas=l.flush,(this._animationCycle=function f(){var h=!r.autoPauseRedraw||!!r.needsRedraw||r.forceGraph.isEngineRunning()||r.graphData.links.some(function(M){return M.__photons&&M.__photons.length});if(r.needsRedraw=!1,r.enablePointerInteraction){var d=r.isPointerDragging?null:c();if(d!==r.hoverObj){var p=r.hoverObj,y=p?p.type:null,m=d?d.type:null;if(y&&y!==m){var v=r["on".concat(y,"Hover")];v&&v(null,p.d)}if(m){var g=r["on".concat(m,"Hover")];g&&g(d.d,y===m?p.d:null)}r.tooltip.content(d&&B(r["".concat(d.type.toLowerCase(),"Label")])(d.d)||null),r.canvas.classList[(d&&r["on".concat(m,"Click")]||!d&&r.onBackgroundClick)&&B(r.showPointerCursor)(d==null?void 0:d.d)?"add":"remove"]("clickable"),r.hoverObj=d}h&&l()}if(h){Hr(a,r.width,r.height);var k=mt(r.canvas).k;r.onRenderFramePre&&r.onRenderFramePre(a,k),r.forceGraph.globalScale(k).tickFrame(),r.onRenderFramePost&&r.onRenderFramePost(a,k)}r.tweenGroup.update(),r.animationFrameRequestId=requestAnimationFrame(f)})()},update:function(n){}}),sn={exports:{}},un,qr;function zh(){if(qr)return un;qr=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return un=e,un}var ln,Wr;function Nh(){if(Wr)return ln;Wr=1;var e=zh();function n(){}function r(){}return r.resetWarningCache=n,ln=function(){function i(s,u,c,l,f,h){if(h!==e){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}i.isRequired=i;function o(){return i}var a={array:i,bigint:i,bool:i,func:i,number:i,object:i,string:i,symbol:i,any:i,arrayOf:o,element:i,elementType:i,instanceOf:o,node:i,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:n};return a.PropTypes=a,a},ln}var Gr;function Rh(){return Gr||(Gr=1,sn.exports=Nh()()),sn.exports}var jh=Rh();const x=io(jh),Ze={width:x.number,height:x.number,graphData:x.shape({nodes:x.arrayOf(x.object).isRequired,links:x.arrayOf(x.object).isRequired}),backgroundColor:x.string,nodeRelSize:x.number,nodeId:x.string,nodeLabel:x.oneOfType([x.string,x.func]),nodeVal:x.oneOfType([x.number,x.string,x.func]),nodeVisibility:x.oneOfType([x.bool,x.string,x.func]),nodeColor:x.oneOfType([x.string,x.func]),nodeAutoColorBy:x.oneOfType([x.string,x.func]),onNodeHover:x.func,onNodeClick:x.func,linkSource:x.string,linkTarget:x.string,linkLabel:x.oneOfType([x.string,x.func]),linkVisibility:x.oneOfType([x.bool,x.string,x.func]),linkColor:x.oneOfType([x.string,x.func]),linkAutoColorBy:x.oneOfType([x.string,x.func]),linkWidth:x.oneOfType([x.number,x.string,x.func]),linkCurvature:x.oneOfType([x.number,x.string,x.func]),linkDirectionalArrowLength:x.oneOfType([x.number,x.string,x.func]),linkDirectionalArrowColor:x.oneOfType([x.string,x.func]),linkDirectionalArrowRelPos:x.oneOfType([x.number,x.string,x.func]),linkDirectionalParticles:x.oneOfType([x.number,x.string,x.func]),linkDirectionalParticleSpeed:x.oneOfType([x.number,x.string,x.func]),linkDirectionalParticleOffset:x.oneOfType([x.number,x.string,x.func]),linkDirectionalParticleWidth:x.oneOfType([x.number,x.string,x.func]),linkDirectionalParticleColor:x.oneOfType([x.string,x.func]),onLinkHover:x.func,onLinkClick:x.func,dagMode:x.oneOf(["td","bu","lr","rl","zin","zout","radialin","radialout"]),dagLevelDistance:x.number,dagNodeFilter:x.func,onDagError:x.func,d3AlphaMin:x.number,d3AlphaDecay:x.number,d3VelocityDecay:x.number,warmupTicks:x.number,cooldownTicks:x.number,cooldownTime:x.number,onEngineTick:x.func,onEngineStop:x.func,getGraphBbox:x.func},Qi={zoomToFit:x.func,onNodeRightClick:x.func,onNodeDrag:x.func,onNodeDragEnd:x.func,onLinkRightClick:x.func,linkHoverPrecision:x.number,onBackgroundClick:x.func,onBackgroundRightClick:x.func,showPointerCursor:x.oneOfType([x.bool,x.func]),enablePointerInteraction:x.bool,enableNodeDrag:x.bool},Wn={showNavInfo:x.bool,nodeOpacity:x.number,nodeResolution:x.number,nodeThreeObject:x.oneOfType([x.object,x.string,x.func]),nodeThreeObjectExtend:x.oneOfType([x.bool,x.string,x.func]),nodePositionUpdate:x.func,linkOpacity:x.number,linkResolution:x.number,linkCurveRotation:x.oneOfType([x.number,x.string,x.func]),linkMaterial:x.oneOfType([x.object,x.string,x.func]),linkThreeObject:x.oneOfType([x.object,x.string,x.func]),linkThreeObjectExtend:x.oneOfType([x.bool,x.string,x.func]),linkPositionUpdate:x.func,linkDirectionalArrowResolution:x.number,linkDirectionalParticleResolution:x.number,linkDirectionalParticleThreeObject:x.oneOfType([x.object,x.string,x.func]),forceEngine:x.oneOf(["d3","ngraph"]),ngraphPhysics:x.object,numDimensions:x.oneOf([1,2,3])},Dh=Object.assign({},Ze,Qi,{linkLineDash:x.oneOfType([x.arrayOf(x.number),x.string,x.func]),nodeCanvasObjectMode:x.oneOfType([x.string,x.func]),nodeCanvasObject:x.func,nodePointerAreaPaint:x.func,linkCanvasObjectMode:x.oneOfType([x.string,x.func]),linkCanvasObject:x.func,linkPointerAreaPaint:x.func,linkDirectionalParticleCanvasObject:x.func,autoPauseRedraw:x.bool,minZoom:x.number,maxZoom:x.number,enableZoomInteraction:x.oneOfType([x.bool,x.func]),enablePanInteraction:x.oneOfType([x.bool,x.func]),onZoom:x.func,onZoomEnd:x.func,onRenderFramePre:x.func,onRenderFramePost:x.func});Object.assign({},Ze,Qi,Wn,{enableNavigationControls:x.bool,controlType:x.oneOf(["trackball","orbit","fly"]),rendererConfig:x.object,extraRenderers:x.arrayOf(x.shape({render:x.func.isRequired}))});Object.assign({},Ze,Wn,{nodeDesc:x.oneOfType([x.string,x.func]),linkDesc:x.oneOfType([x.string,x.func])});Object.assign({},Ze,Wn,{markerAttrs:x.object,yOffset:x.number,glScale:x.number});const Gn=Lo(Eh,{methodNames:["emitParticle","d3Force","d3ReheatSimulation","stopAnimation","pauseAnimation","resumeAnimation","centerAt","zoom","zoomToFit","getGraphBbox","screen2GraphCoords","graph2ScreenCoords"]});Gn.displayName="ForceGraph2D";Gn.propTypes=Dh;function wt(e){return function(){return e}}function Vr(e){return(e()-.5)*1e-6}function Ih(e){return e.x+e.vx}function $h(e){return e.y+e.vy}function Lh(e){var n,r,i,o=1,a=1;typeof e!="function"&&(e=wt(e==null?1:+e));function s(){for(var l,f=n.length,h,d,p,y,m,v,g=0;gd.index){var N=p-T.x-T.vx,D=y-T.y-T.vy,U=N*N+D*D;Up+P||wy+P||Al.r&&(l.r=l[f].r)}function c(){if(n){var l,f=n.length,h;for(r=new Array(f),l=0;la[0]-s[0]||a[1]-s[1]),r=(a,s,u)=>(s[0]-a[0])*(u[1]-a[1])-(s[1]-a[1])*(u[0]-a[0]),i=[];for(const a of n){for(;i.length>=2&&r(i[i.length-2],i[i.length-1],a)<=0;)i.pop();i.push(a)}const o=[];for(let a=n.length-1;a>=0;a--){const s=n[a];for(;o.length>=2&&r(o[o.length-2],o[o.length-1],s)<=0;)o.pop();o.push(s)}return i.pop(),o.pop(),i.concat(o)}function Zh({data:e,selectedNodeId:n,onNodeSelect:r}){const[i,o]=W.useState(null),[a,s]=W.useState(.75),u=W.useRef(null),c=W.useRef(null),[l,f]=W.useState({width:500,height:560});W.useEffect(()=>{if(!u.current)return;const C=new ResizeObserver(O=>{for(const I of O)I.contentRect.width>0&&I.contentRect.height>0&&f({width:Math.floor(I.contentRect.width),height:Math.floor(I.contentRect.height)})});return C.observe(u.current),()=>C.disconnect()},[]);const h=W.useRef(new Map),d=W.useMemo(()=>{const C=h.current,O=new Set,I=e.nodes.map(F=>{O.add(F.id);let G=C.get(F.id);return G?(G.content!==F.content||G.category!==F.category)&&(G.content=F.content,G.category=F.category,G.__baseTextWidth=void 0):(G={...F},C.set(F.id,G)),G});for(const F of Array.from(C.keys()))O.has(F)||C.delete(F);const L=new Map(e.nodes.map(F=>[F.id,F.category])),H=e.edges.map(F=>({source:F.source,target:F.target,weight:F.weight||0,__sid:F.source,__tid:F.target,__sameCat:L.get(F.source)===L.get(F.target),__restColor:Wh[L.get(F.source)??""]??qh}));return{nodes:I,links:H}},[e]),p=W.useMemo(()=>{const C={};return e.edges.forEach(O=>{C[O.source]=(C[O.source]||0)+1,C[O.target]=(C[O.target]||0)+1}),C},[e]),y=C=>({identity:-240,knowledge:240,rules:-240,events:240})[C]||0,m=C=>({identity:-240,knowledge:-240,rules:240,events:240})[C]||0,v=W.useMemo(()=>`${e.nodes.map(C=>C.id).sort().join(",")}#${e.edges.length}`,[e]);W.useEffect(()=>{const C=c.current;if(!C)return;C.d3Force("center",null),C.d3Force("x",Fh().x(L=>y(L.category)).strength(.1)),C.d3Force("y",Uh().y(L=>m(L.category)).strength(.1));const O=C.d3Force("charge");O&&O.strength(-380),C.d3Force("collide",Lh().radius(28).iterations(2));const I=C.d3Force("link");I&&I.distance(L=>L.__sameCat?70:200).strength(L=>L.__sameCat?.3*(L.weight||.6):.01),C.d3ReheatSimulation()},[v]);const g=i||n,k=W.useMemo(()=>d.links.filter(C=>C.__sameCat&&(C.weight||0)>=a).length,[d,a]),M=()=>{c.current&&c.current.zoomToFit(400,40)},b=W.useMemo(()=>{if(!g)return new Set;const C=new Set;return e.edges.forEach(O=>{O.source===g&&C.add(O.target),O.target===g&&C.add(O.source)}),C},[g,e]),_=W.useCallback(C=>g?C.__sid===g||C.__tid===g:C.__sameCat&&(C.weight||0)>=a,[g,a]),w=W.useCallback(C=>g&&(C.__sid===g||C.__tid===g)?Hh:C.__restColor,[g]),A=W.useCallback(C=>g&&(C.__sid===g||C.__tid===g)?2.5:1.4,[g]),T=W.useCallback(C=>g&&(C.__sid===g||C.__tid===g)?4:0,[g]),R=W.useCallback((C,O)=>{const I=c.current,L=u.current;if(!I||!L)return null;const H=L.getBoundingClientRect(),{x:F,y:G}=I.screen2GraphCoords(C-H.left,O-H.top),V=Math.max(I.zoom()||1,.01);let X=null,tt=1/0;for(const Z of d.nodes){if(Z.x==null||Z.y==null)continue;const st=6+Math.min(p[Z.id]||0,15)*.8,et=Math.max(st+3,16/V),qt=Z.x-F,At=Z.y-G,nt=qt*qt+At*At;nt<=et*et&&nt{const O=C.target instanceof HTMLCanvasElement?R(C.clientX,C.clientY):null;o(O?O.id:null),u.current&&(u.current.style.cursor=O?"pointer":"default")},[R]),N=W.useCallback(()=>{o(null),u.current&&(u.current.style.cursor="default")},[]),D=W.useRef(null),U=W.useCallback(C=>{D.current={x:C.clientX,y:C.clientY}},[]),S=W.useCallback(C=>{if(!(C.target instanceof HTMLCanvasElement))return;const O=D.current;if(O&&Math.hypot(C.clientX-O.x,C.clientY-O.y)>6)return;const I=R(C.clientX,C.clientY);r(I?I.id:null)},[R,r]),j=W.useCallback((C,O)=>{var L;const I={};for(const H of d.nodes)H.x==null||H.y==null||(I[L=H.category]??(I[L]=[])).push([H.x,H.y]);for(const[H,F]of Object.entries(I)){const G=Vh[H];if(!G||F.length===0)continue;const V=Yh(F);let X=0,tt=0;V.forEach(et=>{X+=et[0],tt+=et[1]}),X/=V.length,tt/=V.length;const Z=34;if(C.beginPath(),V.length<3)C.arc(X,tt,Z+16,0,2*Math.PI);else{const et=V.map(([nt,lt])=>{const jt=nt-X,Zt=lt-tt,Kt=Math.hypot(jt,Zt)||1;return[nt+jt/Kt*Z,lt+Zt/Kt*Z]}),qt=(nt,lt)=>[(nt[0]+lt[0])/2,(nt[1]+lt[1])/2],At=qt(et[et.length-1],et[0]);C.moveTo(At[0],At[1]);for(let nt=0;ntet[1]));C.font='600 26px "Space Grotesk", sans-serif',C.textAlign="center",C.textBaseline="bottom",C.fillStyle=Xh[H],C.fillText(Xr[H]||H,X,st-Z-8)}},[d]),E=W.useCallback((C,O,I)=>{const L=C.x??0,H=C.y??0,F=6+Math.min(p[C.id]||0,15)*.8,G=Br[C.category]||"#64748b",V=C.id===i,X=C.id===n,tt=g&&C.id!==g&&!b.has(C.id),Z=tt?"#1e293b":G;if(tt||(O.beginPath(),O.arc(L,H,F*1.9,0,2*Math.PI,!1),O.fillStyle=Gh[C.category]||"rgba(100, 116, 139, 0.14)",O.fill()),(V||X)&&(O.shadowColor=G,O.shadowBlur=15),O.beginPath(),O.arc(L,H,F,0,2*Math.PI,!1),O.fillStyle=Z,O.fill(),O.shadowBlur=0,(V||X)&&(O.beginPath(),O.arc(L,H,F+2.5,0,2*Math.PI,!1),O.strokeStyle=X?"#ffffff":"rgba(255, 255, 255, 0.7)",O.lineWidth=1.5,O.stroke()),V||X||g&&b.has(C.id)){const et=C.content.length>35?C.content.slice(0,34)+"…":C.content;if(C.__baseTextWidth===void 0){const Ji=O.font;O.font='500 10px "Space Grotesk", sans-serif',C.__baseTextWidth=O.measureText(et).width,O.font=Ji}const At=(V||X?10.5:9.5)/Math.max(.5,I);O.font=`${V||X?"bold":"500"} ${At}px "Space Grotesk", sans-serif`;const nt=C.__baseTextWidth*(At/10),lt=4.5/Math.max(.5,I),jt=L-nt/2-lt,Zt=H+F+6/Math.max(.5,I),Kt=nt+lt*2,Vn=At+lt*1.6;O.fillStyle=tt?"rgba(10, 15, 25, 0.45)":"rgba(8, 12, 20, 0.88)",O.fillRect(jt,Zt,Kt,Vn),O.strokeStyle=V||X?"rgba(255, 255, 255, 0.2)":"rgba(255, 255, 255, 0.08)",O.lineWidth=.6/Math.max(.5,I),O.strokeRect(jt,Zt,Kt,Vn),O.textAlign="center",O.textBaseline="top",O.fillStyle=tt?"#475569":V||X?"#ffffff":"#cbd5e1",O.fillText(et,L,H+F+7/Math.max(.5,I))}},[p,i,n,g,b]);return $.jsxs("div",{className:"absolute inset-0",ref:u,onPointerMove:P,onPointerLeave:N,onPointerDown:U,onClick:S,style:{background:"radial-gradient(circle at center, rgba(59, 130, 246, 0.08) 0%, #030712 100%)"},children:[$.jsx(Gn,{ref:c,width:l.width,height:l.height,graphData:d,backgroundColor:"rgba(0,0,0,0)",cooldownTicks:120,enablePointerInteraction:!1,enableNodeDrag:!1,onRenderFramePre:j,linkVisibility:_,linkColor:w,linkWidth:A,linkDirectionalParticles:T,linkDirectionalParticleWidth:2.2,linkDirectionalParticleSpeed:.006,nodeCanvasObject:E}),$.jsxs("button",{onClick:M,title:"Zentrieren",className:"absolute right-3 top-3 z-10 flex items-center gap-1.5 rounded-lg border border-border/60 bg-background/50 px-2.5 py-1.5 text-[11px] text-muted-foreground hover:text-foreground backdrop-blur-sm transition-colors cursor-pointer",children:[$.jsx(go,{className:"h-3.5 w-3.5"})," Zentrieren"]}),$.jsxs("div",{className:"absolute left-3 bottom-3 flex flex-wrap items-center gap-x-3 gap-y-1.5 rounded-lg bg-background/40 px-2.5 py-1.5 backdrop-blur-sm",children:[Object.entries(Xr).map(([C,O])=>$.jsxs("span",{className:"flex items-center gap-1 text-[10px] text-muted-foreground",children:[$.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:Br[C]}}),O]},C)),$.jsxs("label",{className:"flex items-center gap-1.5 text-[10px] text-muted-foreground border-l border-border/40 pl-3",children:[$.jsx("span",{children:"Verbindungen"}),$.jsx("span",{className:"text-[9px] text-muted-foreground/60",children:"alle"}),$.jsx("input",{type:"range",min:.45,max:.95,step:.05,value:a,onChange:C=>s(Number(C.target.value)),className:"w-20 accent-primary cursor-pointer",title:"Nur Verbindungen ab dieser Stärke zeigen"}),$.jsx("span",{className:"text-[9px] text-muted-foreground/60",children:"stark"}),$.jsx("span",{className:"font-mono text-[9px] text-muted-foreground/80 min-w-[3ch] text-right",children:k})]})]})]})}class Kh extends W.Component{constructor(){super(...arguments);Bn(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}render(){return this.state.error?$.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:[$.jsx("div",{className:"font-semibold mb-2",children:"Graph konnte nicht gerendert werden"}),$.jsx("pre",{className:"whitespace-pre-wrap break-words text-[11px] leading-relaxed",children:this.state.error.message})]}):this.props.children}}const Qh={"":"Allgemein",traeume:"Träume",muster:"Muster","skill-kandidaten":"Skill-Kandidaten","skill-kandidaten/beauftragt":"Skill-Kandidaten · beauftragt","skill-kandidaten/verworfen":"Skill-Kandidaten · verworfen"};function ad(){const{data:e,isLoading:n}=oo(),[r,i]=W.useState(null),[o,a]=W.useState(null),[s,u]=W.useState(!1),c=ao(),{suche:l=""}=so({from:"/wissen"}),f=l,h=_=>c({to:"/wissen",search:w=>({...w,suche:_||void 0}),replace:!0}),[d,p]=W.useState(!1),{data:y,isLoading:m}=uo(d),v=W.useMemo(()=>(e==null?void 0:e.files)??[],[e]),g=W.useMemo(()=>{const _=new Map;for(const w of v)_.set(w.name.toLowerCase(),w.path);return _},[v]),k=W.useMemo(()=>{if(!f.trim())return v;const _=f.toLowerCase();return v.filter(w=>w.title.toLowerCase().includes(_)||w.path.toLowerCase().includes(_))},[v,f]),M=W.useMemo(()=>{const _=[];for(const w of k){const A=_.find(T=>T.dir===w.dir);A?A.files.push(w):_.push({dir:w.dir,files:[w]})}return _.sort((w,A)=>w.dir===""?-1:A.dir===""?1:w.dir.localeCompare(A.dir))},[k]);W.useEffect(()=>{if(!r&&v.length){const _=v.find(w=>w.path.toLowerCase()==="index.md");i((_==null?void 0:_.path)??v[0].path)}},[v,r]),W.useEffect(()=>{r&&(u(!0),lo(`/api/wissen/datei?pfad=${encodeURIComponent(r)}`).then(a).catch(()=>a({path:r,content:"*(Notiz nicht ladbar)*",mtime:0})).finally(()=>u(!1)))},[r]);const b=_=>{const w=g.get(_.toLowerCase());w&&i(w)};return $.jsxs("div",{className:"space-y-5",children:[$.jsxs("div",{className:"flex items-center justify-between",children:[$.jsxs("div",{children:[$.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"}),$.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."})]}),v.length>0&&$.jsxs("div",{className:"flex rounded-lg border border-border/60 bg-card p-1",children:[$.jsx("button",{onClick:()=>p(!1),className:Ae("rounded-md px-3 py-1.5 text-xs font-medium transition-colors",d?"text-muted-foreground hover:bg-muted":"bg-primary text-primary-foreground shadow"),children:"Liste"}),$.jsx("button",{onClick:()=>p(!0),className:Ae("rounded-md px-3 py-1.5 text-xs font-medium transition-colors",d?"bg-primary text-primary-foreground shadow":"text-muted-foreground hover:bg-muted"),children:"Graph"})]})]}),e&&!e.available&&$.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."}),n&&$.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:[$.jsx(Ke,{className:"h-4 w-4 animate-spin"})," Vault wird geladen …"]}),(e==null?void 0:e.available)&&v.length===0&&$.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."}),d?$.jsxs("div",{className:"mc-card flex h-[70vh] flex-col overflow-hidden p-0 relative",children:[m&&$.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50 z-10",children:$.jsxs("div",{className:"flex items-center gap-2 rounded-2xl border border-border/60 bg-card p-6 text-xs text-muted-foreground",children:[$.jsx(Ke,{className:"h-4 w-4 animate-spin"})," Graph wird berechnet …"]})}),$.jsx(Kh,{children:y&&$.jsx(Zh,{data:y,selectedNodeId:r,onNodeSelect:_=>{_&&(i(_),p(!1))}})})]}):v.length>0&&$.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row",children:[$.jsxs("aside",{className:"w-full shrink-0 space-y-3 lg:w-72",children:[$.jsxs("div",{className:"relative",children:[$.jsx("input",{value:f,onChange:_=>h(_.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"}),$.jsx(yo,{className:"absolute left-2.5 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),$.jsx("div",{className:"max-h-[70vh] space-y-3 overflow-y-auto pr-1 scrollbar-thin",children:M.map(({dir:_,files:w})=>$.jsxs("div",{children:[$.jsxs("p",{className:"mb-1 flex items-center gap-1 text-[10px] font-bold uppercase tracking-wider text-muted-foreground/60",children:[$.jsx(vo,{className:"h-3 w-3"})," ",Qh[_]??_]}),$.jsx("div",{className:"space-y-0.5",children:w.map(A=>$.jsxs("button",{onClick:()=>i(A.path),className:Ae("flex w-full items-center gap-1.5 rounded-lg px-2 py-1.5 text-left text-xs transition-all cursor-pointer",r===A.path?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:[$.jsx(_o,{className:"h-3.5 w-3.5 shrink-0"}),$.jsx("span",{className:"truncate",title:A.title,children:A.name}),A.neu&&$.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:[$.jsx(co,{className:"h-2.5 w-2.5"}),"neu"]})]},A.path))})]},_||"__root"))})]}),$.jsx("div",{className:"min-w-0 flex-1 mc-card p-5",children:s?$.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[$.jsx(Ke,{className:"h-4 w-4 animate-spin"})," Notiz wird geladen …"]}):o?$.jsxs($.Fragment,{children:[$.jsxs("div",{className:"mb-3 flex items-center justify-between border-b border-border/40 pb-2",children:[$.jsxs("span",{className:"flex items-center gap-1.5 font-mono text-[11px] text-muted-foreground",children:[$.jsx(fo,{className:"h-3.5 w-3.5"})," ",o.path]}),o.mtime>0&&$.jsxs("span",{className:"text-[10px] text-muted-foreground/60",children:["Stand ",new Date(o.mtime*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"})]})]}),$.jsx(Jh,{text:o.content,onWikiLink:b,known:g})]}):null})]})]})}function Jh({text:e,onWikiLink:n,known:r}){const i=e.split(` -`),o=[];let a=[],s=null;const u=c=>{a.length&&(o.push($.jsx("ul",{className:"mb-3 ml-4 list-disc space-y-1",children:a},c)),a=[])};return i.forEach((c,l)=>{const f=`l${l}`;if(s!==null){c.trimEnd()==="```"?(o.push($.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:s.join(` -`)},f)),s=null):s.push(c);return}if(c.trimStart().startsWith("```")){u(f),s=[];return}const h=c.trimEnd();if(!h.trim()){u(f);return}const d=h.match(/^(#{1,4})\s+(.*)$/);if(d){u(f);const y=d[1].length,m=y===1?"text-lg font-bold mt-1 mb-3":y===2?"text-base font-bold mt-4 mb-2":"text-sm font-bold mt-3 mb-1.5";o.push($.jsx("p",{className:Ae(m,"font-space text-foreground"),children:cn(d[2],n,r,f)},f));return}const p=h.match(/^\s*[-*•]\s+(.*)$/);if(p){a.push($.jsx("li",{className:"text-xs leading-relaxed text-foreground/85",children:cn(p[1],n,r,f)},f));return}u(f),o.push($.jsx("p",{className:"mb-2 text-xs leading-relaxed text-foreground/85",children:cn(h,n,r,f)},f))}),u("end"),s!==null&&o.push($.jsx("pre",{className:"mb-3 overflow-x-auto rounded-xl border border-border/50 bg-background/50 p-3 font-mono text-[11px]",children:s.join(` -`)},"code-end")),$.jsx("div",{className:"max-w-3xl",children:o})}function cn(e,n,r,i){return e.split(/(\[\[[^\]]+\]\]|\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`)/g).map((a,s)=>{const u=`${i}-${s}`,c=a.match(/^\[\[([^\]|]+)(?:\|([^\]]+))?\]\]$/);if(c){const l=c[1].trim(),f=(c[2]??c[1]).trim();return r.has(l.toLowerCase())?$.jsx("button",{onClick:()=>n(l),className:"rounded bg-primary/10 px-1 text-primary underline decoration-primary/40 underline-offset-2 hover:bg-primary/20 cursor-pointer",children:f},u):$.jsx("span",{className:"rounded bg-background/40 px-1 text-muted-foreground",title:"Notiz existiert (noch) nicht",children:f},u)}return a.startsWith("**")&&a.endsWith("**")?$.jsx("b",{className:"font-semibold text-foreground",children:a.slice(2,-2)},u):a.startsWith("*")&&a.endsWith("*")&&a.length>2?$.jsx("i",{children:a.slice(1,-1)},u):a.startsWith("`")&&a.endsWith("`")?$.jsx("code",{className:"rounded bg-background/50 px-1 font-mono text-[11px] text-teal-300",children:a.slice(1,-1)},u):$.jsx("span",{children:a},u)})}export{ad as WissenView}; diff --git a/frontend/dist/assets/arrow-right-CNrCtUoh.js b/frontend/dist/assets/arrow-right-CNrCtUoh.js deleted file mode 100644 index fe1eaba..0000000 --- a/frontend/dist/assets/arrow-right-CNrCtUoh.js +++ /dev/null @@ -1,6 +0,0 @@ -import{c as r}from"./index-DMY9lUCb.js";/** - * @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 o=r("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);export{o as A}; diff --git a/frontend/dist/assets/barlow-condensed-latin-500-normal-BgYH2mbd.woff2 b/frontend/dist/assets/barlow-condensed-latin-500-normal-BgYH2mbd.woff2 new file mode 100644 index 0000000..e30e239 Binary files /dev/null and b/frontend/dist/assets/barlow-condensed-latin-500-normal-BgYH2mbd.woff2 differ diff --git a/frontend/dist/assets/barlow-condensed-latin-500-normal-HIEiP5Ov.woff b/frontend/dist/assets/barlow-condensed-latin-500-normal-HIEiP5Ov.woff new file mode 100644 index 0000000..c39ecb1 Binary files /dev/null and b/frontend/dist/assets/barlow-condensed-latin-500-normal-HIEiP5Ov.woff differ diff --git a/frontend/dist/assets/barlow-condensed-latin-600-normal-BFJEwTuo.woff b/frontend/dist/assets/barlow-condensed-latin-600-normal-BFJEwTuo.woff new file mode 100644 index 0000000..caccfe2 Binary files /dev/null and b/frontend/dist/assets/barlow-condensed-latin-600-normal-BFJEwTuo.woff differ diff --git a/frontend/dist/assets/barlow-condensed-latin-600-normal-DepVgxBB.woff2 b/frontend/dist/assets/barlow-condensed-latin-600-normal-DepVgxBB.woff2 new file mode 100644 index 0000000..da60c9a Binary files /dev/null and b/frontend/dist/assets/barlow-condensed-latin-600-normal-DepVgxBB.woff2 differ diff --git a/frontend/dist/assets/barlow-condensed-latin-700-normal-Dmwat-ge.woff b/frontend/dist/assets/barlow-condensed-latin-700-normal-Dmwat-ge.woff new file mode 100644 index 0000000..e9ffa4f Binary files /dev/null and b/frontend/dist/assets/barlow-condensed-latin-700-normal-Dmwat-ge.woff differ diff --git a/frontend/dist/assets/barlow-condensed-latin-700-normal-v1xN8_Wq.woff2 b/frontend/dist/assets/barlow-condensed-latin-700-normal-v1xN8_Wq.woff2 new file mode 100644 index 0000000..3726e9d Binary files /dev/null and b/frontend/dist/assets/barlow-condensed-latin-700-normal-v1xN8_Wq.woff2 differ diff --git a/frontend/dist/assets/barlow-condensed-latin-ext-500-normal-B1RE8WP7.woff b/frontend/dist/assets/barlow-condensed-latin-ext-500-normal-B1RE8WP7.woff new file mode 100644 index 0000000..5891a8b Binary files /dev/null and b/frontend/dist/assets/barlow-condensed-latin-ext-500-normal-B1RE8WP7.woff differ diff --git a/frontend/dist/assets/barlow-condensed-latin-ext-500-normal-yA5ONLQ9.woff2 b/frontend/dist/assets/barlow-condensed-latin-ext-500-normal-yA5ONLQ9.woff2 new file mode 100644 index 0000000..39f933c Binary files /dev/null and b/frontend/dist/assets/barlow-condensed-latin-ext-500-normal-yA5ONLQ9.woff2 differ diff --git a/frontend/dist/assets/barlow-condensed-latin-ext-600-normal-18ESti3H.woff2 b/frontend/dist/assets/barlow-condensed-latin-ext-600-normal-18ESti3H.woff2 new file mode 100644 index 0000000..400ed84 Binary files /dev/null and b/frontend/dist/assets/barlow-condensed-latin-ext-600-normal-18ESti3H.woff2 differ diff --git a/frontend/dist/assets/barlow-condensed-latin-ext-600-normal-Clv9cIcR.woff b/frontend/dist/assets/barlow-condensed-latin-ext-600-normal-Clv9cIcR.woff new file mode 100644 index 0000000..afc23bc Binary files /dev/null and b/frontend/dist/assets/barlow-condensed-latin-ext-600-normal-Clv9cIcR.woff differ diff --git a/frontend/dist/assets/barlow-condensed-latin-ext-700-normal-BIHFfxf0.woff b/frontend/dist/assets/barlow-condensed-latin-ext-700-normal-BIHFfxf0.woff new file mode 100644 index 0000000..0b76402 Binary files /dev/null and b/frontend/dist/assets/barlow-condensed-latin-ext-700-normal-BIHFfxf0.woff differ diff --git a/frontend/dist/assets/barlow-condensed-latin-ext-700-normal-CwuXbfVR.woff2 b/frontend/dist/assets/barlow-condensed-latin-ext-700-normal-CwuXbfVR.woff2 new file mode 100644 index 0000000..02f926e Binary files /dev/null and b/frontend/dist/assets/barlow-condensed-latin-ext-700-normal-CwuXbfVR.woff2 differ diff --git a/frontend/dist/assets/barlow-condensed-vietnamese-500-normal-CsrJDWc5.woff b/frontend/dist/assets/barlow-condensed-vietnamese-500-normal-CsrJDWc5.woff new file mode 100644 index 0000000..d44f0b6 Binary files /dev/null and b/frontend/dist/assets/barlow-condensed-vietnamese-500-normal-CsrJDWc5.woff differ diff --git a/frontend/dist/assets/barlow-condensed-vietnamese-500-normal-DjeaNLFD.woff2 b/frontend/dist/assets/barlow-condensed-vietnamese-500-normal-DjeaNLFD.woff2 new file mode 100644 index 0000000..9f04648 Binary files /dev/null and b/frontend/dist/assets/barlow-condensed-vietnamese-500-normal-DjeaNLFD.woff2 differ diff --git a/frontend/dist/assets/barlow-condensed-vietnamese-600-normal-A5AYRdjN.woff2 b/frontend/dist/assets/barlow-condensed-vietnamese-600-normal-A5AYRdjN.woff2 new file mode 100644 index 0000000..9118cc6 Binary files /dev/null and b/frontend/dist/assets/barlow-condensed-vietnamese-600-normal-A5AYRdjN.woff2 differ diff --git a/frontend/dist/assets/barlow-condensed-vietnamese-600-normal-CNlPk46_.woff b/frontend/dist/assets/barlow-condensed-vietnamese-600-normal-CNlPk46_.woff new file mode 100644 index 0000000..c0e2851 Binary files /dev/null and b/frontend/dist/assets/barlow-condensed-vietnamese-600-normal-CNlPk46_.woff differ diff --git a/frontend/dist/assets/barlow-condensed-vietnamese-700-normal-DYeBwlKR.woff2 b/frontend/dist/assets/barlow-condensed-vietnamese-700-normal-DYeBwlKR.woff2 new file mode 100644 index 0000000..60af6f8 Binary files /dev/null and b/frontend/dist/assets/barlow-condensed-vietnamese-700-normal-DYeBwlKR.woff2 differ diff --git a/frontend/dist/assets/barlow-condensed-vietnamese-700-normal-DhIzd8Tb.woff b/frontend/dist/assets/barlow-condensed-vietnamese-700-normal-DhIzd8Tb.woff new file mode 100644 index 0000000..58ba924 Binary files /dev/null and b/frontend/dist/assets/barlow-condensed-vietnamese-700-normal-DhIzd8Tb.woff differ diff --git a/frontend/dist/assets/barlow-latin-400-normal-fsAxiSwU.woff b/frontend/dist/assets/barlow-latin-400-normal-fsAxiSwU.woff new file mode 100644 index 0000000..23eb32e Binary files /dev/null and b/frontend/dist/assets/barlow-latin-400-normal-fsAxiSwU.woff differ diff --git a/frontend/dist/assets/barlow-latin-400-normal-qiz4-Cze.woff2 b/frontend/dist/assets/barlow-latin-400-normal-qiz4-Cze.woff2 new file mode 100644 index 0000000..3914af4 Binary files /dev/null and b/frontend/dist/assets/barlow-latin-400-normal-qiz4-Cze.woff2 differ diff --git a/frontend/dist/assets/barlow-latin-500-normal-BPAOfeC8.woff2 b/frontend/dist/assets/barlow-latin-500-normal-BPAOfeC8.woff2 new file mode 100644 index 0000000..b1d06c6 Binary files /dev/null and b/frontend/dist/assets/barlow-latin-500-normal-BPAOfeC8.woff2 differ diff --git a/frontend/dist/assets/barlow-latin-500-normal-C1h8hMer.woff b/frontend/dist/assets/barlow-latin-500-normal-C1h8hMer.woff new file mode 100644 index 0000000..c42648f Binary files /dev/null and b/frontend/dist/assets/barlow-latin-500-normal-C1h8hMer.woff differ diff --git a/frontend/dist/assets/barlow-latin-600-normal-CNwfPWQD.woff b/frontend/dist/assets/barlow-latin-600-normal-CNwfPWQD.woff new file mode 100644 index 0000000..9d839eb Binary files /dev/null and b/frontend/dist/assets/barlow-latin-600-normal-CNwfPWQD.woff differ diff --git a/frontend/dist/assets/barlow-latin-600-normal-DILqtrty.woff2 b/frontend/dist/assets/barlow-latin-600-normal-DILqtrty.woff2 new file mode 100644 index 0000000..b1a019f Binary files /dev/null and b/frontend/dist/assets/barlow-latin-600-normal-DILqtrty.woff2 differ diff --git a/frontend/dist/assets/barlow-latin-ext-400-normal-CvBsJvxq.woff b/frontend/dist/assets/barlow-latin-ext-400-normal-CvBsJvxq.woff new file mode 100644 index 0000000..0a1a825 Binary files /dev/null and b/frontend/dist/assets/barlow-latin-ext-400-normal-CvBsJvxq.woff differ diff --git a/frontend/dist/assets/barlow-latin-ext-400-normal-HxX4XjxC.woff2 b/frontend/dist/assets/barlow-latin-ext-400-normal-HxX4XjxC.woff2 new file mode 100644 index 0000000..5c6eb7a Binary files /dev/null and b/frontend/dist/assets/barlow-latin-ext-400-normal-HxX4XjxC.woff2 differ diff --git a/frontend/dist/assets/barlow-latin-ext-500-normal-CJPcKP2Q.woff b/frontend/dist/assets/barlow-latin-ext-500-normal-CJPcKP2Q.woff new file mode 100644 index 0000000..60c7acb Binary files /dev/null and b/frontend/dist/assets/barlow-latin-ext-500-normal-CJPcKP2Q.woff differ diff --git a/frontend/dist/assets/barlow-latin-ext-500-normal-DOaysfXq.woff2 b/frontend/dist/assets/barlow-latin-ext-500-normal-DOaysfXq.woff2 new file mode 100644 index 0000000..4966af7 Binary files /dev/null and b/frontend/dist/assets/barlow-latin-ext-500-normal-DOaysfXq.woff2 differ diff --git a/frontend/dist/assets/barlow-latin-ext-600-normal-B8NK_A3D.woff2 b/frontend/dist/assets/barlow-latin-ext-600-normal-B8NK_A3D.woff2 new file mode 100644 index 0000000..3d7c7a2 Binary files /dev/null and b/frontend/dist/assets/barlow-latin-ext-600-normal-B8NK_A3D.woff2 differ diff --git a/frontend/dist/assets/barlow-latin-ext-600-normal-DMVRjfRT.woff b/frontend/dist/assets/barlow-latin-ext-600-normal-DMVRjfRT.woff new file mode 100644 index 0000000..1e9f605 Binary files /dev/null and b/frontend/dist/assets/barlow-latin-ext-600-normal-DMVRjfRT.woff differ diff --git a/frontend/dist/assets/barlow-vietnamese-400-normal-BFeobeCK.woff b/frontend/dist/assets/barlow-vietnamese-400-normal-BFeobeCK.woff new file mode 100644 index 0000000..51ea245 Binary files /dev/null and b/frontend/dist/assets/barlow-vietnamese-400-normal-BFeobeCK.woff differ diff --git a/frontend/dist/assets/barlow-vietnamese-400-normal-Dpl4UHAZ.woff2 b/frontend/dist/assets/barlow-vietnamese-400-normal-Dpl4UHAZ.woff2 new file mode 100644 index 0000000..f3c1547 Binary files /dev/null and b/frontend/dist/assets/barlow-vietnamese-400-normal-Dpl4UHAZ.woff2 differ diff --git a/frontend/dist/assets/barlow-vietnamese-500-normal-GNfB7rCE.woff b/frontend/dist/assets/barlow-vietnamese-500-normal-GNfB7rCE.woff new file mode 100644 index 0000000..84a9c7e Binary files /dev/null and b/frontend/dist/assets/barlow-vietnamese-500-normal-GNfB7rCE.woff differ diff --git a/frontend/dist/assets/barlow-vietnamese-500-normal-zTViEIzf.woff2 b/frontend/dist/assets/barlow-vietnamese-500-normal-zTViEIzf.woff2 new file mode 100644 index 0000000..437819f Binary files /dev/null and b/frontend/dist/assets/barlow-vietnamese-500-normal-zTViEIzf.woff2 differ diff --git a/frontend/dist/assets/barlow-vietnamese-600-normal-CA_GiK2e.woff b/frontend/dist/assets/barlow-vietnamese-600-normal-CA_GiK2e.woff new file mode 100644 index 0000000..6805da4 Binary files /dev/null and b/frontend/dist/assets/barlow-vietnamese-600-normal-CA_GiK2e.woff differ diff --git a/frontend/dist/assets/barlow-vietnamese-600-normal-DcjprdFV.woff2 b/frontend/dist/assets/barlow-vietnamese-600-normal-DcjprdFV.woff2 new file mode 100644 index 0000000..e37b886 Binary files /dev/null and b/frontend/dist/assets/barlow-vietnamese-600-normal-DcjprdFV.woff2 differ diff --git a/frontend/dist/assets/button-Dd8hfusv.js b/frontend/dist/assets/button-Dd8hfusv.js new file mode 100644 index 0000000..88ac006 --- /dev/null +++ b/frontend/dist/assets/button-Dd8hfusv.js @@ -0,0 +1 @@ +var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ee=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function te(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(ee,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ee,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u{t.exports=l()})),d=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=d()})),p=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),m=o(((e,t)=>{t.exports=p()})),h=o((e=>{var t=u().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){return t.H.useMemoCache(e)}})),g=o(((e,t)=>{t.exports=h()})),_=c(u(),1),v=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function y(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:v(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var b=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},x=e=>{let t=b(e);return t.charAt(0).toUpperCase()+t.slice(1)},S=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),C={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function w(e){return e!=null}function T(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??C.width,a=e.size??e.height??C.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?S(...c):S(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??C[`stroke-width`])*Number(e.size??e.width??C.width)/Number(t.size??t.width??C.width):t.strokeWidth??C[`stroke-width`];return[`svg`,{...Object.entries(C).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&w(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&w(t.width)&&{[r(`width`)]:t.width},...`height`in t&&w(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function E(e,t={}){return T(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var D=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},O=(0,_.createContext)({}),k=()=>(0,_.useContext)(O),A=(0,_.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:v=`currentColor`,className:y=``}=k()??{},b=!!c||D(d),[x,C,w=[]]=E(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:S(y,s),hasA11yProp:b,attributes:d});return(0,_.createElement)(x,{ref:f,...C},[...w.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function ee(e,t=[],n=[]){let r=typeof e==`string`?y(e,t,n):e,i=(0,_.forwardRef)(({className:e,...t},n)=>(0,_.createElement)(A,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=x(r.name)),i}var j={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};j.node;var te=ee(j),M=g(),N=48,P=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r{let t=new Int32Array(e.length+1);for(let n=0;n{let t=new Int32Array(e.length),n=0;for(let r=0;r>>1^-(i&1),t[r]=n}return t},L=384,ne=[],R=F(P(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),re=F(P(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),ie=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,z=(()=>{let e=R.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=R[n];iE?F@03263243255B:032523853:0325B:8GA032542HE?3257D>032585:0325B:;0328B:032`),B=P(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),ce=I(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),le=(()=>{let e=new Int32Array(319).fill(-1),t=I(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=I(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r