From 3f7e407ca585502f3293723db010ac3085f011b5 Mon Sep 17 00:00:00 2001 From: Cristian Pufu Date: Mon, 2 Mar 2026 15:03:02 +0200 Subject: [PATCH 1/2] feat: auto-reload, multi-framework detection, conversational mock fix - Auto-reload runtime factory when Python files change instead of showing a manual reload popup. Falls back to the popup when runs are in progress or reload fails. - Clear stale reload toast when a subsequent auto-reload succeeds. - Add detection for llama_index.json, agent_framework.json, google_adk.json, pydantic_ai.json, openai_agents.json in agent project context. - Broaden UiPath conversational input detection to match schemas with contentParts/data/inline structure (without requiring userSettings or $defs). Mock output only includes userSettings when the schema declares it. - Make ReloadToast more compact with aria-label on dismiss button. - Bump version to 0.0.70. Co-Authored-By: Claude Opus 4.6 --- pyproject.toml | 2 +- src/uipath/dev/server/__init__.py | 37 ++++++++++-- .../src/components/shared/ReloadToast.tsx | 47 ++++++++------- .../server/frontend/src/store/useWebSocket.ts | 23 ++++++-- ...anel-DiTmerW3.js => ChatPanel-DWIYYBph.js} | 2 +- .../server/static/assets/index-CzFU-Cnb.css | 1 - .../server/static/assets/index-D4dH-hau.css | 1 + .../{index-RLauX7zc.js => index-V3oNRyE_.js} | 58 +++++++++---------- src/uipath/dev/server/static/index.html | 4 +- src/uipath/dev/server/ws/handler.py | 6 +- src/uipath/dev/server/ws/manager.py | 15 ++++- src/uipath/dev/services/agent/service.py | 36 ++++++------ src/uipath/dev/ui/panels/_json_schema.py | 52 ++++++++++------- uv.lock | 2 +- 14 files changed, 177 insertions(+), 109 deletions(-) rename src/uipath/dev/server/static/assets/{ChatPanel-DiTmerW3.js => ChatPanel-DWIYYBph.js} (99%) delete mode 100644 src/uipath/dev/server/static/assets/index-CzFU-Cnb.css create mode 100644 src/uipath/dev/server/static/assets/index-D4dH-hau.css rename src/uipath/dev/server/static/assets/{index-RLauX7zc.js => index-V3oNRyE_.js} (65%) diff --git a/pyproject.toml b/pyproject.toml index 4acf110..e3786e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath-dev" -version = "0.0.69" +version = "0.0.70" description = "UiPath Developer Console" readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.11" diff --git a/src/uipath/dev/server/__init__.py b/src/uipath/dev/server/__init__.py index d969075..900696e 100644 --- a/src/uipath/dev/server/__init__.py +++ b/src/uipath/dev/server/__init__.py @@ -196,6 +196,31 @@ async def reload_factory(self) -> None: self.reload_pending = False logger.debug("Factory reloaded successfully") + async def _auto_reload(self, py_files: list[str]) -> None: + """Auto-reload factory when Python files change. + + If runs are active, broadcast reload event so the frontend shows a + manual-reload prompt instead. + """ + active = [ + r + for r in self.run_service.runs.values() + if r.status in ("pending", "running") + ] + if active: + logger.debug("Runs in progress — deferring reload to user") + self.reload_pending = True + self.connection_manager.broadcast_reload(py_files) + return + + try: + await self.reload_factory() + self.connection_manager.broadcast_reload(py_files, reloaded=True) + except Exception: + logger.warning("Auto-reload failed", exc_info=True) + self.reload_pending = True + self.connection_manager.broadcast_reload(py_files) + def _start_watcher(self) -> None: """Start the file watcher background task.""" from uipath.dev.server.watcher import watch_project_files @@ -231,11 +256,15 @@ def _on_files_changed(self, changed_files: list[str]) -> None: if relative_files: self.connection_manager.broadcast_files_changed(relative_files) - # Factory hot-reload for Python files only - py_files = [f for f in changed_files if f.endswith((".py", ".pyx"))] + # Factory hot-reload for Python files only (use normalized relative paths) + py_files = [f for f in relative_files if f.endswith((".py", ".pyx"))] if py_files and self.factory_creator is not None: - self.reload_pending = True - self.connection_manager.broadcast_reload(py_files) + loop = self.connection_manager._get_loop() + + def _schedule_reload(files: list[str] = py_files) -> None: + asyncio.ensure_future(self._auto_reload(files)) + + loop.call_soon_threadsafe(_schedule_reload) # ------------------------------------------------------------------ # Internal callbacks diff --git a/src/uipath/dev/server/frontend/src/components/shared/ReloadToast.tsx b/src/uipath/dev/server/frontend/src/components/shared/ReloadToast.tsx index 7cdcd4e..26417bb 100644 --- a/src/uipath/dev/server/frontend/src/components/shared/ReloadToast.tsx +++ b/src/uipath/dev/server/frontend/src/components/shared/ReloadToast.tsx @@ -23,32 +23,31 @@ export default function ReloadToast() { }; return ( -
- - Files changed, reload to apply + + Files changed -
- - -
+ +
); } diff --git a/src/uipath/dev/server/frontend/src/store/useWebSocket.ts b/src/uipath/dev/server/frontend/src/store/useWebSocket.ts index 13b8ee1..9d52e65 100644 --- a/src/uipath/dev/server/frontend/src/store/useWebSocket.ts +++ b/src/uipath/dev/server/frontend/src/store/useWebSocket.ts @@ -1,5 +1,6 @@ import { useEffect, useRef } from "react"; import { WsClient } from "../api/websocket"; +import { listEntrypoints } from "../api/client"; import { useRunStore } from "./useRunStore"; import { useEvalStore } from "./useEvalStore"; import { useAgentStore } from "./useAgentStore"; @@ -21,7 +22,7 @@ export function getWs(): WsClient { export function useWebSocket() { const ws = useRef(getWs()); - const { upsertRun, addTrace, addLog, addChatEvent, setActiveInterrupt, setActiveNode, removeActiveNode, resetRunGraphState, addStateEvent, setReloadPending } = useRunStore(); + const { upsertRun, addTrace, addLog, addChatEvent, setActiveInterrupt, setActiveNode, removeActiveNode, resetRunGraphState, addStateEvent } = useRunStore(); const { upsertEvalRun, updateEvalRunProgress, completeEvalRun } = useEvalStore(); useEffect(() => { @@ -65,9 +66,23 @@ export function useWebSocket() { addStateEvent(runId, nodeName, payload, qualifiedNodeName, phase); break; } - case "reload": - setReloadPending(true); + case "reload": { + const alreadyReloaded = msg.payload.reloaded as boolean | undefined; + if (alreadyReloaded) { + // Server already reloaded the factory — just refresh entrypoints + listEntrypoints() + .then((eps) => { + const store = useRunStore.getState(); + store.setEntrypoints(eps.map((e) => e.name)); + store.setReloadPending(false); + }) + .catch((err) => console.error("Failed to refresh entrypoints:", err)); + } else { + // Runs active or reload failed — show manual reload prompt + useRunStore.getState().setReloadPending(true); + } break; + } case "files.changed": { const changedFiles = msg.payload.files as string[]; const changedSet = new Set(changedFiles); @@ -286,7 +301,7 @@ export function useWebSocket() { }); return unsub; - }, [upsertRun, addTrace, addLog, addChatEvent, setActiveInterrupt, setActiveNode, removeActiveNode, resetRunGraphState, addStateEvent, setReloadPending, upsertEvalRun, updateEvalRunProgress, completeEvalRun]); + }, [upsertRun, addTrace, addLog, addChatEvent, setActiveInterrupt, setActiveNode, removeActiveNode, resetRunGraphState, addStateEvent, upsertEvalRun, updateEvalRunProgress, completeEvalRun]); return ws.current; } diff --git a/src/uipath/dev/server/static/assets/ChatPanel-DiTmerW3.js b/src/uipath/dev/server/static/assets/ChatPanel-DWIYYBph.js similarity index 99% rename from src/uipath/dev/server/static/assets/ChatPanel-DiTmerW3.js rename to src/uipath/dev/server/static/assets/ChatPanel-DWIYYBph.js index e3d3885..67d46a7 100644 --- a/src/uipath/dev/server/static/assets/ChatPanel-DiTmerW3.js +++ b/src/uipath/dev/server/static/assets/ChatPanel-DWIYYBph.js @@ -1,2 +1,2 @@ -import{j as e,a as y}from"./vendor-react-N5xbSGOh.js";import{M,r as T,a as O,u as S}from"./index-RLauX7zc.js";import"./vendor-reactflow-CxoS0d5s.js";const J={user:{label:"You",color:"var(--info)"},tool:{label:"Tool",color:"var(--warning)"},assistant:{label:"AI",color:"var(--success)"}};function A({message:t,onToolCallClick:r,toolCallIndices:o}){const i=t.role==="user",l=t.tool_calls&&t.tool_calls.length>0,a=J[i?"user":l?"tool":"assistant"];return e.jsxs("div",{className:"py-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[e.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:a.color}}),e.jsx("span",{className:"text-[11px] font-semibold",style:{color:a.color},children:a.label})]}),t.content&&(i?e.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose",style:{color:"var(--text-primary)"},children:t.content}):e.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose chat-markdown",style:{color:"var(--text-secondary)"},children:e.jsx(M,{remarkPlugins:[O],rehypePlugins:[T],children:t.content})})),t.tool_calls&&t.tool_calls.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-1 pl-2.5",children:t.tool_calls.map((p,c)=>e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-mono px-2 py-1 rounded cursor-pointer hover:brightness-125",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:p.has_result?"var(--success)":"var(--text-muted)"},onClick:()=>r==null?void 0:r(p.name,(o==null?void 0:o[c])??0),children:[p.has_result?"✓":"•"," ",p.name]},`${p.name}-${c}`))})]})}function L({onSend:t,disabled:r,placeholder:o}){const[i,l]=y.useState(""),u=()=>{const c=i.trim();c&&(t(c),l(""))},a=c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),u())},p=!r&&i.trim().length>0;return e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:[e.jsx("input",{value:i,onChange:c=>l(c.target.value),onKeyDown:a,disabled:r,placeholder:o??"Message...",className:"flex-1 bg-transparent text-sm py-1 disabled:opacity-40 placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),e.jsx("button",{onClick:u,disabled:!p,className:"text-xs font-semibold px-3 py-1.5 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed","aria-label":"Send message",style:{color:p?"var(--accent)":"var(--text-muted)",background:"transparent"},onMouseEnter:c=>{p&&(c.currentTarget.style.background="color-mix(in srgb, var(--accent) 10%, transparent)")},onMouseLeave:c=>{c.currentTarget.style.background="transparent"},children:"Send"})]})}function $(t){if(typeof t!="object"||t===null)return!1;const r=t;return typeof r.properties=="object"&&r.properties!==null&&Object.keys(r.properties).length>0}const f={color:"var(--text-primary)",border:"1px solid var(--border)",background:"var(--bg-primary)"},j="w-full text-[11px] font-mono py-1 px-2 rounded focus:outline-none";function R({name:t,prop:r,value:o,onChange:i}){const l=e.jsxs("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:[t,r.description&&e.jsxs("span",{className:"font-normal normal-case tracking-normal ml-1",style:{color:"var(--text-muted)",opacity:.7},children:["— ",r.description]})]});if(r.enum&&Array.isArray(r.enum))return e.jsxs("div",{children:[l,e.jsx("select",{value:String(o??""),onChange:a=>i(a.target.value),className:j,style:f,children:r.enum.map(a=>e.jsx("option",{value:String(a),children:String(a)},String(a)))})]});if(r.type==="boolean")return e.jsxs("div",{children:[l,e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer py-1",children:[e.jsx("input",{type:"checkbox",checked:!!o,onChange:a=>i(a.target.checked),className:"accent-[var(--accent)]"}),e.jsx("span",{className:"text-[11px] font-mono",style:{color:"var(--text-secondary)"},children:o?"true":"false"})]})]});if(r.type==="number"||r.type==="integer")return e.jsxs("div",{children:[l,e.jsx("input",{type:"number",value:o==null?"":String(o),onChange:a=>i(a.target.value===""?null:Number(a.target.value)),step:r.type==="integer"?1:"any",className:j,style:f})]});if(r.type==="object"||r.type==="array"){const a=typeof o=="string"?o:JSON.stringify(o??null,null,2);return e.jsxs("div",{children:[l,e.jsx("textarea",{value:a,onChange:p=>i(p.target.value),rows:3,className:`${j} resize-y`,style:f})]})}const u=o==null?"":String(o);return u.length>100||u.includes(` +import{j as e,a as y}from"./vendor-react-N5xbSGOh.js";import{M,r as T,a as O,u as S}from"./index-V3oNRyE_.js";import"./vendor-reactflow-CxoS0d5s.js";const J={user:{label:"You",color:"var(--info)"},tool:{label:"Tool",color:"var(--warning)"},assistant:{label:"AI",color:"var(--success)"}};function A({message:t,onToolCallClick:r,toolCallIndices:o}){const i=t.role==="user",l=t.tool_calls&&t.tool_calls.length>0,a=J[i?"user":l?"tool":"assistant"];return e.jsxs("div",{className:"py-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[e.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:a.color}}),e.jsx("span",{className:"text-[11px] font-semibold",style:{color:a.color},children:a.label})]}),t.content&&(i?e.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose",style:{color:"var(--text-primary)"},children:t.content}):e.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose chat-markdown",style:{color:"var(--text-secondary)"},children:e.jsx(M,{remarkPlugins:[O],rehypePlugins:[T],children:t.content})})),t.tool_calls&&t.tool_calls.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-1 pl-2.5",children:t.tool_calls.map((p,c)=>e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-mono px-2 py-1 rounded cursor-pointer hover:brightness-125",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:p.has_result?"var(--success)":"var(--text-muted)"},onClick:()=>r==null?void 0:r(p.name,(o==null?void 0:o[c])??0),children:[p.has_result?"✓":"•"," ",p.name]},`${p.name}-${c}`))})]})}function L({onSend:t,disabled:r,placeholder:o}){const[i,l]=y.useState(""),u=()=>{const c=i.trim();c&&(t(c),l(""))},a=c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),u())},p=!r&&i.trim().length>0;return e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:[e.jsx("input",{value:i,onChange:c=>l(c.target.value),onKeyDown:a,disabled:r,placeholder:o??"Message...",className:"flex-1 bg-transparent text-sm py-1 disabled:opacity-40 placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),e.jsx("button",{onClick:u,disabled:!p,className:"text-xs font-semibold px-3 py-1.5 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed","aria-label":"Send message",style:{color:p?"var(--accent)":"var(--text-muted)",background:"transparent"},onMouseEnter:c=>{p&&(c.currentTarget.style.background="color-mix(in srgb, var(--accent) 10%, transparent)")},onMouseLeave:c=>{c.currentTarget.style.background="transparent"},children:"Send"})]})}function $(t){if(typeof t!="object"||t===null)return!1;const r=t;return typeof r.properties=="object"&&r.properties!==null&&Object.keys(r.properties).length>0}const f={color:"var(--text-primary)",border:"1px solid var(--border)",background:"var(--bg-primary)"},j="w-full text-[11px] font-mono py-1 px-2 rounded focus:outline-none";function R({name:t,prop:r,value:o,onChange:i}){const l=e.jsxs("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:[t,r.description&&e.jsxs("span",{className:"font-normal normal-case tracking-normal ml-1",style:{color:"var(--text-muted)",opacity:.7},children:["— ",r.description]})]});if(r.enum&&Array.isArray(r.enum))return e.jsxs("div",{children:[l,e.jsx("select",{value:String(o??""),onChange:a=>i(a.target.value),className:j,style:f,children:r.enum.map(a=>e.jsx("option",{value:String(a),children:String(a)},String(a)))})]});if(r.type==="boolean")return e.jsxs("div",{children:[l,e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer py-1",children:[e.jsx("input",{type:"checkbox",checked:!!o,onChange:a=>i(a.target.checked),className:"accent-[var(--accent)]"}),e.jsx("span",{className:"text-[11px] font-mono",style:{color:"var(--text-secondary)"},children:o?"true":"false"})]})]});if(r.type==="number"||r.type==="integer")return e.jsxs("div",{children:[l,e.jsx("input",{type:"number",value:o==null?"":String(o),onChange:a=>i(a.target.value===""?null:Number(a.target.value)),step:r.type==="integer"?1:"any",className:j,style:f})]});if(r.type==="object"||r.type==="array"){const a=typeof o=="string"?o:JSON.stringify(o??null,null,2);return e.jsxs("div",{children:[l,e.jsx("textarea",{value:a,onChange:p=>i(p.target.value),rows:3,className:`${j} resize-y`,style:f})]})}const u=o==null?"":String(o);return u.length>100||u.includes(` `)?e.jsxs("div",{children:[l,e.jsx("textarea",{value:u,onChange:a=>i(a.target.value),rows:3,className:`${j} resize-y`,style:f})]}):e.jsxs("div",{children:[l,e.jsx("input",{type:"text",value:u,onChange:a=>i(a.target.value),className:j,style:f})]})}function _({label:t,color:r,onClick:o}){return e.jsx("button",{onClick:o,className:"text-xs font-semibold px-3 py-1.5 rounded cursor-pointer transition-colors",style:{background:`color-mix(in srgb, var(--${r}) 15%, var(--bg-secondary))`,color:`var(--${r})`,border:`1px solid color-mix(in srgb, var(--${r}) 30%, var(--border))`},onMouseEnter:i=>{i.currentTarget.style.background=`color-mix(in srgb, var(--${r}) 25%, var(--bg-secondary))`},onMouseLeave:i=>{i.currentTarget.style.background=`color-mix(in srgb, var(--${r}) 15%, var(--bg-secondary))`},children:t})}function F({interrupt:t,onRespond:r}){const[o,i]=y.useState(""),[l,u]=y.useState(!1),[a,p]=y.useState({}),[c,N]=y.useState(""),[k,h]=y.useState(null),g=t.input_schema,b=$(g),C=y.useCallback(()=>{const s=typeof t.input_value=="object"&&t.input_value!==null?t.input_value:{};if(b){const d={...s};for(const m of Object.keys(g.properties))m in d||(d[m]=null);const x=g.properties;for(const[m,v]of Object.entries(x))(v.type==="object"||v.type==="array")&&typeof d[m]!="string"&&(d[m]=JSON.stringify(d[m]??null,null,2));p(d)}else N(typeof t.input_value=="string"?t.input_value:JSON.stringify(t.input_value??null,null,2));h(null),u(!0)},[t.input_value,b,g]),E=()=>{u(!1),h(null)},w=()=>{if(b){const s={},d=g.properties;for(const[x,m]of Object.entries(a)){const v=d[x];if(((v==null?void 0:v.type)==="object"||(v==null?void 0:v.type)==="array")&&typeof m=="string")try{s[x]=JSON.parse(m)}catch{h(`Invalid JSON for "${x}"`);return}else s[x]=m}r({approved:!0,input:s})}else try{const s=JSON.parse(c);r({approved:!0,input:s})}catch{h("Invalid JSON");return}},n=y.useCallback((s,d)=>{p(x=>({...x,[s]:d}))},[]);return t.interrupt_type==="tool_call_confirmation"?e.jsxs("div",{className:"mx-3 my-2 rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--warning) 40%, var(--border))"},children:[e.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"color-mix(in srgb, var(--warning) 10%, var(--bg-secondary))"},children:[e.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--warning)"},children:l?"Edit Arguments":"Action Required"}),t.tool_name&&e.jsx("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--text-primary)"},children:t.tool_name}),!l&&(t.input_value!=null||b)&&e.jsx("button",{onClick:C,className:"ml-auto p-1.5 rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)"},"aria-label":"Edit arguments",onMouseEnter:s=>{s.currentTarget.style.color="var(--warning)"},onMouseLeave:s=>{s.currentTarget.style.color="var(--text-muted)"},title:"Edit arguments",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),e.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})})]}),l?e.jsxs("div",{className:"px-3 py-2 space-y-3 overflow-y-auto",style:{background:"var(--bg-secondary)",maxHeight:300},children:[b?Object.entries(g.properties).map(([s,d])=>e.jsx(R,{name:s,prop:d,value:a[s],onChange:x=>n(s,x)},s)):e.jsx("textarea",{value:c,onChange:s=>{N(s.target.value),h(null)},rows:8,className:"w-full text-[11px] font-mono py-1 px-2 rounded focus:outline-none resize-y",style:f}),k&&e.jsx("p",{className:"text-[11px]",style:{color:"var(--error)"},children:k})]}):t.input_value!=null&&e.jsx("pre",{className:"px-3 py-2 text-[11px] font-mono whitespace-pre-wrap break-words overflow-y-auto leading-normal",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)",maxHeight:200},children:typeof t.input_value=="string"?t.input_value:JSON.stringify(t.input_value,null,2)}),e.jsx("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--bg-secondary)",borderTop:"1px solid var(--border)"},children:l?e.jsxs(e.Fragment,{children:[e.jsx(_,{label:"Approve",color:"success",onClick:w}),e.jsx(_,{label:"Cancel",color:"text-muted",onClick:E})]}):e.jsxs(e.Fragment,{children:[e.jsx(_,{label:"Approve",color:"success",onClick:()=>r({approved:!0})}),e.jsx(_,{label:"Reject",color:"error",onClick:()=>r({approved:!1})})]})})]}):e.jsxs("div",{className:"mx-3 my-2 rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--accent) 40%, var(--border))"},children:[e.jsx("div",{className:"px-3 py-2",style:{background:"color-mix(in srgb, var(--accent) 10%, var(--bg-secondary))"},children:e.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--accent)"},children:"Input Required"})}),t.content!=null&&e.jsx("div",{className:"px-3 py-2 text-sm leading-relaxed",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)"},children:typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2)}),e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--bg-secondary)",borderTop:"1px solid var(--border)"},children:[e.jsx("input",{value:o,onChange:s=>i(s.target.value),onKeyDown:s=>{s.key==="Enter"&&!s.shiftKey&&o.trim()&&(s.preventDefault(),r({response:o.trim()}))},placeholder:"Type your response...",className:"flex-1 bg-transparent text-sm py-1 placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),e.jsx("button",{onClick:()=>{o.trim()&&r({response:o.trim()})},disabled:!o.trim(),className:"text-xs font-semibold px-3 py-1.5 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:o.trim()?"var(--accent)":"var(--text-muted)",background:"transparent"},children:"Send"})]})]})}function I({messages:t,runId:r,runStatus:o,ws:i}){const l=y.useRef(null),u=y.useRef(!0),a=S(n=>n.addLocalChatMessage),p=S(n=>n.setFocusedSpan),c=S(n=>n.activeInterrupt[r]??null),N=S(n=>n.setActiveInterrupt),k=y.useMemo(()=>{const n=new Map,s=new Map;for(const d of t)if(d.tool_calls){const x=[];for(const m of d.tool_calls){const v=s.get(m.name)??0;x.push(v),s.set(m.name,v+1)}n.set(d.message_id,x)}return n},[t]),[h,g]=y.useState(!1),b=()=>{const n=l.current;if(!n)return;const s=n.scrollHeight-n.scrollTop-n.clientHeight<40;u.current=s,g(n.scrollTop>100)};y.useEffect(()=>{u.current&&l.current&&(l.current.scrollTop=l.current.scrollHeight)});const C=n=>{u.current=!0,a(r,{message_id:`local-${Date.now()}`,role:"user",content:n}),i.sendChatMessage(r,n)},E=n=>{u.current=!0,i.sendInterruptResponse(r,n),N(r,null)},w=o==="running"||!!c;return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[e.jsxs("div",{ref:l,onScroll:b,className:"h-full overflow-y-auto px-3 py-2 space-y-0.5",children:[t.length===0&&e.jsx("p",{className:"text-[var(--text-muted)] text-sm text-center py-6",children:"No messages yet"}),t.map(n=>e.jsx(A,{message:n,toolCallIndices:k.get(n.message_id),onToolCallClick:(s,d)=>p({name:s,index:d})},n.message_id)),c&&e.jsx(F,{interrupt:c,onRespond:E})]}),h&&e.jsx("button",{onClick:()=>{var n;return(n=l.current)==null?void 0:n.scrollTo({top:0,behavior:"smooth"})},className:"absolute top-2 right-3 w-6 h-6 flex items-center justify-center rounded-full cursor-pointer transition-opacity opacity-70 hover:opacity-100",style:{background:"var(--bg-tertiary)",color:"var(--text-primary)"},title:"Scroll to top",children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"18 15 12 9 6 15"})})})]}),e.jsx(L,{onSend:C,disabled:w,placeholder:c?"Respond to the interrupt above...":w?"Waiting for response...":"Message..."})]})}export{I as default}; diff --git a/src/uipath/dev/server/static/assets/index-CzFU-Cnb.css b/src/uipath/dev/server/static/assets/index-CzFU-Cnb.css deleted file mode 100644 index dab1bbc..0000000 --- a/src/uipath/dev/server/static/assets/index-CzFU-Cnb.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial;--tw-ease:initial;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--spacing:.25rem;--container-xs:20rem;--container-xl:36rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-normal:1.5;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.top-1{top:calc(var(--spacing) * 1)}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-2{top:calc(var(--spacing) * 2)}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-1{right:calc(var(--spacing) * 1)}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.bottom-1\.5{bottom:calc(var(--spacing) * 1.5)}.bottom-8{bottom:calc(var(--spacing) * 8)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing) * 0)}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.my-2{margin-block:calc(var(--spacing) * 2)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.mr-0\.5{margin-right:calc(var(--spacing) * .5)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-\[14px\]{height:14px}.h-full{height:100%}.h-screen{height:100vh}.max-h-32{max-height:calc(var(--spacing) * 32)}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-\[85vh\]{max-height:85vh}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-full{min-height:100%}.w-0\.5{width:calc(var(--spacing) * .5)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-24{width:calc(var(--spacing) * 24)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-44{width:calc(var(--spacing) * 44)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-\[200px\]{width:200px}.w-\[calc\(100\%-24px\)\]{width:calc(100% - 24px)}.w-full{width:100%}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\[160px\]{max-width:160px}.max-w-\[200px\]{max-width:200px}.max-w-prose{max-width:65ch}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[140px\]{min-width:140px}.min-w-\[180px\]{min-width:180px}.min-w-\[400px\]{min-width:400px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\[slideIn_0\.2s_ease-out\]{animation:.2s ease-out slideIn}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.appearance-auto{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-\[var\(--border\)\]{border-color:var(--border)}.bg-\[var\(--bg-primary\)\]{background-color:var(--bg-primary)}.bg-\[var\(--sidebar-bg\)\]{background-color:var(--sidebar-bg)}.bg-transparent{background-color:#0000}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-\[3px\]{padding-block:3px}.pt-0{padding-top:calc(var(--spacing) * 0)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-1\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-px{padding-top:1px}.pr-0{padding-right:calc(var(--spacing) * 0)}.pr-1{padding-right:calc(var(--spacing) * 1)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pb-0\.5{padding-bottom:calc(var(--spacing) * .5)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-\[22px\]{padding-left:22px}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--text-muted\)\]{color:var(--text-muted)}.text-\[var\(--text-primary\)\]{color:var(--text-primary)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.accent-\[var\(--accent\)\]{accent-color:var(--accent)}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.outline-none{--tw-outline-style:none;outline-style:none}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-\[var\(--text-muted\)\]::placeholder{color:var(--text-muted)}@media(hover:hover){.hover\:bg-\[var\(--bg-hover\)\]:hover{background-color:var(--bg-hover)}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-100:hover{opacity:1}.hover\:brightness-125:hover{--tw-brightness:brightness(125%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}}pre code.hljs{padding:1em;display:block;overflow-x:auto}code.hljs{padding:3px 5px}.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}:root,[data-theme=dark]{--bg-primary:#0f172a;--bg-secondary:#1e293b;--bg-tertiary:#334155;--bg-hover:#263348;--bg-elevated:#253041;--text-primary:#cbd5e1;--text-secondary:#94a3b8;--text-muted:#64748b;--border:#334155;--accent:#fa4616;--accent-hover:#e03d12;--accent-light:#ff6a3d;--success:#22c55e;--warning:#eab308;--error:#ef4444;--info:#3b82f6;--sidebar-bg:#0e1526;--activity-bar-bg:#0a1020;--card-bg:#1e293b;--input-bg:#0f172a;--code-bg:#0f172a;--tab-active:#fa4616;--tab-text:#94a3b8;--tab-text-active:#fa4616;--node-bg:#1e293b;--node-border:#475569;--scrollbar-thumb:#334155;color-scheme:dark}[data-theme=light]{--bg-primary:#f8fafc;--bg-secondary:#fff;--bg-tertiary:#cbd5e1;--bg-hover:#f1f5f9;--bg-elevated:#fff;--text-primary:#0f172a;--text-secondary:#475569;--text-muted:#94a3b8;--border:#e2e8f0;--accent:#fa4616;--accent-hover:#e03d12;--accent-light:#ff6a3d;--success:#22c55e;--warning:#ca8a04;--error:#ef4444;--info:#2563eb;--sidebar-bg:#fff;--activity-bar-bg:#f1f5f9;--card-bg:#fff;--input-bg:#f8fafc;--code-bg:#e8ecf1;--tab-active:#fa4616;--tab-text:#64748b;--tab-text-active:#fa4616;--node-bg:#fff;--node-border:#cbd5e1;--scrollbar-thumb:#d1d5db;color-scheme:light}body{background:var(--bg-primary);color:var(--text-primary);margin:0;font-family:Inter,system-ui,-apple-system,sans-serif;transition:background-color .2s,color .2s}#root{height:100dvh;display:flex}:focus-visible{outline:2px solid var(--accent);outline-offset:1px}button:focus-visible,[role=button]:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid var(--accent)}@supports (color:color-mix(in lab,red,red)){button:focus-visible,[role=button]:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid color-mix(in srgb,var(--accent) 60%,transparent)}}button:focus-visible,[role=button]:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline-offset:0px;border-radius:3px}.drag-handle-row{cursor:row-resize;background:var(--border);height:3px;transition:background .15s;position:relative}.drag-handle-row:before{content:"";position:absolute;top:-5px;right:0;bottom:-5px;left:0}.drag-handle-row:hover,.drag-handle-row:active{background:var(--accent)}.drag-handle-col{cursor:col-resize;background:var(--border);width:3px;transition:background .15s;position:relative}.drag-handle-col:before{content:"";position:absolute;top:0;right:-5px;bottom:0;left:-5px}.drag-handle-col:hover,.drag-handle-col:active{background:var(--accent)}@keyframes skeleton-pulse{0%,to{opacity:.4}50%{opacity:.7}}.skeleton{background:var(--bg-tertiary);border-radius:4px;animation:1.5s ease-in-out infinite skeleton-pulse}.react-flow__node{font-size:12px}.react-flow__node-default{background:var(--node-bg)!important;color:var(--text-primary)!important;border-color:var(--node-border)!important}.react-flow__background{background:var(--bg-primary)!important}.react-flow__controls button{background:var(--bg-secondary)!important;color:var(--text-primary)!important;border-color:var(--border)!important}.react-flow__controls button:hover{background:var(--bg-hover)!important}.react-flow__controls button svg{fill:var(--text-primary)!important}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:var(--bg-secondary)}::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb);border-radius:3px}select{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}select option{background:var(--bg-secondary);color:var(--text-primary)}.chat-markdown p{margin:.25em 0}.chat-markdown p:first-child{margin-top:0}.chat-markdown p:last-child{margin-bottom:0}.chat-markdown code{background:var(--code-bg);border:1px solid var(--border);border-radius:3px;padding:.1em .35em;font-size:.85em}.chat-markdown pre{background:var(--code-bg);border:1px solid var(--border);border-radius:6px;margin:.5em 0;padding:.75em;overflow-x:auto}.chat-markdown pre code{background:0 0;border:none;padding:0;font-size:.85em}.chat-markdown ul,.chat-markdown ol{margin:.25em 0;padding-left:1.5em}.chat-markdown li{margin:.1em 0}.chat-markdown h1,.chat-markdown h2,.chat-markdown h3{margin:.5em 0 .25em;font-weight:600}.chat-markdown h1{font-size:1.2em}.chat-markdown h2{font-size:1.1em}.chat-markdown h3{font-size:1em}.chat-markdown blockquote{border-left:3px solid var(--border);color:var(--text-secondary);margin:.25em 0;padding-left:.75em}.chat-markdown strong{font-weight:600}.chat-markdown a{color:var(--accent);text-decoration:underline}.chat-markdown table{border-collapse:collapse;width:100%;margin:.5em 0}.chat-markdown th,.chat-markdown td{border:1px solid var(--border);text-align:left;padding:.3em .6em}.chat-markdown th{background:var(--code-bg);font-weight:600}.chat-markdown tr:nth-child(2n){background:var(--code-bg)}.chat-markdown .hljs{background:0 0}[data-theme=light] .chat-markdown .hljs{color:#24292e}[data-theme=light] .chat-markdown .hljs-doctag,[data-theme=light] .chat-markdown .hljs-keyword,[data-theme=light] .chat-markdown .hljs-meta .hljs-keyword,[data-theme=light] .chat-markdown .hljs-template-tag,[data-theme=light] .chat-markdown .hljs-template-variable,[data-theme=light] .chat-markdown .hljs-type,[data-theme=light] .chat-markdown .hljs-variable.language_{color:#d73a49}[data-theme=light] .chat-markdown .hljs-title,[data-theme=light] .chat-markdown .hljs-title.class_,[data-theme=light] .chat-markdown .hljs-title.class_.inherited__,[data-theme=light] .chat-markdown .hljs-title.function_{color:#6f42c1}[data-theme=light] .chat-markdown .hljs-attr,[data-theme=light] .chat-markdown .hljs-attribute,[data-theme=light] .chat-markdown .hljs-literal,[data-theme=light] .chat-markdown .hljs-meta,[data-theme=light] .chat-markdown .hljs-number,[data-theme=light] .chat-markdown .hljs-operator,[data-theme=light] .chat-markdown .hljs-variable,[data-theme=light] .chat-markdown .hljs-selector-attr,[data-theme=light] .chat-markdown .hljs-selector-class,[data-theme=light] .chat-markdown .hljs-selector-id{color:#005cc5}[data-theme=light] .chat-markdown .hljs-regexp,[data-theme=light] .chat-markdown .hljs-string,[data-theme=light] .chat-markdown .hljs-meta .hljs-string{color:#032f62}[data-theme=light] .chat-markdown .hljs-built_in,[data-theme=light] .chat-markdown .hljs-symbol{color:#e36209}[data-theme=light] .chat-markdown .hljs-comment,[data-theme=light] .chat-markdown .hljs-code,[data-theme=light] .chat-markdown .hljs-formula{color:#6a737d}[data-theme=light] .chat-markdown .hljs-name,[data-theme=light] .chat-markdown .hljs-quote,[data-theme=light] .chat-markdown .hljs-selector-tag,[data-theme=light] .chat-markdown .hljs-selector-pseudo{color:#22863a}[data-theme=light] .chat-markdown .hljs-subst{color:#24292e}[data-theme=light] .chat-markdown .hljs-section{color:#005cc5}[data-theme=light] .chat-markdown .hljs-bullet{color:#735c0f}[data-theme=light] .chat-markdown .hljs-addition{color:#22863a;background-color:#f0fff4}[data-theme=light] .chat-markdown .hljs-deletion{color:#b31d28;background-color:#ffeef0}@keyframes agent-changed-pulse{0%,to{box-shadow:inset 0 0 0 50px color-mix(in srgb,var(--success) 20%,transparent)}50%{box-shadow:none}}.agent-changed-file{animation:2s ease-in-out 3 agent-changed-pulse}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}} diff --git a/src/uipath/dev/server/static/assets/index-D4dH-hau.css b/src/uipath/dev/server/static/assets/index-D4dH-hau.css new file mode 100644 index 0000000..23dac34 --- /dev/null +++ b/src/uipath/dev/server/static/assets/index-D4dH-hau.css @@ -0,0 +1 @@ +/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial;--tw-ease:initial;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--spacing:.25rem;--container-xs:20rem;--container-xl:36rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-normal:1.5;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.top-1{top:calc(var(--spacing) * 1)}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-2{top:calc(var(--spacing) * 2)}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-1{right:calc(var(--spacing) * 1)}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.bottom-1\.5{bottom:calc(var(--spacing) * 1.5)}.bottom-8{bottom:calc(var(--spacing) * 8)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing) * 0)}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.my-2{margin-block:calc(var(--spacing) * 2)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.mr-0\.5{margin-right:calc(var(--spacing) * .5)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-\[14px\]{height:14px}.h-full{height:100%}.h-screen{height:100vh}.max-h-32{max-height:calc(var(--spacing) * 32)}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-\[85vh\]{max-height:85vh}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-full{min-height:100%}.w-0\.5{width:calc(var(--spacing) * .5)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-24{width:calc(var(--spacing) * 24)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-44{width:calc(var(--spacing) * 44)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-\[200px\]{width:200px}.w-\[calc\(100\%-24px\)\]{width:calc(100% - 24px)}.w-full{width:100%}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\[160px\]{max-width:160px}.max-w-\[200px\]{max-width:200px}.max-w-prose{max-width:65ch}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[140px\]{min-width:140px}.min-w-\[180px\]{min-width:180px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\[slideIn_0\.2s_ease-out\]{animation:.2s ease-out slideIn}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.appearance-auto{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-\[var\(--border\)\]{border-color:var(--border)}.bg-\[var\(--bg-primary\)\]{background-color:var(--bg-primary)}.bg-\[var\(--sidebar-bg\)\]{background-color:var(--sidebar-bg)}.bg-transparent{background-color:#0000}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-0\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-\[3px\]{padding-block:3px}.pt-0{padding-top:calc(var(--spacing) * 0)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-1\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-px{padding-top:1px}.pr-0{padding-right:calc(var(--spacing) * 0)}.pr-1{padding-right:calc(var(--spacing) * 1)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pb-0\.5{padding-bottom:calc(var(--spacing) * .5)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-\[22px\]{padding-left:22px}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--text-muted\)\]{color:var(--text-muted)}.text-\[var\(--text-primary\)\]{color:var(--text-primary)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.accent-\[var\(--accent\)\]{accent-color:var(--accent)}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.outline-none{--tw-outline-style:none;outline-style:none}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-\[var\(--text-muted\)\]::placeholder{color:var(--text-muted)}@media(hover:hover){.hover\:bg-\[var\(--bg-hover\)\]:hover{background-color:var(--bg-hover)}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-100:hover{opacity:1}.hover\:brightness-125:hover{--tw-brightness:brightness(125%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}}pre code.hljs{padding:1em;display:block;overflow-x:auto}code.hljs{padding:3px 5px}.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}:root,[data-theme=dark]{--bg-primary:#0f172a;--bg-secondary:#1e293b;--bg-tertiary:#334155;--bg-hover:#263348;--bg-elevated:#253041;--text-primary:#cbd5e1;--text-secondary:#94a3b8;--text-muted:#64748b;--border:#334155;--accent:#fa4616;--accent-hover:#e03d12;--accent-light:#ff6a3d;--success:#22c55e;--warning:#eab308;--error:#ef4444;--info:#3b82f6;--sidebar-bg:#0e1526;--activity-bar-bg:#0a1020;--card-bg:#1e293b;--input-bg:#0f172a;--code-bg:#0f172a;--tab-active:#fa4616;--tab-text:#94a3b8;--tab-text-active:#fa4616;--node-bg:#1e293b;--node-border:#475569;--scrollbar-thumb:#334155;color-scheme:dark}[data-theme=light]{--bg-primary:#f8fafc;--bg-secondary:#fff;--bg-tertiary:#cbd5e1;--bg-hover:#f1f5f9;--bg-elevated:#fff;--text-primary:#0f172a;--text-secondary:#475569;--text-muted:#94a3b8;--border:#e2e8f0;--accent:#fa4616;--accent-hover:#e03d12;--accent-light:#ff6a3d;--success:#22c55e;--warning:#ca8a04;--error:#ef4444;--info:#2563eb;--sidebar-bg:#fff;--activity-bar-bg:#f1f5f9;--card-bg:#fff;--input-bg:#f8fafc;--code-bg:#e8ecf1;--tab-active:#fa4616;--tab-text:#64748b;--tab-text-active:#fa4616;--node-bg:#fff;--node-border:#cbd5e1;--scrollbar-thumb:#d1d5db;color-scheme:light}body{background:var(--bg-primary);color:var(--text-primary);margin:0;font-family:Inter,system-ui,-apple-system,sans-serif;transition:background-color .2s,color .2s}#root{height:100dvh;display:flex}:focus-visible{outline:2px solid var(--accent);outline-offset:1px}button:focus-visible,[role=button]:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid var(--accent)}@supports (color:color-mix(in lab,red,red)){button:focus-visible,[role=button]:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid color-mix(in srgb,var(--accent) 60%,transparent)}}button:focus-visible,[role=button]:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline-offset:0px;border-radius:3px}.drag-handle-row{cursor:row-resize;background:var(--border);height:3px;transition:background .15s;position:relative}.drag-handle-row:before{content:"";position:absolute;top:-5px;right:0;bottom:-5px;left:0}.drag-handle-row:hover,.drag-handle-row:active{background:var(--accent)}.drag-handle-col{cursor:col-resize;background:var(--border);width:3px;transition:background .15s;position:relative}.drag-handle-col:before{content:"";position:absolute;top:0;right:-5px;bottom:0;left:-5px}.drag-handle-col:hover,.drag-handle-col:active{background:var(--accent)}@keyframes skeleton-pulse{0%,to{opacity:.4}50%{opacity:.7}}.skeleton{background:var(--bg-tertiary);border-radius:4px;animation:1.5s ease-in-out infinite skeleton-pulse}.react-flow__node{font-size:12px}.react-flow__node-default{background:var(--node-bg)!important;color:var(--text-primary)!important;border-color:var(--node-border)!important}.react-flow__background{background:var(--bg-primary)!important}.react-flow__controls button{background:var(--bg-secondary)!important;color:var(--text-primary)!important;border-color:var(--border)!important}.react-flow__controls button:hover{background:var(--bg-hover)!important}.react-flow__controls button svg{fill:var(--text-primary)!important}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:var(--bg-secondary)}::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb);border-radius:3px}select{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}select option{background:var(--bg-secondary);color:var(--text-primary)}.chat-markdown p{margin:.25em 0}.chat-markdown p:first-child{margin-top:0}.chat-markdown p:last-child{margin-bottom:0}.chat-markdown code{background:var(--code-bg);border:1px solid var(--border);border-radius:3px;padding:.1em .35em;font-size:.85em}.chat-markdown pre{background:var(--code-bg);border:1px solid var(--border);border-radius:6px;margin:.5em 0;padding:.75em;overflow-x:auto}.chat-markdown pre code{background:0 0;border:none;padding:0;font-size:.85em}.chat-markdown ul,.chat-markdown ol{margin:.25em 0;padding-left:1.5em}.chat-markdown li{margin:.1em 0}.chat-markdown h1,.chat-markdown h2,.chat-markdown h3{margin:.5em 0 .25em;font-weight:600}.chat-markdown h1{font-size:1.2em}.chat-markdown h2{font-size:1.1em}.chat-markdown h3{font-size:1em}.chat-markdown blockquote{border-left:3px solid var(--border);color:var(--text-secondary);margin:.25em 0;padding-left:.75em}.chat-markdown strong{font-weight:600}.chat-markdown a{color:var(--accent);text-decoration:underline}.chat-markdown table{border-collapse:collapse;width:100%;margin:.5em 0}.chat-markdown th,.chat-markdown td{border:1px solid var(--border);text-align:left;padding:.3em .6em}.chat-markdown th{background:var(--code-bg);font-weight:600}.chat-markdown tr:nth-child(2n){background:var(--code-bg)}.chat-markdown .hljs{background:0 0}[data-theme=light] .chat-markdown .hljs{color:#24292e}[data-theme=light] .chat-markdown .hljs-doctag,[data-theme=light] .chat-markdown .hljs-keyword,[data-theme=light] .chat-markdown .hljs-meta .hljs-keyword,[data-theme=light] .chat-markdown .hljs-template-tag,[data-theme=light] .chat-markdown .hljs-template-variable,[data-theme=light] .chat-markdown .hljs-type,[data-theme=light] .chat-markdown .hljs-variable.language_{color:#d73a49}[data-theme=light] .chat-markdown .hljs-title,[data-theme=light] .chat-markdown .hljs-title.class_,[data-theme=light] .chat-markdown .hljs-title.class_.inherited__,[data-theme=light] .chat-markdown .hljs-title.function_{color:#6f42c1}[data-theme=light] .chat-markdown .hljs-attr,[data-theme=light] .chat-markdown .hljs-attribute,[data-theme=light] .chat-markdown .hljs-literal,[data-theme=light] .chat-markdown .hljs-meta,[data-theme=light] .chat-markdown .hljs-number,[data-theme=light] .chat-markdown .hljs-operator,[data-theme=light] .chat-markdown .hljs-variable,[data-theme=light] .chat-markdown .hljs-selector-attr,[data-theme=light] .chat-markdown .hljs-selector-class,[data-theme=light] .chat-markdown .hljs-selector-id{color:#005cc5}[data-theme=light] .chat-markdown .hljs-regexp,[data-theme=light] .chat-markdown .hljs-string,[data-theme=light] .chat-markdown .hljs-meta .hljs-string{color:#032f62}[data-theme=light] .chat-markdown .hljs-built_in,[data-theme=light] .chat-markdown .hljs-symbol{color:#e36209}[data-theme=light] .chat-markdown .hljs-comment,[data-theme=light] .chat-markdown .hljs-code,[data-theme=light] .chat-markdown .hljs-formula{color:#6a737d}[data-theme=light] .chat-markdown .hljs-name,[data-theme=light] .chat-markdown .hljs-quote,[data-theme=light] .chat-markdown .hljs-selector-tag,[data-theme=light] .chat-markdown .hljs-selector-pseudo{color:#22863a}[data-theme=light] .chat-markdown .hljs-subst{color:#24292e}[data-theme=light] .chat-markdown .hljs-section{color:#005cc5}[data-theme=light] .chat-markdown .hljs-bullet{color:#735c0f}[data-theme=light] .chat-markdown .hljs-addition{color:#22863a;background-color:#f0fff4}[data-theme=light] .chat-markdown .hljs-deletion{color:#b31d28;background-color:#ffeef0}@keyframes agent-changed-pulse{0%,to{box-shadow:inset 0 0 0 50px color-mix(in srgb,var(--success) 20%,transparent)}50%{box-shadow:none}}.agent-changed-file{animation:2s ease-in-out 3 agent-changed-pulse}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}} diff --git a/src/uipath/dev/server/static/assets/index-RLauX7zc.js b/src/uipath/dev/server/static/assets/index-V3oNRyE_.js similarity index 65% rename from src/uipath/dev/server/static/assets/index-RLauX7zc.js rename to src/uipath/dev/server/static/assets/index-V3oNRyE_.js index 371785f..9101204 100644 --- a/src/uipath/dev/server/static/assets/index-RLauX7zc.js +++ b/src/uipath/dev/server/static/assets/index-V3oNRyE_.js @@ -1,10 +1,10 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-elk-CiLKfHel.js","assets/vendor-react-N5xbSGOh.js","assets/ChatPanel-DiTmerW3.js","assets/vendor-reactflow-CxoS0d5s.js","assets/vendor-reactflow-B5DZHykP.css"])))=>i.map(i=>d[i]); -var Sl=Object.defineProperty;var Tl=(e,t,n)=>t in e?Sl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var It=(e,t,n)=>Tl(e,typeof t!="symbol"?t+"":t,n);import{W as Tn,a as N,j as a,w as Cl,F as Al,g as Xr,b as Ml}from"./vendor-react-N5xbSGOh.js";import{H as ht,P as bt,B as Il,M as Rl,u as Ol,a as Ll,R as jl,b as Dl,C as Pl,c as Bl,d as Fl}from"./vendor-reactflow-CxoS0d5s.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();const Mi=e=>{let t;const n=new Set,r=(c,d)=>{const p=typeof c=="function"?c(t):c;if(!Object.is(p,t)){const m=t;t=d??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(f=>f(t,m))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c))},u=t=e(r,i,l);return l},zl=(e=>e?Mi(e):Mi),$l=e=>e;function Ul(e,t=$l){const n=Tn.useSyncExternalStore(e.subscribe,Tn.useCallback(()=>t(e.getState()),[e,t]),Tn.useCallback(()=>t(e.getInitialState()),[e,t]));return Tn.useDebugValue(n),n}const Ii=e=>{const t=zl(e),n=r=>Ul(t,r);return Object.assign(n,t),n},Ot=(e=>e?Ii(e):Ii),Ee=Ot(e=>({runs:{},selectedRunId:null,traces:{},logs:{},chatMessages:{},entrypoints:[],setRuns:t=>e(n=>{var s;let r=n.breakpoints;for(const o of t)(s=o.breakpoints)!=null&&s.length&&!r[o.id]&&(r={...r,[o.id]:Object.fromEntries(o.breakpoints.map(l=>[l,!0]))});const i={runs:Object.fromEntries(t.map(o=>[o.id,o]))};return r!==n.breakpoints&&(i.breakpoints=r),i}),upsertRun:t=>e(n=>{var i;const r={runs:{...n.runs,[t.id]:t}};if((i=t.breakpoints)!=null&&i.length&&!n.breakpoints[t.id]&&(r.breakpoints={...n.breakpoints,[t.id]:Object.fromEntries(t.breakpoints.map(s=>[s,!0]))}),(t.status==="completed"||t.status==="failed")&&n.activeNodes[t.id]){const{[t.id]:s,...o}=n.activeNodes;r.activeNodes=o}if(t.status!=="suspended"&&n.activeInterrupt[t.id]){const{[t.id]:s,...o}=n.activeInterrupt;r.activeInterrupt=o}return r}),selectRun:t=>e({selectedRunId:t}),addTrace:t=>e(n=>{const r=n.traces[t.run_id]??[],i=r.findIndex(o=>o.span_id===t.span_id),s=i>=0?r.map((o,l)=>l===i?t:o):[...r,t];return{traces:{...n.traces,[t.run_id]:s}}}),setTraces:(t,n)=>e(r=>({traces:{...r.traces,[t]:n}})),addLog:t=>e(n=>{const r=n.logs[t.run_id]??[];return{logs:{...n.logs,[t.run_id]:[...r,t]}}}),setLogs:(t,n)=>e(r=>({logs:{...r.logs,[t]:n}})),addChatEvent:(t,n)=>e(r=>{const i=r.chatMessages[t]??[],s=n.message;if(!s)return r;const o=s.messageId??s.message_id,l=s.role??"assistant",d=(s.contentParts??s.content_parts??[]).filter(b=>{const x=b.mimeType??b.mime_type??"";return x.startsWith("text/")||x==="application/json"}).map(b=>{const x=b.data;return(x==null?void 0:x.inline)??""}).join(` -`).trim(),p=(s.toolCalls??s.tool_calls??[]).map(b=>({name:b.name??"",has_result:!!b.result})),m={message_id:o,role:l,content:d,tool_calls:p.length>0?p:void 0},f=i.findIndex(b=>b.message_id===o);if(f>=0)return{chatMessages:{...r.chatMessages,[t]:i.map((b,x)=>x===f?m:b)}};if(l==="user"){const b=i.findIndex(x=>x.message_id.startsWith("local-")&&x.role==="user"&&x.content===d);if(b>=0)return{chatMessages:{...r.chatMessages,[t]:i.map((x,y)=>y===b?m:x)}}}const h=[...i,m];return{chatMessages:{...r.chatMessages,[t]:h}}}),addLocalChatMessage:(t,n)=>e(r=>{const i=r.chatMessages[t]??[];return{chatMessages:{...r.chatMessages,[t]:[...i,n]}}}),setChatMessages:(t,n)=>e(r=>({chatMessages:{...r.chatMessages,[t]:n}})),setEntrypoints:t=>e({entrypoints:t}),breakpoints:{},toggleBreakpoint:(t,n)=>e(r=>{const i={...r.breakpoints[t]??{}};return i[n]?delete i[n]:i[n]=!0,{breakpoints:{...r.breakpoints,[t]:i}}}),clearBreakpoints:t=>e(n=>{const{[t]:r,...i}=n.breakpoints;return{breakpoints:i}}),activeNodes:{},setActiveNode:(t,n,r)=>e(i=>{const s=i.activeNodes[t]??{executing:{},prev:null};return{activeNodes:{...i.activeNodes,[t]:{executing:{...s.executing,[n]:r??null},prev:s.prev}}}}),removeActiveNode:(t,n)=>e(r=>{const i=r.activeNodes[t];if(!i)return r;const{[n]:s,...o}=i.executing;return{activeNodes:{...r.activeNodes,[t]:{executing:o,prev:n}}}}),resetRunGraphState:t=>e(n=>({stateEvents:{...n.stateEvents,[t]:[]},activeNodes:{...n.activeNodes,[t]:{executing:{},prev:null}}})),stateEvents:{},addStateEvent:(t,n,r,i,s)=>e(o=>{const l=o.stateEvents[t]??[];return{stateEvents:{...o.stateEvents,[t]:[...l,{node_name:n,qualified_node_name:i,phase:s,timestamp:Date.now(),payload:r}]}}}),setStateEvents:(t,n)=>e(r=>({stateEvents:{...r.stateEvents,[t]:n}})),focusedSpan:null,setFocusedSpan:t=>e({focusedSpan:t}),activeInterrupt:{},setActiveInterrupt:(t,n)=>e(r=>({activeInterrupt:{...r.activeInterrupt,[t]:n}})),reloadPending:!1,setReloadPending:t=>e({reloadPending:t}),graphCache:{},setGraphCache:(t,n)=>e(r=>({graphCache:{...r.graphCache,[t]:n}}))})),Yn="/api";async function Hl(e){const t=await fetch(`${Yn}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({environment:e})});if(!t.ok)throw new Error(`Login failed: ${t.status}`);return t.json()}async function cr(){const e=await fetch(`${Yn}/auth/status`);if(!e.ok)throw new Error(`Status check failed: ${e.status}`);return e.json()}async function Wl(e){const t=await fetch(`${Yn}/auth/select-tenant`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tenant_name:e})});if(!t.ok)throw new Error(`Tenant selection failed: ${t.status}`);return t.json()}async function Kl(){await fetch(`${Yn}/auth/logout`,{method:"POST"})}const ys="uipath-env",Gl=["cloud","staging","alpha"];function ql(){const e=localStorage.getItem(ys);return Gl.includes(e)?e:"cloud"}const zn=Ot((e,t)=>({enabled:!0,status:"unauthenticated",environment:ql(),tenants:[],uipathUrl:null,pollTimer:null,expiryTimer:null,init:async()=>{try{const n=await fetch("/api/config");if(n.ok&&!(await n.json()).auth_enabled){e({enabled:!1});return}const r=await cr();e({status:r.status,tenants:r.tenants??[],uipathUrl:r.uipath_url??null}),r.status==="authenticated"&&t().startExpiryCheck()}catch(n){console.error("Auth init failed",n)}},setEnvironment:n=>{localStorage.setItem(ys,n),e({environment:n})},startLogin:async()=>{const{environment:n}=t();try{const r=await Hl(n);e({status:"pending"}),window.open(r.auth_url,"_blank"),t().pollStatus()}catch(r){console.error("Login failed",r)}},pollStatus:()=>{const{pollTimer:n}=t();if(n)return;const r=setInterval(async()=>{try{const i=await cr();i.status!=="pending"&&(t().stopPolling(),e({status:i.status,tenants:i.tenants??[],uipathUrl:i.uipath_url??null}),i.status==="authenticated"&&t().startExpiryCheck())}catch{}},2e3);e({pollTimer:r})},stopPolling:()=>{const{pollTimer:n}=t();n&&(clearInterval(n),e({pollTimer:null}))},startExpiryCheck:()=>{const{expiryTimer:n}=t();if(n)return;const r=setInterval(async()=>{try{(await cr()).status==="expired"&&(t().stopExpiryCheck(),e({status:"expired"}))}catch{}},3e4);e({expiryTimer:r})},stopExpiryCheck:()=>{const{expiryTimer:n}=t();n&&(clearInterval(n),e({expiryTimer:null}))},selectTenant:async n=>{try{const r=await Wl(n);e({status:"authenticated",uipathUrl:r.uipath_url,tenants:[]}),t().startExpiryCheck()}catch(r){console.error("Tenant selection failed",r)}},logout:async()=>{t().stopPolling(),t().stopExpiryCheck();try{await Kl()}catch{}e({status:"unauthenticated",tenants:[],uipathUrl:null})}})),vs=Ot(e=>({projectName:null,projectVersion:null,projectAuthors:null,init:async()=>{try{const t=await fetch("/api/config");if(t.ok){const n=await t.json();e({projectName:n.project_name??null,projectVersion:n.project_version??null,projectAuthors:n.project_authors??null})}}catch{}}}));class Vl{constructor(t){It(this,"ws",null);It(this,"url");It(this,"handlers",new Set);It(this,"reconnectTimer",null);It(this,"shouldReconnect",!0);It(this,"pendingMessages",[]);It(this,"activeSubscriptions",new Set);const n=window.location.protocol==="https:"?"wss:":"ws:";this.url=t??`${n}//${window.location.host}/ws`}connect(){var t;((t=this.ws)==null?void 0:t.readyState)!==WebSocket.OPEN&&(this.ws=new WebSocket(this.url),this.ws.onopen=()=>{console.log("[ws] connected");for(const n of this.activeSubscriptions)this.sendRaw(JSON.stringify({type:"subscribe",payload:{run_id:n}}));for(const n of this.pendingMessages)this.sendRaw(n);this.pendingMessages=[]},this.ws.onmessage=n=>{let r;try{r=JSON.parse(n.data)}catch{console.warn("[ws] failed to parse message",n.data);return}this.handlers.forEach(i=>{try{i(r)}catch(s){console.error("[ws] handler error",s)}})},this.ws.onclose=()=>{console.log("[ws] disconnected"),this.shouldReconnect&&(this.reconnectTimer=setTimeout(()=>this.connect(),2e3))},this.ws.onerror=()=>{var n;(n=this.ws)==null||n.close()})}disconnect(){var t;this.shouldReconnect=!1,this.reconnectTimer&&clearTimeout(this.reconnectTimer),(t=this.ws)==null||t.close(),this.ws=null}onMessage(t){return this.handlers.add(t),()=>this.handlers.delete(t)}sendRaw(t){var n;((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN&&this.ws.send(t)}send(t,n){var i;const r=JSON.stringify({type:t,payload:n});((i=this.ws)==null?void 0:i.readyState)===WebSocket.OPEN?this.ws.send(r):this.pendingMessages.push(r)}subscribe(t){this.activeSubscriptions.add(t),this.send("subscribe",{run_id:t})}unsubscribe(t){this.activeSubscriptions.delete(t),this.send("unsubscribe",{run_id:t})}sendChatMessage(t,n){this.send("chat.message",{run_id:t,text:n})}sendInterruptResponse(t,n){this.send("chat.interrupt_response",{run_id:t,data:n})}debugStep(t){this.send("debug.step",{run_id:t})}debugContinue(t){this.send("debug.continue",{run_id:t})}debugStop(t){this.send("debug.stop",{run_id:t})}setBreakpoints(t,n){this.send("debug.set_breakpoints",{run_id:t,breakpoints:n})}sendAgentMessage(t,n,r,i){this.send("agent.message",{text:t,model:n,session_id:r??void 0,skill_ids:i&&i.length>0?i:void 0})}sendAgentStop(t){this.send("agent.stop",{session_id:t})}sendToolApproval(t,n,r){this.send("agent.tool_response",{session_id:t,tool_call_id:n,approved:r})}sendQuestionResponse(t,n,r){this.send("agent.question_response",{session_id:t,question_id:n,answer:r})}}const Me=Ot(e=>({evaluators:[],localEvaluators:[],evalSets:{},evalRuns:{},setEvaluators:t=>e({evaluators:t}),setLocalEvaluators:t=>e({localEvaluators:t}),addLocalEvaluator:t=>e(n=>({localEvaluators:[...n.localEvaluators,t]})),upsertLocalEvaluator:t=>e(n=>({localEvaluators:n.localEvaluators.some(r=>r.id===t.id)?n.localEvaluators.map(r=>r.id===t.id?t:r):[...n.localEvaluators,t]})),setEvalSets:t=>e({evalSets:Object.fromEntries(t.map(n=>[n.id,n]))}),addEvalSet:t=>e(n=>({evalSets:{...n.evalSets,[t.id]:t}})),updateEvalSetEvaluators:(t,n)=>e(r=>{const i=r.evalSets[t];return i?{evalSets:{...r.evalSets,[t]:{...i,evaluator_ids:n}}}:r}),incrementEvalSetCount:(t,n=1)=>e(r=>{const i=r.evalSets[t];return i?{evalSets:{...r.evalSets,[t]:{...i,eval_count:i.eval_count+n}}}:r}),setEvalRuns:t=>e({evalRuns:Object.fromEntries(t.map(n=>[n.id,n]))}),upsertEvalRun:t=>e(n=>({evalRuns:{...n.evalRuns,[t.id]:t}})),updateEvalRunProgress:(t,n,r)=>e(i=>{const s=i.evalRuns[t];return s?{evalRuns:{...i.evalRuns,[t]:{...s,progress_completed:n,progress_total:r,status:"running"}}}:i}),completeEvalRun:(t,n,r)=>e(i=>{const s=i.evalRuns[t];return s?{evalRuns:{...i.evalRuns,[t]:{...s,status:"completed",overall_score:n,evaluator_scores:r,end_time:new Date().toISOString()}}}:i})}));let Yl=0;function $t(){return`agent-msg-${++Yl}`}const ze=Ot(e=>({sessionId:null,status:"idle",_lastActiveAt:null,messages:[],plan:[],activeQuestion:null,models:[],selectedModel:null,modelsLoading:!1,skills:[],selectedSkillIds:[],skillsLoading:!1,setStatus:t=>e(n=>{const r=n.status==="thinking"||n.status==="planning"||n.status==="executing"||n.status==="awaiting_approval";return{status:t,_lastActiveAt:r&&!(t==="thinking"||t==="planning"||t==="executing"||t==="awaiting_approval")?Date.now():n._lastActiveAt}}),addUserMessage:t=>e(n=>({messages:[...n.messages,{id:$t(),role:"user",content:t,timestamp:Date.now()}]})),appendAssistantText:(t,n)=>e(r=>{const i=[...r.messages],s=i[i.length-1];return s&&s.role==="assistant"&&!s.done?i[i.length-1]={...s,content:s.content+t,done:n}:i.push({id:$t(),role:"assistant",content:t,timestamp:Date.now(),done:n}),{messages:i}}),setPlan:t=>e(n=>{const r=[...n.messages],i=r.findIndex(o=>o.role==="plan"),s={id:i>=0?r[i].id:$t(),role:"plan",content:"",timestamp:Date.now(),planItems:t};return i>=0?r[i]=s:r.push(s),{messages:r,plan:t}}),addToolUse:(t,n)=>e(r=>{const i=[...r.messages],s=i[i.length-1],o={tool:t,args:n};return s&&s.role==="tool"&&s.toolCalls?i[i.length-1]={...s,toolCalls:[...s.toolCalls,o]}:i.push({id:$t(),role:"tool",content:"",timestamp:Date.now(),toolCalls:[o]}),{messages:i}}),addToolResult:(t,n,r)=>e(i=>{const s=[...i.messages];for(let o=s.length-1;o>=0;o--){const l=s[o];if(l.role==="tool"&&l.toolCalls){const u=[...l.toolCalls];for(let c=u.length-1;c>=0;c--)if(u[c].tool===t&&u[c].result===void 0)return u[c]={...u[c],result:n,is_error:r},s[o]={...l,toolCalls:u},{messages:s}}}return{messages:s}}),addToolApprovalRequest:(t,n,r)=>e(i=>{const s=[...i.messages];for(let u=s.length-1;u>=0;u--){const c=s[u];if(c.role==="tool"&&c.toolCalls){const d=[...c.toolCalls];for(let p=d.length-1;p>=0;p--)if(d[p].tool===n&&!d[p].status&&d[p].result===void 0)return d[p]={...d[p],tool_call_id:t,status:"pending"},s[u]={...c,toolCalls:d},{messages:s}}if(c.role!=="tool")break}const o={tool:n,args:r,tool_call_id:t,status:"pending"},l=s[s.length-1];return l&&l.role==="tool"&&l.toolCalls?s[s.length-1]={...l,toolCalls:[...l.toolCalls,o]}:s.push({id:$t(),role:"tool",content:"",timestamp:Date.now(),toolCalls:[o]}),{messages:s}}),resolveToolApproval:(t,n)=>e(r=>{const i=[...r.messages];for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.role==="tool"&&o.toolCalls){const l=[...o.toolCalls];for(let u=l.length-1;u>=0;u--)if(l[u].tool_call_id===t)return l[u]={...l[u],status:n?"approved":"denied"},i[s]={...o,toolCalls:l},{messages:i}}}return{messages:i}}),appendThinking:t=>e(n=>{const r=[...n.messages],i=r[r.length-1];return i&&i.role==="thinking"?r[r.length-1]={...i,content:i.content+t}:r.push({id:$t(),role:"thinking",content:t,timestamp:Date.now()}),{messages:r}}),addError:t=>e(n=>({status:"error",messages:[...n.messages,{id:$t(),role:"assistant",content:`Error: ${t}`,timestamp:Date.now(),done:!0}]})),setActiveQuestion:t=>e({activeQuestion:t}),setSessionId:t=>{sessionStorage.setItem("agent_session_id",t),e({sessionId:t})},setModels:t=>e({models:t}),setSelectedModel:t=>e({selectedModel:t}),setModelsLoading:t=>e({modelsLoading:t}),setSkills:t=>e({skills:t}),setSelectedSkillIds:t=>e({selectedSkillIds:t}),toggleSkill:t=>e(n=>({selectedSkillIds:n.selectedSkillIds.includes(t)?n.selectedSkillIds.filter(i=>i!==t):[...n.selectedSkillIds,t]})),setSkillsLoading:t=>e({skillsLoading:t}),hydrateSession:t=>e({sessionId:t.session_id,status:t.status||"done",messages:t.messages,plan:t.plan,selectedModel:t.model||null}),clearSession:()=>{sessionStorage.removeItem("agent_session_id"),e({sessionId:null,status:"idle",_lastActiveAt:null,messages:[],plan:[],activeQuestion:null})}})),be=Ot(e=>({children:{},expanded:{},selectedFile:null,openTabs:[],fileCache:{},dirty:{},buffers:{},loadingDirs:{},loadingFile:!1,agentChangedFiles:{},diffView:null,setChildren:(t,n)=>e(r=>({children:{...r.children,[t]:n}})),toggleExpanded:t=>e(n=>({expanded:{...n.expanded,[t]:!n.expanded[t]}})),setSelectedFile:t=>e({selectedFile:t}),openTab:t=>e(n=>({selectedFile:t,openTabs:n.openTabs.includes(t)?n.openTabs:[...n.openTabs,t]})),closeTab:t=>e(n=>{const r=n.openTabs.filter(c=>c!==t);let i=n.selectedFile;if(i===t){const c=n.openTabs.indexOf(t);i=r[Math.min(c,r.length-1)]??null}const{[t]:s,...o}=n.dirty,{[t]:l,...u}=n.buffers;return{openTabs:r,selectedFile:i,dirty:o,buffers:u}}),setFileContent:(t,n)=>e(r=>({fileCache:{...r.fileCache,[t]:n}})),updateBuffer:(t,n)=>e(r=>({buffers:{...r.buffers,[t]:n},dirty:{...r.dirty,[t]:!0}})),markClean:t=>e(n=>{const{[t]:r,...i}=n.dirty,{[t]:s,...o}=n.buffers;return{dirty:i,buffers:o}}),setLoadingDir:(t,n)=>e(r=>({loadingDirs:{...r.loadingDirs,[t]:n}})),setLoadingFile:t=>e({loadingFile:t}),markAgentChanged:t=>e(n=>({agentChangedFiles:{...n.agentChangedFiles,[t]:Date.now()}})),clearAgentChanged:t=>e(n=>{const{[t]:r,...i}=n.agentChangedFiles;return{agentChangedFiles:i}}),setDiffView:t=>e({diffView:t}),expandPath:t=>e(n=>{const r=t.split("/"),i={...n.expanded};for(let s=1;se.current.onMessage(x=>{var y,w;switch(x.type){case"run.updated":t(x.payload);break;case"trace":n(x.payload);break;case"log":r(x.payload);break;case"chat":{const T=x.payload.run_id;i(T,x.payload);break}case"chat.interrupt":{const T=x.payload.run_id;s(T,x.payload);break}case"state":{const T=x.payload.run_id,j=x.payload.node_name,O=x.payload.qualified_node_name??null,_=x.payload.phase??null,P=x.payload.payload;j==="__start__"&&_==="started"&&u(T),_==="started"?o(T,j,O):_==="completed"&&l(T,j),c(T,j,P,O,_);break}case"reload":d(!0);break;case"files.changed":{const T=x.payload.files,j=new Set(T),O=be.getState(),_=ze.getState(),P=_.status,D=P==="thinking"||P==="planning"||P==="executing"||P==="awaiting_approval",R=!D&&_._lastActiveAt!=null&&Date.now()-_._lastActiveAt<3e3,S=T.filter(L=>L in O.children?!1:(L.split("/").pop()??"").includes("."));if(console.log("[files.changed]",{all:T,files:S,agentStatus:P,agentIsActive:D,recentlyActive:R}),D||R){let L=!1;for(const C of S){if(O.dirty[C])continue;const v=((y=O.fileCache[C])==null?void 0:y.content)??null,E=((w=O.fileCache[C])==null?void 0:w.language)??null;Lr(C).then(I=>{const H=be.getState();if(H.dirty[C])return;H.setFileContent(C,I),H.expandPath(C);const U=C.split("/");for(let g=1;gbe.getState().setChildren(F,$)).catch(()=>{})}const V=be.getState().openTabs.includes(C);!L&&V&&v!==null&&I.content!==null&&v!==I.content&&(L=!0,be.getState().setSelectedFile(C),H.setDiffView({path:C,original:v,modified:I.content,language:E}),setTimeout(()=>{const g=be.getState().diffView;g&&g.path===C&&g.original===v&&be.getState().setDiffView(null)},5e3)),H.markAgentChanged(C),setTimeout(()=>be.getState().clearAgentChanged(C),1e4)}).catch(()=>{const I=be.getState();I.openTabs.includes(C)&&I.closeTab(C)})}}else for(const L of O.openTabs)O.dirty[L]||!j.has(L)||Lr(L).then(C=>{var E;const v=be.getState();v.dirty[L]||((E=v.fileCache[L])==null?void 0:E.content)!==C.content&&v.setFileContent(L,C)}).catch(()=>{});const M=new Set;for(const L of T){const C=L.lastIndexOf("/"),v=C===-1?"":L.substring(0,C);v in O.children&&M.add(v)}for(const L of M)$n(L).then(C=>be.getState().setChildren(L,C)).catch(()=>{});break}case"eval_run.created":p(x.payload);break;case"eval_run.progress":{const{run_id:T,completed:j,total:O,item_result:_}=x.payload;m(T,j,O,_);break}case"eval_run.completed":{const{run_id:T,overall_score:j,evaluator_scores:O}=x.payload;f(T,j,O);break}case"agent.status":{const{session_id:T,status:j}=x.payload,O=ze.getState();O.sessionId||O.setSessionId(T),O.setStatus(j),(j==="done"||j==="error"||j==="idle")&&O.setActiveQuestion(null);break}case"agent.text":{const{session_id:T,content:j,done:O}=x.payload,_=ze.getState();_.sessionId||_.setSessionId(T),_.appendAssistantText(j,O);break}case"agent.plan":{const{session_id:T,items:j}=x.payload,O=ze.getState();O.sessionId||O.setSessionId(T),O.setPlan(j);break}case"agent.tool_use":{const{session_id:T,tool:j,args:O}=x.payload,_=ze.getState();_.sessionId||_.setSessionId(T),_.addToolUse(j,O);break}case"agent.tool_result":{const{tool:T,result:j,is_error:O}=x.payload;ze.getState().addToolResult(T,j,O);break}case"agent.tool_approval":{const{session_id:T,tool_call_id:j,tool:O,args:_}=x.payload,P=ze.getState();P.sessionId||P.setSessionId(T),P.addToolApprovalRequest(j,O,_);break}case"agent.thinking":{const{content:T}=x.payload;ze.getState().appendThinking(T);break}case"agent.text_delta":{const{session_id:T,delta:j}=x.payload,O=ze.getState();O.sessionId||O.setSessionId(T),O.appendAssistantText(j,!1);break}case"agent.question":{const{session_id:T,question_id:j,question:O,options:_}=x.payload,P=ze.getState();P.sessionId||P.setSessionId(T),P.setActiveQuestion({question_id:j,question:O,options:_});break}case"agent.token_usage":break;case"agent.error":{const{message:T}=x.payload;ze.getState().addError(T);break}}}),[t,n,r,i,s,o,l,u,c,d,p,m,f]),e.current}const Lt="/api";async function jt(e,t){const n=await fetch(e,t);if(!n.ok){let r;try{r=(await n.json()).detail||n.statusText}catch{r=n.statusText}const i=new Error(`HTTP ${n.status}`);throw i.detail=r,i.status=n.status,i}return n.json()}async function ks(){return jt(`${Lt}/entrypoints`)}async function Jl(e){return jt(`${Lt}/entrypoints/${encodeURIComponent(e)}/schema`)}async function Ql(e){return jt(`${Lt}/entrypoints/${encodeURIComponent(e)}/mock-input`)}async function ec(e){return jt(`${Lt}/entrypoints/${encodeURIComponent(e)}/graph`)}async function Ri(e,t,n="run",r=[]){return jt(`${Lt}/runs`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entrypoint:e,input_data:t,mode:n,breakpoints:r})})}async function tc(){return jt(`${Lt}/runs`)}async function ur(e){return jt(`${Lt}/runs/${e}`)}async function nc(){return jt(`${Lt}/reload`,{method:"POST"})}function rc(e){const t=e.replace(/^#\/?/,""),n={section:"debug",view:"new",runId:null,tab:"traces",setupEntrypoint:null,setupMode:null,evalCreating:!1,evalSetId:null,evalRunId:null,evalRunItemName:null,evaluatorId:null,evaluatorCreateType:null,evaluatorFilter:null,explorerFile:null};if(!t||t==="new"||t==="debug"||t==="debug/new")return n;const r=t.match(/^(?:debug\/)?setup\/([^/]+)\/(run|chat)$/);if(r)return{...n,view:"setup",setupEntrypoint:decodeURIComponent(r[1]),setupMode:r[2]};const i=t.match(/^(?:debug\/)?runs\/([^/]+)(?:\/(traces|output))?$/);if(i)return{...n,view:"details",runId:i[1],tab:i[2]??"traces"};if(t==="evals/new")return{...n,section:"evals",evalCreating:!0};const s=t.match(/^evals\/runs\/([^/]+?)(?:\/([^/]+))?$/);if(s)return{...n,section:"evals",evalRunId:s[1],evalRunItemName:s[2]?decodeURIComponent(s[2]):null};const o=t.match(/^evals\/sets\/([^/]+)$/);if(o)return{...n,section:"evals",evalSetId:o[1]};if(t==="evals")return{...n,section:"evals"};const l=t.match(/^evaluators\/new(?:\/(deterministic|llm|tool))?$/);if(l)return{...n,section:"evaluators",evaluatorCreateType:l[1]??"any"};const u=t.match(/^evaluators\/category\/(deterministic|llm|tool)$/);if(u)return{...n,section:"evaluators",evaluatorFilter:u[1]};const c=t.match(/^evaluators\/([^/]+)$/);if(c)return{...n,section:"evaluators",evaluatorId:c[1]};if(t==="evaluators")return{...n,section:"evaluators"};const d=t.match(/^explorer\/file\/(.+)$/);return d?{...n,section:"explorer",explorerFile:decodeURIComponent(d[1])}:t==="explorer"?{...n,section:"explorer"}:n}function ic(){return window.location.hash}function oc(e){return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)}function st(){const e=N.useSyncExternalStore(oc,ic),t=rc(e),n=N.useCallback(r=>{window.location.hash=r},[]);return{...t,navigate:n}}const Oi="(max-width: 767px)";function sc(){const[e,t]=N.useState(()=>window.matchMedia(Oi).matches);return N.useEffect(()=>{const n=window.matchMedia(Oi),r=i=>t(i.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const ac=[{section:"debug",label:"Developer Console",icon:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"8",y:"6",width:"8",height:"14",rx:"4"}),a.jsx("path",{d:"M6 10H4"}),a.jsx("path",{d:"M6 18H4"}),a.jsx("path",{d:"M18 10h2"}),a.jsx("path",{d:"M18 18h2"}),a.jsx("path",{d:"M8 14h8"}),a.jsx("path",{d:"M9 6l-1.5-2"}),a.jsx("path",{d:"M15 6l1.5-2"}),a.jsx("path",{d:"M6 14H4"}),a.jsx("path",{d:"M18 14h2"})]})},{section:"evals",label:"Evals",icon:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M9 3h6"}),a.jsx("path",{d:"M10 3v6.5L5 20a1 1 0 0 0 .9 1.4h12.2a1 1 0 0 0 .9-1.4L14 9.5V3"}),a.jsx("path",{d:"M8.5 14h7"})]})},{section:"evaluators",label:"Evaluators",icon:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M12 2l7 4v5c0 5.25-3.5 9.74-7 11-3.5-1.26-7-5.75-7-11V6l7-4z"}),a.jsx("path",{d:"M9 12l2 2 4-4"})]})},{section:"explorer",label:"Explorer",icon:a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:a.jsx("path",{d:"M7.5 22.5H17.595C17.07 23.4 16.11 24 15 24H7.5C4.185 24 1.5 21.315 1.5 18V6C1.5 4.89 2.1 3.93 3 3.405V18C3 20.475 5.025 22.5 7.5 22.5ZM21 8.121V18C21 19.6545 19.6545 21 18 21H7.5C5.8455 21 4.5 19.6545 4.5 18V3C4.5 1.3455 5.8455 0 7.5 0H12.879C13.4715 0 14.0505 0.24 14.4705 0.6585L20.3415 6.5295C20.766 6.954 21 7.5195 21 8.121ZM13.5 6.75C13.5 7.164 13.8375 7.5 14.25 7.5H19.1895L13.5 1.8105V6.75ZM19.5 18V9H14.25C13.0095 9 12 7.9905 12 6.75V1.5H7.5C6.672 1.5 6 2.1735 6 3V18C6 18.8265 6.672 19.5 7.5 19.5H18C18.828 19.5 19.5 18.8265 19.5 18Z"})})}];function lc({section:e,onSectionChange:t}){return a.jsx("div",{className:"w-12 flex flex-col items-center shrink-0 border-r",style:{background:"var(--activity-bar-bg)",borderColor:"var(--border)"},children:a.jsx("div",{className:"flex flex-col items-center gap-1 pt-2",children:ac.map(n=>{const r=e===n.section;return a.jsxs("button",{onClick:()=>t(n.section),className:"w-10 h-10 flex items-center justify-center rounded cursor-pointer transition-colors relative",style:{color:r?"var(--text-primary)":"var(--text-muted)",background:r?"var(--bg-hover)":"transparent",border:"none"},title:n.label,onMouseEnter:i=>{r||(i.currentTarget.style.color="var(--text-secondary)")},onMouseLeave:i=>{r||(i.currentTarget.style.color="var(--text-muted)")},children:[r&&a.jsx("div",{className:"absolute left-0 top-1.5 bottom-1.5 w-0.5 rounded-r",style:{background:"var(--accent)"}}),n.icon]},n.section)})})})}const tt="/api";async function nt(e,t){const n=await fetch(e,t);if(!n.ok){let r;try{r=(await n.json()).detail||n.statusText}catch{r=n.statusText}const i=new Error(`HTTP ${n.status}`);throw i.detail=r,i.status=n.status,i}return n.json()}async function cc(){return nt(`${tt}/evaluators`)}async function Es(){return nt(`${tt}/eval-sets`)}async function uc(e){return nt(`${tt}/eval-sets`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function dc(e,t){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}/items`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async function pc(e,t){await nt(`${tt}/eval-sets/${encodeURIComponent(e)}/items/${encodeURIComponent(t)}`,{method:"DELETE"})}async function fc(e){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}`)}async function mc(e){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}/runs`,{method:"POST"})}async function gc(){return nt(`${tt}/eval-runs`)}async function Li(e){return nt(`${tt}/eval-runs/${encodeURIComponent(e)}`)}async function Qr(){return nt(`${tt}/local-evaluators`)}async function hc(e){return nt(`${tt}/local-evaluators`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function bc(e,t){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}/evaluators`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({evaluator_refs:t})})}async function xc(e,t){return nt(`${tt}/local-evaluators/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}const yc={"uipath-exact-match":e=>({expectedOutput:e}),"uipath-json-similarity":e=>({expectedOutput:e}),"uipath-contains":()=>({searchText:""}),"uipath-llm-judge-output-semantic-similarity":e=>({expectedOutput:e}),"uipath-llm-judge-output-strict-json-similarity":e=>({expectedOutput:e}),"uipath-llm-judge-trajectory-similarity":()=>({expectedAgentBehavior:""}),"uipath-llm-judge-trajectory-simulation":()=>({expectedAgentBehavior:""}),"uipath-tool-call-count":()=>({}),"uipath-tool-call-args":()=>({}),"uipath-tool-call-order":()=>({}),"uipath-tool-call-output":()=>({})};function vc(e,t){if(!e)return{};const n=yc[e.evaluator_type_id];return n?n(t):e.type==="tool"?{}:e.evaluator_type_id.includes("trajectory")?{expectedAgentBehavior:""}:{expectedOutput:t}}function ws(e){return e?e.type==="tool"?!0:e.evaluator_type_id.includes("tool-call"):!1}function kc(e){return e?ws(e)?{label:"tools",color:"var(--warning, #e5a00d)"}:e.evaluator_type_id.includes("trajectory")?{label:"quality",color:"var(--info, #3b82f6)"}:{label:"output",color:"var(--success, #22c55e)"}:{label:"output",color:"var(--success, #22c55e)"}}function Ec({run:e,onClose:t}){const n=Me(R=>R.evalSets),r=Me(R=>R.setEvalSets),i=Me(R=>R.incrementEvalSetCount),s=Me(R=>R.localEvaluators),o=Me(R=>R.setLocalEvaluators),[l,u]=N.useState(`run-${e.id.slice(0,8)}`),[c,d]=N.useState(new Set),[p,m]=N.useState({}),f=N.useRef(new Set),[h,b]=N.useState(!1),[x,y]=N.useState(null),[w,T]=N.useState(!1),j=Object.values(n),O=N.useMemo(()=>Object.fromEntries(s.map(R=>[R.id,R])),[s]),_=N.useMemo(()=>{const R=new Set;for(const S of c){const M=n[S];M&&M.evaluator_ids.forEach(L=>R.add(L))}return[...R]},[c,n]);N.useEffect(()=>{const R=e.output_data,S=f.current;m(M=>{const L={};for(const C of _)if(S.has(C)&&M[C]!==void 0)L[C]=M[C];else{const v=O[C],E=vc(v,R);L[C]=JSON.stringify(E,null,2)}return L})},[_,O,e.output_data]),N.useEffect(()=>{const R=S=>{S.key==="Escape"&&t()};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[t]),N.useEffect(()=>{j.length===0&&Es().then(r).catch(()=>{}),s.length===0&&Qr().then(o).catch(()=>{})},[]);const P=R=>{d(S=>{const M=new Set(S);return M.has(R)?M.delete(R):M.add(R),M})},D=async()=>{var S;if(!l.trim()||c.size===0)return;y(null),b(!0);const R={};for(const M of _){const L=p[M];if(L!==void 0)try{R[M]=JSON.parse(L)}catch{y(`Invalid JSON for evaluator "${((S=O[M])==null?void 0:S.name)??M}"`),b(!1);return}}try{for(const M of c){const L=n[M],C=new Set((L==null?void 0:L.evaluator_ids)??[]),v={};for(const[E,I]of Object.entries(R))C.has(E)&&(v[E]=I);await dc(M,{name:l.trim(),inputs:e.input_data,expected_output:null,evaluation_criterias:v}),i(M)}T(!0),setTimeout(t,3e3)}catch(M){y(M.detail||M.message||"Failed to add item")}finally{b(!1)}};return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.5)"},onClick:R=>{R.target===R.currentTarget&&t()},children:a.jsxs("div",{className:"w-full max-w-2xl rounded-lg p-6 shadow-xl max-h-[85vh] flex flex-col",style:{background:"var(--bg-primary)",border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}}),a.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"Add to Eval Set"})]}),a.jsx("button",{onClick:t,className:"w-7 h-7 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:R=>{R.currentTarget.style.color="var(--text-primary)"},onMouseLeave:R=>{R.currentTarget.style.color="var(--text-muted)"},"aria-label":"Close",children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0 space-y-4 pr-1",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Item Name"}),a.jsx("input",{type:"text",value:l,onChange:R=>u(R.target.value),className:"w-full rounded-md px-3 py-2 text-xs",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"}})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Inputs"}),a.jsx("pre",{className:"rounded-md px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words max-h-32 overflow-y-auto",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:JSON.stringify(e.input_data,null,2)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Eval Sets"}),j.length===0?a.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"No eval sets found. Create one first."}):a.jsx("div",{className:"rounded-md border overflow-hidden max-h-40 overflow-y-auto",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:j.map(R=>a.jsxs("label",{className:"flex items-center gap-2.5 px-3 py-2 text-xs cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--border)"},onMouseEnter:S=>{S.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:S=>{S.currentTarget.style.background="transparent"},children:[a.jsx("input",{type:"checkbox",checked:c.has(R.id),onChange:()=>P(R.id),className:"accent-[var(--accent)]"}),a.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:R.name}),a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:[R.eval_count," items"]})]},R.id))})]}),_.length>0&&a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Evaluation Criteria"}),a.jsx("div",{className:"space-y-2",children:_.map(R=>{const S=O[R],M=ws(S),L=kc(S);return a.jsxs("div",{className:"rounded-md",style:{border:"1px solid var(--border)",background:"var(--bg-primary)",opacity:M?.6:1},children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{borderBottom:M?"none":"1px solid var(--border)"},children:[a.jsx("span",{className:"text-xs font-medium truncate flex-1",style:{color:"var(--text-primary)"},children:(S==null?void 0:S.name)??R}),a.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full font-medium",style:{color:L.color,background:`color-mix(in srgb, ${L.color} 12%, transparent)`},children:L.label})]}),M?a.jsx("div",{className:"px-3 pb-2",children:a.jsx("span",{className:"text-[10px] italic",style:{color:"var(--text-muted)"},children:"Default criteria — uses evaluator config"})}):a.jsx("div",{className:"px-3 pb-2 pt-1",children:a.jsx("textarea",{value:p[R]??"{}",onChange:C=>{f.current.add(R),m(v=>({...v,[R]:C.target.value}))},rows:8,className:"w-full rounded px-2 py-1.5 text-xs font-mono resize-y",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"}})})]},R)})})]})]}),a.jsxs("div",{className:"mt-4 space-y-3",children:[x&&a.jsx("p",{className:"text-xs px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:x}),w&&a.jsxs("p",{className:"text-xs px-3 py-2 rounded",style:{color:"var(--success)",background:"color-mix(in srgb, var(--success) 10%, var(--bg-secondary))"},children:["Added to ",c.size," eval set",c.size!==1?"s":"","."]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{onClick:t,className:"flex-1 py-2 rounded-md text-xs font-semibold cursor-pointer",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)",border:"1px solid var(--border)"},children:"Cancel"}),a.jsx("button",{onClick:D,disabled:!l.trim()||c.size===0||h||w,className:"flex-1 py-2 rounded-md text-[13px] font-semibold transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},children:h?"Adding...":w?"Added":"Add Item"})]})]})]})})}const wc={pending:"var(--text-muted)",running:"var(--warning)",suspended:"var(--info)",completed:"var(--success)",failed:"var(--error)"};function _c({run:e,isSelected:t,onClick:n}){var p;const r=wc[e.status]??"var(--text-muted)",i=((p=e.entrypoint.split("/").pop())==null?void 0:p.slice(0,16))??e.entrypoint,s=e.start_time?new Date(e.start_time).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"",[o,l]=N.useState(!1),[u,c]=N.useState(!1),d=N.useRef(null);return N.useEffect(()=>{if(!o)return;const m=f=>{d.current&&!d.current.contains(f.target)&&l(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[o]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"group relative w-full text-left px-3 py-1.5 flex items-center gap-2 transition-colors cursor-pointer",style:{background:t?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":void 0,borderLeft:t?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:m=>{t||(m.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:m=>{t||(m.currentTarget.style.background="")},onClick:n,children:[a.jsx("span",{className:"shrink-0 w-2 h-2 rounded-full",style:{background:r}}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-xs truncate",style:{color:t?"var(--text-primary)":"var(--text-secondary)"},children:i}),a.jsxs("div",{className:"text-[11px] tabular-nums",style:{color:"var(--text-muted)"},children:[s,e.duration?` · ${e.duration}`:""]})]}),e.status==="completed"&&a.jsxs("div",{ref:d,className:"relative shrink-0",children:[a.jsx("button",{onClick:m=>{m.stopPropagation(),l(f=>!f)},className:"opacity-40 group-hover:opacity-100 focus:opacity-100 w-7 h-7 flex items-center justify-center rounded transition-opacity cursor-pointer",style:{color:"var(--text-muted)"},onMouseEnter:m=>{m.currentTarget.style.color="var(--text-primary)",m.currentTarget.style.background="var(--bg-secondary)"},onMouseLeave:m=>{m.currentTarget.style.color="var(--text-muted)",m.currentTarget.style.background=""},"aria-label":"Actions",title:"Actions",children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[a.jsx("circle",{cx:"8",cy:"3",r:"1.5"}),a.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),a.jsx("circle",{cx:"8",cy:"13",r:"1.5"})]})}),o&&a.jsx("div",{className:"absolute right-0 top-full mt-1 z-50 min-w-[140px] rounded-md shadow-lg py-1",style:{background:"var(--bg-primary)",border:"1px solid var(--border)"},children:a.jsx("button",{onClick:m=>{m.stopPropagation(),l(!1),c(!0)},className:"w-full text-left px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{color:"var(--text-secondary)"},onMouseEnter:m=>{m.currentTarget.style.background="var(--bg-hover)",m.currentTarget.style.color="var(--text-primary)"},onMouseLeave:m=>{m.currentTarget.style.background="",m.currentTarget.style.color="var(--text-secondary)"},children:"Add to Eval Set"})})]})]}),u&&a.jsx(Ec,{run:e,onClose:()=>c(!1)})]})}function ji({runs:e,selectedRunId:t,onSelectRun:n,onNewRun:r}){const i=[...e].sort((s,o)=>new Date(o.start_time??0).getTime()-new Date(s.start_time??0).getTime());return a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:r,className:"mx-3 mt-2.5 mb-1 px-3 py-1.5 text-[11px] font-medium rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-secondary)"},onMouseEnter:s=>{s.currentTarget.style.color="var(--text-primary)",s.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:s=>{s.currentTarget.style.color="var(--text-secondary)",s.currentTarget.style.borderColor=""},children:"+ New Run"}),a.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"History"}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[i.map(s=>a.jsx(_c,{run:s,isSelected:s.id===t,onClick:()=>n(s.id)},s.id)),i.length===0&&a.jsx("p",{className:"text-xs px-3 py-4 text-center",style:{color:"var(--text-muted)"},children:"No runs yet"})]})]})}function _s(){const e=localStorage.getItem("uipath-dev-theme");return e==="light"||e==="dark"?e:"dark"}function Ns(e){document.documentElement.setAttribute("data-theme",e),localStorage.setItem("uipath-dev-theme",e)}Ns(_s());const Ss=Ot(e=>({theme:_s(),toggleTheme:()=>e(t=>{const n=t.theme==="dark"?"light":"dark";return Ns(n),{theme:n}})}));function Di(){const{theme:e,toggleTheme:t}=Ss(),{enabled:n,status:r,environment:i,tenants:s,uipathUrl:o,setEnvironment:l,startLogin:u,selectTenant:c,logout:d}=zn(),{projectName:p,projectVersion:m,projectAuthors:f}=vs(),[h,b]=N.useState(!1),[x,y]=N.useState(""),w=N.useRef(null),T=N.useRef(null);N.useEffect(()=>{if(!h)return;const v=E=>{w.current&&!w.current.contains(E.target)&&T.current&&!T.current.contains(E.target)&&b(!1)};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[h]);const j=r==="authenticated",O=r==="expired",_=r==="pending",P=r==="needs_tenant";let D="UiPath: Disconnected",R=null,S=!0;j?(D=`UiPath: ${o?o.replace(/^https?:\/\/[^/]+\//,""):""}`,R="var(--success)",S=!1):O?(D=`UiPath: ${o?o.replace(/^https?:\/\/[^/]+\//,""):""} (expired)`,R="var(--error)",S=!1):_?D="UiPath: Signing in…":P&&(D="UiPath: Select Tenant");const M=()=>{_||(O?u():b(v=>!v))},L="flex items-center gap-1 px-1.5 rounded transition-colors",C={onMouseEnter:v=>{v.currentTarget.style.background="var(--bg-hover)",v.currentTarget.style.color="var(--text-primary)"},onMouseLeave:v=>{v.currentTarget.style.background="",v.currentTarget.style.color="var(--text-muted)"}};return a.jsxs("div",{className:"h-6 flex items-center justify-end gap-3 px-2 text-xs border-t shrink-0",style:{background:"var(--bg-secondary)",color:"var(--text-muted)",borderColor:"var(--border)",fontSize:"11px"},children:[n&&a.jsxs("div",{className:"relative flex items-center",children:[a.jsxs("div",{ref:T,className:`${L} cursor-pointer`,onClick:M,...C,title:j?o??"":O?"Token expired — click to re-authenticate":_?"Signing in…":P?"Select a tenant":"Click to sign in",children:[_?a.jsxs("svg",{className:"animate-spin",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10",strokeOpacity:"0.25"}),a.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",strokeLinecap:"round"})]}):R?a.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:R}}):S?a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 9.9-1"})]}):null,a.jsx("span",{className:"truncate max-w-[200px]",children:D})]}),h&&a.jsx("div",{ref:w,className:"absolute bottom-full right-0 mb-1 rounded border shadow-lg p-1 min-w-[180px]",style:{background:"var(--bg-secondary)",borderColor:"var(--border)"},children:j||O?a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:()=>{o&&window.open(o,"_blank","noopener,noreferrer"),b(!1)},className:"w-full flex items-center gap-2 px-2 py-2 text-[11px] rounded cursor-pointer transition-colors text-left",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:v=>{v.currentTarget.style.background="var(--bg-hover)",v.currentTarget.style.color="var(--text-primary)"},onMouseLeave:v=>{v.currentTarget.style.background="transparent",v.currentTarget.style.color="var(--text-muted)"},children:[a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),a.jsx("polyline",{points:"15 3 21 3 21 9"}),a.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),"Go to Platform"]}),a.jsxs("button",{onClick:()=>{d(),b(!1)},className:"w-full flex items-center gap-2 px-2 py-2 text-[11px] rounded cursor-pointer transition-colors text-left",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:v=>{v.currentTarget.style.background="var(--bg-hover)",v.currentTarget.style.color="var(--text-primary)"},onMouseLeave:v=>{v.currentTarget.style.background="transparent",v.currentTarget.style.color="var(--text-muted)"},children:[a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),a.jsx("polyline",{points:"16 17 21 12 16 7"}),a.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}),"Sign Out"]})]}):P?a.jsxs("div",{className:"p-1",children:[a.jsx("label",{className:"block text-[10px] font-medium mb-1",style:{color:"var(--text-muted)"},children:"Tenant"}),a.jsxs("select",{value:x,onChange:v=>y(v.target.value),className:"w-full rounded px-1.5 py-1 text-[10px] mb-1.5 appearance-auto",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-primary)"},children:[a.jsx("option",{value:"",children:"Select…"}),s.map(v=>a.jsx("option",{value:v,children:v},v))]}),a.jsx("button",{onClick:()=>{x&&(c(x),b(!1))},disabled:!x,className:"w-full px-2 py-1 text-[10px] font-medium rounded border border-[var(--border)] bg-transparent cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--text-muted)"},children:"Confirm"})]}):a.jsxs("div",{className:"p-1",children:[a.jsx("label",{className:"block text-[10px] font-medium mb-1",style:{color:"var(--text-muted)"},children:"Environment"}),a.jsxs("select",{value:i,onChange:v=>l(v.target.value),className:"w-full rounded px-1.5 py-0.5 text-[10px] mb-1.5 appearance-auto",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-muted)"},children:[a.jsx("option",{value:"cloud",children:"cloud"}),a.jsx("option",{value:"staging",children:"staging"}),a.jsx("option",{value:"alpha",children:"alpha"})]}),a.jsx("button",{onClick:()=>{u(),b(!1)},className:"w-full px-2 py-1 text-[10px] font-medium rounded border border-[var(--border)] bg-transparent cursor-pointer transition-colors",style:{color:"var(--text-muted)"},onMouseEnter:v=>{v.currentTarget.style.color="var(--text-primary)",v.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:v=>{v.currentTarget.style.color="var(--text-muted)",v.currentTarget.style.borderColor="var(--border)"},children:"Sign In"})]})})]}),p&&a.jsxs("span",{className:L,children:["Project: ",p]}),m&&a.jsxs("span",{className:L,children:["Version: v",m]}),f&&a.jsxs("span",{className:L,children:["Author: ",f]}),a.jsxs("a",{href:"https://github.com/UiPath/uipath-dev-python",target:"_blank",rel:"noopener noreferrer",className:`${L} cursor-pointer no-underline`,style:{color:"var(--text-muted)"},...C,title:"View on GitHub",children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})}),a.jsx("span",{children:"uipath-dev-python"})]}),a.jsxs("div",{className:`${L} cursor-pointer`,onClick:t,...C,title:`Switch to ${e==="dark"?"light":"dark"} theme`,children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e==="dark"?a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"5"}),a.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),a.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),a.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),a.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),a.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),a.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),a.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),a.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}):a.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),a.jsx("span",{children:e==="dark"?"Dark":"Light"})]})]})}function Nc(){const{navigate:e}=st(),t=Ee(c=>c.entrypoints),[n,r]=N.useState(""),[i,s]=N.useState(!0),[o,l]=N.useState(null);N.useEffect(()=>{!n&&t.length>0&&r(t[0])},[t,n]),N.useEffect(()=>{n&&(s(!0),l(null),Jl(n).then(c=>{var p;const d=(p=c.input)==null?void 0:p.properties;s(!!(d!=null&&d.messages))}).catch(c=>{const d=c.detail||{};l(d.error||d.message||`Failed to load entrypoint "${n}"`)}))},[n]);const u=c=>{n&&e(`#/setup/${encodeURIComponent(n)}/${c}`)};return a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"w-full max-w-xl px-6",children:[a.jsxs("div",{className:"mb-8 text-center",children:[a.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:o?"var(--error)":"var(--accent)"}}),a.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"New Run"})]}),!o&&a.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:t.length>1?"Select an entrypoint and choose a mode":"Choose a mode"})]}),t.length>1&&a.jsxs("div",{className:"mb-8",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Entrypoint"}),a.jsx("select",{id:"entrypoint-select",value:n,onChange:c=>r(c.target.value),className:"w-full rounded-md px-3 py-2 text-xs font-mono cursor-pointer appearance-auto",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},children:t.map(c=>a.jsx("option",{value:c,children:c},c))})]}),o?a.jsxs("div",{className:"rounded-md border overflow-hidden",style:{borderColor:"color-mix(in srgb, var(--error) 25%, var(--border))",background:"var(--bg-secondary)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{borderBottom:"1px solid color-mix(in srgb, var(--error) 15%, var(--border))",background:"color-mix(in srgb, var(--error) 4%, var(--bg-secondary))"},children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0},children:a.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM7.25 4.75h1.5v4h-1.5v-4zm.75 6.75a.75.75 0 110-1.5.75.75 0 010 1.5z",fill:"var(--error)"})}),a.jsx("span",{className:"text-[11px] font-medium",style:{color:"var(--error)"},children:"Failed to load entrypoint"})]}),a.jsx("div",{className:"overflow-auto max-h-48 p-3",children:a.jsx("pre",{className:"text-[11px] font-mono whitespace-pre-wrap break-words leading-relaxed m-0",style:{color:"var(--text-muted)"},children:o})})]}):a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx(Pi,{title:"Autonomous",description:"Run the agent end-to-end. Set breakpoints to pause and inspect execution.",icon:a.jsx(Sc,{}),color:"var(--success)",onClick:()=>u("run"),disabled:!n}),a.jsx(Pi,{title:"Conversational",description:i?"Interactive chat session. Send messages and receive responses in real time.":'Requires a "messages" property in the input schema.',icon:a.jsx(Tc,{}),color:"var(--accent)",onClick:()=>u("chat"),disabled:!n||!i})]})]})})}function Pi({title:e,description:t,icon:n,color:r,onClick:i,disabled:s}){return a.jsxs("button",{onClick:i,disabled:s,className:"group flex flex-col items-center text-center p-6 rounded-md border transition-all cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--bg-secondary)",borderColor:"var(--border)"},onMouseEnter:o=>{s||(o.currentTarget.style.borderColor=r,o.currentTarget.style.background=`color-mix(in srgb, ${r} 5%, var(--bg-secondary))`)},onMouseLeave:o=>{o.currentTarget.style.borderColor="var(--border)",o.currentTarget.style.background="var(--bg-secondary)"},children:[a.jsx("div",{className:"mb-4 p-3 rounded-xl transition-colors",style:{background:`color-mix(in srgb, ${r} 10%, var(--bg-primary))`,color:r},children:n}),a.jsx("h3",{className:"text-sm font-semibold mb-1.5",style:{color:"var(--text-primary)"},children:e}),a.jsx("p",{className:"text-xs leading-relaxed",style:{color:"var(--text-muted)"},children:t})]})}function Sc(){return a.jsx("svg",{width:"28",height:"28",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M23.832 15.166H22.7487C22.7487 10.9735 19.3579 7.58268 15.1654 7.58268H14.082V6.20685C14.732 5.83852 15.1654 5.13435 15.1654 4.33268C15.1654 3.14102 14.2012 2.16602 12.9987 2.16602C11.7962 2.16602 10.832 3.14102 10.832 4.33268C10.832 5.13435 11.2654 5.83852 11.9154 6.20685V7.58268H10.832C6.63953 7.58268 3.2487 10.9735 3.2487 15.166H2.16536C1.56953 15.166 1.08203 15.6535 1.08203 16.2493V19.4993C1.08203 20.0952 1.56953 20.5827 2.16536 20.5827H3.2487V21.666C3.2487 22.8685 4.2237 23.8327 5.41536 23.8327H20.582C21.7845 23.8327 22.7487 22.8685 22.7487 21.666V20.5827H23.832C24.4279 20.5827 24.9154 20.0952 24.9154 19.4993V16.2493C24.9154 15.6535 24.4279 15.166 23.832 15.166ZM22.7487 18.416H20.582V21.666H5.41536V18.416H3.2487V17.3327H5.41536V15.166C5.41536 12.176 7.84203 9.74935 10.832 9.74935H15.1654C18.1554 9.74935 20.582 12.176 20.582 15.166V17.3327H22.7487V18.416ZM9.20703 14.6243L11.7637 17.181L10.4854 18.4594L9.20703 17.181L7.9287 18.4594L6.65036 17.181L9.20703 14.6243ZM16.7904 14.6243L19.347 17.181L18.0687 18.4594L16.7904 17.181L15.512 18.4594L14.2337 17.181L16.7904 14.6243Z",fill:"currentColor"})})}function Tc(){return a.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M9.20901 13.541L11.7657 16.0977L10.4873 17.376L9.20901 16.0977L7.93068 17.376L6.65234 16.0977L9.20901 13.541ZM16.7923 13.541L19.349 16.0977L18.0707 17.376L16.7923 16.0977L15.514 17.376L14.2357 16.0977L16.7923 13.541Z",fill:"currentColor"}),a.jsx("path",{d:"M5.25 8.58398H20.75C21.3023 8.58398 21.75 9.0317 21.75 9.58398V23.5293L16.874 21.9043C16.5683 21.8024 16.248 21.751 15.9258 21.751H5.25C4.69782 21.751 4.25018 21.3031 4.25 20.751V9.58398C4.25 9.0317 4.69772 8.58398 5.25 8.58398Z",stroke:"currentColor",strokeWidth:"2"}),a.jsx("ellipse",{cx:"12.9987",cy:"4.33268",rx:"2.16667",ry:"2.16667",fill:"currentColor"}),a.jsx("rect",{x:"11.918",y:"5.41602",width:"2.16667",height:"2.16667",fill:"currentColor"}),a.jsx("path",{d:"M1.08203 14C1.08203 13.4477 1.52975 13 2.08203 13H3.2487V18.4167H2.08203C1.52975 18.4167 1.08203 17.969 1.08203 17.4167V14Z",fill:"currentColor"}),a.jsx("rect",{x:"3.25",y:"15.166",width:"2.16667",height:"1.08333",fill:"currentColor"}),a.jsx("path",{d:"M22.75 13H23.9167C24.4689 13 24.9167 13.4477 24.9167 14V17.4167C24.9167 17.969 24.469 18.4167 23.9167 18.4167H22.75V13Z",fill:"currentColor"}),a.jsx("rect",{x:"20.582",y:"15.166",width:"2.16667",height:"1.08333",fill:"currentColor"})]})}const Cc="modulepreload",Ac=function(e){return"/"+e},Bi={},Ts=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(c){return Promise.all(c.map(d=>Promise.resolve(d).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=o(n.map(c=>{if(c=Ac(c),c in Bi)return;Bi[c]=!0;const d=c.endsWith(".css"),p=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${p}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":Cc,d||(m.as="script"),m.crossOrigin="",m.href=c,u&&m.setAttribute("nonce",u),document.head.appendChild(m),d)return new Promise((f,h)=>{m.addEventListener("load",f),m.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return i.then(o=>{for(const l of o||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})},Mc={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Ic({data:e}){const t=e.status,n=e.nodeWidth,r=e.label??"Start",i=e.hasBreakpoint,s=e.isPausedHere,o=e.isActiveNode,l=e.isExecutingNode,u=s?"var(--error)":l?"var(--success)":o?"var(--accent)":t==="completed"?"var(--success)":t==="running"?"var(--warning)":"var(--node-border)",c=s?"var(--error)":l?"var(--success)":"var(--accent)";return a.jsxs("div",{className:"px-3 py-1.5 rounded-full text-center text-xs overflow-hidden text-ellipsis whitespace-nowrap cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${u}`,boxShadow:s||o||l?`0 0 4px ${c}`:void 0,animation:s||o||l?`node-pulse-${s?"red":l?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r,children:[i&&a.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),r,a.jsx(ht,{type:"source",position:bt.Bottom,style:Mc})]})}const Rc={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Oc({data:e}){const t=e.status,n=e.nodeWidth,r=e.label??"End",i=e.hasBreakpoint,s=e.isPausedHere,o=e.isActiveNode,l=e.isExecutingNode,u=s?"var(--error)":l?"var(--success)":o?"var(--accent)":t==="completed"?"var(--success)":t==="failed"?"var(--error)":"var(--node-border)",c=s?"var(--error)":l?"var(--success)":"var(--accent)";return a.jsxs("div",{className:"px-3 py-1.5 rounded-full text-center text-xs overflow-hidden text-ellipsis whitespace-nowrap cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${u}`,boxShadow:s||o||l?`0 0 4px ${c}`:void 0,animation:s||o||l?`node-pulse-${s?"red":l?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r,children:[i&&a.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),a.jsx(ht,{type:"target",position:bt.Top,style:Rc}),r]})}const Fi={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Lc({data:e}){const t=e.status,n=e.nodeWidth,r=e.model_name,i=e.label??"Model",s=e.hasBreakpoint,o=e.isPausedHere,l=e.isActiveNode,u=e.isExecutingNode,c=o?"var(--error)":u?"var(--success)":l?"var(--accent)":t==="completed"?"var(--success)":t==="running"?"var(--warning)":t==="failed"?"var(--error)":"var(--node-border)",d=o?"var(--error)":u?"var(--success)":"var(--accent)";return a.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${c}`,boxShadow:o||l||u?`0 0 4px ${d}`:void 0,animation:o||l||u?`node-pulse-${o?"red":u?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r?`${i} -${r}`:i,children:[s&&a.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),a.jsx(ht,{type:"target",position:bt.Top,style:Fi}),a.jsx("div",{style:{color:"var(--info)",fontSize:9,marginBottom:1},children:"model"}),a.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:i}),r&&a.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",style:{color:"var(--text-muted)",fontSize:9,marginTop:1},title:r,children:r}),a.jsx(ht,{type:"source",position:bt.Bottom,style:Fi})]})}const zi={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0},jc=3;function Dc({data:e}){const t=e.status,n=e.nodeWidth,r=e.tool_names,i=e.tool_count,s=e.label??"Tool",o=e.hasBreakpoint,l=e.isPausedHere,u=e.isActiveNode,c=e.isExecutingNode,d=l?"var(--error)":c?"var(--success)":u?"var(--accent)":t==="completed"?"var(--success)":t==="running"?"var(--warning)":t==="failed"?"var(--error)":"var(--node-border)",p=l?"var(--error)":c?"var(--success)":"var(--accent)",m=(r==null?void 0:r.slice(0,jc))??[],f=(i??(r==null?void 0:r.length)??0)-m.length;return a.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${d}`,boxShadow:l||u||c?`0 0 4px ${p}`:void 0,animation:l||u||c?`node-pulse-${l?"red":c?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r!=null&&r.length?`${s} +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-elk-CiLKfHel.js","assets/vendor-react-N5xbSGOh.js","assets/ChatPanel-DWIYYBph.js","assets/vendor-reactflow-CxoS0d5s.js","assets/vendor-reactflow-B5DZHykP.css"])))=>i.map(i=>d[i]); +var Sl=Object.defineProperty;var Tl=(e,t,n)=>t in e?Sl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var It=(e,t,n)=>Tl(e,typeof t!="symbol"?t+"":t,n);import{W as Tn,a as _,j as a,w as Cl,F as Al,g as Xr,b as Ml}from"./vendor-react-N5xbSGOh.js";import{H as ht,P as bt,B as Il,M as Rl,u as Ol,a as Ll,R as jl,b as Dl,C as Pl,c as Bl,d as Fl}from"./vendor-reactflow-CxoS0d5s.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();const Ii=e=>{let t;const n=new Set,r=(c,d)=>{const p=typeof c=="function"?c(t):c;if(!Object.is(p,t)){const m=t;t=d??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(f=>f(t,m))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c))},u=t=e(r,i,l);return l},zl=(e=>e?Ii(e):Ii),$l=e=>e;function Ul(e,t=$l){const n=Tn.useSyncExternalStore(e.subscribe,Tn.useCallback(()=>t(e.getState()),[e,t]),Tn.useCallback(()=>t(e.getInitialState()),[e,t]));return Tn.useDebugValue(n),n}const Ri=e=>{const t=zl(e),n=r=>Ul(t,r);return Object.assign(n,t),n},Ot=(e=>e?Ri(e):Ri),ve=Ot(e=>({runs:{},selectedRunId:null,traces:{},logs:{},chatMessages:{},entrypoints:[],setRuns:t=>e(n=>{var s;let r=n.breakpoints;for(const o of t)(s=o.breakpoints)!=null&&s.length&&!r[o.id]&&(r={...r,[o.id]:Object.fromEntries(o.breakpoints.map(l=>[l,!0]))});const i={runs:Object.fromEntries(t.map(o=>[o.id,o]))};return r!==n.breakpoints&&(i.breakpoints=r),i}),upsertRun:t=>e(n=>{var i;const r={runs:{...n.runs,[t.id]:t}};if((i=t.breakpoints)!=null&&i.length&&!n.breakpoints[t.id]&&(r.breakpoints={...n.breakpoints,[t.id]:Object.fromEntries(t.breakpoints.map(s=>[s,!0]))}),(t.status==="completed"||t.status==="failed")&&n.activeNodes[t.id]){const{[t.id]:s,...o}=n.activeNodes;r.activeNodes=o}if(t.status!=="suspended"&&n.activeInterrupt[t.id]){const{[t.id]:s,...o}=n.activeInterrupt;r.activeInterrupt=o}return r}),selectRun:t=>e({selectedRunId:t}),addTrace:t=>e(n=>{const r=n.traces[t.run_id]??[],i=r.findIndex(o=>o.span_id===t.span_id),s=i>=0?r.map((o,l)=>l===i?t:o):[...r,t];return{traces:{...n.traces,[t.run_id]:s}}}),setTraces:(t,n)=>e(r=>({traces:{...r.traces,[t]:n}})),addLog:t=>e(n=>{const r=n.logs[t.run_id]??[];return{logs:{...n.logs,[t.run_id]:[...r,t]}}}),setLogs:(t,n)=>e(r=>({logs:{...r.logs,[t]:n}})),addChatEvent:(t,n)=>e(r=>{const i=r.chatMessages[t]??[],s=n.message;if(!s)return r;const o=s.messageId??s.message_id,l=s.role??"assistant",d=(s.contentParts??s.content_parts??[]).filter(h=>{const v=h.mimeType??h.mime_type??"";return v.startsWith("text/")||v==="application/json"}).map(h=>{const v=h.data;return(v==null?void 0:v.inline)??""}).join(` +`).trim(),p=(s.toolCalls??s.tool_calls??[]).map(h=>({name:h.name??"",has_result:!!h.result})),m={message_id:o,role:l,content:d,tool_calls:p.length>0?p:void 0},f=i.findIndex(h=>h.message_id===o);if(f>=0)return{chatMessages:{...r.chatMessages,[t]:i.map((h,v)=>v===f?m:h)}};if(l==="user"){const h=i.findIndex(v=>v.message_id.startsWith("local-")&&v.role==="user"&&v.content===d);if(h>=0)return{chatMessages:{...r.chatMessages,[t]:i.map((v,y)=>y===h?m:v)}}}const b=[...i,m];return{chatMessages:{...r.chatMessages,[t]:b}}}),addLocalChatMessage:(t,n)=>e(r=>{const i=r.chatMessages[t]??[];return{chatMessages:{...r.chatMessages,[t]:[...i,n]}}}),setChatMessages:(t,n)=>e(r=>({chatMessages:{...r.chatMessages,[t]:n}})),setEntrypoints:t=>e({entrypoints:t}),breakpoints:{},toggleBreakpoint:(t,n)=>e(r=>{const i={...r.breakpoints[t]??{}};return i[n]?delete i[n]:i[n]=!0,{breakpoints:{...r.breakpoints,[t]:i}}}),clearBreakpoints:t=>e(n=>{const{[t]:r,...i}=n.breakpoints;return{breakpoints:i}}),activeNodes:{},setActiveNode:(t,n,r)=>e(i=>{const s=i.activeNodes[t]??{executing:{},prev:null};return{activeNodes:{...i.activeNodes,[t]:{executing:{...s.executing,[n]:r??null},prev:s.prev}}}}),removeActiveNode:(t,n)=>e(r=>{const i=r.activeNodes[t];if(!i)return r;const{[n]:s,...o}=i.executing;return{activeNodes:{...r.activeNodes,[t]:{executing:o,prev:n}}}}),resetRunGraphState:t=>e(n=>({stateEvents:{...n.stateEvents,[t]:[]},activeNodes:{...n.activeNodes,[t]:{executing:{},prev:null}}})),stateEvents:{},addStateEvent:(t,n,r,i,s)=>e(o=>{const l=o.stateEvents[t]??[];return{stateEvents:{...o.stateEvents,[t]:[...l,{node_name:n,qualified_node_name:i,phase:s,timestamp:Date.now(),payload:r}]}}}),setStateEvents:(t,n)=>e(r=>({stateEvents:{...r.stateEvents,[t]:n}})),focusedSpan:null,setFocusedSpan:t=>e({focusedSpan:t}),activeInterrupt:{},setActiveInterrupt:(t,n)=>e(r=>({activeInterrupt:{...r.activeInterrupt,[t]:n}})),reloadPending:!1,setReloadPending:t=>e({reloadPending:t}),graphCache:{},setGraphCache:(t,n)=>e(r=>({graphCache:{...r.graphCache,[t]:n}}))})),Yn="/api";async function Hl(e){const t=await fetch(`${Yn}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({environment:e})});if(!t.ok)throw new Error(`Login failed: ${t.status}`);return t.json()}async function cr(){const e=await fetch(`${Yn}/auth/status`);if(!e.ok)throw new Error(`Status check failed: ${e.status}`);return e.json()}async function Wl(e){const t=await fetch(`${Yn}/auth/select-tenant`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tenant_name:e})});if(!t.ok)throw new Error(`Tenant selection failed: ${t.status}`);return t.json()}async function Kl(){await fetch(`${Yn}/auth/logout`,{method:"POST"})}const vs="uipath-env",Gl=["cloud","staging","alpha"];function ql(){const e=localStorage.getItem(vs);return Gl.includes(e)?e:"cloud"}const zn=Ot((e,t)=>({enabled:!0,status:"unauthenticated",environment:ql(),tenants:[],uipathUrl:null,pollTimer:null,expiryTimer:null,init:async()=>{try{const n=await fetch("/api/config");if(n.ok&&!(await n.json()).auth_enabled){e({enabled:!1});return}const r=await cr();e({status:r.status,tenants:r.tenants??[],uipathUrl:r.uipath_url??null}),r.status==="authenticated"&&t().startExpiryCheck()}catch(n){console.error("Auth init failed",n)}},setEnvironment:n=>{localStorage.setItem(vs,n),e({environment:n})},startLogin:async()=>{const{environment:n}=t();try{const r=await Hl(n);e({status:"pending"}),window.open(r.auth_url,"_blank"),t().pollStatus()}catch(r){console.error("Login failed",r)}},pollStatus:()=>{const{pollTimer:n}=t();if(n)return;const r=setInterval(async()=>{try{const i=await cr();i.status!=="pending"&&(t().stopPolling(),e({status:i.status,tenants:i.tenants??[],uipathUrl:i.uipath_url??null}),i.status==="authenticated"&&t().startExpiryCheck())}catch{}},2e3);e({pollTimer:r})},stopPolling:()=>{const{pollTimer:n}=t();n&&(clearInterval(n),e({pollTimer:null}))},startExpiryCheck:()=>{const{expiryTimer:n}=t();if(n)return;const r=setInterval(async()=>{try{(await cr()).status==="expired"&&(t().stopExpiryCheck(),e({status:"expired"}))}catch{}},3e4);e({expiryTimer:r})},stopExpiryCheck:()=>{const{expiryTimer:n}=t();n&&(clearInterval(n),e({expiryTimer:null}))},selectTenant:async n=>{try{const r=await Wl(n);e({status:"authenticated",uipathUrl:r.uipath_url,tenants:[]}),t().startExpiryCheck()}catch(r){console.error("Tenant selection failed",r)}},logout:async()=>{t().stopPolling(),t().stopExpiryCheck();try{await Kl()}catch{}e({status:"unauthenticated",tenants:[],uipathUrl:null})}})),ks=Ot(e=>({projectName:null,projectVersion:null,projectAuthors:null,init:async()=>{try{const t=await fetch("/api/config");if(t.ok){const n=await t.json();e({projectName:n.project_name??null,projectVersion:n.project_version??null,projectAuthors:n.project_authors??null})}}catch{}}}));class Vl{constructor(t){It(this,"ws",null);It(this,"url");It(this,"handlers",new Set);It(this,"reconnectTimer",null);It(this,"shouldReconnect",!0);It(this,"pendingMessages",[]);It(this,"activeSubscriptions",new Set);const n=window.location.protocol==="https:"?"wss:":"ws:";this.url=t??`${n}//${window.location.host}/ws`}connect(){var t;((t=this.ws)==null?void 0:t.readyState)!==WebSocket.OPEN&&(this.ws=new WebSocket(this.url),this.ws.onopen=()=>{console.log("[ws] connected");for(const n of this.activeSubscriptions)this.sendRaw(JSON.stringify({type:"subscribe",payload:{run_id:n}}));for(const n of this.pendingMessages)this.sendRaw(n);this.pendingMessages=[]},this.ws.onmessage=n=>{let r;try{r=JSON.parse(n.data)}catch{console.warn("[ws] failed to parse message",n.data);return}this.handlers.forEach(i=>{try{i(r)}catch(s){console.error("[ws] handler error",s)}})},this.ws.onclose=()=>{console.log("[ws] disconnected"),this.shouldReconnect&&(this.reconnectTimer=setTimeout(()=>this.connect(),2e3))},this.ws.onerror=()=>{var n;(n=this.ws)==null||n.close()})}disconnect(){var t;this.shouldReconnect=!1,this.reconnectTimer&&clearTimeout(this.reconnectTimer),(t=this.ws)==null||t.close(),this.ws=null}onMessage(t){return this.handlers.add(t),()=>this.handlers.delete(t)}sendRaw(t){var n;((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN&&this.ws.send(t)}send(t,n){var i;const r=JSON.stringify({type:t,payload:n});((i=this.ws)==null?void 0:i.readyState)===WebSocket.OPEN?this.ws.send(r):this.pendingMessages.push(r)}subscribe(t){this.activeSubscriptions.add(t),this.send("subscribe",{run_id:t})}unsubscribe(t){this.activeSubscriptions.delete(t),this.send("unsubscribe",{run_id:t})}sendChatMessage(t,n){this.send("chat.message",{run_id:t,text:n})}sendInterruptResponse(t,n){this.send("chat.interrupt_response",{run_id:t,data:n})}debugStep(t){this.send("debug.step",{run_id:t})}debugContinue(t){this.send("debug.continue",{run_id:t})}debugStop(t){this.send("debug.stop",{run_id:t})}setBreakpoints(t,n){this.send("debug.set_breakpoints",{run_id:t,breakpoints:n})}sendAgentMessage(t,n,r,i){this.send("agent.message",{text:t,model:n,session_id:r??void 0,skill_ids:i&&i.length>0?i:void 0})}sendAgentStop(t){this.send("agent.stop",{session_id:t})}sendToolApproval(t,n,r){this.send("agent.tool_response",{session_id:t,tool_call_id:n,approved:r})}sendQuestionResponse(t,n,r){this.send("agent.question_response",{session_id:t,question_id:n,answer:r})}}const Lt="/api";async function jt(e,t){const n=await fetch(e,t);if(!n.ok){let r;try{r=(await n.json()).detail||n.statusText}catch{r=n.statusText}const i=new Error(`HTTP ${n.status}`);throw i.detail=r,i.status=n.status,i}return n.json()}async function Zr(){return jt(`${Lt}/entrypoints`)}async function Yl(e){return jt(`${Lt}/entrypoints/${encodeURIComponent(e)}/schema`)}async function Xl(e){return jt(`${Lt}/entrypoints/${encodeURIComponent(e)}/mock-input`)}async function Zl(e){return jt(`${Lt}/entrypoints/${encodeURIComponent(e)}/graph`)}async function Oi(e,t,n="run",r=[]){return jt(`${Lt}/runs`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entrypoint:e,input_data:t,mode:n,breakpoints:r})})}async function Jl(){return jt(`${Lt}/runs`)}async function ur(e){return jt(`${Lt}/runs/${e}`)}async function Ql(){return jt(`${Lt}/reload`,{method:"POST"})}const Me=Ot(e=>({evaluators:[],localEvaluators:[],evalSets:{},evalRuns:{},setEvaluators:t=>e({evaluators:t}),setLocalEvaluators:t=>e({localEvaluators:t}),addLocalEvaluator:t=>e(n=>({localEvaluators:[...n.localEvaluators,t]})),upsertLocalEvaluator:t=>e(n=>({localEvaluators:n.localEvaluators.some(r=>r.id===t.id)?n.localEvaluators.map(r=>r.id===t.id?t:r):[...n.localEvaluators,t]})),setEvalSets:t=>e({evalSets:Object.fromEntries(t.map(n=>[n.id,n]))}),addEvalSet:t=>e(n=>({evalSets:{...n.evalSets,[t.id]:t}})),updateEvalSetEvaluators:(t,n)=>e(r=>{const i=r.evalSets[t];return i?{evalSets:{...r.evalSets,[t]:{...i,evaluator_ids:n}}}:r}),incrementEvalSetCount:(t,n=1)=>e(r=>{const i=r.evalSets[t];return i?{evalSets:{...r.evalSets,[t]:{...i,eval_count:i.eval_count+n}}}:r}),setEvalRuns:t=>e({evalRuns:Object.fromEntries(t.map(n=>[n.id,n]))}),upsertEvalRun:t=>e(n=>({evalRuns:{...n.evalRuns,[t.id]:t}})),updateEvalRunProgress:(t,n,r)=>e(i=>{const s=i.evalRuns[t];return s?{evalRuns:{...i.evalRuns,[t]:{...s,progress_completed:n,progress_total:r,status:"running"}}}:i}),completeEvalRun:(t,n,r)=>e(i=>{const s=i.evalRuns[t];return s?{evalRuns:{...i.evalRuns,[t]:{...s,status:"completed",overall_score:n,evaluator_scores:r,end_time:new Date().toISOString()}}}:i})}));let ec=0;function $t(){return`agent-msg-${++ec}`}const ze=Ot(e=>({sessionId:null,status:"idle",_lastActiveAt:null,messages:[],plan:[],activeQuestion:null,models:[],selectedModel:null,modelsLoading:!1,skills:[],selectedSkillIds:[],skillsLoading:!1,setStatus:t=>e(n=>{const r=n.status==="thinking"||n.status==="planning"||n.status==="executing"||n.status==="awaiting_approval";return{status:t,_lastActiveAt:r&&!(t==="thinking"||t==="planning"||t==="executing"||t==="awaiting_approval")?Date.now():n._lastActiveAt}}),addUserMessage:t=>e(n=>({messages:[...n.messages,{id:$t(),role:"user",content:t,timestamp:Date.now()}]})),appendAssistantText:(t,n)=>e(r=>{const i=[...r.messages],s=i[i.length-1];return s&&s.role==="assistant"&&!s.done?i[i.length-1]={...s,content:s.content+t,done:n}:i.push({id:$t(),role:"assistant",content:t,timestamp:Date.now(),done:n}),{messages:i}}),setPlan:t=>e(n=>{const r=[...n.messages],i=r.findIndex(o=>o.role==="plan"),s={id:i>=0?r[i].id:$t(),role:"plan",content:"",timestamp:Date.now(),planItems:t};return i>=0?r[i]=s:r.push(s),{messages:r,plan:t}}),addToolUse:(t,n)=>e(r=>{const i=[...r.messages],s=i[i.length-1],o={tool:t,args:n};return s&&s.role==="tool"&&s.toolCalls?i[i.length-1]={...s,toolCalls:[...s.toolCalls,o]}:i.push({id:$t(),role:"tool",content:"",timestamp:Date.now(),toolCalls:[o]}),{messages:i}}),addToolResult:(t,n,r)=>e(i=>{const s=[...i.messages];for(let o=s.length-1;o>=0;o--){const l=s[o];if(l.role==="tool"&&l.toolCalls){const u=[...l.toolCalls];for(let c=u.length-1;c>=0;c--)if(u[c].tool===t&&u[c].result===void 0)return u[c]={...u[c],result:n,is_error:r},s[o]={...l,toolCalls:u},{messages:s}}}return{messages:s}}),addToolApprovalRequest:(t,n,r)=>e(i=>{const s=[...i.messages];for(let u=s.length-1;u>=0;u--){const c=s[u];if(c.role==="tool"&&c.toolCalls){const d=[...c.toolCalls];for(let p=d.length-1;p>=0;p--)if(d[p].tool===n&&!d[p].status&&d[p].result===void 0)return d[p]={...d[p],tool_call_id:t,status:"pending"},s[u]={...c,toolCalls:d},{messages:s}}if(c.role!=="tool")break}const o={tool:n,args:r,tool_call_id:t,status:"pending"},l=s[s.length-1];return l&&l.role==="tool"&&l.toolCalls?s[s.length-1]={...l,toolCalls:[...l.toolCalls,o]}:s.push({id:$t(),role:"tool",content:"",timestamp:Date.now(),toolCalls:[o]}),{messages:s}}),resolveToolApproval:(t,n)=>e(r=>{const i=[...r.messages];for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.role==="tool"&&o.toolCalls){const l=[...o.toolCalls];for(let u=l.length-1;u>=0;u--)if(l[u].tool_call_id===t)return l[u]={...l[u],status:n?"approved":"denied"},i[s]={...o,toolCalls:l},{messages:i}}}return{messages:i}}),appendThinking:t=>e(n=>{const r=[...n.messages],i=r[r.length-1];return i&&i.role==="thinking"?r[r.length-1]={...i,content:i.content+t}:r.push({id:$t(),role:"thinking",content:t,timestamp:Date.now()}),{messages:r}}),addError:t=>e(n=>({status:"error",messages:[...n.messages,{id:$t(),role:"assistant",content:`Error: ${t}`,timestamp:Date.now(),done:!0}]})),setActiveQuestion:t=>e({activeQuestion:t}),setSessionId:t=>{sessionStorage.setItem("agent_session_id",t),e({sessionId:t})},setModels:t=>e({models:t}),setSelectedModel:t=>e({selectedModel:t}),setModelsLoading:t=>e({modelsLoading:t}),setSkills:t=>e({skills:t}),setSelectedSkillIds:t=>e({selectedSkillIds:t}),toggleSkill:t=>e(n=>({selectedSkillIds:n.selectedSkillIds.includes(t)?n.selectedSkillIds.filter(i=>i!==t):[...n.selectedSkillIds,t]})),setSkillsLoading:t=>e({skillsLoading:t}),hydrateSession:t=>e({sessionId:t.session_id,status:t.status||"done",messages:t.messages,plan:t.plan,selectedModel:t.model||null}),clearSession:()=>{sessionStorage.removeItem("agent_session_id"),e({sessionId:null,status:"idle",_lastActiveAt:null,messages:[],plan:[],activeQuestion:null})}})),be=Ot(e=>({children:{},expanded:{},selectedFile:null,openTabs:[],fileCache:{},dirty:{},buffers:{},loadingDirs:{},loadingFile:!1,agentChangedFiles:{},diffView:null,setChildren:(t,n)=>e(r=>({children:{...r.children,[t]:n}})),toggleExpanded:t=>e(n=>({expanded:{...n.expanded,[t]:!n.expanded[t]}})),setSelectedFile:t=>e({selectedFile:t}),openTab:t=>e(n=>({selectedFile:t,openTabs:n.openTabs.includes(t)?n.openTabs:[...n.openTabs,t]})),closeTab:t=>e(n=>{const r=n.openTabs.filter(c=>c!==t);let i=n.selectedFile;if(i===t){const c=n.openTabs.indexOf(t);i=r[Math.min(c,r.length-1)]??null}const{[t]:s,...o}=n.dirty,{[t]:l,...u}=n.buffers;return{openTabs:r,selectedFile:i,dirty:o,buffers:u}}),setFileContent:(t,n)=>e(r=>({fileCache:{...r.fileCache,[t]:n}})),updateBuffer:(t,n)=>e(r=>({buffers:{...r.buffers,[t]:n},dirty:{...r.dirty,[t]:!0}})),markClean:t=>e(n=>{const{[t]:r,...i}=n.dirty,{[t]:s,...o}=n.buffers;return{dirty:i,buffers:o}}),setLoadingDir:(t,n)=>e(r=>({loadingDirs:{...r.loadingDirs,[t]:n}})),setLoadingFile:t=>e({loadingFile:t}),markAgentChanged:t=>e(n=>({agentChangedFiles:{...n.agentChangedFiles,[t]:Date.now()}})),clearAgentChanged:t=>e(n=>{const{[t]:r,...i}=n.agentChangedFiles;return{agentChangedFiles:i}}),setDiffView:t=>e({diffView:t}),expandPath:t=>e(n=>{const r=t.split("/"),i={...n.expanded};for(let s=1;se.current.onMessage(h=>{var v,y;switch(h.type){case"run.updated":t(h.payload);break;case"trace":n(h.payload);break;case"log":r(h.payload);break;case"chat":{const x=h.payload.run_id;i(x,h.payload);break}case"chat.interrupt":{const x=h.payload.run_id;s(x,h.payload);break}case"state":{const x=h.payload.run_id,C=h.payload.node_name,O=h.payload.qualified_node_name??null,j=h.payload.phase??null,N=h.payload.payload;C==="__start__"&&j==="started"&&u(x),j==="started"?o(x,C,O):j==="completed"&&l(x,C),c(x,C,N,O,j);break}case"reload":{h.payload.reloaded?Zr().then(C=>{const O=ve.getState();O.setEntrypoints(C.map(j=>j.name)),O.setReloadPending(!1)}).catch(C=>console.error("Failed to refresh entrypoints:",C)):ve.getState().setReloadPending(!0);break}case"files.changed":{const x=h.payload.files,C=new Set(x),O=be.getState(),j=ze.getState(),N=j.status,B=N==="thinking"||N==="planning"||N==="executing"||N==="awaiting_approval",D=!B&&j._lastActiveAt!=null&&Date.now()-j._lastActiveAt<3e3,R=x.filter(T=>T in O.children?!1:(T.split("/").pop()??"").includes("."));if(console.log("[files.changed]",{all:x,files:R,agentStatus:N,agentIsActive:B,recentlyActive:D}),B||D){let T=!1;for(const L of R){if(O.dirty[L])continue;const M=((v=O.fileCache[L])==null?void 0:v.content)??null,w=((y=O.fileCache[L])==null?void 0:y.language)??null;Lr(L).then(k=>{const I=be.getState();if(I.dirty[L])return;I.setFileContent(L,k),I.expandPath(L);const W=L.split("/");for(let q=1;qbe.getState().setChildren(g,F)).catch(()=>{})}const U=be.getState().openTabs.includes(L);!T&&U&&M!==null&&k.content!==null&&M!==k.content&&(T=!0,be.getState().setSelectedFile(L),I.setDiffView({path:L,original:M,modified:k.content,language:w}),setTimeout(()=>{const q=be.getState().diffView;q&&q.path===L&&q.original===M&&be.getState().setDiffView(null)},5e3)),I.markAgentChanged(L),setTimeout(()=>be.getState().clearAgentChanged(L),1e4)}).catch(()=>{const k=be.getState();k.openTabs.includes(L)&&k.closeTab(L)})}}else for(const T of O.openTabs)O.dirty[T]||!C.has(T)||Lr(T).then(L=>{var w;const M=be.getState();M.dirty[T]||((w=M.fileCache[T])==null?void 0:w.content)!==L.content&&M.setFileContent(T,L)}).catch(()=>{});const S=new Set;for(const T of x){const L=T.lastIndexOf("/"),M=L===-1?"":T.substring(0,L);M in O.children&&S.add(M)}for(const T of S)$n(T).then(L=>be.getState().setChildren(T,L)).catch(()=>{});break}case"eval_run.created":d(h.payload);break;case"eval_run.progress":{const{run_id:x,completed:C,total:O,item_result:j}=h.payload;p(x,C,O,j);break}case"eval_run.completed":{const{run_id:x,overall_score:C,evaluator_scores:O}=h.payload;m(x,C,O);break}case"agent.status":{const{session_id:x,status:C}=h.payload,O=ze.getState();O.sessionId||O.setSessionId(x),O.setStatus(C),(C==="done"||C==="error"||C==="idle")&&O.setActiveQuestion(null);break}case"agent.text":{const{session_id:x,content:C,done:O}=h.payload,j=ze.getState();j.sessionId||j.setSessionId(x),j.appendAssistantText(C,O);break}case"agent.plan":{const{session_id:x,items:C}=h.payload,O=ze.getState();O.sessionId||O.setSessionId(x),O.setPlan(C);break}case"agent.tool_use":{const{session_id:x,tool:C,args:O}=h.payload,j=ze.getState();j.sessionId||j.setSessionId(x),j.addToolUse(C,O);break}case"agent.tool_result":{const{tool:x,result:C,is_error:O}=h.payload;ze.getState().addToolResult(x,C,O);break}case"agent.tool_approval":{const{session_id:x,tool_call_id:C,tool:O,args:j}=h.payload,N=ze.getState();N.sessionId||N.setSessionId(x),N.addToolApprovalRequest(C,O,j);break}case"agent.thinking":{const{content:x}=h.payload;ze.getState().appendThinking(x);break}case"agent.text_delta":{const{session_id:x,delta:C}=h.payload,O=ze.getState();O.sessionId||O.setSessionId(x),O.appendAssistantText(C,!1);break}case"agent.question":{const{session_id:x,question_id:C,question:O,options:j}=h.payload,N=ze.getState();N.sessionId||N.setSessionId(x),N.setActiveQuestion({question_id:C,question:O,options:j});break}case"agent.token_usage":break;case"agent.error":{const{message:x}=h.payload;ze.getState().addError(x);break}}}),[t,n,r,i,s,o,l,u,c,d,p,m]),e.current}function rc(e){const t=e.replace(/^#\/?/,""),n={section:"debug",view:"new",runId:null,tab:"traces",setupEntrypoint:null,setupMode:null,evalCreating:!1,evalSetId:null,evalRunId:null,evalRunItemName:null,evaluatorId:null,evaluatorCreateType:null,evaluatorFilter:null,explorerFile:null};if(!t||t==="new"||t==="debug"||t==="debug/new")return n;const r=t.match(/^(?:debug\/)?setup\/([^/]+)\/(run|chat)$/);if(r)return{...n,view:"setup",setupEntrypoint:decodeURIComponent(r[1]),setupMode:r[2]};const i=t.match(/^(?:debug\/)?runs\/([^/]+)(?:\/(traces|output))?$/);if(i)return{...n,view:"details",runId:i[1],tab:i[2]??"traces"};if(t==="evals/new")return{...n,section:"evals",evalCreating:!0};const s=t.match(/^evals\/runs\/([^/]+?)(?:\/([^/]+))?$/);if(s)return{...n,section:"evals",evalRunId:s[1],evalRunItemName:s[2]?decodeURIComponent(s[2]):null};const o=t.match(/^evals\/sets\/([^/]+)$/);if(o)return{...n,section:"evals",evalSetId:o[1]};if(t==="evals")return{...n,section:"evals"};const l=t.match(/^evaluators\/new(?:\/(deterministic|llm|tool))?$/);if(l)return{...n,section:"evaluators",evaluatorCreateType:l[1]??"any"};const u=t.match(/^evaluators\/category\/(deterministic|llm|tool)$/);if(u)return{...n,section:"evaluators",evaluatorFilter:u[1]};const c=t.match(/^evaluators\/([^/]+)$/);if(c)return{...n,section:"evaluators",evaluatorId:c[1]};if(t==="evaluators")return{...n,section:"evaluators"};const d=t.match(/^explorer\/file\/(.+)$/);return d?{...n,section:"explorer",explorerFile:decodeURIComponent(d[1])}:t==="explorer"?{...n,section:"explorer"}:n}function ic(){return window.location.hash}function oc(e){return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)}function st(){const e=_.useSyncExternalStore(oc,ic),t=rc(e),n=_.useCallback(r=>{window.location.hash=r},[]);return{...t,navigate:n}}const Li="(max-width: 767px)";function sc(){const[e,t]=_.useState(()=>window.matchMedia(Li).matches);return _.useEffect(()=>{const n=window.matchMedia(Li),r=i=>t(i.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const ac=[{section:"debug",label:"Developer Console",icon:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"8",y:"6",width:"8",height:"14",rx:"4"}),a.jsx("path",{d:"M6 10H4"}),a.jsx("path",{d:"M6 18H4"}),a.jsx("path",{d:"M18 10h2"}),a.jsx("path",{d:"M18 18h2"}),a.jsx("path",{d:"M8 14h8"}),a.jsx("path",{d:"M9 6l-1.5-2"}),a.jsx("path",{d:"M15 6l1.5-2"}),a.jsx("path",{d:"M6 14H4"}),a.jsx("path",{d:"M18 14h2"})]})},{section:"evals",label:"Evals",icon:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M9 3h6"}),a.jsx("path",{d:"M10 3v6.5L5 20a1 1 0 0 0 .9 1.4h12.2a1 1 0 0 0 .9-1.4L14 9.5V3"}),a.jsx("path",{d:"M8.5 14h7"})]})},{section:"evaluators",label:"Evaluators",icon:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M12 2l7 4v5c0 5.25-3.5 9.74-7 11-3.5-1.26-7-5.75-7-11V6l7-4z"}),a.jsx("path",{d:"M9 12l2 2 4-4"})]})},{section:"explorer",label:"Explorer",icon:a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:a.jsx("path",{d:"M7.5 22.5H17.595C17.07 23.4 16.11 24 15 24H7.5C4.185 24 1.5 21.315 1.5 18V6C1.5 4.89 2.1 3.93 3 3.405V18C3 20.475 5.025 22.5 7.5 22.5ZM21 8.121V18C21 19.6545 19.6545 21 18 21H7.5C5.8455 21 4.5 19.6545 4.5 18V3C4.5 1.3455 5.8455 0 7.5 0H12.879C13.4715 0 14.0505 0.24 14.4705 0.6585L20.3415 6.5295C20.766 6.954 21 7.5195 21 8.121ZM13.5 6.75C13.5 7.164 13.8375 7.5 14.25 7.5H19.1895L13.5 1.8105V6.75ZM19.5 18V9H14.25C13.0095 9 12 7.9905 12 6.75V1.5H7.5C6.672 1.5 6 2.1735 6 3V18C6 18.8265 6.672 19.5 7.5 19.5H18C18.828 19.5 19.5 18.8265 19.5 18Z"})})}];function lc({section:e,onSectionChange:t}){return a.jsx("div",{className:"w-12 flex flex-col items-center shrink-0 border-r",style:{background:"var(--activity-bar-bg)",borderColor:"var(--border)"},children:a.jsx("div",{className:"flex flex-col items-center gap-1 pt-2",children:ac.map(n=>{const r=e===n.section;return a.jsxs("button",{onClick:()=>t(n.section),className:"w-10 h-10 flex items-center justify-center rounded cursor-pointer transition-colors relative",style:{color:r?"var(--text-primary)":"var(--text-muted)",background:r?"var(--bg-hover)":"transparent",border:"none"},title:n.label,onMouseEnter:i=>{r||(i.currentTarget.style.color="var(--text-secondary)")},onMouseLeave:i=>{r||(i.currentTarget.style.color="var(--text-muted)")},children:[r&&a.jsx("div",{className:"absolute left-0 top-1.5 bottom-1.5 w-0.5 rounded-r",style:{background:"var(--accent)"}}),n.icon]},n.section)})})})}const tt="/api";async function nt(e,t){const n=await fetch(e,t);if(!n.ok){let r;try{r=(await n.json()).detail||n.statusText}catch{r=n.statusText}const i=new Error(`HTTP ${n.status}`);throw i.detail=r,i.status=n.status,i}return n.json()}async function cc(){return nt(`${tt}/evaluators`)}async function Es(){return nt(`${tt}/eval-sets`)}async function uc(e){return nt(`${tt}/eval-sets`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function dc(e,t){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}/items`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async function pc(e,t){await nt(`${tt}/eval-sets/${encodeURIComponent(e)}/items/${encodeURIComponent(t)}`,{method:"DELETE"})}async function fc(e){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}`)}async function mc(e){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}/runs`,{method:"POST"})}async function gc(){return nt(`${tt}/eval-runs`)}async function ji(e){return nt(`${tt}/eval-runs/${encodeURIComponent(e)}`)}async function ei(){return nt(`${tt}/local-evaluators`)}async function hc(e){return nt(`${tt}/local-evaluators`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function bc(e,t){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}/evaluators`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({evaluator_refs:t})})}async function xc(e,t){return nt(`${tt}/local-evaluators/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}const yc={"uipath-exact-match":e=>({expectedOutput:e}),"uipath-json-similarity":e=>({expectedOutput:e}),"uipath-contains":()=>({searchText:""}),"uipath-llm-judge-output-semantic-similarity":e=>({expectedOutput:e}),"uipath-llm-judge-output-strict-json-similarity":e=>({expectedOutput:e}),"uipath-llm-judge-trajectory-similarity":()=>({expectedAgentBehavior:""}),"uipath-llm-judge-trajectory-simulation":()=>({expectedAgentBehavior:""}),"uipath-tool-call-count":()=>({}),"uipath-tool-call-args":()=>({}),"uipath-tool-call-order":()=>({}),"uipath-tool-call-output":()=>({})};function vc(e,t){if(!e)return{};const n=yc[e.evaluator_type_id];return n?n(t):e.type==="tool"?{}:e.evaluator_type_id.includes("trajectory")?{expectedAgentBehavior:""}:{expectedOutput:t}}function ws(e){return e?e.type==="tool"?!0:e.evaluator_type_id.includes("tool-call"):!1}function kc(e){return e?ws(e)?{label:"tools",color:"var(--warning, #e5a00d)"}:e.evaluator_type_id.includes("trajectory")?{label:"quality",color:"var(--info, #3b82f6)"}:{label:"output",color:"var(--success, #22c55e)"}:{label:"output",color:"var(--success, #22c55e)"}}function Ec({run:e,onClose:t}){const n=Me(R=>R.evalSets),r=Me(R=>R.setEvalSets),i=Me(R=>R.incrementEvalSetCount),s=Me(R=>R.localEvaluators),o=Me(R=>R.setLocalEvaluators),[l,u]=_.useState(`run-${e.id.slice(0,8)}`),[c,d]=_.useState(new Set),[p,m]=_.useState({}),f=_.useRef(new Set),[b,h]=_.useState(!1),[v,y]=_.useState(null),[x,C]=_.useState(!1),O=Object.values(n),j=_.useMemo(()=>Object.fromEntries(s.map(R=>[R.id,R])),[s]),N=_.useMemo(()=>{const R=new Set;for(const S of c){const T=n[S];T&&T.evaluator_ids.forEach(L=>R.add(L))}return[...R]},[c,n]);_.useEffect(()=>{const R=e.output_data,S=f.current;m(T=>{const L={};for(const M of N)if(S.has(M)&&T[M]!==void 0)L[M]=T[M];else{const w=j[M],k=vc(w,R);L[M]=JSON.stringify(k,null,2)}return L})},[N,j,e.output_data]),_.useEffect(()=>{const R=S=>{S.key==="Escape"&&t()};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[t]),_.useEffect(()=>{O.length===0&&Es().then(r).catch(()=>{}),s.length===0&&ei().then(o).catch(()=>{})},[]);const B=R=>{d(S=>{const T=new Set(S);return T.has(R)?T.delete(R):T.add(R),T})},D=async()=>{var S;if(!l.trim()||c.size===0)return;y(null),h(!0);const R={};for(const T of N){const L=p[T];if(L!==void 0)try{R[T]=JSON.parse(L)}catch{y(`Invalid JSON for evaluator "${((S=j[T])==null?void 0:S.name)??T}"`),h(!1);return}}try{for(const T of c){const L=n[T],M=new Set((L==null?void 0:L.evaluator_ids)??[]),w={};for(const[k,I]of Object.entries(R))M.has(k)&&(w[k]=I);await dc(T,{name:l.trim(),inputs:e.input_data,expected_output:null,evaluation_criterias:w}),i(T)}C(!0),setTimeout(t,3e3)}catch(T){y(T.detail||T.message||"Failed to add item")}finally{h(!1)}};return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.5)"},onClick:R=>{R.target===R.currentTarget&&t()},children:a.jsxs("div",{className:"w-full max-w-2xl rounded-lg p-6 shadow-xl max-h-[85vh] flex flex-col",style:{background:"var(--bg-primary)",border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}}),a.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"Add to Eval Set"})]}),a.jsx("button",{onClick:t,className:"w-7 h-7 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:R=>{R.currentTarget.style.color="var(--text-primary)"},onMouseLeave:R=>{R.currentTarget.style.color="var(--text-muted)"},"aria-label":"Close",children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0 space-y-4 pr-1",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Item Name"}),a.jsx("input",{type:"text",value:l,onChange:R=>u(R.target.value),className:"w-full rounded-md px-3 py-2 text-xs",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"}})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Inputs"}),a.jsx("pre",{className:"rounded-md px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words max-h-32 overflow-y-auto",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:JSON.stringify(e.input_data,null,2)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Eval Sets"}),O.length===0?a.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"No eval sets found. Create one first."}):a.jsx("div",{className:"rounded-md border overflow-hidden max-h-40 overflow-y-auto",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:O.map(R=>a.jsxs("label",{className:"flex items-center gap-2.5 px-3 py-2 text-xs cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--border)"},onMouseEnter:S=>{S.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:S=>{S.currentTarget.style.background="transparent"},children:[a.jsx("input",{type:"checkbox",checked:c.has(R.id),onChange:()=>B(R.id),className:"accent-[var(--accent)]"}),a.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:R.name}),a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:[R.eval_count," items"]})]},R.id))})]}),N.length>0&&a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Evaluation Criteria"}),a.jsx("div",{className:"space-y-2",children:N.map(R=>{const S=j[R],T=ws(S),L=kc(S);return a.jsxs("div",{className:"rounded-md",style:{border:"1px solid var(--border)",background:"var(--bg-primary)",opacity:T?.6:1},children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{borderBottom:T?"none":"1px solid var(--border)"},children:[a.jsx("span",{className:"text-xs font-medium truncate flex-1",style:{color:"var(--text-primary)"},children:(S==null?void 0:S.name)??R}),a.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full font-medium",style:{color:L.color,background:`color-mix(in srgb, ${L.color} 12%, transparent)`},children:L.label})]}),T?a.jsx("div",{className:"px-3 pb-2",children:a.jsx("span",{className:"text-[10px] italic",style:{color:"var(--text-muted)"},children:"Default criteria — uses evaluator config"})}):a.jsx("div",{className:"px-3 pb-2 pt-1",children:a.jsx("textarea",{value:p[R]??"{}",onChange:M=>{f.current.add(R),m(w=>({...w,[R]:M.target.value}))},rows:8,className:"w-full rounded px-2 py-1.5 text-xs font-mono resize-y",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"}})})]},R)})})]})]}),a.jsxs("div",{className:"mt-4 space-y-3",children:[v&&a.jsx("p",{className:"text-xs px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:v}),x&&a.jsxs("p",{className:"text-xs px-3 py-2 rounded",style:{color:"var(--success)",background:"color-mix(in srgb, var(--success) 10%, var(--bg-secondary))"},children:["Added to ",c.size," eval set",c.size!==1?"s":"","."]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{onClick:t,className:"flex-1 py-2 rounded-md text-xs font-semibold cursor-pointer",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)",border:"1px solid var(--border)"},children:"Cancel"}),a.jsx("button",{onClick:D,disabled:!l.trim()||c.size===0||b||x,className:"flex-1 py-2 rounded-md text-[13px] font-semibold transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},children:b?"Adding...":x?"Added":"Add Item"})]})]})]})})}const wc={pending:"var(--text-muted)",running:"var(--warning)",suspended:"var(--info)",completed:"var(--success)",failed:"var(--error)"};function _c({run:e,isSelected:t,onClick:n}){var p;const r=wc[e.status]??"var(--text-muted)",i=((p=e.entrypoint.split("/").pop())==null?void 0:p.slice(0,16))??e.entrypoint,s=e.start_time?new Date(e.start_time).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"",[o,l]=_.useState(!1),[u,c]=_.useState(!1),d=_.useRef(null);return _.useEffect(()=>{if(!o)return;const m=f=>{d.current&&!d.current.contains(f.target)&&l(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[o]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"group relative w-full text-left px-3 py-1.5 flex items-center gap-2 transition-colors cursor-pointer",style:{background:t?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":void 0,borderLeft:t?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:m=>{t||(m.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:m=>{t||(m.currentTarget.style.background="")},onClick:n,children:[a.jsx("span",{className:"shrink-0 w-2 h-2 rounded-full",style:{background:r}}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-xs truncate",style:{color:t?"var(--text-primary)":"var(--text-secondary)"},children:i}),a.jsxs("div",{className:"text-[11px] tabular-nums",style:{color:"var(--text-muted)"},children:[s,e.duration?` · ${e.duration}`:""]})]}),e.status==="completed"&&a.jsxs("div",{ref:d,className:"relative shrink-0",children:[a.jsx("button",{onClick:m=>{m.stopPropagation(),l(f=>!f)},className:"opacity-40 group-hover:opacity-100 focus:opacity-100 w-7 h-7 flex items-center justify-center rounded transition-opacity cursor-pointer",style:{color:"var(--text-muted)"},onMouseEnter:m=>{m.currentTarget.style.color="var(--text-primary)",m.currentTarget.style.background="var(--bg-secondary)"},onMouseLeave:m=>{m.currentTarget.style.color="var(--text-muted)",m.currentTarget.style.background=""},"aria-label":"Actions",title:"Actions",children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[a.jsx("circle",{cx:"8",cy:"3",r:"1.5"}),a.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),a.jsx("circle",{cx:"8",cy:"13",r:"1.5"})]})}),o&&a.jsx("div",{className:"absolute right-0 top-full mt-1 z-50 min-w-[140px] rounded-md shadow-lg py-1",style:{background:"var(--bg-primary)",border:"1px solid var(--border)"},children:a.jsx("button",{onClick:m=>{m.stopPropagation(),l(!1),c(!0)},className:"w-full text-left px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{color:"var(--text-secondary)"},onMouseEnter:m=>{m.currentTarget.style.background="var(--bg-hover)",m.currentTarget.style.color="var(--text-primary)"},onMouseLeave:m=>{m.currentTarget.style.background="",m.currentTarget.style.color="var(--text-secondary)"},children:"Add to Eval Set"})})]})]}),u&&a.jsx(Ec,{run:e,onClose:()=>c(!1)})]})}function Di({runs:e,selectedRunId:t,onSelectRun:n,onNewRun:r}){const i=[...e].sort((s,o)=>new Date(o.start_time??0).getTime()-new Date(s.start_time??0).getTime());return a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:r,className:"mx-3 mt-2.5 mb-1 px-3 py-1.5 text-[11px] font-medium rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-secondary)"},onMouseEnter:s=>{s.currentTarget.style.color="var(--text-primary)",s.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:s=>{s.currentTarget.style.color="var(--text-secondary)",s.currentTarget.style.borderColor=""},children:"+ New Run"}),a.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"History"}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[i.map(s=>a.jsx(_c,{run:s,isSelected:s.id===t,onClick:()=>n(s.id)},s.id)),i.length===0&&a.jsx("p",{className:"text-xs px-3 py-4 text-center",style:{color:"var(--text-muted)"},children:"No runs yet"})]})]})}function _s(){const e=localStorage.getItem("uipath-dev-theme");return e==="light"||e==="dark"?e:"dark"}function Ns(e){document.documentElement.setAttribute("data-theme",e),localStorage.setItem("uipath-dev-theme",e)}Ns(_s());const Ss=Ot(e=>({theme:_s(),toggleTheme:()=>e(t=>{const n=t.theme==="dark"?"light":"dark";return Ns(n),{theme:n}})}));function Pi(){const{theme:e,toggleTheme:t}=Ss(),{enabled:n,status:r,environment:i,tenants:s,uipathUrl:o,setEnvironment:l,startLogin:u,selectTenant:c,logout:d}=zn(),{projectName:p,projectVersion:m,projectAuthors:f}=ks(),[b,h]=_.useState(!1),[v,y]=_.useState(""),x=_.useRef(null),C=_.useRef(null);_.useEffect(()=>{if(!b)return;const w=k=>{x.current&&!x.current.contains(k.target)&&C.current&&!C.current.contains(k.target)&&h(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[b]);const O=r==="authenticated",j=r==="expired",N=r==="pending",B=r==="needs_tenant";let D="UiPath: Disconnected",R=null,S=!0;O?(D=`UiPath: ${o?o.replace(/^https?:\/\/[^/]+\//,""):""}`,R="var(--success)",S=!1):j?(D=`UiPath: ${o?o.replace(/^https?:\/\/[^/]+\//,""):""} (expired)`,R="var(--error)",S=!1):N?D="UiPath: Signing in…":B&&(D="UiPath: Select Tenant");const T=()=>{N||(j?u():h(w=>!w))},L="flex items-center gap-1 px-1.5 rounded transition-colors",M={onMouseEnter:w=>{w.currentTarget.style.background="var(--bg-hover)",w.currentTarget.style.color="var(--text-primary)"},onMouseLeave:w=>{w.currentTarget.style.background="",w.currentTarget.style.color="var(--text-muted)"}};return a.jsxs("div",{className:"h-6 flex items-center justify-end gap-3 px-2 text-xs border-t shrink-0",style:{background:"var(--bg-secondary)",color:"var(--text-muted)",borderColor:"var(--border)",fontSize:"11px"},children:[n&&a.jsxs("div",{className:"relative flex items-center",children:[a.jsxs("div",{ref:C,className:`${L} cursor-pointer`,onClick:T,...M,title:O?o??"":j?"Token expired — click to re-authenticate":N?"Signing in…":B?"Select a tenant":"Click to sign in",children:[N?a.jsxs("svg",{className:"animate-spin",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10",strokeOpacity:"0.25"}),a.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",strokeLinecap:"round"})]}):R?a.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:R}}):S?a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 9.9-1"})]}):null,a.jsx("span",{className:"truncate max-w-[200px]",children:D})]}),b&&a.jsx("div",{ref:x,className:"absolute bottom-full right-0 mb-1 rounded border shadow-lg p-1 min-w-[180px]",style:{background:"var(--bg-secondary)",borderColor:"var(--border)"},children:O||j?a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:()=>{o&&window.open(o,"_blank","noopener,noreferrer"),h(!1)},className:"w-full flex items-center gap-2 px-2 py-2 text-[11px] rounded cursor-pointer transition-colors text-left",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:w=>{w.currentTarget.style.background="var(--bg-hover)",w.currentTarget.style.color="var(--text-primary)"},onMouseLeave:w=>{w.currentTarget.style.background="transparent",w.currentTarget.style.color="var(--text-muted)"},children:[a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),a.jsx("polyline",{points:"15 3 21 3 21 9"}),a.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),"Go to Platform"]}),a.jsxs("button",{onClick:()=>{d(),h(!1)},className:"w-full flex items-center gap-2 px-2 py-2 text-[11px] rounded cursor-pointer transition-colors text-left",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:w=>{w.currentTarget.style.background="var(--bg-hover)",w.currentTarget.style.color="var(--text-primary)"},onMouseLeave:w=>{w.currentTarget.style.background="transparent",w.currentTarget.style.color="var(--text-muted)"},children:[a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),a.jsx("polyline",{points:"16 17 21 12 16 7"}),a.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}),"Sign Out"]})]}):B?a.jsxs("div",{className:"p-1",children:[a.jsx("label",{className:"block text-[10px] font-medium mb-1",style:{color:"var(--text-muted)"},children:"Tenant"}),a.jsxs("select",{value:v,onChange:w=>y(w.target.value),className:"w-full rounded px-1.5 py-1 text-[10px] mb-1.5 appearance-auto",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-primary)"},children:[a.jsx("option",{value:"",children:"Select…"}),s.map(w=>a.jsx("option",{value:w,children:w},w))]}),a.jsx("button",{onClick:()=>{v&&(c(v),h(!1))},disabled:!v,className:"w-full px-2 py-1 text-[10px] font-medium rounded border border-[var(--border)] bg-transparent cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--text-muted)"},children:"Confirm"})]}):a.jsxs("div",{className:"p-1",children:[a.jsx("label",{className:"block text-[10px] font-medium mb-1",style:{color:"var(--text-muted)"},children:"Environment"}),a.jsxs("select",{value:i,onChange:w=>l(w.target.value),className:"w-full rounded px-1.5 py-0.5 text-[10px] mb-1.5 appearance-auto",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-muted)"},children:[a.jsx("option",{value:"cloud",children:"cloud"}),a.jsx("option",{value:"staging",children:"staging"}),a.jsx("option",{value:"alpha",children:"alpha"})]}),a.jsx("button",{onClick:()=>{u(),h(!1)},className:"w-full px-2 py-1 text-[10px] font-medium rounded border border-[var(--border)] bg-transparent cursor-pointer transition-colors",style:{color:"var(--text-muted)"},onMouseEnter:w=>{w.currentTarget.style.color="var(--text-primary)",w.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:w=>{w.currentTarget.style.color="var(--text-muted)",w.currentTarget.style.borderColor="var(--border)"},children:"Sign In"})]})})]}),p&&a.jsxs("span",{className:L,children:["Project: ",p]}),m&&a.jsxs("span",{className:L,children:["Version: v",m]}),f&&a.jsxs("span",{className:L,children:["Author: ",f]}),a.jsxs("a",{href:"https://github.com/UiPath/uipath-dev-python",target:"_blank",rel:"noopener noreferrer",className:`${L} cursor-pointer no-underline`,style:{color:"var(--text-muted)"},...M,title:"View on GitHub",children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})}),a.jsx("span",{children:"uipath-dev-python"})]}),a.jsxs("div",{className:`${L} cursor-pointer`,onClick:t,...M,title:`Switch to ${e==="dark"?"light":"dark"} theme`,children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e==="dark"?a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"5"}),a.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),a.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),a.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),a.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),a.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),a.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),a.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),a.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}):a.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),a.jsx("span",{children:e==="dark"?"Dark":"Light"})]})]})}function Nc(){const{navigate:e}=st(),t=ve(c=>c.entrypoints),[n,r]=_.useState(""),[i,s]=_.useState(!0),[o,l]=_.useState(null);_.useEffect(()=>{!n&&t.length>0&&r(t[0])},[t,n]),_.useEffect(()=>{n&&(s(!0),l(null),Yl(n).then(c=>{var p;const d=(p=c.input)==null?void 0:p.properties;s(!!(d!=null&&d.messages))}).catch(c=>{const d=c.detail||{};l(d.error||d.message||`Failed to load entrypoint "${n}"`)}))},[n]);const u=c=>{n&&e(`#/setup/${encodeURIComponent(n)}/${c}`)};return a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"w-full max-w-xl px-6",children:[a.jsxs("div",{className:"mb-8 text-center",children:[a.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:o?"var(--error)":"var(--accent)"}}),a.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"New Run"})]}),!o&&a.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:t.length>1?"Select an entrypoint and choose a mode":"Choose a mode"})]}),t.length>1&&a.jsxs("div",{className:"mb-8",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Entrypoint"}),a.jsx("select",{id:"entrypoint-select",value:n,onChange:c=>r(c.target.value),className:"w-full rounded-md px-3 py-2 text-xs font-mono cursor-pointer appearance-auto",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},children:t.map(c=>a.jsx("option",{value:c,children:c},c))})]}),o?a.jsxs("div",{className:"rounded-md border overflow-hidden",style:{borderColor:"color-mix(in srgb, var(--error) 25%, var(--border))",background:"var(--bg-secondary)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{borderBottom:"1px solid color-mix(in srgb, var(--error) 15%, var(--border))",background:"color-mix(in srgb, var(--error) 4%, var(--bg-secondary))"},children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0},children:a.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM7.25 4.75h1.5v4h-1.5v-4zm.75 6.75a.75.75 0 110-1.5.75.75 0 010 1.5z",fill:"var(--error)"})}),a.jsx("span",{className:"text-[11px] font-medium",style:{color:"var(--error)"},children:"Failed to load entrypoint"})]}),a.jsx("div",{className:"overflow-auto max-h-48 p-3",children:a.jsx("pre",{className:"text-[11px] font-mono whitespace-pre-wrap break-words leading-relaxed m-0",style:{color:"var(--text-muted)"},children:o})})]}):a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx(Bi,{title:"Autonomous",description:"Run the agent end-to-end. Set breakpoints to pause and inspect execution.",icon:a.jsx(Sc,{}),color:"var(--success)",onClick:()=>u("run"),disabled:!n}),a.jsx(Bi,{title:"Conversational",description:i?"Interactive chat session. Send messages and receive responses in real time.":'Requires a "messages" property in the input schema.',icon:a.jsx(Tc,{}),color:"var(--accent)",onClick:()=>u("chat"),disabled:!n||!i})]})]})})}function Bi({title:e,description:t,icon:n,color:r,onClick:i,disabled:s}){return a.jsxs("button",{onClick:i,disabled:s,className:"group flex flex-col items-center text-center p-6 rounded-md border transition-all cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--bg-secondary)",borderColor:"var(--border)"},onMouseEnter:o=>{s||(o.currentTarget.style.borderColor=r,o.currentTarget.style.background=`color-mix(in srgb, ${r} 5%, var(--bg-secondary))`)},onMouseLeave:o=>{o.currentTarget.style.borderColor="var(--border)",o.currentTarget.style.background="var(--bg-secondary)"},children:[a.jsx("div",{className:"mb-4 p-3 rounded-xl transition-colors",style:{background:`color-mix(in srgb, ${r} 10%, var(--bg-primary))`,color:r},children:n}),a.jsx("h3",{className:"text-sm font-semibold mb-1.5",style:{color:"var(--text-primary)"},children:e}),a.jsx("p",{className:"text-xs leading-relaxed",style:{color:"var(--text-muted)"},children:t})]})}function Sc(){return a.jsx("svg",{width:"28",height:"28",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M23.832 15.166H22.7487C22.7487 10.9735 19.3579 7.58268 15.1654 7.58268H14.082V6.20685C14.732 5.83852 15.1654 5.13435 15.1654 4.33268C15.1654 3.14102 14.2012 2.16602 12.9987 2.16602C11.7962 2.16602 10.832 3.14102 10.832 4.33268C10.832 5.13435 11.2654 5.83852 11.9154 6.20685V7.58268H10.832C6.63953 7.58268 3.2487 10.9735 3.2487 15.166H2.16536C1.56953 15.166 1.08203 15.6535 1.08203 16.2493V19.4993C1.08203 20.0952 1.56953 20.5827 2.16536 20.5827H3.2487V21.666C3.2487 22.8685 4.2237 23.8327 5.41536 23.8327H20.582C21.7845 23.8327 22.7487 22.8685 22.7487 21.666V20.5827H23.832C24.4279 20.5827 24.9154 20.0952 24.9154 19.4993V16.2493C24.9154 15.6535 24.4279 15.166 23.832 15.166ZM22.7487 18.416H20.582V21.666H5.41536V18.416H3.2487V17.3327H5.41536V15.166C5.41536 12.176 7.84203 9.74935 10.832 9.74935H15.1654C18.1554 9.74935 20.582 12.176 20.582 15.166V17.3327H22.7487V18.416ZM9.20703 14.6243L11.7637 17.181L10.4854 18.4594L9.20703 17.181L7.9287 18.4594L6.65036 17.181L9.20703 14.6243ZM16.7904 14.6243L19.347 17.181L18.0687 18.4594L16.7904 17.181L15.512 18.4594L14.2337 17.181L16.7904 14.6243Z",fill:"currentColor"})})}function Tc(){return a.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M9.20901 13.541L11.7657 16.0977L10.4873 17.376L9.20901 16.0977L7.93068 17.376L6.65234 16.0977L9.20901 13.541ZM16.7923 13.541L19.349 16.0977L18.0707 17.376L16.7923 16.0977L15.514 17.376L14.2357 16.0977L16.7923 13.541Z",fill:"currentColor"}),a.jsx("path",{d:"M5.25 8.58398H20.75C21.3023 8.58398 21.75 9.0317 21.75 9.58398V23.5293L16.874 21.9043C16.5683 21.8024 16.248 21.751 15.9258 21.751H5.25C4.69782 21.751 4.25018 21.3031 4.25 20.751V9.58398C4.25 9.0317 4.69772 8.58398 5.25 8.58398Z",stroke:"currentColor",strokeWidth:"2"}),a.jsx("ellipse",{cx:"12.9987",cy:"4.33268",rx:"2.16667",ry:"2.16667",fill:"currentColor"}),a.jsx("rect",{x:"11.918",y:"5.41602",width:"2.16667",height:"2.16667",fill:"currentColor"}),a.jsx("path",{d:"M1.08203 14C1.08203 13.4477 1.52975 13 2.08203 13H3.2487V18.4167H2.08203C1.52975 18.4167 1.08203 17.969 1.08203 17.4167V14Z",fill:"currentColor"}),a.jsx("rect",{x:"3.25",y:"15.166",width:"2.16667",height:"1.08333",fill:"currentColor"}),a.jsx("path",{d:"M22.75 13H23.9167C24.4689 13 24.9167 13.4477 24.9167 14V17.4167C24.9167 17.969 24.469 18.4167 23.9167 18.4167H22.75V13Z",fill:"currentColor"}),a.jsx("rect",{x:"20.582",y:"15.166",width:"2.16667",height:"1.08333",fill:"currentColor"})]})}const Cc="modulepreload",Ac=function(e){return"/"+e},Fi={},Ts=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(c){return Promise.all(c.map(d=>Promise.resolve(d).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=o(n.map(c=>{if(c=Ac(c),c in Fi)return;Fi[c]=!0;const d=c.endsWith(".css"),p=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${p}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":Cc,d||(m.as="script"),m.crossOrigin="",m.href=c,u&&m.setAttribute("nonce",u),document.head.appendChild(m),d)return new Promise((f,b)=>{m.addEventListener("load",f),m.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return i.then(o=>{for(const l of o||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})},Mc={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Ic({data:e}){const t=e.status,n=e.nodeWidth,r=e.label??"Start",i=e.hasBreakpoint,s=e.isPausedHere,o=e.isActiveNode,l=e.isExecutingNode,u=s?"var(--error)":l?"var(--success)":o?"var(--accent)":t==="completed"?"var(--success)":t==="running"?"var(--warning)":"var(--node-border)",c=s?"var(--error)":l?"var(--success)":"var(--accent)";return a.jsxs("div",{className:"px-3 py-1.5 rounded-full text-center text-xs overflow-hidden text-ellipsis whitespace-nowrap cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${u}`,boxShadow:s||o||l?`0 0 4px ${c}`:void 0,animation:s||o||l?`node-pulse-${s?"red":l?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r,children:[i&&a.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),r,a.jsx(ht,{type:"source",position:bt.Bottom,style:Mc})]})}const Rc={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Oc({data:e}){const t=e.status,n=e.nodeWidth,r=e.label??"End",i=e.hasBreakpoint,s=e.isPausedHere,o=e.isActiveNode,l=e.isExecutingNode,u=s?"var(--error)":l?"var(--success)":o?"var(--accent)":t==="completed"?"var(--success)":t==="failed"?"var(--error)":"var(--node-border)",c=s?"var(--error)":l?"var(--success)":"var(--accent)";return a.jsxs("div",{className:"px-3 py-1.5 rounded-full text-center text-xs overflow-hidden text-ellipsis whitespace-nowrap cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${u}`,boxShadow:s||o||l?`0 0 4px ${c}`:void 0,animation:s||o||l?`node-pulse-${s?"red":l?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r,children:[i&&a.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),a.jsx(ht,{type:"target",position:bt.Top,style:Rc}),r]})}const zi={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Lc({data:e}){const t=e.status,n=e.nodeWidth,r=e.model_name,i=e.label??"Model",s=e.hasBreakpoint,o=e.isPausedHere,l=e.isActiveNode,u=e.isExecutingNode,c=o?"var(--error)":u?"var(--success)":l?"var(--accent)":t==="completed"?"var(--success)":t==="running"?"var(--warning)":t==="failed"?"var(--error)":"var(--node-border)",d=o?"var(--error)":u?"var(--success)":"var(--accent)";return a.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${c}`,boxShadow:o||l||u?`0 0 4px ${d}`:void 0,animation:o||l||u?`node-pulse-${o?"red":u?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r?`${i} +${r}`:i,children:[s&&a.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),a.jsx(ht,{type:"target",position:bt.Top,style:zi}),a.jsx("div",{style:{color:"var(--info)",fontSize:9,marginBottom:1},children:"model"}),a.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:i}),r&&a.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",style:{color:"var(--text-muted)",fontSize:9,marginTop:1},title:r,children:r}),a.jsx(ht,{type:"source",position:bt.Bottom,style:zi})]})}const $i={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0},jc=3;function Dc({data:e}){const t=e.status,n=e.nodeWidth,r=e.tool_names,i=e.tool_count,s=e.label??"Tool",o=e.hasBreakpoint,l=e.isPausedHere,u=e.isActiveNode,c=e.isExecutingNode,d=l?"var(--error)":c?"var(--success)":u?"var(--accent)":t==="completed"?"var(--success)":t==="running"?"var(--warning)":t==="failed"?"var(--error)":"var(--node-border)",p=l?"var(--error)":c?"var(--success)":"var(--accent)",m=(r==null?void 0:r.slice(0,jc))??[],f=(i??(r==null?void 0:r.length)??0)-m.length;return a.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${d}`,boxShadow:l||u||c?`0 0 4px ${p}`:void 0,animation:l||u||c?`node-pulse-${l?"red":c?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r!=null&&r.length?`${s} ${r.join(` -`)}`:s,children:[o&&a.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),a.jsx(ht,{type:"target",position:bt.Top,style:zi}),a.jsxs("div",{style:{color:"var(--warning)",fontSize:9,marginBottom:1},children:["tools",i?` (${i})`:""]}),a.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s}),m.length>0&&a.jsxs("div",{style:{marginTop:3,fontSize:9,color:"var(--text-muted)",textAlign:"left"},children:[m.map(h=>a.jsx("div",{className:"truncate",children:h},h)),f>0&&a.jsxs("div",{style:{fontStyle:"italic"},children:["+",f," more"]})]}),a.jsx(ht,{type:"source",position:bt.Bottom,style:zi})]})}const $i={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Pc({data:e}){const t=e.label??"",n=e.status,r=e.hasBreakpoint,i=e.isPausedHere,s=e.isActiveNode,o=e.isExecutingNode,l=i?"var(--error)":o?"var(--success)":s?"var(--accent)":n==="completed"?"var(--success)":n==="running"?"var(--warning)":n==="failed"?"var(--error)":"var(--bg-tertiary)",u=i?"var(--error)":o?"var(--success)":"var(--accent)";return a.jsxs("div",{className:"relative cursor-pointer",style:{width:"100%",height:"100%",background:"var(--bg-secondary)",border:`1.5px ${i||s||o?"solid":"dashed"} ${l}`,borderRadius:8,boxShadow:i||s||o?`0 0 4px ${u}`:void 0,animation:i||s||o?`node-pulse-${i?"red":o?"green":"accent"} 1.5s ease-in-out infinite`:void 0},children:[r&&a.jsx("div",{className:"absolute",style:{top:4,left:4,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--bg-tertiary)",boxShadow:"0 0 4px var(--error)",zIndex:1}}),a.jsx(ht,{type:"target",position:bt.Top,style:$i}),a.jsx("div",{style:{padding:"4px 10px",fontSize:10,color:"var(--text-muted)",fontWeight:600,textAlign:"center",borderBottom:`1px solid ${l}`,background:"var(--bg-tertiary)",borderRadius:"8px 8px 0 0"},children:t}),a.jsx(ht,{type:"source",position:bt.Bottom,style:$i})]})}function Bc({data:e}){const t=e.status,n=e.nodeWidth,r=e.label??"",i=e.hasBreakpoint,s=e.isPausedHere,o=e.isActiveNode,l=e.isExecutingNode,u=s?"var(--error)":l?"var(--success)":o?"var(--accent)":t==="completed"?"var(--success)":t==="running"?"var(--warning)":t==="failed"?"var(--error)":"var(--node-border)",c=s?"var(--error)":l?"var(--success)":"var(--accent)";return a.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${u}`,boxShadow:s||o||l?`0 0 4px ${c}`:void 0,animation:s||o||l?`node-pulse-${s?"red":l?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r,children:[i&&a.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),a.jsx(ht,{type:"target",position:bt.Top}),a.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:r}),a.jsx(ht,{type:"source",position:bt.Bottom})]})}function Fc(e,t=8){if(e.length<2)return"";if(e.length===2)return`M ${e[0].x} ${e[0].y} L ${e[1].x} ${e[1].y}`;let n=`M ${e[0].x} ${e[0].y}`;for(let i=1;i0&&(n+=Math.min(r.length,3)*12+(r.length>3?12:0)+4),e!=null&&e.model_name&&(n+=14),n}let dr=null;async function Gc(){if(!dr){const{default:e}=await Ts(async()=>{const{default:t}=await import("./vendor-elk-CiLKfHel.js").then(n=>n.e);return{default:t}},__vite__mapDeps([0,1]));dr=new e}return dr}const Wi={"elk.algorithm":"layered","elk.direction":"DOWN","elk.edgeRouting":"ORTHOGONAL","elk.layered.crossingMinimization.strategy":"LAYER_SWEEP","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.spacing.nodeNode":"25","elk.layered.spacing.nodeNodeBetweenLayers":"50","elk.spacing.edgeNode":"30","elk.spacing.edgeEdge":"15","elk.layered.spacing.edgeNodeBetweenLayers":"25","elk.layered.spacing.edgeEdgeBetweenLayers":"15","elk.portAlignment.default":"CENTER","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES"},qc="[top=35,left=15,bottom=15,right=15]";function Vc(e){const t=[],n=[];for(const r of e.nodes){const i=r.data,s={id:r.id,width:Ui(i),height:Hi(i,r.type)};if(r.data.subgraph){const o=r.data.subgraph;delete s.width,delete s.height,s.layoutOptions={...Wi,"elk.padding":qc},s.children=o.nodes.map(l=>({id:`${r.id}/${l.id}`,width:Ui(l.data),height:Hi(l.data,l.type)})),s.edges=o.edges.map(l=>({id:`${r.id}/${l.id}`,sources:[`${r.id}/${l.source}`],targets:[`${r.id}/${l.target}`]}))}t.push(s)}for(const r of e.edges)n.push({id:r.id,sources:[r.source],targets:[r.target]});return{id:"root",layoutOptions:Wi,children:t,edges:n}}const jr={type:Rl.ArrowClosed,width:12,height:12,color:"var(--node-border)"};function Cs(e){return{stroke:"var(--node-border)",strokeWidth:1.5,...e?{strokeDasharray:"6 3"}:{}}}function Ki(e,t,n,r,i){var c;const s=(c=e.sections)==null?void 0:c[0],o=(i==null?void 0:i.x)??0,l=(i==null?void 0:i.y)??0;let u;if(s)u={sourcePoint:{x:s.startPoint.x+o,y:s.startPoint.y+l},targetPoint:{x:s.endPoint.x+o,y:s.endPoint.y+l},bendPoints:(s.bendPoints??[]).map(d=>({x:d.x+o,y:d.y+l}))};else{const d=t.get(e.sources[0]),p=t.get(e.targets[0]);d&&p&&(u={sourcePoint:{x:d.x+d.width/2,y:d.y+d.height},targetPoint:{x:p.x+p.width/2,y:p.y},bendPoints:[]})}return{id:e.id,source:e.sources[0],target:e.targets[0],type:"elk",data:u,style:Cs(r),markerEnd:jr,...n?{label:n,labelStyle:{fill:"var(--text-muted)",fontSize:10},labelBgStyle:{fill:"var(--bg-primary)",fillOpacity:.8}}:{}}}async function Yc(e){var u,c;const t=Vc(e),r=await(await Gc()).layout(t),i=new Map;for(const d of e.nodes)if(i.set(d.id,{type:d.type,data:d.data}),d.data.subgraph)for(const p of d.data.subgraph.nodes)i.set(`${d.id}/${p.id}`,{type:p.type,data:p.data});const s=[],o=[],l=new Map;for(const d of r.children??[]){const p=d.x??0,m=d.y??0;l.set(d.id,{x:p,y:m,width:d.width??0,height:d.height??0});for(const f of d.children??[])l.set(f.id,{x:p+(f.x??0),y:m+(f.y??0),width:f.width??0,height:f.height??0})}for(const d of r.children??[]){const p=i.get(d.id);if((((u=d.children)==null?void 0:u.length)??0)>0){s.push({id:d.id,type:"groupNode",data:{...(p==null?void 0:p.data)??{},nodeWidth:d.width,nodeHeight:d.height},position:{x:d.x??0,y:d.y??0},style:{width:d.width,height:d.height}});for(const b of d.children??[]){const x=i.get(b.id);s.push({id:b.id,type:(x==null?void 0:x.type)??"defaultNode",data:{...(x==null?void 0:x.data)??{},nodeWidth:b.width},position:{x:b.x??0,y:b.y??0},parentNode:d.id,extent:"parent"})}const f=d.x??0,h=d.y??0;for(const b of d.edges??[]){const x=e.nodes.find(w=>w.id===d.id),y=(c=x==null?void 0:x.data.subgraph)==null?void 0:c.edges.find(w=>`${d.id}/${w.id}`===b.id);o.push(Ki(b,l,y==null?void 0:y.label,y==null?void 0:y.conditional,{x:f,y:h}))}}else s.push({id:d.id,type:(p==null?void 0:p.type)??"defaultNode",data:{...(p==null?void 0:p.data)??{},nodeWidth:d.width},position:{x:d.x??0,y:d.y??0}})}for(const d of r.edges??[]){const p=e.edges.find(m=>m.id===d.id);o.push(Ki(d,l,p==null?void 0:p.label,p==null?void 0:p.conditional))}return{nodes:s,edges:o}}function Un({entrypoint:e,runId:t,breakpointNode:n,breakpointNextNodes:r,onBreakpointChange:i}){const[s,o,l]=Ol([]),[u,c,d]=Ll([]),[p,m]=N.useState(!0),[f,h]=N.useState(!1),[b,x]=N.useState(0),y=N.useRef(0),w=N.useRef(null),T=Ee(v=>v.breakpoints[t]),j=Ee(v=>v.toggleBreakpoint),O=Ee(v=>v.clearBreakpoints),_=Ee(v=>v.activeNodes[t]),P=Ee(v=>{var E;return(E=v.runs[t])==null?void 0:E.status}),D=N.useCallback((v,E)=>{if(E.type==="startNode"||E.type==="endNode")return;const I=E.type==="groupNode"?E.id:E.id.includes("/")?E.id.split("/").pop():E.id;j(t,I);const H=Ee.getState().breakpoints[t]??{};i==null||i(Object.keys(H))},[t,j,i]),R=T&&Object.keys(T).length>0,S=N.useCallback(()=>{if(R)O(t),i==null||i([]);else{const v=[];for(const I of s){if(I.type==="startNode"||I.type==="endNode"||I.parentNode)continue;const H=I.type==="groupNode"?I.id:I.id.includes("/")?I.id.split("/").pop():I.id;v.push(H)}for(const I of v)T!=null&&T[I]||j(t,I);const E=Ee.getState().breakpoints[t]??{};i==null||i(Object.keys(E))}},[t,R,T,s,O,j,i]);N.useEffect(()=>{o(v=>v.map(E=>{var U;if(E.type==="startNode"||E.type==="endNode")return E;const I=E.type==="groupNode"?E.id:E.id.includes("/")?E.id.split("/").pop():E.id,H=!!(T&&T[I]);return H!==!!((U=E.data)!=null&&U.hasBreakpoint)?{...E,data:{...E.data,hasBreakpoint:H}}:E}))},[T,o]),N.useEffect(()=>{const v=n?new Set(n.split(",").map(E=>E.trim()).filter(Boolean)):null;o(E=>E.map(I=>{var g,F;if(I.type==="startNode"||I.type==="endNode")return I;const H=I.type==="groupNode"?I.id:I.id.includes("/")?I.id.split("/").pop():I.id,U=(g=I.data)==null?void 0:g.label,V=v!=null&&(v.has(H)||U!=null&&v.has(U));return V!==!!((F=I.data)!=null&&F.isPausedHere)?{...I,data:{...I.data,isPausedHere:V}}:I}))},[n,b,o]);const M=Ee(v=>v.stateEvents[t]);N.useEffect(()=>{const v=!!n;let E=new Set;const I=new Set,H=new Set,U=new Set,V=new Map,g=new Map;if(M)for(const F of M)F.phase==="started"?g.set(F.node_name,F.qualified_node_name??null):F.phase==="completed"&&g.delete(F.node_name);o(F=>{var k;for(const ie of F)ie.type&&V.set(ie.id,ie.type);const $=ie=>{var W;const K=[];for(const re of F){const de=re.type==="groupNode"?re.id:re.id.includes("/")?re.id.split("/").pop():re.id,xe=(W=re.data)==null?void 0:W.label;(de===ie||xe!=null&&xe===ie)&&K.push(re.id)}return K};if(v&&n){const ie=n.split(",").map(K=>K.trim()).filter(Boolean);for(const K of ie)$(K).forEach(W=>E.add(W));if(r!=null&&r.length)for(const K of r)$(K).forEach(W=>H.add(W));_!=null&&_.prev&&$(_.prev).forEach(K=>I.add(K))}else if(g.size>0){const ie=new Map;for(const K of F){const W=(k=K.data)==null?void 0:k.label;if(!W)continue;const re=K.id.includes("/")?K.id.split("/").pop():K.id;for(const de of[re,W]){let xe=ie.get(de);xe||(xe=new Set,ie.set(de,xe)),xe.add(K.id)}}for(const[K,W]of g){let re=!1;if(W){const de=W.replace(/:/g,"/");for(const xe of F)xe.id===de&&(E.add(xe.id),re=!0)}if(!re){const de=ie.get(K);de&&de.forEach(xe=>E.add(xe))}}}return F}),c(F=>{const $=I.size===0||F.some(k=>E.has(k.target)&&I.has(k.source));return F.map(k=>{var K,W;let ie;return v?ie=E.has(k.target)&&(I.size===0||!$||I.has(k.source))||E.has(k.source)&&H.has(k.target):(ie=E.has(k.source),!ie&&V.get(k.target)==="endNode"&&E.has(k.target)&&(ie=!0)),ie?(v||U.add(k.target),{...k,style:{stroke:"var(--accent)",strokeWidth:2.5},markerEnd:{...jr,color:"var(--accent)"},data:{...k.data,highlighted:!0},animated:!0}):(K=k.data)!=null&&K.highlighted?{...k,style:Cs((W=k.data)==null?void 0:W.conditional),markerEnd:jr,data:{...k.data,highlighted:!1},animated:!1}:k})}),o(F=>F.map($=>{var K,W,re,de;const k=!v&&E.has($.id);if($.type==="startNode"||$.type==="endNode"){const xe=U.has($.id)||!v&&E.has($.id);return xe!==!!((K=$.data)!=null&&K.isActiveNode)||k!==!!((W=$.data)!=null&&W.isExecutingNode)?{...$,data:{...$.data,isActiveNode:xe,isExecutingNode:k}}:$}const ie=v?H.has($.id):U.has($.id);return ie!==!!((re=$.data)!=null&&re.isActiveNode)||k!==!!((de=$.data)!=null&&de.isExecutingNode)?{...$,data:{...$.data,isActiveNode:ie,isExecutingNode:k}}:$}))},[M,_,n,r,P,b,o,c]);const L=Ee(v=>v.graphCache[t]);N.useEffect(()=>{if(!L&&t!=="__setup__")return;const v=L?Promise.resolve(L):ec(e),E=++y.current;m(!0),h(!1),v.then(async I=>{if(y.current!==E)return;if(!I.nodes.length){h(!0);return}const{nodes:H,edges:U}=await Yc(I);if(y.current!==E)return;const V=Ee.getState().breakpoints[t],g=V?H.map(F=>{if(F.type==="startNode"||F.type==="endNode")return F;const $=F.type==="groupNode"?F.id:F.id.includes("/")?F.id.split("/").pop():F.id;return V[$]?{...F,data:{...F.data,hasBreakpoint:!0}}:F}):H;o(g),c(U),x(F=>F+1),setTimeout(()=>{var F;(F=w.current)==null||F.fitView({padding:.1,duration:200})},100)}).catch(()=>{y.current===E&&h(!0)}).finally(()=>{y.current===E&&m(!1)})},[e,t,L,o,c]),N.useEffect(()=>{const v=setTimeout(()=>{var E;(E=w.current)==null||E.fitView({padding:.1,duration:200})},100);return()=>clearTimeout(v)},[t]);const C=N.useRef(null);return N.useEffect(()=>{const v=C.current;if(!v)return;const E=new ResizeObserver(()=>{var I;(I=w.current)==null||I.fitView({padding:.1,duration:200})});return E.observe(v),()=>E.disconnect()},[p,f]),N.useEffect(()=>{o(v=>{var k,ie,K;const E=!!(M!=null&&M.length),I=P==="completed"||P==="failed",H=new Set,U=new Set(v.map(W=>W.id)),V=new Map;for(const W of v){const re=(k=W.data)==null?void 0:k.label;if(!re)continue;const de=W.id.includes("/")?W.id.split("/").pop():W.id;for(const xe of[de,re]){let Oe=V.get(xe);Oe||(Oe=new Set,V.set(xe,Oe)),Oe.add(W.id)}}if(E)for(const W of M){let re=!1;if(W.qualified_node_name){const de=W.qualified_node_name.replace(/:/g,"/");U.has(de)&&(H.add(de),re=!0)}if(!re){const de=V.get(W.node_name);de&&de.forEach(xe=>H.add(xe))}}const g=new Set;for(const W of v)W.parentNode&&H.has(W.id)&&g.add(W.parentNode);let F;P==="failed"&&H.size===0&&(F=(ie=v.find(W=>!W.parentNode&&W.type!=="startNode"&&W.type!=="endNode"&&W.type!=="groupNode"))==null?void 0:ie.id);let $;if(P==="completed"){const W=(K=v.find(re=>!re.parentNode&&re.type!=="startNode"&&re.type!=="endNode"&&re.type!=="groupNode"))==null?void 0:K.id;W&&!H.has(W)&&($=W)}return v.map(W=>{var de;let re;return W.id===F?re="failed":W.id===$||H.has(W.id)?re="completed":W.type==="startNode"?(!W.parentNode&&E||W.parentNode&&g.has(W.parentNode))&&(re="completed"):W.type==="endNode"?!W.parentNode&&I?re=P==="failed"?"failed":"completed":W.parentNode&&g.has(W.parentNode)&&(re="completed"):W.type==="groupNode"&&g.has(W.id)&&(re="completed"),re!==((de=W.data)==null?void 0:de.status)?{...W,data:{...W.data,status:re}}:W})})},[M,P,b,o]),p?a.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:"Loading graph..."}):f?a.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4",style:{color:"var(--text-muted)"},children:[a.jsxs("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("rect",{x:"38",y:"10",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.4"}),a.jsx("line",{x1:"60",y1:"34",x2:"60",y2:"46",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("rect",{x:"12",y:"46",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("rect",{x:"64",y:"46",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"60",y1:"46",x2:"34",y2:"46",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"60",y1:"46",x2:"86",y2:"46",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"34",y1:"70",x2:"34",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"86",y1:"70",x2:"86",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"34",y1:"82",x2:"60",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"86",y1:"82",x2:"60",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"60",y1:"82",x2:"60",y2:"86",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("rect",{x:"38",y:"86",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.4"})]}),a.jsx("span",{className:"text-xs",children:"No graph schema available"})]}):a.jsxs("div",{ref:C,className:"h-full graph-panel",children:[a.jsx("style",{children:` +`)}`:s,children:[o&&a.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),a.jsx(ht,{type:"target",position:bt.Top,style:$i}),a.jsxs("div",{style:{color:"var(--warning)",fontSize:9,marginBottom:1},children:["tools",i?` (${i})`:""]}),a.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s}),m.length>0&&a.jsxs("div",{style:{marginTop:3,fontSize:9,color:"var(--text-muted)",textAlign:"left"},children:[m.map(b=>a.jsx("div",{className:"truncate",children:b},b)),f>0&&a.jsxs("div",{style:{fontStyle:"italic"},children:["+",f," more"]})]}),a.jsx(ht,{type:"source",position:bt.Bottom,style:$i})]})}const Ui={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Pc({data:e}){const t=e.label??"",n=e.status,r=e.hasBreakpoint,i=e.isPausedHere,s=e.isActiveNode,o=e.isExecutingNode,l=i?"var(--error)":o?"var(--success)":s?"var(--accent)":n==="completed"?"var(--success)":n==="running"?"var(--warning)":n==="failed"?"var(--error)":"var(--bg-tertiary)",u=i?"var(--error)":o?"var(--success)":"var(--accent)";return a.jsxs("div",{className:"relative cursor-pointer",style:{width:"100%",height:"100%",background:"var(--bg-secondary)",border:`1.5px ${i||s||o?"solid":"dashed"} ${l}`,borderRadius:8,boxShadow:i||s||o?`0 0 4px ${u}`:void 0,animation:i||s||o?`node-pulse-${i?"red":o?"green":"accent"} 1.5s ease-in-out infinite`:void 0},children:[r&&a.jsx("div",{className:"absolute",style:{top:4,left:4,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--bg-tertiary)",boxShadow:"0 0 4px var(--error)",zIndex:1}}),a.jsx(ht,{type:"target",position:bt.Top,style:Ui}),a.jsx("div",{style:{padding:"4px 10px",fontSize:10,color:"var(--text-muted)",fontWeight:600,textAlign:"center",borderBottom:`1px solid ${l}`,background:"var(--bg-tertiary)",borderRadius:"8px 8px 0 0"},children:t}),a.jsx(ht,{type:"source",position:bt.Bottom,style:Ui})]})}function Bc({data:e}){const t=e.status,n=e.nodeWidth,r=e.label??"",i=e.hasBreakpoint,s=e.isPausedHere,o=e.isActiveNode,l=e.isExecutingNode,u=s?"var(--error)":l?"var(--success)":o?"var(--accent)":t==="completed"?"var(--success)":t==="running"?"var(--warning)":t==="failed"?"var(--error)":"var(--node-border)",c=s?"var(--error)":l?"var(--success)":"var(--accent)";return a.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${u}`,boxShadow:s||o||l?`0 0 4px ${c}`:void 0,animation:s||o||l?`node-pulse-${s?"red":l?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r,children:[i&&a.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),a.jsx(ht,{type:"target",position:bt.Top}),a.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:r}),a.jsx(ht,{type:"source",position:bt.Bottom})]})}function Fc(e,t=8){if(e.length<2)return"";if(e.length===2)return`M ${e[0].x} ${e[0].y} L ${e[1].x} ${e[1].y}`;let n=`M ${e[0].x} ${e[0].y}`;for(let i=1;i0&&(n+=Math.min(r.length,3)*12+(r.length>3?12:0)+4),e!=null&&e.model_name&&(n+=14),n}let dr=null;async function Gc(){if(!dr){const{default:e}=await Ts(async()=>{const{default:t}=await import("./vendor-elk-CiLKfHel.js").then(n=>n.e);return{default:t}},__vite__mapDeps([0,1]));dr=new e}return dr}const Ki={"elk.algorithm":"layered","elk.direction":"DOWN","elk.edgeRouting":"ORTHOGONAL","elk.layered.crossingMinimization.strategy":"LAYER_SWEEP","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.spacing.nodeNode":"25","elk.layered.spacing.nodeNodeBetweenLayers":"50","elk.spacing.edgeNode":"30","elk.spacing.edgeEdge":"15","elk.layered.spacing.edgeNodeBetweenLayers":"25","elk.layered.spacing.edgeEdgeBetweenLayers":"15","elk.portAlignment.default":"CENTER","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES"},qc="[top=35,left=15,bottom=15,right=15]";function Vc(e){const t=[],n=[];for(const r of e.nodes){const i=r.data,s={id:r.id,width:Hi(i),height:Wi(i,r.type)};if(r.data.subgraph){const o=r.data.subgraph;delete s.width,delete s.height,s.layoutOptions={...Ki,"elk.padding":qc},s.children=o.nodes.map(l=>({id:`${r.id}/${l.id}`,width:Hi(l.data),height:Wi(l.data,l.type)})),s.edges=o.edges.map(l=>({id:`${r.id}/${l.id}`,sources:[`${r.id}/${l.source}`],targets:[`${r.id}/${l.target}`]}))}t.push(s)}for(const r of e.edges)n.push({id:r.id,sources:[r.source],targets:[r.target]});return{id:"root",layoutOptions:Ki,children:t,edges:n}}const jr={type:Rl.ArrowClosed,width:12,height:12,color:"var(--node-border)"};function Cs(e){return{stroke:"var(--node-border)",strokeWidth:1.5,...e?{strokeDasharray:"6 3"}:{}}}function Gi(e,t,n,r,i){var c;const s=(c=e.sections)==null?void 0:c[0],o=(i==null?void 0:i.x)??0,l=(i==null?void 0:i.y)??0;let u;if(s)u={sourcePoint:{x:s.startPoint.x+o,y:s.startPoint.y+l},targetPoint:{x:s.endPoint.x+o,y:s.endPoint.y+l},bendPoints:(s.bendPoints??[]).map(d=>({x:d.x+o,y:d.y+l}))};else{const d=t.get(e.sources[0]),p=t.get(e.targets[0]);d&&p&&(u={sourcePoint:{x:d.x+d.width/2,y:d.y+d.height},targetPoint:{x:p.x+p.width/2,y:p.y},bendPoints:[]})}return{id:e.id,source:e.sources[0],target:e.targets[0],type:"elk",data:u,style:Cs(r),markerEnd:jr,...n?{label:n,labelStyle:{fill:"var(--text-muted)",fontSize:10},labelBgStyle:{fill:"var(--bg-primary)",fillOpacity:.8}}:{}}}async function Yc(e){var u,c;const t=Vc(e),r=await(await Gc()).layout(t),i=new Map;for(const d of e.nodes)if(i.set(d.id,{type:d.type,data:d.data}),d.data.subgraph)for(const p of d.data.subgraph.nodes)i.set(`${d.id}/${p.id}`,{type:p.type,data:p.data});const s=[],o=[],l=new Map;for(const d of r.children??[]){const p=d.x??0,m=d.y??0;l.set(d.id,{x:p,y:m,width:d.width??0,height:d.height??0});for(const f of d.children??[])l.set(f.id,{x:p+(f.x??0),y:m+(f.y??0),width:f.width??0,height:f.height??0})}for(const d of r.children??[]){const p=i.get(d.id);if((((u=d.children)==null?void 0:u.length)??0)>0){s.push({id:d.id,type:"groupNode",data:{...(p==null?void 0:p.data)??{},nodeWidth:d.width,nodeHeight:d.height},position:{x:d.x??0,y:d.y??0},style:{width:d.width,height:d.height}});for(const h of d.children??[]){const v=i.get(h.id);s.push({id:h.id,type:(v==null?void 0:v.type)??"defaultNode",data:{...(v==null?void 0:v.data)??{},nodeWidth:h.width},position:{x:h.x??0,y:h.y??0},parentNode:d.id,extent:"parent"})}const f=d.x??0,b=d.y??0;for(const h of d.edges??[]){const v=e.nodes.find(x=>x.id===d.id),y=(c=v==null?void 0:v.data.subgraph)==null?void 0:c.edges.find(x=>`${d.id}/${x.id}`===h.id);o.push(Gi(h,l,y==null?void 0:y.label,y==null?void 0:y.conditional,{x:f,y:b}))}}else s.push({id:d.id,type:(p==null?void 0:p.type)??"defaultNode",data:{...(p==null?void 0:p.data)??{},nodeWidth:d.width},position:{x:d.x??0,y:d.y??0}})}for(const d of r.edges??[]){const p=e.edges.find(m=>m.id===d.id);o.push(Gi(d,l,p==null?void 0:p.label,p==null?void 0:p.conditional))}return{nodes:s,edges:o}}function Un({entrypoint:e,runId:t,breakpointNode:n,breakpointNextNodes:r,onBreakpointChange:i}){const[s,o,l]=Ol([]),[u,c,d]=Ll([]),[p,m]=_.useState(!0),[f,b]=_.useState(!1),[h,v]=_.useState(0),y=_.useRef(0),x=_.useRef(null),C=ve(w=>w.breakpoints[t]),O=ve(w=>w.toggleBreakpoint),j=ve(w=>w.clearBreakpoints),N=ve(w=>w.activeNodes[t]),B=ve(w=>{var k;return(k=w.runs[t])==null?void 0:k.status}),D=_.useCallback((w,k)=>{if(k.type==="startNode"||k.type==="endNode")return;const I=k.type==="groupNode"?k.id:k.id.includes("/")?k.id.split("/").pop():k.id;O(t,I);const W=ve.getState().breakpoints[t]??{};i==null||i(Object.keys(W))},[t,O,i]),R=C&&Object.keys(C).length>0,S=_.useCallback(()=>{if(R)j(t),i==null||i([]);else{const w=[];for(const I of s){if(I.type==="startNode"||I.type==="endNode"||I.parentNode)continue;const W=I.type==="groupNode"?I.id:I.id.includes("/")?I.id.split("/").pop():I.id;w.push(W)}for(const I of w)C!=null&&C[I]||O(t,I);const k=ve.getState().breakpoints[t]??{};i==null||i(Object.keys(k))}},[t,R,C,s,j,O,i]);_.useEffect(()=>{o(w=>w.map(k=>{var U;if(k.type==="startNode"||k.type==="endNode")return k;const I=k.type==="groupNode"?k.id:k.id.includes("/")?k.id.split("/").pop():k.id,W=!!(C&&C[I]);return W!==!!((U=k.data)!=null&&U.hasBreakpoint)?{...k,data:{...k.data,hasBreakpoint:W}}:k}))},[C,o]),_.useEffect(()=>{const w=n?new Set(n.split(",").map(k=>k.trim()).filter(Boolean)):null;o(k=>k.map(I=>{var g,F;if(I.type==="startNode"||I.type==="endNode")return I;const W=I.type==="groupNode"?I.id:I.id.includes("/")?I.id.split("/").pop():I.id,U=(g=I.data)==null?void 0:g.label,q=w!=null&&(w.has(W)||U!=null&&w.has(U));return q!==!!((F=I.data)!=null&&F.isPausedHere)?{...I,data:{...I.data,isPausedHere:q}}:I}))},[n,h,o]);const T=ve(w=>w.stateEvents[t]);_.useEffect(()=>{const w=!!n;let k=new Set;const I=new Set,W=new Set,U=new Set,q=new Map,g=new Map;if(T)for(const F of T)F.phase==="started"?g.set(F.node_name,F.qualified_node_name??null):F.phase==="completed"&&g.delete(F.node_name);o(F=>{var E;for(const ie of F)ie.type&&q.set(ie.id,ie.type);const $=ie=>{var H;const K=[];for(const re of F){const de=re.type==="groupNode"?re.id:re.id.includes("/")?re.id.split("/").pop():re.id,xe=(H=re.data)==null?void 0:H.label;(de===ie||xe!=null&&xe===ie)&&K.push(re.id)}return K};if(w&&n){const ie=n.split(",").map(K=>K.trim()).filter(Boolean);for(const K of ie)$(K).forEach(H=>k.add(H));if(r!=null&&r.length)for(const K of r)$(K).forEach(H=>W.add(H));N!=null&&N.prev&&$(N.prev).forEach(K=>I.add(K))}else if(g.size>0){const ie=new Map;for(const K of F){const H=(E=K.data)==null?void 0:E.label;if(!H)continue;const re=K.id.includes("/")?K.id.split("/").pop():K.id;for(const de of[re,H]){let xe=ie.get(de);xe||(xe=new Set,ie.set(de,xe)),xe.add(K.id)}}for(const[K,H]of g){let re=!1;if(H){const de=H.replace(/:/g,"/");for(const xe of F)xe.id===de&&(k.add(xe.id),re=!0)}if(!re){const de=ie.get(K);de&&de.forEach(xe=>k.add(xe))}}}return F}),c(F=>{const $=I.size===0||F.some(E=>k.has(E.target)&&I.has(E.source));return F.map(E=>{var K,H;let ie;return w?ie=k.has(E.target)&&(I.size===0||!$||I.has(E.source))||k.has(E.source)&&W.has(E.target):(ie=k.has(E.source),!ie&&q.get(E.target)==="endNode"&&k.has(E.target)&&(ie=!0)),ie?(w||U.add(E.target),{...E,style:{stroke:"var(--accent)",strokeWidth:2.5},markerEnd:{...jr,color:"var(--accent)"},data:{...E.data,highlighted:!0},animated:!0}):(K=E.data)!=null&&K.highlighted?{...E,style:Cs((H=E.data)==null?void 0:H.conditional),markerEnd:jr,data:{...E.data,highlighted:!1},animated:!1}:E})}),o(F=>F.map($=>{var K,H,re,de;const E=!w&&k.has($.id);if($.type==="startNode"||$.type==="endNode"){const xe=U.has($.id)||!w&&k.has($.id);return xe!==!!((K=$.data)!=null&&K.isActiveNode)||E!==!!((H=$.data)!=null&&H.isExecutingNode)?{...$,data:{...$.data,isActiveNode:xe,isExecutingNode:E}}:$}const ie=w?W.has($.id):U.has($.id);return ie!==!!((re=$.data)!=null&&re.isActiveNode)||E!==!!((de=$.data)!=null&&de.isExecutingNode)?{...$,data:{...$.data,isActiveNode:ie,isExecutingNode:E}}:$}))},[T,N,n,r,B,h,o,c]);const L=ve(w=>w.graphCache[t]);_.useEffect(()=>{if(!L&&t!=="__setup__")return;const w=L?Promise.resolve(L):Zl(e),k=++y.current;m(!0),b(!1),w.then(async I=>{if(y.current!==k)return;if(!I.nodes.length){b(!0);return}const{nodes:W,edges:U}=await Yc(I);if(y.current!==k)return;const q=ve.getState().breakpoints[t],g=q?W.map(F=>{if(F.type==="startNode"||F.type==="endNode")return F;const $=F.type==="groupNode"?F.id:F.id.includes("/")?F.id.split("/").pop():F.id;return q[$]?{...F,data:{...F.data,hasBreakpoint:!0}}:F}):W;o(g),c(U),v(F=>F+1),setTimeout(()=>{var F;(F=x.current)==null||F.fitView({padding:.1,duration:200})},100)}).catch(()=>{y.current===k&&b(!0)}).finally(()=>{y.current===k&&m(!1)})},[e,t,L,o,c]),_.useEffect(()=>{const w=setTimeout(()=>{var k;(k=x.current)==null||k.fitView({padding:.1,duration:200})},100);return()=>clearTimeout(w)},[t]);const M=_.useRef(null);return _.useEffect(()=>{const w=M.current;if(!w)return;const k=new ResizeObserver(()=>{var I;(I=x.current)==null||I.fitView({padding:.1,duration:200})});return k.observe(w),()=>k.disconnect()},[p,f]),_.useEffect(()=>{o(w=>{var E,ie,K;const k=!!(T!=null&&T.length),I=B==="completed"||B==="failed",W=new Set,U=new Set(w.map(H=>H.id)),q=new Map;for(const H of w){const re=(E=H.data)==null?void 0:E.label;if(!re)continue;const de=H.id.includes("/")?H.id.split("/").pop():H.id;for(const xe of[de,re]){let Oe=q.get(xe);Oe||(Oe=new Set,q.set(xe,Oe)),Oe.add(H.id)}}if(k)for(const H of T){let re=!1;if(H.qualified_node_name){const de=H.qualified_node_name.replace(/:/g,"/");U.has(de)&&(W.add(de),re=!0)}if(!re){const de=q.get(H.node_name);de&&de.forEach(xe=>W.add(xe))}}const g=new Set;for(const H of w)H.parentNode&&W.has(H.id)&&g.add(H.parentNode);let F;B==="failed"&&W.size===0&&(F=(ie=w.find(H=>!H.parentNode&&H.type!=="startNode"&&H.type!=="endNode"&&H.type!=="groupNode"))==null?void 0:ie.id);let $;if(B==="completed"){const H=(K=w.find(re=>!re.parentNode&&re.type!=="startNode"&&re.type!=="endNode"&&re.type!=="groupNode"))==null?void 0:K.id;H&&!W.has(H)&&($=H)}return w.map(H=>{var de;let re;return H.id===F?re="failed":H.id===$||W.has(H.id)?re="completed":H.type==="startNode"?(!H.parentNode&&k||H.parentNode&&g.has(H.parentNode))&&(re="completed"):H.type==="endNode"?!H.parentNode&&I?re=B==="failed"?"failed":"completed":H.parentNode&&g.has(H.parentNode)&&(re="completed"):H.type==="groupNode"&&g.has(H.id)&&(re="completed"),re!==((de=H.data)==null?void 0:de.status)?{...H,data:{...H.data,status:re}}:H})})},[T,B,h,o]),p?a.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:"Loading graph..."}):f?a.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4",style:{color:"var(--text-muted)"},children:[a.jsxs("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("rect",{x:"38",y:"10",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.4"}),a.jsx("line",{x1:"60",y1:"34",x2:"60",y2:"46",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("rect",{x:"12",y:"46",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("rect",{x:"64",y:"46",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"60",y1:"46",x2:"34",y2:"46",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"60",y1:"46",x2:"86",y2:"46",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"34",y1:"70",x2:"34",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"86",y1:"70",x2:"86",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"34",y1:"82",x2:"60",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"86",y1:"82",x2:"60",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"60",y1:"82",x2:"60",y2:"86",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("rect",{x:"38",y:"86",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.4"})]}),a.jsx("span",{className:"text-xs",children:"No graph schema available"})]}):a.jsxs("div",{ref:M,className:"h-full graph-panel",children:[a.jsx("style",{children:` .graph-panel .react-flow__handle { opacity: 0 !important; width: 0 !important; @@ -37,8 +37,8 @@ ${r.join(` 0%, 100% { box-shadow: 0 0 4px var(--error); } 50% { box-shadow: 0 0 10px var(--error); } } - `}),a.jsxs(jl,{nodes:s,edges:u,onNodesChange:l,onEdgesChange:d,nodeTypes:$c,edgeTypes:Uc,onInit:v=>{w.current=v},onNodeClick:D,fitView:!0,proOptions:{hideAttribution:!0},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,children:[a.jsx(Dl,{color:"var(--bg-tertiary)",gap:16}),a.jsx(Pl,{showInteractive:!1}),a.jsx(Bl,{position:"top-right",children:a.jsxs("button",{onClick:S,title:R?"Remove all breakpoints":"Set breakpoints on all nodes",style:{background:"var(--bg-secondary)",color:R?"var(--error)":"var(--text-muted)",border:`1px solid ${R?"var(--error)":"var(--node-border)"}`,borderRadius:6,padding:"4px 10px",fontSize:12,cursor:"pointer",display:"flex",alignItems:"center",gap:4},children:[a.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:R?"var(--error)":"var(--node-border)"}}),R?"Clear all":"Break all"]})}),a.jsx(Fl,{nodeColor:v=>{var I;if(v.type==="groupNode")return"var(--bg-tertiary)";const E=(I=v.data)==null?void 0:I.status;return E==="completed"?"var(--success)":E==="running"?"var(--warning)":E==="failed"?"var(--error)":"var(--node-border)"},nodeStrokeWidth:0,style:{background:"var(--bg-secondary)",width:120,height:80}})]})]})}const Ut="__setup__";function Xc({entrypoint:e,mode:t,ws:n,onRunCreated:r,isMobile:i}){const[s,o]=N.useState("{}"),[l,u]=N.useState({}),[c,d]=N.useState(!1),[p,m]=N.useState(!0),[f,h]=N.useState(null),[b,x]=N.useState(""),[y,w]=N.useState(!0),[T,j]=N.useState(()=>{const I=localStorage.getItem("setupTextareaHeight");return I?parseInt(I,10):140}),O=N.useRef(null),[_,P]=N.useState(()=>{const I=localStorage.getItem("setupPanelWidth");return I?parseInt(I,10):380}),D=t==="run";N.useEffect(()=>{m(!0),h(null),Ql(e).then(I=>{u(I.mock_input),o(JSON.stringify(I.mock_input,null,2))}).catch(I=>{console.error("Failed to load mock input:",I);const H=I.detail||{};h(H.message||`Failed to load schema for "${e}"`),o("{}")}).finally(()=>m(!1))},[e]),N.useEffect(()=>{Ee.getState().clearBreakpoints(Ut)},[]);const R=async()=>{let I;try{I=JSON.parse(s)}catch{alert("Invalid JSON input");return}d(!0);try{const H=Ee.getState().breakpoints[Ut]??{},U=Object.keys(H),V=await Ri(e,I,t,U);Ee.getState().clearBreakpoints(Ut),Ee.getState().upsertRun(V),r(V.id)}catch(H){console.error("Failed to create run:",H)}finally{d(!1)}},S=async()=>{const I=b.trim();if(I){d(!0);try{const H=Ee.getState().breakpoints[Ut]??{},U=Object.keys(H),V=await Ri(e,l,"chat",U);Ee.getState().clearBreakpoints(Ut),Ee.getState().upsertRun(V),Ee.getState().addLocalChatMessage(V.id,{message_id:`local-${Date.now()}`,role:"user",content:I}),n.sendChatMessage(V.id,I),r(V.id)}catch(H){console.error("Failed to create chat run:",H)}finally{d(!1)}}};N.useEffect(()=>{try{JSON.parse(s),w(!0)}catch{w(!1)}},[s]);const M=N.useCallback(I=>{I.preventDefault();const H="touches"in I?I.touches[0].clientY:I.clientY,U=T,V=F=>{const $="touches"in F?F.touches[0].clientY:F.clientY,k=Math.max(60,U+(H-$));j(k)},g=()=>{document.removeEventListener("mousemove",V),document.removeEventListener("mouseup",g),document.removeEventListener("touchmove",V),document.removeEventListener("touchend",g),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("setupTextareaHeight",String(T))};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",V),document.addEventListener("mouseup",g),document.addEventListener("touchmove",V,{passive:!1}),document.addEventListener("touchend",g)},[T]),L=N.useCallback(I=>{I.preventDefault();const H="touches"in I?I.touches[0].clientX:I.clientX,U=_,V=F=>{const $=O.current;if(!$)return;const k="touches"in F?F.touches[0].clientX:F.clientX,ie=$.clientWidth-300,K=Math.max(280,Math.min(ie,U+(H-k)));P(K)},g=()=>{document.removeEventListener("mousemove",V),document.removeEventListener("mouseup",g),document.removeEventListener("touchmove",V),document.removeEventListener("touchend",g),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("setupPanelWidth",String(_))};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",V),document.addEventListener("mouseup",g),document.addEventListener("touchmove",V,{passive:!1}),document.addEventListener("touchend",g)},[_]),C=D?"Autonomous":"Conversational",v=D?"var(--success)":"var(--accent)",E=a.jsxs("div",{className:"shrink-0 flex flex-col",style:i?{background:"var(--bg-primary)"}:{width:_,background:"var(--bg-primary)"},children:[a.jsxs("div",{className:"px-4 text-xs font-semibold border-b flex items-center gap-2 h-10",style:{color:"var(--text-muted)",borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[a.jsx("span",{style:{color:v},children:"●"}),C]}),a.jsxs("div",{className:"flex-1 overflow-y-auto flex flex-col items-center justify-center gap-4 px-6",children:[a.jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--text-muted)",opacity:.5},children:D?a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("polyline",{points:"12 6 12 12 16 14"})]}):a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),a.jsxs("div",{className:"text-center space-y-1.5",children:[a.jsx("p",{className:"text-sm font-medium",style:{color:"var(--text-secondary)"},children:D?"Ready to execute":"Ready to chat"}),a.jsxs("p",{className:"text-xs leading-relaxed",style:{color:"var(--text-muted)"},children:["Click nodes to set breakpoints",D?a.jsxs(a.Fragment,{children:[",",a.jsx("br",{}),"configure input below, then run"]}):a.jsxs(a.Fragment,{children:[",",a.jsx("br",{}),"then send your first message"]})]})]})]}),D?a.jsxs("div",{className:"flex flex-col",style:{background:"var(--bg-primary)"},children:[!i&&a.jsx("div",{onMouseDown:M,onTouchStart:M,className:"shrink-0 drag-handle-row"}),a.jsxs("div",{className:"px-4 py-3",children:[f?a.jsx("div",{className:"text-xs mb-3 px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:f}):a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:["Input",p&&a.jsx("span",{className:"ml-2 font-normal",children:"Loading..."})]}),a.jsx("textarea",{value:s,onChange:I=>o(I.target.value),spellCheck:!1,className:"w-full rounded-md px-3 py-2 text-xs font-mono leading-relaxed resize-none mb-3",style:{height:i?120:T,background:"var(--bg-secondary)",border:`1px solid ${y?"var(--border)":"#b91c1c"}`,color:"var(--text-primary)"}})]}),a.jsx("button",{onClick:R,disabled:c||p||!!f,className:"w-full py-2 text-sm font-semibold rounded-md border cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed transition-colors flex items-center justify-center gap-2",style:{background:"transparent",borderColor:v,color:v},onMouseEnter:I=>{c||(I.currentTarget.style.background=`color-mix(in srgb, ${v} 10%, transparent)`)},onMouseLeave:I=>{I.currentTarget.style.background="transparent"},children:c?"Starting...":a.jsxs(a.Fragment,{children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:a.jsx("polygon",{points:"5,3 19,12 5,21"})}),"Execute"]})})]})]}):a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:[a.jsx("input",{value:b,onChange:I=>x(I.target.value),onKeyDown:I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),S())},disabled:c||p,placeholder:c?"Starting...":"Message...",className:"flex-1 bg-transparent text-sm py-1 disabled:opacity-40 placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),a.jsx("button",{onClick:S,disabled:c||p||!b.trim(),className:"text-xs font-semibold px-3 py-1.5 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:!c&&b.trim()?"var(--accent)":"var(--text-muted)",background:"transparent"},onMouseEnter:I=>{!c&&b.trim()&&(I.currentTarget.style.background="color-mix(in srgb, var(--accent) 10%, transparent)")},onMouseLeave:I=>{I.currentTarget.style.background="transparent"},children:"Send"})]})]});return i?a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsx("div",{className:"shrink-0",style:{height:"40vh"},children:a.jsx(Un,{entrypoint:e,traces:[],runId:Ut})}),a.jsx("div",{className:"flex-1 overflow-y-auto flex flex-col min-h-0",children:E})]}):a.jsxs("div",{ref:O,className:"flex h-full",children:[a.jsx("div",{className:"flex-1 min-w-0",children:a.jsx(Un,{entrypoint:e,traces:[],runId:Ut})}),a.jsx("div",{onMouseDown:L,onTouchStart:L,className:"shrink-0 drag-handle-col"}),E]})}const Zc={key:"var(--info)",string:"var(--success)",number:"var(--warning)",boolean:"var(--accent)",null:"var(--accent)",punctuation:"var(--text-muted)"};function Jc(e){const t=[],n=/("(?:[^"\\]|\\.)*")\s*:|("(?:[^"\\]|\\.)*")|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b|(true|false)\b|(null)\b|([{}[\]:,])/g;let r=0,i;for(;(i=n.exec(e))!==null;){if(i.index>r&&t.push({type:"punctuation",text:e.slice(r,i.index)}),i[1]!==void 0){t.push({type:"key",text:i[1]});const s=e.indexOf(":",i.index+i[1].length);s!==-1&&(s>i.index+i[1].length&&t.push({type:"punctuation",text:e.slice(i.index+i[1].length,s)}),t.push({type:"punctuation",text:":"}),n.lastIndex=s+1)}else i[2]!==void 0?t.push({type:"string",text:i[2]}):i[3]!==void 0?t.push({type:"number",text:i[3]}):i[4]!==void 0?t.push({type:"boolean",text:i[4]}):i[5]!==void 0?t.push({type:"null",text:i[5]}):i[6]!==void 0&&t.push({type:"punctuation",text:i[6]});r=n.lastIndex}return rJc(e),[e]);return a.jsx("pre",{className:t,style:n,children:r.map((i,s)=>a.jsx("span",{style:{color:Zc[i.type]},children:i.text},s))})}const Qc={started:{color:"var(--info)",label:"Started"},running:{color:"var(--warning)",label:"Running"},completed:{color:"var(--success)",label:"Completed"},failed:{color:"var(--error)",label:"Failed"},error:{color:"var(--error)",label:"Error"}},eu={color:"var(--text-muted)",label:"Unknown"};function tu(e){if(typeof e!="string")return null;const t=e.trim();if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))try{return JSON.stringify(JSON.parse(t),null,2)}catch{return null}return null}const Gi=200;function nu(e){if(typeof e=="string")return e;if(e==null)return String(e);try{return JSON.stringify(e,null,2)}catch{return String(e)}}function ru({value:e}){const[t,n]=N.useState(!1),r=nu(e),i=N.useMemo(()=>tu(e),[e]),s=i!==null,o=i??r,l=o.length>Gi||o.includes(` -`),u=N.useCallback(()=>n(c=>!c),[]);return l?a.jsxs("div",{children:[t?s?a.jsx(ot,{json:o,className:"font-mono text-[11px] whitespace-pre-wrap break-all",style:{}}):a.jsx("pre",{className:"font-mono text-[11px] whitespace-pre-wrap break-all",style:{color:"var(--text-primary)"},children:o}):a.jsxs("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:[o.slice(0,Gi),"..."]}),a.jsx("button",{onClick:u,className:"text-[11px] cursor-pointer ml-1 px-1",style:{color:"var(--info)"},children:t?"[less]":"[more]"})]}):s?a.jsx(ot,{json:o,className:"font-mono text-[11px] break-all whitespace-pre-wrap",style:{}}):a.jsx("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:o})}function iu({span:e}){const[t,n]=N.useState(!0),[r,i]=N.useState(!1),[s,o]=N.useState("table"),[l,u]=N.useState(!1),c=Qc[e.status.toLowerCase()]??{...eu,label:e.status},d=N.useMemo(()=>JSON.stringify(e,null,2),[e]),p=N.useCallback(()=>{navigator.clipboard.writeText(d).then(()=>{u(!0),setTimeout(()=>u(!1),1500)})},[d]),m=Object.entries(e.attributes),f=[{label:"Span",value:e.span_id},...e.trace_id?[{label:"Trace",value:e.trace_id}]:[],{label:"Run",value:e.run_id},...e.parent_span_id?[{label:"Parent",value:e.parent_span_id}]:[]];return a.jsxs("div",{className:"flex flex-col h-full text-xs leading-normal",children:[a.jsxs("div",{className:"px-2 border-b flex items-center gap-1 shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",height:"32px"},children:[a.jsx("button",{onClick:()=>o("table"),className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:s==="table"?"var(--accent)":"var(--text-muted)",background:s==="table"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:h=>{s!=="table"&&(h.currentTarget.style.color="var(--text-primary)")},onMouseLeave:h=>{s!=="table"&&(h.currentTarget.style.color="var(--text-muted)")},children:"Table"}),a.jsx("button",{onClick:()=>o("json"),className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:s==="json"?"var(--accent)":"var(--text-muted)",background:s==="json"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:h=>{s!=="json"&&(h.currentTarget.style.color="var(--text-primary)")},onMouseLeave:h=>{s!=="json"&&(h.currentTarget.style.color="var(--text-muted)")},children:"JSON"}),a.jsxs("span",{className:"ml-auto shrink-0 inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] font-bold uppercase tracking-wider",style:{background:`color-mix(in srgb, ${c.color} 15%, var(--bg-secondary))`,color:c.color},children:[a.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full",style:{background:c.color}}),c.label]})]}),a.jsx("div",{className:"overflow-y-auto flex-1 p-0.5 pr-0 pt-0 mr-0.5 mt-0.5",children:s==="table"?a.jsxs(a.Fragment,{children:[m.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"px-2 py-1 text-[11px] uppercase font-bold tracking-wider border-b cursor-pointer flex items-center",style:{color:"var(--success)",borderColor:"var(--border)",background:"var(--bg-secondary)"},onClick:()=>n(h=>!h),children:[a.jsxs("span",{className:"flex-1",children:["Attributes (",m.length,")"]}),a.jsx("span",{style:{color:"var(--text-muted)",transform:t?"rotate(0deg)":"rotate(-90deg)"},children:"▾"})]}),t&&m.map(([h,b],x)=>a.jsxs("div",{className:"flex gap-2 px-2 py-1 items-start border-b",style:{borderColor:"var(--border)",background:x%2===0?"var(--bg-primary)":"var(--bg-secondary)"},children:[a.jsx("span",{className:"font-mono font-semibold shrink-0 pt-px truncate text-[11px]",style:{color:"var(--info)",width:"35%"},title:h,children:h}),a.jsx("span",{className:"flex-1 min-w-0",children:a.jsx(ru,{value:b})})]},h))]}),a.jsxs("div",{className:"px-2 py-1 text-[11px] uppercase font-bold tracking-wider border-b cursor-pointer flex items-center",style:{color:"var(--success)",borderColor:"var(--border)",background:"var(--bg-secondary)"},onClick:()=>i(h=>!h),children:[a.jsxs("span",{className:"flex-1",children:["Identifiers (",f.length,")"]}),a.jsx("span",{style:{color:"var(--text-muted)",transform:r?"rotate(0deg)":"rotate(-90deg)"},children:"▾"})]}),r&&f.map((h,b)=>a.jsxs("div",{className:"flex gap-2 px-2 py-1 items-start border-b",style:{borderColor:"var(--border)",background:b%2===0?"var(--bg-primary)":"var(--bg-secondary)"},children:[a.jsx("span",{className:"font-mono font-semibold shrink-0 pt-px truncate text-[11px]",style:{color:"var(--info)",width:"35%"},title:h.label,children:h.label}),a.jsx("span",{className:"flex-1 min-w-0",children:a.jsx("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:h.value})})]},h.label))]}):a.jsxs("div",{className:"relative",children:[a.jsx("button",{onClick:p,className:"absolute top-1 right-1 z-10 text-[11px] cursor-pointer px-2 py-1 rounded transition-colors",style:{color:l?"var(--success)":"var(--text-muted)",background:"var(--bg-secondary)",border:"1px solid var(--border)"},onMouseEnter:h=>{l||(h.currentTarget.style.color="var(--text-primary)")},onMouseLeave:h=>{h.currentTarget.style.color=l?"var(--success)":"var(--text-muted)"},children:l?"Copied!":"Copy"}),a.jsx(ot,{json:d,className:"font-mono text-[11px] whitespace-pre-wrap p-2",style:{}})]})})]})}function ou(e){const t=[];function n(r,i){t.push({span:r.span,depth:i});for(const s of r.children)n(s,i+1)}for(const r of e)n(r,0);return t}function su({tree:e,selectedSpan:t,onSelect:n}){const r=N.useMemo(()=>ou(e),[e]),{globalStart:i,totalDuration:s}=N.useMemo(()=>{if(r.length===0)return{globalStart:0,totalDuration:1};let o=1/0,l=-1/0;for(const{span:u}of r){const c=new Date(u.timestamp).getTime();o=Math.min(o,c),l=Math.max(l,c+(u.duration_ms??0))}return{globalStart:o,totalDuration:Math.max(l-o,1)}},[r]);return r.length===0?null:a.jsx(a.Fragment,{children:r.map(({span:o,depth:l})=>{var b;const u=new Date(o.timestamp).getTime()-i,c=o.duration_ms??0,d=u/s*100,p=Math.max(c/s*100,.3),m=As[o.status.toLowerCase()]??"var(--text-muted)",f=o.span_id===(t==null?void 0:t.span_id),h=(b=o.attributes)==null?void 0:b["openinference.span.kind"];return a.jsxs("button",{"data-span-id":o.span_id,onClick:()=>n(o),className:"w-full text-left text-xs leading-normal py-1 flex items-center transition-colors",style:{background:f?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:f?"2px solid var(--accent)":"2px solid transparent"},onMouseEnter:x=>{f||(x.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:x=>{f||(x.currentTarget.style.background="")},children:[a.jsxs("div",{className:"shrink-0 flex items-center gap-1 overflow-hidden",style:{width:"35%",minWidth:"80px",paddingLeft:`${l*12+4}px`},children:[a.jsx("span",{className:"shrink-0 flex items-center justify-center w-3.5 h-3.5",children:a.jsx(Ms,{kind:h,statusColor:m})}),a.jsx("span",{className:"text-[var(--text-primary)] truncate",children:o.span_name})]}),a.jsx("div",{className:"flex-1 relative h-[14px] mx-1 rounded-sm",style:{background:"var(--bg-secondary)"},children:a.jsx("div",{className:"absolute rounded-sm",style:{left:`${d}%`,width:`${p}%`,top:"2px",bottom:"2px",background:m,opacity:.8,minWidth:"2px"}})}),a.jsx("span",{className:"shrink-0 text-[10px] tabular-nums pr-2",style:{width:"52px",textAlign:"right",color:"var(--text-muted)"},children:Is(o.duration_ms)})]},o.span_id)})})}const As={started:"var(--info)",running:"var(--warning)",completed:"var(--success)",failed:"var(--error)",error:"var(--error)"};function Ms({kind:e,statusColor:t}){const n=t,r=14,i={width:r,height:r,viewBox:"0 0 16 16",fill:"none",stroke:n,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"LLM":return a.jsx("svg",{...i,children:a.jsx("path",{d:"M8 2L9 5L12 4L10 7L14 8L10 9L12 12L9 11L8 14L7 11L4 12L6 9L2 8L6 7L4 4L7 5Z",fill:n,stroke:"none"})});case"TOOL":return a.jsx("svg",{...i,children:a.jsx("path",{d:"M10.5 2.5a3.5 3.5 0 0 0-3.17 4.93L3.5 11.27a1 1 0 0 0 0 1.41l.82.82a1 1 0 0 0 1.41 0l3.84-3.83A3.5 3.5 0 1 0 10.5 2.5z"})});case"AGENT":return a.jsxs("svg",{...i,children:[a.jsx("rect",{x:"3",y:"5",width:"10",height:"8",rx:"2"}),a.jsx("circle",{cx:"6",cy:"9",r:"1",fill:n,stroke:"none"}),a.jsx("circle",{cx:"10",cy:"9",r:"1",fill:n,stroke:"none"}),a.jsx("path",{d:"M8 2v3"}),a.jsx("path",{d:"M6 2h4"})]});case"CHAIN":return a.jsxs("svg",{...i,children:[a.jsx("path",{d:"M6.5 9.5L9.5 6.5"}),a.jsx("path",{d:"M4.5 8.5l-1 1a2 2 0 0 0 2.83 2.83l1-1"}),a.jsx("path",{d:"M11.5 7.5l1-1a2 2 0 0 0-2.83-2.83l-1 1"})]});case"RETRIEVER":return a.jsxs("svg",{...i,children:[a.jsx("circle",{cx:"7",cy:"7",r:"4"}),a.jsx("path",{d:"M10 10l3.5 3.5"})]});case"EMBEDDING":return a.jsxs("svg",{...i,children:[a.jsx("rect",{x:"2",y:"2",width:"4",height:"4",rx:"0.5"}),a.jsx("rect",{x:"10",y:"2",width:"4",height:"4",rx:"0.5"}),a.jsx("rect",{x:"2",y:"10",width:"4",height:"4",rx:"0.5"}),a.jsx("rect",{x:"10",y:"10",width:"4",height:"4",rx:"0.5"})]});default:return a.jsx("span",{className:"shrink-0 w-2 h-2 rounded-full",style:{background:t}})}}function au(e){const t=new Map(e.map(o=>[o.span_id,o])),n=new Map;for(const o of e)if(o.parent_span_id){const l=n.get(o.parent_span_id)??[];l.push(o),n.set(o.parent_span_id,l)}const r=e.filter(o=>o.parent_span_id===null||!t.has(o.parent_span_id));function i(o){const l=(n.get(o.span_id)??[]).sort((u,c)=>u.timestamp.localeCompare(c.timestamp));return{span:o,children:l.map(i)}}return r.sort((o,l)=>o.timestamp.localeCompare(l.timestamp)).map(i).flatMap(o=>o.span.span_name==="root"?o.children:[o])}function Is(e){return e==null?"":e<1e3?`${e.toFixed(0)}ms`:`${(e/1e3).toFixed(2)}s`}function Rs(e){return e.map(t=>{const{span:n}=t;return t.children.length>0?{name:n.span_name,children:Rs(t.children)}:{name:n.span_name}})}function Dr({traces:e}){const[t,n]=N.useState(null),[r,i]=N.useState(new Set),[s,o]=N.useState(()=>{const D=localStorage.getItem("traceTreeSplitWidth");return D?parseFloat(D):50}),[l,u]=N.useState(!1),[c,d]=N.useState(!1),[p,m]=N.useState(()=>localStorage.getItem("traceViewMode")||"tree"),f=au(e),h=N.useMemo(()=>JSON.stringify(Rs(f),null,2),[e]),b=N.useCallback(()=>{navigator.clipboard.writeText(h).then(()=>{d(!0),setTimeout(()=>d(!1),1500)})},[h]),x=Ee(D=>D.focusedSpan),y=Ee(D=>D.setFocusedSpan),[w,T]=N.useState(null),j=N.useRef(null),O=N.useCallback(D=>{i(R=>{const S=new Set(R);return S.has(D)?S.delete(D):S.add(D),S})},[]),_=N.useRef(null);N.useEffect(()=>{const D=f.length>0?f[0].span.span_id:null,R=_.current;if(_.current=D,D&&D!==R)n(f[0].span);else if(t===null)f.length>0&&n(f[0].span);else{const S=e.find(M=>M.span_id===t.span_id);S&&S!==t&&n(S)}},[e]),N.useEffect(()=>{if(!x)return;const R=e.filter(S=>S.span_name===x.name).sort((S,M)=>S.timestamp.localeCompare(M.timestamp))[x.index];if(R){n(R),T(R.span_id);const S=new Map(e.map(M=>[M.span_id,M.parent_span_id]));i(M=>{const L=new Set(M);let C=R.parent_span_id;for(;C;)L.delete(C),C=S.get(C)??null;return L})}y(null)},[x,e,y]),N.useEffect(()=>{if(!w)return;const D=w;T(null),requestAnimationFrame(()=>{const R=j.current,S=R==null?void 0:R.querySelector(`[data-span-id="${D}"]`);R&&S&&S.scrollIntoView({block:"center",behavior:"smooth"})})},[w]),N.useEffect(()=>{if(!l)return;const D=S=>{const M=document.querySelector(".trace-tree-container");if(!M)return;const L=M.getBoundingClientRect(),C=(S.clientX-L.left)/L.width*100,v=Math.max(20,Math.min(80,C));o(v),localStorage.setItem("traceTreeSplitWidth",String(v))},R=()=>{u(!1)};return window.addEventListener("mousemove",D),window.addEventListener("mouseup",R),()=>{window.removeEventListener("mousemove",D),window.removeEventListener("mouseup",R)}},[l]);const P=D=>{D.preventDefault(),u(!0)};return a.jsxs("div",{className:"flex h-full trace-tree-container",style:{cursor:l?"col-resize":void 0},children:[a.jsxs("div",{className:"flex flex-col",style:{width:`${s}%`},children:[e.length>0&&a.jsxs("div",{className:"flex items-center gap-1 px-2 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",height:"32px"},children:[a.jsx("button",{onClick:()=>{m("tree"),localStorage.setItem("traceViewMode","tree")},className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:p==="tree"?"var(--accent)":"var(--text-muted)",background:p==="tree"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:D=>{p!=="tree"&&(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{p!=="tree"&&(D.currentTarget.style.color="var(--text-muted)")},children:"Tree"}),a.jsx("button",{onClick:()=>{m("timeline"),localStorage.setItem("traceViewMode","timeline")},className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:p==="timeline"?"var(--accent)":"var(--text-muted)",background:p==="timeline"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:D=>{p!=="timeline"&&(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{p!=="timeline"&&(D.currentTarget.style.color="var(--text-muted)")},children:"Timeline"}),a.jsx("button",{onClick:()=>{m("json"),localStorage.setItem("traceViewMode","json")},className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:p==="json"?"var(--accent)":"var(--text-muted)",background:p==="json"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:D=>{p!=="json"&&(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{p!=="json"&&(D.currentTarget.style.color="var(--text-muted)")},children:"JSON"})]}),a.jsx("div",{ref:j,className:"overflow-y-auto flex-1 p-0.5 pr-0 pt-0 mr-0.5 mt-0.5",children:f.length===0?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"No traces yet"})}):p==="tree"?f.map((D,R)=>a.jsx(Os,{node:D,depth:0,selectedId:(t==null?void 0:t.span_id)??null,onSelect:n,isLast:R===f.length-1,collapsedIds:r,toggleExpanded:O},D.span.span_id)):p==="timeline"?a.jsx(su,{tree:f,selectedSpan:t,onSelect:n}):a.jsxs("div",{className:"relative",children:[a.jsx("button",{onClick:b,className:"absolute top-1 right-1 z-10 text-[11px] cursor-pointer px-2 py-1 rounded transition-colors",style:{color:c?"var(--success)":"var(--text-muted)",background:"var(--bg-secondary)",border:"1px solid var(--border)"},onMouseEnter:D=>{c||(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{D.currentTarget.style.color=c?"var(--success)":"var(--text-muted)"},children:c?"Copied!":"Copy"}),a.jsx(ot,{json:h,className:"font-mono text-[11px] whitespace-pre-wrap p-2",style:{}})]})})]}),a.jsx("div",{onMouseDown:P,className:"shrink-0 drag-handle-col",style:l?{background:"var(--accent)"}:void 0}),a.jsx("div",{className:"flex-1 overflow-hidden",children:t?a.jsx(iu,{span:t}):a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"Select a span to view details"})})})]})}function Os({node:e,depth:t,selectedId:n,onSelect:r,isLast:i,collapsedIds:s,toggleExpanded:o}){var b;const{span:l}=e,u=!s.has(l.span_id),c=As[l.status.toLowerCase()]??"var(--text-muted)",d=Is(l.duration_ms),p=l.span_id===n,m=e.children.length>0,f=t*20,h=(b=l.attributes)==null?void 0:b["openinference.span.kind"];return a.jsxs("div",{className:"relative",children:[t>0&&a.jsx("div",{className:"absolute top-0 z-10 pointer-events-none",style:{left:`${f-10}px`,width:"1px",height:i?"16px":"100%",background:"var(--border)"}}),a.jsxs("button",{"data-span-id":l.span_id,onClick:()=>r(l),className:"w-full text-left text-xs leading-normal py-1.5 pr-2 flex items-center gap-1.5 transition-colors relative",style:{paddingLeft:`${f+4}px`,background:p?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":void 0,borderLeft:p?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:x=>{p||(x.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:x=>{p||(x.currentTarget.style.background="")},children:[t>0&&a.jsx("div",{className:"absolute z-10 pointer-events-none",style:{left:`${f-10}px`,top:"50%",width:"10px",height:"1px",background:"var(--border)"}}),m?a.jsx("span",{onClick:x=>{x.stopPropagation(),o(l.span_id)},className:"shrink-0 w-5 h-5 flex items-center justify-center cursor-pointer rounded hover:bg-[var(--bg-hover)]",style:{color:"var(--text-muted)"},children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",style:{transform:u?"rotate(90deg)":"rotate(0deg)"},children:a.jsx("path",{d:"M3 1.5L7 5L3 8.5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})})}):a.jsx("span",{className:"shrink-0 w-4"}),a.jsx("span",{className:"shrink-0 flex items-center justify-center w-4 h-4",children:a.jsx(Ms,{kind:h,statusColor:c})}),a.jsx("span",{className:"text-[var(--text-primary)] truncate min-w-0 flex-1",children:l.span_name}),d&&a.jsx("span",{className:"text-[var(--text-muted)] shrink-0 ml-auto pl-2 tabular-nums",children:d})]}),u&&e.children.map((x,y)=>a.jsx(Os,{node:x,depth:t+1,selectedId:n,onSelect:r,isLast:y===e.children.length-1,collapsedIds:s,toggleExpanded:o},x.span.span_id))]})}const lu={DEBUG:{color:"var(--text-muted)",bg:"color-mix(in srgb, var(--text-muted) 15%, var(--bg-secondary))",border:"var(--text-muted)"},INFO:{color:"var(--info)",bg:"color-mix(in srgb, var(--info) 15%, var(--bg-secondary))",border:"var(--info)"},WARN:{color:"var(--warning)",bg:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",border:"var(--warning)"},WARNING:{color:"var(--warning)",bg:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",border:"var(--warning)"},ERROR:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",border:"var(--error)"},CRITICAL:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",border:"var(--error)"}},cu={color:"var(--text-muted)",bg:"transparent"};function qi({logs:e}){const t=N.useRef(null),n=N.useRef(null),[r,i]=N.useState(!1);N.useEffect(()=>{var o;(o=n.current)==null||o.scrollIntoView({behavior:"smooth"})},[e.length]);const s=()=>{const o=t.current;o&&i(o.scrollTop>100)};return e.length===0?a.jsx("div",{className:"h-full flex items-center justify-center",children:a.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"No logs yet"})}):a.jsxs("div",{className:"h-full relative",children:[a.jsxs("div",{ref:t,onScroll:s,className:"h-full overflow-y-auto font-mono text-xs leading-normal",children:[e.map((o,l)=>{const u=new Date(o.timestamp).toLocaleTimeString(void 0,{hour12:!1}),c=o.level.toUpperCase(),d=c.slice(0,4),p=lu[c]??cu,m=l%2===0;return a.jsxs("div",{className:"flex gap-3 px-3 py-1.5",style:{background:m?"var(--bg-primary)":"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[var(--text-muted)] shrink-0",children:u}),a.jsx("span",{className:"shrink-0 self-start px-1.5 py-0.5 rounded text-[10px] font-semibold leading-none inline-flex items-center",style:{color:p.color,background:p.bg},children:d}),a.jsx("span",{className:"text-[var(--text-primary)] whitespace-pre-wrap break-all",children:o.message})]},l)}),a.jsx("div",{ref:n})]}),r&&a.jsx("button",{onClick:()=>{var o;return(o=t.current)==null?void 0:o.scrollTo({top:0,behavior:"smooth"})},className:"absolute top-2 right-3 w-6 h-6 flex items-center justify-center rounded-full cursor-pointer transition-opacity opacity-70 hover:opacity-100",style:{background:"var(--bg-tertiary)",color:"var(--text-primary)"},title:"Scroll to top",children:a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"18 15 12 9 6 15"})})})]})}const uu={started:{color:"var(--accent)",label:"started"},updated:{color:"var(--info)",label:"updated"},completed:{color:"var(--success)",label:"completed"},faulted:{color:"var(--error)",label:"faulted"}},Vi={color:"var(--text-muted)",label:""};function An({events:e,runStatus:t}){const n=N.useRef(null),r=N.useRef(!0),[i,s]=N.useState(null),o=()=>{const l=n.current;l&&(r.current=l.scrollHeight-l.scrollTop-l.clientHeight<40)};return N.useEffect(()=>{r.current&&n.current&&(n.current.scrollTop=n.current.scrollHeight)}),e.length===0?a.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:a.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:t==="running"?"Waiting for events...":"No events yet"})}):a.jsx("div",{ref:n,onScroll:o,className:"h-full overflow-y-auto font-mono text-xs leading-normal",children:e.map((l,u)=>{const c=new Date(l.timestamp).toLocaleTimeString(void 0,{hour12:!1}),d=l.payload&&Object.keys(l.payload).length>0,p=i===u,m=l.phase?uu[l.phase]??Vi:Vi;return a.jsxs("div",{children:[a.jsxs("div",{onClick:()=>{d&&s(p?null:u)},className:"flex items-center gap-2 px-3 py-1.5",style:{background:u%2===0?"var(--bg-primary)":"var(--bg-secondary)",cursor:d?"pointer":"default"},children:[a.jsx("span",{className:"shrink-0",style:{color:"var(--text-muted)"},children:c}),a.jsx("span",{className:"shrink-0",style:{color:m.color},children:"●"}),a.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:l.node_name}),m.label&&a.jsx("span",{className:"shrink-0 text-[10px]",style:{color:"var(--text-muted)"},children:m.label}),d&&a.jsx("span",{className:"shrink-0 text-[9px] transition-transform",style:{color:"var(--text-muted)",transform:p?"rotate(90deg)":"rotate(0deg)"},children:"▸"})]}),p&&d&&a.jsx("div",{className:"px-3 py-2 border-t border-b",style:{borderColor:"var(--border)",background:"color-mix(in srgb, var(--bg-secondary) 80%, var(--bg-primary))"},children:a.jsx(ot,{json:JSON.stringify(l.payload,null,2),className:"text-[11px] font-mono whitespace-pre-wrap break-words"})})]},u)})})}function _t({title:e,copyText:t,trailing:n,children:r}){const[i,s]=N.useState(!1),o=N.useCallback(()=>{t&&navigator.clipboard.writeText(t).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})},[t]);return a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:e}),n,t&&a.jsx("button",{onClick:o,className:`${n?"":"ml-auto "}text-[10px] cursor-pointer px-1.5 py-0.5 rounded transition-colors`,style:{color:i?"var(--success)":"var(--text-muted)",background:"var(--bg-tertiary)",border:"none"},onMouseEnter:l=>{i||(l.currentTarget.style.color="var(--text-primary)")},onMouseLeave:l=>{l.currentTarget.style.color=i?"var(--success)":"var(--text-muted)"},children:i?"Copied":"Copy"})]}),r]})}function Yi({runId:e,status:t,ws:n,breakpointNode:r}){const i=t==="suspended",s=o=>{const l=Ee.getState().breakpoints[e]??{};n.setBreakpoints(e,Object.keys(l)),o==="step"?n.debugStep(e):o==="continue"?n.debugContinue(e):n.debugStop(e)};return a.jsxs("div",{className:"flex items-center gap-1 px-4 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[11px] font-semibold mr-1",style:{color:"var(--text-muted)"},children:"Debug"}),a.jsx(pr,{label:"Step",onClick:()=>s("step"),disabled:!i,color:"var(--info)",active:i}),a.jsx(pr,{label:"Continue",onClick:()=>s("continue"),disabled:!i,color:"var(--success)",active:i}),a.jsx(pr,{label:"Stop",onClick:()=>s("stop"),disabled:!i,color:"var(--error)",active:i}),a.jsx("span",{className:"text-[11px] ml-auto truncate",style:{color:i?"var(--accent)":"var(--text-muted)"},children:i?r?`Paused at ${r}`:"Paused":t})]})}function pr({label:e,onClick:t,disabled:n,color:r,active:i}){return a.jsx("button",{onClick:t,disabled:n,className:"px-3 py-1 h-7 text-[11px] font-semibold rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:i?r:"var(--text-muted)",background:i?`color-mix(in srgb, ${r} 10%, transparent)`:"transparent"},onMouseEnter:s=>{n||(s.currentTarget.style.background=`color-mix(in srgb, ${r} 20%, transparent)`)},onMouseLeave:s=>{s.currentTarget.style.background=i?`color-mix(in srgb, ${r} 10%, transparent)`:"transparent"},children:e})}const Xi=N.lazy(()=>Ts(()=>import("./ChatPanel-DiTmerW3.js"),__vite__mapDeps([2,1,3,4]))),du=[],pu=[],fu=[],mu=[];function gu({run:e,ws:t,isMobile:n}){const r=e.mode==="chat",[i,s]=N.useState(280),[o,l]=N.useState(()=>{const C=localStorage.getItem("chatPanelWidth");return C?parseInt(C,10):380}),[u,c]=N.useState("primary"),[d,p]=N.useState(r?"primary":"traces"),m=N.useRef(null),f=N.useRef(null),h=N.useRef(!1),b=Ee(C=>C.traces[e.id]||du),x=Ee(C=>C.logs[e.id]||pu),y=Ee(C=>C.chatMessages[e.id]||fu),w=Ee(C=>C.stateEvents[e.id]||mu),T=Ee(C=>C.breakpoints[e.id]);N.useEffect(()=>{t.setBreakpoints(e.id,T?Object.keys(T):[])},[e.id]);const j=N.useCallback(C=>{t.setBreakpoints(e.id,C)},[e.id,t]),O=N.useCallback(C=>{C.preventDefault(),h.current=!0;const v="touches"in C?C.touches[0].clientY:C.clientY,E=i,I=U=>{if(!h.current)return;const V=m.current;if(!V)return;const g="touches"in U?U.touches[0].clientY:U.clientY,F=V.clientHeight-100,$=Math.max(80,Math.min(F,E+(g-v)));s($)},H=()=>{h.current=!1,document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",H),document.removeEventListener("touchmove",I),document.removeEventListener("touchend",H),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",I),document.addEventListener("mouseup",H),document.addEventListener("touchmove",I,{passive:!1}),document.addEventListener("touchend",H)},[i]),_=N.useCallback(C=>{C.preventDefault();const v="touches"in C?C.touches[0].clientX:C.clientX,E=o,I=U=>{const V=f.current;if(!V)return;const g="touches"in U?U.touches[0].clientX:U.clientX,F=V.clientWidth-300,$=Math.max(280,Math.min(F,E+(v-g)));l($)},H=()=>{document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",H),document.removeEventListener("touchmove",I),document.removeEventListener("touchend",H),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("chatPanelWidth",String(o))};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",I),document.addEventListener("mouseup",H),document.addEventListener("touchmove",I,{passive:!1}),document.addEventListener("touchend",H)},[o]),P=r?"Chat":"Events",D=r?"var(--accent)":"var(--success)",R=C=>C==="primary"?D:C==="events"?"var(--success)":"var(--accent)",S=Ee(C=>C.activeInterrupt[e.id]??null),M=e.status==="running"?a.jsx("span",{className:"ml-auto text-[11px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:r?"Thinking...":"Running..."}):r&&e.status==="suspended"&&S?a.jsx("span",{className:"ml-auto text-[11px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:"Action Required"}):null;if(n){const C=[{id:"traces",label:"Traces",count:b.length},{id:"primary",label:P},...r?[{id:"events",label:"Events",count:w.length}]:[],{id:"io",label:"I/O"},{id:"logs",label:"Logs",count:x.length}];return a.jsxs("div",{className:"flex flex-col h-full",children:[(e.mode==="debug"||e.status==="suspended"&&!S||T&&Object.keys(T).length>0)&&a.jsx(Yi,{runId:e.id,status:e.status,ws:t,breakpointNode:e.breakpoint_node}),a.jsx("div",{className:"shrink-0",style:{height:"40vh"},children:a.jsx(Un,{entrypoint:e.entrypoint,traces:b,runId:e.id,breakpointNode:e.breakpoint_node,breakpointNextNodes:e.breakpoint_next_nodes,onBreakpointChange:j})}),a.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-y shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[C.map(v=>a.jsxs("button",{onClick:()=>p(v.id),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded transition-colors cursor-pointer",style:{color:d===v.id?R(v.id):"var(--text-muted)",background:d===v.id?`color-mix(in srgb, ${R(v.id)} 10%, transparent)`:"transparent"},children:[v.label,v.count!==void 0&&v.count>0&&a.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--text-muted)"},children:v.count})]},v.id)),M]}),a.jsxs("div",{className:"flex-1 overflow-hidden",children:[d==="traces"&&a.jsx(Dr,{traces:b}),d==="primary"&&(r?a.jsx(N.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:a.jsx("span",{className:"text-xs",children:"Loading chat..."})}),children:a.jsx(Xi,{messages:y,runId:e.id,runStatus:e.status,ws:t})}):a.jsx(An,{events:w,runStatus:e.status})),d==="events"&&a.jsx(An,{events:w,runStatus:e.status}),d==="io"&&a.jsx(Zi,{run:e}),d==="logs"&&a.jsx(qi,{logs:x})]})]})}const L=[{id:"primary",label:P},...r?[{id:"events",label:"Events",count:w.length}]:[],{id:"io",label:"I/O"},{id:"logs",label:"Logs",count:x.length}];return a.jsxs("div",{ref:f,className:"flex h-full",children:[a.jsxs("div",{ref:m,className:"flex flex-col flex-1 min-w-0",children:[(e.mode==="debug"||e.status==="suspended"&&!S||T&&Object.keys(T).length>0)&&a.jsx(Yi,{runId:e.id,status:e.status,ws:t,breakpointNode:e.breakpoint_node}),a.jsx("div",{className:"shrink-0 overflow-hidden",style:{height:i},children:a.jsx(Un,{entrypoint:e.entrypoint,traces:b,runId:e.id,breakpointNode:e.breakpoint_node,breakpointNextNodes:e.breakpoint_next_nodes,onBreakpointChange:j})}),a.jsx("div",{onMouseDown:O,onTouchStart:O,className:"shrink-0 drag-handle-row"}),a.jsx("div",{className:"flex-1 overflow-hidden",children:a.jsx(Dr,{traces:b})})]}),a.jsx("div",{onMouseDown:_,onTouchStart:_,className:"shrink-0 drag-handle-col"}),a.jsxs("div",{className:"shrink-0 flex flex-col",style:{width:o,background:"var(--bg-primary)"},children:[a.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[L.map(C=>a.jsxs("button",{onClick:()=>c(C.id),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded transition-colors cursor-pointer",style:{color:u===C.id?R(C.id):"var(--text-muted)",background:u===C.id?`color-mix(in srgb, ${R(C.id)} 10%, transparent)`:"transparent"},onMouseEnter:v=>{u!==C.id&&(v.currentTarget.style.color="var(--text-primary)")},onMouseLeave:v=>{u!==C.id&&(v.currentTarget.style.color="var(--text-muted)")},children:[C.label,C.count!==void 0&&C.count>0&&a.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--text-muted)"},children:C.count})]},C.id)),M]}),a.jsxs("div",{className:"flex-1 overflow-hidden",children:[u==="primary"&&(r?a.jsx(N.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:a.jsx("span",{className:"text-xs",children:"Loading chat..."})}),children:a.jsx(Xi,{messages:y,runId:e.id,runStatus:e.status,ws:t})}):a.jsx(An,{events:w,runStatus:e.status})),u==="events"&&a.jsx(An,{events:w,runStatus:e.status}),u==="io"&&a.jsx(Zi,{run:e}),u==="logs"&&a.jsx(qi,{logs:x})]})]})]})}function Zi({run:e}){return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx(_t,{title:"Input",copyText:JSON.stringify(e.input_data,null,2),children:a.jsx(ot,{json:JSON.stringify(e.input_data,null,2),className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.output_data&&a.jsx(_t,{title:"Output",copyText:typeof e.output_data=="string"?e.output_data:JSON.stringify(e.output_data,null,2),children:a.jsx(ot,{json:typeof e.output_data=="string"?e.output_data:JSON.stringify(e.output_data,null,2),className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.error&&a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--error) 40%, var(--border))"},children:[a.jsxs("div",{className:"px-3 py-2 text-xs font-semibold flex items-center gap-2",style:{background:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",color:"var(--error)"},children:[a.jsx("span",{children:"Error"}),a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"color-mix(in srgb, var(--error) 20%, var(--bg-secondary))"},children:e.error.code}),a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"color-mix(in srgb, var(--error) 20%, var(--bg-secondary))"},children:e.error.category})]}),a.jsxs("div",{className:"px-3 py-2 text-xs leading-normal",children:[a.jsx("div",{className:"font-semibold mb-2",style:{color:"var(--text-primary)"},children:e.error.title}),a.jsx("pre",{className:"whitespace-pre-wrap font-mono text-[11px] max-w-prose",style:{color:"var(--text-secondary)"},children:e.error.detail})]})]})]})}function Ji(){const{reloadPending:e,setReloadPending:t,setEntrypoints:n}=Ee(),[r,i]=N.useState(!1);if(!e)return null;const s=async()=>{i(!0);try{await nc();const o=await ks();n(o.map(l=>l.name)),t(!1)}catch(o){console.error("Reload failed:",o)}finally{i(!1)}};return a.jsxs("div",{className:"fixed top-4 left-1/2 -translate-x-1/2 z-50 flex items-center justify-between px-5 py-2.5 rounded-lg shadow-lg min-w-[400px]",style:{background:"var(--bg-secondary)",border:"1px solid var(--bg-tertiary)"},children:[a.jsx("span",{className:"text-sm",style:{color:"var(--text-secondary)"},children:"Files changed, reload to apply"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("button",{onClick:s,disabled:r,className:"px-3 py-1 text-sm font-medium rounded cursor-pointer",style:{background:"var(--accent)",color:"#fff",opacity:r?.6:1},children:r?"Reloading...":"Reload"}),a.jsx("button",{onClick:()=>t(!1),className:"text-sm cursor-pointer px-1",style:{color:"var(--text-muted)",background:"none",border:"none"},children:"✕"})]})]})}let hu=0;const Qi=Ot(e=>({toasts:[],addToast:(t,n)=>{const r=String(++hu);e(s=>({toasts:[...s.toasts,{id:r,type:t,message:n}]})),setTimeout(()=>{e(s=>({toasts:s.toasts.filter(o=>o.id!==r)}))},t==="error"?8e3:5e3)},removeToast:t=>{e(n=>({toasts:n.toasts.filter(r=>r.id!==t)}))}})),eo={success:{color:"var(--success)",bg:"color-mix(in srgb, var(--success) 10%, var(--bg-elevated))",border:"color-mix(in srgb, var(--success) 30%, var(--border))"},error:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 10%, var(--bg-elevated))",border:"color-mix(in srgb, var(--error) 30%, var(--border))"},info:{color:"var(--info)",bg:"color-mix(in srgb, var(--info) 10%, var(--bg-elevated))",border:"color-mix(in srgb, var(--info) 30%, var(--border))"}};function to(){const e=Qi(n=>n.toasts),t=Qi(n=>n.removeToast);return e.length===0?null:a.jsx("div",{className:"fixed bottom-8 right-4 z-[100] flex flex-col gap-2 pointer-events-none",children:e.map(n=>{const r=eo[n.type]??eo.info;return a.jsxs("div",{className:"pointer-events-auto flex items-center gap-2 px-4 py-2.5 rounded-lg shadow-lg text-xs font-medium max-w-xs animate-[slideIn_0.2s_ease-out]",style:{background:r.bg,border:`1px solid ${r.border}`,color:r.color},children:[a.jsx("span",{className:"flex-1",children:n.message}),a.jsx("button",{onClick:()=>t(n.id),className:"shrink-0 w-5 h-5 flex items-center justify-center rounded cursor-pointer transition-opacity opacity-60 hover:opacity-100",style:{color:r.color,background:"transparent",border:"none"},"aria-label":"Dismiss",children:a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[a.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),a.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9"})]})})]},n.id)})})}function bu(e){return e===null?"-":`${Math.round(e*100)}%`}function xu(e){if(e===null)return"var(--text-muted)";const t=e*100;return t>=80?"var(--success)":t>=50?"var(--warning)":"var(--error)"}const no={pending:{color:"var(--text-muted)",label:"Pending"},running:{color:"var(--info)",label:"Running"},completed:{color:"var(--success)",label:"Completed"},failed:{color:"var(--error)",label:"Failed"}};function ro(){const e=Me(l=>l.evalSets),t=Me(l=>l.evalRuns),{evalSetId:n,evalRunId:r,navigate:i}=st(),s=Object.values(e),o=Object.values(t).sort((l,u)=>new Date(u.start_time??0).getTime()-new Date(l.start_time??0).getTime());return a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a.jsx("button",{onClick:()=>i("#/evals/new"),className:"w-[calc(100%-24px)] mx-3 mt-2.5 mb-1 px-3 py-1.5 text-[11px] text-center font-medium rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-secondary)"},onMouseEnter:l=>{l.currentTarget.style.color="var(--text-primary)",l.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:l=>{l.currentTarget.style.color="var(--text-secondary)",l.currentTarget.style.borderColor=""},children:"+ New Eval Set"}),a.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Eval Sets"}),s.map(l=>{const u=n===l.id;return a.jsxs("button",{onClick:()=>i(`#/evals/sets/${l.id}`),className:"w-full text-left px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{background:u?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:u?"var(--text-primary)":"var(--text-secondary)",borderLeft:u?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:c=>{u||(c.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:c=>{u||(c.currentTarget.style.background="transparent")},children:[a.jsx("div",{className:"truncate font-medium",children:l.name}),a.jsxs("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-muted)"},children:[l.eval_count," items · ",l.evaluator_ids.length," evaluator",l.evaluator_ids.length!==1?"s":""]})]},l.id)}),s.length===0&&a.jsx("p",{className:"text-[11px] px-3 py-2",style:{color:"var(--text-muted)"},children:"No eval sets yet"}),a.jsx("div",{className:"px-3 pt-4 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"History"}),o.map(l=>{const u=r===l.id,c=no[l.status]??no.pending;return a.jsx("button",{onClick:()=>i(`#/evals/runs/${l.id}`),className:"w-full text-left px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{background:u?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:u?"var(--text-primary)":"var(--text-secondary)",borderLeft:u?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:d=>{u||(d.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:d=>{u||(d.currentTarget.style.background="transparent")},children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:c.color}}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"truncate font-medium",children:l.eval_set_name}),a.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-muted)"},children:l.start_time?new Date(l.start_time).toLocaleString():c.label})]}),a.jsx("span",{className:"font-mono shrink-0",style:{color:xu(l.overall_score)},children:bu(l.overall_score)})]})},l.id)}),o.length===0&&a.jsx("p",{className:"text-[11px] px-3 py-2",style:{color:"var(--text-muted)"},children:"No eval runs yet"})]})}function io(e,t=60){const n=typeof e=="string"?e:JSON.stringify(e);return!n||n==="null"?"-":n.length>t?n.slice(0,t)+"...":n}function yu({evalSetId:e}){const[t,n]=N.useState(null),[r,i]=N.useState(!0),[s,o]=N.useState(null),[l,u]=N.useState(!1),[c,d]=N.useState("io"),p=Me(g=>g.evaluators),m=Me(g=>g.localEvaluators),f=Me(g=>g.updateEvalSetEvaluators),h=Me(g=>g.incrementEvalSetCount),b=Me(g=>g.upsertEvalRun),{navigate:x}=st(),[y,w]=N.useState(!1),[T,j]=N.useState(new Set),[O,_]=N.useState(!1),P=N.useRef(null),[D,R]=N.useState(()=>{const g=localStorage.getItem("evalSetSidebarWidth");return g?parseInt(g,10):320}),[S,M]=N.useState(!1),L=N.useRef(null);N.useEffect(()=>{localStorage.setItem("evalSetSidebarWidth",String(D))},[D]),N.useEffect(()=>{i(!0),o(null),fc(e).then(g=>{n(g),g.items.length>0&&o(g.items[0].name)}).catch(console.error).finally(()=>i(!1))},[e]);const C=async()=>{u(!0);try{const g=await mc(e);b(g),x(`#/evals/runs/${g.id}`)}catch(g){console.error(g)}finally{u(!1)}},v=async g=>{if(t)try{await pc(e,g),n(F=>{if(!F)return F;const $=F.items.filter(k=>k.name!==g);return{...F,items:$,eval_count:$.length}}),h(e,-1),s===g&&o(null)}catch(F){console.error(F)}},E=N.useCallback(()=>{t&&j(new Set(t.evaluator_ids)),w(!0)},[t]),I=g=>{j(F=>{const $=new Set(F);return $.has(g)?$.delete(g):$.add(g),$})},H=async()=>{if(t){_(!0);try{const g=await bc(e,Array.from(T));n(g),f(e,g.evaluator_ids),w(!1)}catch(g){console.error(g)}finally{_(!1)}}};N.useEffect(()=>{if(!y)return;const g=F=>{P.current&&!P.current.contains(F.target)&&w(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[y]);const U=N.useCallback(g=>{g.preventDefault(),M(!0);const F="touches"in g?g.touches[0].clientX:g.clientX,$=D,k=K=>{const W=L.current;if(!W)return;const re="touches"in K?K.touches[0].clientX:K.clientX,de=W.clientWidth-300,xe=Math.max(280,Math.min(de,$+(F-re)));R(xe)},ie=()=>{M(!1),document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",ie),document.removeEventListener("touchmove",k),document.removeEventListener("touchend",ie),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",k),document.addEventListener("mouseup",ie),document.addEventListener("touchmove",k,{passive:!1}),document.addEventListener("touchend",ie)},[D]);if(r)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-sm",children:"Loading..."});if(!t)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Eval set not found"});const V=t.items.find(g=>g.name===s)??null;return a.jsxs("div",{ref:L,className:"flex h-full",children:[a.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[a.jsxs("div",{className:"px-4 h-10 border-b shrink-0 flex items-center gap-4",style:{borderColor:"var(--border)"},children:[a.jsx("h1",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:t.name}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:[t.eval_count," items"]}),a.jsxs("div",{className:"flex gap-1 items-center ml-auto relative",children:[a.jsx("button",{onClick:E,className:"w-7 h-7 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:g=>{g.currentTarget.style.color="var(--text-primary)",g.currentTarget.style.background="var(--bg-secondary)"},onMouseLeave:g=>{g.currentTarget.style.color="var(--text-muted)",g.currentTarget.style.background="transparent"},title:"Edit evaluators","aria-label":"Edit evaluators",children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"}),a.jsx("path",{d:"m15 5 4 4"})]})}),t.evaluator_ids.map(g=>{const F=p.find($=>$.id===g);return a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[11px] font-medium",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:(F==null?void 0:F.name)??g},g)}),y&&a.jsxs("div",{ref:P,className:"absolute top-full right-0 mt-1 z-50 rounded-md border shadow-lg",style:{background:"var(--bg-primary)",borderColor:"var(--border)",minWidth:220},children:[a.jsx("div",{className:"px-3 py-2 border-b text-[10px] uppercase tracking-wide font-semibold",style:{color:"var(--text-muted)",borderColor:"var(--border)"},children:"Evaluators"}),a.jsx("div",{className:"max-h-48 overflow-y-auto",children:m.length===0?a.jsx("div",{className:"px-3 py-3 text-xs",style:{color:"var(--text-muted)"},children:"No evaluators available"}):m.map(g=>a.jsxs("label",{className:"flex items-center gap-2 px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--border)"},onMouseEnter:F=>{F.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:F=>{F.currentTarget.style.background="transparent"},children:[a.jsx("input",{type:"checkbox",checked:T.has(g.id),onChange:()=>I(g.id),className:"accent-[var(--accent)]"}),a.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:g.name})]},g.id))}),a.jsx("div",{className:"px-3 py-2 border-t flex justify-end",style:{borderColor:"var(--border)"},children:a.jsx("button",{onClick:H,disabled:O,className:"px-3 py-1 text-[11px] font-semibold rounded cursor-pointer transition-colors disabled:opacity-50",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},onMouseEnter:g=>{g.currentTarget.style.background="var(--accent-hover)"},onMouseLeave:g=>{g.currentTarget.style.background="var(--accent)"},children:O?"Saving...":"Update"})})]})]}),a.jsxs("button",{onClick:C,disabled:l,className:"ml-2 px-3 py-1 h-7 text-xs font-semibold rounded border flex items-center gap-1.5 cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--success)",borderColor:"var(--success)",background:"transparent"},onMouseEnter:g=>{l||(g.currentTarget.style.background="color-mix(in srgb, var(--success) 10%, transparent)")},onMouseLeave:g=>{g.currentTarget.style.background="transparent"},title:"Run eval set","aria-label":"Run eval set",children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:a.jsx("polygon",{points:"5,3 19,12 5,21"})}),l?"Running...":"Run"]})]}),a.jsxs("div",{className:"flex items-center px-3 h-7 text-[11px] font-semibold shrink-0 border-b",style:{color:"var(--text-muted)",background:"var(--bg-secondary)",borderColor:"var(--border)"},children:[a.jsx("span",{className:"w-56 shrink-0",children:"Name"}),a.jsx("span",{className:"flex-1 min-w-0",children:"Input"}),a.jsx("span",{className:"w-32 shrink-0 pl-2",children:"Expected Behavior"}),a.jsx("span",{className:"w-32 shrink-0 pl-2",children:"Expected Output"}),a.jsx("span",{className:"w-32 shrink-0 pl-2",children:"Simulation Instr."}),a.jsx("span",{className:"w-8 shrink-0"})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[t.items.map(g=>{const F=g.name===s;return a.jsxs("button",{onClick:()=>o(F?null:g.name),className:"group w-full text-left px-3 py-1.5 flex items-center text-xs border-b transition-colors cursor-pointer",style:{borderColor:"var(--border)",background:F?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:F?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:$=>{F||($.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:$=>{F||($.currentTarget.style.background="")},children:[a.jsx("span",{className:"w-56 shrink-0 truncate",style:{color:"var(--text-primary)"},children:g.name}),a.jsx("span",{className:"flex-1 min-w-0 truncate font-mono text-[11px]",style:{color:"var(--text-muted)"},children:io(g.inputs)}),a.jsx("span",{className:"w-32 shrink-0 truncate pl-2 text-[11px]",style:{color:"var(--text-muted)"},children:g.expected_behavior||"-"}),a.jsx("span",{className:"w-32 shrink-0 truncate pl-2 font-mono text-[11px]",style:{color:"var(--text-muted)"},children:io(g.expected_output,40)}),a.jsx("span",{className:"w-32 shrink-0 truncate pl-2 text-[11px]",style:{color:"var(--text-muted)"},children:g.simulation_instructions||"-"}),a.jsx("span",{role:"button",tabIndex:0,className:"w-8 shrink-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",onClick:$=>{$.stopPropagation(),v(g.name)},onKeyDown:$=>{$.key==="Enter"&&($.stopPropagation(),v(g.name))},style:{color:"var(--text-muted)"},onMouseEnter:$=>{$.currentTarget.style.color="var(--error)"},onMouseLeave:$=>{$.currentTarget.style.color="var(--text-muted)"},title:"Delete item",children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},g.name)}),t.items.length===0&&a.jsx("div",{className:"flex items-center justify-center py-8 text-[var(--text-muted)] text-xs",children:"No items in this eval set"})]})]}),a.jsx("div",{onMouseDown:U,onTouchStart:U,className:`shrink-0 drag-handle-col${S?"":" transition-all"}`,style:{width:V?3:0,opacity:V?1:0}}),a.jsxs("div",{className:`shrink-0 flex flex-col overflow-hidden${S?"":" transition-[width] duration-200 ease-in-out"}`,style:{width:V?D:0,background:"var(--bg-primary)"},children:[a.jsx("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",minWidth:D},children:["io","evaluators"].map(g=>{const F=c===g,$=g==="io"?"I/O":"Evaluators";return a.jsx("button",{onClick:()=>d(g),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded inline-flex items-center cursor-pointer transition-colors",style:{color:F?"var(--accent)":"var(--text-muted)",background:F?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent",border:"none"},children:$},g)})}),a.jsx("div",{className:"flex-1 overflow-hidden",style:{minWidth:D},children:V?c==="io"?a.jsx(vu,{item:V}):a.jsx(ku,{item:V,evaluators:p}):null})]})]})}function vu({item:e}){const t=JSON.stringify(e.inputs,null,2),n=e.expected_output!=null?typeof e.expected_output=="string"?e.expected_output:JSON.stringify(e.expected_output,null,2):null;return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx(_t,{title:"Input",copyText:t,children:a.jsx(ot,{json:t,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.expected_behavior&&a.jsx(_t,{title:"Expected Behavior",copyText:e.expected_behavior,children:a.jsx("div",{className:"px-3 py-2 text-xs leading-relaxed whitespace-pre-wrap",style:{color:"var(--text-secondary)"},children:e.expected_behavior})}),n&&a.jsx(_t,{title:"Expected Output",copyText:n,children:a.jsx(ot,{json:n,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.simulation_instructions&&a.jsx(_t,{title:"Simulation Instructions",copyText:e.simulation_instructions,children:a.jsx("div",{className:"px-3 py-2 text-xs leading-relaxed whitespace-pre-wrap",style:{color:"var(--text-secondary)"},children:e.simulation_instructions})})]})}function ku({item:e,evaluators:t}){return a.jsx("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:e.evaluator_ids.length>0?a.jsx(a.Fragment,{children:e.evaluator_ids.map(n=>{var s;const r=t.find(o=>o.id===n),i=(s=e.evaluation_criterias)==null?void 0:s[n];return a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:(r==null?void 0:r.name)??n}),a.jsx("span",{className:"ml-auto text-[10px]",style:{color:"var(--text-muted)"},children:i?"Custom criteria":"Default criteria"})]}),i&&a.jsx("pre",{className:"px-3 py-2 border-t text-[11px] font-mono overflow-x-auto max-h-32 whitespace-pre-wrap break-words",style:{borderColor:"var(--border)",color:"var(--text-secondary)"},children:JSON.stringify(i,null,2)})]},n)})}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:"No evaluators configured for this item"})})}function en(e){return e===null?"-":`${Math.round(e*100)}%`}function wt(e){if(e===null)return"var(--text-muted)";const t=e*100;return t>=80?"var(--success)":t>=50?"var(--warning)":"var(--error)"}function Eu(e,t){if(!e)return"-";const n=new Date(e).getTime(),r=t?new Date(t).getTime():Date.now(),i=Math.round((r-n)/1e3);return i<60?`${i}s`:`${Math.floor(i/60)}m ${i%60}s`}function oo(e){return e.replace(/\s*Evaluator$/i,"")}const so={pending:{color:"var(--text-muted)",bg:"var(--bg-tertiary)",label:"Pending"},running:{color:"var(--info)",bg:"rgba(59,130,246,0.1)",label:"Running"},completed:{color:"var(--success)",bg:"rgba(34,197,94,0.1)",label:"Completed"},failed:{color:"var(--error)",bg:"rgba(239,68,68,0.1)",label:"Failed"}};function wu({evalRunId:e,itemName:t}){const[n,r]=N.useState(null),[i,s]=N.useState(!0),{navigate:o}=st(),l=t??null,[u,c]=N.useState(220),d=N.useRef(null),p=N.useRef(!1),[m,f]=N.useState(()=>{const M=localStorage.getItem("evalSidebarWidth");return M?parseInt(M,10):320}),[h,b]=N.useState(!1),x=N.useRef(null);N.useEffect(()=>{localStorage.setItem("evalSidebarWidth",String(m))},[m]);const y=Me(M=>M.evalRuns[e]),w=Me(M=>M.evaluators);N.useEffect(()=>{s(!0),Li(e).then(M=>{if(r(M),!t){const L=M.results.find(C=>C.status==="completed")??M.results[0];L&&o(`#/evals/runs/${e}/${encodeURIComponent(L.name)}`)}}).catch(console.error).finally(()=>s(!1))},[e]),N.useEffect(()=>{((y==null?void 0:y.status)==="completed"||(y==null?void 0:y.status)==="failed")&&Li(e).then(r).catch(console.error)},[y==null?void 0:y.status,e]),N.useEffect(()=>{if(t||!(n!=null&&n.results))return;const M=n.results.find(L=>L.status==="completed")??n.results[0];M&&o(`#/evals/runs/${e}/${encodeURIComponent(M.name)}`)},[n==null?void 0:n.results]);const T=N.useCallback(M=>{M.preventDefault(),p.current=!0;const L="touches"in M?M.touches[0].clientY:M.clientY,C=u,v=I=>{if(!p.current)return;const H=d.current;if(!H)return;const U="touches"in I?I.touches[0].clientY:I.clientY,V=H.clientHeight-100,g=Math.max(80,Math.min(V,C+(U-L)));c(g)},E=()=>{p.current=!1,document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",E),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",E),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",v),document.addEventListener("mouseup",E),document.addEventListener("touchmove",v,{passive:!1}),document.addEventListener("touchend",E)},[u]),j=N.useCallback(M=>{M.preventDefault(),b(!0);const L="touches"in M?M.touches[0].clientX:M.clientX,C=m,v=I=>{const H=x.current;if(!H)return;const U="touches"in I?I.touches[0].clientX:I.clientX,V=H.clientWidth-300,g=Math.max(280,Math.min(V,C+(L-U)));f(g)},E=()=>{b(!1),document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",E),document.removeEventListener("touchmove",v),document.removeEventListener("touchend",E),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",v),document.addEventListener("mouseup",E),document.addEventListener("touchmove",v,{passive:!1}),document.addEventListener("touchend",E)},[m]);if(i)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-sm",children:"Loading..."});if(!n)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Eval run not found"});const O=y??n,_=so[O.status]??so.pending,P=O.status==="running",D=Object.keys(O.evaluator_scores??{}),R=n.results.find(M=>M.name===l)??null,S=((R==null?void 0:R.traces)??[]).map(M=>({...M,run_id:""}));return a.jsxs("div",{ref:x,className:"flex h-full",children:[a.jsxs("div",{ref:d,className:"flex flex-col flex-1 min-w-0",children:[a.jsxs("div",{className:"px-4 h-10 border-b shrink-0 flex items-center gap-4",style:{borderColor:"var(--border)"},children:[a.jsx("h1",{className:"text-base font-semibold truncate min-w-0",style:{color:"var(--text-primary)"},children:O.eval_set_name}),a.jsx("span",{className:"px-2 py-0.5 rounded text-[11px] font-semibold uppercase tracking-wide",style:{color:_.color,background:_.bg},children:_.label}),a.jsx("span",{className:"text-sm font-bold font-mono",style:{color:wt(O.overall_score)},children:en(O.overall_score)}),a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:Eu(O.start_time,O.end_time)}),P&&a.jsxs("div",{className:"flex items-center gap-2 max-w-[160px]",children:[a.jsx("div",{className:"flex-1 h-2 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${O.progress_total>0?O.progress_completed/O.progress_total*100:0}%`,background:"var(--info)"}})}),a.jsxs("span",{className:"text-[11px] shrink-0",style:{color:"var(--text-muted)"},children:[O.progress_completed,"/",O.progress_total]})]}),D.length>0&&a.jsx("div",{className:"flex gap-3 ml-auto",children:D.map(M=>{const L=w.find(v=>v.id===M),C=O.evaluator_scores[M];return a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:oo((L==null?void 0:L.name)??M)}),a.jsx("div",{className:"w-12 h-2 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${C*100}%`,background:wt(C)}})}),a.jsx("span",{className:"text-[11px] font-mono",style:{color:wt(C)},children:en(C)})]},M)})})]}),a.jsxs("div",{className:"shrink-0 overflow-hidden flex flex-col",style:{height:u},children:[a.jsxs("div",{className:"flex items-center px-3 h-7 text-[11px] font-semibold shrink-0 border-b",style:{color:"var(--text-muted)",background:"var(--bg-secondary)",borderColor:"var(--border)"},children:[a.jsx("span",{className:"w-5 shrink-0"}),a.jsx("span",{className:"flex-1 min-w-0",children:"Name"}),a.jsx("span",{className:"w-14 shrink-0 text-right",children:"Score"}),D.map(M=>{const L=w.find(C=>C.id===M);return a.jsx("span",{className:"w-36 shrink-0 text-right truncate pl-2",title:(L==null?void 0:L.name)??M,children:oo((L==null?void 0:L.name)??M)},M)}),a.jsx("span",{className:"w-14 shrink-0 text-right",children:"Time"})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[n.results.map(M=>{const L=M.status==="pending",C=M.status==="failed",v=M.name===l;return a.jsxs("button",{onClick:()=>{o(v?`#/evals/runs/${e}`:`#/evals/runs/${e}/${encodeURIComponent(M.name)}`)},className:"w-full text-left px-3 py-1.5 flex items-center text-xs border-b transition-colors cursor-pointer",style:{borderColor:"var(--border)",background:v?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:v?"2px solid var(--accent)":"2px solid transparent",opacity:L?.5:1},onMouseEnter:E=>{v||(E.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:E=>{v||(E.currentTarget.style.background="")},children:[a.jsx("span",{className:"w-5 shrink-0 flex justify-center",children:a.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:L?"var(--text-muted)":C?"var(--error)":M.overall_score>=.8?"var(--success)":M.overall_score>=.5?"var(--warning)":"var(--error)"}})}),a.jsx("span",{className:"flex-1 min-w-0 truncate",style:{color:"var(--text-primary)"},children:M.name}),a.jsx("span",{className:"w-14 shrink-0 text-right font-mono font-semibold",style:{color:wt(L?null:M.overall_score)},children:L?"-":en(M.overall_score)}),D.map(E=>a.jsx("span",{className:"w-36 shrink-0 text-right font-mono pl-2",style:{color:wt(L?null:M.scores[E]??null)},children:L?"-":en(M.scores[E]??null)},E)),a.jsx("span",{className:"w-14 shrink-0 text-right",style:{color:"var(--text-muted)"},children:M.duration_ms!==null?`${(M.duration_ms/1e3).toFixed(1)}s`:"-"})]},M.name)}),n.results.length===0&&a.jsx("div",{className:"flex items-center justify-center py-8 text-[var(--text-muted)] text-xs",children:P?"Waiting for results...":"No results"})]})]}),a.jsx("div",{onMouseDown:T,onTouchStart:T,className:"shrink-0 drag-handle-row"}),a.jsx("div",{className:"flex-1 overflow-hidden",children:R&&S.length>0?a.jsx(Dr,{traces:S}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:(R==null?void 0:R.status)==="pending"?"Pending...":"No traces available"})})]}),a.jsx("div",{onMouseDown:j,onTouchStart:j,className:`shrink-0 drag-handle-col${h?"":" transition-all"}`,style:{width:R?3:0,opacity:R?1:0}}),a.jsx(Nu,{width:m,item:R,evaluators:w,isRunning:P,isDragging:h})]})}const _u=[{id:"score",label:"Score"},{id:"io",label:"I/O"},{id:"logs",label:"Logs"}];function Nu({width:e,item:t,evaluators:n,isRunning:r,isDragging:i}){const[s,o]=N.useState("score"),l=!!t;return a.jsxs("div",{className:`shrink-0 flex flex-col overflow-hidden${i?"":" transition-[width] duration-200 ease-in-out"}`,style:{width:l?e:0,background:"var(--bg-primary)"},children:[a.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",minWidth:e},children:[_u.map(u=>a.jsx("button",{onClick:()=>o(u.id),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded transition-colors cursor-pointer",style:{color:s===u.id?"var(--accent)":"var(--text-muted)",background:s===u.id?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent",border:"none"},onMouseEnter:c=>{s!==u.id&&(c.currentTarget.style.color="var(--text-primary)")},onMouseLeave:c=>{s!==u.id&&(c.currentTarget.style.color="var(--text-muted)")},children:u.label},u.id)),r&&a.jsx("span",{className:"ml-auto text-[11px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:"Running..."})]}),a.jsx("div",{className:"flex-1 overflow-y-auto",style:{minWidth:e},children:t?t.status==="pending"?a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:"Pending..."}):a.jsxs(a.Fragment,{children:[t.status==="failed"&&a.jsxs("div",{className:"mx-2 mt-2 px-3 py-2 rounded text-xs",style:{background:"rgba(239,68,68,0.1)",color:"var(--error)"},children:[a.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[a.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("path",{d:"M8 4.5v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("circle",{cx:"8",cy:"11",r:"0.75",fill:"currentColor"})]}),a.jsx("span",{children:"Evaluator error"})]}),t.error&&a.jsx("div",{className:"mt-1 pl-[22px] text-[11px] opacity-80 break-words",style:{color:"var(--text-secondary)"},children:t.error})]}),s==="score"?a.jsx(Su,{item:t,evaluators:n}):s==="io"?a.jsx(Tu,{item:t}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:"Logs coming soon"})]}):null})]})}function Su({item:e,evaluators:t}){const n=Object.keys(e.scores);return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"truncate text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"Overall"}),a.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[a.jsx("div",{className:"w-24 h-2.5 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${e.overall_score*100}%`,background:wt(e.overall_score)}})}),a.jsx("span",{className:"text-xs font-mono font-bold shrink-0 w-10 text-right",style:{color:wt(e.overall_score)},children:en(e.overall_score)})]})]})}),e.status==="failed"&&n.length===0&&a.jsx("div",{className:"px-3 py-3 text-xs text-center",style:{color:"var(--text-muted)"},children:"All evaluators failed — no scores available"}),n.map(r=>{const i=t.find(l=>l.id===r),s=e.scores[r],o=e.justifications[r];return a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"truncate text-[11px] font-semibold",style:{color:"var(--text-primary)"},title:(i==null?void 0:i.name)??r,children:(i==null?void 0:i.name)??r}),a.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[a.jsx("div",{className:"w-24 h-2.5 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${s*100}%`,background:wt(s)}})}),a.jsx("span",{className:"text-xs font-mono font-bold shrink-0 w-10 text-right",style:{color:wt(s)},children:en(s)})]})]}),o&&a.jsx(Au,{text:o})]},r)})]})}function Tu({item:e}){const t=JSON.stringify(e.inputs,null,2),n=typeof e.output=="string"?e.output:JSON.stringify(e.output,null,2),r=e.expected_output!=null?typeof e.expected_output=="string"?e.expected_output:JSON.stringify(e.expected_output,null,2):null;return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx(_t,{title:"Input",copyText:t,children:a.jsx(ot,{json:t,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),r&&a.jsx(_t,{title:"Expected Output",copyText:r,children:a.jsx(ot,{json:r,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),a.jsx(_t,{title:"Output",copyText:n,trailing:e.duration_ms!==null?a.jsxs("span",{className:"ml-auto text-[10px]",style:{color:"var(--text-muted)"},children:[(e.duration_ms/1e3).toFixed(2),"s"]}):void 0,children:a.jsx(ot,{json:n,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})})]})}function Cu(e){var i;const t=e.match(/expected="(.+?)"\s+actual="(.+?)"(.*)/s);if(!t)return null;const n={},r=((i=t[3])==null?void 0:i.trim())??"";if(r)for(const s of r.match(/(\w+)=([\S]+)/g)??[]){const o=s.indexOf("=");n[s.slice(0,o)]=s.slice(o+1)}return{expected:t[1],actual:t[2],meta:n}}function ao(e){try{const t=e.replace(/'/g,'"').replace(/\bTrue\b/g,"true").replace(/\bFalse\b/g,"false").replace(/\bNone\b/g,"null"),n=JSON.parse(t);return JSON.stringify(n,null,2)}catch{return e}}function Au({text:e}){const t=Cu(e);if(!t)return a.jsx("div",{className:"px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:a.jsx("div",{className:"text-xs leading-relaxed",style:{color:"var(--text-secondary)"},children:e})});const n=ao(t.expected),r=ao(t.actual),i=n===r;return a.jsxs("div",{className:"border-t",style:{borderColor:"var(--border)"},children:[a.jsxs("div",{className:"grid grid-cols-2 gap-0",children:[a.jsxs("div",{className:"px-3 py-2 border-r",style:{borderColor:"var(--border)"},children:[a.jsx("div",{className:"text-[10px] font-semibold mb-1",style:{color:"var(--text-muted)"},children:"Expected"}),a.jsx("pre",{className:"text-[11px] font-mono whitespace-pre-wrap break-words",style:{color:"var(--text-secondary)"},children:n})]}),a.jsxs("div",{className:"px-3 py-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[a.jsx("span",{className:"text-[10px] font-semibold",style:{color:"var(--text-muted)"},children:"Actual"}),a.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:i?"var(--success)":"var(--error)"}})]}),a.jsx("pre",{className:"text-[11px] font-mono whitespace-pre-wrap break-words",style:{color:i?"var(--success)":"var(--error)"},children:r})]})]}),Object.keys(t.meta).length>0&&a.jsx("div",{className:"px-3 py-1.5 border-t flex items-center gap-3",style:{borderColor:"var(--border)"},children:Object.entries(t.meta).map(([s,o])=>a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:[a.jsx("span",{className:"font-medium",children:s.replace(/_/g," ")})," ",a.jsx("span",{className:"font-mono",children:o})]},s))})]})}const lo={deterministic:"var(--success)",llm:"#a78bfa",tool:"var(--info)"};function co(){const e=Me(f=>f.localEvaluators),t=Me(f=>f.addEvalSet),{navigate:n}=st(),[r,i]=N.useState(""),[s,o]=N.useState(new Set),[l,u]=N.useState(null),[c,d]=N.useState(!1),p=f=>{o(h=>{const b=new Set(h);return b.has(f)?b.delete(f):b.add(f),b})},m=async()=>{if(r.trim()){u(null),d(!0);try{const f=await uc({name:r.trim(),evaluator_refs:Array.from(s)});t(f),n(`#/evals/sets/${f.id}`)}catch(f){u(f.detail||f.message||"Failed to create eval set")}finally{d(!1)}}};return a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"w-full max-w-xl px-6",children:[a.jsxs("div",{className:"mb-8 text-center",children:[a.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}}),a.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"New Eval Set"})]}),a.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"Create an evaluation set with a name and evaluators"})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Name"}),a.jsx("input",{type:"text",value:r,onChange:f=>i(f.target.value),placeholder:"e.g. Basic QA Tests",className:"w-full rounded-md px-3 py-2 text-xs",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},onKeyDown:f=>{f.key==="Enter"&&r.trim()&&m()}})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Evaluators"}),e.length===0?a.jsxs("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:["No evaluators configured."," ",a.jsx("button",{onClick:()=>n("#/evaluators/new"),className:"underline cursor-pointer",style:{color:"var(--accent)",background:"none",border:"none",padding:0,font:"inherit"},children:"Create one first"})]}):a.jsx("div",{className:"rounded-md border overflow-hidden",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:e.map(f=>a.jsxs("label",{className:"flex items-center gap-2.5 px-3 py-2 text-xs cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--border)"},onMouseEnter:h=>{h.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:h=>{h.currentTarget.style.background="transparent"},children:[a.jsx("input",{type:"checkbox",checked:s.has(f.id),onChange:()=>p(f.id),className:"accent-[var(--accent)]"}),a.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:f.name}),a.jsx("span",{className:"text-[11px] font-medium px-1.5 py-0.5 rounded",style:{background:`color-mix(in srgb, ${lo[f.type]??"var(--text-muted)"} 15%, transparent)`,color:lo[f.type]??"var(--text-muted)"},children:f.type})]},f.id))})]}),l&&a.jsx("p",{className:"text-xs mb-4 px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:l}),a.jsx("button",{onClick:m,disabled:!r.trim()||c,className:"w-full py-2 rounded-md text-[13px] font-semibold transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},children:c?"Creating...":"Create Eval Set"})]})})}const Mu=[{type:"deterministic",label:"Deterministic",badgeColor:"var(--success)"},{type:"llm",label:"LLM Judge",badgeColor:"#a78bfa"},{type:"tool",label:"Tool-Based",badgeColor:"var(--info)"}];function uo(){const e=Me(s=>s.localEvaluators),{evaluatorFilter:t,evaluatorCreateType:n,navigate:r}=st(),i=!t&&!n;return a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>r("#/evaluators/new"),className:"mx-3 mt-2.5 mb-1 px-3 py-1.5 text-[11px] font-medium rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-secondary)"},onMouseEnter:s=>{s.currentTarget.style.color="var(--text-primary)",s.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:s=>{s.currentTarget.style.color="var(--text-secondary)",s.currentTarget.style.borderColor=""},children:"+ New Evaluator"}),a.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Categories"}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a.jsxs("button",{onClick:()=>r("#/evaluators"),className:"w-full text-left px-3 py-2 text-xs flex items-center gap-2 cursor-pointer transition-colors",style:{background:i?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:i?"var(--text-primary)":"var(--text-secondary)",borderLeft:i?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:s=>{i||(s.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:s=>{i||(s.currentTarget.style.background="transparent")},children:[a.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:"var(--text-muted)"}}),a.jsx("span",{className:"flex-1 truncate",children:"All"}),e.length>0&&a.jsx("span",{className:"text-[10px] px-1.5 rounded-full",style:{background:"var(--bg-tertiary)",color:"var(--text-muted)"},children:e.length})]}),Mu.map(s=>{const o=e.filter(u=>u.type===s.type).length,l=t===s.type;return a.jsxs("button",{onClick:()=>r(l?"#/evaluators":`#/evaluators/category/${s.type}`),className:"w-full text-left px-3 py-2 text-xs flex items-center gap-2 cursor-pointer transition-colors",style:{background:l?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:l?"var(--text-primary)":"var(--text-secondary)",borderLeft:l?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:u=>{l||(u.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:u=>{l||(u.currentTarget.style.background="transparent")},children:[a.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:s.badgeColor}}),a.jsx("span",{className:"flex-1 truncate",children:s.label}),o>0&&a.jsx("span",{className:"text-[10px] px-1.5 rounded-full",style:{background:"var(--bg-tertiary)",color:"var(--text-muted)"},children:o})]},s.type)})]})]})}const po={deterministic:{label:"Deterministic",color:"var(--success)",bg:"rgba(34,197,94,0.1)"},llm:{label:"LLM Judge",color:"#a78bfa",bg:"rgba(167,139,250,0.1)"},tool:{label:"Tool-Based",color:"var(--info)",bg:"rgba(59,130,246,0.1)"}},Pr={deterministic:"Deterministic",llm:"LLM Judge",tool:"Tool-Based"},pn={deterministic:[{id:"uipath-exact-match",name:"Exact Match"},{id:"uipath-contains",name:"Contains"},{id:"uipath-json-similarity",name:"JSON Similarity"}],llm:[{id:"uipath-llm-judge-output-semantic-similarity",name:"LLM Judge Output"},{id:"uipath-llm-judge-output-strict-json-similarity",name:"LLM Judge Strict JSON"},{id:"uipath-llm-judge-trajectory-similarity",name:"LLM Judge Trajectory"},{id:"uipath-llm-judge-trajectory-simulation",name:"LLM Judge Trajectory Simulation"}],tool:[{id:"uipath-tool-call-order",name:"Tool Call Order"},{id:"uipath-tool-call-args",name:"Tool Call Args"},{id:"uipath-tool-call-count",name:"Tool Call Count"},{id:"uipath-tool-call-output",name:"Tool Call Output"}]};function Ls(e){return e.includes("trajectory")?{targetOutputKey:!1,prompt:!0}:e.includes("llm-judge")?{targetOutputKey:!0,prompt:!0}:e.includes("tool-call-output")?{targetOutputKey:!0,prompt:!1}:e.includes("exact-match")||e.includes("contains")||e.includes("json-similarity")?{targetOutputKey:!0,prompt:!1}:{targetOutputKey:!1,prompt:!1}}const fr={"uipath-exact-match":{description:"Checks whether the agent output exactly matches the expected output.",prompt:""},"uipath-contains":{description:"Checks whether the agent output contains the expected substring.",prompt:""},"uipath-json-similarity":{description:"Compares JSON structures for semantic similarity, ignoring key ordering and whitespace.",prompt:""},"uipath-llm-judge-output-semantic-similarity":{description:"Uses an LLM to score semantic similarity between the agent's actual output and the expected output, accounting for synonyms, paraphrases, and equivalent expressions.",prompt:`As an expert evaluator, analyze the semantic similarity between the expected and actual outputs and determine a score from 0 to 100. Focus on comparing meaning and contextual equivalence of corresponding fields, accounting for alternative valid expressions, synonyms, and reasonable variations in language while maintaining high standards for accuracy and completeness. Provide your score with a brief justification. + `}),a.jsxs(jl,{nodes:s,edges:u,onNodesChange:l,onEdgesChange:d,nodeTypes:$c,edgeTypes:Uc,onInit:w=>{x.current=w},onNodeClick:D,fitView:!0,proOptions:{hideAttribution:!0},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,children:[a.jsx(Dl,{color:"var(--bg-tertiary)",gap:16}),a.jsx(Pl,{showInteractive:!1}),a.jsx(Bl,{position:"top-right",children:a.jsxs("button",{onClick:S,title:R?"Remove all breakpoints":"Set breakpoints on all nodes",style:{background:"var(--bg-secondary)",color:R?"var(--error)":"var(--text-muted)",border:`1px solid ${R?"var(--error)":"var(--node-border)"}`,borderRadius:6,padding:"4px 10px",fontSize:12,cursor:"pointer",display:"flex",alignItems:"center",gap:4},children:[a.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:R?"var(--error)":"var(--node-border)"}}),R?"Clear all":"Break all"]})}),a.jsx(Fl,{nodeColor:w=>{var I;if(w.type==="groupNode")return"var(--bg-tertiary)";const k=(I=w.data)==null?void 0:I.status;return k==="completed"?"var(--success)":k==="running"?"var(--warning)":k==="failed"?"var(--error)":"var(--node-border)"},nodeStrokeWidth:0,style:{background:"var(--bg-secondary)",width:120,height:80}})]})]})}const Ut="__setup__";function Xc({entrypoint:e,mode:t,ws:n,onRunCreated:r,isMobile:i}){const[s,o]=_.useState("{}"),[l,u]=_.useState({}),[c,d]=_.useState(!1),[p,m]=_.useState(!0),[f,b]=_.useState(null),[h,v]=_.useState(""),[y,x]=_.useState(!0),[C,O]=_.useState(()=>{const I=localStorage.getItem("setupTextareaHeight");return I?parseInt(I,10):140}),j=_.useRef(null),[N,B]=_.useState(()=>{const I=localStorage.getItem("setupPanelWidth");return I?parseInt(I,10):380}),D=t==="run";_.useEffect(()=>{m(!0),b(null),Xl(e).then(I=>{u(I.mock_input),o(JSON.stringify(I.mock_input,null,2))}).catch(I=>{console.error("Failed to load mock input:",I);const W=I.detail||{};b(W.message||`Failed to load schema for "${e}"`),o("{}")}).finally(()=>m(!1))},[e]),_.useEffect(()=>{ve.getState().clearBreakpoints(Ut)},[]);const R=async()=>{let I;try{I=JSON.parse(s)}catch{alert("Invalid JSON input");return}d(!0);try{const W=ve.getState().breakpoints[Ut]??{},U=Object.keys(W),q=await Oi(e,I,t,U);ve.getState().clearBreakpoints(Ut),ve.getState().upsertRun(q),r(q.id)}catch(W){console.error("Failed to create run:",W)}finally{d(!1)}},S=async()=>{const I=h.trim();if(I){d(!0);try{const W=ve.getState().breakpoints[Ut]??{},U=Object.keys(W),q=await Oi(e,l,"chat",U);ve.getState().clearBreakpoints(Ut),ve.getState().upsertRun(q),ve.getState().addLocalChatMessage(q.id,{message_id:`local-${Date.now()}`,role:"user",content:I}),n.sendChatMessage(q.id,I),r(q.id)}catch(W){console.error("Failed to create chat run:",W)}finally{d(!1)}}};_.useEffect(()=>{try{JSON.parse(s),x(!0)}catch{x(!1)}},[s]);const T=_.useCallback(I=>{I.preventDefault();const W="touches"in I?I.touches[0].clientY:I.clientY,U=C,q=F=>{const $="touches"in F?F.touches[0].clientY:F.clientY,E=Math.max(60,U+(W-$));O(E)},g=()=>{document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",g),document.removeEventListener("touchmove",q),document.removeEventListener("touchend",g),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("setupTextareaHeight",String(C))};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",q),document.addEventListener("mouseup",g),document.addEventListener("touchmove",q,{passive:!1}),document.addEventListener("touchend",g)},[C]),L=_.useCallback(I=>{I.preventDefault();const W="touches"in I?I.touches[0].clientX:I.clientX,U=N,q=F=>{const $=j.current;if(!$)return;const E="touches"in F?F.touches[0].clientX:F.clientX,ie=$.clientWidth-300,K=Math.max(280,Math.min(ie,U+(W-E)));B(K)},g=()=>{document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",g),document.removeEventListener("touchmove",q),document.removeEventListener("touchend",g),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("setupPanelWidth",String(N))};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",q),document.addEventListener("mouseup",g),document.addEventListener("touchmove",q,{passive:!1}),document.addEventListener("touchend",g)},[N]),M=D?"Autonomous":"Conversational",w=D?"var(--success)":"var(--accent)",k=a.jsxs("div",{className:"shrink-0 flex flex-col",style:i?{background:"var(--bg-primary)"}:{width:N,background:"var(--bg-primary)"},children:[a.jsxs("div",{className:"px-4 text-xs font-semibold border-b flex items-center gap-2 h-10",style:{color:"var(--text-muted)",borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[a.jsx("span",{style:{color:w},children:"●"}),M]}),a.jsxs("div",{className:"flex-1 overflow-y-auto flex flex-col items-center justify-center gap-4 px-6",children:[a.jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--text-muted)",opacity:.5},children:D?a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("polyline",{points:"12 6 12 12 16 14"})]}):a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),a.jsxs("div",{className:"text-center space-y-1.5",children:[a.jsx("p",{className:"text-sm font-medium",style:{color:"var(--text-secondary)"},children:D?"Ready to execute":"Ready to chat"}),a.jsxs("p",{className:"text-xs leading-relaxed",style:{color:"var(--text-muted)"},children:["Click nodes to set breakpoints",D?a.jsxs(a.Fragment,{children:[",",a.jsx("br",{}),"configure input below, then run"]}):a.jsxs(a.Fragment,{children:[",",a.jsx("br",{}),"then send your first message"]})]})]})]}),D?a.jsxs("div",{className:"flex flex-col",style:{background:"var(--bg-primary)"},children:[!i&&a.jsx("div",{onMouseDown:T,onTouchStart:T,className:"shrink-0 drag-handle-row"}),a.jsxs("div",{className:"px-4 py-3",children:[f?a.jsx("div",{className:"text-xs mb-3 px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:f}):a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:["Input",p&&a.jsx("span",{className:"ml-2 font-normal",children:"Loading..."})]}),a.jsx("textarea",{value:s,onChange:I=>o(I.target.value),spellCheck:!1,className:"w-full rounded-md px-3 py-2 text-xs font-mono leading-relaxed resize-none mb-3",style:{height:i?120:C,background:"var(--bg-secondary)",border:`1px solid ${y?"var(--border)":"#b91c1c"}`,color:"var(--text-primary)"}})]}),a.jsx("button",{onClick:R,disabled:c||p||!!f,className:"w-full py-2 text-sm font-semibold rounded-md border cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed transition-colors flex items-center justify-center gap-2",style:{background:"transparent",borderColor:w,color:w},onMouseEnter:I=>{c||(I.currentTarget.style.background=`color-mix(in srgb, ${w} 10%, transparent)`)},onMouseLeave:I=>{I.currentTarget.style.background="transparent"},children:c?"Starting...":a.jsxs(a.Fragment,{children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:a.jsx("polygon",{points:"5,3 19,12 5,21"})}),"Execute"]})})]})]}):a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:[a.jsx("input",{value:h,onChange:I=>v(I.target.value),onKeyDown:I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),S())},disabled:c||p,placeholder:c?"Starting...":"Message...",className:"flex-1 bg-transparent text-sm py-1 disabled:opacity-40 placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),a.jsx("button",{onClick:S,disabled:c||p||!h.trim(),className:"text-xs font-semibold px-3 py-1.5 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:!c&&h.trim()?"var(--accent)":"var(--text-muted)",background:"transparent"},onMouseEnter:I=>{!c&&h.trim()&&(I.currentTarget.style.background="color-mix(in srgb, var(--accent) 10%, transparent)")},onMouseLeave:I=>{I.currentTarget.style.background="transparent"},children:"Send"})]})]});return i?a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsx("div",{className:"shrink-0",style:{height:"40vh"},children:a.jsx(Un,{entrypoint:e,traces:[],runId:Ut})}),a.jsx("div",{className:"flex-1 overflow-y-auto flex flex-col min-h-0",children:k})]}):a.jsxs("div",{ref:j,className:"flex h-full",children:[a.jsx("div",{className:"flex-1 min-w-0",children:a.jsx(Un,{entrypoint:e,traces:[],runId:Ut})}),a.jsx("div",{onMouseDown:L,onTouchStart:L,className:"shrink-0 drag-handle-col"}),k]})}const Zc={key:"var(--info)",string:"var(--success)",number:"var(--warning)",boolean:"var(--accent)",null:"var(--accent)",punctuation:"var(--text-muted)"};function Jc(e){const t=[],n=/("(?:[^"\\]|\\.)*")\s*:|("(?:[^"\\]|\\.)*")|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b|(true|false)\b|(null)\b|([{}[\]:,])/g;let r=0,i;for(;(i=n.exec(e))!==null;){if(i.index>r&&t.push({type:"punctuation",text:e.slice(r,i.index)}),i[1]!==void 0){t.push({type:"key",text:i[1]});const s=e.indexOf(":",i.index+i[1].length);s!==-1&&(s>i.index+i[1].length&&t.push({type:"punctuation",text:e.slice(i.index+i[1].length,s)}),t.push({type:"punctuation",text:":"}),n.lastIndex=s+1)}else i[2]!==void 0?t.push({type:"string",text:i[2]}):i[3]!==void 0?t.push({type:"number",text:i[3]}):i[4]!==void 0?t.push({type:"boolean",text:i[4]}):i[5]!==void 0?t.push({type:"null",text:i[5]}):i[6]!==void 0&&t.push({type:"punctuation",text:i[6]});r=n.lastIndex}return rJc(e),[e]);return a.jsx("pre",{className:t,style:n,children:r.map((i,s)=>a.jsx("span",{style:{color:Zc[i.type]},children:i.text},s))})}const Qc={started:{color:"var(--info)",label:"Started"},running:{color:"var(--warning)",label:"Running"},completed:{color:"var(--success)",label:"Completed"},failed:{color:"var(--error)",label:"Failed"},error:{color:"var(--error)",label:"Error"}},eu={color:"var(--text-muted)",label:"Unknown"};function tu(e){if(typeof e!="string")return null;const t=e.trim();if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))try{return JSON.stringify(JSON.parse(t),null,2)}catch{return null}return null}const qi=200;function nu(e){if(typeof e=="string")return e;if(e==null)return String(e);try{return JSON.stringify(e,null,2)}catch{return String(e)}}function ru({value:e}){const[t,n]=_.useState(!1),r=nu(e),i=_.useMemo(()=>tu(e),[e]),s=i!==null,o=i??r,l=o.length>qi||o.includes(` +`),u=_.useCallback(()=>n(c=>!c),[]);return l?a.jsxs("div",{children:[t?s?a.jsx(ot,{json:o,className:"font-mono text-[11px] whitespace-pre-wrap break-all",style:{}}):a.jsx("pre",{className:"font-mono text-[11px] whitespace-pre-wrap break-all",style:{color:"var(--text-primary)"},children:o}):a.jsxs("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:[o.slice(0,qi),"..."]}),a.jsx("button",{onClick:u,className:"text-[11px] cursor-pointer ml-1 px-1",style:{color:"var(--info)"},children:t?"[less]":"[more]"})]}):s?a.jsx(ot,{json:o,className:"font-mono text-[11px] break-all whitespace-pre-wrap",style:{}}):a.jsx("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:o})}function iu({span:e}){const[t,n]=_.useState(!0),[r,i]=_.useState(!1),[s,o]=_.useState("table"),[l,u]=_.useState(!1),c=Qc[e.status.toLowerCase()]??{...eu,label:e.status},d=_.useMemo(()=>JSON.stringify(e,null,2),[e]),p=_.useCallback(()=>{navigator.clipboard.writeText(d).then(()=>{u(!0),setTimeout(()=>u(!1),1500)})},[d]),m=Object.entries(e.attributes),f=[{label:"Span",value:e.span_id},...e.trace_id?[{label:"Trace",value:e.trace_id}]:[],{label:"Run",value:e.run_id},...e.parent_span_id?[{label:"Parent",value:e.parent_span_id}]:[]];return a.jsxs("div",{className:"flex flex-col h-full text-xs leading-normal",children:[a.jsxs("div",{className:"px-2 border-b flex items-center gap-1 shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",height:"32px"},children:[a.jsx("button",{onClick:()=>o("table"),className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:s==="table"?"var(--accent)":"var(--text-muted)",background:s==="table"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:b=>{s!=="table"&&(b.currentTarget.style.color="var(--text-primary)")},onMouseLeave:b=>{s!=="table"&&(b.currentTarget.style.color="var(--text-muted)")},children:"Table"}),a.jsx("button",{onClick:()=>o("json"),className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:s==="json"?"var(--accent)":"var(--text-muted)",background:s==="json"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:b=>{s!=="json"&&(b.currentTarget.style.color="var(--text-primary)")},onMouseLeave:b=>{s!=="json"&&(b.currentTarget.style.color="var(--text-muted)")},children:"JSON"}),a.jsxs("span",{className:"ml-auto shrink-0 inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] font-bold uppercase tracking-wider",style:{background:`color-mix(in srgb, ${c.color} 15%, var(--bg-secondary))`,color:c.color},children:[a.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full",style:{background:c.color}}),c.label]})]}),a.jsx("div",{className:"overflow-y-auto flex-1 p-0.5 pr-0 pt-0 mr-0.5 mt-0.5",children:s==="table"?a.jsxs(a.Fragment,{children:[m.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"px-2 py-1 text-[11px] uppercase font-bold tracking-wider border-b cursor-pointer flex items-center",style:{color:"var(--success)",borderColor:"var(--border)",background:"var(--bg-secondary)"},onClick:()=>n(b=>!b),children:[a.jsxs("span",{className:"flex-1",children:["Attributes (",m.length,")"]}),a.jsx("span",{style:{color:"var(--text-muted)",transform:t?"rotate(0deg)":"rotate(-90deg)"},children:"▾"})]}),t&&m.map(([b,h],v)=>a.jsxs("div",{className:"flex gap-2 px-2 py-1 items-start border-b",style:{borderColor:"var(--border)",background:v%2===0?"var(--bg-primary)":"var(--bg-secondary)"},children:[a.jsx("span",{className:"font-mono font-semibold shrink-0 pt-px truncate text-[11px]",style:{color:"var(--info)",width:"35%"},title:b,children:b}),a.jsx("span",{className:"flex-1 min-w-0",children:a.jsx(ru,{value:h})})]},b))]}),a.jsxs("div",{className:"px-2 py-1 text-[11px] uppercase font-bold tracking-wider border-b cursor-pointer flex items-center",style:{color:"var(--success)",borderColor:"var(--border)",background:"var(--bg-secondary)"},onClick:()=>i(b=>!b),children:[a.jsxs("span",{className:"flex-1",children:["Identifiers (",f.length,")"]}),a.jsx("span",{style:{color:"var(--text-muted)",transform:r?"rotate(0deg)":"rotate(-90deg)"},children:"▾"})]}),r&&f.map((b,h)=>a.jsxs("div",{className:"flex gap-2 px-2 py-1 items-start border-b",style:{borderColor:"var(--border)",background:h%2===0?"var(--bg-primary)":"var(--bg-secondary)"},children:[a.jsx("span",{className:"font-mono font-semibold shrink-0 pt-px truncate text-[11px]",style:{color:"var(--info)",width:"35%"},title:b.label,children:b.label}),a.jsx("span",{className:"flex-1 min-w-0",children:a.jsx("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:b.value})})]},b.label))]}):a.jsxs("div",{className:"relative",children:[a.jsx("button",{onClick:p,className:"absolute top-1 right-1 z-10 text-[11px] cursor-pointer px-2 py-1 rounded transition-colors",style:{color:l?"var(--success)":"var(--text-muted)",background:"var(--bg-secondary)",border:"1px solid var(--border)"},onMouseEnter:b=>{l||(b.currentTarget.style.color="var(--text-primary)")},onMouseLeave:b=>{b.currentTarget.style.color=l?"var(--success)":"var(--text-muted)"},children:l?"Copied!":"Copy"}),a.jsx(ot,{json:d,className:"font-mono text-[11px] whitespace-pre-wrap p-2",style:{}})]})})]})}function ou(e){const t=[];function n(r,i){t.push({span:r.span,depth:i});for(const s of r.children)n(s,i+1)}for(const r of e)n(r,0);return t}function su({tree:e,selectedSpan:t,onSelect:n}){const r=_.useMemo(()=>ou(e),[e]),{globalStart:i,totalDuration:s}=_.useMemo(()=>{if(r.length===0)return{globalStart:0,totalDuration:1};let o=1/0,l=-1/0;for(const{span:u}of r){const c=new Date(u.timestamp).getTime();o=Math.min(o,c),l=Math.max(l,c+(u.duration_ms??0))}return{globalStart:o,totalDuration:Math.max(l-o,1)}},[r]);return r.length===0?null:a.jsx(a.Fragment,{children:r.map(({span:o,depth:l})=>{var h;const u=new Date(o.timestamp).getTime()-i,c=o.duration_ms??0,d=u/s*100,p=Math.max(c/s*100,.3),m=As[o.status.toLowerCase()]??"var(--text-muted)",f=o.span_id===(t==null?void 0:t.span_id),b=(h=o.attributes)==null?void 0:h["openinference.span.kind"];return a.jsxs("button",{"data-span-id":o.span_id,onClick:()=>n(o),className:"w-full text-left text-xs leading-normal py-1 flex items-center transition-colors",style:{background:f?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:f?"2px solid var(--accent)":"2px solid transparent"},onMouseEnter:v=>{f||(v.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:v=>{f||(v.currentTarget.style.background="")},children:[a.jsxs("div",{className:"shrink-0 flex items-center gap-1 overflow-hidden",style:{width:"35%",minWidth:"80px",paddingLeft:`${l*12+4}px`},children:[a.jsx("span",{className:"shrink-0 flex items-center justify-center w-3.5 h-3.5",children:a.jsx(Ms,{kind:b,statusColor:m})}),a.jsx("span",{className:"text-[var(--text-primary)] truncate",children:o.span_name})]}),a.jsx("div",{className:"flex-1 relative h-[14px] mx-1 rounded-sm",style:{background:"var(--bg-secondary)"},children:a.jsx("div",{className:"absolute rounded-sm",style:{left:`${d}%`,width:`${p}%`,top:"2px",bottom:"2px",background:m,opacity:.8,minWidth:"2px"}})}),a.jsx("span",{className:"shrink-0 text-[10px] tabular-nums pr-2",style:{width:"52px",textAlign:"right",color:"var(--text-muted)"},children:Is(o.duration_ms)})]},o.span_id)})})}const As={started:"var(--info)",running:"var(--warning)",completed:"var(--success)",failed:"var(--error)",error:"var(--error)"};function Ms({kind:e,statusColor:t}){const n=t,r=14,i={width:r,height:r,viewBox:"0 0 16 16",fill:"none",stroke:n,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"LLM":return a.jsx("svg",{...i,children:a.jsx("path",{d:"M8 2L9 5L12 4L10 7L14 8L10 9L12 12L9 11L8 14L7 11L4 12L6 9L2 8L6 7L4 4L7 5Z",fill:n,stroke:"none"})});case"TOOL":return a.jsx("svg",{...i,children:a.jsx("path",{d:"M10.5 2.5a3.5 3.5 0 0 0-3.17 4.93L3.5 11.27a1 1 0 0 0 0 1.41l.82.82a1 1 0 0 0 1.41 0l3.84-3.83A3.5 3.5 0 1 0 10.5 2.5z"})});case"AGENT":return a.jsxs("svg",{...i,children:[a.jsx("rect",{x:"3",y:"5",width:"10",height:"8",rx:"2"}),a.jsx("circle",{cx:"6",cy:"9",r:"1",fill:n,stroke:"none"}),a.jsx("circle",{cx:"10",cy:"9",r:"1",fill:n,stroke:"none"}),a.jsx("path",{d:"M8 2v3"}),a.jsx("path",{d:"M6 2h4"})]});case"CHAIN":return a.jsxs("svg",{...i,children:[a.jsx("path",{d:"M6.5 9.5L9.5 6.5"}),a.jsx("path",{d:"M4.5 8.5l-1 1a2 2 0 0 0 2.83 2.83l1-1"}),a.jsx("path",{d:"M11.5 7.5l1-1a2 2 0 0 0-2.83-2.83l-1 1"})]});case"RETRIEVER":return a.jsxs("svg",{...i,children:[a.jsx("circle",{cx:"7",cy:"7",r:"4"}),a.jsx("path",{d:"M10 10l3.5 3.5"})]});case"EMBEDDING":return a.jsxs("svg",{...i,children:[a.jsx("rect",{x:"2",y:"2",width:"4",height:"4",rx:"0.5"}),a.jsx("rect",{x:"10",y:"2",width:"4",height:"4",rx:"0.5"}),a.jsx("rect",{x:"2",y:"10",width:"4",height:"4",rx:"0.5"}),a.jsx("rect",{x:"10",y:"10",width:"4",height:"4",rx:"0.5"})]});default:return a.jsx("span",{className:"shrink-0 w-2 h-2 rounded-full",style:{background:t}})}}function au(e){const t=new Map(e.map(o=>[o.span_id,o])),n=new Map;for(const o of e)if(o.parent_span_id){const l=n.get(o.parent_span_id)??[];l.push(o),n.set(o.parent_span_id,l)}const r=e.filter(o=>o.parent_span_id===null||!t.has(o.parent_span_id));function i(o){const l=(n.get(o.span_id)??[]).sort((u,c)=>u.timestamp.localeCompare(c.timestamp));return{span:o,children:l.map(i)}}return r.sort((o,l)=>o.timestamp.localeCompare(l.timestamp)).map(i).flatMap(o=>o.span.span_name==="root"?o.children:[o])}function Is(e){return e==null?"":e<1e3?`${e.toFixed(0)}ms`:`${(e/1e3).toFixed(2)}s`}function Rs(e){return e.map(t=>{const{span:n}=t;return t.children.length>0?{name:n.span_name,children:Rs(t.children)}:{name:n.span_name}})}function Dr({traces:e}){const[t,n]=_.useState(null),[r,i]=_.useState(new Set),[s,o]=_.useState(()=>{const D=localStorage.getItem("traceTreeSplitWidth");return D?parseFloat(D):50}),[l,u]=_.useState(!1),[c,d]=_.useState(!1),[p,m]=_.useState(()=>localStorage.getItem("traceViewMode")||"tree"),f=au(e),b=_.useMemo(()=>JSON.stringify(Rs(f),null,2),[e]),h=_.useCallback(()=>{navigator.clipboard.writeText(b).then(()=>{d(!0),setTimeout(()=>d(!1),1500)})},[b]),v=ve(D=>D.focusedSpan),y=ve(D=>D.setFocusedSpan),[x,C]=_.useState(null),O=_.useRef(null),j=_.useCallback(D=>{i(R=>{const S=new Set(R);return S.has(D)?S.delete(D):S.add(D),S})},[]),N=_.useRef(null);_.useEffect(()=>{const D=f.length>0?f[0].span.span_id:null,R=N.current;if(N.current=D,D&&D!==R)n(f[0].span);else if(t===null)f.length>0&&n(f[0].span);else{const S=e.find(T=>T.span_id===t.span_id);S&&S!==t&&n(S)}},[e]),_.useEffect(()=>{if(!v)return;const R=e.filter(S=>S.span_name===v.name).sort((S,T)=>S.timestamp.localeCompare(T.timestamp))[v.index];if(R){n(R),C(R.span_id);const S=new Map(e.map(T=>[T.span_id,T.parent_span_id]));i(T=>{const L=new Set(T);let M=R.parent_span_id;for(;M;)L.delete(M),M=S.get(M)??null;return L})}y(null)},[v,e,y]),_.useEffect(()=>{if(!x)return;const D=x;C(null),requestAnimationFrame(()=>{const R=O.current,S=R==null?void 0:R.querySelector(`[data-span-id="${D}"]`);R&&S&&S.scrollIntoView({block:"center",behavior:"smooth"})})},[x]),_.useEffect(()=>{if(!l)return;const D=S=>{const T=document.querySelector(".trace-tree-container");if(!T)return;const L=T.getBoundingClientRect(),M=(S.clientX-L.left)/L.width*100,w=Math.max(20,Math.min(80,M));o(w),localStorage.setItem("traceTreeSplitWidth",String(w))},R=()=>{u(!1)};return window.addEventListener("mousemove",D),window.addEventListener("mouseup",R),()=>{window.removeEventListener("mousemove",D),window.removeEventListener("mouseup",R)}},[l]);const B=D=>{D.preventDefault(),u(!0)};return a.jsxs("div",{className:"flex h-full trace-tree-container",style:{cursor:l?"col-resize":void 0},children:[a.jsxs("div",{className:"flex flex-col",style:{width:`${s}%`},children:[e.length>0&&a.jsxs("div",{className:"flex items-center gap-1 px-2 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",height:"32px"},children:[a.jsx("button",{onClick:()=>{m("tree"),localStorage.setItem("traceViewMode","tree")},className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:p==="tree"?"var(--accent)":"var(--text-muted)",background:p==="tree"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:D=>{p!=="tree"&&(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{p!=="tree"&&(D.currentTarget.style.color="var(--text-muted)")},children:"Tree"}),a.jsx("button",{onClick:()=>{m("timeline"),localStorage.setItem("traceViewMode","timeline")},className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:p==="timeline"?"var(--accent)":"var(--text-muted)",background:p==="timeline"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:D=>{p!=="timeline"&&(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{p!=="timeline"&&(D.currentTarget.style.color="var(--text-muted)")},children:"Timeline"}),a.jsx("button",{onClick:()=>{m("json"),localStorage.setItem("traceViewMode","json")},className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:p==="json"?"var(--accent)":"var(--text-muted)",background:p==="json"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:D=>{p!=="json"&&(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{p!=="json"&&(D.currentTarget.style.color="var(--text-muted)")},children:"JSON"})]}),a.jsx("div",{ref:O,className:"overflow-y-auto flex-1 p-0.5 pr-0 pt-0 mr-0.5 mt-0.5",children:f.length===0?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"No traces yet"})}):p==="tree"?f.map((D,R)=>a.jsx(Os,{node:D,depth:0,selectedId:(t==null?void 0:t.span_id)??null,onSelect:n,isLast:R===f.length-1,collapsedIds:r,toggleExpanded:j},D.span.span_id)):p==="timeline"?a.jsx(su,{tree:f,selectedSpan:t,onSelect:n}):a.jsxs("div",{className:"relative",children:[a.jsx("button",{onClick:h,className:"absolute top-1 right-1 z-10 text-[11px] cursor-pointer px-2 py-1 rounded transition-colors",style:{color:c?"var(--success)":"var(--text-muted)",background:"var(--bg-secondary)",border:"1px solid var(--border)"},onMouseEnter:D=>{c||(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{D.currentTarget.style.color=c?"var(--success)":"var(--text-muted)"},children:c?"Copied!":"Copy"}),a.jsx(ot,{json:b,className:"font-mono text-[11px] whitespace-pre-wrap p-2",style:{}})]})})]}),a.jsx("div",{onMouseDown:B,className:"shrink-0 drag-handle-col",style:l?{background:"var(--accent)"}:void 0}),a.jsx("div",{className:"flex-1 overflow-hidden",children:t?a.jsx(iu,{span:t}):a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"Select a span to view details"})})})]})}function Os({node:e,depth:t,selectedId:n,onSelect:r,isLast:i,collapsedIds:s,toggleExpanded:o}){var h;const{span:l}=e,u=!s.has(l.span_id),c=As[l.status.toLowerCase()]??"var(--text-muted)",d=Is(l.duration_ms),p=l.span_id===n,m=e.children.length>0,f=t*20,b=(h=l.attributes)==null?void 0:h["openinference.span.kind"];return a.jsxs("div",{className:"relative",children:[t>0&&a.jsx("div",{className:"absolute top-0 z-10 pointer-events-none",style:{left:`${f-10}px`,width:"1px",height:i?"16px":"100%",background:"var(--border)"}}),a.jsxs("button",{"data-span-id":l.span_id,onClick:()=>r(l),className:"w-full text-left text-xs leading-normal py-1.5 pr-2 flex items-center gap-1.5 transition-colors relative",style:{paddingLeft:`${f+4}px`,background:p?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":void 0,borderLeft:p?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:v=>{p||(v.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:v=>{p||(v.currentTarget.style.background="")},children:[t>0&&a.jsx("div",{className:"absolute z-10 pointer-events-none",style:{left:`${f-10}px`,top:"50%",width:"10px",height:"1px",background:"var(--border)"}}),m?a.jsx("span",{onClick:v=>{v.stopPropagation(),o(l.span_id)},className:"shrink-0 w-5 h-5 flex items-center justify-center cursor-pointer rounded hover:bg-[var(--bg-hover)]",style:{color:"var(--text-muted)"},children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",style:{transform:u?"rotate(90deg)":"rotate(0deg)"},children:a.jsx("path",{d:"M3 1.5L7 5L3 8.5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})})}):a.jsx("span",{className:"shrink-0 w-4"}),a.jsx("span",{className:"shrink-0 flex items-center justify-center w-4 h-4",children:a.jsx(Ms,{kind:b,statusColor:c})}),a.jsx("span",{className:"text-[var(--text-primary)] truncate min-w-0 flex-1",children:l.span_name}),d&&a.jsx("span",{className:"text-[var(--text-muted)] shrink-0 ml-auto pl-2 tabular-nums",children:d})]}),u&&e.children.map((v,y)=>a.jsx(Os,{node:v,depth:t+1,selectedId:n,onSelect:r,isLast:y===e.children.length-1,collapsedIds:s,toggleExpanded:o},v.span.span_id))]})}const lu={DEBUG:{color:"var(--text-muted)",bg:"color-mix(in srgb, var(--text-muted) 15%, var(--bg-secondary))",border:"var(--text-muted)"},INFO:{color:"var(--info)",bg:"color-mix(in srgb, var(--info) 15%, var(--bg-secondary))",border:"var(--info)"},WARN:{color:"var(--warning)",bg:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",border:"var(--warning)"},WARNING:{color:"var(--warning)",bg:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",border:"var(--warning)"},ERROR:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",border:"var(--error)"},CRITICAL:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",border:"var(--error)"}},cu={color:"var(--text-muted)",bg:"transparent"};function Vi({logs:e}){const t=_.useRef(null),n=_.useRef(null),[r,i]=_.useState(!1);_.useEffect(()=>{var o;(o=n.current)==null||o.scrollIntoView({behavior:"smooth"})},[e.length]);const s=()=>{const o=t.current;o&&i(o.scrollTop>100)};return e.length===0?a.jsx("div",{className:"h-full flex items-center justify-center",children:a.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"No logs yet"})}):a.jsxs("div",{className:"h-full relative",children:[a.jsxs("div",{ref:t,onScroll:s,className:"h-full overflow-y-auto font-mono text-xs leading-normal",children:[e.map((o,l)=>{const u=new Date(o.timestamp).toLocaleTimeString(void 0,{hour12:!1}),c=o.level.toUpperCase(),d=c.slice(0,4),p=lu[c]??cu,m=l%2===0;return a.jsxs("div",{className:"flex gap-3 px-3 py-1.5",style:{background:m?"var(--bg-primary)":"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[var(--text-muted)] shrink-0",children:u}),a.jsx("span",{className:"shrink-0 self-start px-1.5 py-0.5 rounded text-[10px] font-semibold leading-none inline-flex items-center",style:{color:p.color,background:p.bg},children:d}),a.jsx("span",{className:"text-[var(--text-primary)] whitespace-pre-wrap break-all",children:o.message})]},l)}),a.jsx("div",{ref:n})]}),r&&a.jsx("button",{onClick:()=>{var o;return(o=t.current)==null?void 0:o.scrollTo({top:0,behavior:"smooth"})},className:"absolute top-2 right-3 w-6 h-6 flex items-center justify-center rounded-full cursor-pointer transition-opacity opacity-70 hover:opacity-100",style:{background:"var(--bg-tertiary)",color:"var(--text-primary)"},title:"Scroll to top",children:a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"18 15 12 9 6 15"})})})]})}const uu={started:{color:"var(--accent)",label:"started"},updated:{color:"var(--info)",label:"updated"},completed:{color:"var(--success)",label:"completed"},faulted:{color:"var(--error)",label:"faulted"}},Yi={color:"var(--text-muted)",label:""};function An({events:e,runStatus:t}){const n=_.useRef(null),r=_.useRef(!0),[i,s]=_.useState(null),o=()=>{const l=n.current;l&&(r.current=l.scrollHeight-l.scrollTop-l.clientHeight<40)};return _.useEffect(()=>{r.current&&n.current&&(n.current.scrollTop=n.current.scrollHeight)}),e.length===0?a.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:a.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:t==="running"?"Waiting for events...":"No events yet"})}):a.jsx("div",{ref:n,onScroll:o,className:"h-full overflow-y-auto font-mono text-xs leading-normal",children:e.map((l,u)=>{const c=new Date(l.timestamp).toLocaleTimeString(void 0,{hour12:!1}),d=l.payload&&Object.keys(l.payload).length>0,p=i===u,m=l.phase?uu[l.phase]??Yi:Yi;return a.jsxs("div",{children:[a.jsxs("div",{onClick:()=>{d&&s(p?null:u)},className:"flex items-center gap-2 px-3 py-1.5",style:{background:u%2===0?"var(--bg-primary)":"var(--bg-secondary)",cursor:d?"pointer":"default"},children:[a.jsx("span",{className:"shrink-0",style:{color:"var(--text-muted)"},children:c}),a.jsx("span",{className:"shrink-0",style:{color:m.color},children:"●"}),a.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:l.node_name}),m.label&&a.jsx("span",{className:"shrink-0 text-[10px]",style:{color:"var(--text-muted)"},children:m.label}),d&&a.jsx("span",{className:"shrink-0 text-[9px] transition-transform",style:{color:"var(--text-muted)",transform:p?"rotate(90deg)":"rotate(0deg)"},children:"▸"})]}),p&&d&&a.jsx("div",{className:"px-3 py-2 border-t border-b",style:{borderColor:"var(--border)",background:"color-mix(in srgb, var(--bg-secondary) 80%, var(--bg-primary))"},children:a.jsx(ot,{json:JSON.stringify(l.payload,null,2),className:"text-[11px] font-mono whitespace-pre-wrap break-words"})})]},u)})})}function _t({title:e,copyText:t,trailing:n,children:r}){const[i,s]=_.useState(!1),o=_.useCallback(()=>{t&&navigator.clipboard.writeText(t).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})},[t]);return a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:e}),n,t&&a.jsx("button",{onClick:o,className:`${n?"":"ml-auto "}text-[10px] cursor-pointer px-1.5 py-0.5 rounded transition-colors`,style:{color:i?"var(--success)":"var(--text-muted)",background:"var(--bg-tertiary)",border:"none"},onMouseEnter:l=>{i||(l.currentTarget.style.color="var(--text-primary)")},onMouseLeave:l=>{l.currentTarget.style.color=i?"var(--success)":"var(--text-muted)"},children:i?"Copied":"Copy"})]}),r]})}function Xi({runId:e,status:t,ws:n,breakpointNode:r}){const i=t==="suspended",s=o=>{const l=ve.getState().breakpoints[e]??{};n.setBreakpoints(e,Object.keys(l)),o==="step"?n.debugStep(e):o==="continue"?n.debugContinue(e):n.debugStop(e)};return a.jsxs("div",{className:"flex items-center gap-1 px-4 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[11px] font-semibold mr-1",style:{color:"var(--text-muted)"},children:"Debug"}),a.jsx(pr,{label:"Step",onClick:()=>s("step"),disabled:!i,color:"var(--info)",active:i}),a.jsx(pr,{label:"Continue",onClick:()=>s("continue"),disabled:!i,color:"var(--success)",active:i}),a.jsx(pr,{label:"Stop",onClick:()=>s("stop"),disabled:!i,color:"var(--error)",active:i}),a.jsx("span",{className:"text-[11px] ml-auto truncate",style:{color:i?"var(--accent)":"var(--text-muted)"},children:i?r?`Paused at ${r}`:"Paused":t})]})}function pr({label:e,onClick:t,disabled:n,color:r,active:i}){return a.jsx("button",{onClick:t,disabled:n,className:"px-3 py-1 h-7 text-[11px] font-semibold rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:i?r:"var(--text-muted)",background:i?`color-mix(in srgb, ${r} 10%, transparent)`:"transparent"},onMouseEnter:s=>{n||(s.currentTarget.style.background=`color-mix(in srgb, ${r} 20%, transparent)`)},onMouseLeave:s=>{s.currentTarget.style.background=i?`color-mix(in srgb, ${r} 10%, transparent)`:"transparent"},children:e})}const Zi=_.lazy(()=>Ts(()=>import("./ChatPanel-DWIYYBph.js"),__vite__mapDeps([2,1,3,4]))),du=[],pu=[],fu=[],mu=[];function gu({run:e,ws:t,isMobile:n}){const r=e.mode==="chat",[i,s]=_.useState(280),[o,l]=_.useState(()=>{const M=localStorage.getItem("chatPanelWidth");return M?parseInt(M,10):380}),[u,c]=_.useState("primary"),[d,p]=_.useState(r?"primary":"traces"),m=_.useRef(null),f=_.useRef(null),b=_.useRef(!1),h=ve(M=>M.traces[e.id]||du),v=ve(M=>M.logs[e.id]||pu),y=ve(M=>M.chatMessages[e.id]||fu),x=ve(M=>M.stateEvents[e.id]||mu),C=ve(M=>M.breakpoints[e.id]);_.useEffect(()=>{t.setBreakpoints(e.id,C?Object.keys(C):[])},[e.id]);const O=_.useCallback(M=>{t.setBreakpoints(e.id,M)},[e.id,t]),j=_.useCallback(M=>{M.preventDefault(),b.current=!0;const w="touches"in M?M.touches[0].clientY:M.clientY,k=i,I=U=>{if(!b.current)return;const q=m.current;if(!q)return;const g="touches"in U?U.touches[0].clientY:U.clientY,F=q.clientHeight-100,$=Math.max(80,Math.min(F,k+(g-w)));s($)},W=()=>{b.current=!1,document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",W),document.removeEventListener("touchmove",I),document.removeEventListener("touchend",W),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",I),document.addEventListener("mouseup",W),document.addEventListener("touchmove",I,{passive:!1}),document.addEventListener("touchend",W)},[i]),N=_.useCallback(M=>{M.preventDefault();const w="touches"in M?M.touches[0].clientX:M.clientX,k=o,I=U=>{const q=f.current;if(!q)return;const g="touches"in U?U.touches[0].clientX:U.clientX,F=q.clientWidth-300,$=Math.max(280,Math.min(F,k+(w-g)));l($)},W=()=>{document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",W),document.removeEventListener("touchmove",I),document.removeEventListener("touchend",W),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("chatPanelWidth",String(o))};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",I),document.addEventListener("mouseup",W),document.addEventListener("touchmove",I,{passive:!1}),document.addEventListener("touchend",W)},[o]),B=r?"Chat":"Events",D=r?"var(--accent)":"var(--success)",R=M=>M==="primary"?D:M==="events"?"var(--success)":"var(--accent)",S=ve(M=>M.activeInterrupt[e.id]??null),T=e.status==="running"?a.jsx("span",{className:"ml-auto text-[11px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:r?"Thinking...":"Running..."}):r&&e.status==="suspended"&&S?a.jsx("span",{className:"ml-auto text-[11px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:"Action Required"}):null;if(n){const M=[{id:"traces",label:"Traces",count:h.length},{id:"primary",label:B},...r?[{id:"events",label:"Events",count:x.length}]:[],{id:"io",label:"I/O"},{id:"logs",label:"Logs",count:v.length}];return a.jsxs("div",{className:"flex flex-col h-full",children:[(e.mode==="debug"||e.status==="suspended"&&!S||C&&Object.keys(C).length>0)&&a.jsx(Xi,{runId:e.id,status:e.status,ws:t,breakpointNode:e.breakpoint_node}),a.jsx("div",{className:"shrink-0",style:{height:"40vh"},children:a.jsx(Un,{entrypoint:e.entrypoint,traces:h,runId:e.id,breakpointNode:e.breakpoint_node,breakpointNextNodes:e.breakpoint_next_nodes,onBreakpointChange:O})}),a.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-y shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[M.map(w=>a.jsxs("button",{onClick:()=>p(w.id),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded transition-colors cursor-pointer",style:{color:d===w.id?R(w.id):"var(--text-muted)",background:d===w.id?`color-mix(in srgb, ${R(w.id)} 10%, transparent)`:"transparent"},children:[w.label,w.count!==void 0&&w.count>0&&a.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--text-muted)"},children:w.count})]},w.id)),T]}),a.jsxs("div",{className:"flex-1 overflow-hidden",children:[d==="traces"&&a.jsx(Dr,{traces:h}),d==="primary"&&(r?a.jsx(_.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:a.jsx("span",{className:"text-xs",children:"Loading chat..."})}),children:a.jsx(Zi,{messages:y,runId:e.id,runStatus:e.status,ws:t})}):a.jsx(An,{events:x,runStatus:e.status})),d==="events"&&a.jsx(An,{events:x,runStatus:e.status}),d==="io"&&a.jsx(Ji,{run:e}),d==="logs"&&a.jsx(Vi,{logs:v})]})]})}const L=[{id:"primary",label:B},...r?[{id:"events",label:"Events",count:x.length}]:[],{id:"io",label:"I/O"},{id:"logs",label:"Logs",count:v.length}];return a.jsxs("div",{ref:f,className:"flex h-full",children:[a.jsxs("div",{ref:m,className:"flex flex-col flex-1 min-w-0",children:[(e.mode==="debug"||e.status==="suspended"&&!S||C&&Object.keys(C).length>0)&&a.jsx(Xi,{runId:e.id,status:e.status,ws:t,breakpointNode:e.breakpoint_node}),a.jsx("div",{className:"shrink-0 overflow-hidden",style:{height:i},children:a.jsx(Un,{entrypoint:e.entrypoint,traces:h,runId:e.id,breakpointNode:e.breakpoint_node,breakpointNextNodes:e.breakpoint_next_nodes,onBreakpointChange:O})}),a.jsx("div",{onMouseDown:j,onTouchStart:j,className:"shrink-0 drag-handle-row"}),a.jsx("div",{className:"flex-1 overflow-hidden",children:a.jsx(Dr,{traces:h})})]}),a.jsx("div",{onMouseDown:N,onTouchStart:N,className:"shrink-0 drag-handle-col"}),a.jsxs("div",{className:"shrink-0 flex flex-col",style:{width:o,background:"var(--bg-primary)"},children:[a.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[L.map(M=>a.jsxs("button",{onClick:()=>c(M.id),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded transition-colors cursor-pointer",style:{color:u===M.id?R(M.id):"var(--text-muted)",background:u===M.id?`color-mix(in srgb, ${R(M.id)} 10%, transparent)`:"transparent"},onMouseEnter:w=>{u!==M.id&&(w.currentTarget.style.color="var(--text-primary)")},onMouseLeave:w=>{u!==M.id&&(w.currentTarget.style.color="var(--text-muted)")},children:[M.label,M.count!==void 0&&M.count>0&&a.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--text-muted)"},children:M.count})]},M.id)),T]}),a.jsxs("div",{className:"flex-1 overflow-hidden",children:[u==="primary"&&(r?a.jsx(_.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:a.jsx("span",{className:"text-xs",children:"Loading chat..."})}),children:a.jsx(Zi,{messages:y,runId:e.id,runStatus:e.status,ws:t})}):a.jsx(An,{events:x,runStatus:e.status})),u==="events"&&a.jsx(An,{events:x,runStatus:e.status}),u==="io"&&a.jsx(Ji,{run:e}),u==="logs"&&a.jsx(Vi,{logs:v})]})]})]})}function Ji({run:e}){return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx(_t,{title:"Input",copyText:JSON.stringify(e.input_data,null,2),children:a.jsx(ot,{json:JSON.stringify(e.input_data,null,2),className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.output_data&&a.jsx(_t,{title:"Output",copyText:typeof e.output_data=="string"?e.output_data:JSON.stringify(e.output_data,null,2),children:a.jsx(ot,{json:typeof e.output_data=="string"?e.output_data:JSON.stringify(e.output_data,null,2),className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.error&&a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--error) 40%, var(--border))"},children:[a.jsxs("div",{className:"px-3 py-2 text-xs font-semibold flex items-center gap-2",style:{background:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",color:"var(--error)"},children:[a.jsx("span",{children:"Error"}),a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"color-mix(in srgb, var(--error) 20%, var(--bg-secondary))"},children:e.error.code}),a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"color-mix(in srgb, var(--error) 20%, var(--bg-secondary))"},children:e.error.category})]}),a.jsxs("div",{className:"px-3 py-2 text-xs leading-normal",children:[a.jsx("div",{className:"font-semibold mb-2",style:{color:"var(--text-primary)"},children:e.error.title}),a.jsx("pre",{className:"whitespace-pre-wrap font-mono text-[11px] max-w-prose",style:{color:"var(--text-secondary)"},children:e.error.detail})]})]})]})}function Qi(){const{reloadPending:e,setReloadPending:t,setEntrypoints:n}=ve(),[r,i]=_.useState(!1);if(!e)return null;const s=async()=>{i(!0);try{await Ql();const o=await Zr();n(o.map(l=>l.name)),t(!1)}catch(o){console.error("Reload failed:",o)}finally{i(!1)}};return a.jsxs("div",{className:"fixed top-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-3 px-4 py-2 rounded-lg shadow-lg",style:{background:"var(--bg-secondary)",border:"1px solid var(--bg-tertiary)"},children:[a.jsx("span",{className:"text-xs",style:{color:"var(--text-secondary)"},children:"Files changed"}),a.jsx("button",{onClick:s,disabled:r,className:"px-2.5 py-0.5 text-xs font-medium rounded cursor-pointer",style:{background:"var(--accent)",color:"#fff",opacity:r?.6:1},children:r?"Reloading...":"Reload"}),a.jsx("button",{onClick:()=>t(!1),"aria-label":"Dismiss reload prompt",className:"text-xs cursor-pointer px-0.5",style:{color:"var(--text-muted)",background:"none",border:"none"},children:"✕"})]})}let hu=0;const eo=Ot(e=>({toasts:[],addToast:(t,n)=>{const r=String(++hu);e(s=>({toasts:[...s.toasts,{id:r,type:t,message:n}]})),setTimeout(()=>{e(s=>({toasts:s.toasts.filter(o=>o.id!==r)}))},t==="error"?8e3:5e3)},removeToast:t=>{e(n=>({toasts:n.toasts.filter(r=>r.id!==t)}))}})),to={success:{color:"var(--success)",bg:"color-mix(in srgb, var(--success) 10%, var(--bg-elevated))",border:"color-mix(in srgb, var(--success) 30%, var(--border))"},error:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 10%, var(--bg-elevated))",border:"color-mix(in srgb, var(--error) 30%, var(--border))"},info:{color:"var(--info)",bg:"color-mix(in srgb, var(--info) 10%, var(--bg-elevated))",border:"color-mix(in srgb, var(--info) 30%, var(--border))"}};function no(){const e=eo(n=>n.toasts),t=eo(n=>n.removeToast);return e.length===0?null:a.jsx("div",{className:"fixed bottom-8 right-4 z-[100] flex flex-col gap-2 pointer-events-none",children:e.map(n=>{const r=to[n.type]??to.info;return a.jsxs("div",{className:"pointer-events-auto flex items-center gap-2 px-4 py-2.5 rounded-lg shadow-lg text-xs font-medium max-w-xs animate-[slideIn_0.2s_ease-out]",style:{background:r.bg,border:`1px solid ${r.border}`,color:r.color},children:[a.jsx("span",{className:"flex-1",children:n.message}),a.jsx("button",{onClick:()=>t(n.id),className:"shrink-0 w-5 h-5 flex items-center justify-center rounded cursor-pointer transition-opacity opacity-60 hover:opacity-100",style:{color:r.color,background:"transparent",border:"none"},"aria-label":"Dismiss",children:a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[a.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),a.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9"})]})})]},n.id)})})}function bu(e){return e===null?"-":`${Math.round(e*100)}%`}function xu(e){if(e===null)return"var(--text-muted)";const t=e*100;return t>=80?"var(--success)":t>=50?"var(--warning)":"var(--error)"}const ro={pending:{color:"var(--text-muted)",label:"Pending"},running:{color:"var(--info)",label:"Running"},completed:{color:"var(--success)",label:"Completed"},failed:{color:"var(--error)",label:"Failed"}};function io(){const e=Me(l=>l.evalSets),t=Me(l=>l.evalRuns),{evalSetId:n,evalRunId:r,navigate:i}=st(),s=Object.values(e),o=Object.values(t).sort((l,u)=>new Date(u.start_time??0).getTime()-new Date(l.start_time??0).getTime());return a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a.jsx("button",{onClick:()=>i("#/evals/new"),className:"w-[calc(100%-24px)] mx-3 mt-2.5 mb-1 px-3 py-1.5 text-[11px] text-center font-medium rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-secondary)"},onMouseEnter:l=>{l.currentTarget.style.color="var(--text-primary)",l.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:l=>{l.currentTarget.style.color="var(--text-secondary)",l.currentTarget.style.borderColor=""},children:"+ New Eval Set"}),a.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Eval Sets"}),s.map(l=>{const u=n===l.id;return a.jsxs("button",{onClick:()=>i(`#/evals/sets/${l.id}`),className:"w-full text-left px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{background:u?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:u?"var(--text-primary)":"var(--text-secondary)",borderLeft:u?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:c=>{u||(c.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:c=>{u||(c.currentTarget.style.background="transparent")},children:[a.jsx("div",{className:"truncate font-medium",children:l.name}),a.jsxs("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-muted)"},children:[l.eval_count," items · ",l.evaluator_ids.length," evaluator",l.evaluator_ids.length!==1?"s":""]})]},l.id)}),s.length===0&&a.jsx("p",{className:"text-[11px] px-3 py-2",style:{color:"var(--text-muted)"},children:"No eval sets yet"}),a.jsx("div",{className:"px-3 pt-4 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"History"}),o.map(l=>{const u=r===l.id,c=ro[l.status]??ro.pending;return a.jsx("button",{onClick:()=>i(`#/evals/runs/${l.id}`),className:"w-full text-left px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{background:u?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:u?"var(--text-primary)":"var(--text-secondary)",borderLeft:u?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:d=>{u||(d.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:d=>{u||(d.currentTarget.style.background="transparent")},children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:c.color}}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"truncate font-medium",children:l.eval_set_name}),a.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-muted)"},children:l.start_time?new Date(l.start_time).toLocaleString():c.label})]}),a.jsx("span",{className:"font-mono shrink-0",style:{color:xu(l.overall_score)},children:bu(l.overall_score)})]})},l.id)}),o.length===0&&a.jsx("p",{className:"text-[11px] px-3 py-2",style:{color:"var(--text-muted)"},children:"No eval runs yet"})]})}function oo(e,t=60){const n=typeof e=="string"?e:JSON.stringify(e);return!n||n==="null"?"-":n.length>t?n.slice(0,t)+"...":n}function yu({evalSetId:e}){const[t,n]=_.useState(null),[r,i]=_.useState(!0),[s,o]=_.useState(null),[l,u]=_.useState(!1),[c,d]=_.useState("io"),p=Me(g=>g.evaluators),m=Me(g=>g.localEvaluators),f=Me(g=>g.updateEvalSetEvaluators),b=Me(g=>g.incrementEvalSetCount),h=Me(g=>g.upsertEvalRun),{navigate:v}=st(),[y,x]=_.useState(!1),[C,O]=_.useState(new Set),[j,N]=_.useState(!1),B=_.useRef(null),[D,R]=_.useState(()=>{const g=localStorage.getItem("evalSetSidebarWidth");return g?parseInt(g,10):320}),[S,T]=_.useState(!1),L=_.useRef(null);_.useEffect(()=>{localStorage.setItem("evalSetSidebarWidth",String(D))},[D]),_.useEffect(()=>{i(!0),o(null),fc(e).then(g=>{n(g),g.items.length>0&&o(g.items[0].name)}).catch(console.error).finally(()=>i(!1))},[e]);const M=async()=>{u(!0);try{const g=await mc(e);h(g),v(`#/evals/runs/${g.id}`)}catch(g){console.error(g)}finally{u(!1)}},w=async g=>{if(t)try{await pc(e,g),n(F=>{if(!F)return F;const $=F.items.filter(E=>E.name!==g);return{...F,items:$,eval_count:$.length}}),b(e,-1),s===g&&o(null)}catch(F){console.error(F)}},k=_.useCallback(()=>{t&&O(new Set(t.evaluator_ids)),x(!0)},[t]),I=g=>{O(F=>{const $=new Set(F);return $.has(g)?$.delete(g):$.add(g),$})},W=async()=>{if(t){N(!0);try{const g=await bc(e,Array.from(C));n(g),f(e,g.evaluator_ids),x(!1)}catch(g){console.error(g)}finally{N(!1)}}};_.useEffect(()=>{if(!y)return;const g=F=>{B.current&&!B.current.contains(F.target)&&x(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[y]);const U=_.useCallback(g=>{g.preventDefault(),T(!0);const F="touches"in g?g.touches[0].clientX:g.clientX,$=D,E=K=>{const H=L.current;if(!H)return;const re="touches"in K?K.touches[0].clientX:K.clientX,de=H.clientWidth-300,xe=Math.max(280,Math.min(de,$+(F-re)));R(xe)},ie=()=>{T(!1),document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",ie),document.removeEventListener("touchmove",E),document.removeEventListener("touchend",ie),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",E),document.addEventListener("mouseup",ie),document.addEventListener("touchmove",E,{passive:!1}),document.addEventListener("touchend",ie)},[D]);if(r)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-sm",children:"Loading..."});if(!t)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Eval set not found"});const q=t.items.find(g=>g.name===s)??null;return a.jsxs("div",{ref:L,className:"flex h-full",children:[a.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[a.jsxs("div",{className:"px-4 h-10 border-b shrink-0 flex items-center gap-4",style:{borderColor:"var(--border)"},children:[a.jsx("h1",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:t.name}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:[t.eval_count," items"]}),a.jsxs("div",{className:"flex gap-1 items-center ml-auto relative",children:[a.jsx("button",{onClick:k,className:"w-7 h-7 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:g=>{g.currentTarget.style.color="var(--text-primary)",g.currentTarget.style.background="var(--bg-secondary)"},onMouseLeave:g=>{g.currentTarget.style.color="var(--text-muted)",g.currentTarget.style.background="transparent"},title:"Edit evaluators","aria-label":"Edit evaluators",children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"}),a.jsx("path",{d:"m15 5 4 4"})]})}),t.evaluator_ids.map(g=>{const F=p.find($=>$.id===g);return a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[11px] font-medium",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:(F==null?void 0:F.name)??g},g)}),y&&a.jsxs("div",{ref:B,className:"absolute top-full right-0 mt-1 z-50 rounded-md border shadow-lg",style:{background:"var(--bg-primary)",borderColor:"var(--border)",minWidth:220},children:[a.jsx("div",{className:"px-3 py-2 border-b text-[10px] uppercase tracking-wide font-semibold",style:{color:"var(--text-muted)",borderColor:"var(--border)"},children:"Evaluators"}),a.jsx("div",{className:"max-h-48 overflow-y-auto",children:m.length===0?a.jsx("div",{className:"px-3 py-3 text-xs",style:{color:"var(--text-muted)"},children:"No evaluators available"}):m.map(g=>a.jsxs("label",{className:"flex items-center gap-2 px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--border)"},onMouseEnter:F=>{F.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:F=>{F.currentTarget.style.background="transparent"},children:[a.jsx("input",{type:"checkbox",checked:C.has(g.id),onChange:()=>I(g.id),className:"accent-[var(--accent)]"}),a.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:g.name})]},g.id))}),a.jsx("div",{className:"px-3 py-2 border-t flex justify-end",style:{borderColor:"var(--border)"},children:a.jsx("button",{onClick:W,disabled:j,className:"px-3 py-1 text-[11px] font-semibold rounded cursor-pointer transition-colors disabled:opacity-50",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},onMouseEnter:g=>{g.currentTarget.style.background="var(--accent-hover)"},onMouseLeave:g=>{g.currentTarget.style.background="var(--accent)"},children:j?"Saving...":"Update"})})]})]}),a.jsxs("button",{onClick:M,disabled:l,className:"ml-2 px-3 py-1 h-7 text-xs font-semibold rounded border flex items-center gap-1.5 cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--success)",borderColor:"var(--success)",background:"transparent"},onMouseEnter:g=>{l||(g.currentTarget.style.background="color-mix(in srgb, var(--success) 10%, transparent)")},onMouseLeave:g=>{g.currentTarget.style.background="transparent"},title:"Run eval set","aria-label":"Run eval set",children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:a.jsx("polygon",{points:"5,3 19,12 5,21"})}),l?"Running...":"Run"]})]}),a.jsxs("div",{className:"flex items-center px-3 h-7 text-[11px] font-semibold shrink-0 border-b",style:{color:"var(--text-muted)",background:"var(--bg-secondary)",borderColor:"var(--border)"},children:[a.jsx("span",{className:"w-56 shrink-0",children:"Name"}),a.jsx("span",{className:"flex-1 min-w-0",children:"Input"}),a.jsx("span",{className:"w-32 shrink-0 pl-2",children:"Expected Behavior"}),a.jsx("span",{className:"w-32 shrink-0 pl-2",children:"Expected Output"}),a.jsx("span",{className:"w-32 shrink-0 pl-2",children:"Simulation Instr."}),a.jsx("span",{className:"w-8 shrink-0"})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[t.items.map(g=>{const F=g.name===s;return a.jsxs("button",{onClick:()=>o(F?null:g.name),className:"group w-full text-left px-3 py-1.5 flex items-center text-xs border-b transition-colors cursor-pointer",style:{borderColor:"var(--border)",background:F?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:F?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:$=>{F||($.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:$=>{F||($.currentTarget.style.background="")},children:[a.jsx("span",{className:"w-56 shrink-0 truncate",style:{color:"var(--text-primary)"},children:g.name}),a.jsx("span",{className:"flex-1 min-w-0 truncate font-mono text-[11px]",style:{color:"var(--text-muted)"},children:oo(g.inputs)}),a.jsx("span",{className:"w-32 shrink-0 truncate pl-2 text-[11px]",style:{color:"var(--text-muted)"},children:g.expected_behavior||"-"}),a.jsx("span",{className:"w-32 shrink-0 truncate pl-2 font-mono text-[11px]",style:{color:"var(--text-muted)"},children:oo(g.expected_output,40)}),a.jsx("span",{className:"w-32 shrink-0 truncate pl-2 text-[11px]",style:{color:"var(--text-muted)"},children:g.simulation_instructions||"-"}),a.jsx("span",{role:"button",tabIndex:0,className:"w-8 shrink-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",onClick:$=>{$.stopPropagation(),w(g.name)},onKeyDown:$=>{$.key==="Enter"&&($.stopPropagation(),w(g.name))},style:{color:"var(--text-muted)"},onMouseEnter:$=>{$.currentTarget.style.color="var(--error)"},onMouseLeave:$=>{$.currentTarget.style.color="var(--text-muted)"},title:"Delete item",children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},g.name)}),t.items.length===0&&a.jsx("div",{className:"flex items-center justify-center py-8 text-[var(--text-muted)] text-xs",children:"No items in this eval set"})]})]}),a.jsx("div",{onMouseDown:U,onTouchStart:U,className:`shrink-0 drag-handle-col${S?"":" transition-all"}`,style:{width:q?3:0,opacity:q?1:0}}),a.jsxs("div",{className:`shrink-0 flex flex-col overflow-hidden${S?"":" transition-[width] duration-200 ease-in-out"}`,style:{width:q?D:0,background:"var(--bg-primary)"},children:[a.jsx("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",minWidth:D},children:["io","evaluators"].map(g=>{const F=c===g,$=g==="io"?"I/O":"Evaluators";return a.jsx("button",{onClick:()=>d(g),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded inline-flex items-center cursor-pointer transition-colors",style:{color:F?"var(--accent)":"var(--text-muted)",background:F?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent",border:"none"},children:$},g)})}),a.jsx("div",{className:"flex-1 overflow-hidden",style:{minWidth:D},children:q?c==="io"?a.jsx(vu,{item:q}):a.jsx(ku,{item:q,evaluators:p}):null})]})]})}function vu({item:e}){const t=JSON.stringify(e.inputs,null,2),n=e.expected_output!=null?typeof e.expected_output=="string"?e.expected_output:JSON.stringify(e.expected_output,null,2):null;return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx(_t,{title:"Input",copyText:t,children:a.jsx(ot,{json:t,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.expected_behavior&&a.jsx(_t,{title:"Expected Behavior",copyText:e.expected_behavior,children:a.jsx("div",{className:"px-3 py-2 text-xs leading-relaxed whitespace-pre-wrap",style:{color:"var(--text-secondary)"},children:e.expected_behavior})}),n&&a.jsx(_t,{title:"Expected Output",copyText:n,children:a.jsx(ot,{json:n,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.simulation_instructions&&a.jsx(_t,{title:"Simulation Instructions",copyText:e.simulation_instructions,children:a.jsx("div",{className:"px-3 py-2 text-xs leading-relaxed whitespace-pre-wrap",style:{color:"var(--text-secondary)"},children:e.simulation_instructions})})]})}function ku({item:e,evaluators:t}){return a.jsx("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:e.evaluator_ids.length>0?a.jsx(a.Fragment,{children:e.evaluator_ids.map(n=>{var s;const r=t.find(o=>o.id===n),i=(s=e.evaluation_criterias)==null?void 0:s[n];return a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:(r==null?void 0:r.name)??n}),a.jsx("span",{className:"ml-auto text-[10px]",style:{color:"var(--text-muted)"},children:i?"Custom criteria":"Default criteria"})]}),i&&a.jsx("pre",{className:"px-3 py-2 border-t text-[11px] font-mono overflow-x-auto max-h-32 whitespace-pre-wrap break-words",style:{borderColor:"var(--border)",color:"var(--text-secondary)"},children:JSON.stringify(i,null,2)})]},n)})}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:"No evaluators configured for this item"})})}function en(e){return e===null?"-":`${Math.round(e*100)}%`}function wt(e){if(e===null)return"var(--text-muted)";const t=e*100;return t>=80?"var(--success)":t>=50?"var(--warning)":"var(--error)"}function Eu(e,t){if(!e)return"-";const n=new Date(e).getTime(),r=t?new Date(t).getTime():Date.now(),i=Math.round((r-n)/1e3);return i<60?`${i}s`:`${Math.floor(i/60)}m ${i%60}s`}function so(e){return e.replace(/\s*Evaluator$/i,"")}const ao={pending:{color:"var(--text-muted)",bg:"var(--bg-tertiary)",label:"Pending"},running:{color:"var(--info)",bg:"rgba(59,130,246,0.1)",label:"Running"},completed:{color:"var(--success)",bg:"rgba(34,197,94,0.1)",label:"Completed"},failed:{color:"var(--error)",bg:"rgba(239,68,68,0.1)",label:"Failed"}};function wu({evalRunId:e,itemName:t}){const[n,r]=_.useState(null),[i,s]=_.useState(!0),{navigate:o}=st(),l=t??null,[u,c]=_.useState(220),d=_.useRef(null),p=_.useRef(!1),[m,f]=_.useState(()=>{const T=localStorage.getItem("evalSidebarWidth");return T?parseInt(T,10):320}),[b,h]=_.useState(!1),v=_.useRef(null);_.useEffect(()=>{localStorage.setItem("evalSidebarWidth",String(m))},[m]);const y=Me(T=>T.evalRuns[e]),x=Me(T=>T.evaluators);_.useEffect(()=>{s(!0),ji(e).then(T=>{if(r(T),!t){const L=T.results.find(M=>M.status==="completed")??T.results[0];L&&o(`#/evals/runs/${e}/${encodeURIComponent(L.name)}`)}}).catch(console.error).finally(()=>s(!1))},[e]),_.useEffect(()=>{((y==null?void 0:y.status)==="completed"||(y==null?void 0:y.status)==="failed")&&ji(e).then(r).catch(console.error)},[y==null?void 0:y.status,e]),_.useEffect(()=>{if(t||!(n!=null&&n.results))return;const T=n.results.find(L=>L.status==="completed")??n.results[0];T&&o(`#/evals/runs/${e}/${encodeURIComponent(T.name)}`)},[n==null?void 0:n.results]);const C=_.useCallback(T=>{T.preventDefault(),p.current=!0;const L="touches"in T?T.touches[0].clientY:T.clientY,M=u,w=I=>{if(!p.current)return;const W=d.current;if(!W)return;const U="touches"in I?I.touches[0].clientY:I.clientY,q=W.clientHeight-100,g=Math.max(80,Math.min(q,M+(U-L)));c(g)},k=()=>{p.current=!1,document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",w),document.removeEventListener("touchend",k),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",w),document.addEventListener("mouseup",k),document.addEventListener("touchmove",w,{passive:!1}),document.addEventListener("touchend",k)},[u]),O=_.useCallback(T=>{T.preventDefault(),h(!0);const L="touches"in T?T.touches[0].clientX:T.clientX,M=m,w=I=>{const W=v.current;if(!W)return;const U="touches"in I?I.touches[0].clientX:I.clientX,q=W.clientWidth-300,g=Math.max(280,Math.min(q,M+(L-U)));f(g)},k=()=>{h(!1),document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",w),document.removeEventListener("touchend",k),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",w),document.addEventListener("mouseup",k),document.addEventListener("touchmove",w,{passive:!1}),document.addEventListener("touchend",k)},[m]);if(i)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-sm",children:"Loading..."});if(!n)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Eval run not found"});const j=y??n,N=ao[j.status]??ao.pending,B=j.status==="running",D=Object.keys(j.evaluator_scores??{}),R=n.results.find(T=>T.name===l)??null,S=((R==null?void 0:R.traces)??[]).map(T=>({...T,run_id:""}));return a.jsxs("div",{ref:v,className:"flex h-full",children:[a.jsxs("div",{ref:d,className:"flex flex-col flex-1 min-w-0",children:[a.jsxs("div",{className:"px-4 h-10 border-b shrink-0 flex items-center gap-4",style:{borderColor:"var(--border)"},children:[a.jsx("h1",{className:"text-base font-semibold truncate min-w-0",style:{color:"var(--text-primary)"},children:j.eval_set_name}),a.jsx("span",{className:"px-2 py-0.5 rounded text-[11px] font-semibold uppercase tracking-wide",style:{color:N.color,background:N.bg},children:N.label}),a.jsx("span",{className:"text-sm font-bold font-mono",style:{color:wt(j.overall_score)},children:en(j.overall_score)}),a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:Eu(j.start_time,j.end_time)}),B&&a.jsxs("div",{className:"flex items-center gap-2 max-w-[160px]",children:[a.jsx("div",{className:"flex-1 h-2 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${j.progress_total>0?j.progress_completed/j.progress_total*100:0}%`,background:"var(--info)"}})}),a.jsxs("span",{className:"text-[11px] shrink-0",style:{color:"var(--text-muted)"},children:[j.progress_completed,"/",j.progress_total]})]}),D.length>0&&a.jsx("div",{className:"flex gap-3 ml-auto",children:D.map(T=>{const L=x.find(w=>w.id===T),M=j.evaluator_scores[T];return a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:so((L==null?void 0:L.name)??T)}),a.jsx("div",{className:"w-12 h-2 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${M*100}%`,background:wt(M)}})}),a.jsx("span",{className:"text-[11px] font-mono",style:{color:wt(M)},children:en(M)})]},T)})})]}),a.jsxs("div",{className:"shrink-0 overflow-hidden flex flex-col",style:{height:u},children:[a.jsxs("div",{className:"flex items-center px-3 h-7 text-[11px] font-semibold shrink-0 border-b",style:{color:"var(--text-muted)",background:"var(--bg-secondary)",borderColor:"var(--border)"},children:[a.jsx("span",{className:"w-5 shrink-0"}),a.jsx("span",{className:"flex-1 min-w-0",children:"Name"}),a.jsx("span",{className:"w-14 shrink-0 text-right",children:"Score"}),D.map(T=>{const L=x.find(M=>M.id===T);return a.jsx("span",{className:"w-36 shrink-0 text-right truncate pl-2",title:(L==null?void 0:L.name)??T,children:so((L==null?void 0:L.name)??T)},T)}),a.jsx("span",{className:"w-14 shrink-0 text-right",children:"Time"})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[n.results.map(T=>{const L=T.status==="pending",M=T.status==="failed",w=T.name===l;return a.jsxs("button",{onClick:()=>{o(w?`#/evals/runs/${e}`:`#/evals/runs/${e}/${encodeURIComponent(T.name)}`)},className:"w-full text-left px-3 py-1.5 flex items-center text-xs border-b transition-colors cursor-pointer",style:{borderColor:"var(--border)",background:w?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:w?"2px solid var(--accent)":"2px solid transparent",opacity:L?.5:1},onMouseEnter:k=>{w||(k.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:k=>{w||(k.currentTarget.style.background="")},children:[a.jsx("span",{className:"w-5 shrink-0 flex justify-center",children:a.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:L?"var(--text-muted)":M?"var(--error)":T.overall_score>=.8?"var(--success)":T.overall_score>=.5?"var(--warning)":"var(--error)"}})}),a.jsx("span",{className:"flex-1 min-w-0 truncate",style:{color:"var(--text-primary)"},children:T.name}),a.jsx("span",{className:"w-14 shrink-0 text-right font-mono font-semibold",style:{color:wt(L?null:T.overall_score)},children:L?"-":en(T.overall_score)}),D.map(k=>a.jsx("span",{className:"w-36 shrink-0 text-right font-mono pl-2",style:{color:wt(L?null:T.scores[k]??null)},children:L?"-":en(T.scores[k]??null)},k)),a.jsx("span",{className:"w-14 shrink-0 text-right",style:{color:"var(--text-muted)"},children:T.duration_ms!==null?`${(T.duration_ms/1e3).toFixed(1)}s`:"-"})]},T.name)}),n.results.length===0&&a.jsx("div",{className:"flex items-center justify-center py-8 text-[var(--text-muted)] text-xs",children:B?"Waiting for results...":"No results"})]})]}),a.jsx("div",{onMouseDown:C,onTouchStart:C,className:"shrink-0 drag-handle-row"}),a.jsx("div",{className:"flex-1 overflow-hidden",children:R&&S.length>0?a.jsx(Dr,{traces:S}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:(R==null?void 0:R.status)==="pending"?"Pending...":"No traces available"})})]}),a.jsx("div",{onMouseDown:O,onTouchStart:O,className:`shrink-0 drag-handle-col${b?"":" transition-all"}`,style:{width:R?3:0,opacity:R?1:0}}),a.jsx(Nu,{width:m,item:R,evaluators:x,isRunning:B,isDragging:b})]})}const _u=[{id:"score",label:"Score"},{id:"io",label:"I/O"},{id:"logs",label:"Logs"}];function Nu({width:e,item:t,evaluators:n,isRunning:r,isDragging:i}){const[s,o]=_.useState("score"),l=!!t;return a.jsxs("div",{className:`shrink-0 flex flex-col overflow-hidden${i?"":" transition-[width] duration-200 ease-in-out"}`,style:{width:l?e:0,background:"var(--bg-primary)"},children:[a.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",minWidth:e},children:[_u.map(u=>a.jsx("button",{onClick:()=>o(u.id),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded transition-colors cursor-pointer",style:{color:s===u.id?"var(--accent)":"var(--text-muted)",background:s===u.id?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent",border:"none"},onMouseEnter:c=>{s!==u.id&&(c.currentTarget.style.color="var(--text-primary)")},onMouseLeave:c=>{s!==u.id&&(c.currentTarget.style.color="var(--text-muted)")},children:u.label},u.id)),r&&a.jsx("span",{className:"ml-auto text-[11px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:"Running..."})]}),a.jsx("div",{className:"flex-1 overflow-y-auto",style:{minWidth:e},children:t?t.status==="pending"?a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:"Pending..."}):a.jsxs(a.Fragment,{children:[t.status==="failed"&&a.jsxs("div",{className:"mx-2 mt-2 px-3 py-2 rounded text-xs",style:{background:"rgba(239,68,68,0.1)",color:"var(--error)"},children:[a.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[a.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("path",{d:"M8 4.5v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("circle",{cx:"8",cy:"11",r:"0.75",fill:"currentColor"})]}),a.jsx("span",{children:"Evaluator error"})]}),t.error&&a.jsx("div",{className:"mt-1 pl-[22px] text-[11px] opacity-80 break-words",style:{color:"var(--text-secondary)"},children:t.error})]}),s==="score"?a.jsx(Su,{item:t,evaluators:n}):s==="io"?a.jsx(Tu,{item:t}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:"Logs coming soon"})]}):null})]})}function Su({item:e,evaluators:t}){const n=Object.keys(e.scores);return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"truncate text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"Overall"}),a.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[a.jsx("div",{className:"w-24 h-2.5 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${e.overall_score*100}%`,background:wt(e.overall_score)}})}),a.jsx("span",{className:"text-xs font-mono font-bold shrink-0 w-10 text-right",style:{color:wt(e.overall_score)},children:en(e.overall_score)})]})]})}),e.status==="failed"&&n.length===0&&a.jsx("div",{className:"px-3 py-3 text-xs text-center",style:{color:"var(--text-muted)"},children:"All evaluators failed — no scores available"}),n.map(r=>{const i=t.find(l=>l.id===r),s=e.scores[r],o=e.justifications[r];return a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"truncate text-[11px] font-semibold",style:{color:"var(--text-primary)"},title:(i==null?void 0:i.name)??r,children:(i==null?void 0:i.name)??r}),a.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[a.jsx("div",{className:"w-24 h-2.5 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${s*100}%`,background:wt(s)}})}),a.jsx("span",{className:"text-xs font-mono font-bold shrink-0 w-10 text-right",style:{color:wt(s)},children:en(s)})]})]}),o&&a.jsx(Au,{text:o})]},r)})]})}function Tu({item:e}){const t=JSON.stringify(e.inputs,null,2),n=typeof e.output=="string"?e.output:JSON.stringify(e.output,null,2),r=e.expected_output!=null?typeof e.expected_output=="string"?e.expected_output:JSON.stringify(e.expected_output,null,2):null;return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx(_t,{title:"Input",copyText:t,children:a.jsx(ot,{json:t,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),r&&a.jsx(_t,{title:"Expected Output",copyText:r,children:a.jsx(ot,{json:r,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),a.jsx(_t,{title:"Output",copyText:n,trailing:e.duration_ms!==null?a.jsxs("span",{className:"ml-auto text-[10px]",style:{color:"var(--text-muted)"},children:[(e.duration_ms/1e3).toFixed(2),"s"]}):void 0,children:a.jsx(ot,{json:n,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})})]})}function Cu(e){var i;const t=e.match(/expected="(.+?)"\s+actual="(.+?)"(.*)/s);if(!t)return null;const n={},r=((i=t[3])==null?void 0:i.trim())??"";if(r)for(const s of r.match(/(\w+)=([\S]+)/g)??[]){const o=s.indexOf("=");n[s.slice(0,o)]=s.slice(o+1)}return{expected:t[1],actual:t[2],meta:n}}function lo(e){try{const t=e.replace(/'/g,'"').replace(/\bTrue\b/g,"true").replace(/\bFalse\b/g,"false").replace(/\bNone\b/g,"null"),n=JSON.parse(t);return JSON.stringify(n,null,2)}catch{return e}}function Au({text:e}){const t=Cu(e);if(!t)return a.jsx("div",{className:"px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:a.jsx("div",{className:"text-xs leading-relaxed",style:{color:"var(--text-secondary)"},children:e})});const n=lo(t.expected),r=lo(t.actual),i=n===r;return a.jsxs("div",{className:"border-t",style:{borderColor:"var(--border)"},children:[a.jsxs("div",{className:"grid grid-cols-2 gap-0",children:[a.jsxs("div",{className:"px-3 py-2 border-r",style:{borderColor:"var(--border)"},children:[a.jsx("div",{className:"text-[10px] font-semibold mb-1",style:{color:"var(--text-muted)"},children:"Expected"}),a.jsx("pre",{className:"text-[11px] font-mono whitespace-pre-wrap break-words",style:{color:"var(--text-secondary)"},children:n})]}),a.jsxs("div",{className:"px-3 py-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[a.jsx("span",{className:"text-[10px] font-semibold",style:{color:"var(--text-muted)"},children:"Actual"}),a.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:i?"var(--success)":"var(--error)"}})]}),a.jsx("pre",{className:"text-[11px] font-mono whitespace-pre-wrap break-words",style:{color:i?"var(--success)":"var(--error)"},children:r})]})]}),Object.keys(t.meta).length>0&&a.jsx("div",{className:"px-3 py-1.5 border-t flex items-center gap-3",style:{borderColor:"var(--border)"},children:Object.entries(t.meta).map(([s,o])=>a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:[a.jsx("span",{className:"font-medium",children:s.replace(/_/g," ")})," ",a.jsx("span",{className:"font-mono",children:o})]},s))})]})}const co={deterministic:"var(--success)",llm:"#a78bfa",tool:"var(--info)"};function uo(){const e=Me(f=>f.localEvaluators),t=Me(f=>f.addEvalSet),{navigate:n}=st(),[r,i]=_.useState(""),[s,o]=_.useState(new Set),[l,u]=_.useState(null),[c,d]=_.useState(!1),p=f=>{o(b=>{const h=new Set(b);return h.has(f)?h.delete(f):h.add(f),h})},m=async()=>{if(r.trim()){u(null),d(!0);try{const f=await uc({name:r.trim(),evaluator_refs:Array.from(s)});t(f),n(`#/evals/sets/${f.id}`)}catch(f){u(f.detail||f.message||"Failed to create eval set")}finally{d(!1)}}};return a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"w-full max-w-xl px-6",children:[a.jsxs("div",{className:"mb-8 text-center",children:[a.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}}),a.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"New Eval Set"})]}),a.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"Create an evaluation set with a name and evaluators"})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Name"}),a.jsx("input",{type:"text",value:r,onChange:f=>i(f.target.value),placeholder:"e.g. Basic QA Tests",className:"w-full rounded-md px-3 py-2 text-xs",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},onKeyDown:f=>{f.key==="Enter"&&r.trim()&&m()}})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Evaluators"}),e.length===0?a.jsxs("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:["No evaluators configured."," ",a.jsx("button",{onClick:()=>n("#/evaluators/new"),className:"underline cursor-pointer",style:{color:"var(--accent)",background:"none",border:"none",padding:0,font:"inherit"},children:"Create one first"})]}):a.jsx("div",{className:"rounded-md border overflow-hidden",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:e.map(f=>a.jsxs("label",{className:"flex items-center gap-2.5 px-3 py-2 text-xs cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--border)"},onMouseEnter:b=>{b.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:b=>{b.currentTarget.style.background="transparent"},children:[a.jsx("input",{type:"checkbox",checked:s.has(f.id),onChange:()=>p(f.id),className:"accent-[var(--accent)]"}),a.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:f.name}),a.jsx("span",{className:"text-[11px] font-medium px-1.5 py-0.5 rounded",style:{background:`color-mix(in srgb, ${co[f.type]??"var(--text-muted)"} 15%, transparent)`,color:co[f.type]??"var(--text-muted)"},children:f.type})]},f.id))})]}),l&&a.jsx("p",{className:"text-xs mb-4 px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:l}),a.jsx("button",{onClick:m,disabled:!r.trim()||c,className:"w-full py-2 rounded-md text-[13px] font-semibold transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},children:c?"Creating...":"Create Eval Set"})]})})}const Mu=[{type:"deterministic",label:"Deterministic",badgeColor:"var(--success)"},{type:"llm",label:"LLM Judge",badgeColor:"#a78bfa"},{type:"tool",label:"Tool-Based",badgeColor:"var(--info)"}];function po(){const e=Me(s=>s.localEvaluators),{evaluatorFilter:t,evaluatorCreateType:n,navigate:r}=st(),i=!t&&!n;return a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>r("#/evaluators/new"),className:"mx-3 mt-2.5 mb-1 px-3 py-1.5 text-[11px] font-medium rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-secondary)"},onMouseEnter:s=>{s.currentTarget.style.color="var(--text-primary)",s.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:s=>{s.currentTarget.style.color="var(--text-secondary)",s.currentTarget.style.borderColor=""},children:"+ New Evaluator"}),a.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Categories"}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a.jsxs("button",{onClick:()=>r("#/evaluators"),className:"w-full text-left px-3 py-2 text-xs flex items-center gap-2 cursor-pointer transition-colors",style:{background:i?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:i?"var(--text-primary)":"var(--text-secondary)",borderLeft:i?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:s=>{i||(s.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:s=>{i||(s.currentTarget.style.background="transparent")},children:[a.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:"var(--text-muted)"}}),a.jsx("span",{className:"flex-1 truncate",children:"All"}),e.length>0&&a.jsx("span",{className:"text-[10px] px-1.5 rounded-full",style:{background:"var(--bg-tertiary)",color:"var(--text-muted)"},children:e.length})]}),Mu.map(s=>{const o=e.filter(u=>u.type===s.type).length,l=t===s.type;return a.jsxs("button",{onClick:()=>r(l?"#/evaluators":`#/evaluators/category/${s.type}`),className:"w-full text-left px-3 py-2 text-xs flex items-center gap-2 cursor-pointer transition-colors",style:{background:l?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:l?"var(--text-primary)":"var(--text-secondary)",borderLeft:l?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:u=>{l||(u.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:u=>{l||(u.currentTarget.style.background="transparent")},children:[a.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:s.badgeColor}}),a.jsx("span",{className:"flex-1 truncate",children:s.label}),o>0&&a.jsx("span",{className:"text-[10px] px-1.5 rounded-full",style:{background:"var(--bg-tertiary)",color:"var(--text-muted)"},children:o})]},s.type)})]})]})}const fo={deterministic:{label:"Deterministic",color:"var(--success)",bg:"rgba(34,197,94,0.1)"},llm:{label:"LLM Judge",color:"#a78bfa",bg:"rgba(167,139,250,0.1)"},tool:{label:"Tool-Based",color:"var(--info)",bg:"rgba(59,130,246,0.1)"}},Pr={deterministic:"Deterministic",llm:"LLM Judge",tool:"Tool-Based"},pn={deterministic:[{id:"uipath-exact-match",name:"Exact Match"},{id:"uipath-contains",name:"Contains"},{id:"uipath-json-similarity",name:"JSON Similarity"}],llm:[{id:"uipath-llm-judge-output-semantic-similarity",name:"LLM Judge Output"},{id:"uipath-llm-judge-output-strict-json-similarity",name:"LLM Judge Strict JSON"},{id:"uipath-llm-judge-trajectory-similarity",name:"LLM Judge Trajectory"},{id:"uipath-llm-judge-trajectory-simulation",name:"LLM Judge Trajectory Simulation"}],tool:[{id:"uipath-tool-call-order",name:"Tool Call Order"},{id:"uipath-tool-call-args",name:"Tool Call Args"},{id:"uipath-tool-call-count",name:"Tool Call Count"},{id:"uipath-tool-call-output",name:"Tool Call Output"}]};function Ls(e){return e.includes("trajectory")?{targetOutputKey:!1,prompt:!0}:e.includes("llm-judge")?{targetOutputKey:!0,prompt:!0}:e.includes("tool-call-output")?{targetOutputKey:!0,prompt:!1}:e.includes("exact-match")||e.includes("contains")||e.includes("json-similarity")?{targetOutputKey:!0,prompt:!1}:{targetOutputKey:!1,prompt:!1}}const fr={"uipath-exact-match":{description:"Checks whether the agent output exactly matches the expected output.",prompt:""},"uipath-contains":{description:"Checks whether the agent output contains the expected substring.",prompt:""},"uipath-json-similarity":{description:"Compares JSON structures for semantic similarity, ignoring key ordering and whitespace.",prompt:""},"uipath-llm-judge-output-semantic-similarity":{description:"Uses an LLM to score semantic similarity between the agent's actual output and the expected output, accounting for synonyms, paraphrases, and equivalent expressions.",prompt:`As an expert evaluator, analyze the semantic similarity between the expected and actual outputs and determine a score from 0 to 100. Focus on comparing meaning and contextual equivalence of corresponding fields, accounting for alternative valid expressions, synonyms, and reasonable variations in language while maintaining high standards for accuracy and completeness. Provide your score with a brief justification. ---- ExpectedOutput: {{ExpectedOutput}} @@ -68,41 +68,41 @@ ExpectedAgentBehavior: {{ExpectedAgentBehavior}} ---- AgentRunHistory: -{{AgentRunHistory}}`},"uipath-tool-call-order":{description:"Validates that the agent called tools in the expected sequence.",prompt:""},"uipath-tool-call-args":{description:"Checks whether the agent called tools with the expected arguments.",prompt:""},"uipath-tool-call-count":{description:"Validates that the agent made the expected number of tool calls.",prompt:""},"uipath-tool-call-output":{description:"Validates the output returned by the agent's tool calls.",prompt:""}};function Iu(e){for(const[t,n]of Object.entries(pn))if(n.some(r=>r.id===e))return t;return"deterministic"}function Ru({evaluatorId:e,evaluatorFilter:t}){const n=Me(w=>w.localEvaluators),r=Me(w=>w.setLocalEvaluators),i=Me(w=>w.upsertLocalEvaluator),s=Me(w=>w.evaluators),{navigate:o}=st(),l=e?n.find(w=>w.id===e)??null:null,u=!!l,c=t?n.filter(w=>w.type===t):n,[d,p]=N.useState(()=>{const w=localStorage.getItem("evaluatorSidebarWidth");return w?parseInt(w,10):320}),[m,f]=N.useState(!1),h=N.useRef(null);N.useEffect(()=>{localStorage.setItem("evaluatorSidebarWidth",String(d))},[d]),N.useEffect(()=>{Qr().then(r).catch(console.error)},[r]);const b=N.useCallback(w=>{w.preventDefault(),f(!0);const T="touches"in w?w.touches[0].clientX:w.clientX,j=d,O=P=>{const D=h.current;if(!D)return;const R="touches"in P?P.touches[0].clientX:P.clientX,S=D.clientWidth-300,M=Math.max(280,Math.min(S,j+(T-R)));p(M)},_=()=>{f(!1),document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",_),document.removeEventListener("touchmove",O),document.removeEventListener("touchend",_),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",O),document.addEventListener("mouseup",_),document.addEventListener("touchmove",O,{passive:!1}),document.addEventListener("touchend",_)},[d]),x=w=>{i(w)},y=()=>{o("#/evaluators")};return a.jsxs("div",{ref:h,className:"flex h-full",children:[a.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[a.jsxs("div",{className:"px-4 h-10 border-b shrink-0 flex items-center gap-4",style:{borderColor:"var(--border)"},children:[a.jsx("h1",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:"Evaluators"}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:[c.length,t?` / ${n.length}`:""," configured"]})]}),a.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:c.length===0?a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:n.length===0?"No evaluators configured yet.":"No evaluators in this category."}):a.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))"},children:c.map(w=>a.jsx(Ou,{evaluator:w,evaluators:s,selected:w.id===e,onClick:()=>o(w.id===e?"#/evaluators":`#/evaluators/${encodeURIComponent(w.id)}`)},w.id))})})]}),a.jsx("div",{onMouseDown:b,onTouchStart:b,className:`shrink-0 drag-handle-col${m?"":" transition-all"}`,style:{width:u?3:0,opacity:u?1:0}}),a.jsxs("div",{className:`shrink-0 flex flex-col overflow-hidden${m?"":" transition-[width] duration-200 ease-in-out"}`,style:{width:u?d:0,background:"var(--bg-primary)"},children:[a.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",minWidth:d},children:[a.jsx("span",{className:"px-2 py-0.5 h-7 text-xs font-semibold rounded inline-flex items-center",style:{color:"var(--accent)",background:"color-mix(in srgb, var(--accent) 10%, transparent)"},children:"Edit Evaluator"}),a.jsx("button",{onClick:y,"aria-label":"Close editor",className:"ml-auto w-7 h-7 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:w=>{w.currentTarget.style.color="var(--text-primary)"},onMouseLeave:w=>{w.currentTarget.style.color="var(--text-muted)"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsx("div",{className:"flex-1 overflow-hidden",style:{minWidth:d},children:l&&a.jsx(Lu,{evaluator:l,onUpdated:x})})]})]})}function Ou({evaluator:e,evaluators:t,selected:n,onClick:r}){const i=po[e.type]??po.deterministic,s=t.find(l=>l.id===e.evaluator_type_id),o=e.evaluator_type_id.startsWith("file://");return a.jsxs("div",{className:"rounded-md p-4 flex flex-col cursor-pointer transition-colors",style:{border:n?"1px solid var(--accent)":"1px solid var(--border)",background:n?"color-mix(in srgb, var(--accent) 5%, var(--card-bg))":"var(--card-bg)"},onClick:r,onMouseEnter:l=>{n||(l.currentTarget.style.borderColor="var(--text-muted)")},onMouseLeave:l=>{n||(l.currentTarget.style.borderColor="var(--border)")},children:[a.jsx("div",{className:"text-sm font-semibold",style:{color:"var(--text-primary)"},children:e.name}),e.description&&a.jsx("div",{className:"text-xs leading-relaxed mt-2",style:{color:"var(--text-secondary)"},children:e.description}),a.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-auto pt-3",children:[a.jsxs("span",{className:"px-2 py-0.5 rounded text-[10px] font-medium",style:{color:i.color,background:i.bg},children:["Category: ",i.label]}),a.jsxs("span",{className:"px-2 py-0.5 rounded text-[10px] font-medium",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:["Type: ",o?"Custom":(s==null?void 0:s.name)??e.evaluator_type_id]}),a.jsxs("span",{className:"px-2 py-0.5 rounded text-[10px] font-medium font-mono",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:["Target: ",e.target_output_key||"*"]})]})]})}function Lu({evaluator:e,onUpdated:t}){var O,_;const n=Iu(e.evaluator_type_id),r=pn[n]??[],[i,s]=N.useState(e.description),[o,l]=N.useState(e.evaluator_type_id),[u,c]=N.useState(((O=e.config)==null?void 0:O.targetOutputKey)??"*"),[d,p]=N.useState(((_=e.config)==null?void 0:_.prompt)??""),[m,f]=N.useState(!1),[h,b]=N.useState(null),[x,y]=N.useState(!1);N.useEffect(()=>{var P,D;s(e.description),l(e.evaluator_type_id),c(((P=e.config)==null?void 0:P.targetOutputKey)??"*"),p(((D=e.config)==null?void 0:D.prompt)??""),b(null),y(!1)},[e.id]);const w=Ls(o),T=async()=>{f(!0),b(null),y(!1);try{const P={};w.targetOutputKey&&(P.targetOutputKey=u),w.prompt&&d.trim()&&(P.prompt=d);const D=await xc(e.id,{description:i.trim(),evaluator_type_id:o,config:P});t(D),y(!0),setTimeout(()=>y(!1),2e3)}catch(P){const D=P==null?void 0:P.detail;b(D??"Failed to update evaluator")}finally{f(!1)}},j={background:"var(--bg-secondary)",color:"var(--text-primary)",border:"1px solid var(--border)"};return a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"p-4 overflow-y-auto flex-1 space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Name"}),a.jsx("div",{className:"px-3 py-2 rounded-lg text-xs",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:e.name})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Category"}),a.jsx("div",{className:"px-3 py-2 rounded-lg text-xs",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:Pr[n]??n})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Type"}),a.jsx("select",{value:o,onChange:P=>l(P.target.value),className:"w-full px-3 py-2 rounded-lg text-xs outline-none cursor-pointer",style:j,children:r.map(P=>a.jsx("option",{value:P.id,children:P.name},P.id))})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Description"}),a.jsx("textarea",{value:i,onChange:P=>s(P.target.value),placeholder:"What does this evaluator check?",rows:4,className:"w-full px-3 py-2 rounded-lg text-xs leading-relaxed outline-none resize-y",style:j})]}),w.targetOutputKey&&a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Target Output Key"}),a.jsx("input",{type:"text",value:u,onChange:P=>c(P.target.value),placeholder:"*",className:"w-full px-3 py-2 rounded-lg text-xs outline-none",style:j}),a.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-muted)"},children:"Use * for entire output or a specific key name"})]}),w.prompt&&a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Prompt"}),a.jsx("textarea",{value:d,onChange:P=>p(P.target.value),placeholder:"Evaluation prompt for the LLM judge...",rows:8,className:"w-full px-3 py-2 rounded-lg text-xs font-mono leading-relaxed outline-none resize-y",style:j})]})]}),a.jsxs("div",{className:"shrink-0 p-4 space-y-2",children:[h&&a.jsx("div",{className:"text-xs px-3 py-2 rounded-lg",style:{background:"rgba(239,68,68,0.1)",color:"var(--error)"},children:h}),x&&a.jsx("div",{className:"text-xs px-3 py-2 rounded-lg",style:{background:"rgba(34,197,94,0.1)",color:"var(--success)"},children:"Saved successfully"}),a.jsx("button",{onClick:T,disabled:m,className:"w-full py-2.5 text-xs font-semibold rounded-md border cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed transition-colors",style:{background:"transparent",borderColor:"var(--accent)",color:"var(--accent)"},onMouseEnter:P=>{P.currentTarget.style.background="color-mix(in srgb, var(--accent) 15%, transparent)"},onMouseLeave:P=>{P.currentTarget.style.background="transparent"},children:m?"Saving...":"Save Changes"})]})]})}const ju=["deterministic","llm","tool"];function Du({category:e}){var v;const t=Me(E=>E.addLocalEvaluator),{navigate:n}=st(),r=e!=="any",[i,s]=N.useState(r?e:"deterministic"),o=pn[i]??[],[l,u]=N.useState(""),[c,d]=N.useState(""),[p,m]=N.useState(((v=o[0])==null?void 0:v.id)??""),[f,h]=N.useState("*"),[b,x]=N.useState(""),[y,w]=N.useState(!1),[T,j]=N.useState(null),[O,_]=N.useState(!1),[P,D]=N.useState(!1);N.useEffect(()=>{var V;const E=r?e:"deterministic";s(E);const H=((V=(pn[E]??[])[0])==null?void 0:V.id)??"",U=fr[H];u(""),d((U==null?void 0:U.description)??""),m(H),h("*"),x((U==null?void 0:U.prompt)??""),j(null),_(!1),D(!1)},[e,r]);const R=E=>{var V;s(E);const H=((V=(pn[E]??[])[0])==null?void 0:V.id)??"",U=fr[H];m(H),O||d((U==null?void 0:U.description)??""),P||x((U==null?void 0:U.prompt)??"")},S=E=>{m(E);const I=fr[E];I&&(O||d(I.description),P||x(I.prompt))},M=Ls(p),L=async()=>{if(!l.trim()){j("Name is required");return}w(!0),j(null);try{const E={};M.targetOutputKey&&(E.targetOutputKey=f),M.prompt&&b.trim()&&(E.prompt=b);const I=await hc({name:l.trim(),description:c.trim(),evaluator_type_id:p,config:E});t(I),n("#/evaluators")}catch(E){const I=E==null?void 0:E.detail;j(I??"Failed to create evaluator")}finally{w(!1)}},C={background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"};return a.jsx("div",{className:"h-full overflow-y-auto",children:a.jsx("div",{className:"flex items-center justify-center min-h-full py-8",children:a.jsxs("div",{className:"w-full max-w-xl px-6",children:[a.jsxs("div",{className:"mb-8 text-center",children:[a.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}}),a.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"New Evaluator"})]}),a.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"Create an evaluator to score agent outputs"})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Name"}),a.jsx("input",{type:"text",value:l,onChange:E=>u(E.target.value),placeholder:"e.g. MyEvaluator",className:"w-full rounded-md px-3 py-2 text-xs",style:C,onKeyDown:E=>{E.key==="Enter"&&l.trim()&&L()}})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Category"}),r?a.jsx("div",{className:"px-3 py-2 rounded-md text-xs",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:Pr[i]??i}):a.jsx("select",{value:i,onChange:E=>R(E.target.value),className:"w-full rounded-md px-3 py-2 text-xs cursor-pointer appearance-auto",style:C,children:ju.map(E=>a.jsx("option",{value:E,children:Pr[E]},E))})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Type"}),a.jsx("select",{value:p,onChange:E=>S(E.target.value),className:"w-full rounded-md px-3 py-2 text-xs cursor-pointer appearance-auto",style:C,children:o.map(E=>a.jsx("option",{value:E.id,children:E.name},E.id))})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Description"}),a.jsx("textarea",{value:c,onChange:E=>{d(E.target.value),_(!0)},placeholder:"What does this evaluator check?",rows:3,className:"w-full rounded-md px-3 py-2 text-xs leading-relaxed resize-y",style:C})]}),M.targetOutputKey&&a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Target Output Key"}),a.jsx("input",{type:"text",value:f,onChange:E=>h(E.target.value),placeholder:"*",className:"w-full rounded-md px-3 py-2 text-xs",style:C}),a.jsx("div",{className:"text-xs mt-1",style:{color:"var(--text-muted)"},children:"Use * for entire output or a specific key name"})]}),M.prompt&&a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Prompt"}),a.jsx("textarea",{value:b,onChange:E=>{x(E.target.value),D(!0)},placeholder:"Evaluation prompt for the LLM judge...",rows:6,className:"w-full rounded-md px-3 py-2 text-xs font-mono leading-relaxed resize-y",style:C})]}),T&&a.jsx("p",{className:"text-xs mb-4 px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:T}),a.jsx("button",{onClick:L,disabled:y||!l.trim(),className:"w-full py-2 rounded-md text-[13px] font-semibold transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},children:y?"Creating...":"Create Evaluator"})]})})})}function js({path:e,name:t,type:n,depth:r}){const i=be(w=>w.children[e]),s=be(w=>!!w.expanded[e]),o=be(w=>!!w.loadingDirs[e]),l=be(w=>!!w.dirty[e]),u=be(w=>!!w.agentChangedFiles[e]),c=be(w=>w.selectedFile),{setChildren:d,toggleExpanded:p,setLoadingDir:m,openTab:f}=be(),{navigate:h}=st(),b=n==="directory",x=!b&&c===e,y=N.useCallback(()=>{b?(!i&&!o&&(m(e,!0),$n(e).then(w=>d(e,w)).catch(console.error).finally(()=>m(e,!1))),p(e)):(f(e),h(`#/explorer/file/${encodeURIComponent(e)}`))},[b,i,o,e,d,p,m,f,h]);return a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:y,className:`w-full text-left flex items-center gap-1 py-[3px] text-[13px] cursor-pointer transition-colors group${u?" agent-changed-file":""}`,style:{paddingLeft:`${12+r*16}px`,paddingRight:"8px",background:x?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:x?"var(--text-primary)":"var(--text-secondary)",border:"none"},onMouseEnter:w=>{x||(w.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:w=>{x||(w.currentTarget.style.background="transparent")},children:[a.jsx("span",{className:"w-3 shrink-0 flex items-center justify-center",style:{color:"var(--text-muted)"},children:b&&a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",style:{transform:s?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s"},children:a.jsx("path",{d:"M3 1.5L7 5L3 8.5z"})})}),a.jsx("span",{className:"shrink-0",style:{color:b?"var(--accent)":"var(--text-muted)"},children:b?a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}):a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"})]})}),a.jsx("span",{className:"truncate flex-1",children:t}),l&&a.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{background:"var(--accent)"}}),o&&a.jsx("span",{className:"text-[10px] shrink-0",style:{color:"var(--text-muted)"},children:"..."})]}),b&&s&&i&&i.map(w=>a.jsx(js,{path:w.path,name:w.name,type:w.type,depth:r+1},w.path))]})}function fo(){const e=be(n=>n.children[""]),{setChildren:t}=be();return N.useEffect(()=>{e||$n("").then(n=>t("",n)).catch(console.error)},[e,t]),a.jsx("div",{className:"flex-1 overflow-y-auto py-1",children:e?e.map(n=>a.jsx(js,{path:n.path,name:n.name,type:n.type,depth:0},n.path)):a.jsx("p",{className:"text-[11px] px-3 py-2",style:{color:"var(--text-muted)"},children:"Loading..."})})}const mo=e=>{e.editor.defineTheme("uipath-dark",{base:"vs-dark",inherit:!0,rules:[{token:"comment",foreground:"64748b",fontStyle:"italic"},{token:"keyword",foreground:"c084fc"},{token:"string",foreground:"86efac"},{token:"number",foreground:"fcd34d"},{token:"type",foreground:"7dd3fc"}],colors:{"editor.background":"#0f172a","editor.foreground":"#cbd5e1","editor.lineHighlightBackground":"#1e293b","editor.selectionBackground":"#334155","editor.inactiveSelectionBackground":"#263348","editorLineNumber.foreground":"#64748b","editorLineNumber.activeForeground":"#94a3b8","editorCursor.foreground":"#fa4616","editorIndentGuide.background":"#334155","editorIndentGuide.activeBackground":"#64748b","editorWidget.background":"#1e293b","editorWidget.border":"#334155","editorSuggestWidget.background":"#1e293b","editorSuggestWidget.border":"#334155","editorSuggestWidget.selectedBackground":"#263348","editorHoverWidget.background":"#1e293b","editorHoverWidget.border":"#334155","scrollbarSlider.background":"#33415580","scrollbarSlider.hoverBackground":"#33415599","scrollbarSlider.activeBackground":"#334155cc"}}),e.editor.defineTheme("uipath-light",{base:"vs",inherit:!0,rules:[{token:"comment",foreground:"94a3b8",fontStyle:"italic"},{token:"keyword",foreground:"7c3aed"},{token:"string",foreground:"16a34a"},{token:"number",foreground:"d97706"},{token:"type",foreground:"0284c7"}],colors:{"editor.background":"#f8fafc","editor.foreground":"#0f172a","editor.lineHighlightBackground":"#f1f5f9","editor.selectionBackground":"#e2e8f0","editor.inactiveSelectionBackground":"#f1f5f9","editorLineNumber.foreground":"#94a3b8","editorLineNumber.activeForeground":"#475569","editorCursor.foreground":"#fa4616","editorIndentGuide.background":"#e2e8f0","editorIndentGuide.activeBackground":"#94a3b8","editorWidget.background":"#ffffff","editorWidget.border":"#e2e8f0","editorSuggestWidget.background":"#ffffff","editorSuggestWidget.border":"#e2e8f0","editorSuggestWidget.selectedBackground":"#f1f5f9","editorHoverWidget.background":"#ffffff","editorHoverWidget.border":"#e2e8f0","scrollbarSlider.background":"#d1d5db80","scrollbarSlider.hoverBackground":"#d1d5db99","scrollbarSlider.activeBackground":"#d1d5dbcc"}})};function go(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Pu(e){const t=e.replace(/\\/g,"/").split("/");return t[t.length-1]||e}function Bu(){const e=be(C=>C.openTabs),n=be(C=>C.selectedFile),r=be(C=>n?C.fileCache[n]:void 0),i=be(C=>n?!!C.dirty[n]:!1),s=be(C=>n?C.buffers[n]:void 0),o=be(C=>C.loadingFile),l=be(C=>C.dirty),u=be(C=>C.diffView),c=be(C=>n?!!C.agentChangedFiles[n]:!1),{setFileContent:d,updateBuffer:p,markClean:m,setLoadingFile:f,openTab:h,closeTab:b,setDiffView:x}=be(),{navigate:y}=st(),w=Ss(C=>C.theme),T=N.useRef(null),{explorerFile:j}=st();N.useEffect(()=>{j&&h(j)},[j,h]),N.useEffect(()=>{n&&(be.getState().fileCache[n]||(f(!0),Lr(n).then(C=>d(n,C)).catch(console.error).finally(()=>f(!1))))},[n,d,f]);const O=N.useCallback(()=>{if(!n)return;const C=be.getState().fileCache[n],E=be.getState().buffers[n]??(C==null?void 0:C.content);E!=null&&Xl(n,E).then(()=>{m(n),d(n,{...C,content:E})}).catch(console.error)},[n,m,d]);N.useEffect(()=>{const C=v=>{(v.ctrlKey||v.metaKey)&&v.key==="s"&&(v.preventDefault(),O())};return window.addEventListener("keydown",C),()=>window.removeEventListener("keydown",C)},[O]);const _=C=>{T.current=C},P=N.useCallback(C=>{C!==void 0&&n&&p(n,C)},[n,p]),D=N.useCallback(C=>{h(C),y(`#/explorer/file/${encodeURIComponent(C)}`)},[h,y]),R=N.useCallback((C,v)=>{C.stopPropagation();const E=be.getState(),I=E.openTabs.filter(H=>H!==v);if(b(v),E.selectedFile===v){const H=E.openTabs.indexOf(v),U=I[Math.min(H,I.length-1)];y(U?`#/explorer/file/${encodeURIComponent(U)}`:"#/explorer")}},[b,y]),S=N.useCallback((C,v)=>{C.button===1&&R(C,v)},[R]),M=e.length>0&&a.jsx("div",{className:"h-10 flex items-end overflow-x-auto shrink-0",style:{background:"var(--bg-secondary)",borderBottom:"1px solid var(--border)"},children:e.map(C=>{const v=C===n,E=!!l[C];return a.jsxs("button",{onClick:()=>D(C),onMouseDown:I=>S(I,C),className:"h-full flex items-center gap-1.5 px-3 text-[12px] shrink-0 cursor-pointer transition-colors relative",style:{background:v?"var(--bg-primary)":"transparent",color:v?"var(--text-primary)":"var(--text-secondary)",border:"none",borderBottom:v?"2px solid var(--accent)":"2px solid transparent",maxWidth:"180px"},onMouseEnter:I=>{v||(I.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:I=>{v||(I.currentTarget.style.background="transparent")},children:[a.jsx("span",{className:"truncate",children:Pu(C)}),E?a.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{background:"var(--accent)"},title:"Unsaved changes"}):a.jsx("span",{className:"w-4 h-4 flex items-center justify-center rounded shrink-0 transition-colors",style:{color:"var(--text-muted)"},onClick:I=>R(I,C),onMouseEnter:I=>{I.currentTarget.style.background="var(--bg-hover)",I.currentTarget.style.color="var(--text-primary)"},onMouseLeave:I=>{I.currentTarget.style.background="transparent",I.currentTarget.style.color="var(--text-muted)"},children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",children:a.jsx("path",{d:"M8 8.707l3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.708.708L7.293 8l-3.647 3.646.708.708L8 8.707z"})})})]},C)})});if(!n)return a.jsxs("div",{className:"flex flex-col h-full",children:[M,a.jsx("div",{className:"flex-1 flex items-center justify-center",style:{color:"var(--text-muted)"},children:"Select a file to view"})]});if(o&&!r)return a.jsxs("div",{className:"flex flex-col h-full",children:[M,a.jsx("div",{className:"flex-1 flex items-center justify-center",style:{color:"var(--text-muted)"},children:a.jsx("div",{className:"text-sm",children:"Loading file..."})})]});if(!r&&!o)return a.jsxs("div",{className:"flex flex-col h-full",children:[M,a.jsx("div",{className:"flex-1 flex items-center justify-center",style:{color:"var(--text-muted)"},children:a.jsx("div",{className:"text-sm",children:"Failed to load file"})})]});if(!r)return null;if(r.binary)return a.jsxs("div",{className:"flex flex-col h-full",children:[M,a.jsx("div",{className:"h-8 flex items-center px-3 gap-2 text-xs shrink-0 border-b",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:a.jsx("span",{style:{color:"var(--text-muted)"},children:go(r.size)})}),a.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3",style:{color:"var(--text-muted)"},children:[a.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"}),a.jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),a.jsx("span",{className:"text-sm",children:"Binary file — preview not available"})]})]});const L=u&&u.path===n;return a.jsxs("div",{className:"flex flex-col h-full",children:[M,a.jsxs("div",{className:"h-8 flex items-center px-3 gap-2 text-xs shrink-0 border-b",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[r.language&&a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px]",style:{background:"var(--bg-hover)",color:"var(--text-muted)"},children:r.language}),a.jsx("span",{style:{color:"var(--text-muted)"},children:go(r.size)}),c&&a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium",style:{background:"color-mix(in srgb, var(--info) 20%, transparent)",color:"var(--info)"},children:"Agent modified"}),a.jsx("div",{className:"flex-1"}),i&&a.jsx("span",{className:"text-[10px] font-medium",style:{color:"var(--accent)"},children:"Modified"}),a.jsx("button",{onClick:O,className:"px-2 py-0.5 rounded text-[11px] font-medium cursor-pointer transition-colors",style:{background:i?"var(--accent)":"var(--bg-hover)",color:i?"white":"var(--text-muted)",border:"none"},children:"Save"})]}),L&&a.jsxs("div",{className:"h-8 flex items-center px-3 gap-2 text-xs shrink-0 border-b",style:{borderColor:"var(--border)",background:"color-mix(in srgb, var(--info) 10%, var(--bg-secondary))"},children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--info)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),a.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),a.jsx("span",{style:{color:"var(--info)"},children:"Agent modified this file"}),a.jsx("div",{className:"flex-1"}),a.jsx("button",{onClick:()=>x(null),className:"px-2 py-0.5 rounded text-[11px] font-medium cursor-pointer transition-colors",style:{background:"var(--bg-hover)",color:"var(--text-secondary)",border:"none"},children:"Dismiss"})]}),a.jsx("div",{className:"flex-1 overflow-hidden",children:L?a.jsx(Cl,{original:u.original,modified:u.modified,language:u.language??"plaintext",theme:w==="dark"?"uipath-dark":"uipath-light",beforeMount:mo,options:{readOnly:!0,minimap:{enabled:!1},fontSize:13,lineNumbersMinChars:4,scrollBeyondLastLine:!1,automaticLayout:!0,renderSideBySide:!0}},`diff-${n}`):a.jsx(Al,{language:r.language??"plaintext",theme:w==="dark"?"uipath-dark":"uipath-light",value:s??r.content??"",onChange:P,beforeMount:mo,onMount:_,options:{minimap:{enabled:!1},fontSize:13,lineNumbersMinChars:4,scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0,tabSize:2,renderWhitespace:"selection"}},n)})]})}const Zn="/api";async function Fu(){const e=await fetch(`${Zn}/agent/models`);if(!e.ok){if(e.status===401)return[];throw new Error(`HTTP ${e.status}`)}return e.json()}async function zu(e){const t=await fetch(`${Zn}/agent/session/${e}/diagnostics`);if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}async function $u(e){const t=await fetch(`${Zn}/agent/session/${e}/state`);if(t.status===404)return null;if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}async function Uu(){const e=await fetch(`${Zn}/agent/skills`);if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}function Hu(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Wu=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ku=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gu={};function ho(e,t){return(Gu.jsx?Ku:Wu).test(e)}const qu=/[ \t\n\f\r]/g;function Vu(e){return typeof e=="object"?e.type==="text"?bo(e.value):!1:bo(e)}function bo(e){return e.replace(qu,"")===""}class xn{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}xn.prototype.normal={};xn.prototype.property={};xn.prototype.space=void 0;function Ds(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new xn(n,r,t)}function Br(e){return e.toLowerCase()}class Xe{constructor(t,n){this.attribute=n,this.property=t}}Xe.prototype.attribute="";Xe.prototype.booleanish=!1;Xe.prototype.boolean=!1;Xe.prototype.commaOrSpaceSeparated=!1;Xe.prototype.commaSeparated=!1;Xe.prototype.defined=!1;Xe.prototype.mustUseProperty=!1;Xe.prototype.number=!1;Xe.prototype.overloadedBoolean=!1;Xe.prototype.property="";Xe.prototype.spaceSeparated=!1;Xe.prototype.space=void 0;let Yu=0;const pe=Kt(),Pe=Kt(),Fr=Kt(),q=Kt(),Ae=Kt(),tn=Kt(),Qe=Kt();function Kt(){return 2**++Yu}const zr=Object.freeze(Object.defineProperty({__proto__:null,boolean:pe,booleanish:Pe,commaOrSpaceSeparated:Qe,commaSeparated:tn,number:q,overloadedBoolean:Fr,spaceSeparated:Ae},Symbol.toStringTag,{value:"Module"})),mr=Object.keys(zr);class ei extends Xe{constructor(t,n,r,i){let s=-1;if(super(t,n),xo(this,"space",i),typeof r=="number")for(;++s4&&n.slice(0,4)==="data"&&ed.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(yo,rd);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!yo.test(s)){let o=s.replace(Qu,nd);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=ei}return new i(r,t)}function nd(e){return"-"+e.toLowerCase()}function rd(e){return e.charAt(1).toUpperCase()}const id=Ds([Ps,Xu,zs,$s,Us],"html"),ti=Ds([Ps,Zu,zs,$s,Us],"svg");function od(e){return e.join(" ").trim()}var Yt={},gr,vo;function sd(){if(vo)return gr;vo=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,u=` -`,c="/",d="*",p="",m="comment",f="declaration";function h(x,y){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];y=y||{};var w=1,T=1;function j(v){var E=v.match(t);E&&(w+=E.length);var I=v.lastIndexOf(u);T=~I?v.length-I:T+v.length}function O(){var v={line:w,column:T};return function(E){return E.position=new _(v),R(),E}}function _(v){this.start=v,this.end={line:w,column:T},this.source=y.source}_.prototype.content=x;function P(v){var E=new Error(y.source+":"+w+":"+T+": "+v);if(E.reason=v,E.filename=y.source,E.line=w,E.column=T,E.source=x,!y.silent)throw E}function D(v){var E=v.exec(x);if(E){var I=E[0];return j(I),x=x.slice(I.length),E}}function R(){D(n)}function S(v){var E;for(v=v||[];E=M();)E!==!1&&v.push(E);return v}function M(){var v=O();if(!(c!=x.charAt(0)||d!=x.charAt(1))){for(var E=2;p!=x.charAt(E)&&(d!=x.charAt(E)||c!=x.charAt(E+1));)++E;if(E+=2,p===x.charAt(E-1))return P("End of comment missing");var I=x.slice(2,E-2);return T+=2,j(I),x=x.slice(E),T+=2,v({type:m,comment:I})}}function L(){var v=O(),E=D(r);if(E){if(M(),!D(i))return P("property missing ':'");var I=D(s),H=v({type:f,property:b(E[0].replace(e,p)),value:I?b(I[0].replace(e,p)):p});return D(o),H}}function C(){var v=[];S(v);for(var E;E=L();)E!==!1&&(v.push(E),S(v));return v}return R(),C()}function b(x){return x?x.replace(l,p):p}return gr=h,gr}var ko;function ad(){if(ko)return Yt;ko=1;var e=Yt&&Yt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.default=n;const t=e(sd());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const o=(0,t.default)(r),l=typeof i=="function";return o.forEach(u=>{if(u.type!=="declaration")return;const{property:c,value:d}=u;l?i(c,d,u):d&&(s=s||{},s[c]=d)}),s}return Yt}var an={},Eo;function ld(){if(Eo)return an;Eo=1,Object.defineProperty(an,"__esModule",{value:!0}),an.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(c){return!c||n.test(c)||e.test(c)},o=function(c,d){return d.toUpperCase()},l=function(c,d){return"".concat(d,"-")},u=function(c,d){return d===void 0&&(d={}),s(c)?c:(c=c.toLowerCase(),d.reactCompat?c=c.replace(i,l):c=c.replace(r,l),c.replace(t,o))};return an.camelCase=u,an}var ln,wo;function cd(){if(wo)return ln;wo=1;var e=ln&&ln.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(ad()),n=ld();function r(i,s){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(l,u){l&&u&&(o[(0,n.camelCase)(l,s)]=u)}),o}return r.default=r,ln=r,ln}var ud=cd();const dd=Xr(ud),Hs=Ws("end"),ni=Ws("start");function Ws(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function pd(e){const t=ni(e),n=Hs(e);if(t&&n)return{start:t,end:n}}function fn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?_o(e.position):"start"in e||"end"in e?_o(e):"line"in e||"column"in e?$r(e):""}function $r(e){return No(e&&e.line)+":"+No(e&&e.column)}function _o(e){return $r(e&&e.start)+"-"+$r(e&&e.end)}function No(e){return e&&typeof e=="number"?e:1}class We extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=fn(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}We.prototype.file="";We.prototype.name="";We.prototype.reason="";We.prototype.message="";We.prototype.stack="";We.prototype.column=void 0;We.prototype.line=void 0;We.prototype.ancestors=void 0;We.prototype.cause=void 0;We.prototype.fatal=void 0;We.prototype.place=void 0;We.prototype.ruleId=void 0;We.prototype.source=void 0;const ri={}.hasOwnProperty,fd=new Map,md=/[A-Z]/g,gd=new Set(["table","tbody","thead","tfoot","tr"]),hd=new Set(["td","th"]),Ks="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function bd(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Nd(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=_d(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ti:id,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=Gs(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function Gs(e,t,n){if(t.type==="element")return xd(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return yd(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return kd(e,t,n);if(t.type==="mdxjsEsm")return vd(e,t);if(t.type==="root")return Ed(e,t,n);if(t.type==="text")return wd(e,t)}function xd(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ti,e.schema=i),e.ancestors.push(t);const s=Vs(e,t.tagName,!1),o=Sd(e,t);let l=oi(e,t);return gd.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!Vu(u):!0})),qs(e,o,s,t),ii(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function yd(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}hn(e,t.position)}function vd(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);hn(e,t.position)}function kd(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ti,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Vs(e,t.name,!0),o=Td(e,t),l=oi(e,t);return qs(e,o,s,t),ii(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function Ed(e,t,n){const r={};return ii(r,oi(e,t)),e.create(t,e.Fragment,r,n)}function wd(e,t){return t.value}function qs(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ii(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function _d(e,t,n){return r;function r(i,s,o,l){const c=Array.isArray(o.children)?n:t;return l?c(s,o,l):c(s,o)}}function Nd(e,t){return n;function n(r,i,s,o){const l=Array.isArray(s.children),u=ni(r);return t(i,s,o,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Sd(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ri.call(t.properties,i)){const s=Cd(e,i,t.properties[i]);if(s){const[o,l]=s;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&hd.has(t.tagName)?r=l:n[o]=l}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Td(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else hn(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else hn(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function oi(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:fd;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s0?(et(e,e.length,0,t),e):t}const Co={}.hasOwnProperty;function Xs(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function dt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ve=Dt(/[A-Za-z]/),He=Dt(/[\dA-Za-z]/),Pd=Dt(/[#-'*+\--9=?A-Z^-~]/);function Hn(e){return e!==null&&(e<32||e===127)}const Ur=Dt(/\d/),Bd=Dt(/[\dA-Fa-f]/),Fd=Dt(/[!-/:-@[-`{-~]/);function se(e){return e!==null&&e<-2}function Se(e){return e!==null&&(e<0||e===32)}function he(e){return e===-2||e===-1||e===32}const Jn=Dt(new RegExp("\\p{P}|\\p{S}","u")),Wt=Dt(/\s/);function Dt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function on(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(o=String.fromCharCode(s,l),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ke(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(u){return he(u)?(e.enter(n),l(u)):t(u)}function l(u){return he(u)&&s++o))return;const P=t.events.length;let D=P,R,S;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(R){S=t.events[D][1].end;break}R=!0}for(y(r),_=P;_T;){const O=n[j];t.containerState=O[1],O[0].exit.call(t,e)}n.length=T}function w(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Wd(e,t,n){return ke(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function nn(e){if(e===null||Se(e)||Wt(e))return 1;if(Jn(e))return 2}function Qn(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},m={...e[n][1].start};Mo(p,-u),Mo(m,u),o={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},s={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=it(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=it(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=it(c,Qn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=it(c,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=it(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,et(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n0&&he(_)?ke(e,w,"linePrefix",s+1)(_):w(_)}function w(_){return _===null||se(_)?e.check(Io,b,j)(_):(e.enter("codeFlowValue"),T(_))}function T(_){return _===null||se(_)?(e.exit("codeFlowValue"),w(_)):(e.consume(_),T)}function j(_){return e.exit("codeFenced"),t(_)}function O(_,P,D){let R=0;return S;function S(E){return _.enter("lineEnding"),_.consume(E),_.exit("lineEnding"),M}function M(E){return _.enter("codeFencedFence"),he(E)?ke(_,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(E):L(E)}function L(E){return E===l?(_.enter("codeFencedFenceSequence"),C(E)):D(E)}function C(E){return E===l?(R++,_.consume(E),C):R>=o?(_.exit("codeFencedFenceSequence"),he(E)?ke(_,v,"whitespace")(E):v(E)):D(E)}function v(E){return E===null||se(E)?(_.exit("codeFencedFence"),P(E)):D(E)}}}function np(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const br={name:"codeIndented",tokenize:ip},rp={partial:!0,tokenize:op};function ip(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),ke(e,s,"linePrefix",5)(c)}function s(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?u(c):se(c)?e.attempt(rp,o,u)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||se(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),l)}function u(c){return e.exit("codeIndented"),t(c)}}function op(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):se(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):ke(e,s,"linePrefix",5)(o)}function s(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):se(o)?i(o):n(o)}}const sp={name:"codeText",previous:lp,resolve:ap,tokenize:cp};function ap(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&cn(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),cn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),cn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function na(e,t,n,r,i,s,o,l,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return p;function p(y){return y===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(y),e.exit(s),m):y===null||y===32||y===41||Hn(y)?n(y):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),b(y))}function m(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(l),m(y)):y===null||y===60||se(y)?n(y):(e.consume(y),y===92?h:f)}function h(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function b(y){return!d&&(y===null||y===41||Se(y))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(y)):d999||f===null||f===91||f===93&&!u||f===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(f):f===93?(e.exit(s),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):se(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),p(f))}function p(f){return f===null||f===91||f===93||se(f)||l++>999?(e.exit("chunkString"),d(f)):(e.consume(f),u||(u=!he(f)),f===92?m:p)}function m(f){return f===91||f===92||f===93?(e.consume(f),l++,p):p(f)}}function ia(e,t,n,r,i,s){let o;return l;function l(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),o=m===40?41:m,u):n(m)}function u(m){return m===o?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(s),c(m))}function c(m){return m===o?(e.exit(s),u(o)):m===null?n(m):se(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),ke(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===o||m===null||se(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?p:d)}function p(m){return m===o||m===92?(e.consume(m),d):d(m)}}function mn(e,t){let n;return r;function r(i){return se(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):he(i)?ke(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const bp={name:"definition",tokenize:yp},xp={partial:!0,tokenize:vp};function yp(e,t,n){const r=this;let i;return s;function s(f){return e.enter("definition"),o(f)}function o(f){return ra.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function l(f){return i=dt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),u):n(f)}function u(f){return Se(f)?mn(e,c)(f):c(f)}function c(f){return na(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(xp,p,p)(f)}function p(f){return he(f)?ke(e,m,"whitespace")(f):m(f)}function m(f){return f===null||se(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function vp(e,t,n){return r;function r(l){return Se(l)?mn(e,i)(l):n(l)}function i(l){return ia(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return he(l)?ke(e,o,"whitespace")(l):o(l)}function o(l){return l===null||se(l)?t(l):n(l)}}const kp={name:"hardBreakEscape",tokenize:Ep};function Ep(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return se(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const wp={name:"headingAtx",resolve:_p,tokenize:Np};function _p(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},et(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function Np(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||Se(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||se(d)?(e.exit("atxHeading"),t(d)):he(d)?ke(e,l,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),l(d))}function c(d){return d===null||d===35||Se(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),c)}}const Sp=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Oo=["pre","script","style","textarea"],Tp={concrete:!0,name:"htmlFlow",resolveTo:Mp,tokenize:Ip},Cp={partial:!0,tokenize:Op},Ap={partial:!0,tokenize:Rp};function Mp(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ip(e,t,n){const r=this;let i,s,o,l,u;return c;function c(k){return d(k)}function d(k){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(k),p}function p(k){return k===33?(e.consume(k),m):k===47?(e.consume(k),s=!0,b):k===63?(e.consume(k),i=3,r.interrupt?t:g):Ve(k)?(e.consume(k),o=String.fromCharCode(k),x):n(k)}function m(k){return k===45?(e.consume(k),i=2,f):k===91?(e.consume(k),i=5,l=0,h):Ve(k)?(e.consume(k),i=4,r.interrupt?t:g):n(k)}function f(k){return k===45?(e.consume(k),r.interrupt?t:g):n(k)}function h(k){const ie="CDATA[";return k===ie.charCodeAt(l++)?(e.consume(k),l===ie.length?r.interrupt?t:L:h):n(k)}function b(k){return Ve(k)?(e.consume(k),o=String.fromCharCode(k),x):n(k)}function x(k){if(k===null||k===47||k===62||Se(k)){const ie=k===47,K=o.toLowerCase();return!ie&&!s&&Oo.includes(K)?(i=1,r.interrupt?t(k):L(k)):Sp.includes(o.toLowerCase())?(i=6,ie?(e.consume(k),y):r.interrupt?t(k):L(k)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(k):s?w(k):T(k))}return k===45||He(k)?(e.consume(k),o+=String.fromCharCode(k),x):n(k)}function y(k){return k===62?(e.consume(k),r.interrupt?t:L):n(k)}function w(k){return he(k)?(e.consume(k),w):S(k)}function T(k){return k===47?(e.consume(k),S):k===58||k===95||Ve(k)?(e.consume(k),j):he(k)?(e.consume(k),T):S(k)}function j(k){return k===45||k===46||k===58||k===95||He(k)?(e.consume(k),j):O(k)}function O(k){return k===61?(e.consume(k),_):he(k)?(e.consume(k),O):T(k)}function _(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),u=k,P):he(k)?(e.consume(k),_):D(k)}function P(k){return k===u?(e.consume(k),u=null,R):k===null||se(k)?n(k):(e.consume(k),P)}function D(k){return k===null||k===34||k===39||k===47||k===60||k===61||k===62||k===96||Se(k)?O(k):(e.consume(k),D)}function R(k){return k===47||k===62||he(k)?T(k):n(k)}function S(k){return k===62?(e.consume(k),M):n(k)}function M(k){return k===null||se(k)?L(k):he(k)?(e.consume(k),M):n(k)}function L(k){return k===45&&i===2?(e.consume(k),I):k===60&&i===1?(e.consume(k),H):k===62&&i===4?(e.consume(k),F):k===63&&i===3?(e.consume(k),g):k===93&&i===5?(e.consume(k),V):se(k)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Cp,$,C)(k)):k===null||se(k)?(e.exit("htmlFlowData"),C(k)):(e.consume(k),L)}function C(k){return e.check(Ap,v,$)(k)}function v(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),E}function E(k){return k===null||se(k)?C(k):(e.enter("htmlFlowData"),L(k))}function I(k){return k===45?(e.consume(k),g):L(k)}function H(k){return k===47?(e.consume(k),o="",U):L(k)}function U(k){if(k===62){const ie=o.toLowerCase();return Oo.includes(ie)?(e.consume(k),F):L(k)}return Ve(k)&&o.length<8?(e.consume(k),o+=String.fromCharCode(k),U):L(k)}function V(k){return k===93?(e.consume(k),g):L(k)}function g(k){return k===62?(e.consume(k),F):k===45&&i===2?(e.consume(k),g):L(k)}function F(k){return k===null||se(k)?(e.exit("htmlFlowData"),$(k)):(e.consume(k),F)}function $(k){return e.exit("htmlFlow"),t(k)}}function Rp(e,t,n){const r=this;return i;function i(o){return se(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function Op(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(yn,t,n)}}const Lp={name:"htmlText",tokenize:jp};function jp(e,t,n){const r=this;let i,s,o;return l;function l(g){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(g),u}function u(g){return g===33?(e.consume(g),c):g===47?(e.consume(g),O):g===63?(e.consume(g),T):Ve(g)?(e.consume(g),D):n(g)}function c(g){return g===45?(e.consume(g),d):g===91?(e.consume(g),s=0,h):Ve(g)?(e.consume(g),w):n(g)}function d(g){return g===45?(e.consume(g),f):n(g)}function p(g){return g===null?n(g):g===45?(e.consume(g),m):se(g)?(o=p,H(g)):(e.consume(g),p)}function m(g){return g===45?(e.consume(g),f):p(g)}function f(g){return g===62?I(g):g===45?m(g):p(g)}function h(g){const F="CDATA[";return g===F.charCodeAt(s++)?(e.consume(g),s===F.length?b:h):n(g)}function b(g){return g===null?n(g):g===93?(e.consume(g),x):se(g)?(o=b,H(g)):(e.consume(g),b)}function x(g){return g===93?(e.consume(g),y):b(g)}function y(g){return g===62?I(g):g===93?(e.consume(g),y):b(g)}function w(g){return g===null||g===62?I(g):se(g)?(o=w,H(g)):(e.consume(g),w)}function T(g){return g===null?n(g):g===63?(e.consume(g),j):se(g)?(o=T,H(g)):(e.consume(g),T)}function j(g){return g===62?I(g):T(g)}function O(g){return Ve(g)?(e.consume(g),_):n(g)}function _(g){return g===45||He(g)?(e.consume(g),_):P(g)}function P(g){return se(g)?(o=P,H(g)):he(g)?(e.consume(g),P):I(g)}function D(g){return g===45||He(g)?(e.consume(g),D):g===47||g===62||Se(g)?R(g):n(g)}function R(g){return g===47?(e.consume(g),I):g===58||g===95||Ve(g)?(e.consume(g),S):se(g)?(o=R,H(g)):he(g)?(e.consume(g),R):I(g)}function S(g){return g===45||g===46||g===58||g===95||He(g)?(e.consume(g),S):M(g)}function M(g){return g===61?(e.consume(g),L):se(g)?(o=M,H(g)):he(g)?(e.consume(g),M):R(g)}function L(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),i=g,C):se(g)?(o=L,H(g)):he(g)?(e.consume(g),L):(e.consume(g),v)}function C(g){return g===i?(e.consume(g),i=void 0,E):g===null?n(g):se(g)?(o=C,H(g)):(e.consume(g),C)}function v(g){return g===null||g===34||g===39||g===60||g===61||g===96?n(g):g===47||g===62||Se(g)?R(g):(e.consume(g),v)}function E(g){return g===47||g===62||Se(g)?R(g):n(g)}function I(g){return g===62?(e.consume(g),e.exit("htmlTextData"),e.exit("htmlText"),t):n(g)}function H(g){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),U}function U(g){return he(g)?ke(e,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(g):V(g)}function V(g){return e.enter("htmlTextData"),o(g)}}const li={name:"labelEnd",resolveAll:Fp,resolveTo:zp,tokenize:$p},Dp={tokenize:Up},Pp={tokenize:Hp},Bp={tokenize:Wp};function Fp(e){let t=-1;const n=[];for(;++t=3&&(c===null||se(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),he(c)?ke(e,l,"whitespace")(c):l(c))}}const Ye={continuation:{tokenize:ef},exit:nf,name:"list",tokenize:Qp},Zp={partial:!0,tokenize:rf},Jp={partial:!0,tokenize:tf};function Qp(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(f){const h=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(h==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Ur(f)){if(r.containerState.type||(r.containerState.type=h,e.enter(h,{_container:!0})),h==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Fn,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(f)}return n(f)}function u(f){return Ur(f)&&++o<10?(e.consume(f),u):(!r.interrupt||o<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(yn,r.interrupt?n:d,e.attempt(Zp,m,p))}function d(f){return r.containerState.initialBlankLine=!0,s++,m(f)}function p(f){return he(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),m):n(f)}function m(f){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function ef(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yn,i,s);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ke(e,t,"listItemIndent",r.containerState.size+1)(l)}function s(l){return r.containerState.furtherBlankLines||!he(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Jp,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,ke(e,e.attempt(Ye,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function tf(e,t,n){const r=this;return ke(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function nf(e){e.exit(this.containerState.type)}function rf(e,t,n){const r=this;return ke(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!he(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Lo={name:"setextUnderline",resolveTo:of,tokenize:sf};function of(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function sf(e,t,n){const r=this;let i;return s;function s(c){let d=r.events.length,p;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){p=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===i?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),he(c)?ke(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||se(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const af={tokenize:lf};function lf(e){const t=this,n=e.attempt(yn,r,e.attempt(this.parser.constructs.flowInitial,i,ke(e,e.attempt(this.parser.constructs.flow,i,e.attempt(pp,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const cf={resolveAll:sa()},uf=oa("string"),df=oa("text");function oa(e){return{resolveAll:sa(e==="text"?pf:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,l);return o;function o(d){return c(d)?s(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return c(d)?(n.exit("data"),s(d)):(n.consume(d),u)}function c(d){if(d===null)return!0;const p=i[d];let m=-1;if(p)for(;++m-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function Nf(e,t){let n=-1;const r=[];let i;for(;++nr.id===e))return t;return"deterministic"}function Ru({evaluatorId:e,evaluatorFilter:t}){const n=Me(x=>x.localEvaluators),r=Me(x=>x.setLocalEvaluators),i=Me(x=>x.upsertLocalEvaluator),s=Me(x=>x.evaluators),{navigate:o}=st(),l=e?n.find(x=>x.id===e)??null:null,u=!!l,c=t?n.filter(x=>x.type===t):n,[d,p]=_.useState(()=>{const x=localStorage.getItem("evaluatorSidebarWidth");return x?parseInt(x,10):320}),[m,f]=_.useState(!1),b=_.useRef(null);_.useEffect(()=>{localStorage.setItem("evaluatorSidebarWidth",String(d))},[d]),_.useEffect(()=>{ei().then(r).catch(console.error)},[r]);const h=_.useCallback(x=>{x.preventDefault(),f(!0);const C="touches"in x?x.touches[0].clientX:x.clientX,O=d,j=B=>{const D=b.current;if(!D)return;const R="touches"in B?B.touches[0].clientX:B.clientX,S=D.clientWidth-300,T=Math.max(280,Math.min(S,O+(C-R)));p(T)},N=()=>{f(!1),document.removeEventListener("mousemove",j),document.removeEventListener("mouseup",N),document.removeEventListener("touchmove",j),document.removeEventListener("touchend",N),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",j),document.addEventListener("mouseup",N),document.addEventListener("touchmove",j,{passive:!1}),document.addEventListener("touchend",N)},[d]),v=x=>{i(x)},y=()=>{o("#/evaluators")};return a.jsxs("div",{ref:b,className:"flex h-full",children:[a.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[a.jsxs("div",{className:"px-4 h-10 border-b shrink-0 flex items-center gap-4",style:{borderColor:"var(--border)"},children:[a.jsx("h1",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:"Evaluators"}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:[c.length,t?` / ${n.length}`:""," configured"]})]}),a.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:c.length===0?a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:n.length===0?"No evaluators configured yet.":"No evaluators in this category."}):a.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))"},children:c.map(x=>a.jsx(Ou,{evaluator:x,evaluators:s,selected:x.id===e,onClick:()=>o(x.id===e?"#/evaluators":`#/evaluators/${encodeURIComponent(x.id)}`)},x.id))})})]}),a.jsx("div",{onMouseDown:h,onTouchStart:h,className:`shrink-0 drag-handle-col${m?"":" transition-all"}`,style:{width:u?3:0,opacity:u?1:0}}),a.jsxs("div",{className:`shrink-0 flex flex-col overflow-hidden${m?"":" transition-[width] duration-200 ease-in-out"}`,style:{width:u?d:0,background:"var(--bg-primary)"},children:[a.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",minWidth:d},children:[a.jsx("span",{className:"px-2 py-0.5 h-7 text-xs font-semibold rounded inline-flex items-center",style:{color:"var(--accent)",background:"color-mix(in srgb, var(--accent) 10%, transparent)"},children:"Edit Evaluator"}),a.jsx("button",{onClick:y,"aria-label":"Close editor",className:"ml-auto w-7 h-7 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:x=>{x.currentTarget.style.color="var(--text-primary)"},onMouseLeave:x=>{x.currentTarget.style.color="var(--text-muted)"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsx("div",{className:"flex-1 overflow-hidden",style:{minWidth:d},children:l&&a.jsx(Lu,{evaluator:l,onUpdated:v})})]})]})}function Ou({evaluator:e,evaluators:t,selected:n,onClick:r}){const i=fo[e.type]??fo.deterministic,s=t.find(l=>l.id===e.evaluator_type_id),o=e.evaluator_type_id.startsWith("file://");return a.jsxs("div",{className:"rounded-md p-4 flex flex-col cursor-pointer transition-colors",style:{border:n?"1px solid var(--accent)":"1px solid var(--border)",background:n?"color-mix(in srgb, var(--accent) 5%, var(--card-bg))":"var(--card-bg)"},onClick:r,onMouseEnter:l=>{n||(l.currentTarget.style.borderColor="var(--text-muted)")},onMouseLeave:l=>{n||(l.currentTarget.style.borderColor="var(--border)")},children:[a.jsx("div",{className:"text-sm font-semibold",style:{color:"var(--text-primary)"},children:e.name}),e.description&&a.jsx("div",{className:"text-xs leading-relaxed mt-2",style:{color:"var(--text-secondary)"},children:e.description}),a.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-auto pt-3",children:[a.jsxs("span",{className:"px-2 py-0.5 rounded text-[10px] font-medium",style:{color:i.color,background:i.bg},children:["Category: ",i.label]}),a.jsxs("span",{className:"px-2 py-0.5 rounded text-[10px] font-medium",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:["Type: ",o?"Custom":(s==null?void 0:s.name)??e.evaluator_type_id]}),a.jsxs("span",{className:"px-2 py-0.5 rounded text-[10px] font-medium font-mono",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:["Target: ",e.target_output_key||"*"]})]})]})}function Lu({evaluator:e,onUpdated:t}){var j,N;const n=Iu(e.evaluator_type_id),r=pn[n]??[],[i,s]=_.useState(e.description),[o,l]=_.useState(e.evaluator_type_id),[u,c]=_.useState(((j=e.config)==null?void 0:j.targetOutputKey)??"*"),[d,p]=_.useState(((N=e.config)==null?void 0:N.prompt)??""),[m,f]=_.useState(!1),[b,h]=_.useState(null),[v,y]=_.useState(!1);_.useEffect(()=>{var B,D;s(e.description),l(e.evaluator_type_id),c(((B=e.config)==null?void 0:B.targetOutputKey)??"*"),p(((D=e.config)==null?void 0:D.prompt)??""),h(null),y(!1)},[e.id]);const x=Ls(o),C=async()=>{f(!0),h(null),y(!1);try{const B={};x.targetOutputKey&&(B.targetOutputKey=u),x.prompt&&d.trim()&&(B.prompt=d);const D=await xc(e.id,{description:i.trim(),evaluator_type_id:o,config:B});t(D),y(!0),setTimeout(()=>y(!1),2e3)}catch(B){const D=B==null?void 0:B.detail;h(D??"Failed to update evaluator")}finally{f(!1)}},O={background:"var(--bg-secondary)",color:"var(--text-primary)",border:"1px solid var(--border)"};return a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"p-4 overflow-y-auto flex-1 space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Name"}),a.jsx("div",{className:"px-3 py-2 rounded-lg text-xs",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:e.name})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Category"}),a.jsx("div",{className:"px-3 py-2 rounded-lg text-xs",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:Pr[n]??n})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Type"}),a.jsx("select",{value:o,onChange:B=>l(B.target.value),className:"w-full px-3 py-2 rounded-lg text-xs outline-none cursor-pointer",style:O,children:r.map(B=>a.jsx("option",{value:B.id,children:B.name},B.id))})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Description"}),a.jsx("textarea",{value:i,onChange:B=>s(B.target.value),placeholder:"What does this evaluator check?",rows:4,className:"w-full px-3 py-2 rounded-lg text-xs leading-relaxed outline-none resize-y",style:O})]}),x.targetOutputKey&&a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Target Output Key"}),a.jsx("input",{type:"text",value:u,onChange:B=>c(B.target.value),placeholder:"*",className:"w-full px-3 py-2 rounded-lg text-xs outline-none",style:O}),a.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-muted)"},children:"Use * for entire output or a specific key name"})]}),x.prompt&&a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Prompt"}),a.jsx("textarea",{value:d,onChange:B=>p(B.target.value),placeholder:"Evaluation prompt for the LLM judge...",rows:8,className:"w-full px-3 py-2 rounded-lg text-xs font-mono leading-relaxed outline-none resize-y",style:O})]})]}),a.jsxs("div",{className:"shrink-0 p-4 space-y-2",children:[b&&a.jsx("div",{className:"text-xs px-3 py-2 rounded-lg",style:{background:"rgba(239,68,68,0.1)",color:"var(--error)"},children:b}),v&&a.jsx("div",{className:"text-xs px-3 py-2 rounded-lg",style:{background:"rgba(34,197,94,0.1)",color:"var(--success)"},children:"Saved successfully"}),a.jsx("button",{onClick:C,disabled:m,className:"w-full py-2.5 text-xs font-semibold rounded-md border cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed transition-colors",style:{background:"transparent",borderColor:"var(--accent)",color:"var(--accent)"},onMouseEnter:B=>{B.currentTarget.style.background="color-mix(in srgb, var(--accent) 15%, transparent)"},onMouseLeave:B=>{B.currentTarget.style.background="transparent"},children:m?"Saving...":"Save Changes"})]})]})}const ju=["deterministic","llm","tool"];function Du({category:e}){var w;const t=Me(k=>k.addLocalEvaluator),{navigate:n}=st(),r=e!=="any",[i,s]=_.useState(r?e:"deterministic"),o=pn[i]??[],[l,u]=_.useState(""),[c,d]=_.useState(""),[p,m]=_.useState(((w=o[0])==null?void 0:w.id)??""),[f,b]=_.useState("*"),[h,v]=_.useState(""),[y,x]=_.useState(!1),[C,O]=_.useState(null),[j,N]=_.useState(!1),[B,D]=_.useState(!1);_.useEffect(()=>{var q;const k=r?e:"deterministic";s(k);const W=((q=(pn[k]??[])[0])==null?void 0:q.id)??"",U=fr[W];u(""),d((U==null?void 0:U.description)??""),m(W),b("*"),v((U==null?void 0:U.prompt)??""),O(null),N(!1),D(!1)},[e,r]);const R=k=>{var q;s(k);const W=((q=(pn[k]??[])[0])==null?void 0:q.id)??"",U=fr[W];m(W),j||d((U==null?void 0:U.description)??""),B||v((U==null?void 0:U.prompt)??"")},S=k=>{m(k);const I=fr[k];I&&(j||d(I.description),B||v(I.prompt))},T=Ls(p),L=async()=>{if(!l.trim()){O("Name is required");return}x(!0),O(null);try{const k={};T.targetOutputKey&&(k.targetOutputKey=f),T.prompt&&h.trim()&&(k.prompt=h);const I=await hc({name:l.trim(),description:c.trim(),evaluator_type_id:p,config:k});t(I),n("#/evaluators")}catch(k){const I=k==null?void 0:k.detail;O(I??"Failed to create evaluator")}finally{x(!1)}},M={background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"};return a.jsx("div",{className:"h-full overflow-y-auto",children:a.jsx("div",{className:"flex items-center justify-center min-h-full py-8",children:a.jsxs("div",{className:"w-full max-w-xl px-6",children:[a.jsxs("div",{className:"mb-8 text-center",children:[a.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}}),a.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"New Evaluator"})]}),a.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"Create an evaluator to score agent outputs"})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Name"}),a.jsx("input",{type:"text",value:l,onChange:k=>u(k.target.value),placeholder:"e.g. MyEvaluator",className:"w-full rounded-md px-3 py-2 text-xs",style:M,onKeyDown:k=>{k.key==="Enter"&&l.trim()&&L()}})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Category"}),r?a.jsx("div",{className:"px-3 py-2 rounded-md text-xs",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:Pr[i]??i}):a.jsx("select",{value:i,onChange:k=>R(k.target.value),className:"w-full rounded-md px-3 py-2 text-xs cursor-pointer appearance-auto",style:M,children:ju.map(k=>a.jsx("option",{value:k,children:Pr[k]},k))})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Type"}),a.jsx("select",{value:p,onChange:k=>S(k.target.value),className:"w-full rounded-md px-3 py-2 text-xs cursor-pointer appearance-auto",style:M,children:o.map(k=>a.jsx("option",{value:k.id,children:k.name},k.id))})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Description"}),a.jsx("textarea",{value:c,onChange:k=>{d(k.target.value),N(!0)},placeholder:"What does this evaluator check?",rows:3,className:"w-full rounded-md px-3 py-2 text-xs leading-relaxed resize-y",style:M})]}),T.targetOutputKey&&a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Target Output Key"}),a.jsx("input",{type:"text",value:f,onChange:k=>b(k.target.value),placeholder:"*",className:"w-full rounded-md px-3 py-2 text-xs",style:M}),a.jsx("div",{className:"text-xs mt-1",style:{color:"var(--text-muted)"},children:"Use * for entire output or a specific key name"})]}),T.prompt&&a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Prompt"}),a.jsx("textarea",{value:h,onChange:k=>{v(k.target.value),D(!0)},placeholder:"Evaluation prompt for the LLM judge...",rows:6,className:"w-full rounded-md px-3 py-2 text-xs font-mono leading-relaxed resize-y",style:M})]}),C&&a.jsx("p",{className:"text-xs mb-4 px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:C}),a.jsx("button",{onClick:L,disabled:y||!l.trim(),className:"w-full py-2 rounded-md text-[13px] font-semibold transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},children:y?"Creating...":"Create Evaluator"})]})})})}function js({path:e,name:t,type:n,depth:r}){const i=be(x=>x.children[e]),s=be(x=>!!x.expanded[e]),o=be(x=>!!x.loadingDirs[e]),l=be(x=>!!x.dirty[e]),u=be(x=>!!x.agentChangedFiles[e]),c=be(x=>x.selectedFile),{setChildren:d,toggleExpanded:p,setLoadingDir:m,openTab:f}=be(),{navigate:b}=st(),h=n==="directory",v=!h&&c===e,y=_.useCallback(()=>{h?(!i&&!o&&(m(e,!0),$n(e).then(x=>d(e,x)).catch(console.error).finally(()=>m(e,!1))),p(e)):(f(e),b(`#/explorer/file/${encodeURIComponent(e)}`))},[h,i,o,e,d,p,m,f,b]);return a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:y,className:`w-full text-left flex items-center gap-1 py-[3px] text-[13px] cursor-pointer transition-colors group${u?" agent-changed-file":""}`,style:{paddingLeft:`${12+r*16}px`,paddingRight:"8px",background:v?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:v?"var(--text-primary)":"var(--text-secondary)",border:"none"},onMouseEnter:x=>{v||(x.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:x=>{v||(x.currentTarget.style.background="transparent")},children:[a.jsx("span",{className:"w-3 shrink-0 flex items-center justify-center",style:{color:"var(--text-muted)"},children:h&&a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",style:{transform:s?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s"},children:a.jsx("path",{d:"M3 1.5L7 5L3 8.5z"})})}),a.jsx("span",{className:"shrink-0",style:{color:h?"var(--accent)":"var(--text-muted)"},children:h?a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}):a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"})]})}),a.jsx("span",{className:"truncate flex-1",children:t}),l&&a.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{background:"var(--accent)"}}),o&&a.jsx("span",{className:"text-[10px] shrink-0",style:{color:"var(--text-muted)"},children:"..."})]}),h&&s&&i&&i.map(x=>a.jsx(js,{path:x.path,name:x.name,type:x.type,depth:r+1},x.path))]})}function mo(){const e=be(n=>n.children[""]),{setChildren:t}=be();return _.useEffect(()=>{e||$n("").then(n=>t("",n)).catch(console.error)},[e,t]),a.jsx("div",{className:"flex-1 overflow-y-auto py-1",children:e?e.map(n=>a.jsx(js,{path:n.path,name:n.name,type:n.type,depth:0},n.path)):a.jsx("p",{className:"text-[11px] px-3 py-2",style:{color:"var(--text-muted)"},children:"Loading..."})})}const go=e=>{e.editor.defineTheme("uipath-dark",{base:"vs-dark",inherit:!0,rules:[{token:"comment",foreground:"64748b",fontStyle:"italic"},{token:"keyword",foreground:"c084fc"},{token:"string",foreground:"86efac"},{token:"number",foreground:"fcd34d"},{token:"type",foreground:"7dd3fc"}],colors:{"editor.background":"#0f172a","editor.foreground":"#cbd5e1","editor.lineHighlightBackground":"#1e293b","editor.selectionBackground":"#334155","editor.inactiveSelectionBackground":"#263348","editorLineNumber.foreground":"#64748b","editorLineNumber.activeForeground":"#94a3b8","editorCursor.foreground":"#fa4616","editorIndentGuide.background":"#334155","editorIndentGuide.activeBackground":"#64748b","editorWidget.background":"#1e293b","editorWidget.border":"#334155","editorSuggestWidget.background":"#1e293b","editorSuggestWidget.border":"#334155","editorSuggestWidget.selectedBackground":"#263348","editorHoverWidget.background":"#1e293b","editorHoverWidget.border":"#334155","scrollbarSlider.background":"#33415580","scrollbarSlider.hoverBackground":"#33415599","scrollbarSlider.activeBackground":"#334155cc"}}),e.editor.defineTheme("uipath-light",{base:"vs",inherit:!0,rules:[{token:"comment",foreground:"94a3b8",fontStyle:"italic"},{token:"keyword",foreground:"7c3aed"},{token:"string",foreground:"16a34a"},{token:"number",foreground:"d97706"},{token:"type",foreground:"0284c7"}],colors:{"editor.background":"#f8fafc","editor.foreground":"#0f172a","editor.lineHighlightBackground":"#f1f5f9","editor.selectionBackground":"#e2e8f0","editor.inactiveSelectionBackground":"#f1f5f9","editorLineNumber.foreground":"#94a3b8","editorLineNumber.activeForeground":"#475569","editorCursor.foreground":"#fa4616","editorIndentGuide.background":"#e2e8f0","editorIndentGuide.activeBackground":"#94a3b8","editorWidget.background":"#ffffff","editorWidget.border":"#e2e8f0","editorSuggestWidget.background":"#ffffff","editorSuggestWidget.border":"#e2e8f0","editorSuggestWidget.selectedBackground":"#f1f5f9","editorHoverWidget.background":"#ffffff","editorHoverWidget.border":"#e2e8f0","scrollbarSlider.background":"#d1d5db80","scrollbarSlider.hoverBackground":"#d1d5db99","scrollbarSlider.activeBackground":"#d1d5dbcc"}})};function ho(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Pu(e){const t=e.replace(/\\/g,"/").split("/");return t[t.length-1]||e}function Bu(){const e=be(M=>M.openTabs),n=be(M=>M.selectedFile),r=be(M=>n?M.fileCache[n]:void 0),i=be(M=>n?!!M.dirty[n]:!1),s=be(M=>n?M.buffers[n]:void 0),o=be(M=>M.loadingFile),l=be(M=>M.dirty),u=be(M=>M.diffView),c=be(M=>n?!!M.agentChangedFiles[n]:!1),{setFileContent:d,updateBuffer:p,markClean:m,setLoadingFile:f,openTab:b,closeTab:h,setDiffView:v}=be(),{navigate:y}=st(),x=Ss(M=>M.theme),C=_.useRef(null),{explorerFile:O}=st();_.useEffect(()=>{O&&b(O)},[O,b]),_.useEffect(()=>{n&&(be.getState().fileCache[n]||(f(!0),Lr(n).then(M=>d(n,M)).catch(console.error).finally(()=>f(!1))))},[n,d,f]);const j=_.useCallback(()=>{if(!n)return;const M=be.getState().fileCache[n],k=be.getState().buffers[n]??(M==null?void 0:M.content);k!=null&&tc(n,k).then(()=>{m(n),d(n,{...M,content:k})}).catch(console.error)},[n,m,d]);_.useEffect(()=>{const M=w=>{(w.ctrlKey||w.metaKey)&&w.key==="s"&&(w.preventDefault(),j())};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[j]);const N=M=>{C.current=M},B=_.useCallback(M=>{M!==void 0&&n&&p(n,M)},[n,p]),D=_.useCallback(M=>{b(M),y(`#/explorer/file/${encodeURIComponent(M)}`)},[b,y]),R=_.useCallback((M,w)=>{M.stopPropagation();const k=be.getState(),I=k.openTabs.filter(W=>W!==w);if(h(w),k.selectedFile===w){const W=k.openTabs.indexOf(w),U=I[Math.min(W,I.length-1)];y(U?`#/explorer/file/${encodeURIComponent(U)}`:"#/explorer")}},[h,y]),S=_.useCallback((M,w)=>{M.button===1&&R(M,w)},[R]),T=e.length>0&&a.jsx("div",{className:"h-10 flex items-end overflow-x-auto shrink-0",style:{background:"var(--bg-secondary)",borderBottom:"1px solid var(--border)"},children:e.map(M=>{const w=M===n,k=!!l[M];return a.jsxs("button",{onClick:()=>D(M),onMouseDown:I=>S(I,M),className:"h-full flex items-center gap-1.5 px-3 text-[12px] shrink-0 cursor-pointer transition-colors relative",style:{background:w?"var(--bg-primary)":"transparent",color:w?"var(--text-primary)":"var(--text-secondary)",border:"none",borderBottom:w?"2px solid var(--accent)":"2px solid transparent",maxWidth:"180px"},onMouseEnter:I=>{w||(I.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:I=>{w||(I.currentTarget.style.background="transparent")},children:[a.jsx("span",{className:"truncate",children:Pu(M)}),k?a.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{background:"var(--accent)"},title:"Unsaved changes"}):a.jsx("span",{className:"w-4 h-4 flex items-center justify-center rounded shrink-0 transition-colors",style:{color:"var(--text-muted)"},onClick:I=>R(I,M),onMouseEnter:I=>{I.currentTarget.style.background="var(--bg-hover)",I.currentTarget.style.color="var(--text-primary)"},onMouseLeave:I=>{I.currentTarget.style.background="transparent",I.currentTarget.style.color="var(--text-muted)"},children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",children:a.jsx("path",{d:"M8 8.707l3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.708.708L7.293 8l-3.647 3.646.708.708L8 8.707z"})})})]},M)})});if(!n)return a.jsxs("div",{className:"flex flex-col h-full",children:[T,a.jsx("div",{className:"flex-1 flex items-center justify-center",style:{color:"var(--text-muted)"},children:"Select a file to view"})]});if(o&&!r)return a.jsxs("div",{className:"flex flex-col h-full",children:[T,a.jsx("div",{className:"flex-1 flex items-center justify-center",style:{color:"var(--text-muted)"},children:a.jsx("div",{className:"text-sm",children:"Loading file..."})})]});if(!r&&!o)return a.jsxs("div",{className:"flex flex-col h-full",children:[T,a.jsx("div",{className:"flex-1 flex items-center justify-center",style:{color:"var(--text-muted)"},children:a.jsx("div",{className:"text-sm",children:"Failed to load file"})})]});if(!r)return null;if(r.binary)return a.jsxs("div",{className:"flex flex-col h-full",children:[T,a.jsx("div",{className:"h-8 flex items-center px-3 gap-2 text-xs shrink-0 border-b",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:a.jsx("span",{style:{color:"var(--text-muted)"},children:ho(r.size)})}),a.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3",style:{color:"var(--text-muted)"},children:[a.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"}),a.jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),a.jsx("span",{className:"text-sm",children:"Binary file — preview not available"})]})]});const L=u&&u.path===n;return a.jsxs("div",{className:"flex flex-col h-full",children:[T,a.jsxs("div",{className:"h-8 flex items-center px-3 gap-2 text-xs shrink-0 border-b",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[r.language&&a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px]",style:{background:"var(--bg-hover)",color:"var(--text-muted)"},children:r.language}),a.jsx("span",{style:{color:"var(--text-muted)"},children:ho(r.size)}),c&&a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium",style:{background:"color-mix(in srgb, var(--info) 20%, transparent)",color:"var(--info)"},children:"Agent modified"}),a.jsx("div",{className:"flex-1"}),i&&a.jsx("span",{className:"text-[10px] font-medium",style:{color:"var(--accent)"},children:"Modified"}),a.jsx("button",{onClick:j,className:"px-2 py-0.5 rounded text-[11px] font-medium cursor-pointer transition-colors",style:{background:i?"var(--accent)":"var(--bg-hover)",color:i?"white":"var(--text-muted)",border:"none"},children:"Save"})]}),L&&a.jsxs("div",{className:"h-8 flex items-center px-3 gap-2 text-xs shrink-0 border-b",style:{borderColor:"var(--border)",background:"color-mix(in srgb, var(--info) 10%, var(--bg-secondary))"},children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--info)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),a.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),a.jsx("span",{style:{color:"var(--info)"},children:"Agent modified this file"}),a.jsx("div",{className:"flex-1"}),a.jsx("button",{onClick:()=>v(null),className:"px-2 py-0.5 rounded text-[11px] font-medium cursor-pointer transition-colors",style:{background:"var(--bg-hover)",color:"var(--text-secondary)",border:"none"},children:"Dismiss"})]}),a.jsx("div",{className:"flex-1 overflow-hidden",children:L?a.jsx(Cl,{original:u.original,modified:u.modified,language:u.language??"plaintext",theme:x==="dark"?"uipath-dark":"uipath-light",beforeMount:go,options:{readOnly:!0,minimap:{enabled:!1},fontSize:13,lineNumbersMinChars:4,scrollBeyondLastLine:!1,automaticLayout:!0,renderSideBySide:!0}},`diff-${n}`):a.jsx(Al,{language:r.language??"plaintext",theme:x==="dark"?"uipath-dark":"uipath-light",value:s??r.content??"",onChange:B,beforeMount:go,onMount:N,options:{minimap:{enabled:!1},fontSize:13,lineNumbersMinChars:4,scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0,tabSize:2,renderWhitespace:"selection"}},n)})]})}const Zn="/api";async function Fu(){const e=await fetch(`${Zn}/agent/models`);if(!e.ok){if(e.status===401)return[];throw new Error(`HTTP ${e.status}`)}return e.json()}async function zu(e){const t=await fetch(`${Zn}/agent/session/${e}/diagnostics`);if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}async function $u(e){const t=await fetch(`${Zn}/agent/session/${e}/state`);if(t.status===404)return null;if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}async function Uu(){const e=await fetch(`${Zn}/agent/skills`);if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}function Hu(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Wu=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ku=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gu={};function bo(e,t){return(Gu.jsx?Ku:Wu).test(e)}const qu=/[ \t\n\f\r]/g;function Vu(e){return typeof e=="object"?e.type==="text"?xo(e.value):!1:xo(e)}function xo(e){return e.replace(qu,"")===""}class xn{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}xn.prototype.normal={};xn.prototype.property={};xn.prototype.space=void 0;function Ds(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new xn(n,r,t)}function Br(e){return e.toLowerCase()}class Xe{constructor(t,n){this.attribute=n,this.property=t}}Xe.prototype.attribute="";Xe.prototype.booleanish=!1;Xe.prototype.boolean=!1;Xe.prototype.commaOrSpaceSeparated=!1;Xe.prototype.commaSeparated=!1;Xe.prototype.defined=!1;Xe.prototype.mustUseProperty=!1;Xe.prototype.number=!1;Xe.prototype.overloadedBoolean=!1;Xe.prototype.property="";Xe.prototype.spaceSeparated=!1;Xe.prototype.space=void 0;let Yu=0;const pe=Kt(),Pe=Kt(),Fr=Kt(),V=Kt(),Ae=Kt(),tn=Kt(),Qe=Kt();function Kt(){return 2**++Yu}const zr=Object.freeze(Object.defineProperty({__proto__:null,boolean:pe,booleanish:Pe,commaOrSpaceSeparated:Qe,commaSeparated:tn,number:V,overloadedBoolean:Fr,spaceSeparated:Ae},Symbol.toStringTag,{value:"Module"})),mr=Object.keys(zr);class ti extends Xe{constructor(t,n,r,i){let s=-1;if(super(t,n),yo(this,"space",i),typeof r=="number")for(;++s4&&n.slice(0,4)==="data"&&ed.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(vo,rd);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!vo.test(s)){let o=s.replace(Qu,nd);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=ti}return new i(r,t)}function nd(e){return"-"+e.toLowerCase()}function rd(e){return e.charAt(1).toUpperCase()}const id=Ds([Ps,Xu,zs,$s,Us],"html"),ni=Ds([Ps,Zu,zs,$s,Us],"svg");function od(e){return e.join(" ").trim()}var Yt={},gr,ko;function sd(){if(ko)return gr;ko=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,u=` +`,c="/",d="*",p="",m="comment",f="declaration";function b(v,y){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];y=y||{};var x=1,C=1;function O(w){var k=w.match(t);k&&(x+=k.length);var I=w.lastIndexOf(u);C=~I?w.length-I:C+w.length}function j(){var w={line:x,column:C};return function(k){return k.position=new N(w),R(),k}}function N(w){this.start=w,this.end={line:x,column:C},this.source=y.source}N.prototype.content=v;function B(w){var k=new Error(y.source+":"+x+":"+C+": "+w);if(k.reason=w,k.filename=y.source,k.line=x,k.column=C,k.source=v,!y.silent)throw k}function D(w){var k=w.exec(v);if(k){var I=k[0];return O(I),v=v.slice(I.length),k}}function R(){D(n)}function S(w){var k;for(w=w||[];k=T();)k!==!1&&w.push(k);return w}function T(){var w=j();if(!(c!=v.charAt(0)||d!=v.charAt(1))){for(var k=2;p!=v.charAt(k)&&(d!=v.charAt(k)||c!=v.charAt(k+1));)++k;if(k+=2,p===v.charAt(k-1))return B("End of comment missing");var I=v.slice(2,k-2);return C+=2,O(I),v=v.slice(k),C+=2,w({type:m,comment:I})}}function L(){var w=j(),k=D(r);if(k){if(T(),!D(i))return B("property missing ':'");var I=D(s),W=w({type:f,property:h(k[0].replace(e,p)),value:I?h(I[0].replace(e,p)):p});return D(o),W}}function M(){var w=[];S(w);for(var k;k=L();)k!==!1&&(w.push(k),S(w));return w}return R(),M()}function h(v){return v?v.replace(l,p):p}return gr=b,gr}var Eo;function ad(){if(Eo)return Yt;Eo=1;var e=Yt&&Yt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.default=n;const t=e(sd());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const o=(0,t.default)(r),l=typeof i=="function";return o.forEach(u=>{if(u.type!=="declaration")return;const{property:c,value:d}=u;l?i(c,d,u):d&&(s=s||{},s[c]=d)}),s}return Yt}var an={},wo;function ld(){if(wo)return an;wo=1,Object.defineProperty(an,"__esModule",{value:!0}),an.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(c){return!c||n.test(c)||e.test(c)},o=function(c,d){return d.toUpperCase()},l=function(c,d){return"".concat(d,"-")},u=function(c,d){return d===void 0&&(d={}),s(c)?c:(c=c.toLowerCase(),d.reactCompat?c=c.replace(i,l):c=c.replace(r,l),c.replace(t,o))};return an.camelCase=u,an}var ln,_o;function cd(){if(_o)return ln;_o=1;var e=ln&&ln.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(ad()),n=ld();function r(i,s){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(l,u){l&&u&&(o[(0,n.camelCase)(l,s)]=u)}),o}return r.default=r,ln=r,ln}var ud=cd();const dd=Xr(ud),Hs=Ws("end"),ri=Ws("start");function Ws(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function pd(e){const t=ri(e),n=Hs(e);if(t&&n)return{start:t,end:n}}function fn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?No(e.position):"start"in e||"end"in e?No(e):"line"in e||"column"in e?$r(e):""}function $r(e){return So(e&&e.line)+":"+So(e&&e.column)}function No(e){return $r(e&&e.start)+"-"+$r(e&&e.end)}function So(e){return e&&typeof e=="number"?e:1}class We extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=fn(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}We.prototype.file="";We.prototype.name="";We.prototype.reason="";We.prototype.message="";We.prototype.stack="";We.prototype.column=void 0;We.prototype.line=void 0;We.prototype.ancestors=void 0;We.prototype.cause=void 0;We.prototype.fatal=void 0;We.prototype.place=void 0;We.prototype.ruleId=void 0;We.prototype.source=void 0;const ii={}.hasOwnProperty,fd=new Map,md=/[A-Z]/g,gd=new Set(["table","tbody","thead","tfoot","tr"]),hd=new Set(["td","th"]),Ks="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function bd(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Nd(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=_d(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ni:id,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=Gs(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function Gs(e,t,n){if(t.type==="element")return xd(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return yd(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return kd(e,t,n);if(t.type==="mdxjsEsm")return vd(e,t);if(t.type==="root")return Ed(e,t,n);if(t.type==="text")return wd(e,t)}function xd(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ni,e.schema=i),e.ancestors.push(t);const s=Vs(e,t.tagName,!1),o=Sd(e,t);let l=si(e,t);return gd.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!Vu(u):!0})),qs(e,o,s,t),oi(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function yd(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}hn(e,t.position)}function vd(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);hn(e,t.position)}function kd(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ni,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Vs(e,t.name,!0),o=Td(e,t),l=si(e,t);return qs(e,o,s,t),oi(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function Ed(e,t,n){const r={};return oi(r,si(e,t)),e.create(t,e.Fragment,r,n)}function wd(e,t){return t.value}function qs(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function oi(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function _d(e,t,n){return r;function r(i,s,o,l){const c=Array.isArray(o.children)?n:t;return l?c(s,o,l):c(s,o)}}function Nd(e,t){return n;function n(r,i,s,o){const l=Array.isArray(s.children),u=ri(r);return t(i,s,o,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Sd(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ii.call(t.properties,i)){const s=Cd(e,i,t.properties[i]);if(s){const[o,l]=s;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&hd.has(t.tagName)?r=l:n[o]=l}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Td(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else hn(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else hn(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function si(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:fd;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s0?(et(e,e.length,0,t),e):t}const Ao={}.hasOwnProperty;function Xs(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function dt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ve=Dt(/[A-Za-z]/),He=Dt(/[\dA-Za-z]/),Pd=Dt(/[#-'*+\--9=?A-Z^-~]/);function Hn(e){return e!==null&&(e<32||e===127)}const Ur=Dt(/\d/),Bd=Dt(/[\dA-Fa-f]/),Fd=Dt(/[!-/:-@[-`{-~]/);function se(e){return e!==null&&e<-2}function Se(e){return e!==null&&(e<0||e===32)}function he(e){return e===-2||e===-1||e===32}const Jn=Dt(new RegExp("\\p{P}|\\p{S}","u")),Wt=Dt(/\s/);function Dt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function on(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(o=String.fromCharCode(s,l),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ee(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(u){return he(u)?(e.enter(n),l(u)):t(u)}function l(u){return he(u)&&s++o))return;const B=t.events.length;let D=B,R,S;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(R){S=t.events[D][1].end;break}R=!0}for(y(r),N=B;NC;){const j=n[O];t.containerState=j[1],j[0].exit.call(t,e)}n.length=C}function x(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Wd(e,t,n){return Ee(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function nn(e){if(e===null||Se(e)||Wt(e))return 1;if(Jn(e))return 2}function Qn(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},m={...e[n][1].start};Io(p,-u),Io(m,u),o={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},s={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=it(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=it(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=it(c,Qn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=it(c,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=it(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,et(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n0&&he(N)?Ee(e,x,"linePrefix",s+1)(N):x(N)}function x(N){return N===null||se(N)?e.check(Ro,h,O)(N):(e.enter("codeFlowValue"),C(N))}function C(N){return N===null||se(N)?(e.exit("codeFlowValue"),x(N)):(e.consume(N),C)}function O(N){return e.exit("codeFenced"),t(N)}function j(N,B,D){let R=0;return S;function S(k){return N.enter("lineEnding"),N.consume(k),N.exit("lineEnding"),T}function T(k){return N.enter("codeFencedFence"),he(k)?Ee(N,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):L(k)}function L(k){return k===l?(N.enter("codeFencedFenceSequence"),M(k)):D(k)}function M(k){return k===l?(R++,N.consume(k),M):R>=o?(N.exit("codeFencedFenceSequence"),he(k)?Ee(N,w,"whitespace")(k):w(k)):D(k)}function w(k){return k===null||se(k)?(N.exit("codeFencedFence"),B(k)):D(k)}}}function np(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const br={name:"codeIndented",tokenize:ip},rp={partial:!0,tokenize:op};function ip(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Ee(e,s,"linePrefix",5)(c)}function s(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?u(c):se(c)?e.attempt(rp,o,u)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||se(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),l)}function u(c){return e.exit("codeIndented"),t(c)}}function op(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):se(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Ee(e,s,"linePrefix",5)(o)}function s(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):se(o)?i(o):n(o)}}const sp={name:"codeText",previous:lp,resolve:ap,tokenize:cp};function ap(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&cn(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),cn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),cn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function na(e,t,n,r,i,s,o,l,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return p;function p(y){return y===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(y),e.exit(s),m):y===null||y===32||y===41||Hn(y)?n(y):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),h(y))}function m(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(l),m(y)):y===null||y===60||se(y)?n(y):(e.consume(y),y===92?b:f)}function b(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function h(y){return!d&&(y===null||y===41||Se(y))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(y)):d999||f===null||f===91||f===93&&!u||f===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(f):f===93?(e.exit(s),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):se(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),p(f))}function p(f){return f===null||f===91||f===93||se(f)||l++>999?(e.exit("chunkString"),d(f)):(e.consume(f),u||(u=!he(f)),f===92?m:p)}function m(f){return f===91||f===92||f===93?(e.consume(f),l++,p):p(f)}}function ia(e,t,n,r,i,s){let o;return l;function l(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),o=m===40?41:m,u):n(m)}function u(m){return m===o?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(s),c(m))}function c(m){return m===o?(e.exit(s),u(o)):m===null?n(m):se(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Ee(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===o||m===null||se(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?p:d)}function p(m){return m===o||m===92?(e.consume(m),d):d(m)}}function mn(e,t){let n;return r;function r(i){return se(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):he(i)?Ee(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const bp={name:"definition",tokenize:yp},xp={partial:!0,tokenize:vp};function yp(e,t,n){const r=this;let i;return s;function s(f){return e.enter("definition"),o(f)}function o(f){return ra.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function l(f){return i=dt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),u):n(f)}function u(f){return Se(f)?mn(e,c)(f):c(f)}function c(f){return na(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(xp,p,p)(f)}function p(f){return he(f)?Ee(e,m,"whitespace")(f):m(f)}function m(f){return f===null||se(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function vp(e,t,n){return r;function r(l){return Se(l)?mn(e,i)(l):n(l)}function i(l){return ia(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return he(l)?Ee(e,o,"whitespace")(l):o(l)}function o(l){return l===null||se(l)?t(l):n(l)}}const kp={name:"hardBreakEscape",tokenize:Ep};function Ep(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return se(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const wp={name:"headingAtx",resolve:_p,tokenize:Np};function _p(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},et(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function Np(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||Se(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||se(d)?(e.exit("atxHeading"),t(d)):he(d)?Ee(e,l,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),l(d))}function c(d){return d===null||d===35||Se(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),c)}}const Sp=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Lo=["pre","script","style","textarea"],Tp={concrete:!0,name:"htmlFlow",resolveTo:Mp,tokenize:Ip},Cp={partial:!0,tokenize:Op},Ap={partial:!0,tokenize:Rp};function Mp(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ip(e,t,n){const r=this;let i,s,o,l,u;return c;function c(E){return d(E)}function d(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),p}function p(E){return E===33?(e.consume(E),m):E===47?(e.consume(E),s=!0,h):E===63?(e.consume(E),i=3,r.interrupt?t:g):Ve(E)?(e.consume(E),o=String.fromCharCode(E),v):n(E)}function m(E){return E===45?(e.consume(E),i=2,f):E===91?(e.consume(E),i=5,l=0,b):Ve(E)?(e.consume(E),i=4,r.interrupt?t:g):n(E)}function f(E){return E===45?(e.consume(E),r.interrupt?t:g):n(E)}function b(E){const ie="CDATA[";return E===ie.charCodeAt(l++)?(e.consume(E),l===ie.length?r.interrupt?t:L:b):n(E)}function h(E){return Ve(E)?(e.consume(E),o=String.fromCharCode(E),v):n(E)}function v(E){if(E===null||E===47||E===62||Se(E)){const ie=E===47,K=o.toLowerCase();return!ie&&!s&&Lo.includes(K)?(i=1,r.interrupt?t(E):L(E)):Sp.includes(o.toLowerCase())?(i=6,ie?(e.consume(E),y):r.interrupt?t(E):L(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):s?x(E):C(E))}return E===45||He(E)?(e.consume(E),o+=String.fromCharCode(E),v):n(E)}function y(E){return E===62?(e.consume(E),r.interrupt?t:L):n(E)}function x(E){return he(E)?(e.consume(E),x):S(E)}function C(E){return E===47?(e.consume(E),S):E===58||E===95||Ve(E)?(e.consume(E),O):he(E)?(e.consume(E),C):S(E)}function O(E){return E===45||E===46||E===58||E===95||He(E)?(e.consume(E),O):j(E)}function j(E){return E===61?(e.consume(E),N):he(E)?(e.consume(E),j):C(E)}function N(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),u=E,B):he(E)?(e.consume(E),N):D(E)}function B(E){return E===u?(e.consume(E),u=null,R):E===null||se(E)?n(E):(e.consume(E),B)}function D(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||Se(E)?j(E):(e.consume(E),D)}function R(E){return E===47||E===62||he(E)?C(E):n(E)}function S(E){return E===62?(e.consume(E),T):n(E)}function T(E){return E===null||se(E)?L(E):he(E)?(e.consume(E),T):n(E)}function L(E){return E===45&&i===2?(e.consume(E),I):E===60&&i===1?(e.consume(E),W):E===62&&i===4?(e.consume(E),F):E===63&&i===3?(e.consume(E),g):E===93&&i===5?(e.consume(E),q):se(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Cp,$,M)(E)):E===null||se(E)?(e.exit("htmlFlowData"),M(E)):(e.consume(E),L)}function M(E){return e.check(Ap,w,$)(E)}function w(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),k}function k(E){return E===null||se(E)?M(E):(e.enter("htmlFlowData"),L(E))}function I(E){return E===45?(e.consume(E),g):L(E)}function W(E){return E===47?(e.consume(E),o="",U):L(E)}function U(E){if(E===62){const ie=o.toLowerCase();return Lo.includes(ie)?(e.consume(E),F):L(E)}return Ve(E)&&o.length<8?(e.consume(E),o+=String.fromCharCode(E),U):L(E)}function q(E){return E===93?(e.consume(E),g):L(E)}function g(E){return E===62?(e.consume(E),F):E===45&&i===2?(e.consume(E),g):L(E)}function F(E){return E===null||se(E)?(e.exit("htmlFlowData"),$(E)):(e.consume(E),F)}function $(E){return e.exit("htmlFlow"),t(E)}}function Rp(e,t,n){const r=this;return i;function i(o){return se(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function Op(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(yn,t,n)}}const Lp={name:"htmlText",tokenize:jp};function jp(e,t,n){const r=this;let i,s,o;return l;function l(g){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(g),u}function u(g){return g===33?(e.consume(g),c):g===47?(e.consume(g),j):g===63?(e.consume(g),C):Ve(g)?(e.consume(g),D):n(g)}function c(g){return g===45?(e.consume(g),d):g===91?(e.consume(g),s=0,b):Ve(g)?(e.consume(g),x):n(g)}function d(g){return g===45?(e.consume(g),f):n(g)}function p(g){return g===null?n(g):g===45?(e.consume(g),m):se(g)?(o=p,W(g)):(e.consume(g),p)}function m(g){return g===45?(e.consume(g),f):p(g)}function f(g){return g===62?I(g):g===45?m(g):p(g)}function b(g){const F="CDATA[";return g===F.charCodeAt(s++)?(e.consume(g),s===F.length?h:b):n(g)}function h(g){return g===null?n(g):g===93?(e.consume(g),v):se(g)?(o=h,W(g)):(e.consume(g),h)}function v(g){return g===93?(e.consume(g),y):h(g)}function y(g){return g===62?I(g):g===93?(e.consume(g),y):h(g)}function x(g){return g===null||g===62?I(g):se(g)?(o=x,W(g)):(e.consume(g),x)}function C(g){return g===null?n(g):g===63?(e.consume(g),O):se(g)?(o=C,W(g)):(e.consume(g),C)}function O(g){return g===62?I(g):C(g)}function j(g){return Ve(g)?(e.consume(g),N):n(g)}function N(g){return g===45||He(g)?(e.consume(g),N):B(g)}function B(g){return se(g)?(o=B,W(g)):he(g)?(e.consume(g),B):I(g)}function D(g){return g===45||He(g)?(e.consume(g),D):g===47||g===62||Se(g)?R(g):n(g)}function R(g){return g===47?(e.consume(g),I):g===58||g===95||Ve(g)?(e.consume(g),S):se(g)?(o=R,W(g)):he(g)?(e.consume(g),R):I(g)}function S(g){return g===45||g===46||g===58||g===95||He(g)?(e.consume(g),S):T(g)}function T(g){return g===61?(e.consume(g),L):se(g)?(o=T,W(g)):he(g)?(e.consume(g),T):R(g)}function L(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),i=g,M):se(g)?(o=L,W(g)):he(g)?(e.consume(g),L):(e.consume(g),w)}function M(g){return g===i?(e.consume(g),i=void 0,k):g===null?n(g):se(g)?(o=M,W(g)):(e.consume(g),M)}function w(g){return g===null||g===34||g===39||g===60||g===61||g===96?n(g):g===47||g===62||Se(g)?R(g):(e.consume(g),w)}function k(g){return g===47||g===62||Se(g)?R(g):n(g)}function I(g){return g===62?(e.consume(g),e.exit("htmlTextData"),e.exit("htmlText"),t):n(g)}function W(g){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),U}function U(g){return he(g)?Ee(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(g):q(g)}function q(g){return e.enter("htmlTextData"),o(g)}}const ci={name:"labelEnd",resolveAll:Fp,resolveTo:zp,tokenize:$p},Dp={tokenize:Up},Pp={tokenize:Hp},Bp={tokenize:Wp};function Fp(e){let t=-1;const n=[];for(;++t=3&&(c===null||se(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),he(c)?Ee(e,l,"whitespace")(c):l(c))}}const Ye={continuation:{tokenize:ef},exit:nf,name:"list",tokenize:Qp},Zp={partial:!0,tokenize:rf},Jp={partial:!0,tokenize:tf};function Qp(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(f){const b=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Ur(f)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Fn,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(f)}return n(f)}function u(f){return Ur(f)&&++o<10?(e.consume(f),u):(!r.interrupt||o<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(yn,r.interrupt?n:d,e.attempt(Zp,m,p))}function d(f){return r.containerState.initialBlankLine=!0,s++,m(f)}function p(f){return he(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),m):n(f)}function m(f){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function ef(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yn,i,s);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ee(e,t,"listItemIndent",r.containerState.size+1)(l)}function s(l){return r.containerState.furtherBlankLines||!he(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Jp,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ee(e,e.attempt(Ye,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function tf(e,t,n){const r=this;return Ee(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function nf(e){e.exit(this.containerState.type)}function rf(e,t,n){const r=this;return Ee(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!he(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const jo={name:"setextUnderline",resolveTo:of,tokenize:sf};function of(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function sf(e,t,n){const r=this;let i;return s;function s(c){let d=r.events.length,p;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){p=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===i?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),he(c)?Ee(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||se(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const af={tokenize:lf};function lf(e){const t=this,n=e.attempt(yn,r,e.attempt(this.parser.constructs.flowInitial,i,Ee(e,e.attempt(this.parser.constructs.flow,i,e.attempt(pp,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const cf={resolveAll:sa()},uf=oa("string"),df=oa("text");function oa(e){return{resolveAll:sa(e==="text"?pf:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,l);return o;function o(d){return c(d)?s(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return c(d)?(n.exit("data"),s(d)):(n.consume(d),u)}function c(d){if(d===null)return!0;const p=i[d];let m=-1;if(p)for(;++m-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function Nf(e,t){let n=-1;const r=[];let i;for(;++n0){const Ke=ee.tokenStack[ee.tokenStack.length-1];(Ke[1]||Do).call(ee,void 0,Ke[0])}for(G.position={start:Rt(B.length>0?B[0][1].start:{line:1,column:1,offset:0}),end:Rt(B.length>0?B[B.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we0){const Ke=ee.tokenStack[ee.tokenStack.length-1];(Ke[1]||Po).call(ee,void 0,Ke[0])}for(G.position={start:Rt(P.length>0?P[0][1].start:{line:1,column:1,offset:0}),end:Rt(P.length>0?P[P.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function Ff(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zf(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $f(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=on(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,l+=1,e.footnoteCounts.set(r,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function Uf(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hf(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ca(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Wf(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ca(e,t);const i={src:on(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function Kf(e,t){const n={src:on(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Gf(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function qf(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ca(e,t);const i={href:on(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Vf(e,t){const n={href:on(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Yf(e,t,n){const r=e.all(t),i=n?Xf(n):ua(t),s={},o=[];if(typeof t.checked=="boolean"){const d=r[0];let p;d&&d.type==="element"&&d.tagName==="p"?p=d:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l1}function Zf(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=ni(t.children[1]),u=Hs(t.children[t.children.length-1]);l&&u&&(o.position={start:l,end:u}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function nm(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let u=-1;const c=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(Fo(t.slice(i),i>0,!1)),s.join("")}function Fo(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===Po||s===Bo;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===Po||s===Bo;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function om(e,t){const n={type:"text",value:im(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function sm(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const am={blockquote:Df,break:Pf,code:Bf,delete:Ff,emphasis:zf,footnoteReference:$f,heading:Uf,html:Hf,imageReference:Wf,image:Kf,inlineCode:Gf,linkReference:qf,link:Vf,listItem:Yf,list:Zf,paragraph:Jf,root:Qf,strong:em,table:tm,tableCell:rm,tableRow:nm,text:om,thematicBreak:sm,toml:Mn,yaml:Mn,definition:Mn,footnoteDefinition:Mn};function Mn(){}const da=-1,er=0,gn=1,Wn=2,ci=3,ui=4,di=5,pi=6,pa=7,fa=8,zo=typeof self=="object"?self:globalThis,lm=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case er:case da:return n(o,i);case gn:{const l=n([],i);for(const u of o)l.push(r(u));return l}case Wn:{const l=n({},i);for(const[u,c]of o)l[r(u)]=r(c);return l}case ci:return n(new Date(o),i);case ui:{const{source:l,flags:u}=o;return n(new RegExp(l,u),i)}case di:{const l=n(new Map,i);for(const[u,c]of o)l.set(r(u),r(c));return l}case pi:{const l=n(new Set,i);for(const u of o)l.add(r(u));return l}case pa:{const{name:l,message:u}=o;return n(new zo[l](u),i)}case fa:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(new zo[s](o),i)};return r},$o=e=>lm(new Map,e)(0),Xt="",{toString:cm}={},{keys:um}=Object,un=e=>{const t=typeof e;if(t!=="object"||!e)return[er,t];const n=cm.call(e).slice(8,-1);switch(n){case"Array":return[gn,Xt];case"Object":return[Wn,Xt];case"Date":return[ci,Xt];case"RegExp":return[ui,Xt];case"Map":return[di,Xt];case"Set":return[pi,Xt];case"DataView":return[gn,n]}return n.includes("Array")?[gn,n]:n.includes("Error")?[pa,n]:[Wn,n]},In=([e,t])=>e===er&&(t==="function"||t==="symbol"),dm=(e,t,n,r)=>{const i=(o,l)=>{const u=r.push(o)-1;return n.set(l,u),u},s=o=>{if(n.has(o))return n.get(o);let[l,u]=un(o);switch(l){case er:{let d=o;switch(u){case"bigint":l=fa,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return i([da],o)}return i([l,d],o)}case gn:{if(u){let m=o;return u==="DataView"?m=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(m=new Uint8Array(o)),i([u,[...m]],o)}const d=[],p=i([l,d],o);for(const m of o)d.push(s(m));return p}case Wn:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const d=[],p=i([l,d],o);for(const m of um(o))(e||!In(un(o[m])))&&d.push([s(m),s(o[m])]);return p}case ci:return i([l,o.toISOString()],o);case ui:{const{source:d,flags:p}=o;return i([l,{source:d,flags:p}],o)}case di:{const d=[],p=i([l,d],o);for(const[m,f]of o)(e||!(In(un(m))||In(un(f))))&&d.push([s(m),s(f)]);return p}case pi:{const d=[],p=i([l,d],o);for(const m of o)(e||!In(un(m)))&&d.push(s(m));return p}}const{message:c}=o;return i([l,{name:u,message:c}],o)};return s},Uo=(e,{json:t,lossy:n}={})=>{const r=[];return dm(!(t||n),!!t,new Map,r)(e),r},Kn=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?$o(Uo(e,t)):structuredClone(e):(e,t)=>$o(Uo(e,t));function pm(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function fm(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function mm(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||pm,r=e.options.footnoteBackLabel||fm,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u0&&h.push({type:"text",value:" "});let w=typeof n=="string"?n:n(u,f);typeof w=="string"&&(w={type:"text",value:w}),h.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,f),className:["data-footnote-backref"]},children:Array.isArray(w)?w:[w]})}const x=d[d.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const w=x.children[x.children.length-1];w&&w.type==="text"?w.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(...h)}else d.push(...h);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(d,!0)};e.patch(c,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Kn(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`});const c={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,c),e.applyData(t,c)}function Xf(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r1}function Zf(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=ri(t.children[1]),u=Hs(t.children[t.children.length-1]);l&&u&&(o.position={start:l,end:u}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function nm(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let u=-1;const c=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(zo(t.slice(i),i>0,!1)),s.join("")}function zo(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===Bo||s===Fo;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===Bo||s===Fo;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function om(e,t){const n={type:"text",value:im(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function sm(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const am={blockquote:Df,break:Pf,code:Bf,delete:Ff,emphasis:zf,footnoteReference:$f,heading:Uf,html:Hf,imageReference:Wf,image:Kf,inlineCode:Gf,linkReference:qf,link:Vf,listItem:Yf,list:Zf,paragraph:Jf,root:Qf,strong:em,table:tm,tableCell:rm,tableRow:nm,text:om,thematicBreak:sm,toml:Mn,yaml:Mn,definition:Mn,footnoteDefinition:Mn};function Mn(){}const da=-1,er=0,gn=1,Wn=2,ui=3,di=4,pi=5,fi=6,pa=7,fa=8,$o=typeof self=="object"?self:globalThis,lm=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case er:case da:return n(o,i);case gn:{const l=n([],i);for(const u of o)l.push(r(u));return l}case Wn:{const l=n({},i);for(const[u,c]of o)l[r(u)]=r(c);return l}case ui:return n(new Date(o),i);case di:{const{source:l,flags:u}=o;return n(new RegExp(l,u),i)}case pi:{const l=n(new Map,i);for(const[u,c]of o)l.set(r(u),r(c));return l}case fi:{const l=n(new Set,i);for(const u of o)l.add(r(u));return l}case pa:{const{name:l,message:u}=o;return n(new $o[l](u),i)}case fa:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(new $o[s](o),i)};return r},Uo=e=>lm(new Map,e)(0),Xt="",{toString:cm}={},{keys:um}=Object,un=e=>{const t=typeof e;if(t!=="object"||!e)return[er,t];const n=cm.call(e).slice(8,-1);switch(n){case"Array":return[gn,Xt];case"Object":return[Wn,Xt];case"Date":return[ui,Xt];case"RegExp":return[di,Xt];case"Map":return[pi,Xt];case"Set":return[fi,Xt];case"DataView":return[gn,n]}return n.includes("Array")?[gn,n]:n.includes("Error")?[pa,n]:[Wn,n]},In=([e,t])=>e===er&&(t==="function"||t==="symbol"),dm=(e,t,n,r)=>{const i=(o,l)=>{const u=r.push(o)-1;return n.set(l,u),u},s=o=>{if(n.has(o))return n.get(o);let[l,u]=un(o);switch(l){case er:{let d=o;switch(u){case"bigint":l=fa,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return i([da],o)}return i([l,d],o)}case gn:{if(u){let m=o;return u==="DataView"?m=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(m=new Uint8Array(o)),i([u,[...m]],o)}const d=[],p=i([l,d],o);for(const m of o)d.push(s(m));return p}case Wn:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const d=[],p=i([l,d],o);for(const m of um(o))(e||!In(un(o[m])))&&d.push([s(m),s(o[m])]);return p}case ui:return i([l,o.toISOString()],o);case di:{const{source:d,flags:p}=o;return i([l,{source:d,flags:p}],o)}case pi:{const d=[],p=i([l,d],o);for(const[m,f]of o)(e||!(In(un(m))||In(un(f))))&&d.push([s(m),s(f)]);return p}case fi:{const d=[],p=i([l,d],o);for(const m of o)(e||!In(un(m)))&&d.push(s(m));return p}}const{message:c}=o;return i([l,{name:u,message:c}],o)};return s},Ho=(e,{json:t,lossy:n}={})=>{const r=[];return dm(!(t||n),!!t,new Map,r)(e),r},Kn=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Uo(Ho(e,t)):structuredClone(e):(e,t)=>Uo(Ho(e,t));function pm(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function fm(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function mm(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||pm,r=e.options.footnoteBackLabel||fm,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u0&&b.push({type:"text",value:" "});let x=typeof n=="string"?n:n(u,f);typeof x=="string"&&(x={type:"text",value:x}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,f),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const x=v.children[v.children.length-1];x&&x.type==="text"?x.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...b)}else d.push(...b);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(d,!0)};e.patch(c,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Kn(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` -`}]}}const vn=(function(e){if(e==null)return xm;if(typeof e=="function")return tr(e);if(typeof e=="object")return Array.isArray(e)?gm(e):hm(e);if(typeof e=="string")return bm(e);throw new Error("Expected function, string, or object as test")});function gm(e){const t=[];let n=-1;for(;++n":""))+")"})}return m;function m(){let f=ma,h,b,x;if((!t||s(u,c,d[d.length-1]||void 0))&&(f=Em(n(u,d)),f[0]===Wr))return f;if("children"in u&&u.children){const y=u;if(y.children&&f[0]!==km)for(b=(r?y.children.length:-1)+o,x=d.concat(y);b>-1&&b":""))+")"})}return m;function m(){let f=ma,b,h,v;if((!t||s(u,c,d[d.length-1]||void 0))&&(f=Em(n(u,d)),f[0]===Wr))return f;if("children"in u&&u.children){const y=u;if(y.children&&f[0]!==km)for(h=(r?y.children.length:-1)+o,v=d.concat(y);h>-1&&h0&&n.push({type:"text",value:` -`}),n}function Ho(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Wo(e,t){const n=_m(e,t),r=n.one(e,void 0),i=mm(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:` -`},i),s}function Am(e,t){return e&&"run"in e?async function(n,r){const i=Wo(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Wo(n,{file:r,...e||t})}}function Ko(e){if(e)throw e}var yr,Go;function Mm(){if(Go)return yr;Go=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},s=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var d=e.call(c,"constructor"),p=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!p)return!1;var m;for(m in c);return typeof m>"u"||e.call(c,m)},o=function(c,d){n&&d.name==="__proto__"?n(c,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):c[d.name]=d.newValue},l=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(r)return r(c,d).value}else return;return c[d]};return yr=function u(){var c,d,p,m,f,h,b=arguments[0],x=1,y=arguments.length,w=!1;for(typeof b=="boolean"&&(w=b,b=arguments[1]||{},x=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});xo.length;let u;l&&o.push(i);try{u=e.apply(this,o)}catch(c){const d=c;if(l&&n)throw d;return i(d)}l||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(o,...l){n||(n=!0,t(o,...l))}function s(o){i(null,o)}}const gt={basename:Lm,dirname:jm,extname:Dm,join:Pm,sep:"/"};function Lm(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');kn(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function jm(e){if(kn(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Dm(e){kn(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Pm(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Fm(e,t){let n="",r=0,i=-1,s=0,o=-1,l,u;for(;++o<=e.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else l===46&&s>-1?s++:s=-1}return n}function kn(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const zm={cwd:$m};function $m(){return"/"}function qr(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Um(e){if(typeof e=="string")e=new URL(e);else if(!qr(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Hm(e)}function Hm(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[f,...h]=d;const b=r[m][1];Gr(b)&&Gr(f)&&(f=vr(!0,b,f)),r[m]=[c,f,...h]}}}}const qm=new fi().freeze();function _r(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Nr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Sr(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Vo(e){if(!Gr(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Yo(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Rn(e){return Vm(e)?e:new ha(e)}function Vm(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ym(e){return typeof e=="string"||Xm(e)}function Xm(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Zm="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Xo=[],Zo={allowDangerousHtml:!0},Jm=/^(https?|ircs?|mailto|xmpp)$/i,Qm=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function eg(e){const t=tg(e),n=ng(e);return rg(t.runSync(t.parse(n),n),e)}function tg(e){const t=e.rehypePlugins||Xo,n=e.remarkPlugins||Xo,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Zo}:Zo;return qm().use(jf).use(n).use(Am,r).use(t)}function ng(e){const t=e.children||"",n=new ha;return typeof t=="string"&&(n.value=t),n}function rg(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||ig;for(const d of Qm)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Zm+d.id,void 0);return nr(e,c),bd(e,{Fragment:a.Fragment,components:i,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function c(d,p,m){if(d.type==="raw"&&m&&typeof p=="number")return o?m.children.splice(p,1):m.children[p]={type:"text",value:d.value},p;if(d.type==="element"){let f;for(f in hr)if(Object.hasOwn(hr,f)&&Object.hasOwn(d.properties,f)){const h=d.properties[f],b=hr[f];(b===null||b.includes(d.tagName))&&(d.properties[f]=u(String(h||""),f,d))}}if(d.type==="element"){let f=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!f&&r&&typeof p=="number"&&(f=!r(d,p,m)),f&&m&&typeof p=="number")return l&&d.children?m.children.splice(p,1,...d.children):m.children.splice(p,1),p}}}function ig(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Jm.test(e.slice(0,t))?e:""}const Jo=(function(e,t,n){const r=vn(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tc&&(c=d):d&&(c!==void 0&&c>-1&&u.push(` -`.repeat(c)||" "),c=-1,u.push(d))}return u.join("")}function xa(e,t,n){return e.type==="element"?pg(e,t,n):e.type==="text"?n.whitespace==="normal"?ya(e,n):fg(e):[]}function pg(e,t,n){const r=va(e,n),i=e.children||[];let s=-1,o=[];if(ug(e))return o;let l,u;for(Vr(e)||ns(e)&&Jo(t,e,ns)?u=` -`:cg(e)?(l=2,u=2):ba(e)&&(l=1,u=1);++s]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},f=t.optional(i)+e.IDENT_RE+"\\s*\\(",h=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],x=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],j={type:b,keyword:h,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:x},O={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[O,p,l,n,e.C_BLOCK_COMMENT_MODE,d,c],P={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:_.concat([{begin:/\(/,end:/\)/,keywords:j,contains:_.concat(["self"]),relevance:0}]),relevance:0},D={className:"function",begin:"("+o+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:j,relevance:0},{begin:f,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,d,l,{begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:j,illegal:"",keywords:j,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:j},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function yg(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=xg(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function vg(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(l);const u={match:/\\"/},c={className:"string",begin:/'/,end:/'/},d={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},m=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],f=e.SHEBANG({binary:`(${m.join("|")})`,relevance:10}),h={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},b=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],x=["true","false"],y={match:/(\/[a-z._-]+)+/},w=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],T=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],j=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],O=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:b,literal:x,built_in:[...w,...T,"set","shopt",...j,...O]},contains:[f,e.SHEBANG(),h,p,s,o,y,l,u,c,d,n]}}function kg(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},f=t.optional(i)+e.IDENT_RE+"\\s*\\(",x={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[p,l,n,e.C_BLOCK_COMMENT_MODE,d,c],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:x,contains:y.concat([{begin:/\(/,end:/\)/,keywords:x,contains:y.concat(["self"]),relevance:0}]),relevance:0},T={begin:"("+o+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:x,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:x,relevance:0},{begin:f,returnBegin:!0,contains:[e.inherit(m,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,d,l,{begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C",aliases:["h"],keywords:x,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:p,strings:c,keywords:x}}}function Eg(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},f=t.optional(i)+e.IDENT_RE+"\\s*\\(",h=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],b=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],x=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],j={type:b,keyword:h,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:x},O={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},_=[O,p,l,n,e.C_BLOCK_COMMENT_MODE,d,c],P={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:j,contains:_.concat([{begin:/\(/,end:/\)/,keywords:j,contains:_.concat(["self"]),relevance:0}]),relevance:0},D={className:"function",begin:"("+o+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:j,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:j,relevance:0},{begin:f,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,d,l,{begin:/\(/,end:/\)/,keywords:j,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:j,illegal:"",keywords:j,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:j},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function wg(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:i.concat(s),built_in:t,literal:r},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=e.inherit(d,{illegal:/\n/}),m={className:"subst",begin:/\{/,end:/\}/,keywords:o},f=e.inherit(m,{illegal:/\n/}),h={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,f]},b={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]},x=e.inherit(b,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]});m.contains=[b,h,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,e.C_BLOCK_COMMENT_MODE],f.contains=[x,h,p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[c,b,h,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},w={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},T=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",j={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,u,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,w,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,w,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+T+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,w],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[y,u,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},j]}}const _g=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Ng=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Sg=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Tg=[...Ng,...Sg],Cg=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Ag=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Mg=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ig=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Rg(e){const t=e.regex,n=_g(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Ag.join("|")+")"},{begin:":(:)?("+Mg.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ig.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:Cg.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Tg.join("|")+")\\b"}]}}function Og(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Lg(e){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"ka(e,t,n-1))}function Pg(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+ka("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),u={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:u,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:u,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,rs,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},rs,c]}}const is="[A-Za-z$_][0-9A-Za-z$_]*",Bg=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Fg=["true","false","null","undefined","NaN","Infinity"],Ea=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],wa=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],_a=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],zg=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],$g=[].concat(_a,Ea,wa);function Ug(e){const t=e.regex,n=(U,{after:V})=>{const g="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,V)=>{const g=U[0].length+U.index,F=U.input[g];if(F==="<"||F===","){V.ignoreMatch();return}F===">"&&(n(U,{after:g})||V.ignoreMatch());let $;const k=U.input.substring(g);if($=k.match(/^\s*=/)){V.ignoreMatch();return}if(($=k.match(/^\s+extends\s+/))&&$.index===0){V.ignoreMatch();return}}},l={$pattern:is,keyword:Bg,literal:Fg,built_in:$g,"variable.language":zg},u="[0-9](_?[0-9])*",c=`\\.(${u})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${d})((${c})|\\.)?|(${c}))[eE][+-]?(${u})\\b`},{begin:`\\b(${d})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},h={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},x={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,m]},w={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},T=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,h,b,x,{match:/\$\d+/},p];m.contains=T.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(T)});const j=[].concat(w,m.contains),O=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(j)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:O},P={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},D={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Ea,...wa]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},S={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},M={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function L(U){return t.concat("(?!",U.join("|"),")")}const C={match:t.concat(/\b/,L([..._a,"super","import"].map(U=>`${U}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},v={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},E={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",H={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:O,CLASS_REFERENCE:D},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,h,b,x,w,{match:/\$\d+/},p,D,{scope:"attr",match:r+t.lookahead(":"),relevance:0},H,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,e.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:O}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},S,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},v,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},C,M,P,E,{match:/\$[(.]/}]}}function Hg(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Jt="[0-9](_*[0-9])*",jn=`\\.(${Jt})`,Dn="[0-9a-fA-F](_*[0-9a-fA-F])*",Wg={className:"number",variants:[{begin:`(\\b(${Jt})((${jn})|\\.)?|(${jn}))[eE][+-]?(${Jt})[fFdD]?\\b`},{begin:`\\b(${Jt})((${jn})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${jn})[fFdD]?\\b`},{begin:`\\b(${Jt})[fFdD]\\b`},{begin:`\\b0[xX]((${Dn})\\.?|(${Dn})?\\.(${Dn}))[pP][+-]?(${Jt})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Dn})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Kg(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,i]}]};i.contains.push(o);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},u={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},c=Wg,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),p={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},m=p;return m.variants[1].contains=[p],p.variants[1].contains=[m],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,r,l,u,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[p,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,l,u,o,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,u]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},c]}}const Gg=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),qg=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Vg=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Yg=[...qg,...Vg],Xg=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Na=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Sa=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Zg=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),Jg=Na.concat(Sa).sort().reverse();function Qg(e){const t=Gg(e),n=Jg,r="and or not only",i="[\\w-]+",s="("+i+"|@\\{"+i+"\\})",o=[],l=[],u=function(T){return{className:"string",begin:"~?"+T+".*?"+T}},c=function(T,j,O){return{className:T,begin:j,relevance:O}},d={$pattern:/[a-z-]+/,keyword:r,attribute:Xg.join(" ")},p={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,u("'"),u('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,p,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const m=l.concat({begin:/\{/,end:/\}/,contains:o}),f={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},h={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Zg.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},b={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:l,relevance:0}},x={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:m}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+Yg.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,c("selector-tag",s,0),c("selector-id","#"+s),c("selector-class","\\."+s,0),c("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Na.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Sa.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:m},{begin:"!important"},t.FUNCTION_DISPATCH]},w={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,x,w,h,y,f,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function eh(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function th(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=e.inherit(c,{contains:[]}),m=e.inherit(d,{contains:[]});c.contains.push(m),d.contains.push(p);let f=[n,u];return[c,d,p,m].forEach(y=>{y.contains=y.contains.concat(f)}),f=f.concat(c,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:f},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:f}]}]},n,s,c,d,{className:"quote",begin:"^>\\s+",contains:f,end:"$"},i,r,u,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function rh(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},u={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+u.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:u,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function ih(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},o={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},u={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,s,u],p=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],m=(b,x,y="\\1")=>{const w=y==="\\1"?y:t.concat(y,x);return t.concat(t.concat("(?:",b,")"),x,/(?:\\.|[^\\\/])*?/,w,/(?:\\.|[^\\\/])*?/,y,r)},f=(b,x,y)=>t.concat(t.concat("(?:",b,")"),x,/(?:\\.|[^\\\/])*?/,y,r),h=[u,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:m("s|tr|y",t.either(...p,{capture:!0}))},{begin:m("s|tr|y","\\(","\\)")},{begin:m("s|tr|y","\\[","\\]")},{begin:m("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:f("(?:m|qr)?",/\//,/\//)},{begin:f("m|qr",t.either(...p,{capture:!0}),/\1/)},{begin:f("m|qr",/\(/,/\)/)},{begin:f("m|qr",/\[/,/\]/)},{begin:f("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=h,o.contains=h,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:h}}function oh(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+r},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},u={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(u)}),p={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(u),"on:begin":(v,E)=>{E.data._beginMatch=v[1]||v[2]},"on:end":(v,E)=>{E.data._beginMatch!==v[1]&&E.ignoreMatch()}},m=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),f=`[ -]`,h={scope:"string",variants:[d,c,p,m]},b={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},x=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],w=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],j={keyword:y,literal:(v=>{const E=[];return v.forEach(I=>{E.push(I),I.toLowerCase()===I?E.push(I.toUpperCase()):E.push(I.toLowerCase())}),E})(x),built_in:w},O=v=>v.map(E=>E.replace(/\|\d+$/,"")),_={variants:[{match:[/new/,t.concat(f,"+"),t.concat("(?!",O(w).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},P=t.concat(r,"\\b(?!\\()"),D={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),P],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),P],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},R={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},S={relevance:0,begin:/\(/,end:/\)/,keywords:j,contains:[R,o,D,e.C_BLOCK_COMMENT_MODE,h,b,_]},M={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",O(y).join("\\b|"),"|",O(w).join("\\b|"),"\\b)"),r,t.concat(f,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[S]};S.contains.push(M);const L=[R,D,e.C_BLOCK_COMMENT_MODE,h,b,_],C={begin:t.concat(/#\[\s*\\?/,t.either(i,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:x,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:x,keyword:["new","array"]},contains:["self",...L]},...L,{scope:"meta",variants:[{match:i},{match:s}]}]};return{case_insensitive:!1,keywords:j,contains:[C,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,M,D,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},_,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:j,contains:["self",C,o,D,e.C_BLOCK_COMMENT_MODE,h,b]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},h,b]}}function sh(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function ah(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function lh(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},p={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u,d,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u,d,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},m="[0-9](_?[0-9])*",f=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,h=`\\b|${r.join("|")}`,b={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${f}))[eE][+-]?(${m})[jJ]?(?=${h})`},{begin:`(${f})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${h})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${h})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${h})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${h})`},{begin:`\\b(${m})[jJ](?=${h})`}]},x={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",u,b,p,e.HASH_COMMENT_MODE]}]};return c.contains=[p,b,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[u,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,x,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,y,p]}]}}function ch(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function uh(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[s,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function dh(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},u={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:o},p={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},m="[1-9](_?[0-9])*|0",f="[0-9](_?[0-9])*",h={className:"number",relevance:0,variants:[{begin:`\\b(${m})(\\.(${f}))?([eE][+-]?(${f})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},b={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},_=[p,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:n}],relevance:0},h,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(u,c),relevance:0}].concat(u,c);d.contains=_,b.contains=_;const S=[{begin:/^\s*=>/,starts:{end:"$",contains:_}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:_}}];return c.unshift(u),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(S).concat(c).concat(_)}}function ph(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],u=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:l,literal:u,built_in:c},illegal:""},s]}}const fh=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),mh=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],gh=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],hh=[...mh,...gh],bh=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),xh=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),yh=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),vh=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function kh(e){const t=fh(e),n=yh,r=xh,i="@[a-z-]+",s="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+hh.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+vh.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,l,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:bh.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function Eh(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function wh(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],u=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],p=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],m=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],f=d,h=[...c,...u].filter(O=>!d.includes(O)),b={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},x={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...f),/\s*\(/),relevance:0,keywords:{built_in:f}};function w(O){return t.concat(/\b/,t.either(...O.map(_=>_.replace(/\s+/,"\\s+"))),/\b/)}const T={scope:"keyword",match:w(m),relevance:0};function j(O,{exceptions:_,when:P}={}){const D=P;return _=_||[],O.map(R=>R.match(/\|\d+$/)||_.includes(R)?R:D(R)?`${R}|0`:R)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:j(h,{when:O=>O.length<3}),literal:s,type:l,built_in:p},contains:[{scope:"type",match:w(o)},T,y,b,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,x]}}function Ta(e){return e?typeof e=="string"?e:e.source:null}function dn(e){return Ne("(?=",e,")")}function Ne(...e){return e.map(n=>Ta(n)).join("")}function _h(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function qe(...e){return"("+(_h(e).capture?"":"?:")+e.map(r=>Ta(r)).join("|")+")"}const gi=e=>Ne(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Nh=["Protocol","Type"].map(gi),os=["init","self"].map(gi),Sh=["Any","Self"],Tr=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],ss=["false","nil","true"],Th=["assignment","associativity","higherThan","left","lowerThan","none","right"],Ch=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],as=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Ca=qe(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Aa=qe(Ca,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Cr=Ne(Ca,Aa,"*"),Ma=qe(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Gn=qe(Ma,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),mt=Ne(Ma,Gn,"*"),Pn=Ne(/[A-Z]/,Gn,"*"),Ah=["attached","autoclosure",Ne(/convention\(/,qe("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Ne(/objc\(/,mt,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Mh=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Ih(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,qe(...Nh,...os)],className:{2:"keyword"}},s={match:Ne(/\./,qe(...Tr)),relevance:0},o=Tr.filter(ve=>typeof ve=="string").concat(["_|0"]),l=Tr.filter(ve=>typeof ve!="string").concat(Sh).map(gi),u={variants:[{className:"keyword",match:qe(...l,...os)}]},c={$pattern:qe(/\b\w+/,/#\w+/),keyword:o.concat(Ch),literal:ss},d=[i,s,u],p={match:Ne(/\./,qe(...as)),relevance:0},m={className:"built_in",match:Ne(/\b/,qe(...as),/(?=\()/)},f=[p,m],h={match:/->/,relevance:0},b={className:"operator",relevance:0,variants:[{match:Cr},{match:`\\.(\\.|${Aa})+`}]},x=[h,b],y="([0-9]_*)+",w="([0-9a-fA-F]_*)+",T={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${w})(\\.(${w}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},j=(ve="")=>({className:"subst",variants:[{match:Ne(/\\/,ve,/[0\\tnr"']/)},{match:Ne(/\\/,ve,/u\{[0-9a-fA-F]{1,8}\}/)}]}),O=(ve="")=>({className:"subst",match:Ne(/\\/,ve,/[\t ]*(?:[\r\n]|\r\n)/)}),_=(ve="")=>({className:"subst",label:"interpol",begin:Ne(/\\/,ve,/\(/),end:/\)/}),P=(ve="")=>({begin:Ne(ve,/"""/),end:Ne(/"""/,ve),contains:[j(ve),O(ve),_(ve)]}),D=(ve="")=>({begin:Ne(ve,/"/),end:Ne(/"/,ve),contains:[j(ve),_(ve)]}),R={className:"string",variants:[P(),P("#"),P("##"),P("###"),D(),D("#"),D("##"),D("###")]},S=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],M={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:S},L=ve=>{const lt=Ne(ve,/\//),rt=Ne(/\//,ve);return{begin:lt,end:rt,contains:[...S,{scope:"comment",begin:`#(?!.*${rt})`,end:/$/}]}},C={scope:"regexp",variants:[L("###"),L("##"),L("#"),M]},v={match:Ne(/`/,mt,/`/)},E={className:"variable",match:/\$\d+/},I={className:"variable",match:`\\$${Gn}+`},H=[v,E,I],U={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Mh,contains:[...x,T,R]}]}},V={scope:"keyword",match:Ne(/@/,qe(...Ah),dn(qe(/\(/,/\s+/)))},g={scope:"meta",match:Ne(/@/,mt)},F=[U,V,g],$={match:dn(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Ne(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Gn,"+")},{className:"type",match:Pn,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Ne(/\s+&\s+/,dn(Pn)),relevance:0}]},k={begin://,keywords:c,contains:[...r,...d,...F,h,$]};$.contains.push(k);const ie={match:Ne(mt,/\s*:/),keywords:"_|0",relevance:0},K={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",ie,...r,C,...d,...f,...x,T,R,...H,...F,$]},W={begin://,keywords:"repeat each",contains:[...r,$]},re={begin:qe(dn(Ne(mt,/\s*:/)),dn(Ne(mt,/\s+/,mt,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:mt}]},de={begin:/\(/,end:/\)/,keywords:c,contains:[re,...r,...d,...x,T,R,...F,$,K],endsParent:!0,illegal:/["']/},xe={match:[/(func|macro)/,/\s+/,qe(v.match,mt,Cr)],className:{1:"keyword",3:"title.function"},contains:[W,de,t],illegal:[/\[/,/%/]},Oe={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[W,de,t],illegal:/\[|%/},Ie={match:[/operator/,/\s+/,Cr],className:{1:"keyword",3:"title"}},at={begin:[/precedencegroup/,/\s+/,Pn],className:{1:"keyword",3:"title"},contains:[$],keywords:[...Th,...ss],end:/}/},St={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Pt={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},yt={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,mt,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[W,...d,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:Pn},...d],relevance:0}]};for(const ve of R.variants){const lt=ve.contains.find(vt=>vt.label==="interpol");lt.keywords=c;const rt=[...d,...f,...x,T,R,...H];lt.contains=[...rt,{begin:/\(/,end:/\)/,contains:["self",...rt]}]}return{name:"Swift",keywords:c,contains:[...r,xe,Oe,St,Pt,yt,Ie,at,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},C,...d,...f,...x,T,R,...H,...F,$,K]}}const qn="[A-Za-z$_][0-9A-Za-z$_]*",Ia=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Ra=["true","false","null","undefined","NaN","Infinity"],Oa=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],La=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ja=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Da=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Pa=[].concat(ja,Oa,La);function Rh(e){const t=e.regex,n=(U,{after:V})=>{const g="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,V)=>{const g=U[0].length+U.index,F=U.input[g];if(F==="<"||F===","){V.ignoreMatch();return}F===">"&&(n(U,{after:g})||V.ignoreMatch());let $;const k=U.input.substring(g);if($=k.match(/^\s*=/)){V.ignoreMatch();return}if(($=k.match(/^\s+extends\s+/))&&$.index===0){V.ignoreMatch();return}}},l={$pattern:qn,keyword:Ia,literal:Ra,built_in:Pa,"variable.language":Da},u="[0-9](_?[0-9])*",c=`\\.(${u})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${d})((${c})|\\.)?|(${c}))[eE][+-]?(${u})\\b`},{begin:`\\b(${d})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},h={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"css"}},b={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},x={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,m]},w={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},T=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,h,b,x,{match:/\$\d+/},p];m.contains=T.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(T)});const j=[].concat(w,m.contains),O=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(j)}]),_={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:O},P={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},D={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Oa,...La]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},S={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[_],illegal:/%/},M={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function L(U){return t.concat("(?!",U.join("|"),")")}const C={match:t.concat(/\b/,L([...ja,"super","import"].map(U=>`${U}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},v={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},E={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},_]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",H={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[_]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:O,CLASS_REFERENCE:D},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,h,b,x,w,{match:/\$\d+/},p,D,{scope:"attr",match:r+t.lookahead(":"),relevance:0},H,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,e.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:O}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},S,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[_,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},v,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[_]},C,M,P,E,{match:/\$[(.]/}]}}function Oh(e){const t=e.regex,n=Rh(e),r=qn,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:qn,keyword:Ia.concat(u),literal:Ra,built_in:Pa.concat(i),"variable.language":Da},d={className:"meta",begin:"@"+r},p=(b,x,y)=>{const w=b.contains.findIndex(T=>T.label===x);if(w===-1)throw new Error("can not find mode to replace");b.contains.splice(w,1,y)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(d);const m=n.contains.find(b=>b.scope==="attr"),f=Object.assign({},m,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,m,f]),n.contains=n.contains.concat([d,s,o,f]),p(n,"shebang",e.SHEBANG()),p(n,"use_strict",l);const h=n.contains.find(b=>b.label==="func.def");return h.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Lh(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,u={className:"literal",variants:[{begin:t.concat(/# */,t.either(s,i),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(s,i),/ +/,t.either(o,l),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},p=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),m=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,u,c,d,p,m,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[m]}]}}function jh(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},u={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,i,e.QUOTE_STRING_MODE,u,c,l]}}function Dh(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(s,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),u=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[s,u,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,o,u,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Ph(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},l=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),m={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},f={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},h={begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},b={begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},x=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},m,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},h,b,s,o],y=[...x];return y.pop(),y.push(l),f.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:x}}const Bh={arduino:yg,bash:vg,c:kg,cpp:Eg,csharp:wg,css:Rg,diff:Og,go:Lg,graphql:jg,ini:Dg,java:Pg,javascript:Ug,json:Hg,kotlin:Kg,less:Qg,lua:eh,makefile:th,markdown:nh,objectivec:rh,perl:ih,php:oh,"php-template":sh,plaintext:ah,python:lh,"python-repl":ch,r:uh,ruby:dh,rust:ph,scss:kh,shell:Eh,sql:wh,swift:Ih,typescript:Oh,vbnet:Lh,wasm:jh,xml:Dh,yaml:Ph};var Ar,ls;function Fh(){if(ls)return Ar;ls=1;function e(A){return A instanceof Map?A.clear=A.delete=A.set=function(){throw new Error("map is read-only")}:A instanceof Set&&(A.add=A.clear=A.delete=function(){throw new Error("set is read-only")}),Object.freeze(A),Object.getOwnPropertyNames(A).forEach(z=>{const X=A[z],ce=typeof X;(ce==="object"||ce==="function")&&!Object.isFrozen(X)&&e(X)}),A}class t{constructor(z){z.data===void 0&&(z.data={}),this.data=z.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(A){return A.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function r(A,...z){const X=Object.create(null);for(const ce in A)X[ce]=A[ce];return z.forEach(function(ce){for(const Le in ce)X[Le]=ce[Le]}),X}const i="",s=A=>!!A.scope,o=(A,{prefix:z})=>{if(A.startsWith("language:"))return A.replace("language:","language-");if(A.includes(".")){const X=A.split(".");return[`${z}${X.shift()}`,...X.map((ce,Le)=>`${ce}${"_".repeat(Le+1)}`)].join(" ")}return`${z}${A}`};class l{constructor(z,X){this.buffer="",this.classPrefix=X.classPrefix,z.walk(this)}addText(z){this.buffer+=n(z)}openNode(z){if(!s(z))return;const X=o(z.scope,{prefix:this.classPrefix});this.span(X)}closeNode(z){s(z)&&(this.buffer+=i)}value(){return this.buffer}span(z){this.buffer+=``}}const u=(A={})=>{const z={children:[]};return Object.assign(z,A),z};class c{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(z){this.top.children.push(z)}openNode(z){const X=u({scope:z});this.add(X),this.stack.push(X)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(z){return this.constructor._walk(z,this.rootNode)}static _walk(z,X){return typeof X=="string"?z.addText(X):X.children&&(z.openNode(X),X.children.forEach(ce=>this._walk(z,ce)),z.closeNode(X)),z}static _collapse(z){typeof z!="string"&&z.children&&(z.children.every(X=>typeof X=="string")?z.children=[z.children.join("")]:z.children.forEach(X=>{c._collapse(X)}))}}class d extends c{constructor(z){super(),this.options=z}addText(z){z!==""&&this.add(z)}startScope(z){this.openNode(z)}endScope(){this.closeNode()}__addSublanguage(z,X){const ce=z.root;X&&(ce.scope=`language:${X}`),this.add(ce)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(A){return A?typeof A=="string"?A:A.source:null}function m(A){return b("(?=",A,")")}function f(A){return b("(?:",A,")*")}function h(A){return b("(?:",A,")?")}function b(...A){return A.map(X=>p(X)).join("")}function x(A){const z=A[A.length-1];return typeof z=="object"&&z.constructor===Object?(A.splice(A.length-1,1),z):{}}function y(...A){return"("+(x(A).capture?"":"?:")+A.map(ce=>p(ce)).join("|")+")"}function w(A){return new RegExp(A.toString()+"|").exec("").length-1}function T(A,z){const X=A&&A.exec(z);return X&&X.index===0}const j=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function O(A,{joinWith:z}){let X=0;return A.map(ce=>{X+=1;const Le=X;let je=p(ce),te="";for(;je.length>0;){const Q=j.exec(je);if(!Q){te+=je;break}te+=je.substring(0,Q.index),je=je.substring(Q.index+Q[0].length),Q[0][0]==="\\"&&Q[1]?te+="\\"+String(Number(Q[1])+Le):(te+=Q[0],Q[0]==="("&&X++)}return te}).map(ce=>`(${ce})`).join(z)}const _=/\b\B/,P="[a-zA-Z]\\w*",D="[a-zA-Z_]\\w*",R="\\b\\d+(\\.\\d+)?",S="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",M="\\b(0b[01]+)",L="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",C=(A={})=>{const z=/^#![ ]*\//;return A.binary&&(A.begin=b(z,/.*\b/,A.binary,/\b.*/)),r({scope:"meta",begin:z,end:/$/,relevance:0,"on:begin":(X,ce)=>{X.index!==0&&ce.ignoreMatch()}},A)},v={begin:"\\\\[\\s\\S]",relevance:0},E={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[v]},I={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[v]},H={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},U=function(A,z,X={}){const ce=r({scope:"comment",begin:A,end:z,contains:[]},X);ce.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Le=y("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return ce.contains.push({begin:b(/[ ]+/,"(",Le,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),ce},V=U("//","$"),g=U("/\\*","\\*/"),F=U("#","$"),$={scope:"number",begin:R,relevance:0},k={scope:"number",begin:S,relevance:0},ie={scope:"number",begin:M,relevance:0},K={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[v,{begin:/\[/,end:/\]/,relevance:0,contains:[v]}]},W={scope:"title",begin:P,relevance:0},re={scope:"title",begin:D,relevance:0},de={begin:"\\.\\s*"+D,relevance:0};var Oe=Object.freeze({__proto__:null,APOS_STRING_MODE:E,BACKSLASH_ESCAPE:v,BINARY_NUMBER_MODE:ie,BINARY_NUMBER_RE:M,COMMENT:U,C_BLOCK_COMMENT_MODE:g,C_LINE_COMMENT_MODE:V,C_NUMBER_MODE:k,C_NUMBER_RE:S,END_SAME_AS_BEGIN:function(A){return Object.assign(A,{"on:begin":(z,X)=>{X.data._beginMatch=z[1]},"on:end":(z,X)=>{X.data._beginMatch!==z[1]&&X.ignoreMatch()}})},HASH_COMMENT_MODE:F,IDENT_RE:P,MATCH_NOTHING_RE:_,METHOD_GUARD:de,NUMBER_MODE:$,NUMBER_RE:R,PHRASAL_WORDS_MODE:H,QUOTE_STRING_MODE:I,REGEXP_MODE:K,RE_STARTERS_RE:L,SHEBANG:C,TITLE_MODE:W,UNDERSCORE_IDENT_RE:D,UNDERSCORE_TITLE_MODE:re});function Ie(A,z){A.input[A.index-1]==="."&&z.ignoreMatch()}function at(A,z){A.className!==void 0&&(A.scope=A.className,delete A.className)}function St(A,z){z&&A.beginKeywords&&(A.begin="\\b("+A.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",A.__beforeBegin=Ie,A.keywords=A.keywords||A.beginKeywords,delete A.beginKeywords,A.relevance===void 0&&(A.relevance=0))}function Pt(A,z){Array.isArray(A.illegal)&&(A.illegal=y(...A.illegal))}function yt(A,z){if(A.match){if(A.begin||A.end)throw new Error("begin & end are not supported with match");A.begin=A.match,delete A.match}}function ve(A,z){A.relevance===void 0&&(A.relevance=1)}const lt=(A,z)=>{if(!A.beforeMatch)return;if(A.starts)throw new Error("beforeMatch cannot be used with starts");const X=Object.assign({},A);Object.keys(A).forEach(ce=>{delete A[ce]}),A.keywords=X.keywords,A.begin=b(X.beforeMatch,m(X.begin)),A.starts={relevance:0,contains:[Object.assign(X,{endsParent:!0})]},A.relevance=0,delete X.beforeMatch},rt=["of","and","for","in","not","or","if","then","parent","list","value"],vt="keyword";function Bt(A,z,X=vt){const ce=Object.create(null);return typeof A=="string"?Le(X,A.split(" ")):Array.isArray(A)?Le(X,A):Object.keys(A).forEach(function(je){Object.assign(ce,Bt(A[je],z,je))}),ce;function Le(je,te){z&&(te=te.map(Q=>Q.toLowerCase())),te.forEach(function(Q){const le=Q.split("|");ce[le[0]]=[je,qt(le[0],le[1])]})}}function qt(A,z){return z?Number(z):J(A)?0:1}function J(A){return rt.includes(A.toLowerCase())}const ge={},Re=A=>{console.error(A)},fe=(A,...z)=>{console.log(`WARN: ${A}`,...z)},B=(A,z)=>{ge[`${A}/${z}`]||(console.log(`Deprecated as of ${A}. ${z}`),ge[`${A}/${z}`]=!0)},G=new Error;function ee(A,z,{key:X}){let ce=0;const Le=A[X],je={},te={};for(let Q=1;Q<=z.length;Q++)te[Q+ce]=Le[Q],je[Q+ce]=!0,ce+=w(z[Q-1]);A[X]=te,A[X]._emit=je,A[X]._multi=!0}function ae(A){if(Array.isArray(A.begin)){if(A.skip||A.excludeBegin||A.returnBegin)throw Re("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),G;if(typeof A.beginScope!="object"||A.beginScope===null)throw Re("beginScope must be object"),G;ee(A,A.begin,{key:"beginScope"}),A.begin=O(A.begin,{joinWith:""})}}function we(A){if(Array.isArray(A.end)){if(A.skip||A.excludeEnd||A.returnEnd)throw Re("skip, excludeEnd, returnEnd not compatible with endScope: {}"),G;if(typeof A.endScope!="object"||A.endScope===null)throw Re("endScope must be object"),G;ee(A,A.end,{key:"endScope"}),A.end=O(A.end,{joinWith:""})}}function Ke(A){A.scope&&typeof A.scope=="object"&&A.scope!==null&&(A.beginScope=A.scope,delete A.scope)}function kt(A){Ke(A),typeof A.beginScope=="string"&&(A.beginScope={_wrap:A.beginScope}),typeof A.endScope=="string"&&(A.endScope={_wrap:A.endScope}),ae(A),we(A)}function ct(A){function z(te,Q){return new RegExp(p(te),"m"+(A.case_insensitive?"i":"")+(A.unicodeRegex?"u":"")+(Q?"g":""))}class X{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Q,le){le.position=this.position++,this.matchIndexes[this.matchAt]=le,this.regexes.push([le,Q]),this.matchAt+=w(Q)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Q=this.regexes.map(le=>le[1]);this.matcherRe=z(O(Q,{joinWith:"|"}),!0),this.lastIndex=0}exec(Q){this.matcherRe.lastIndex=this.lastIndex;const le=this.matcherRe.exec(Q);if(!le)return null;const Fe=le.findIndex((sn,rr)=>rr>0&&sn!==void 0),De=this.matchIndexes[Fe];return le.splice(0,Fe),Object.assign(le,De)}}class ce{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Q){if(this.multiRegexes[Q])return this.multiRegexes[Q];const le=new X;return this.rules.slice(Q).forEach(([Fe,De])=>le.addRule(Fe,De)),le.compile(),this.multiRegexes[Q]=le,le}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Q,le){this.rules.push([Q,le]),le.type==="begin"&&this.count++}exec(Q){const le=this.getMatcher(this.regexIndex);le.lastIndex=this.lastIndex;let Fe=le.exec(Q);if(this.resumingScanAtSamePosition()&&!(Fe&&Fe.index===this.lastIndex)){const De=this.getMatcher(0);De.lastIndex=this.lastIndex+1,Fe=De.exec(Q)}return Fe&&(this.regexIndex+=Fe.position+1,this.regexIndex===this.count&&this.considerAll()),Fe}}function Le(te){const Q=new ce;return te.contains.forEach(le=>Q.addRule(le.begin,{rule:le,type:"begin"})),te.terminatorEnd&&Q.addRule(te.terminatorEnd,{type:"end"}),te.illegal&&Q.addRule(te.illegal,{type:"illegal"}),Q}function je(te,Q){const le=te;if(te.isCompiled)return le;[at,yt,kt,lt].forEach(De=>De(te,Q)),A.compilerExtensions.forEach(De=>De(te,Q)),te.__beforeBegin=null,[St,Pt,ve].forEach(De=>De(te,Q)),te.isCompiled=!0;let Fe=null;return typeof te.keywords=="object"&&te.keywords.$pattern&&(te.keywords=Object.assign({},te.keywords),Fe=te.keywords.$pattern,delete te.keywords.$pattern),Fe=Fe||/\w+/,te.keywords&&(te.keywords=Bt(te.keywords,A.case_insensitive)),le.keywordPatternRe=z(Fe,!0),Q&&(te.begin||(te.begin=/\B|\b/),le.beginRe=z(le.begin),!te.end&&!te.endsWithParent&&(te.end=/\B|\b/),te.end&&(le.endRe=z(le.end)),le.terminatorEnd=p(le.end)||"",te.endsWithParent&&Q.terminatorEnd&&(le.terminatorEnd+=(te.end?"|":"")+Q.terminatorEnd)),te.illegal&&(le.illegalRe=z(te.illegal)),te.contains||(te.contains=[]),te.contains=[].concat(...te.contains.map(function(De){return Ft(De==="self"?te:De)})),te.contains.forEach(function(De){je(De,le)}),te.starts&&je(te.starts,Q),le.matcher=Le(le),le}if(A.compilerExtensions||(A.compilerExtensions=[]),A.contains&&A.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return A.classNameAliases=r(A.classNameAliases||{}),je(A)}function Tt(A){return A?A.endsWithParent||Tt(A.starts):!1}function Ft(A){return A.variants&&!A.cachedVariants&&(A.cachedVariants=A.variants.map(function(z){return r(A,{variants:null},z)})),A.cachedVariants?A.cachedVariants:Tt(A)?r(A,{starts:A.starts?r(A.starts):null}):Object.isFrozen(A)?r(A):A}var Ge="11.11.1";class Ct extends Error{constructor(z,X){super(z),this.name="HTMLInjectionError",this.html=X}}const Ze=n,yi=r,vi=Symbol("nomatch"),al=7,ki=function(A){const z=Object.create(null),X=Object.create(null),ce=[];let Le=!0;const je="Could not find the language '{}', did you forget to load/include a language module?",te={disableAutodetect:!0,name:"Plain text",contains:[]};let Q={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:d};function le(Y){return Q.noHighlightRe.test(Y)}function Fe(Y){let oe=Y.className+" ";oe+=Y.parentNode?Y.parentNode.className:"";const ye=Q.languageDetectRe.exec(oe);if(ye){const Te=At(ye[1]);return Te||(fe(je.replace("{}",ye[1])),fe("Falling back to no-highlight mode for this block.",Y)),Te?ye[1]:"no-highlight"}return oe.split(/\s+/).find(Te=>le(Te)||At(Te))}function De(Y,oe,ye){let Te="",Be="";typeof oe=="object"?(Te=Y,ye=oe.ignoreIllegals,Be=oe.language):(B("10.7.0","highlight(lang, code, ...args) has been deprecated."),B("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),Be=Y,Te=oe),ye===void 0&&(ye=!0);const ut={code:Te,language:Be};wn("before:highlight",ut);const Mt=ut.result?ut.result:sn(ut.language,ut.code,ye);return Mt.code=ut.code,wn("after:highlight",Mt),Mt}function sn(Y,oe,ye,Te){const Be=Object.create(null);function ut(Z,ne){return Z.keywords[ne]}function Mt(){if(!ue.keywords){$e.addText(Ce);return}let Z=0;ue.keywordPatternRe.lastIndex=0;let ne=ue.keywordPatternRe.exec(Ce),me="";for(;ne;){me+=Ce.substring(Z,ne.index);const _e=ft.case_insensitive?ne[0].toLowerCase():ne[0],Ue=ut(ue,_e);if(Ue){const[Et,_l]=Ue;if($e.addText(me),me="",Be[_e]=(Be[_e]||0)+1,Be[_e]<=al&&(Sn+=_l),Et.startsWith("_"))me+=ne[0];else{const Nl=ft.classNameAliases[Et]||Et;pt(ne[0],Nl)}}else me+=ne[0];Z=ue.keywordPatternRe.lastIndex,ne=ue.keywordPatternRe.exec(Ce)}me+=Ce.substring(Z),$e.addText(me)}function _n(){if(Ce==="")return;let Z=null;if(typeof ue.subLanguage=="string"){if(!z[ue.subLanguage]){$e.addText(Ce);return}Z=sn(ue.subLanguage,Ce,!0,Ai[ue.subLanguage]),Ai[ue.subLanguage]=Z._top}else Z=ir(Ce,ue.subLanguage.length?ue.subLanguage:null);ue.relevance>0&&(Sn+=Z.relevance),$e.__addSublanguage(Z._emitter,Z.language)}function Je(){ue.subLanguage!=null?_n():Mt(),Ce=""}function pt(Z,ne){Z!==""&&($e.startScope(ne),$e.addText(Z),$e.endScope())}function Ni(Z,ne){let me=1;const _e=ne.length-1;for(;me<=_e;){if(!Z._emit[me]){me++;continue}const Ue=ft.classNameAliases[Z[me]]||Z[me],Et=ne[me];Ue?pt(Et,Ue):(Ce=Et,Mt(),Ce=""),me++}}function Si(Z,ne){return Z.scope&&typeof Z.scope=="string"&&$e.openNode(ft.classNameAliases[Z.scope]||Z.scope),Z.beginScope&&(Z.beginScope._wrap?(pt(Ce,ft.classNameAliases[Z.beginScope._wrap]||Z.beginScope._wrap),Ce=""):Z.beginScope._multi&&(Ni(Z.beginScope,ne),Ce="")),ue=Object.create(Z,{parent:{value:ue}}),ue}function Ti(Z,ne,me){let _e=T(Z.endRe,me);if(_e){if(Z["on:end"]){const Ue=new t(Z);Z["on:end"](ne,Ue),Ue.isMatchIgnored&&(_e=!1)}if(_e){for(;Z.endsParent&&Z.parent;)Z=Z.parent;return Z}}if(Z.endsWithParent)return Ti(Z.parent,ne,me)}function yl(Z){return ue.matcher.regexIndex===0?(Ce+=Z[0],1):(lr=!0,0)}function vl(Z){const ne=Z[0],me=Z.rule,_e=new t(me),Ue=[me.__beforeBegin,me["on:begin"]];for(const Et of Ue)if(Et&&(Et(Z,_e),_e.isMatchIgnored))return yl(ne);return me.skip?Ce+=ne:(me.excludeBegin&&(Ce+=ne),Je(),!me.returnBegin&&!me.excludeBegin&&(Ce=ne)),Si(me,Z),me.returnBegin?0:ne.length}function kl(Z){const ne=Z[0],me=oe.substring(Z.index),_e=Ti(ue,Z,me);if(!_e)return vi;const Ue=ue;ue.endScope&&ue.endScope._wrap?(Je(),pt(ne,ue.endScope._wrap)):ue.endScope&&ue.endScope._multi?(Je(),Ni(ue.endScope,Z)):Ue.skip?Ce+=ne:(Ue.returnEnd||Ue.excludeEnd||(Ce+=ne),Je(),Ue.excludeEnd&&(Ce=ne));do ue.scope&&$e.closeNode(),!ue.skip&&!ue.subLanguage&&(Sn+=ue.relevance),ue=ue.parent;while(ue!==_e.parent);return _e.starts&&Si(_e.starts,Z),Ue.returnEnd?0:ne.length}function El(){const Z=[];for(let ne=ue;ne!==ft;ne=ne.parent)ne.scope&&Z.unshift(ne.scope);Z.forEach(ne=>$e.openNode(ne))}let Nn={};function Ci(Z,ne){const me=ne&&ne[0];if(Ce+=Z,me==null)return Je(),0;if(Nn.type==="begin"&&ne.type==="end"&&Nn.index===ne.index&&me===""){if(Ce+=oe.slice(ne.index,ne.index+1),!Le){const _e=new Error(`0 width match regex (${Y})`);throw _e.languageName=Y,_e.badRule=Nn.rule,_e}return 1}if(Nn=ne,ne.type==="begin")return vl(ne);if(ne.type==="illegal"&&!ye){const _e=new Error('Illegal lexeme "'+me+'" for mode "'+(ue.scope||"")+'"');throw _e.mode=ue,_e}else if(ne.type==="end"){const _e=kl(ne);if(_e!==vi)return _e}if(ne.type==="illegal"&&me==="")return Ce+=` -`,1;if(ar>1e5&&ar>ne.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ce+=me,me.length}const ft=At(Y);if(!ft)throw Re(je.replace("{}",Y)),new Error('Unknown language: "'+Y+'"');const wl=ct(ft);let sr="",ue=Te||wl;const Ai={},$e=new Q.__emitter(Q);El();let Ce="",Sn=0,zt=0,ar=0,lr=!1;try{if(ft.__emitTokens)ft.__emitTokens(oe,$e);else{for(ue.matcher.considerAll();;){ar++,lr?lr=!1:ue.matcher.considerAll(),ue.matcher.lastIndex=zt;const Z=ue.matcher.exec(oe);if(!Z)break;const ne=oe.substring(zt,Z.index),me=Ci(ne,Z);zt=Z.index+me}Ci(oe.substring(zt))}return $e.finalize(),sr=$e.toHTML(),{language:Y,value:sr,relevance:Sn,illegal:!1,_emitter:$e,_top:ue}}catch(Z){if(Z.message&&Z.message.includes("Illegal"))return{language:Y,value:Ze(oe),illegal:!0,relevance:0,_illegalBy:{message:Z.message,index:zt,context:oe.slice(zt-100,zt+100),mode:Z.mode,resultSoFar:sr},_emitter:$e};if(Le)return{language:Y,value:Ze(oe),illegal:!1,relevance:0,errorRaised:Z,_emitter:$e,_top:ue};throw Z}}function rr(Y){const oe={value:Ze(Y),illegal:!1,relevance:0,_top:te,_emitter:new Q.__emitter(Q)};return oe._emitter.addText(Y),oe}function ir(Y,oe){oe=oe||Q.languages||Object.keys(z);const ye=rr(Y),Te=oe.filter(At).filter(_i).map(Je=>sn(Je,Y,!1));Te.unshift(ye);const Be=Te.sort((Je,pt)=>{if(Je.relevance!==pt.relevance)return pt.relevance-Je.relevance;if(Je.language&&pt.language){if(At(Je.language).supersetOf===pt.language)return 1;if(At(pt.language).supersetOf===Je.language)return-1}return 0}),[ut,Mt]=Be,_n=ut;return _n.secondBest=Mt,_n}function ll(Y,oe,ye){const Te=oe&&X[oe]||ye;Y.classList.add("hljs"),Y.classList.add(`language-${Te}`)}function or(Y){let oe=null;const ye=Fe(Y);if(le(ye))return;if(wn("before:highlightElement",{el:Y,language:ye}),Y.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Y);return}if(Y.children.length>0&&(Q.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Y)),Q.throwUnescapedHTML))throw new Ct("One of your code blocks includes unescaped HTML.",Y.innerHTML);oe=Y;const Te=oe.textContent,Be=ye?De(Te,{language:ye,ignoreIllegals:!0}):ir(Te);Y.innerHTML=Be.value,Y.dataset.highlighted="yes",ll(Y,ye,Be.language),Y.result={language:Be.language,re:Be.relevance,relevance:Be.relevance},Be.secondBest&&(Y.secondBest={language:Be.secondBest.language,relevance:Be.secondBest.relevance}),wn("after:highlightElement",{el:Y,result:Be,text:Te})}function cl(Y){Q=yi(Q,Y)}const ul=()=>{En(),B("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function dl(){En(),B("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Ei=!1;function En(){function Y(){En()}if(document.readyState==="loading"){Ei||window.addEventListener("DOMContentLoaded",Y,!1),Ei=!0;return}document.querySelectorAll(Q.cssSelector).forEach(or)}function pl(Y,oe){let ye=null;try{ye=oe(A)}catch(Te){if(Re("Language definition for '{}' could not be registered.".replace("{}",Y)),Le)Re(Te);else throw Te;ye=te}ye.name||(ye.name=Y),z[Y]=ye,ye.rawDefinition=oe.bind(null,A),ye.aliases&&wi(ye.aliases,{languageName:Y})}function fl(Y){delete z[Y];for(const oe of Object.keys(X))X[oe]===Y&&delete X[oe]}function ml(){return Object.keys(z)}function At(Y){return Y=(Y||"").toLowerCase(),z[Y]||z[X[Y]]}function wi(Y,{languageName:oe}){typeof Y=="string"&&(Y=[Y]),Y.forEach(ye=>{X[ye.toLowerCase()]=oe})}function _i(Y){const oe=At(Y);return oe&&!oe.disableAutodetect}function gl(Y){Y["before:highlightBlock"]&&!Y["before:highlightElement"]&&(Y["before:highlightElement"]=oe=>{Y["before:highlightBlock"](Object.assign({block:oe.el},oe))}),Y["after:highlightBlock"]&&!Y["after:highlightElement"]&&(Y["after:highlightElement"]=oe=>{Y["after:highlightBlock"](Object.assign({block:oe.el},oe))})}function hl(Y){gl(Y),ce.push(Y)}function bl(Y){const oe=ce.indexOf(Y);oe!==-1&&ce.splice(oe,1)}function wn(Y,oe){const ye=Y;ce.forEach(function(Te){Te[ye]&&Te[ye](oe)})}function xl(Y){return B("10.7.0","highlightBlock will be removed entirely in v12.0"),B("10.7.0","Please use highlightElement now."),or(Y)}Object.assign(A,{highlight:De,highlightAuto:ir,highlightAll:En,highlightElement:or,highlightBlock:xl,configure:cl,initHighlighting:ul,initHighlightingOnLoad:dl,registerLanguage:pl,unregisterLanguage:fl,listLanguages:ml,getLanguage:At,registerAliases:wi,autoDetection:_i,inherit:yi,addPlugin:hl,removePlugin:bl}),A.debugMode=function(){Le=!1},A.safeMode=function(){Le=!0},A.versionString=Ge,A.regex={concat:b,lookahead:m,either:y,optional:h,anyNumberOfTimes:f};for(const Y in Oe)typeof Oe[Y]=="object"&&e(Oe[Y]);return Object.assign(A,Oe),A},Vt=ki({});return Vt.newInstance=()=>ki({}),Ar=Vt,Vt.HighlightJS=Vt,Vt.default=Vt,Ar}var zh=Fh();const $h=Xr(zh),cs={},Uh="hljs-";function Hh(e){const t=$h.newInstance();return e&&s(e),{highlight:n,highlightAuto:r,listLanguages:i,register:s,registerAlias:o,registered:l};function n(u,c,d){const p=d||cs,m=typeof p.prefix=="string"?p.prefix:Uh;if(!t.getLanguage(u))throw new Error("Unknown language: `"+u+"` is not registered");t.configure({__emitter:Wh,classPrefix:m});const f=t.highlight(c,{ignoreIllegals:!0,language:u});if(f.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:f.errorRaised});const h=f._emitter.root,b=h.data;return b.language=f.language,b.relevance=f.relevance,h}function r(u,c){const p=(c||cs).subset||i();let m=-1,f=0,h;for(;++mf&&(f=x.data.relevance,h=x)}return h||{type:"root",children:[],data:{language:void 0,relevance:f}}}function i(){return t.listLanguages()}function s(u,c){if(typeof u=="string")t.registerLanguage(u,c);else{let d;for(d in u)Object.hasOwn(u,d)&&t.registerLanguage(d,u[d])}}function o(u,c){if(typeof u=="string")t.registerAliases(typeof c=="string"?c:[...c],{languageName:u});else{let d;for(d in u)if(Object.hasOwn(u,d)){const p=u[d];t.registerAliases(typeof p=="string"?p:[...p],{languageName:d})}}}function l(u){return!!t.getLanguage(u)}}class Wh{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],i=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(t){const n=this,r=t.split(".").map(function(o,l){return l?o+"_".repeat(l):n.options.classPrefix+o}),i=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Kh={};function Gh(e){const t=e||Kh,n=t.aliases,r=t.detect||!1,i=t.languages||Bh,s=t.plainText,o=t.prefix,l=t.subset;let u="hljs";const c=Hh(i);if(n&&c.registerAlias(n),o){const d=o.indexOf("-");u=d===-1?o:o.slice(0,d)}return function(d,p){nr(d,"element",function(m,f,h){if(m.tagName!=="code"||!h||h.type!=="element"||h.tagName!=="pre")return;const b=qh(m);if(b===!1||!b&&!r||b&&s&&s.includes(b))return;Array.isArray(m.properties.className)||(m.properties.className=[]),m.properties.className.includes(u)||m.properties.className.unshift(u);const x=dg(m,{whitespace:"pre"});let y;try{y=b?c.highlight(b,x,{prefix:o}):c.highlightAuto(x,{prefix:o,subset:l})}catch(w){const T=w;if(b&&/Unknown language/.test(T.message)){p.message("Cannot highlight as `"+b+"`, it’s not registered",{ancestors:[h,m],cause:T,place:m.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw T}!b&&y.data&&y.data.language&&m.properties.className.push("language-"+y.data.language),y.children.length>0&&(m.children=y.children)})}}function qh(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n0?{type:"text",value:_}:void 0),_===!1?m.lastIndex=j+1:(h!==j&&w.push({type:"text",value:c.value.slice(h,j)}),Array.isArray(_)?w.push(..._):_&&w.push(_),h=j+T[0].length,y=!0),!m.global)break;T=m.exec(c.value)}return y?(h?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=us(e,"(");let s=us(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function Ba(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Wt(n)||Jn(n))&&(!t||n!==47)}Fa.peek=yb;function db(){this.buffer()}function pb(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function fb(){this.buffer()}function mb(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function gb(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=dt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hb(e){this.exit(e)}function bb(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=dt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function xb(e){this.exit(e)}function yb(){return"["}function Fa(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),o(),s+=i.move("]"),s}function vb(){return{enter:{gfmFootnoteCallString:db,gfmFootnoteCall:pb,gfmFootnoteDefinitionLabelString:fb,gfmFootnoteDefinition:mb},exit:{gfmFootnoteCallString:gb,gfmFootnoteCall:hb,gfmFootnoteDefinitionLabelString:bb,gfmFootnoteDefinition:xb}}}function kb(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Fa},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const l=s.createTracker(o);let u=l.move("[^");const c=s.enter("footnoteDefinition"),d=s.enter("label");return u+=l.move(s.safe(s.associationId(r),{before:u,after:"]"})),d(),u+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),u+=l.move((t?` -`:" ")+s.indentLines(s.containerFlow(r,l.current()),t?za:Eb))),c(),u}}function Eb(e,t,n){return t===0?e:za(e,t,n)}function za(e,t,n){return(n?"":" ")+e}const wb=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];$a.peek=Cb;function _b(){return{canContainEols:["delete"],enter:{strikethrough:Sb},exit:{strikethrough:Tb}}}function Nb(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:wb}],handlers:{delete:$a}}}function Sb(e){this.enter({type:"delete",children:[]},e)}function Tb(e){this.exit(e)}function $a(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function Cb(){return"~"}function Ab(e){return e.length}function Mb(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Ab,s=[],o=[],l=[],u=[];let c=0,d=-1;for(;++dc&&(c=e[d].length);++yu[y])&&(u[y]=T)}b.push(w)}o[d]=b,l[d]=x}let p=-1;if(typeof r=="object"&&"length"in r)for(;++pu[p]&&(u[p]=w),f[p]=w),m[p]=T}o.splice(1,0,m),l.splice(1,0,f),d=-1;const h=[];for(;++d "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),Ob);return i(),o}function Ob(e,t,n){return">"+(n?"":" ")+e}function Lb(e,t){return ps(e,t.inConstruct,!0)&&!ps(e,t.notInConstruct,!1)}function ps(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r"u"||e.call(c,m)},o=function(c,d){n&&d.name==="__proto__"?n(c,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):c[d.name]=d.newValue},l=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(r)return r(c,d).value}else return;return c[d]};return yr=function u(){var c,d,p,m,f,b,h=arguments[0],v=1,y=arguments.length,x=!1;for(typeof h=="boolean"&&(x=h,h=arguments[1]||{},v=2),(h==null||typeof h!="object"&&typeof h!="function")&&(h={});vo.length;let u;l&&o.push(i);try{u=e.apply(this,o)}catch(c){const d=c;if(l&&n)throw d;return i(d)}l||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(o,...l){n||(n=!0,t(o,...l))}function s(o){i(null,o)}}const gt={basename:Lm,dirname:jm,extname:Dm,join:Pm,sep:"/"};function Lm(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');kn(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function jm(e){if(kn(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Dm(e){kn(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Pm(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Fm(e,t){let n="",r=0,i=-1,s=0,o=-1,l,u;for(;++o<=e.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else l===46&&s>-1?s++:s=-1}return n}function kn(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const zm={cwd:$m};function $m(){return"/"}function qr(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Um(e){if(typeof e=="string")e=new URL(e);else if(!qr(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Hm(e)}function Hm(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[f,...b]=d;const h=r[m][1];Gr(h)&&Gr(f)&&(f=vr(!0,h,f)),r[m]=[c,f,...b]}}}}const qm=new mi().freeze();function _r(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Nr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Sr(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Yo(e){if(!Gr(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Xo(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Rn(e){return Vm(e)?e:new ha(e)}function Vm(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ym(e){return typeof e=="string"||Xm(e)}function Xm(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Zm="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Zo=[],Jo={allowDangerousHtml:!0},Jm=/^(https?|ircs?|mailto|xmpp)$/i,Qm=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function eg(e){const t=tg(e),n=ng(e);return rg(t.runSync(t.parse(n),n),e)}function tg(e){const t=e.rehypePlugins||Zo,n=e.remarkPlugins||Zo,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Jo}:Jo;return qm().use(jf).use(n).use(Am,r).use(t)}function ng(e){const t=e.children||"",n=new ha;return typeof t=="string"&&(n.value=t),n}function rg(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||ig;for(const d of Qm)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Zm+d.id,void 0);return nr(e,c),bd(e,{Fragment:a.Fragment,components:i,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function c(d,p,m){if(d.type==="raw"&&m&&typeof p=="number")return o?m.children.splice(p,1):m.children[p]={type:"text",value:d.value},p;if(d.type==="element"){let f;for(f in hr)if(Object.hasOwn(hr,f)&&Object.hasOwn(d.properties,f)){const b=d.properties[f],h=hr[f];(h===null||h.includes(d.tagName))&&(d.properties[f]=u(String(b||""),f,d))}}if(d.type==="element"){let f=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!f&&r&&typeof p=="number"&&(f=!r(d,p,m)),f&&m&&typeof p=="number")return l&&d.children?m.children.splice(p,1,...d.children):m.children.splice(p,1),p}}}function ig(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Jm.test(e.slice(0,t))?e:""}const Qo=(function(e,t,n){const r=vn(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tc&&(c=d):d&&(c!==void 0&&c>-1&&u.push(` +`.repeat(c)||" "),c=-1,u.push(d))}return u.join("")}function xa(e,t,n){return e.type==="element"?pg(e,t,n):e.type==="text"?n.whitespace==="normal"?ya(e,n):fg(e):[]}function pg(e,t,n){const r=va(e,n),i=e.children||[];let s=-1,o=[];if(ug(e))return o;let l,u;for(Vr(e)||rs(e)&&Qo(t,e,rs)?u=` +`:cg(e)?(l=2,u=2):ba(e)&&(l=1,u=1);++s]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},f=t.optional(i)+e.IDENT_RE+"\\s*\\(",b=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],h=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:h,keyword:b,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},j={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[j,p,l,n,e.C_BLOCK_COMMENT_MODE,d,c],B={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:N.concat([{begin:/\(/,end:/\)/,keywords:O,contains:N.concat(["self"]),relevance:0}]),relevance:0},D={className:"function",begin:"("+o+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:O,relevance:0},{begin:f,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,d,l,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"",keywords:O,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function yg(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=xg(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function vg(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(l);const u={match:/\\"/},c={className:"string",begin:/'/,end:/'/},d={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},m=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],f=e.SHEBANG({binary:`(${m.join("|")})`,relevance:10}),b={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},h=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},x=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],C=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],O=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],j=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:h,literal:v,built_in:[...x,...C,"set","shopt",...O,...j]},contains:[f,e.SHEBANG(),b,p,s,o,y,l,u,c,d,n]}}function kg(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},f=t.optional(i)+e.IDENT_RE+"\\s*\\(",v={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[p,l,n,e.C_BLOCK_COMMENT_MODE,d,c],x={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},C={begin:"("+o+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:v,relevance:0},{begin:f,returnBegin:!0,contains:[e.inherit(m,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,d,l,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C",aliases:["h"],keywords:v,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:p,strings:c,keywords:v}}}function Eg(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},f=t.optional(i)+e.IDENT_RE+"\\s*\\(",b=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],h=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:h,keyword:b,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},j={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[j,p,l,n,e.C_BLOCK_COMMENT_MODE,d,c],B={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:N.concat([{begin:/\(/,end:/\)/,keywords:O,contains:N.concat(["self"]),relevance:0}]),relevance:0},D={className:"function",begin:"("+o+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:O,relevance:0},{begin:f,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,d,l,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"",keywords:O,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function wg(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:i.concat(s),built_in:t,literal:r},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=e.inherit(d,{illegal:/\n/}),m={className:"subst",begin:/\{/,end:/\}/,keywords:o},f=e.inherit(m,{illegal:/\n/}),b={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,f]},h={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]},v=e.inherit(h,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]});m.contains=[h,b,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,e.C_BLOCK_COMMENT_MODE],f.contains=[v,b,p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[c,h,b,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},x={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},C=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",O={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,u,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+C+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,x],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[y,u,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},O]}}const _g=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Ng=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Sg=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Tg=[...Ng,...Sg],Cg=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Ag=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Mg=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ig=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Rg(e){const t=e.regex,n=_g(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Ag.join("|")+")"},{begin:":(:)?("+Mg.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ig.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:Cg.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Tg.join("|")+")\\b"}]}}function Og(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Lg(e){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"ka(e,t,n-1))}function Pg(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+ka("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),u={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:u,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:u,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,is,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},is,c]}}const os="[A-Za-z$_][0-9A-Za-z$_]*",Bg=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Fg=["true","false","null","undefined","NaN","Infinity"],Ea=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],wa=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],_a=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],zg=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],$g=[].concat(_a,Ea,wa);function Ug(e){const t=e.regex,n=(U,{after:q})=>{const g="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,q)=>{const g=U[0].length+U.index,F=U.input[g];if(F==="<"||F===","){q.ignoreMatch();return}F===">"&&(n(U,{after:g})||q.ignoreMatch());let $;const E=U.input.substring(g);if($=E.match(/^\s*=/)){q.ignoreMatch();return}if(($=E.match(/^\s+extends\s+/))&&$.index===0){q.ignoreMatch();return}}},l={$pattern:os,keyword:Bg,literal:Fg,built_in:$g,"variable.language":zg},u="[0-9](_?[0-9])*",c=`\\.(${u})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${d})((${c})|\\.)?|(${c}))[eE][+-]?(${u})\\b`},{begin:`\\b(${d})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"css"}},h={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,m]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},C=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,b,h,v,{match:/\$\d+/},p];m.contains=C.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(C)});const O=[].concat(x,m.contains),j=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:j},B={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},D={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Ea,...wa]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},S={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},T={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function L(U){return t.concat("(?!",U.join("|"),")")}const M={match:t.concat(/\b/,L([..._a,"super","import"].map(U=>`${U}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},w={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",W={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:j,CLASS_REFERENCE:D},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,b,h,v,x,{match:/\$\d+/},p,D,{scope:"attr",match:r+t.lookahead(":"),relevance:0},W,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:j}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},S,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},w,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},M,T,B,k,{match:/\$[(.]/}]}}function Hg(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Jt="[0-9](_*[0-9])*",jn=`\\.(${Jt})`,Dn="[0-9a-fA-F](_*[0-9a-fA-F])*",Wg={className:"number",variants:[{begin:`(\\b(${Jt})((${jn})|\\.)?|(${jn}))[eE][+-]?(${Jt})[fFdD]?\\b`},{begin:`\\b(${Jt})((${jn})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${jn})[fFdD]?\\b`},{begin:`\\b(${Jt})[fFdD]\\b`},{begin:`\\b0[xX]((${Dn})\\.?|(${Dn})?\\.(${Dn}))[pP][+-]?(${Jt})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Dn})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Kg(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,i]}]};i.contains.push(o);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},u={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},c=Wg,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),p={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},m=p;return m.variants[1].contains=[p],p.variants[1].contains=[m],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,r,l,u,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[p,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,l,u,o,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,u]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},c]}}const Gg=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),qg=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Vg=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Yg=[...qg,...Vg],Xg=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Na=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Sa=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Zg=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),Jg=Na.concat(Sa).sort().reverse();function Qg(e){const t=Gg(e),n=Jg,r="and or not only",i="[\\w-]+",s="("+i+"|@\\{"+i+"\\})",o=[],l=[],u=function(C){return{className:"string",begin:"~?"+C+".*?"+C}},c=function(C,O,j){return{className:C,begin:O,relevance:j}},d={$pattern:/[a-z-]+/,keyword:r,attribute:Xg.join(" ")},p={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,u("'"),u('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,p,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const m=l.concat({begin:/\{/,end:/\}/,contains:o}),f={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},b={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Zg.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},h={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:l,relevance:0}},v={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:m}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+Yg.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,c("selector-tag",s,0),c("selector-id","#"+s),c("selector-class","\\."+s,0),c("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Na.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Sa.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:m},{begin:"!important"},t.FUNCTION_DISPATCH]},x={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,h,v,x,b,y,f,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function eh(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function th(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=e.inherit(c,{contains:[]}),m=e.inherit(d,{contains:[]});c.contains.push(m),d.contains.push(p);let f=[n,u];return[c,d,p,m].forEach(y=>{y.contains=y.contains.concat(f)}),f=f.concat(c,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:f},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:f}]}]},n,s,c,d,{className:"quote",begin:"^>\\s+",contains:f,end:"$"},i,r,u,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function rh(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},u={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+u.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:u,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function ih(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},o={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},u={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,s,u],p=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],m=(h,v,y="\\1")=>{const x=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",h,")"),v,/(?:\\.|[^\\\/])*?/,x,/(?:\\.|[^\\\/])*?/,y,r)},f=(h,v,y)=>t.concat(t.concat("(?:",h,")"),v,/(?:\\.|[^\\\/])*?/,y,r),b=[u,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:m("s|tr|y",t.either(...p,{capture:!0}))},{begin:m("s|tr|y","\\(","\\)")},{begin:m("s|tr|y","\\[","\\]")},{begin:m("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:f("(?:m|qr)?",/\//,/\//)},{begin:f("m|qr",t.either(...p,{capture:!0}),/\1/)},{begin:f("m|qr",/\(/,/\)/)},{begin:f("m|qr",/\[/,/\]/)},{begin:f("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=b,o.contains=b,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:b}}function oh(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+r},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},u={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(u)}),p={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(u),"on:begin":(w,k)=>{k.data._beginMatch=w[1]||w[2]},"on:end":(w,k)=>{k.data._beginMatch!==w[1]&&k.ignoreMatch()}},m=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),f=`[ +]`,b={scope:"string",variants:[d,c,p,m]},h={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},v=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],x=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],O={keyword:y,literal:(w=>{const k=[];return w.forEach(I=>{k.push(I),I.toLowerCase()===I?k.push(I.toUpperCase()):k.push(I.toLowerCase())}),k})(v),built_in:x},j=w=>w.map(k=>k.replace(/\|\d+$/,"")),N={variants:[{match:[/new/,t.concat(f,"+"),t.concat("(?!",j(x).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},B=t.concat(r,"\\b(?!\\()"),D={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),B],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),B],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},R={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},S={relevance:0,begin:/\(/,end:/\)/,keywords:O,contains:[R,o,D,e.C_BLOCK_COMMENT_MODE,b,h,N]},T={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",j(y).join("\\b|"),"|",j(x).join("\\b|"),"\\b)"),r,t.concat(f,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[S]};S.contains.push(T);const L=[R,D,e.C_BLOCK_COMMENT_MODE,b,h,N],M={begin:t.concat(/#\[\s*\\?/,t.either(i,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...L]},...L,{scope:"meta",variants:[{match:i},{match:s}]}]};return{case_insensitive:!1,keywords:O,contains:[M,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,T,D,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},N,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:O,contains:["self",M,o,D,e.C_BLOCK_COMMENT_MODE,b,h]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},b,h]}}function sh(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function ah(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function lh(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},p={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u,d,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u,d,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},m="[0-9](_?[0-9])*",f=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,b=`\\b|${r.join("|")}`,h={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${f}))[eE][+-]?(${m})[jJ]?(?=${b})`},{begin:`(${f})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${b})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${b})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${b})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${b})`},{begin:`\\b(${m})[jJ](?=${b})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",u,h,p,e.HASH_COMMENT_MODE]}]};return c.contains=[p,h,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[u,h,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[h,y,p]}]}}function ch(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function uh(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[s,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function dh(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},u={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:o},p={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},m="[1-9](_?[0-9])*|0",f="[0-9](_?[0-9])*",b={className:"number",relevance:0,variants:[{begin:`\\b(${m})(\\.(${f}))?([eE][+-]?(${f})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},h={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},N=[p,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[h]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:n}],relevance:0},b,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(u,c),relevance:0}].concat(u,c);d.contains=N,h.contains=N;const S=[{begin:/^\s*=>/,starts:{end:"$",contains:N}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:N}}];return c.unshift(u),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(S).concat(c).concat(N)}}function ph(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],u=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:l,literal:u,built_in:c},illegal:""},s]}}const fh=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),mh=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],gh=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],hh=[...mh,...gh],bh=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),xh=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),yh=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),vh=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function kh(e){const t=fh(e),n=yh,r=xh,i="@[a-z-]+",s="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+hh.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+vh.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,l,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:bh.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function Eh(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function wh(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],u=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],p=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],m=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],f=d,b=[...c,...u].filter(j=>!d.includes(j)),h={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...f),/\s*\(/),relevance:0,keywords:{built_in:f}};function x(j){return t.concat(/\b/,t.either(...j.map(N=>N.replace(/\s+/,"\\s+"))),/\b/)}const C={scope:"keyword",match:x(m),relevance:0};function O(j,{exceptions:N,when:B}={}){const D=B;return N=N||[],j.map(R=>R.match(/\|\d+$/)||N.includes(R)?R:D(R)?`${R}|0`:R)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(b,{when:j=>j.length<3}),literal:s,type:l,built_in:p},contains:[{scope:"type",match:x(o)},C,y,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function Ta(e){return e?typeof e=="string"?e:e.source:null}function dn(e){return Ne("(?=",e,")")}function Ne(...e){return e.map(n=>Ta(n)).join("")}function _h(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function qe(...e){return"("+(_h(e).capture?"":"?:")+e.map(r=>Ta(r)).join("|")+")"}const hi=e=>Ne(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Nh=["Protocol","Type"].map(hi),ss=["init","self"].map(hi),Sh=["Any","Self"],Tr=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],as=["false","nil","true"],Th=["assignment","associativity","higherThan","left","lowerThan","none","right"],Ch=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],ls=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Ca=qe(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Aa=qe(Ca,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Cr=Ne(Ca,Aa,"*"),Ma=qe(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Gn=qe(Ma,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),mt=Ne(Ma,Gn,"*"),Pn=Ne(/[A-Z]/,Gn,"*"),Ah=["attached","autoclosure",Ne(/convention\(/,qe("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Ne(/objc\(/,mt,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Mh=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Ih(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,qe(...Nh,...ss)],className:{2:"keyword"}},s={match:Ne(/\./,qe(...Tr)),relevance:0},o=Tr.filter(ke=>typeof ke=="string").concat(["_|0"]),l=Tr.filter(ke=>typeof ke!="string").concat(Sh).map(hi),u={variants:[{className:"keyword",match:qe(...l,...ss)}]},c={$pattern:qe(/\b\w+/,/#\w+/),keyword:o.concat(Ch),literal:as},d=[i,s,u],p={match:Ne(/\./,qe(...ls)),relevance:0},m={className:"built_in",match:Ne(/\b/,qe(...ls),/(?=\()/)},f=[p,m],b={match:/->/,relevance:0},h={className:"operator",relevance:0,variants:[{match:Cr},{match:`\\.(\\.|${Aa})+`}]},v=[b,h],y="([0-9]_*)+",x="([0-9a-fA-F]_*)+",C={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${x})(\\.(${x}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},O=(ke="")=>({className:"subst",variants:[{match:Ne(/\\/,ke,/[0\\tnr"']/)},{match:Ne(/\\/,ke,/u\{[0-9a-fA-F]{1,8}\}/)}]}),j=(ke="")=>({className:"subst",match:Ne(/\\/,ke,/[\t ]*(?:[\r\n]|\r\n)/)}),N=(ke="")=>({className:"subst",label:"interpol",begin:Ne(/\\/,ke,/\(/),end:/\)/}),B=(ke="")=>({begin:Ne(ke,/"""/),end:Ne(/"""/,ke),contains:[O(ke),j(ke),N(ke)]}),D=(ke="")=>({begin:Ne(ke,/"/),end:Ne(/"/,ke),contains:[O(ke),N(ke)]}),R={className:"string",variants:[B(),B("#"),B("##"),B("###"),D(),D("#"),D("##"),D("###")]},S=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],T={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:S},L=ke=>{const lt=Ne(ke,/\//),rt=Ne(/\//,ke);return{begin:lt,end:rt,contains:[...S,{scope:"comment",begin:`#(?!.*${rt})`,end:/$/}]}},M={scope:"regexp",variants:[L("###"),L("##"),L("#"),T]},w={match:Ne(/`/,mt,/`/)},k={className:"variable",match:/\$\d+/},I={className:"variable",match:`\\$${Gn}+`},W=[w,k,I],U={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Mh,contains:[...v,C,R]}]}},q={scope:"keyword",match:Ne(/@/,qe(...Ah),dn(qe(/\(/,/\s+/)))},g={scope:"meta",match:Ne(/@/,mt)},F=[U,q,g],$={match:dn(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Ne(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Gn,"+")},{className:"type",match:Pn,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Ne(/\s+&\s+/,dn(Pn)),relevance:0}]},E={begin://,keywords:c,contains:[...r,...d,...F,b,$]};$.contains.push(E);const ie={match:Ne(mt,/\s*:/),keywords:"_|0",relevance:0},K={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",ie,...r,M,...d,...f,...v,C,R,...W,...F,$]},H={begin://,keywords:"repeat each",contains:[...r,$]},re={begin:qe(dn(Ne(mt,/\s*:/)),dn(Ne(mt,/\s+/,mt,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:mt}]},de={begin:/\(/,end:/\)/,keywords:c,contains:[re,...r,...d,...v,C,R,...F,$,K],endsParent:!0,illegal:/["']/},xe={match:[/(func|macro)/,/\s+/,qe(w.match,mt,Cr)],className:{1:"keyword",3:"title.function"},contains:[H,de,t],illegal:[/\[/,/%/]},Oe={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[H,de,t],illegal:/\[|%/},Ie={match:[/operator/,/\s+/,Cr],className:{1:"keyword",3:"title"}},at={begin:[/precedencegroup/,/\s+/,Pn],className:{1:"keyword",3:"title"},contains:[$],keywords:[...Th,...as],end:/}/},St={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Pt={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},yt={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,mt,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[H,...d,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:Pn},...d],relevance:0}]};for(const ke of R.variants){const lt=ke.contains.find(vt=>vt.label==="interpol");lt.keywords=c;const rt=[...d,...f,...v,C,R,...W];lt.contains=[...rt,{begin:/\(/,end:/\)/,contains:["self",...rt]}]}return{name:"Swift",keywords:c,contains:[...r,xe,Oe,St,Pt,yt,Ie,at,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},M,...d,...f,...v,C,R,...W,...F,$,K]}}const qn="[A-Za-z$_][0-9A-Za-z$_]*",Ia=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Ra=["true","false","null","undefined","NaN","Infinity"],Oa=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],La=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ja=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Da=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Pa=[].concat(ja,Oa,La);function Rh(e){const t=e.regex,n=(U,{after:q})=>{const g="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,q)=>{const g=U[0].length+U.index,F=U.input[g];if(F==="<"||F===","){q.ignoreMatch();return}F===">"&&(n(U,{after:g})||q.ignoreMatch());let $;const E=U.input.substring(g);if($=E.match(/^\s*=/)){q.ignoreMatch();return}if(($=E.match(/^\s+extends\s+/))&&$.index===0){q.ignoreMatch();return}}},l={$pattern:qn,keyword:Ia,literal:Ra,built_in:Pa,"variable.language":Da},u="[0-9](_?[0-9])*",c=`\\.(${u})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${d})((${c})|\\.)?|(${c}))[eE][+-]?(${u})\\b`},{begin:`\\b(${d})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"css"}},h={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,m]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},C=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,b,h,v,{match:/\$\d+/},p];m.contains=C.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(C)});const O=[].concat(x,m.contains),j=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:j},B={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},D={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Oa,...La]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},S={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},T={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function L(U){return t.concat("(?!",U.join("|"),")")}const M={match:t.concat(/\b/,L([...ja,"super","import"].map(U=>`${U}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},w={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",W={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:j,CLASS_REFERENCE:D},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,b,h,v,x,{match:/\$\d+/},p,D,{scope:"attr",match:r+t.lookahead(":"),relevance:0},W,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:j}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},S,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},w,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},M,T,B,k,{match:/\$[(.]/}]}}function Oh(e){const t=e.regex,n=Rh(e),r=qn,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:qn,keyword:Ia.concat(u),literal:Ra,built_in:Pa.concat(i),"variable.language":Da},d={className:"meta",begin:"@"+r},p=(h,v,y)=>{const x=h.contains.findIndex(C=>C.label===v);if(x===-1)throw new Error("can not find mode to replace");h.contains.splice(x,1,y)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(d);const m=n.contains.find(h=>h.scope==="attr"),f=Object.assign({},m,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,m,f]),n.contains=n.contains.concat([d,s,o,f]),p(n,"shebang",e.SHEBANG()),p(n,"use_strict",l);const b=n.contains.find(h=>h.label==="func.def");return b.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Lh(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,u={className:"literal",variants:[{begin:t.concat(/# */,t.either(s,i),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(s,i),/ +/,t.either(o,l),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},p=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),m=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,u,c,d,p,m,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[m]}]}}function jh(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},u={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,i,e.QUOTE_STRING_MODE,u,c,l]}}function Dh(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(s,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),u=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[s,u,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,o,u,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Ph(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},l=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),m={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},f={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},b={begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},h={begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},v=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},m,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},b,h,s,o],y=[...v];return y.pop(),y.push(l),f.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const Bh={arduino:yg,bash:vg,c:kg,cpp:Eg,csharp:wg,css:Rg,diff:Og,go:Lg,graphql:jg,ini:Dg,java:Pg,javascript:Ug,json:Hg,kotlin:Kg,less:Qg,lua:eh,makefile:th,markdown:nh,objectivec:rh,perl:ih,php:oh,"php-template":sh,plaintext:ah,python:lh,"python-repl":ch,r:uh,ruby:dh,rust:ph,scss:kh,shell:Eh,sql:wh,swift:Ih,typescript:Oh,vbnet:Lh,wasm:jh,xml:Dh,yaml:Ph};var Ar,cs;function Fh(){if(cs)return Ar;cs=1;function e(A){return A instanceof Map?A.clear=A.delete=A.set=function(){throw new Error("map is read-only")}:A instanceof Set&&(A.add=A.clear=A.delete=function(){throw new Error("set is read-only")}),Object.freeze(A),Object.getOwnPropertyNames(A).forEach(z=>{const X=A[z],ce=typeof X;(ce==="object"||ce==="function")&&!Object.isFrozen(X)&&e(X)}),A}class t{constructor(z){z.data===void 0&&(z.data={}),this.data=z.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(A){return A.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function r(A,...z){const X=Object.create(null);for(const ce in A)X[ce]=A[ce];return z.forEach(function(ce){for(const Le in ce)X[Le]=ce[Le]}),X}const i="",s=A=>!!A.scope,o=(A,{prefix:z})=>{if(A.startsWith("language:"))return A.replace("language:","language-");if(A.includes(".")){const X=A.split(".");return[`${z}${X.shift()}`,...X.map((ce,Le)=>`${ce}${"_".repeat(Le+1)}`)].join(" ")}return`${z}${A}`};class l{constructor(z,X){this.buffer="",this.classPrefix=X.classPrefix,z.walk(this)}addText(z){this.buffer+=n(z)}openNode(z){if(!s(z))return;const X=o(z.scope,{prefix:this.classPrefix});this.span(X)}closeNode(z){s(z)&&(this.buffer+=i)}value(){return this.buffer}span(z){this.buffer+=``}}const u=(A={})=>{const z={children:[]};return Object.assign(z,A),z};class c{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(z){this.top.children.push(z)}openNode(z){const X=u({scope:z});this.add(X),this.stack.push(X)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(z){return this.constructor._walk(z,this.rootNode)}static _walk(z,X){return typeof X=="string"?z.addText(X):X.children&&(z.openNode(X),X.children.forEach(ce=>this._walk(z,ce)),z.closeNode(X)),z}static _collapse(z){typeof z!="string"&&z.children&&(z.children.every(X=>typeof X=="string")?z.children=[z.children.join("")]:z.children.forEach(X=>{c._collapse(X)}))}}class d extends c{constructor(z){super(),this.options=z}addText(z){z!==""&&this.add(z)}startScope(z){this.openNode(z)}endScope(){this.closeNode()}__addSublanguage(z,X){const ce=z.root;X&&(ce.scope=`language:${X}`),this.add(ce)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(A){return A?typeof A=="string"?A:A.source:null}function m(A){return h("(?=",A,")")}function f(A){return h("(?:",A,")*")}function b(A){return h("(?:",A,")?")}function h(...A){return A.map(X=>p(X)).join("")}function v(A){const z=A[A.length-1];return typeof z=="object"&&z.constructor===Object?(A.splice(A.length-1,1),z):{}}function y(...A){return"("+(v(A).capture?"":"?:")+A.map(ce=>p(ce)).join("|")+")"}function x(A){return new RegExp(A.toString()+"|").exec("").length-1}function C(A,z){const X=A&&A.exec(z);return X&&X.index===0}const O=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function j(A,{joinWith:z}){let X=0;return A.map(ce=>{X+=1;const Le=X;let je=p(ce),te="";for(;je.length>0;){const Q=O.exec(je);if(!Q){te+=je;break}te+=je.substring(0,Q.index),je=je.substring(Q.index+Q[0].length),Q[0][0]==="\\"&&Q[1]?te+="\\"+String(Number(Q[1])+Le):(te+=Q[0],Q[0]==="("&&X++)}return te}).map(ce=>`(${ce})`).join(z)}const N=/\b\B/,B="[a-zA-Z]\\w*",D="[a-zA-Z_]\\w*",R="\\b\\d+(\\.\\d+)?",S="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",T="\\b(0b[01]+)",L="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",M=(A={})=>{const z=/^#![ ]*\//;return A.binary&&(A.begin=h(z,/.*\b/,A.binary,/\b.*/)),r({scope:"meta",begin:z,end:/$/,relevance:0,"on:begin":(X,ce)=>{X.index!==0&&ce.ignoreMatch()}},A)},w={begin:"\\\\[\\s\\S]",relevance:0},k={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[w]},I={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[w]},W={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},U=function(A,z,X={}){const ce=r({scope:"comment",begin:A,end:z,contains:[]},X);ce.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Le=y("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return ce.contains.push({begin:h(/[ ]+/,"(",Le,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),ce},q=U("//","$"),g=U("/\\*","\\*/"),F=U("#","$"),$={scope:"number",begin:R,relevance:0},E={scope:"number",begin:S,relevance:0},ie={scope:"number",begin:T,relevance:0},K={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[w,{begin:/\[/,end:/\]/,relevance:0,contains:[w]}]},H={scope:"title",begin:B,relevance:0},re={scope:"title",begin:D,relevance:0},de={begin:"\\.\\s*"+D,relevance:0};var Oe=Object.freeze({__proto__:null,APOS_STRING_MODE:k,BACKSLASH_ESCAPE:w,BINARY_NUMBER_MODE:ie,BINARY_NUMBER_RE:T,COMMENT:U,C_BLOCK_COMMENT_MODE:g,C_LINE_COMMENT_MODE:q,C_NUMBER_MODE:E,C_NUMBER_RE:S,END_SAME_AS_BEGIN:function(A){return Object.assign(A,{"on:begin":(z,X)=>{X.data._beginMatch=z[1]},"on:end":(z,X)=>{X.data._beginMatch!==z[1]&&X.ignoreMatch()}})},HASH_COMMENT_MODE:F,IDENT_RE:B,MATCH_NOTHING_RE:N,METHOD_GUARD:de,NUMBER_MODE:$,NUMBER_RE:R,PHRASAL_WORDS_MODE:W,QUOTE_STRING_MODE:I,REGEXP_MODE:K,RE_STARTERS_RE:L,SHEBANG:M,TITLE_MODE:H,UNDERSCORE_IDENT_RE:D,UNDERSCORE_TITLE_MODE:re});function Ie(A,z){A.input[A.index-1]==="."&&z.ignoreMatch()}function at(A,z){A.className!==void 0&&(A.scope=A.className,delete A.className)}function St(A,z){z&&A.beginKeywords&&(A.begin="\\b("+A.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",A.__beforeBegin=Ie,A.keywords=A.keywords||A.beginKeywords,delete A.beginKeywords,A.relevance===void 0&&(A.relevance=0))}function Pt(A,z){Array.isArray(A.illegal)&&(A.illegal=y(...A.illegal))}function yt(A,z){if(A.match){if(A.begin||A.end)throw new Error("begin & end are not supported with match");A.begin=A.match,delete A.match}}function ke(A,z){A.relevance===void 0&&(A.relevance=1)}const lt=(A,z)=>{if(!A.beforeMatch)return;if(A.starts)throw new Error("beforeMatch cannot be used with starts");const X=Object.assign({},A);Object.keys(A).forEach(ce=>{delete A[ce]}),A.keywords=X.keywords,A.begin=h(X.beforeMatch,m(X.begin)),A.starts={relevance:0,contains:[Object.assign(X,{endsParent:!0})]},A.relevance=0,delete X.beforeMatch},rt=["of","and","for","in","not","or","if","then","parent","list","value"],vt="keyword";function Bt(A,z,X=vt){const ce=Object.create(null);return typeof A=="string"?Le(X,A.split(" ")):Array.isArray(A)?Le(X,A):Object.keys(A).forEach(function(je){Object.assign(ce,Bt(A[je],z,je))}),ce;function Le(je,te){z&&(te=te.map(Q=>Q.toLowerCase())),te.forEach(function(Q){const le=Q.split("|");ce[le[0]]=[je,qt(le[0],le[1])]})}}function qt(A,z){return z?Number(z):J(A)?0:1}function J(A){return rt.includes(A.toLowerCase())}const ge={},Re=A=>{console.error(A)},fe=(A,...z)=>{console.log(`WARN: ${A}`,...z)},P=(A,z)=>{ge[`${A}/${z}`]||(console.log(`Deprecated as of ${A}. ${z}`),ge[`${A}/${z}`]=!0)},G=new Error;function ee(A,z,{key:X}){let ce=0;const Le=A[X],je={},te={};for(let Q=1;Q<=z.length;Q++)te[Q+ce]=Le[Q],je[Q+ce]=!0,ce+=x(z[Q-1]);A[X]=te,A[X]._emit=je,A[X]._multi=!0}function ae(A){if(Array.isArray(A.begin)){if(A.skip||A.excludeBegin||A.returnBegin)throw Re("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),G;if(typeof A.beginScope!="object"||A.beginScope===null)throw Re("beginScope must be object"),G;ee(A,A.begin,{key:"beginScope"}),A.begin=j(A.begin,{joinWith:""})}}function we(A){if(Array.isArray(A.end)){if(A.skip||A.excludeEnd||A.returnEnd)throw Re("skip, excludeEnd, returnEnd not compatible with endScope: {}"),G;if(typeof A.endScope!="object"||A.endScope===null)throw Re("endScope must be object"),G;ee(A,A.end,{key:"endScope"}),A.end=j(A.end,{joinWith:""})}}function Ke(A){A.scope&&typeof A.scope=="object"&&A.scope!==null&&(A.beginScope=A.scope,delete A.scope)}function kt(A){Ke(A),typeof A.beginScope=="string"&&(A.beginScope={_wrap:A.beginScope}),typeof A.endScope=="string"&&(A.endScope={_wrap:A.endScope}),ae(A),we(A)}function ct(A){function z(te,Q){return new RegExp(p(te),"m"+(A.case_insensitive?"i":"")+(A.unicodeRegex?"u":"")+(Q?"g":""))}class X{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Q,le){le.position=this.position++,this.matchIndexes[this.matchAt]=le,this.regexes.push([le,Q]),this.matchAt+=x(Q)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Q=this.regexes.map(le=>le[1]);this.matcherRe=z(j(Q,{joinWith:"|"}),!0),this.lastIndex=0}exec(Q){this.matcherRe.lastIndex=this.lastIndex;const le=this.matcherRe.exec(Q);if(!le)return null;const Fe=le.findIndex((sn,rr)=>rr>0&&sn!==void 0),De=this.matchIndexes[Fe];return le.splice(0,Fe),Object.assign(le,De)}}class ce{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Q){if(this.multiRegexes[Q])return this.multiRegexes[Q];const le=new X;return this.rules.slice(Q).forEach(([Fe,De])=>le.addRule(Fe,De)),le.compile(),this.multiRegexes[Q]=le,le}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Q,le){this.rules.push([Q,le]),le.type==="begin"&&this.count++}exec(Q){const le=this.getMatcher(this.regexIndex);le.lastIndex=this.lastIndex;let Fe=le.exec(Q);if(this.resumingScanAtSamePosition()&&!(Fe&&Fe.index===this.lastIndex)){const De=this.getMatcher(0);De.lastIndex=this.lastIndex+1,Fe=De.exec(Q)}return Fe&&(this.regexIndex+=Fe.position+1,this.regexIndex===this.count&&this.considerAll()),Fe}}function Le(te){const Q=new ce;return te.contains.forEach(le=>Q.addRule(le.begin,{rule:le,type:"begin"})),te.terminatorEnd&&Q.addRule(te.terminatorEnd,{type:"end"}),te.illegal&&Q.addRule(te.illegal,{type:"illegal"}),Q}function je(te,Q){const le=te;if(te.isCompiled)return le;[at,yt,kt,lt].forEach(De=>De(te,Q)),A.compilerExtensions.forEach(De=>De(te,Q)),te.__beforeBegin=null,[St,Pt,ke].forEach(De=>De(te,Q)),te.isCompiled=!0;let Fe=null;return typeof te.keywords=="object"&&te.keywords.$pattern&&(te.keywords=Object.assign({},te.keywords),Fe=te.keywords.$pattern,delete te.keywords.$pattern),Fe=Fe||/\w+/,te.keywords&&(te.keywords=Bt(te.keywords,A.case_insensitive)),le.keywordPatternRe=z(Fe,!0),Q&&(te.begin||(te.begin=/\B|\b/),le.beginRe=z(le.begin),!te.end&&!te.endsWithParent&&(te.end=/\B|\b/),te.end&&(le.endRe=z(le.end)),le.terminatorEnd=p(le.end)||"",te.endsWithParent&&Q.terminatorEnd&&(le.terminatorEnd+=(te.end?"|":"")+Q.terminatorEnd)),te.illegal&&(le.illegalRe=z(te.illegal)),te.contains||(te.contains=[]),te.contains=[].concat(...te.contains.map(function(De){return Ft(De==="self"?te:De)})),te.contains.forEach(function(De){je(De,le)}),te.starts&&je(te.starts,Q),le.matcher=Le(le),le}if(A.compilerExtensions||(A.compilerExtensions=[]),A.contains&&A.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return A.classNameAliases=r(A.classNameAliases||{}),je(A)}function Tt(A){return A?A.endsWithParent||Tt(A.starts):!1}function Ft(A){return A.variants&&!A.cachedVariants&&(A.cachedVariants=A.variants.map(function(z){return r(A,{variants:null},z)})),A.cachedVariants?A.cachedVariants:Tt(A)?r(A,{starts:A.starts?r(A.starts):null}):Object.isFrozen(A)?r(A):A}var Ge="11.11.1";class Ct extends Error{constructor(z,X){super(z),this.name="HTMLInjectionError",this.html=X}}const Ze=n,vi=r,ki=Symbol("nomatch"),al=7,Ei=function(A){const z=Object.create(null),X=Object.create(null),ce=[];let Le=!0;const je="Could not find the language '{}', did you forget to load/include a language module?",te={disableAutodetect:!0,name:"Plain text",contains:[]};let Q={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:d};function le(Y){return Q.noHighlightRe.test(Y)}function Fe(Y){let oe=Y.className+" ";oe+=Y.parentNode?Y.parentNode.className:"";const ye=Q.languageDetectRe.exec(oe);if(ye){const Te=At(ye[1]);return Te||(fe(je.replace("{}",ye[1])),fe("Falling back to no-highlight mode for this block.",Y)),Te?ye[1]:"no-highlight"}return oe.split(/\s+/).find(Te=>le(Te)||At(Te))}function De(Y,oe,ye){let Te="",Be="";typeof oe=="object"?(Te=Y,ye=oe.ignoreIllegals,Be=oe.language):(P("10.7.0","highlight(lang, code, ...args) has been deprecated."),P("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),Be=Y,Te=oe),ye===void 0&&(ye=!0);const ut={code:Te,language:Be};wn("before:highlight",ut);const Mt=ut.result?ut.result:sn(ut.language,ut.code,ye);return Mt.code=ut.code,wn("after:highlight",Mt),Mt}function sn(Y,oe,ye,Te){const Be=Object.create(null);function ut(Z,ne){return Z.keywords[ne]}function Mt(){if(!ue.keywords){$e.addText(Ce);return}let Z=0;ue.keywordPatternRe.lastIndex=0;let ne=ue.keywordPatternRe.exec(Ce),me="";for(;ne;){me+=Ce.substring(Z,ne.index);const _e=ft.case_insensitive?ne[0].toLowerCase():ne[0],Ue=ut(ue,_e);if(Ue){const[Et,_l]=Ue;if($e.addText(me),me="",Be[_e]=(Be[_e]||0)+1,Be[_e]<=al&&(Sn+=_l),Et.startsWith("_"))me+=ne[0];else{const Nl=ft.classNameAliases[Et]||Et;pt(ne[0],Nl)}}else me+=ne[0];Z=ue.keywordPatternRe.lastIndex,ne=ue.keywordPatternRe.exec(Ce)}me+=Ce.substring(Z),$e.addText(me)}function _n(){if(Ce==="")return;let Z=null;if(typeof ue.subLanguage=="string"){if(!z[ue.subLanguage]){$e.addText(Ce);return}Z=sn(ue.subLanguage,Ce,!0,Mi[ue.subLanguage]),Mi[ue.subLanguage]=Z._top}else Z=ir(Ce,ue.subLanguage.length?ue.subLanguage:null);ue.relevance>0&&(Sn+=Z.relevance),$e.__addSublanguage(Z._emitter,Z.language)}function Je(){ue.subLanguage!=null?_n():Mt(),Ce=""}function pt(Z,ne){Z!==""&&($e.startScope(ne),$e.addText(Z),$e.endScope())}function Si(Z,ne){let me=1;const _e=ne.length-1;for(;me<=_e;){if(!Z._emit[me]){me++;continue}const Ue=ft.classNameAliases[Z[me]]||Z[me],Et=ne[me];Ue?pt(Et,Ue):(Ce=Et,Mt(),Ce=""),me++}}function Ti(Z,ne){return Z.scope&&typeof Z.scope=="string"&&$e.openNode(ft.classNameAliases[Z.scope]||Z.scope),Z.beginScope&&(Z.beginScope._wrap?(pt(Ce,ft.classNameAliases[Z.beginScope._wrap]||Z.beginScope._wrap),Ce=""):Z.beginScope._multi&&(Si(Z.beginScope,ne),Ce="")),ue=Object.create(Z,{parent:{value:ue}}),ue}function Ci(Z,ne,me){let _e=C(Z.endRe,me);if(_e){if(Z["on:end"]){const Ue=new t(Z);Z["on:end"](ne,Ue),Ue.isMatchIgnored&&(_e=!1)}if(_e){for(;Z.endsParent&&Z.parent;)Z=Z.parent;return Z}}if(Z.endsWithParent)return Ci(Z.parent,ne,me)}function yl(Z){return ue.matcher.regexIndex===0?(Ce+=Z[0],1):(lr=!0,0)}function vl(Z){const ne=Z[0],me=Z.rule,_e=new t(me),Ue=[me.__beforeBegin,me["on:begin"]];for(const Et of Ue)if(Et&&(Et(Z,_e),_e.isMatchIgnored))return yl(ne);return me.skip?Ce+=ne:(me.excludeBegin&&(Ce+=ne),Je(),!me.returnBegin&&!me.excludeBegin&&(Ce=ne)),Ti(me,Z),me.returnBegin?0:ne.length}function kl(Z){const ne=Z[0],me=oe.substring(Z.index),_e=Ci(ue,Z,me);if(!_e)return ki;const Ue=ue;ue.endScope&&ue.endScope._wrap?(Je(),pt(ne,ue.endScope._wrap)):ue.endScope&&ue.endScope._multi?(Je(),Si(ue.endScope,Z)):Ue.skip?Ce+=ne:(Ue.returnEnd||Ue.excludeEnd||(Ce+=ne),Je(),Ue.excludeEnd&&(Ce=ne));do ue.scope&&$e.closeNode(),!ue.skip&&!ue.subLanguage&&(Sn+=ue.relevance),ue=ue.parent;while(ue!==_e.parent);return _e.starts&&Ti(_e.starts,Z),Ue.returnEnd?0:ne.length}function El(){const Z=[];for(let ne=ue;ne!==ft;ne=ne.parent)ne.scope&&Z.unshift(ne.scope);Z.forEach(ne=>$e.openNode(ne))}let Nn={};function Ai(Z,ne){const me=ne&&ne[0];if(Ce+=Z,me==null)return Je(),0;if(Nn.type==="begin"&&ne.type==="end"&&Nn.index===ne.index&&me===""){if(Ce+=oe.slice(ne.index,ne.index+1),!Le){const _e=new Error(`0 width match regex (${Y})`);throw _e.languageName=Y,_e.badRule=Nn.rule,_e}return 1}if(Nn=ne,ne.type==="begin")return vl(ne);if(ne.type==="illegal"&&!ye){const _e=new Error('Illegal lexeme "'+me+'" for mode "'+(ue.scope||"")+'"');throw _e.mode=ue,_e}else if(ne.type==="end"){const _e=kl(ne);if(_e!==ki)return _e}if(ne.type==="illegal"&&me==="")return Ce+=` +`,1;if(ar>1e5&&ar>ne.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ce+=me,me.length}const ft=At(Y);if(!ft)throw Re(je.replace("{}",Y)),new Error('Unknown language: "'+Y+'"');const wl=ct(ft);let sr="",ue=Te||wl;const Mi={},$e=new Q.__emitter(Q);El();let Ce="",Sn=0,zt=0,ar=0,lr=!1;try{if(ft.__emitTokens)ft.__emitTokens(oe,$e);else{for(ue.matcher.considerAll();;){ar++,lr?lr=!1:ue.matcher.considerAll(),ue.matcher.lastIndex=zt;const Z=ue.matcher.exec(oe);if(!Z)break;const ne=oe.substring(zt,Z.index),me=Ai(ne,Z);zt=Z.index+me}Ai(oe.substring(zt))}return $e.finalize(),sr=$e.toHTML(),{language:Y,value:sr,relevance:Sn,illegal:!1,_emitter:$e,_top:ue}}catch(Z){if(Z.message&&Z.message.includes("Illegal"))return{language:Y,value:Ze(oe),illegal:!0,relevance:0,_illegalBy:{message:Z.message,index:zt,context:oe.slice(zt-100,zt+100),mode:Z.mode,resultSoFar:sr},_emitter:$e};if(Le)return{language:Y,value:Ze(oe),illegal:!1,relevance:0,errorRaised:Z,_emitter:$e,_top:ue};throw Z}}function rr(Y){const oe={value:Ze(Y),illegal:!1,relevance:0,_top:te,_emitter:new Q.__emitter(Q)};return oe._emitter.addText(Y),oe}function ir(Y,oe){oe=oe||Q.languages||Object.keys(z);const ye=rr(Y),Te=oe.filter(At).filter(Ni).map(Je=>sn(Je,Y,!1));Te.unshift(ye);const Be=Te.sort((Je,pt)=>{if(Je.relevance!==pt.relevance)return pt.relevance-Je.relevance;if(Je.language&&pt.language){if(At(Je.language).supersetOf===pt.language)return 1;if(At(pt.language).supersetOf===Je.language)return-1}return 0}),[ut,Mt]=Be,_n=ut;return _n.secondBest=Mt,_n}function ll(Y,oe,ye){const Te=oe&&X[oe]||ye;Y.classList.add("hljs"),Y.classList.add(`language-${Te}`)}function or(Y){let oe=null;const ye=Fe(Y);if(le(ye))return;if(wn("before:highlightElement",{el:Y,language:ye}),Y.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Y);return}if(Y.children.length>0&&(Q.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Y)),Q.throwUnescapedHTML))throw new Ct("One of your code blocks includes unescaped HTML.",Y.innerHTML);oe=Y;const Te=oe.textContent,Be=ye?De(Te,{language:ye,ignoreIllegals:!0}):ir(Te);Y.innerHTML=Be.value,Y.dataset.highlighted="yes",ll(Y,ye,Be.language),Y.result={language:Be.language,re:Be.relevance,relevance:Be.relevance},Be.secondBest&&(Y.secondBest={language:Be.secondBest.language,relevance:Be.secondBest.relevance}),wn("after:highlightElement",{el:Y,result:Be,text:Te})}function cl(Y){Q=vi(Q,Y)}const ul=()=>{En(),P("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function dl(){En(),P("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let wi=!1;function En(){function Y(){En()}if(document.readyState==="loading"){wi||window.addEventListener("DOMContentLoaded",Y,!1),wi=!0;return}document.querySelectorAll(Q.cssSelector).forEach(or)}function pl(Y,oe){let ye=null;try{ye=oe(A)}catch(Te){if(Re("Language definition for '{}' could not be registered.".replace("{}",Y)),Le)Re(Te);else throw Te;ye=te}ye.name||(ye.name=Y),z[Y]=ye,ye.rawDefinition=oe.bind(null,A),ye.aliases&&_i(ye.aliases,{languageName:Y})}function fl(Y){delete z[Y];for(const oe of Object.keys(X))X[oe]===Y&&delete X[oe]}function ml(){return Object.keys(z)}function At(Y){return Y=(Y||"").toLowerCase(),z[Y]||z[X[Y]]}function _i(Y,{languageName:oe}){typeof Y=="string"&&(Y=[Y]),Y.forEach(ye=>{X[ye.toLowerCase()]=oe})}function Ni(Y){const oe=At(Y);return oe&&!oe.disableAutodetect}function gl(Y){Y["before:highlightBlock"]&&!Y["before:highlightElement"]&&(Y["before:highlightElement"]=oe=>{Y["before:highlightBlock"](Object.assign({block:oe.el},oe))}),Y["after:highlightBlock"]&&!Y["after:highlightElement"]&&(Y["after:highlightElement"]=oe=>{Y["after:highlightBlock"](Object.assign({block:oe.el},oe))})}function hl(Y){gl(Y),ce.push(Y)}function bl(Y){const oe=ce.indexOf(Y);oe!==-1&&ce.splice(oe,1)}function wn(Y,oe){const ye=Y;ce.forEach(function(Te){Te[ye]&&Te[ye](oe)})}function xl(Y){return P("10.7.0","highlightBlock will be removed entirely in v12.0"),P("10.7.0","Please use highlightElement now."),or(Y)}Object.assign(A,{highlight:De,highlightAuto:ir,highlightAll:En,highlightElement:or,highlightBlock:xl,configure:cl,initHighlighting:ul,initHighlightingOnLoad:dl,registerLanguage:pl,unregisterLanguage:fl,listLanguages:ml,getLanguage:At,registerAliases:_i,autoDetection:Ni,inherit:vi,addPlugin:hl,removePlugin:bl}),A.debugMode=function(){Le=!1},A.safeMode=function(){Le=!0},A.versionString=Ge,A.regex={concat:h,lookahead:m,either:y,optional:b,anyNumberOfTimes:f};for(const Y in Oe)typeof Oe[Y]=="object"&&e(Oe[Y]);return Object.assign(A,Oe),A},Vt=Ei({});return Vt.newInstance=()=>Ei({}),Ar=Vt,Vt.HighlightJS=Vt,Vt.default=Vt,Ar}var zh=Fh();const $h=Xr(zh),us={},Uh="hljs-";function Hh(e){const t=$h.newInstance();return e&&s(e),{highlight:n,highlightAuto:r,listLanguages:i,register:s,registerAlias:o,registered:l};function n(u,c,d){const p=d||us,m=typeof p.prefix=="string"?p.prefix:Uh;if(!t.getLanguage(u))throw new Error("Unknown language: `"+u+"` is not registered");t.configure({__emitter:Wh,classPrefix:m});const f=t.highlight(c,{ignoreIllegals:!0,language:u});if(f.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:f.errorRaised});const b=f._emitter.root,h=b.data;return h.language=f.language,h.relevance=f.relevance,b}function r(u,c){const p=(c||us).subset||i();let m=-1,f=0,b;for(;++mf&&(f=v.data.relevance,b=v)}return b||{type:"root",children:[],data:{language:void 0,relevance:f}}}function i(){return t.listLanguages()}function s(u,c){if(typeof u=="string")t.registerLanguage(u,c);else{let d;for(d in u)Object.hasOwn(u,d)&&t.registerLanguage(d,u[d])}}function o(u,c){if(typeof u=="string")t.registerAliases(typeof c=="string"?c:[...c],{languageName:u});else{let d;for(d in u)if(Object.hasOwn(u,d)){const p=u[d];t.registerAliases(typeof p=="string"?p:[...p],{languageName:d})}}}function l(u){return!!t.getLanguage(u)}}class Wh{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],i=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(t){const n=this,r=t.split(".").map(function(o,l){return l?o+"_".repeat(l):n.options.classPrefix+o}),i=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Kh={};function Gh(e){const t=e||Kh,n=t.aliases,r=t.detect||!1,i=t.languages||Bh,s=t.plainText,o=t.prefix,l=t.subset;let u="hljs";const c=Hh(i);if(n&&c.registerAlias(n),o){const d=o.indexOf("-");u=d===-1?o:o.slice(0,d)}return function(d,p){nr(d,"element",function(m,f,b){if(m.tagName!=="code"||!b||b.type!=="element"||b.tagName!=="pre")return;const h=qh(m);if(h===!1||!h&&!r||h&&s&&s.includes(h))return;Array.isArray(m.properties.className)||(m.properties.className=[]),m.properties.className.includes(u)||m.properties.className.unshift(u);const v=dg(m,{whitespace:"pre"});let y;try{y=h?c.highlight(h,v,{prefix:o}):c.highlightAuto(v,{prefix:o,subset:l})}catch(x){const C=x;if(h&&/Unknown language/.test(C.message)){p.message("Cannot highlight as `"+h+"`, it’s not registered",{ancestors:[b,m],cause:C,place:m.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw C}!h&&y.data&&y.data.language&&m.properties.className.push("language-"+y.data.language),y.children.length>0&&(m.children=y.children)})}}function qh(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n0?{type:"text",value:N}:void 0),N===!1?m.lastIndex=O+1:(b!==O&&x.push({type:"text",value:c.value.slice(b,O)}),Array.isArray(N)?x.push(...N):N&&x.push(N),b=O+C[0].length,y=!0),!m.global)break;C=m.exec(c.value)}return y?(b?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=ds(e,"(");let s=ds(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function Ba(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Wt(n)||Jn(n))&&(!t||n!==47)}Fa.peek=yb;function db(){this.buffer()}function pb(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function fb(){this.buffer()}function mb(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function gb(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=dt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hb(e){this.exit(e)}function bb(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=dt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function xb(e){this.exit(e)}function yb(){return"["}function Fa(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),o(),s+=i.move("]"),s}function vb(){return{enter:{gfmFootnoteCallString:db,gfmFootnoteCall:pb,gfmFootnoteDefinitionLabelString:fb,gfmFootnoteDefinition:mb},exit:{gfmFootnoteCallString:gb,gfmFootnoteCall:hb,gfmFootnoteDefinitionLabelString:bb,gfmFootnoteDefinition:xb}}}function kb(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Fa},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const l=s.createTracker(o);let u=l.move("[^");const c=s.enter("footnoteDefinition"),d=s.enter("label");return u+=l.move(s.safe(s.associationId(r),{before:u,after:"]"})),d(),u+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),u+=l.move((t?` +`:" ")+s.indentLines(s.containerFlow(r,l.current()),t?za:Eb))),c(),u}}function Eb(e,t,n){return t===0?e:za(e,t,n)}function za(e,t,n){return(n?"":" ")+e}const wb=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];$a.peek=Cb;function _b(){return{canContainEols:["delete"],enter:{strikethrough:Sb},exit:{strikethrough:Tb}}}function Nb(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:wb}],handlers:{delete:$a}}}function Sb(e){this.enter({type:"delete",children:[]},e)}function Tb(e){this.exit(e)}function $a(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function Cb(){return"~"}function Ab(e){return e.length}function Mb(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Ab,s=[],o=[],l=[],u=[];let c=0,d=-1;for(;++dc&&(c=e[d].length);++yu[y])&&(u[y]=C)}h.push(x)}o[d]=h,l[d]=v}let p=-1;if(typeof r=="object"&&"length"in r)for(;++pu[p]&&(u[p]=x),f[p]=x),m[p]=C}o.splice(1,0,m),l.splice(1,0,f),d=-1;const b=[];for(;++d "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),Ob);return i(),o}function Ob(e,t,n){return">"+(n?"":" ")+e}function Lb(e,t){return fs(e,t.inConstruct,!0)&&!fs(e,t.notInConstruct,!1)}function fs(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ro&&(o=s):s=1,i=r+t.length,r=n.indexOf(t,i);return o}function Db(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Pb(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Bb(e,t,n,r){const i=Pb(n),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(Db(e,n)){const p=n.enter("codeIndented"),m=n.indentLines(s,Fb);return p(),m}const l=n.createTracker(r),u=i.repeat(Math.max(jb(s,i)+1,3)),c=n.enter("codeFenced");let d=l.move(u);if(e.lang){const p=n.enter(`codeFencedLang${o}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${o}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:` `,encode:["`"],...l.current()})),p()}return d+=l.move(` `),s&&(d+=l.move(s+` -`)),d+=l.move(u),c(),d}function Fb(e,t,n){return(n?"":" ")+e}function hi(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function zb(e,t,n,r){const i=hi(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const u=n.createTracker(r);let c=u.move("[");return c+=u.move(n.safe(n.associationId(e),{before:c,after:"]",...u.current()})),c+=u.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(l=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":` -`,...u.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),l()),o(),c}function $b(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function bn(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Vn(e,t,n){const r=nn(e),i=nn(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ua.peek=Ub;function Ua(e,t,n,r){const i=$b(n),s=n.enter("emphasis"),o=n.createTracker(r),l=o.move(i);let u=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const c=u.charCodeAt(0),d=Vn(r.before.charCodeAt(r.before.length-1),c,i);d.inside&&(u=bn(c)+u.slice(1));const p=u.charCodeAt(u.length-1),m=Vn(r.after.charCodeAt(0),p,i);m.inside&&(u=u.slice(0,-1)+bn(p));const f=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:m.outside,before:d.outside},l+u+f}function Ub(e,t,n){return n.options.emphasis||"*"}function Hb(e,t){let n=!1;return nr(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Wr}),!!((!e.depth||e.depth<3)&&si(e)&&(t.options.setext||n))}function Wb(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(Hb(e,n)){const d=n.enter("headingSetext"),p=n.enter("phrasing"),m=n.containerPhrasing(e,{...s.current(),before:` +`)),d+=l.move(u),c(),d}function Fb(e,t,n){return(n?"":" ")+e}function bi(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function zb(e,t,n,r){const i=bi(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const u=n.createTracker(r);let c=u.move("[");return c+=u.move(n.safe(n.associationId(e),{before:c,after:"]",...u.current()})),c+=u.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(l=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":` +`,...u.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),l()),o(),c}function $b(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function bn(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Vn(e,t,n){const r=nn(e),i=nn(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ua.peek=Ub;function Ua(e,t,n,r){const i=$b(n),s=n.enter("emphasis"),o=n.createTracker(r),l=o.move(i);let u=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const c=u.charCodeAt(0),d=Vn(r.before.charCodeAt(r.before.length-1),c,i);d.inside&&(u=bn(c)+u.slice(1));const p=u.charCodeAt(u.length-1),m=Vn(r.after.charCodeAt(0),p,i);m.inside&&(u=u.slice(0,-1)+bn(p));const f=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:m.outside,before:d.outside},l+u+f}function Ub(e,t,n){return n.options.emphasis||"*"}function Hb(e,t){let n=!1;return nr(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Wr}),!!((!e.depth||e.depth<3)&&ai(e)&&(t.options.setext||n))}function Wb(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(Hb(e,n)){const d=n.enter("headingSetext"),p=n.enter("phrasing"),m=n.containerPhrasing(e,{...s.current(),before:` `,after:` `});return p(),d(),m+` `+(i===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(` `))+1))}const o="#".repeat(i),l=n.enter("headingAtx"),u=n.enter("phrasing");s.move(o+" ");let c=n.containerPhrasing(e,{before:"# ",after:` -`,...s.current()});return/^[\t ]/.test(c)&&(c=bn(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),u(),l(),c}Ha.peek=Kb;function Ha(e){return e.value||""}function Kb(){return"<"}Wa.peek=Gb;function Wa(e,t,n,r){const i=hi(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const u=n.createTracker(r);let c=u.move("![");return c+=u.move(n.safe(e.alt,{before:c,after:"]",...u.current()})),c+=u.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(l=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":")",...u.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),l()),c+=u.move(")"),o(),c}function Gb(){return"!"}Ka.peek=qb;function Ka(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");const c=n.safe(e.alt,{before:u,after:"]",...l.current()});u+=l.move(c+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return o(),n.stack=d,s(),i==="full"||!c||c!==p?u+=l.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function qb(){return"!"}Ga.peek=Vb;function Ga(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s\u007F]/.test(e.url))}Va.peek=Yb;function Va(e,t,n,r){const i=hi(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,u;if(qa(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let p=o.move("<");return p+=o.move(n.containerPhrasing(e,{before:p,after:">",...o.current()})),p+=o.move(">"),l(),n.stack=d,p}l=n.enter("link"),u=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(u=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),u(),e.title&&(u=n.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),u()),c+=o.move(")"),l(),c}function Yb(e,t,n){return qa(e,n)?"<":"["}Ya.peek=Xb;function Ya(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");const c=n.containerPhrasing(e,{before:u,after:"]",...l.current()});u+=l.move(c+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return o(),n.stack=d,s(),i==="full"||!c||c!==p?u+=l.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function Xb(){return"["}function bi(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Zb(e){const t=bi(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Jb(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Xa(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Qb(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?Jb(n):bi(n);const l=e.ordered?o==="."?")":".":Zb(n);let u=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),Xa(n)===o&&d){let p=-1;for(;++p-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(s+" ".repeat(o-s.length)),l.shift(o);const u=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,l.current()),d);return u(),c;function d(p,m,f){return m?(f?"":" ".repeat(o))+p:(f?s:s+" ".repeat(o-s.length))+p}}function nx(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const rx=vn(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ix(e,t,n,r){return(e.children.some(function(o){return rx(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function ox(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Za.peek=sx;function Za(e,t,n,r){const i=ox(n),s=n.enter("strong"),o=n.createTracker(r),l=o.move(i+i);let u=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const c=u.charCodeAt(0),d=Vn(r.before.charCodeAt(r.before.length-1),c,i);d.inside&&(u=bn(c)+u.slice(1));const p=u.charCodeAt(u.length-1),m=Vn(r.after.charCodeAt(0),p,i);m.inside&&(u=u.slice(0,-1)+bn(p));const f=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:m.outside,before:d.outside},l+u+f}function sx(e,t,n){return n.options.strong||"*"}function ax(e,t,n,r){return n.safe(e.value,r)}function lx(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function cx(e,t,n){const r=(Xa(n)+(n.options.ruleSpaces?" ":"")).repeat(lx(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Ja={blockquote:Rb,break:fs,code:Bb,definition:zb,emphasis:Ua,hardBreak:fs,heading:Wb,html:Ha,image:Wa,imageReference:Ka,inlineCode:Ga,link:Va,linkReference:Ya,list:Qb,listItem:tx,paragraph:nx,root:ix,strong:Za,text:ax,thematicBreak:cx};function ux(){return{enter:{table:dx,tableData:ms,tableHeader:ms,tableRow:fx},exit:{codeText:mx,table:px,tableData:Or,tableHeader:Or,tableRow:Or}}}function dx(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function px(e){this.exit(e),this.data.inTable=void 0}function fx(e){this.enter({type:"tableRow",children:[]},e)}function Or(e){this.exit(e)}function ms(e){this.enter({type:"tableCell",children:[]},e)}function mx(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,gx));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function gx(e,t){return t==="|"?t:e}function hx(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` -`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:o,tableCell:u,tableRow:l}};function o(f,h,b,x){return c(d(f,b,x),f.align)}function l(f,h,b,x){const y=p(f,b,x),w=c([y]);return w.slice(0,w.indexOf(` -`))}function u(f,h,b,x){const y=b.enter("tableCell"),w=b.enter("phrasing"),T=b.containerPhrasing(f,{...x,before:s,after:s});return w(),y(),T}function c(f,h){return Mb(f,{align:h,alignDelimiters:r,padding:n,stringLength:i})}function d(f,h,b){const x=f.children;let y=-1;const w=[],T=h.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Lx={tokenize:Ux,partial:!0};function jx(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Fx,continuation:{tokenize:zx},exit:$x}},text:{91:{name:"gfmFootnoteCall",tokenize:Bx},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Dx,resolveTo:Px}}}}function Dx(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){o=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return l;function l(u){if(!o||!o._balanced)return n(u);const c=dt(r.sliceSerialize({start:o.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function Px(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function Bx(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return l;function l(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),u}function u(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(p){if(s>999||p===93&&!o||p===null||p===91||Se(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return i.includes(dt(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return Se(p)||(o=!0),s++,e.consume(p),p===92?d:c}function d(p){return p===91||p===92||p===93?(e.consume(p),s++,c):c(p)}}function Fx(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,l;return u;function u(h){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(h){return h===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(h)}function d(h){if(o>999||h===93&&!l||h===null||h===91||Se(h))return n(h);if(h===93){e.exit("chunkString");const b=e.exit("gfmFootnoteDefinitionLabelString");return s=dt(r.sliceSerialize(b)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(h),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return Se(h)||(l=!0),o++,e.consume(h),h===92?p:d}function p(h){return h===91||h===92||h===93?(e.consume(h),o++,d):d(h)}function m(h){return h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),i.includes(s)||i.push(s),ke(e,f,"gfmFootnoteDefinitionWhitespace")):n(h)}function f(h){return t(h)}}function zx(e,t,n){return e.check(yn,t,e.attempt(Lx,t,n))}function $x(e){e.exit("gfmFootnoteDefinition")}function Ux(e,t,n){const r=this;return ke(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function Hx(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,l){let u=-1;for(;++u1?u(h):(o.consume(h),p++,f);if(p<2&&!n)return u(h);const x=o.exit("strikethroughSequenceTemporary"),y=nn(h);return x._open=!y||y===2&&!!b,x._close=!b||b===2&&!!y,l(h)}}}class Wx{constructor(){this.map=[]}add(t,n,r){Kx(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function Kx(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const v=r.events[M][1].type;if(v==="lineEnding"||v==="linePrefix")M--;else break}const L=M>-1?r.events[M][1].type:null,C=L==="tableHead"||L==="tableRow"?_:u;return C===_&&r.parser.lazy[r.now().line]?n(S):C(S)}function u(S){return e.enter("tableHead"),e.enter("tableRow"),c(S)}function c(S){return S===124||(o=!0,s+=1),d(S)}function d(S){return S===null?n(S):se(S)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),f):n(S):he(S)?ke(e,d,"whitespace")(S):(s+=1,o&&(o=!1,i+=1),S===124?(e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),p(S)))}function p(S){return S===null||S===124||Se(S)?(e.exit("data"),d(S)):(e.consume(S),S===92?m:p)}function m(S){return S===92||S===124?(e.consume(S),p):p(S)}function f(S){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(S):(e.enter("tableDelimiterRow"),o=!1,he(S)?ke(e,h,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):h(S))}function h(S){return S===45||S===58?x(S):S===124?(o=!0,e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),b):O(S)}function b(S){return he(S)?ke(e,x,"whitespace")(S):x(S)}function x(S){return S===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(S),e.exit("tableDelimiterMarker"),y):S===45?(s+=1,y(S)):S===null||se(S)?j(S):O(S)}function y(S){return S===45?(e.enter("tableDelimiterFiller"),w(S)):O(S)}function w(S){return S===45?(e.consume(S),w):S===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(S),e.exit("tableDelimiterMarker"),T):(e.exit("tableDelimiterFiller"),T(S))}function T(S){return he(S)?ke(e,j,"whitespace")(S):j(S)}function j(S){return S===124?h(S):S===null||se(S)?!o||i!==s?O(S):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(S)):O(S)}function O(S){return n(S)}function _(S){return e.enter("tableRow"),P(S)}function P(S){return S===124?(e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),P):S===null||se(S)?(e.exit("tableRow"),t(S)):he(S)?ke(e,P,"whitespace")(S):(e.enter("data"),D(S))}function D(S){return S===null||S===124||Se(S)?(e.exit("data"),P(S)):(e.consume(S),S===92?R:D)}function R(S){return S===92||S===124?(e.consume(S),D):D(S)}}function Yx(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],l=!1,u=0,c,d,p;const m=new Wx;for(;++nn[2]+1){const h=n[2]+1,b=n[3]-n[2]-1;e.add(h,b,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return i!==void 0&&(s.end=Object.assign({},Qt(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function hs(e,t,n,r,i){const s=[],o=Qt(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function Qt(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Xx={name:"tasklistCheck",tokenize:Jx};function Zx(){return{text:{91:Xx}}}function Jx(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),s)}function s(u){return Se(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),o):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),o):n(u)}function o(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(u)}function l(u){return se(u)?t(u):he(u)?e.check({tokenize:Qx},t,n)(u):n(u)}}function Qx(e,t,n){return ke(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function ey(e){return Xs([Nx(),jx(),Hx(e),qx(),Zx()])}const ty={};function ny(e){const t=this,n=e||ty,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(ey(n)),s.push(kx()),o.push(Ex(n))}const ry={user:{label:"You",color:"var(--info)"},assistant:{label:"AI",color:"var(--success)"},tool:{label:"Tool",color:"var(--warning)"},plan:{label:"Plan",color:"var(--accent)"},thinking:{label:"Reasoning",color:"var(--text-muted)"}};function iy({message:e}){const[t,n]=N.useState(!1);return a.jsxs("div",{className:"py-1.5",children:[a.jsxs("button",{onClick:()=>n(!t),className:"flex items-center gap-1.5 mb-0.5 cursor-pointer",style:{background:"none",border:"none",padding:0},children:[a.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:"var(--text-muted)",opacity:.5}}),a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-muted)"},children:"Reasoning"}),a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-muted)",strokeWidth:"2",style:{transform:t?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s",marginLeft:2},children:a.jsx("path",{d:"M6 9l6 6 6-6"})})]}),t&&a.jsx("div",{className:"text-[12px] leading-relaxed pl-2.5 max-w-prose whitespace-pre-wrap",style:{color:"var(--text-muted)",fontStyle:"italic"},children:e.content})]})}function oy({message:e}){const t=e.planItems??[];return a.jsxs("div",{className:"py-1.5",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:"var(--accent)"}}),a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--accent)"},children:"Plan"})]}),a.jsx("div",{className:"pl-2.5 space-y-1 mt-1",children:t.map((n,r)=>a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[n.status==="completed"?a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--success)",strokeWidth:"2.5",strokeLinecap:"round",children:a.jsx("path",{d:"M20 6L9 17l-5-5"})}):n.status==="in_progress"?a.jsx("span",{className:"w-3.5 h-3.5 flex items-center justify-center",children:a.jsx("span",{className:"w-2 h-2 rounded-full animate-pulse",style:{background:"var(--accent)"}})}):a.jsx("span",{className:"w-3.5 h-3.5 flex items-center justify-center",children:a.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:"var(--text-muted)",opacity:.4}})}),a.jsx("span",{style:{color:n.status==="completed"?"var(--text-muted)":"var(--text-primary)",textDecoration:n.status==="completed"?"line-through":"none"},children:n.title})]},r))})]})}function sy({tc:e}){const t=n=>{if(!e.tool_call_id)return;const r=ze.getState().sessionId;r&&(ze.getState().resolveToolApproval(e.tool_call_id,n),Xn().sendToolApproval(r,e.tool_call_id,n))};return a.jsxs("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--warning) 40%, var(--border))"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"color-mix(in srgb, var(--warning) 10%, var(--bg-secondary))"},children:[a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--warning)"},children:"Action Required"}),a.jsx("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--text-primary)"},children:e.tool})]}),e.args!=null&&a.jsx("pre",{className:"px-3 py-2 text-[11px] font-mono whitespace-pre-wrap break-words overflow-y-auto leading-normal",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)",maxHeight:200},children:JSON.stringify(e.args,null,2)}),a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--bg-secondary)",borderTop:"1px solid var(--border)"},children:[a.jsx("button",{onClick:()=>t(!0),className:"text-xs font-semibold px-3 py-1.5 rounded cursor-pointer transition-colors",style:{background:"color-mix(in srgb, var(--success) 15%, var(--bg-secondary))",color:"var(--success)",border:"1px solid color-mix(in srgb, var(--success) 30%, var(--border))"},onMouseEnter:n=>{n.currentTarget.style.background="color-mix(in srgb, var(--success) 25%, var(--bg-secondary))"},onMouseLeave:n=>{n.currentTarget.style.background="color-mix(in srgb, var(--success) 15%, var(--bg-secondary))"},children:"Approve"}),a.jsx("button",{onClick:()=>t(!1),className:"text-xs font-semibold px-3 py-1.5 rounded cursor-pointer transition-colors",style:{background:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",color:"var(--error)",border:"1px solid color-mix(in srgb, var(--error) 30%, var(--border))"},onMouseEnter:n=>{n.currentTarget.style.background="color-mix(in srgb, var(--error) 25%, var(--bg-secondary))"},onMouseLeave:n=>{n.currentTarget.style.background="color-mix(in srgb, var(--error) 15%, var(--bg-secondary))"},children:"Reject"})]})]})}function ay({tc:e,active:t,onClick:n}){const r=e.status==="denied",i=e.result!==void 0,s=r?"var(--error)":i?e.is_error?"var(--error)":"var(--success)":"var(--text-muted)",o=r?"✗":i?e.is_error?"✗":"✓":"•";return a.jsxs("button",{onClick:n,className:"inline-flex items-center gap-1 text-[11px] font-mono px-2 py-1 rounded cursor-pointer transition-all",style:{background:t?"var(--bg-secondary)":"var(--bg-primary)",border:t?"1px solid var(--text-muted)":"1px solid var(--border)",color:s},children:[o," ",e.tool,r&&a.jsx("span",{className:"ml-1 text-[10px] uppercase",children:"Denied"})]})}function ly({tc:e}){const t=e.result!==void 0,n=e.args!=null&&Object.keys(e.args).length>0;return a.jsxs("div",{className:"rounded-lg overflow-hidden",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5",style:{borderBottom:"1px solid var(--border)"},children:[a.jsx("span",{className:"text-[11px] font-mono font-semibold",style:{color:"var(--text-primary)"},children:e.tool}),e.is_error&&a.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 rounded",style:{background:"color-mix(in srgb, var(--error) 15%, transparent)",color:"var(--error)"},children:"Error"})]}),a.jsxs("div",{className:"flex flex-col gap-0",children:[n&&a.jsxs("div",{style:{borderBottom:t?"1px solid var(--border)":"none"},children:[a.jsx("div",{className:"px-3 pt-1.5 pb-0.5",children:a.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold",style:{color:"var(--text-muted)"},children:"Input"})}),a.jsx("pre",{className:"px-3 pb-2 text-[11px] font-mono whitespace-pre-wrap break-words overflow-y-auto leading-relaxed",style:{color:"var(--text-secondary)",maxHeight:160},children:JSON.stringify(e.args,null,2)})]}),t&&a.jsxs("div",{children:[a.jsx("div",{className:"px-3 pt-1.5 pb-0.5",children:a.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold",style:{color:e.is_error?"var(--error)":"var(--text-muted)"},children:"Output"})}),a.jsx("pre",{className:"px-3 pb-2 text-[11px] font-mono whitespace-pre-wrap break-words overflow-y-auto leading-relaxed",style:{color:e.is_error?"var(--error)":"var(--text-secondary)",maxHeight:240},children:e.result})]})]})]})}const bs=3;function cy({message:e}){const t=e.toolCalls??(e.toolCall?[e.toolCall]:[]),[n,r]=N.useState(!1),[i,s]=N.useState(null);if(t.length===0)return null;const o=t.find(p=>p.status==="pending");if(o)return a.jsx("div",{className:"py-1.5 pl-2.5",children:a.jsx(sy,{tc:o})});const l=t.length-bs,u=l>0&&!n,c=u?t.slice(-bs):t,d=u?l:0;return a.jsxs("div",{className:"py-1.5",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:"var(--warning)"}}),a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--warning)"},children:t.length===1?"Tool":`Tools (${t.length})`})]}),a.jsxs("div",{className:"pl-2.5 space-y-1.5",children:[a.jsxs("div",{className:"flex flex-wrap gap-1",children:[u&&a.jsxs("button",{onClick:()=>r(!0),className:"inline-flex items-center gap-1 text-[11px] font-mono px-2 py-1 rounded cursor-pointer hover:brightness-125",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-muted)"},children:["+",l," more"]}),c.map((p,m)=>{const f=m+d;return a.jsx(ay,{tc:p,active:i===f,onClick:()=>s(i===f?null:f)},f)})]}),i!==null&&t[i]&&a.jsx(ly,{tc:t[i]})]})]})}function uy(e){const t=e.total_prompt_tokens+e.total_completion_tokens;let n=`## Agent Diagnostics +`,...s.current()});return/^[\t ]/.test(c)&&(c=bn(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),u(),l(),c}Ha.peek=Kb;function Ha(e){return e.value||""}function Kb(){return"<"}Wa.peek=Gb;function Wa(e,t,n,r){const i=bi(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const u=n.createTracker(r);let c=u.move("![");return c+=u.move(n.safe(e.alt,{before:c,after:"]",...u.current()})),c+=u.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(l=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":")",...u.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),l()),c+=u.move(")"),o(),c}function Gb(){return"!"}Ka.peek=qb;function Ka(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");const c=n.safe(e.alt,{before:u,after:"]",...l.current()});u+=l.move(c+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return o(),n.stack=d,s(),i==="full"||!c||c!==p?u+=l.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function qb(){return"!"}Ga.peek=Vb;function Ga(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s\u007F]/.test(e.url))}Va.peek=Yb;function Va(e,t,n,r){const i=bi(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,u;if(qa(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let p=o.move("<");return p+=o.move(n.containerPhrasing(e,{before:p,after:">",...o.current()})),p+=o.move(">"),l(),n.stack=d,p}l=n.enter("link"),u=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(u=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),u(),e.title&&(u=n.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),u()),c+=o.move(")"),l(),c}function Yb(e,t,n){return qa(e,n)?"<":"["}Ya.peek=Xb;function Ya(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");const c=n.containerPhrasing(e,{before:u,after:"]",...l.current()});u+=l.move(c+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return o(),n.stack=d,s(),i==="full"||!c||c!==p?u+=l.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function Xb(){return"["}function xi(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Zb(e){const t=xi(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Jb(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Xa(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Qb(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?Jb(n):xi(n);const l=e.ordered?o==="."?")":".":Zb(n);let u=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),Xa(n)===o&&d){let p=-1;for(;++p-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(s+" ".repeat(o-s.length)),l.shift(o);const u=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,l.current()),d);return u(),c;function d(p,m,f){return m?(f?"":" ".repeat(o))+p:(f?s:s+" ".repeat(o-s.length))+p}}function nx(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const rx=vn(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ix(e,t,n,r){return(e.children.some(function(o){return rx(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function ox(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Za.peek=sx;function Za(e,t,n,r){const i=ox(n),s=n.enter("strong"),o=n.createTracker(r),l=o.move(i+i);let u=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const c=u.charCodeAt(0),d=Vn(r.before.charCodeAt(r.before.length-1),c,i);d.inside&&(u=bn(c)+u.slice(1));const p=u.charCodeAt(u.length-1),m=Vn(r.after.charCodeAt(0),p,i);m.inside&&(u=u.slice(0,-1)+bn(p));const f=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:m.outside,before:d.outside},l+u+f}function sx(e,t,n){return n.options.strong||"*"}function ax(e,t,n,r){return n.safe(e.value,r)}function lx(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function cx(e,t,n){const r=(Xa(n)+(n.options.ruleSpaces?" ":"")).repeat(lx(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Ja={blockquote:Rb,break:ms,code:Bb,definition:zb,emphasis:Ua,hardBreak:ms,heading:Wb,html:Ha,image:Wa,imageReference:Ka,inlineCode:Ga,link:Va,linkReference:Ya,list:Qb,listItem:tx,paragraph:nx,root:ix,strong:Za,text:ax,thematicBreak:cx};function ux(){return{enter:{table:dx,tableData:gs,tableHeader:gs,tableRow:fx},exit:{codeText:mx,table:px,tableData:Or,tableHeader:Or,tableRow:Or}}}function dx(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function px(e){this.exit(e),this.data.inTable=void 0}function fx(e){this.enter({type:"tableRow",children:[]},e)}function Or(e){this.exit(e)}function gs(e){this.enter({type:"tableCell",children:[]},e)}function mx(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,gx));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function gx(e,t){return t==="|"?t:e}function hx(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:o,tableCell:u,tableRow:l}};function o(f,b,h,v){return c(d(f,h,v),f.align)}function l(f,b,h,v){const y=p(f,h,v),x=c([y]);return x.slice(0,x.indexOf(` +`))}function u(f,b,h,v){const y=h.enter("tableCell"),x=h.enter("phrasing"),C=h.containerPhrasing(f,{...v,before:s,after:s});return x(),y(),C}function c(f,b){return Mb(f,{align:b,alignDelimiters:r,padding:n,stringLength:i})}function d(f,b,h){const v=f.children;let y=-1;const x=[],C=b.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Lx={tokenize:Ux,partial:!0};function jx(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Fx,continuation:{tokenize:zx},exit:$x}},text:{91:{name:"gfmFootnoteCall",tokenize:Bx},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Dx,resolveTo:Px}}}}function Dx(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){o=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return l;function l(u){if(!o||!o._balanced)return n(u);const c=dt(r.sliceSerialize({start:o.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function Px(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function Bx(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return l;function l(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),u}function u(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(p){if(s>999||p===93&&!o||p===null||p===91||Se(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return i.includes(dt(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return Se(p)||(o=!0),s++,e.consume(p),p===92?d:c}function d(p){return p===91||p===92||p===93?(e.consume(p),s++,c):c(p)}}function Fx(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,l;return u;function u(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(b)}function d(b){if(o>999||b===93&&!l||b===null||b===91||Se(b))return n(b);if(b===93){e.exit("chunkString");const h=e.exit("gfmFootnoteDefinitionLabelString");return s=dt(r.sliceSerialize(h)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return Se(b)||(l=!0),o++,e.consume(b),b===92?p:d}function p(b){return b===91||b===92||b===93?(e.consume(b),o++,d):d(b)}function m(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),i.includes(s)||i.push(s),Ee(e,f,"gfmFootnoteDefinitionWhitespace")):n(b)}function f(b){return t(b)}}function zx(e,t,n){return e.check(yn,t,e.attempt(Lx,t,n))}function $x(e){e.exit("gfmFootnoteDefinition")}function Ux(e,t,n){const r=this;return Ee(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function Hx(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,l){let u=-1;for(;++u1?u(b):(o.consume(b),p++,f);if(p<2&&!n)return u(b);const v=o.exit("strikethroughSequenceTemporary"),y=nn(b);return v._open=!y||y===2&&!!h,v._close=!h||h===2&&!!y,l(b)}}}class Wx{constructor(){this.map=[]}add(t,n,r){Kx(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function Kx(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const w=r.events[T][1].type;if(w==="lineEnding"||w==="linePrefix")T--;else break}const L=T>-1?r.events[T][1].type:null,M=L==="tableHead"||L==="tableRow"?N:u;return M===N&&r.parser.lazy[r.now().line]?n(S):M(S)}function u(S){return e.enter("tableHead"),e.enter("tableRow"),c(S)}function c(S){return S===124||(o=!0,s+=1),d(S)}function d(S){return S===null?n(S):se(S)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),f):n(S):he(S)?Ee(e,d,"whitespace")(S):(s+=1,o&&(o=!1,i+=1),S===124?(e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),p(S)))}function p(S){return S===null||S===124||Se(S)?(e.exit("data"),d(S)):(e.consume(S),S===92?m:p)}function m(S){return S===92||S===124?(e.consume(S),p):p(S)}function f(S){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(S):(e.enter("tableDelimiterRow"),o=!1,he(S)?Ee(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):b(S))}function b(S){return S===45||S===58?v(S):S===124?(o=!0,e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),h):j(S)}function h(S){return he(S)?Ee(e,v,"whitespace")(S):v(S)}function v(S){return S===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(S),e.exit("tableDelimiterMarker"),y):S===45?(s+=1,y(S)):S===null||se(S)?O(S):j(S)}function y(S){return S===45?(e.enter("tableDelimiterFiller"),x(S)):j(S)}function x(S){return S===45?(e.consume(S),x):S===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(S),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(S))}function C(S){return he(S)?Ee(e,O,"whitespace")(S):O(S)}function O(S){return S===124?b(S):S===null||se(S)?!o||i!==s?j(S):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(S)):j(S)}function j(S){return n(S)}function N(S){return e.enter("tableRow"),B(S)}function B(S){return S===124?(e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),B):S===null||se(S)?(e.exit("tableRow"),t(S)):he(S)?Ee(e,B,"whitespace")(S):(e.enter("data"),D(S))}function D(S){return S===null||S===124||Se(S)?(e.exit("data"),B(S)):(e.consume(S),S===92?R:D)}function R(S){return S===92||S===124?(e.consume(S),D):D(S)}}function Yx(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],l=!1,u=0,c,d,p;const m=new Wx;for(;++nn[2]+1){const b=n[2]+1,h=n[3]-n[2]-1;e.add(b,h,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return i!==void 0&&(s.end=Object.assign({},Qt(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function bs(e,t,n,r,i){const s=[],o=Qt(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function Qt(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Xx={name:"tasklistCheck",tokenize:Jx};function Zx(){return{text:{91:Xx}}}function Jx(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),s)}function s(u){return Se(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),o):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),o):n(u)}function o(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(u)}function l(u){return se(u)?t(u):he(u)?e.check({tokenize:Qx},t,n)(u):n(u)}}function Qx(e,t,n){return Ee(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function ey(e){return Xs([Nx(),jx(),Hx(e),qx(),Zx()])}const ty={};function ny(e){const t=this,n=e||ty,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(ey(n)),s.push(kx()),o.push(Ex(n))}const ry={user:{label:"You",color:"var(--info)"},assistant:{label:"AI",color:"var(--success)"},tool:{label:"Tool",color:"var(--warning)"},plan:{label:"Plan",color:"var(--accent)"},thinking:{label:"Reasoning",color:"var(--text-muted)"}};function iy({message:e}){const[t,n]=_.useState(!1);return a.jsxs("div",{className:"py-1.5",children:[a.jsxs("button",{onClick:()=>n(!t),className:"flex items-center gap-1.5 mb-0.5 cursor-pointer",style:{background:"none",border:"none",padding:0},children:[a.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:"var(--text-muted)",opacity:.5}}),a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-muted)"},children:"Reasoning"}),a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-muted)",strokeWidth:"2",style:{transform:t?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s",marginLeft:2},children:a.jsx("path",{d:"M6 9l6 6 6-6"})})]}),t&&a.jsx("div",{className:"text-[12px] leading-relaxed pl-2.5 max-w-prose whitespace-pre-wrap",style:{color:"var(--text-muted)",fontStyle:"italic"},children:e.content})]})}function oy({message:e}){const t=e.planItems??[];return a.jsxs("div",{className:"py-1.5",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:"var(--accent)"}}),a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--accent)"},children:"Plan"})]}),a.jsx("div",{className:"pl-2.5 space-y-1 mt-1",children:t.map((n,r)=>a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[n.status==="completed"?a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--success)",strokeWidth:"2.5",strokeLinecap:"round",children:a.jsx("path",{d:"M20 6L9 17l-5-5"})}):n.status==="in_progress"?a.jsx("span",{className:"w-3.5 h-3.5 flex items-center justify-center",children:a.jsx("span",{className:"w-2 h-2 rounded-full animate-pulse",style:{background:"var(--accent)"}})}):a.jsx("span",{className:"w-3.5 h-3.5 flex items-center justify-center",children:a.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:"var(--text-muted)",opacity:.4}})}),a.jsx("span",{style:{color:n.status==="completed"?"var(--text-muted)":"var(--text-primary)",textDecoration:n.status==="completed"?"line-through":"none"},children:n.title})]},r))})]})}function sy({tc:e}){const t=n=>{if(!e.tool_call_id)return;const r=ze.getState().sessionId;r&&(ze.getState().resolveToolApproval(e.tool_call_id,n),Xn().sendToolApproval(r,e.tool_call_id,n))};return a.jsxs("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--warning) 40%, var(--border))"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"color-mix(in srgb, var(--warning) 10%, var(--bg-secondary))"},children:[a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--warning)"},children:"Action Required"}),a.jsx("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--text-primary)"},children:e.tool})]}),e.args!=null&&a.jsx("pre",{className:"px-3 py-2 text-[11px] font-mono whitespace-pre-wrap break-words overflow-y-auto leading-normal",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)",maxHeight:200},children:JSON.stringify(e.args,null,2)}),a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--bg-secondary)",borderTop:"1px solid var(--border)"},children:[a.jsx("button",{onClick:()=>t(!0),className:"text-xs font-semibold px-3 py-1.5 rounded cursor-pointer transition-colors",style:{background:"color-mix(in srgb, var(--success) 15%, var(--bg-secondary))",color:"var(--success)",border:"1px solid color-mix(in srgb, var(--success) 30%, var(--border))"},onMouseEnter:n=>{n.currentTarget.style.background="color-mix(in srgb, var(--success) 25%, var(--bg-secondary))"},onMouseLeave:n=>{n.currentTarget.style.background="color-mix(in srgb, var(--success) 15%, var(--bg-secondary))"},children:"Approve"}),a.jsx("button",{onClick:()=>t(!1),className:"text-xs font-semibold px-3 py-1.5 rounded cursor-pointer transition-colors",style:{background:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",color:"var(--error)",border:"1px solid color-mix(in srgb, var(--error) 30%, var(--border))"},onMouseEnter:n=>{n.currentTarget.style.background="color-mix(in srgb, var(--error) 25%, var(--bg-secondary))"},onMouseLeave:n=>{n.currentTarget.style.background="color-mix(in srgb, var(--error) 15%, var(--bg-secondary))"},children:"Reject"})]})]})}function ay({tc:e,active:t,onClick:n}){const r=e.status==="denied",i=e.result!==void 0,s=r?"var(--error)":i?e.is_error?"var(--error)":"var(--success)":"var(--text-muted)",o=r?"✗":i?e.is_error?"✗":"✓":"•";return a.jsxs("button",{onClick:n,className:"inline-flex items-center gap-1 text-[11px] font-mono px-2 py-1 rounded cursor-pointer transition-all",style:{background:t?"var(--bg-secondary)":"var(--bg-primary)",border:t?"1px solid var(--text-muted)":"1px solid var(--border)",color:s},children:[o," ",e.tool,r&&a.jsx("span",{className:"ml-1 text-[10px] uppercase",children:"Denied"})]})}function ly({tc:e}){const t=e.result!==void 0,n=e.args!=null&&Object.keys(e.args).length>0;return a.jsxs("div",{className:"rounded-lg overflow-hidden",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5",style:{borderBottom:"1px solid var(--border)"},children:[a.jsx("span",{className:"text-[11px] font-mono font-semibold",style:{color:"var(--text-primary)"},children:e.tool}),e.is_error&&a.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 rounded",style:{background:"color-mix(in srgb, var(--error) 15%, transparent)",color:"var(--error)"},children:"Error"})]}),a.jsxs("div",{className:"flex flex-col gap-0",children:[n&&a.jsxs("div",{style:{borderBottom:t?"1px solid var(--border)":"none"},children:[a.jsx("div",{className:"px-3 pt-1.5 pb-0.5",children:a.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold",style:{color:"var(--text-muted)"},children:"Input"})}),a.jsx("pre",{className:"px-3 pb-2 text-[11px] font-mono whitespace-pre-wrap break-words overflow-y-auto leading-relaxed",style:{color:"var(--text-secondary)",maxHeight:160},children:JSON.stringify(e.args,null,2)})]}),t&&a.jsxs("div",{children:[a.jsx("div",{className:"px-3 pt-1.5 pb-0.5",children:a.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold",style:{color:e.is_error?"var(--error)":"var(--text-muted)"},children:"Output"})}),a.jsx("pre",{className:"px-3 pb-2 text-[11px] font-mono whitespace-pre-wrap break-words overflow-y-auto leading-relaxed",style:{color:e.is_error?"var(--error)":"var(--text-secondary)",maxHeight:240},children:e.result})]})]})]})}const xs=3;function cy({message:e}){const t=e.toolCalls??(e.toolCall?[e.toolCall]:[]),[n,r]=_.useState(!1),[i,s]=_.useState(null);if(t.length===0)return null;const o=t.find(p=>p.status==="pending");if(o)return a.jsx("div",{className:"py-1.5 pl-2.5",children:a.jsx(sy,{tc:o})});const l=t.length-xs,u=l>0&&!n,c=u?t.slice(-xs):t,d=u?l:0;return a.jsxs("div",{className:"py-1.5",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:"var(--warning)"}}),a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--warning)"},children:t.length===1?"Tool":`Tools (${t.length})`})]}),a.jsxs("div",{className:"pl-2.5 space-y-1.5",children:[a.jsxs("div",{className:"flex flex-wrap gap-1",children:[u&&a.jsxs("button",{onClick:()=>r(!0),className:"inline-flex items-center gap-1 text-[11px] font-mono px-2 py-1 rounded cursor-pointer hover:brightness-125",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-muted)"},children:["+",l," more"]}),c.map((p,m)=>{const f=m+d;return a.jsx(ay,{tc:p,active:i===f,onClick:()=>s(i===f?null:f)},f)})]}),i!==null&&t[i]&&a.jsx(ly,{tc:t[i]})]})]})}function uy(e){const t=e.total_prompt_tokens+e.total_completion_tokens;let n=`## Agent Diagnostics - Model: ${e.model} - Turns: ${e.turn_count}/50 (max reached) - Tokens: ${e.total_prompt_tokens} prompt + ${e.total_completion_tokens} completion = ${t} total @@ -115,5 +115,5 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Be=Y,Te=oe),ye===void - [${o.status}] ${o.title}`}const s=e.last_messages;return s&&s.length>0&&(n+=` ## Last Messages`,s.forEach((o,l)=>{const u=o.tool?`${o.role}:${o.tool}`:o.role,c=o.content?o.content.replace(/\n/g," "):"";n+=` -${l+1}. [${u}] ${c}`})),n}function dy(){const[e,t]=N.useState("idle"),n=async()=>{const r=ze.getState().sessionId;if(r){t("loading");try{const i=await zu(r),s=uy(i);await navigator.clipboard.writeText(s),t("copied"),setTimeout(()=>t("idle"),2e3)}catch{t("idle")}}};return a.jsx("button",{onClick:n,disabled:e==="loading",className:"inline-flex items-center gap-1 text-[11px] font-mono px-2 py-1 rounded cursor-pointer hover:brightness-125 mt-1",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:e==="copied"?"var(--success)":"var(--text-muted)"},children:e==="copied"?"Copied!":e==="loading"?"Loading...":"Copy Diagnostics"})}function py({message:e}){if(e.role==="thinking")return a.jsx(iy,{message:e});if(e.role==="plan")return a.jsx(oy,{message:e});if(e.role==="tool")return a.jsx(cy,{message:e});const t=e.role==="user"?"user":"assistant",n=ry[t];return a.jsxs("div",{className:"py-1.5",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:n.color}}),a.jsx("span",{className:"text-[11px] font-semibold",style:{color:n.color},children:n.label})]}),e.content&&(e.role==="user"?a.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose",style:{color:"var(--text-primary)"},children:e.content}):a.jsxs("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose chat-markdown",style:{color:"var(--text-secondary)"},children:[a.jsx(eg,{remarkPlugins:[ny],rehypePlugins:[Gh],children:e.content}),e.content.includes("Reached maximum iterations")&&a.jsx(dy,{})]}))]})}function fy(){const e=ze(l=>l.activeQuestion),t=ze(l=>l.sessionId),n=ze(l=>l.setActiveQuestion),[r,i]=N.useState("");if(!e)return null;const s=l=>{t&&(Xn().sendQuestionResponse(t,e.question_id,l),n(null),i(""))},o=e.options.length>0;return a.jsxs("div",{className:"mx-3 mb-2 rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--accent) 40%, var(--border))"},children:[a.jsx("div",{className:"px-3 py-2",style:{background:"color-mix(in srgb, var(--accent) 10%, var(--bg-secondary))"},children:a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--accent)"},children:"Question"})}),a.jsxs("div",{className:"px-3 py-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("p",{className:"text-sm mb-2",style:{color:"var(--text-primary)"},children:e.question}),o&&a.jsx("div",{className:"flex flex-col gap-1 mb-2",children:e.options.map((l,u)=>a.jsxs("button",{onClick:()=>s(l),className:"w-full text-left text-[13px] py-2 px-3 rounded cursor-pointer transition-colors flex items-center gap-2",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",borderLeft:"2px solid transparent",color:"var(--text-primary)",fontFamily:"var(--font-mono, ui-monospace, monospace)"},onMouseEnter:c=>{c.currentTarget.style.borderLeftColor="var(--accent)",c.currentTarget.style.background="color-mix(in srgb, var(--accent) 8%, var(--bg-primary))"},onMouseLeave:c=>{c.currentTarget.style.borderLeftColor="transparent",c.currentTarget.style.background="var(--bg-primary)"},children:[a.jsxs("span",{className:"text-[11px] font-semibold shrink-0",style:{color:"var(--text-muted)"},children:[u+1,"."]}),a.jsx("span",{className:"truncate",children:l})]},u))}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{type:"text",value:r,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Enter"&&r.trim()&&s(r.trim())},placeholder:o?"Or type a custom answer...":"Type your answer...",className:"flex-1 text-sm px-2 py-1.5 rounded outline-none",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-primary)"}}),a.jsx("button",{onClick:()=>{r.trim()&&s(r.trim())},disabled:!r.trim(),className:"text-xs font-semibold px-3 py-1.5 rounded cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-not-allowed",style:{background:"color-mix(in srgb, var(--accent) 15%, var(--bg-secondary))",color:"var(--accent)",border:"1px solid color-mix(in srgb, var(--accent) 30%, var(--border))"},children:"Send"})]})]})]})}function my(){const e=N.useRef(Xn()).current,[t,n]=N.useState(""),r=N.useRef(null),i=N.useRef(!0),s=zn(K=>K.enabled),o=zn(K=>K.status),l=!s||o==="authenticated",{sessionId:u,status:c,messages:d,plan:p,models:m,selectedModel:f,modelsLoading:h,skills:b,selectedSkillIds:x,skillsLoading:y,setModels:w,setSelectedModel:T,setModelsLoading:j,setSkills:O,setSelectedSkillIds:_,toggleSkill:P,setSkillsLoading:D,addUserMessage:R,hydrateSession:S,clearSession:M}=ze();N.useEffect(()=>{l&&(m.length>0||(j(!0),Fu().then(K=>{if(w(K),K.length>0&&!f){const W=K.find(re=>re.model_name.includes("claude"));T(W?W.model_name:K[0].model_name)}}).catch(console.error).finally(()=>j(!1))))},[l,m.length,f,w,T,j]),N.useEffect(()=>{b.length>0||(D(!0),Uu().then(K=>{O(K),_(K.map(W=>W.id))}).catch(console.error).finally(()=>D(!1)))},[b.length,O,_,D]),N.useEffect(()=>{if(u)return;const K=sessionStorage.getItem("agent_session_id");K&&$u(K).then(W=>{W?S(W):sessionStorage.removeItem("agent_session_id")}).catch(()=>{sessionStorage.removeItem("agent_session_id")})},[]);const[L,C]=N.useState(!1),v=()=>{const K=r.current;if(!K)return;const W=K.scrollHeight-K.scrollTop-K.clientHeight<40;i.current=W,C(K.scrollTop>100)};N.useEffect(()=>{i.current&&r.current&&(r.current.scrollTop=r.current.scrollHeight)});const E=c==="thinking"||c==="executing"||c==="planning"||c==="awaiting_input",I=d[d.length-1],H=E&&(I==null?void 0:I.role)==="assistant"&&!I.done,U=E&&!H,V=N.useRef(null),g=()=>{const K=V.current;K&&(K.style.height="auto",K.style.height=Math.min(K.scrollHeight,200)+"px")},F=N.useCallback(()=>{const K=t.trim();!K||!f||E||(i.current=!0,R(K),e.sendAgentMessage(K,f,u,x),n(""),requestAnimationFrame(()=>{const W=V.current;W&&(W.style.height="auto")}))},[t,f,E,u,x,R,e]),$=N.useCallback(()=>{u&&e.sendAgentStop(u)},[u,e]),k=K=>{K.key==="Enter"&&!K.shiftKey&&(K.preventDefault(),F())},ie=!E&&!!f&&t.trim().length>0;return l?a.jsxs("div",{className:"flex flex-col h-full",style:{background:"var(--bg-primary)"},children:[a.jsx(xs,{selectedModel:f,models:m,modelsLoading:h,onModelChange:T,skills:b,selectedSkillIds:x,skillsLoading:y,onToggleSkill:P,onClear:M,onStop:$,hasMessages:d.length>0,isBusy:E}),a.jsx(hy,{plan:p}),a.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[a.jsxs("div",{ref:r,onScroll:v,className:"h-full overflow-y-auto px-3 py-2 space-y-0.5",children:[d.length===0&&a.jsxs("div",{className:"flex flex-col items-center justify-center py-10 px-4 gap-3",style:{color:"var(--text-muted)"},children:[a.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),a.jsxs("div",{className:"text-center space-y-1.5",children:[a.jsx("p",{className:"text-sm font-medium",style:{color:"var(--text-secondary)"},children:"Ask the agent to help you code"}),a.jsxs("p",{className:"text-xs leading-relaxed",children:["Create agents, functions, evaluations,",a.jsx("br",{}),"or ask questions about your project."]})]})]}),d.filter(K=>K.role!=="plan").map(K=>a.jsx(py,{message:K},K.id)),U&&a.jsx("div",{className:"py-1.5",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full animate-pulse",style:{background:"var(--success)"}}),a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--success)"},children:c==="thinking"?"Thinking...":c==="executing"?"Executing...":c==="awaiting_input"?"Waiting for answer...":"Planning..."})]})})]}),L&&a.jsx("button",{onClick:()=>{var K;i.current=!1,(K=r.current)==null||K.scrollTo({top:0,behavior:"smooth"})},className:"absolute top-2 right-3 w-6 h-6 flex items-center justify-center rounded-full cursor-pointer transition-opacity opacity-70 hover:opacity-100",style:{background:"var(--bg-tertiary)",color:"var(--text-primary)"},title:"Scroll to top",children:a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"18 15 12 9 6 15"})})})]}),a.jsx(fy,{}),a.jsxs("div",{className:"flex items-end gap-2 px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:[a.jsx("textarea",{ref:V,value:t,onChange:K=>{n(K.target.value),g()},onKeyDown:k,disabled:E||!f,placeholder:E?"Waiting for response...":"Message...",rows:2,className:"flex-1 bg-transparent text-sm py-1 disabled:opacity-40 placeholder:text-[var(--text-muted)] resize-none",style:{color:"var(--text-primary)",maxHeight:200,overflow:"auto"}}),a.jsx("button",{onClick:F,disabled:!ie,className:"text-xs font-semibold px-3 py-1.5 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed shrink-0","aria-label":"Send message",style:{color:ie?"var(--accent)":"var(--text-muted)",background:"transparent"},onMouseEnter:K=>{ie&&(K.currentTarget.style.background="color-mix(in srgb, var(--accent) 10%, transparent)")},onMouseLeave:K=>{K.currentTarget.style.background="transparent"},children:"Send"})]})]}):a.jsxs("div",{className:"flex flex-col h-full",style:{background:"var(--bg-primary)"},children:[a.jsx(xs,{selectedModel:f,models:m,modelsLoading:h,onModelChange:T,skills:b,selectedSkillIds:x,skillsLoading:y,onToggleSkill:P,onClear:M,onStop:$,hasMessages:!1,isBusy:!1}),a.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:a.jsxs("div",{className:"text-center",style:{color:"var(--text-muted)"},children:[a.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"mx-auto mb-2",strokeLinecap:"round",children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"Sign in to use Agent"}),a.jsx("p",{className:"text-xs",children:"Authentication is required to access the coding agent."})]})})]})}function xs({selectedModel:e,models:t,modelsLoading:n,onModelChange:r,skills:i,selectedSkillIds:s,skillsLoading:o,onToggleSkill:l,onClear:u,onStop:c,hasMessages:d,isBusy:p}){const[m,f]=N.useState(!1),h=N.useRef(null);return N.useEffect(()=>{if(!m)return;const b=x=>{h.current&&!h.current.contains(x.target)&&f(!1)};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[m]),a.jsxs("div",{className:"shrink-0 flex items-center gap-2 px-3 h-10 border-b",style:{borderColor:"var(--border)",background:"var(--bg-primary)"},children:[a.jsx("span",{className:"text-[11px] uppercase tracking-wider font-semibold shrink-0",style:{color:"var(--text-muted)"},children:"Agent"}),a.jsxs("select",{value:e??"",onChange:b=>r(b.target.value),className:"flex-1 text-[11px] rounded px-1.5 py-1 outline-none min-w-0 cursor-pointer",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},disabled:n,children:[n&&a.jsx("option",{value:"",children:"Loading models..."}),!n&&t.length===0&&a.jsx("option",{value:"",children:"No models"}),t.map(b=>a.jsx("option",{value:b.model_name,children:b.model_name},b.model_name))]}),!o&&i.length>0&&a.jsxs("div",{className:"relative shrink-0",ref:h,children:[a.jsxs("button",{onClick:()=>f(!m),className:"text-[11px] font-semibold px-2 py-1 rounded cursor-pointer flex items-center gap-1",style:{background:s.length>0?"color-mix(in srgb, var(--accent) 15%, transparent)":"transparent",border:`1px solid ${s.length>0?"var(--accent)":"var(--border)"}`,color:s.length>0?"var(--accent)":"var(--text-muted)"},title:"Skills",children:[a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"}),a.jsx("path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"})]}),s.length>0&&a.jsx("span",{children:s.length})]}),m&&a.jsx("div",{className:"absolute top-full right-0 mt-1 rounded shadow-lg z-50 py-1 max-h-64 overflow-y-auto",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",width:"190px"},children:i.map(b=>a.jsxs("button",{onClick:()=>l(b.id),className:"w-full text-left px-2 py-1 text-[11px] flex items-center gap-1.5 cursor-pointer",style:{color:"var(--text-primary)"},title:b.description,onMouseEnter:x=>{x.currentTarget.style.background="var(--bg-tertiary)"},onMouseLeave:x=>{x.currentTarget.style.background="transparent"},children:[a.jsx("span",{className:"w-3 h-3 rounded border flex items-center justify-center shrink-0",style:{borderColor:s.includes(b.id)?"var(--accent)":"var(--border)",background:s.includes(b.id)?"var(--accent)":"transparent"},children:s.includes(b.id)&&a.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})})}),a.jsx("span",{className:"truncate",children:b.name})]},b.id))})]}),p&&a.jsx("button",{onClick:c,className:"shrink-0 text-[11px] font-semibold px-2 py-1 rounded cursor-pointer",style:{background:"transparent",border:"1px solid var(--error)",color:"var(--error)"},title:"Stop",onMouseEnter:b=>{b.currentTarget.style.background="color-mix(in srgb, var(--error) 10%, transparent)"},onMouseLeave:b=>{b.currentTarget.style.background="transparent"},children:"Stop"}),d&&!p&&a.jsx("button",{onClick:u,className:"shrink-0 w-6 h-6 flex items-center justify-center rounded cursor-pointer",style:{background:"transparent",border:"none",color:"var(--text-muted)"},title:"New session",onMouseEnter:b=>{b.currentTarget.style.color="var(--text-primary)"},onMouseLeave:b=>{b.currentTarget.style.color="var(--text-muted)"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("polyline",{points:"1 4 1 10 7 10"}),a.jsx("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]})})]})}const gy=10;function hy({plan:e}){const t=e.filter(m=>m.status==="completed").length,n=e.filter(m=>m.status!=="completed"),r=e.length>0&&t===e.length,[i,s]=N.useState(!1),o=N.useRef(n.length);if(N.useEffect(()=>{r&&s(!0)},[r]),N.useEffect(()=>{n.length>o.current&&s(!1),o.current=n.length},[n.length]),e.length===0)return null;const l=e.filter(m=>m.status==="completed"),u=Math.max(0,gy-n.length),d=[...l.slice(-u),...n],p=e.length-d.length;return a.jsxs("div",{className:"shrink-0 border-b",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[a.jsxs("button",{onClick:()=>s(!i),className:"w-full flex items-center gap-2 px-3 py-1.5 cursor-pointer",style:{background:"none",border:"none"},children:[a.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:"var(--accent)"}}),a.jsxs("span",{className:"text-[11px] font-semibold",style:{color:"var(--accent)"},children:["Plan (",t,"/",e.length," completed)"]}),a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-muted)",strokeWidth:"2",className:"ml-auto",style:{transform:i?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.15s"},children:a.jsx("path",{d:"M6 9l6 6 6-6"})})]}),!i&&a.jsxs("div",{className:"px-3 pb-2 space-y-1",children:[p>0&&a.jsxs("div",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:[p," earlier completed task",p!==1?"s":""," hidden"]}),d.map((m,f)=>a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[m.status==="completed"?a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--success)",strokeWidth:"2.5",strokeLinecap:"round",children:a.jsx("path",{d:"M20 6L9 17l-5-5"})}):m.status==="in_progress"?a.jsx("span",{className:"w-3.5 h-3.5 flex items-center justify-center",children:a.jsx("span",{className:"w-2 h-2 rounded-full animate-pulse",style:{background:"var(--accent)"}})}):a.jsx("span",{className:"w-3.5 h-3.5 flex items-center justify-center",children:a.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:"var(--text-muted)",opacity:.4}})}),a.jsx("span",{style:{color:m.status==="completed"?"var(--text-muted)":"var(--text-primary)",textDecoration:m.status==="completed"?"line-through":"none"},children:m.title})]},f))]})]})}function by(){const e=Zl(),t=sc(),[n,r]=N.useState(!1),[i,s]=N.useState(248),[o,l]=N.useState(!1),[u,c]=N.useState(380),[d,p]=N.useState(!1),{runs:m,selectedRunId:f,setRuns:h,upsertRun:b,selectRun:x,setTraces:y,setLogs:w,setChatMessages:T,setEntrypoints:j,setStateEvents:O,setGraphCache:_,setActiveNode:P,removeActiveNode:D}=Ee(),{section:R,view:S,runId:M,setupEntrypoint:L,setupMode:C,evalCreating:v,evalSetId:E,evalRunId:I,evalRunItemName:H,evaluatorCreateType:U,evaluatorId:V,evaluatorFilter:g,explorerFile:F,navigate:$}=st(),{setEvalSets:k,setEvaluators:ie,setLocalEvaluators:K,setEvalRuns:W}=Me();N.useEffect(()=>{R==="debug"&&S==="details"&&M&&M!==f&&x(M)},[R,S,M,f,x]);const re=zn(J=>J.init),de=vs(J=>J.init);N.useEffect(()=>{tc().then(h).catch(console.error),ks().then(J=>j(J.map(ge=>ge.name))).catch(console.error),re(),de()},[h,j,re,de]),N.useEffect(()=>{R==="evals"&&(Es().then(J=>k(J)).catch(console.error),gc().then(J=>W(J)).catch(console.error)),(R==="evals"||R==="evaluators")&&(cc().then(J=>ie(J)).catch(console.error),Qr().then(J=>K(J)).catch(console.error))},[R,k,ie,K,W]);const xe=Me(J=>J.evalSets),Oe=Me(J=>J.evalRuns);N.useEffect(()=>{if(R!=="evals"||v||E||I)return;const J=Object.values(Oe).sort((Re,fe)=>new Date(fe.start_time??0).getTime()-new Date(Re.start_time??0).getTime());if(J.length>0){$(`#/evals/runs/${J[0].id}`);return}const ge=Object.values(xe);ge.length>0&&$(`#/evals/sets/${ge[0].id}`)},[R,v,E,I,Oe,xe,$]),N.useEffect(()=>{const J=ge=>{ge.key==="Escape"&&n&&r(!1)};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},[n]);const Ie=f?m[f]:null,at=N.useCallback((J,ge)=>{b(ge),y(J,ge.traces),w(J,ge.logs);const Re=ge.messages.map(fe=>{const B=fe.contentParts??fe.content_parts??[],G=fe.toolCalls??fe.tool_calls??[];return{message_id:fe.messageId??fe.message_id,role:fe.role??"assistant",content:B.filter(ee=>{const ae=ee.mimeType??ee.mime_type??"";return ae.startsWith("text/")||ae==="application/json"}).map(ee=>{const ae=ee.data;return(ae==null?void 0:ae.inline)??""}).join(` -`).trim()??"",tool_calls:G.length>0?G.map(ee=>({name:ee.name??"",has_result:!!ee.result})):void 0}});if(T(J,Re),ge.graph&&ge.graph.nodes.length>0&&_(J,ge.graph),ge.states&&ge.states.length>0&&(O(J,ge.states.map(fe=>({node_name:fe.node_name,qualified_node_name:fe.qualified_node_name,phase:fe.phase,timestamp:new Date(fe.timestamp).getTime(),payload:fe.payload}))),ge.status!=="completed"&&ge.status!=="failed"))for(const fe of ge.states)fe.phase==="started"?P(J,fe.node_name,fe.qualified_node_name):fe.phase==="completed"&&D(J,fe.node_name)},[b,y,w,T,O,_,P,D]);N.useEffect(()=>{if(!f)return;e.subscribe(f),ur(f).then(ge=>at(f,ge)).catch(console.error);const J=setTimeout(()=>{const ge=Ee.getState().runs[f];ge&&(ge.status==="pending"||ge.status==="running")&&ur(f).then(Re=>at(f,Re)).catch(console.error)},2e3);return()=>{clearTimeout(J),e.unsubscribe(f)}},[f,e,at]);const St=N.useRef(null);N.useEffect(()=>{var Re,fe;if(!f)return;const J=Ie==null?void 0:Ie.status,ge=St.current;if(St.current=J??null,J&&(J==="completed"||J==="failed")&&ge!==J){const B=Ee.getState(),G=((Re=B.traces[f])==null?void 0:Re.length)??0,ee=((fe=B.logs[f])==null?void 0:fe.length)??0,ae=(Ie==null?void 0:Ie.trace_count)??0,we=(Ie==null?void 0:Ie.log_count)??0;(Gat(f,Ke)).catch(console.error)}},[f,Ie==null?void 0:Ie.status,at]);const Pt=J=>{$(`#/debug/runs/${J}/traces`),x(J),r(!1)},yt=J=>{$(`#/debug/runs/${J}/traces`),x(J),r(!1)},ve=()=>{$("#/debug/new"),r(!1)},lt=J=>{J==="debug"?$("#/debug/new"):J==="evals"?$("#/evals"):J==="evaluators"?$("#/evaluators"):J==="explorer"&&$("#/explorer")},rt=N.useCallback(J=>{J.preventDefault(),l(!0);const ge="touches"in J?J.touches[0].clientX:J.clientX,Re=i,fe=G=>{const ee="touches"in G?G.touches[0].clientX:G.clientX,ae=Math.max(200,Math.min(480,Re+(ee-ge)));s(ae)},B=()=>{l(!1),document.removeEventListener("mousemove",fe),document.removeEventListener("mouseup",B),document.removeEventListener("touchmove",fe),document.removeEventListener("touchend",B),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",fe),document.addEventListener("mouseup",B),document.addEventListener("touchmove",fe,{passive:!1}),document.addEventListener("touchend",B)},[i]),vt=N.useCallback(J=>{J.preventDefault(),p(!0);const ge="touches"in J?J.touches[0].clientX:J.clientX,Re=u,fe=G=>{const ee="touches"in G?G.touches[0].clientX:G.clientX,ae=Math.max(280,Math.min(700,Re-(ee-ge)));c(ae)},B=()=>{p(!1),document.removeEventListener("mousemove",fe),document.removeEventListener("mouseup",B),document.removeEventListener("touchmove",fe),document.removeEventListener("touchend",B),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",fe),document.addEventListener("mouseup",B),document.addEventListener("touchmove",fe,{passive:!1}),document.addEventListener("touchend",B)},[u]),Bt=be(J=>J.openTabs),qt=()=>R==="explorer"?Bt.length>0||F?a.jsx(Bu,{}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Select a file to view"}):R==="evals"?v?a.jsx(co,{}):I?a.jsx(wu,{evalRunId:I,itemName:H}):E?a.jsx(yu,{evalSetId:E}):a.jsx(co,{}):R==="evaluators"?U?a.jsx(Du,{category:U}):a.jsx(Ru,{evaluatorId:V,evaluatorFilter:g}):S==="new"?a.jsx(Nc,{}):S==="setup"&&L&&C?a.jsx(Xc,{entrypoint:L,mode:C,ws:e,onRunCreated:Pt,isMobile:t}):Ie?a.jsx(gu,{run:Ie,ws:e,isMobile:t}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Select a run or create a new one"});return t?a.jsxs("div",{className:"flex flex-col h-screen w-screen",children:[a.jsxs("div",{className:"flex flex-1 overflow-hidden relative",children:[!n&&a.jsx("button",{onClick:()=>r(!0),className:"fixed top-2 left-2 z-40 w-9 h-9 flex items-center justify-center rounded-lg cursor-pointer",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),a.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),a.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})}),n&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"fixed inset-0 z-50",style:{background:"rgba(0,0,0,0.5)"},onClick:()=>r(!1)}),a.jsxs("aside",{className:"fixed inset-y-0 left-0 z-50 w-64 bg-[var(--sidebar-bg)] border-r border-[var(--border)] flex flex-col",children:[a.jsxs("div",{className:"px-3 h-10 border-b border-[var(--border)] flex items-center justify-between",children:[a.jsxs("button",{onClick:()=>{$("#/debug/new"),r(!1)},className:"flex items-center gap-2 cursor-pointer",style:{background:"none",border:"none"},children:[a.jsx("img",{src:"/favicon.ico",width:"14",height:"14",alt:"UiPath"}),a.jsx("span",{className:"text-[10px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Developer Console"})]}),a.jsx("button",{onClick:()=>r(!1),className:"w-6 h-6 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),R==="debug"&&a.jsx(ji,{runs:Object.values(m),selectedRunId:f,onSelectRun:yt,onNewRun:ve}),R==="evals"&&a.jsx(ro,{}),R==="evaluators"&&a.jsx(uo,{}),R==="explorer"&&a.jsx(fo,{})]})]}),a.jsx("main",{className:"flex-1 overflow-hidden bg-[var(--bg-primary)]",children:qt()})]}),a.jsx(Di,{}),a.jsx(Ji,{}),a.jsx(to,{})]}):a.jsxs("div",{className:"flex flex-col h-screen w-screen",children:[a.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[a.jsxs("aside",{className:"shrink-0 flex flex-col",style:{width:i,background:"var(--sidebar-bg)"},children:[a.jsxs("div",{className:"flex h-10 border-b shrink-0",style:{borderColor:"var(--border)"},children:[a.jsx("button",{onClick:()=>$("#/debug/new"),className:"w-12 shrink-0 flex items-center justify-center cursor-pointer transition-colors border-r",style:{background:"var(--activity-bar-bg)",border:"none",borderRight:"1px solid var(--border)"},onMouseEnter:J=>{J.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:J=>{J.currentTarget.style.background="var(--activity-bar-bg)"},children:a.jsx("img",{src:"/favicon.ico",width:"20",height:"20",alt:"UiPath"})}),a.jsx("div",{className:"flex-1 flex items-center px-3",style:{background:"var(--sidebar-bg)"},children:a.jsx("span",{className:"text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:R==="debug"?"Developer Console":R==="evals"?"Evaluations":R==="evaluators"?"Evaluators":"Explorer"})})]}),a.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[a.jsx(lc,{section:R,onSectionChange:lt}),a.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[R==="debug"&&a.jsx(ji,{runs:Object.values(m),selectedRunId:f,onSelectRun:yt,onNewRun:ve}),R==="evals"&&a.jsx(ro,{}),R==="evaluators"&&a.jsx(uo,{}),R==="explorer"&&a.jsx(fo,{})]})]})]}),a.jsx("div",{onMouseDown:rt,onTouchStart:rt,className:"shrink-0 drag-handle-col",style:o?{background:"var(--accent)"}:void 0}),a.jsxs("main",{className:"flex-1 overflow-hidden bg-[var(--bg-primary)] flex",children:[a.jsx("div",{className:"flex-1 overflow-hidden",children:qt()}),R==="explorer"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{onMouseDown:vt,onTouchStart:vt,className:"shrink-0 drag-handle-col",style:d?{background:"var(--accent)"}:void 0}),a.jsx("div",{className:"shrink-0 overflow-hidden",style:{width:u,borderLeft:"1px solid var(--border)"},children:a.jsx(my,{})})]})]})]}),a.jsx(Di,{}),a.jsx(Ji,{}),a.jsx(to,{})]})}Ml.createRoot(document.getElementById("root")).render(a.jsx(N.StrictMode,{children:a.jsx(by,{})}));export{eg as M,ny as a,Gh as r,Ee as u}; +${l+1}. [${u}] ${c}`})),n}function dy(){const[e,t]=_.useState("idle"),n=async()=>{const r=ze.getState().sessionId;if(r){t("loading");try{const i=await zu(r),s=uy(i);await navigator.clipboard.writeText(s),t("copied"),setTimeout(()=>t("idle"),2e3)}catch{t("idle")}}};return a.jsx("button",{onClick:n,disabled:e==="loading",className:"inline-flex items-center gap-1 text-[11px] font-mono px-2 py-1 rounded cursor-pointer hover:brightness-125 mt-1",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:e==="copied"?"var(--success)":"var(--text-muted)"},children:e==="copied"?"Copied!":e==="loading"?"Loading...":"Copy Diagnostics"})}function py({message:e}){if(e.role==="thinking")return a.jsx(iy,{message:e});if(e.role==="plan")return a.jsx(oy,{message:e});if(e.role==="tool")return a.jsx(cy,{message:e});const t=e.role==="user"?"user":"assistant",n=ry[t];return a.jsxs("div",{className:"py-1.5",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:n.color}}),a.jsx("span",{className:"text-[11px] font-semibold",style:{color:n.color},children:n.label})]}),e.content&&(e.role==="user"?a.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose",style:{color:"var(--text-primary)"},children:e.content}):a.jsxs("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose chat-markdown",style:{color:"var(--text-secondary)"},children:[a.jsx(eg,{remarkPlugins:[ny],rehypePlugins:[Gh],children:e.content}),e.content.includes("Reached maximum iterations")&&a.jsx(dy,{})]}))]})}function fy(){const e=ze(l=>l.activeQuestion),t=ze(l=>l.sessionId),n=ze(l=>l.setActiveQuestion),[r,i]=_.useState("");if(!e)return null;const s=l=>{t&&(Xn().sendQuestionResponse(t,e.question_id,l),n(null),i(""))},o=e.options.length>0;return a.jsxs("div",{className:"mx-3 mb-2 rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--accent) 40%, var(--border))"},children:[a.jsx("div",{className:"px-3 py-2",style:{background:"color-mix(in srgb, var(--accent) 10%, var(--bg-secondary))"},children:a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--accent)"},children:"Question"})}),a.jsxs("div",{className:"px-3 py-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("p",{className:"text-sm mb-2",style:{color:"var(--text-primary)"},children:e.question}),o&&a.jsx("div",{className:"flex flex-col gap-1 mb-2",children:e.options.map((l,u)=>a.jsxs("button",{onClick:()=>s(l),className:"w-full text-left text-[13px] py-2 px-3 rounded cursor-pointer transition-colors flex items-center gap-2",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",borderLeft:"2px solid transparent",color:"var(--text-primary)",fontFamily:"var(--font-mono, ui-monospace, monospace)"},onMouseEnter:c=>{c.currentTarget.style.borderLeftColor="var(--accent)",c.currentTarget.style.background="color-mix(in srgb, var(--accent) 8%, var(--bg-primary))"},onMouseLeave:c=>{c.currentTarget.style.borderLeftColor="transparent",c.currentTarget.style.background="var(--bg-primary)"},children:[a.jsxs("span",{className:"text-[11px] font-semibold shrink-0",style:{color:"var(--text-muted)"},children:[u+1,"."]}),a.jsx("span",{className:"truncate",children:l})]},u))}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{type:"text",value:r,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Enter"&&r.trim()&&s(r.trim())},placeholder:o?"Or type a custom answer...":"Type your answer...",className:"flex-1 text-sm px-2 py-1.5 rounded outline-none",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-primary)"}}),a.jsx("button",{onClick:()=>{r.trim()&&s(r.trim())},disabled:!r.trim(),className:"text-xs font-semibold px-3 py-1.5 rounded cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-not-allowed",style:{background:"color-mix(in srgb, var(--accent) 15%, var(--bg-secondary))",color:"var(--accent)",border:"1px solid color-mix(in srgb, var(--accent) 30%, var(--border))"},children:"Send"})]})]})]})}function my(){const e=_.useRef(Xn()).current,[t,n]=_.useState(""),r=_.useRef(null),i=_.useRef(!0),s=zn(K=>K.enabled),o=zn(K=>K.status),l=!s||o==="authenticated",{sessionId:u,status:c,messages:d,plan:p,models:m,selectedModel:f,modelsLoading:b,skills:h,selectedSkillIds:v,skillsLoading:y,setModels:x,setSelectedModel:C,setModelsLoading:O,setSkills:j,setSelectedSkillIds:N,toggleSkill:B,setSkillsLoading:D,addUserMessage:R,hydrateSession:S,clearSession:T}=ze();_.useEffect(()=>{l&&(m.length>0||(O(!0),Fu().then(K=>{if(x(K),K.length>0&&!f){const H=K.find(re=>re.model_name.includes("claude"));C(H?H.model_name:K[0].model_name)}}).catch(console.error).finally(()=>O(!1))))},[l,m.length,f,x,C,O]),_.useEffect(()=>{h.length>0||(D(!0),Uu().then(K=>{j(K),N(K.map(H=>H.id))}).catch(console.error).finally(()=>D(!1)))},[h.length,j,N,D]),_.useEffect(()=>{if(u)return;const K=sessionStorage.getItem("agent_session_id");K&&$u(K).then(H=>{H?S(H):sessionStorage.removeItem("agent_session_id")}).catch(()=>{sessionStorage.removeItem("agent_session_id")})},[]);const[L,M]=_.useState(!1),w=()=>{const K=r.current;if(!K)return;const H=K.scrollHeight-K.scrollTop-K.clientHeight<40;i.current=H,M(K.scrollTop>100)};_.useEffect(()=>{i.current&&r.current&&(r.current.scrollTop=r.current.scrollHeight)});const k=c==="thinking"||c==="executing"||c==="planning"||c==="awaiting_input",I=d[d.length-1],W=k&&(I==null?void 0:I.role)==="assistant"&&!I.done,U=k&&!W,q=_.useRef(null),g=()=>{const K=q.current;K&&(K.style.height="auto",K.style.height=Math.min(K.scrollHeight,200)+"px")},F=_.useCallback(()=>{const K=t.trim();!K||!f||k||(i.current=!0,R(K),e.sendAgentMessage(K,f,u,v),n(""),requestAnimationFrame(()=>{const H=q.current;H&&(H.style.height="auto")}))},[t,f,k,u,v,R,e]),$=_.useCallback(()=>{u&&e.sendAgentStop(u)},[u,e]),E=K=>{K.key==="Enter"&&!K.shiftKey&&(K.preventDefault(),F())},ie=!k&&!!f&&t.trim().length>0;return l?a.jsxs("div",{className:"flex flex-col h-full",style:{background:"var(--bg-primary)"},children:[a.jsx(ys,{selectedModel:f,models:m,modelsLoading:b,onModelChange:C,skills:h,selectedSkillIds:v,skillsLoading:y,onToggleSkill:B,onClear:T,onStop:$,hasMessages:d.length>0,isBusy:k}),a.jsx(hy,{plan:p}),a.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[a.jsxs("div",{ref:r,onScroll:w,className:"h-full overflow-y-auto px-3 py-2 space-y-0.5",children:[d.length===0&&a.jsxs("div",{className:"flex flex-col items-center justify-center py-10 px-4 gap-3",style:{color:"var(--text-muted)"},children:[a.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),a.jsxs("div",{className:"text-center space-y-1.5",children:[a.jsx("p",{className:"text-sm font-medium",style:{color:"var(--text-secondary)"},children:"Ask the agent to help you code"}),a.jsxs("p",{className:"text-xs leading-relaxed",children:["Create agents, functions, evaluations,",a.jsx("br",{}),"or ask questions about your project."]})]})]}),d.filter(K=>K.role!=="plan").map(K=>a.jsx(py,{message:K},K.id)),U&&a.jsx("div",{className:"py-1.5",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full animate-pulse",style:{background:"var(--success)"}}),a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--success)"},children:c==="thinking"?"Thinking...":c==="executing"?"Executing...":c==="awaiting_input"?"Waiting for answer...":"Planning..."})]})})]}),L&&a.jsx("button",{onClick:()=>{var K;i.current=!1,(K=r.current)==null||K.scrollTo({top:0,behavior:"smooth"})},className:"absolute top-2 right-3 w-6 h-6 flex items-center justify-center rounded-full cursor-pointer transition-opacity opacity-70 hover:opacity-100",style:{background:"var(--bg-tertiary)",color:"var(--text-primary)"},title:"Scroll to top",children:a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"18 15 12 9 6 15"})})})]}),a.jsx(fy,{}),a.jsxs("div",{className:"flex items-end gap-2 px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:[a.jsx("textarea",{ref:q,value:t,onChange:K=>{n(K.target.value),g()},onKeyDown:E,disabled:k||!f,placeholder:k?"Waiting for response...":"Message...",rows:2,className:"flex-1 bg-transparent text-sm py-1 disabled:opacity-40 placeholder:text-[var(--text-muted)] resize-none",style:{color:"var(--text-primary)",maxHeight:200,overflow:"auto"}}),a.jsx("button",{onClick:F,disabled:!ie,className:"text-xs font-semibold px-3 py-1.5 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed shrink-0","aria-label":"Send message",style:{color:ie?"var(--accent)":"var(--text-muted)",background:"transparent"},onMouseEnter:K=>{ie&&(K.currentTarget.style.background="color-mix(in srgb, var(--accent) 10%, transparent)")},onMouseLeave:K=>{K.currentTarget.style.background="transparent"},children:"Send"})]})]}):a.jsxs("div",{className:"flex flex-col h-full",style:{background:"var(--bg-primary)"},children:[a.jsx(ys,{selectedModel:f,models:m,modelsLoading:b,onModelChange:C,skills:h,selectedSkillIds:v,skillsLoading:y,onToggleSkill:B,onClear:T,onStop:$,hasMessages:!1,isBusy:!1}),a.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:a.jsxs("div",{className:"text-center",style:{color:"var(--text-muted)"},children:[a.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"mx-auto mb-2",strokeLinecap:"round",children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"Sign in to use Agent"}),a.jsx("p",{className:"text-xs",children:"Authentication is required to access the coding agent."})]})})]})}function ys({selectedModel:e,models:t,modelsLoading:n,onModelChange:r,skills:i,selectedSkillIds:s,skillsLoading:o,onToggleSkill:l,onClear:u,onStop:c,hasMessages:d,isBusy:p}){const[m,f]=_.useState(!1),b=_.useRef(null);return _.useEffect(()=>{if(!m)return;const h=v=>{b.current&&!b.current.contains(v.target)&&f(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[m]),a.jsxs("div",{className:"shrink-0 flex items-center gap-2 px-3 h-10 border-b",style:{borderColor:"var(--border)",background:"var(--bg-primary)"},children:[a.jsx("span",{className:"text-[11px] uppercase tracking-wider font-semibold shrink-0",style:{color:"var(--text-muted)"},children:"Agent"}),a.jsxs("select",{value:e??"",onChange:h=>r(h.target.value),className:"flex-1 text-[11px] rounded px-1.5 py-1 outline-none min-w-0 cursor-pointer",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},disabled:n,children:[n&&a.jsx("option",{value:"",children:"Loading models..."}),!n&&t.length===0&&a.jsx("option",{value:"",children:"No models"}),t.map(h=>a.jsx("option",{value:h.model_name,children:h.model_name},h.model_name))]}),!o&&i.length>0&&a.jsxs("div",{className:"relative shrink-0",ref:b,children:[a.jsxs("button",{onClick:()=>f(!m),className:"text-[11px] font-semibold px-2 py-1 rounded cursor-pointer flex items-center gap-1",style:{background:s.length>0?"color-mix(in srgb, var(--accent) 15%, transparent)":"transparent",border:`1px solid ${s.length>0?"var(--accent)":"var(--border)"}`,color:s.length>0?"var(--accent)":"var(--text-muted)"},title:"Skills",children:[a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"}),a.jsx("path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"})]}),s.length>0&&a.jsx("span",{children:s.length})]}),m&&a.jsx("div",{className:"absolute top-full right-0 mt-1 rounded shadow-lg z-50 py-1 max-h-64 overflow-y-auto",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",width:"190px"},children:i.map(h=>a.jsxs("button",{onClick:()=>l(h.id),className:"w-full text-left px-2 py-1 text-[11px] flex items-center gap-1.5 cursor-pointer",style:{color:"var(--text-primary)"},title:h.description,onMouseEnter:v=>{v.currentTarget.style.background="var(--bg-tertiary)"},onMouseLeave:v=>{v.currentTarget.style.background="transparent"},children:[a.jsx("span",{className:"w-3 h-3 rounded border flex items-center justify-center shrink-0",style:{borderColor:s.includes(h.id)?"var(--accent)":"var(--border)",background:s.includes(h.id)?"var(--accent)":"transparent"},children:s.includes(h.id)&&a.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})})}),a.jsx("span",{className:"truncate",children:h.name})]},h.id))})]}),p&&a.jsx("button",{onClick:c,className:"shrink-0 text-[11px] font-semibold px-2 py-1 rounded cursor-pointer",style:{background:"transparent",border:"1px solid var(--error)",color:"var(--error)"},title:"Stop",onMouseEnter:h=>{h.currentTarget.style.background="color-mix(in srgb, var(--error) 10%, transparent)"},onMouseLeave:h=>{h.currentTarget.style.background="transparent"},children:"Stop"}),d&&!p&&a.jsx("button",{onClick:u,className:"shrink-0 w-6 h-6 flex items-center justify-center rounded cursor-pointer",style:{background:"transparent",border:"none",color:"var(--text-muted)"},title:"New session",onMouseEnter:h=>{h.currentTarget.style.color="var(--text-primary)"},onMouseLeave:h=>{h.currentTarget.style.color="var(--text-muted)"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("polyline",{points:"1 4 1 10 7 10"}),a.jsx("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]})})]})}const gy=10;function hy({plan:e}){const t=e.filter(m=>m.status==="completed").length,n=e.filter(m=>m.status!=="completed"),r=e.length>0&&t===e.length,[i,s]=_.useState(!1),o=_.useRef(n.length);if(_.useEffect(()=>{r&&s(!0)},[r]),_.useEffect(()=>{n.length>o.current&&s(!1),o.current=n.length},[n.length]),e.length===0)return null;const l=e.filter(m=>m.status==="completed"),u=Math.max(0,gy-n.length),d=[...l.slice(-u),...n],p=e.length-d.length;return a.jsxs("div",{className:"shrink-0 border-b",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[a.jsxs("button",{onClick:()=>s(!i),className:"w-full flex items-center gap-2 px-3 py-1.5 cursor-pointer",style:{background:"none",border:"none"},children:[a.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:"var(--accent)"}}),a.jsxs("span",{className:"text-[11px] font-semibold",style:{color:"var(--accent)"},children:["Plan (",t,"/",e.length," completed)"]}),a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-muted)",strokeWidth:"2",className:"ml-auto",style:{transform:i?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.15s"},children:a.jsx("path",{d:"M6 9l6 6 6-6"})})]}),!i&&a.jsxs("div",{className:"px-3 pb-2 space-y-1",children:[p>0&&a.jsxs("div",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:[p," earlier completed task",p!==1?"s":""," hidden"]}),d.map((m,f)=>a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[m.status==="completed"?a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--success)",strokeWidth:"2.5",strokeLinecap:"round",children:a.jsx("path",{d:"M20 6L9 17l-5-5"})}):m.status==="in_progress"?a.jsx("span",{className:"w-3.5 h-3.5 flex items-center justify-center",children:a.jsx("span",{className:"w-2 h-2 rounded-full animate-pulse",style:{background:"var(--accent)"}})}):a.jsx("span",{className:"w-3.5 h-3.5 flex items-center justify-center",children:a.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:"var(--text-muted)",opacity:.4}})}),a.jsx("span",{style:{color:m.status==="completed"?"var(--text-muted)":"var(--text-primary)",textDecoration:m.status==="completed"?"line-through":"none"},children:m.title})]},f))]})]})}function by(){const e=nc(),t=sc(),[n,r]=_.useState(!1),[i,s]=_.useState(248),[o,l]=_.useState(!1),[u,c]=_.useState(380),[d,p]=_.useState(!1),{runs:m,selectedRunId:f,setRuns:b,upsertRun:h,selectRun:v,setTraces:y,setLogs:x,setChatMessages:C,setEntrypoints:O,setStateEvents:j,setGraphCache:N,setActiveNode:B,removeActiveNode:D}=ve(),{section:R,view:S,runId:T,setupEntrypoint:L,setupMode:M,evalCreating:w,evalSetId:k,evalRunId:I,evalRunItemName:W,evaluatorCreateType:U,evaluatorId:q,evaluatorFilter:g,explorerFile:F,navigate:$}=st(),{setEvalSets:E,setEvaluators:ie,setLocalEvaluators:K,setEvalRuns:H}=Me();_.useEffect(()=>{R==="debug"&&S==="details"&&T&&T!==f&&v(T)},[R,S,T,f,v]);const re=zn(J=>J.init),de=ks(J=>J.init);_.useEffect(()=>{Jl().then(b).catch(console.error),Zr().then(J=>O(J.map(ge=>ge.name))).catch(console.error),re(),de()},[b,O,re,de]),_.useEffect(()=>{R==="evals"&&(Es().then(J=>E(J)).catch(console.error),gc().then(J=>H(J)).catch(console.error)),(R==="evals"||R==="evaluators")&&(cc().then(J=>ie(J)).catch(console.error),ei().then(J=>K(J)).catch(console.error))},[R,E,ie,K,H]);const xe=Me(J=>J.evalSets),Oe=Me(J=>J.evalRuns);_.useEffect(()=>{if(R!=="evals"||w||k||I)return;const J=Object.values(Oe).sort((Re,fe)=>new Date(fe.start_time??0).getTime()-new Date(Re.start_time??0).getTime());if(J.length>0){$(`#/evals/runs/${J[0].id}`);return}const ge=Object.values(xe);ge.length>0&&$(`#/evals/sets/${ge[0].id}`)},[R,w,k,I,Oe,xe,$]),_.useEffect(()=>{const J=ge=>{ge.key==="Escape"&&n&&r(!1)};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},[n]);const Ie=f?m[f]:null,at=_.useCallback((J,ge)=>{h(ge),y(J,ge.traces),x(J,ge.logs);const Re=ge.messages.map(fe=>{const P=fe.contentParts??fe.content_parts??[],G=fe.toolCalls??fe.tool_calls??[];return{message_id:fe.messageId??fe.message_id,role:fe.role??"assistant",content:P.filter(ee=>{const ae=ee.mimeType??ee.mime_type??"";return ae.startsWith("text/")||ae==="application/json"}).map(ee=>{const ae=ee.data;return(ae==null?void 0:ae.inline)??""}).join(` +`).trim()??"",tool_calls:G.length>0?G.map(ee=>({name:ee.name??"",has_result:!!ee.result})):void 0}});if(C(J,Re),ge.graph&&ge.graph.nodes.length>0&&N(J,ge.graph),ge.states&&ge.states.length>0&&(j(J,ge.states.map(fe=>({node_name:fe.node_name,qualified_node_name:fe.qualified_node_name,phase:fe.phase,timestamp:new Date(fe.timestamp).getTime(),payload:fe.payload}))),ge.status!=="completed"&&ge.status!=="failed"))for(const fe of ge.states)fe.phase==="started"?B(J,fe.node_name,fe.qualified_node_name):fe.phase==="completed"&&D(J,fe.node_name)},[h,y,x,C,j,N,B,D]);_.useEffect(()=>{if(!f)return;e.subscribe(f),ur(f).then(ge=>at(f,ge)).catch(console.error);const J=setTimeout(()=>{const ge=ve.getState().runs[f];ge&&(ge.status==="pending"||ge.status==="running")&&ur(f).then(Re=>at(f,Re)).catch(console.error)},2e3);return()=>{clearTimeout(J),e.unsubscribe(f)}},[f,e,at]);const St=_.useRef(null);_.useEffect(()=>{var Re,fe;if(!f)return;const J=Ie==null?void 0:Ie.status,ge=St.current;if(St.current=J??null,J&&(J==="completed"||J==="failed")&&ge!==J){const P=ve.getState(),G=((Re=P.traces[f])==null?void 0:Re.length)??0,ee=((fe=P.logs[f])==null?void 0:fe.length)??0,ae=(Ie==null?void 0:Ie.trace_count)??0,we=(Ie==null?void 0:Ie.log_count)??0;(Gat(f,Ke)).catch(console.error)}},[f,Ie==null?void 0:Ie.status,at]);const Pt=J=>{$(`#/debug/runs/${J}/traces`),v(J),r(!1)},yt=J=>{$(`#/debug/runs/${J}/traces`),v(J),r(!1)},ke=()=>{$("#/debug/new"),r(!1)},lt=J=>{J==="debug"?$("#/debug/new"):J==="evals"?$("#/evals"):J==="evaluators"?$("#/evaluators"):J==="explorer"&&$("#/explorer")},rt=_.useCallback(J=>{J.preventDefault(),l(!0);const ge="touches"in J?J.touches[0].clientX:J.clientX,Re=i,fe=G=>{const ee="touches"in G?G.touches[0].clientX:G.clientX,ae=Math.max(200,Math.min(480,Re+(ee-ge)));s(ae)},P=()=>{l(!1),document.removeEventListener("mousemove",fe),document.removeEventListener("mouseup",P),document.removeEventListener("touchmove",fe),document.removeEventListener("touchend",P),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",fe),document.addEventListener("mouseup",P),document.addEventListener("touchmove",fe,{passive:!1}),document.addEventListener("touchend",P)},[i]),vt=_.useCallback(J=>{J.preventDefault(),p(!0);const ge="touches"in J?J.touches[0].clientX:J.clientX,Re=u,fe=G=>{const ee="touches"in G?G.touches[0].clientX:G.clientX,ae=Math.max(280,Math.min(700,Re-(ee-ge)));c(ae)},P=()=>{p(!1),document.removeEventListener("mousemove",fe),document.removeEventListener("mouseup",P),document.removeEventListener("touchmove",fe),document.removeEventListener("touchend",P),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",fe),document.addEventListener("mouseup",P),document.addEventListener("touchmove",fe,{passive:!1}),document.addEventListener("touchend",P)},[u]),Bt=be(J=>J.openTabs),qt=()=>R==="explorer"?Bt.length>0||F?a.jsx(Bu,{}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Select a file to view"}):R==="evals"?w?a.jsx(uo,{}):I?a.jsx(wu,{evalRunId:I,itemName:W}):k?a.jsx(yu,{evalSetId:k}):a.jsx(uo,{}):R==="evaluators"?U?a.jsx(Du,{category:U}):a.jsx(Ru,{evaluatorId:q,evaluatorFilter:g}):S==="new"?a.jsx(Nc,{}):S==="setup"&&L&&M?a.jsx(Xc,{entrypoint:L,mode:M,ws:e,onRunCreated:Pt,isMobile:t}):Ie?a.jsx(gu,{run:Ie,ws:e,isMobile:t}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Select a run or create a new one"});return t?a.jsxs("div",{className:"flex flex-col h-screen w-screen",children:[a.jsxs("div",{className:"flex flex-1 overflow-hidden relative",children:[!n&&a.jsx("button",{onClick:()=>r(!0),className:"fixed top-2 left-2 z-40 w-9 h-9 flex items-center justify-center rounded-lg cursor-pointer",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),a.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),a.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})}),n&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"fixed inset-0 z-50",style:{background:"rgba(0,0,0,0.5)"},onClick:()=>r(!1)}),a.jsxs("aside",{className:"fixed inset-y-0 left-0 z-50 w-64 bg-[var(--sidebar-bg)] border-r border-[var(--border)] flex flex-col",children:[a.jsxs("div",{className:"px-3 h-10 border-b border-[var(--border)] flex items-center justify-between",children:[a.jsxs("button",{onClick:()=>{$("#/debug/new"),r(!1)},className:"flex items-center gap-2 cursor-pointer",style:{background:"none",border:"none"},children:[a.jsx("img",{src:"/favicon.ico",width:"14",height:"14",alt:"UiPath"}),a.jsx("span",{className:"text-[10px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Developer Console"})]}),a.jsx("button",{onClick:()=>r(!1),className:"w-6 h-6 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),R==="debug"&&a.jsx(Di,{runs:Object.values(m),selectedRunId:f,onSelectRun:yt,onNewRun:ke}),R==="evals"&&a.jsx(io,{}),R==="evaluators"&&a.jsx(po,{}),R==="explorer"&&a.jsx(mo,{})]})]}),a.jsx("main",{className:"flex-1 overflow-hidden bg-[var(--bg-primary)]",children:qt()})]}),a.jsx(Pi,{}),a.jsx(Qi,{}),a.jsx(no,{})]}):a.jsxs("div",{className:"flex flex-col h-screen w-screen",children:[a.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[a.jsxs("aside",{className:"shrink-0 flex flex-col",style:{width:i,background:"var(--sidebar-bg)"},children:[a.jsxs("div",{className:"flex h-10 border-b shrink-0",style:{borderColor:"var(--border)"},children:[a.jsx("button",{onClick:()=>$("#/debug/new"),className:"w-12 shrink-0 flex items-center justify-center cursor-pointer transition-colors border-r",style:{background:"var(--activity-bar-bg)",border:"none",borderRight:"1px solid var(--border)"},onMouseEnter:J=>{J.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:J=>{J.currentTarget.style.background="var(--activity-bar-bg)"},children:a.jsx("img",{src:"/favicon.ico",width:"20",height:"20",alt:"UiPath"})}),a.jsx("div",{className:"flex-1 flex items-center px-3",style:{background:"var(--sidebar-bg)"},children:a.jsx("span",{className:"text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:R==="debug"?"Developer Console":R==="evals"?"Evaluations":R==="evaluators"?"Evaluators":"Explorer"})})]}),a.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[a.jsx(lc,{section:R,onSectionChange:lt}),a.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[R==="debug"&&a.jsx(Di,{runs:Object.values(m),selectedRunId:f,onSelectRun:yt,onNewRun:ke}),R==="evals"&&a.jsx(io,{}),R==="evaluators"&&a.jsx(po,{}),R==="explorer"&&a.jsx(mo,{})]})]})]}),a.jsx("div",{onMouseDown:rt,onTouchStart:rt,className:"shrink-0 drag-handle-col",style:o?{background:"var(--accent)"}:void 0}),a.jsxs("main",{className:"flex-1 overflow-hidden bg-[var(--bg-primary)] flex",children:[a.jsx("div",{className:"flex-1 overflow-hidden",children:qt()}),R==="explorer"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{onMouseDown:vt,onTouchStart:vt,className:"shrink-0 drag-handle-col",style:d?{background:"var(--accent)"}:void 0}),a.jsx("div",{className:"shrink-0 overflow-hidden",style:{width:u,borderLeft:"1px solid var(--border)"},children:a.jsx(my,{})})]})]})]}),a.jsx(Pi,{}),a.jsx(Qi,{}),a.jsx(no,{})]})}Ml.createRoot(document.getElementById("root")).render(a.jsx(_.StrictMode,{children:a.jsx(by,{})}));export{eg as M,ny as a,Gh as r,ve as u}; diff --git a/src/uipath/dev/server/static/index.html b/src/uipath/dev/server/static/index.html index 04e5b77..89e1060 100644 --- a/src/uipath/dev/server/static/index.html +++ b/src/uipath/dev/server/static/index.html @@ -5,11 +5,11 @@ UiPath Developer Console - + - +
diff --git a/src/uipath/dev/server/ws/handler.py b/src/uipath/dev/server/ws/handler.py index 40a5492..7cfd9ae 100644 --- a/src/uipath/dev/server/ws/handler.py +++ b/src/uipath/dev/server/ws/handler.py @@ -29,9 +29,11 @@ async def websocket_endpoint(websocket: WebSocket) -> None: await manager.connect(websocket) - # If a reload is pending (file changed before this client connected), notify immediately + # If a reload is pending (deferred because runs were active), notify the client if server.reload_pending: - await websocket.send_json(server_message(ServerEvent.RELOAD, {"files": []})) + await websocket.send_json( + server_message(ServerEvent.RELOAD, {"files": [], "reloaded": False}) + ) try: while True: diff --git a/src/uipath/dev/server/ws/manager.py b/src/uipath/dev/server/ws/manager.py index 4fdf7c6..e2c2c87 100644 --- a/src/uipath/dev/server/ws/manager.py +++ b/src/uipath/dev/server/ws/manager.py @@ -160,9 +160,18 @@ def broadcast_state(self, state_data: StateData) -> None: msg = server_message(ServerEvent.STATE, serialize_state(state_data)) self._schedule_broadcast(state_data.run_id, msg) - def broadcast_reload(self, changed_files: list[str]) -> None: - """Broadcast a reload event to all connected clients.""" - msg = server_message(ServerEvent.RELOAD, {"files": changed_files}) + def broadcast_reload( + self, changed_files: list[str], *, reloaded: bool = False + ) -> None: + """Broadcast a reload event to all connected clients. + + Args: + reloaded: If True, the server already reloaded the factory and + the client only needs to refresh entrypoints. + """ + msg = server_message( + ServerEvent.RELOAD, {"files": changed_files, "reloaded": reloaded} + ) for ws in self._connections: self._enqueue(ws, msg) diff --git a/src/uipath/dev/services/agent/service.py b/src/uipath/dev/services/agent/service.py index c7d4e55..7808b08 100644 --- a/src/uipath/dev/services/agent/service.py +++ b/src/uipath/dev/services/agent/service.py @@ -45,23 +45,25 @@ def _detect_project_context(project_root: Path) -> str: except Exception: pass - uipath_json = project_root / "uipath.json" - if uipath_json.is_file(): - try: - parts.append( - f"uipath.json: {uipath_json.read_text(encoding='utf-8').strip()}" - ) - except Exception: - pass - - langgraph_json = project_root / "langgraph.json" - if langgraph_json.is_file(): - try: - parts.append( - f"langgraph.json: {langgraph_json.read_text(encoding='utf-8').strip()}" - ) - except Exception: - pass + # Detect agentic framework config files + framework_configs = [ + "uipath.json", + "langgraph.json", + "llama_index.json", + "agent_framework.json", + "google_adk.json", + "pydantic_ai.json", + "openai_agents.json", + ] + for config_name in framework_configs: + config_path = project_root / config_name + if config_path.is_file(): + try: + parts.append( + f"{config_name}: {config_path.read_text(encoding='utf-8').strip()}" + ) + except Exception: + pass evals_dir = project_root / "evaluations" if evals_dir.is_dir(): diff --git a/src/uipath/dev/ui/panels/_json_schema.py b/src/uipath/dev/ui/panels/_json_schema.py index db7866f..34d526c 100644 --- a/src/uipath/dev/ui/panels/_json_schema.py +++ b/src/uipath/dev/ui/panels/_json_schema.py @@ -13,52 +13,64 @@ def mock_json_from_schema(schema: dict[str, Any]) -> Any: """ def _is_uipath_conversational_input(s: dict[str, Any]) -> bool: - """Check if this schema represents a UiPath conversational agent input.""" + """Check if this schema represents a UiPath conversational agent input. + + Matches when the schema has a ``messages`` array whose items use the + UiPath contentParts/data/inline message shape — either declared via + ``$defs`` or defined inline. + """ if s.get("type") != "object": return False props = s.get("properties", {}) - # Check for the characteristic fields of ConversationalAgentInput - has_messages = "messages" in props - has_user_settings = "userSettings" in props - - if not (has_messages and has_user_settings): + if "messages" not in props: return False - # Additional check: messages should be an array messages_prop = props.get("messages", {}) if messages_prop.get("type") != "array": return False - # Check if $defs contains UiPath message types + # Path 1: $defs contain well-known UiPath message types defs = s.get("$defs", {}) uipath_types = [ "UiPathConversationMessage", "UiPathConversationContentPart", "UiPathInlineValue", ] - has_uipath_defs = any(t in defs for t in uipath_types) + if any(t in defs for t in uipath_types): + return True - return has_uipath_defs + # Path 2: items schema has contentParts → data → inline + items = messages_prop.get("items", {}) + if not isinstance(items, dict): + return False + item_props = items.get("properties", {}) + cp = item_props.get("contentParts", {}) + if cp.get("type") != "array": + return False + cp_item = cp.get("items", {}) + if not isinstance(cp_item, dict): + return False + data_prop = cp_item.get("properties", {}).get("data", {}) + return "inline" in data_prop.get("properties", {}) - def _mock_uipath_conversational_input() -> dict[str, Any]: + def _mock_uipath_conversational_input(s: dict[str, Any]) -> dict[str, Any]: """Generate a user-friendly mock for UiPath conversational agent input.""" - return { + result: dict[str, Any] = { "messages": [ { - "messageId": "msg-001", "role": "user", "contentParts": [ { - "contentPartId": "part-001", "mimeType": "text/plain", "data": {"inline": "Hello, how can you help me today?"}, } ], - "createdAt": "2025-01-19T10:00:00Z", - "updatedAt": "2025-01-19T10:00:00Z", } ], - "userSettings": { + } + # Include userSettings only when the schema declares it + if "userSettings" in s.get("properties", {}): + result["userSettings"] = { "name": "John Doe", "email": "john.doe@example.com", "role": "Software Engineer", @@ -66,8 +78,8 @@ def _mock_uipath_conversational_input() -> dict[str, Any]: "company": "Acme Corp", "country": "United States", "timezone": "America/New_York", - }, - } + } + return result def _is_langchain_messages_array(sub_schema: dict[str, Any]) -> bool: """Check if this is a LangChain messages array.""" @@ -170,7 +182,7 @@ def _mock_value( # Check for UiPath conversational input schema first if _is_uipath_conversational_input(schema): - return _mock_uipath_conversational_input() + return _mock_uipath_conversational_input(schema) # Top-level: if it's an object with properties, build a dict if schema.get("type") == "object": diff --git a/uv.lock b/uv.lock index 61fcbf4..e12a37c 100644 --- a/uv.lock +++ b/uv.lock @@ -2266,7 +2266,7 @@ wheels = [ [[package]] name = "uipath-dev" -version = "0.0.69" +version = "0.0.70" source = { editable = "." } dependencies = [ { name = "fastapi" }, From 584ac8c9c5787309531fd0dd4174a8fd199441e8 Mon Sep 17 00:00:00 2001 From: Cristian Pufu Date: Mon, 2 Mar 2026 17:10:57 +0200 Subject: [PATCH 2/2] feat: agent trace inspector, diff views, system prompt improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add OTEL-style trace inspector panel showing per-LLM-call spans with input messages, output, tool calls, token usage, and timing - Add git-style diff view for edit_file tool calls in both trace panel and chat approval/detail cards (shared DiffView component) - Add Trace button in agent chat sidebar header to open inspector tab - Fix system prompt to be framework-agnostic: agents can live in any config file (pydantic_ai.json, langgraph.json, etc.), not just uipath.json — prevents agent from writing to wrong config - Deduplicate "Available reference files" list in skill summaries (was repeated 6x, now appended once) - Trim bloated skill section TOCs from system prompt to save tokens - Clarify bash tool runs via cmd.exe on Windows - Bump bash timeout from 30s to 120s for long-running eval commands - Fix eval command in Full Build Cycle to show syntax - Fix Windows case-sensitivity bug in glob/grep path resolution - Bump version to 0.0.71 Co-Authored-By: Claude Opus 4.6 --- pyproject.toml | 2 +- .../server/frontend/src/api/agent-client.ts | 9 +- .../src/components/agent/AgentChatSidebar.tsx | 13 + .../src/components/agent/AgentMessage.tsx | 39 +- .../src/components/agent/AgentStatePanel.tsx | 429 ++++++++++++++++++ .../src/components/agent/DiffView.tsx | 75 +++ .../src/components/explorer/FileEditor.tsx | 19 +- .../dev/server/frontend/src/types/agent.ts | 33 ++ .../dev/server/frontend/tsconfig.tsbuildinfo | 2 +- src/uipath/dev/server/routes/agent.py | 12 + ...anel-DWIYYBph.js => ChatPanel-22tyOge8.js} | 2 +- .../server/static/assets/index-B6Qbh6OY.js | 121 +++++ .../server/static/assets/index-D4dH-hau.css | 1 - .../server/static/assets/index-V3oNRyE_.js | 119 ----- .../server/static/assets/index-YAcg9zUx.css | 1 + src/uipath/dev/server/static/index.html | 4 +- src/uipath/dev/services/agent/loop.py | 101 ++++- src/uipath/dev/services/agent/service.py | 56 ++- src/uipath/dev/services/agent/session.py | 4 + src/uipath/dev/services/agent/tools.py | 39 +- src/uipath/dev/services/skill_service.py | 39 +- .../uipath/references/creating-agents.md | 16 +- .../skills/uipath/references/evaluations.md | 6 +- .../uipath/references/running-agents.md | 6 +- uv.lock | 2 +- 25 files changed, 954 insertions(+), 196 deletions(-) create mode 100644 src/uipath/dev/server/frontend/src/components/agent/AgentStatePanel.tsx create mode 100644 src/uipath/dev/server/frontend/src/components/agent/DiffView.tsx rename src/uipath/dev/server/static/assets/{ChatPanel-DWIYYBph.js => ChatPanel-22tyOge8.js} (99%) create mode 100644 src/uipath/dev/server/static/assets/index-B6Qbh6OY.js delete mode 100644 src/uipath/dev/server/static/assets/index-D4dH-hau.css delete mode 100644 src/uipath/dev/server/static/assets/index-V3oNRyE_.js create mode 100644 src/uipath/dev/server/static/assets/index-YAcg9zUx.css diff --git a/pyproject.toml b/pyproject.toml index e3786e2..97fc8bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath-dev" -version = "0.0.70" +version = "0.0.71" description = "UiPath Developer Console" readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.11" diff --git a/src/uipath/dev/server/frontend/src/api/agent-client.ts b/src/uipath/dev/server/frontend/src/api/agent-client.ts index 17a37f4..07769c7 100644 --- a/src/uipath/dev/server/frontend/src/api/agent-client.ts +++ b/src/uipath/dev/server/frontend/src/api/agent-client.ts @@ -1,4 +1,4 @@ -import type { AgentModel, AgentSessionState, AgentSkill } from "../types/agent"; +import type { AgentModel, AgentRawState, AgentSessionState, AgentSkill } from "../types/agent"; const BASE = "/api"; @@ -26,6 +26,13 @@ export async function getAgentSessionState(sessionId: string): Promise { + const res = await fetch(`${BASE}/agent/session/${sessionId}/raw-state`); + if (res.status === 404) return null; + if (!res.ok) throw new Error(`HTTP ${res.status}`); + return res.json(); +} + export async function listAgentSkills(): Promise { const res = await fetch(`${BASE}/agent/skills`); if (!res.ok) { diff --git a/src/uipath/dev/server/frontend/src/components/agent/AgentChatSidebar.tsx b/src/uipath/dev/server/frontend/src/components/agent/AgentChatSidebar.tsx index 8092445..2f28dc7 100644 --- a/src/uipath/dev/server/frontend/src/components/agent/AgentChatSidebar.tsx +++ b/src/uipath/dev/server/frontend/src/components/agent/AgentChatSidebar.tsx @@ -1,6 +1,7 @@ import { useCallback, useEffect, useRef, useState } from "react"; import { useAgentStore } from "../../store/useAgentStore"; import { useAuthStore } from "../../store/useAuthStore"; +import { useExplorerStore } from "../../store/useExplorerStore"; import { getAgentSessionState, listAgentModels, listAgentSkills } from "../../api/agent-client"; import { getWs } from "../../store/useWebSocket"; import AgentMessageComponent from "./AgentMessage"; @@ -412,6 +413,18 @@ function Header({ )} )} + {hasMessages && ( + + )} {isBusy && ( + + + {/* ── Scroll ────────────────────────────────────────────── */} +
+ +
+            {data.system_prompt || "(empty)"}
+          
+
+ + +
+ {data.tool_schemas.map((t) => ( +
+ {t.function.name} + {t.function.description && ( + {t.function.description} + )} +
+ ))} +
+
+ + {/* ── Spans ───────────────────────────────────────────── */} + {data.traces.length === 0 ? ( +
+ No spans yet — send a message to the agent. +
+ ) : ( + data.traces.map((span, i) => ( + + )) + )} +
+ + ); +} + +// ─── Tiny components ──────────────────────────────────────────────── +function Empty({ text }: { text: string }) { + return

{text}

; +} +function Pill({ text }: { text: string }) { + return {text}; +} +function StatusDot({ status }: { status: string }) { + const active = ["thinking", "executing", "awaiting_approval"].includes(status); + const color = status === "error" ? "var(--error)" : active ? "var(--accent)" : "var(--success)"; + return ( + + + {status} + + ); +} + +// ─── Top-level collapsible (system prompt, tools) ─────────────────── +function TopSection({ label, children }: { label: string; children: React.ReactNode }) { + const [open, setOpen] = useState(false); + return ( +
+ + {open &&
{children}
} +
+ ); +} + +// ═════════════════════════════════════════════════════════════════════ +// Span block — one per LLM call +// ═════════════════════════════════════════════════════════════════════ +function SpanBlock({ span, index, defaultOpen }: { span: AgentTraceSpan; index: number; defaultOpen: boolean }) { + const [open, setOpen] = useState(defaultOpen); + const tok = span.prompt_tokens + span.completion_tokens; + const nTools = span.output_tool_calls.length; + + return ( +
+ {/* ── Span header ─────────────────────────────────────── */} + + + {/* ── Expanded ────────────────────────────────────────── */} + {open && ( +
+ {/* Input messages */} + + + {/* Divider */} +
+
+ Response +
+
+ + {/* Output */} +
+ {span.output_thinking && ( + + )} + {span.output_content ? ( + + ) : !span.output_thinking ? ( +
(no text output)
+ ) : null} +
+ + {/* Tool calls */} + {nTools > 0 && ( + <> +
+
+ + Tool Calls ({nTools}) + +
+
+
+ {span.output_tool_calls.map((tc, i) => { + const res = span.tool_results?.find((r) => r.name === tc.name); + return ; + })} +
+ + )} +
+ )} +
+ ); +} + +// ═════════════════════════════════════════════════════════════════════ +// Conversation thread — renders a list of messages +// ═════════════════════════════════════════════════════════════════════ +function ConversationThread({ label, messages, defaultOpen }: { + label: string; + messages: TraceMessage[]; + defaultOpen: boolean; +}) { + const [open, setOpen] = useState(defaultOpen); + const MAX_COLLAPSED = 4; + const [showAll, setShowAll] = useState(false); + const visible = open ? (showAll ? messages : messages.slice(-MAX_COLLAPSED)) : []; + const hiddenCount = messages.length - (showAll ? 0 : Math.min(messages.length, MAX_COLLAPSED)); + + return ( +
+ + {open && ( +
+ {!showAll && hiddenCount > 0 && ( + + )} + {visible.map((m, i) => ( + + ))} +
+ )} +
+ ); +} + +// ═════════════════════════════════════════════════════════════════════ +// Message card — the core building block +// ═════════════════════════════════════════════════════════════════════ +function MessageCard({ role, content, toolCalls, toolCallId }: { + role: string; + content: string; + toolCalls?: { name: string; arguments: string }[]; + toolCallId?: string; +}) { + const [expanded, setExpanded] = useState(false); + const rs = roleStyle(role); + const isLong = content.length > 200; + const preview = isLong && !expanded ? trunc(content, 200) : content; + const isEmpty = !content && !toolCalls?.length; + + return ( +
+ {/* Header row */} +
+ + {rs.label} + + {toolCallId && ( + + {toolCallId.slice(0, 12)}\u2026 + + )} + {toolCalls && toolCalls.length > 0 && ( + + calls: {toolCalls.map((tc) => tc.name).join(", ")} + + )} +
+ {(isLong || toolCalls?.length) && ( + + )} +
+ + {/* Content */} + {!isEmpty && ( +
+ {content && ( +
+              {preview}
+            
+ )} + + {/* Expanded: show tool call details */} + {expanded && toolCalls && toolCalls.length > 0 && ( +
+ {toolCalls.map((tc, i) => ( +
+ {tc.name} +
+                    {prettyJson(tc.arguments)}
+                  
+
+ ))} +
+ )} +
+ )} + + {isEmpty && ( +
(empty)
+ )} +
+ ); +} + +// ═════════════════════════════════════════════════════════════════════ +// Tool call card — for output tool calls + results +// ═════════════════════════════════════════════════════════════════════ +function ToolCallCard({ name, args, result }: { name: string; args: string; result?: string }) { + const [open, setOpen] = useState(false); + const rs = roleStyle("tool"); + + // Parse edit_file for diff view + const isEdit = name === "edit_file"; + let editParsed: { path?: string; old_string?: string; new_string?: string } | null = null; + if (isEdit) { + try { editParsed = JSON.parse(args); } catch { /* fall through */ } + } + const showDiff = isEdit && editParsed?.old_string != null && editParsed?.new_string != null; + + return ( +
+ + + {open && ( +
+ {showDiff ? ( + + ) : ( +
+
Arguments
+
+                {prettyJson(args)}
+              
+
+ )} + {result !== undefined && ( +
+
Result
+
+                {result}
+              
+
+ )} +
+ )} +
+ ); +} + diff --git a/src/uipath/dev/server/frontend/src/components/agent/DiffView.tsx b/src/uipath/dev/server/frontend/src/components/agent/DiffView.tsx new file mode 100644 index 0000000..2cbbb2b --- /dev/null +++ b/src/uipath/dev/server/frontend/src/components/agent/DiffView.tsx @@ -0,0 +1,75 @@ +// Shared diff view for edit_file tool calls + +export function computeUnifiedDiff(oldStr: string, newStr: string): { type: "ctx" | "del" | "add"; text: string }[] { + const oldLines = oldStr.split("\n"); + const newLines = newStr.split("\n"); + + const m = oldLines.length; + const n = newLines.length; + const dp: number[][] = Array.from({ length: m + 1 }, () => new Array(n + 1).fill(0)); + for (let i = 1; i <= m; i++) { + for (let j = 1; j <= n; j++) { + dp[i][j] = oldLines[i - 1] === newLines[j - 1] + ? dp[i - 1][j - 1] + 1 + : Math.max(dp[i - 1][j], dp[i][j - 1]); + } + } + + const result: { type: "ctx" | "del" | "add"; text: string }[] = []; + let i = m, j = n; + while (i > 0 || j > 0) { + if (i > 0 && j > 0 && oldLines[i - 1] === newLines[j - 1]) { + result.push({ type: "ctx", text: oldLines[i - 1] }); + i--; j--; + } else if (j > 0 && (i === 0 || dp[i][j - 1] >= dp[i - 1][j])) { + result.push({ type: "add", text: newLines[j - 1] }); + j--; + } else { + result.push({ type: "del", text: oldLines[i - 1] }); + i--; + } + } + result.reverse(); + return result; +} + +const DIFF_STYLES: Record = { + del: { bg: "color-mix(in srgb, #ef4444 12%, transparent)", color: "#f87171", prefix: "-" }, + add: { bg: "color-mix(in srgb, #22c55e 12%, transparent)", color: "#4ade80", prefix: "+" }, + ctx: { bg: "transparent", color: "var(--text-muted)", prefix: " " }, +}; + +export function DiffView({ path, oldStr, newStr }: { path?: string; oldStr: string; newStr: string }) { + const lines = computeUnifiedDiff(oldStr, newStr); + const delCount = lines.filter((l) => l.type === "del").length; + const addCount = lines.filter((l) => l.type === "add").length; + + return ( +
+
+ Diff + {path && {path}} +
+ +{addCount} + -{delCount} +
+
+ {lines.map((line, i) => { + const s = DIFF_STYLES[line.type]; + return ( +
+ + {s.prefix} + +
+                {line.text}
+              
+
+ ); + })} +
+
+ ); +} diff --git a/src/uipath/dev/server/frontend/src/components/explorer/FileEditor.tsx b/src/uipath/dev/server/frontend/src/components/explorer/FileEditor.tsx index f9de046..723c1ed 100644 --- a/src/uipath/dev/server/frontend/src/components/explorer/FileEditor.tsx +++ b/src/uipath/dev/server/frontend/src/components/explorer/FileEditor.tsx @@ -4,6 +4,9 @@ import { useExplorerStore } from "../../store/useExplorerStore"; import { useTheme } from "../../store/useTheme"; import { useHashRoute } from "../../hooks/useHashRoute"; import { readFile, saveFile } from "../../api/explorer-client"; +import AgentStatePanel from "../agent/AgentStatePanel"; + +const AGENT_STATE_TAB = "__agent_state__"; const handleBeforeMount: BeforeMount = (monaco) => { monaco.editor.defineTheme("uipath-dark", { @@ -113,7 +116,7 @@ export default function FileEditor() { // Load file content when selectedFile changes useEffect(() => { - if (!filePath) return; + if (!filePath || filePath === AGENT_STATE_TAB) return; if (!useExplorerStore.getState().fileCache[filePath]) { setLoadingFile(true); readFile(filePath) @@ -228,7 +231,7 @@ export default function FileEditor() { if (!isActive) e.currentTarget.style.background = "transparent"; }} > - {basename(tab)} + {tab === AGENT_STATE_TAB ? "Agent Trace" : basename(tab)} {tabDirty ? ( ); + // Agent Trace special tab + if (filePath === AGENT_STATE_TAB) { + return ( +
+ {tabBar} +
+ +
+
+ ); + } + // No file selected if (!filePath) { return ( diff --git a/src/uipath/dev/server/frontend/src/types/agent.ts b/src/uipath/dev/server/frontend/src/types/agent.ts index 3d6fda9..c56847c 100644 --- a/src/uipath/dev/server/frontend/src/types/agent.ts +++ b/src/uipath/dev/server/frontend/src/types/agent.ts @@ -53,3 +53,36 @@ export interface AgentSessionState { turn_count: number; compaction_count: number; } + +export interface TraceMessage { + role: string; + content: string; + tool_calls?: { name: string; arguments: string }[]; + tool_call_id?: string; +} + +export interface AgentTraceSpan { + turn_index: number; + input_messages: TraceMessage[]; + output_content: string; + output_thinking?: string; + output_tool_calls: { name: string; arguments: string }[]; + tool_results?: { tool_call_id: string; name: string; result: string }[]; + prompt_tokens: number; + completion_tokens: number; + duration_ms: number; + model: string; + status: string; +} + +export interface AgentRawState { + session_id: string; + model: string; + status: string; + turn_count: number; + total_prompt_tokens: number; + total_completion_tokens: number; + system_prompt: string; + tool_schemas: { function: { name: string; description?: string; parameters?: unknown } }[]; + traces: AgentTraceSpan[]; +} diff --git a/src/uipath/dev/server/frontend/tsconfig.tsbuildinfo b/src/uipath/dev/server/frontend/tsconfig.tsbuildinfo index 4889e6f..dd84d5c 100644 --- a/src/uipath/dev/server/frontend/tsconfig.tsbuildinfo +++ b/src/uipath/dev/server/frontend/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/agent-client.ts","./src/api/auth.ts","./src/api/client.ts","./src/api/eval-client.ts","./src/api/explorer-client.ts","./src/api/websocket.ts","./src/components/agent/agentchatsidebar.tsx","./src/components/agent/agentmessage.tsx","./src/components/agent/questioncard.tsx","./src/components/chat/chatinput.tsx","./src/components/chat/chatinterrupt.tsx","./src/components/chat/chatmessage.tsx","./src/components/chat/chatpanel.tsx","./src/components/debug/debugcontrols.tsx","./src/components/evals/createevalsetview.tsx","./src/components/evals/evalrunresults.tsx","./src/components/evals/evalsetdetail.tsx","./src/components/evals/evalssidebar.tsx","./src/components/evaluators/createevaluatorview.tsx","./src/components/evaluators/evaluatordetail.tsx","./src/components/evaluators/evaluatorssidebar.tsx","./src/components/explorer/explorersidebar.tsx","./src/components/explorer/fileeditor.tsx","./src/components/graph/graphpanel.tsx","./src/components/graph/edges/elkedge.tsx","./src/components/graph/nodes/defaultnode.tsx","./src/components/graph/nodes/endnode.tsx","./src/components/graph/nodes/groupnode.tsx","./src/components/graph/nodes/modelnode.tsx","./src/components/graph/nodes/startnode.tsx","./src/components/graph/nodes/toolnode.tsx","./src/components/layout/activitybar.tsx","./src/components/layout/debugsidebar.tsx","./src/components/layout/sidepanel.tsx","./src/components/layout/sidebar.tsx","./src/components/layout/statusbar.tsx","./src/components/logs/logpanel.tsx","./src/components/runs/addtoevalmodal.tsx","./src/components/runs/newrunpanel.tsx","./src/components/runs/rundetailspanel.tsx","./src/components/runs/runeventspanel.tsx","./src/components/runs/runhistoryitem.tsx","./src/components/runs/setupview.tsx","./src/components/shared/datasection.tsx","./src/components/shared/jsonhighlight.tsx","./src/components/shared/reloadtoast.tsx","./src/components/shared/toastcontainer.tsx","./src/components/traces/spandetails.tsx","./src/components/traces/tracetree.tsx","./src/components/traces/waterfallview.tsx","./src/hooks/usehashroute.ts","./src/hooks/useismobile.ts","./src/store/useagentstore.ts","./src/store/useauthstore.ts","./src/store/useconfigstore.ts","./src/store/useevalstore.ts","./src/store/useexplorerstore.ts","./src/store/userunstore.ts","./src/store/usetheme.ts","./src/store/usetoaststore.ts","./src/store/usewebsocket.ts","./src/types/agent.ts","./src/types/eval.ts","./src/types/explorer.ts","./src/types/graph.ts","./src/types/run.ts","./src/types/ws.ts"],"version":"5.7.3"} \ No newline at end of file +{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/api/agent-client.ts","./src/api/auth.ts","./src/api/client.ts","./src/api/eval-client.ts","./src/api/explorer-client.ts","./src/api/websocket.ts","./src/components/agent/agentchatsidebar.tsx","./src/components/agent/agentmessage.tsx","./src/components/agent/agentstatepanel.tsx","./src/components/agent/diffview.tsx","./src/components/agent/questioncard.tsx","./src/components/chat/chatinput.tsx","./src/components/chat/chatinterrupt.tsx","./src/components/chat/chatmessage.tsx","./src/components/chat/chatpanel.tsx","./src/components/debug/debugcontrols.tsx","./src/components/evals/createevalsetview.tsx","./src/components/evals/evalrunresults.tsx","./src/components/evals/evalsetdetail.tsx","./src/components/evals/evalssidebar.tsx","./src/components/evaluators/createevaluatorview.tsx","./src/components/evaluators/evaluatordetail.tsx","./src/components/evaluators/evaluatorssidebar.tsx","./src/components/explorer/explorersidebar.tsx","./src/components/explorer/fileeditor.tsx","./src/components/graph/graphpanel.tsx","./src/components/graph/edges/elkedge.tsx","./src/components/graph/nodes/defaultnode.tsx","./src/components/graph/nodes/endnode.tsx","./src/components/graph/nodes/groupnode.tsx","./src/components/graph/nodes/modelnode.tsx","./src/components/graph/nodes/startnode.tsx","./src/components/graph/nodes/toolnode.tsx","./src/components/layout/activitybar.tsx","./src/components/layout/debugsidebar.tsx","./src/components/layout/sidepanel.tsx","./src/components/layout/sidebar.tsx","./src/components/layout/statusbar.tsx","./src/components/logs/logpanel.tsx","./src/components/runs/addtoevalmodal.tsx","./src/components/runs/newrunpanel.tsx","./src/components/runs/rundetailspanel.tsx","./src/components/runs/runeventspanel.tsx","./src/components/runs/runhistoryitem.tsx","./src/components/runs/setupview.tsx","./src/components/shared/datasection.tsx","./src/components/shared/jsonhighlight.tsx","./src/components/shared/reloadtoast.tsx","./src/components/shared/toastcontainer.tsx","./src/components/traces/spandetails.tsx","./src/components/traces/tracetree.tsx","./src/components/traces/waterfallview.tsx","./src/hooks/usehashroute.ts","./src/hooks/useismobile.ts","./src/store/useagentstore.ts","./src/store/useauthstore.ts","./src/store/useconfigstore.ts","./src/store/useevalstore.ts","./src/store/useexplorerstore.ts","./src/store/userunstore.ts","./src/store/usetheme.ts","./src/store/usetoaststore.ts","./src/store/usewebsocket.ts","./src/types/agent.ts","./src/types/eval.ts","./src/types/explorer.ts","./src/types/graph.ts","./src/types/run.ts","./src/types/ws.ts"],"version":"5.7.3"} \ No newline at end of file diff --git a/src/uipath/dev/server/routes/agent.py b/src/uipath/dev/server/routes/agent.py index 649e09b..8df68d8 100644 --- a/src/uipath/dev/server/routes/agent.py +++ b/src/uipath/dev/server/routes/agent.py @@ -79,6 +79,18 @@ async def get_session_state(session_id: str, request: Request) -> dict[str, Any] return result +@router.get("/agent/session/{session_id}/raw-state") +async def get_session_raw_state(session_id: str, request: Request) -> dict[str, Any]: + """Return raw trace data for the agent trace inspector.""" + from uipath.dev.services.agent import AgentService + + agent_service: AgentService = request.app.state.server.agent_service + result = agent_service.get_session_raw_state(session_id) + if result is None: + raise HTTPException(status_code=404, detail="Session not found") + return result + + @router.get("/agent/skills") async def list_agent_skills(request: Request) -> list[dict[str, str]]: """List available built-in skills.""" diff --git a/src/uipath/dev/server/static/assets/ChatPanel-DWIYYBph.js b/src/uipath/dev/server/static/assets/ChatPanel-22tyOge8.js similarity index 99% rename from src/uipath/dev/server/static/assets/ChatPanel-DWIYYBph.js rename to src/uipath/dev/server/static/assets/ChatPanel-22tyOge8.js index 67d46a7..f734b43 100644 --- a/src/uipath/dev/server/static/assets/ChatPanel-DWIYYBph.js +++ b/src/uipath/dev/server/static/assets/ChatPanel-22tyOge8.js @@ -1,2 +1,2 @@ -import{j as e,a as y}from"./vendor-react-N5xbSGOh.js";import{M,r as T,a as O,u as S}from"./index-V3oNRyE_.js";import"./vendor-reactflow-CxoS0d5s.js";const J={user:{label:"You",color:"var(--info)"},tool:{label:"Tool",color:"var(--warning)"},assistant:{label:"AI",color:"var(--success)"}};function A({message:t,onToolCallClick:r,toolCallIndices:o}){const i=t.role==="user",l=t.tool_calls&&t.tool_calls.length>0,a=J[i?"user":l?"tool":"assistant"];return e.jsxs("div",{className:"py-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[e.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:a.color}}),e.jsx("span",{className:"text-[11px] font-semibold",style:{color:a.color},children:a.label})]}),t.content&&(i?e.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose",style:{color:"var(--text-primary)"},children:t.content}):e.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose chat-markdown",style:{color:"var(--text-secondary)"},children:e.jsx(M,{remarkPlugins:[O],rehypePlugins:[T],children:t.content})})),t.tool_calls&&t.tool_calls.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-1 pl-2.5",children:t.tool_calls.map((p,c)=>e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-mono px-2 py-1 rounded cursor-pointer hover:brightness-125",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:p.has_result?"var(--success)":"var(--text-muted)"},onClick:()=>r==null?void 0:r(p.name,(o==null?void 0:o[c])??0),children:[p.has_result?"✓":"•"," ",p.name]},`${p.name}-${c}`))})]})}function L({onSend:t,disabled:r,placeholder:o}){const[i,l]=y.useState(""),u=()=>{const c=i.trim();c&&(t(c),l(""))},a=c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),u())},p=!r&&i.trim().length>0;return e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:[e.jsx("input",{value:i,onChange:c=>l(c.target.value),onKeyDown:a,disabled:r,placeholder:o??"Message...",className:"flex-1 bg-transparent text-sm py-1 disabled:opacity-40 placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),e.jsx("button",{onClick:u,disabled:!p,className:"text-xs font-semibold px-3 py-1.5 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed","aria-label":"Send message",style:{color:p?"var(--accent)":"var(--text-muted)",background:"transparent"},onMouseEnter:c=>{p&&(c.currentTarget.style.background="color-mix(in srgb, var(--accent) 10%, transparent)")},onMouseLeave:c=>{c.currentTarget.style.background="transparent"},children:"Send"})]})}function $(t){if(typeof t!="object"||t===null)return!1;const r=t;return typeof r.properties=="object"&&r.properties!==null&&Object.keys(r.properties).length>0}const f={color:"var(--text-primary)",border:"1px solid var(--border)",background:"var(--bg-primary)"},j="w-full text-[11px] font-mono py-1 px-2 rounded focus:outline-none";function R({name:t,prop:r,value:o,onChange:i}){const l=e.jsxs("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:[t,r.description&&e.jsxs("span",{className:"font-normal normal-case tracking-normal ml-1",style:{color:"var(--text-muted)",opacity:.7},children:["— ",r.description]})]});if(r.enum&&Array.isArray(r.enum))return e.jsxs("div",{children:[l,e.jsx("select",{value:String(o??""),onChange:a=>i(a.target.value),className:j,style:f,children:r.enum.map(a=>e.jsx("option",{value:String(a),children:String(a)},String(a)))})]});if(r.type==="boolean")return e.jsxs("div",{children:[l,e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer py-1",children:[e.jsx("input",{type:"checkbox",checked:!!o,onChange:a=>i(a.target.checked),className:"accent-[var(--accent)]"}),e.jsx("span",{className:"text-[11px] font-mono",style:{color:"var(--text-secondary)"},children:o?"true":"false"})]})]});if(r.type==="number"||r.type==="integer")return e.jsxs("div",{children:[l,e.jsx("input",{type:"number",value:o==null?"":String(o),onChange:a=>i(a.target.value===""?null:Number(a.target.value)),step:r.type==="integer"?1:"any",className:j,style:f})]});if(r.type==="object"||r.type==="array"){const a=typeof o=="string"?o:JSON.stringify(o??null,null,2);return e.jsxs("div",{children:[l,e.jsx("textarea",{value:a,onChange:p=>i(p.target.value),rows:3,className:`${j} resize-y`,style:f})]})}const u=o==null?"":String(o);return u.length>100||u.includes(` +import{j as e,a as y}from"./vendor-react-N5xbSGOh.js";import{M,r as T,a as O,u as S}from"./index-B6Qbh6OY.js";import"./vendor-reactflow-CxoS0d5s.js";const J={user:{label:"You",color:"var(--info)"},tool:{label:"Tool",color:"var(--warning)"},assistant:{label:"AI",color:"var(--success)"}};function A({message:t,onToolCallClick:r,toolCallIndices:o}){const i=t.role==="user",l=t.tool_calls&&t.tool_calls.length>0,a=J[i?"user":l?"tool":"assistant"];return e.jsxs("div",{className:"py-1.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[e.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:a.color}}),e.jsx("span",{className:"text-[11px] font-semibold",style:{color:a.color},children:a.label})]}),t.content&&(i?e.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose",style:{color:"var(--text-primary)"},children:t.content}):e.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose chat-markdown",style:{color:"var(--text-secondary)"},children:e.jsx(M,{remarkPlugins:[O],rehypePlugins:[T],children:t.content})})),t.tool_calls&&t.tool_calls.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-1 pl-2.5",children:t.tool_calls.map((p,c)=>e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-mono px-2 py-1 rounded cursor-pointer hover:brightness-125",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:p.has_result?"var(--success)":"var(--text-muted)"},onClick:()=>r==null?void 0:r(p.name,(o==null?void 0:o[c])??0),children:[p.has_result?"✓":"•"," ",p.name]},`${p.name}-${c}`))})]})}function L({onSend:t,disabled:r,placeholder:o}){const[i,l]=y.useState(""),u=()=>{const c=i.trim();c&&(t(c),l(""))},a=c=>{c.key==="Enter"&&!c.shiftKey&&(c.preventDefault(),u())},p=!r&&i.trim().length>0;return e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:[e.jsx("input",{value:i,onChange:c=>l(c.target.value),onKeyDown:a,disabled:r,placeholder:o??"Message...",className:"flex-1 bg-transparent text-sm py-1 disabled:opacity-40 placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),e.jsx("button",{onClick:u,disabled:!p,className:"text-xs font-semibold px-3 py-1.5 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed","aria-label":"Send message",style:{color:p?"var(--accent)":"var(--text-muted)",background:"transparent"},onMouseEnter:c=>{p&&(c.currentTarget.style.background="color-mix(in srgb, var(--accent) 10%, transparent)")},onMouseLeave:c=>{c.currentTarget.style.background="transparent"},children:"Send"})]})}function $(t){if(typeof t!="object"||t===null)return!1;const r=t;return typeof r.properties=="object"&&r.properties!==null&&Object.keys(r.properties).length>0}const f={color:"var(--text-primary)",border:"1px solid var(--border)",background:"var(--bg-primary)"},j="w-full text-[11px] font-mono py-1 px-2 rounded focus:outline-none";function R({name:t,prop:r,value:o,onChange:i}){const l=e.jsxs("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:[t,r.description&&e.jsxs("span",{className:"font-normal normal-case tracking-normal ml-1",style:{color:"var(--text-muted)",opacity:.7},children:["— ",r.description]})]});if(r.enum&&Array.isArray(r.enum))return e.jsxs("div",{children:[l,e.jsx("select",{value:String(o??""),onChange:a=>i(a.target.value),className:j,style:f,children:r.enum.map(a=>e.jsx("option",{value:String(a),children:String(a)},String(a)))})]});if(r.type==="boolean")return e.jsxs("div",{children:[l,e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer py-1",children:[e.jsx("input",{type:"checkbox",checked:!!o,onChange:a=>i(a.target.checked),className:"accent-[var(--accent)]"}),e.jsx("span",{className:"text-[11px] font-mono",style:{color:"var(--text-secondary)"},children:o?"true":"false"})]})]});if(r.type==="number"||r.type==="integer")return e.jsxs("div",{children:[l,e.jsx("input",{type:"number",value:o==null?"":String(o),onChange:a=>i(a.target.value===""?null:Number(a.target.value)),step:r.type==="integer"?1:"any",className:j,style:f})]});if(r.type==="object"||r.type==="array"){const a=typeof o=="string"?o:JSON.stringify(o??null,null,2);return e.jsxs("div",{children:[l,e.jsx("textarea",{value:a,onChange:p=>i(p.target.value),rows:3,className:`${j} resize-y`,style:f})]})}const u=o==null?"":String(o);return u.length>100||u.includes(` `)?e.jsxs("div",{children:[l,e.jsx("textarea",{value:u,onChange:a=>i(a.target.value),rows:3,className:`${j} resize-y`,style:f})]}):e.jsxs("div",{children:[l,e.jsx("input",{type:"text",value:u,onChange:a=>i(a.target.value),className:j,style:f})]})}function _({label:t,color:r,onClick:o}){return e.jsx("button",{onClick:o,className:"text-xs font-semibold px-3 py-1.5 rounded cursor-pointer transition-colors",style:{background:`color-mix(in srgb, var(--${r}) 15%, var(--bg-secondary))`,color:`var(--${r})`,border:`1px solid color-mix(in srgb, var(--${r}) 30%, var(--border))`},onMouseEnter:i=>{i.currentTarget.style.background=`color-mix(in srgb, var(--${r}) 25%, var(--bg-secondary))`},onMouseLeave:i=>{i.currentTarget.style.background=`color-mix(in srgb, var(--${r}) 15%, var(--bg-secondary))`},children:t})}function F({interrupt:t,onRespond:r}){const[o,i]=y.useState(""),[l,u]=y.useState(!1),[a,p]=y.useState({}),[c,N]=y.useState(""),[k,h]=y.useState(null),g=t.input_schema,b=$(g),C=y.useCallback(()=>{const s=typeof t.input_value=="object"&&t.input_value!==null?t.input_value:{};if(b){const d={...s};for(const m of Object.keys(g.properties))m in d||(d[m]=null);const x=g.properties;for(const[m,v]of Object.entries(x))(v.type==="object"||v.type==="array")&&typeof d[m]!="string"&&(d[m]=JSON.stringify(d[m]??null,null,2));p(d)}else N(typeof t.input_value=="string"?t.input_value:JSON.stringify(t.input_value??null,null,2));h(null),u(!0)},[t.input_value,b,g]),E=()=>{u(!1),h(null)},w=()=>{if(b){const s={},d=g.properties;for(const[x,m]of Object.entries(a)){const v=d[x];if(((v==null?void 0:v.type)==="object"||(v==null?void 0:v.type)==="array")&&typeof m=="string")try{s[x]=JSON.parse(m)}catch{h(`Invalid JSON for "${x}"`);return}else s[x]=m}r({approved:!0,input:s})}else try{const s=JSON.parse(c);r({approved:!0,input:s})}catch{h("Invalid JSON");return}},n=y.useCallback((s,d)=>{p(x=>({...x,[s]:d}))},[]);return t.interrupt_type==="tool_call_confirmation"?e.jsxs("div",{className:"mx-3 my-2 rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--warning) 40%, var(--border))"},children:[e.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"color-mix(in srgb, var(--warning) 10%, var(--bg-secondary))"},children:[e.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--warning)"},children:l?"Edit Arguments":"Action Required"}),t.tool_name&&e.jsx("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--text-primary)"},children:t.tool_name}),!l&&(t.input_value!=null||b)&&e.jsx("button",{onClick:C,className:"ml-auto p-1.5 rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)"},"aria-label":"Edit arguments",onMouseEnter:s=>{s.currentTarget.style.color="var(--warning)"},onMouseLeave:s=>{s.currentTarget.style.color="var(--text-muted)"},title:"Edit arguments",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),e.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})})]}),l?e.jsxs("div",{className:"px-3 py-2 space-y-3 overflow-y-auto",style:{background:"var(--bg-secondary)",maxHeight:300},children:[b?Object.entries(g.properties).map(([s,d])=>e.jsx(R,{name:s,prop:d,value:a[s],onChange:x=>n(s,x)},s)):e.jsx("textarea",{value:c,onChange:s=>{N(s.target.value),h(null)},rows:8,className:"w-full text-[11px] font-mono py-1 px-2 rounded focus:outline-none resize-y",style:f}),k&&e.jsx("p",{className:"text-[11px]",style:{color:"var(--error)"},children:k})]}):t.input_value!=null&&e.jsx("pre",{className:"px-3 py-2 text-[11px] font-mono whitespace-pre-wrap break-words overflow-y-auto leading-normal",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)",maxHeight:200},children:typeof t.input_value=="string"?t.input_value:JSON.stringify(t.input_value,null,2)}),e.jsx("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--bg-secondary)",borderTop:"1px solid var(--border)"},children:l?e.jsxs(e.Fragment,{children:[e.jsx(_,{label:"Approve",color:"success",onClick:w}),e.jsx(_,{label:"Cancel",color:"text-muted",onClick:E})]}):e.jsxs(e.Fragment,{children:[e.jsx(_,{label:"Approve",color:"success",onClick:()=>r({approved:!0})}),e.jsx(_,{label:"Reject",color:"error",onClick:()=>r({approved:!1})})]})})]}):e.jsxs("div",{className:"mx-3 my-2 rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--accent) 40%, var(--border))"},children:[e.jsx("div",{className:"px-3 py-2",style:{background:"color-mix(in srgb, var(--accent) 10%, var(--bg-secondary))"},children:e.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--accent)"},children:"Input Required"})}),t.content!=null&&e.jsx("div",{className:"px-3 py-2 text-sm leading-relaxed",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)"},children:typeof t.content=="string"?t.content:JSON.stringify(t.content,null,2)}),e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--bg-secondary)",borderTop:"1px solid var(--border)"},children:[e.jsx("input",{value:o,onChange:s=>i(s.target.value),onKeyDown:s=>{s.key==="Enter"&&!s.shiftKey&&o.trim()&&(s.preventDefault(),r({response:o.trim()}))},placeholder:"Type your response...",className:"flex-1 bg-transparent text-sm py-1 placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),e.jsx("button",{onClick:()=>{o.trim()&&r({response:o.trim()})},disabled:!o.trim(),className:"text-xs font-semibold px-3 py-1.5 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:o.trim()?"var(--accent)":"var(--text-muted)",background:"transparent"},children:"Send"})]})]})}function I({messages:t,runId:r,runStatus:o,ws:i}){const l=y.useRef(null),u=y.useRef(!0),a=S(n=>n.addLocalChatMessage),p=S(n=>n.setFocusedSpan),c=S(n=>n.activeInterrupt[r]??null),N=S(n=>n.setActiveInterrupt),k=y.useMemo(()=>{const n=new Map,s=new Map;for(const d of t)if(d.tool_calls){const x=[];for(const m of d.tool_calls){const v=s.get(m.name)??0;x.push(v),s.set(m.name,v+1)}n.set(d.message_id,x)}return n},[t]),[h,g]=y.useState(!1),b=()=>{const n=l.current;if(!n)return;const s=n.scrollHeight-n.scrollTop-n.clientHeight<40;u.current=s,g(n.scrollTop>100)};y.useEffect(()=>{u.current&&l.current&&(l.current.scrollTop=l.current.scrollHeight)});const C=n=>{u.current=!0,a(r,{message_id:`local-${Date.now()}`,role:"user",content:n}),i.sendChatMessage(r,n)},E=n=>{u.current=!0,i.sendInterruptResponse(r,n),N(r,null)},w=o==="running"||!!c;return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[e.jsxs("div",{ref:l,onScroll:b,className:"h-full overflow-y-auto px-3 py-2 space-y-0.5",children:[t.length===0&&e.jsx("p",{className:"text-[var(--text-muted)] text-sm text-center py-6",children:"No messages yet"}),t.map(n=>e.jsx(A,{message:n,toolCallIndices:k.get(n.message_id),onToolCallClick:(s,d)=>p({name:s,index:d})},n.message_id)),c&&e.jsx(F,{interrupt:c,onRespond:E})]}),h&&e.jsx("button",{onClick:()=>{var n;return(n=l.current)==null?void 0:n.scrollTo({top:0,behavior:"smooth"})},className:"absolute top-2 right-3 w-6 h-6 flex items-center justify-center rounded-full cursor-pointer transition-opacity opacity-70 hover:opacity-100",style:{background:"var(--bg-tertiary)",color:"var(--text-primary)"},title:"Scroll to top",children:e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"18 15 12 9 6 15"})})})]}),e.jsx(L,{onSend:C,disabled:w,placeholder:c?"Respond to the interrupt above...":w?"Waiting for response...":"Message..."})]})}export{I as default}; diff --git a/src/uipath/dev/server/static/assets/index-B6Qbh6OY.js b/src/uipath/dev/server/static/assets/index-B6Qbh6OY.js new file mode 100644 index 0000000..6e883d6 --- /dev/null +++ b/src/uipath/dev/server/static/assets/index-B6Qbh6OY.js @@ -0,0 +1,121 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-elk-CiLKfHel.js","assets/vendor-react-N5xbSGOh.js","assets/ChatPanel-22tyOge8.js","assets/vendor-reactflow-CxoS0d5s.js","assets/vendor-reactflow-B5DZHykP.css"])))=>i.map(i=>d[i]); +var Fl=Object.defineProperty;var zl=(e,t,n)=>t in e?Fl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var It=(e,t,n)=>zl(e,typeof t!="symbol"?t+"":t,n);import{W as An,a as _,j as i,w as $l,F as Ul,g as ns,b as Hl}from"./vendor-react-N5xbSGOh.js";import{H as gt,P as xt,B as Wl,M as Kl,u as Gl,a as ql,R as Vl,b as Yl,C as Xl,c as Zl,d as Jl}from"./vendor-reactflow-CxoS0d5s.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();const Fs=e=>{let t;const n=new Set,r=(u,d)=>{const p=typeof u=="function"?u(t):u;if(!Object.is(p,t)){const m=t;t=d??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(f=>f(t,m))}},s=()=>t,l={setState:r,getState:s,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u))},c=t=e(r,s,l);return l},Ql=(e=>e?Fs(e):Fs),ec=e=>e;function tc(e,t=ec){const n=An.useSyncExternalStore(e.subscribe,An.useCallback(()=>t(e.getState()),[e,t]),An.useCallback(()=>t(e.getInitialState()),[e,t]));return An.useDebugValue(n),n}const zs=e=>{const t=Ql(e),n=r=>tc(t,r);return Object.assign(n,t),n},Ot=(e=>e?zs(e):zs),ve=Ot(e=>({runs:{},selectedRunId:null,traces:{},logs:{},chatMessages:{},entrypoints:[],setRuns:t=>e(n=>{var a;let r=n.breakpoints;for(const o of t)(a=o.breakpoints)!=null&&a.length&&!r[o.id]&&(r={...r,[o.id]:Object.fromEntries(o.breakpoints.map(l=>[l,!0]))});const s={runs:Object.fromEntries(t.map(o=>[o.id,o]))};return r!==n.breakpoints&&(s.breakpoints=r),s}),upsertRun:t=>e(n=>{var s;const r={runs:{...n.runs,[t.id]:t}};if((s=t.breakpoints)!=null&&s.length&&!n.breakpoints[t.id]&&(r.breakpoints={...n.breakpoints,[t.id]:Object.fromEntries(t.breakpoints.map(a=>[a,!0]))}),(t.status==="completed"||t.status==="failed")&&n.activeNodes[t.id]){const{[t.id]:a,...o}=n.activeNodes;r.activeNodes=o}if(t.status!=="suspended"&&n.activeInterrupt[t.id]){const{[t.id]:a,...o}=n.activeInterrupt;r.activeInterrupt=o}return r}),selectRun:t=>e({selectedRunId:t}),addTrace:t=>e(n=>{const r=n.traces[t.run_id]??[],s=r.findIndex(o=>o.span_id===t.span_id),a=s>=0?r.map((o,l)=>l===s?t:o):[...r,t];return{traces:{...n.traces,[t.run_id]:a}}}),setTraces:(t,n)=>e(r=>({traces:{...r.traces,[t]:n}})),addLog:t=>e(n=>{const r=n.logs[t.run_id]??[];return{logs:{...n.logs,[t.run_id]:[...r,t]}}}),setLogs:(t,n)=>e(r=>({logs:{...r.logs,[t]:n}})),addChatEvent:(t,n)=>e(r=>{const s=r.chatMessages[t]??[],a=n.message;if(!a)return r;const o=a.messageId??a.message_id,l=a.role??"assistant",d=(a.contentParts??a.content_parts??[]).filter(g=>{const v=g.mimeType??g.mime_type??"";return v.startsWith("text/")||v==="application/json"}).map(g=>{const v=g.data;return(v==null?void 0:v.inline)??""}).join(` +`).trim(),p=(a.toolCalls??a.tool_calls??[]).map(g=>({name:g.name??"",has_result:!!g.result})),m={message_id:o,role:l,content:d,tool_calls:p.length>0?p:void 0},f=s.findIndex(g=>g.message_id===o);if(f>=0)return{chatMessages:{...r.chatMessages,[t]:s.map((g,v)=>v===f?m:g)}};if(l==="user"){const g=s.findIndex(v=>v.message_id.startsWith("local-")&&v.role==="user"&&v.content===d);if(g>=0)return{chatMessages:{...r.chatMessages,[t]:s.map((v,y)=>y===g?m:v)}}}const x=[...s,m];return{chatMessages:{...r.chatMessages,[t]:x}}}),addLocalChatMessage:(t,n)=>e(r=>{const s=r.chatMessages[t]??[];return{chatMessages:{...r.chatMessages,[t]:[...s,n]}}}),setChatMessages:(t,n)=>e(r=>({chatMessages:{...r.chatMessages,[t]:n}})),setEntrypoints:t=>e({entrypoints:t}),breakpoints:{},toggleBreakpoint:(t,n)=>e(r=>{const s={...r.breakpoints[t]??{}};return s[n]?delete s[n]:s[n]=!0,{breakpoints:{...r.breakpoints,[t]:s}}}),clearBreakpoints:t=>e(n=>{const{[t]:r,...s}=n.breakpoints;return{breakpoints:s}}),activeNodes:{},setActiveNode:(t,n,r)=>e(s=>{const a=s.activeNodes[t]??{executing:{},prev:null};return{activeNodes:{...s.activeNodes,[t]:{executing:{...a.executing,[n]:r??null},prev:a.prev}}}}),removeActiveNode:(t,n)=>e(r=>{const s=r.activeNodes[t];if(!s)return r;const{[n]:a,...o}=s.executing;return{activeNodes:{...r.activeNodes,[t]:{executing:o,prev:n}}}}),resetRunGraphState:t=>e(n=>({stateEvents:{...n.stateEvents,[t]:[]},activeNodes:{...n.activeNodes,[t]:{executing:{},prev:null}}})),stateEvents:{},addStateEvent:(t,n,r,s,a)=>e(o=>{const l=o.stateEvents[t]??[];return{stateEvents:{...o.stateEvents,[t]:[...l,{node_name:n,qualified_node_name:s,phase:a,timestamp:Date.now(),payload:r}]}}}),setStateEvents:(t,n)=>e(r=>({stateEvents:{...r.stateEvents,[t]:n}})),focusedSpan:null,setFocusedSpan:t=>e({focusedSpan:t}),activeInterrupt:{},setActiveInterrupt:(t,n)=>e(r=>({activeInterrupt:{...r.activeInterrupt,[t]:n}})),reloadPending:!1,setReloadPending:t=>e({reloadPending:t}),graphCache:{},setGraphCache:(t,n)=>e(r=>({graphCache:{...r.graphCache,[t]:n}}))})),Qn="/api";async function nc(e){const t=await fetch(`${Qn}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({environment:e})});if(!t.ok)throw new Error(`Login failed: ${t.status}`);return t.json()}async function pr(){const e=await fetch(`${Qn}/auth/status`);if(!e.ok)throw new Error(`Status check failed: ${e.status}`);return e.json()}async function rc(e){const t=await fetch(`${Qn}/auth/select-tenant`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tenant_name:e})});if(!t.ok)throw new Error(`Tenant selection failed: ${t.status}`);return t.json()}async function sc(){await fetch(`${Qn}/auth/logout`,{method:"POST"})}const Ai="uipath-env",oc=["cloud","staging","alpha"];function ic(){const e=localStorage.getItem(Ai);return oc.includes(e)?e:"cloud"}const Hn=Ot((e,t)=>({enabled:!0,status:"unauthenticated",environment:ic(),tenants:[],uipathUrl:null,pollTimer:null,expiryTimer:null,init:async()=>{try{const n=await fetch("/api/config");if(n.ok&&!(await n.json()).auth_enabled){e({enabled:!1});return}const r=await pr();e({status:r.status,tenants:r.tenants??[],uipathUrl:r.uipath_url??null}),r.status==="authenticated"&&t().startExpiryCheck()}catch(n){console.error("Auth init failed",n)}},setEnvironment:n=>{localStorage.setItem(Ai,n),e({environment:n})},startLogin:async()=>{const{environment:n}=t();try{const r=await nc(n);e({status:"pending"}),window.open(r.auth_url,"_blank"),t().pollStatus()}catch(r){console.error("Login failed",r)}},pollStatus:()=>{const{pollTimer:n}=t();if(n)return;const r=setInterval(async()=>{try{const s=await pr();s.status!=="pending"&&(t().stopPolling(),e({status:s.status,tenants:s.tenants??[],uipathUrl:s.uipath_url??null}),s.status==="authenticated"&&t().startExpiryCheck())}catch{}},2e3);e({pollTimer:r})},stopPolling:()=>{const{pollTimer:n}=t();n&&(clearInterval(n),e({pollTimer:null}))},startExpiryCheck:()=>{const{expiryTimer:n}=t();if(n)return;const r=setInterval(async()=>{try{(await pr()).status==="expired"&&(t().stopExpiryCheck(),e({status:"expired"}))}catch{}},3e4);e({expiryTimer:r})},stopExpiryCheck:()=>{const{expiryTimer:n}=t();n&&(clearInterval(n),e({expiryTimer:null}))},selectTenant:async n=>{try{const r=await rc(n);e({status:"authenticated",uipathUrl:r.uipath_url,tenants:[]}),t().startExpiryCheck()}catch(r){console.error("Tenant selection failed",r)}},logout:async()=>{t().stopPolling(),t().stopExpiryCheck();try{await sc()}catch{}e({status:"unauthenticated",tenants:[],uipathUrl:null})}})),Mi=Ot(e=>({projectName:null,projectVersion:null,projectAuthors:null,init:async()=>{try{const t=await fetch("/api/config");if(t.ok){const n=await t.json();e({projectName:n.project_name??null,projectVersion:n.project_version??null,projectAuthors:n.project_authors??null})}}catch{}}}));class ac{constructor(t){It(this,"ws",null);It(this,"url");It(this,"handlers",new Set);It(this,"reconnectTimer",null);It(this,"shouldReconnect",!0);It(this,"pendingMessages",[]);It(this,"activeSubscriptions",new Set);const n=window.location.protocol==="https:"?"wss:":"ws:";this.url=t??`${n}//${window.location.host}/ws`}connect(){var t;((t=this.ws)==null?void 0:t.readyState)!==WebSocket.OPEN&&(this.ws=new WebSocket(this.url),this.ws.onopen=()=>{console.log("[ws] connected");for(const n of this.activeSubscriptions)this.sendRaw(JSON.stringify({type:"subscribe",payload:{run_id:n}}));for(const n of this.pendingMessages)this.sendRaw(n);this.pendingMessages=[]},this.ws.onmessage=n=>{let r;try{r=JSON.parse(n.data)}catch{console.warn("[ws] failed to parse message",n.data);return}this.handlers.forEach(s=>{try{s(r)}catch(a){console.error("[ws] handler error",a)}})},this.ws.onclose=()=>{console.log("[ws] disconnected"),this.shouldReconnect&&(this.reconnectTimer=setTimeout(()=>this.connect(),2e3))},this.ws.onerror=()=>{var n;(n=this.ws)==null||n.close()})}disconnect(){var t;this.shouldReconnect=!1,this.reconnectTimer&&clearTimeout(this.reconnectTimer),(t=this.ws)==null||t.close(),this.ws=null}onMessage(t){return this.handlers.add(t),()=>this.handlers.delete(t)}sendRaw(t){var n;((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN&&this.ws.send(t)}send(t,n){var s;const r=JSON.stringify({type:t,payload:n});((s=this.ws)==null?void 0:s.readyState)===WebSocket.OPEN?this.ws.send(r):this.pendingMessages.push(r)}subscribe(t){this.activeSubscriptions.add(t),this.send("subscribe",{run_id:t})}unsubscribe(t){this.activeSubscriptions.delete(t),this.send("unsubscribe",{run_id:t})}sendChatMessage(t,n){this.send("chat.message",{run_id:t,text:n})}sendInterruptResponse(t,n){this.send("chat.interrupt_response",{run_id:t,data:n})}debugStep(t){this.send("debug.step",{run_id:t})}debugContinue(t){this.send("debug.continue",{run_id:t})}debugStop(t){this.send("debug.stop",{run_id:t})}setBreakpoints(t,n){this.send("debug.set_breakpoints",{run_id:t,breakpoints:n})}sendAgentMessage(t,n,r,s){this.send("agent.message",{text:t,model:n,session_id:r??void 0,skill_ids:s&&s.length>0?s:void 0})}sendAgentStop(t){this.send("agent.stop",{session_id:t})}sendToolApproval(t,n,r){this.send("agent.tool_response",{session_id:t,tool_call_id:n,approved:r})}sendQuestionResponse(t,n,r){this.send("agent.question_response",{session_id:t,question_id:n,answer:r})}}const jt="/api";async function Lt(e,t){const n=await fetch(e,t);if(!n.ok){let r;try{r=(await n.json()).detail||n.statusText}catch{r=n.statusText}const s=new Error(`HTTP ${n.status}`);throw s.detail=r,s.status=n.status,s}return n.json()}async function rs(){return Lt(`${jt}/entrypoints`)}async function lc(e){return Lt(`${jt}/entrypoints/${encodeURIComponent(e)}/schema`)}async function cc(e){return Lt(`${jt}/entrypoints/${encodeURIComponent(e)}/mock-input`)}async function uc(e){return Lt(`${jt}/entrypoints/${encodeURIComponent(e)}/graph`)}async function $s(e,t,n="run",r=[]){return Lt(`${jt}/runs`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entrypoint:e,input_data:t,mode:n,breakpoints:r})})}async function dc(){return Lt(`${jt}/runs`)}async function fr(e){return Lt(`${jt}/runs/${e}`)}async function pc(){return Lt(`${jt}/reload`,{method:"POST"})}const Me=Ot(e=>({evaluators:[],localEvaluators:[],evalSets:{},evalRuns:{},setEvaluators:t=>e({evaluators:t}),setLocalEvaluators:t=>e({localEvaluators:t}),addLocalEvaluator:t=>e(n=>({localEvaluators:[...n.localEvaluators,t]})),upsertLocalEvaluator:t=>e(n=>({localEvaluators:n.localEvaluators.some(r=>r.id===t.id)?n.localEvaluators.map(r=>r.id===t.id?t:r):[...n.localEvaluators,t]})),setEvalSets:t=>e({evalSets:Object.fromEntries(t.map(n=>[n.id,n]))}),addEvalSet:t=>e(n=>({evalSets:{...n.evalSets,[t.id]:t}})),updateEvalSetEvaluators:(t,n)=>e(r=>{const s=r.evalSets[t];return s?{evalSets:{...r.evalSets,[t]:{...s,evaluator_ids:n}}}:r}),incrementEvalSetCount:(t,n=1)=>e(r=>{const s=r.evalSets[t];return s?{evalSets:{...r.evalSets,[t]:{...s,eval_count:s.eval_count+n}}}:r}),setEvalRuns:t=>e({evalRuns:Object.fromEntries(t.map(n=>[n.id,n]))}),upsertEvalRun:t=>e(n=>({evalRuns:{...n.evalRuns,[t.id]:t}})),updateEvalRunProgress:(t,n,r)=>e(s=>{const a=s.evalRuns[t];return a?{evalRuns:{...s.evalRuns,[t]:{...a,progress_completed:n,progress_total:r,status:"running"}}}:s}),completeEvalRun:(t,n,r)=>e(s=>{const a=s.evalRuns[t];return a?{evalRuns:{...s.evalRuns,[t]:{...a,status:"completed",overall_score:n,evaluator_scores:r,end_time:new Date().toISOString()}}}:s})}));let fc=0;function $t(){return`agent-msg-${++fc}`}const Be=Ot(e=>({sessionId:null,status:"idle",_lastActiveAt:null,messages:[],plan:[],activeQuestion:null,models:[],selectedModel:null,modelsLoading:!1,skills:[],selectedSkillIds:[],skillsLoading:!1,setStatus:t=>e(n=>{const r=n.status==="thinking"||n.status==="planning"||n.status==="executing"||n.status==="awaiting_approval";return{status:t,_lastActiveAt:r&&!(t==="thinking"||t==="planning"||t==="executing"||t==="awaiting_approval")?Date.now():n._lastActiveAt}}),addUserMessage:t=>e(n=>({messages:[...n.messages,{id:$t(),role:"user",content:t,timestamp:Date.now()}]})),appendAssistantText:(t,n)=>e(r=>{const s=[...r.messages],a=s[s.length-1];return a&&a.role==="assistant"&&!a.done?s[s.length-1]={...a,content:a.content+t,done:n}:s.push({id:$t(),role:"assistant",content:t,timestamp:Date.now(),done:n}),{messages:s}}),setPlan:t=>e(n=>{const r=[...n.messages],s=r.findIndex(o=>o.role==="plan"),a={id:s>=0?r[s].id:$t(),role:"plan",content:"",timestamp:Date.now(),planItems:t};return s>=0?r[s]=a:r.push(a),{messages:r,plan:t}}),addToolUse:(t,n)=>e(r=>{const s=[...r.messages],a=s[s.length-1],o={tool:t,args:n};return a&&a.role==="tool"&&a.toolCalls?s[s.length-1]={...a,toolCalls:[...a.toolCalls,o]}:s.push({id:$t(),role:"tool",content:"",timestamp:Date.now(),toolCalls:[o]}),{messages:s}}),addToolResult:(t,n,r)=>e(s=>{const a=[...s.messages];for(let o=a.length-1;o>=0;o--){const l=a[o];if(l.role==="tool"&&l.toolCalls){const c=[...l.toolCalls];for(let u=c.length-1;u>=0;u--)if(c[u].tool===t&&c[u].result===void 0)return c[u]={...c[u],result:n,is_error:r},a[o]={...l,toolCalls:c},{messages:a}}}return{messages:a}}),addToolApprovalRequest:(t,n,r)=>e(s=>{const a=[...s.messages];for(let c=a.length-1;c>=0;c--){const u=a[c];if(u.role==="tool"&&u.toolCalls){const d=[...u.toolCalls];for(let p=d.length-1;p>=0;p--)if(d[p].tool===n&&!d[p].status&&d[p].result===void 0)return d[p]={...d[p],tool_call_id:t,status:"pending"},a[c]={...u,toolCalls:d},{messages:a}}if(u.role!=="tool")break}const o={tool:n,args:r,tool_call_id:t,status:"pending"},l=a[a.length-1];return l&&l.role==="tool"&&l.toolCalls?a[a.length-1]={...l,toolCalls:[...l.toolCalls,o]}:a.push({id:$t(),role:"tool",content:"",timestamp:Date.now(),toolCalls:[o]}),{messages:a}}),resolveToolApproval:(t,n)=>e(r=>{const s=[...r.messages];for(let a=s.length-1;a>=0;a--){const o=s[a];if(o.role==="tool"&&o.toolCalls){const l=[...o.toolCalls];for(let c=l.length-1;c>=0;c--)if(l[c].tool_call_id===t)return l[c]={...l[c],status:n?"approved":"denied"},s[a]={...o,toolCalls:l},{messages:s}}}return{messages:s}}),appendThinking:t=>e(n=>{const r=[...n.messages],s=r[r.length-1];return s&&s.role==="thinking"?r[r.length-1]={...s,content:s.content+t}:r.push({id:$t(),role:"thinking",content:t,timestamp:Date.now()}),{messages:r}}),addError:t=>e(n=>({status:"error",messages:[...n.messages,{id:$t(),role:"assistant",content:`Error: ${t}`,timestamp:Date.now(),done:!0}]})),setActiveQuestion:t=>e({activeQuestion:t}),setSessionId:t=>{sessionStorage.setItem("agent_session_id",t),e({sessionId:t})},setModels:t=>e({models:t}),setSelectedModel:t=>e({selectedModel:t}),setModelsLoading:t=>e({modelsLoading:t}),setSkills:t=>e({skills:t}),setSelectedSkillIds:t=>e({selectedSkillIds:t}),toggleSkill:t=>e(n=>({selectedSkillIds:n.selectedSkillIds.includes(t)?n.selectedSkillIds.filter(s=>s!==t):[...n.selectedSkillIds,t]})),setSkillsLoading:t=>e({skillsLoading:t}),hydrateSession:t=>e({sessionId:t.session_id,status:t.status||"done",messages:t.messages,plan:t.plan,selectedModel:t.model||null}),clearSession:()=>{sessionStorage.removeItem("agent_session_id"),e({sessionId:null,status:"idle",_lastActiveAt:null,messages:[],plan:[],activeQuestion:null})}})),ge=Ot(e=>({children:{},expanded:{},selectedFile:null,openTabs:[],fileCache:{},dirty:{},buffers:{},loadingDirs:{},loadingFile:!1,agentChangedFiles:{},diffView:null,setChildren:(t,n)=>e(r=>({children:{...r.children,[t]:n}})),toggleExpanded:t=>e(n=>({expanded:{...n.expanded,[t]:!n.expanded[t]}})),setSelectedFile:t=>e({selectedFile:t}),openTab:t=>e(n=>({selectedFile:t,openTabs:n.openTabs.includes(t)?n.openTabs:[...n.openTabs,t]})),closeTab:t=>e(n=>{const r=n.openTabs.filter(u=>u!==t);let s=n.selectedFile;if(s===t){const u=n.openTabs.indexOf(t);s=r[Math.min(u,r.length-1)]??null}const{[t]:a,...o}=n.dirty,{[t]:l,...c}=n.buffers;return{openTabs:r,selectedFile:s,dirty:o,buffers:c}}),setFileContent:(t,n)=>e(r=>({fileCache:{...r.fileCache,[t]:n}})),updateBuffer:(t,n)=>e(r=>({buffers:{...r.buffers,[t]:n},dirty:{...r.dirty,[t]:!0}})),markClean:t=>e(n=>{const{[t]:r,...s}=n.dirty,{[t]:a,...o}=n.buffers;return{dirty:s,buffers:o}}),setLoadingDir:(t,n)=>e(r=>({loadingDirs:{...r.loadingDirs,[t]:n}})),setLoadingFile:t=>e({loadingFile:t}),markAgentChanged:t=>e(n=>({agentChangedFiles:{...n.agentChangedFiles,[t]:Date.now()}})),clearAgentChanged:t=>e(n=>{const{[t]:r,...s}=n.agentChangedFiles;return{agentChangedFiles:s}}),setDiffView:t=>e({diffView:t}),expandPath:t=>e(n=>{const r=t.split("/"),s={...n.expanded};for(let a=1;ae.current.onMessage(g=>{var v,y;switch(g.type){case"run.updated":t(g.payload);break;case"trace":n(g.payload);break;case"log":r(g.payload);break;case"chat":{const b=g.payload.run_id;s(b,g.payload);break}case"chat.interrupt":{const b=g.payload.run_id;a(b,g.payload);break}case"state":{const b=g.payload.run_id,C=g.payload.node_name,O=g.payload.qualified_node_name??null,L=g.payload.phase??null,N=g.payload.payload;C==="__start__"&&L==="started"&&c(b),L==="started"?o(b,C,O):L==="completed"&&l(b,C),u(b,C,N,O,L);break}case"reload":{g.payload.reloaded?rs().then(C=>{const O=ve.getState();O.setEntrypoints(C.map(L=>L.name)),O.setReloadPending(!1)}).catch(C=>console.error("Failed to refresh entrypoints:",C)):ve.getState().setReloadPending(!0);break}case"files.changed":{const b=g.payload.files,C=new Set(b),O=ge.getState(),L=Be.getState(),N=L.status,B=N==="thinking"||N==="planning"||N==="executing"||N==="awaiting_approval",D=!B&&L._lastActiveAt!=null&&Date.now()-L._lastActiveAt<3e3,R=b.filter(T=>T in O.children?!1:(T.split("/").pop()??"").includes("."));if(console.log("[files.changed]",{all:b,files:R,agentStatus:N,agentIsActive:B,recentlyActive:D}),B||D){let T=!1;for(const j of R){if(O.dirty[j])continue;const M=((v=O.fileCache[j])==null?void 0:v.content)??null,w=((y=O.fileCache[j])==null?void 0:y.language)??null;Fr(j).then(k=>{const I=ge.getState();if(I.dirty[j])return;I.setFileContent(j,k),I.expandPath(j);const W=j.split("/");for(let q=1;qge.getState().setChildren(h,F)).catch(()=>{})}const U=ge.getState().openTabs.includes(j);!T&&U&&M!==null&&k.content!==null&&M!==k.content&&(T=!0,ge.getState().setSelectedFile(j),I.setDiffView({path:j,original:M,modified:k.content,language:w}),setTimeout(()=>{const q=ge.getState().diffView;q&&q.path===j&&q.original===M&&ge.getState().setDiffView(null)},5e3)),I.markAgentChanged(j),setTimeout(()=>ge.getState().clearAgentChanged(j),1e4)}).catch(()=>{const k=ge.getState();k.openTabs.includes(j)&&k.closeTab(j)})}}else for(const T of O.openTabs)O.dirty[T]||!C.has(T)||Fr(T).then(j=>{var w;const M=ge.getState();M.dirty[T]||((w=M.fileCache[T])==null?void 0:w.content)!==j.content&&M.setFileContent(T,j)}).catch(()=>{});const S=new Set;for(const T of b){const j=T.lastIndexOf("/"),M=j===-1?"":T.substring(0,j);M in O.children&&S.add(M)}for(const T of S)Wn(T).then(j=>ge.getState().setChildren(T,j)).catch(()=>{});break}case"eval_run.created":d(g.payload);break;case"eval_run.progress":{const{run_id:b,completed:C,total:O,item_result:L}=g.payload;p(b,C,O,L);break}case"eval_run.completed":{const{run_id:b,overall_score:C,evaluator_scores:O}=g.payload;m(b,C,O);break}case"agent.status":{const{session_id:b,status:C}=g.payload,O=Be.getState();O.sessionId||O.setSessionId(b),O.setStatus(C),(C==="done"||C==="error"||C==="idle")&&O.setActiveQuestion(null);break}case"agent.text":{const{session_id:b,content:C,done:O}=g.payload,L=Be.getState();L.sessionId||L.setSessionId(b),L.appendAssistantText(C,O);break}case"agent.plan":{const{session_id:b,items:C}=g.payload,O=Be.getState();O.sessionId||O.setSessionId(b),O.setPlan(C);break}case"agent.tool_use":{const{session_id:b,tool:C,args:O}=g.payload,L=Be.getState();L.sessionId||L.setSessionId(b),L.addToolUse(C,O);break}case"agent.tool_result":{const{tool:b,result:C,is_error:O}=g.payload;Be.getState().addToolResult(b,C,O);break}case"agent.tool_approval":{const{session_id:b,tool_call_id:C,tool:O,args:L}=g.payload,N=Be.getState();N.sessionId||N.setSessionId(b),N.addToolApprovalRequest(C,O,L);break}case"agent.thinking":{const{content:b}=g.payload;Be.getState().appendThinking(b);break}case"agent.text_delta":{const{session_id:b,delta:C}=g.payload,O=Be.getState();O.sessionId||O.setSessionId(b),O.appendAssistantText(C,!1);break}case"agent.question":{const{session_id:b,question_id:C,question:O,options:L}=g.payload,N=Be.getState();N.sessionId||N.setSessionId(b),N.setActiveQuestion({question_id:C,question:O,options:L});break}case"agent.token_usage":break;case"agent.error":{const{message:b}=g.payload;Be.getState().addError(b);break}}}),[t,n,r,s,a,o,l,c,u,d,p,m]),e.current}function gc(e){const t=e.replace(/^#\/?/,""),n={section:"debug",view:"new",runId:null,tab:"traces",setupEntrypoint:null,setupMode:null,evalCreating:!1,evalSetId:null,evalRunId:null,evalRunItemName:null,evaluatorId:null,evaluatorCreateType:null,evaluatorFilter:null,explorerFile:null};if(!t||t==="new"||t==="debug"||t==="debug/new")return n;const r=t.match(/^(?:debug\/)?setup\/([^/]+)\/(run|chat)$/);if(r)return{...n,view:"setup",setupEntrypoint:decodeURIComponent(r[1]),setupMode:r[2]};const s=t.match(/^(?:debug\/)?runs\/([^/]+)(?:\/(traces|output))?$/);if(s)return{...n,view:"details",runId:s[1],tab:s[2]??"traces"};if(t==="evals/new")return{...n,section:"evals",evalCreating:!0};const a=t.match(/^evals\/runs\/([^/]+?)(?:\/([^/]+))?$/);if(a)return{...n,section:"evals",evalRunId:a[1],evalRunItemName:a[2]?decodeURIComponent(a[2]):null};const o=t.match(/^evals\/sets\/([^/]+)$/);if(o)return{...n,section:"evals",evalSetId:o[1]};if(t==="evals")return{...n,section:"evals"};const l=t.match(/^evaluators\/new(?:\/(deterministic|llm|tool))?$/);if(l)return{...n,section:"evaluators",evaluatorCreateType:l[1]??"any"};const c=t.match(/^evaluators\/category\/(deterministic|llm|tool)$/);if(c)return{...n,section:"evaluators",evaluatorFilter:c[1]};const u=t.match(/^evaluators\/([^/]+)$/);if(u)return{...n,section:"evaluators",evaluatorId:u[1]};if(t==="evaluators")return{...n,section:"evaluators"};const d=t.match(/^explorer\/file\/(.+)$/);return d?{...n,section:"explorer",explorerFile:decodeURIComponent(d[1])}:t==="explorer"?{...n,section:"explorer"}:n}function xc(){return window.location.hash}function bc(e){return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)}function it(){const e=_.useSyncExternalStore(bc,xc),t=gc(e),n=_.useCallback(r=>{window.location.hash=r},[]);return{...t,navigate:n}}const Us="(max-width: 767px)";function yc(){const[e,t]=_.useState(()=>window.matchMedia(Us).matches);return _.useEffect(()=>{const n=window.matchMedia(Us),r=s=>t(s.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const vc=[{section:"debug",label:"Developer Console",icon:i.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("rect",{x:"8",y:"6",width:"8",height:"14",rx:"4"}),i.jsx("path",{d:"M6 10H4"}),i.jsx("path",{d:"M6 18H4"}),i.jsx("path",{d:"M18 10h2"}),i.jsx("path",{d:"M18 18h2"}),i.jsx("path",{d:"M8 14h8"}),i.jsx("path",{d:"M9 6l-1.5-2"}),i.jsx("path",{d:"M15 6l1.5-2"}),i.jsx("path",{d:"M6 14H4"}),i.jsx("path",{d:"M18 14h2"})]})},{section:"evals",label:"Evals",icon:i.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M9 3h6"}),i.jsx("path",{d:"M10 3v6.5L5 20a1 1 0 0 0 .9 1.4h12.2a1 1 0 0 0 .9-1.4L14 9.5V3"}),i.jsx("path",{d:"M8.5 14h7"})]})},{section:"evaluators",label:"Evaluators",icon:i.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M12 2l7 4v5c0 5.25-3.5 9.74-7 11-3.5-1.26-7-5.75-7-11V6l7-4z"}),i.jsx("path",{d:"M9 12l2 2 4-4"})]})},{section:"explorer",label:"Explorer",icon:i.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:i.jsx("path",{d:"M7.5 22.5H17.595C17.07 23.4 16.11 24 15 24H7.5C4.185 24 1.5 21.315 1.5 18V6C1.5 4.89 2.1 3.93 3 3.405V18C3 20.475 5.025 22.5 7.5 22.5ZM21 8.121V18C21 19.6545 19.6545 21 18 21H7.5C5.8455 21 4.5 19.6545 4.5 18V3C4.5 1.3455 5.8455 0 7.5 0H12.879C13.4715 0 14.0505 0.24 14.4705 0.6585L20.3415 6.5295C20.766 6.954 21 7.5195 21 8.121ZM13.5 6.75C13.5 7.164 13.8375 7.5 14.25 7.5H19.1895L13.5 1.8105V6.75ZM19.5 18V9H14.25C13.0095 9 12 7.9905 12 6.75V1.5H7.5C6.672 1.5 6 2.1735 6 3V18C6 18.8265 6.672 19.5 7.5 19.5H18C18.828 19.5 19.5 18.8265 19.5 18Z"})})}];function kc({section:e,onSectionChange:t}){return i.jsx("div",{className:"w-12 flex flex-col items-center shrink-0 border-r",style:{background:"var(--activity-bar-bg)",borderColor:"var(--border)"},children:i.jsx("div",{className:"flex flex-col items-center gap-1 pt-2",children:vc.map(n=>{const r=e===n.section;return i.jsxs("button",{onClick:()=>t(n.section),className:"w-10 h-10 flex items-center justify-center rounded cursor-pointer transition-colors relative",style:{color:r?"var(--text-primary)":"var(--text-muted)",background:r?"var(--bg-hover)":"transparent",border:"none"},title:n.label,onMouseEnter:s=>{r||(s.currentTarget.style.color="var(--text-secondary)")},onMouseLeave:s=>{r||(s.currentTarget.style.color="var(--text-muted)")},children:[r&&i.jsx("div",{className:"absolute left-0 top-1.5 bottom-1.5 w-0.5 rounded-r",style:{background:"var(--accent)"}}),n.icon]},n.section)})})})}const tt="/api";async function nt(e,t){const n=await fetch(e,t);if(!n.ok){let r;try{r=(await n.json()).detail||n.statusText}catch{r=n.statusText}const s=new Error(`HTTP ${n.status}`);throw s.detail=r,s.status=n.status,s}return n.json()}async function Ec(){return nt(`${tt}/evaluators`)}async function Ii(){return nt(`${tt}/eval-sets`)}async function wc(e){return nt(`${tt}/eval-sets`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function _c(e,t){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}/items`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async function Nc(e,t){await nt(`${tt}/eval-sets/${encodeURIComponent(e)}/items/${encodeURIComponent(t)}`,{method:"DELETE"})}async function Sc(e){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}`)}async function Tc(e){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}/runs`,{method:"POST"})}async function Cc(){return nt(`${tt}/eval-runs`)}async function Hs(e){return nt(`${tt}/eval-runs/${encodeURIComponent(e)}`)}async function is(){return nt(`${tt}/local-evaluators`)}async function Ac(e){return nt(`${tt}/local-evaluators`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function Mc(e,t){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}/evaluators`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({evaluator_refs:t})})}async function Ic(e,t){return nt(`${tt}/local-evaluators/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}const Rc={"uipath-exact-match":e=>({expectedOutput:e}),"uipath-json-similarity":e=>({expectedOutput:e}),"uipath-contains":()=>({searchText:""}),"uipath-llm-judge-output-semantic-similarity":e=>({expectedOutput:e}),"uipath-llm-judge-output-strict-json-similarity":e=>({expectedOutput:e}),"uipath-llm-judge-trajectory-similarity":()=>({expectedAgentBehavior:""}),"uipath-llm-judge-trajectory-simulation":()=>({expectedAgentBehavior:""}),"uipath-tool-call-count":()=>({}),"uipath-tool-call-args":()=>({}),"uipath-tool-call-order":()=>({}),"uipath-tool-call-output":()=>({})};function Oc(e,t){if(!e)return{};const n=Rc[e.evaluator_type_id];return n?n(t):e.type==="tool"?{}:e.evaluator_type_id.includes("trajectory")?{expectedAgentBehavior:""}:{expectedOutput:t}}function Ri(e){return e?e.type==="tool"?!0:e.evaluator_type_id.includes("tool-call"):!1}function jc(e){return e?Ri(e)?{label:"tools",color:"var(--warning, #e5a00d)"}:e.evaluator_type_id.includes("trajectory")?{label:"quality",color:"var(--info, #3b82f6)"}:{label:"output",color:"var(--success, #22c55e)"}:{label:"output",color:"var(--success, #22c55e)"}}function Lc({run:e,onClose:t}){const n=Me(R=>R.evalSets),r=Me(R=>R.setEvalSets),s=Me(R=>R.incrementEvalSetCount),a=Me(R=>R.localEvaluators),o=Me(R=>R.setLocalEvaluators),[l,c]=_.useState(`run-${e.id.slice(0,8)}`),[u,d]=_.useState(new Set),[p,m]=_.useState({}),f=_.useRef(new Set),[x,g]=_.useState(!1),[v,y]=_.useState(null),[b,C]=_.useState(!1),O=Object.values(n),L=_.useMemo(()=>Object.fromEntries(a.map(R=>[R.id,R])),[a]),N=_.useMemo(()=>{const R=new Set;for(const S of u){const T=n[S];T&&T.evaluator_ids.forEach(j=>R.add(j))}return[...R]},[u,n]);_.useEffect(()=>{const R=e.output_data,S=f.current;m(T=>{const j={};for(const M of N)if(S.has(M)&&T[M]!==void 0)j[M]=T[M];else{const w=L[M],k=Oc(w,R);j[M]=JSON.stringify(k,null,2)}return j})},[N,L,e.output_data]),_.useEffect(()=>{const R=S=>{S.key==="Escape"&&t()};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[t]),_.useEffect(()=>{O.length===0&&Ii().then(r).catch(()=>{}),a.length===0&&is().then(o).catch(()=>{})},[]);const B=R=>{d(S=>{const T=new Set(S);return T.has(R)?T.delete(R):T.add(R),T})},D=async()=>{var S;if(!l.trim()||u.size===0)return;y(null),g(!0);const R={};for(const T of N){const j=p[T];if(j!==void 0)try{R[T]=JSON.parse(j)}catch{y(`Invalid JSON for evaluator "${((S=L[T])==null?void 0:S.name)??T}"`),g(!1);return}}try{for(const T of u){const j=n[T],M=new Set((j==null?void 0:j.evaluator_ids)??[]),w={};for(const[k,I]of Object.entries(R))M.has(k)&&(w[k]=I);await _c(T,{name:l.trim(),inputs:e.input_data,expected_output:null,evaluation_criterias:w}),s(T)}C(!0),setTimeout(t,3e3)}catch(T){y(T.detail||T.message||"Failed to add item")}finally{g(!1)}};return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.5)"},onClick:R=>{R.target===R.currentTarget&&t()},children:i.jsxs("div",{className:"w-full max-w-2xl rounded-lg p-6 shadow-xl max-h-[85vh] flex flex-col",style:{background:"var(--bg-primary)",border:"1px solid var(--border)"},children:[i.jsxs("div",{className:"flex items-center justify-between mb-6",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}}),i.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"Add to Eval Set"})]}),i.jsx("button",{onClick:t,className:"w-7 h-7 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:R=>{R.currentTarget.style.color="var(--text-primary)"},onMouseLeave:R=>{R.currentTarget.style.color="var(--text-muted)"},"aria-label":"Close",children:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[i.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),i.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0 space-y-4 pr-1",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Item Name"}),i.jsx("input",{type:"text",value:l,onChange:R=>c(R.target.value),className:"w-full rounded-md px-3 py-2 text-xs",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"}})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Inputs"}),i.jsx("pre",{className:"rounded-md px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words max-h-32 overflow-y-auto",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:JSON.stringify(e.input_data,null,2)})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Eval Sets"}),O.length===0?i.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"No eval sets found. Create one first."}):i.jsx("div",{className:"rounded-md border overflow-hidden max-h-40 overflow-y-auto",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:O.map(R=>i.jsxs("label",{className:"flex items-center gap-2.5 px-3 py-2 text-xs cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--border)"},onMouseEnter:S=>{S.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:S=>{S.currentTarget.style.background="transparent"},children:[i.jsx("input",{type:"checkbox",checked:u.has(R.id),onChange:()=>B(R.id),className:"accent-[var(--accent)]"}),i.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:R.name}),i.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:[R.eval_count," items"]})]},R.id))})]}),N.length>0&&i.jsxs("div",{children:[i.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Evaluation Criteria"}),i.jsx("div",{className:"space-y-2",children:N.map(R=>{const S=L[R],T=Ri(S),j=jc(S);return i.jsxs("div",{className:"rounded-md",style:{border:"1px solid var(--border)",background:"var(--bg-primary)",opacity:T?.6:1},children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{borderBottom:T?"none":"1px solid var(--border)"},children:[i.jsx("span",{className:"text-xs font-medium truncate flex-1",style:{color:"var(--text-primary)"},children:(S==null?void 0:S.name)??R}),i.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full font-medium",style:{color:j.color,background:`color-mix(in srgb, ${j.color} 12%, transparent)`},children:j.label})]}),T?i.jsx("div",{className:"px-3 pb-2",children:i.jsx("span",{className:"text-[10px] italic",style:{color:"var(--text-muted)"},children:"Default criteria — uses evaluator config"})}):i.jsx("div",{className:"px-3 pb-2 pt-1",children:i.jsx("textarea",{value:p[R]??"{}",onChange:M=>{f.current.add(R),m(w=>({...w,[R]:M.target.value}))},rows:8,className:"w-full rounded px-2 py-1.5 text-xs font-mono resize-y",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"}})})]},R)})})]})]}),i.jsxs("div",{className:"mt-4 space-y-3",children:[v&&i.jsx("p",{className:"text-xs px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:v}),b&&i.jsxs("p",{className:"text-xs px-3 py-2 rounded",style:{color:"var(--success)",background:"color-mix(in srgb, var(--success) 10%, var(--bg-secondary))"},children:["Added to ",u.size," eval set",u.size!==1?"s":"","."]}),i.jsxs("div",{className:"flex gap-2",children:[i.jsx("button",{onClick:t,className:"flex-1 py-2 rounded-md text-xs font-semibold cursor-pointer",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)",border:"1px solid var(--border)"},children:"Cancel"}),i.jsx("button",{onClick:D,disabled:!l.trim()||u.size===0||x||b,className:"flex-1 py-2 rounded-md text-[13px] font-semibold transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},children:x?"Adding...":b?"Added":"Add Item"})]})]})]})})}const Dc={pending:"var(--text-muted)",running:"var(--warning)",suspended:"var(--info)",completed:"var(--success)",failed:"var(--error)"};function Pc({run:e,isSelected:t,onClick:n}){var p;const r=Dc[e.status]??"var(--text-muted)",s=((p=e.entrypoint.split("/").pop())==null?void 0:p.slice(0,16))??e.entrypoint,a=e.start_time?new Date(e.start_time).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"",[o,l]=_.useState(!1),[c,u]=_.useState(!1),d=_.useRef(null);return _.useEffect(()=>{if(!o)return;const m=f=>{d.current&&!d.current.contains(f.target)&&l(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[o]),i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"group relative w-full text-left px-3 py-1.5 flex items-center gap-2 transition-colors cursor-pointer",style:{background:t?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":void 0,borderLeft:t?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:m=>{t||(m.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:m=>{t||(m.currentTarget.style.background="")},onClick:n,children:[i.jsx("span",{className:"shrink-0 w-2 h-2 rounded-full",style:{background:r}}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"text-xs truncate",style:{color:t?"var(--text-primary)":"var(--text-secondary)"},children:s}),i.jsxs("div",{className:"text-[11px] tabular-nums",style:{color:"var(--text-muted)"},children:[a,e.duration?` · ${e.duration}`:""]})]}),e.status==="completed"&&i.jsxs("div",{ref:d,className:"relative shrink-0",children:[i.jsx("button",{onClick:m=>{m.stopPropagation(),l(f=>!f)},className:"opacity-40 group-hover:opacity-100 focus:opacity-100 w-7 h-7 flex items-center justify-center rounded transition-opacity cursor-pointer",style:{color:"var(--text-muted)"},onMouseEnter:m=>{m.currentTarget.style.color="var(--text-primary)",m.currentTarget.style.background="var(--bg-secondary)"},onMouseLeave:m=>{m.currentTarget.style.color="var(--text-muted)",m.currentTarget.style.background=""},"aria-label":"Actions",title:"Actions",children:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[i.jsx("circle",{cx:"8",cy:"3",r:"1.5"}),i.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),i.jsx("circle",{cx:"8",cy:"13",r:"1.5"})]})}),o&&i.jsx("div",{className:"absolute right-0 top-full mt-1 z-50 min-w-[140px] rounded-md shadow-lg py-1",style:{background:"var(--bg-primary)",border:"1px solid var(--border)"},children:i.jsx("button",{onClick:m=>{m.stopPropagation(),l(!1),u(!0)},className:"w-full text-left px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{color:"var(--text-secondary)"},onMouseEnter:m=>{m.currentTarget.style.background="var(--bg-hover)",m.currentTarget.style.color="var(--text-primary)"},onMouseLeave:m=>{m.currentTarget.style.background="",m.currentTarget.style.color="var(--text-secondary)"},children:"Add to Eval Set"})})]})]}),c&&i.jsx(Lc,{run:e,onClose:()=>u(!1)})]})}function Ws({runs:e,selectedRunId:t,onSelectRun:n,onNewRun:r}){const s=[...e].sort((a,o)=>new Date(o.start_time??0).getTime()-new Date(a.start_time??0).getTime());return i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:r,className:"mx-3 mt-2.5 mb-1 px-3 py-1.5 text-[11px] font-medium rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-secondary)"},onMouseEnter:a=>{a.currentTarget.style.color="var(--text-primary)",a.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:a=>{a.currentTarget.style.color="var(--text-secondary)",a.currentTarget.style.borderColor=""},children:"+ New Run"}),i.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"History"}),i.jsxs("div",{className:"flex-1 overflow-y-auto",children:[s.map(a=>i.jsx(Pc,{run:a,isSelected:a.id===t,onClick:()=>n(a.id)},a.id)),s.length===0&&i.jsx("p",{className:"text-xs px-3 py-4 text-center",style:{color:"var(--text-muted)"},children:"No runs yet"})]})]})}function Oi(){const e=localStorage.getItem("uipath-dev-theme");return e==="light"||e==="dark"?e:"dark"}function ji(e){document.documentElement.setAttribute("data-theme",e),localStorage.setItem("uipath-dev-theme",e)}ji(Oi());const Li=Ot(e=>({theme:Oi(),toggleTheme:()=>e(t=>{const n=t.theme==="dark"?"light":"dark";return ji(n),{theme:n}})}));function Ks(){const{theme:e,toggleTheme:t}=Li(),{enabled:n,status:r,environment:s,tenants:a,uipathUrl:o,setEnvironment:l,startLogin:c,selectTenant:u,logout:d}=Hn(),{projectName:p,projectVersion:m,projectAuthors:f}=Mi(),[x,g]=_.useState(!1),[v,y]=_.useState(""),b=_.useRef(null),C=_.useRef(null);_.useEffect(()=>{if(!x)return;const w=k=>{b.current&&!b.current.contains(k.target)&&C.current&&!C.current.contains(k.target)&&g(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[x]);const O=r==="authenticated",L=r==="expired",N=r==="pending",B=r==="needs_tenant";let D="UiPath: Disconnected",R=null,S=!0;O?(D=`UiPath: ${o?o.replace(/^https?:\/\/[^/]+\//,""):""}`,R="var(--success)",S=!1):L?(D=`UiPath: ${o?o.replace(/^https?:\/\/[^/]+\//,""):""} (expired)`,R="var(--error)",S=!1):N?D="UiPath: Signing in…":B&&(D="UiPath: Select Tenant");const T=()=>{N||(L?c():g(w=>!w))},j="flex items-center gap-1 px-1.5 rounded transition-colors",M={onMouseEnter:w=>{w.currentTarget.style.background="var(--bg-hover)",w.currentTarget.style.color="var(--text-primary)"},onMouseLeave:w=>{w.currentTarget.style.background="",w.currentTarget.style.color="var(--text-muted)"}};return i.jsxs("div",{className:"h-6 flex items-center justify-end gap-3 px-2 text-xs border-t shrink-0",style:{background:"var(--bg-secondary)",color:"var(--text-muted)",borderColor:"var(--border)",fontSize:"11px"},children:[n&&i.jsxs("div",{className:"relative flex items-center",children:[i.jsxs("div",{ref:C,className:`${j} cursor-pointer`,onClick:T,...M,title:O?o??"":L?"Token expired — click to re-authenticate":N?"Signing in…":B?"Select a tenant":"Click to sign in",children:[N?i.jsxs("svg",{className:"animate-spin",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[i.jsx("circle",{cx:"12",cy:"12",r:"10",strokeOpacity:"0.25"}),i.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",strokeLinecap:"round"})]}):R?i.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:R}}):S?i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),i.jsx("path",{d:"M7 11V7a5 5 0 0 1 9.9-1"})]}):null,i.jsx("span",{className:"truncate max-w-[200px]",children:D})]}),x&&i.jsx("div",{ref:b,className:"absolute bottom-full right-0 mb-1 rounded border shadow-lg p-1 min-w-[180px]",style:{background:"var(--bg-secondary)",borderColor:"var(--border)"},children:O||L?i.jsxs(i.Fragment,{children:[i.jsxs("button",{onClick:()=>{o&&window.open(o,"_blank","noopener,noreferrer"),g(!1)},className:"w-full flex items-center gap-2 px-2 py-2 text-[11px] rounded cursor-pointer transition-colors text-left",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:w=>{w.currentTarget.style.background="var(--bg-hover)",w.currentTarget.style.color="var(--text-primary)"},onMouseLeave:w=>{w.currentTarget.style.background="transparent",w.currentTarget.style.color="var(--text-muted)"},children:[i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),i.jsx("polyline",{points:"15 3 21 3 21 9"}),i.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),"Go to Platform"]}),i.jsxs("button",{onClick:()=>{d(),g(!1)},className:"w-full flex items-center gap-2 px-2 py-2 text-[11px] rounded cursor-pointer transition-colors text-left",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:w=>{w.currentTarget.style.background="var(--bg-hover)",w.currentTarget.style.color="var(--text-primary)"},onMouseLeave:w=>{w.currentTarget.style.background="transparent",w.currentTarget.style.color="var(--text-muted)"},children:[i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),i.jsx("polyline",{points:"16 17 21 12 16 7"}),i.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}),"Sign Out"]})]}):B?i.jsxs("div",{className:"p-1",children:[i.jsx("label",{className:"block text-[10px] font-medium mb-1",style:{color:"var(--text-muted)"},children:"Tenant"}),i.jsxs("select",{value:v,onChange:w=>y(w.target.value),className:"w-full rounded px-1.5 py-1 text-[10px] mb-1.5 appearance-auto",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-primary)"},children:[i.jsx("option",{value:"",children:"Select…"}),a.map(w=>i.jsx("option",{value:w,children:w},w))]}),i.jsx("button",{onClick:()=>{v&&(u(v),g(!1))},disabled:!v,className:"w-full px-2 py-1 text-[10px] font-medium rounded border border-[var(--border)] bg-transparent cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--text-muted)"},children:"Confirm"})]}):i.jsxs("div",{className:"p-1",children:[i.jsx("label",{className:"block text-[10px] font-medium mb-1",style:{color:"var(--text-muted)"},children:"Environment"}),i.jsxs("select",{value:s,onChange:w=>l(w.target.value),className:"w-full rounded px-1.5 py-0.5 text-[10px] mb-1.5 appearance-auto",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-muted)"},children:[i.jsx("option",{value:"cloud",children:"cloud"}),i.jsx("option",{value:"staging",children:"staging"}),i.jsx("option",{value:"alpha",children:"alpha"})]}),i.jsx("button",{onClick:()=>{c(),g(!1)},className:"w-full px-2 py-1 text-[10px] font-medium rounded border border-[var(--border)] bg-transparent cursor-pointer transition-colors",style:{color:"var(--text-muted)"},onMouseEnter:w=>{w.currentTarget.style.color="var(--text-primary)",w.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:w=>{w.currentTarget.style.color="var(--text-muted)",w.currentTarget.style.borderColor="var(--border)"},children:"Sign In"})]})})]}),p&&i.jsxs("span",{className:j,children:["Project: ",p]}),m&&i.jsxs("span",{className:j,children:["Version: v",m]}),f&&i.jsxs("span",{className:j,children:["Author: ",f]}),i.jsxs("a",{href:"https://github.com/UiPath/uipath-dev-python",target:"_blank",rel:"noopener noreferrer",className:`${j} cursor-pointer no-underline`,style:{color:"var(--text-muted)"},...M,title:"View on GitHub",children:[i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:i.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})}),i.jsx("span",{children:"uipath-dev-python"})]}),i.jsxs("div",{className:`${j} cursor-pointer`,onClick:t,...M,title:`Switch to ${e==="dark"?"light":"dark"} theme`,children:[i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e==="dark"?i.jsxs(i.Fragment,{children:[i.jsx("circle",{cx:"12",cy:"12",r:"5"}),i.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),i.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),i.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),i.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),i.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),i.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),i.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),i.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}):i.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),i.jsx("span",{children:e==="dark"?"Dark":"Light"})]})]})}function Bc(){const{navigate:e}=it(),t=ve(u=>u.entrypoints),[n,r]=_.useState(""),[s,a]=_.useState(!0),[o,l]=_.useState(null);_.useEffect(()=>{!n&&t.length>0&&r(t[0])},[t,n]),_.useEffect(()=>{n&&(a(!0),l(null),lc(n).then(u=>{var p;const d=(p=u.input)==null?void 0:p.properties;a(!!(d!=null&&d.messages))}).catch(u=>{const d=u.detail||{};l(d.error||d.message||`Failed to load entrypoint "${n}"`)}))},[n]);const c=u=>{n&&e(`#/setup/${encodeURIComponent(n)}/${u}`)};return i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsxs("div",{className:"w-full max-w-xl px-6",children:[i.jsxs("div",{className:"mb-8 text-center",children:[i.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[i.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:o?"var(--error)":"var(--accent)"}}),i.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"New Run"})]}),!o&&i.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:t.length>1?"Select an entrypoint and choose a mode":"Choose a mode"})]}),t.length>1&&i.jsxs("div",{className:"mb-8",children:[i.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Entrypoint"}),i.jsx("select",{id:"entrypoint-select",value:n,onChange:u=>r(u.target.value),className:"w-full rounded-md px-3 py-2 text-xs font-mono cursor-pointer appearance-auto",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},children:t.map(u=>i.jsx("option",{value:u,children:u},u))})]}),o?i.jsxs("div",{className:"rounded-md border overflow-hidden",style:{borderColor:"color-mix(in srgb, var(--error) 25%, var(--border))",background:"var(--bg-secondary)"},children:[i.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{borderBottom:"1px solid color-mix(in srgb, var(--error) 15%, var(--border))",background:"color-mix(in srgb, var(--error) 4%, var(--bg-secondary))"},children:[i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0},children:i.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM7.25 4.75h1.5v4h-1.5v-4zm.75 6.75a.75.75 0 110-1.5.75.75 0 010 1.5z",fill:"var(--error)"})}),i.jsx("span",{className:"text-[11px] font-medium",style:{color:"var(--error)"},children:"Failed to load entrypoint"})]}),i.jsx("div",{className:"overflow-auto max-h-48 p-3",children:i.jsx("pre",{className:"text-[11px] font-mono whitespace-pre-wrap break-words leading-relaxed m-0",style:{color:"var(--text-muted)"},children:o})})]}):i.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[i.jsx(Gs,{title:"Autonomous",description:"Run the agent end-to-end. Set breakpoints to pause and inspect execution.",icon:i.jsx(Fc,{}),color:"var(--success)",onClick:()=>c("run"),disabled:!n}),i.jsx(Gs,{title:"Conversational",description:s?"Interactive chat session. Send messages and receive responses in real time.":'Requires a "messages" property in the input schema.',icon:i.jsx(zc,{}),color:"var(--accent)",onClick:()=>c("chat"),disabled:!n||!s})]})]})})}function Gs({title:e,description:t,icon:n,color:r,onClick:s,disabled:a}){return i.jsxs("button",{onClick:s,disabled:a,className:"group flex flex-col items-center text-center p-6 rounded-md border transition-all cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--bg-secondary)",borderColor:"var(--border)"},onMouseEnter:o=>{a||(o.currentTarget.style.borderColor=r,o.currentTarget.style.background=`color-mix(in srgb, ${r} 5%, var(--bg-secondary))`)},onMouseLeave:o=>{o.currentTarget.style.borderColor="var(--border)",o.currentTarget.style.background="var(--bg-secondary)"},children:[i.jsx("div",{className:"mb-4 p-3 rounded-xl transition-colors",style:{background:`color-mix(in srgb, ${r} 10%, var(--bg-primary))`,color:r},children:n}),i.jsx("h3",{className:"text-sm font-semibold mb-1.5",style:{color:"var(--text-primary)"},children:e}),i.jsx("p",{className:"text-xs leading-relaxed",style:{color:"var(--text-muted)"},children:t})]})}function Fc(){return i.jsx("svg",{width:"28",height:"28",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:i.jsx("path",{d:"M23.832 15.166H22.7487C22.7487 10.9735 19.3579 7.58268 15.1654 7.58268H14.082V6.20685C14.732 5.83852 15.1654 5.13435 15.1654 4.33268C15.1654 3.14102 14.2012 2.16602 12.9987 2.16602C11.7962 2.16602 10.832 3.14102 10.832 4.33268C10.832 5.13435 11.2654 5.83852 11.9154 6.20685V7.58268H10.832C6.63953 7.58268 3.2487 10.9735 3.2487 15.166H2.16536C1.56953 15.166 1.08203 15.6535 1.08203 16.2493V19.4993C1.08203 20.0952 1.56953 20.5827 2.16536 20.5827H3.2487V21.666C3.2487 22.8685 4.2237 23.8327 5.41536 23.8327H20.582C21.7845 23.8327 22.7487 22.8685 22.7487 21.666V20.5827H23.832C24.4279 20.5827 24.9154 20.0952 24.9154 19.4993V16.2493C24.9154 15.6535 24.4279 15.166 23.832 15.166ZM22.7487 18.416H20.582V21.666H5.41536V18.416H3.2487V17.3327H5.41536V15.166C5.41536 12.176 7.84203 9.74935 10.832 9.74935H15.1654C18.1554 9.74935 20.582 12.176 20.582 15.166V17.3327H22.7487V18.416ZM9.20703 14.6243L11.7637 17.181L10.4854 18.4594L9.20703 17.181L7.9287 18.4594L6.65036 17.181L9.20703 14.6243ZM16.7904 14.6243L19.347 17.181L18.0687 18.4594L16.7904 17.181L15.512 18.4594L14.2337 17.181L16.7904 14.6243Z",fill:"currentColor"})})}function zc(){return i.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("path",{d:"M9.20901 13.541L11.7657 16.0977L10.4873 17.376L9.20901 16.0977L7.93068 17.376L6.65234 16.0977L9.20901 13.541ZM16.7923 13.541L19.349 16.0977L18.0707 17.376L16.7923 16.0977L15.514 17.376L14.2357 16.0977L16.7923 13.541Z",fill:"currentColor"}),i.jsx("path",{d:"M5.25 8.58398H20.75C21.3023 8.58398 21.75 9.0317 21.75 9.58398V23.5293L16.874 21.9043C16.5683 21.8024 16.248 21.751 15.9258 21.751H5.25C4.69782 21.751 4.25018 21.3031 4.25 20.751V9.58398C4.25 9.0317 4.69772 8.58398 5.25 8.58398Z",stroke:"currentColor",strokeWidth:"2"}),i.jsx("ellipse",{cx:"12.9987",cy:"4.33268",rx:"2.16667",ry:"2.16667",fill:"currentColor"}),i.jsx("rect",{x:"11.918",y:"5.41602",width:"2.16667",height:"2.16667",fill:"currentColor"}),i.jsx("path",{d:"M1.08203 14C1.08203 13.4477 1.52975 13 2.08203 13H3.2487V18.4167H2.08203C1.52975 18.4167 1.08203 17.969 1.08203 17.4167V14Z",fill:"currentColor"}),i.jsx("rect",{x:"3.25",y:"15.166",width:"2.16667",height:"1.08333",fill:"currentColor"}),i.jsx("path",{d:"M22.75 13H23.9167C24.4689 13 24.9167 13.4477 24.9167 14V17.4167C24.9167 17.969 24.469 18.4167 23.9167 18.4167H22.75V13Z",fill:"currentColor"}),i.jsx("rect",{x:"20.582",y:"15.166",width:"2.16667",height:"1.08333",fill:"currentColor"})]})}const $c="modulepreload",Uc=function(e){return"/"+e},qs={},Di=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let o=function(u){return Promise.all(u.map(d=>Promise.resolve(d).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=o(n.map(u=>{if(u=Uc(u),u in qs)return;qs[u]=!0;const d=u.endsWith(".css"),p=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${p}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":$c,d||(m.as="script"),m.crossOrigin="",m.href=u,c&&m.setAttribute("nonce",c),document.head.appendChild(m),d)return new Promise((f,x)=>{m.addEventListener("load",f),m.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${u}`)))})}))}function a(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})},Hc={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Wc({data:e}){const t=e.status,n=e.nodeWidth,r=e.label??"Start",s=e.hasBreakpoint,a=e.isPausedHere,o=e.isActiveNode,l=e.isExecutingNode,c=a?"var(--error)":l?"var(--success)":o?"var(--accent)":t==="completed"?"var(--success)":t==="running"?"var(--warning)":"var(--node-border)",u=a?"var(--error)":l?"var(--success)":"var(--accent)";return i.jsxs("div",{className:"px-3 py-1.5 rounded-full text-center text-xs overflow-hidden text-ellipsis whitespace-nowrap cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${c}`,boxShadow:a||o||l?`0 0 4px ${u}`:void 0,animation:a||o||l?`node-pulse-${a?"red":l?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r,children:[s&&i.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),r,i.jsx(gt,{type:"source",position:xt.Bottom,style:Hc})]})}const Kc={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Gc({data:e}){const t=e.status,n=e.nodeWidth,r=e.label??"End",s=e.hasBreakpoint,a=e.isPausedHere,o=e.isActiveNode,l=e.isExecutingNode,c=a?"var(--error)":l?"var(--success)":o?"var(--accent)":t==="completed"?"var(--success)":t==="failed"?"var(--error)":"var(--node-border)",u=a?"var(--error)":l?"var(--success)":"var(--accent)";return i.jsxs("div",{className:"px-3 py-1.5 rounded-full text-center text-xs overflow-hidden text-ellipsis whitespace-nowrap cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${c}`,boxShadow:a||o||l?`0 0 4px ${u}`:void 0,animation:a||o||l?`node-pulse-${a?"red":l?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r,children:[s&&i.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),i.jsx(gt,{type:"target",position:xt.Top,style:Kc}),r]})}const Vs={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function qc({data:e}){const t=e.status,n=e.nodeWidth,r=e.model_name,s=e.label??"Model",a=e.hasBreakpoint,o=e.isPausedHere,l=e.isActiveNode,c=e.isExecutingNode,u=o?"var(--error)":c?"var(--success)":l?"var(--accent)":t==="completed"?"var(--success)":t==="running"?"var(--warning)":t==="failed"?"var(--error)":"var(--node-border)",d=o?"var(--error)":c?"var(--success)":"var(--accent)";return i.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${u}`,boxShadow:o||l||c?`0 0 4px ${d}`:void 0,animation:o||l||c?`node-pulse-${o?"red":c?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r?`${s} +${r}`:s,children:[a&&i.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),i.jsx(gt,{type:"target",position:xt.Top,style:Vs}),i.jsx("div",{style:{color:"var(--info)",fontSize:9,marginBottom:1},children:"model"}),i.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s}),r&&i.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",style:{color:"var(--text-muted)",fontSize:9,marginTop:1},title:r,children:r}),i.jsx(gt,{type:"source",position:xt.Bottom,style:Vs})]})}const Ys={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0},Vc=3;function Yc({data:e}){const t=e.status,n=e.nodeWidth,r=e.tool_names,s=e.tool_count,a=e.label??"Tool",o=e.hasBreakpoint,l=e.isPausedHere,c=e.isActiveNode,u=e.isExecutingNode,d=l?"var(--error)":u?"var(--success)":c?"var(--accent)":t==="completed"?"var(--success)":t==="running"?"var(--warning)":t==="failed"?"var(--error)":"var(--node-border)",p=l?"var(--error)":u?"var(--success)":"var(--accent)",m=(r==null?void 0:r.slice(0,Vc))??[],f=(s??(r==null?void 0:r.length)??0)-m.length;return i.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${d}`,boxShadow:l||c||u?`0 0 4px ${p}`:void 0,animation:l||c||u?`node-pulse-${l?"red":u?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r!=null&&r.length?`${a} + +${r.join(` +`)}`:a,children:[o&&i.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),i.jsx(gt,{type:"target",position:xt.Top,style:Ys}),i.jsxs("div",{style:{color:"var(--warning)",fontSize:9,marginBottom:1},children:["tools",s?` (${s})`:""]}),i.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:a}),m.length>0&&i.jsxs("div",{style:{marginTop:3,fontSize:9,color:"var(--text-muted)",textAlign:"left"},children:[m.map(x=>i.jsx("div",{className:"truncate",children:x},x)),f>0&&i.jsxs("div",{style:{fontStyle:"italic"},children:["+",f," more"]})]}),i.jsx(gt,{type:"source",position:xt.Bottom,style:Ys})]})}const Xs={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Xc({data:e}){const t=e.label??"",n=e.status,r=e.hasBreakpoint,s=e.isPausedHere,a=e.isActiveNode,o=e.isExecutingNode,l=s?"var(--error)":o?"var(--success)":a?"var(--accent)":n==="completed"?"var(--success)":n==="running"?"var(--warning)":n==="failed"?"var(--error)":"var(--bg-tertiary)",c=s?"var(--error)":o?"var(--success)":"var(--accent)";return i.jsxs("div",{className:"relative cursor-pointer",style:{width:"100%",height:"100%",background:"var(--bg-secondary)",border:`1.5px ${s||a||o?"solid":"dashed"} ${l}`,borderRadius:8,boxShadow:s||a||o?`0 0 4px ${c}`:void 0,animation:s||a||o?`node-pulse-${s?"red":o?"green":"accent"} 1.5s ease-in-out infinite`:void 0},children:[r&&i.jsx("div",{className:"absolute",style:{top:4,left:4,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--bg-tertiary)",boxShadow:"0 0 4px var(--error)",zIndex:1}}),i.jsx(gt,{type:"target",position:xt.Top,style:Xs}),i.jsx("div",{style:{padding:"4px 10px",fontSize:10,color:"var(--text-muted)",fontWeight:600,textAlign:"center",borderBottom:`1px solid ${l}`,background:"var(--bg-tertiary)",borderRadius:"8px 8px 0 0"},children:t}),i.jsx(gt,{type:"source",position:xt.Bottom,style:Xs})]})}function Zc({data:e}){const t=e.status,n=e.nodeWidth,r=e.label??"",s=e.hasBreakpoint,a=e.isPausedHere,o=e.isActiveNode,l=e.isExecutingNode,c=a?"var(--error)":l?"var(--success)":o?"var(--accent)":t==="completed"?"var(--success)":t==="running"?"var(--warning)":t==="failed"?"var(--error)":"var(--node-border)",u=a?"var(--error)":l?"var(--success)":"var(--accent)";return i.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${c}`,boxShadow:a||o||l?`0 0 4px ${u}`:void 0,animation:a||o||l?`node-pulse-${a?"red":l?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r,children:[s&&i.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),i.jsx(gt,{type:"target",position:xt.Top}),i.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:r}),i.jsx(gt,{type:"source",position:xt.Bottom})]})}function Jc(e,t=8){if(e.length<2)return"";if(e.length===2)return`M ${e[0].x} ${e[0].y} L ${e[1].x} ${e[1].y}`;let n=`M ${e[0].x} ${e[0].y}`;for(let s=1;s0&&(n+=Math.min(r.length,3)*12+(r.length>3?12:0)+4),e!=null&&e.model_name&&(n+=14),n}let mr=null;async function ou(){if(!mr){const{default:e}=await Di(async()=>{const{default:t}=await import("./vendor-elk-CiLKfHel.js").then(n=>n.e);return{default:t}},__vite__mapDeps([0,1]));mr=new e}return mr}const Qs={"elk.algorithm":"layered","elk.direction":"DOWN","elk.edgeRouting":"ORTHOGONAL","elk.layered.crossingMinimization.strategy":"LAYER_SWEEP","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.spacing.nodeNode":"25","elk.layered.spacing.nodeNodeBetweenLayers":"50","elk.spacing.edgeNode":"30","elk.spacing.edgeEdge":"15","elk.layered.spacing.edgeNodeBetweenLayers":"25","elk.layered.spacing.edgeEdgeBetweenLayers":"15","elk.portAlignment.default":"CENTER","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES"},iu="[top=35,left=15,bottom=15,right=15]";function au(e){const t=[],n=[];for(const r of e.nodes){const s=r.data,a={id:r.id,width:Zs(s),height:Js(s,r.type)};if(r.data.subgraph){const o=r.data.subgraph;delete a.width,delete a.height,a.layoutOptions={...Qs,"elk.padding":iu},a.children=o.nodes.map(l=>({id:`${r.id}/${l.id}`,width:Zs(l.data),height:Js(l.data,l.type)})),a.edges=o.edges.map(l=>({id:`${r.id}/${l.id}`,sources:[`${r.id}/${l.source}`],targets:[`${r.id}/${l.target}`]}))}t.push(a)}for(const r of e.edges)n.push({id:r.id,sources:[r.source],targets:[r.target]});return{id:"root",layoutOptions:Qs,children:t,edges:n}}const zr={type:Kl.ArrowClosed,width:12,height:12,color:"var(--node-border)"};function Pi(e){return{stroke:"var(--node-border)",strokeWidth:1.5,...e?{strokeDasharray:"6 3"}:{}}}function eo(e,t,n,r,s){var u;const a=(u=e.sections)==null?void 0:u[0],o=(s==null?void 0:s.x)??0,l=(s==null?void 0:s.y)??0;let c;if(a)c={sourcePoint:{x:a.startPoint.x+o,y:a.startPoint.y+l},targetPoint:{x:a.endPoint.x+o,y:a.endPoint.y+l},bendPoints:(a.bendPoints??[]).map(d=>({x:d.x+o,y:d.y+l}))};else{const d=t.get(e.sources[0]),p=t.get(e.targets[0]);d&&p&&(c={sourcePoint:{x:d.x+d.width/2,y:d.y+d.height},targetPoint:{x:p.x+p.width/2,y:p.y},bendPoints:[]})}return{id:e.id,source:e.sources[0],target:e.targets[0],type:"elk",data:c,style:Pi(r),markerEnd:zr,...n?{label:n,labelStyle:{fill:"var(--text-muted)",fontSize:10},labelBgStyle:{fill:"var(--bg-primary)",fillOpacity:.8}}:{}}}async function lu(e){var c,u;const t=au(e),r=await(await ou()).layout(t),s=new Map;for(const d of e.nodes)if(s.set(d.id,{type:d.type,data:d.data}),d.data.subgraph)for(const p of d.data.subgraph.nodes)s.set(`${d.id}/${p.id}`,{type:p.type,data:p.data});const a=[],o=[],l=new Map;for(const d of r.children??[]){const p=d.x??0,m=d.y??0;l.set(d.id,{x:p,y:m,width:d.width??0,height:d.height??0});for(const f of d.children??[])l.set(f.id,{x:p+(f.x??0),y:m+(f.y??0),width:f.width??0,height:f.height??0})}for(const d of r.children??[]){const p=s.get(d.id);if((((c=d.children)==null?void 0:c.length)??0)>0){a.push({id:d.id,type:"groupNode",data:{...(p==null?void 0:p.data)??{},nodeWidth:d.width,nodeHeight:d.height},position:{x:d.x??0,y:d.y??0},style:{width:d.width,height:d.height}});for(const g of d.children??[]){const v=s.get(g.id);a.push({id:g.id,type:(v==null?void 0:v.type)??"defaultNode",data:{...(v==null?void 0:v.data)??{},nodeWidth:g.width},position:{x:g.x??0,y:g.y??0},parentNode:d.id,extent:"parent"})}const f=d.x??0,x=d.y??0;for(const g of d.edges??[]){const v=e.nodes.find(b=>b.id===d.id),y=(u=v==null?void 0:v.data.subgraph)==null?void 0:u.edges.find(b=>`${d.id}/${b.id}`===g.id);o.push(eo(g,l,y==null?void 0:y.label,y==null?void 0:y.conditional,{x:f,y:x}))}}else a.push({id:d.id,type:(p==null?void 0:p.type)??"defaultNode",data:{...(p==null?void 0:p.data)??{},nodeWidth:d.width},position:{x:d.x??0,y:d.y??0}})}for(const d of r.edges??[]){const p=e.edges.find(m=>m.id===d.id);o.push(eo(d,l,p==null?void 0:p.label,p==null?void 0:p.conditional))}return{nodes:a,edges:o}}function Kn({entrypoint:e,runId:t,breakpointNode:n,breakpointNextNodes:r,onBreakpointChange:s}){const[a,o,l]=Gl([]),[c,u,d]=ql([]),[p,m]=_.useState(!0),[f,x]=_.useState(!1),[g,v]=_.useState(0),y=_.useRef(0),b=_.useRef(null),C=ve(w=>w.breakpoints[t]),O=ve(w=>w.toggleBreakpoint),L=ve(w=>w.clearBreakpoints),N=ve(w=>w.activeNodes[t]),B=ve(w=>{var k;return(k=w.runs[t])==null?void 0:k.status}),D=_.useCallback((w,k)=>{if(k.type==="startNode"||k.type==="endNode")return;const I=k.type==="groupNode"?k.id:k.id.includes("/")?k.id.split("/").pop():k.id;O(t,I);const W=ve.getState().breakpoints[t]??{};s==null||s(Object.keys(W))},[t,O,s]),R=C&&Object.keys(C).length>0,S=_.useCallback(()=>{if(R)L(t),s==null||s([]);else{const w=[];for(const I of a){if(I.type==="startNode"||I.type==="endNode"||I.parentNode)continue;const W=I.type==="groupNode"?I.id:I.id.includes("/")?I.id.split("/").pop():I.id;w.push(W)}for(const I of w)C!=null&&C[I]||O(t,I);const k=ve.getState().breakpoints[t]??{};s==null||s(Object.keys(k))}},[t,R,C,a,L,O,s]);_.useEffect(()=>{o(w=>w.map(k=>{var U;if(k.type==="startNode"||k.type==="endNode")return k;const I=k.type==="groupNode"?k.id:k.id.includes("/")?k.id.split("/").pop():k.id,W=!!(C&&C[I]);return W!==!!((U=k.data)!=null&&U.hasBreakpoint)?{...k,data:{...k.data,hasBreakpoint:W}}:k}))},[C,o]),_.useEffect(()=>{const w=n?new Set(n.split(",").map(k=>k.trim()).filter(Boolean)):null;o(k=>k.map(I=>{var h,F;if(I.type==="startNode"||I.type==="endNode")return I;const W=I.type==="groupNode"?I.id:I.id.includes("/")?I.id.split("/").pop():I.id,U=(h=I.data)==null?void 0:h.label,q=w!=null&&(w.has(W)||U!=null&&w.has(U));return q!==!!((F=I.data)!=null&&F.isPausedHere)?{...I,data:{...I.data,isPausedHere:q}}:I}))},[n,g,o]);const T=ve(w=>w.stateEvents[t]);_.useEffect(()=>{const w=!!n;let k=new Set;const I=new Set,W=new Set,U=new Set,q=new Map,h=new Map;if(T)for(const F of T)F.phase==="started"?h.set(F.node_name,F.qualified_node_name??null):F.phase==="completed"&&h.delete(F.node_name);o(F=>{var E;for(const se of F)se.type&&q.set(se.id,se.type);const $=se=>{var H;const K=[];for(const re of F){const de=re.type==="groupNode"?re.id:re.id.includes("/")?re.id.split("/").pop():re.id,be=(H=re.data)==null?void 0:H.label;(de===se||be!=null&&be===se)&&K.push(re.id)}return K};if(w&&n){const se=n.split(",").map(K=>K.trim()).filter(Boolean);for(const K of se)$(K).forEach(H=>k.add(H));if(r!=null&&r.length)for(const K of r)$(K).forEach(H=>W.add(H));N!=null&&N.prev&&$(N.prev).forEach(K=>I.add(K))}else if(h.size>0){const se=new Map;for(const K of F){const H=(E=K.data)==null?void 0:E.label;if(!H)continue;const re=K.id.includes("/")?K.id.split("/").pop():K.id;for(const de of[re,H]){let be=se.get(de);be||(be=new Set,se.set(de,be)),be.add(K.id)}}for(const[K,H]of h){let re=!1;if(H){const de=H.replace(/:/g,"/");for(const be of F)be.id===de&&(k.add(be.id),re=!0)}if(!re){const de=se.get(K);de&&de.forEach(be=>k.add(be))}}}return F}),u(F=>{const $=I.size===0||F.some(E=>k.has(E.target)&&I.has(E.source));return F.map(E=>{var K,H;let se;return w?se=k.has(E.target)&&(I.size===0||!$||I.has(E.source))||k.has(E.source)&&W.has(E.target):(se=k.has(E.source),!se&&q.get(E.target)==="endNode"&&k.has(E.target)&&(se=!0)),se?(w||U.add(E.target),{...E,style:{stroke:"var(--accent)",strokeWidth:2.5},markerEnd:{...zr,color:"var(--accent)"},data:{...E.data,highlighted:!0},animated:!0}):(K=E.data)!=null&&K.highlighted?{...E,style:Pi((H=E.data)==null?void 0:H.conditional),markerEnd:zr,data:{...E.data,highlighted:!1},animated:!1}:E})}),o(F=>F.map($=>{var K,H,re,de;const E=!w&&k.has($.id);if($.type==="startNode"||$.type==="endNode"){const be=U.has($.id)||!w&&k.has($.id);return be!==!!((K=$.data)!=null&&K.isActiveNode)||E!==!!((H=$.data)!=null&&H.isExecutingNode)?{...$,data:{...$.data,isActiveNode:be,isExecutingNode:E}}:$}const se=w?W.has($.id):U.has($.id);return se!==!!((re=$.data)!=null&&re.isActiveNode)||E!==!!((de=$.data)!=null&&de.isExecutingNode)?{...$,data:{...$.data,isActiveNode:se,isExecutingNode:E}}:$}))},[T,N,n,r,B,g,o,u]);const j=ve(w=>w.graphCache[t]);_.useEffect(()=>{if(!j&&t!=="__setup__")return;const w=j?Promise.resolve(j):uc(e),k=++y.current;m(!0),x(!1),w.then(async I=>{if(y.current!==k)return;if(!I.nodes.length){x(!0);return}const{nodes:W,edges:U}=await lu(I);if(y.current!==k)return;const q=ve.getState().breakpoints[t],h=q?W.map(F=>{if(F.type==="startNode"||F.type==="endNode")return F;const $=F.type==="groupNode"?F.id:F.id.includes("/")?F.id.split("/").pop():F.id;return q[$]?{...F,data:{...F.data,hasBreakpoint:!0}}:F}):W;o(h),u(U),v(F=>F+1),setTimeout(()=>{var F;(F=b.current)==null||F.fitView({padding:.1,duration:200})},100)}).catch(()=>{y.current===k&&x(!0)}).finally(()=>{y.current===k&&m(!1)})},[e,t,j,o,u]),_.useEffect(()=>{const w=setTimeout(()=>{var k;(k=b.current)==null||k.fitView({padding:.1,duration:200})},100);return()=>clearTimeout(w)},[t]);const M=_.useRef(null);return _.useEffect(()=>{const w=M.current;if(!w)return;const k=new ResizeObserver(()=>{var I;(I=b.current)==null||I.fitView({padding:.1,duration:200})});return k.observe(w),()=>k.disconnect()},[p,f]),_.useEffect(()=>{o(w=>{var E,se,K;const k=!!(T!=null&&T.length),I=B==="completed"||B==="failed",W=new Set,U=new Set(w.map(H=>H.id)),q=new Map;for(const H of w){const re=(E=H.data)==null?void 0:E.label;if(!re)continue;const de=H.id.includes("/")?H.id.split("/").pop():H.id;for(const be of[de,re]){let Oe=q.get(be);Oe||(Oe=new Set,q.set(be,Oe)),Oe.add(H.id)}}if(k)for(const H of T){let re=!1;if(H.qualified_node_name){const de=H.qualified_node_name.replace(/:/g,"/");U.has(de)&&(W.add(de),re=!0)}if(!re){const de=q.get(H.node_name);de&&de.forEach(be=>W.add(be))}}const h=new Set;for(const H of w)H.parentNode&&W.has(H.id)&&h.add(H.parentNode);let F;B==="failed"&&W.size===0&&(F=(se=w.find(H=>!H.parentNode&&H.type!=="startNode"&&H.type!=="endNode"&&H.type!=="groupNode"))==null?void 0:se.id);let $;if(B==="completed"){const H=(K=w.find(re=>!re.parentNode&&re.type!=="startNode"&&re.type!=="endNode"&&re.type!=="groupNode"))==null?void 0:K.id;H&&!W.has(H)&&($=H)}return w.map(H=>{var de;let re;return H.id===F?re="failed":H.id===$||W.has(H.id)?re="completed":H.type==="startNode"?(!H.parentNode&&k||H.parentNode&&h.has(H.parentNode))&&(re="completed"):H.type==="endNode"?!H.parentNode&&I?re=B==="failed"?"failed":"completed":H.parentNode&&h.has(H.parentNode)&&(re="completed"):H.type==="groupNode"&&h.has(H.id)&&(re="completed"),re!==((de=H.data)==null?void 0:de.status)?{...H,data:{...H.data,status:re}}:H})})},[T,B,g,o]),p?i.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:"Loading graph..."}):f?i.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4",style:{color:"var(--text-muted)"},children:[i.jsxs("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("rect",{x:"38",y:"10",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.4"}),i.jsx("line",{x1:"60",y1:"34",x2:"60",y2:"46",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),i.jsx("rect",{x:"12",y:"46",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),i.jsx("rect",{x:"64",y:"46",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),i.jsx("line",{x1:"60",y1:"46",x2:"34",y2:"46",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),i.jsx("line",{x1:"60",y1:"46",x2:"86",y2:"46",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),i.jsx("line",{x1:"34",y1:"70",x2:"34",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),i.jsx("line",{x1:"86",y1:"70",x2:"86",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),i.jsx("line",{x1:"34",y1:"82",x2:"60",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),i.jsx("line",{x1:"86",y1:"82",x2:"60",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),i.jsx("line",{x1:"60",y1:"82",x2:"60",y2:"86",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),i.jsx("rect",{x:"38",y:"86",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.4"})]}),i.jsx("span",{className:"text-xs",children:"No graph schema available"})]}):i.jsxs("div",{ref:M,className:"h-full graph-panel",children:[i.jsx("style",{children:` + .graph-panel .react-flow__handle { + opacity: 0 !important; + width: 0 !important; + height: 0 !important; + min-width: 0 !important; + min-height: 0 !important; + border: none !important; + pointer-events: none !important; + } + .graph-panel .react-flow__edges { + overflow: visible !important; + z-index: 1 !important; + } + .graph-panel .react-flow__edge.animated path { + stroke-dasharray: 8 4; + animation: edge-flow 0.6s linear infinite; + } + @keyframes edge-flow { + to { stroke-dashoffset: -12; } + } + @keyframes node-pulse-accent { + 0%, 100% { box-shadow: 0 0 4px var(--accent); } + 50% { box-shadow: 0 0 10px var(--accent); } + } + @keyframes node-pulse-green { + 0%, 100% { box-shadow: 0 0 4px var(--success); } + 50% { box-shadow: 0 0 10px var(--success); } + } + @keyframes node-pulse-red { + 0%, 100% { box-shadow: 0 0 4px var(--error); } + 50% { box-shadow: 0 0 10px var(--error); } + } + `}),i.jsxs(Vl,{nodes:a,edges:c,onNodesChange:l,onEdgesChange:d,nodeTypes:eu,edgeTypes:tu,onInit:w=>{b.current=w},onNodeClick:D,fitView:!0,proOptions:{hideAttribution:!0},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,children:[i.jsx(Yl,{color:"var(--bg-tertiary)",gap:16}),i.jsx(Xl,{showInteractive:!1}),i.jsx(Zl,{position:"top-right",children:i.jsxs("button",{onClick:S,title:R?"Remove all breakpoints":"Set breakpoints on all nodes",style:{background:"var(--bg-secondary)",color:R?"var(--error)":"var(--text-muted)",border:`1px solid ${R?"var(--error)":"var(--node-border)"}`,borderRadius:6,padding:"4px 10px",fontSize:12,cursor:"pointer",display:"flex",alignItems:"center",gap:4},children:[i.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:R?"var(--error)":"var(--node-border)"}}),R?"Clear all":"Break all"]})}),i.jsx(Jl,{nodeColor:w=>{var I;if(w.type==="groupNode")return"var(--bg-tertiary)";const k=(I=w.data)==null?void 0:I.status;return k==="completed"?"var(--success)":k==="running"?"var(--warning)":k==="failed"?"var(--error)":"var(--node-border)"},nodeStrokeWidth:0,style:{background:"var(--bg-secondary)",width:120,height:80}})]})]})}const Ut="__setup__";function cu({entrypoint:e,mode:t,ws:n,onRunCreated:r,isMobile:s}){const[a,o]=_.useState("{}"),[l,c]=_.useState({}),[u,d]=_.useState(!1),[p,m]=_.useState(!0),[f,x]=_.useState(null),[g,v]=_.useState(""),[y,b]=_.useState(!0),[C,O]=_.useState(()=>{const I=localStorage.getItem("setupTextareaHeight");return I?parseInt(I,10):140}),L=_.useRef(null),[N,B]=_.useState(()=>{const I=localStorage.getItem("setupPanelWidth");return I?parseInt(I,10):380}),D=t==="run";_.useEffect(()=>{m(!0),x(null),cc(e).then(I=>{c(I.mock_input),o(JSON.stringify(I.mock_input,null,2))}).catch(I=>{console.error("Failed to load mock input:",I);const W=I.detail||{};x(W.message||`Failed to load schema for "${e}"`),o("{}")}).finally(()=>m(!1))},[e]),_.useEffect(()=>{ve.getState().clearBreakpoints(Ut)},[]);const R=async()=>{let I;try{I=JSON.parse(a)}catch{alert("Invalid JSON input");return}d(!0);try{const W=ve.getState().breakpoints[Ut]??{},U=Object.keys(W),q=await $s(e,I,t,U);ve.getState().clearBreakpoints(Ut),ve.getState().upsertRun(q),r(q.id)}catch(W){console.error("Failed to create run:",W)}finally{d(!1)}},S=async()=>{const I=g.trim();if(I){d(!0);try{const W=ve.getState().breakpoints[Ut]??{},U=Object.keys(W),q=await $s(e,l,"chat",U);ve.getState().clearBreakpoints(Ut),ve.getState().upsertRun(q),ve.getState().addLocalChatMessage(q.id,{message_id:`local-${Date.now()}`,role:"user",content:I}),n.sendChatMessage(q.id,I),r(q.id)}catch(W){console.error("Failed to create chat run:",W)}finally{d(!1)}}};_.useEffect(()=>{try{JSON.parse(a),b(!0)}catch{b(!1)}},[a]);const T=_.useCallback(I=>{I.preventDefault();const W="touches"in I?I.touches[0].clientY:I.clientY,U=C,q=F=>{const $="touches"in F?F.touches[0].clientY:F.clientY,E=Math.max(60,U+(W-$));O(E)},h=()=>{document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",h),document.removeEventListener("touchmove",q),document.removeEventListener("touchend",h),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("setupTextareaHeight",String(C))};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",q),document.addEventListener("mouseup",h),document.addEventListener("touchmove",q,{passive:!1}),document.addEventListener("touchend",h)},[C]),j=_.useCallback(I=>{I.preventDefault();const W="touches"in I?I.touches[0].clientX:I.clientX,U=N,q=F=>{const $=L.current;if(!$)return;const E="touches"in F?F.touches[0].clientX:F.clientX,se=$.clientWidth-300,K=Math.max(280,Math.min(se,U+(W-E)));B(K)},h=()=>{document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",h),document.removeEventListener("touchmove",q),document.removeEventListener("touchend",h),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("setupPanelWidth",String(N))};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",q),document.addEventListener("mouseup",h),document.addEventListener("touchmove",q,{passive:!1}),document.addEventListener("touchend",h)},[N]),M=D?"Autonomous":"Conversational",w=D?"var(--success)":"var(--accent)",k=i.jsxs("div",{className:"shrink-0 flex flex-col",style:s?{background:"var(--bg-primary)"}:{width:N,background:"var(--bg-primary)"},children:[i.jsxs("div",{className:"px-4 text-xs font-semibold border-b flex items-center gap-2 h-10",style:{color:"var(--text-muted)",borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[i.jsx("span",{style:{color:w},children:"●"}),M]}),i.jsxs("div",{className:"flex-1 overflow-y-auto flex flex-col items-center justify-center gap-4 px-6",children:[i.jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--text-muted)",opacity:.5},children:D?i.jsxs(i.Fragment,{children:[i.jsx("circle",{cx:"12",cy:"12",r:"10"}),i.jsx("polyline",{points:"12 6 12 12 16 14"})]}):i.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),i.jsxs("div",{className:"text-center space-y-1.5",children:[i.jsx("p",{className:"text-sm font-medium",style:{color:"var(--text-secondary)"},children:D?"Ready to execute":"Ready to chat"}),i.jsxs("p",{className:"text-xs leading-relaxed",style:{color:"var(--text-muted)"},children:["Click nodes to set breakpoints",D?i.jsxs(i.Fragment,{children:[",",i.jsx("br",{}),"configure input below, then run"]}):i.jsxs(i.Fragment,{children:[",",i.jsx("br",{}),"then send your first message"]})]})]})]}),D?i.jsxs("div",{className:"flex flex-col",style:{background:"var(--bg-primary)"},children:[!s&&i.jsx("div",{onMouseDown:T,onTouchStart:T,className:"shrink-0 drag-handle-row"}),i.jsxs("div",{className:"px-4 py-3",children:[f?i.jsx("div",{className:"text-xs mb-3 px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:f}):i.jsxs(i.Fragment,{children:[i.jsxs("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:["Input",p&&i.jsx("span",{className:"ml-2 font-normal",children:"Loading..."})]}),i.jsx("textarea",{value:a,onChange:I=>o(I.target.value),spellCheck:!1,className:"w-full rounded-md px-3 py-2 text-xs font-mono leading-relaxed resize-none mb-3",style:{height:s?120:C,background:"var(--bg-secondary)",border:`1px solid ${y?"var(--border)":"#b91c1c"}`,color:"var(--text-primary)"}})]}),i.jsx("button",{onClick:R,disabled:u||p||!!f,className:"w-full py-2 text-sm font-semibold rounded-md border cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed transition-colors flex items-center justify-center gap-2",style:{background:"transparent",borderColor:w,color:w},onMouseEnter:I=>{u||(I.currentTarget.style.background=`color-mix(in srgb, ${w} 10%, transparent)`)},onMouseLeave:I=>{I.currentTarget.style.background="transparent"},children:u?"Starting...":i.jsxs(i.Fragment,{children:[i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:i.jsx("polygon",{points:"5,3 19,12 5,21"})}),"Execute"]})})]})]}):i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:[i.jsx("input",{value:g,onChange:I=>v(I.target.value),onKeyDown:I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),S())},disabled:u||p,placeholder:u?"Starting...":"Message...",className:"flex-1 bg-transparent text-sm py-1 disabled:opacity-40 placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),i.jsx("button",{onClick:S,disabled:u||p||!g.trim(),className:"text-xs font-semibold px-3 py-1.5 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:!u&&g.trim()?"var(--accent)":"var(--text-muted)",background:"transparent"},onMouseEnter:I=>{!u&&g.trim()&&(I.currentTarget.style.background="color-mix(in srgb, var(--accent) 10%, transparent)")},onMouseLeave:I=>{I.currentTarget.style.background="transparent"},children:"Send"})]})]});return s?i.jsxs("div",{className:"flex flex-col h-full",children:[i.jsx("div",{className:"shrink-0",style:{height:"40vh"},children:i.jsx(Kn,{entrypoint:e,traces:[],runId:Ut})}),i.jsx("div",{className:"flex-1 overflow-y-auto flex flex-col min-h-0",children:k})]}):i.jsxs("div",{ref:L,className:"flex h-full",children:[i.jsx("div",{className:"flex-1 min-w-0",children:i.jsx(Kn,{entrypoint:e,traces:[],runId:Ut})}),i.jsx("div",{onMouseDown:j,onTouchStart:j,className:"shrink-0 drag-handle-col"}),k]})}const uu={key:"var(--info)",string:"var(--success)",number:"var(--warning)",boolean:"var(--accent)",null:"var(--accent)",punctuation:"var(--text-muted)"};function du(e){const t=[],n=/("(?:[^"\\]|\\.)*")\s*:|("(?:[^"\\]|\\.)*")|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b|(true|false)\b|(null)\b|([{}[\]:,])/g;let r=0,s;for(;(s=n.exec(e))!==null;){if(s.index>r&&t.push({type:"punctuation",text:e.slice(r,s.index)}),s[1]!==void 0){t.push({type:"key",text:s[1]});const a=e.indexOf(":",s.index+s[1].length);a!==-1&&(a>s.index+s[1].length&&t.push({type:"punctuation",text:e.slice(s.index+s[1].length,a)}),t.push({type:"punctuation",text:":"}),n.lastIndex=a+1)}else s[2]!==void 0?t.push({type:"string",text:s[2]}):s[3]!==void 0?t.push({type:"number",text:s[3]}):s[4]!==void 0?t.push({type:"boolean",text:s[4]}):s[5]!==void 0?t.push({type:"null",text:s[5]}):s[6]!==void 0&&t.push({type:"punctuation",text:s[6]});r=n.lastIndex}return rdu(e),[e]);return i.jsx("pre",{className:t,style:n,children:r.map((s,a)=>i.jsx("span",{style:{color:uu[s.type]},children:s.text},a))})}const pu={started:{color:"var(--info)",label:"Started"},running:{color:"var(--warning)",label:"Running"},completed:{color:"var(--success)",label:"Completed"},failed:{color:"var(--error)",label:"Failed"},error:{color:"var(--error)",label:"Error"}},fu={color:"var(--text-muted)",label:"Unknown"};function mu(e){if(typeof e!="string")return null;const t=e.trim();if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))try{return JSON.stringify(JSON.parse(t),null,2)}catch{return null}return null}const to=200;function hu(e){if(typeof e=="string")return e;if(e==null)return String(e);try{return JSON.stringify(e,null,2)}catch{return String(e)}}function gu({value:e}){const[t,n]=_.useState(!1),r=hu(e),s=_.useMemo(()=>mu(e),[e]),a=s!==null,o=s??r,l=o.length>to||o.includes(` +`),c=_.useCallback(()=>n(u=>!u),[]);return l?i.jsxs("div",{children:[t?a?i.jsx(ot,{json:o,className:"font-mono text-[11px] whitespace-pre-wrap break-all",style:{}}):i.jsx("pre",{className:"font-mono text-[11px] whitespace-pre-wrap break-all",style:{color:"var(--text-primary)"},children:o}):i.jsxs("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:[o.slice(0,to),"..."]}),i.jsx("button",{onClick:c,className:"text-[11px] cursor-pointer ml-1 px-1",style:{color:"var(--info)"},children:t?"[less]":"[more]"})]}):a?i.jsx(ot,{json:o,className:"font-mono text-[11px] break-all whitespace-pre-wrap",style:{}}):i.jsx("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:o})}function xu({span:e}){const[t,n]=_.useState(!0),[r,s]=_.useState(!1),[a,o]=_.useState("table"),[l,c]=_.useState(!1),u=pu[e.status.toLowerCase()]??{...fu,label:e.status},d=_.useMemo(()=>JSON.stringify(e,null,2),[e]),p=_.useCallback(()=>{navigator.clipboard.writeText(d).then(()=>{c(!0),setTimeout(()=>c(!1),1500)})},[d]),m=Object.entries(e.attributes),f=[{label:"Span",value:e.span_id},...e.trace_id?[{label:"Trace",value:e.trace_id}]:[],{label:"Run",value:e.run_id},...e.parent_span_id?[{label:"Parent",value:e.parent_span_id}]:[]];return i.jsxs("div",{className:"flex flex-col h-full text-xs leading-normal",children:[i.jsxs("div",{className:"px-2 border-b flex items-center gap-1 shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",height:"32px"},children:[i.jsx("button",{onClick:()=>o("table"),className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:a==="table"?"var(--accent)":"var(--text-muted)",background:a==="table"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:x=>{a!=="table"&&(x.currentTarget.style.color="var(--text-primary)")},onMouseLeave:x=>{a!=="table"&&(x.currentTarget.style.color="var(--text-muted)")},children:"Table"}),i.jsx("button",{onClick:()=>o("json"),className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:a==="json"?"var(--accent)":"var(--text-muted)",background:a==="json"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:x=>{a!=="json"&&(x.currentTarget.style.color="var(--text-primary)")},onMouseLeave:x=>{a!=="json"&&(x.currentTarget.style.color="var(--text-muted)")},children:"JSON"}),i.jsxs("span",{className:"ml-auto shrink-0 inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] font-bold uppercase tracking-wider",style:{background:`color-mix(in srgb, ${u.color} 15%, var(--bg-secondary))`,color:u.color},children:[i.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full",style:{background:u.color}}),u.label]})]}),i.jsx("div",{className:"overflow-y-auto flex-1 p-0.5 pr-0 pt-0 mr-0.5 mt-0.5",children:a==="table"?i.jsxs(i.Fragment,{children:[m.length>0&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"px-2 py-1 text-[11px] uppercase font-bold tracking-wider border-b cursor-pointer flex items-center",style:{color:"var(--success)",borderColor:"var(--border)",background:"var(--bg-secondary)"},onClick:()=>n(x=>!x),children:[i.jsxs("span",{className:"flex-1",children:["Attributes (",m.length,")"]}),i.jsx("span",{style:{color:"var(--text-muted)",transform:t?"rotate(0deg)":"rotate(-90deg)"},children:"▾"})]}),t&&m.map(([x,g],v)=>i.jsxs("div",{className:"flex gap-2 px-2 py-1 items-start border-b",style:{borderColor:"var(--border)",background:v%2===0?"var(--bg-primary)":"var(--bg-secondary)"},children:[i.jsx("span",{className:"font-mono font-semibold shrink-0 pt-px truncate text-[11px]",style:{color:"var(--info)",width:"35%"},title:x,children:x}),i.jsx("span",{className:"flex-1 min-w-0",children:i.jsx(gu,{value:g})})]},x))]}),i.jsxs("div",{className:"px-2 py-1 text-[11px] uppercase font-bold tracking-wider border-b cursor-pointer flex items-center",style:{color:"var(--success)",borderColor:"var(--border)",background:"var(--bg-secondary)"},onClick:()=>s(x=>!x),children:[i.jsxs("span",{className:"flex-1",children:["Identifiers (",f.length,")"]}),i.jsx("span",{style:{color:"var(--text-muted)",transform:r?"rotate(0deg)":"rotate(-90deg)"},children:"▾"})]}),r&&f.map((x,g)=>i.jsxs("div",{className:"flex gap-2 px-2 py-1 items-start border-b",style:{borderColor:"var(--border)",background:g%2===0?"var(--bg-primary)":"var(--bg-secondary)"},children:[i.jsx("span",{className:"font-mono font-semibold shrink-0 pt-px truncate text-[11px]",style:{color:"var(--info)",width:"35%"},title:x.label,children:x.label}),i.jsx("span",{className:"flex-1 min-w-0",children:i.jsx("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:x.value})})]},x.label))]}):i.jsxs("div",{className:"relative",children:[i.jsx("button",{onClick:p,className:"absolute top-1 right-1 z-10 text-[11px] cursor-pointer px-2 py-1 rounded transition-colors",style:{color:l?"var(--success)":"var(--text-muted)",background:"var(--bg-secondary)",border:"1px solid var(--border)"},onMouseEnter:x=>{l||(x.currentTarget.style.color="var(--text-primary)")},onMouseLeave:x=>{x.currentTarget.style.color=l?"var(--success)":"var(--text-muted)"},children:l?"Copied!":"Copy"}),i.jsx(ot,{json:d,className:"font-mono text-[11px] whitespace-pre-wrap p-2",style:{}})]})})]})}function bu(e){const t=[];function n(r,s){t.push({span:r.span,depth:s});for(const a of r.children)n(a,s+1)}for(const r of e)n(r,0);return t}function yu({tree:e,selectedSpan:t,onSelect:n}){const r=_.useMemo(()=>bu(e),[e]),{globalStart:s,totalDuration:a}=_.useMemo(()=>{if(r.length===0)return{globalStart:0,totalDuration:1};let o=1/0,l=-1/0;for(const{span:c}of r){const u=new Date(c.timestamp).getTime();o=Math.min(o,u),l=Math.max(l,u+(c.duration_ms??0))}return{globalStart:o,totalDuration:Math.max(l-o,1)}},[r]);return r.length===0?null:i.jsx(i.Fragment,{children:r.map(({span:o,depth:l})=>{var g;const c=new Date(o.timestamp).getTime()-s,u=o.duration_ms??0,d=c/a*100,p=Math.max(u/a*100,.3),m=Bi[o.status.toLowerCase()]??"var(--text-muted)",f=o.span_id===(t==null?void 0:t.span_id),x=(g=o.attributes)==null?void 0:g["openinference.span.kind"];return i.jsxs("button",{"data-span-id":o.span_id,onClick:()=>n(o),className:"w-full text-left text-xs leading-normal py-1 flex items-center transition-colors",style:{background:f?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:f?"2px solid var(--accent)":"2px solid transparent"},onMouseEnter:v=>{f||(v.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:v=>{f||(v.currentTarget.style.background="")},children:[i.jsxs("div",{className:"shrink-0 flex items-center gap-1 overflow-hidden",style:{width:"35%",minWidth:"80px",paddingLeft:`${l*12+4}px`},children:[i.jsx("span",{className:"shrink-0 flex items-center justify-center w-3.5 h-3.5",children:i.jsx(Fi,{kind:x,statusColor:m})}),i.jsx("span",{className:"text-[var(--text-primary)] truncate",children:o.span_name})]}),i.jsx("div",{className:"flex-1 relative h-[14px] mx-1 rounded-sm",style:{background:"var(--bg-secondary)"},children:i.jsx("div",{className:"absolute rounded-sm",style:{left:`${d}%`,width:`${p}%`,top:"2px",bottom:"2px",background:m,opacity:.8,minWidth:"2px"}})}),i.jsx("span",{className:"shrink-0 text-[10px] tabular-nums pr-2",style:{width:"52px",textAlign:"right",color:"var(--text-muted)"},children:zi(o.duration_ms)})]},o.span_id)})})}const Bi={started:"var(--info)",running:"var(--warning)",completed:"var(--success)",failed:"var(--error)",error:"var(--error)"};function Fi({kind:e,statusColor:t}){const n=t,r=14,s={width:r,height:r,viewBox:"0 0 16 16",fill:"none",stroke:n,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"LLM":return i.jsx("svg",{...s,children:i.jsx("path",{d:"M8 2L9 5L12 4L10 7L14 8L10 9L12 12L9 11L8 14L7 11L4 12L6 9L2 8L6 7L4 4L7 5Z",fill:n,stroke:"none"})});case"TOOL":return i.jsx("svg",{...s,children:i.jsx("path",{d:"M10.5 2.5a3.5 3.5 0 0 0-3.17 4.93L3.5 11.27a1 1 0 0 0 0 1.41l.82.82a1 1 0 0 0 1.41 0l3.84-3.83A3.5 3.5 0 1 0 10.5 2.5z"})});case"AGENT":return i.jsxs("svg",{...s,children:[i.jsx("rect",{x:"3",y:"5",width:"10",height:"8",rx:"2"}),i.jsx("circle",{cx:"6",cy:"9",r:"1",fill:n,stroke:"none"}),i.jsx("circle",{cx:"10",cy:"9",r:"1",fill:n,stroke:"none"}),i.jsx("path",{d:"M8 2v3"}),i.jsx("path",{d:"M6 2h4"})]});case"CHAIN":return i.jsxs("svg",{...s,children:[i.jsx("path",{d:"M6.5 9.5L9.5 6.5"}),i.jsx("path",{d:"M4.5 8.5l-1 1a2 2 0 0 0 2.83 2.83l1-1"}),i.jsx("path",{d:"M11.5 7.5l1-1a2 2 0 0 0-2.83-2.83l-1 1"})]});case"RETRIEVER":return i.jsxs("svg",{...s,children:[i.jsx("circle",{cx:"7",cy:"7",r:"4"}),i.jsx("path",{d:"M10 10l3.5 3.5"})]});case"EMBEDDING":return i.jsxs("svg",{...s,children:[i.jsx("rect",{x:"2",y:"2",width:"4",height:"4",rx:"0.5"}),i.jsx("rect",{x:"10",y:"2",width:"4",height:"4",rx:"0.5"}),i.jsx("rect",{x:"2",y:"10",width:"4",height:"4",rx:"0.5"}),i.jsx("rect",{x:"10",y:"10",width:"4",height:"4",rx:"0.5"})]});default:return i.jsx("span",{className:"shrink-0 w-2 h-2 rounded-full",style:{background:t}})}}function vu(e){const t=new Map(e.map(o=>[o.span_id,o])),n=new Map;for(const o of e)if(o.parent_span_id){const l=n.get(o.parent_span_id)??[];l.push(o),n.set(o.parent_span_id,l)}const r=e.filter(o=>o.parent_span_id===null||!t.has(o.parent_span_id));function s(o){const l=(n.get(o.span_id)??[]).sort((c,u)=>c.timestamp.localeCompare(u.timestamp));return{span:o,children:l.map(s)}}return r.sort((o,l)=>o.timestamp.localeCompare(l.timestamp)).map(s).flatMap(o=>o.span.span_name==="root"?o.children:[o])}function zi(e){return e==null?"":e<1e3?`${e.toFixed(0)}ms`:`${(e/1e3).toFixed(2)}s`}function $i(e){return e.map(t=>{const{span:n}=t;return t.children.length>0?{name:n.span_name,children:$i(t.children)}:{name:n.span_name}})}function $r({traces:e}){const[t,n]=_.useState(null),[r,s]=_.useState(new Set),[a,o]=_.useState(()=>{const D=localStorage.getItem("traceTreeSplitWidth");return D?parseFloat(D):50}),[l,c]=_.useState(!1),[u,d]=_.useState(!1),[p,m]=_.useState(()=>localStorage.getItem("traceViewMode")||"tree"),f=vu(e),x=_.useMemo(()=>JSON.stringify($i(f),null,2),[e]),g=_.useCallback(()=>{navigator.clipboard.writeText(x).then(()=>{d(!0),setTimeout(()=>d(!1),1500)})},[x]),v=ve(D=>D.focusedSpan),y=ve(D=>D.setFocusedSpan),[b,C]=_.useState(null),O=_.useRef(null),L=_.useCallback(D=>{s(R=>{const S=new Set(R);return S.has(D)?S.delete(D):S.add(D),S})},[]),N=_.useRef(null);_.useEffect(()=>{const D=f.length>0?f[0].span.span_id:null,R=N.current;if(N.current=D,D&&D!==R)n(f[0].span);else if(t===null)f.length>0&&n(f[0].span);else{const S=e.find(T=>T.span_id===t.span_id);S&&S!==t&&n(S)}},[e]),_.useEffect(()=>{if(!v)return;const R=e.filter(S=>S.span_name===v.name).sort((S,T)=>S.timestamp.localeCompare(T.timestamp))[v.index];if(R){n(R),C(R.span_id);const S=new Map(e.map(T=>[T.span_id,T.parent_span_id]));s(T=>{const j=new Set(T);let M=R.parent_span_id;for(;M;)j.delete(M),M=S.get(M)??null;return j})}y(null)},[v,e,y]),_.useEffect(()=>{if(!b)return;const D=b;C(null),requestAnimationFrame(()=>{const R=O.current,S=R==null?void 0:R.querySelector(`[data-span-id="${D}"]`);R&&S&&S.scrollIntoView({block:"center",behavior:"smooth"})})},[b]),_.useEffect(()=>{if(!l)return;const D=S=>{const T=document.querySelector(".trace-tree-container");if(!T)return;const j=T.getBoundingClientRect(),M=(S.clientX-j.left)/j.width*100,w=Math.max(20,Math.min(80,M));o(w),localStorage.setItem("traceTreeSplitWidth",String(w))},R=()=>{c(!1)};return window.addEventListener("mousemove",D),window.addEventListener("mouseup",R),()=>{window.removeEventListener("mousemove",D),window.removeEventListener("mouseup",R)}},[l]);const B=D=>{D.preventDefault(),c(!0)};return i.jsxs("div",{className:"flex h-full trace-tree-container",style:{cursor:l?"col-resize":void 0},children:[i.jsxs("div",{className:"flex flex-col",style:{width:`${a}%`},children:[e.length>0&&i.jsxs("div",{className:"flex items-center gap-1 px-2 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",height:"32px"},children:[i.jsx("button",{onClick:()=>{m("tree"),localStorage.setItem("traceViewMode","tree")},className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:p==="tree"?"var(--accent)":"var(--text-muted)",background:p==="tree"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:D=>{p!=="tree"&&(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{p!=="tree"&&(D.currentTarget.style.color="var(--text-muted)")},children:"Tree"}),i.jsx("button",{onClick:()=>{m("timeline"),localStorage.setItem("traceViewMode","timeline")},className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:p==="timeline"?"var(--accent)":"var(--text-muted)",background:p==="timeline"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:D=>{p!=="timeline"&&(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{p!=="timeline"&&(D.currentTarget.style.color="var(--text-muted)")},children:"Timeline"}),i.jsx("button",{onClick:()=>{m("json"),localStorage.setItem("traceViewMode","json")},className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:p==="json"?"var(--accent)":"var(--text-muted)",background:p==="json"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:D=>{p!=="json"&&(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{p!=="json"&&(D.currentTarget.style.color="var(--text-muted)")},children:"JSON"})]}),i.jsx("div",{ref:O,className:"overflow-y-auto flex-1 p-0.5 pr-0 pt-0 mr-0.5 mt-0.5",children:f.length===0?i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"No traces yet"})}):p==="tree"?f.map((D,R)=>i.jsx(Ui,{node:D,depth:0,selectedId:(t==null?void 0:t.span_id)??null,onSelect:n,isLast:R===f.length-1,collapsedIds:r,toggleExpanded:L},D.span.span_id)):p==="timeline"?i.jsx(yu,{tree:f,selectedSpan:t,onSelect:n}):i.jsxs("div",{className:"relative",children:[i.jsx("button",{onClick:g,className:"absolute top-1 right-1 z-10 text-[11px] cursor-pointer px-2 py-1 rounded transition-colors",style:{color:u?"var(--success)":"var(--text-muted)",background:"var(--bg-secondary)",border:"1px solid var(--border)"},onMouseEnter:D=>{u||(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{D.currentTarget.style.color=u?"var(--success)":"var(--text-muted)"},children:u?"Copied!":"Copy"}),i.jsx(ot,{json:x,className:"font-mono text-[11px] whitespace-pre-wrap p-2",style:{}})]})})]}),i.jsx("div",{onMouseDown:B,className:"shrink-0 drag-handle-col",style:l?{background:"var(--accent)"}:void 0}),i.jsx("div",{className:"flex-1 overflow-hidden",children:t?i.jsx(xu,{span:t}):i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"Select a span to view details"})})})]})}function Ui({node:e,depth:t,selectedId:n,onSelect:r,isLast:s,collapsedIds:a,toggleExpanded:o}){var g;const{span:l}=e,c=!a.has(l.span_id),u=Bi[l.status.toLowerCase()]??"var(--text-muted)",d=zi(l.duration_ms),p=l.span_id===n,m=e.children.length>0,f=t*20,x=(g=l.attributes)==null?void 0:g["openinference.span.kind"];return i.jsxs("div",{className:"relative",children:[t>0&&i.jsx("div",{className:"absolute top-0 z-10 pointer-events-none",style:{left:`${f-10}px`,width:"1px",height:s?"16px":"100%",background:"var(--border)"}}),i.jsxs("button",{"data-span-id":l.span_id,onClick:()=>r(l),className:"w-full text-left text-xs leading-normal py-1.5 pr-2 flex items-center gap-1.5 transition-colors relative",style:{paddingLeft:`${f+4}px`,background:p?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":void 0,borderLeft:p?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:v=>{p||(v.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:v=>{p||(v.currentTarget.style.background="")},children:[t>0&&i.jsx("div",{className:"absolute z-10 pointer-events-none",style:{left:`${f-10}px`,top:"50%",width:"10px",height:"1px",background:"var(--border)"}}),m?i.jsx("span",{onClick:v=>{v.stopPropagation(),o(l.span_id)},className:"shrink-0 w-5 h-5 flex items-center justify-center cursor-pointer rounded hover:bg-[var(--bg-hover)]",style:{color:"var(--text-muted)"},children:i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",style:{transform:c?"rotate(90deg)":"rotate(0deg)"},children:i.jsx("path",{d:"M3 1.5L7 5L3 8.5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})})}):i.jsx("span",{className:"shrink-0 w-4"}),i.jsx("span",{className:"shrink-0 flex items-center justify-center w-4 h-4",children:i.jsx(Fi,{kind:x,statusColor:u})}),i.jsx("span",{className:"text-[var(--text-primary)] truncate min-w-0 flex-1",children:l.span_name}),d&&i.jsx("span",{className:"text-[var(--text-muted)] shrink-0 ml-auto pl-2 tabular-nums",children:d})]}),c&&e.children.map((v,y)=>i.jsx(Ui,{node:v,depth:t+1,selectedId:n,onSelect:r,isLast:y===e.children.length-1,collapsedIds:a,toggleExpanded:o},v.span.span_id))]})}const ku={DEBUG:{color:"var(--text-muted)",bg:"color-mix(in srgb, var(--text-muted) 15%, var(--bg-secondary))",border:"var(--text-muted)"},INFO:{color:"var(--info)",bg:"color-mix(in srgb, var(--info) 15%, var(--bg-secondary))",border:"var(--info)"},WARN:{color:"var(--warning)",bg:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",border:"var(--warning)"},WARNING:{color:"var(--warning)",bg:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",border:"var(--warning)"},ERROR:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",border:"var(--error)"},CRITICAL:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",border:"var(--error)"}},Eu={color:"var(--text-muted)",bg:"transparent"};function no({logs:e}){const t=_.useRef(null),n=_.useRef(null),[r,s]=_.useState(!1);_.useEffect(()=>{var o;(o=n.current)==null||o.scrollIntoView({behavior:"smooth"})},[e.length]);const a=()=>{const o=t.current;o&&s(o.scrollTop>100)};return e.length===0?i.jsx("div",{className:"h-full flex items-center justify-center",children:i.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"No logs yet"})}):i.jsxs("div",{className:"h-full relative",children:[i.jsxs("div",{ref:t,onScroll:a,className:"h-full overflow-y-auto font-mono text-xs leading-normal",children:[e.map((o,l)=>{const c=new Date(o.timestamp).toLocaleTimeString(void 0,{hour12:!1}),u=o.level.toUpperCase(),d=u.slice(0,4),p=ku[u]??Eu,m=l%2===0;return i.jsxs("div",{className:"flex gap-3 px-3 py-1.5",style:{background:m?"var(--bg-primary)":"var(--bg-secondary)"},children:[i.jsx("span",{className:"text-[var(--text-muted)] shrink-0",children:c}),i.jsx("span",{className:"shrink-0 self-start px-1.5 py-0.5 rounded text-[10px] font-semibold leading-none inline-flex items-center",style:{color:p.color,background:p.bg},children:d}),i.jsx("span",{className:"text-[var(--text-primary)] whitespace-pre-wrap break-all",children:o.message})]},l)}),i.jsx("div",{ref:n})]}),r&&i.jsx("button",{onClick:()=>{var o;return(o=t.current)==null?void 0:o.scrollTo({top:0,behavior:"smooth"})},className:"absolute top-2 right-3 w-6 h-6 flex items-center justify-center rounded-full cursor-pointer transition-opacity opacity-70 hover:opacity-100",style:{background:"var(--bg-tertiary)",color:"var(--text-primary)"},title:"Scroll to top",children:i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("polyline",{points:"18 15 12 9 6 15"})})})]})}const wu={started:{color:"var(--accent)",label:"started"},updated:{color:"var(--info)",label:"updated"},completed:{color:"var(--success)",label:"completed"},faulted:{color:"var(--error)",label:"faulted"}},ro={color:"var(--text-muted)",label:""};function In({events:e,runStatus:t}){const n=_.useRef(null),r=_.useRef(!0),[s,a]=_.useState(null),o=()=>{const l=n.current;l&&(r.current=l.scrollHeight-l.scrollTop-l.clientHeight<40)};return _.useEffect(()=>{r.current&&n.current&&(n.current.scrollTop=n.current.scrollHeight)}),e.length===0?i.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:i.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:t==="running"?"Waiting for events...":"No events yet"})}):i.jsx("div",{ref:n,onScroll:o,className:"h-full overflow-y-auto font-mono text-xs leading-normal",children:e.map((l,c)=>{const u=new Date(l.timestamp).toLocaleTimeString(void 0,{hour12:!1}),d=l.payload&&Object.keys(l.payload).length>0,p=s===c,m=l.phase?wu[l.phase]??ro:ro;return i.jsxs("div",{children:[i.jsxs("div",{onClick:()=>{d&&a(p?null:c)},className:"flex items-center gap-2 px-3 py-1.5",style:{background:c%2===0?"var(--bg-primary)":"var(--bg-secondary)",cursor:d?"pointer":"default"},children:[i.jsx("span",{className:"shrink-0",style:{color:"var(--text-muted)"},children:u}),i.jsx("span",{className:"shrink-0",style:{color:m.color},children:"●"}),i.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:l.node_name}),m.label&&i.jsx("span",{className:"shrink-0 text-[10px]",style:{color:"var(--text-muted)"},children:m.label}),d&&i.jsx("span",{className:"shrink-0 text-[9px] transition-transform",style:{color:"var(--text-muted)",transform:p?"rotate(90deg)":"rotate(0deg)"},children:"▸"})]}),p&&d&&i.jsx("div",{className:"px-3 py-2 border-t border-b",style:{borderColor:"var(--border)",background:"color-mix(in srgb, var(--bg-secondary) 80%, var(--bg-primary))"},children:i.jsx(ot,{json:JSON.stringify(l.payload,null,2),className:"text-[11px] font-mono whitespace-pre-wrap break-words"})})]},c)})})}function _t({title:e,copyText:t,trailing:n,children:r}){const[s,a]=_.useState(!1),o=_.useCallback(()=>{t&&navigator.clipboard.writeText(t).then(()=>{a(!0),setTimeout(()=>a(!1),1500)})},[t]);return i.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:[i.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[i.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:e}),n,t&&i.jsx("button",{onClick:o,className:`${n?"":"ml-auto "}text-[10px] cursor-pointer px-1.5 py-0.5 rounded transition-colors`,style:{color:s?"var(--success)":"var(--text-muted)",background:"var(--bg-tertiary)",border:"none"},onMouseEnter:l=>{s||(l.currentTarget.style.color="var(--text-primary)")},onMouseLeave:l=>{l.currentTarget.style.color=s?"var(--success)":"var(--text-muted)"},children:s?"Copied":"Copy"})]}),r]})}function so({runId:e,status:t,ws:n,breakpointNode:r}){const s=t==="suspended",a=o=>{const l=ve.getState().breakpoints[e]??{};n.setBreakpoints(e,Object.keys(l)),o==="step"?n.debugStep(e):o==="continue"?n.debugContinue(e):n.debugStop(e)};return i.jsxs("div",{className:"flex items-center gap-1 px-4 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[i.jsx("span",{className:"text-[11px] font-semibold mr-1",style:{color:"var(--text-muted)"},children:"Debug"}),i.jsx(hr,{label:"Step",onClick:()=>a("step"),disabled:!s,color:"var(--info)",active:s}),i.jsx(hr,{label:"Continue",onClick:()=>a("continue"),disabled:!s,color:"var(--success)",active:s}),i.jsx(hr,{label:"Stop",onClick:()=>a("stop"),disabled:!s,color:"var(--error)",active:s}),i.jsx("span",{className:"text-[11px] ml-auto truncate",style:{color:s?"var(--accent)":"var(--text-muted)"},children:s?r?`Paused at ${r}`:"Paused":t})]})}function hr({label:e,onClick:t,disabled:n,color:r,active:s}){return i.jsx("button",{onClick:t,disabled:n,className:"px-3 py-1 h-7 text-[11px] font-semibold rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:s?r:"var(--text-muted)",background:s?`color-mix(in srgb, ${r} 10%, transparent)`:"transparent"},onMouseEnter:a=>{n||(a.currentTarget.style.background=`color-mix(in srgb, ${r} 20%, transparent)`)},onMouseLeave:a=>{a.currentTarget.style.background=s?`color-mix(in srgb, ${r} 10%, transparent)`:"transparent"},children:e})}const oo=_.lazy(()=>Di(()=>import("./ChatPanel-22tyOge8.js"),__vite__mapDeps([2,1,3,4]))),_u=[],Nu=[],Su=[],Tu=[];function Cu({run:e,ws:t,isMobile:n}){const r=e.mode==="chat",[s,a]=_.useState(280),[o,l]=_.useState(()=>{const M=localStorage.getItem("chatPanelWidth");return M?parseInt(M,10):380}),[c,u]=_.useState("primary"),[d,p]=_.useState(r?"primary":"traces"),m=_.useRef(null),f=_.useRef(null),x=_.useRef(!1),g=ve(M=>M.traces[e.id]||_u),v=ve(M=>M.logs[e.id]||Nu),y=ve(M=>M.chatMessages[e.id]||Su),b=ve(M=>M.stateEvents[e.id]||Tu),C=ve(M=>M.breakpoints[e.id]);_.useEffect(()=>{t.setBreakpoints(e.id,C?Object.keys(C):[])},[e.id]);const O=_.useCallback(M=>{t.setBreakpoints(e.id,M)},[e.id,t]),L=_.useCallback(M=>{M.preventDefault(),x.current=!0;const w="touches"in M?M.touches[0].clientY:M.clientY,k=s,I=U=>{if(!x.current)return;const q=m.current;if(!q)return;const h="touches"in U?U.touches[0].clientY:U.clientY,F=q.clientHeight-100,$=Math.max(80,Math.min(F,k+(h-w)));a($)},W=()=>{x.current=!1,document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",W),document.removeEventListener("touchmove",I),document.removeEventListener("touchend",W),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",I),document.addEventListener("mouseup",W),document.addEventListener("touchmove",I,{passive:!1}),document.addEventListener("touchend",W)},[s]),N=_.useCallback(M=>{M.preventDefault();const w="touches"in M?M.touches[0].clientX:M.clientX,k=o,I=U=>{const q=f.current;if(!q)return;const h="touches"in U?U.touches[0].clientX:U.clientX,F=q.clientWidth-300,$=Math.max(280,Math.min(F,k+(w-h)));l($)},W=()=>{document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",W),document.removeEventListener("touchmove",I),document.removeEventListener("touchend",W),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("chatPanelWidth",String(o))};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",I),document.addEventListener("mouseup",W),document.addEventListener("touchmove",I,{passive:!1}),document.addEventListener("touchend",W)},[o]),B=r?"Chat":"Events",D=r?"var(--accent)":"var(--success)",R=M=>M==="primary"?D:M==="events"?"var(--success)":"var(--accent)",S=ve(M=>M.activeInterrupt[e.id]??null),T=e.status==="running"?i.jsx("span",{className:"ml-auto text-[11px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:r?"Thinking...":"Running..."}):r&&e.status==="suspended"&&S?i.jsx("span",{className:"ml-auto text-[11px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:"Action Required"}):null;if(n){const M=[{id:"traces",label:"Traces",count:g.length},{id:"primary",label:B},...r?[{id:"events",label:"Events",count:b.length}]:[],{id:"io",label:"I/O"},{id:"logs",label:"Logs",count:v.length}];return i.jsxs("div",{className:"flex flex-col h-full",children:[(e.mode==="debug"||e.status==="suspended"&&!S||C&&Object.keys(C).length>0)&&i.jsx(so,{runId:e.id,status:e.status,ws:t,breakpointNode:e.breakpoint_node}),i.jsx("div",{className:"shrink-0",style:{height:"40vh"},children:i.jsx(Kn,{entrypoint:e.entrypoint,traces:g,runId:e.id,breakpointNode:e.breakpoint_node,breakpointNextNodes:e.breakpoint_next_nodes,onBreakpointChange:O})}),i.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-y shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[M.map(w=>i.jsxs("button",{onClick:()=>p(w.id),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded transition-colors cursor-pointer",style:{color:d===w.id?R(w.id):"var(--text-muted)",background:d===w.id?`color-mix(in srgb, ${R(w.id)} 10%, transparent)`:"transparent"},children:[w.label,w.count!==void 0&&w.count>0&&i.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--text-muted)"},children:w.count})]},w.id)),T]}),i.jsxs("div",{className:"flex-1 overflow-hidden",children:[d==="traces"&&i.jsx($r,{traces:g}),d==="primary"&&(r?i.jsx(_.Suspense,{fallback:i.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:i.jsx("span",{className:"text-xs",children:"Loading chat..."})}),children:i.jsx(oo,{messages:y,runId:e.id,runStatus:e.status,ws:t})}):i.jsx(In,{events:b,runStatus:e.status})),d==="events"&&i.jsx(In,{events:b,runStatus:e.status}),d==="io"&&i.jsx(io,{run:e}),d==="logs"&&i.jsx(no,{logs:v})]})]})}const j=[{id:"primary",label:B},...r?[{id:"events",label:"Events",count:b.length}]:[],{id:"io",label:"I/O"},{id:"logs",label:"Logs",count:v.length}];return i.jsxs("div",{ref:f,className:"flex h-full",children:[i.jsxs("div",{ref:m,className:"flex flex-col flex-1 min-w-0",children:[(e.mode==="debug"||e.status==="suspended"&&!S||C&&Object.keys(C).length>0)&&i.jsx(so,{runId:e.id,status:e.status,ws:t,breakpointNode:e.breakpoint_node}),i.jsx("div",{className:"shrink-0 overflow-hidden",style:{height:s},children:i.jsx(Kn,{entrypoint:e.entrypoint,traces:g,runId:e.id,breakpointNode:e.breakpoint_node,breakpointNextNodes:e.breakpoint_next_nodes,onBreakpointChange:O})}),i.jsx("div",{onMouseDown:L,onTouchStart:L,className:"shrink-0 drag-handle-row"}),i.jsx("div",{className:"flex-1 overflow-hidden",children:i.jsx($r,{traces:g})})]}),i.jsx("div",{onMouseDown:N,onTouchStart:N,className:"shrink-0 drag-handle-col"}),i.jsxs("div",{className:"shrink-0 flex flex-col",style:{width:o,background:"var(--bg-primary)"},children:[i.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[j.map(M=>i.jsxs("button",{onClick:()=>u(M.id),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded transition-colors cursor-pointer",style:{color:c===M.id?R(M.id):"var(--text-muted)",background:c===M.id?`color-mix(in srgb, ${R(M.id)} 10%, transparent)`:"transparent"},onMouseEnter:w=>{c!==M.id&&(w.currentTarget.style.color="var(--text-primary)")},onMouseLeave:w=>{c!==M.id&&(w.currentTarget.style.color="var(--text-muted)")},children:[M.label,M.count!==void 0&&M.count>0&&i.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--text-muted)"},children:M.count})]},M.id)),T]}),i.jsxs("div",{className:"flex-1 overflow-hidden",children:[c==="primary"&&(r?i.jsx(_.Suspense,{fallback:i.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:i.jsx("span",{className:"text-xs",children:"Loading chat..."})}),children:i.jsx(oo,{messages:y,runId:e.id,runStatus:e.status,ws:t})}):i.jsx(In,{events:b,runStatus:e.status})),c==="events"&&i.jsx(In,{events:b,runStatus:e.status}),c==="io"&&i.jsx(io,{run:e}),c==="logs"&&i.jsx(no,{logs:v})]})]})]})}function io({run:e}){return i.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[i.jsx(_t,{title:"Input",copyText:JSON.stringify(e.input_data,null,2),children:i.jsx(ot,{json:JSON.stringify(e.input_data,null,2),className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.output_data&&i.jsx(_t,{title:"Output",copyText:typeof e.output_data=="string"?e.output_data:JSON.stringify(e.output_data,null,2),children:i.jsx(ot,{json:typeof e.output_data=="string"?e.output_data:JSON.stringify(e.output_data,null,2),className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.error&&i.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--error) 40%, var(--border))"},children:[i.jsxs("div",{className:"px-3 py-2 text-xs font-semibold flex items-center gap-2",style:{background:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",color:"var(--error)"},children:[i.jsx("span",{children:"Error"}),i.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"color-mix(in srgb, var(--error) 20%, var(--bg-secondary))"},children:e.error.code}),i.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"color-mix(in srgb, var(--error) 20%, var(--bg-secondary))"},children:e.error.category})]}),i.jsxs("div",{className:"px-3 py-2 text-xs leading-normal",children:[i.jsx("div",{className:"font-semibold mb-2",style:{color:"var(--text-primary)"},children:e.error.title}),i.jsx("pre",{className:"whitespace-pre-wrap font-mono text-[11px] max-w-prose",style:{color:"var(--text-secondary)"},children:e.error.detail})]})]})]})}function ao(){const{reloadPending:e,setReloadPending:t,setEntrypoints:n}=ve(),[r,s]=_.useState(!1);if(!e)return null;const a=async()=>{s(!0);try{await pc();const o=await rs();n(o.map(l=>l.name)),t(!1)}catch(o){console.error("Reload failed:",o)}finally{s(!1)}};return i.jsxs("div",{className:"fixed top-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-3 px-4 py-2 rounded-lg shadow-lg",style:{background:"var(--bg-secondary)",border:"1px solid var(--bg-tertiary)"},children:[i.jsx("span",{className:"text-xs",style:{color:"var(--text-secondary)"},children:"Files changed"}),i.jsx("button",{onClick:a,disabled:r,className:"px-2.5 py-0.5 text-xs font-medium rounded cursor-pointer",style:{background:"var(--accent)",color:"#fff",opacity:r?.6:1},children:r?"Reloading...":"Reload"}),i.jsx("button",{onClick:()=>t(!1),"aria-label":"Dismiss reload prompt",className:"text-xs cursor-pointer px-0.5",style:{color:"var(--text-muted)",background:"none",border:"none"},children:"✕"})]})}let Au=0;const lo=Ot(e=>({toasts:[],addToast:(t,n)=>{const r=String(++Au);e(a=>({toasts:[...a.toasts,{id:r,type:t,message:n}]})),setTimeout(()=>{e(a=>({toasts:a.toasts.filter(o=>o.id!==r)}))},t==="error"?8e3:5e3)},removeToast:t=>{e(n=>({toasts:n.toasts.filter(r=>r.id!==t)}))}})),co={success:{color:"var(--success)",bg:"color-mix(in srgb, var(--success) 10%, var(--bg-elevated))",border:"color-mix(in srgb, var(--success) 30%, var(--border))"},error:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 10%, var(--bg-elevated))",border:"color-mix(in srgb, var(--error) 30%, var(--border))"},info:{color:"var(--info)",bg:"color-mix(in srgb, var(--info) 10%, var(--bg-elevated))",border:"color-mix(in srgb, var(--info) 30%, var(--border))"}};function uo(){const e=lo(n=>n.toasts),t=lo(n=>n.removeToast);return e.length===0?null:i.jsx("div",{className:"fixed bottom-8 right-4 z-[100] flex flex-col gap-2 pointer-events-none",children:e.map(n=>{const r=co[n.type]??co.info;return i.jsxs("div",{className:"pointer-events-auto flex items-center gap-2 px-4 py-2.5 rounded-lg shadow-lg text-xs font-medium max-w-xs animate-[slideIn_0.2s_ease-out]",style:{background:r.bg,border:`1px solid ${r.border}`,color:r.color},children:[i.jsx("span",{className:"flex-1",children:n.message}),i.jsx("button",{onClick:()=>t(n.id),className:"shrink-0 w-5 h-5 flex items-center justify-center rounded cursor-pointer transition-opacity opacity-60 hover:opacity-100",style:{color:r.color,background:"transparent",border:"none"},"aria-label":"Dismiss",children:i.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[i.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),i.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9"})]})})]},n.id)})})}function Mu(e){return e===null?"-":`${Math.round(e*100)}%`}function Iu(e){if(e===null)return"var(--text-muted)";const t=e*100;return t>=80?"var(--success)":t>=50?"var(--warning)":"var(--error)"}const po={pending:{color:"var(--text-muted)",label:"Pending"},running:{color:"var(--info)",label:"Running"},completed:{color:"var(--success)",label:"Completed"},failed:{color:"var(--error)",label:"Failed"}};function fo(){const e=Me(l=>l.evalSets),t=Me(l=>l.evalRuns),{evalSetId:n,evalRunId:r,navigate:s}=it(),a=Object.values(e),o=Object.values(t).sort((l,c)=>new Date(c.start_time??0).getTime()-new Date(l.start_time??0).getTime());return i.jsxs("div",{className:"flex-1 overflow-y-auto",children:[i.jsx("button",{onClick:()=>s("#/evals/new"),className:"w-[calc(100%-24px)] mx-3 mt-2.5 mb-1 px-3 py-1.5 text-[11px] text-center font-medium rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-secondary)"},onMouseEnter:l=>{l.currentTarget.style.color="var(--text-primary)",l.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:l=>{l.currentTarget.style.color="var(--text-secondary)",l.currentTarget.style.borderColor=""},children:"+ New Eval Set"}),i.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Eval Sets"}),a.map(l=>{const c=n===l.id;return i.jsxs("button",{onClick:()=>s(`#/evals/sets/${l.id}`),className:"w-full text-left px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{background:c?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:c?"var(--text-primary)":"var(--text-secondary)",borderLeft:c?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:u=>{c||(u.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:u=>{c||(u.currentTarget.style.background="transparent")},children:[i.jsx("div",{className:"truncate font-medium",children:l.name}),i.jsxs("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-muted)"},children:[l.eval_count," items · ",l.evaluator_ids.length," evaluator",l.evaluator_ids.length!==1?"s":""]})]},l.id)}),a.length===0&&i.jsx("p",{className:"text-[11px] px-3 py-2",style:{color:"var(--text-muted)"},children:"No eval sets yet"}),i.jsx("div",{className:"px-3 pt-4 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"History"}),o.map(l=>{const c=r===l.id,u=po[l.status]??po.pending;return i.jsx("button",{onClick:()=>s(`#/evals/runs/${l.id}`),className:"w-full text-left px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{background:c?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:c?"var(--text-primary)":"var(--text-secondary)",borderLeft:c?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:d=>{c||(d.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:d=>{c||(d.currentTarget.style.background="transparent")},children:i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:u.color}}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("div",{className:"truncate font-medium",children:l.eval_set_name}),i.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-muted)"},children:l.start_time?new Date(l.start_time).toLocaleString():u.label})]}),i.jsx("span",{className:"font-mono shrink-0",style:{color:Iu(l.overall_score)},children:Mu(l.overall_score)})]})},l.id)}),o.length===0&&i.jsx("p",{className:"text-[11px] px-3 py-2",style:{color:"var(--text-muted)"},children:"No eval runs yet"})]})}function mo(e,t=60){const n=typeof e=="string"?e:JSON.stringify(e);return!n||n==="null"?"-":n.length>t?n.slice(0,t)+"...":n}function Ru({evalSetId:e}){const[t,n]=_.useState(null),[r,s]=_.useState(!0),[a,o]=_.useState(null),[l,c]=_.useState(!1),[u,d]=_.useState("io"),p=Me(h=>h.evaluators),m=Me(h=>h.localEvaluators),f=Me(h=>h.updateEvalSetEvaluators),x=Me(h=>h.incrementEvalSetCount),g=Me(h=>h.upsertEvalRun),{navigate:v}=it(),[y,b]=_.useState(!1),[C,O]=_.useState(new Set),[L,N]=_.useState(!1),B=_.useRef(null),[D,R]=_.useState(()=>{const h=localStorage.getItem("evalSetSidebarWidth");return h?parseInt(h,10):320}),[S,T]=_.useState(!1),j=_.useRef(null);_.useEffect(()=>{localStorage.setItem("evalSetSidebarWidth",String(D))},[D]),_.useEffect(()=>{s(!0),o(null),Sc(e).then(h=>{n(h),h.items.length>0&&o(h.items[0].name)}).catch(console.error).finally(()=>s(!1))},[e]);const M=async()=>{c(!0);try{const h=await Tc(e);g(h),v(`#/evals/runs/${h.id}`)}catch(h){console.error(h)}finally{c(!1)}},w=async h=>{if(t)try{await Nc(e,h),n(F=>{if(!F)return F;const $=F.items.filter(E=>E.name!==h);return{...F,items:$,eval_count:$.length}}),x(e,-1),a===h&&o(null)}catch(F){console.error(F)}},k=_.useCallback(()=>{t&&O(new Set(t.evaluator_ids)),b(!0)},[t]),I=h=>{O(F=>{const $=new Set(F);return $.has(h)?$.delete(h):$.add(h),$})},W=async()=>{if(t){N(!0);try{const h=await Mc(e,Array.from(C));n(h),f(e,h.evaluator_ids),b(!1)}catch(h){console.error(h)}finally{N(!1)}}};_.useEffect(()=>{if(!y)return;const h=F=>{B.current&&!B.current.contains(F.target)&&b(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[y]);const U=_.useCallback(h=>{h.preventDefault(),T(!0);const F="touches"in h?h.touches[0].clientX:h.clientX,$=D,E=K=>{const H=j.current;if(!H)return;const re="touches"in K?K.touches[0].clientX:K.clientX,de=H.clientWidth-300,be=Math.max(280,Math.min(de,$+(F-re)));R(be)},se=()=>{T(!1),document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",se),document.removeEventListener("touchmove",E),document.removeEventListener("touchend",se),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",E),document.addEventListener("mouseup",se),document.addEventListener("touchmove",E,{passive:!1}),document.addEventListener("touchend",se)},[D]);if(r)return i.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-sm",children:"Loading..."});if(!t)return i.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Eval set not found"});const q=t.items.find(h=>h.name===a)??null;return i.jsxs("div",{ref:j,className:"flex h-full",children:[i.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[i.jsxs("div",{className:"px-4 h-10 border-b shrink-0 flex items-center gap-4",style:{borderColor:"var(--border)"},children:[i.jsx("h1",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:t.name}),i.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:[t.eval_count," items"]}),i.jsxs("div",{className:"flex gap-1 items-center ml-auto relative",children:[i.jsx("button",{onClick:k,className:"w-7 h-7 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:h=>{h.currentTarget.style.color="var(--text-primary)",h.currentTarget.style.background="var(--bg-secondary)"},onMouseLeave:h=>{h.currentTarget.style.color="var(--text-muted)",h.currentTarget.style.background="transparent"},title:"Edit evaluators","aria-label":"Edit evaluators",children:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"}),i.jsx("path",{d:"m15 5 4 4"})]})}),t.evaluator_ids.map(h=>{const F=p.find($=>$.id===h);return i.jsx("span",{className:"px-1.5 py-0.5 rounded text-[11px] font-medium",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:(F==null?void 0:F.name)??h},h)}),y&&i.jsxs("div",{ref:B,className:"absolute top-full right-0 mt-1 z-50 rounded-md border shadow-lg",style:{background:"var(--bg-primary)",borderColor:"var(--border)",minWidth:220},children:[i.jsx("div",{className:"px-3 py-2 border-b text-[10px] uppercase tracking-wide font-semibold",style:{color:"var(--text-muted)",borderColor:"var(--border)"},children:"Evaluators"}),i.jsx("div",{className:"max-h-48 overflow-y-auto",children:m.length===0?i.jsx("div",{className:"px-3 py-3 text-xs",style:{color:"var(--text-muted)"},children:"No evaluators available"}):m.map(h=>i.jsxs("label",{className:"flex items-center gap-2 px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--border)"},onMouseEnter:F=>{F.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:F=>{F.currentTarget.style.background="transparent"},children:[i.jsx("input",{type:"checkbox",checked:C.has(h.id),onChange:()=>I(h.id),className:"accent-[var(--accent)]"}),i.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:h.name})]},h.id))}),i.jsx("div",{className:"px-3 py-2 border-t flex justify-end",style:{borderColor:"var(--border)"},children:i.jsx("button",{onClick:W,disabled:L,className:"px-3 py-1 text-[11px] font-semibold rounded cursor-pointer transition-colors disabled:opacity-50",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},onMouseEnter:h=>{h.currentTarget.style.background="var(--accent-hover)"},onMouseLeave:h=>{h.currentTarget.style.background="var(--accent)"},children:L?"Saving...":"Update"})})]})]}),i.jsxs("button",{onClick:M,disabled:l,className:"ml-2 px-3 py-1 h-7 text-xs font-semibold rounded border flex items-center gap-1.5 cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--success)",borderColor:"var(--success)",background:"transparent"},onMouseEnter:h=>{l||(h.currentTarget.style.background="color-mix(in srgb, var(--success) 10%, transparent)")},onMouseLeave:h=>{h.currentTarget.style.background="transparent"},title:"Run eval set","aria-label":"Run eval set",children:[i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:i.jsx("polygon",{points:"5,3 19,12 5,21"})}),l?"Running...":"Run"]})]}),i.jsxs("div",{className:"flex items-center px-3 h-7 text-[11px] font-semibold shrink-0 border-b",style:{color:"var(--text-muted)",background:"var(--bg-secondary)",borderColor:"var(--border)"},children:[i.jsx("span",{className:"w-56 shrink-0",children:"Name"}),i.jsx("span",{className:"flex-1 min-w-0",children:"Input"}),i.jsx("span",{className:"w-32 shrink-0 pl-2",children:"Expected Behavior"}),i.jsx("span",{className:"w-32 shrink-0 pl-2",children:"Expected Output"}),i.jsx("span",{className:"w-32 shrink-0 pl-2",children:"Simulation Instr."}),i.jsx("span",{className:"w-8 shrink-0"})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto",children:[t.items.map(h=>{const F=h.name===a;return i.jsxs("button",{onClick:()=>o(F?null:h.name),className:"group w-full text-left px-3 py-1.5 flex items-center text-xs border-b transition-colors cursor-pointer",style:{borderColor:"var(--border)",background:F?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:F?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:$=>{F||($.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:$=>{F||($.currentTarget.style.background="")},children:[i.jsx("span",{className:"w-56 shrink-0 truncate",style:{color:"var(--text-primary)"},children:h.name}),i.jsx("span",{className:"flex-1 min-w-0 truncate font-mono text-[11px]",style:{color:"var(--text-muted)"},children:mo(h.inputs)}),i.jsx("span",{className:"w-32 shrink-0 truncate pl-2 text-[11px]",style:{color:"var(--text-muted)"},children:h.expected_behavior||"-"}),i.jsx("span",{className:"w-32 shrink-0 truncate pl-2 font-mono text-[11px]",style:{color:"var(--text-muted)"},children:mo(h.expected_output,40)}),i.jsx("span",{className:"w-32 shrink-0 truncate pl-2 text-[11px]",style:{color:"var(--text-muted)"},children:h.simulation_instructions||"-"}),i.jsx("span",{role:"button",tabIndex:0,className:"w-8 shrink-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",onClick:$=>{$.stopPropagation(),w(h.name)},onKeyDown:$=>{$.key==="Enter"&&($.stopPropagation(),w(h.name))},style:{color:"var(--text-muted)"},onMouseEnter:$=>{$.currentTarget.style.color="var(--error)"},onMouseLeave:$=>{$.currentTarget.style.color="var(--text-muted)"},title:"Delete item",children:i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[i.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),i.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},h.name)}),t.items.length===0&&i.jsx("div",{className:"flex items-center justify-center py-8 text-[var(--text-muted)] text-xs",children:"No items in this eval set"})]})]}),i.jsx("div",{onMouseDown:U,onTouchStart:U,className:`shrink-0 drag-handle-col${S?"":" transition-all"}`,style:{width:q?3:0,opacity:q?1:0}}),i.jsxs("div",{className:`shrink-0 flex flex-col overflow-hidden${S?"":" transition-[width] duration-200 ease-in-out"}`,style:{width:q?D:0,background:"var(--bg-primary)"},children:[i.jsx("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",minWidth:D},children:["io","evaluators"].map(h=>{const F=u===h,$=h==="io"?"I/O":"Evaluators";return i.jsx("button",{onClick:()=>d(h),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded inline-flex items-center cursor-pointer transition-colors",style:{color:F?"var(--accent)":"var(--text-muted)",background:F?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent",border:"none"},children:$},h)})}),i.jsx("div",{className:"flex-1 overflow-hidden",style:{minWidth:D},children:q?u==="io"?i.jsx(Ou,{item:q}):i.jsx(ju,{item:q,evaluators:p}):null})]})]})}function Ou({item:e}){const t=JSON.stringify(e.inputs,null,2),n=e.expected_output!=null?typeof e.expected_output=="string"?e.expected_output:JSON.stringify(e.expected_output,null,2):null;return i.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[i.jsx(_t,{title:"Input",copyText:t,children:i.jsx(ot,{json:t,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.expected_behavior&&i.jsx(_t,{title:"Expected Behavior",copyText:e.expected_behavior,children:i.jsx("div",{className:"px-3 py-2 text-xs leading-relaxed whitespace-pre-wrap",style:{color:"var(--text-secondary)"},children:e.expected_behavior})}),n&&i.jsx(_t,{title:"Expected Output",copyText:n,children:i.jsx(ot,{json:n,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.simulation_instructions&&i.jsx(_t,{title:"Simulation Instructions",copyText:e.simulation_instructions,children:i.jsx("div",{className:"px-3 py-2 text-xs leading-relaxed whitespace-pre-wrap",style:{color:"var(--text-secondary)"},children:e.simulation_instructions})})]})}function ju({item:e,evaluators:t}){return i.jsx("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:e.evaluator_ids.length>0?i.jsx(i.Fragment,{children:e.evaluator_ids.map(n=>{var a;const r=t.find(o=>o.id===n),s=(a=e.evaluation_criterias)==null?void 0:a[n];return i.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:[i.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[i.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:(r==null?void 0:r.name)??n}),i.jsx("span",{className:"ml-auto text-[10px]",style:{color:"var(--text-muted)"},children:s?"Custom criteria":"Default criteria"})]}),s&&i.jsx("pre",{className:"px-3 py-2 border-t text-[11px] font-mono overflow-x-auto max-h-32 whitespace-pre-wrap break-words",style:{borderColor:"var(--border)",color:"var(--text-secondary)"},children:JSON.stringify(s,null,2)})]},n)})}):i.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:"No evaluators configured for this item"})})}function en(e){return e===null?"-":`${Math.round(e*100)}%`}function wt(e){if(e===null)return"var(--text-muted)";const t=e*100;return t>=80?"var(--success)":t>=50?"var(--warning)":"var(--error)"}function Lu(e,t){if(!e)return"-";const n=new Date(e).getTime(),r=t?new Date(t).getTime():Date.now(),s=Math.round((r-n)/1e3);return s<60?`${s}s`:`${Math.floor(s/60)}m ${s%60}s`}function ho(e){return e.replace(/\s*Evaluator$/i,"")}const go={pending:{color:"var(--text-muted)",bg:"var(--bg-tertiary)",label:"Pending"},running:{color:"var(--info)",bg:"rgba(59,130,246,0.1)",label:"Running"},completed:{color:"var(--success)",bg:"rgba(34,197,94,0.1)",label:"Completed"},failed:{color:"var(--error)",bg:"rgba(239,68,68,0.1)",label:"Failed"}};function Du({evalRunId:e,itemName:t}){const[n,r]=_.useState(null),[s,a]=_.useState(!0),{navigate:o}=it(),l=t??null,[c,u]=_.useState(220),d=_.useRef(null),p=_.useRef(!1),[m,f]=_.useState(()=>{const T=localStorage.getItem("evalSidebarWidth");return T?parseInt(T,10):320}),[x,g]=_.useState(!1),v=_.useRef(null);_.useEffect(()=>{localStorage.setItem("evalSidebarWidth",String(m))},[m]);const y=Me(T=>T.evalRuns[e]),b=Me(T=>T.evaluators);_.useEffect(()=>{a(!0),Hs(e).then(T=>{if(r(T),!t){const j=T.results.find(M=>M.status==="completed")??T.results[0];j&&o(`#/evals/runs/${e}/${encodeURIComponent(j.name)}`)}}).catch(console.error).finally(()=>a(!1))},[e]),_.useEffect(()=>{((y==null?void 0:y.status)==="completed"||(y==null?void 0:y.status)==="failed")&&Hs(e).then(r).catch(console.error)},[y==null?void 0:y.status,e]),_.useEffect(()=>{if(t||!(n!=null&&n.results))return;const T=n.results.find(j=>j.status==="completed")??n.results[0];T&&o(`#/evals/runs/${e}/${encodeURIComponent(T.name)}`)},[n==null?void 0:n.results]);const C=_.useCallback(T=>{T.preventDefault(),p.current=!0;const j="touches"in T?T.touches[0].clientY:T.clientY,M=c,w=I=>{if(!p.current)return;const W=d.current;if(!W)return;const U="touches"in I?I.touches[0].clientY:I.clientY,q=W.clientHeight-100,h=Math.max(80,Math.min(q,M+(U-j)));u(h)},k=()=>{p.current=!1,document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",w),document.removeEventListener("touchend",k),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",w),document.addEventListener("mouseup",k),document.addEventListener("touchmove",w,{passive:!1}),document.addEventListener("touchend",k)},[c]),O=_.useCallback(T=>{T.preventDefault(),g(!0);const j="touches"in T?T.touches[0].clientX:T.clientX,M=m,w=I=>{const W=v.current;if(!W)return;const U="touches"in I?I.touches[0].clientX:I.clientX,q=W.clientWidth-300,h=Math.max(280,Math.min(q,M+(j-U)));f(h)},k=()=>{g(!1),document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",w),document.removeEventListener("touchend",k),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",w),document.addEventListener("mouseup",k),document.addEventListener("touchmove",w,{passive:!1}),document.addEventListener("touchend",k)},[m]);if(s)return i.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-sm",children:"Loading..."});if(!n)return i.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Eval run not found"});const L=y??n,N=go[L.status]??go.pending,B=L.status==="running",D=Object.keys(L.evaluator_scores??{}),R=n.results.find(T=>T.name===l)??null,S=((R==null?void 0:R.traces)??[]).map(T=>({...T,run_id:""}));return i.jsxs("div",{ref:v,className:"flex h-full",children:[i.jsxs("div",{ref:d,className:"flex flex-col flex-1 min-w-0",children:[i.jsxs("div",{className:"px-4 h-10 border-b shrink-0 flex items-center gap-4",style:{borderColor:"var(--border)"},children:[i.jsx("h1",{className:"text-base font-semibold truncate min-w-0",style:{color:"var(--text-primary)"},children:L.eval_set_name}),i.jsx("span",{className:"px-2 py-0.5 rounded text-[11px] font-semibold uppercase tracking-wide",style:{color:N.color,background:N.bg},children:N.label}),i.jsx("span",{className:"text-sm font-bold font-mono",style:{color:wt(L.overall_score)},children:en(L.overall_score)}),i.jsx("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:Lu(L.start_time,L.end_time)}),B&&i.jsxs("div",{className:"flex items-center gap-2 max-w-[160px]",children:[i.jsx("div",{className:"flex-1 h-2 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:i.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${L.progress_total>0?L.progress_completed/L.progress_total*100:0}%`,background:"var(--info)"}})}),i.jsxs("span",{className:"text-[11px] shrink-0",style:{color:"var(--text-muted)"},children:[L.progress_completed,"/",L.progress_total]})]}),D.length>0&&i.jsx("div",{className:"flex gap-3 ml-auto",children:D.map(T=>{const j=b.find(w=>w.id===T),M=L.evaluator_scores[T];return i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:ho((j==null?void 0:j.name)??T)}),i.jsx("div",{className:"w-12 h-2 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:i.jsx("div",{className:"h-full rounded-full",style:{width:`${M*100}%`,background:wt(M)}})}),i.jsx("span",{className:"text-[11px] font-mono",style:{color:wt(M)},children:en(M)})]},T)})})]}),i.jsxs("div",{className:"shrink-0 overflow-hidden flex flex-col",style:{height:c},children:[i.jsxs("div",{className:"flex items-center px-3 h-7 text-[11px] font-semibold shrink-0 border-b",style:{color:"var(--text-muted)",background:"var(--bg-secondary)",borderColor:"var(--border)"},children:[i.jsx("span",{className:"w-5 shrink-0"}),i.jsx("span",{className:"flex-1 min-w-0",children:"Name"}),i.jsx("span",{className:"w-14 shrink-0 text-right",children:"Score"}),D.map(T=>{const j=b.find(M=>M.id===T);return i.jsx("span",{className:"w-36 shrink-0 text-right truncate pl-2",title:(j==null?void 0:j.name)??T,children:ho((j==null?void 0:j.name)??T)},T)}),i.jsx("span",{className:"w-14 shrink-0 text-right",children:"Time"})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto",children:[n.results.map(T=>{const j=T.status==="pending",M=T.status==="failed",w=T.name===l;return i.jsxs("button",{onClick:()=>{o(w?`#/evals/runs/${e}`:`#/evals/runs/${e}/${encodeURIComponent(T.name)}`)},className:"w-full text-left px-3 py-1.5 flex items-center text-xs border-b transition-colors cursor-pointer",style:{borderColor:"var(--border)",background:w?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:w?"2px solid var(--accent)":"2px solid transparent",opacity:j?.5:1},onMouseEnter:k=>{w||(k.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:k=>{w||(k.currentTarget.style.background="")},children:[i.jsx("span",{className:"w-5 shrink-0 flex justify-center",children:i.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:j?"var(--text-muted)":M?"var(--error)":T.overall_score>=.8?"var(--success)":T.overall_score>=.5?"var(--warning)":"var(--error)"}})}),i.jsx("span",{className:"flex-1 min-w-0 truncate",style:{color:"var(--text-primary)"},children:T.name}),i.jsx("span",{className:"w-14 shrink-0 text-right font-mono font-semibold",style:{color:wt(j?null:T.overall_score)},children:j?"-":en(T.overall_score)}),D.map(k=>i.jsx("span",{className:"w-36 shrink-0 text-right font-mono pl-2",style:{color:wt(j?null:T.scores[k]??null)},children:j?"-":en(T.scores[k]??null)},k)),i.jsx("span",{className:"w-14 shrink-0 text-right",style:{color:"var(--text-muted)"},children:T.duration_ms!==null?`${(T.duration_ms/1e3).toFixed(1)}s`:"-"})]},T.name)}),n.results.length===0&&i.jsx("div",{className:"flex items-center justify-center py-8 text-[var(--text-muted)] text-xs",children:B?"Waiting for results...":"No results"})]})]}),i.jsx("div",{onMouseDown:C,onTouchStart:C,className:"shrink-0 drag-handle-row"}),i.jsx("div",{className:"flex-1 overflow-hidden",children:R&&S.length>0?i.jsx($r,{traces:S}):i.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:(R==null?void 0:R.status)==="pending"?"Pending...":"No traces available"})})]}),i.jsx("div",{onMouseDown:O,onTouchStart:O,className:`shrink-0 drag-handle-col${x?"":" transition-all"}`,style:{width:R?3:0,opacity:R?1:0}}),i.jsx(Bu,{width:m,item:R,evaluators:b,isRunning:B,isDragging:x})]})}const Pu=[{id:"score",label:"Score"},{id:"io",label:"I/O"},{id:"logs",label:"Logs"}];function Bu({width:e,item:t,evaluators:n,isRunning:r,isDragging:s}){const[a,o]=_.useState("score"),l=!!t;return i.jsxs("div",{className:`shrink-0 flex flex-col overflow-hidden${s?"":" transition-[width] duration-200 ease-in-out"}`,style:{width:l?e:0,background:"var(--bg-primary)"},children:[i.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",minWidth:e},children:[Pu.map(c=>i.jsx("button",{onClick:()=>o(c.id),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded transition-colors cursor-pointer",style:{color:a===c.id?"var(--accent)":"var(--text-muted)",background:a===c.id?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent",border:"none"},onMouseEnter:u=>{a!==c.id&&(u.currentTarget.style.color="var(--text-primary)")},onMouseLeave:u=>{a!==c.id&&(u.currentTarget.style.color="var(--text-muted)")},children:c.label},c.id)),r&&i.jsx("span",{className:"ml-auto text-[11px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:"Running..."})]}),i.jsx("div",{className:"flex-1 overflow-y-auto",style:{minWidth:e},children:t?t.status==="pending"?i.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:"Pending..."}):i.jsxs(i.Fragment,{children:[t.status==="failed"&&i.jsxs("div",{className:"mx-2 mt-2 px-3 py-2 rounded text-xs",style:{background:"rgba(239,68,68,0.1)",color:"var(--error)"},children:[i.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[i.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),i.jsx("path",{d:"M8 4.5v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),i.jsx("circle",{cx:"8",cy:"11",r:"0.75",fill:"currentColor"})]}),i.jsx("span",{children:"Evaluator error"})]}),t.error&&i.jsx("div",{className:"mt-1 pl-[22px] text-[11px] opacity-80 break-words",style:{color:"var(--text-secondary)"},children:t.error})]}),a==="score"?i.jsx(Fu,{item:t,evaluators:n}):a==="io"?i.jsx(zu,{item:t}):i.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:"Logs coming soon"})]}):null})]})}function Fu({item:e,evaluators:t}){const n=Object.keys(e.scores);return i.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[i.jsx("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:i.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[i.jsx("span",{className:"truncate text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"Overall"}),i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("div",{className:"w-24 h-2.5 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:i.jsx("div",{className:"h-full rounded-full",style:{width:`${e.overall_score*100}%`,background:wt(e.overall_score)}})}),i.jsx("span",{className:"text-xs font-mono font-bold shrink-0 w-10 text-right",style:{color:wt(e.overall_score)},children:en(e.overall_score)})]})]})}),e.status==="failed"&&n.length===0&&i.jsx("div",{className:"px-3 py-3 text-xs text-center",style:{color:"var(--text-muted)"},children:"All evaluators failed — no scores available"}),n.map(r=>{const s=t.find(l=>l.id===r),a=e.scores[r],o=e.justifications[r];return i.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:[i.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[i.jsx("span",{className:"truncate text-[11px] font-semibold",style:{color:"var(--text-primary)"},title:(s==null?void 0:s.name)??r,children:(s==null?void 0:s.name)??r}),i.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[i.jsx("div",{className:"w-24 h-2.5 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:i.jsx("div",{className:"h-full rounded-full",style:{width:`${a*100}%`,background:wt(a)}})}),i.jsx("span",{className:"text-xs font-mono font-bold shrink-0 w-10 text-right",style:{color:wt(a)},children:en(a)})]})]}),o&&i.jsx(Uu,{text:o})]},r)})]})}function zu({item:e}){const t=JSON.stringify(e.inputs,null,2),n=typeof e.output=="string"?e.output:JSON.stringify(e.output,null,2),r=e.expected_output!=null?typeof e.expected_output=="string"?e.expected_output:JSON.stringify(e.expected_output,null,2):null;return i.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[i.jsx(_t,{title:"Input",copyText:t,children:i.jsx(ot,{json:t,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),r&&i.jsx(_t,{title:"Expected Output",copyText:r,children:i.jsx(ot,{json:r,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),i.jsx(_t,{title:"Output",copyText:n,trailing:e.duration_ms!==null?i.jsxs("span",{className:"ml-auto text-[10px]",style:{color:"var(--text-muted)"},children:[(e.duration_ms/1e3).toFixed(2),"s"]}):void 0,children:i.jsx(ot,{json:n,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})})]})}function $u(e){var s;const t=e.match(/expected="(.+?)"\s+actual="(.+?)"(.*)/s);if(!t)return null;const n={},r=((s=t[3])==null?void 0:s.trim())??"";if(r)for(const a of r.match(/(\w+)=([\S]+)/g)??[]){const o=a.indexOf("=");n[a.slice(0,o)]=a.slice(o+1)}return{expected:t[1],actual:t[2],meta:n}}function xo(e){try{const t=e.replace(/'/g,'"').replace(/\bTrue\b/g,"true").replace(/\bFalse\b/g,"false").replace(/\bNone\b/g,"null"),n=JSON.parse(t);return JSON.stringify(n,null,2)}catch{return e}}function Uu({text:e}){const t=$u(e);if(!t)return i.jsx("div",{className:"px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:i.jsx("div",{className:"text-xs leading-relaxed",style:{color:"var(--text-secondary)"},children:e})});const n=xo(t.expected),r=xo(t.actual),s=n===r;return i.jsxs("div",{className:"border-t",style:{borderColor:"var(--border)"},children:[i.jsxs("div",{className:"grid grid-cols-2 gap-0",children:[i.jsxs("div",{className:"px-3 py-2 border-r",style:{borderColor:"var(--border)"},children:[i.jsx("div",{className:"text-[10px] font-semibold mb-1",style:{color:"var(--text-muted)"},children:"Expected"}),i.jsx("pre",{className:"text-[11px] font-mono whitespace-pre-wrap break-words",style:{color:"var(--text-secondary)"},children:n})]}),i.jsxs("div",{className:"px-3 py-2",children:[i.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[i.jsx("span",{className:"text-[10px] font-semibold",style:{color:"var(--text-muted)"},children:"Actual"}),i.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:s?"var(--success)":"var(--error)"}})]}),i.jsx("pre",{className:"text-[11px] font-mono whitespace-pre-wrap break-words",style:{color:s?"var(--success)":"var(--error)"},children:r})]})]}),Object.keys(t.meta).length>0&&i.jsx("div",{className:"px-3 py-1.5 border-t flex items-center gap-3",style:{borderColor:"var(--border)"},children:Object.entries(t.meta).map(([a,o])=>i.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:[i.jsx("span",{className:"font-medium",children:a.replace(/_/g," ")})," ",i.jsx("span",{className:"font-mono",children:o})]},a))})]})}const bo={deterministic:"var(--success)",llm:"#a78bfa",tool:"var(--info)"};function yo(){const e=Me(f=>f.localEvaluators),t=Me(f=>f.addEvalSet),{navigate:n}=it(),[r,s]=_.useState(""),[a,o]=_.useState(new Set),[l,c]=_.useState(null),[u,d]=_.useState(!1),p=f=>{o(x=>{const g=new Set(x);return g.has(f)?g.delete(f):g.add(f),g})},m=async()=>{if(r.trim()){c(null),d(!0);try{const f=await wc({name:r.trim(),evaluator_refs:Array.from(a)});t(f),n(`#/evals/sets/${f.id}`)}catch(f){c(f.detail||f.message||"Failed to create eval set")}finally{d(!1)}}};return i.jsx("div",{className:"flex items-center justify-center h-full",children:i.jsxs("div",{className:"w-full max-w-xl px-6",children:[i.jsxs("div",{className:"mb-8 text-center",children:[i.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[i.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}}),i.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"New Eval Set"})]}),i.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"Create an evaluation set with a name and evaluators"})]}),i.jsxs("div",{className:"mb-6",children:[i.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Name"}),i.jsx("input",{type:"text",value:r,onChange:f=>s(f.target.value),placeholder:"e.g. Basic QA Tests",className:"w-full rounded-md px-3 py-2 text-xs",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},onKeyDown:f=>{f.key==="Enter"&&r.trim()&&m()}})]}),i.jsxs("div",{className:"mb-6",children:[i.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Evaluators"}),e.length===0?i.jsxs("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:["No evaluators configured."," ",i.jsx("button",{onClick:()=>n("#/evaluators/new"),className:"underline cursor-pointer",style:{color:"var(--accent)",background:"none",border:"none",padding:0,font:"inherit"},children:"Create one first"})]}):i.jsx("div",{className:"rounded-md border overflow-hidden",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:e.map(f=>i.jsxs("label",{className:"flex items-center gap-2.5 px-3 py-2 text-xs cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--border)"},onMouseEnter:x=>{x.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:x=>{x.currentTarget.style.background="transparent"},children:[i.jsx("input",{type:"checkbox",checked:a.has(f.id),onChange:()=>p(f.id),className:"accent-[var(--accent)]"}),i.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:f.name}),i.jsx("span",{className:"text-[11px] font-medium px-1.5 py-0.5 rounded",style:{background:`color-mix(in srgb, ${bo[f.type]??"var(--text-muted)"} 15%, transparent)`,color:bo[f.type]??"var(--text-muted)"},children:f.type})]},f.id))})]}),l&&i.jsx("p",{className:"text-xs mb-4 px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:l}),i.jsx("button",{onClick:m,disabled:!r.trim()||u,className:"w-full py-2 rounded-md text-[13px] font-semibold transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},children:u?"Creating...":"Create Eval Set"})]})})}const Hu=[{type:"deterministic",label:"Deterministic",badgeColor:"var(--success)"},{type:"llm",label:"LLM Judge",badgeColor:"#a78bfa"},{type:"tool",label:"Tool-Based",badgeColor:"var(--info)"}];function vo(){const e=Me(a=>a.localEvaluators),{evaluatorFilter:t,evaluatorCreateType:n,navigate:r}=it(),s=!t&&!n;return i.jsxs(i.Fragment,{children:[i.jsx("button",{onClick:()=>r("#/evaluators/new"),className:"mx-3 mt-2.5 mb-1 px-3 py-1.5 text-[11px] font-medium rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-secondary)"},onMouseEnter:a=>{a.currentTarget.style.color="var(--text-primary)",a.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:a=>{a.currentTarget.style.color="var(--text-secondary)",a.currentTarget.style.borderColor=""},children:"+ New Evaluator"}),i.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Categories"}),i.jsxs("div",{className:"flex-1 overflow-y-auto",children:[i.jsxs("button",{onClick:()=>r("#/evaluators"),className:"w-full text-left px-3 py-2 text-xs flex items-center gap-2 cursor-pointer transition-colors",style:{background:s?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:s?"var(--text-primary)":"var(--text-secondary)",borderLeft:s?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:a=>{s||(a.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:a=>{s||(a.currentTarget.style.background="transparent")},children:[i.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:"var(--text-muted)"}}),i.jsx("span",{className:"flex-1 truncate",children:"All"}),e.length>0&&i.jsx("span",{className:"text-[10px] px-1.5 rounded-full",style:{background:"var(--bg-tertiary)",color:"var(--text-muted)"},children:e.length})]}),Hu.map(a=>{const o=e.filter(c=>c.type===a.type).length,l=t===a.type;return i.jsxs("button",{onClick:()=>r(l?"#/evaluators":`#/evaluators/category/${a.type}`),className:"w-full text-left px-3 py-2 text-xs flex items-center gap-2 cursor-pointer transition-colors",style:{background:l?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:l?"var(--text-primary)":"var(--text-secondary)",borderLeft:l?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:c=>{l||(c.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:c=>{l||(c.currentTarget.style.background="transparent")},children:[i.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:a.badgeColor}}),i.jsx("span",{className:"flex-1 truncate",children:a.label}),o>0&&i.jsx("span",{className:"text-[10px] px-1.5 rounded-full",style:{background:"var(--bg-tertiary)",color:"var(--text-muted)"},children:o})]},a.type)})]})]})}const ko={deterministic:{label:"Deterministic",color:"var(--success)",bg:"rgba(34,197,94,0.1)"},llm:{label:"LLM Judge",color:"#a78bfa",bg:"rgba(167,139,250,0.1)"},tool:{label:"Tool-Based",color:"var(--info)",bg:"rgba(59,130,246,0.1)"}},Ur={deterministic:"Deterministic",llm:"LLM Judge",tool:"Tool-Based"},pn={deterministic:[{id:"uipath-exact-match",name:"Exact Match"},{id:"uipath-contains",name:"Contains"},{id:"uipath-json-similarity",name:"JSON Similarity"}],llm:[{id:"uipath-llm-judge-output-semantic-similarity",name:"LLM Judge Output"},{id:"uipath-llm-judge-output-strict-json-similarity",name:"LLM Judge Strict JSON"},{id:"uipath-llm-judge-trajectory-similarity",name:"LLM Judge Trajectory"},{id:"uipath-llm-judge-trajectory-simulation",name:"LLM Judge Trajectory Simulation"}],tool:[{id:"uipath-tool-call-order",name:"Tool Call Order"},{id:"uipath-tool-call-args",name:"Tool Call Args"},{id:"uipath-tool-call-count",name:"Tool Call Count"},{id:"uipath-tool-call-output",name:"Tool Call Output"}]};function Hi(e){return e.includes("trajectory")?{targetOutputKey:!1,prompt:!0}:e.includes("llm-judge")?{targetOutputKey:!0,prompt:!0}:e.includes("tool-call-output")?{targetOutputKey:!0,prompt:!1}:e.includes("exact-match")||e.includes("contains")||e.includes("json-similarity")?{targetOutputKey:!0,prompt:!1}:{targetOutputKey:!1,prompt:!1}}const gr={"uipath-exact-match":{description:"Checks whether the agent output exactly matches the expected output.",prompt:""},"uipath-contains":{description:"Checks whether the agent output contains the expected substring.",prompt:""},"uipath-json-similarity":{description:"Compares JSON structures for semantic similarity, ignoring key ordering and whitespace.",prompt:""},"uipath-llm-judge-output-semantic-similarity":{description:"Uses an LLM to score semantic similarity between the agent's actual output and the expected output, accounting for synonyms, paraphrases, and equivalent expressions.",prompt:`As an expert evaluator, analyze the semantic similarity between the expected and actual outputs and determine a score from 0 to 100. Focus on comparing meaning and contextual equivalence of corresponding fields, accounting for alternative valid expressions, synonyms, and reasonable variations in language while maintaining high standards for accuracy and completeness. Provide your score with a brief justification. +---- +ExpectedOutput: +{{ExpectedOutput}} +---- +ActualOutput: +{{ActualOutput}}`},"uipath-llm-judge-output-strict-json-similarity":{description:"Uses an LLM to perform strict structural and value comparison between JSON outputs, checking key names, nesting, types, and values.",prompt:`As an expert evaluator, perform a strict comparison of the expected and actual JSON outputs and determine a score from 0 to 100. Check that all keys are present, values match in type and content, and nesting structure is preserved. Minor formatting differences (whitespace, key ordering) should not affect the score. Provide your score with a brief justification. +---- +ExpectedOutput: +{{ExpectedOutput}} +---- +ActualOutput: +{{ActualOutput}}`},"uipath-llm-judge-trajectory-similarity":{description:"Uses an LLM to evaluate whether the agent's tool-call trajectory matches the expected sequence of actions, considering order, arguments, and completeness.",prompt:`As an expert evaluator, compare the agent's actual tool-call trajectory against the expected trajectory and determine a score from 0 to 100. Consider the order of tool calls, the correctness of arguments passed, and whether all expected steps were completed. Minor variations in argument formatting are acceptable if semantically equivalent. Provide your score with a brief justification. +---- +ExpectedTrajectory: +{{ExpectedTrajectory}} +---- +ActualTrajectory: +{{ActualTrajectory}}`},"uipath-llm-judge-trajectory-simulation":{description:"Uses an LLM to evaluate the agent's behavior against simulation instructions and expected outcomes by analyzing the full run history.",prompt:`As an expert evaluator, determine how well the agent performed on a scale of 0 to 100. Focus on whether the simulation was successful and whether the agent behaved according to the expected output, accounting for alternative valid expressions and reasonable variations in language while maintaining high standards for accuracy and completeness. Provide your score with a brief justification. +---- +UserOrSyntheticInputGivenToAgent: +{{UserOrSyntheticInput}} +---- +SimulationInstructions: +{{SimulationInstructions}} +---- +ExpectedAgentBehavior: +{{ExpectedAgentBehavior}} +---- +AgentRunHistory: +{{AgentRunHistory}}`},"uipath-tool-call-order":{description:"Validates that the agent called tools in the expected sequence.",prompt:""},"uipath-tool-call-args":{description:"Checks whether the agent called tools with the expected arguments.",prompt:""},"uipath-tool-call-count":{description:"Validates that the agent made the expected number of tool calls.",prompt:""},"uipath-tool-call-output":{description:"Validates the output returned by the agent's tool calls.",prompt:""}};function Wu(e){for(const[t,n]of Object.entries(pn))if(n.some(r=>r.id===e))return t;return"deterministic"}function Ku({evaluatorId:e,evaluatorFilter:t}){const n=Me(b=>b.localEvaluators),r=Me(b=>b.setLocalEvaluators),s=Me(b=>b.upsertLocalEvaluator),a=Me(b=>b.evaluators),{navigate:o}=it(),l=e?n.find(b=>b.id===e)??null:null,c=!!l,u=t?n.filter(b=>b.type===t):n,[d,p]=_.useState(()=>{const b=localStorage.getItem("evaluatorSidebarWidth");return b?parseInt(b,10):320}),[m,f]=_.useState(!1),x=_.useRef(null);_.useEffect(()=>{localStorage.setItem("evaluatorSidebarWidth",String(d))},[d]),_.useEffect(()=>{is().then(r).catch(console.error)},[r]);const g=_.useCallback(b=>{b.preventDefault(),f(!0);const C="touches"in b?b.touches[0].clientX:b.clientX,O=d,L=B=>{const D=x.current;if(!D)return;const R="touches"in B?B.touches[0].clientX:B.clientX,S=D.clientWidth-300,T=Math.max(280,Math.min(S,O+(C-R)));p(T)},N=()=>{f(!1),document.removeEventListener("mousemove",L),document.removeEventListener("mouseup",N),document.removeEventListener("touchmove",L),document.removeEventListener("touchend",N),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",L),document.addEventListener("mouseup",N),document.addEventListener("touchmove",L,{passive:!1}),document.addEventListener("touchend",N)},[d]),v=b=>{s(b)},y=()=>{o("#/evaluators")};return i.jsxs("div",{ref:x,className:"flex h-full",children:[i.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[i.jsxs("div",{className:"px-4 h-10 border-b shrink-0 flex items-center gap-4",style:{borderColor:"var(--border)"},children:[i.jsx("h1",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:"Evaluators"}),i.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:[u.length,t?` / ${n.length}`:""," configured"]})]}),i.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:u.length===0?i.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:n.length===0?"No evaluators configured yet.":"No evaluators in this category."}):i.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))"},children:u.map(b=>i.jsx(Gu,{evaluator:b,evaluators:a,selected:b.id===e,onClick:()=>o(b.id===e?"#/evaluators":`#/evaluators/${encodeURIComponent(b.id)}`)},b.id))})})]}),i.jsx("div",{onMouseDown:g,onTouchStart:g,className:`shrink-0 drag-handle-col${m?"":" transition-all"}`,style:{width:c?3:0,opacity:c?1:0}}),i.jsxs("div",{className:`shrink-0 flex flex-col overflow-hidden${m?"":" transition-[width] duration-200 ease-in-out"}`,style:{width:c?d:0,background:"var(--bg-primary)"},children:[i.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",minWidth:d},children:[i.jsx("span",{className:"px-2 py-0.5 h-7 text-xs font-semibold rounded inline-flex items-center",style:{color:"var(--accent)",background:"color-mix(in srgb, var(--accent) 10%, transparent)"},children:"Edit Evaluator"}),i.jsx("button",{onClick:y,"aria-label":"Close editor",className:"ml-auto w-7 h-7 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:b=>{b.currentTarget.style.color="var(--text-primary)"},onMouseLeave:b=>{b.currentTarget.style.color="var(--text-muted)"},children:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[i.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),i.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),i.jsx("div",{className:"flex-1 overflow-hidden",style:{minWidth:d},children:l&&i.jsx(qu,{evaluator:l,onUpdated:v})})]})]})}function Gu({evaluator:e,evaluators:t,selected:n,onClick:r}){const s=ko[e.type]??ko.deterministic,a=t.find(l=>l.id===e.evaluator_type_id),o=e.evaluator_type_id.startsWith("file://");return i.jsxs("div",{className:"rounded-md p-4 flex flex-col cursor-pointer transition-colors",style:{border:n?"1px solid var(--accent)":"1px solid var(--border)",background:n?"color-mix(in srgb, var(--accent) 5%, var(--card-bg))":"var(--card-bg)"},onClick:r,onMouseEnter:l=>{n||(l.currentTarget.style.borderColor="var(--text-muted)")},onMouseLeave:l=>{n||(l.currentTarget.style.borderColor="var(--border)")},children:[i.jsx("div",{className:"text-sm font-semibold",style:{color:"var(--text-primary)"},children:e.name}),e.description&&i.jsx("div",{className:"text-xs leading-relaxed mt-2",style:{color:"var(--text-secondary)"},children:e.description}),i.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-auto pt-3",children:[i.jsxs("span",{className:"px-2 py-0.5 rounded text-[10px] font-medium",style:{color:s.color,background:s.bg},children:["Category: ",s.label]}),i.jsxs("span",{className:"px-2 py-0.5 rounded text-[10px] font-medium",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:["Type: ",o?"Custom":(a==null?void 0:a.name)??e.evaluator_type_id]}),i.jsxs("span",{className:"px-2 py-0.5 rounded text-[10px] font-medium font-mono",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:["Target: ",e.target_output_key||"*"]})]})]})}function qu({evaluator:e,onUpdated:t}){var L,N;const n=Wu(e.evaluator_type_id),r=pn[n]??[],[s,a]=_.useState(e.description),[o,l]=_.useState(e.evaluator_type_id),[c,u]=_.useState(((L=e.config)==null?void 0:L.targetOutputKey)??"*"),[d,p]=_.useState(((N=e.config)==null?void 0:N.prompt)??""),[m,f]=_.useState(!1),[x,g]=_.useState(null),[v,y]=_.useState(!1);_.useEffect(()=>{var B,D;a(e.description),l(e.evaluator_type_id),u(((B=e.config)==null?void 0:B.targetOutputKey)??"*"),p(((D=e.config)==null?void 0:D.prompt)??""),g(null),y(!1)},[e.id]);const b=Hi(o),C=async()=>{f(!0),g(null),y(!1);try{const B={};b.targetOutputKey&&(B.targetOutputKey=c),b.prompt&&d.trim()&&(B.prompt=d);const D=await Ic(e.id,{description:s.trim(),evaluator_type_id:o,config:B});t(D),y(!0),setTimeout(()=>y(!1),2e3)}catch(B){const D=B==null?void 0:B.detail;g(D??"Failed to update evaluator")}finally{f(!1)}},O={background:"var(--bg-secondary)",color:"var(--text-primary)",border:"1px solid var(--border)"};return i.jsxs("div",{className:"flex flex-col h-full",children:[i.jsxs("div",{className:"p-4 overflow-y-auto flex-1 space-y-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Name"}),i.jsx("div",{className:"px-3 py-2 rounded-lg text-xs",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:e.name})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Category"}),i.jsx("div",{className:"px-3 py-2 rounded-lg text-xs",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:Ur[n]??n})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Type"}),i.jsx("select",{value:o,onChange:B=>l(B.target.value),className:"w-full px-3 py-2 rounded-lg text-xs outline-none cursor-pointer",style:O,children:r.map(B=>i.jsx("option",{value:B.id,children:B.name},B.id))})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Description"}),i.jsx("textarea",{value:s,onChange:B=>a(B.target.value),placeholder:"What does this evaluator check?",rows:4,className:"w-full px-3 py-2 rounded-lg text-xs leading-relaxed outline-none resize-y",style:O})]}),b.targetOutputKey&&i.jsxs("div",{children:[i.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Target Output Key"}),i.jsx("input",{type:"text",value:c,onChange:B=>u(B.target.value),placeholder:"*",className:"w-full px-3 py-2 rounded-lg text-xs outline-none",style:O}),i.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-muted)"},children:"Use * for entire output or a specific key name"})]}),b.prompt&&i.jsxs("div",{children:[i.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Prompt"}),i.jsx("textarea",{value:d,onChange:B=>p(B.target.value),placeholder:"Evaluation prompt for the LLM judge...",rows:8,className:"w-full px-3 py-2 rounded-lg text-xs font-mono leading-relaxed outline-none resize-y",style:O})]})]}),i.jsxs("div",{className:"shrink-0 p-4 space-y-2",children:[x&&i.jsx("div",{className:"text-xs px-3 py-2 rounded-lg",style:{background:"rgba(239,68,68,0.1)",color:"var(--error)"},children:x}),v&&i.jsx("div",{className:"text-xs px-3 py-2 rounded-lg",style:{background:"rgba(34,197,94,0.1)",color:"var(--success)"},children:"Saved successfully"}),i.jsx("button",{onClick:C,disabled:m,className:"w-full py-2.5 text-xs font-semibold rounded-md border cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed transition-colors",style:{background:"transparent",borderColor:"var(--accent)",color:"var(--accent)"},onMouseEnter:B=>{B.currentTarget.style.background="color-mix(in srgb, var(--accent) 15%, transparent)"},onMouseLeave:B=>{B.currentTarget.style.background="transparent"},children:m?"Saving...":"Save Changes"})]})]})}const Vu=["deterministic","llm","tool"];function Yu({category:e}){var w;const t=Me(k=>k.addLocalEvaluator),{navigate:n}=it(),r=e!=="any",[s,a]=_.useState(r?e:"deterministic"),o=pn[s]??[],[l,c]=_.useState(""),[u,d]=_.useState(""),[p,m]=_.useState(((w=o[0])==null?void 0:w.id)??""),[f,x]=_.useState("*"),[g,v]=_.useState(""),[y,b]=_.useState(!1),[C,O]=_.useState(null),[L,N]=_.useState(!1),[B,D]=_.useState(!1);_.useEffect(()=>{var q;const k=r?e:"deterministic";a(k);const W=((q=(pn[k]??[])[0])==null?void 0:q.id)??"",U=gr[W];c(""),d((U==null?void 0:U.description)??""),m(W),x("*"),v((U==null?void 0:U.prompt)??""),O(null),N(!1),D(!1)},[e,r]);const R=k=>{var q;a(k);const W=((q=(pn[k]??[])[0])==null?void 0:q.id)??"",U=gr[W];m(W),L||d((U==null?void 0:U.description)??""),B||v((U==null?void 0:U.prompt)??"")},S=k=>{m(k);const I=gr[k];I&&(L||d(I.description),B||v(I.prompt))},T=Hi(p),j=async()=>{if(!l.trim()){O("Name is required");return}b(!0),O(null);try{const k={};T.targetOutputKey&&(k.targetOutputKey=f),T.prompt&&g.trim()&&(k.prompt=g);const I=await Ac({name:l.trim(),description:u.trim(),evaluator_type_id:p,config:k});t(I),n("#/evaluators")}catch(k){const I=k==null?void 0:k.detail;O(I??"Failed to create evaluator")}finally{b(!1)}},M={background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"};return i.jsx("div",{className:"h-full overflow-y-auto",children:i.jsx("div",{className:"flex items-center justify-center min-h-full py-8",children:i.jsxs("div",{className:"w-full max-w-xl px-6",children:[i.jsxs("div",{className:"mb-8 text-center",children:[i.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[i.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}}),i.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"New Evaluator"})]}),i.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"Create an evaluator to score agent outputs"})]}),i.jsxs("div",{className:"mb-6",children:[i.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Name"}),i.jsx("input",{type:"text",value:l,onChange:k=>c(k.target.value),placeholder:"e.g. MyEvaluator",className:"w-full rounded-md px-3 py-2 text-xs",style:M,onKeyDown:k=>{k.key==="Enter"&&l.trim()&&j()}})]}),i.jsxs("div",{className:"mb-6",children:[i.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Category"}),r?i.jsx("div",{className:"px-3 py-2 rounded-md text-xs",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:Ur[s]??s}):i.jsx("select",{value:s,onChange:k=>R(k.target.value),className:"w-full rounded-md px-3 py-2 text-xs cursor-pointer appearance-auto",style:M,children:Vu.map(k=>i.jsx("option",{value:k,children:Ur[k]},k))})]}),i.jsxs("div",{className:"mb-6",children:[i.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Type"}),i.jsx("select",{value:p,onChange:k=>S(k.target.value),className:"w-full rounded-md px-3 py-2 text-xs cursor-pointer appearance-auto",style:M,children:o.map(k=>i.jsx("option",{value:k.id,children:k.name},k.id))})]}),i.jsxs("div",{className:"mb-6",children:[i.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Description"}),i.jsx("textarea",{value:u,onChange:k=>{d(k.target.value),N(!0)},placeholder:"What does this evaluator check?",rows:3,className:"w-full rounded-md px-3 py-2 text-xs leading-relaxed resize-y",style:M})]}),T.targetOutputKey&&i.jsxs("div",{className:"mb-6",children:[i.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Target Output Key"}),i.jsx("input",{type:"text",value:f,onChange:k=>x(k.target.value),placeholder:"*",className:"w-full rounded-md px-3 py-2 text-xs",style:M}),i.jsx("div",{className:"text-xs mt-1",style:{color:"var(--text-muted)"},children:"Use * for entire output or a specific key name"})]}),T.prompt&&i.jsxs("div",{className:"mb-6",children:[i.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Prompt"}),i.jsx("textarea",{value:g,onChange:k=>{v(k.target.value),D(!0)},placeholder:"Evaluation prompt for the LLM judge...",rows:6,className:"w-full rounded-md px-3 py-2 text-xs font-mono leading-relaxed resize-y",style:M})]}),C&&i.jsx("p",{className:"text-xs mb-4 px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:C}),i.jsx("button",{onClick:j,disabled:y||!l.trim(),className:"w-full py-2 rounded-md text-[13px] font-semibold transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},children:y?"Creating...":"Create Evaluator"})]})})})}function Wi({path:e,name:t,type:n,depth:r}){const s=ge(b=>b.children[e]),a=ge(b=>!!b.expanded[e]),o=ge(b=>!!b.loadingDirs[e]),l=ge(b=>!!b.dirty[e]),c=ge(b=>!!b.agentChangedFiles[e]),u=ge(b=>b.selectedFile),{setChildren:d,toggleExpanded:p,setLoadingDir:m,openTab:f}=ge(),{navigate:x}=it(),g=n==="directory",v=!g&&u===e,y=_.useCallback(()=>{g?(!s&&!o&&(m(e,!0),Wn(e).then(b=>d(e,b)).catch(console.error).finally(()=>m(e,!1))),p(e)):(f(e),x(`#/explorer/file/${encodeURIComponent(e)}`))},[g,s,o,e,d,p,m,f,x]);return i.jsxs(i.Fragment,{children:[i.jsxs("button",{onClick:y,className:`w-full text-left flex items-center gap-1 py-[3px] text-[13px] cursor-pointer transition-colors group${c?" agent-changed-file":""}`,style:{paddingLeft:`${12+r*16}px`,paddingRight:"8px",background:v?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:v?"var(--text-primary)":"var(--text-secondary)",border:"none"},onMouseEnter:b=>{v||(b.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:b=>{v||(b.currentTarget.style.background="transparent")},children:[i.jsx("span",{className:"w-3 shrink-0 flex items-center justify-center",style:{color:"var(--text-muted)"},children:g&&i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",style:{transform:a?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s"},children:i.jsx("path",{d:"M3 1.5L7 5L3 8.5z"})})}),i.jsx("span",{className:"shrink-0",style:{color:g?"var(--accent)":"var(--text-muted)"},children:g?i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}):i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),i.jsx("polyline",{points:"14 2 14 8 20 8"})]})}),i.jsx("span",{className:"truncate flex-1",children:t}),l&&i.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{background:"var(--accent)"}}),o&&i.jsx("span",{className:"text-[10px] shrink-0",style:{color:"var(--text-muted)"},children:"..."})]}),g&&a&&s&&s.map(b=>i.jsx(Wi,{path:b.path,name:b.name,type:b.type,depth:r+1},b.path))]})}function Eo(){const e=ge(n=>n.children[""]),{setChildren:t}=ge();return _.useEffect(()=>{e||Wn("").then(n=>t("",n)).catch(console.error)},[e,t]),i.jsx("div",{className:"flex-1 overflow-y-auto py-1",children:e?e.map(n=>i.jsx(Wi,{path:n.path,name:n.name,type:n.type,depth:0},n.path)):i.jsx("p",{className:"text-[11px] px-3 py-2",style:{color:"var(--text-muted)"},children:"Loading..."})})}const yn="/api";async function Xu(){const e=await fetch(`${yn}/agent/models`);if(!e.ok){if(e.status===401)return[];throw new Error(`HTTP ${e.status}`)}return e.json()}async function Zu(e){const t=await fetch(`${yn}/agent/session/${e}/diagnostics`);if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}async function Ju(e){const t=await fetch(`${yn}/agent/session/${e}/state`);if(t.status===404)return null;if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}async function Qu(e){const t=await fetch(`${yn}/agent/session/${e}/raw-state`);if(t.status===404)return null;if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}async function ed(){const e=await fetch(`${yn}/agent/skills`);if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}function td(e,t){const n=e.split(` +`),r=t.split(` +`),s=n.length,a=r.length,o=Array.from({length:s+1},()=>new Array(a+1).fill(0));for(let d=1;d<=s;d++)for(let p=1;p<=a;p++)o[d][p]=n[d-1]===r[p-1]?o[d-1][p-1]+1:Math.max(o[d-1][p],o[d][p-1]);const l=[];let c=s,u=a;for(;c>0||u>0;)c>0&&u>0&&n[c-1]===r[u-1]?(l.push({type:"ctx",text:n[c-1]}),c--,u--):u>0&&(c===0||o[c][u-1]>=o[c-1][u])?(l.push({type:"add",text:r[u-1]}),u--):(l.push({type:"del",text:n[c-1]}),c--);return l.reverse(),l}const nd={del:{bg:"color-mix(in srgb, #ef4444 12%, transparent)",color:"#f87171",prefix:"-"},add:{bg:"color-mix(in srgb, #22c55e 12%, transparent)",color:"#4ade80",prefix:"+"},ctx:{bg:"transparent",color:"var(--text-muted)",prefix:" "}};function as({path:e,oldStr:t,newStr:n}){const r=td(t,n),s=r.filter(o=>o.type==="del").length,a=r.filter(o=>o.type==="add").length;return i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:"var(--text-muted)"},children:"Diff"}),e&&i.jsx("span",{className:"text-[11px] font-mono truncate",style:{color:"var(--text-secondary)"},children:e}),i.jsx("div",{className:"flex-1"}),i.jsxs("span",{className:"text-[11px] font-mono font-medium",style:{color:"#4ade80"},children:["+",a]}),i.jsxs("span",{className:"text-[11px] font-mono font-medium",style:{color:"#f87171"},children:["-",s]})]}),i.jsx("div",{className:"rounded overflow-auto max-h-64",style:{background:"var(--bg-primary)"},children:r.map((o,l)=>{const c=nd[o.type];return i.jsxs("div",{className:"flex",style:{background:c.bg},children:[i.jsx("span",{className:"shrink-0 w-5 text-right pr-1 select-none text-[11px] font-mono leading-relaxed",style:{color:c.color,opacity:.6},children:c.prefix}),i.jsx("pre",{className:"text-[11px] leading-relaxed whitespace-pre-wrap break-words font-mono m-0 pl-1 flex-1",style:{color:c.color},children:o.text})]},l)})})]})}const Gn={user:{border:"#22c55e",fg:"#22c55e",bg:"color-mix(in srgb, #22c55e 8%, transparent)",label:"USER"},assistant:{border:"#a855f7",fg:"#a855f7",bg:"color-mix(in srgb, #a855f7 8%, transparent)",label:"ASSISTANT"},tool:{border:"#f59e0b",fg:"#f59e0b",bg:"color-mix(in srgb, #f59e0b 8%, transparent)",label:"TOOL"},system:{border:"#3b82f6",fg:"#3b82f6",bg:"color-mix(in srgb, #3b82f6 8%, transparent)",label:"SYSTEM"},thinking:{border:"#64748b",fg:"#94a3b8",bg:"color-mix(in srgb, #64748b 6%, transparent)",label:"THINKING"}};function Ki(e){return Gn[e]||Gn.system}function rd(e){return e>=1e3?`${(e/1e3).toFixed(1)}s`:`${e}ms`}function $n(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function Gi(e,t){return e.length<=t?e:e.slice(0,t)+"…"}function qi(e){try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function ls({open:e}){return i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",style:{transition:"transform .12s",transform:e?"rotate(90deg)":"rotate(0)",flexShrink:0,opacity:.5},children:i.jsx("path",{d:"M9 18l6-6-6-6"})})}function sd(){const e=Be(c=>c.sessionId),t=Be(c=>c.status),[n,r]=_.useState(null),[s,a]=_.useState(!1),o=_.useCallback(()=>{e&&(a(!0),Qu(e).then(c=>{c&&r(c)}).catch(console.error).finally(()=>a(!1)))},[e]);if(_.useEffect(()=>{o()},[o]),_.useEffect(()=>{o()},[t,o]),!e)return i.jsx(xr,{text:"No active agent session"});if(!n&&s)return i.jsx(xr,{text:"Loading trace data\\u2026"});if(!n)return i.jsx(xr,{text:"No trace data available"});const l=n.total_prompt_tokens+n.total_completion_tokens;return i.jsxs("div",{className:"flex flex-col h-full",style:{background:"var(--bg-primary)"},children:[i.jsxs("div",{className:"shrink-0 flex items-center gap-3 px-4 h-10 border-b",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[i.jsx("span",{className:"text-[12px] font-bold",style:{color:"var(--text-primary)"},children:"Trace"}),i.jsx(fn,{text:n.model||"?"}),i.jsx(fn,{text:`${n.turn_count} turn${n.turn_count!==1?"s":""}`}),i.jsx(fn,{text:`${$n(l)} tok`}),i.jsx(od,{status:n.status}),i.jsx("div",{className:"flex-1"}),i.jsx("button",{onClick:o,className:"text-[11px] px-2 py-0.5 rounded cursor-pointer",style:{background:"var(--bg-hover)",color:"var(--text-secondary)",border:"none"},children:s?"…":"Refresh"})]}),i.jsxs("div",{className:"flex-1 overflow-y-auto",children:[i.jsx(wo,{label:"System Prompt",children:i.jsx("pre",{className:"text-[11px] leading-relaxed whitespace-pre-wrap break-words font-mono m-0",style:{color:"var(--text-secondary)"},children:n.system_prompt||"(empty)"})}),i.jsx(wo,{label:`Tools (${n.tool_schemas.length})`,children:i.jsx("div",{className:"space-y-0.5",children:n.tool_schemas.map(c=>i.jsxs("div",{className:"flex items-baseline gap-2 py-px",children:[i.jsx("code",{className:"text-[11px] font-semibold shrink-0",style:{color:"var(--accent)"},children:c.function.name}),c.function.description&&i.jsx("span",{className:"text-[11px] truncate",style:{color:"var(--text-muted)"},children:c.function.description})]},c.function.name))})}),n.traces.length===0?i.jsx("div",{className:"px-4 py-10 text-center text-sm",style:{color:"var(--text-muted)"},children:"No spans yet — send a message to the agent."}):n.traces.map((c,u)=>i.jsx(id,{span:c,index:u,defaultOpen:u===n.traces.length-1},u))]})]})}function xr({text:e}){return i.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:i.jsx("p",{className:"text-sm",children:e})})}function fn({text:e}){return i.jsx("span",{className:"text-[11px] px-1.5 py-0.5 rounded",style:{background:"var(--bg-hover)",color:"var(--text-muted)"},children:e})}function od({status:e}){const t=["thinking","executing","awaiting_approval"].includes(e),n=e==="error"?"var(--error)":t?"var(--accent)":"var(--success)";return i.jsxs("span",{className:"flex items-center gap-1 text-[11px]",style:{color:n},children:[i.jsx("span",{className:`w-1.5 h-1.5 rounded-full${t?" animate-pulse":""}`,style:{background:n}}),e]})}function wo({label:e,children:t}){const[n,r]=_.useState(!1);return i.jsxs("div",{className:"border-b",style:{borderColor:"var(--border)"},children:[i.jsxs("button",{onClick:()=>r(!n),className:"w-full flex items-center gap-2 px-4 py-2 cursor-pointer",style:{background:n?"var(--bg-secondary)":"transparent",border:"none"},children:[i.jsx(ls,{open:n}),i.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:e})]}),n&&i.jsx("div",{className:"px-4 pb-3 pt-1",style:{background:"var(--bg-secondary)"},children:t})]})}function id({span:e,index:t,defaultOpen:n}){const[r,s]=_.useState(n),a=e.prompt_tokens+e.completion_tokens,o=e.output_tool_calls.length;return i.jsxs("div",{className:"border-b",style:{borderColor:"var(--border)"},children:[i.jsxs("button",{onClick:()=>s(!r),className:"w-full flex items-center gap-2 px-4 py-2.5 cursor-pointer",style:{background:"transparent",border:"none"},children:[i.jsx(ls,{open:r}),i.jsxs("span",{className:"text-[12px] font-bold tabular-nums w-14 shrink-0",style:{color:"var(--text-primary)"},children:["Turn ",t+1]}),i.jsx(fn,{text:rd(e.duration_ms)}),i.jsx(fn,{text:`${$n(a)} tok`}),o>0&&i.jsxs("span",{className:"text-[11px] px-1.5 py-0.5 rounded font-medium",style:{background:Gn.tool.bg,color:Gn.tool.fg},children:[o," tool",o>1?"s":""]}),i.jsx("div",{className:"flex-1"}),i.jsxs("span",{className:"text-[11px] tabular-nums",style:{color:"var(--text-muted)"},children:[$n(e.prompt_tokens)," in · ",$n(e.completion_tokens)," out"]})]}),r&&i.jsxs("div",{className:"px-4 pb-4",children:[i.jsx(ad,{label:`Input (${e.input_messages.length} messages)`,messages:e.input_messages,defaultOpen:!1}),i.jsxs("div",{className:"flex items-center gap-2 my-3",children:[i.jsx("div",{className:"flex-1 h-px",style:{background:"var(--border)"}}),i.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest",style:{color:"var(--text-muted)"},children:"Response"}),i.jsx("div",{className:"flex-1 h-px",style:{background:"var(--border)"}})]}),i.jsxs("div",{className:"space-y-2",children:[e.output_thinking&&i.jsx(Hr,{role:"thinking",content:e.output_thinking}),e.output_content?i.jsx(Hr,{role:"assistant",content:e.output_content}):e.output_thinking?null:i.jsx("div",{className:"text-[11px] italic pl-3",style:{color:"var(--text-muted)"},children:"(no text output)"})]}),o>0&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex items-center gap-2 my-3",children:[i.jsx("div",{className:"flex-1 h-px",style:{background:"var(--border)"}}),i.jsxs("span",{className:"text-[10px] font-bold uppercase tracking-widest",style:{color:"var(--text-muted)"},children:["Tool Calls (",o,")"]}),i.jsx("div",{className:"flex-1 h-px",style:{background:"var(--border)"}})]}),i.jsx("div",{className:"space-y-2",children:e.output_tool_calls.map((l,c)=>{var d;const u=(d=e.tool_results)==null?void 0:d.find(p=>p.name===l.name);return i.jsx(ld,{name:l.name,args:l.arguments,result:u==null?void 0:u.result},c)})})]})]})]})}function ad({label:e,messages:t,defaultOpen:n}){const[r,s]=_.useState(n),a=4,[o,l]=_.useState(!1),c=r?o?t:t.slice(-a):[],u=t.length-(o?0:Math.min(t.length,a));return i.jsxs("div",{children:[i.jsxs("button",{onClick:()=>s(!r),className:"flex items-center gap-1.5 cursor-pointer mb-2",style:{background:"none",border:"none",padding:0},children:[i.jsx(ls,{open:r}),i.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider",style:{color:"var(--text-muted)"},children:e})]}),r&&i.jsxs("div",{className:"space-y-1.5",children:[!o&&u>0&&i.jsxs("button",{onClick:()=>l(!0),className:"text-[11px] cursor-pointer",style:{color:"var(--accent)",background:"none",border:"none",padding:"2px 12px"},children:["Show ",u," earlier message",u!==1?"s":""]}),c.map((d,p)=>i.jsx(Hr,{role:d.role,content:d.content,toolCalls:d.tool_calls,toolCallId:d.tool_call_id},p))]})]})}function Hr({role:e,content:t,toolCalls:n,toolCallId:r}){const[s,a]=_.useState(!1),o=Ki(e),l=t.length>200,c=l&&!s?Gi(t,200):t,u=!t&&!(n!=null&&n.length);return i.jsxs("div",{className:"rounded",style:{background:o.bg,borderLeft:`3px solid ${o.border}`},children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5",children:[i.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider leading-none",style:{color:o.fg},children:o.label}),r&&i.jsxs("span",{className:"text-[10px] font-mono",style:{color:"var(--text-muted)"},children:[r.slice(0,12),"\\u2026"]}),n&&n.length>0&&i.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:["calls: ",n.map(d=>d.name).join(", ")]}),i.jsx("div",{className:"flex-1"}),(l||(n==null?void 0:n.length))&&i.jsx("button",{onClick:()=>a(!s),className:"text-[11px] cursor-pointer font-medium",style:{color:"var(--accent)",background:"none",border:"none",padding:0},children:s?"Collapse":"Expand"})]}),!u&&i.jsxs("div",{className:"px-3 pb-2",children:[t&&i.jsx("pre",{className:"text-[11px] leading-relaxed whitespace-pre-wrap break-words font-[inherit] m-0",style:{color:e==="thinking"?"var(--text-muted)":"var(--text-secondary)"},children:c}),s&&n&&n.length>0&&i.jsx("div",{className:"mt-2 space-y-1.5",children:n.map((d,p)=>i.jsxs("div",{className:"rounded p-2",style:{background:"var(--bg-secondary)"},children:[i.jsx("code",{className:"text-[11px] font-semibold",style:{color:"var(--accent)"},children:d.name}),i.jsx("pre",{className:"text-[11px] leading-relaxed whitespace-pre-wrap break-words font-mono mt-1 m-0 max-h-32 overflow-auto",style:{color:"var(--text-muted)"},children:qi(d.arguments)})]},p))})]}),u&&i.jsx("div",{className:"px-3 pb-2 text-[11px] italic",style:{color:"var(--text-muted)"},children:"(empty)"})]})}function ld({name:e,args:t,result:n}){const[r,s]=_.useState(!1),a=Ki("tool"),o=e==="edit_file";let l=null;if(o)try{l=JSON.parse(t)}catch{}const c=o&&(l==null?void 0:l.old_string)!=null&&(l==null?void 0:l.new_string)!=null;return i.jsxs("div",{className:"rounded",style:{background:a.bg,borderLeft:`3px solid ${a.border}`},children:[i.jsxs("button",{onClick:()=>s(!r),className:"w-full flex items-center gap-2 px-3 py-1.5 cursor-pointer text-left",style:{background:"none",border:"none"},children:[i.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:a.fg},children:"CALL"}),i.jsx("code",{className:"text-[11px] font-semibold",style:{color:"var(--accent)"},children:e}),o&&(l==null?void 0:l.path)&&i.jsx("span",{className:"text-[11px] font-mono truncate",style:{color:"var(--text-muted)"},children:l.path}),n!==void 0&&!r&&!o&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:"→"}),i.jsx("span",{className:"text-[11px] truncate flex-1 min-w-0",style:{color:"var(--text-secondary)"},children:Gi(n,80)})]}),i.jsx("div",{className:"flex-1"}),n!==void 0&&i.jsx("span",{className:"text-[11px] px-1.5 py-0.5 rounded",style:{background:n.startsWith("Error")?"color-mix(in srgb, var(--error) 12%, transparent)":"color-mix(in srgb, var(--success) 12%, transparent)",color:n.startsWith("Error")?"var(--error)":"var(--success)"},children:n.startsWith("Error")?"failed":"ok"}),i.jsx("span",{className:"text-[11px] font-medium",style:{color:"var(--accent)"},children:r?"Collapse":"Expand"})]}),r&&i.jsxs("div",{className:"px-3 pb-2.5 space-y-2",children:[c?i.jsx(as,{path:l.path||"",oldStr:l.old_string,newStr:l.new_string}):i.jsxs("div",{children:[i.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider mb-1",style:{color:"var(--text-muted)"},children:"Arguments"}),i.jsx("pre",{className:"text-[11px] leading-relaxed whitespace-pre-wrap break-words p-2 rounded overflow-auto max-h-52 font-mono m-0",style:{background:"var(--bg-primary)",color:"var(--text-secondary)"},children:qi(t)})]}),n!==void 0&&i.jsxs("div",{children:[i.jsx("div",{className:"text-[10px] font-bold uppercase tracking-wider mb-1",style:{color:"var(--text-muted)"},children:"Result"}),i.jsx("pre",{className:"text-[11px] leading-relaxed whitespace-pre-wrap break-words p-2 rounded overflow-auto max-h-52 font-mono m-0",style:{background:"var(--bg-primary)",color:"var(--text-secondary)"},children:n})]})]})]})}const br="__agent_state__",_o=e=>{e.editor.defineTheme("uipath-dark",{base:"vs-dark",inherit:!0,rules:[{token:"comment",foreground:"64748b",fontStyle:"italic"},{token:"keyword",foreground:"c084fc"},{token:"string",foreground:"86efac"},{token:"number",foreground:"fcd34d"},{token:"type",foreground:"7dd3fc"}],colors:{"editor.background":"#0f172a","editor.foreground":"#cbd5e1","editor.lineHighlightBackground":"#1e293b","editor.selectionBackground":"#334155","editor.inactiveSelectionBackground":"#263348","editorLineNumber.foreground":"#64748b","editorLineNumber.activeForeground":"#94a3b8","editorCursor.foreground":"#fa4616","editorIndentGuide.background":"#334155","editorIndentGuide.activeBackground":"#64748b","editorWidget.background":"#1e293b","editorWidget.border":"#334155","editorSuggestWidget.background":"#1e293b","editorSuggestWidget.border":"#334155","editorSuggestWidget.selectedBackground":"#263348","editorHoverWidget.background":"#1e293b","editorHoverWidget.border":"#334155","scrollbarSlider.background":"#33415580","scrollbarSlider.hoverBackground":"#33415599","scrollbarSlider.activeBackground":"#334155cc"}}),e.editor.defineTheme("uipath-light",{base:"vs",inherit:!0,rules:[{token:"comment",foreground:"94a3b8",fontStyle:"italic"},{token:"keyword",foreground:"7c3aed"},{token:"string",foreground:"16a34a"},{token:"number",foreground:"d97706"},{token:"type",foreground:"0284c7"}],colors:{"editor.background":"#f8fafc","editor.foreground":"#0f172a","editor.lineHighlightBackground":"#f1f5f9","editor.selectionBackground":"#e2e8f0","editor.inactiveSelectionBackground":"#f1f5f9","editorLineNumber.foreground":"#94a3b8","editorLineNumber.activeForeground":"#475569","editorCursor.foreground":"#fa4616","editorIndentGuide.background":"#e2e8f0","editorIndentGuide.activeBackground":"#94a3b8","editorWidget.background":"#ffffff","editorWidget.border":"#e2e8f0","editorSuggestWidget.background":"#ffffff","editorSuggestWidget.border":"#e2e8f0","editorSuggestWidget.selectedBackground":"#f1f5f9","editorHoverWidget.background":"#ffffff","editorHoverWidget.border":"#e2e8f0","scrollbarSlider.background":"#d1d5db80","scrollbarSlider.hoverBackground":"#d1d5db99","scrollbarSlider.activeBackground":"#d1d5dbcc"}})};function No(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function cd(e){const t=e.replace(/\\/g,"/").split("/");return t[t.length-1]||e}function ud(){const e=ge(M=>M.openTabs),n=ge(M=>M.selectedFile),r=ge(M=>n?M.fileCache[n]:void 0),s=ge(M=>n?!!M.dirty[n]:!1),a=ge(M=>n?M.buffers[n]:void 0),o=ge(M=>M.loadingFile),l=ge(M=>M.dirty),c=ge(M=>M.diffView),u=ge(M=>n?!!M.agentChangedFiles[n]:!1),{setFileContent:d,updateBuffer:p,markClean:m,setLoadingFile:f,openTab:x,closeTab:g,setDiffView:v}=ge(),{navigate:y}=it(),b=Li(M=>M.theme),C=_.useRef(null),{explorerFile:O}=it();_.useEffect(()=>{O&&x(O)},[O,x]),_.useEffect(()=>{!n||n===br||ge.getState().fileCache[n]||(f(!0),Fr(n).then(M=>d(n,M)).catch(console.error).finally(()=>f(!1)))},[n,d,f]);const L=_.useCallback(()=>{if(!n)return;const M=ge.getState().fileCache[n],k=ge.getState().buffers[n]??(M==null?void 0:M.content);k!=null&&mc(n,k).then(()=>{m(n),d(n,{...M,content:k})}).catch(console.error)},[n,m,d]);_.useEffect(()=>{const M=w=>{(w.ctrlKey||w.metaKey)&&w.key==="s"&&(w.preventDefault(),L())};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[L]);const N=M=>{C.current=M},B=_.useCallback(M=>{M!==void 0&&n&&p(n,M)},[n,p]),D=_.useCallback(M=>{x(M),y(`#/explorer/file/${encodeURIComponent(M)}`)},[x,y]),R=_.useCallback((M,w)=>{M.stopPropagation();const k=ge.getState(),I=k.openTabs.filter(W=>W!==w);if(g(w),k.selectedFile===w){const W=k.openTabs.indexOf(w),U=I[Math.min(W,I.length-1)];y(U?`#/explorer/file/${encodeURIComponent(U)}`:"#/explorer")}},[g,y]),S=_.useCallback((M,w)=>{M.button===1&&R(M,w)},[R]),T=e.length>0&&i.jsx("div",{className:"h-10 flex items-end overflow-x-auto shrink-0",style:{background:"var(--bg-secondary)",borderBottom:"1px solid var(--border)"},children:e.map(M=>{const w=M===n,k=!!l[M];return i.jsxs("button",{onClick:()=>D(M),onMouseDown:I=>S(I,M),className:"h-full flex items-center gap-1.5 px-3 text-[12px] shrink-0 cursor-pointer transition-colors relative",style:{background:w?"var(--bg-primary)":"transparent",color:w?"var(--text-primary)":"var(--text-secondary)",border:"none",borderBottom:w?"2px solid var(--accent)":"2px solid transparent",maxWidth:"180px"},onMouseEnter:I=>{w||(I.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:I=>{w||(I.currentTarget.style.background="transparent")},children:[i.jsx("span",{className:"truncate",children:M===br?"Agent Trace":cd(M)}),k?i.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{background:"var(--accent)"},title:"Unsaved changes"}):i.jsx("span",{className:"w-4 h-4 flex items-center justify-center rounded shrink-0 transition-colors",style:{color:"var(--text-muted)"},onClick:I=>R(I,M),onMouseEnter:I=>{I.currentTarget.style.background="var(--bg-hover)",I.currentTarget.style.color="var(--text-primary)"},onMouseLeave:I=>{I.currentTarget.style.background="transparent",I.currentTarget.style.color="var(--text-muted)"},children:i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",children:i.jsx("path",{d:"M8 8.707l3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.708.708L7.293 8l-3.647 3.646.708.708L8 8.707z"})})})]},M)})});if(n===br)return i.jsxs("div",{className:"flex flex-col h-full",children:[T,i.jsx("div",{className:"flex-1 overflow-hidden",children:i.jsx(sd,{})})]});if(!n)return i.jsxs("div",{className:"flex flex-col h-full",children:[T,i.jsx("div",{className:"flex-1 flex items-center justify-center",style:{color:"var(--text-muted)"},children:"Select a file to view"})]});if(o&&!r)return i.jsxs("div",{className:"flex flex-col h-full",children:[T,i.jsx("div",{className:"flex-1 flex items-center justify-center",style:{color:"var(--text-muted)"},children:i.jsx("div",{className:"text-sm",children:"Loading file..."})})]});if(!r&&!o)return i.jsxs("div",{className:"flex flex-col h-full",children:[T,i.jsx("div",{className:"flex-1 flex items-center justify-center",style:{color:"var(--text-muted)"},children:i.jsx("div",{className:"text-sm",children:"Failed to load file"})})]});if(!r)return null;if(r.binary)return i.jsxs("div",{className:"flex flex-col h-full",children:[T,i.jsx("div",{className:"h-8 flex items-center px-3 gap-2 text-xs shrink-0 border-b",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:i.jsx("span",{style:{color:"var(--text-muted)"},children:No(r.size)})}),i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3",style:{color:"var(--text-muted)"},children:[i.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),i.jsx("polyline",{points:"14 2 14 8 20 8"}),i.jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),i.jsx("span",{className:"text-sm",children:"Binary file — preview not available"})]})]});const j=c&&c.path===n;return i.jsxs("div",{className:"flex flex-col h-full",children:[T,i.jsxs("div",{className:"h-8 flex items-center px-3 gap-2 text-xs shrink-0 border-b",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[r.language&&i.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px]",style:{background:"var(--bg-hover)",color:"var(--text-muted)"},children:r.language}),i.jsx("span",{style:{color:"var(--text-muted)"},children:No(r.size)}),u&&i.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium",style:{background:"color-mix(in srgb, var(--info) 20%, transparent)",color:"var(--info)"},children:"Agent modified"}),i.jsx("div",{className:"flex-1"}),s&&i.jsx("span",{className:"text-[10px] font-medium",style:{color:"var(--accent)"},children:"Modified"}),i.jsx("button",{onClick:L,className:"px-2 py-0.5 rounded text-[11px] font-medium cursor-pointer transition-colors",style:{background:s?"var(--accent)":"var(--bg-hover)",color:s?"white":"var(--text-muted)",border:"none"},children:"Save"})]}),j&&i.jsxs("div",{className:"h-8 flex items-center px-3 gap-2 text-xs shrink-0 border-b",style:{borderColor:"var(--border)",background:"color-mix(in srgb, var(--info) 10%, var(--bg-secondary))"},children:[i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--info)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("circle",{cx:"12",cy:"12",r:"10"}),i.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),i.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),i.jsx("span",{style:{color:"var(--info)"},children:"Agent modified this file"}),i.jsx("div",{className:"flex-1"}),i.jsx("button",{onClick:()=>v(null),className:"px-2 py-0.5 rounded text-[11px] font-medium cursor-pointer transition-colors",style:{background:"var(--bg-hover)",color:"var(--text-secondary)",border:"none"},children:"Dismiss"})]}),i.jsx("div",{className:"flex-1 overflow-hidden",children:j?i.jsx($l,{original:c.original,modified:c.modified,language:c.language??"plaintext",theme:b==="dark"?"uipath-dark":"uipath-light",beforeMount:_o,options:{readOnly:!0,minimap:{enabled:!1},fontSize:13,lineNumbersMinChars:4,scrollBeyondLastLine:!1,automaticLayout:!0,renderSideBySide:!0}},`diff-${n}`):i.jsx(Ul,{language:r.language??"plaintext",theme:b==="dark"?"uipath-dark":"uipath-light",value:a??r.content??"",onChange:B,beforeMount:_o,onMount:N,options:{minimap:{enabled:!1},fontSize:13,lineNumbersMinChars:4,scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0,tabSize:2,renderWhitespace:"selection"}},n)})]})}function dd(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const pd=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,fd=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,md={};function So(e,t){return(md.jsx?fd:pd).test(e)}const hd=/[ \t\n\f\r]/g;function gd(e){return typeof e=="object"?e.type==="text"?To(e.value):!1:To(e)}function To(e){return e.replace(hd,"")===""}class vn{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}vn.prototype.normal={};vn.prototype.property={};vn.prototype.space=void 0;function Vi(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new vn(n,r,t)}function Wr(e){return e.toLowerCase()}class Xe{constructor(t,n){this.attribute=n,this.property=t}}Xe.prototype.attribute="";Xe.prototype.booleanish=!1;Xe.prototype.boolean=!1;Xe.prototype.commaOrSpaceSeparated=!1;Xe.prototype.commaSeparated=!1;Xe.prototype.defined=!1;Xe.prototype.mustUseProperty=!1;Xe.prototype.number=!1;Xe.prototype.overloadedBoolean=!1;Xe.prototype.property="";Xe.prototype.spaceSeparated=!1;Xe.prototype.space=void 0;let xd=0;const pe=Kt(),Pe=Kt(),Kr=Kt(),V=Kt(),Ae=Kt(),tn=Kt(),Qe=Kt();function Kt(){return 2**++xd}const Gr=Object.freeze(Object.defineProperty({__proto__:null,boolean:pe,booleanish:Pe,commaOrSpaceSeparated:Qe,commaSeparated:tn,number:V,overloadedBoolean:Kr,spaceSeparated:Ae},Symbol.toStringTag,{value:"Module"})),yr=Object.keys(Gr);class cs extends Xe{constructor(t,n,r,s){let a=-1;if(super(t,n),Co(this,"space",s),typeof r=="number")for(;++a4&&n.slice(0,4)==="data"&&Ed.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Ao,Nd);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Ao.test(a)){let o=a.replace(kd,_d);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=cs}return new s(r,t)}function _d(e){return"-"+e.toLowerCase()}function Nd(e){return e.charAt(1).toUpperCase()}const Sd=Vi([Yi,bd,Ji,Qi,ea],"html"),us=Vi([Yi,yd,Ji,Qi,ea],"svg");function Td(e){return e.join(" ").trim()}var Yt={},vr,Mo;function Cd(){if(Mo)return vr;Mo=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,a=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c=` +`,u="/",d="*",p="",m="comment",f="declaration";function x(v,y){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];y=y||{};var b=1,C=1;function O(w){var k=w.match(t);k&&(b+=k.length);var I=w.lastIndexOf(c);C=~I?w.length-I:C+w.length}function L(){var w={line:b,column:C};return function(k){return k.position=new N(w),R(),k}}function N(w){this.start=w,this.end={line:b,column:C},this.source=y.source}N.prototype.content=v;function B(w){var k=new Error(y.source+":"+b+":"+C+": "+w);if(k.reason=w,k.filename=y.source,k.line=b,k.column=C,k.source=v,!y.silent)throw k}function D(w){var k=w.exec(v);if(k){var I=k[0];return O(I),v=v.slice(I.length),k}}function R(){D(n)}function S(w){var k;for(w=w||[];k=T();)k!==!1&&w.push(k);return w}function T(){var w=L();if(!(u!=v.charAt(0)||d!=v.charAt(1))){for(var k=2;p!=v.charAt(k)&&(d!=v.charAt(k)||u!=v.charAt(k+1));)++k;if(k+=2,p===v.charAt(k-1))return B("End of comment missing");var I=v.slice(2,k-2);return C+=2,O(I),v=v.slice(k),C+=2,w({type:m,comment:I})}}function j(){var w=L(),k=D(r);if(k){if(T(),!D(s))return B("property missing ':'");var I=D(a),W=w({type:f,property:g(k[0].replace(e,p)),value:I?g(I[0].replace(e,p)):p});return D(o),W}}function M(){var w=[];S(w);for(var k;k=j();)k!==!1&&(w.push(k),S(w));return w}return R(),M()}function g(v){return v?v.replace(l,p):p}return vr=x,vr}var Io;function Ad(){if(Io)return Yt;Io=1;var e=Yt&&Yt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.default=n;const t=e(Cd());function n(r,s){let a=null;if(!r||typeof r!="string")return a;const o=(0,t.default)(r),l=typeof s=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:u,value:d}=c;l?s(u,d,c):d&&(a=a||{},a[u]=d)}),a}return Yt}var an={},Ro;function Md(){if(Ro)return an;Ro=1,Object.defineProperty(an,"__esModule",{value:!0}),an.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,a=function(u){return!u||n.test(u)||e.test(u)},o=function(u,d){return d.toUpperCase()},l=function(u,d){return"".concat(d,"-")},c=function(u,d){return d===void 0&&(d={}),a(u)?u:(u=u.toLowerCase(),d.reactCompat?u=u.replace(s,l):u=u.replace(r,l),u.replace(t,o))};return an.camelCase=c,an}var ln,Oo;function Id(){if(Oo)return ln;Oo=1;var e=ln&&ln.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(Ad()),n=Md();function r(s,a){var o={};return!s||typeof s!="string"||(0,t.default)(s,function(l,c){l&&c&&(o[(0,n.camelCase)(l,a)]=c)}),o}return r.default=r,ln=r,ln}var Rd=Id();const Od=ns(Rd),ta=na("end"),ds=na("start");function na(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function jd(e){const t=ds(e),n=ta(e);if(t&&n)return{start:t,end:n}}function mn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?jo(e.position):"start"in e||"end"in e?jo(e):"line"in e||"column"in e?qr(e):""}function qr(e){return Lo(e&&e.line)+":"+Lo(e&&e.column)}function jo(e){return qr(e&&e.start)+"-"+qr(e&&e.end)}function Lo(e){return e&&typeof e=="number"?e:1}class We extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",a={},o=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?s=t:!a.cause&&t&&(o=!0,s=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const l=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=mn(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=o&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}We.prototype.file="";We.prototype.name="";We.prototype.reason="";We.prototype.message="";We.prototype.stack="";We.prototype.column=void 0;We.prototype.line=void 0;We.prototype.ancestors=void 0;We.prototype.cause=void 0;We.prototype.fatal=void 0;We.prototype.place=void 0;We.prototype.ruleId=void 0;We.prototype.source=void 0;const ps={}.hasOwnProperty,Ld=new Map,Dd=/[A-Z]/g,Pd=new Set(["table","tbody","thead","tfoot","tr"]),Bd=new Set(["td","th"]),ra="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Fd(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=qd(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Gd(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?us:Sd,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=sa(s,e,void 0);return a&&typeof a!="string"?a:s.create(e,s.Fragment,{children:a||void 0},void 0)}function sa(e,t,n){if(t.type==="element")return zd(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return $d(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Hd(e,t,n);if(t.type==="mdxjsEsm")return Ud(e,t);if(t.type==="root")return Wd(e,t,n);if(t.type==="text")return Kd(e,t)}function zd(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=us,e.schema=s),e.ancestors.push(t);const a=ia(e,t.tagName,!1),o=Vd(e,t);let l=ms(e,t);return Pd.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!gd(c):!0})),oa(e,o,a,t),fs(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function $d(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}xn(e,t.position)}function Ud(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);xn(e,t.position)}function Hd(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=us,e.schema=s),e.ancestors.push(t);const a=t.name===null?e.Fragment:ia(e,t.name,!0),o=Yd(e,t),l=ms(e,t);return oa(e,o,a,t),fs(o,l),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Wd(e,t,n){const r={};return fs(r,ms(e,t)),e.create(t,e.Fragment,r,n)}function Kd(e,t){return t.value}function oa(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function fs(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Gd(e,t,n){return r;function r(s,a,o,l){const u=Array.isArray(o.children)?n:t;return l?u(a,o,l):u(a,o)}}function qd(e,t){return n;function n(r,s,a,o){const l=Array.isArray(a.children),c=ds(r);return t(s,a,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Vd(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&ps.call(t.properties,s)){const a=Xd(e,s,t.properties[s]);if(a){const[o,l]=a;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Bd.has(t.tagName)?r=l:n[o]=l}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Yd(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const o=a.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else xn(e,t.position);else{const s=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,a=e.evaluater.evaluateExpression(l.expression)}else xn(e,t.position);else a=r.value===null?!0:r.value;n[s]=a}return n}function ms(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:Ld;for(;++rs?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(et(e,e.length,0,t),e):t}const Bo={}.hasOwnProperty;function la(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function dt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ve=Dt(/[A-Za-z]/),He=Dt(/[\dA-Za-z]/),op=Dt(/[#-'*+\--9=?A-Z^-~]/);function qn(e){return e!==null&&(e<32||e===127)}const Vr=Dt(/\d/),ip=Dt(/[\dA-Fa-f]/),ap=Dt(/[!-/:-@[-`{-~]/);function ie(e){return e!==null&&e<-2}function Se(e){return e!==null&&(e<0||e===32)}function xe(e){return e===-2||e===-1||e===32}const tr=Dt(new RegExp("\\p{P}|\\p{S}","u")),Wt=Dt(/\s/);function Dt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function sn(e){const t=[];let n=-1,r=0,s=0;for(;++n55295&&a<57344){const l=e.charCodeAt(n+1);a<56320&&l>56319&&l<57344?(o=String.fromCharCode(a,l),s=1):o="�"}else o=String.fromCharCode(a);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+s+1,o=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function Ee(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let a=0;return o;function o(c){return xe(c)?(e.enter(n),l(c)):t(c)}function l(c){return xe(c)&&a++o))return;const B=t.events.length;let D=B,R,S;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(R){S=t.events[D][1].end;break}R=!0}for(y(r),N=B;NC;){const L=n[O];t.containerState=L[1],L[0].exit.call(t,e)}n.length=C}function b(){s.write([null]),a=void 0,s=void 0,t.containerState._closeFlow=void 0}}function pp(e,t,n){return Ee(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function nn(e){if(e===null||Se(e)||Wt(e))return 1;if(tr(e))return 2}function nr(e,t,n){const r=[];let s=-1;for(;++s1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},m={...e[n][1].start};zo(p,-c),zo(m,c),o={type:c>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=st(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=st(u,[["enter",s,t],["enter",o,t],["exit",o,t],["enter",a,t]]),u=st(u,nr(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=st(u,[["exit",a,t],["enter",l,t],["exit",l,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,u=st(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,et(e,r-1,n-r+3,u),n=r+u.length-d-2;break}}for(n=-1;++n0&&xe(N)?Ee(e,b,"linePrefix",a+1)(N):b(N)}function b(N){return N===null||ie(N)?e.check($o,g,O)(N):(e.enter("codeFlowValue"),C(N))}function C(N){return N===null||ie(N)?(e.exit("codeFlowValue"),b(N)):(e.consume(N),C)}function O(N){return e.exit("codeFenced"),t(N)}function L(N,B,D){let R=0;return S;function S(k){return N.enter("lineEnding"),N.consume(k),N.exit("lineEnding"),T}function T(k){return N.enter("codeFencedFence"),xe(k)?Ee(N,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):j(k)}function j(k){return k===l?(N.enter("codeFencedFenceSequence"),M(k)):D(k)}function M(k){return k===l?(R++,N.consume(k),M):R>=o?(N.exit("codeFencedFenceSequence"),xe(k)?Ee(N,w,"whitespace")(k):w(k)):D(k)}function w(k){return k===null||ie(k)?(N.exit("codeFencedFence"),B(k)):D(k)}}}function _p(e,t,n){const r=this;return s;function s(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const Er={name:"codeIndented",tokenize:Sp},Np={partial:!0,tokenize:Tp};function Sp(e,t,n){const r=this;return s;function s(u){return e.enter("codeIndented"),Ee(e,a,"linePrefix",5)(u)}function a(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?c(u):ie(u)?e.attempt(Np,o,c)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||ie(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),l)}function c(u){return e.exit("codeIndented"),t(u)}}function Tp(e,t,n){const r=this;return s;function s(o){return r.parser.lazy[r.now().line]?n(o):ie(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):Ee(e,a,"linePrefix",5)(o)}function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):ie(o)?s(o):n(o)}}const Cp={name:"codeText",previous:Mp,resolve:Ap,tokenize:Ip};function Ap(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&cn(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),cn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),cn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function ma(e,t,n,r,s,a,o,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return p;function p(y){return y===60?(e.enter(r),e.enter(s),e.enter(a),e.consume(y),e.exit(a),m):y===null||y===32||y===41||qn(y)?n(y):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),g(y))}function m(y){return y===62?(e.enter(a),e.consume(y),e.exit(a),e.exit(s),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(l),m(y)):y===null||y===60||ie(y)?n(y):(e.consume(y),y===92?x:f)}function x(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function g(y){return!d&&(y===null||y===41||Se(y))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(y)):d999||f===null||f===91||f===93&&!c||f===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(f):f===93?(e.exit(a),e.enter(s),e.consume(f),e.exit(s),e.exit(r),t):ie(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),p(f))}function p(f){return f===null||f===91||f===93||ie(f)||l++>999?(e.exit("chunkString"),d(f)):(e.consume(f),c||(c=!xe(f)),f===92?m:p)}function m(f){return f===91||f===92||f===93?(e.consume(f),l++,p):p(f)}}function ga(e,t,n,r,s,a){let o;return l;function l(m){return m===34||m===39||m===40?(e.enter(r),e.enter(s),e.consume(m),e.exit(s),o=m===40?41:m,c):n(m)}function c(m){return m===o?(e.enter(s),e.consume(m),e.exit(s),e.exit(r),t):(e.enter(a),u(m))}function u(m){return m===o?(e.exit(a),c(o)):m===null?n(m):ie(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Ee(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===o||m===null||ie(m)?(e.exit("chunkString"),u(m)):(e.consume(m),m===92?p:d)}function p(m){return m===o||m===92?(e.consume(m),d):d(m)}}function hn(e,t){let n;return r;function r(s){return ie(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):xe(s)?Ee(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const Fp={name:"definition",tokenize:$p},zp={partial:!0,tokenize:Up};function $p(e,t,n){const r=this;let s;return a;function a(f){return e.enter("definition"),o(f)}function o(f){return ha.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function l(f){return s=dt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),c):n(f)}function c(f){return Se(f)?hn(e,u)(f):u(f)}function u(f){return ma(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(zp,p,p)(f)}function p(f){return xe(f)?Ee(e,m,"whitespace")(f):m(f)}function m(f){return f===null||ie(f)?(e.exit("definition"),r.parser.defined.push(s),t(f)):n(f)}}function Up(e,t,n){return r;function r(l){return Se(l)?hn(e,s)(l):n(l)}function s(l){return ga(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function a(l){return xe(l)?Ee(e,o,"whitespace")(l):o(l)}function o(l){return l===null||ie(l)?t(l):n(l)}}const Hp={name:"hardBreakEscape",tokenize:Wp};function Wp(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),s}function s(a){return ie(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const Kp={name:"headingAtx",resolve:Gp,tokenize:qp};function Gp(e,t){let n=e.length-2,r=3,s,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},et(e,r,n-r+1,[["enter",s,t],["enter",a,t],["exit",a,t],["exit",s,t]])),e}function qp(e,t,n){let r=0;return s;function s(d){return e.enter("atxHeading"),a(d)}function a(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||Se(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||ie(d)?(e.exit("atxHeading"),t(d)):xe(d)?Ee(e,l,"whitespace")(d):(e.enter("atxHeadingText"),u(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||Se(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),u)}}const Vp=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ho=["pre","script","style","textarea"],Yp={concrete:!0,name:"htmlFlow",resolveTo:Jp,tokenize:Qp},Xp={partial:!0,tokenize:tf},Zp={partial:!0,tokenize:ef};function Jp(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Qp(e,t,n){const r=this;let s,a,o,l,c;return u;function u(E){return d(E)}function d(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),p}function p(E){return E===33?(e.consume(E),m):E===47?(e.consume(E),a=!0,g):E===63?(e.consume(E),s=3,r.interrupt?t:h):Ve(E)?(e.consume(E),o=String.fromCharCode(E),v):n(E)}function m(E){return E===45?(e.consume(E),s=2,f):E===91?(e.consume(E),s=5,l=0,x):Ve(E)?(e.consume(E),s=4,r.interrupt?t:h):n(E)}function f(E){return E===45?(e.consume(E),r.interrupt?t:h):n(E)}function x(E){const se="CDATA[";return E===se.charCodeAt(l++)?(e.consume(E),l===se.length?r.interrupt?t:j:x):n(E)}function g(E){return Ve(E)?(e.consume(E),o=String.fromCharCode(E),v):n(E)}function v(E){if(E===null||E===47||E===62||Se(E)){const se=E===47,K=o.toLowerCase();return!se&&!a&&Ho.includes(K)?(s=1,r.interrupt?t(E):j(E)):Vp.includes(o.toLowerCase())?(s=6,se?(e.consume(E),y):r.interrupt?t(E):j(E)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):a?b(E):C(E))}return E===45||He(E)?(e.consume(E),o+=String.fromCharCode(E),v):n(E)}function y(E){return E===62?(e.consume(E),r.interrupt?t:j):n(E)}function b(E){return xe(E)?(e.consume(E),b):S(E)}function C(E){return E===47?(e.consume(E),S):E===58||E===95||Ve(E)?(e.consume(E),O):xe(E)?(e.consume(E),C):S(E)}function O(E){return E===45||E===46||E===58||E===95||He(E)?(e.consume(E),O):L(E)}function L(E){return E===61?(e.consume(E),N):xe(E)?(e.consume(E),L):C(E)}function N(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),c=E,B):xe(E)?(e.consume(E),N):D(E)}function B(E){return E===c?(e.consume(E),c=null,R):E===null||ie(E)?n(E):(e.consume(E),B)}function D(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||Se(E)?L(E):(e.consume(E),D)}function R(E){return E===47||E===62||xe(E)?C(E):n(E)}function S(E){return E===62?(e.consume(E),T):n(E)}function T(E){return E===null||ie(E)?j(E):xe(E)?(e.consume(E),T):n(E)}function j(E){return E===45&&s===2?(e.consume(E),I):E===60&&s===1?(e.consume(E),W):E===62&&s===4?(e.consume(E),F):E===63&&s===3?(e.consume(E),h):E===93&&s===5?(e.consume(E),q):ie(E)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(Xp,$,M)(E)):E===null||ie(E)?(e.exit("htmlFlowData"),M(E)):(e.consume(E),j)}function M(E){return e.check(Zp,w,$)(E)}function w(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),k}function k(E){return E===null||ie(E)?M(E):(e.enter("htmlFlowData"),j(E))}function I(E){return E===45?(e.consume(E),h):j(E)}function W(E){return E===47?(e.consume(E),o="",U):j(E)}function U(E){if(E===62){const se=o.toLowerCase();return Ho.includes(se)?(e.consume(E),F):j(E)}return Ve(E)&&o.length<8?(e.consume(E),o+=String.fromCharCode(E),U):j(E)}function q(E){return E===93?(e.consume(E),h):j(E)}function h(E){return E===62?(e.consume(E),F):E===45&&s===2?(e.consume(E),h):j(E)}function F(E){return E===null||ie(E)?(e.exit("htmlFlowData"),$(E)):(e.consume(E),F)}function $(E){return e.exit("htmlFlow"),t(E)}}function ef(e,t,n){const r=this;return s;function s(o){return ie(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a):n(o)}function a(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function tf(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(kn,t,n)}}const nf={name:"htmlText",tokenize:rf};function rf(e,t,n){const r=this;let s,a,o;return l;function l(h){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(h),c}function c(h){return h===33?(e.consume(h),u):h===47?(e.consume(h),L):h===63?(e.consume(h),C):Ve(h)?(e.consume(h),D):n(h)}function u(h){return h===45?(e.consume(h),d):h===91?(e.consume(h),a=0,x):Ve(h)?(e.consume(h),b):n(h)}function d(h){return h===45?(e.consume(h),f):n(h)}function p(h){return h===null?n(h):h===45?(e.consume(h),m):ie(h)?(o=p,W(h)):(e.consume(h),p)}function m(h){return h===45?(e.consume(h),f):p(h)}function f(h){return h===62?I(h):h===45?m(h):p(h)}function x(h){const F="CDATA[";return h===F.charCodeAt(a++)?(e.consume(h),a===F.length?g:x):n(h)}function g(h){return h===null?n(h):h===93?(e.consume(h),v):ie(h)?(o=g,W(h)):(e.consume(h),g)}function v(h){return h===93?(e.consume(h),y):g(h)}function y(h){return h===62?I(h):h===93?(e.consume(h),y):g(h)}function b(h){return h===null||h===62?I(h):ie(h)?(o=b,W(h)):(e.consume(h),b)}function C(h){return h===null?n(h):h===63?(e.consume(h),O):ie(h)?(o=C,W(h)):(e.consume(h),C)}function O(h){return h===62?I(h):C(h)}function L(h){return Ve(h)?(e.consume(h),N):n(h)}function N(h){return h===45||He(h)?(e.consume(h),N):B(h)}function B(h){return ie(h)?(o=B,W(h)):xe(h)?(e.consume(h),B):I(h)}function D(h){return h===45||He(h)?(e.consume(h),D):h===47||h===62||Se(h)?R(h):n(h)}function R(h){return h===47?(e.consume(h),I):h===58||h===95||Ve(h)?(e.consume(h),S):ie(h)?(o=R,W(h)):xe(h)?(e.consume(h),R):I(h)}function S(h){return h===45||h===46||h===58||h===95||He(h)?(e.consume(h),S):T(h)}function T(h){return h===61?(e.consume(h),j):ie(h)?(o=T,W(h)):xe(h)?(e.consume(h),T):R(h)}function j(h){return h===null||h===60||h===61||h===62||h===96?n(h):h===34||h===39?(e.consume(h),s=h,M):ie(h)?(o=j,W(h)):xe(h)?(e.consume(h),j):(e.consume(h),w)}function M(h){return h===s?(e.consume(h),s=void 0,k):h===null?n(h):ie(h)?(o=M,W(h)):(e.consume(h),M)}function w(h){return h===null||h===34||h===39||h===60||h===61||h===96?n(h):h===47||h===62||Se(h)?R(h):(e.consume(h),w)}function k(h){return h===47||h===62||Se(h)?R(h):n(h)}function I(h){return h===62?(e.consume(h),e.exit("htmlTextData"),e.exit("htmlText"),t):n(h)}function W(h){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),U}function U(h){return xe(h)?Ee(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):q(h)}function q(h){return e.enter("htmlTextData"),o(h)}}const xs={name:"labelEnd",resolveAll:lf,resolveTo:cf,tokenize:uf},sf={tokenize:df},of={tokenize:pf},af={tokenize:ff};function lf(e){let t=-1;const n=[];for(;++t=3&&(u===null||ie(u))?(e.exit("thematicBreak"),t(u)):n(u)}function c(u){return u===s?(e.consume(u),r++,c):(e.exit("thematicBreakSequence"),xe(u)?Ee(e,l,"whitespace")(u):l(u))}}const Ye={continuation:{tokenize:wf},exit:Nf,name:"list",tokenize:Ef},vf={partial:!0,tokenize:Sf},kf={partial:!0,tokenize:_f};function Ef(e,t,n){const r=this,s=r.events[r.events.length-1];let a=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return l;function l(f){const x=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Vr(f)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Un,n,u)(f):u(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(f)}return n(f)}function c(f){return Vr(f)&&++o<10?(e.consume(f),c):(!r.interrupt||o<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),u(f)):n(f)}function u(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(kn,r.interrupt?n:d,e.attempt(vf,m,p))}function d(f){return r.containerState.initialBlankLine=!0,a++,m(f)}function p(f){return xe(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),m):n(f)}function m(f){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function wf(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(kn,s,a);function s(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ee(e,t,"listItemIndent",r.containerState.size+1)(l)}function a(l){return r.containerState.furtherBlankLines||!xe(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(kf,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ee(e,e.attempt(Ye,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function _f(e,t,n){const r=this;return Ee(e,s,"listItemIndent",r.containerState.size+1);function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(a):n(a)}}function Nf(e){e.exit(this.containerState.type)}function Sf(e,t,n){const r=this;return Ee(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(a){const o=r.events[r.events.length-1];return!xe(a)&&o&&o[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Wo={name:"setextUnderline",resolveTo:Tf,tokenize:Cf};function Tf(e,t){let n=e.length,r,s,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",a?(e.splice(s,0,["enter",o,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function Cf(e,t,n){const r=this;let s;return a;function a(u){let d=r.events.length,p;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){p=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),s=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===s?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),xe(u)?Ee(e,c,"lineSuffix")(u):c(u))}function c(u){return u===null||ie(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Af={tokenize:Mf};function Mf(e){const t=this,n=e.attempt(kn,r,e.attempt(this.parser.constructs.flowInitial,s,Ee(e,e.attempt(this.parser.constructs.flow,s,e.attempt(jp,s)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const If={resolveAll:ba()},Rf=xa("string"),Of=xa("text");function xa(e){return{resolveAll:ba(e==="text"?jf:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],a=n.attempt(s,o,l);return o;function o(d){return u(d)?a(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return u(d)?(n.exit("data"),a(d)):(n.consume(d),c)}function u(d){if(d===null)return!0;const p=s[d];let m=-1;if(p)for(;++m-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}a>0&&o.push(e[s].slice(0,a))}return o}function qf(e,t){let n=-1;const r=[];let s;for(;++n0){const Ke=ee.tokenStack[ee.tokenStack.length-1];(Ke[1]||Go).call(ee,void 0,Ke[0])}for(G.position={start:Rt(P.length>0?P[0][1].start:{line:1,column:1,offset:0}),end:Rt(P.length>0?P[P.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we0&&(r.className=["language-"+s[0]]);let a={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a}function am(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function lm(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function cm(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=sn(r.toLowerCase()),a=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,u),e.applyData(t,u)}function um(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function dm(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ka(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),a=s[0];a&&a.type==="text"?a.value="["+a.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=r:s.push({type:"text",value:r}),s}function pm(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ka(e,t);const s={src:sn(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,a),e.applyData(t,a)}function fm(e,t){const n={src:sn(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function mm(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function hm(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ka(e,t);const s={href:sn(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const a={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function gm(e,t){const n={href:sn(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function xm(e,t,n){const r=e.all(t),s=n?bm(n):Ea(t),a={},o=[];if(typeof t.checked=="boolean"){const d=r[0];let p;d&&d.type==="element"&&d.tagName==="p"?p=d:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l1}function ym(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=ds(t.children[1]),c=ta(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),s.push(o)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,a),e.applyData(t,a)}function _m(e,t,n){const r=n?n.children:void 0,a=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let c=-1;const u=[];for(;++c0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return a.push(Yo(t.slice(s),s>0,!1)),a.join("")}function Yo(e,t,n){let r=0,s=e.length;if(t){let a=e.codePointAt(r);for(;a===qo||a===Vo;)r++,a=e.codePointAt(r)}if(n){let a=e.codePointAt(s-1);for(;a===qo||a===Vo;)s--,a=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function Tm(e,t){const n={type:"text",value:Sm(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Cm(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Am={blockquote:sm,break:om,code:im,delete:am,emphasis:lm,footnoteReference:cm,heading:um,html:dm,imageReference:pm,image:fm,inlineCode:mm,linkReference:hm,link:gm,listItem:xm,list:ym,paragraph:vm,root:km,strong:Em,table:wm,tableCell:Nm,tableRow:_m,text:Tm,thematicBreak:Cm,toml:Rn,yaml:Rn,definition:Rn,footnoteDefinition:Rn};function Rn(){}const wa=-1,rr=0,gn=1,Vn=2,bs=3,ys=4,vs=5,ks=6,_a=7,Na=8,Xo=typeof self=="object"?self:globalThis,Mm=(e,t)=>{const n=(s,a)=>(e.set(a,s),s),r=s=>{if(e.has(s))return e.get(s);const[a,o]=t[s];switch(a){case rr:case wa:return n(o,s);case gn:{const l=n([],s);for(const c of o)l.push(r(c));return l}case Vn:{const l=n({},s);for(const[c,u]of o)l[r(c)]=r(u);return l}case bs:return n(new Date(o),s);case ys:{const{source:l,flags:c}=o;return n(new RegExp(l,c),s)}case vs:{const l=n(new Map,s);for(const[c,u]of o)l.set(r(c),r(u));return l}case ks:{const l=n(new Set,s);for(const c of o)l.add(r(c));return l}case _a:{const{name:l,message:c}=o;return n(new Xo[l](c),s)}case Na:return n(BigInt(o),s);case"BigInt":return n(Object(BigInt(o)),s);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(new Xo[a](o),s)};return r},Zo=e=>Mm(new Map,e)(0),Xt="",{toString:Im}={},{keys:Rm}=Object,un=e=>{const t=typeof e;if(t!=="object"||!e)return[rr,t];const n=Im.call(e).slice(8,-1);switch(n){case"Array":return[gn,Xt];case"Object":return[Vn,Xt];case"Date":return[bs,Xt];case"RegExp":return[ys,Xt];case"Map":return[vs,Xt];case"Set":return[ks,Xt];case"DataView":return[gn,n]}return n.includes("Array")?[gn,n]:n.includes("Error")?[_a,n]:[Vn,n]},On=([e,t])=>e===rr&&(t==="function"||t==="symbol"),Om=(e,t,n,r)=>{const s=(o,l)=>{const c=r.push(o)-1;return n.set(l,c),c},a=o=>{if(n.has(o))return n.get(o);let[l,c]=un(o);switch(l){case rr:{let d=o;switch(c){case"bigint":l=Na,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return s([wa],o)}return s([l,d],o)}case gn:{if(c){let m=o;return c==="DataView"?m=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(m=new Uint8Array(o)),s([c,[...m]],o)}const d=[],p=s([l,d],o);for(const m of o)d.push(a(m));return p}case Vn:{if(c)switch(c){case"BigInt":return s([c,o.toString()],o);case"Boolean":case"Number":case"String":return s([c,o.valueOf()],o)}if(t&&"toJSON"in o)return a(o.toJSON());const d=[],p=s([l,d],o);for(const m of Rm(o))(e||!On(un(o[m])))&&d.push([a(m),a(o[m])]);return p}case bs:return s([l,o.toISOString()],o);case ys:{const{source:d,flags:p}=o;return s([l,{source:d,flags:p}],o)}case vs:{const d=[],p=s([l,d],o);for(const[m,f]of o)(e||!(On(un(m))||On(un(f))))&&d.push([a(m),a(f)]);return p}case ks:{const d=[],p=s([l,d],o);for(const m of o)(e||!On(un(m)))&&d.push(a(m));return p}}const{message:u}=o;return s([l,{name:c,message:u}],o)};return a},Jo=(e,{json:t,lossy:n}={})=>{const r=[];return Om(!(t||n),!!t,new Map,r)(e),r},Yn=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Zo(Jo(e,t)):structuredClone(e):(e,t)=>Zo(Jo(e,t));function jm(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Lm(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Dm(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||jm,r=e.options.footnoteBackLabel||Lm,s=e.options.footnoteLabel||"Footnotes",a=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c0&&x.push({type:"text",value:" "});let b=typeof n=="string"?n:n(c,f);typeof b=="string"&&(b={type:"text",value:b}),x.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,f),className:["data-footnote-backref"]},children:Array.isArray(b)?b:[b]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const b=v.children[v.children.length-1];b&&b.type==="text"?b.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...x)}else d.push(...x);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(d,!0)};e.patch(u,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:a,properties:{...Yn(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` +`}]}}const En=(function(e){if(e==null)return zm;if(typeof e=="function")return sr(e);if(typeof e=="object")return Array.isArray(e)?Pm(e):Bm(e);if(typeof e=="string")return Fm(e);throw new Error("Expected function, string, or object as test")});function Pm(e){const t=[];let n=-1;for(;++n":""))+")"})}return m;function m(){let f=Sa,x,g,v;if((!t||a(c,u,d[d.length-1]||void 0))&&(f=Wm(n(c,d)),f[0]===Xr))return f;if("children"in c&&c.children){const y=c;if(y.children&&f[0]!==Hm)for(g=(r?y.children.length:-1)+o,v=d.concat(y);g>-1&&g0&&n.push({type:"text",value:` +`}),n}function Qo(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function ei(e,t){const n=Gm(e,t),r=n.one(e,void 0),s=Dm(n),a=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&a.children.push({type:"text",value:` +`},s),a}function Zm(e,t){return e&&"run"in e?async function(n,r){const s=ei(n,{file:r,...t});await e.run(s,r)}:function(n,r){return ei(n,{file:r,...e||t})}}function ti(e){if(e)throw e}var _r,ni;function Jm(){if(ni)return _r;ni=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},a=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var d=e.call(u,"constructor"),p=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!d&&!p)return!1;var m;for(m in u);return typeof m>"u"||e.call(u,m)},o=function(u,d){n&&d.name==="__proto__"?n(u,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):u[d.name]=d.newValue},l=function(u,d){if(d==="__proto__")if(e.call(u,d)){if(r)return r(u,d).value}else return;return u[d]};return _r=function c(){var u,d,p,m,f,x,g=arguments[0],v=1,y=arguments.length,b=!1;for(typeof g=="boolean"&&(b=g,g=arguments[1]||{},v=2),(g==null||typeof g!="object"&&typeof g!="function")&&(g={});vo.length;let c;l&&o.push(s);try{c=e.apply(this,o)}catch(u){const d=u;if(l&&n)throw d;return s(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(a,s):c instanceof Error?s(c):a(c))}function s(o,...l){n||(n=!0,t(o,...l))}function a(o){s(null,o)}}const ht={basename:nh,dirname:rh,extname:sh,join:oh,sep:"/"};function nh(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');wn(e);let n=0,r=-1,s=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else r<0&&(a=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(a){n=s+1;break}}else o<0&&(a=!0,o=s+1),l>-1&&(e.codePointAt(s)===t.codePointAt(l--)?l<0&&(r=s):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function rh(e){if(wn(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function sh(e){wn(e);let t=e.length,n=-1,r=0,s=-1,a=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?s<0?s=t:a!==1&&(a=1):s>-1&&(a=-1)}return s<0||n<0||a===0||a===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function oh(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function ah(e,t){let n="",r=0,s=-1,a=0,o=-1,l,c;for(;++o<=e.length;){if(o2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),s=o,a=0;continue}}else if(n.length>0){n="",r=0,s=o,a=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,a=0}else l===46&&a>-1?a++:a=-1}return n}function wn(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const lh={cwd:ch};function ch(){return"/"}function Qr(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function uh(e){if(typeof e=="string")e=new URL(e);else if(!Qr(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return dh(e)}function dh(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[f,...x]=d;const g=r[m][1];Jr(g)&&Jr(f)&&(f=Nr(!0,g,f)),r[m]=[u,f,...x]}}}}const hh=new Es().freeze();function Ar(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Mr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ir(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function si(e){if(!Jr(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function oi(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function jn(e){return gh(e)?e:new Ca(e)}function gh(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function xh(e){return typeof e=="string"||bh(e)}function bh(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const yh="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ii=[],ai={allowDangerousHtml:!0},vh=/^(https?|ircs?|mailto|xmpp)$/i,kh=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Eh(e){const t=wh(e),n=_h(e);return Nh(t.runSync(t.parse(n),n),e)}function wh(e){const t=e.rehypePlugins||ii,n=e.remarkPlugins||ii,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ai}:ai;return hh().use(rm).use(n).use(Zm,r).use(t)}function _h(e){const t=e.children||"",n=new Ca;return typeof t=="string"&&(n.value=t),n}function Nh(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,a=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||Sh;for(const d of kh)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+yh+d.id,void 0);return or(e,u),Fd(e,{Fragment:i.Fragment,components:s,ignoreInvalidStyle:!0,jsx:i.jsx,jsxs:i.jsxs,passKeys:!0,passNode:!0});function u(d,p,m){if(d.type==="raw"&&m&&typeof p=="number")return o?m.children.splice(p,1):m.children[p]={type:"text",value:d.value},p;if(d.type==="element"){let f;for(f in kr)if(Object.hasOwn(kr,f)&&Object.hasOwn(d.properties,f)){const x=d.properties[f],g=kr[f];(g===null||g.includes(d.tagName))&&(d.properties[f]=c(String(x||""),f,d))}}if(d.type==="element"){let f=n?!n.includes(d.tagName):a?a.includes(d.tagName):!1;if(!f&&r&&typeof p=="number"&&(f=!r(d,p,m)),f&&m&&typeof p=="number")return l&&d.children?m.children.splice(p,1,...d.children):m.children.splice(p,1),p}}}function Sh(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||vh.test(e.slice(0,t))?e:""}const li=(function(e,t,n){const r=En(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tu&&(u=d):d&&(u!==void 0&&u>-1&&c.push(` +`.repeat(u)||" "),u=-1,c.push(d))}return c.join("")}function Ma(e,t,n){return e.type==="element"?jh(e,t,n):e.type==="text"?n.whitespace==="normal"?Ia(e,n):Lh(e):[]}function jh(e,t,n){const r=Ra(e,n),s=e.children||[];let a=-1,o=[];if(Rh(e))return o;let l,c;for(es(e)||pi(e)&&li(t,e,pi)?c=` +`:Ih(e)?(l=2,c=2):Aa(e)&&(l=1,c=1);++a]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},f=t.optional(s)+e.IDENT_RE+"\\s*\\(",x=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:g,keyword:x,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},L={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[L,p,l,n,e.C_BLOCK_COMMENT_MODE,d,u],B={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:N.concat([{begin:/\(/,end:/\)/,keywords:O,contains:N.concat(["self"]),relevance:0}]),relevance:0},D={className:"function",begin:"("+o+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:O,relevance:0},{begin:f,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"",keywords:O,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function $h(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=zh(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function Uh(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},m=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],f=e.SHEBANG({binary:`(${m.join("|")})`,relevance:10}),x={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},b=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],C=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],O=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],L=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:g,literal:v,built_in:[...b,...C,"set","shopt",...O,...L]},contains:[f,e.SHEBANG(),x,p,a,o,y,l,c,u,d,n]}}function Hh(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",o="("+r+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},f=t.optional(s)+e.IDENT_RE+"\\s*\\(",v={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[p,l,n,e.C_BLOCK_COMMENT_MODE,d,u],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},C={begin:"("+o+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:v,relevance:0},{begin:f,returnBegin:!0,contains:[e.inherit(m,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C",aliases:["h"],keywords:v,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:p,strings:u,keywords:v}}}function Wh(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",s="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(s)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:t.optional(s)+e.IDENT_RE,relevance:0},f=t.optional(s)+e.IDENT_RE+"\\s*\\(",x=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:g,keyword:x,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},L={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[L,p,l,n,e.C_BLOCK_COMMENT_MODE,d,u],B={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:N.concat([{begin:/\(/,end:/\)/,keywords:O,contains:N.concat(["self"]),relevance:0}]),relevance:0},D={className:"function",begin:"("+o+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:O,relevance:0},{begin:f,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,u,d,l,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,u,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"",keywords:O,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function Kh(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],s=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],a=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:s.concat(a),built_in:t,literal:r},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=e.inherit(d,{illegal:/\n/}),m={className:"subst",begin:/\{/,end:/\}/,keywords:o},f=e.inherit(m,{illegal:/\n/}),x={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,f]},g={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]},v=e.inherit(g,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]});m.contains=[g,x,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.C_BLOCK_COMMENT_MODE],f.contains=[v,x,p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[u,g,x,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},b={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},C=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",O={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,c,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+C+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,b],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[y,c,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},O]}}const Gh=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),qh=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Vh=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Yh=[...qh,...Vh],Xh=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Zh=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Jh=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Qh=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function eg(e){const t=e.regex,n=Gh(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},s="and or not only",a=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Zh.join("|")+")"},{begin:":(:)?("+Jh.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Qh.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:Xh.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Yh.join("|")+")\\b"}]}}function tg(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function ng(e){const a={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:a,illegal:"Oa(e,t,n-1))}function og(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Oa("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),c={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:c,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:c,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:c,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,fi,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},fi,u]}}const mi="[A-Za-z$_][0-9A-Za-z$_]*",ig=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],ag=["true","false","null","undefined","NaN","Infinity"],ja=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],La=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Da=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],lg=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],cg=[].concat(Da,ja,La);function ug(e){const t=e.regex,n=(U,{after:q})=>{const h="",end:""},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,q)=>{const h=U[0].length+U.index,F=U.input[h];if(F==="<"||F===","){q.ignoreMatch();return}F===">"&&(n(U,{after:h})||q.ignoreMatch());let $;const E=U.input.substring(h);if($=E.match(/^\s*=/)){q.ignoreMatch();return}if(($=E.match(/^\s+extends\s+/))&&$.index===0){q.ignoreMatch();return}}},l={$pattern:mi,keyword:ig,literal:ag,built_in:cg,"variable.language":lg},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},x={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,m]},b={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},C=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,x,g,v,{match:/\$\d+/},p];m.contains=C.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(C)});const O=[].concat(b,m.contains),L=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:L},B={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},D={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...ja,...La]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},S={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},T={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function j(U){return t.concat("(?!",U.join("|"),")")}const M={match:t.concat(/\b/,j([...Da,"super","import"].map(U=>`${U}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},w={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",W={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:D},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,x,g,v,b,{match:/\$\d+/},p,D,{scope:"attr",match:r+t.lookahead(":"),relevance:0},W,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},S,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},w,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},M,T,B,k,{match:/\$[(.]/}]}}function dg(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Jt="[0-9](_*[0-9])*",Pn=`\\.(${Jt})`,Bn="[0-9a-fA-F](_*[0-9a-fA-F])*",pg={className:"number",variants:[{begin:`(\\b(${Jt})((${Pn})|\\.)?|(${Pn}))[eE][+-]?(${Jt})[fFdD]?\\b`},{begin:`\\b(${Jt})((${Pn})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Pn})[fFdD]?\\b`},{begin:`\\b(${Jt})[fFdD]\\b`},{begin:`\\b0[xX]((${Bn})\\.?|(${Bn})?\\.(${Bn}))[pP][+-]?(${Jt})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Bn})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function fg(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},s={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},a={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[a,s]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,a,s]}]};s.contains.push(o);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},c={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},u=pg,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),p={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},m=p;return m.variants[1].contains=[p],p.variants[1].contains=[m],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,r,l,c,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[p,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,l,c,o,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,c]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},u]}}const mg=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),hg=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],gg=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],xg=[...hg,...gg],bg=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Pa=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Ba=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),yg=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),vg=Pa.concat(Ba).sort().reverse();function kg(e){const t=mg(e),n=vg,r="and or not only",s="[\\w-]+",a="("+s+"|@\\{"+s+"\\})",o=[],l=[],c=function(C){return{className:"string",begin:"~?"+C+".*?"+C}},u=function(C,O,L){return{className:C,begin:O,relevance:L}},d={$pattern:/[a-z-]+/,keyword:r,attribute:bg.join(" ")},p={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,c("'"),c('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,p,u("variable","@@?"+s,10),u("variable","@\\{"+s+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:s+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const m=l.concat({begin:/\{/,end:/\}/,contains:o}),f={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},x={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+yg.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:l,relevance:0}},v={className:"variable",variants:[{begin:"@"+s+"\\s*:",relevance:15},{begin:"@"+s}],starts:{end:"[;}]",returnEnd:!0,contains:m}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,u("keyword","all\\b"),u("variable","@\\{"+s+"\\}"),{begin:"\\b("+xg.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,u("selector-tag",a,0),u("selector-id","#"+a),u("selector-class","\\."+a,0),u("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Pa.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Ba.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:m},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:s+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,v,b,x,y,f,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function Eg(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},s=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:s.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:s}].concat(s)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function wg(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},s={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},a={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,c={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=e.inherit(u,{contains:[]}),m=e.inherit(d,{contains:[]});u.contains.push(m),d.contains.push(p);let f=[n,c];return[u,d,p,m].forEach(y=>{y.contains=y.contains.concat(f)}),f=f.concat(u,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:f},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:f}]}]},n,a,u,d,{className:"quote",begin:"^>\\s+",contains:f,end:"$"},s,r,c,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function Ng(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},c={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+c.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:c,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function Sg(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,s={$pattern:/[\w.]+/,keyword:n.join(" ")},a={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:s},o={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},c={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},u={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,a,c],p=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],m=(g,v,y="\\1")=>{const b=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",g,")"),v,/(?:\\.|[^\\\/])*?/,b,/(?:\\.|[^\\\/])*?/,y,r)},f=(g,v,y)=>t.concat(t.concat("(?:",g,")"),v,/(?:\\.|[^\\\/])*?/,y,r),x=[c,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},u,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:m("s|tr|y",t.either(...p,{capture:!0}))},{begin:m("s|tr|y","\\(","\\)")},{begin:m("s|tr|y","\\[","\\]")},{begin:m("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:f("(?:m|qr)?",/\//,/\//)},{begin:f("m|qr",t.either(...p,{capture:!0}),/\1/)},{begin:f("m|qr",/\(/,/\)/)},{begin:f("m|qr",/\[/,/\]/)},{begin:f("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,u]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return a.contains=x,o.contains=x,{name:"Perl",aliases:["pl","pm"],keywords:s,contains:x}}function Tg(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),s=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),a=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+r},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},c={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},u=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(c)}),p={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(c),"on:begin":(w,k)=>{k.data._beginMatch=w[1]||w[2]},"on:end":(w,k)=>{k.data._beginMatch!==w[1]&&k.ignoreMatch()}},m=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),f=`[ +]`,x={scope:"string",variants:[d,u,p,m]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},v=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],b=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],O={keyword:y,literal:(w=>{const k=[];return w.forEach(I=>{k.push(I),I.toLowerCase()===I?k.push(I.toUpperCase()):k.push(I.toLowerCase())}),k})(v),built_in:b},L=w=>w.map(k=>k.replace(/\|\d+$/,"")),N={variants:[{match:[/new/,t.concat(f,"+"),t.concat("(?!",L(b).join("\\b|"),"\\b)"),s],scope:{1:"keyword",4:"title.class"}}]},B=t.concat(r,"\\b(?!\\()"),D={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),B],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[s,t.concat(/::/,t.lookahead(/(?!class\b)/)),B],scope:{1:"title.class",3:"variable.constant"}},{match:[s,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[s,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},R={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},S={relevance:0,begin:/\(/,end:/\)/,keywords:O,contains:[R,o,D,e.C_BLOCK_COMMENT_MODE,x,g,N]},T={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",L(y).join("\\b|"),"|",L(b).join("\\b|"),"\\b)"),r,t.concat(f,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[S]};S.contains.push(T);const j=[R,D,e.C_BLOCK_COMMENT_MODE,x,g,N],M={begin:t.concat(/#\[\s*\\?/,t.either(s,a)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...j]},...j,{scope:"meta",variants:[{match:s},{match:a}]}]};return{case_insensitive:!1,keywords:O,contains:[M,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,T,D,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},N,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:O,contains:["self",M,o,D,e.C_BLOCK_COMMENT_MODE,x,g]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},x,g]}}function Cg(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function Ag(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Mg(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},p={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,d,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},m="[0-9](_?[0-9])*",f=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,x=`\\b|${r.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${f}))[eE][+-]?(${m})[jJ]?(?=${x})`},{begin:`(${f})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${x})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${x})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${x})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${x})`},{begin:`\\b(${m})[jJ](?=${x})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,g,p,e.HASH_COMMENT_MODE]}]};return u.contains=[p,g,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,y,p]}]}}function Ig(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function Rg(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),s=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,a=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[s,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[a,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:s},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:a},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Og(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),s=t.concat(r,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},c={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:o},p={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},m="[1-9](_?[0-9])*|0",f="[0-9](_?[0-9])*",x={className:"number",relevance:0,variants:[{begin:`\\b(${m})(\\.(${f}))?([eE][+-]?(${f})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},g={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},N=[p,{variants:[{match:[/class\s+/,s,/\s+<\s+/,s]},{match:[/\b(class|module)\s+/,s]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,s],scope:{2:"title.class"},keywords:o},{relevance:0,match:[s,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[g]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:n}],relevance:0},x,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(c,u),relevance:0}].concat(c,u);d.contains=N,g.contains=N;const S=[{begin:/^\s*=>/,starts:{end:"$",contains:N}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:N}}];return u.unshift(c),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(S).concat(u).concat(N)}}function jg(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),s=t.concat(n,e.IDENT_RE),a={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,s,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],c=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:l,literal:c,built_in:u},illegal:""},a]}}const Lg=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Dg=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Pg=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Bg=[...Dg,...Pg],Fg=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),zg=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),$g=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ug=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Hg(e){const t=Lg(e),n=$g,r=zg,s="@[a-z-]+",a="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Bg.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ug.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,l,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:s,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:Fg.join(" ")},contains:[{begin:s,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function Wg(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function Kg(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},s={begin:/"/,end:/"/,contains:[{match:/""/}]},a=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],c=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],p=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],m=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],f=d,x=[...u,...c].filter(L=>!d.includes(L)),g={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...f),/\s*\(/),relevance:0,keywords:{built_in:f}};function b(L){return t.concat(/\b/,t.either(...L.map(N=>N.replace(/\s+/,"\\s+"))),/\b/)}const C={scope:"keyword",match:b(m),relevance:0};function O(L,{exceptions:N,when:B}={}){const D=B;return N=N||[],L.map(R=>R.match(/\|\d+$/)||N.includes(R)?R:D(R)?`${R}|0`:R)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(x,{when:L=>L.length<3}),literal:a,type:l,built_in:p},contains:[{scope:"type",match:b(o)},C,y,g,r,s,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function Fa(e){return e?typeof e=="string"?e:e.source:null}function dn(e){return Ne("(?=",e,")")}function Ne(...e){return e.map(n=>Fa(n)).join("")}function Gg(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function qe(...e){return"("+(Gg(e).capture?"":"?:")+e.map(r=>Fa(r)).join("|")+")"}const _s=e=>Ne(/\b/,e,/\w$/.test(e)?/\b/:/\B/),qg=["Protocol","Type"].map(_s),hi=["init","self"].map(_s),Vg=["Any","Self"],Rr=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],gi=["false","nil","true"],Yg=["assignment","associativity","higherThan","left","lowerThan","none","right"],Xg=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],xi=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],za=qe(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),$a=qe(za,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Or=Ne(za,$a,"*"),Ua=qe(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Xn=qe(Ua,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),mt=Ne(Ua,Xn,"*"),Fn=Ne(/[A-Z]/,Xn,"*"),Zg=["attached","autoclosure",Ne(/convention\(/,qe("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Ne(/objc\(/,mt,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Jg=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Qg(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],s={match:[/\./,qe(...qg,...hi)],className:{2:"keyword"}},a={match:Ne(/\./,qe(...Rr)),relevance:0},o=Rr.filter(ke=>typeof ke=="string").concat(["_|0"]),l=Rr.filter(ke=>typeof ke!="string").concat(Vg).map(_s),c={variants:[{className:"keyword",match:qe(...l,...hi)}]},u={$pattern:qe(/\b\w+/,/#\w+/),keyword:o.concat(Xg),literal:gi},d=[s,a,c],p={match:Ne(/\./,qe(...xi)),relevance:0},m={className:"built_in",match:Ne(/\b/,qe(...xi),/(?=\()/)},f=[p,m],x={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:Or},{match:`\\.(\\.|${$a})+`}]},v=[x,g],y="([0-9]_*)+",b="([0-9a-fA-F]_*)+",C={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${b})(\\.(${b}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},O=(ke="")=>({className:"subst",variants:[{match:Ne(/\\/,ke,/[0\\tnr"']/)},{match:Ne(/\\/,ke,/u\{[0-9a-fA-F]{1,8}\}/)}]}),L=(ke="")=>({className:"subst",match:Ne(/\\/,ke,/[\t ]*(?:[\r\n]|\r\n)/)}),N=(ke="")=>({className:"subst",label:"interpol",begin:Ne(/\\/,ke,/\(/),end:/\)/}),B=(ke="")=>({begin:Ne(ke,/"""/),end:Ne(/"""/,ke),contains:[O(ke),L(ke),N(ke)]}),D=(ke="")=>({begin:Ne(ke,/"/),end:Ne(/"/,ke),contains:[O(ke),N(ke)]}),R={className:"string",variants:[B(),B("#"),B("##"),B("###"),D(),D("#"),D("##"),D("###")]},S=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],T={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:S},j=ke=>{const lt=Ne(ke,/\//),rt=Ne(/\//,ke);return{begin:lt,end:rt,contains:[...S,{scope:"comment",begin:`#(?!.*${rt})`,end:/$/}]}},M={scope:"regexp",variants:[j("###"),j("##"),j("#"),T]},w={match:Ne(/`/,mt,/`/)},k={className:"variable",match:/\$\d+/},I={className:"variable",match:`\\$${Xn}+`},W=[w,k,I],U={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Jg,contains:[...v,C,R]}]}},q={scope:"keyword",match:Ne(/@/,qe(...Zg),dn(qe(/\(/,/\s+/)))},h={scope:"meta",match:Ne(/@/,mt)},F=[U,q,h],$={match:dn(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Ne(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Xn,"+")},{className:"type",match:Fn,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Ne(/\s+&\s+/,dn(Fn)),relevance:0}]},E={begin://,keywords:u,contains:[...r,...d,...F,x,$]};$.contains.push(E);const se={match:Ne(mt,/\s*:/),keywords:"_|0",relevance:0},K={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",se,...r,M,...d,...f,...v,C,R,...W,...F,$]},H={begin://,keywords:"repeat each",contains:[...r,$]},re={begin:qe(dn(Ne(mt,/\s*:/)),dn(Ne(mt,/\s+/,mt,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:mt}]},de={begin:/\(/,end:/\)/,keywords:u,contains:[re,...r,...d,...v,C,R,...F,$,K],endsParent:!0,illegal:/["']/},be={match:[/(func|macro)/,/\s+/,qe(w.match,mt,Or)],className:{1:"keyword",3:"title.function"},contains:[H,de,t],illegal:[/\[/,/%/]},Oe={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[H,de,t],illegal:/\[|%/},Ie={match:[/operator/,/\s+/,Or],className:{1:"keyword",3:"title"}},at={begin:[/precedencegroup/,/\s+/,Fn],className:{1:"keyword",3:"title"},contains:[$],keywords:[...Yg,...gi],end:/}/},St={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Pt={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},yt={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,mt,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:u,contains:[H,...d,{begin:/:/,end:/\{/,keywords:u,contains:[{scope:"title.class.inherited",match:Fn},...d],relevance:0}]};for(const ke of R.variants){const lt=ke.contains.find(vt=>vt.label==="interpol");lt.keywords=u;const rt=[...d,...f,...v,C,R,...W];lt.contains=[...rt,{begin:/\(/,end:/\)/,contains:["self",...rt]}]}return{name:"Swift",keywords:u,contains:[...r,be,Oe,St,Pt,yt,Ie,at,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},M,...d,...f,...v,C,R,...W,...F,$,K]}}const Zn="[A-Za-z$_][0-9A-Za-z$_]*",Ha=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Wa=["true","false","null","undefined","NaN","Infinity"],Ka=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Ga=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],qa=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Va=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ya=[].concat(qa,Ka,Ga);function ex(e){const t=e.regex,n=(U,{after:q})=>{const h="",end:""},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,q)=>{const h=U[0].length+U.index,F=U.input[h];if(F==="<"||F===","){q.ignoreMatch();return}F===">"&&(n(U,{after:h})||q.ignoreMatch());let $;const E=U.input.substring(h);if($=E.match(/^\s*=/)){q.ignoreMatch();return}if(($=E.match(/^\s+extends\s+/))&&$.index===0){q.ignoreMatch();return}}},l={$pattern:Zn,keyword:Ha,literal:Wa,built_in:Ya,"variable.language":Va},c="[0-9](_?[0-9])*",u=`\\.(${c})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${d})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${d})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},x={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,m]},b={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},C=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,x,g,v,{match:/\$\d+/},p];m.contains=C.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(C)});const O=[].concat(b,m.contains),L=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:L},B={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},D={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Ka,...Ga]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},S={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},T={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function j(U){return t.concat("(?!",U.join("|"),")")}const M={match:t.concat(/\b/,j([...qa,"super","import"].map(U=>`${U}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},w={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",W={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:D},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,x,g,v,b,{match:/\$\d+/},p,D,{scope:"attr",match:r+t.lookahead(":"),relevance:0},W,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,e.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:a},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},S,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},w,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},M,T,B,k,{match:/\$[(.]/}]}}function tx(e){const t=e.regex,n=ex(e),r=Zn,s=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:s},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},c=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:Zn,keyword:Ha.concat(c),literal:Wa,built_in:Ya.concat(s),"variable.language":Va},d={className:"meta",begin:"@"+r},p=(g,v,y)=>{const b=g.contains.findIndex(C=>C.label===v);if(b===-1)throw new Error("can not find mode to replace");g.contains.splice(b,1,y)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(d);const m=n.contains.find(g=>g.scope==="attr"),f=Object.assign({},m,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,m,f]),n.contains=n.contains.concat([d,a,o,f]),p(n,"shebang",e.SHEBANG()),p(n,"use_strict",l);const x=n.contains.find(g=>g.label==="func.def");return x.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function nx(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,c={className:"literal",variants:[{begin:t.concat(/# */,t.either(a,s),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(a,s),/ +/,t.either(o,l),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},p=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),m=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,c,u,d,p,m,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[m]}]}}function rx(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],s={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},a={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},c={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},a,o,s,e.QUOTE_STRING_MODE,c,u,l]}}function sx(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,s={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(a,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),c=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[a,c,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[a,o,c,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},s,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[c]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function ox(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},a={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},l=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),m={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},f={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},x={begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},v=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},m,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},x,g,a,o],y=[...v];return y.pop(),y.push(l),f.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const ix={arduino:$h,bash:Uh,c:Hh,cpp:Wh,csharp:Kh,css:eg,diff:tg,go:ng,graphql:rg,ini:sg,java:og,javascript:ug,json:dg,kotlin:fg,less:kg,lua:Eg,makefile:wg,markdown:_g,objectivec:Ng,perl:Sg,php:Tg,"php-template":Cg,plaintext:Ag,python:Mg,"python-repl":Ig,r:Rg,ruby:Og,rust:jg,scss:Hg,shell:Wg,sql:Kg,swift:Qg,typescript:tx,vbnet:nx,wasm:rx,xml:sx,yaml:ox};var jr,bi;function ax(){if(bi)return jr;bi=1;function e(A){return A instanceof Map?A.clear=A.delete=A.set=function(){throw new Error("map is read-only")}:A instanceof Set&&(A.add=A.clear=A.delete=function(){throw new Error("set is read-only")}),Object.freeze(A),Object.getOwnPropertyNames(A).forEach(z=>{const X=A[z],ce=typeof X;(ce==="object"||ce==="function")&&!Object.isFrozen(X)&&e(X)}),A}class t{constructor(z){z.data===void 0&&(z.data={}),this.data=z.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(A){return A.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function r(A,...z){const X=Object.create(null);for(const ce in A)X[ce]=A[ce];return z.forEach(function(ce){for(const je in ce)X[je]=ce[je]}),X}const s="
",a=A=>!!A.scope,o=(A,{prefix:z})=>{if(A.startsWith("language:"))return A.replace("language:","language-");if(A.includes(".")){const X=A.split(".");return[`${z}${X.shift()}`,...X.map((ce,je)=>`${ce}${"_".repeat(je+1)}`)].join(" ")}return`${z}${A}`};class l{constructor(z,X){this.buffer="",this.classPrefix=X.classPrefix,z.walk(this)}addText(z){this.buffer+=n(z)}openNode(z){if(!a(z))return;const X=o(z.scope,{prefix:this.classPrefix});this.span(X)}closeNode(z){a(z)&&(this.buffer+=s)}value(){return this.buffer}span(z){this.buffer+=``}}const c=(A={})=>{const z={children:[]};return Object.assign(z,A),z};class u{constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(z){this.top.children.push(z)}openNode(z){const X=c({scope:z});this.add(X),this.stack.push(X)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(z){return this.constructor._walk(z,this.rootNode)}static _walk(z,X){return typeof X=="string"?z.addText(X):X.children&&(z.openNode(X),X.children.forEach(ce=>this._walk(z,ce)),z.closeNode(X)),z}static _collapse(z){typeof z!="string"&&z.children&&(z.children.every(X=>typeof X=="string")?z.children=[z.children.join("")]:z.children.forEach(X=>{u._collapse(X)}))}}class d extends u{constructor(z){super(),this.options=z}addText(z){z!==""&&this.add(z)}startScope(z){this.openNode(z)}endScope(){this.closeNode()}__addSublanguage(z,X){const ce=z.root;X&&(ce.scope=`language:${X}`),this.add(ce)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(A){return A?typeof A=="string"?A:A.source:null}function m(A){return g("(?=",A,")")}function f(A){return g("(?:",A,")*")}function x(A){return g("(?:",A,")?")}function g(...A){return A.map(X=>p(X)).join("")}function v(A){const z=A[A.length-1];return typeof z=="object"&&z.constructor===Object?(A.splice(A.length-1,1),z):{}}function y(...A){return"("+(v(A).capture?"":"?:")+A.map(ce=>p(ce)).join("|")+")"}function b(A){return new RegExp(A.toString()+"|").exec("").length-1}function C(A,z){const X=A&&A.exec(z);return X&&X.index===0}const O=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function L(A,{joinWith:z}){let X=0;return A.map(ce=>{X+=1;const je=X;let Le=p(ce),te="";for(;Le.length>0;){const Q=O.exec(Le);if(!Q){te+=Le;break}te+=Le.substring(0,Q.index),Le=Le.substring(Q.index+Q[0].length),Q[0][0]==="\\"&&Q[1]?te+="\\"+String(Number(Q[1])+je):(te+=Q[0],Q[0]==="("&&X++)}return te}).map(ce=>`(${ce})`).join(z)}const N=/\b\B/,B="[a-zA-Z]\\w*",D="[a-zA-Z_]\\w*",R="\\b\\d+(\\.\\d+)?",S="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",T="\\b(0b[01]+)",j="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",M=(A={})=>{const z=/^#![ ]*\//;return A.binary&&(A.begin=g(z,/.*\b/,A.binary,/\b.*/)),r({scope:"meta",begin:z,end:/$/,relevance:0,"on:begin":(X,ce)=>{X.index!==0&&ce.ignoreMatch()}},A)},w={begin:"\\\\[\\s\\S]",relevance:0},k={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[w]},I={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[w]},W={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},U=function(A,z,X={}){const ce=r({scope:"comment",begin:A,end:z,contains:[]},X);ce.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const je=y("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return ce.contains.push({begin:g(/[ ]+/,"(",je,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),ce},q=U("//","$"),h=U("/\\*","\\*/"),F=U("#","$"),$={scope:"number",begin:R,relevance:0},E={scope:"number",begin:S,relevance:0},se={scope:"number",begin:T,relevance:0},K={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[w,{begin:/\[/,end:/\]/,relevance:0,contains:[w]}]},H={scope:"title",begin:B,relevance:0},re={scope:"title",begin:D,relevance:0},de={begin:"\\.\\s*"+D,relevance:0};var Oe=Object.freeze({__proto__:null,APOS_STRING_MODE:k,BACKSLASH_ESCAPE:w,BINARY_NUMBER_MODE:se,BINARY_NUMBER_RE:T,COMMENT:U,C_BLOCK_COMMENT_MODE:h,C_LINE_COMMENT_MODE:q,C_NUMBER_MODE:E,C_NUMBER_RE:S,END_SAME_AS_BEGIN:function(A){return Object.assign(A,{"on:begin":(z,X)=>{X.data._beginMatch=z[1]},"on:end":(z,X)=>{X.data._beginMatch!==z[1]&&X.ignoreMatch()}})},HASH_COMMENT_MODE:F,IDENT_RE:B,MATCH_NOTHING_RE:N,METHOD_GUARD:de,NUMBER_MODE:$,NUMBER_RE:R,PHRASAL_WORDS_MODE:W,QUOTE_STRING_MODE:I,REGEXP_MODE:K,RE_STARTERS_RE:j,SHEBANG:M,TITLE_MODE:H,UNDERSCORE_IDENT_RE:D,UNDERSCORE_TITLE_MODE:re});function Ie(A,z){A.input[A.index-1]==="."&&z.ignoreMatch()}function at(A,z){A.className!==void 0&&(A.scope=A.className,delete A.className)}function St(A,z){z&&A.beginKeywords&&(A.begin="\\b("+A.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",A.__beforeBegin=Ie,A.keywords=A.keywords||A.beginKeywords,delete A.beginKeywords,A.relevance===void 0&&(A.relevance=0))}function Pt(A,z){Array.isArray(A.illegal)&&(A.illegal=y(...A.illegal))}function yt(A,z){if(A.match){if(A.begin||A.end)throw new Error("begin & end are not supported with match");A.begin=A.match,delete A.match}}function ke(A,z){A.relevance===void 0&&(A.relevance=1)}const lt=(A,z)=>{if(!A.beforeMatch)return;if(A.starts)throw new Error("beforeMatch cannot be used with starts");const X=Object.assign({},A);Object.keys(A).forEach(ce=>{delete A[ce]}),A.keywords=X.keywords,A.begin=g(X.beforeMatch,m(X.begin)),A.starts={relevance:0,contains:[Object.assign(X,{endsParent:!0})]},A.relevance=0,delete X.beforeMatch},rt=["of","and","for","in","not","or","if","then","parent","list","value"],vt="keyword";function Bt(A,z,X=vt){const ce=Object.create(null);return typeof A=="string"?je(X,A.split(" ")):Array.isArray(A)?je(X,A):Object.keys(A).forEach(function(Le){Object.assign(ce,Bt(A[Le],z,Le))}),ce;function je(Le,te){z&&(te=te.map(Q=>Q.toLowerCase())),te.forEach(function(Q){const le=Q.split("|");ce[le[0]]=[Le,qt(le[0],le[1])]})}}function qt(A,z){return z?Number(z):J(A)?0:1}function J(A){return rt.includes(A.toLowerCase())}const he={},Re=A=>{console.error(A)},fe=(A,...z)=>{console.log(`WARN: ${A}`,...z)},P=(A,z)=>{he[`${A}/${z}`]||(console.log(`Deprecated as of ${A}. ${z}`),he[`${A}/${z}`]=!0)},G=new Error;function ee(A,z,{key:X}){let ce=0;const je=A[X],Le={},te={};for(let Q=1;Q<=z.length;Q++)te[Q+ce]=je[Q],Le[Q+ce]=!0,ce+=b(z[Q-1]);A[X]=te,A[X]._emit=Le,A[X]._multi=!0}function ae(A){if(Array.isArray(A.begin)){if(A.skip||A.excludeBegin||A.returnBegin)throw Re("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),G;if(typeof A.beginScope!="object"||A.beginScope===null)throw Re("beginScope must be object"),G;ee(A,A.begin,{key:"beginScope"}),A.begin=L(A.begin,{joinWith:""})}}function we(A){if(Array.isArray(A.end)){if(A.skip||A.excludeEnd||A.returnEnd)throw Re("skip, excludeEnd, returnEnd not compatible with endScope: {}"),G;if(typeof A.endScope!="object"||A.endScope===null)throw Re("endScope must be object"),G;ee(A,A.end,{key:"endScope"}),A.end=L(A.end,{joinWith:""})}}function Ke(A){A.scope&&typeof A.scope=="object"&&A.scope!==null&&(A.beginScope=A.scope,delete A.scope)}function kt(A){Ke(A),typeof A.beginScope=="string"&&(A.beginScope={_wrap:A.beginScope}),typeof A.endScope=="string"&&(A.endScope={_wrap:A.endScope}),ae(A),we(A)}function ct(A){function z(te,Q){return new RegExp(p(te),"m"+(A.case_insensitive?"i":"")+(A.unicodeRegex?"u":"")+(Q?"g":""))}class X{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Q,le){le.position=this.position++,this.matchIndexes[this.matchAt]=le,this.regexes.push([le,Q]),this.matchAt+=b(Q)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Q=this.regexes.map(le=>le[1]);this.matcherRe=z(L(Q,{joinWith:"|"}),!0),this.lastIndex=0}exec(Q){this.matcherRe.lastIndex=this.lastIndex;const le=this.matcherRe.exec(Q);if(!le)return null;const ze=le.findIndex((on,ir)=>ir>0&&on!==void 0),De=this.matchIndexes[ze];return le.splice(0,ze),Object.assign(le,De)}}class ce{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Q){if(this.multiRegexes[Q])return this.multiRegexes[Q];const le=new X;return this.rules.slice(Q).forEach(([ze,De])=>le.addRule(ze,De)),le.compile(),this.multiRegexes[Q]=le,le}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Q,le){this.rules.push([Q,le]),le.type==="begin"&&this.count++}exec(Q){const le=this.getMatcher(this.regexIndex);le.lastIndex=this.lastIndex;let ze=le.exec(Q);if(this.resumingScanAtSamePosition()&&!(ze&&ze.index===this.lastIndex)){const De=this.getMatcher(0);De.lastIndex=this.lastIndex+1,ze=De.exec(Q)}return ze&&(this.regexIndex+=ze.position+1,this.regexIndex===this.count&&this.considerAll()),ze}}function je(te){const Q=new ce;return te.contains.forEach(le=>Q.addRule(le.begin,{rule:le,type:"begin"})),te.terminatorEnd&&Q.addRule(te.terminatorEnd,{type:"end"}),te.illegal&&Q.addRule(te.illegal,{type:"illegal"}),Q}function Le(te,Q){const le=te;if(te.isCompiled)return le;[at,yt,kt,lt].forEach(De=>De(te,Q)),A.compilerExtensions.forEach(De=>De(te,Q)),te.__beforeBegin=null,[St,Pt,ke].forEach(De=>De(te,Q)),te.isCompiled=!0;let ze=null;return typeof te.keywords=="object"&&te.keywords.$pattern&&(te.keywords=Object.assign({},te.keywords),ze=te.keywords.$pattern,delete te.keywords.$pattern),ze=ze||/\w+/,te.keywords&&(te.keywords=Bt(te.keywords,A.case_insensitive)),le.keywordPatternRe=z(ze,!0),Q&&(te.begin||(te.begin=/\B|\b/),le.beginRe=z(le.begin),!te.end&&!te.endsWithParent&&(te.end=/\B|\b/),te.end&&(le.endRe=z(le.end)),le.terminatorEnd=p(le.end)||"",te.endsWithParent&&Q.terminatorEnd&&(le.terminatorEnd+=(te.end?"|":"")+Q.terminatorEnd)),te.illegal&&(le.illegalRe=z(te.illegal)),te.contains||(te.contains=[]),te.contains=[].concat(...te.contains.map(function(De){return Ft(De==="self"?te:De)})),te.contains.forEach(function(De){Le(De,le)}),te.starts&&Le(te.starts,Q),le.matcher=je(le),le}if(A.compilerExtensions||(A.compilerExtensions=[]),A.contains&&A.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return A.classNameAliases=r(A.classNameAliases||{}),Le(A)}function Tt(A){return A?A.endsWithParent||Tt(A.starts):!1}function Ft(A){return A.variants&&!A.cachedVariants&&(A.cachedVariants=A.variants.map(function(z){return r(A,{variants:null},z)})),A.cachedVariants?A.cachedVariants:Tt(A)?r(A,{starts:A.starts?r(A.starts):null}):Object.isFrozen(A)?r(A):A}var Ge="11.11.1";class Ct extends Error{constructor(z,X){super(z),this.name="HTMLInjectionError",this.html=X}}const Ze=n,Cs=r,As=Symbol("nomatch"),vl=7,Ms=function(A){const z=Object.create(null),X=Object.create(null),ce=[];let je=!0;const Le="Could not find the language '{}', did you forget to load/include a language module?",te={disableAutodetect:!0,name:"Plain text",contains:[]};let Q={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:d};function le(Y){return Q.noHighlightRe.test(Y)}function ze(Y){let oe=Y.className+" ";oe+=Y.parentNode?Y.parentNode.className:"";const ye=Q.languageDetectRe.exec(oe);if(ye){const Te=At(ye[1]);return Te||(fe(Le.replace("{}",ye[1])),fe("Falling back to no-highlight mode for this block.",Y)),Te?ye[1]:"no-highlight"}return oe.split(/\s+/).find(Te=>le(Te)||At(Te))}function De(Y,oe,ye){let Te="",Fe="";typeof oe=="object"?(Te=Y,ye=oe.ignoreIllegals,Fe=oe.language):(P("10.7.0","highlight(lang, code, ...args) has been deprecated."),P("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),Fe=Y,Te=oe),ye===void 0&&(ye=!0);const ut={code:Te,language:Fe};Nn("before:highlight",ut);const Mt=ut.result?ut.result:on(ut.language,ut.code,ye);return Mt.code=ut.code,Nn("after:highlight",Mt),Mt}function on(Y,oe,ye,Te){const Fe=Object.create(null);function ut(Z,ne){return Z.keywords[ne]}function Mt(){if(!ue.keywords){$e.addText(Ce);return}let Z=0;ue.keywordPatternRe.lastIndex=0;let ne=ue.keywordPatternRe.exec(Ce),me="";for(;ne;){me+=Ce.substring(Z,ne.index);const _e=ft.case_insensitive?ne[0].toLowerCase():ne[0],Ue=ut(ue,_e);if(Ue){const[Et,Pl]=Ue;if($e.addText(me),me="",Fe[_e]=(Fe[_e]||0)+1,Fe[_e]<=vl&&(Cn+=Pl),Et.startsWith("_"))me+=ne[0];else{const Bl=ft.classNameAliases[Et]||Et;pt(ne[0],Bl)}}else me+=ne[0];Z=ue.keywordPatternRe.lastIndex,ne=ue.keywordPatternRe.exec(Ce)}me+=Ce.substring(Z),$e.addText(me)}function Sn(){if(Ce==="")return;let Z=null;if(typeof ue.subLanguage=="string"){if(!z[ue.subLanguage]){$e.addText(Ce);return}Z=on(ue.subLanguage,Ce,!0,Bs[ue.subLanguage]),Bs[ue.subLanguage]=Z._top}else Z=ar(Ce,ue.subLanguage.length?ue.subLanguage:null);ue.relevance>0&&(Cn+=Z.relevance),$e.__addSublanguage(Z._emitter,Z.language)}function Je(){ue.subLanguage!=null?Sn():Mt(),Ce=""}function pt(Z,ne){Z!==""&&($e.startScope(ne),$e.addText(Z),$e.endScope())}function js(Z,ne){let me=1;const _e=ne.length-1;for(;me<=_e;){if(!Z._emit[me]){me++;continue}const Ue=ft.classNameAliases[Z[me]]||Z[me],Et=ne[me];Ue?pt(Et,Ue):(Ce=Et,Mt(),Ce=""),me++}}function Ls(Z,ne){return Z.scope&&typeof Z.scope=="string"&&$e.openNode(ft.classNameAliases[Z.scope]||Z.scope),Z.beginScope&&(Z.beginScope._wrap?(pt(Ce,ft.classNameAliases[Z.beginScope._wrap]||Z.beginScope._wrap),Ce=""):Z.beginScope._multi&&(js(Z.beginScope,ne),Ce="")),ue=Object.create(Z,{parent:{value:ue}}),ue}function Ds(Z,ne,me){let _e=C(Z.endRe,me);if(_e){if(Z["on:end"]){const Ue=new t(Z);Z["on:end"](ne,Ue),Ue.isMatchIgnored&&(_e=!1)}if(_e){for(;Z.endsParent&&Z.parent;)Z=Z.parent;return Z}}if(Z.endsWithParent)return Ds(Z.parent,ne,me)}function Rl(Z){return ue.matcher.regexIndex===0?(Ce+=Z[0],1):(dr=!0,0)}function Ol(Z){const ne=Z[0],me=Z.rule,_e=new t(me),Ue=[me.__beforeBegin,me["on:begin"]];for(const Et of Ue)if(Et&&(Et(Z,_e),_e.isMatchIgnored))return Rl(ne);return me.skip?Ce+=ne:(me.excludeBegin&&(Ce+=ne),Je(),!me.returnBegin&&!me.excludeBegin&&(Ce=ne)),Ls(me,Z),me.returnBegin?0:ne.length}function jl(Z){const ne=Z[0],me=oe.substring(Z.index),_e=Ds(ue,Z,me);if(!_e)return As;const Ue=ue;ue.endScope&&ue.endScope._wrap?(Je(),pt(ne,ue.endScope._wrap)):ue.endScope&&ue.endScope._multi?(Je(),js(ue.endScope,Z)):Ue.skip?Ce+=ne:(Ue.returnEnd||Ue.excludeEnd||(Ce+=ne),Je(),Ue.excludeEnd&&(Ce=ne));do ue.scope&&$e.closeNode(),!ue.skip&&!ue.subLanguage&&(Cn+=ue.relevance),ue=ue.parent;while(ue!==_e.parent);return _e.starts&&Ls(_e.starts,Z),Ue.returnEnd?0:ne.length}function Ll(){const Z=[];for(let ne=ue;ne!==ft;ne=ne.parent)ne.scope&&Z.unshift(ne.scope);Z.forEach(ne=>$e.openNode(ne))}let Tn={};function Ps(Z,ne){const me=ne&&ne[0];if(Ce+=Z,me==null)return Je(),0;if(Tn.type==="begin"&&ne.type==="end"&&Tn.index===ne.index&&me===""){if(Ce+=oe.slice(ne.index,ne.index+1),!je){const _e=new Error(`0 width match regex (${Y})`);throw _e.languageName=Y,_e.badRule=Tn.rule,_e}return 1}if(Tn=ne,ne.type==="begin")return Ol(ne);if(ne.type==="illegal"&&!ye){const _e=new Error('Illegal lexeme "'+me+'" for mode "'+(ue.scope||"")+'"');throw _e.mode=ue,_e}else if(ne.type==="end"){const _e=jl(ne);if(_e!==As)return _e}if(ne.type==="illegal"&&me==="")return Ce+=` +`,1;if(ur>1e5&&ur>ne.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ce+=me,me.length}const ft=At(Y);if(!ft)throw Re(Le.replace("{}",Y)),new Error('Unknown language: "'+Y+'"');const Dl=ct(ft);let cr="",ue=Te||Dl;const Bs={},$e=new Q.__emitter(Q);Ll();let Ce="",Cn=0,zt=0,ur=0,dr=!1;try{if(ft.__emitTokens)ft.__emitTokens(oe,$e);else{for(ue.matcher.considerAll();;){ur++,dr?dr=!1:ue.matcher.considerAll(),ue.matcher.lastIndex=zt;const Z=ue.matcher.exec(oe);if(!Z)break;const ne=oe.substring(zt,Z.index),me=Ps(ne,Z);zt=Z.index+me}Ps(oe.substring(zt))}return $e.finalize(),cr=$e.toHTML(),{language:Y,value:cr,relevance:Cn,illegal:!1,_emitter:$e,_top:ue}}catch(Z){if(Z.message&&Z.message.includes("Illegal"))return{language:Y,value:Ze(oe),illegal:!0,relevance:0,_illegalBy:{message:Z.message,index:zt,context:oe.slice(zt-100,zt+100),mode:Z.mode,resultSoFar:cr},_emitter:$e};if(je)return{language:Y,value:Ze(oe),illegal:!1,relevance:0,errorRaised:Z,_emitter:$e,_top:ue};throw Z}}function ir(Y){const oe={value:Ze(Y),illegal:!1,relevance:0,_top:te,_emitter:new Q.__emitter(Q)};return oe._emitter.addText(Y),oe}function ar(Y,oe){oe=oe||Q.languages||Object.keys(z);const ye=ir(Y),Te=oe.filter(At).filter(Os).map(Je=>on(Je,Y,!1));Te.unshift(ye);const Fe=Te.sort((Je,pt)=>{if(Je.relevance!==pt.relevance)return pt.relevance-Je.relevance;if(Je.language&&pt.language){if(At(Je.language).supersetOf===pt.language)return 1;if(At(pt.language).supersetOf===Je.language)return-1}return 0}),[ut,Mt]=Fe,Sn=ut;return Sn.secondBest=Mt,Sn}function kl(Y,oe,ye){const Te=oe&&X[oe]||ye;Y.classList.add("hljs"),Y.classList.add(`language-${Te}`)}function lr(Y){let oe=null;const ye=ze(Y);if(le(ye))return;if(Nn("before:highlightElement",{el:Y,language:ye}),Y.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Y);return}if(Y.children.length>0&&(Q.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Y)),Q.throwUnescapedHTML))throw new Ct("One of your code blocks includes unescaped HTML.",Y.innerHTML);oe=Y;const Te=oe.textContent,Fe=ye?De(Te,{language:ye,ignoreIllegals:!0}):ar(Te);Y.innerHTML=Fe.value,Y.dataset.highlighted="yes",kl(Y,ye,Fe.language),Y.result={language:Fe.language,re:Fe.relevance,relevance:Fe.relevance},Fe.secondBest&&(Y.secondBest={language:Fe.secondBest.language,relevance:Fe.secondBest.relevance}),Nn("after:highlightElement",{el:Y,result:Fe,text:Te})}function El(Y){Q=Cs(Q,Y)}const wl=()=>{_n(),P("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function _l(){_n(),P("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Is=!1;function _n(){function Y(){_n()}if(document.readyState==="loading"){Is||window.addEventListener("DOMContentLoaded",Y,!1),Is=!0;return}document.querySelectorAll(Q.cssSelector).forEach(lr)}function Nl(Y,oe){let ye=null;try{ye=oe(A)}catch(Te){if(Re("Language definition for '{}' could not be registered.".replace("{}",Y)),je)Re(Te);else throw Te;ye=te}ye.name||(ye.name=Y),z[Y]=ye,ye.rawDefinition=oe.bind(null,A),ye.aliases&&Rs(ye.aliases,{languageName:Y})}function Sl(Y){delete z[Y];for(const oe of Object.keys(X))X[oe]===Y&&delete X[oe]}function Tl(){return Object.keys(z)}function At(Y){return Y=(Y||"").toLowerCase(),z[Y]||z[X[Y]]}function Rs(Y,{languageName:oe}){typeof Y=="string"&&(Y=[Y]),Y.forEach(ye=>{X[ye.toLowerCase()]=oe})}function Os(Y){const oe=At(Y);return oe&&!oe.disableAutodetect}function Cl(Y){Y["before:highlightBlock"]&&!Y["before:highlightElement"]&&(Y["before:highlightElement"]=oe=>{Y["before:highlightBlock"](Object.assign({block:oe.el},oe))}),Y["after:highlightBlock"]&&!Y["after:highlightElement"]&&(Y["after:highlightElement"]=oe=>{Y["after:highlightBlock"](Object.assign({block:oe.el},oe))})}function Al(Y){Cl(Y),ce.push(Y)}function Ml(Y){const oe=ce.indexOf(Y);oe!==-1&&ce.splice(oe,1)}function Nn(Y,oe){const ye=Y;ce.forEach(function(Te){Te[ye]&&Te[ye](oe)})}function Il(Y){return P("10.7.0","highlightBlock will be removed entirely in v12.0"),P("10.7.0","Please use highlightElement now."),lr(Y)}Object.assign(A,{highlight:De,highlightAuto:ar,highlightAll:_n,highlightElement:lr,highlightBlock:Il,configure:El,initHighlighting:wl,initHighlightingOnLoad:_l,registerLanguage:Nl,unregisterLanguage:Sl,listLanguages:Tl,getLanguage:At,registerAliases:Rs,autoDetection:Os,inherit:Cs,addPlugin:Al,removePlugin:Ml}),A.debugMode=function(){je=!1},A.safeMode=function(){je=!0},A.versionString=Ge,A.regex={concat:g,lookahead:m,either:y,optional:x,anyNumberOfTimes:f};for(const Y in Oe)typeof Oe[Y]=="object"&&e(Oe[Y]);return Object.assign(A,Oe),A},Vt=Ms({});return Vt.newInstance=()=>Ms({}),jr=Vt,Vt.HighlightJS=Vt,Vt.default=Vt,jr}var lx=ax();const cx=ns(lx),yi={},ux="hljs-";function dx(e){const t=cx.newInstance();return e&&a(e),{highlight:n,highlightAuto:r,listLanguages:s,register:a,registerAlias:o,registered:l};function n(c,u,d){const p=d||yi,m=typeof p.prefix=="string"?p.prefix:ux;if(!t.getLanguage(c))throw new Error("Unknown language: `"+c+"` is not registered");t.configure({__emitter:px,classPrefix:m});const f=t.highlight(u,{ignoreIllegals:!0,language:c});if(f.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:f.errorRaised});const x=f._emitter.root,g=x.data;return g.language=f.language,g.relevance=f.relevance,x}function r(c,u){const p=(u||yi).subset||s();let m=-1,f=0,x;for(;++mf&&(f=v.data.relevance,x=v)}return x||{type:"root",children:[],data:{language:void 0,relevance:f}}}function s(){return t.listLanguages()}function a(c,u){if(typeof c=="string")t.registerLanguage(c,u);else{let d;for(d in c)Object.hasOwn(c,d)&&t.registerLanguage(d,c[d])}}function o(c,u){if(typeof c=="string")t.registerAliases(typeof u=="string"?u:[...u],{languageName:c});else{let d;for(d in c)if(Object.hasOwn(c,d)){const p=c[d];t.registerAliases(typeof p=="string"?p:[...p],{languageName:d})}}}function l(c){return!!t.getLanguage(c)}}class px{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],s=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:s}):r.children.push(...s)}openNode(t){const n=this,r=t.split(".").map(function(o,l){return l?o+"_".repeat(l):n.options.classPrefix+o}),s=this.stack[this.stack.length-1],a={type:"element",tagName:"span",properties:{className:r},children:[]};s.children.push(a),this.stack.push(a)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const fx={};function mx(e){const t=e||fx,n=t.aliases,r=t.detect||!1,s=t.languages||ix,a=t.plainText,o=t.prefix,l=t.subset;let c="hljs";const u=dx(s);if(n&&u.registerAlias(n),o){const d=o.indexOf("-");c=d===-1?o:o.slice(0,d)}return function(d,p){or(d,"element",function(m,f,x){if(m.tagName!=="code"||!x||x.type!=="element"||x.tagName!=="pre")return;const g=hx(m);if(g===!1||!g&&!r||g&&a&&a.includes(g))return;Array.isArray(m.properties.className)||(m.properties.className=[]),m.properties.className.includes(c)||m.properties.className.unshift(c);const v=Oh(m,{whitespace:"pre"});let y;try{y=g?u.highlight(g,v,{prefix:o}):u.highlightAuto(v,{prefix:o,subset:l})}catch(b){const C=b;if(g&&/Unknown language/.test(C.message)){p.message("Cannot highlight as `"+g+"`, it’s not registered",{ancestors:[x,m],cause:C,place:m.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw C}!g&&y.data&&y.data.language&&m.properties.className.push("language-"+y.data.language),y.children.length>0&&(m.children=y.children)})}}function hx(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n0?{type:"text",value:N}:void 0),N===!1?m.lastIndex=O+1:(x!==O&&b.push({type:"text",value:u.value.slice(x,O)}),Array.isArray(N)?b.push(...N):N&&b.push(N),x=O+C[0].length,y=!0),!m.global)break;C=m.exec(u.value)}return y?(x?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=vi(e,"(");let a=vi(e,")");for(;r!==-1&&s>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}function Xa(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Wt(n)||tr(n))&&(!t||n!==47)}Za.peek=$x;function Ox(){this.buffer()}function jx(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Lx(){this.buffer()}function Dx(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Px(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=dt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Bx(e){this.exit(e)}function Fx(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=dt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function zx(e){this.exit(e)}function $x(){return"["}function Za(e,t,n,r){const s=n.createTracker(r);let a=s.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return a+=s.move(n.safe(n.associationId(e),{after:"]",before:a})),l(),o(),a+=s.move("]"),a}function Ux(){return{enter:{gfmFootnoteCallString:Ox,gfmFootnoteCall:jx,gfmFootnoteDefinitionLabelString:Lx,gfmFootnoteDefinition:Dx},exit:{gfmFootnoteCallString:Px,gfmFootnoteCall:Bx,gfmFootnoteDefinitionLabelString:Fx,gfmFootnoteDefinition:zx}}}function Hx(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Za},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,a,o){const l=a.createTracker(o);let c=l.move("[^");const u=a.enter("footnoteDefinition"),d=a.enter("label");return c+=l.move(a.safe(a.associationId(r),{before:c,after:"]"})),d(),c+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),c+=l.move((t?` +`:" ")+a.indentLines(a.containerFlow(r,l.current()),t?Ja:Wx))),u(),c}}function Wx(e,t,n){return t===0?e:Ja(e,t,n)}function Ja(e,t,n){return(n?"":" ")+e}const Kx=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Qa.peek=Xx;function Gx(){return{canContainEols:["delete"],enter:{strikethrough:Vx},exit:{strikethrough:Yx}}}function qx(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Kx}],handlers:{delete:Qa}}}function Vx(e){this.enter({type:"delete",children:[]},e)}function Yx(e){this.exit(e)}function Qa(e,t,n,r){const s=n.createTracker(r),a=n.enter("strikethrough");let o=s.move("~~");return o+=n.containerPhrasing(e,{...s.current(),before:o,after:"~"}),o+=s.move("~~"),a(),o}function Xx(){return"~"}function Zx(e){return e.length}function Jx(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||Zx,a=[],o=[],l=[],c=[];let u=0,d=-1;for(;++du&&(u=e[d].length);++yc[y])&&(c[y]=C)}g.push(b)}o[d]=g,l[d]=v}let p=-1;if(typeof r=="object"&&"length"in r)for(;++pc[p]&&(c[p]=b),f[p]=b),m[p]=C}o.splice(1,0,m),l.splice(1,0,f),d=-1;const x=[];for(;++d "),a.shift(2);const o=n.indentLines(n.containerFlow(e,a.current()),tb);return s(),o}function tb(e,t,n){return">"+(n?"":" ")+e}function nb(e,t){return Ei(e,t.inConstruct,!0)&&!Ei(e,t.notInConstruct,!1)}function Ei(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ro&&(o=a):a=1,s=r+t.length,r=n.indexOf(t,s);return o}function sb(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function ob(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function ib(e,t,n,r){const s=ob(n),a=e.value||"",o=s==="`"?"GraveAccent":"Tilde";if(sb(e,n)){const p=n.enter("codeIndented"),m=n.indentLines(a,ab);return p(),m}const l=n.createTracker(r),c=s.repeat(Math.max(rb(a,s)+1,3)),u=n.enter("codeFenced");let d=l.move(c);if(e.lang){const p=n.enter(`codeFencedLang${o}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${o}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:` +`,encode:["`"],...l.current()})),p()}return d+=l.move(` +`),a&&(d+=l.move(a+` +`)),d+=l.move(c),u(),d}function ab(e,t,n){return(n?"":" ")+e}function Ns(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function lb(e,t,n,r){const s=Ns(n),a=s==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const c=n.createTracker(r);let u=c.move("[");return u+=c.move(n.safe(n.associationId(e),{before:u,after:"]",...c.current()})),u+=c.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":` +`,...c.current()}))),l(),e.title&&(l=n.enter(`title${a}`),u+=c.move(" "+s),u+=c.move(n.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),l()),o(),u}function cb(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function bn(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Jn(e,t,n){const r=nn(e),s=nn(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}el.peek=ub;function el(e,t,n,r){const s=cb(n),a=n.enter("emphasis"),o=n.createTracker(r),l=o.move(s);let c=o.move(n.containerPhrasing(e,{after:s,before:l,...o.current()}));const u=c.charCodeAt(0),d=Jn(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(c=bn(u)+c.slice(1));const p=c.charCodeAt(c.length-1),m=Jn(r.after.charCodeAt(0),p,s);m.inside&&(c=c.slice(0,-1)+bn(p));const f=o.move(s);return a(),n.attentionEncodeSurroundingInfo={after:m.outside,before:d.outside},l+c+f}function ub(e,t,n){return n.options.emphasis||"*"}function db(e,t){let n=!1;return or(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Xr}),!!((!e.depth||e.depth<3)&&hs(e)&&(t.options.setext||n))}function pb(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(db(e,n)){const d=n.enter("headingSetext"),p=n.enter("phrasing"),m=n.containerPhrasing(e,{...a.current(),before:` +`,after:` +`});return p(),d(),m+` +`+(s===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(` +`))+1))}const o="#".repeat(s),l=n.enter("headingAtx"),c=n.enter("phrasing");a.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:` +`,...a.current()});return/^[\t ]/.test(u)&&(u=bn(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),c(),l(),u}tl.peek=fb;function tl(e){return e.value||""}function fb(){return"<"}nl.peek=mb;function nl(e,t,n,r){const s=Ns(n),a=s==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const c=n.createTracker(r);let u=c.move("![");return u+=c.move(n.safe(e.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(n.safe(e.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=n.enter("destinationRaw"),u+=c.move(n.safe(e.url,{before:u,after:e.title?" ":")",...c.current()}))),l(),e.title&&(l=n.enter(`title${a}`),u+=c.move(" "+s),u+=c.move(n.safe(e.title,{before:u,after:s,...c.current()})),u+=c.move(s),l()),u+=c.move(")"),o(),u}function mb(){return"!"}rl.peek=hb;function rl(e,t,n,r){const s=e.referenceType,a=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("![");const u=n.safe(e.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,a(),s==="full"||!u||u!==p?c+=l.move(p+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function hb(){return"!"}sl.peek=gb;function sl(e,t,n){let r=e.value||"",s="`",a=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a\u007F]/.test(e.url))}il.peek=xb;function il(e,t,n,r){const s=Ns(n),a=s==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,c;if(ol(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let p=o.move("<");return p+=o.move(n.containerPhrasing(e,{before:p,after:">",...o.current()})),p+=o.move(">"),l(),n.stack=d,p}l=n.enter("link"),c=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(c=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),u+=o.move(" "+s),u+=o.move(n.safe(e.title,{before:u,after:s,...o.current()})),u+=o.move(s),c()),u+=o.move(")"),l(),u}function xb(e,t,n){return ol(e,n)?"<":"["}al.peek=bb;function al(e,t,n,r){const s=e.referenceType,a=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let c=l.move("[");const u=n.containerPhrasing(e,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:c,after:"]",...l.current()});return o(),n.stack=d,a(),s==="full"||!u||u!==p?c+=l.move(p+"]"):s==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function bb(){return"["}function Ss(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function yb(e){const t=Ss(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function vb(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ll(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function kb(e,t,n,r){const s=n.enter("list"),a=n.bulletCurrent;let o=e.ordered?vb(n):Ss(n);const l=e.ordered?o==="."?")":".":yb(n);let c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),ll(n)===o&&d){let p=-1;for(;++p-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(a+" ".repeat(o-a.length)),l.shift(o);const c=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,l.current()),d);return c(),u;function d(p,m,f){return m?(f?"":" ".repeat(o))+p:(f?a:a+" ".repeat(o-a.length))+p}}function _b(e,t,n,r){const s=n.enter("paragraph"),a=n.enter("phrasing"),o=n.containerPhrasing(e,r);return a(),s(),o}const Nb=En(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Sb(e,t,n,r){return(e.children.some(function(o){return Nb(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function Tb(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}cl.peek=Cb;function cl(e,t,n,r){const s=Tb(n),a=n.enter("strong"),o=n.createTracker(r),l=o.move(s+s);let c=o.move(n.containerPhrasing(e,{after:s,before:l,...o.current()}));const u=c.charCodeAt(0),d=Jn(r.before.charCodeAt(r.before.length-1),u,s);d.inside&&(c=bn(u)+c.slice(1));const p=c.charCodeAt(c.length-1),m=Jn(r.after.charCodeAt(0),p,s);m.inside&&(c=c.slice(0,-1)+bn(p));const f=o.move(s+s);return a(),n.attentionEncodeSurroundingInfo={after:m.outside,before:d.outside},l+c+f}function Cb(e,t,n){return n.options.strong||"*"}function Ab(e,t,n,r){return n.safe(e.value,r)}function Mb(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Ib(e,t,n){const r=(ll(n)+(n.options.ruleSpaces?" ":"")).repeat(Mb(n));return n.options.ruleSpaces?r.slice(0,-1):r}const ul={blockquote:eb,break:wi,code:ib,definition:lb,emphasis:el,hardBreak:wi,heading:pb,html:tl,image:nl,imageReference:rl,inlineCode:sl,link:il,linkReference:al,list:kb,listItem:wb,paragraph:_b,root:Sb,strong:cl,text:Ab,thematicBreak:Ib};function Rb(){return{enter:{table:Ob,tableData:_i,tableHeader:_i,tableRow:Lb},exit:{codeText:Db,table:jb,tableData:Br,tableHeader:Br,tableRow:Br}}}function Ob(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function jb(e){this.exit(e),this.data.inTable=void 0}function Lb(e){this.enter({type:"tableRow",children:[]},e)}function Br(e){this.exit(e)}function _i(e){this.enter({type:"tableCell",children:[]},e)}function Db(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Pb));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Pb(e,t){return t==="|"?t:e}function Bb(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:o,tableCell:c,tableRow:l}};function o(f,x,g,v){return u(d(f,g,v),f.align)}function l(f,x,g,v){const y=p(f,g,v),b=u([y]);return b.slice(0,b.indexOf(` +`))}function c(f,x,g,v){const y=g.enter("tableCell"),b=g.enter("phrasing"),C=g.containerPhrasing(f,{...v,before:a,after:a});return b(),y(),C}function u(f,x){return Jx(f,{align:x,alignDelimiters:r,padding:n,stringLength:s})}function d(f,x,g){const v=f.children;let y=-1;const b=[],C=x.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const ny={tokenize:uy,partial:!0};function ry(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:ay,continuation:{tokenize:ly},exit:cy}},text:{91:{name:"gfmFootnoteCall",tokenize:iy},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:sy,resolveTo:oy}}}}function sy(e,t,n){const r=this;let s=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;s--;){const c=r.events[s][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return n(c);const u=dt(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!a.includes(u.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function oy(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const a={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},a.start),end:Object.assign({},a.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function iy(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a=0,o;return l;function l(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),c}function c(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(p){if(a>999||p===93&&!o||p===null||p===91||Se(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return s.includes(dt(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return Se(p)||(o=!0),a++,e.consume(p),p===92?d:u}function d(p){return p===91||p===92||p===93?(e.consume(p),a++,u):u(p)}}function ay(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,o=0,l;return c;function c(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(x)}function d(x){if(o>999||x===93&&!l||x===null||x===91||Se(x))return n(x);if(x===93){e.exit("chunkString");const g=e.exit("gfmFootnoteDefinitionLabelString");return a=dt(r.sliceSerialize(g)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return Se(x)||(l=!0),o++,e.consume(x),x===92?p:d}function p(x){return x===91||x===92||x===93?(e.consume(x),o++,d):d(x)}function m(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),s.includes(a)||s.push(a),Ee(e,f,"gfmFootnoteDefinitionWhitespace")):n(x)}function f(x){return t(x)}}function ly(e,t,n){return e.check(kn,t,e.attempt(ny,t,n))}function cy(e){e.exit("gfmFootnoteDefinition")}function uy(e,t,n){const r=this;return Ee(e,s,"gfmFootnoteDefinitionIndent",5);function s(a){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(a):n(a)}}function dy(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:a,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(o,l){let c=-1;for(;++c1?c(x):(o.consume(x),p++,f);if(p<2&&!n)return c(x);const v=o.exit("strikethroughSequenceTemporary"),y=nn(x);return v._open=!y||y===2&&!!g,v._close=!g||g===2&&!!y,l(x)}}}class py{constructor(){this.map=[]}add(t,n,r){fy(this,t,n,r)}consume(t){if(this.map.sort(function(a,o){return a[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const a of s)t.push(a);s=r.pop()}this.map.length=0}}function fy(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s-1;){const w=r.events[T][1].type;if(w==="lineEnding"||w==="linePrefix")T--;else break}const j=T>-1?r.events[T][1].type:null,M=j==="tableHead"||j==="tableRow"?N:c;return M===N&&r.parser.lazy[r.now().line]?n(S):M(S)}function c(S){return e.enter("tableHead"),e.enter("tableRow"),u(S)}function u(S){return S===124||(o=!0,a+=1),d(S)}function d(S){return S===null?n(S):ie(S)?a>1?(a=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),f):n(S):xe(S)?Ee(e,d,"whitespace")(S):(a+=1,o&&(o=!1,s+=1),S===124?(e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),p(S)))}function p(S){return S===null||S===124||Se(S)?(e.exit("data"),d(S)):(e.consume(S),S===92?m:p)}function m(S){return S===92||S===124?(e.consume(S),p):p(S)}function f(S){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(S):(e.enter("tableDelimiterRow"),o=!1,xe(S)?Ee(e,x,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):x(S))}function x(S){return S===45||S===58?v(S):S===124?(o=!0,e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),g):L(S)}function g(S){return xe(S)?Ee(e,v,"whitespace")(S):v(S)}function v(S){return S===58?(a+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(S),e.exit("tableDelimiterMarker"),y):S===45?(a+=1,y(S)):S===null||ie(S)?O(S):L(S)}function y(S){return S===45?(e.enter("tableDelimiterFiller"),b(S)):L(S)}function b(S){return S===45?(e.consume(S),b):S===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(S),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(S))}function C(S){return xe(S)?Ee(e,O,"whitespace")(S):O(S)}function O(S){return S===124?x(S):S===null||ie(S)?!o||s!==a?L(S):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(S)):L(S)}function L(S){return n(S)}function N(S){return e.enter("tableRow"),B(S)}function B(S){return S===124?(e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),B):S===null||ie(S)?(e.exit("tableRow"),t(S)):xe(S)?Ee(e,B,"whitespace")(S):(e.enter("data"),D(S))}function D(S){return S===null||S===124||Se(S)?(e.exit("data"),B(S)):(e.consume(S),S===92?R:D)}function R(S){return S===92||S===124?(e.consume(S),D):D(S)}}function xy(e,t){let n=-1,r=!0,s=0,a=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,u,d,p;const m=new py;for(;++nn[2]+1){const x=n[2]+1,g=n[3]-n[2]-1;e.add(x,g,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return s!==void 0&&(a.end=Object.assign({},Qt(t.events,s)),e.add(s,0,[["exit",a,t]]),a=void 0),a}function Si(e,t,n,r,s){const a=[],o=Qt(t.events,n);s&&(s.end=Object.assign({},o),a.push(["exit",s,t])),r.end=Object.assign({},o),a.push(["exit",r,t]),e.add(n+1,0,a)}function Qt(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const by={name:"tasklistCheck",tokenize:vy};function yy(){return{text:{91:by}}}function vy(e,t,n){const r=this;return s;function s(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),a)}function a(c){return Se(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(c)}function l(c){return ie(c)?t(c):xe(c)?e.check({tokenize:ky},t,n)(c):n(c)}}function ky(e,t,n){return Ee(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function Ey(e){return la([qb(),ry(),dy(e),hy(),yy()])}const wy={};function _y(e){const t=this,n=e||wy,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),a=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(Ey(n)),a.push(Hb()),o.push(Wb(n))}const Ny={user:{label:"You",color:"var(--info)"},assistant:{label:"AI",color:"var(--success)"},tool:{label:"Tool",color:"var(--warning)"},plan:{label:"Plan",color:"var(--accent)"},thinking:{label:"Reasoning",color:"var(--text-muted)"}};function Sy({message:e}){const[t,n]=_.useState(!1);return i.jsxs("div",{className:"py-1.5",children:[i.jsxs("button",{onClick:()=>n(!t),className:"flex items-center gap-1.5 mb-0.5 cursor-pointer",style:{background:"none",border:"none",padding:0},children:[i.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:"var(--text-muted)",opacity:.5}}),i.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-muted)"},children:"Reasoning"}),i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-muted)",strokeWidth:"2",style:{transform:t?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s",marginLeft:2},children:i.jsx("path",{d:"M6 9l6 6 6-6"})})]}),t&&i.jsx("div",{className:"text-[12px] leading-relaxed pl-2.5 max-w-prose whitespace-pre-wrap",style:{color:"var(--text-muted)",fontStyle:"italic"},children:e.content})]})}function Ty({message:e}){const t=e.planItems??[];return i.jsxs("div",{className:"py-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[i.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:"var(--accent)"}}),i.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--accent)"},children:"Plan"})]}),i.jsx("div",{className:"pl-2.5 space-y-1 mt-1",children:t.map((n,r)=>i.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[n.status==="completed"?i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--success)",strokeWidth:"2.5",strokeLinecap:"round",children:i.jsx("path",{d:"M20 6L9 17l-5-5"})}):n.status==="in_progress"?i.jsx("span",{className:"w-3.5 h-3.5 flex items-center justify-center",children:i.jsx("span",{className:"w-2 h-2 rounded-full animate-pulse",style:{background:"var(--accent)"}})}):i.jsx("span",{className:"w-3.5 h-3.5 flex items-center justify-center",children:i.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:"var(--text-muted)",opacity:.4}})}),i.jsx("span",{style:{color:n.status==="completed"?"var(--text-muted)":"var(--text-primary)",textDecoration:n.status==="completed"?"line-through":"none"},children:n.title})]},r))})]})}function yl(e){if(e.tool!=="edit_file"||!e.args)return null;const t=e.args;return typeof t.old_string=="string"&&typeof t.new_string=="string"?{path:t.file_path,old_string:t.old_string,new_string:t.new_string}:null}function Cy({tc:e}){const t=r=>{if(!e.tool_call_id)return;const s=Be.getState().sessionId;s&&(Be.getState().resolveToolApproval(e.tool_call_id,r),er().sendToolApproval(s,e.tool_call_id,r))},n=yl(e);return i.jsxs("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--warning) 40%, var(--border))"},children:[i.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"color-mix(in srgb, var(--warning) 10%, var(--bg-secondary))"},children:[i.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--warning)"},children:"Action Required"}),i.jsx("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--text-primary)"},children:e.tool}),(n==null?void 0:n.path)&&i.jsx("span",{className:"text-[11px] font-mono truncate",style:{color:"var(--text-muted)"},children:n.path})]}),n?i.jsx("div",{className:"px-3 py-2",style:{background:"var(--bg-secondary)"},children:i.jsx(as,{path:n.path,oldStr:n.old_string,newStr:n.new_string})}):e.args!=null?i.jsx("pre",{className:"px-3 py-2 text-[11px] font-mono whitespace-pre-wrap break-words overflow-y-auto leading-normal",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)",maxHeight:200},children:JSON.stringify(e.args,null,2)}):null,i.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--bg-secondary)",borderTop:"1px solid var(--border)"},children:[i.jsx("button",{onClick:()=>t(!0),className:"text-xs font-semibold px-3 py-1.5 rounded cursor-pointer transition-colors",style:{background:"color-mix(in srgb, var(--success) 15%, var(--bg-secondary))",color:"var(--success)",border:"1px solid color-mix(in srgb, var(--success) 30%, var(--border))"},onMouseEnter:r=>{r.currentTarget.style.background="color-mix(in srgb, var(--success) 25%, var(--bg-secondary))"},onMouseLeave:r=>{r.currentTarget.style.background="color-mix(in srgb, var(--success) 15%, var(--bg-secondary))"},children:"Approve"}),i.jsx("button",{onClick:()=>t(!1),className:"text-xs font-semibold px-3 py-1.5 rounded cursor-pointer transition-colors",style:{background:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",color:"var(--error)",border:"1px solid color-mix(in srgb, var(--error) 30%, var(--border))"},onMouseEnter:r=>{r.currentTarget.style.background="color-mix(in srgb, var(--error) 25%, var(--bg-secondary))"},onMouseLeave:r=>{r.currentTarget.style.background="color-mix(in srgb, var(--error) 15%, var(--bg-secondary))"},children:"Reject"})]})]})}function Ay({tc:e,active:t,onClick:n}){const r=e.status==="denied",s=e.result!==void 0,a=r?"var(--error)":s?e.is_error?"var(--error)":"var(--success)":"var(--text-muted)",o=r?"✗":s?e.is_error?"✗":"✓":"•";return i.jsxs("button",{onClick:n,className:"inline-flex items-center gap-1 text-[11px] font-mono px-2 py-1 rounded cursor-pointer transition-all",style:{background:t?"var(--bg-secondary)":"var(--bg-primary)",border:t?"1px solid var(--text-muted)":"1px solid var(--border)",color:a},children:[o," ",e.tool,r&&i.jsx("span",{className:"ml-1 text-[10px] uppercase",children:"Denied"})]})}function My({tc:e}){const t=e.result!==void 0,n=e.args!=null&&Object.keys(e.args).length>0,r=yl(e);return i.jsxs("div",{className:"rounded-lg overflow-hidden",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:[i.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5",style:{borderBottom:"1px solid var(--border)"},children:[i.jsx("span",{className:"text-[11px] font-mono font-semibold",style:{color:"var(--text-primary)"},children:e.tool}),(r==null?void 0:r.path)&&i.jsx("span",{className:"text-[11px] font-mono truncate",style:{color:"var(--text-muted)"},children:r.path}),e.is_error&&i.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 rounded",style:{background:"color-mix(in srgb, var(--error) 15%, transparent)",color:"var(--error)"},children:"Error"})]}),i.jsxs("div",{className:"flex flex-col gap-0",children:[r?i.jsx("div",{className:"px-3 py-2",style:{borderBottom:t?"1px solid var(--border)":"none"},children:i.jsx(as,{path:r.path,oldStr:r.old_string,newStr:r.new_string})}):n?i.jsxs("div",{style:{borderBottom:t?"1px solid var(--border)":"none"},children:[i.jsx("div",{className:"px-3 pt-1.5 pb-0.5",children:i.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold",style:{color:"var(--text-muted)"},children:"Input"})}),i.jsx("pre",{className:"px-3 pb-2 text-[11px] font-mono whitespace-pre-wrap break-words overflow-y-auto leading-relaxed",style:{color:"var(--text-secondary)",maxHeight:160},children:JSON.stringify(e.args,null,2)})]}):null,t&&i.jsxs("div",{children:[i.jsx("div",{className:"px-3 pt-1.5 pb-0.5",children:i.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold",style:{color:e.is_error?"var(--error)":"var(--text-muted)"},children:"Output"})}),i.jsx("pre",{className:"px-3 pb-2 text-[11px] font-mono whitespace-pre-wrap break-words overflow-y-auto leading-relaxed",style:{color:e.is_error?"var(--error)":"var(--text-secondary)",maxHeight:240},children:e.result})]})]})]})}const Ti=3;function Iy({message:e}){const t=e.toolCalls??(e.toolCall?[e.toolCall]:[]),[n,r]=_.useState(!1),[s,a]=_.useState(null);if(t.length===0)return null;const o=t.find(p=>p.status==="pending");if(o)return i.jsx("div",{className:"py-1.5 pl-2.5",children:i.jsx(Cy,{tc:o})});const l=t.length-Ti,c=l>0&&!n,u=c?t.slice(-Ti):t,d=c?l:0;return i.jsxs("div",{className:"py-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[i.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:"var(--warning)"}}),i.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--warning)"},children:t.length===1?"Tool":`Tools (${t.length})`})]}),i.jsxs("div",{className:"pl-2.5 space-y-1.5",children:[i.jsxs("div",{className:"flex flex-wrap gap-1",children:[c&&i.jsxs("button",{onClick:()=>r(!0),className:"inline-flex items-center gap-1 text-[11px] font-mono px-2 py-1 rounded cursor-pointer hover:brightness-125",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-muted)"},children:["+",l," more"]}),u.map((p,m)=>{const f=m+d;return i.jsx(Ay,{tc:p,active:s===f,onClick:()=>a(s===f?null:f)},f)})]}),s!==null&&t[s]&&i.jsx(My,{tc:t[s]})]})]})}function Ry(e){const t=e.total_prompt_tokens+e.total_completion_tokens;let n=`## Agent Diagnostics +- Model: ${e.model} +- Turns: ${e.turn_count}/50 (max reached) +- Tokens: ${e.total_prompt_tokens} prompt + ${e.total_completion_tokens} completion = ${t} total +- Compactions: ${e.compaction_count}`;const r=e.tool_summary;if(r&&r.length>0){n+=` + +## Tool Usage`;for(const o of r)n+=` +- ${o.tool}: ${o.calls} call${o.calls!==1?"s":""}`,o.errors&&(n+=` (${o.errors} error${o.errors!==1?"s":""})`)}const s=e.tasks;if(s&&s.length>0){n+=` + +## Tasks`;for(const o of s)n+=` +- [${o.status}] ${o.title}`}const a=e.last_messages;return a&&a.length>0&&(n+=` + +## Last Messages`,a.forEach((o,l)=>{const c=o.tool?`${o.role}:${o.tool}`:o.role,u=o.content?o.content.replace(/\n/g," "):"";n+=` +${l+1}. [${c}] ${u}`})),n}function Oy(){const[e,t]=_.useState("idle"),n=async()=>{const r=Be.getState().sessionId;if(r){t("loading");try{const s=await Zu(r),a=Ry(s);await navigator.clipboard.writeText(a),t("copied"),setTimeout(()=>t("idle"),2e3)}catch{t("idle")}}};return i.jsx("button",{onClick:n,disabled:e==="loading",className:"inline-flex items-center gap-1 text-[11px] font-mono px-2 py-1 rounded cursor-pointer hover:brightness-125 mt-1",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:e==="copied"?"var(--success)":"var(--text-muted)"},children:e==="copied"?"Copied!":e==="loading"?"Loading...":"Copy Diagnostics"})}function jy({message:e}){if(e.role==="thinking")return i.jsx(Sy,{message:e});if(e.role==="plan")return i.jsx(Ty,{message:e});if(e.role==="tool")return i.jsx(Iy,{message:e});const t=e.role==="user"?"user":"assistant",n=Ny[t];return i.jsxs("div",{className:"py-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[i.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:n.color}}),i.jsx("span",{className:"text-[11px] font-semibold",style:{color:n.color},children:n.label})]}),e.content&&(e.role==="user"?i.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose",style:{color:"var(--text-primary)"},children:e.content}):i.jsxs("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose chat-markdown",style:{color:"var(--text-secondary)"},children:[i.jsx(Eh,{remarkPlugins:[_y],rehypePlugins:[mx],children:e.content}),e.content.includes("Reached maximum iterations")&&i.jsx(Oy,{})]}))]})}function Ly(){const e=Be(l=>l.activeQuestion),t=Be(l=>l.sessionId),n=Be(l=>l.setActiveQuestion),[r,s]=_.useState("");if(!e)return null;const a=l=>{t&&(er().sendQuestionResponse(t,e.question_id,l),n(null),s(""))},o=e.options.length>0;return i.jsxs("div",{className:"mx-3 mb-2 rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--accent) 40%, var(--border))"},children:[i.jsx("div",{className:"px-3 py-2",style:{background:"color-mix(in srgb, var(--accent) 10%, var(--bg-secondary))"},children:i.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--accent)"},children:"Question"})}),i.jsxs("div",{className:"px-3 py-2",style:{background:"var(--bg-secondary)"},children:[i.jsx("p",{className:"text-sm mb-2",style:{color:"var(--text-primary)"},children:e.question}),o&&i.jsx("div",{className:"flex flex-col gap-1 mb-2",children:e.options.map((l,c)=>i.jsxs("button",{onClick:()=>a(l),className:"w-full text-left text-[13px] py-2 px-3 rounded cursor-pointer transition-colors flex items-center gap-2",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",borderLeft:"2px solid transparent",color:"var(--text-primary)",fontFamily:"var(--font-mono, ui-monospace, monospace)"},onMouseEnter:u=>{u.currentTarget.style.borderLeftColor="var(--accent)",u.currentTarget.style.background="color-mix(in srgb, var(--accent) 8%, var(--bg-primary))"},onMouseLeave:u=>{u.currentTarget.style.borderLeftColor="transparent",u.currentTarget.style.background="var(--bg-primary)"},children:[i.jsxs("span",{className:"text-[11px] font-semibold shrink-0",style:{color:"var(--text-muted)"},children:[c+1,"."]}),i.jsx("span",{className:"truncate",children:l})]},c))}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("input",{type:"text",value:r,onChange:l=>s(l.target.value),onKeyDown:l=>{l.key==="Enter"&&r.trim()&&a(r.trim())},placeholder:o?"Or type a custom answer...":"Type your answer...",className:"flex-1 text-sm px-2 py-1.5 rounded outline-none",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-primary)"}}),i.jsx("button",{onClick:()=>{r.trim()&&a(r.trim())},disabled:!r.trim(),className:"text-xs font-semibold px-3 py-1.5 rounded cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-not-allowed",style:{background:"color-mix(in srgb, var(--accent) 15%, var(--bg-secondary))",color:"var(--accent)",border:"1px solid color-mix(in srgb, var(--accent) 30%, var(--border))"},children:"Send"})]})]})]})}function Dy(){const e=_.useRef(er()).current,[t,n]=_.useState(""),r=_.useRef(null),s=_.useRef(!0),a=Hn(K=>K.enabled),o=Hn(K=>K.status),l=!a||o==="authenticated",{sessionId:c,status:u,messages:d,plan:p,models:m,selectedModel:f,modelsLoading:x,skills:g,selectedSkillIds:v,skillsLoading:y,setModels:b,setSelectedModel:C,setModelsLoading:O,setSkills:L,setSelectedSkillIds:N,toggleSkill:B,setSkillsLoading:D,addUserMessage:R,hydrateSession:S,clearSession:T}=Be();_.useEffect(()=>{l&&(m.length>0||(O(!0),Xu().then(K=>{if(b(K),K.length>0&&!f){const H=K.find(re=>re.model_name.includes("claude"));C(H?H.model_name:K[0].model_name)}}).catch(console.error).finally(()=>O(!1))))},[l,m.length,f,b,C,O]),_.useEffect(()=>{g.length>0||(D(!0),ed().then(K=>{L(K),N(K.map(H=>H.id))}).catch(console.error).finally(()=>D(!1)))},[g.length,L,N,D]),_.useEffect(()=>{if(c)return;const K=sessionStorage.getItem("agent_session_id");K&&Ju(K).then(H=>{H?S(H):sessionStorage.removeItem("agent_session_id")}).catch(()=>{sessionStorage.removeItem("agent_session_id")})},[]);const[j,M]=_.useState(!1),w=()=>{const K=r.current;if(!K)return;const H=K.scrollHeight-K.scrollTop-K.clientHeight<40;s.current=H,M(K.scrollTop>100)};_.useEffect(()=>{s.current&&r.current&&(r.current.scrollTop=r.current.scrollHeight)});const k=u==="thinking"||u==="executing"||u==="planning"||u==="awaiting_input",I=d[d.length-1],W=k&&(I==null?void 0:I.role)==="assistant"&&!I.done,U=k&&!W,q=_.useRef(null),h=()=>{const K=q.current;K&&(K.style.height="auto",K.style.height=Math.min(K.scrollHeight,200)+"px")},F=_.useCallback(()=>{const K=t.trim();!K||!f||k||(s.current=!0,R(K),e.sendAgentMessage(K,f,c,v),n(""),requestAnimationFrame(()=>{const H=q.current;H&&(H.style.height="auto")}))},[t,f,k,c,v,R,e]),$=_.useCallback(()=>{c&&e.sendAgentStop(c)},[c,e]),E=K=>{K.key==="Enter"&&!K.shiftKey&&(K.preventDefault(),F())},se=!k&&!!f&&t.trim().length>0;return l?i.jsxs("div",{className:"flex flex-col h-full",style:{background:"var(--bg-primary)"},children:[i.jsx(Ci,{selectedModel:f,models:m,modelsLoading:x,onModelChange:C,skills:g,selectedSkillIds:v,skillsLoading:y,onToggleSkill:B,onClear:T,onStop:$,hasMessages:d.length>0,isBusy:k}),i.jsx(By,{plan:p}),i.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[i.jsxs("div",{ref:r,onScroll:w,className:"h-full overflow-y-auto px-3 py-2 space-y-0.5",children:[d.length===0&&i.jsxs("div",{className:"flex flex-col items-center justify-center py-10 px-4 gap-3",style:{color:"var(--text-muted)"},children:[i.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),i.jsxs("div",{className:"text-center space-y-1.5",children:[i.jsx("p",{className:"text-sm font-medium",style:{color:"var(--text-secondary)"},children:"Ask the agent to help you code"}),i.jsxs("p",{className:"text-xs leading-relaxed",children:["Create agents, functions, evaluations,",i.jsx("br",{}),"or ask questions about your project."]})]})]}),d.filter(K=>K.role!=="plan").map(K=>i.jsx(jy,{message:K},K.id)),U&&i.jsx("div",{className:"py-1.5",children:i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("div",{className:"w-2 h-2 rounded-full animate-pulse",style:{background:"var(--success)"}}),i.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--success)"},children:u==="thinking"?"Thinking...":u==="executing"?"Executing...":u==="awaiting_input"?"Waiting for answer...":"Planning..."})]})})]}),j&&i.jsx("button",{onClick:()=>{var K;s.current=!1,(K=r.current)==null||K.scrollTo({top:0,behavior:"smooth"})},className:"absolute top-2 right-3 w-6 h-6 flex items-center justify-center rounded-full cursor-pointer transition-opacity opacity-70 hover:opacity-100",style:{background:"var(--bg-tertiary)",color:"var(--text-primary)"},title:"Scroll to top",children:i.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("polyline",{points:"18 15 12 9 6 15"})})})]}),i.jsx(Ly,{}),i.jsxs("div",{className:"flex items-end gap-2 px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:[i.jsx("textarea",{ref:q,value:t,onChange:K=>{n(K.target.value),h()},onKeyDown:E,disabled:k||!f,placeholder:k?"Waiting for response...":"Message...",rows:2,className:"flex-1 bg-transparent text-sm py-1 disabled:opacity-40 placeholder:text-[var(--text-muted)] resize-none",style:{color:"var(--text-primary)",maxHeight:200,overflow:"auto"}}),i.jsx("button",{onClick:F,disabled:!se,className:"text-xs font-semibold px-3 py-1.5 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed shrink-0","aria-label":"Send message",style:{color:se?"var(--accent)":"var(--text-muted)",background:"transparent"},onMouseEnter:K=>{se&&(K.currentTarget.style.background="color-mix(in srgb, var(--accent) 10%, transparent)")},onMouseLeave:K=>{K.currentTarget.style.background="transparent"},children:"Send"})]})]}):i.jsxs("div",{className:"flex flex-col h-full",style:{background:"var(--bg-primary)"},children:[i.jsx(Ci,{selectedModel:f,models:m,modelsLoading:x,onModelChange:C,skills:g,selectedSkillIds:v,skillsLoading:y,onToggleSkill:B,onClear:T,onStop:$,hasMessages:!1,isBusy:!1}),i.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:i.jsxs("div",{className:"text-center",style:{color:"var(--text-muted)"},children:[i.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"mx-auto mb-2",strokeLinecap:"round",children:[i.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),i.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),i.jsx("p",{className:"text-sm font-medium mb-1",children:"Sign in to use Agent"}),i.jsx("p",{className:"text-xs",children:"Authentication is required to access the coding agent."})]})})]})}function Ci({selectedModel:e,models:t,modelsLoading:n,onModelChange:r,skills:s,selectedSkillIds:a,skillsLoading:o,onToggleSkill:l,onClear:c,onStop:u,hasMessages:d,isBusy:p}){const[m,f]=_.useState(!1),x=_.useRef(null);return _.useEffect(()=>{if(!m)return;const g=v=>{x.current&&!x.current.contains(v.target)&&f(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[m]),i.jsxs("div",{className:"shrink-0 flex items-center gap-2 px-3 h-10 border-b",style:{borderColor:"var(--border)",background:"var(--bg-primary)"},children:[i.jsx("span",{className:"text-[11px] uppercase tracking-wider font-semibold shrink-0",style:{color:"var(--text-muted)"},children:"Agent"}),i.jsxs("select",{value:e??"",onChange:g=>r(g.target.value),className:"flex-1 text-[11px] rounded px-1.5 py-1 outline-none min-w-0 cursor-pointer",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},disabled:n,children:[n&&i.jsx("option",{value:"",children:"Loading models..."}),!n&&t.length===0&&i.jsx("option",{value:"",children:"No models"}),t.map(g=>i.jsx("option",{value:g.model_name,children:g.model_name},g.model_name))]}),!o&&s.length>0&&i.jsxs("div",{className:"relative shrink-0",ref:x,children:[i.jsxs("button",{onClick:()=>f(!m),className:"text-[11px] font-semibold px-2 py-1 rounded cursor-pointer flex items-center gap-1",style:{background:a.length>0?"color-mix(in srgb, var(--accent) 15%, transparent)":"transparent",border:`1px solid ${a.length>0?"var(--accent)":"var(--border)"}`,color:a.length>0?"var(--accent)":"var(--text-muted)"},title:"Skills",children:[i.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"}),i.jsx("path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"})]}),a.length>0&&i.jsx("span",{children:a.length})]}),m&&i.jsx("div",{className:"absolute top-full right-0 mt-1 rounded shadow-lg z-50 py-1 max-h-64 overflow-y-auto",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",width:"190px"},children:s.map(g=>i.jsxs("button",{onClick:()=>l(g.id),className:"w-full text-left px-2 py-1 text-[11px] flex items-center gap-1.5 cursor-pointer",style:{color:"var(--text-primary)"},title:g.description,onMouseEnter:v=>{v.currentTarget.style.background="var(--bg-tertiary)"},onMouseLeave:v=>{v.currentTarget.style.background="transparent"},children:[i.jsx("span",{className:"w-3 h-3 rounded border flex items-center justify-center shrink-0",style:{borderColor:a.includes(g.id)?"var(--accent)":"var(--border)",background:a.includes(g.id)?"var(--accent)":"transparent"},children:a.includes(g.id)&&i.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("polyline",{points:"20 6 9 17 4 12"})})}),i.jsx("span",{className:"truncate",children:g.name})]},g.id))})]}),d&&i.jsx("button",{onClick:()=>ge.getState().openTab("__agent_state__"),className:"shrink-0 text-[11px] font-semibold px-2 py-1 rounded cursor-pointer",style:{background:"transparent",border:"1px solid var(--border)",color:"var(--text-muted)"},title:"Open agent trace inspector",onMouseEnter:g=>{g.currentTarget.style.background="var(--bg-hover)",g.currentTarget.style.color="var(--text-primary)"},onMouseLeave:g=>{g.currentTarget.style.background="transparent",g.currentTarget.style.color="var(--text-muted)"},children:"Trace"}),p&&i.jsx("button",{onClick:u,className:"shrink-0 text-[11px] font-semibold px-2 py-1 rounded cursor-pointer",style:{background:"transparent",border:"1px solid var(--error)",color:"var(--error)"},title:"Stop",onMouseEnter:g=>{g.currentTarget.style.background="color-mix(in srgb, var(--error) 10%, transparent)"},onMouseLeave:g=>{g.currentTarget.style.background="transparent"},children:"Stop"}),d&&!p&&i.jsx("button",{onClick:c,className:"shrink-0 w-6 h-6 flex items-center justify-center rounded cursor-pointer",style:{background:"transparent",border:"none",color:"var(--text-muted)"},title:"New session",onMouseEnter:g=>{g.currentTarget.style.color="var(--text-primary)"},onMouseLeave:g=>{g.currentTarget.style.color="var(--text-muted)"},children:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("polyline",{points:"1 4 1 10 7 10"}),i.jsx("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]})})]})}const Py=10;function By({plan:e}){const t=e.filter(m=>m.status==="completed").length,n=e.filter(m=>m.status!=="completed"),r=e.length>0&&t===e.length,[s,a]=_.useState(!1),o=_.useRef(n.length);if(_.useEffect(()=>{r&&a(!0)},[r]),_.useEffect(()=>{n.length>o.current&&a(!1),o.current=n.length},[n.length]),e.length===0)return null;const l=e.filter(m=>m.status==="completed"),c=Math.max(0,Py-n.length),d=[...l.slice(-c),...n],p=e.length-d.length;return i.jsxs("div",{className:"shrink-0 border-b",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[i.jsxs("button",{onClick:()=>a(!s),className:"w-full flex items-center gap-2 px-3 py-1.5 cursor-pointer",style:{background:"none",border:"none"},children:[i.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:"var(--accent)"}}),i.jsxs("span",{className:"text-[11px] font-semibold",style:{color:"var(--accent)"},children:["Plan (",t,"/",e.length," completed)"]}),i.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-muted)",strokeWidth:"2",className:"ml-auto",style:{transform:s?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.15s"},children:i.jsx("path",{d:"M6 9l6 6 6-6"})})]}),!s&&i.jsxs("div",{className:"px-3 pb-2 space-y-1",children:[p>0&&i.jsxs("div",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:[p," earlier completed task",p!==1?"s":""," hidden"]}),d.map((m,f)=>i.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[m.status==="completed"?i.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--success)",strokeWidth:"2.5",strokeLinecap:"round",children:i.jsx("path",{d:"M20 6L9 17l-5-5"})}):m.status==="in_progress"?i.jsx("span",{className:"w-3.5 h-3.5 flex items-center justify-center",children:i.jsx("span",{className:"w-2 h-2 rounded-full animate-pulse",style:{background:"var(--accent)"}})}):i.jsx("span",{className:"w-3.5 h-3.5 flex items-center justify-center",children:i.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:"var(--text-muted)",opacity:.4}})}),i.jsx("span",{style:{color:m.status==="completed"?"var(--text-muted)":"var(--text-primary)",textDecoration:m.status==="completed"?"line-through":"none"},children:m.title})]},f))]})]})}function Fy(){const e=hc(),t=yc(),[n,r]=_.useState(!1),[s,a]=_.useState(248),[o,l]=_.useState(!1),[c,u]=_.useState(380),[d,p]=_.useState(!1),{runs:m,selectedRunId:f,setRuns:x,upsertRun:g,selectRun:v,setTraces:y,setLogs:b,setChatMessages:C,setEntrypoints:O,setStateEvents:L,setGraphCache:N,setActiveNode:B,removeActiveNode:D}=ve(),{section:R,view:S,runId:T,setupEntrypoint:j,setupMode:M,evalCreating:w,evalSetId:k,evalRunId:I,evalRunItemName:W,evaluatorCreateType:U,evaluatorId:q,evaluatorFilter:h,explorerFile:F,navigate:$}=it(),{setEvalSets:E,setEvaluators:se,setLocalEvaluators:K,setEvalRuns:H}=Me();_.useEffect(()=>{R==="debug"&&S==="details"&&T&&T!==f&&v(T)},[R,S,T,f,v]);const re=Hn(J=>J.init),de=Mi(J=>J.init);_.useEffect(()=>{dc().then(x).catch(console.error),rs().then(J=>O(J.map(he=>he.name))).catch(console.error),re(),de()},[x,O,re,de]),_.useEffect(()=>{R==="evals"&&(Ii().then(J=>E(J)).catch(console.error),Cc().then(J=>H(J)).catch(console.error)),(R==="evals"||R==="evaluators")&&(Ec().then(J=>se(J)).catch(console.error),is().then(J=>K(J)).catch(console.error))},[R,E,se,K,H]);const be=Me(J=>J.evalSets),Oe=Me(J=>J.evalRuns);_.useEffect(()=>{if(R!=="evals"||w||k||I)return;const J=Object.values(Oe).sort((Re,fe)=>new Date(fe.start_time??0).getTime()-new Date(Re.start_time??0).getTime());if(J.length>0){$(`#/evals/runs/${J[0].id}`);return}const he=Object.values(be);he.length>0&&$(`#/evals/sets/${he[0].id}`)},[R,w,k,I,Oe,be,$]),_.useEffect(()=>{const J=he=>{he.key==="Escape"&&n&&r(!1)};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},[n]);const Ie=f?m[f]:null,at=_.useCallback((J,he)=>{g(he),y(J,he.traces),b(J,he.logs);const Re=he.messages.map(fe=>{const P=fe.contentParts??fe.content_parts??[],G=fe.toolCalls??fe.tool_calls??[];return{message_id:fe.messageId??fe.message_id,role:fe.role??"assistant",content:P.filter(ee=>{const ae=ee.mimeType??ee.mime_type??"";return ae.startsWith("text/")||ae==="application/json"}).map(ee=>{const ae=ee.data;return(ae==null?void 0:ae.inline)??""}).join(` +`).trim()??"",tool_calls:G.length>0?G.map(ee=>({name:ee.name??"",has_result:!!ee.result})):void 0}});if(C(J,Re),he.graph&&he.graph.nodes.length>0&&N(J,he.graph),he.states&&he.states.length>0&&(L(J,he.states.map(fe=>({node_name:fe.node_name,qualified_node_name:fe.qualified_node_name,phase:fe.phase,timestamp:new Date(fe.timestamp).getTime(),payload:fe.payload}))),he.status!=="completed"&&he.status!=="failed"))for(const fe of he.states)fe.phase==="started"?B(J,fe.node_name,fe.qualified_node_name):fe.phase==="completed"&&D(J,fe.node_name)},[g,y,b,C,L,N,B,D]);_.useEffect(()=>{if(!f)return;e.subscribe(f),fr(f).then(he=>at(f,he)).catch(console.error);const J=setTimeout(()=>{const he=ve.getState().runs[f];he&&(he.status==="pending"||he.status==="running")&&fr(f).then(Re=>at(f,Re)).catch(console.error)},2e3);return()=>{clearTimeout(J),e.unsubscribe(f)}},[f,e,at]);const St=_.useRef(null);_.useEffect(()=>{var Re,fe;if(!f)return;const J=Ie==null?void 0:Ie.status,he=St.current;if(St.current=J??null,J&&(J==="completed"||J==="failed")&&he!==J){const P=ve.getState(),G=((Re=P.traces[f])==null?void 0:Re.length)??0,ee=((fe=P.logs[f])==null?void 0:fe.length)??0,ae=(Ie==null?void 0:Ie.trace_count)??0,we=(Ie==null?void 0:Ie.log_count)??0;(Gat(f,Ke)).catch(console.error)}},[f,Ie==null?void 0:Ie.status,at]);const Pt=J=>{$(`#/debug/runs/${J}/traces`),v(J),r(!1)},yt=J=>{$(`#/debug/runs/${J}/traces`),v(J),r(!1)},ke=()=>{$("#/debug/new"),r(!1)},lt=J=>{J==="debug"?$("#/debug/new"):J==="evals"?$("#/evals"):J==="evaluators"?$("#/evaluators"):J==="explorer"&&$("#/explorer")},rt=_.useCallback(J=>{J.preventDefault(),l(!0);const he="touches"in J?J.touches[0].clientX:J.clientX,Re=s,fe=G=>{const ee="touches"in G?G.touches[0].clientX:G.clientX,ae=Math.max(200,Math.min(480,Re+(ee-he)));a(ae)},P=()=>{l(!1),document.removeEventListener("mousemove",fe),document.removeEventListener("mouseup",P),document.removeEventListener("touchmove",fe),document.removeEventListener("touchend",P),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",fe),document.addEventListener("mouseup",P),document.addEventListener("touchmove",fe,{passive:!1}),document.addEventListener("touchend",P)},[s]),vt=_.useCallback(J=>{J.preventDefault(),p(!0);const he="touches"in J?J.touches[0].clientX:J.clientX,Re=c,fe=G=>{const ee="touches"in G?G.touches[0].clientX:G.clientX,ae=Math.max(280,Math.min(700,Re-(ee-he)));u(ae)},P=()=>{p(!1),document.removeEventListener("mousemove",fe),document.removeEventListener("mouseup",P),document.removeEventListener("touchmove",fe),document.removeEventListener("touchend",P),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",fe),document.addEventListener("mouseup",P),document.addEventListener("touchmove",fe,{passive:!1}),document.addEventListener("touchend",P)},[c]),Bt=ge(J=>J.openTabs),qt=()=>R==="explorer"?Bt.length>0||F?i.jsx(ud,{}):i.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Select a file to view"}):R==="evals"?w?i.jsx(yo,{}):I?i.jsx(Du,{evalRunId:I,itemName:W}):k?i.jsx(Ru,{evalSetId:k}):i.jsx(yo,{}):R==="evaluators"?U?i.jsx(Yu,{category:U}):i.jsx(Ku,{evaluatorId:q,evaluatorFilter:h}):S==="new"?i.jsx(Bc,{}):S==="setup"&&j&&M?i.jsx(cu,{entrypoint:j,mode:M,ws:e,onRunCreated:Pt,isMobile:t}):Ie?i.jsx(Cu,{run:Ie,ws:e,isMobile:t}):i.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Select a run or create a new one"});return t?i.jsxs("div",{className:"flex flex-col h-screen w-screen",children:[i.jsxs("div",{className:"flex flex-1 overflow-hidden relative",children:[!n&&i.jsx("button",{onClick:()=>r(!0),className:"fixed top-2 left-2 z-40 w-9 h-9 flex items-center justify-center rounded-lg cursor-pointer",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[i.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),i.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),i.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})}),n&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 z-50",style:{background:"rgba(0,0,0,0.5)"},onClick:()=>r(!1)}),i.jsxs("aside",{className:"fixed inset-y-0 left-0 z-50 w-64 bg-[var(--sidebar-bg)] border-r border-[var(--border)] flex flex-col",children:[i.jsxs("div",{className:"px-3 h-10 border-b border-[var(--border)] flex items-center justify-between",children:[i.jsxs("button",{onClick:()=>{$("#/debug/new"),r(!1)},className:"flex items-center gap-2 cursor-pointer",style:{background:"none",border:"none"},children:[i.jsx("img",{src:"/favicon.ico",width:"14",height:"14",alt:"UiPath"}),i.jsx("span",{className:"text-[10px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Developer Console"})]}),i.jsx("button",{onClick:()=>r(!1),className:"w-6 h-6 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},children:i.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[i.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),i.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),R==="debug"&&i.jsx(Ws,{runs:Object.values(m),selectedRunId:f,onSelectRun:yt,onNewRun:ke}),R==="evals"&&i.jsx(fo,{}),R==="evaluators"&&i.jsx(vo,{}),R==="explorer"&&i.jsx(Eo,{})]})]}),i.jsx("main",{className:"flex-1 overflow-hidden bg-[var(--bg-primary)]",children:qt()})]}),i.jsx(Ks,{}),i.jsx(ao,{}),i.jsx(uo,{})]}):i.jsxs("div",{className:"flex flex-col h-screen w-screen",children:[i.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[i.jsxs("aside",{className:"shrink-0 flex flex-col",style:{width:s,background:"var(--sidebar-bg)"},children:[i.jsxs("div",{className:"flex h-10 border-b shrink-0",style:{borderColor:"var(--border)"},children:[i.jsx("button",{onClick:()=>$("#/debug/new"),className:"w-12 shrink-0 flex items-center justify-center cursor-pointer transition-colors border-r",style:{background:"var(--activity-bar-bg)",border:"none",borderRight:"1px solid var(--border)"},onMouseEnter:J=>{J.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:J=>{J.currentTarget.style.background="var(--activity-bar-bg)"},children:i.jsx("img",{src:"/favicon.ico",width:"20",height:"20",alt:"UiPath"})}),i.jsx("div",{className:"flex-1 flex items-center px-3",style:{background:"var(--sidebar-bg)"},children:i.jsx("span",{className:"text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:R==="debug"?"Developer Console":R==="evals"?"Evaluations":R==="evaluators"?"Evaluators":"Explorer"})})]}),i.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[i.jsx(kc,{section:R,onSectionChange:lt}),i.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[R==="debug"&&i.jsx(Ws,{runs:Object.values(m),selectedRunId:f,onSelectRun:yt,onNewRun:ke}),R==="evals"&&i.jsx(fo,{}),R==="evaluators"&&i.jsx(vo,{}),R==="explorer"&&i.jsx(Eo,{})]})]})]}),i.jsx("div",{onMouseDown:rt,onTouchStart:rt,className:"shrink-0 drag-handle-col",style:o?{background:"var(--accent)"}:void 0}),i.jsxs("main",{className:"flex-1 overflow-hidden bg-[var(--bg-primary)] flex",children:[i.jsx("div",{className:"flex-1 overflow-hidden",children:qt()}),R==="explorer"&&i.jsxs(i.Fragment,{children:[i.jsx("div",{onMouseDown:vt,onTouchStart:vt,className:"shrink-0 drag-handle-col",style:d?{background:"var(--accent)"}:void 0}),i.jsx("div",{className:"shrink-0 overflow-hidden",style:{width:c,borderLeft:"1px solid var(--border)"},children:i.jsx(Dy,{})})]})]})]}),i.jsx(Ks,{}),i.jsx(ao,{}),i.jsx(uo,{})]})}Hl.createRoot(document.getElementById("root")).render(i.jsx(_.StrictMode,{children:i.jsx(Fy,{})}));export{Eh as M,_y as a,mx as r,ve as u}; diff --git a/src/uipath/dev/server/static/assets/index-D4dH-hau.css b/src/uipath/dev/server/static/assets/index-D4dH-hau.css deleted file mode 100644 index 23dac34..0000000 --- a/src/uipath/dev/server/static/assets/index-D4dH-hau.css +++ /dev/null @@ -1 +0,0 @@ -/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial;--tw-ease:initial;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--spacing:.25rem;--container-xs:20rem;--container-xl:36rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-normal:1.5;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.top-1{top:calc(var(--spacing) * 1)}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-2{top:calc(var(--spacing) * 2)}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-1{right:calc(var(--spacing) * 1)}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.bottom-1\.5{bottom:calc(var(--spacing) * 1.5)}.bottom-8{bottom:calc(var(--spacing) * 8)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing) * 0)}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.my-2{margin-block:calc(var(--spacing) * 2)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.mr-0\.5{margin-right:calc(var(--spacing) * .5)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-\[14px\]{height:14px}.h-full{height:100%}.h-screen{height:100vh}.max-h-32{max-height:calc(var(--spacing) * 32)}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-\[85vh\]{max-height:85vh}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-full{min-height:100%}.w-0\.5{width:calc(var(--spacing) * .5)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-24{width:calc(var(--spacing) * 24)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-44{width:calc(var(--spacing) * 44)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-\[200px\]{width:200px}.w-\[calc\(100\%-24px\)\]{width:calc(100% - 24px)}.w-full{width:100%}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\[160px\]{max-width:160px}.max-w-\[200px\]{max-width:200px}.max-w-prose{max-width:65ch}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[140px\]{min-width:140px}.min-w-\[180px\]{min-width:180px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\[slideIn_0\.2s_ease-out\]{animation:.2s ease-out slideIn}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.appearance-auto{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-\[var\(--border\)\]{border-color:var(--border)}.bg-\[var\(--bg-primary\)\]{background-color:var(--bg-primary)}.bg-\[var\(--sidebar-bg\)\]{background-color:var(--sidebar-bg)}.bg-transparent{background-color:#0000}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-0\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-\[3px\]{padding-block:3px}.pt-0{padding-top:calc(var(--spacing) * 0)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-1\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-px{padding-top:1px}.pr-0{padding-right:calc(var(--spacing) * 0)}.pr-1{padding-right:calc(var(--spacing) * 1)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pb-0\.5{padding-bottom:calc(var(--spacing) * .5)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-\[22px\]{padding-left:22px}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--text-muted\)\]{color:var(--text-muted)}.text-\[var\(--text-primary\)\]{color:var(--text-primary)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.accent-\[var\(--accent\)\]{accent-color:var(--accent)}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.outline-none{--tw-outline-style:none;outline-style:none}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-\[var\(--text-muted\)\]::placeholder{color:var(--text-muted)}@media(hover:hover){.hover\:bg-\[var\(--bg-hover\)\]:hover{background-color:var(--bg-hover)}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-100:hover{opacity:1}.hover\:brightness-125:hover{--tw-brightness:brightness(125%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}}pre code.hljs{padding:1em;display:block;overflow-x:auto}code.hljs{padding:3px 5px}.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}:root,[data-theme=dark]{--bg-primary:#0f172a;--bg-secondary:#1e293b;--bg-tertiary:#334155;--bg-hover:#263348;--bg-elevated:#253041;--text-primary:#cbd5e1;--text-secondary:#94a3b8;--text-muted:#64748b;--border:#334155;--accent:#fa4616;--accent-hover:#e03d12;--accent-light:#ff6a3d;--success:#22c55e;--warning:#eab308;--error:#ef4444;--info:#3b82f6;--sidebar-bg:#0e1526;--activity-bar-bg:#0a1020;--card-bg:#1e293b;--input-bg:#0f172a;--code-bg:#0f172a;--tab-active:#fa4616;--tab-text:#94a3b8;--tab-text-active:#fa4616;--node-bg:#1e293b;--node-border:#475569;--scrollbar-thumb:#334155;color-scheme:dark}[data-theme=light]{--bg-primary:#f8fafc;--bg-secondary:#fff;--bg-tertiary:#cbd5e1;--bg-hover:#f1f5f9;--bg-elevated:#fff;--text-primary:#0f172a;--text-secondary:#475569;--text-muted:#94a3b8;--border:#e2e8f0;--accent:#fa4616;--accent-hover:#e03d12;--accent-light:#ff6a3d;--success:#22c55e;--warning:#ca8a04;--error:#ef4444;--info:#2563eb;--sidebar-bg:#fff;--activity-bar-bg:#f1f5f9;--card-bg:#fff;--input-bg:#f8fafc;--code-bg:#e8ecf1;--tab-active:#fa4616;--tab-text:#64748b;--tab-text-active:#fa4616;--node-bg:#fff;--node-border:#cbd5e1;--scrollbar-thumb:#d1d5db;color-scheme:light}body{background:var(--bg-primary);color:var(--text-primary);margin:0;font-family:Inter,system-ui,-apple-system,sans-serif;transition:background-color .2s,color .2s}#root{height:100dvh;display:flex}:focus-visible{outline:2px solid var(--accent);outline-offset:1px}button:focus-visible,[role=button]:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid var(--accent)}@supports (color:color-mix(in lab,red,red)){button:focus-visible,[role=button]:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid color-mix(in srgb,var(--accent) 60%,transparent)}}button:focus-visible,[role=button]:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline-offset:0px;border-radius:3px}.drag-handle-row{cursor:row-resize;background:var(--border);height:3px;transition:background .15s;position:relative}.drag-handle-row:before{content:"";position:absolute;top:-5px;right:0;bottom:-5px;left:0}.drag-handle-row:hover,.drag-handle-row:active{background:var(--accent)}.drag-handle-col{cursor:col-resize;background:var(--border);width:3px;transition:background .15s;position:relative}.drag-handle-col:before{content:"";position:absolute;top:0;right:-5px;bottom:0;left:-5px}.drag-handle-col:hover,.drag-handle-col:active{background:var(--accent)}@keyframes skeleton-pulse{0%,to{opacity:.4}50%{opacity:.7}}.skeleton{background:var(--bg-tertiary);border-radius:4px;animation:1.5s ease-in-out infinite skeleton-pulse}.react-flow__node{font-size:12px}.react-flow__node-default{background:var(--node-bg)!important;color:var(--text-primary)!important;border-color:var(--node-border)!important}.react-flow__background{background:var(--bg-primary)!important}.react-flow__controls button{background:var(--bg-secondary)!important;color:var(--text-primary)!important;border-color:var(--border)!important}.react-flow__controls button:hover{background:var(--bg-hover)!important}.react-flow__controls button svg{fill:var(--text-primary)!important}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:var(--bg-secondary)}::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb);border-radius:3px}select{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}select option{background:var(--bg-secondary);color:var(--text-primary)}.chat-markdown p{margin:.25em 0}.chat-markdown p:first-child{margin-top:0}.chat-markdown p:last-child{margin-bottom:0}.chat-markdown code{background:var(--code-bg);border:1px solid var(--border);border-radius:3px;padding:.1em .35em;font-size:.85em}.chat-markdown pre{background:var(--code-bg);border:1px solid var(--border);border-radius:6px;margin:.5em 0;padding:.75em;overflow-x:auto}.chat-markdown pre code{background:0 0;border:none;padding:0;font-size:.85em}.chat-markdown ul,.chat-markdown ol{margin:.25em 0;padding-left:1.5em}.chat-markdown li{margin:.1em 0}.chat-markdown h1,.chat-markdown h2,.chat-markdown h3{margin:.5em 0 .25em;font-weight:600}.chat-markdown h1{font-size:1.2em}.chat-markdown h2{font-size:1.1em}.chat-markdown h3{font-size:1em}.chat-markdown blockquote{border-left:3px solid var(--border);color:var(--text-secondary);margin:.25em 0;padding-left:.75em}.chat-markdown strong{font-weight:600}.chat-markdown a{color:var(--accent);text-decoration:underline}.chat-markdown table{border-collapse:collapse;width:100%;margin:.5em 0}.chat-markdown th,.chat-markdown td{border:1px solid var(--border);text-align:left;padding:.3em .6em}.chat-markdown th{background:var(--code-bg);font-weight:600}.chat-markdown tr:nth-child(2n){background:var(--code-bg)}.chat-markdown .hljs{background:0 0}[data-theme=light] .chat-markdown .hljs{color:#24292e}[data-theme=light] .chat-markdown .hljs-doctag,[data-theme=light] .chat-markdown .hljs-keyword,[data-theme=light] .chat-markdown .hljs-meta .hljs-keyword,[data-theme=light] .chat-markdown .hljs-template-tag,[data-theme=light] .chat-markdown .hljs-template-variable,[data-theme=light] .chat-markdown .hljs-type,[data-theme=light] .chat-markdown .hljs-variable.language_{color:#d73a49}[data-theme=light] .chat-markdown .hljs-title,[data-theme=light] .chat-markdown .hljs-title.class_,[data-theme=light] .chat-markdown .hljs-title.class_.inherited__,[data-theme=light] .chat-markdown .hljs-title.function_{color:#6f42c1}[data-theme=light] .chat-markdown .hljs-attr,[data-theme=light] .chat-markdown .hljs-attribute,[data-theme=light] .chat-markdown .hljs-literal,[data-theme=light] .chat-markdown .hljs-meta,[data-theme=light] .chat-markdown .hljs-number,[data-theme=light] .chat-markdown .hljs-operator,[data-theme=light] .chat-markdown .hljs-variable,[data-theme=light] .chat-markdown .hljs-selector-attr,[data-theme=light] .chat-markdown .hljs-selector-class,[data-theme=light] .chat-markdown .hljs-selector-id{color:#005cc5}[data-theme=light] .chat-markdown .hljs-regexp,[data-theme=light] .chat-markdown .hljs-string,[data-theme=light] .chat-markdown .hljs-meta .hljs-string{color:#032f62}[data-theme=light] .chat-markdown .hljs-built_in,[data-theme=light] .chat-markdown .hljs-symbol{color:#e36209}[data-theme=light] .chat-markdown .hljs-comment,[data-theme=light] .chat-markdown .hljs-code,[data-theme=light] .chat-markdown .hljs-formula{color:#6a737d}[data-theme=light] .chat-markdown .hljs-name,[data-theme=light] .chat-markdown .hljs-quote,[data-theme=light] .chat-markdown .hljs-selector-tag,[data-theme=light] .chat-markdown .hljs-selector-pseudo{color:#22863a}[data-theme=light] .chat-markdown .hljs-subst{color:#24292e}[data-theme=light] .chat-markdown .hljs-section{color:#005cc5}[data-theme=light] .chat-markdown .hljs-bullet{color:#735c0f}[data-theme=light] .chat-markdown .hljs-addition{color:#22863a;background-color:#f0fff4}[data-theme=light] .chat-markdown .hljs-deletion{color:#b31d28;background-color:#ffeef0}@keyframes agent-changed-pulse{0%,to{box-shadow:inset 0 0 0 50px color-mix(in srgb,var(--success) 20%,transparent)}50%{box-shadow:none}}.agent-changed-file{animation:2s ease-in-out 3 agent-changed-pulse}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}} diff --git a/src/uipath/dev/server/static/assets/index-V3oNRyE_.js b/src/uipath/dev/server/static/assets/index-V3oNRyE_.js deleted file mode 100644 index 9101204..0000000 --- a/src/uipath/dev/server/static/assets/index-V3oNRyE_.js +++ /dev/null @@ -1,119 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-elk-CiLKfHel.js","assets/vendor-react-N5xbSGOh.js","assets/ChatPanel-DWIYYBph.js","assets/vendor-reactflow-CxoS0d5s.js","assets/vendor-reactflow-B5DZHykP.css"])))=>i.map(i=>d[i]); -var Sl=Object.defineProperty;var Tl=(e,t,n)=>t in e?Sl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var It=(e,t,n)=>Tl(e,typeof t!="symbol"?t+"":t,n);import{W as Tn,a as _,j as a,w as Cl,F as Al,g as Xr,b as Ml}from"./vendor-react-N5xbSGOh.js";import{H as ht,P as bt,B as Il,M as Rl,u as Ol,a as Ll,R as jl,b as Dl,C as Pl,c as Bl,d as Fl}from"./vendor-reactflow-CxoS0d5s.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();const Ii=e=>{let t;const n=new Set,r=(c,d)=>{const p=typeof c=="function"?c(t):c;if(!Object.is(p,t)){const m=t;t=d??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(f=>f(t,m))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c))},u=t=e(r,i,l);return l},zl=(e=>e?Ii(e):Ii),$l=e=>e;function Ul(e,t=$l){const n=Tn.useSyncExternalStore(e.subscribe,Tn.useCallback(()=>t(e.getState()),[e,t]),Tn.useCallback(()=>t(e.getInitialState()),[e,t]));return Tn.useDebugValue(n),n}const Ri=e=>{const t=zl(e),n=r=>Ul(t,r);return Object.assign(n,t),n},Ot=(e=>e?Ri(e):Ri),ve=Ot(e=>({runs:{},selectedRunId:null,traces:{},logs:{},chatMessages:{},entrypoints:[],setRuns:t=>e(n=>{var s;let r=n.breakpoints;for(const o of t)(s=o.breakpoints)!=null&&s.length&&!r[o.id]&&(r={...r,[o.id]:Object.fromEntries(o.breakpoints.map(l=>[l,!0]))});const i={runs:Object.fromEntries(t.map(o=>[o.id,o]))};return r!==n.breakpoints&&(i.breakpoints=r),i}),upsertRun:t=>e(n=>{var i;const r={runs:{...n.runs,[t.id]:t}};if((i=t.breakpoints)!=null&&i.length&&!n.breakpoints[t.id]&&(r.breakpoints={...n.breakpoints,[t.id]:Object.fromEntries(t.breakpoints.map(s=>[s,!0]))}),(t.status==="completed"||t.status==="failed")&&n.activeNodes[t.id]){const{[t.id]:s,...o}=n.activeNodes;r.activeNodes=o}if(t.status!=="suspended"&&n.activeInterrupt[t.id]){const{[t.id]:s,...o}=n.activeInterrupt;r.activeInterrupt=o}return r}),selectRun:t=>e({selectedRunId:t}),addTrace:t=>e(n=>{const r=n.traces[t.run_id]??[],i=r.findIndex(o=>o.span_id===t.span_id),s=i>=0?r.map((o,l)=>l===i?t:o):[...r,t];return{traces:{...n.traces,[t.run_id]:s}}}),setTraces:(t,n)=>e(r=>({traces:{...r.traces,[t]:n}})),addLog:t=>e(n=>{const r=n.logs[t.run_id]??[];return{logs:{...n.logs,[t.run_id]:[...r,t]}}}),setLogs:(t,n)=>e(r=>({logs:{...r.logs,[t]:n}})),addChatEvent:(t,n)=>e(r=>{const i=r.chatMessages[t]??[],s=n.message;if(!s)return r;const o=s.messageId??s.message_id,l=s.role??"assistant",d=(s.contentParts??s.content_parts??[]).filter(h=>{const v=h.mimeType??h.mime_type??"";return v.startsWith("text/")||v==="application/json"}).map(h=>{const v=h.data;return(v==null?void 0:v.inline)??""}).join(` -`).trim(),p=(s.toolCalls??s.tool_calls??[]).map(h=>({name:h.name??"",has_result:!!h.result})),m={message_id:o,role:l,content:d,tool_calls:p.length>0?p:void 0},f=i.findIndex(h=>h.message_id===o);if(f>=0)return{chatMessages:{...r.chatMessages,[t]:i.map((h,v)=>v===f?m:h)}};if(l==="user"){const h=i.findIndex(v=>v.message_id.startsWith("local-")&&v.role==="user"&&v.content===d);if(h>=0)return{chatMessages:{...r.chatMessages,[t]:i.map((v,y)=>y===h?m:v)}}}const b=[...i,m];return{chatMessages:{...r.chatMessages,[t]:b}}}),addLocalChatMessage:(t,n)=>e(r=>{const i=r.chatMessages[t]??[];return{chatMessages:{...r.chatMessages,[t]:[...i,n]}}}),setChatMessages:(t,n)=>e(r=>({chatMessages:{...r.chatMessages,[t]:n}})),setEntrypoints:t=>e({entrypoints:t}),breakpoints:{},toggleBreakpoint:(t,n)=>e(r=>{const i={...r.breakpoints[t]??{}};return i[n]?delete i[n]:i[n]=!0,{breakpoints:{...r.breakpoints,[t]:i}}}),clearBreakpoints:t=>e(n=>{const{[t]:r,...i}=n.breakpoints;return{breakpoints:i}}),activeNodes:{},setActiveNode:(t,n,r)=>e(i=>{const s=i.activeNodes[t]??{executing:{},prev:null};return{activeNodes:{...i.activeNodes,[t]:{executing:{...s.executing,[n]:r??null},prev:s.prev}}}}),removeActiveNode:(t,n)=>e(r=>{const i=r.activeNodes[t];if(!i)return r;const{[n]:s,...o}=i.executing;return{activeNodes:{...r.activeNodes,[t]:{executing:o,prev:n}}}}),resetRunGraphState:t=>e(n=>({stateEvents:{...n.stateEvents,[t]:[]},activeNodes:{...n.activeNodes,[t]:{executing:{},prev:null}}})),stateEvents:{},addStateEvent:(t,n,r,i,s)=>e(o=>{const l=o.stateEvents[t]??[];return{stateEvents:{...o.stateEvents,[t]:[...l,{node_name:n,qualified_node_name:i,phase:s,timestamp:Date.now(),payload:r}]}}}),setStateEvents:(t,n)=>e(r=>({stateEvents:{...r.stateEvents,[t]:n}})),focusedSpan:null,setFocusedSpan:t=>e({focusedSpan:t}),activeInterrupt:{},setActiveInterrupt:(t,n)=>e(r=>({activeInterrupt:{...r.activeInterrupt,[t]:n}})),reloadPending:!1,setReloadPending:t=>e({reloadPending:t}),graphCache:{},setGraphCache:(t,n)=>e(r=>({graphCache:{...r.graphCache,[t]:n}}))})),Yn="/api";async function Hl(e){const t=await fetch(`${Yn}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({environment:e})});if(!t.ok)throw new Error(`Login failed: ${t.status}`);return t.json()}async function cr(){const e=await fetch(`${Yn}/auth/status`);if(!e.ok)throw new Error(`Status check failed: ${e.status}`);return e.json()}async function Wl(e){const t=await fetch(`${Yn}/auth/select-tenant`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tenant_name:e})});if(!t.ok)throw new Error(`Tenant selection failed: ${t.status}`);return t.json()}async function Kl(){await fetch(`${Yn}/auth/logout`,{method:"POST"})}const vs="uipath-env",Gl=["cloud","staging","alpha"];function ql(){const e=localStorage.getItem(vs);return Gl.includes(e)?e:"cloud"}const zn=Ot((e,t)=>({enabled:!0,status:"unauthenticated",environment:ql(),tenants:[],uipathUrl:null,pollTimer:null,expiryTimer:null,init:async()=>{try{const n=await fetch("/api/config");if(n.ok&&!(await n.json()).auth_enabled){e({enabled:!1});return}const r=await cr();e({status:r.status,tenants:r.tenants??[],uipathUrl:r.uipath_url??null}),r.status==="authenticated"&&t().startExpiryCheck()}catch(n){console.error("Auth init failed",n)}},setEnvironment:n=>{localStorage.setItem(vs,n),e({environment:n})},startLogin:async()=>{const{environment:n}=t();try{const r=await Hl(n);e({status:"pending"}),window.open(r.auth_url,"_blank"),t().pollStatus()}catch(r){console.error("Login failed",r)}},pollStatus:()=>{const{pollTimer:n}=t();if(n)return;const r=setInterval(async()=>{try{const i=await cr();i.status!=="pending"&&(t().stopPolling(),e({status:i.status,tenants:i.tenants??[],uipathUrl:i.uipath_url??null}),i.status==="authenticated"&&t().startExpiryCheck())}catch{}},2e3);e({pollTimer:r})},stopPolling:()=>{const{pollTimer:n}=t();n&&(clearInterval(n),e({pollTimer:null}))},startExpiryCheck:()=>{const{expiryTimer:n}=t();if(n)return;const r=setInterval(async()=>{try{(await cr()).status==="expired"&&(t().stopExpiryCheck(),e({status:"expired"}))}catch{}},3e4);e({expiryTimer:r})},stopExpiryCheck:()=>{const{expiryTimer:n}=t();n&&(clearInterval(n),e({expiryTimer:null}))},selectTenant:async n=>{try{const r=await Wl(n);e({status:"authenticated",uipathUrl:r.uipath_url,tenants:[]}),t().startExpiryCheck()}catch(r){console.error("Tenant selection failed",r)}},logout:async()=>{t().stopPolling(),t().stopExpiryCheck();try{await Kl()}catch{}e({status:"unauthenticated",tenants:[],uipathUrl:null})}})),ks=Ot(e=>({projectName:null,projectVersion:null,projectAuthors:null,init:async()=>{try{const t=await fetch("/api/config");if(t.ok){const n=await t.json();e({projectName:n.project_name??null,projectVersion:n.project_version??null,projectAuthors:n.project_authors??null})}}catch{}}}));class Vl{constructor(t){It(this,"ws",null);It(this,"url");It(this,"handlers",new Set);It(this,"reconnectTimer",null);It(this,"shouldReconnect",!0);It(this,"pendingMessages",[]);It(this,"activeSubscriptions",new Set);const n=window.location.protocol==="https:"?"wss:":"ws:";this.url=t??`${n}//${window.location.host}/ws`}connect(){var t;((t=this.ws)==null?void 0:t.readyState)!==WebSocket.OPEN&&(this.ws=new WebSocket(this.url),this.ws.onopen=()=>{console.log("[ws] connected");for(const n of this.activeSubscriptions)this.sendRaw(JSON.stringify({type:"subscribe",payload:{run_id:n}}));for(const n of this.pendingMessages)this.sendRaw(n);this.pendingMessages=[]},this.ws.onmessage=n=>{let r;try{r=JSON.parse(n.data)}catch{console.warn("[ws] failed to parse message",n.data);return}this.handlers.forEach(i=>{try{i(r)}catch(s){console.error("[ws] handler error",s)}})},this.ws.onclose=()=>{console.log("[ws] disconnected"),this.shouldReconnect&&(this.reconnectTimer=setTimeout(()=>this.connect(),2e3))},this.ws.onerror=()=>{var n;(n=this.ws)==null||n.close()})}disconnect(){var t;this.shouldReconnect=!1,this.reconnectTimer&&clearTimeout(this.reconnectTimer),(t=this.ws)==null||t.close(),this.ws=null}onMessage(t){return this.handlers.add(t),()=>this.handlers.delete(t)}sendRaw(t){var n;((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN&&this.ws.send(t)}send(t,n){var i;const r=JSON.stringify({type:t,payload:n});((i=this.ws)==null?void 0:i.readyState)===WebSocket.OPEN?this.ws.send(r):this.pendingMessages.push(r)}subscribe(t){this.activeSubscriptions.add(t),this.send("subscribe",{run_id:t})}unsubscribe(t){this.activeSubscriptions.delete(t),this.send("unsubscribe",{run_id:t})}sendChatMessage(t,n){this.send("chat.message",{run_id:t,text:n})}sendInterruptResponse(t,n){this.send("chat.interrupt_response",{run_id:t,data:n})}debugStep(t){this.send("debug.step",{run_id:t})}debugContinue(t){this.send("debug.continue",{run_id:t})}debugStop(t){this.send("debug.stop",{run_id:t})}setBreakpoints(t,n){this.send("debug.set_breakpoints",{run_id:t,breakpoints:n})}sendAgentMessage(t,n,r,i){this.send("agent.message",{text:t,model:n,session_id:r??void 0,skill_ids:i&&i.length>0?i:void 0})}sendAgentStop(t){this.send("agent.stop",{session_id:t})}sendToolApproval(t,n,r){this.send("agent.tool_response",{session_id:t,tool_call_id:n,approved:r})}sendQuestionResponse(t,n,r){this.send("agent.question_response",{session_id:t,question_id:n,answer:r})}}const Lt="/api";async function jt(e,t){const n=await fetch(e,t);if(!n.ok){let r;try{r=(await n.json()).detail||n.statusText}catch{r=n.statusText}const i=new Error(`HTTP ${n.status}`);throw i.detail=r,i.status=n.status,i}return n.json()}async function Zr(){return jt(`${Lt}/entrypoints`)}async function Yl(e){return jt(`${Lt}/entrypoints/${encodeURIComponent(e)}/schema`)}async function Xl(e){return jt(`${Lt}/entrypoints/${encodeURIComponent(e)}/mock-input`)}async function Zl(e){return jt(`${Lt}/entrypoints/${encodeURIComponent(e)}/graph`)}async function Oi(e,t,n="run",r=[]){return jt(`${Lt}/runs`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entrypoint:e,input_data:t,mode:n,breakpoints:r})})}async function Jl(){return jt(`${Lt}/runs`)}async function ur(e){return jt(`${Lt}/runs/${e}`)}async function Ql(){return jt(`${Lt}/reload`,{method:"POST"})}const Me=Ot(e=>({evaluators:[],localEvaluators:[],evalSets:{},evalRuns:{},setEvaluators:t=>e({evaluators:t}),setLocalEvaluators:t=>e({localEvaluators:t}),addLocalEvaluator:t=>e(n=>({localEvaluators:[...n.localEvaluators,t]})),upsertLocalEvaluator:t=>e(n=>({localEvaluators:n.localEvaluators.some(r=>r.id===t.id)?n.localEvaluators.map(r=>r.id===t.id?t:r):[...n.localEvaluators,t]})),setEvalSets:t=>e({evalSets:Object.fromEntries(t.map(n=>[n.id,n]))}),addEvalSet:t=>e(n=>({evalSets:{...n.evalSets,[t.id]:t}})),updateEvalSetEvaluators:(t,n)=>e(r=>{const i=r.evalSets[t];return i?{evalSets:{...r.evalSets,[t]:{...i,evaluator_ids:n}}}:r}),incrementEvalSetCount:(t,n=1)=>e(r=>{const i=r.evalSets[t];return i?{evalSets:{...r.evalSets,[t]:{...i,eval_count:i.eval_count+n}}}:r}),setEvalRuns:t=>e({evalRuns:Object.fromEntries(t.map(n=>[n.id,n]))}),upsertEvalRun:t=>e(n=>({evalRuns:{...n.evalRuns,[t.id]:t}})),updateEvalRunProgress:(t,n,r)=>e(i=>{const s=i.evalRuns[t];return s?{evalRuns:{...i.evalRuns,[t]:{...s,progress_completed:n,progress_total:r,status:"running"}}}:i}),completeEvalRun:(t,n,r)=>e(i=>{const s=i.evalRuns[t];return s?{evalRuns:{...i.evalRuns,[t]:{...s,status:"completed",overall_score:n,evaluator_scores:r,end_time:new Date().toISOString()}}}:i})}));let ec=0;function $t(){return`agent-msg-${++ec}`}const ze=Ot(e=>({sessionId:null,status:"idle",_lastActiveAt:null,messages:[],plan:[],activeQuestion:null,models:[],selectedModel:null,modelsLoading:!1,skills:[],selectedSkillIds:[],skillsLoading:!1,setStatus:t=>e(n=>{const r=n.status==="thinking"||n.status==="planning"||n.status==="executing"||n.status==="awaiting_approval";return{status:t,_lastActiveAt:r&&!(t==="thinking"||t==="planning"||t==="executing"||t==="awaiting_approval")?Date.now():n._lastActiveAt}}),addUserMessage:t=>e(n=>({messages:[...n.messages,{id:$t(),role:"user",content:t,timestamp:Date.now()}]})),appendAssistantText:(t,n)=>e(r=>{const i=[...r.messages],s=i[i.length-1];return s&&s.role==="assistant"&&!s.done?i[i.length-1]={...s,content:s.content+t,done:n}:i.push({id:$t(),role:"assistant",content:t,timestamp:Date.now(),done:n}),{messages:i}}),setPlan:t=>e(n=>{const r=[...n.messages],i=r.findIndex(o=>o.role==="plan"),s={id:i>=0?r[i].id:$t(),role:"plan",content:"",timestamp:Date.now(),planItems:t};return i>=0?r[i]=s:r.push(s),{messages:r,plan:t}}),addToolUse:(t,n)=>e(r=>{const i=[...r.messages],s=i[i.length-1],o={tool:t,args:n};return s&&s.role==="tool"&&s.toolCalls?i[i.length-1]={...s,toolCalls:[...s.toolCalls,o]}:i.push({id:$t(),role:"tool",content:"",timestamp:Date.now(),toolCalls:[o]}),{messages:i}}),addToolResult:(t,n,r)=>e(i=>{const s=[...i.messages];for(let o=s.length-1;o>=0;o--){const l=s[o];if(l.role==="tool"&&l.toolCalls){const u=[...l.toolCalls];for(let c=u.length-1;c>=0;c--)if(u[c].tool===t&&u[c].result===void 0)return u[c]={...u[c],result:n,is_error:r},s[o]={...l,toolCalls:u},{messages:s}}}return{messages:s}}),addToolApprovalRequest:(t,n,r)=>e(i=>{const s=[...i.messages];for(let u=s.length-1;u>=0;u--){const c=s[u];if(c.role==="tool"&&c.toolCalls){const d=[...c.toolCalls];for(let p=d.length-1;p>=0;p--)if(d[p].tool===n&&!d[p].status&&d[p].result===void 0)return d[p]={...d[p],tool_call_id:t,status:"pending"},s[u]={...c,toolCalls:d},{messages:s}}if(c.role!=="tool")break}const o={tool:n,args:r,tool_call_id:t,status:"pending"},l=s[s.length-1];return l&&l.role==="tool"&&l.toolCalls?s[s.length-1]={...l,toolCalls:[...l.toolCalls,o]}:s.push({id:$t(),role:"tool",content:"",timestamp:Date.now(),toolCalls:[o]}),{messages:s}}),resolveToolApproval:(t,n)=>e(r=>{const i=[...r.messages];for(let s=i.length-1;s>=0;s--){const o=i[s];if(o.role==="tool"&&o.toolCalls){const l=[...o.toolCalls];for(let u=l.length-1;u>=0;u--)if(l[u].tool_call_id===t)return l[u]={...l[u],status:n?"approved":"denied"},i[s]={...o,toolCalls:l},{messages:i}}}return{messages:i}}),appendThinking:t=>e(n=>{const r=[...n.messages],i=r[r.length-1];return i&&i.role==="thinking"?r[r.length-1]={...i,content:i.content+t}:r.push({id:$t(),role:"thinking",content:t,timestamp:Date.now()}),{messages:r}}),addError:t=>e(n=>({status:"error",messages:[...n.messages,{id:$t(),role:"assistant",content:`Error: ${t}`,timestamp:Date.now(),done:!0}]})),setActiveQuestion:t=>e({activeQuestion:t}),setSessionId:t=>{sessionStorage.setItem("agent_session_id",t),e({sessionId:t})},setModels:t=>e({models:t}),setSelectedModel:t=>e({selectedModel:t}),setModelsLoading:t=>e({modelsLoading:t}),setSkills:t=>e({skills:t}),setSelectedSkillIds:t=>e({selectedSkillIds:t}),toggleSkill:t=>e(n=>({selectedSkillIds:n.selectedSkillIds.includes(t)?n.selectedSkillIds.filter(i=>i!==t):[...n.selectedSkillIds,t]})),setSkillsLoading:t=>e({skillsLoading:t}),hydrateSession:t=>e({sessionId:t.session_id,status:t.status||"done",messages:t.messages,plan:t.plan,selectedModel:t.model||null}),clearSession:()=>{sessionStorage.removeItem("agent_session_id"),e({sessionId:null,status:"idle",_lastActiveAt:null,messages:[],plan:[],activeQuestion:null})}})),be=Ot(e=>({children:{},expanded:{},selectedFile:null,openTabs:[],fileCache:{},dirty:{},buffers:{},loadingDirs:{},loadingFile:!1,agentChangedFiles:{},diffView:null,setChildren:(t,n)=>e(r=>({children:{...r.children,[t]:n}})),toggleExpanded:t=>e(n=>({expanded:{...n.expanded,[t]:!n.expanded[t]}})),setSelectedFile:t=>e({selectedFile:t}),openTab:t=>e(n=>({selectedFile:t,openTabs:n.openTabs.includes(t)?n.openTabs:[...n.openTabs,t]})),closeTab:t=>e(n=>{const r=n.openTabs.filter(c=>c!==t);let i=n.selectedFile;if(i===t){const c=n.openTabs.indexOf(t);i=r[Math.min(c,r.length-1)]??null}const{[t]:s,...o}=n.dirty,{[t]:l,...u}=n.buffers;return{openTabs:r,selectedFile:i,dirty:o,buffers:u}}),setFileContent:(t,n)=>e(r=>({fileCache:{...r.fileCache,[t]:n}})),updateBuffer:(t,n)=>e(r=>({buffers:{...r.buffers,[t]:n},dirty:{...r.dirty,[t]:!0}})),markClean:t=>e(n=>{const{[t]:r,...i}=n.dirty,{[t]:s,...o}=n.buffers;return{dirty:i,buffers:o}}),setLoadingDir:(t,n)=>e(r=>({loadingDirs:{...r.loadingDirs,[t]:n}})),setLoadingFile:t=>e({loadingFile:t}),markAgentChanged:t=>e(n=>({agentChangedFiles:{...n.agentChangedFiles,[t]:Date.now()}})),clearAgentChanged:t=>e(n=>{const{[t]:r,...i}=n.agentChangedFiles;return{agentChangedFiles:i}}),setDiffView:t=>e({diffView:t}),expandPath:t=>e(n=>{const r=t.split("/"),i={...n.expanded};for(let s=1;se.current.onMessage(h=>{var v,y;switch(h.type){case"run.updated":t(h.payload);break;case"trace":n(h.payload);break;case"log":r(h.payload);break;case"chat":{const x=h.payload.run_id;i(x,h.payload);break}case"chat.interrupt":{const x=h.payload.run_id;s(x,h.payload);break}case"state":{const x=h.payload.run_id,C=h.payload.node_name,O=h.payload.qualified_node_name??null,j=h.payload.phase??null,N=h.payload.payload;C==="__start__"&&j==="started"&&u(x),j==="started"?o(x,C,O):j==="completed"&&l(x,C),c(x,C,N,O,j);break}case"reload":{h.payload.reloaded?Zr().then(C=>{const O=ve.getState();O.setEntrypoints(C.map(j=>j.name)),O.setReloadPending(!1)}).catch(C=>console.error("Failed to refresh entrypoints:",C)):ve.getState().setReloadPending(!0);break}case"files.changed":{const x=h.payload.files,C=new Set(x),O=be.getState(),j=ze.getState(),N=j.status,B=N==="thinking"||N==="planning"||N==="executing"||N==="awaiting_approval",D=!B&&j._lastActiveAt!=null&&Date.now()-j._lastActiveAt<3e3,R=x.filter(T=>T in O.children?!1:(T.split("/").pop()??"").includes("."));if(console.log("[files.changed]",{all:x,files:R,agentStatus:N,agentIsActive:B,recentlyActive:D}),B||D){let T=!1;for(const L of R){if(O.dirty[L])continue;const M=((v=O.fileCache[L])==null?void 0:v.content)??null,w=((y=O.fileCache[L])==null?void 0:y.language)??null;Lr(L).then(k=>{const I=be.getState();if(I.dirty[L])return;I.setFileContent(L,k),I.expandPath(L);const W=L.split("/");for(let q=1;qbe.getState().setChildren(g,F)).catch(()=>{})}const U=be.getState().openTabs.includes(L);!T&&U&&M!==null&&k.content!==null&&M!==k.content&&(T=!0,be.getState().setSelectedFile(L),I.setDiffView({path:L,original:M,modified:k.content,language:w}),setTimeout(()=>{const q=be.getState().diffView;q&&q.path===L&&q.original===M&&be.getState().setDiffView(null)},5e3)),I.markAgentChanged(L),setTimeout(()=>be.getState().clearAgentChanged(L),1e4)}).catch(()=>{const k=be.getState();k.openTabs.includes(L)&&k.closeTab(L)})}}else for(const T of O.openTabs)O.dirty[T]||!C.has(T)||Lr(T).then(L=>{var w;const M=be.getState();M.dirty[T]||((w=M.fileCache[T])==null?void 0:w.content)!==L.content&&M.setFileContent(T,L)}).catch(()=>{});const S=new Set;for(const T of x){const L=T.lastIndexOf("/"),M=L===-1?"":T.substring(0,L);M in O.children&&S.add(M)}for(const T of S)$n(T).then(L=>be.getState().setChildren(T,L)).catch(()=>{});break}case"eval_run.created":d(h.payload);break;case"eval_run.progress":{const{run_id:x,completed:C,total:O,item_result:j}=h.payload;p(x,C,O,j);break}case"eval_run.completed":{const{run_id:x,overall_score:C,evaluator_scores:O}=h.payload;m(x,C,O);break}case"agent.status":{const{session_id:x,status:C}=h.payload,O=ze.getState();O.sessionId||O.setSessionId(x),O.setStatus(C),(C==="done"||C==="error"||C==="idle")&&O.setActiveQuestion(null);break}case"agent.text":{const{session_id:x,content:C,done:O}=h.payload,j=ze.getState();j.sessionId||j.setSessionId(x),j.appendAssistantText(C,O);break}case"agent.plan":{const{session_id:x,items:C}=h.payload,O=ze.getState();O.sessionId||O.setSessionId(x),O.setPlan(C);break}case"agent.tool_use":{const{session_id:x,tool:C,args:O}=h.payload,j=ze.getState();j.sessionId||j.setSessionId(x),j.addToolUse(C,O);break}case"agent.tool_result":{const{tool:x,result:C,is_error:O}=h.payload;ze.getState().addToolResult(x,C,O);break}case"agent.tool_approval":{const{session_id:x,tool_call_id:C,tool:O,args:j}=h.payload,N=ze.getState();N.sessionId||N.setSessionId(x),N.addToolApprovalRequest(C,O,j);break}case"agent.thinking":{const{content:x}=h.payload;ze.getState().appendThinking(x);break}case"agent.text_delta":{const{session_id:x,delta:C}=h.payload,O=ze.getState();O.sessionId||O.setSessionId(x),O.appendAssistantText(C,!1);break}case"agent.question":{const{session_id:x,question_id:C,question:O,options:j}=h.payload,N=ze.getState();N.sessionId||N.setSessionId(x),N.setActiveQuestion({question_id:C,question:O,options:j});break}case"agent.token_usage":break;case"agent.error":{const{message:x}=h.payload;ze.getState().addError(x);break}}}),[t,n,r,i,s,o,l,u,c,d,p,m]),e.current}function rc(e){const t=e.replace(/^#\/?/,""),n={section:"debug",view:"new",runId:null,tab:"traces",setupEntrypoint:null,setupMode:null,evalCreating:!1,evalSetId:null,evalRunId:null,evalRunItemName:null,evaluatorId:null,evaluatorCreateType:null,evaluatorFilter:null,explorerFile:null};if(!t||t==="new"||t==="debug"||t==="debug/new")return n;const r=t.match(/^(?:debug\/)?setup\/([^/]+)\/(run|chat)$/);if(r)return{...n,view:"setup",setupEntrypoint:decodeURIComponent(r[1]),setupMode:r[2]};const i=t.match(/^(?:debug\/)?runs\/([^/]+)(?:\/(traces|output))?$/);if(i)return{...n,view:"details",runId:i[1],tab:i[2]??"traces"};if(t==="evals/new")return{...n,section:"evals",evalCreating:!0};const s=t.match(/^evals\/runs\/([^/]+?)(?:\/([^/]+))?$/);if(s)return{...n,section:"evals",evalRunId:s[1],evalRunItemName:s[2]?decodeURIComponent(s[2]):null};const o=t.match(/^evals\/sets\/([^/]+)$/);if(o)return{...n,section:"evals",evalSetId:o[1]};if(t==="evals")return{...n,section:"evals"};const l=t.match(/^evaluators\/new(?:\/(deterministic|llm|tool))?$/);if(l)return{...n,section:"evaluators",evaluatorCreateType:l[1]??"any"};const u=t.match(/^evaluators\/category\/(deterministic|llm|tool)$/);if(u)return{...n,section:"evaluators",evaluatorFilter:u[1]};const c=t.match(/^evaluators\/([^/]+)$/);if(c)return{...n,section:"evaluators",evaluatorId:c[1]};if(t==="evaluators")return{...n,section:"evaluators"};const d=t.match(/^explorer\/file\/(.+)$/);return d?{...n,section:"explorer",explorerFile:decodeURIComponent(d[1])}:t==="explorer"?{...n,section:"explorer"}:n}function ic(){return window.location.hash}function oc(e){return window.addEventListener("hashchange",e),()=>window.removeEventListener("hashchange",e)}function st(){const e=_.useSyncExternalStore(oc,ic),t=rc(e),n=_.useCallback(r=>{window.location.hash=r},[]);return{...t,navigate:n}}const Li="(max-width: 767px)";function sc(){const[e,t]=_.useState(()=>window.matchMedia(Li).matches);return _.useEffect(()=>{const n=window.matchMedia(Li),r=i=>t(i.matches);return n.addEventListener("change",r),()=>n.removeEventListener("change",r)},[]),e}const ac=[{section:"debug",label:"Developer Console",icon:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{x:"8",y:"6",width:"8",height:"14",rx:"4"}),a.jsx("path",{d:"M6 10H4"}),a.jsx("path",{d:"M6 18H4"}),a.jsx("path",{d:"M18 10h2"}),a.jsx("path",{d:"M18 18h2"}),a.jsx("path",{d:"M8 14h8"}),a.jsx("path",{d:"M9 6l-1.5-2"}),a.jsx("path",{d:"M15 6l1.5-2"}),a.jsx("path",{d:"M6 14H4"}),a.jsx("path",{d:"M18 14h2"})]})},{section:"evals",label:"Evals",icon:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M9 3h6"}),a.jsx("path",{d:"M10 3v6.5L5 20a1 1 0 0 0 .9 1.4h12.2a1 1 0 0 0 .9-1.4L14 9.5V3"}),a.jsx("path",{d:"M8.5 14h7"})]})},{section:"evaluators",label:"Evaluators",icon:a.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M12 2l7 4v5c0 5.25-3.5 9.74-7 11-3.5-1.26-7-5.75-7-11V6l7-4z"}),a.jsx("path",{d:"M9 12l2 2 4-4"})]})},{section:"explorer",label:"Explorer",icon:a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:a.jsx("path",{d:"M7.5 22.5H17.595C17.07 23.4 16.11 24 15 24H7.5C4.185 24 1.5 21.315 1.5 18V6C1.5 4.89 2.1 3.93 3 3.405V18C3 20.475 5.025 22.5 7.5 22.5ZM21 8.121V18C21 19.6545 19.6545 21 18 21H7.5C5.8455 21 4.5 19.6545 4.5 18V3C4.5 1.3455 5.8455 0 7.5 0H12.879C13.4715 0 14.0505 0.24 14.4705 0.6585L20.3415 6.5295C20.766 6.954 21 7.5195 21 8.121ZM13.5 6.75C13.5 7.164 13.8375 7.5 14.25 7.5H19.1895L13.5 1.8105V6.75ZM19.5 18V9H14.25C13.0095 9 12 7.9905 12 6.75V1.5H7.5C6.672 1.5 6 2.1735 6 3V18C6 18.8265 6.672 19.5 7.5 19.5H18C18.828 19.5 19.5 18.8265 19.5 18Z"})})}];function lc({section:e,onSectionChange:t}){return a.jsx("div",{className:"w-12 flex flex-col items-center shrink-0 border-r",style:{background:"var(--activity-bar-bg)",borderColor:"var(--border)"},children:a.jsx("div",{className:"flex flex-col items-center gap-1 pt-2",children:ac.map(n=>{const r=e===n.section;return a.jsxs("button",{onClick:()=>t(n.section),className:"w-10 h-10 flex items-center justify-center rounded cursor-pointer transition-colors relative",style:{color:r?"var(--text-primary)":"var(--text-muted)",background:r?"var(--bg-hover)":"transparent",border:"none"},title:n.label,onMouseEnter:i=>{r||(i.currentTarget.style.color="var(--text-secondary)")},onMouseLeave:i=>{r||(i.currentTarget.style.color="var(--text-muted)")},children:[r&&a.jsx("div",{className:"absolute left-0 top-1.5 bottom-1.5 w-0.5 rounded-r",style:{background:"var(--accent)"}}),n.icon]},n.section)})})})}const tt="/api";async function nt(e,t){const n=await fetch(e,t);if(!n.ok){let r;try{r=(await n.json()).detail||n.statusText}catch{r=n.statusText}const i=new Error(`HTTP ${n.status}`);throw i.detail=r,i.status=n.status,i}return n.json()}async function cc(){return nt(`${tt}/evaluators`)}async function Es(){return nt(`${tt}/eval-sets`)}async function uc(e){return nt(`${tt}/eval-sets`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function dc(e,t){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}/items`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async function pc(e,t){await nt(`${tt}/eval-sets/${encodeURIComponent(e)}/items/${encodeURIComponent(t)}`,{method:"DELETE"})}async function fc(e){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}`)}async function mc(e){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}/runs`,{method:"POST"})}async function gc(){return nt(`${tt}/eval-runs`)}async function ji(e){return nt(`${tt}/eval-runs/${encodeURIComponent(e)}`)}async function ei(){return nt(`${tt}/local-evaluators`)}async function hc(e){return nt(`${tt}/local-evaluators`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function bc(e,t){return nt(`${tt}/eval-sets/${encodeURIComponent(e)}/evaluators`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({evaluator_refs:t})})}async function xc(e,t){return nt(`${tt}/local-evaluators/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}const yc={"uipath-exact-match":e=>({expectedOutput:e}),"uipath-json-similarity":e=>({expectedOutput:e}),"uipath-contains":()=>({searchText:""}),"uipath-llm-judge-output-semantic-similarity":e=>({expectedOutput:e}),"uipath-llm-judge-output-strict-json-similarity":e=>({expectedOutput:e}),"uipath-llm-judge-trajectory-similarity":()=>({expectedAgentBehavior:""}),"uipath-llm-judge-trajectory-simulation":()=>({expectedAgentBehavior:""}),"uipath-tool-call-count":()=>({}),"uipath-tool-call-args":()=>({}),"uipath-tool-call-order":()=>({}),"uipath-tool-call-output":()=>({})};function vc(e,t){if(!e)return{};const n=yc[e.evaluator_type_id];return n?n(t):e.type==="tool"?{}:e.evaluator_type_id.includes("trajectory")?{expectedAgentBehavior:""}:{expectedOutput:t}}function ws(e){return e?e.type==="tool"?!0:e.evaluator_type_id.includes("tool-call"):!1}function kc(e){return e?ws(e)?{label:"tools",color:"var(--warning, #e5a00d)"}:e.evaluator_type_id.includes("trajectory")?{label:"quality",color:"var(--info, #3b82f6)"}:{label:"output",color:"var(--success, #22c55e)"}:{label:"output",color:"var(--success, #22c55e)"}}function Ec({run:e,onClose:t}){const n=Me(R=>R.evalSets),r=Me(R=>R.setEvalSets),i=Me(R=>R.incrementEvalSetCount),s=Me(R=>R.localEvaluators),o=Me(R=>R.setLocalEvaluators),[l,u]=_.useState(`run-${e.id.slice(0,8)}`),[c,d]=_.useState(new Set),[p,m]=_.useState({}),f=_.useRef(new Set),[b,h]=_.useState(!1),[v,y]=_.useState(null),[x,C]=_.useState(!1),O=Object.values(n),j=_.useMemo(()=>Object.fromEntries(s.map(R=>[R.id,R])),[s]),N=_.useMemo(()=>{const R=new Set;for(const S of c){const T=n[S];T&&T.evaluator_ids.forEach(L=>R.add(L))}return[...R]},[c,n]);_.useEffect(()=>{const R=e.output_data,S=f.current;m(T=>{const L={};for(const M of N)if(S.has(M)&&T[M]!==void 0)L[M]=T[M];else{const w=j[M],k=vc(w,R);L[M]=JSON.stringify(k,null,2)}return L})},[N,j,e.output_data]),_.useEffect(()=>{const R=S=>{S.key==="Escape"&&t()};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[t]),_.useEffect(()=>{O.length===0&&Es().then(r).catch(()=>{}),s.length===0&&ei().then(o).catch(()=>{})},[]);const B=R=>{d(S=>{const T=new Set(S);return T.has(R)?T.delete(R):T.add(R),T})},D=async()=>{var S;if(!l.trim()||c.size===0)return;y(null),h(!0);const R={};for(const T of N){const L=p[T];if(L!==void 0)try{R[T]=JSON.parse(L)}catch{y(`Invalid JSON for evaluator "${((S=j[T])==null?void 0:S.name)??T}"`),h(!1);return}}try{for(const T of c){const L=n[T],M=new Set((L==null?void 0:L.evaluator_ids)??[]),w={};for(const[k,I]of Object.entries(R))M.has(k)&&(w[k]=I);await dc(T,{name:l.trim(),inputs:e.input_data,expected_output:null,evaluation_criterias:w}),i(T)}C(!0),setTimeout(t,3e3)}catch(T){y(T.detail||T.message||"Failed to add item")}finally{h(!1)}};return a.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.5)"},onClick:R=>{R.target===R.currentTarget&&t()},children:a.jsxs("div",{className:"w-full max-w-2xl rounded-lg p-6 shadow-xl max-h-[85vh] flex flex-col",style:{background:"var(--bg-primary)",border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}}),a.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"Add to Eval Set"})]}),a.jsx("button",{onClick:t,className:"w-7 h-7 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:R=>{R.currentTarget.style.color="var(--text-primary)"},onMouseLeave:R=>{R.currentTarget.style.color="var(--text-muted)"},"aria-label":"Close",children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto min-h-0 space-y-4 pr-1",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Item Name"}),a.jsx("input",{type:"text",value:l,onChange:R=>u(R.target.value),className:"w-full rounded-md px-3 py-2 text-xs",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"}})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Inputs"}),a.jsx("pre",{className:"rounded-md px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words max-h-32 overflow-y-auto",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-secondary)"},children:JSON.stringify(e.input_data,null,2)})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Eval Sets"}),O.length===0?a.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:"No eval sets found. Create one first."}):a.jsx("div",{className:"rounded-md border overflow-hidden max-h-40 overflow-y-auto",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:O.map(R=>a.jsxs("label",{className:"flex items-center gap-2.5 px-3 py-2 text-xs cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--border)"},onMouseEnter:S=>{S.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:S=>{S.currentTarget.style.background="transparent"},children:[a.jsx("input",{type:"checkbox",checked:c.has(R.id),onChange:()=>B(R.id),className:"accent-[var(--accent)]"}),a.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:R.name}),a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:[R.eval_count," items"]})]},R.id))})]}),N.length>0&&a.jsxs("div",{children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Evaluation Criteria"}),a.jsx("div",{className:"space-y-2",children:N.map(R=>{const S=j[R],T=ws(S),L=kc(S);return a.jsxs("div",{className:"rounded-md",style:{border:"1px solid var(--border)",background:"var(--bg-primary)",opacity:T?.6:1},children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{borderBottom:T?"none":"1px solid var(--border)"},children:[a.jsx("span",{className:"text-xs font-medium truncate flex-1",style:{color:"var(--text-primary)"},children:(S==null?void 0:S.name)??R}),a.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full font-medium",style:{color:L.color,background:`color-mix(in srgb, ${L.color} 12%, transparent)`},children:L.label})]}),T?a.jsx("div",{className:"px-3 pb-2",children:a.jsx("span",{className:"text-[10px] italic",style:{color:"var(--text-muted)"},children:"Default criteria — uses evaluator config"})}):a.jsx("div",{className:"px-3 pb-2 pt-1",children:a.jsx("textarea",{value:p[R]??"{}",onChange:M=>{f.current.add(R),m(w=>({...w,[R]:M.target.value}))},rows:8,className:"w-full rounded px-2 py-1.5 text-xs font-mono resize-y",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"}})})]},R)})})]})]}),a.jsxs("div",{className:"mt-4 space-y-3",children:[v&&a.jsx("p",{className:"text-xs px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:v}),x&&a.jsxs("p",{className:"text-xs px-3 py-2 rounded",style:{color:"var(--success)",background:"color-mix(in srgb, var(--success) 10%, var(--bg-secondary))"},children:["Added to ",c.size," eval set",c.size!==1?"s":"","."]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{onClick:t,className:"flex-1 py-2 rounded-md text-xs font-semibold cursor-pointer",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)",border:"1px solid var(--border)"},children:"Cancel"}),a.jsx("button",{onClick:D,disabled:!l.trim()||c.size===0||b||x,className:"flex-1 py-2 rounded-md text-[13px] font-semibold transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},children:b?"Adding...":x?"Added":"Add Item"})]})]})]})})}const wc={pending:"var(--text-muted)",running:"var(--warning)",suspended:"var(--info)",completed:"var(--success)",failed:"var(--error)"};function _c({run:e,isSelected:t,onClick:n}){var p;const r=wc[e.status]??"var(--text-muted)",i=((p=e.entrypoint.split("/").pop())==null?void 0:p.slice(0,16))??e.entrypoint,s=e.start_time?new Date(e.start_time).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"",[o,l]=_.useState(!1),[u,c]=_.useState(!1),d=_.useRef(null);return _.useEffect(()=>{if(!o)return;const m=f=>{d.current&&!d.current.contains(f.target)&&l(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[o]),a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"group relative w-full text-left px-3 py-1.5 flex items-center gap-2 transition-colors cursor-pointer",style:{background:t?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":void 0,borderLeft:t?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:m=>{t||(m.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:m=>{t||(m.currentTarget.style.background="")},onClick:n,children:[a.jsx("span",{className:"shrink-0 w-2 h-2 rounded-full",style:{background:r}}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-xs truncate",style:{color:t?"var(--text-primary)":"var(--text-secondary)"},children:i}),a.jsxs("div",{className:"text-[11px] tabular-nums",style:{color:"var(--text-muted)"},children:[s,e.duration?` · ${e.duration}`:""]})]}),e.status==="completed"&&a.jsxs("div",{ref:d,className:"relative shrink-0",children:[a.jsx("button",{onClick:m=>{m.stopPropagation(),l(f=>!f)},className:"opacity-40 group-hover:opacity-100 focus:opacity-100 w-7 h-7 flex items-center justify-center rounded transition-opacity cursor-pointer",style:{color:"var(--text-muted)"},onMouseEnter:m=>{m.currentTarget.style.color="var(--text-primary)",m.currentTarget.style.background="var(--bg-secondary)"},onMouseLeave:m=>{m.currentTarget.style.color="var(--text-muted)",m.currentTarget.style.background=""},"aria-label":"Actions",title:"Actions",children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"currentColor",children:[a.jsx("circle",{cx:"8",cy:"3",r:"1.5"}),a.jsx("circle",{cx:"8",cy:"8",r:"1.5"}),a.jsx("circle",{cx:"8",cy:"13",r:"1.5"})]})}),o&&a.jsx("div",{className:"absolute right-0 top-full mt-1 z-50 min-w-[140px] rounded-md shadow-lg py-1",style:{background:"var(--bg-primary)",border:"1px solid var(--border)"},children:a.jsx("button",{onClick:m=>{m.stopPropagation(),l(!1),c(!0)},className:"w-full text-left px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{color:"var(--text-secondary)"},onMouseEnter:m=>{m.currentTarget.style.background="var(--bg-hover)",m.currentTarget.style.color="var(--text-primary)"},onMouseLeave:m=>{m.currentTarget.style.background="",m.currentTarget.style.color="var(--text-secondary)"},children:"Add to Eval Set"})})]})]}),u&&a.jsx(Ec,{run:e,onClose:()=>c(!1)})]})}function Di({runs:e,selectedRunId:t,onSelectRun:n,onNewRun:r}){const i=[...e].sort((s,o)=>new Date(o.start_time??0).getTime()-new Date(s.start_time??0).getTime());return a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:r,className:"mx-3 mt-2.5 mb-1 px-3 py-1.5 text-[11px] font-medium rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-secondary)"},onMouseEnter:s=>{s.currentTarget.style.color="var(--text-primary)",s.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:s=>{s.currentTarget.style.color="var(--text-secondary)",s.currentTarget.style.borderColor=""},children:"+ New Run"}),a.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"History"}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[i.map(s=>a.jsx(_c,{run:s,isSelected:s.id===t,onClick:()=>n(s.id)},s.id)),i.length===0&&a.jsx("p",{className:"text-xs px-3 py-4 text-center",style:{color:"var(--text-muted)"},children:"No runs yet"})]})]})}function _s(){const e=localStorage.getItem("uipath-dev-theme");return e==="light"||e==="dark"?e:"dark"}function Ns(e){document.documentElement.setAttribute("data-theme",e),localStorage.setItem("uipath-dev-theme",e)}Ns(_s());const Ss=Ot(e=>({theme:_s(),toggleTheme:()=>e(t=>{const n=t.theme==="dark"?"light":"dark";return Ns(n),{theme:n}})}));function Pi(){const{theme:e,toggleTheme:t}=Ss(),{enabled:n,status:r,environment:i,tenants:s,uipathUrl:o,setEnvironment:l,startLogin:u,selectTenant:c,logout:d}=zn(),{projectName:p,projectVersion:m,projectAuthors:f}=ks(),[b,h]=_.useState(!1),[v,y]=_.useState(""),x=_.useRef(null),C=_.useRef(null);_.useEffect(()=>{if(!b)return;const w=k=>{x.current&&!x.current.contains(k.target)&&C.current&&!C.current.contains(k.target)&&h(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[b]);const O=r==="authenticated",j=r==="expired",N=r==="pending",B=r==="needs_tenant";let D="UiPath: Disconnected",R=null,S=!0;O?(D=`UiPath: ${o?o.replace(/^https?:\/\/[^/]+\//,""):""}`,R="var(--success)",S=!1):j?(D=`UiPath: ${o?o.replace(/^https?:\/\/[^/]+\//,""):""} (expired)`,R="var(--error)",S=!1):N?D="UiPath: Signing in…":B&&(D="UiPath: Select Tenant");const T=()=>{N||(j?u():h(w=>!w))},L="flex items-center gap-1 px-1.5 rounded transition-colors",M={onMouseEnter:w=>{w.currentTarget.style.background="var(--bg-hover)",w.currentTarget.style.color="var(--text-primary)"},onMouseLeave:w=>{w.currentTarget.style.background="",w.currentTarget.style.color="var(--text-muted)"}};return a.jsxs("div",{className:"h-6 flex items-center justify-end gap-3 px-2 text-xs border-t shrink-0",style:{background:"var(--bg-secondary)",color:"var(--text-muted)",borderColor:"var(--border)",fontSize:"11px"},children:[n&&a.jsxs("div",{className:"relative flex items-center",children:[a.jsxs("div",{ref:C,className:`${L} cursor-pointer`,onClick:T,...M,title:O?o??"":j?"Token expired — click to re-authenticate":N?"Signing in…":B?"Select a tenant":"Click to sign in",children:[N?a.jsxs("svg",{className:"animate-spin",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10",strokeOpacity:"0.25"}),a.jsx("path",{d:"M12 2a10 10 0 0 1 10 10",strokeLinecap:"round"})]}):R?a.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{background:R}}):S?a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 9.9-1"})]}):null,a.jsx("span",{className:"truncate max-w-[200px]",children:D})]}),b&&a.jsx("div",{ref:x,className:"absolute bottom-full right-0 mb-1 rounded border shadow-lg p-1 min-w-[180px]",style:{background:"var(--bg-secondary)",borderColor:"var(--border)"},children:O||j?a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:()=>{o&&window.open(o,"_blank","noopener,noreferrer"),h(!1)},className:"w-full flex items-center gap-2 px-2 py-2 text-[11px] rounded cursor-pointer transition-colors text-left",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:w=>{w.currentTarget.style.background="var(--bg-hover)",w.currentTarget.style.color="var(--text-primary)"},onMouseLeave:w=>{w.currentTarget.style.background="transparent",w.currentTarget.style.color="var(--text-muted)"},children:[a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),a.jsx("polyline",{points:"15 3 21 3 21 9"}),a.jsx("line",{x1:"10",y1:"14",x2:"21",y2:"3"})]}),"Go to Platform"]}),a.jsxs("button",{onClick:()=>{d(),h(!1)},className:"w-full flex items-center gap-2 px-2 py-2 text-[11px] rounded cursor-pointer transition-colors text-left",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:w=>{w.currentTarget.style.background="var(--bg-hover)",w.currentTarget.style.color="var(--text-primary)"},onMouseLeave:w=>{w.currentTarget.style.background="transparent",w.currentTarget.style.color="var(--text-muted)"},children:[a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),a.jsx("polyline",{points:"16 17 21 12 16 7"}),a.jsx("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}),"Sign Out"]})]}):B?a.jsxs("div",{className:"p-1",children:[a.jsx("label",{className:"block text-[10px] font-medium mb-1",style:{color:"var(--text-muted)"},children:"Tenant"}),a.jsxs("select",{value:v,onChange:w=>y(w.target.value),className:"w-full rounded px-1.5 py-1 text-[10px] mb-1.5 appearance-auto",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-primary)"},children:[a.jsx("option",{value:"",children:"Select…"}),s.map(w=>a.jsx("option",{value:w,children:w},w))]}),a.jsx("button",{onClick:()=>{v&&(c(v),h(!1))},disabled:!v,className:"w-full px-2 py-1 text-[10px] font-medium rounded border border-[var(--border)] bg-transparent cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--text-muted)"},children:"Confirm"})]}):a.jsxs("div",{className:"p-1",children:[a.jsx("label",{className:"block text-[10px] font-medium mb-1",style:{color:"var(--text-muted)"},children:"Environment"}),a.jsxs("select",{value:i,onChange:w=>l(w.target.value),className:"w-full rounded px-1.5 py-0.5 text-[10px] mb-1.5 appearance-auto",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-muted)"},children:[a.jsx("option",{value:"cloud",children:"cloud"}),a.jsx("option",{value:"staging",children:"staging"}),a.jsx("option",{value:"alpha",children:"alpha"})]}),a.jsx("button",{onClick:()=>{u(),h(!1)},className:"w-full px-2 py-1 text-[10px] font-medium rounded border border-[var(--border)] bg-transparent cursor-pointer transition-colors",style:{color:"var(--text-muted)"},onMouseEnter:w=>{w.currentTarget.style.color="var(--text-primary)",w.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:w=>{w.currentTarget.style.color="var(--text-muted)",w.currentTarget.style.borderColor="var(--border)"},children:"Sign In"})]})})]}),p&&a.jsxs("span",{className:L,children:["Project: ",p]}),m&&a.jsxs("span",{className:L,children:["Version: v",m]}),f&&a.jsxs("span",{className:L,children:["Author: ",f]}),a.jsxs("a",{href:"https://github.com/UiPath/uipath-dev-python",target:"_blank",rel:"noopener noreferrer",className:`${L} cursor-pointer no-underline`,style:{color:"var(--text-muted)"},...M,title:"View on GitHub",children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"})}),a.jsx("span",{children:"uipath-dev-python"})]}),a.jsxs("div",{className:`${L} cursor-pointer`,onClick:t,...M,title:`Switch to ${e==="dark"?"light":"dark"} theme`,children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e==="dark"?a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"5"}),a.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),a.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),a.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),a.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),a.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),a.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),a.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),a.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}):a.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),a.jsx("span",{children:e==="dark"?"Dark":"Light"})]})]})}function Nc(){const{navigate:e}=st(),t=ve(c=>c.entrypoints),[n,r]=_.useState(""),[i,s]=_.useState(!0),[o,l]=_.useState(null);_.useEffect(()=>{!n&&t.length>0&&r(t[0])},[t,n]),_.useEffect(()=>{n&&(s(!0),l(null),Yl(n).then(c=>{var p;const d=(p=c.input)==null?void 0:p.properties;s(!!(d!=null&&d.messages))}).catch(c=>{const d=c.detail||{};l(d.error||d.message||`Failed to load entrypoint "${n}"`)}))},[n]);const u=c=>{n&&e(`#/setup/${encodeURIComponent(n)}/${c}`)};return a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"w-full max-w-xl px-6",children:[a.jsxs("div",{className:"mb-8 text-center",children:[a.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:o?"var(--error)":"var(--accent)"}}),a.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"New Run"})]}),!o&&a.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:t.length>1?"Select an entrypoint and choose a mode":"Choose a mode"})]}),t.length>1&&a.jsxs("div",{className:"mb-8",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Entrypoint"}),a.jsx("select",{id:"entrypoint-select",value:n,onChange:c=>r(c.target.value),className:"w-full rounded-md px-3 py-2 text-xs font-mono cursor-pointer appearance-auto",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},children:t.map(c=>a.jsx("option",{value:c,children:c},c))})]}),o?a.jsxs("div",{className:"rounded-md border overflow-hidden",style:{borderColor:"color-mix(in srgb, var(--error) 25%, var(--border))",background:"var(--bg-secondary)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{borderBottom:"1px solid color-mix(in srgb, var(--error) 15%, var(--border))",background:"color-mix(in srgb, var(--error) 4%, var(--bg-secondary))"},children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0},children:a.jsx("path",{d:"M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM7.25 4.75h1.5v4h-1.5v-4zm.75 6.75a.75.75 0 110-1.5.75.75 0 010 1.5z",fill:"var(--error)"})}),a.jsx("span",{className:"text-[11px] font-medium",style:{color:"var(--error)"},children:"Failed to load entrypoint"})]}),a.jsx("div",{className:"overflow-auto max-h-48 p-3",children:a.jsx("pre",{className:"text-[11px] font-mono whitespace-pre-wrap break-words leading-relaxed m-0",style:{color:"var(--text-muted)"},children:o})})]}):a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx(Bi,{title:"Autonomous",description:"Run the agent end-to-end. Set breakpoints to pause and inspect execution.",icon:a.jsx(Sc,{}),color:"var(--success)",onClick:()=>u("run"),disabled:!n}),a.jsx(Bi,{title:"Conversational",description:i?"Interactive chat session. Send messages and receive responses in real time.":'Requires a "messages" property in the input schema.',icon:a.jsx(Tc,{}),color:"var(--accent)",onClick:()=>u("chat"),disabled:!n||!i})]})]})})}function Bi({title:e,description:t,icon:n,color:r,onClick:i,disabled:s}){return a.jsxs("button",{onClick:i,disabled:s,className:"group flex flex-col items-center text-center p-6 rounded-md border transition-all cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--bg-secondary)",borderColor:"var(--border)"},onMouseEnter:o=>{s||(o.currentTarget.style.borderColor=r,o.currentTarget.style.background=`color-mix(in srgb, ${r} 5%, var(--bg-secondary))`)},onMouseLeave:o=>{o.currentTarget.style.borderColor="var(--border)",o.currentTarget.style.background="var(--bg-secondary)"},children:[a.jsx("div",{className:"mb-4 p-3 rounded-xl transition-colors",style:{background:`color-mix(in srgb, ${r} 10%, var(--bg-primary))`,color:r},children:n}),a.jsx("h3",{className:"text-sm font-semibold mb-1.5",style:{color:"var(--text-primary)"},children:e}),a.jsx("p",{className:"text-xs leading-relaxed",style:{color:"var(--text-muted)"},children:t})]})}function Sc(){return a.jsx("svg",{width:"28",height:"28",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M23.832 15.166H22.7487C22.7487 10.9735 19.3579 7.58268 15.1654 7.58268H14.082V6.20685C14.732 5.83852 15.1654 5.13435 15.1654 4.33268C15.1654 3.14102 14.2012 2.16602 12.9987 2.16602C11.7962 2.16602 10.832 3.14102 10.832 4.33268C10.832 5.13435 11.2654 5.83852 11.9154 6.20685V7.58268H10.832C6.63953 7.58268 3.2487 10.9735 3.2487 15.166H2.16536C1.56953 15.166 1.08203 15.6535 1.08203 16.2493V19.4993C1.08203 20.0952 1.56953 20.5827 2.16536 20.5827H3.2487V21.666C3.2487 22.8685 4.2237 23.8327 5.41536 23.8327H20.582C21.7845 23.8327 22.7487 22.8685 22.7487 21.666V20.5827H23.832C24.4279 20.5827 24.9154 20.0952 24.9154 19.4993V16.2493C24.9154 15.6535 24.4279 15.166 23.832 15.166ZM22.7487 18.416H20.582V21.666H5.41536V18.416H3.2487V17.3327H5.41536V15.166C5.41536 12.176 7.84203 9.74935 10.832 9.74935H15.1654C18.1554 9.74935 20.582 12.176 20.582 15.166V17.3327H22.7487V18.416ZM9.20703 14.6243L11.7637 17.181L10.4854 18.4594L9.20703 17.181L7.9287 18.4594L6.65036 17.181L9.20703 14.6243ZM16.7904 14.6243L19.347 17.181L18.0687 18.4594L16.7904 17.181L15.512 18.4594L14.2337 17.181L16.7904 14.6243Z",fill:"currentColor"})})}function Tc(){return a.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M9.20901 13.541L11.7657 16.0977L10.4873 17.376L9.20901 16.0977L7.93068 17.376L6.65234 16.0977L9.20901 13.541ZM16.7923 13.541L19.349 16.0977L18.0707 17.376L16.7923 16.0977L15.514 17.376L14.2357 16.0977L16.7923 13.541Z",fill:"currentColor"}),a.jsx("path",{d:"M5.25 8.58398H20.75C21.3023 8.58398 21.75 9.0317 21.75 9.58398V23.5293L16.874 21.9043C16.5683 21.8024 16.248 21.751 15.9258 21.751H5.25C4.69782 21.751 4.25018 21.3031 4.25 20.751V9.58398C4.25 9.0317 4.69772 8.58398 5.25 8.58398Z",stroke:"currentColor",strokeWidth:"2"}),a.jsx("ellipse",{cx:"12.9987",cy:"4.33268",rx:"2.16667",ry:"2.16667",fill:"currentColor"}),a.jsx("rect",{x:"11.918",y:"5.41602",width:"2.16667",height:"2.16667",fill:"currentColor"}),a.jsx("path",{d:"M1.08203 14C1.08203 13.4477 1.52975 13 2.08203 13H3.2487V18.4167H2.08203C1.52975 18.4167 1.08203 17.969 1.08203 17.4167V14Z",fill:"currentColor"}),a.jsx("rect",{x:"3.25",y:"15.166",width:"2.16667",height:"1.08333",fill:"currentColor"}),a.jsx("path",{d:"M22.75 13H23.9167C24.4689 13 24.9167 13.4477 24.9167 14V17.4167C24.9167 17.969 24.469 18.4167 23.9167 18.4167H22.75V13Z",fill:"currentColor"}),a.jsx("rect",{x:"20.582",y:"15.166",width:"2.16667",height:"1.08333",fill:"currentColor"})]})}const Cc="modulepreload",Ac=function(e){return"/"+e},Fi={},Ts=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let o=function(c){return Promise.all(c.map(d=>Promise.resolve(d).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=o(n.map(c=>{if(c=Ac(c),c in Fi)return;Fi[c]=!0;const d=c.endsWith(".css"),p=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${p}`))return;const m=document.createElement("link");if(m.rel=d?"stylesheet":Cc,d||(m.as="script"),m.crossOrigin="",m.href=c,u&&m.setAttribute("nonce",u),document.head.appendChild(m),d)return new Promise((f,b)=>{m.addEventListener("load",f),m.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return i.then(o=>{for(const l of o||[])l.status==="rejected"&&s(l.reason);return t().catch(s)})},Mc={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Ic({data:e}){const t=e.status,n=e.nodeWidth,r=e.label??"Start",i=e.hasBreakpoint,s=e.isPausedHere,o=e.isActiveNode,l=e.isExecutingNode,u=s?"var(--error)":l?"var(--success)":o?"var(--accent)":t==="completed"?"var(--success)":t==="running"?"var(--warning)":"var(--node-border)",c=s?"var(--error)":l?"var(--success)":"var(--accent)";return a.jsxs("div",{className:"px-3 py-1.5 rounded-full text-center text-xs overflow-hidden text-ellipsis whitespace-nowrap cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${u}`,boxShadow:s||o||l?`0 0 4px ${c}`:void 0,animation:s||o||l?`node-pulse-${s?"red":l?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r,children:[i&&a.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),r,a.jsx(ht,{type:"source",position:bt.Bottom,style:Mc})]})}const Rc={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Oc({data:e}){const t=e.status,n=e.nodeWidth,r=e.label??"End",i=e.hasBreakpoint,s=e.isPausedHere,o=e.isActiveNode,l=e.isExecutingNode,u=s?"var(--error)":l?"var(--success)":o?"var(--accent)":t==="completed"?"var(--success)":t==="failed"?"var(--error)":"var(--node-border)",c=s?"var(--error)":l?"var(--success)":"var(--accent)";return a.jsxs("div",{className:"px-3 py-1.5 rounded-full text-center text-xs overflow-hidden text-ellipsis whitespace-nowrap cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${u}`,boxShadow:s||o||l?`0 0 4px ${c}`:void 0,animation:s||o||l?`node-pulse-${s?"red":l?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r,children:[i&&a.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),a.jsx(ht,{type:"target",position:bt.Top,style:Rc}),r]})}const zi={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Lc({data:e}){const t=e.status,n=e.nodeWidth,r=e.model_name,i=e.label??"Model",s=e.hasBreakpoint,o=e.isPausedHere,l=e.isActiveNode,u=e.isExecutingNode,c=o?"var(--error)":u?"var(--success)":l?"var(--accent)":t==="completed"?"var(--success)":t==="running"?"var(--warning)":t==="failed"?"var(--error)":"var(--node-border)",d=o?"var(--error)":u?"var(--success)":"var(--accent)";return a.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${c}`,boxShadow:o||l||u?`0 0 4px ${d}`:void 0,animation:o||l||u?`node-pulse-${o?"red":u?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r?`${i} -${r}`:i,children:[s&&a.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),a.jsx(ht,{type:"target",position:bt.Top,style:zi}),a.jsx("div",{style:{color:"var(--info)",fontSize:9,marginBottom:1},children:"model"}),a.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:i}),r&&a.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",style:{color:"var(--text-muted)",fontSize:9,marginTop:1},title:r,children:r}),a.jsx(ht,{type:"source",position:bt.Bottom,style:zi})]})}const $i={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0},jc=3;function Dc({data:e}){const t=e.status,n=e.nodeWidth,r=e.tool_names,i=e.tool_count,s=e.label??"Tool",o=e.hasBreakpoint,l=e.isPausedHere,u=e.isActiveNode,c=e.isExecutingNode,d=l?"var(--error)":c?"var(--success)":u?"var(--accent)":t==="completed"?"var(--success)":t==="running"?"var(--warning)":t==="failed"?"var(--error)":"var(--node-border)",p=l?"var(--error)":c?"var(--success)":"var(--accent)",m=(r==null?void 0:r.slice(0,jc))??[],f=(i??(r==null?void 0:r.length)??0)-m.length;return a.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${d}`,boxShadow:l||u||c?`0 0 4px ${p}`:void 0,animation:l||u||c?`node-pulse-${l?"red":c?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r!=null&&r.length?`${s} - -${r.join(` -`)}`:s,children:[o&&a.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),a.jsx(ht,{type:"target",position:bt.Top,style:$i}),a.jsxs("div",{style:{color:"var(--warning)",fontSize:9,marginBottom:1},children:["tools",i?` (${i})`:""]}),a.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:s}),m.length>0&&a.jsxs("div",{style:{marginTop:3,fontSize:9,color:"var(--text-muted)",textAlign:"left"},children:[m.map(b=>a.jsx("div",{className:"truncate",children:b},b)),f>0&&a.jsxs("div",{style:{fontStyle:"italic"},children:["+",f," more"]})]}),a.jsx(ht,{type:"source",position:bt.Bottom,style:$i})]})}const Ui={opacity:0,width:1,height:1,minWidth:0,minHeight:0,border:"none",padding:0};function Pc({data:e}){const t=e.label??"",n=e.status,r=e.hasBreakpoint,i=e.isPausedHere,s=e.isActiveNode,o=e.isExecutingNode,l=i?"var(--error)":o?"var(--success)":s?"var(--accent)":n==="completed"?"var(--success)":n==="running"?"var(--warning)":n==="failed"?"var(--error)":"var(--bg-tertiary)",u=i?"var(--error)":o?"var(--success)":"var(--accent)";return a.jsxs("div",{className:"relative cursor-pointer",style:{width:"100%",height:"100%",background:"var(--bg-secondary)",border:`1.5px ${i||s||o?"solid":"dashed"} ${l}`,borderRadius:8,boxShadow:i||s||o?`0 0 4px ${u}`:void 0,animation:i||s||o?`node-pulse-${i?"red":o?"green":"accent"} 1.5s ease-in-out infinite`:void 0},children:[r&&a.jsx("div",{className:"absolute",style:{top:4,left:4,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--bg-tertiary)",boxShadow:"0 0 4px var(--error)",zIndex:1}}),a.jsx(ht,{type:"target",position:bt.Top,style:Ui}),a.jsx("div",{style:{padding:"4px 10px",fontSize:10,color:"var(--text-muted)",fontWeight:600,textAlign:"center",borderBottom:`1px solid ${l}`,background:"var(--bg-tertiary)",borderRadius:"8px 8px 0 0"},children:t}),a.jsx(ht,{type:"source",position:bt.Bottom,style:Ui})]})}function Bc({data:e}){const t=e.status,n=e.nodeWidth,r=e.label??"",i=e.hasBreakpoint,s=e.isPausedHere,o=e.isActiveNode,l=e.isExecutingNode,u=s?"var(--error)":l?"var(--success)":o?"var(--accent)":t==="completed"?"var(--success)":t==="running"?"var(--warning)":t==="failed"?"var(--error)":"var(--node-border)",c=s?"var(--error)":l?"var(--success)":"var(--accent)";return a.jsxs("div",{className:"px-3 py-1.5 rounded-lg text-center text-xs overflow-hidden cursor-pointer relative",style:{width:n,background:"var(--node-bg)",color:"var(--text-primary)",border:`2px solid ${u}`,boxShadow:s||o||l?`0 0 4px ${c}`:void 0,animation:s||o||l?`node-pulse-${s?"red":l?"green":"accent"} 1.5s ease-in-out infinite`:void 0},title:r,children:[i&&a.jsx("div",{className:"absolute",style:{top:2,left:2,width:12,height:12,borderRadius:"50%",background:"var(--error)",border:"2px solid var(--node-bg)",boxShadow:"0 0 4px var(--error)"}}),a.jsx(ht,{type:"target",position:bt.Top}),a.jsx("div",{className:"overflow-hidden text-ellipsis whitespace-nowrap",children:r}),a.jsx(ht,{type:"source",position:bt.Bottom})]})}function Fc(e,t=8){if(e.length<2)return"";if(e.length===2)return`M ${e[0].x} ${e[0].y} L ${e[1].x} ${e[1].y}`;let n=`M ${e[0].x} ${e[0].y}`;for(let i=1;i0&&(n+=Math.min(r.length,3)*12+(r.length>3?12:0)+4),e!=null&&e.model_name&&(n+=14),n}let dr=null;async function Gc(){if(!dr){const{default:e}=await Ts(async()=>{const{default:t}=await import("./vendor-elk-CiLKfHel.js").then(n=>n.e);return{default:t}},__vite__mapDeps([0,1]));dr=new e}return dr}const Ki={"elk.algorithm":"layered","elk.direction":"DOWN","elk.edgeRouting":"ORTHOGONAL","elk.layered.crossingMinimization.strategy":"LAYER_SWEEP","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX","elk.spacing.nodeNode":"25","elk.layered.spacing.nodeNodeBetweenLayers":"50","elk.spacing.edgeNode":"30","elk.spacing.edgeEdge":"15","elk.layered.spacing.edgeNodeBetweenLayers":"25","elk.layered.spacing.edgeEdgeBetweenLayers":"15","elk.portAlignment.default":"CENTER","elk.layered.considerModelOrder.strategy":"NODES_AND_EDGES"},qc="[top=35,left=15,bottom=15,right=15]";function Vc(e){const t=[],n=[];for(const r of e.nodes){const i=r.data,s={id:r.id,width:Hi(i),height:Wi(i,r.type)};if(r.data.subgraph){const o=r.data.subgraph;delete s.width,delete s.height,s.layoutOptions={...Ki,"elk.padding":qc},s.children=o.nodes.map(l=>({id:`${r.id}/${l.id}`,width:Hi(l.data),height:Wi(l.data,l.type)})),s.edges=o.edges.map(l=>({id:`${r.id}/${l.id}`,sources:[`${r.id}/${l.source}`],targets:[`${r.id}/${l.target}`]}))}t.push(s)}for(const r of e.edges)n.push({id:r.id,sources:[r.source],targets:[r.target]});return{id:"root",layoutOptions:Ki,children:t,edges:n}}const jr={type:Rl.ArrowClosed,width:12,height:12,color:"var(--node-border)"};function Cs(e){return{stroke:"var(--node-border)",strokeWidth:1.5,...e?{strokeDasharray:"6 3"}:{}}}function Gi(e,t,n,r,i){var c;const s=(c=e.sections)==null?void 0:c[0],o=(i==null?void 0:i.x)??0,l=(i==null?void 0:i.y)??0;let u;if(s)u={sourcePoint:{x:s.startPoint.x+o,y:s.startPoint.y+l},targetPoint:{x:s.endPoint.x+o,y:s.endPoint.y+l},bendPoints:(s.bendPoints??[]).map(d=>({x:d.x+o,y:d.y+l}))};else{const d=t.get(e.sources[0]),p=t.get(e.targets[0]);d&&p&&(u={sourcePoint:{x:d.x+d.width/2,y:d.y+d.height},targetPoint:{x:p.x+p.width/2,y:p.y},bendPoints:[]})}return{id:e.id,source:e.sources[0],target:e.targets[0],type:"elk",data:u,style:Cs(r),markerEnd:jr,...n?{label:n,labelStyle:{fill:"var(--text-muted)",fontSize:10},labelBgStyle:{fill:"var(--bg-primary)",fillOpacity:.8}}:{}}}async function Yc(e){var u,c;const t=Vc(e),r=await(await Gc()).layout(t),i=new Map;for(const d of e.nodes)if(i.set(d.id,{type:d.type,data:d.data}),d.data.subgraph)for(const p of d.data.subgraph.nodes)i.set(`${d.id}/${p.id}`,{type:p.type,data:p.data});const s=[],o=[],l=new Map;for(const d of r.children??[]){const p=d.x??0,m=d.y??0;l.set(d.id,{x:p,y:m,width:d.width??0,height:d.height??0});for(const f of d.children??[])l.set(f.id,{x:p+(f.x??0),y:m+(f.y??0),width:f.width??0,height:f.height??0})}for(const d of r.children??[]){const p=i.get(d.id);if((((u=d.children)==null?void 0:u.length)??0)>0){s.push({id:d.id,type:"groupNode",data:{...(p==null?void 0:p.data)??{},nodeWidth:d.width,nodeHeight:d.height},position:{x:d.x??0,y:d.y??0},style:{width:d.width,height:d.height}});for(const h of d.children??[]){const v=i.get(h.id);s.push({id:h.id,type:(v==null?void 0:v.type)??"defaultNode",data:{...(v==null?void 0:v.data)??{},nodeWidth:h.width},position:{x:h.x??0,y:h.y??0},parentNode:d.id,extent:"parent"})}const f=d.x??0,b=d.y??0;for(const h of d.edges??[]){const v=e.nodes.find(x=>x.id===d.id),y=(c=v==null?void 0:v.data.subgraph)==null?void 0:c.edges.find(x=>`${d.id}/${x.id}`===h.id);o.push(Gi(h,l,y==null?void 0:y.label,y==null?void 0:y.conditional,{x:f,y:b}))}}else s.push({id:d.id,type:(p==null?void 0:p.type)??"defaultNode",data:{...(p==null?void 0:p.data)??{},nodeWidth:d.width},position:{x:d.x??0,y:d.y??0}})}for(const d of r.edges??[]){const p=e.edges.find(m=>m.id===d.id);o.push(Gi(d,l,p==null?void 0:p.label,p==null?void 0:p.conditional))}return{nodes:s,edges:o}}function Un({entrypoint:e,runId:t,breakpointNode:n,breakpointNextNodes:r,onBreakpointChange:i}){const[s,o,l]=Ol([]),[u,c,d]=Ll([]),[p,m]=_.useState(!0),[f,b]=_.useState(!1),[h,v]=_.useState(0),y=_.useRef(0),x=_.useRef(null),C=ve(w=>w.breakpoints[t]),O=ve(w=>w.toggleBreakpoint),j=ve(w=>w.clearBreakpoints),N=ve(w=>w.activeNodes[t]),B=ve(w=>{var k;return(k=w.runs[t])==null?void 0:k.status}),D=_.useCallback((w,k)=>{if(k.type==="startNode"||k.type==="endNode")return;const I=k.type==="groupNode"?k.id:k.id.includes("/")?k.id.split("/").pop():k.id;O(t,I);const W=ve.getState().breakpoints[t]??{};i==null||i(Object.keys(W))},[t,O,i]),R=C&&Object.keys(C).length>0,S=_.useCallback(()=>{if(R)j(t),i==null||i([]);else{const w=[];for(const I of s){if(I.type==="startNode"||I.type==="endNode"||I.parentNode)continue;const W=I.type==="groupNode"?I.id:I.id.includes("/")?I.id.split("/").pop():I.id;w.push(W)}for(const I of w)C!=null&&C[I]||O(t,I);const k=ve.getState().breakpoints[t]??{};i==null||i(Object.keys(k))}},[t,R,C,s,j,O,i]);_.useEffect(()=>{o(w=>w.map(k=>{var U;if(k.type==="startNode"||k.type==="endNode")return k;const I=k.type==="groupNode"?k.id:k.id.includes("/")?k.id.split("/").pop():k.id,W=!!(C&&C[I]);return W!==!!((U=k.data)!=null&&U.hasBreakpoint)?{...k,data:{...k.data,hasBreakpoint:W}}:k}))},[C,o]),_.useEffect(()=>{const w=n?new Set(n.split(",").map(k=>k.trim()).filter(Boolean)):null;o(k=>k.map(I=>{var g,F;if(I.type==="startNode"||I.type==="endNode")return I;const W=I.type==="groupNode"?I.id:I.id.includes("/")?I.id.split("/").pop():I.id,U=(g=I.data)==null?void 0:g.label,q=w!=null&&(w.has(W)||U!=null&&w.has(U));return q!==!!((F=I.data)!=null&&F.isPausedHere)?{...I,data:{...I.data,isPausedHere:q}}:I}))},[n,h,o]);const T=ve(w=>w.stateEvents[t]);_.useEffect(()=>{const w=!!n;let k=new Set;const I=new Set,W=new Set,U=new Set,q=new Map,g=new Map;if(T)for(const F of T)F.phase==="started"?g.set(F.node_name,F.qualified_node_name??null):F.phase==="completed"&&g.delete(F.node_name);o(F=>{var E;for(const ie of F)ie.type&&q.set(ie.id,ie.type);const $=ie=>{var H;const K=[];for(const re of F){const de=re.type==="groupNode"?re.id:re.id.includes("/")?re.id.split("/").pop():re.id,xe=(H=re.data)==null?void 0:H.label;(de===ie||xe!=null&&xe===ie)&&K.push(re.id)}return K};if(w&&n){const ie=n.split(",").map(K=>K.trim()).filter(Boolean);for(const K of ie)$(K).forEach(H=>k.add(H));if(r!=null&&r.length)for(const K of r)$(K).forEach(H=>W.add(H));N!=null&&N.prev&&$(N.prev).forEach(K=>I.add(K))}else if(g.size>0){const ie=new Map;for(const K of F){const H=(E=K.data)==null?void 0:E.label;if(!H)continue;const re=K.id.includes("/")?K.id.split("/").pop():K.id;for(const de of[re,H]){let xe=ie.get(de);xe||(xe=new Set,ie.set(de,xe)),xe.add(K.id)}}for(const[K,H]of g){let re=!1;if(H){const de=H.replace(/:/g,"/");for(const xe of F)xe.id===de&&(k.add(xe.id),re=!0)}if(!re){const de=ie.get(K);de&&de.forEach(xe=>k.add(xe))}}}return F}),c(F=>{const $=I.size===0||F.some(E=>k.has(E.target)&&I.has(E.source));return F.map(E=>{var K,H;let ie;return w?ie=k.has(E.target)&&(I.size===0||!$||I.has(E.source))||k.has(E.source)&&W.has(E.target):(ie=k.has(E.source),!ie&&q.get(E.target)==="endNode"&&k.has(E.target)&&(ie=!0)),ie?(w||U.add(E.target),{...E,style:{stroke:"var(--accent)",strokeWidth:2.5},markerEnd:{...jr,color:"var(--accent)"},data:{...E.data,highlighted:!0},animated:!0}):(K=E.data)!=null&&K.highlighted?{...E,style:Cs((H=E.data)==null?void 0:H.conditional),markerEnd:jr,data:{...E.data,highlighted:!1},animated:!1}:E})}),o(F=>F.map($=>{var K,H,re,de;const E=!w&&k.has($.id);if($.type==="startNode"||$.type==="endNode"){const xe=U.has($.id)||!w&&k.has($.id);return xe!==!!((K=$.data)!=null&&K.isActiveNode)||E!==!!((H=$.data)!=null&&H.isExecutingNode)?{...$,data:{...$.data,isActiveNode:xe,isExecutingNode:E}}:$}const ie=w?W.has($.id):U.has($.id);return ie!==!!((re=$.data)!=null&&re.isActiveNode)||E!==!!((de=$.data)!=null&&de.isExecutingNode)?{...$,data:{...$.data,isActiveNode:ie,isExecutingNode:E}}:$}))},[T,N,n,r,B,h,o,c]);const L=ve(w=>w.graphCache[t]);_.useEffect(()=>{if(!L&&t!=="__setup__")return;const w=L?Promise.resolve(L):Zl(e),k=++y.current;m(!0),b(!1),w.then(async I=>{if(y.current!==k)return;if(!I.nodes.length){b(!0);return}const{nodes:W,edges:U}=await Yc(I);if(y.current!==k)return;const q=ve.getState().breakpoints[t],g=q?W.map(F=>{if(F.type==="startNode"||F.type==="endNode")return F;const $=F.type==="groupNode"?F.id:F.id.includes("/")?F.id.split("/").pop():F.id;return q[$]?{...F,data:{...F.data,hasBreakpoint:!0}}:F}):W;o(g),c(U),v(F=>F+1),setTimeout(()=>{var F;(F=x.current)==null||F.fitView({padding:.1,duration:200})},100)}).catch(()=>{y.current===k&&b(!0)}).finally(()=>{y.current===k&&m(!1)})},[e,t,L,o,c]),_.useEffect(()=>{const w=setTimeout(()=>{var k;(k=x.current)==null||k.fitView({padding:.1,duration:200})},100);return()=>clearTimeout(w)},[t]);const M=_.useRef(null);return _.useEffect(()=>{const w=M.current;if(!w)return;const k=new ResizeObserver(()=>{var I;(I=x.current)==null||I.fitView({padding:.1,duration:200})});return k.observe(w),()=>k.disconnect()},[p,f]),_.useEffect(()=>{o(w=>{var E,ie,K;const k=!!(T!=null&&T.length),I=B==="completed"||B==="failed",W=new Set,U=new Set(w.map(H=>H.id)),q=new Map;for(const H of w){const re=(E=H.data)==null?void 0:E.label;if(!re)continue;const de=H.id.includes("/")?H.id.split("/").pop():H.id;for(const xe of[de,re]){let Oe=q.get(xe);Oe||(Oe=new Set,q.set(xe,Oe)),Oe.add(H.id)}}if(k)for(const H of T){let re=!1;if(H.qualified_node_name){const de=H.qualified_node_name.replace(/:/g,"/");U.has(de)&&(W.add(de),re=!0)}if(!re){const de=q.get(H.node_name);de&&de.forEach(xe=>W.add(xe))}}const g=new Set;for(const H of w)H.parentNode&&W.has(H.id)&&g.add(H.parentNode);let F;B==="failed"&&W.size===0&&(F=(ie=w.find(H=>!H.parentNode&&H.type!=="startNode"&&H.type!=="endNode"&&H.type!=="groupNode"))==null?void 0:ie.id);let $;if(B==="completed"){const H=(K=w.find(re=>!re.parentNode&&re.type!=="startNode"&&re.type!=="endNode"&&re.type!=="groupNode"))==null?void 0:K.id;H&&!W.has(H)&&($=H)}return w.map(H=>{var de;let re;return H.id===F?re="failed":H.id===$||W.has(H.id)?re="completed":H.type==="startNode"?(!H.parentNode&&k||H.parentNode&&g.has(H.parentNode))&&(re="completed"):H.type==="endNode"?!H.parentNode&&I?re=B==="failed"?"failed":"completed":H.parentNode&&g.has(H.parentNode)&&(re="completed"):H.type==="groupNode"&&g.has(H.id)&&(re="completed"),re!==((de=H.data)==null?void 0:de.status)?{...H,data:{...H.data,status:re}}:H})})},[T,B,h,o]),p?a.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:"Loading graph..."}):f?a.jsxs("div",{className:"flex flex-col items-center justify-center h-full gap-4",style:{color:"var(--text-muted)"},children:[a.jsxs("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("rect",{x:"38",y:"10",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.4"}),a.jsx("line",{x1:"60",y1:"34",x2:"60",y2:"46",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("rect",{x:"12",y:"46",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("rect",{x:"64",y:"46",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"60",y1:"46",x2:"34",y2:"46",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"60",y1:"46",x2:"86",y2:"46",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"34",y1:"70",x2:"34",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"86",y1:"70",x2:"86",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"34",y1:"82",x2:"60",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"86",y1:"82",x2:"60",y2:"82",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("line",{x1:"60",y1:"82",x2:"60",y2:"86",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.3"}),a.jsx("rect",{x:"38",y:"86",width:"44",height:"24",rx:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"4 3",opacity:"0.4"})]}),a.jsx("span",{className:"text-xs",children:"No graph schema available"})]}):a.jsxs("div",{ref:M,className:"h-full graph-panel",children:[a.jsx("style",{children:` - .graph-panel .react-flow__handle { - opacity: 0 !important; - width: 0 !important; - height: 0 !important; - min-width: 0 !important; - min-height: 0 !important; - border: none !important; - pointer-events: none !important; - } - .graph-panel .react-flow__edges { - overflow: visible !important; - z-index: 1 !important; - } - .graph-panel .react-flow__edge.animated path { - stroke-dasharray: 8 4; - animation: edge-flow 0.6s linear infinite; - } - @keyframes edge-flow { - to { stroke-dashoffset: -12; } - } - @keyframes node-pulse-accent { - 0%, 100% { box-shadow: 0 0 4px var(--accent); } - 50% { box-shadow: 0 0 10px var(--accent); } - } - @keyframes node-pulse-green { - 0%, 100% { box-shadow: 0 0 4px var(--success); } - 50% { box-shadow: 0 0 10px var(--success); } - } - @keyframes node-pulse-red { - 0%, 100% { box-shadow: 0 0 4px var(--error); } - 50% { box-shadow: 0 0 10px var(--error); } - } - `}),a.jsxs(jl,{nodes:s,edges:u,onNodesChange:l,onEdgesChange:d,nodeTypes:$c,edgeTypes:Uc,onInit:w=>{x.current=w},onNodeClick:D,fitView:!0,proOptions:{hideAttribution:!0},nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,children:[a.jsx(Dl,{color:"var(--bg-tertiary)",gap:16}),a.jsx(Pl,{showInteractive:!1}),a.jsx(Bl,{position:"top-right",children:a.jsxs("button",{onClick:S,title:R?"Remove all breakpoints":"Set breakpoints on all nodes",style:{background:"var(--bg-secondary)",color:R?"var(--error)":"var(--text-muted)",border:`1px solid ${R?"var(--error)":"var(--node-border)"}`,borderRadius:6,padding:"4px 10px",fontSize:12,cursor:"pointer",display:"flex",alignItems:"center",gap:4},children:[a.jsx("span",{style:{display:"inline-block",width:8,height:8,borderRadius:"50%",background:R?"var(--error)":"var(--node-border)"}}),R?"Clear all":"Break all"]})}),a.jsx(Fl,{nodeColor:w=>{var I;if(w.type==="groupNode")return"var(--bg-tertiary)";const k=(I=w.data)==null?void 0:I.status;return k==="completed"?"var(--success)":k==="running"?"var(--warning)":k==="failed"?"var(--error)":"var(--node-border)"},nodeStrokeWidth:0,style:{background:"var(--bg-secondary)",width:120,height:80}})]})]})}const Ut="__setup__";function Xc({entrypoint:e,mode:t,ws:n,onRunCreated:r,isMobile:i}){const[s,o]=_.useState("{}"),[l,u]=_.useState({}),[c,d]=_.useState(!1),[p,m]=_.useState(!0),[f,b]=_.useState(null),[h,v]=_.useState(""),[y,x]=_.useState(!0),[C,O]=_.useState(()=>{const I=localStorage.getItem("setupTextareaHeight");return I?parseInt(I,10):140}),j=_.useRef(null),[N,B]=_.useState(()=>{const I=localStorage.getItem("setupPanelWidth");return I?parseInt(I,10):380}),D=t==="run";_.useEffect(()=>{m(!0),b(null),Xl(e).then(I=>{u(I.mock_input),o(JSON.stringify(I.mock_input,null,2))}).catch(I=>{console.error("Failed to load mock input:",I);const W=I.detail||{};b(W.message||`Failed to load schema for "${e}"`),o("{}")}).finally(()=>m(!1))},[e]),_.useEffect(()=>{ve.getState().clearBreakpoints(Ut)},[]);const R=async()=>{let I;try{I=JSON.parse(s)}catch{alert("Invalid JSON input");return}d(!0);try{const W=ve.getState().breakpoints[Ut]??{},U=Object.keys(W),q=await Oi(e,I,t,U);ve.getState().clearBreakpoints(Ut),ve.getState().upsertRun(q),r(q.id)}catch(W){console.error("Failed to create run:",W)}finally{d(!1)}},S=async()=>{const I=h.trim();if(I){d(!0);try{const W=ve.getState().breakpoints[Ut]??{},U=Object.keys(W),q=await Oi(e,l,"chat",U);ve.getState().clearBreakpoints(Ut),ve.getState().upsertRun(q),ve.getState().addLocalChatMessage(q.id,{message_id:`local-${Date.now()}`,role:"user",content:I}),n.sendChatMessage(q.id,I),r(q.id)}catch(W){console.error("Failed to create chat run:",W)}finally{d(!1)}}};_.useEffect(()=>{try{JSON.parse(s),x(!0)}catch{x(!1)}},[s]);const T=_.useCallback(I=>{I.preventDefault();const W="touches"in I?I.touches[0].clientY:I.clientY,U=C,q=F=>{const $="touches"in F?F.touches[0].clientY:F.clientY,E=Math.max(60,U+(W-$));O(E)},g=()=>{document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",g),document.removeEventListener("touchmove",q),document.removeEventListener("touchend",g),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("setupTextareaHeight",String(C))};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",q),document.addEventListener("mouseup",g),document.addEventListener("touchmove",q,{passive:!1}),document.addEventListener("touchend",g)},[C]),L=_.useCallback(I=>{I.preventDefault();const W="touches"in I?I.touches[0].clientX:I.clientX,U=N,q=F=>{const $=j.current;if(!$)return;const E="touches"in F?F.touches[0].clientX:F.clientX,ie=$.clientWidth-300,K=Math.max(280,Math.min(ie,U+(W-E)));B(K)},g=()=>{document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",g),document.removeEventListener("touchmove",q),document.removeEventListener("touchend",g),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("setupPanelWidth",String(N))};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",q),document.addEventListener("mouseup",g),document.addEventListener("touchmove",q,{passive:!1}),document.addEventListener("touchend",g)},[N]),M=D?"Autonomous":"Conversational",w=D?"var(--success)":"var(--accent)",k=a.jsxs("div",{className:"shrink-0 flex flex-col",style:i?{background:"var(--bg-primary)"}:{width:N,background:"var(--bg-primary)"},children:[a.jsxs("div",{className:"px-4 text-xs font-semibold border-b flex items-center gap-2 h-10",style:{color:"var(--text-muted)",borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[a.jsx("span",{style:{color:w},children:"●"}),M]}),a.jsxs("div",{className:"flex-1 overflow-y-auto flex flex-col items-center justify-center gap-4 px-6",children:[a.jsx("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--text-muted)",opacity:.5},children:D?a.jsxs(a.Fragment,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("polyline",{points:"12 6 12 12 16 14"})]}):a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),a.jsxs("div",{className:"text-center space-y-1.5",children:[a.jsx("p",{className:"text-sm font-medium",style:{color:"var(--text-secondary)"},children:D?"Ready to execute":"Ready to chat"}),a.jsxs("p",{className:"text-xs leading-relaxed",style:{color:"var(--text-muted)"},children:["Click nodes to set breakpoints",D?a.jsxs(a.Fragment,{children:[",",a.jsx("br",{}),"configure input below, then run"]}):a.jsxs(a.Fragment,{children:[",",a.jsx("br",{}),"then send your first message"]})]})]})]}),D?a.jsxs("div",{className:"flex flex-col",style:{background:"var(--bg-primary)"},children:[!i&&a.jsx("div",{onMouseDown:T,onTouchStart:T,className:"shrink-0 drag-handle-row"}),a.jsxs("div",{className:"px-4 py-3",children:[f?a.jsx("div",{className:"text-xs mb-3 px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:f}):a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:["Input",p&&a.jsx("span",{className:"ml-2 font-normal",children:"Loading..."})]}),a.jsx("textarea",{value:s,onChange:I=>o(I.target.value),spellCheck:!1,className:"w-full rounded-md px-3 py-2 text-xs font-mono leading-relaxed resize-none mb-3",style:{height:i?120:C,background:"var(--bg-secondary)",border:`1px solid ${y?"var(--border)":"#b91c1c"}`,color:"var(--text-primary)"}})]}),a.jsx("button",{onClick:R,disabled:c||p||!!f,className:"w-full py-2 text-sm font-semibold rounded-md border cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed transition-colors flex items-center justify-center gap-2",style:{background:"transparent",borderColor:w,color:w},onMouseEnter:I=>{c||(I.currentTarget.style.background=`color-mix(in srgb, ${w} 10%, transparent)`)},onMouseLeave:I=>{I.currentTarget.style.background="transparent"},children:c?"Starting...":a.jsxs(a.Fragment,{children:[a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:a.jsx("polygon",{points:"5,3 19,12 5,21"})}),"Execute"]})})]})]}):a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:[a.jsx("input",{value:h,onChange:I=>v(I.target.value),onKeyDown:I=>{I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),S())},disabled:c||p,placeholder:c?"Starting...":"Message...",className:"flex-1 bg-transparent text-sm py-1 disabled:opacity-40 placeholder:text-[var(--text-muted)]",style:{color:"var(--text-primary)"}}),a.jsx("button",{onClick:S,disabled:c||p||!h.trim(),className:"text-xs font-semibold px-3 py-1.5 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:!c&&h.trim()?"var(--accent)":"var(--text-muted)",background:"transparent"},onMouseEnter:I=>{!c&&h.trim()&&(I.currentTarget.style.background="color-mix(in srgb, var(--accent) 10%, transparent)")},onMouseLeave:I=>{I.currentTarget.style.background="transparent"},children:"Send"})]})]});return i?a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsx("div",{className:"shrink-0",style:{height:"40vh"},children:a.jsx(Un,{entrypoint:e,traces:[],runId:Ut})}),a.jsx("div",{className:"flex-1 overflow-y-auto flex flex-col min-h-0",children:k})]}):a.jsxs("div",{ref:j,className:"flex h-full",children:[a.jsx("div",{className:"flex-1 min-w-0",children:a.jsx(Un,{entrypoint:e,traces:[],runId:Ut})}),a.jsx("div",{onMouseDown:L,onTouchStart:L,className:"shrink-0 drag-handle-col"}),k]})}const Zc={key:"var(--info)",string:"var(--success)",number:"var(--warning)",boolean:"var(--accent)",null:"var(--accent)",punctuation:"var(--text-muted)"};function Jc(e){const t=[],n=/("(?:[^"\\]|\\.)*")\s*:|("(?:[^"\\]|\\.)*")|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b|(true|false)\b|(null)\b|([{}[\]:,])/g;let r=0,i;for(;(i=n.exec(e))!==null;){if(i.index>r&&t.push({type:"punctuation",text:e.slice(r,i.index)}),i[1]!==void 0){t.push({type:"key",text:i[1]});const s=e.indexOf(":",i.index+i[1].length);s!==-1&&(s>i.index+i[1].length&&t.push({type:"punctuation",text:e.slice(i.index+i[1].length,s)}),t.push({type:"punctuation",text:":"}),n.lastIndex=s+1)}else i[2]!==void 0?t.push({type:"string",text:i[2]}):i[3]!==void 0?t.push({type:"number",text:i[3]}):i[4]!==void 0?t.push({type:"boolean",text:i[4]}):i[5]!==void 0?t.push({type:"null",text:i[5]}):i[6]!==void 0&&t.push({type:"punctuation",text:i[6]});r=n.lastIndex}return rJc(e),[e]);return a.jsx("pre",{className:t,style:n,children:r.map((i,s)=>a.jsx("span",{style:{color:Zc[i.type]},children:i.text},s))})}const Qc={started:{color:"var(--info)",label:"Started"},running:{color:"var(--warning)",label:"Running"},completed:{color:"var(--success)",label:"Completed"},failed:{color:"var(--error)",label:"Failed"},error:{color:"var(--error)",label:"Error"}},eu={color:"var(--text-muted)",label:"Unknown"};function tu(e){if(typeof e!="string")return null;const t=e.trim();if(t.startsWith("{")&&t.endsWith("}")||t.startsWith("[")&&t.endsWith("]"))try{return JSON.stringify(JSON.parse(t),null,2)}catch{return null}return null}const qi=200;function nu(e){if(typeof e=="string")return e;if(e==null)return String(e);try{return JSON.stringify(e,null,2)}catch{return String(e)}}function ru({value:e}){const[t,n]=_.useState(!1),r=nu(e),i=_.useMemo(()=>tu(e),[e]),s=i!==null,o=i??r,l=o.length>qi||o.includes(` -`),u=_.useCallback(()=>n(c=>!c),[]);return l?a.jsxs("div",{children:[t?s?a.jsx(ot,{json:o,className:"font-mono text-[11px] whitespace-pre-wrap break-all",style:{}}):a.jsx("pre",{className:"font-mono text-[11px] whitespace-pre-wrap break-all",style:{color:"var(--text-primary)"},children:o}):a.jsxs("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:[o.slice(0,qi),"..."]}),a.jsx("button",{onClick:u,className:"text-[11px] cursor-pointer ml-1 px-1",style:{color:"var(--info)"},children:t?"[less]":"[more]"})]}):s?a.jsx(ot,{json:o,className:"font-mono text-[11px] break-all whitespace-pre-wrap",style:{}}):a.jsx("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:o})}function iu({span:e}){const[t,n]=_.useState(!0),[r,i]=_.useState(!1),[s,o]=_.useState("table"),[l,u]=_.useState(!1),c=Qc[e.status.toLowerCase()]??{...eu,label:e.status},d=_.useMemo(()=>JSON.stringify(e,null,2),[e]),p=_.useCallback(()=>{navigator.clipboard.writeText(d).then(()=>{u(!0),setTimeout(()=>u(!1),1500)})},[d]),m=Object.entries(e.attributes),f=[{label:"Span",value:e.span_id},...e.trace_id?[{label:"Trace",value:e.trace_id}]:[],{label:"Run",value:e.run_id},...e.parent_span_id?[{label:"Parent",value:e.parent_span_id}]:[]];return a.jsxs("div",{className:"flex flex-col h-full text-xs leading-normal",children:[a.jsxs("div",{className:"px-2 border-b flex items-center gap-1 shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",height:"32px"},children:[a.jsx("button",{onClick:()=>o("table"),className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:s==="table"?"var(--accent)":"var(--text-muted)",background:s==="table"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:b=>{s!=="table"&&(b.currentTarget.style.color="var(--text-primary)")},onMouseLeave:b=>{s!=="table"&&(b.currentTarget.style.color="var(--text-muted)")},children:"Table"}),a.jsx("button",{onClick:()=>o("json"),className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:s==="json"?"var(--accent)":"var(--text-muted)",background:s==="json"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:b=>{s!=="json"&&(b.currentTarget.style.color="var(--text-primary)")},onMouseLeave:b=>{s!=="json"&&(b.currentTarget.style.color="var(--text-muted)")},children:"JSON"}),a.jsxs("span",{className:"ml-auto shrink-0 inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[11px] font-bold uppercase tracking-wider",style:{background:`color-mix(in srgb, ${c.color} 15%, var(--bg-secondary))`,color:c.color},children:[a.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full",style:{background:c.color}}),c.label]})]}),a.jsx("div",{className:"overflow-y-auto flex-1 p-0.5 pr-0 pt-0 mr-0.5 mt-0.5",children:s==="table"?a.jsxs(a.Fragment,{children:[m.length>0&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"px-2 py-1 text-[11px] uppercase font-bold tracking-wider border-b cursor-pointer flex items-center",style:{color:"var(--success)",borderColor:"var(--border)",background:"var(--bg-secondary)"},onClick:()=>n(b=>!b),children:[a.jsxs("span",{className:"flex-1",children:["Attributes (",m.length,")"]}),a.jsx("span",{style:{color:"var(--text-muted)",transform:t?"rotate(0deg)":"rotate(-90deg)"},children:"▾"})]}),t&&m.map(([b,h],v)=>a.jsxs("div",{className:"flex gap-2 px-2 py-1 items-start border-b",style:{borderColor:"var(--border)",background:v%2===0?"var(--bg-primary)":"var(--bg-secondary)"},children:[a.jsx("span",{className:"font-mono font-semibold shrink-0 pt-px truncate text-[11px]",style:{color:"var(--info)",width:"35%"},title:b,children:b}),a.jsx("span",{className:"flex-1 min-w-0",children:a.jsx(ru,{value:h})})]},b))]}),a.jsxs("div",{className:"px-2 py-1 text-[11px] uppercase font-bold tracking-wider border-b cursor-pointer flex items-center",style:{color:"var(--success)",borderColor:"var(--border)",background:"var(--bg-secondary)"},onClick:()=>i(b=>!b),children:[a.jsxs("span",{className:"flex-1",children:["Identifiers (",f.length,")"]}),a.jsx("span",{style:{color:"var(--text-muted)",transform:r?"rotate(0deg)":"rotate(-90deg)"},children:"▾"})]}),r&&f.map((b,h)=>a.jsxs("div",{className:"flex gap-2 px-2 py-1 items-start border-b",style:{borderColor:"var(--border)",background:h%2===0?"var(--bg-primary)":"var(--bg-secondary)"},children:[a.jsx("span",{className:"font-mono font-semibold shrink-0 pt-px truncate text-[11px]",style:{color:"var(--info)",width:"35%"},title:b.label,children:b.label}),a.jsx("span",{className:"flex-1 min-w-0",children:a.jsx("span",{className:"font-mono text-[11px] break-all",style:{color:"var(--text-primary)"},children:b.value})})]},b.label))]}):a.jsxs("div",{className:"relative",children:[a.jsx("button",{onClick:p,className:"absolute top-1 right-1 z-10 text-[11px] cursor-pointer px-2 py-1 rounded transition-colors",style:{color:l?"var(--success)":"var(--text-muted)",background:"var(--bg-secondary)",border:"1px solid var(--border)"},onMouseEnter:b=>{l||(b.currentTarget.style.color="var(--text-primary)")},onMouseLeave:b=>{b.currentTarget.style.color=l?"var(--success)":"var(--text-muted)"},children:l?"Copied!":"Copy"}),a.jsx(ot,{json:d,className:"font-mono text-[11px] whitespace-pre-wrap p-2",style:{}})]})})]})}function ou(e){const t=[];function n(r,i){t.push({span:r.span,depth:i});for(const s of r.children)n(s,i+1)}for(const r of e)n(r,0);return t}function su({tree:e,selectedSpan:t,onSelect:n}){const r=_.useMemo(()=>ou(e),[e]),{globalStart:i,totalDuration:s}=_.useMemo(()=>{if(r.length===0)return{globalStart:0,totalDuration:1};let o=1/0,l=-1/0;for(const{span:u}of r){const c=new Date(u.timestamp).getTime();o=Math.min(o,c),l=Math.max(l,c+(u.duration_ms??0))}return{globalStart:o,totalDuration:Math.max(l-o,1)}},[r]);return r.length===0?null:a.jsx(a.Fragment,{children:r.map(({span:o,depth:l})=>{var h;const u=new Date(o.timestamp).getTime()-i,c=o.duration_ms??0,d=u/s*100,p=Math.max(c/s*100,.3),m=As[o.status.toLowerCase()]??"var(--text-muted)",f=o.span_id===(t==null?void 0:t.span_id),b=(h=o.attributes)==null?void 0:h["openinference.span.kind"];return a.jsxs("button",{"data-span-id":o.span_id,onClick:()=>n(o),className:"w-full text-left text-xs leading-normal py-1 flex items-center transition-colors",style:{background:f?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:f?"2px solid var(--accent)":"2px solid transparent"},onMouseEnter:v=>{f||(v.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:v=>{f||(v.currentTarget.style.background="")},children:[a.jsxs("div",{className:"shrink-0 flex items-center gap-1 overflow-hidden",style:{width:"35%",minWidth:"80px",paddingLeft:`${l*12+4}px`},children:[a.jsx("span",{className:"shrink-0 flex items-center justify-center w-3.5 h-3.5",children:a.jsx(Ms,{kind:b,statusColor:m})}),a.jsx("span",{className:"text-[var(--text-primary)] truncate",children:o.span_name})]}),a.jsx("div",{className:"flex-1 relative h-[14px] mx-1 rounded-sm",style:{background:"var(--bg-secondary)"},children:a.jsx("div",{className:"absolute rounded-sm",style:{left:`${d}%`,width:`${p}%`,top:"2px",bottom:"2px",background:m,opacity:.8,minWidth:"2px"}})}),a.jsx("span",{className:"shrink-0 text-[10px] tabular-nums pr-2",style:{width:"52px",textAlign:"right",color:"var(--text-muted)"},children:Is(o.duration_ms)})]},o.span_id)})})}const As={started:"var(--info)",running:"var(--warning)",completed:"var(--success)",failed:"var(--error)",error:"var(--error)"};function Ms({kind:e,statusColor:t}){const n=t,r=14,i={width:r,height:r,viewBox:"0 0 16 16",fill:"none",stroke:n,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"};switch(e){case"LLM":return a.jsx("svg",{...i,children:a.jsx("path",{d:"M8 2L9 5L12 4L10 7L14 8L10 9L12 12L9 11L8 14L7 11L4 12L6 9L2 8L6 7L4 4L7 5Z",fill:n,stroke:"none"})});case"TOOL":return a.jsx("svg",{...i,children:a.jsx("path",{d:"M10.5 2.5a3.5 3.5 0 0 0-3.17 4.93L3.5 11.27a1 1 0 0 0 0 1.41l.82.82a1 1 0 0 0 1.41 0l3.84-3.83A3.5 3.5 0 1 0 10.5 2.5z"})});case"AGENT":return a.jsxs("svg",{...i,children:[a.jsx("rect",{x:"3",y:"5",width:"10",height:"8",rx:"2"}),a.jsx("circle",{cx:"6",cy:"9",r:"1",fill:n,stroke:"none"}),a.jsx("circle",{cx:"10",cy:"9",r:"1",fill:n,stroke:"none"}),a.jsx("path",{d:"M8 2v3"}),a.jsx("path",{d:"M6 2h4"})]});case"CHAIN":return a.jsxs("svg",{...i,children:[a.jsx("path",{d:"M6.5 9.5L9.5 6.5"}),a.jsx("path",{d:"M4.5 8.5l-1 1a2 2 0 0 0 2.83 2.83l1-1"}),a.jsx("path",{d:"M11.5 7.5l1-1a2 2 0 0 0-2.83-2.83l-1 1"})]});case"RETRIEVER":return a.jsxs("svg",{...i,children:[a.jsx("circle",{cx:"7",cy:"7",r:"4"}),a.jsx("path",{d:"M10 10l3.5 3.5"})]});case"EMBEDDING":return a.jsxs("svg",{...i,children:[a.jsx("rect",{x:"2",y:"2",width:"4",height:"4",rx:"0.5"}),a.jsx("rect",{x:"10",y:"2",width:"4",height:"4",rx:"0.5"}),a.jsx("rect",{x:"2",y:"10",width:"4",height:"4",rx:"0.5"}),a.jsx("rect",{x:"10",y:"10",width:"4",height:"4",rx:"0.5"})]});default:return a.jsx("span",{className:"shrink-0 w-2 h-2 rounded-full",style:{background:t}})}}function au(e){const t=new Map(e.map(o=>[o.span_id,o])),n=new Map;for(const o of e)if(o.parent_span_id){const l=n.get(o.parent_span_id)??[];l.push(o),n.set(o.parent_span_id,l)}const r=e.filter(o=>o.parent_span_id===null||!t.has(o.parent_span_id));function i(o){const l=(n.get(o.span_id)??[]).sort((u,c)=>u.timestamp.localeCompare(c.timestamp));return{span:o,children:l.map(i)}}return r.sort((o,l)=>o.timestamp.localeCompare(l.timestamp)).map(i).flatMap(o=>o.span.span_name==="root"?o.children:[o])}function Is(e){return e==null?"":e<1e3?`${e.toFixed(0)}ms`:`${(e/1e3).toFixed(2)}s`}function Rs(e){return e.map(t=>{const{span:n}=t;return t.children.length>0?{name:n.span_name,children:Rs(t.children)}:{name:n.span_name}})}function Dr({traces:e}){const[t,n]=_.useState(null),[r,i]=_.useState(new Set),[s,o]=_.useState(()=>{const D=localStorage.getItem("traceTreeSplitWidth");return D?parseFloat(D):50}),[l,u]=_.useState(!1),[c,d]=_.useState(!1),[p,m]=_.useState(()=>localStorage.getItem("traceViewMode")||"tree"),f=au(e),b=_.useMemo(()=>JSON.stringify(Rs(f),null,2),[e]),h=_.useCallback(()=>{navigator.clipboard.writeText(b).then(()=>{d(!0),setTimeout(()=>d(!1),1500)})},[b]),v=ve(D=>D.focusedSpan),y=ve(D=>D.setFocusedSpan),[x,C]=_.useState(null),O=_.useRef(null),j=_.useCallback(D=>{i(R=>{const S=new Set(R);return S.has(D)?S.delete(D):S.add(D),S})},[]),N=_.useRef(null);_.useEffect(()=>{const D=f.length>0?f[0].span.span_id:null,R=N.current;if(N.current=D,D&&D!==R)n(f[0].span);else if(t===null)f.length>0&&n(f[0].span);else{const S=e.find(T=>T.span_id===t.span_id);S&&S!==t&&n(S)}},[e]),_.useEffect(()=>{if(!v)return;const R=e.filter(S=>S.span_name===v.name).sort((S,T)=>S.timestamp.localeCompare(T.timestamp))[v.index];if(R){n(R),C(R.span_id);const S=new Map(e.map(T=>[T.span_id,T.parent_span_id]));i(T=>{const L=new Set(T);let M=R.parent_span_id;for(;M;)L.delete(M),M=S.get(M)??null;return L})}y(null)},[v,e,y]),_.useEffect(()=>{if(!x)return;const D=x;C(null),requestAnimationFrame(()=>{const R=O.current,S=R==null?void 0:R.querySelector(`[data-span-id="${D}"]`);R&&S&&S.scrollIntoView({block:"center",behavior:"smooth"})})},[x]),_.useEffect(()=>{if(!l)return;const D=S=>{const T=document.querySelector(".trace-tree-container");if(!T)return;const L=T.getBoundingClientRect(),M=(S.clientX-L.left)/L.width*100,w=Math.max(20,Math.min(80,M));o(w),localStorage.setItem("traceTreeSplitWidth",String(w))},R=()=>{u(!1)};return window.addEventListener("mousemove",D),window.addEventListener("mouseup",R),()=>{window.removeEventListener("mousemove",D),window.removeEventListener("mouseup",R)}},[l]);const B=D=>{D.preventDefault(),u(!0)};return a.jsxs("div",{className:"flex h-full trace-tree-container",style:{cursor:l?"col-resize":void 0},children:[a.jsxs("div",{className:"flex flex-col",style:{width:`${s}%`},children:[e.length>0&&a.jsxs("div",{className:"flex items-center gap-1 px-2 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",height:"32px"},children:[a.jsx("button",{onClick:()=>{m("tree"),localStorage.setItem("traceViewMode","tree")},className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:p==="tree"?"var(--accent)":"var(--text-muted)",background:p==="tree"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:D=>{p!=="tree"&&(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{p!=="tree"&&(D.currentTarget.style.color="var(--text-muted)")},children:"Tree"}),a.jsx("button",{onClick:()=>{m("timeline"),localStorage.setItem("traceViewMode","timeline")},className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:p==="timeline"?"var(--accent)":"var(--text-muted)",background:p==="timeline"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:D=>{p!=="timeline"&&(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{p!=="timeline"&&(D.currentTarget.style.color="var(--text-muted)")},children:"Timeline"}),a.jsx("button",{onClick:()=>{m("json"),localStorage.setItem("traceViewMode","json")},className:"px-2.5 h-6 text-[11px] font-semibold rounded transition-colors cursor-pointer inline-flex items-center",style:{color:p==="json"?"var(--accent)":"var(--text-muted)",background:p==="json"?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent"},onMouseEnter:D=>{p!=="json"&&(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{p!=="json"&&(D.currentTarget.style.color="var(--text-muted)")},children:"JSON"})]}),a.jsx("div",{ref:O,className:"overflow-y-auto flex-1 p-0.5 pr-0 pt-0 mr-0.5 mt-0.5",children:f.length===0?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"No traces yet"})}):p==="tree"?f.map((D,R)=>a.jsx(Os,{node:D,depth:0,selectedId:(t==null?void 0:t.span_id)??null,onSelect:n,isLast:R===f.length-1,collapsedIds:r,toggleExpanded:j},D.span.span_id)):p==="timeline"?a.jsx(su,{tree:f,selectedSpan:t,onSelect:n}):a.jsxs("div",{className:"relative",children:[a.jsx("button",{onClick:h,className:"absolute top-1 right-1 z-10 text-[11px] cursor-pointer px-2 py-1 rounded transition-colors",style:{color:c?"var(--success)":"var(--text-muted)",background:"var(--bg-secondary)",border:"1px solid var(--border)"},onMouseEnter:D=>{c||(D.currentTarget.style.color="var(--text-primary)")},onMouseLeave:D=>{D.currentTarget.style.color=c?"var(--success)":"var(--text-muted)"},children:c?"Copied!":"Copy"}),a.jsx(ot,{json:b,className:"font-mono text-[11px] whitespace-pre-wrap p-2",style:{}})]})})]}),a.jsx("div",{onMouseDown:B,className:"shrink-0 drag-handle-col",style:l?{background:"var(--accent)"}:void 0}),a.jsx("div",{className:"flex-1 overflow-hidden",children:t?a.jsx(iu,{span:t}):a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"Select a span to view details"})})})]})}function Os({node:e,depth:t,selectedId:n,onSelect:r,isLast:i,collapsedIds:s,toggleExpanded:o}){var h;const{span:l}=e,u=!s.has(l.span_id),c=As[l.status.toLowerCase()]??"var(--text-muted)",d=Is(l.duration_ms),p=l.span_id===n,m=e.children.length>0,f=t*20,b=(h=l.attributes)==null?void 0:h["openinference.span.kind"];return a.jsxs("div",{className:"relative",children:[t>0&&a.jsx("div",{className:"absolute top-0 z-10 pointer-events-none",style:{left:`${f-10}px`,width:"1px",height:i?"16px":"100%",background:"var(--border)"}}),a.jsxs("button",{"data-span-id":l.span_id,onClick:()=>r(l),className:"w-full text-left text-xs leading-normal py-1.5 pr-2 flex items-center gap-1.5 transition-colors relative",style:{paddingLeft:`${f+4}px`,background:p?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":void 0,borderLeft:p?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:v=>{p||(v.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:v=>{p||(v.currentTarget.style.background="")},children:[t>0&&a.jsx("div",{className:"absolute z-10 pointer-events-none",style:{left:`${f-10}px`,top:"50%",width:"10px",height:"1px",background:"var(--border)"}}),m?a.jsx("span",{onClick:v=>{v.stopPropagation(),o(l.span_id)},className:"shrink-0 w-5 h-5 flex items-center justify-center cursor-pointer rounded hover:bg-[var(--bg-hover)]",style:{color:"var(--text-muted)"},children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",style:{transform:u?"rotate(90deg)":"rotate(0deg)"},children:a.jsx("path",{d:"M3 1.5L7 5L3 8.5",stroke:"currentColor",strokeWidth:"1.5",fill:"none",strokeLinecap:"round",strokeLinejoin:"round"})})}):a.jsx("span",{className:"shrink-0 w-4"}),a.jsx("span",{className:"shrink-0 flex items-center justify-center w-4 h-4",children:a.jsx(Ms,{kind:b,statusColor:c})}),a.jsx("span",{className:"text-[var(--text-primary)] truncate min-w-0 flex-1",children:l.span_name}),d&&a.jsx("span",{className:"text-[var(--text-muted)] shrink-0 ml-auto pl-2 tabular-nums",children:d})]}),u&&e.children.map((v,y)=>a.jsx(Os,{node:v,depth:t+1,selectedId:n,onSelect:r,isLast:y===e.children.length-1,collapsedIds:s,toggleExpanded:o},v.span.span_id))]})}const lu={DEBUG:{color:"var(--text-muted)",bg:"color-mix(in srgb, var(--text-muted) 15%, var(--bg-secondary))",border:"var(--text-muted)"},INFO:{color:"var(--info)",bg:"color-mix(in srgb, var(--info) 15%, var(--bg-secondary))",border:"var(--info)"},WARN:{color:"var(--warning)",bg:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",border:"var(--warning)"},WARNING:{color:"var(--warning)",bg:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",border:"var(--warning)"},ERROR:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",border:"var(--error)"},CRITICAL:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",border:"var(--error)"}},cu={color:"var(--text-muted)",bg:"transparent"};function Vi({logs:e}){const t=_.useRef(null),n=_.useRef(null),[r,i]=_.useState(!1);_.useEffect(()=>{var o;(o=n.current)==null||o.scrollIntoView({behavior:"smooth"})},[e.length]);const s=()=>{const o=t.current;o&&i(o.scrollTop>100)};return e.length===0?a.jsx("div",{className:"h-full flex items-center justify-center",children:a.jsx("p",{className:"text-[var(--text-muted)] text-sm",children:"No logs yet"})}):a.jsxs("div",{className:"h-full relative",children:[a.jsxs("div",{ref:t,onScroll:s,className:"h-full overflow-y-auto font-mono text-xs leading-normal",children:[e.map((o,l)=>{const u=new Date(o.timestamp).toLocaleTimeString(void 0,{hour12:!1}),c=o.level.toUpperCase(),d=c.slice(0,4),p=lu[c]??cu,m=l%2===0;return a.jsxs("div",{className:"flex gap-3 px-3 py-1.5",style:{background:m?"var(--bg-primary)":"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[var(--text-muted)] shrink-0",children:u}),a.jsx("span",{className:"shrink-0 self-start px-1.5 py-0.5 rounded text-[10px] font-semibold leading-none inline-flex items-center",style:{color:p.color,background:p.bg},children:d}),a.jsx("span",{className:"text-[var(--text-primary)] whitespace-pre-wrap break-all",children:o.message})]},l)}),a.jsx("div",{ref:n})]}),r&&a.jsx("button",{onClick:()=>{var o;return(o=t.current)==null?void 0:o.scrollTo({top:0,behavior:"smooth"})},className:"absolute top-2 right-3 w-6 h-6 flex items-center justify-center rounded-full cursor-pointer transition-opacity opacity-70 hover:opacity-100",style:{background:"var(--bg-tertiary)",color:"var(--text-primary)"},title:"Scroll to top",children:a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"18 15 12 9 6 15"})})})]})}const uu={started:{color:"var(--accent)",label:"started"},updated:{color:"var(--info)",label:"updated"},completed:{color:"var(--success)",label:"completed"},faulted:{color:"var(--error)",label:"faulted"}},Yi={color:"var(--text-muted)",label:""};function An({events:e,runStatus:t}){const n=_.useRef(null),r=_.useRef(!0),[i,s]=_.useState(null),o=()=>{const l=n.current;l&&(r.current=l.scrollHeight-l.scrollTop-l.clientHeight<40)};return _.useEffect(()=>{r.current&&n.current&&(n.current.scrollTop=n.current.scrollHeight)}),e.length===0?a.jsx("div",{className:"flex-1 flex items-center justify-center h-full",children:a.jsx("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:t==="running"?"Waiting for events...":"No events yet"})}):a.jsx("div",{ref:n,onScroll:o,className:"h-full overflow-y-auto font-mono text-xs leading-normal",children:e.map((l,u)=>{const c=new Date(l.timestamp).toLocaleTimeString(void 0,{hour12:!1}),d=l.payload&&Object.keys(l.payload).length>0,p=i===u,m=l.phase?uu[l.phase]??Yi:Yi;return a.jsxs("div",{children:[a.jsxs("div",{onClick:()=>{d&&s(p?null:u)},className:"flex items-center gap-2 px-3 py-1.5",style:{background:u%2===0?"var(--bg-primary)":"var(--bg-secondary)",cursor:d?"pointer":"default"},children:[a.jsx("span",{className:"shrink-0",style:{color:"var(--text-muted)"},children:c}),a.jsx("span",{className:"shrink-0",style:{color:m.color},children:"●"}),a.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:l.node_name}),m.label&&a.jsx("span",{className:"shrink-0 text-[10px]",style:{color:"var(--text-muted)"},children:m.label}),d&&a.jsx("span",{className:"shrink-0 text-[9px] transition-transform",style:{color:"var(--text-muted)",transform:p?"rotate(90deg)":"rotate(0deg)"},children:"▸"})]}),p&&d&&a.jsx("div",{className:"px-3 py-2 border-t border-b",style:{borderColor:"var(--border)",background:"color-mix(in srgb, var(--bg-secondary) 80%, var(--bg-primary))"},children:a.jsx(ot,{json:JSON.stringify(l.payload,null,2),className:"text-[11px] font-mono whitespace-pre-wrap break-words"})})]},u)})})}function _t({title:e,copyText:t,trailing:n,children:r}){const[i,s]=_.useState(!1),o=_.useCallback(()=>{t&&navigator.clipboard.writeText(t).then(()=>{s(!0),setTimeout(()=>s(!1),1500)})},[t]);return a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:e}),n,t&&a.jsx("button",{onClick:o,className:`${n?"":"ml-auto "}text-[10px] cursor-pointer px-1.5 py-0.5 rounded transition-colors`,style:{color:i?"var(--success)":"var(--text-muted)",background:"var(--bg-tertiary)",border:"none"},onMouseEnter:l=>{i||(l.currentTarget.style.color="var(--text-primary)")},onMouseLeave:l=>{l.currentTarget.style.color=i?"var(--success)":"var(--text-muted)"},children:i?"Copied":"Copy"})]}),r]})}function Xi({runId:e,status:t,ws:n,breakpointNode:r}){const i=t==="suspended",s=o=>{const l=ve.getState().breakpoints[e]??{};n.setBreakpoints(e,Object.keys(l)),o==="step"?n.debugStep(e):o==="continue"?n.debugContinue(e):n.debugStop(e)};return a.jsxs("div",{className:"flex items-center gap-1 px-4 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[11px] font-semibold mr-1",style:{color:"var(--text-muted)"},children:"Debug"}),a.jsx(pr,{label:"Step",onClick:()=>s("step"),disabled:!i,color:"var(--info)",active:i}),a.jsx(pr,{label:"Continue",onClick:()=>s("continue"),disabled:!i,color:"var(--success)",active:i}),a.jsx(pr,{label:"Stop",onClick:()=>s("stop"),disabled:!i,color:"var(--error)",active:i}),a.jsx("span",{className:"text-[11px] ml-auto truncate",style:{color:i?"var(--accent)":"var(--text-muted)"},children:i?r?`Paused at ${r}`:"Paused":t})]})}function pr({label:e,onClick:t,disabled:n,color:r,active:i}){return a.jsx("button",{onClick:t,disabled:n,className:"px-3 py-1 h-7 text-[11px] font-semibold rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed",style:{color:i?r:"var(--text-muted)",background:i?`color-mix(in srgb, ${r} 10%, transparent)`:"transparent"},onMouseEnter:s=>{n||(s.currentTarget.style.background=`color-mix(in srgb, ${r} 20%, transparent)`)},onMouseLeave:s=>{s.currentTarget.style.background=i?`color-mix(in srgb, ${r} 10%, transparent)`:"transparent"},children:e})}const Zi=_.lazy(()=>Ts(()=>import("./ChatPanel-DWIYYBph.js"),__vite__mapDeps([2,1,3,4]))),du=[],pu=[],fu=[],mu=[];function gu({run:e,ws:t,isMobile:n}){const r=e.mode==="chat",[i,s]=_.useState(280),[o,l]=_.useState(()=>{const M=localStorage.getItem("chatPanelWidth");return M?parseInt(M,10):380}),[u,c]=_.useState("primary"),[d,p]=_.useState(r?"primary":"traces"),m=_.useRef(null),f=_.useRef(null),b=_.useRef(!1),h=ve(M=>M.traces[e.id]||du),v=ve(M=>M.logs[e.id]||pu),y=ve(M=>M.chatMessages[e.id]||fu),x=ve(M=>M.stateEvents[e.id]||mu),C=ve(M=>M.breakpoints[e.id]);_.useEffect(()=>{t.setBreakpoints(e.id,C?Object.keys(C):[])},[e.id]);const O=_.useCallback(M=>{t.setBreakpoints(e.id,M)},[e.id,t]),j=_.useCallback(M=>{M.preventDefault(),b.current=!0;const w="touches"in M?M.touches[0].clientY:M.clientY,k=i,I=U=>{if(!b.current)return;const q=m.current;if(!q)return;const g="touches"in U?U.touches[0].clientY:U.clientY,F=q.clientHeight-100,$=Math.max(80,Math.min(F,k+(g-w)));s($)},W=()=>{b.current=!1,document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",W),document.removeEventListener("touchmove",I),document.removeEventListener("touchend",W),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",I),document.addEventListener("mouseup",W),document.addEventListener("touchmove",I,{passive:!1}),document.addEventListener("touchend",W)},[i]),N=_.useCallback(M=>{M.preventDefault();const w="touches"in M?M.touches[0].clientX:M.clientX,k=o,I=U=>{const q=f.current;if(!q)return;const g="touches"in U?U.touches[0].clientX:U.clientX,F=q.clientWidth-300,$=Math.max(280,Math.min(F,k+(w-g)));l($)},W=()=>{document.removeEventListener("mousemove",I),document.removeEventListener("mouseup",W),document.removeEventListener("touchmove",I),document.removeEventListener("touchend",W),document.body.style.cursor="",document.body.style.userSelect="",localStorage.setItem("chatPanelWidth",String(o))};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",I),document.addEventListener("mouseup",W),document.addEventListener("touchmove",I,{passive:!1}),document.addEventListener("touchend",W)},[o]),B=r?"Chat":"Events",D=r?"var(--accent)":"var(--success)",R=M=>M==="primary"?D:M==="events"?"var(--success)":"var(--accent)",S=ve(M=>M.activeInterrupt[e.id]??null),T=e.status==="running"?a.jsx("span",{className:"ml-auto text-[11px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:r?"Thinking...":"Running..."}):r&&e.status==="suspended"&&S?a.jsx("span",{className:"ml-auto text-[11px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:"Action Required"}):null;if(n){const M=[{id:"traces",label:"Traces",count:h.length},{id:"primary",label:B},...r?[{id:"events",label:"Events",count:x.length}]:[],{id:"io",label:"I/O"},{id:"logs",label:"Logs",count:v.length}];return a.jsxs("div",{className:"flex flex-col h-full",children:[(e.mode==="debug"||e.status==="suspended"&&!S||C&&Object.keys(C).length>0)&&a.jsx(Xi,{runId:e.id,status:e.status,ws:t,breakpointNode:e.breakpoint_node}),a.jsx("div",{className:"shrink-0",style:{height:"40vh"},children:a.jsx(Un,{entrypoint:e.entrypoint,traces:h,runId:e.id,breakpointNode:e.breakpoint_node,breakpointNextNodes:e.breakpoint_next_nodes,onBreakpointChange:O})}),a.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-y shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[M.map(w=>a.jsxs("button",{onClick:()=>p(w.id),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded transition-colors cursor-pointer",style:{color:d===w.id?R(w.id):"var(--text-muted)",background:d===w.id?`color-mix(in srgb, ${R(w.id)} 10%, transparent)`:"transparent"},children:[w.label,w.count!==void 0&&w.count>0&&a.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--text-muted)"},children:w.count})]},w.id)),T]}),a.jsxs("div",{className:"flex-1 overflow-hidden",children:[d==="traces"&&a.jsx(Dr,{traces:h}),d==="primary"&&(r?a.jsx(_.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:a.jsx("span",{className:"text-xs",children:"Loading chat..."})}),children:a.jsx(Zi,{messages:y,runId:e.id,runStatus:e.status,ws:t})}):a.jsx(An,{events:x,runStatus:e.status})),d==="events"&&a.jsx(An,{events:x,runStatus:e.status}),d==="io"&&a.jsx(Ji,{run:e}),d==="logs"&&a.jsx(Vi,{logs:v})]})]})}const L=[{id:"primary",label:B},...r?[{id:"events",label:"Events",count:x.length}]:[],{id:"io",label:"I/O"},{id:"logs",label:"Logs",count:v.length}];return a.jsxs("div",{ref:f,className:"flex h-full",children:[a.jsxs("div",{ref:m,className:"flex flex-col flex-1 min-w-0",children:[(e.mode==="debug"||e.status==="suspended"&&!S||C&&Object.keys(C).length>0)&&a.jsx(Xi,{runId:e.id,status:e.status,ws:t,breakpointNode:e.breakpoint_node}),a.jsx("div",{className:"shrink-0 overflow-hidden",style:{height:i},children:a.jsx(Un,{entrypoint:e.entrypoint,traces:h,runId:e.id,breakpointNode:e.breakpoint_node,breakpointNextNodes:e.breakpoint_next_nodes,onBreakpointChange:O})}),a.jsx("div",{onMouseDown:j,onTouchStart:j,className:"shrink-0 drag-handle-row"}),a.jsx("div",{className:"flex-1 overflow-hidden",children:a.jsx(Dr,{traces:h})})]}),a.jsx("div",{onMouseDown:N,onTouchStart:N,className:"shrink-0 drag-handle-col"}),a.jsxs("div",{className:"shrink-0 flex flex-col",style:{width:o,background:"var(--bg-primary)"},children:[a.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[L.map(M=>a.jsxs("button",{onClick:()=>c(M.id),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded transition-colors cursor-pointer",style:{color:u===M.id?R(M.id):"var(--text-muted)",background:u===M.id?`color-mix(in srgb, ${R(M.id)} 10%, transparent)`:"transparent"},onMouseEnter:w=>{u!==M.id&&(w.currentTarget.style.color="var(--text-primary)")},onMouseLeave:w=>{u!==M.id&&(w.currentTarget.style.color="var(--text-muted)")},children:[M.label,M.count!==void 0&&M.count>0&&a.jsx("span",{className:"ml-1 font-normal",style:{color:"var(--text-muted)"},children:M.count})]},M.id)),T]}),a.jsxs("div",{className:"flex-1 overflow-hidden",children:[u==="primary"&&(r?a.jsx(_.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-full",style:{color:"var(--text-muted)"},children:a.jsx("span",{className:"text-xs",children:"Loading chat..."})}),children:a.jsx(Zi,{messages:y,runId:e.id,runStatus:e.status,ws:t})}):a.jsx(An,{events:x,runStatus:e.status})),u==="events"&&a.jsx(An,{events:x,runStatus:e.status}),u==="io"&&a.jsx(Ji,{run:e}),u==="logs"&&a.jsx(Vi,{logs:v})]})]})]})}function Ji({run:e}){return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx(_t,{title:"Input",copyText:JSON.stringify(e.input_data,null,2),children:a.jsx(ot,{json:JSON.stringify(e.input_data,null,2),className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.output_data&&a.jsx(_t,{title:"Output",copyText:typeof e.output_data=="string"?e.output_data:JSON.stringify(e.output_data,null,2),children:a.jsx(ot,{json:typeof e.output_data=="string"?e.output_data:JSON.stringify(e.output_data,null,2),className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.error&&a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--error) 40%, var(--border))"},children:[a.jsxs("div",{className:"px-3 py-2 text-xs font-semibold flex items-center gap-2",style:{background:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",color:"var(--error)"},children:[a.jsx("span",{children:"Error"}),a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"color-mix(in srgb, var(--error) 20%, var(--bg-secondary))"},children:e.error.code}),a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-mono",style:{background:"color-mix(in srgb, var(--error) 20%, var(--bg-secondary))"},children:e.error.category})]}),a.jsxs("div",{className:"px-3 py-2 text-xs leading-normal",children:[a.jsx("div",{className:"font-semibold mb-2",style:{color:"var(--text-primary)"},children:e.error.title}),a.jsx("pre",{className:"whitespace-pre-wrap font-mono text-[11px] max-w-prose",style:{color:"var(--text-secondary)"},children:e.error.detail})]})]})]})}function Qi(){const{reloadPending:e,setReloadPending:t,setEntrypoints:n}=ve(),[r,i]=_.useState(!1);if(!e)return null;const s=async()=>{i(!0);try{await Ql();const o=await Zr();n(o.map(l=>l.name)),t(!1)}catch(o){console.error("Reload failed:",o)}finally{i(!1)}};return a.jsxs("div",{className:"fixed top-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-3 px-4 py-2 rounded-lg shadow-lg",style:{background:"var(--bg-secondary)",border:"1px solid var(--bg-tertiary)"},children:[a.jsx("span",{className:"text-xs",style:{color:"var(--text-secondary)"},children:"Files changed"}),a.jsx("button",{onClick:s,disabled:r,className:"px-2.5 py-0.5 text-xs font-medium rounded cursor-pointer",style:{background:"var(--accent)",color:"#fff",opacity:r?.6:1},children:r?"Reloading...":"Reload"}),a.jsx("button",{onClick:()=>t(!1),"aria-label":"Dismiss reload prompt",className:"text-xs cursor-pointer px-0.5",style:{color:"var(--text-muted)",background:"none",border:"none"},children:"✕"})]})}let hu=0;const eo=Ot(e=>({toasts:[],addToast:(t,n)=>{const r=String(++hu);e(s=>({toasts:[...s.toasts,{id:r,type:t,message:n}]})),setTimeout(()=>{e(s=>({toasts:s.toasts.filter(o=>o.id!==r)}))},t==="error"?8e3:5e3)},removeToast:t=>{e(n=>({toasts:n.toasts.filter(r=>r.id!==t)}))}})),to={success:{color:"var(--success)",bg:"color-mix(in srgb, var(--success) 10%, var(--bg-elevated))",border:"color-mix(in srgb, var(--success) 30%, var(--border))"},error:{color:"var(--error)",bg:"color-mix(in srgb, var(--error) 10%, var(--bg-elevated))",border:"color-mix(in srgb, var(--error) 30%, var(--border))"},info:{color:"var(--info)",bg:"color-mix(in srgb, var(--info) 10%, var(--bg-elevated))",border:"color-mix(in srgb, var(--info) 30%, var(--border))"}};function no(){const e=eo(n=>n.toasts),t=eo(n=>n.removeToast);return e.length===0?null:a.jsx("div",{className:"fixed bottom-8 right-4 z-[100] flex flex-col gap-2 pointer-events-none",children:e.map(n=>{const r=to[n.type]??to.info;return a.jsxs("div",{className:"pointer-events-auto flex items-center gap-2 px-4 py-2.5 rounded-lg shadow-lg text-xs font-medium max-w-xs animate-[slideIn_0.2s_ease-out]",style:{background:r.bg,border:`1px solid ${r.border}`,color:r.color},children:[a.jsx("span",{className:"flex-1",children:n.message}),a.jsx("button",{onClick:()=>t(n.id),className:"shrink-0 w-5 h-5 flex items-center justify-center rounded cursor-pointer transition-opacity opacity-60 hover:opacity-100",style:{color:r.color,background:"transparent",border:"none"},"aria-label":"Dismiss",children:a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",children:[a.jsx("line",{x1:"1",y1:"1",x2:"9",y2:"9"}),a.jsx("line",{x1:"9",y1:"1",x2:"1",y2:"9"})]})})]},n.id)})})}function bu(e){return e===null?"-":`${Math.round(e*100)}%`}function xu(e){if(e===null)return"var(--text-muted)";const t=e*100;return t>=80?"var(--success)":t>=50?"var(--warning)":"var(--error)"}const ro={pending:{color:"var(--text-muted)",label:"Pending"},running:{color:"var(--info)",label:"Running"},completed:{color:"var(--success)",label:"Completed"},failed:{color:"var(--error)",label:"Failed"}};function io(){const e=Me(l=>l.evalSets),t=Me(l=>l.evalRuns),{evalSetId:n,evalRunId:r,navigate:i}=st(),s=Object.values(e),o=Object.values(t).sort((l,u)=>new Date(u.start_time??0).getTime()-new Date(l.start_time??0).getTime());return a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a.jsx("button",{onClick:()=>i("#/evals/new"),className:"w-[calc(100%-24px)] mx-3 mt-2.5 mb-1 px-3 py-1.5 text-[11px] text-center font-medium rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-secondary)"},onMouseEnter:l=>{l.currentTarget.style.color="var(--text-primary)",l.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:l=>{l.currentTarget.style.color="var(--text-secondary)",l.currentTarget.style.borderColor=""},children:"+ New Eval Set"}),a.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Eval Sets"}),s.map(l=>{const u=n===l.id;return a.jsxs("button",{onClick:()=>i(`#/evals/sets/${l.id}`),className:"w-full text-left px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{background:u?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:u?"var(--text-primary)":"var(--text-secondary)",borderLeft:u?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:c=>{u||(c.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:c=>{u||(c.currentTarget.style.background="transparent")},children:[a.jsx("div",{className:"truncate font-medium",children:l.name}),a.jsxs("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-muted)"},children:[l.eval_count," items · ",l.evaluator_ids.length," evaluator",l.evaluator_ids.length!==1?"s":""]})]},l.id)}),s.length===0&&a.jsx("p",{className:"text-[11px] px-3 py-2",style:{color:"var(--text-muted)"},children:"No eval sets yet"}),a.jsx("div",{className:"px-3 pt-4 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"History"}),o.map(l=>{const u=r===l.id,c=ro[l.status]??ro.pending;return a.jsx("button",{onClick:()=>i(`#/evals/runs/${l.id}`),className:"w-full text-left px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{background:u?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:u?"var(--text-primary)":"var(--text-secondary)",borderLeft:u?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:d=>{u||(d.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:d=>{u||(d.currentTarget.style.background="transparent")},children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:c.color}}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"truncate font-medium",children:l.eval_set_name}),a.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-muted)"},children:l.start_time?new Date(l.start_time).toLocaleString():c.label})]}),a.jsx("span",{className:"font-mono shrink-0",style:{color:xu(l.overall_score)},children:bu(l.overall_score)})]})},l.id)}),o.length===0&&a.jsx("p",{className:"text-[11px] px-3 py-2",style:{color:"var(--text-muted)"},children:"No eval runs yet"})]})}function oo(e,t=60){const n=typeof e=="string"?e:JSON.stringify(e);return!n||n==="null"?"-":n.length>t?n.slice(0,t)+"...":n}function yu({evalSetId:e}){const[t,n]=_.useState(null),[r,i]=_.useState(!0),[s,o]=_.useState(null),[l,u]=_.useState(!1),[c,d]=_.useState("io"),p=Me(g=>g.evaluators),m=Me(g=>g.localEvaluators),f=Me(g=>g.updateEvalSetEvaluators),b=Me(g=>g.incrementEvalSetCount),h=Me(g=>g.upsertEvalRun),{navigate:v}=st(),[y,x]=_.useState(!1),[C,O]=_.useState(new Set),[j,N]=_.useState(!1),B=_.useRef(null),[D,R]=_.useState(()=>{const g=localStorage.getItem("evalSetSidebarWidth");return g?parseInt(g,10):320}),[S,T]=_.useState(!1),L=_.useRef(null);_.useEffect(()=>{localStorage.setItem("evalSetSidebarWidth",String(D))},[D]),_.useEffect(()=>{i(!0),o(null),fc(e).then(g=>{n(g),g.items.length>0&&o(g.items[0].name)}).catch(console.error).finally(()=>i(!1))},[e]);const M=async()=>{u(!0);try{const g=await mc(e);h(g),v(`#/evals/runs/${g.id}`)}catch(g){console.error(g)}finally{u(!1)}},w=async g=>{if(t)try{await pc(e,g),n(F=>{if(!F)return F;const $=F.items.filter(E=>E.name!==g);return{...F,items:$,eval_count:$.length}}),b(e,-1),s===g&&o(null)}catch(F){console.error(F)}},k=_.useCallback(()=>{t&&O(new Set(t.evaluator_ids)),x(!0)},[t]),I=g=>{O(F=>{const $=new Set(F);return $.has(g)?$.delete(g):$.add(g),$})},W=async()=>{if(t){N(!0);try{const g=await bc(e,Array.from(C));n(g),f(e,g.evaluator_ids),x(!1)}catch(g){console.error(g)}finally{N(!1)}}};_.useEffect(()=>{if(!y)return;const g=F=>{B.current&&!B.current.contains(F.target)&&x(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[y]);const U=_.useCallback(g=>{g.preventDefault(),T(!0);const F="touches"in g?g.touches[0].clientX:g.clientX,$=D,E=K=>{const H=L.current;if(!H)return;const re="touches"in K?K.touches[0].clientX:K.clientX,de=H.clientWidth-300,xe=Math.max(280,Math.min(de,$+(F-re)));R(xe)},ie=()=>{T(!1),document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",ie),document.removeEventListener("touchmove",E),document.removeEventListener("touchend",ie),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",E),document.addEventListener("mouseup",ie),document.addEventListener("touchmove",E,{passive:!1}),document.addEventListener("touchend",ie)},[D]);if(r)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-sm",children:"Loading..."});if(!t)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Eval set not found"});const q=t.items.find(g=>g.name===s)??null;return a.jsxs("div",{ref:L,className:"flex h-full",children:[a.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[a.jsxs("div",{className:"px-4 h-10 border-b shrink-0 flex items-center gap-4",style:{borderColor:"var(--border)"},children:[a.jsx("h1",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:t.name}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:[t.eval_count," items"]}),a.jsxs("div",{className:"flex gap-1 items-center ml-auto relative",children:[a.jsx("button",{onClick:k,className:"w-7 h-7 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:g=>{g.currentTarget.style.color="var(--text-primary)",g.currentTarget.style.background="var(--bg-secondary)"},onMouseLeave:g=>{g.currentTarget.style.color="var(--text-muted)",g.currentTarget.style.background="transparent"},title:"Edit evaluators","aria-label":"Edit evaluators",children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"}),a.jsx("path",{d:"m15 5 4 4"})]})}),t.evaluator_ids.map(g=>{const F=p.find($=>$.id===g);return a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[11px] font-medium",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:(F==null?void 0:F.name)??g},g)}),y&&a.jsxs("div",{ref:B,className:"absolute top-full right-0 mt-1 z-50 rounded-md border shadow-lg",style:{background:"var(--bg-primary)",borderColor:"var(--border)",minWidth:220},children:[a.jsx("div",{className:"px-3 py-2 border-b text-[10px] uppercase tracking-wide font-semibold",style:{color:"var(--text-muted)",borderColor:"var(--border)"},children:"Evaluators"}),a.jsx("div",{className:"max-h-48 overflow-y-auto",children:m.length===0?a.jsx("div",{className:"px-3 py-3 text-xs",style:{color:"var(--text-muted)"},children:"No evaluators available"}):m.map(g=>a.jsxs("label",{className:"flex items-center gap-2 px-3 py-1.5 text-xs cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--border)"},onMouseEnter:F=>{F.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:F=>{F.currentTarget.style.background="transparent"},children:[a.jsx("input",{type:"checkbox",checked:C.has(g.id),onChange:()=>I(g.id),className:"accent-[var(--accent)]"}),a.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:g.name})]},g.id))}),a.jsx("div",{className:"px-3 py-2 border-t flex justify-end",style:{borderColor:"var(--border)"},children:a.jsx("button",{onClick:W,disabled:j,className:"px-3 py-1 text-[11px] font-semibold rounded cursor-pointer transition-colors disabled:opacity-50",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},onMouseEnter:g=>{g.currentTarget.style.background="var(--accent-hover)"},onMouseLeave:g=>{g.currentTarget.style.background="var(--accent)"},children:j?"Saving...":"Update"})})]})]}),a.jsxs("button",{onClick:M,disabled:l,className:"ml-2 px-3 py-1 h-7 text-xs font-semibold rounded border flex items-center gap-1.5 cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-not-allowed",style:{color:"var(--success)",borderColor:"var(--success)",background:"transparent"},onMouseEnter:g=>{l||(g.currentTarget.style.background="color-mix(in srgb, var(--success) 10%, transparent)")},onMouseLeave:g=>{g.currentTarget.style.background="transparent"},title:"Run eval set","aria-label":"Run eval set",children:[a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:a.jsx("polygon",{points:"5,3 19,12 5,21"})}),l?"Running...":"Run"]})]}),a.jsxs("div",{className:"flex items-center px-3 h-7 text-[11px] font-semibold shrink-0 border-b",style:{color:"var(--text-muted)",background:"var(--bg-secondary)",borderColor:"var(--border)"},children:[a.jsx("span",{className:"w-56 shrink-0",children:"Name"}),a.jsx("span",{className:"flex-1 min-w-0",children:"Input"}),a.jsx("span",{className:"w-32 shrink-0 pl-2",children:"Expected Behavior"}),a.jsx("span",{className:"w-32 shrink-0 pl-2",children:"Expected Output"}),a.jsx("span",{className:"w-32 shrink-0 pl-2",children:"Simulation Instr."}),a.jsx("span",{className:"w-8 shrink-0"})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[t.items.map(g=>{const F=g.name===s;return a.jsxs("button",{onClick:()=>o(F?null:g.name),className:"group w-full text-left px-3 py-1.5 flex items-center text-xs border-b transition-colors cursor-pointer",style:{borderColor:"var(--border)",background:F?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:F?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:$=>{F||($.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:$=>{F||($.currentTarget.style.background="")},children:[a.jsx("span",{className:"w-56 shrink-0 truncate",style:{color:"var(--text-primary)"},children:g.name}),a.jsx("span",{className:"flex-1 min-w-0 truncate font-mono text-[11px]",style:{color:"var(--text-muted)"},children:oo(g.inputs)}),a.jsx("span",{className:"w-32 shrink-0 truncate pl-2 text-[11px]",style:{color:"var(--text-muted)"},children:g.expected_behavior||"-"}),a.jsx("span",{className:"w-32 shrink-0 truncate pl-2 font-mono text-[11px]",style:{color:"var(--text-muted)"},children:oo(g.expected_output,40)}),a.jsx("span",{className:"w-32 shrink-0 truncate pl-2 text-[11px]",style:{color:"var(--text-muted)"},children:g.simulation_instructions||"-"}),a.jsx("span",{role:"button",tabIndex:0,className:"w-8 shrink-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",onClick:$=>{$.stopPropagation(),w(g.name)},onKeyDown:$=>{$.key==="Enter"&&($.stopPropagation(),w(g.name))},style:{color:"var(--text-muted)"},onMouseEnter:$=>{$.currentTarget.style.color="var(--error)"},onMouseLeave:$=>{$.currentTarget.style.color="var(--text-muted)"},title:"Delete item",children:a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},g.name)}),t.items.length===0&&a.jsx("div",{className:"flex items-center justify-center py-8 text-[var(--text-muted)] text-xs",children:"No items in this eval set"})]})]}),a.jsx("div",{onMouseDown:U,onTouchStart:U,className:`shrink-0 drag-handle-col${S?"":" transition-all"}`,style:{width:q?3:0,opacity:q?1:0}}),a.jsxs("div",{className:`shrink-0 flex flex-col overflow-hidden${S?"":" transition-[width] duration-200 ease-in-out"}`,style:{width:q?D:0,background:"var(--bg-primary)"},children:[a.jsx("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",minWidth:D},children:["io","evaluators"].map(g=>{const F=c===g,$=g==="io"?"I/O":"Evaluators";return a.jsx("button",{onClick:()=>d(g),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded inline-flex items-center cursor-pointer transition-colors",style:{color:F?"var(--accent)":"var(--text-muted)",background:F?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent",border:"none"},children:$},g)})}),a.jsx("div",{className:"flex-1 overflow-hidden",style:{minWidth:D},children:q?c==="io"?a.jsx(vu,{item:q}):a.jsx(ku,{item:q,evaluators:p}):null})]})]})}function vu({item:e}){const t=JSON.stringify(e.inputs,null,2),n=e.expected_output!=null?typeof e.expected_output=="string"?e.expected_output:JSON.stringify(e.expected_output,null,2):null;return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx(_t,{title:"Input",copyText:t,children:a.jsx(ot,{json:t,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.expected_behavior&&a.jsx(_t,{title:"Expected Behavior",copyText:e.expected_behavior,children:a.jsx("div",{className:"px-3 py-2 text-xs leading-relaxed whitespace-pre-wrap",style:{color:"var(--text-secondary)"},children:e.expected_behavior})}),n&&a.jsx(_t,{title:"Expected Output",copyText:n,children:a.jsx(ot,{json:n,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),e.simulation_instructions&&a.jsx(_t,{title:"Simulation Instructions",copyText:e.simulation_instructions,children:a.jsx("div",{className:"px-3 py-2 text-xs leading-relaxed whitespace-pre-wrap",style:{color:"var(--text-secondary)"},children:e.simulation_instructions})})]})}function ku({item:e,evaluators:t}){return a.jsx("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:e.evaluator_ids.length>0?a.jsx(a.Fragment,{children:e.evaluator_ids.map(n=>{var s;const r=t.find(o=>o.id===n),i=(s=e.evaluation_criterias)==null?void 0:s[n];return a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:(r==null?void 0:r.name)??n}),a.jsx("span",{className:"ml-auto text-[10px]",style:{color:"var(--text-muted)"},children:i?"Custom criteria":"Default criteria"})]}),i&&a.jsx("pre",{className:"px-3 py-2 border-t text-[11px] font-mono overflow-x-auto max-h-32 whitespace-pre-wrap break-words",style:{borderColor:"var(--border)",color:"var(--text-secondary)"},children:JSON.stringify(i,null,2)})]},n)})}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:"No evaluators configured for this item"})})}function en(e){return e===null?"-":`${Math.round(e*100)}%`}function wt(e){if(e===null)return"var(--text-muted)";const t=e*100;return t>=80?"var(--success)":t>=50?"var(--warning)":"var(--error)"}function Eu(e,t){if(!e)return"-";const n=new Date(e).getTime(),r=t?new Date(t).getTime():Date.now(),i=Math.round((r-n)/1e3);return i<60?`${i}s`:`${Math.floor(i/60)}m ${i%60}s`}function so(e){return e.replace(/\s*Evaluator$/i,"")}const ao={pending:{color:"var(--text-muted)",bg:"var(--bg-tertiary)",label:"Pending"},running:{color:"var(--info)",bg:"rgba(59,130,246,0.1)",label:"Running"},completed:{color:"var(--success)",bg:"rgba(34,197,94,0.1)",label:"Completed"},failed:{color:"var(--error)",bg:"rgba(239,68,68,0.1)",label:"Failed"}};function wu({evalRunId:e,itemName:t}){const[n,r]=_.useState(null),[i,s]=_.useState(!0),{navigate:o}=st(),l=t??null,[u,c]=_.useState(220),d=_.useRef(null),p=_.useRef(!1),[m,f]=_.useState(()=>{const T=localStorage.getItem("evalSidebarWidth");return T?parseInt(T,10):320}),[b,h]=_.useState(!1),v=_.useRef(null);_.useEffect(()=>{localStorage.setItem("evalSidebarWidth",String(m))},[m]);const y=Me(T=>T.evalRuns[e]),x=Me(T=>T.evaluators);_.useEffect(()=>{s(!0),ji(e).then(T=>{if(r(T),!t){const L=T.results.find(M=>M.status==="completed")??T.results[0];L&&o(`#/evals/runs/${e}/${encodeURIComponent(L.name)}`)}}).catch(console.error).finally(()=>s(!1))},[e]),_.useEffect(()=>{((y==null?void 0:y.status)==="completed"||(y==null?void 0:y.status)==="failed")&&ji(e).then(r).catch(console.error)},[y==null?void 0:y.status,e]),_.useEffect(()=>{if(t||!(n!=null&&n.results))return;const T=n.results.find(L=>L.status==="completed")??n.results[0];T&&o(`#/evals/runs/${e}/${encodeURIComponent(T.name)}`)},[n==null?void 0:n.results]);const C=_.useCallback(T=>{T.preventDefault(),p.current=!0;const L="touches"in T?T.touches[0].clientY:T.clientY,M=u,w=I=>{if(!p.current)return;const W=d.current;if(!W)return;const U="touches"in I?I.touches[0].clientY:I.clientY,q=W.clientHeight-100,g=Math.max(80,Math.min(q,M+(U-L)));c(g)},k=()=>{p.current=!1,document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",w),document.removeEventListener("touchend",k),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="row-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",w),document.addEventListener("mouseup",k),document.addEventListener("touchmove",w,{passive:!1}),document.addEventListener("touchend",k)},[u]),O=_.useCallback(T=>{T.preventDefault(),h(!0);const L="touches"in T?T.touches[0].clientX:T.clientX,M=m,w=I=>{const W=v.current;if(!W)return;const U="touches"in I?I.touches[0].clientX:I.clientX,q=W.clientWidth-300,g=Math.max(280,Math.min(q,M+(L-U)));f(g)},k=()=>{h(!1),document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",w),document.removeEventListener("touchend",k),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",w),document.addEventListener("mouseup",k),document.addEventListener("touchmove",w,{passive:!1}),document.addEventListener("touchend",k)},[m]);if(i)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-sm",children:"Loading..."});if(!n)return a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Eval run not found"});const j=y??n,N=ao[j.status]??ao.pending,B=j.status==="running",D=Object.keys(j.evaluator_scores??{}),R=n.results.find(T=>T.name===l)??null,S=((R==null?void 0:R.traces)??[]).map(T=>({...T,run_id:""}));return a.jsxs("div",{ref:v,className:"flex h-full",children:[a.jsxs("div",{ref:d,className:"flex flex-col flex-1 min-w-0",children:[a.jsxs("div",{className:"px-4 h-10 border-b shrink-0 flex items-center gap-4",style:{borderColor:"var(--border)"},children:[a.jsx("h1",{className:"text-base font-semibold truncate min-w-0",style:{color:"var(--text-primary)"},children:j.eval_set_name}),a.jsx("span",{className:"px-2 py-0.5 rounded text-[11px] font-semibold uppercase tracking-wide",style:{color:N.color,background:N.bg},children:N.label}),a.jsx("span",{className:"text-sm font-bold font-mono",style:{color:wt(j.overall_score)},children:en(j.overall_score)}),a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:Eu(j.start_time,j.end_time)}),B&&a.jsxs("div",{className:"flex items-center gap-2 max-w-[160px]",children:[a.jsx("div",{className:"flex-1 h-2 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${j.progress_total>0?j.progress_completed/j.progress_total*100:0}%`,background:"var(--info)"}})}),a.jsxs("span",{className:"text-[11px] shrink-0",style:{color:"var(--text-muted)"},children:[j.progress_completed,"/",j.progress_total]})]}),D.length>0&&a.jsx("div",{className:"flex gap-3 ml-auto",children:D.map(T=>{const L=x.find(w=>w.id===T),M=j.evaluator_scores[T];return a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:so((L==null?void 0:L.name)??T)}),a.jsx("div",{className:"w-12 h-2 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${M*100}%`,background:wt(M)}})}),a.jsx("span",{className:"text-[11px] font-mono",style:{color:wt(M)},children:en(M)})]},T)})})]}),a.jsxs("div",{className:"shrink-0 overflow-hidden flex flex-col",style:{height:u},children:[a.jsxs("div",{className:"flex items-center px-3 h-7 text-[11px] font-semibold shrink-0 border-b",style:{color:"var(--text-muted)",background:"var(--bg-secondary)",borderColor:"var(--border)"},children:[a.jsx("span",{className:"w-5 shrink-0"}),a.jsx("span",{className:"flex-1 min-w-0",children:"Name"}),a.jsx("span",{className:"w-14 shrink-0 text-right",children:"Score"}),D.map(T=>{const L=x.find(M=>M.id===T);return a.jsx("span",{className:"w-36 shrink-0 text-right truncate pl-2",title:(L==null?void 0:L.name)??T,children:so((L==null?void 0:L.name)??T)},T)}),a.jsx("span",{className:"w-14 shrink-0 text-right",children:"Time"})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[n.results.map(T=>{const L=T.status==="pending",M=T.status==="failed",w=T.name===l;return a.jsxs("button",{onClick:()=>{o(w?`#/evals/runs/${e}`:`#/evals/runs/${e}/${encodeURIComponent(T.name)}`)},className:"w-full text-left px-3 py-1.5 flex items-center text-xs border-b transition-colors cursor-pointer",style:{borderColor:"var(--border)",background:w?"color-mix(in srgb, var(--accent) 10%, var(--bg-primary))":void 0,borderLeft:w?"2px solid var(--accent)":"2px solid transparent",opacity:L?.5:1},onMouseEnter:k=>{w||(k.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:k=>{w||(k.currentTarget.style.background="")},children:[a.jsx("span",{className:"w-5 shrink-0 flex justify-center",children:a.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:L?"var(--text-muted)":M?"var(--error)":T.overall_score>=.8?"var(--success)":T.overall_score>=.5?"var(--warning)":"var(--error)"}})}),a.jsx("span",{className:"flex-1 min-w-0 truncate",style:{color:"var(--text-primary)"},children:T.name}),a.jsx("span",{className:"w-14 shrink-0 text-right font-mono font-semibold",style:{color:wt(L?null:T.overall_score)},children:L?"-":en(T.overall_score)}),D.map(k=>a.jsx("span",{className:"w-36 shrink-0 text-right font-mono pl-2",style:{color:wt(L?null:T.scores[k]??null)},children:L?"-":en(T.scores[k]??null)},k)),a.jsx("span",{className:"w-14 shrink-0 text-right",style:{color:"var(--text-muted)"},children:T.duration_ms!==null?`${(T.duration_ms/1e3).toFixed(1)}s`:"-"})]},T.name)}),n.results.length===0&&a.jsx("div",{className:"flex items-center justify-center py-8 text-[var(--text-muted)] text-xs",children:B?"Waiting for results...":"No results"})]})]}),a.jsx("div",{onMouseDown:C,onTouchStart:C,className:"shrink-0 drag-handle-row"}),a.jsx("div",{className:"flex-1 overflow-hidden",children:R&&S.length>0?a.jsx(Dr,{traces:S}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:(R==null?void 0:R.status)==="pending"?"Pending...":"No traces available"})})]}),a.jsx("div",{onMouseDown:O,onTouchStart:O,className:`shrink-0 drag-handle-col${b?"":" transition-all"}`,style:{width:R?3:0,opacity:R?1:0}}),a.jsx(Nu,{width:m,item:R,evaluators:x,isRunning:B,isDragging:b})]})}const _u=[{id:"score",label:"Score"},{id:"io",label:"I/O"},{id:"logs",label:"Logs"}];function Nu({width:e,item:t,evaluators:n,isRunning:r,isDragging:i}){const[s,o]=_.useState("score"),l=!!t;return a.jsxs("div",{className:`shrink-0 flex flex-col overflow-hidden${i?"":" transition-[width] duration-200 ease-in-out"}`,style:{width:l?e:0,background:"var(--bg-primary)"},children:[a.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",minWidth:e},children:[_u.map(u=>a.jsx("button",{onClick:()=>o(u.id),className:"px-2.5 py-1 h-7 text-xs font-semibold rounded transition-colors cursor-pointer",style:{color:s===u.id?"var(--accent)":"var(--text-muted)",background:s===u.id?"color-mix(in srgb, var(--accent) 10%, transparent)":"transparent",border:"none"},onMouseEnter:c=>{s!==u.id&&(c.currentTarget.style.color="var(--text-primary)")},onMouseLeave:c=>{s!==u.id&&(c.currentTarget.style.color="var(--text-muted)")},children:u.label},u.id)),r&&a.jsx("span",{className:"ml-auto text-[11px] px-2 py-0.5 rounded-full shrink-0",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--warning)"},children:"Running..."})]}),a.jsx("div",{className:"flex-1 overflow-y-auto",style:{minWidth:e},children:t?t.status==="pending"?a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:"Pending..."}):a.jsxs(a.Fragment,{children:[t.status==="failed"&&a.jsxs("div",{className:"mx-2 mt-2 px-3 py-2 rounded text-xs",style:{background:"rgba(239,68,68,0.1)",color:"var(--error)"},children:[a.jsxs("div",{className:"flex items-center gap-2 font-semibold",children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:[a.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.5"}),a.jsx("path",{d:"M8 4.5v4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),a.jsx("circle",{cx:"8",cy:"11",r:"0.75",fill:"currentColor"})]}),a.jsx("span",{children:"Evaluator error"})]}),t.error&&a.jsx("div",{className:"mt-1 pl-[22px] text-[11px] opacity-80 break-words",style:{color:"var(--text-secondary)"},children:t.error})]}),s==="score"?a.jsx(Su,{item:t,evaluators:n}):s==="io"?a.jsx(Tu,{item:t}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:"Logs coming soon"})]}):null})]})}function Su({item:e,evaluators:t}){const n=Object.keys(e.scores);return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"truncate text-[11px] font-semibold",style:{color:"var(--text-primary)"},children:"Overall"}),a.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[a.jsx("div",{className:"w-24 h-2.5 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${e.overall_score*100}%`,background:wt(e.overall_score)}})}),a.jsx("span",{className:"text-xs font-mono font-bold shrink-0 w-10 text-right",style:{color:wt(e.overall_score)},children:en(e.overall_score)})]})]})}),e.status==="failed"&&n.length===0&&a.jsx("div",{className:"px-3 py-3 text-xs text-center",style:{color:"var(--text-muted)"},children:"All evaluators failed — no scores available"}),n.map(r=>{const i=t.find(l=>l.id===r),s=e.scores[r],o=e.justifications[r];return a.jsxs("div",{className:"overflow-hidden",style:{border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("span",{className:"truncate text-[11px] font-semibold",style:{color:"var(--text-primary)"},title:(i==null?void 0:i.name)??r,children:(i==null?void 0:i.name)??r}),a.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[a.jsx("div",{className:"w-24 h-2.5 rounded-full overflow-hidden",style:{background:"var(--bg-tertiary)"},children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${s*100}%`,background:wt(s)}})}),a.jsx("span",{className:"text-xs font-mono font-bold shrink-0 w-10 text-right",style:{color:wt(s)},children:en(s)})]})]}),o&&a.jsx(Au,{text:o})]},r)})]})}function Tu({item:e}){const t=JSON.stringify(e.inputs,null,2),n=typeof e.output=="string"?e.output:JSON.stringify(e.output,null,2),r=e.expected_output!=null?typeof e.expected_output=="string"?e.expected_output:JSON.stringify(e.expected_output,null,2):null;return a.jsxs("div",{className:"p-2 overflow-y-auto h-full space-y-1.5",children:[a.jsx(_t,{title:"Input",copyText:t,children:a.jsx(ot,{json:t,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),r&&a.jsx(_t,{title:"Expected Output",copyText:r,children:a.jsx(ot,{json:r,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})}),a.jsx(_t,{title:"Output",copyText:n,trailing:e.duration_ms!==null?a.jsxs("span",{className:"ml-auto text-[10px]",style:{color:"var(--text-muted)"},children:[(e.duration_ms/1e3).toFixed(2),"s"]}):void 0,children:a.jsx(ot,{json:n,className:"px-3 py-2 text-xs font-mono whitespace-pre-wrap break-words"})})]})}function Cu(e){var i;const t=e.match(/expected="(.+?)"\s+actual="(.+?)"(.*)/s);if(!t)return null;const n={},r=((i=t[3])==null?void 0:i.trim())??"";if(r)for(const s of r.match(/(\w+)=([\S]+)/g)??[]){const o=s.indexOf("=");n[s.slice(0,o)]=s.slice(o+1)}return{expected:t[1],actual:t[2],meta:n}}function lo(e){try{const t=e.replace(/'/g,'"').replace(/\bTrue\b/g,"true").replace(/\bFalse\b/g,"false").replace(/\bNone\b/g,"null"),n=JSON.parse(t);return JSON.stringify(n,null,2)}catch{return e}}function Au({text:e}){const t=Cu(e);if(!t)return a.jsx("div",{className:"px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:a.jsx("div",{className:"text-xs leading-relaxed",style:{color:"var(--text-secondary)"},children:e})});const n=lo(t.expected),r=lo(t.actual),i=n===r;return a.jsxs("div",{className:"border-t",style:{borderColor:"var(--border)"},children:[a.jsxs("div",{className:"grid grid-cols-2 gap-0",children:[a.jsxs("div",{className:"px-3 py-2 border-r",style:{borderColor:"var(--border)"},children:[a.jsx("div",{className:"text-[10px] font-semibold mb-1",style:{color:"var(--text-muted)"},children:"Expected"}),a.jsx("pre",{className:"text-[11px] font-mono whitespace-pre-wrap break-words",style:{color:"var(--text-secondary)"},children:n})]}),a.jsxs("div",{className:"px-3 py-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[a.jsx("span",{className:"text-[10px] font-semibold",style:{color:"var(--text-muted)"},children:"Actual"}),a.jsx("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:i?"var(--success)":"var(--error)"}})]}),a.jsx("pre",{className:"text-[11px] font-mono whitespace-pre-wrap break-words",style:{color:i?"var(--success)":"var(--error)"},children:r})]})]}),Object.keys(t.meta).length>0&&a.jsx("div",{className:"px-3 py-1.5 border-t flex items-center gap-3",style:{borderColor:"var(--border)"},children:Object.entries(t.meta).map(([s,o])=>a.jsxs("span",{className:"text-[10px]",style:{color:"var(--text-muted)"},children:[a.jsx("span",{className:"font-medium",children:s.replace(/_/g," ")})," ",a.jsx("span",{className:"font-mono",children:o})]},s))})]})}const co={deterministic:"var(--success)",llm:"#a78bfa",tool:"var(--info)"};function uo(){const e=Me(f=>f.localEvaluators),t=Me(f=>f.addEvalSet),{navigate:n}=st(),[r,i]=_.useState(""),[s,o]=_.useState(new Set),[l,u]=_.useState(null),[c,d]=_.useState(!1),p=f=>{o(b=>{const h=new Set(b);return h.has(f)?h.delete(f):h.add(f),h})},m=async()=>{if(r.trim()){u(null),d(!0);try{const f=await uc({name:r.trim(),evaluator_refs:Array.from(s)});t(f),n(`#/evals/sets/${f.id}`)}catch(f){u(f.detail||f.message||"Failed to create eval set")}finally{d(!1)}}};return a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"w-full max-w-xl px-6",children:[a.jsxs("div",{className:"mb-8 text-center",children:[a.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}}),a.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"New Eval Set"})]}),a.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"Create an evaluation set with a name and evaluators"})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Name"}),a.jsx("input",{type:"text",value:r,onChange:f=>i(f.target.value),placeholder:"e.g. Basic QA Tests",className:"w-full rounded-md px-3 py-2 text-xs",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},onKeyDown:f=>{f.key==="Enter"&&r.trim()&&m()}})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Evaluators"}),e.length===0?a.jsxs("p",{className:"text-xs",style:{color:"var(--text-muted)"},children:["No evaluators configured."," ",a.jsx("button",{onClick:()=>n("#/evaluators/new"),className:"underline cursor-pointer",style:{color:"var(--accent)",background:"none",border:"none",padding:0,font:"inherit"},children:"Create one first"})]}):a.jsx("div",{className:"rounded-md border overflow-hidden",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:e.map(f=>a.jsxs("label",{className:"flex items-center gap-2.5 px-3 py-2 text-xs cursor-pointer transition-colors",style:{borderBottom:"1px solid var(--border)"},onMouseEnter:b=>{b.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:b=>{b.currentTarget.style.background="transparent"},children:[a.jsx("input",{type:"checkbox",checked:s.has(f.id),onChange:()=>p(f.id),className:"accent-[var(--accent)]"}),a.jsx("span",{className:"flex-1 truncate",style:{color:"var(--text-primary)"},children:f.name}),a.jsx("span",{className:"text-[11px] font-medium px-1.5 py-0.5 rounded",style:{background:`color-mix(in srgb, ${co[f.type]??"var(--text-muted)"} 15%, transparent)`,color:co[f.type]??"var(--text-muted)"},children:f.type})]},f.id))})]}),l&&a.jsx("p",{className:"text-xs mb-4 px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:l}),a.jsx("button",{onClick:m,disabled:!r.trim()||c,className:"w-full py-2 rounded-md text-[13px] font-semibold transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},children:c?"Creating...":"Create Eval Set"})]})})}const Mu=[{type:"deterministic",label:"Deterministic",badgeColor:"var(--success)"},{type:"llm",label:"LLM Judge",badgeColor:"#a78bfa"},{type:"tool",label:"Tool-Based",badgeColor:"var(--info)"}];function po(){const e=Me(s=>s.localEvaluators),{evaluatorFilter:t,evaluatorCreateType:n,navigate:r}=st(),i=!t&&!n;return a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:()=>r("#/evaluators/new"),className:"mx-3 mt-2.5 mb-1 px-3 py-1.5 text-[11px] font-medium rounded border border-[var(--border)] bg-transparent transition-colors cursor-pointer",style:{color:"var(--text-secondary)"},onMouseEnter:s=>{s.currentTarget.style.color="var(--text-primary)",s.currentTarget.style.borderColor="var(--text-muted)"},onMouseLeave:s=>{s.currentTarget.style.color="var(--text-secondary)",s.currentTarget.style.borderColor=""},children:"+ New Evaluator"}),a.jsx("div",{className:"px-3 pt-3 pb-1 text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Categories"}),a.jsxs("div",{className:"flex-1 overflow-y-auto",children:[a.jsxs("button",{onClick:()=>r("#/evaluators"),className:"w-full text-left px-3 py-2 text-xs flex items-center gap-2 cursor-pointer transition-colors",style:{background:i?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:i?"var(--text-primary)":"var(--text-secondary)",borderLeft:i?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:s=>{i||(s.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:s=>{i||(s.currentTarget.style.background="transparent")},children:[a.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:"var(--text-muted)"}}),a.jsx("span",{className:"flex-1 truncate",children:"All"}),e.length>0&&a.jsx("span",{className:"text-[10px] px-1.5 rounded-full",style:{background:"var(--bg-tertiary)",color:"var(--text-muted)"},children:e.length})]}),Mu.map(s=>{const o=e.filter(u=>u.type===s.type).length,l=t===s.type;return a.jsxs("button",{onClick:()=>r(l?"#/evaluators":`#/evaluators/category/${s.type}`),className:"w-full text-left px-3 py-2 text-xs flex items-center gap-2 cursor-pointer transition-colors",style:{background:l?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:l?"var(--text-primary)":"var(--text-secondary)",borderLeft:l?"3px solid var(--accent)":"3px solid transparent"},onMouseEnter:u=>{l||(u.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:u=>{l||(u.currentTarget.style.background="transparent")},children:[a.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:s.badgeColor}}),a.jsx("span",{className:"flex-1 truncate",children:s.label}),o>0&&a.jsx("span",{className:"text-[10px] px-1.5 rounded-full",style:{background:"var(--bg-tertiary)",color:"var(--text-muted)"},children:o})]},s.type)})]})]})}const fo={deterministic:{label:"Deterministic",color:"var(--success)",bg:"rgba(34,197,94,0.1)"},llm:{label:"LLM Judge",color:"#a78bfa",bg:"rgba(167,139,250,0.1)"},tool:{label:"Tool-Based",color:"var(--info)",bg:"rgba(59,130,246,0.1)"}},Pr={deterministic:"Deterministic",llm:"LLM Judge",tool:"Tool-Based"},pn={deterministic:[{id:"uipath-exact-match",name:"Exact Match"},{id:"uipath-contains",name:"Contains"},{id:"uipath-json-similarity",name:"JSON Similarity"}],llm:[{id:"uipath-llm-judge-output-semantic-similarity",name:"LLM Judge Output"},{id:"uipath-llm-judge-output-strict-json-similarity",name:"LLM Judge Strict JSON"},{id:"uipath-llm-judge-trajectory-similarity",name:"LLM Judge Trajectory"},{id:"uipath-llm-judge-trajectory-simulation",name:"LLM Judge Trajectory Simulation"}],tool:[{id:"uipath-tool-call-order",name:"Tool Call Order"},{id:"uipath-tool-call-args",name:"Tool Call Args"},{id:"uipath-tool-call-count",name:"Tool Call Count"},{id:"uipath-tool-call-output",name:"Tool Call Output"}]};function Ls(e){return e.includes("trajectory")?{targetOutputKey:!1,prompt:!0}:e.includes("llm-judge")?{targetOutputKey:!0,prompt:!0}:e.includes("tool-call-output")?{targetOutputKey:!0,prompt:!1}:e.includes("exact-match")||e.includes("contains")||e.includes("json-similarity")?{targetOutputKey:!0,prompt:!1}:{targetOutputKey:!1,prompt:!1}}const fr={"uipath-exact-match":{description:"Checks whether the agent output exactly matches the expected output.",prompt:""},"uipath-contains":{description:"Checks whether the agent output contains the expected substring.",prompt:""},"uipath-json-similarity":{description:"Compares JSON structures for semantic similarity, ignoring key ordering and whitespace.",prompt:""},"uipath-llm-judge-output-semantic-similarity":{description:"Uses an LLM to score semantic similarity between the agent's actual output and the expected output, accounting for synonyms, paraphrases, and equivalent expressions.",prompt:`As an expert evaluator, analyze the semantic similarity between the expected and actual outputs and determine a score from 0 to 100. Focus on comparing meaning and contextual equivalence of corresponding fields, accounting for alternative valid expressions, synonyms, and reasonable variations in language while maintaining high standards for accuracy and completeness. Provide your score with a brief justification. ----- -ExpectedOutput: -{{ExpectedOutput}} ----- -ActualOutput: -{{ActualOutput}}`},"uipath-llm-judge-output-strict-json-similarity":{description:"Uses an LLM to perform strict structural and value comparison between JSON outputs, checking key names, nesting, types, and values.",prompt:`As an expert evaluator, perform a strict comparison of the expected and actual JSON outputs and determine a score from 0 to 100. Check that all keys are present, values match in type and content, and nesting structure is preserved. Minor formatting differences (whitespace, key ordering) should not affect the score. Provide your score with a brief justification. ----- -ExpectedOutput: -{{ExpectedOutput}} ----- -ActualOutput: -{{ActualOutput}}`},"uipath-llm-judge-trajectory-similarity":{description:"Uses an LLM to evaluate whether the agent's tool-call trajectory matches the expected sequence of actions, considering order, arguments, and completeness.",prompt:`As an expert evaluator, compare the agent's actual tool-call trajectory against the expected trajectory and determine a score from 0 to 100. Consider the order of tool calls, the correctness of arguments passed, and whether all expected steps were completed. Minor variations in argument formatting are acceptable if semantically equivalent. Provide your score with a brief justification. ----- -ExpectedTrajectory: -{{ExpectedTrajectory}} ----- -ActualTrajectory: -{{ActualTrajectory}}`},"uipath-llm-judge-trajectory-simulation":{description:"Uses an LLM to evaluate the agent's behavior against simulation instructions and expected outcomes by analyzing the full run history.",prompt:`As an expert evaluator, determine how well the agent performed on a scale of 0 to 100. Focus on whether the simulation was successful and whether the agent behaved according to the expected output, accounting for alternative valid expressions and reasonable variations in language while maintaining high standards for accuracy and completeness. Provide your score with a brief justification. ----- -UserOrSyntheticInputGivenToAgent: -{{UserOrSyntheticInput}} ----- -SimulationInstructions: -{{SimulationInstructions}} ----- -ExpectedAgentBehavior: -{{ExpectedAgentBehavior}} ----- -AgentRunHistory: -{{AgentRunHistory}}`},"uipath-tool-call-order":{description:"Validates that the agent called tools in the expected sequence.",prompt:""},"uipath-tool-call-args":{description:"Checks whether the agent called tools with the expected arguments.",prompt:""},"uipath-tool-call-count":{description:"Validates that the agent made the expected number of tool calls.",prompt:""},"uipath-tool-call-output":{description:"Validates the output returned by the agent's tool calls.",prompt:""}};function Iu(e){for(const[t,n]of Object.entries(pn))if(n.some(r=>r.id===e))return t;return"deterministic"}function Ru({evaluatorId:e,evaluatorFilter:t}){const n=Me(x=>x.localEvaluators),r=Me(x=>x.setLocalEvaluators),i=Me(x=>x.upsertLocalEvaluator),s=Me(x=>x.evaluators),{navigate:o}=st(),l=e?n.find(x=>x.id===e)??null:null,u=!!l,c=t?n.filter(x=>x.type===t):n,[d,p]=_.useState(()=>{const x=localStorage.getItem("evaluatorSidebarWidth");return x?parseInt(x,10):320}),[m,f]=_.useState(!1),b=_.useRef(null);_.useEffect(()=>{localStorage.setItem("evaluatorSidebarWidth",String(d))},[d]),_.useEffect(()=>{ei().then(r).catch(console.error)},[r]);const h=_.useCallback(x=>{x.preventDefault(),f(!0);const C="touches"in x?x.touches[0].clientX:x.clientX,O=d,j=B=>{const D=b.current;if(!D)return;const R="touches"in B?B.touches[0].clientX:B.clientX,S=D.clientWidth-300,T=Math.max(280,Math.min(S,O+(C-R)));p(T)},N=()=>{f(!1),document.removeEventListener("mousemove",j),document.removeEventListener("mouseup",N),document.removeEventListener("touchmove",j),document.removeEventListener("touchend",N),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",j),document.addEventListener("mouseup",N),document.addEventListener("touchmove",j,{passive:!1}),document.addEventListener("touchend",N)},[d]),v=x=>{i(x)},y=()=>{o("#/evaluators")};return a.jsxs("div",{ref:b,className:"flex h-full",children:[a.jsxs("div",{className:"flex flex-col flex-1 min-w-0",children:[a.jsxs("div",{className:"px-4 h-10 border-b shrink-0 flex items-center gap-4",style:{borderColor:"var(--border)"},children:[a.jsx("h1",{className:"text-base font-semibold",style:{color:"var(--text-primary)"},children:"Evaluators"}),a.jsxs("span",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:[c.length,t?` / ${n.length}`:""," configured"]})]}),a.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:c.length===0?a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)] text-xs",children:n.length===0?"No evaluators configured yet.":"No evaluators in this category."}):a.jsx("div",{className:"grid gap-3",style:{gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))"},children:c.map(x=>a.jsx(Ou,{evaluator:x,evaluators:s,selected:x.id===e,onClick:()=>o(x.id===e?"#/evaluators":`#/evaluators/${encodeURIComponent(x.id)}`)},x.id))})})]}),a.jsx("div",{onMouseDown:h,onTouchStart:h,className:`shrink-0 drag-handle-col${m?"":" transition-all"}`,style:{width:u?3:0,opacity:u?1:0}}),a.jsxs("div",{className:`shrink-0 flex flex-col overflow-hidden${m?"":" transition-[width] duration-200 ease-in-out"}`,style:{width:u?d:0,background:"var(--bg-primary)"},children:[a.jsxs("div",{className:"flex items-center gap-1 px-2 h-10 border-b shrink-0",style:{borderColor:"var(--border)",background:"var(--bg-secondary)",minWidth:d},children:[a.jsx("span",{className:"px-2 py-0.5 h-7 text-xs font-semibold rounded inline-flex items-center",style:{color:"var(--accent)",background:"color-mix(in srgb, var(--accent) 10%, transparent)"},children:"Edit Evaluator"}),a.jsx("button",{onClick:y,"aria-label":"Close editor",className:"ml-auto w-7 h-7 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},onMouseEnter:x=>{x.currentTarget.style.color="var(--text-primary)"},onMouseLeave:x=>{x.currentTarget.style.color="var(--text-muted)"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsx("div",{className:"flex-1 overflow-hidden",style:{minWidth:d},children:l&&a.jsx(Lu,{evaluator:l,onUpdated:v})})]})]})}function Ou({evaluator:e,evaluators:t,selected:n,onClick:r}){const i=fo[e.type]??fo.deterministic,s=t.find(l=>l.id===e.evaluator_type_id),o=e.evaluator_type_id.startsWith("file://");return a.jsxs("div",{className:"rounded-md p-4 flex flex-col cursor-pointer transition-colors",style:{border:n?"1px solid var(--accent)":"1px solid var(--border)",background:n?"color-mix(in srgb, var(--accent) 5%, var(--card-bg))":"var(--card-bg)"},onClick:r,onMouseEnter:l=>{n||(l.currentTarget.style.borderColor="var(--text-muted)")},onMouseLeave:l=>{n||(l.currentTarget.style.borderColor="var(--border)")},children:[a.jsx("div",{className:"text-sm font-semibold",style:{color:"var(--text-primary)"},children:e.name}),e.description&&a.jsx("div",{className:"text-xs leading-relaxed mt-2",style:{color:"var(--text-secondary)"},children:e.description}),a.jsxs("div",{className:"flex flex-wrap gap-1.5 mt-auto pt-3",children:[a.jsxs("span",{className:"px-2 py-0.5 rounded text-[10px] font-medium",style:{color:i.color,background:i.bg},children:["Category: ",i.label]}),a.jsxs("span",{className:"px-2 py-0.5 rounded text-[10px] font-medium",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:["Type: ",o?"Custom":(s==null?void 0:s.name)??e.evaluator_type_id]}),a.jsxs("span",{className:"px-2 py-0.5 rounded text-[10px] font-medium font-mono",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:["Target: ",e.target_output_key||"*"]})]})]})}function Lu({evaluator:e,onUpdated:t}){var j,N;const n=Iu(e.evaluator_type_id),r=pn[n]??[],[i,s]=_.useState(e.description),[o,l]=_.useState(e.evaluator_type_id),[u,c]=_.useState(((j=e.config)==null?void 0:j.targetOutputKey)??"*"),[d,p]=_.useState(((N=e.config)==null?void 0:N.prompt)??""),[m,f]=_.useState(!1),[b,h]=_.useState(null),[v,y]=_.useState(!1);_.useEffect(()=>{var B,D;s(e.description),l(e.evaluator_type_id),c(((B=e.config)==null?void 0:B.targetOutputKey)??"*"),p(((D=e.config)==null?void 0:D.prompt)??""),h(null),y(!1)},[e.id]);const x=Ls(o),C=async()=>{f(!0),h(null),y(!1);try{const B={};x.targetOutputKey&&(B.targetOutputKey=u),x.prompt&&d.trim()&&(B.prompt=d);const D=await xc(e.id,{description:i.trim(),evaluator_type_id:o,config:B});t(D),y(!0),setTimeout(()=>y(!1),2e3)}catch(B){const D=B==null?void 0:B.detail;h(D??"Failed to update evaluator")}finally{f(!1)}},O={background:"var(--bg-secondary)",color:"var(--text-primary)",border:"1px solid var(--border)"};return a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsxs("div",{className:"p-4 overflow-y-auto flex-1 space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Name"}),a.jsx("div",{className:"px-3 py-2 rounded-lg text-xs",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:e.name})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Category"}),a.jsx("div",{className:"px-3 py-2 rounded-lg text-xs",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:Pr[n]??n})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Type"}),a.jsx("select",{value:o,onChange:B=>l(B.target.value),className:"w-full px-3 py-2 rounded-lg text-xs outline-none cursor-pointer",style:O,children:r.map(B=>a.jsx("option",{value:B.id,children:B.name},B.id))})]}),a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Description"}),a.jsx("textarea",{value:i,onChange:B=>s(B.target.value),placeholder:"What does this evaluator check?",rows:4,className:"w-full px-3 py-2 rounded-lg text-xs leading-relaxed outline-none resize-y",style:O})]}),x.targetOutputKey&&a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Target Output Key"}),a.jsx("input",{type:"text",value:u,onChange:B=>c(B.target.value),placeholder:"*",className:"w-full px-3 py-2 rounded-lg text-xs outline-none",style:O}),a.jsx("div",{className:"text-[11px] mt-0.5",style:{color:"var(--text-muted)"},children:"Use * for entire output or a specific key name"})]}),x.prompt&&a.jsxs("div",{children:[a.jsx("label",{className:"text-[11px] font-medium block mb-1",style:{color:"var(--text-muted)"},children:"Prompt"}),a.jsx("textarea",{value:d,onChange:B=>p(B.target.value),placeholder:"Evaluation prompt for the LLM judge...",rows:8,className:"w-full px-3 py-2 rounded-lg text-xs font-mono leading-relaxed outline-none resize-y",style:O})]})]}),a.jsxs("div",{className:"shrink-0 p-4 space-y-2",children:[b&&a.jsx("div",{className:"text-xs px-3 py-2 rounded-lg",style:{background:"rgba(239,68,68,0.1)",color:"var(--error)"},children:b}),v&&a.jsx("div",{className:"text-xs px-3 py-2 rounded-lg",style:{background:"rgba(34,197,94,0.1)",color:"var(--success)"},children:"Saved successfully"}),a.jsx("button",{onClick:C,disabled:m,className:"w-full py-2.5 text-xs font-semibold rounded-md border cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed transition-colors",style:{background:"transparent",borderColor:"var(--accent)",color:"var(--accent)"},onMouseEnter:B=>{B.currentTarget.style.background="color-mix(in srgb, var(--accent) 15%, transparent)"},onMouseLeave:B=>{B.currentTarget.style.background="transparent"},children:m?"Saving...":"Save Changes"})]})]})}const ju=["deterministic","llm","tool"];function Du({category:e}){var w;const t=Me(k=>k.addLocalEvaluator),{navigate:n}=st(),r=e!=="any",[i,s]=_.useState(r?e:"deterministic"),o=pn[i]??[],[l,u]=_.useState(""),[c,d]=_.useState(""),[p,m]=_.useState(((w=o[0])==null?void 0:w.id)??""),[f,b]=_.useState("*"),[h,v]=_.useState(""),[y,x]=_.useState(!1),[C,O]=_.useState(null),[j,N]=_.useState(!1),[B,D]=_.useState(!1);_.useEffect(()=>{var q;const k=r?e:"deterministic";s(k);const W=((q=(pn[k]??[])[0])==null?void 0:q.id)??"",U=fr[W];u(""),d((U==null?void 0:U.description)??""),m(W),b("*"),v((U==null?void 0:U.prompt)??""),O(null),N(!1),D(!1)},[e,r]);const R=k=>{var q;s(k);const W=((q=(pn[k]??[])[0])==null?void 0:q.id)??"",U=fr[W];m(W),j||d((U==null?void 0:U.description)??""),B||v((U==null?void 0:U.prompt)??"")},S=k=>{m(k);const I=fr[k];I&&(j||d(I.description),B||v(I.prompt))},T=Ls(p),L=async()=>{if(!l.trim()){O("Name is required");return}x(!0),O(null);try{const k={};T.targetOutputKey&&(k.targetOutputKey=f),T.prompt&&h.trim()&&(k.prompt=h);const I=await hc({name:l.trim(),description:c.trim(),evaluator_type_id:p,config:k});t(I),n("#/evaluators")}catch(k){const I=k==null?void 0:k.detail;O(I??"Failed to create evaluator")}finally{x(!1)}},M={background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"};return a.jsx("div",{className:"h-full overflow-y-auto",children:a.jsx("div",{className:"flex items-center justify-center min-h-full py-8",children:a.jsxs("div",{className:"w-full max-w-xl px-6",children:[a.jsxs("div",{className:"mb-8 text-center",children:[a.jsxs("div",{className:"flex items-center justify-center gap-2 mb-2",children:[a.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--accent)"}}),a.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--text-muted)"},children:"New Evaluator"})]}),a.jsx("p",{className:"text-sm",style:{color:"var(--text-muted)"},children:"Create an evaluator to score agent outputs"})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Name"}),a.jsx("input",{type:"text",value:l,onChange:k=>u(k.target.value),placeholder:"e.g. MyEvaluator",className:"w-full rounded-md px-3 py-2 text-xs",style:M,onKeyDown:k=>{k.key==="Enter"&&l.trim()&&L()}})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Category"}),r?a.jsx("div",{className:"px-3 py-2 rounded-md text-xs",style:{background:"var(--bg-tertiary)",color:"var(--text-secondary)"},children:Pr[i]??i}):a.jsx("select",{value:i,onChange:k=>R(k.target.value),className:"w-full rounded-md px-3 py-2 text-xs cursor-pointer appearance-auto",style:M,children:ju.map(k=>a.jsx("option",{value:k,children:Pr[k]},k))})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Type"}),a.jsx("select",{value:p,onChange:k=>S(k.target.value),className:"w-full rounded-md px-3 py-2 text-xs cursor-pointer appearance-auto",style:M,children:o.map(k=>a.jsx("option",{value:k.id,children:k.name},k.id))})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Description"}),a.jsx("textarea",{value:c,onChange:k=>{d(k.target.value),N(!0)},placeholder:"What does this evaluator check?",rows:3,className:"w-full rounded-md px-3 py-2 text-xs leading-relaxed resize-y",style:M})]}),T.targetOutputKey&&a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Target Output Key"}),a.jsx("input",{type:"text",value:f,onChange:k=>b(k.target.value),placeholder:"*",className:"w-full rounded-md px-3 py-2 text-xs",style:M}),a.jsx("div",{className:"text-xs mt-1",style:{color:"var(--text-muted)"},children:"Use * for entire output or a specific key name"})]}),T.prompt&&a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-[11px] font-medium mb-1.5",style:{color:"var(--text-muted)"},children:"Prompt"}),a.jsx("textarea",{value:h,onChange:k=>{v(k.target.value),D(!0)},placeholder:"Evaluation prompt for the LLM judge...",rows:6,className:"w-full rounded-md px-3 py-2 text-xs font-mono leading-relaxed resize-y",style:M})]}),C&&a.jsx("p",{className:"text-xs mb-4 px-3 py-2 rounded",style:{color:"var(--error)",background:"color-mix(in srgb, var(--error) 10%, var(--bg-secondary))"},children:C}),a.jsx("button",{onClick:L,disabled:y||!l.trim(),className:"w-full py-2 rounded-md text-[13px] font-semibold transition-colors cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:"var(--accent)",color:"var(--bg-primary)",border:"none"},children:y?"Creating...":"Create Evaluator"})]})})})}function js({path:e,name:t,type:n,depth:r}){const i=be(x=>x.children[e]),s=be(x=>!!x.expanded[e]),o=be(x=>!!x.loadingDirs[e]),l=be(x=>!!x.dirty[e]),u=be(x=>!!x.agentChangedFiles[e]),c=be(x=>x.selectedFile),{setChildren:d,toggleExpanded:p,setLoadingDir:m,openTab:f}=be(),{navigate:b}=st(),h=n==="directory",v=!h&&c===e,y=_.useCallback(()=>{h?(!i&&!o&&(m(e,!0),$n(e).then(x=>d(e,x)).catch(console.error).finally(()=>m(e,!1))),p(e)):(f(e),b(`#/explorer/file/${encodeURIComponent(e)}`))},[h,i,o,e,d,p,m,f,b]);return a.jsxs(a.Fragment,{children:[a.jsxs("button",{onClick:y,className:`w-full text-left flex items-center gap-1 py-[3px] text-[13px] cursor-pointer transition-colors group${u?" agent-changed-file":""}`,style:{paddingLeft:`${12+r*16}px`,paddingRight:"8px",background:v?"color-mix(in srgb, var(--accent) 15%, var(--bg-primary))":"transparent",color:v?"var(--text-primary)":"var(--text-secondary)",border:"none"},onMouseEnter:x=>{v||(x.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:x=>{v||(x.currentTarget.style.background="transparent")},children:[a.jsx("span",{className:"w-3 shrink-0 flex items-center justify-center",style:{color:"var(--text-muted)"},children:h&&a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor",style:{transform:s?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s"},children:a.jsx("path",{d:"M3 1.5L7 5L3 8.5z"})})}),a.jsx("span",{className:"shrink-0",style:{color:h?"var(--accent)":"var(--text-muted)"},children:h?a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})}):a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"})]})}),a.jsx("span",{className:"truncate flex-1",children:t}),l&&a.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{background:"var(--accent)"}}),o&&a.jsx("span",{className:"text-[10px] shrink-0",style:{color:"var(--text-muted)"},children:"..."})]}),h&&s&&i&&i.map(x=>a.jsx(js,{path:x.path,name:x.name,type:x.type,depth:r+1},x.path))]})}function mo(){const e=be(n=>n.children[""]),{setChildren:t}=be();return _.useEffect(()=>{e||$n("").then(n=>t("",n)).catch(console.error)},[e,t]),a.jsx("div",{className:"flex-1 overflow-y-auto py-1",children:e?e.map(n=>a.jsx(js,{path:n.path,name:n.name,type:n.type,depth:0},n.path)):a.jsx("p",{className:"text-[11px] px-3 py-2",style:{color:"var(--text-muted)"},children:"Loading..."})})}const go=e=>{e.editor.defineTheme("uipath-dark",{base:"vs-dark",inherit:!0,rules:[{token:"comment",foreground:"64748b",fontStyle:"italic"},{token:"keyword",foreground:"c084fc"},{token:"string",foreground:"86efac"},{token:"number",foreground:"fcd34d"},{token:"type",foreground:"7dd3fc"}],colors:{"editor.background":"#0f172a","editor.foreground":"#cbd5e1","editor.lineHighlightBackground":"#1e293b","editor.selectionBackground":"#334155","editor.inactiveSelectionBackground":"#263348","editorLineNumber.foreground":"#64748b","editorLineNumber.activeForeground":"#94a3b8","editorCursor.foreground":"#fa4616","editorIndentGuide.background":"#334155","editorIndentGuide.activeBackground":"#64748b","editorWidget.background":"#1e293b","editorWidget.border":"#334155","editorSuggestWidget.background":"#1e293b","editorSuggestWidget.border":"#334155","editorSuggestWidget.selectedBackground":"#263348","editorHoverWidget.background":"#1e293b","editorHoverWidget.border":"#334155","scrollbarSlider.background":"#33415580","scrollbarSlider.hoverBackground":"#33415599","scrollbarSlider.activeBackground":"#334155cc"}}),e.editor.defineTheme("uipath-light",{base:"vs",inherit:!0,rules:[{token:"comment",foreground:"94a3b8",fontStyle:"italic"},{token:"keyword",foreground:"7c3aed"},{token:"string",foreground:"16a34a"},{token:"number",foreground:"d97706"},{token:"type",foreground:"0284c7"}],colors:{"editor.background":"#f8fafc","editor.foreground":"#0f172a","editor.lineHighlightBackground":"#f1f5f9","editor.selectionBackground":"#e2e8f0","editor.inactiveSelectionBackground":"#f1f5f9","editorLineNumber.foreground":"#94a3b8","editorLineNumber.activeForeground":"#475569","editorCursor.foreground":"#fa4616","editorIndentGuide.background":"#e2e8f0","editorIndentGuide.activeBackground":"#94a3b8","editorWidget.background":"#ffffff","editorWidget.border":"#e2e8f0","editorSuggestWidget.background":"#ffffff","editorSuggestWidget.border":"#e2e8f0","editorSuggestWidget.selectedBackground":"#f1f5f9","editorHoverWidget.background":"#ffffff","editorHoverWidget.border":"#e2e8f0","scrollbarSlider.background":"#d1d5db80","scrollbarSlider.hoverBackground":"#d1d5db99","scrollbarSlider.activeBackground":"#d1d5dbcc"}})};function ho(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Pu(e){const t=e.replace(/\\/g,"/").split("/");return t[t.length-1]||e}function Bu(){const e=be(M=>M.openTabs),n=be(M=>M.selectedFile),r=be(M=>n?M.fileCache[n]:void 0),i=be(M=>n?!!M.dirty[n]:!1),s=be(M=>n?M.buffers[n]:void 0),o=be(M=>M.loadingFile),l=be(M=>M.dirty),u=be(M=>M.diffView),c=be(M=>n?!!M.agentChangedFiles[n]:!1),{setFileContent:d,updateBuffer:p,markClean:m,setLoadingFile:f,openTab:b,closeTab:h,setDiffView:v}=be(),{navigate:y}=st(),x=Ss(M=>M.theme),C=_.useRef(null),{explorerFile:O}=st();_.useEffect(()=>{O&&b(O)},[O,b]),_.useEffect(()=>{n&&(be.getState().fileCache[n]||(f(!0),Lr(n).then(M=>d(n,M)).catch(console.error).finally(()=>f(!1))))},[n,d,f]);const j=_.useCallback(()=>{if(!n)return;const M=be.getState().fileCache[n],k=be.getState().buffers[n]??(M==null?void 0:M.content);k!=null&&tc(n,k).then(()=>{m(n),d(n,{...M,content:k})}).catch(console.error)},[n,m,d]);_.useEffect(()=>{const M=w=>{(w.ctrlKey||w.metaKey)&&w.key==="s"&&(w.preventDefault(),j())};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[j]);const N=M=>{C.current=M},B=_.useCallback(M=>{M!==void 0&&n&&p(n,M)},[n,p]),D=_.useCallback(M=>{b(M),y(`#/explorer/file/${encodeURIComponent(M)}`)},[b,y]),R=_.useCallback((M,w)=>{M.stopPropagation();const k=be.getState(),I=k.openTabs.filter(W=>W!==w);if(h(w),k.selectedFile===w){const W=k.openTabs.indexOf(w),U=I[Math.min(W,I.length-1)];y(U?`#/explorer/file/${encodeURIComponent(U)}`:"#/explorer")}},[h,y]),S=_.useCallback((M,w)=>{M.button===1&&R(M,w)},[R]),T=e.length>0&&a.jsx("div",{className:"h-10 flex items-end overflow-x-auto shrink-0",style:{background:"var(--bg-secondary)",borderBottom:"1px solid var(--border)"},children:e.map(M=>{const w=M===n,k=!!l[M];return a.jsxs("button",{onClick:()=>D(M),onMouseDown:I=>S(I,M),className:"h-full flex items-center gap-1.5 px-3 text-[12px] shrink-0 cursor-pointer transition-colors relative",style:{background:w?"var(--bg-primary)":"transparent",color:w?"var(--text-primary)":"var(--text-secondary)",border:"none",borderBottom:w?"2px solid var(--accent)":"2px solid transparent",maxWidth:"180px"},onMouseEnter:I=>{w||(I.currentTarget.style.background="var(--bg-hover)")},onMouseLeave:I=>{w||(I.currentTarget.style.background="transparent")},children:[a.jsx("span",{className:"truncate",children:Pu(M)}),k?a.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{background:"var(--accent)"},title:"Unsaved changes"}):a.jsx("span",{className:"w-4 h-4 flex items-center justify-center rounded shrink-0 transition-colors",style:{color:"var(--text-muted)"},onClick:I=>R(I,M),onMouseEnter:I=>{I.currentTarget.style.background="var(--bg-hover)",I.currentTarget.style.color="var(--text-primary)"},onMouseLeave:I=>{I.currentTarget.style.background="transparent",I.currentTarget.style.color="var(--text-muted)"},children:a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 16 16",fill:"currentColor",children:a.jsx("path",{d:"M8 8.707l3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.708.708L7.293 8l-3.647 3.646.708.708L8 8.707z"})})})]},M)})});if(!n)return a.jsxs("div",{className:"flex flex-col h-full",children:[T,a.jsx("div",{className:"flex-1 flex items-center justify-center",style:{color:"var(--text-muted)"},children:"Select a file to view"})]});if(o&&!r)return a.jsxs("div",{className:"flex flex-col h-full",children:[T,a.jsx("div",{className:"flex-1 flex items-center justify-center",style:{color:"var(--text-muted)"},children:a.jsx("div",{className:"text-sm",children:"Loading file..."})})]});if(!r&&!o)return a.jsxs("div",{className:"flex flex-col h-full",children:[T,a.jsx("div",{className:"flex-1 flex items-center justify-center",style:{color:"var(--text-muted)"},children:a.jsx("div",{className:"text-sm",children:"Failed to load file"})})]});if(!r)return null;if(r.binary)return a.jsxs("div",{className:"flex flex-col h-full",children:[T,a.jsx("div",{className:"h-8 flex items-center px-3 gap-2 text-xs shrink-0 border-b",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:a.jsx("span",{style:{color:"var(--text-muted)"},children:ho(r.size)})}),a.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center gap-3",style:{color:"var(--text-muted)"},children:[a.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"}),a.jsx("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),a.jsx("span",{className:"text-sm",children:"Binary file — preview not available"})]})]});const L=u&&u.path===n;return a.jsxs("div",{className:"flex flex-col h-full",children:[T,a.jsxs("div",{className:"h-8 flex items-center px-3 gap-2 text-xs shrink-0 border-b",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[r.language&&a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px]",style:{background:"var(--bg-hover)",color:"var(--text-muted)"},children:r.language}),a.jsx("span",{style:{color:"var(--text-muted)"},children:ho(r.size)}),c&&a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-medium",style:{background:"color-mix(in srgb, var(--info) 20%, transparent)",color:"var(--info)"},children:"Agent modified"}),a.jsx("div",{className:"flex-1"}),i&&a.jsx("span",{className:"text-[10px] font-medium",style:{color:"var(--accent)"},children:"Modified"}),a.jsx("button",{onClick:j,className:"px-2 py-0.5 rounded text-[11px] font-medium cursor-pointer transition-colors",style:{background:i?"var(--accent)":"var(--bg-hover)",color:i?"white":"var(--text-muted)",border:"none"},children:"Save"})]}),L&&a.jsxs("div",{className:"h-8 flex items-center px-3 gap-2 text-xs shrink-0 border-b",style:{borderColor:"var(--border)",background:"color-mix(in srgb, var(--info) 10%, var(--bg-secondary))"},children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--info)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("circle",{cx:"12",cy:"12",r:"10"}),a.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),a.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),a.jsx("span",{style:{color:"var(--info)"},children:"Agent modified this file"}),a.jsx("div",{className:"flex-1"}),a.jsx("button",{onClick:()=>v(null),className:"px-2 py-0.5 rounded text-[11px] font-medium cursor-pointer transition-colors",style:{background:"var(--bg-hover)",color:"var(--text-secondary)",border:"none"},children:"Dismiss"})]}),a.jsx("div",{className:"flex-1 overflow-hidden",children:L?a.jsx(Cl,{original:u.original,modified:u.modified,language:u.language??"plaintext",theme:x==="dark"?"uipath-dark":"uipath-light",beforeMount:go,options:{readOnly:!0,minimap:{enabled:!1},fontSize:13,lineNumbersMinChars:4,scrollBeyondLastLine:!1,automaticLayout:!0,renderSideBySide:!0}},`diff-${n}`):a.jsx(Al,{language:r.language??"plaintext",theme:x==="dark"?"uipath-dark":"uipath-light",value:s??r.content??"",onChange:B,beforeMount:go,onMount:N,options:{minimap:{enabled:!1},fontSize:13,lineNumbersMinChars:4,scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0,tabSize:2,renderWhitespace:"selection"}},n)})]})}const Zn="/api";async function Fu(){const e=await fetch(`${Zn}/agent/models`);if(!e.ok){if(e.status===401)return[];throw new Error(`HTTP ${e.status}`)}return e.json()}async function zu(e){const t=await fetch(`${Zn}/agent/session/${e}/diagnostics`);if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}async function $u(e){const t=await fetch(`${Zn}/agent/session/${e}/state`);if(t.status===404)return null;if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.json()}async function Uu(){const e=await fetch(`${Zn}/agent/skills`);if(!e.ok)throw new Error(`HTTP ${e.status}`);return e.json()}function Hu(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Wu=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ku=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gu={};function bo(e,t){return(Gu.jsx?Ku:Wu).test(e)}const qu=/[ \t\n\f\r]/g;function Vu(e){return typeof e=="object"?e.type==="text"?xo(e.value):!1:xo(e)}function xo(e){return e.replace(qu,"")===""}class xn{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}xn.prototype.normal={};xn.prototype.property={};xn.prototype.space=void 0;function Ds(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new xn(n,r,t)}function Br(e){return e.toLowerCase()}class Xe{constructor(t,n){this.attribute=n,this.property=t}}Xe.prototype.attribute="";Xe.prototype.booleanish=!1;Xe.prototype.boolean=!1;Xe.prototype.commaOrSpaceSeparated=!1;Xe.prototype.commaSeparated=!1;Xe.prototype.defined=!1;Xe.prototype.mustUseProperty=!1;Xe.prototype.number=!1;Xe.prototype.overloadedBoolean=!1;Xe.prototype.property="";Xe.prototype.spaceSeparated=!1;Xe.prototype.space=void 0;let Yu=0;const pe=Kt(),Pe=Kt(),Fr=Kt(),V=Kt(),Ae=Kt(),tn=Kt(),Qe=Kt();function Kt(){return 2**++Yu}const zr=Object.freeze(Object.defineProperty({__proto__:null,boolean:pe,booleanish:Pe,commaOrSpaceSeparated:Qe,commaSeparated:tn,number:V,overloadedBoolean:Fr,spaceSeparated:Ae},Symbol.toStringTag,{value:"Module"})),mr=Object.keys(zr);class ti extends Xe{constructor(t,n,r,i){let s=-1;if(super(t,n),yo(this,"space",i),typeof r=="number")for(;++s4&&n.slice(0,4)==="data"&&ed.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(vo,rd);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!vo.test(s)){let o=s.replace(Qu,nd);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=ti}return new i(r,t)}function nd(e){return"-"+e.toLowerCase()}function rd(e){return e.charAt(1).toUpperCase()}const id=Ds([Ps,Xu,zs,$s,Us],"html"),ni=Ds([Ps,Zu,zs,$s,Us],"svg");function od(e){return e.join(" ").trim()}var Yt={},gr,ko;function sd(){if(ko)return gr;ko=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,u=` -`,c="/",d="*",p="",m="comment",f="declaration";function b(v,y){if(typeof v!="string")throw new TypeError("First argument must be a string");if(!v)return[];y=y||{};var x=1,C=1;function O(w){var k=w.match(t);k&&(x+=k.length);var I=w.lastIndexOf(u);C=~I?w.length-I:C+w.length}function j(){var w={line:x,column:C};return function(k){return k.position=new N(w),R(),k}}function N(w){this.start=w,this.end={line:x,column:C},this.source=y.source}N.prototype.content=v;function B(w){var k=new Error(y.source+":"+x+":"+C+": "+w);if(k.reason=w,k.filename=y.source,k.line=x,k.column=C,k.source=v,!y.silent)throw k}function D(w){var k=w.exec(v);if(k){var I=k[0];return O(I),v=v.slice(I.length),k}}function R(){D(n)}function S(w){var k;for(w=w||[];k=T();)k!==!1&&w.push(k);return w}function T(){var w=j();if(!(c!=v.charAt(0)||d!=v.charAt(1))){for(var k=2;p!=v.charAt(k)&&(d!=v.charAt(k)||c!=v.charAt(k+1));)++k;if(k+=2,p===v.charAt(k-1))return B("End of comment missing");var I=v.slice(2,k-2);return C+=2,O(I),v=v.slice(k),C+=2,w({type:m,comment:I})}}function L(){var w=j(),k=D(r);if(k){if(T(),!D(i))return B("property missing ':'");var I=D(s),W=w({type:f,property:h(k[0].replace(e,p)),value:I?h(I[0].replace(e,p)):p});return D(o),W}}function M(){var w=[];S(w);for(var k;k=L();)k!==!1&&(w.push(k),S(w));return w}return R(),M()}function h(v){return v?v.replace(l,p):p}return gr=b,gr}var Eo;function ad(){if(Eo)return Yt;Eo=1;var e=Yt&&Yt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Yt,"__esModule",{value:!0}),Yt.default=n;const t=e(sd());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const o=(0,t.default)(r),l=typeof i=="function";return o.forEach(u=>{if(u.type!=="declaration")return;const{property:c,value:d}=u;l?i(c,d,u):d&&(s=s||{},s[c]=d)}),s}return Yt}var an={},wo;function ld(){if(wo)return an;wo=1,Object.defineProperty(an,"__esModule",{value:!0}),an.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(c){return!c||n.test(c)||e.test(c)},o=function(c,d){return d.toUpperCase()},l=function(c,d){return"".concat(d,"-")},u=function(c,d){return d===void 0&&(d={}),s(c)?c:(c=c.toLowerCase(),d.reactCompat?c=c.replace(i,l):c=c.replace(r,l),c.replace(t,o))};return an.camelCase=u,an}var ln,_o;function cd(){if(_o)return ln;_o=1;var e=ln&&ln.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(ad()),n=ld();function r(i,s){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(l,u){l&&u&&(o[(0,n.camelCase)(l,s)]=u)}),o}return r.default=r,ln=r,ln}var ud=cd();const dd=Xr(ud),Hs=Ws("end"),ri=Ws("start");function Ws(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function pd(e){const t=ri(e),n=Hs(e);if(t&&n)return{start:t,end:n}}function fn(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?No(e.position):"start"in e||"end"in e?No(e):"line"in e||"column"in e?$r(e):""}function $r(e){return So(e&&e.line)+":"+So(e&&e.column)}function No(e){return $r(e&&e.start)+"-"+$r(e&&e.end)}function So(e){return e&&typeof e=="number"?e:1}class We extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?s.ruleId=r:(s.source=r.slice(0,u),s.ruleId=r.slice(u+1))}if(!s.place&&s.ancestors&&s.ancestors){const u=s.ancestors[s.ancestors.length-1];u&&(s.place=u.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=fn(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}We.prototype.file="";We.prototype.name="";We.prototype.reason="";We.prototype.message="";We.prototype.stack="";We.prototype.column=void 0;We.prototype.line=void 0;We.prototype.ancestors=void 0;We.prototype.cause=void 0;We.prototype.fatal=void 0;We.prototype.place=void 0;We.prototype.ruleId=void 0;We.prototype.source=void 0;const ii={}.hasOwnProperty,fd=new Map,md=/[A-Z]/g,gd=new Set(["table","tbody","thead","tfoot","tr"]),hd=new Set(["td","th"]),Ks="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function bd(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Nd(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=_d(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?ni:id,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=Gs(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function Gs(e,t,n){if(t.type==="element")return xd(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return yd(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return kd(e,t,n);if(t.type==="mdxjsEsm")return vd(e,t);if(t.type==="root")return Ed(e,t,n);if(t.type==="text")return wd(e,t)}function xd(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=ni,e.schema=i),e.ancestors.push(t);const s=Vs(e,t.tagName,!1),o=Sd(e,t);let l=si(e,t);return gd.has(t.tagName)&&(l=l.filter(function(u){return typeof u=="string"?!Vu(u):!0})),qs(e,o,s,t),oi(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function yd(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}hn(e,t.position)}function vd(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);hn(e,t.position)}function kd(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=ni,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Vs(e,t.name,!0),o=Td(e,t),l=si(e,t);return qs(e,o,s,t),oi(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function Ed(e,t,n){const r={};return oi(r,si(e,t)),e.create(t,e.Fragment,r,n)}function wd(e,t){return t.value}function qs(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function oi(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function _d(e,t,n){return r;function r(i,s,o,l){const c=Array.isArray(o.children)?n:t;return l?c(s,o,l):c(s,o)}}function Nd(e,t){return n;function n(r,i,s,o){const l=Array.isArray(s.children),u=ri(r);return t(i,s,o,l,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Sd(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&ii.call(t.properties,i)){const s=Cd(e,i,t.properties[i]);if(s){const[o,l]=s;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&hd.has(t.tagName)?r=l:n[o]=l}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Td(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else hn(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else hn(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function si(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:fd;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s0?(et(e,e.length,0,t),e):t}const Ao={}.hasOwnProperty;function Xs(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function dt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ve=Dt(/[A-Za-z]/),He=Dt(/[\dA-Za-z]/),Pd=Dt(/[#-'*+\--9=?A-Z^-~]/);function Hn(e){return e!==null&&(e<32||e===127)}const Ur=Dt(/\d/),Bd=Dt(/[\dA-Fa-f]/),Fd=Dt(/[!-/:-@[-`{-~]/);function se(e){return e!==null&&e<-2}function Se(e){return e!==null&&(e<0||e===32)}function he(e){return e===-2||e===-1||e===32}const Jn=Dt(new RegExp("\\p{P}|\\p{S}","u")),Wt=Dt(/\s/);function Dt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function on(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(o=String.fromCharCode(s,l),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ee(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(u){return he(u)?(e.enter(n),l(u)):t(u)}function l(u){return he(u)&&s++o))return;const B=t.events.length;let D=B,R,S;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(R){S=t.events[D][1].end;break}R=!0}for(y(r),N=B;NC;){const j=n[O];t.containerState=j[1],j[0].exit.call(t,e)}n.length=C}function x(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Wd(e,t,n){return Ee(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function nn(e){if(e===null||Se(e)||Wt(e))return 1;if(Jn(e))return 2}function Qn(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},m={...e[n][1].start};Io(p,-u),Io(m,u),o={type:u>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},l={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},s={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=it(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=it(c,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),c=it(c,Qn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=it(c,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,c=it(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,et(e,r-1,n-r+3,c),n=r+c.length-d-2;break}}for(n=-1;++n0&&he(N)?Ee(e,x,"linePrefix",s+1)(N):x(N)}function x(N){return N===null||se(N)?e.check(Ro,h,O)(N):(e.enter("codeFlowValue"),C(N))}function C(N){return N===null||se(N)?(e.exit("codeFlowValue"),x(N)):(e.consume(N),C)}function O(N){return e.exit("codeFenced"),t(N)}function j(N,B,D){let R=0;return S;function S(k){return N.enter("lineEnding"),N.consume(k),N.exit("lineEnding"),T}function T(k){return N.enter("codeFencedFence"),he(k)?Ee(N,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):L(k)}function L(k){return k===l?(N.enter("codeFencedFenceSequence"),M(k)):D(k)}function M(k){return k===l?(R++,N.consume(k),M):R>=o?(N.exit("codeFencedFenceSequence"),he(k)?Ee(N,w,"whitespace")(k):w(k)):D(k)}function w(k){return k===null||se(k)?(N.exit("codeFencedFence"),B(k)):D(k)}}}function np(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const br={name:"codeIndented",tokenize:ip},rp={partial:!0,tokenize:op};function ip(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Ee(e,s,"linePrefix",5)(c)}function s(c){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(c):n(c)}function o(c){return c===null?u(c):se(c)?e.attempt(rp,o,u)(c):(e.enter("codeFlowValue"),l(c))}function l(c){return c===null||se(c)?(e.exit("codeFlowValue"),o(c)):(e.consume(c),l)}function u(c){return e.exit("codeIndented"),t(c)}}function op(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):se(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Ee(e,s,"linePrefix",5)(o)}function s(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):se(o)?i(o):n(o)}}const sp={name:"codeText",previous:lp,resolve:ap,tokenize:cp};function ap(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&cn(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),cn(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),cn(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function na(e,t,n,r,i,s,o,l,u){const c=u||Number.POSITIVE_INFINITY;let d=0;return p;function p(y){return y===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(y),e.exit(s),m):y===null||y===32||y===41||Hn(y)?n(y):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),h(y))}function m(y){return y===62?(e.enter(s),e.consume(y),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),f(y))}function f(y){return y===62?(e.exit("chunkString"),e.exit(l),m(y)):y===null||y===60||se(y)?n(y):(e.consume(y),y===92?b:f)}function b(y){return y===60||y===62||y===92?(e.consume(y),f):f(y)}function h(y){return!d&&(y===null||y===41||Se(y))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(y)):d999||f===null||f===91||f===93&&!u||f===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(f):f===93?(e.exit(s),e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):se(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),p(f))}function p(f){return f===null||f===91||f===93||se(f)||l++>999?(e.exit("chunkString"),d(f)):(e.consume(f),u||(u=!he(f)),f===92?m:p)}function m(f){return f===91||f===92||f===93?(e.consume(f),l++,p):p(f)}}function ia(e,t,n,r,i,s){let o;return l;function l(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),o=m===40?41:m,u):n(m)}function u(m){return m===o?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(s),c(m))}function c(m){return m===o?(e.exit(s),u(o)):m===null?n(m):se(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Ee(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===o||m===null||se(m)?(e.exit("chunkString"),c(m)):(e.consume(m),m===92?p:d)}function p(m){return m===o||m===92?(e.consume(m),d):d(m)}}function mn(e,t){let n;return r;function r(i){return se(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):he(i)?Ee(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const bp={name:"definition",tokenize:yp},xp={partial:!0,tokenize:vp};function yp(e,t,n){const r=this;let i;return s;function s(f){return e.enter("definition"),o(f)}function o(f){return ra.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(f)}function l(f){return i=dt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),f===58?(e.enter("definitionMarker"),e.consume(f),e.exit("definitionMarker"),u):n(f)}function u(f){return Se(f)?mn(e,c)(f):c(f)}function c(f){return na(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(f)}function d(f){return e.attempt(xp,p,p)(f)}function p(f){return he(f)?Ee(e,m,"whitespace")(f):m(f)}function m(f){return f===null||se(f)?(e.exit("definition"),r.parser.defined.push(i),t(f)):n(f)}}function vp(e,t,n){return r;function r(l){return Se(l)?mn(e,i)(l):n(l)}function i(l){return ia(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return he(l)?Ee(e,o,"whitespace")(l):o(l)}function o(l){return l===null||se(l)?t(l):n(l)}}const kp={name:"hardBreakEscape",tokenize:Ep};function Ep(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return se(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const wp={name:"headingAtx",resolve:_p,tokenize:Np};function _p(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},et(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function Np(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||Se(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),u(d)):d===null||se(d)?(e.exit("atxHeading"),t(d)):he(d)?Ee(e,l,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function u(d){return d===35?(e.consume(d),u):(e.exit("atxHeadingSequence"),l(d))}function c(d){return d===null||d===35||Se(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),c)}}const Sp=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Lo=["pre","script","style","textarea"],Tp={concrete:!0,name:"htmlFlow",resolveTo:Mp,tokenize:Ip},Cp={partial:!0,tokenize:Op},Ap={partial:!0,tokenize:Rp};function Mp(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ip(e,t,n){const r=this;let i,s,o,l,u;return c;function c(E){return d(E)}function d(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),p}function p(E){return E===33?(e.consume(E),m):E===47?(e.consume(E),s=!0,h):E===63?(e.consume(E),i=3,r.interrupt?t:g):Ve(E)?(e.consume(E),o=String.fromCharCode(E),v):n(E)}function m(E){return E===45?(e.consume(E),i=2,f):E===91?(e.consume(E),i=5,l=0,b):Ve(E)?(e.consume(E),i=4,r.interrupt?t:g):n(E)}function f(E){return E===45?(e.consume(E),r.interrupt?t:g):n(E)}function b(E){const ie="CDATA[";return E===ie.charCodeAt(l++)?(e.consume(E),l===ie.length?r.interrupt?t:L:b):n(E)}function h(E){return Ve(E)?(e.consume(E),o=String.fromCharCode(E),v):n(E)}function v(E){if(E===null||E===47||E===62||Se(E)){const ie=E===47,K=o.toLowerCase();return!ie&&!s&&Lo.includes(K)?(i=1,r.interrupt?t(E):L(E)):Sp.includes(o.toLowerCase())?(i=6,ie?(e.consume(E),y):r.interrupt?t(E):L(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):s?x(E):C(E))}return E===45||He(E)?(e.consume(E),o+=String.fromCharCode(E),v):n(E)}function y(E){return E===62?(e.consume(E),r.interrupt?t:L):n(E)}function x(E){return he(E)?(e.consume(E),x):S(E)}function C(E){return E===47?(e.consume(E),S):E===58||E===95||Ve(E)?(e.consume(E),O):he(E)?(e.consume(E),C):S(E)}function O(E){return E===45||E===46||E===58||E===95||He(E)?(e.consume(E),O):j(E)}function j(E){return E===61?(e.consume(E),N):he(E)?(e.consume(E),j):C(E)}function N(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),u=E,B):he(E)?(e.consume(E),N):D(E)}function B(E){return E===u?(e.consume(E),u=null,R):E===null||se(E)?n(E):(e.consume(E),B)}function D(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||Se(E)?j(E):(e.consume(E),D)}function R(E){return E===47||E===62||he(E)?C(E):n(E)}function S(E){return E===62?(e.consume(E),T):n(E)}function T(E){return E===null||se(E)?L(E):he(E)?(e.consume(E),T):n(E)}function L(E){return E===45&&i===2?(e.consume(E),I):E===60&&i===1?(e.consume(E),W):E===62&&i===4?(e.consume(E),F):E===63&&i===3?(e.consume(E),g):E===93&&i===5?(e.consume(E),q):se(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Cp,$,M)(E)):E===null||se(E)?(e.exit("htmlFlowData"),M(E)):(e.consume(E),L)}function M(E){return e.check(Ap,w,$)(E)}function w(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),k}function k(E){return E===null||se(E)?M(E):(e.enter("htmlFlowData"),L(E))}function I(E){return E===45?(e.consume(E),g):L(E)}function W(E){return E===47?(e.consume(E),o="",U):L(E)}function U(E){if(E===62){const ie=o.toLowerCase();return Lo.includes(ie)?(e.consume(E),F):L(E)}return Ve(E)&&o.length<8?(e.consume(E),o+=String.fromCharCode(E),U):L(E)}function q(E){return E===93?(e.consume(E),g):L(E)}function g(E){return E===62?(e.consume(E),F):E===45&&i===2?(e.consume(E),g):L(E)}function F(E){return E===null||se(E)?(e.exit("htmlFlowData"),$(E)):(e.consume(E),F)}function $(E){return e.exit("htmlFlow"),t(E)}}function Rp(e,t,n){const r=this;return i;function i(o){return se(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function Op(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(yn,t,n)}}const Lp={name:"htmlText",tokenize:jp};function jp(e,t,n){const r=this;let i,s,o;return l;function l(g){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(g),u}function u(g){return g===33?(e.consume(g),c):g===47?(e.consume(g),j):g===63?(e.consume(g),C):Ve(g)?(e.consume(g),D):n(g)}function c(g){return g===45?(e.consume(g),d):g===91?(e.consume(g),s=0,b):Ve(g)?(e.consume(g),x):n(g)}function d(g){return g===45?(e.consume(g),f):n(g)}function p(g){return g===null?n(g):g===45?(e.consume(g),m):se(g)?(o=p,W(g)):(e.consume(g),p)}function m(g){return g===45?(e.consume(g),f):p(g)}function f(g){return g===62?I(g):g===45?m(g):p(g)}function b(g){const F="CDATA[";return g===F.charCodeAt(s++)?(e.consume(g),s===F.length?h:b):n(g)}function h(g){return g===null?n(g):g===93?(e.consume(g),v):se(g)?(o=h,W(g)):(e.consume(g),h)}function v(g){return g===93?(e.consume(g),y):h(g)}function y(g){return g===62?I(g):g===93?(e.consume(g),y):h(g)}function x(g){return g===null||g===62?I(g):se(g)?(o=x,W(g)):(e.consume(g),x)}function C(g){return g===null?n(g):g===63?(e.consume(g),O):se(g)?(o=C,W(g)):(e.consume(g),C)}function O(g){return g===62?I(g):C(g)}function j(g){return Ve(g)?(e.consume(g),N):n(g)}function N(g){return g===45||He(g)?(e.consume(g),N):B(g)}function B(g){return se(g)?(o=B,W(g)):he(g)?(e.consume(g),B):I(g)}function D(g){return g===45||He(g)?(e.consume(g),D):g===47||g===62||Se(g)?R(g):n(g)}function R(g){return g===47?(e.consume(g),I):g===58||g===95||Ve(g)?(e.consume(g),S):se(g)?(o=R,W(g)):he(g)?(e.consume(g),R):I(g)}function S(g){return g===45||g===46||g===58||g===95||He(g)?(e.consume(g),S):T(g)}function T(g){return g===61?(e.consume(g),L):se(g)?(o=T,W(g)):he(g)?(e.consume(g),T):R(g)}function L(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),i=g,M):se(g)?(o=L,W(g)):he(g)?(e.consume(g),L):(e.consume(g),w)}function M(g){return g===i?(e.consume(g),i=void 0,k):g===null?n(g):se(g)?(o=M,W(g)):(e.consume(g),M)}function w(g){return g===null||g===34||g===39||g===60||g===61||g===96?n(g):g===47||g===62||Se(g)?R(g):(e.consume(g),w)}function k(g){return g===47||g===62||Se(g)?R(g):n(g)}function I(g){return g===62?(e.consume(g),e.exit("htmlTextData"),e.exit("htmlText"),t):n(g)}function W(g){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),U}function U(g){return he(g)?Ee(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(g):q(g)}function q(g){return e.enter("htmlTextData"),o(g)}}const ci={name:"labelEnd",resolveAll:Fp,resolveTo:zp,tokenize:$p},Dp={tokenize:Up},Pp={tokenize:Hp},Bp={tokenize:Wp};function Fp(e){let t=-1;const n=[];for(;++t=3&&(c===null||se(c))?(e.exit("thematicBreak"),t(c)):n(c)}function u(c){return c===i?(e.consume(c),r++,u):(e.exit("thematicBreakSequence"),he(c)?Ee(e,l,"whitespace")(c):l(c))}}const Ye={continuation:{tokenize:ef},exit:nf,name:"list",tokenize:Qp},Zp={partial:!0,tokenize:rf},Jp={partial:!0,tokenize:tf};function Qp(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(f){const b=r.containerState.type||(f===42||f===43||f===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||f===r.containerState.marker:Ur(f)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),f===42||f===45?e.check(Fn,n,c)(f):c(f);if(!r.interrupt||f===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(f)}return n(f)}function u(f){return Ur(f)&&++o<10?(e.consume(f),u):(!r.interrupt||o<2)&&(r.containerState.marker?f===r.containerState.marker:f===41||f===46)?(e.exit("listItemValue"),c(f)):n(f)}function c(f){return e.enter("listItemMarker"),e.consume(f),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||f,e.check(yn,r.interrupt?n:d,e.attempt(Zp,m,p))}function d(f){return r.containerState.initialBlankLine=!0,s++,m(f)}function p(f){return he(f)?(e.enter("listItemPrefixWhitespace"),e.consume(f),e.exit("listItemPrefixWhitespace"),m):n(f)}function m(f){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(f)}}function ef(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(yn,i,s);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ee(e,t,"listItemIndent",r.containerState.size+1)(l)}function s(l){return r.containerState.furtherBlankLines||!he(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Jp,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ee(e,e.attempt(Ye,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function tf(e,t,n){const r=this;return Ee(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function nf(e){e.exit(this.containerState.type)}function rf(e,t,n){const r=this;return Ee(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!he(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const jo={name:"setextUnderline",resolveTo:of,tokenize:sf};function of(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function sf(e,t,n){const r=this;let i;return s;function s(c){let d=r.events.length,p;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){p=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=c,o(c)):n(c)}function o(c){return e.enter("setextHeadingLineSequence"),l(c)}function l(c){return c===i?(e.consume(c),l):(e.exit("setextHeadingLineSequence"),he(c)?Ee(e,u,"lineSuffix")(c):u(c))}function u(c){return c===null||se(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const af={tokenize:lf};function lf(e){const t=this,n=e.attempt(yn,r,e.attempt(this.parser.constructs.flowInitial,i,Ee(e,e.attempt(this.parser.constructs.flow,i,e.attempt(pp,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const cf={resolveAll:sa()},uf=oa("string"),df=oa("text");function oa(e){return{resolveAll:sa(e==="text"?pf:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,l);return o;function o(d){return c(d)?s(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),u}function u(d){return c(d)?(n.exit("data"),s(d)):(n.consume(d),u)}function c(d){if(d===null)return!0;const p=i[d];let m=-1;if(p)for(;++m-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function Nf(e,t){let n=-1;const r=[];let i;for(;++n0){const Ke=ee.tokenStack[ee.tokenStack.length-1];(Ke[1]||Po).call(ee,void 0,Ke[0])}for(G.position={start:Rt(P.length>0?P[0][1].start:{line:1,column:1,offset:0}),end:Rt(P.length>0?P[P.length-2][1].end:{line:1,column:1,offset:0})},we=-1;++we0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function Ff(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function zf(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $f(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=on(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,l+=1,e.footnoteCounts.set(r,l);const u={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,u);const c={type:"element",tagName:"sup",properties:{},children:[u]};return e.patch(t,c),e.applyData(t,c)}function Uf(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Hf(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function ca(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function Wf(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ca(e,t);const i={src:on(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function Kf(e,t){const n={src:on(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Gf(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function qf(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return ca(e,t);const i={href:on(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function Vf(e,t){const n={href:on(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Yf(e,t,n){const r=e.all(t),i=n?Xf(n):ua(t),s={},o=[];if(typeof t.checked=="boolean"){const d=r[0];let p;d&&d.type==="element"&&d.tagName==="p"?p=d:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l1}function Zf(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=ri(t.children[1]),u=Hs(t.children[t.children.length-1]);l&&u&&(o.position={start:l,end:u}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function nm(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let u=-1;const c=[];for(;++u0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(zo(t.slice(i),i>0,!1)),s.join("")}function zo(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===Bo||s===Fo;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===Bo||s===Fo;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function om(e,t){const n={type:"text",value:im(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function sm(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const am={blockquote:Df,break:Pf,code:Bf,delete:Ff,emphasis:zf,footnoteReference:$f,heading:Uf,html:Hf,imageReference:Wf,image:Kf,inlineCode:Gf,linkReference:qf,link:Vf,listItem:Yf,list:Zf,paragraph:Jf,root:Qf,strong:em,table:tm,tableCell:rm,tableRow:nm,text:om,thematicBreak:sm,toml:Mn,yaml:Mn,definition:Mn,footnoteDefinition:Mn};function Mn(){}const da=-1,er=0,gn=1,Wn=2,ui=3,di=4,pi=5,fi=6,pa=7,fa=8,$o=typeof self=="object"?self:globalThis,lm=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case er:case da:return n(o,i);case gn:{const l=n([],i);for(const u of o)l.push(r(u));return l}case Wn:{const l=n({},i);for(const[u,c]of o)l[r(u)]=r(c);return l}case ui:return n(new Date(o),i);case di:{const{source:l,flags:u}=o;return n(new RegExp(l,u),i)}case pi:{const l=n(new Map,i);for(const[u,c]of o)l.set(r(u),r(c));return l}case fi:{const l=n(new Set,i);for(const u of o)l.add(r(u));return l}case pa:{const{name:l,message:u}=o;return n(new $o[l](u),i)}case fa:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(new $o[s](o),i)};return r},Uo=e=>lm(new Map,e)(0),Xt="",{toString:cm}={},{keys:um}=Object,un=e=>{const t=typeof e;if(t!=="object"||!e)return[er,t];const n=cm.call(e).slice(8,-1);switch(n){case"Array":return[gn,Xt];case"Object":return[Wn,Xt];case"Date":return[ui,Xt];case"RegExp":return[di,Xt];case"Map":return[pi,Xt];case"Set":return[fi,Xt];case"DataView":return[gn,n]}return n.includes("Array")?[gn,n]:n.includes("Error")?[pa,n]:[Wn,n]},In=([e,t])=>e===er&&(t==="function"||t==="symbol"),dm=(e,t,n,r)=>{const i=(o,l)=>{const u=r.push(o)-1;return n.set(l,u),u},s=o=>{if(n.has(o))return n.get(o);let[l,u]=un(o);switch(l){case er:{let d=o;switch(u){case"bigint":l=fa,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+u);d=null;break;case"undefined":return i([da],o)}return i([l,d],o)}case gn:{if(u){let m=o;return u==="DataView"?m=new Uint8Array(o.buffer):u==="ArrayBuffer"&&(m=new Uint8Array(o)),i([u,[...m]],o)}const d=[],p=i([l,d],o);for(const m of o)d.push(s(m));return p}case Wn:{if(u)switch(u){case"BigInt":return i([u,o.toString()],o);case"Boolean":case"Number":case"String":return i([u,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const d=[],p=i([l,d],o);for(const m of um(o))(e||!In(un(o[m])))&&d.push([s(m),s(o[m])]);return p}case ui:return i([l,o.toISOString()],o);case di:{const{source:d,flags:p}=o;return i([l,{source:d,flags:p}],o)}case pi:{const d=[],p=i([l,d],o);for(const[m,f]of o)(e||!(In(un(m))||In(un(f))))&&d.push([s(m),s(f)]);return p}case fi:{const d=[],p=i([l,d],o);for(const m of o)(e||!In(un(m)))&&d.push(s(m));return p}}const{message:c}=o;return i([l,{name:u,message:c}],o)};return s},Ho=(e,{json:t,lossy:n}={})=>{const r=[];return dm(!(t||n),!!t,new Map,r)(e),r},Kn=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Uo(Ho(e,t)):structuredClone(e):(e,t)=>Uo(Ho(e,t));function pm(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function fm(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function mm(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||pm,r=e.options.footnoteBackLabel||fm,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let u=-1;for(;++u0&&b.push({type:"text",value:" "});let x=typeof n=="string"?n:n(u,f);typeof x=="string"&&(x={type:"text",value:x}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+m+(f>1?"-"+f:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(u,f),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const v=d[d.length-1];if(v&&v.type==="element"&&v.tagName==="p"){const x=v.children[v.children.length-1];x&&x.type==="text"?x.value+=" ":v.children.push({type:"text",value:" "}),v.children.push(...b)}else d.push(...b);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+m},children:e.wrap(d,!0)};e.patch(c,y),l.push(y)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Kn(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` -`}]}}const vn=(function(e){if(e==null)return xm;if(typeof e=="function")return tr(e);if(typeof e=="object")return Array.isArray(e)?gm(e):hm(e);if(typeof e=="string")return bm(e);throw new Error("Expected function, string, or object as test")});function gm(e){const t=[];let n=-1;for(;++n":""))+")"})}return m;function m(){let f=ma,b,h,v;if((!t||s(u,c,d[d.length-1]||void 0))&&(f=Em(n(u,d)),f[0]===Wr))return f;if("children"in u&&u.children){const y=u;if(y.children&&f[0]!==km)for(h=(r?y.children.length:-1)+o,v=d.concat(y);h>-1&&h0&&n.push({type:"text",value:` -`}),n}function Wo(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ko(e,t){const n=_m(e,t),r=n.one(e,void 0),i=mm(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:` -`},i),s}function Am(e,t){return e&&"run"in e?async function(n,r){const i=Ko(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Ko(n,{file:r,...e||t})}}function Go(e){if(e)throw e}var yr,qo;function Mm(){if(qo)return yr;qo=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(c){return typeof Array.isArray=="function"?Array.isArray(c):t.call(c)==="[object Array]"},s=function(c){if(!c||t.call(c)!=="[object Object]")return!1;var d=e.call(c,"constructor"),p=c.constructor&&c.constructor.prototype&&e.call(c.constructor.prototype,"isPrototypeOf");if(c.constructor&&!d&&!p)return!1;var m;for(m in c);return typeof m>"u"||e.call(c,m)},o=function(c,d){n&&d.name==="__proto__"?n(c,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):c[d.name]=d.newValue},l=function(c,d){if(d==="__proto__")if(e.call(c,d)){if(r)return r(c,d).value}else return;return c[d]};return yr=function u(){var c,d,p,m,f,b,h=arguments[0],v=1,y=arguments.length,x=!1;for(typeof h=="boolean"&&(x=h,h=arguments[1]||{},v=2),(h==null||typeof h!="object"&&typeof h!="function")&&(h={});vo.length;let u;l&&o.push(i);try{u=e.apply(this,o)}catch(c){const d=c;if(l&&n)throw d;return i(d)}l||(u&&u.then&&typeof u.then=="function"?u.then(s,i):u instanceof Error?i(u):s(u))}function i(o,...l){n||(n=!0,t(o,...l))}function s(o){i(null,o)}}const gt={basename:Lm,dirname:jm,extname:Dm,join:Pm,sep:"/"};function Lm(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');kn(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function jm(e){if(kn(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Dm(e){kn(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function Pm(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Fm(e,t){let n="",r=0,i=-1,s=0,o=-1,l,u;for(;++o<=e.length;){if(o2){if(u=n.lastIndexOf("/"),u!==n.length-1){u<0?(n="",r=0):(n=n.slice(0,u),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else l===46&&s>-1?s++:s=-1}return n}function kn(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const zm={cwd:$m};function $m(){return"/"}function qr(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Um(e){if(typeof e=="string")e=new URL(e);else if(!qr(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Hm(e)}function Hm(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[f,...b]=d;const h=r[m][1];Gr(h)&&Gr(f)&&(f=vr(!0,h,f)),r[m]=[c,f,...b]}}}}const qm=new mi().freeze();function _r(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Nr(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Sr(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Yo(e){if(!Gr(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Xo(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Rn(e){return Vm(e)?e:new ha(e)}function Vm(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ym(e){return typeof e=="string"||Xm(e)}function Xm(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Zm="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Zo=[],Jo={allowDangerousHtml:!0},Jm=/^(https?|ircs?|mailto|xmpp)$/i,Qm=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function eg(e){const t=tg(e),n=ng(e);return rg(t.runSync(t.parse(n),n),e)}function tg(e){const t=e.rehypePlugins||Zo,n=e.remarkPlugins||Zo,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Jo}:Jo;return qm().use(jf).use(n).use(Am,r).use(t)}function ng(e){const t=e.children||"",n=new ha;return typeof t=="string"&&(n.value=t),n}function rg(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,u=t.urlTransform||ig;for(const d of Qm)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Zm+d.id,void 0);return nr(e,c),bd(e,{Fragment:a.Fragment,components:i,ignoreInvalidStyle:!0,jsx:a.jsx,jsxs:a.jsxs,passKeys:!0,passNode:!0});function c(d,p,m){if(d.type==="raw"&&m&&typeof p=="number")return o?m.children.splice(p,1):m.children[p]={type:"text",value:d.value},p;if(d.type==="element"){let f;for(f in hr)if(Object.hasOwn(hr,f)&&Object.hasOwn(d.properties,f)){const b=d.properties[f],h=hr[f];(h===null||h.includes(d.tagName))&&(d.properties[f]=u(String(b||""),f,d))}}if(d.type==="element"){let f=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!f&&r&&typeof p=="number"&&(f=!r(d,p,m)),f&&m&&typeof p=="number")return l&&d.children?m.children.splice(p,1,...d.children):m.children.splice(p,1),p}}}function ig(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Jm.test(e.slice(0,t))?e:""}const Qo=(function(e,t,n){const r=vn(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++tc&&(c=d):d&&(c!==void 0&&c>-1&&u.push(` -`.repeat(c)||" "),c=-1,u.push(d))}return u.join("")}function xa(e,t,n){return e.type==="element"?pg(e,t,n):e.type==="text"?n.whitespace==="normal"?ya(e,n):fg(e):[]}function pg(e,t,n){const r=va(e,n),i=e.children||[];let s=-1,o=[];if(ug(e))return o;let l,u;for(Vr(e)||rs(e)&&Qo(t,e,rs)?u=` -`:cg(e)?(l=2,u=2):ba(e)&&(l=1,u=1);++s]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},f=t.optional(i)+e.IDENT_RE+"\\s*\\(",b=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],h=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:h,keyword:b,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},j={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[j,p,l,n,e.C_BLOCK_COMMENT_MODE,d,c],B={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:N.concat([{begin:/\(/,end:/\)/,keywords:O,contains:N.concat(["self"]),relevance:0}]),relevance:0},D={className:"function",begin:"("+o+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:O,relevance:0},{begin:f,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,d,l,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"",keywords:O,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function yg(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=xg(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function vg(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,i]};i.contains.push(l);const u={match:/\\"/},c={className:"string",begin:/'/,end:/'/},d={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},m=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],f=e.SHEBANG({binary:`(${m.join("|")})`,relevance:10}),b={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},h=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],y={match:/(\/[a-z._-]+)+/},x=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],C=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],O=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],j=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:h,literal:v,built_in:[...x,...C,"set","shopt",...O,...j]},contains:[f,e.SHEBANG(),b,p,s,o,y,l,u,c,d,n]}}function kg(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},f=t.optional(i)+e.IDENT_RE+"\\s*\\(",v={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[p,l,n,e.C_BLOCK_COMMENT_MODE,d,c],x={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:v,contains:y.concat([{begin:/\(/,end:/\)/,keywords:v,contains:y.concat(["self"]),relevance:0}]),relevance:0},C={begin:"("+o+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:v,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:v,relevance:0},{begin:f,returnBegin:!0,contains:[e.inherit(m,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,d,l,{begin:/\(/,end:/\)/,keywords:v,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C",aliases:["h"],keywords:v,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:p,strings:c,keywords:v}}}function Eg(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+t.optional(i)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},c={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},d={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(c,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:t.optional(i)+e.IDENT_RE,relevance:0},f=t.optional(i)+e.IDENT_RE+"\\s*\\(",b=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],h=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],v=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],O={type:h,keyword:b,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:v},j={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},N=[j,p,l,n,e.C_BLOCK_COMMENT_MODE,d,c],B={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:O,contains:N.concat([{begin:/\(/,end:/\)/,keywords:O,contains:N.concat(["self"]),relevance:0}]),relevance:0},D={className:"function",begin:"("+o+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:O,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:O,relevance:0},{begin:f,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[c,d]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,c,d,l,{begin:/\(/,end:/\)/,keywords:O,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,c,d,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:O,illegal:"",keywords:O,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:O},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function wg(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:i.concat(s),built_in:t,literal:r},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=e.inherit(d,{illegal:/\n/}),m={className:"subst",begin:/\{/,end:/\}/,keywords:o},f=e.inherit(m,{illegal:/\n/}),b={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,f]},h={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]},v=e.inherit(h,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]});m.contains=[h,b,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,e.C_BLOCK_COMMENT_MODE],f.contains=[v,b,p,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const y={variants:[c,h,b,d,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},x={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},C=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",O={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},y,u,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,x,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+C+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,x],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[y,u,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},O]}}const _g=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Ng=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Sg=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Tg=[...Ng,...Sg],Cg=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Ag=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Mg=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Ig=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Rg(e){const t=e.regex,n=_g(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",l=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Ag.join("|")+")"},{begin:":(:)?("+Mg.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ig.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...l,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...l,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:Cg.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...l,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Tg.join("|")+")\\b"}]}}function Og(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function Lg(e){const s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"ka(e,t,n-1))}function Pg(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+ka("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),u={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},c={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},d={className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:u,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:u,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,is,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},is,c]}}const os="[A-Za-z$_][0-9A-Za-z$_]*",Bg=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Fg=["true","false","null","undefined","NaN","Infinity"],Ea=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],wa=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],_a=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],zg=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],$g=[].concat(_a,Ea,wa);function Ug(e){const t=e.regex,n=(U,{after:q})=>{const g="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,q)=>{const g=U[0].length+U.index,F=U.input[g];if(F==="<"||F===","){q.ignoreMatch();return}F===">"&&(n(U,{after:g})||q.ignoreMatch());let $;const E=U.input.substring(g);if($=E.match(/^\s*=/)){q.ignoreMatch();return}if(($=E.match(/^\s+extends\s+/))&&$.index===0){q.ignoreMatch();return}}},l={$pattern:os,keyword:Bg,literal:Fg,built_in:$g,"variable.language":zg},u="[0-9](_?[0-9])*",c=`\\.(${u})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${d})((${c})|\\.)?|(${c}))[eE][+-]?(${u})\\b`},{begin:`\\b(${d})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"css"}},h={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,m]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},C=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,b,h,v,{match:/\$\d+/},p];m.contains=C.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(C)});const O=[].concat(x,m.contains),j=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:j},B={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},D={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Ea,...wa]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},S={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},T={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function L(U){return t.concat("(?!",U.join("|"),")")}const M={match:t.concat(/\b/,L([..._a,"super","import"].map(U=>`${U}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},w={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",W={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:j,CLASS_REFERENCE:D},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,b,h,v,x,{match:/\$\d+/},p,D,{scope:"attr",match:r+t.lookahead(":"),relevance:0},W,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:j}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},S,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},w,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},M,T,B,k,{match:/\$[(.]/}]}}function Hg(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],i={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Jt="[0-9](_*[0-9])*",jn=`\\.(${Jt})`,Dn="[0-9a-fA-F](_*[0-9a-fA-F])*",Wg={className:"number",variants:[{begin:`(\\b(${Jt})((${jn})|\\.)?|(${jn}))[eE][+-]?(${Jt})[fFdD]?\\b`},{begin:`\\b(${Jt})((${jn})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${jn})[fFdD]?\\b`},{begin:`\\b(${Jt})[fFdD]\\b`},{begin:`\\b0[xX]((${Dn})\\.?|(${Dn})?\\.(${Dn}))[pP][+-]?(${Jt})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Dn})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Kg(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,i]}]};i.contains.push(o);const l={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},u={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},c=Wg,d=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),p={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},m=p;return m.variants[1].contains=[p],p.variants[1].contains=[m],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,d,n,r,l,u,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[p,e.C_LINE_COMMENT_MODE,d],relevance:0},e.C_LINE_COMMENT_MODE,d,l,u,o,e.C_NUMBER_MODE]},d]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},l,u]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` -`},c]}}const Gg=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),qg=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Vg=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Yg=[...qg,...Vg],Xg=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Na=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Sa=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Zg=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),Jg=Na.concat(Sa).sort().reverse();function Qg(e){const t=Gg(e),n=Jg,r="and or not only",i="[\\w-]+",s="("+i+"|@\\{"+i+"\\})",o=[],l=[],u=function(C){return{className:"string",begin:"~?"+C+".*?"+C}},c=function(C,O,j){return{className:C,begin:O,relevance:j}},d={$pattern:/[a-z-]+/,keyword:r,attribute:Xg.join(" ")},p={begin:"\\(",end:"\\)",contains:l,keywords:d,relevance:0};l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,u("'"),u('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,p,c("variable","@@?"+i,10),c("variable","@\\{"+i+"\\}"),c("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const m=l.concat({begin:/\{/,end:/\}/,contains:o}),f={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(l)},b={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Zg.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:l}}]},h={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:d,returnEnd:!0,contains:l,relevance:0}},v={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:m}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,c("keyword","all\\b"),c("variable","@\\{"+i+"\\}"),{begin:"\\b("+Yg.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,c("selector-tag",s,0),c("selector-id","#"+s),c("selector-class","\\."+s,0),c("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Na.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Sa.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:m},{begin:"!important"},t.FUNCTION_DISPATCH]},x={begin:i+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[y]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,h,v,x,b,y,f,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function eh(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},i=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function th(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},c={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},d={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=e.inherit(c,{contains:[]}),m=e.inherit(d,{contains:[]});c.contains.push(m),d.contains.push(p);let f=[n,u];return[c,d,p,m].forEach(y=>{y.contains=y.contains.concat(f)}),f=f.concat(c,d),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:f},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:f}]}]},n,s,c,d,{className:"quote",begin:"^>\\s+",contains:f,end:"$"},i,r,u,o,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function rh(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},u={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+u.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:u,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function ih(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:n.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},o={begin:/->\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},u={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},c={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,s,u],p=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],m=(h,v,y="\\1")=>{const x=y==="\\1"?y:t.concat(y,v);return t.concat(t.concat("(?:",h,")"),v,/(?:\\.|[^\\\/])*?/,x,/(?:\\.|[^\\\/])*?/,y,r)},f=(h,v,y)=>t.concat(t.concat("(?:",h,")"),v,/(?:\\.|[^\\\/])*?/,y,r),b=[u,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},c,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:m("s|tr|y",t.either(...p,{capture:!0}))},{begin:m("s|tr|y","\\(","\\)")},{begin:m("s|tr|y","\\[","\\]")},{begin:m("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:f("(?:m|qr)?",/\//,/\//)},{begin:f("m|qr",t.either(...p,{capture:!0}),/\1/)},{begin:f("m|qr",/\(/,/\)/)},{begin:f("m|qr",/\[/,/\]/)},{begin:f("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,c]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=b,o.contains=b,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:b}}function oh(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),s=t.concat(/[A-Z]+/,n),o={scope:"variable",match:"\\$+"+r},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},u={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},c=e.inherit(e.APOS_STRING_MODE,{illegal:null}),d=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(u)}),p={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(u),"on:begin":(w,k)=>{k.data._beginMatch=w[1]||w[2]},"on:end":(w,k)=>{k.data._beginMatch!==w[1]&&k.ignoreMatch()}},m=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),f=`[ -]`,b={scope:"string",variants:[d,c,p,m]},h={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},v=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],x=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],O={keyword:y,literal:(w=>{const k=[];return w.forEach(I=>{k.push(I),I.toLowerCase()===I?k.push(I.toUpperCase()):k.push(I.toLowerCase())}),k})(v),built_in:x},j=w=>w.map(k=>k.replace(/\|\d+$/,"")),N={variants:[{match:[/new/,t.concat(f,"+"),t.concat("(?!",j(x).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},B=t.concat(r,"\\b(?!\\()"),D={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),B],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,t.concat(/::/,t.lookahead(/(?!class\b)/)),B],scope:{1:"title.class",3:"variable.constant"}},{match:[i,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},R={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},S={relevance:0,begin:/\(/,end:/\)/,keywords:O,contains:[R,o,D,e.C_BLOCK_COMMENT_MODE,b,h,N]},T={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",j(y).join("\\b|"),"|",j(x).join("\\b|"),"\\b)"),r,t.concat(f,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[S]};S.contains.push(T);const L=[R,D,e.C_BLOCK_COMMENT_MODE,b,h,N],M={begin:t.concat(/#\[\s*\\?/,t.either(i,s)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:v,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:v,keyword:["new","array"]},contains:["self",...L]},...L,{scope:"meta",variants:[{match:i},{match:s}]}]};return{case_insensitive:!1,keywords:O,contains:[M,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},o,T,D,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},N,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:O,contains:["self",M,o,D,e.C_BLOCK_COMMENT_MODE,b,h]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},b,h]}}function sh(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function ah(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function lh(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},c={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},d={begin:/\{\{/,relevance:0},p={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u,d,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u,d,c]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,d,c]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,d,c]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},m="[0-9](_?[0-9])*",f=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,b=`\\b|${r.join("|")}`,h={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${f}))[eE][+-]?(${m})[jJ]?(?=${b})`},{begin:`(${f})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${b})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${b})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${b})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${b})`},{begin:`\\b(${m})[jJ](?=${b})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",u,h,p,e.HASH_COMMENT_MODE]}]};return c.contains=[p,h,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[u,h,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[h,y,p]}]}}function ch(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function uh(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[s,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function dh(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=t.concat(r,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},u={begin:"#<",end:">"},c=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:o},p={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},m="[1-9](_?[0-9])*|0",f="[0-9](_?[0-9])*",b={className:"number",relevance:0,variants:[{begin:`\\b(${m})(\\.(${f}))?([eE][+-]?(${f})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},h={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},N=[p,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[h]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:n}],relevance:0},b,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(u,c),relevance:0}].concat(u,c);d.contains=N,h.contains=N;const S=[{begin:/^\s*=>/,starts:{end:"$",contains:N}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:N}}];return c.unshift(u),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(S).concat(c).concat(N)}}function ph(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),i=t.concat(n,e.IDENT_RE),s={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,i,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],u=["true","false","Some","None","Ok","Err"],c=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],d=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:d,keyword:l,literal:u,built_in:c},illegal:""},s]}}const fh=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),mh=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],gh=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],hh=[...mh,...gh],bh=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),xh=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),yh=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),vh=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function kh(e){const t=fh(e),n=yh,r=xh,i="@[a-z-]+",s="and or not only",l={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+hh.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},l,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+vh.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,l,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:bh.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},l,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function Eh(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function wh(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},i={begin:/"/,end:/"/,contains:[{match:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],u=["add","asc","collation","desc","final","first","last","view"],c=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],d=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],p=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],m=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],f=d,b=[...c,...u].filter(j=>!d.includes(j)),h={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},v={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={match:t.concat(/\b/,t.either(...f),/\s*\(/),relevance:0,keywords:{built_in:f}};function x(j){return t.concat(/\b/,t.either(...j.map(N=>N.replace(/\s+/,"\\s+"))),/\b/)}const C={scope:"keyword",match:x(m),relevance:0};function O(j,{exceptions:N,when:B}={}){const D=B;return N=N||[],j.map(R=>R.match(/\|\d+$/)||N.includes(R)?R:D(R)?`${R}|0`:R)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:O(b,{when:j=>j.length<3}),literal:s,type:l,built_in:p},contains:[{scope:"type",match:x(o)},C,y,h,r,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,v]}}function Ta(e){return e?typeof e=="string"?e:e.source:null}function dn(e){return Ne("(?=",e,")")}function Ne(...e){return e.map(n=>Ta(n)).join("")}function _h(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function qe(...e){return"("+(_h(e).capture?"":"?:")+e.map(r=>Ta(r)).join("|")+")"}const hi=e=>Ne(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Nh=["Protocol","Type"].map(hi),ss=["init","self"].map(hi),Sh=["Any","Self"],Tr=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],as=["false","nil","true"],Th=["assignment","associativity","higherThan","left","lowerThan","none","right"],Ch=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],ls=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Ca=qe(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Aa=qe(Ca,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Cr=Ne(Ca,Aa,"*"),Ma=qe(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Gn=qe(Ma,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),mt=Ne(Ma,Gn,"*"),Pn=Ne(/[A-Z]/,Gn,"*"),Ah=["attached","autoclosure",Ne(/convention\(/,qe("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Ne(/objc\(/,mt,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Mh=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Ih(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],i={match:[/\./,qe(...Nh,...ss)],className:{2:"keyword"}},s={match:Ne(/\./,qe(...Tr)),relevance:0},o=Tr.filter(ke=>typeof ke=="string").concat(["_|0"]),l=Tr.filter(ke=>typeof ke!="string").concat(Sh).map(hi),u={variants:[{className:"keyword",match:qe(...l,...ss)}]},c={$pattern:qe(/\b\w+/,/#\w+/),keyword:o.concat(Ch),literal:as},d=[i,s,u],p={match:Ne(/\./,qe(...ls)),relevance:0},m={className:"built_in",match:Ne(/\b/,qe(...ls),/(?=\()/)},f=[p,m],b={match:/->/,relevance:0},h={className:"operator",relevance:0,variants:[{match:Cr},{match:`\\.(\\.|${Aa})+`}]},v=[b,h],y="([0-9]_*)+",x="([0-9a-fA-F]_*)+",C={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${x})(\\.(${x}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},O=(ke="")=>({className:"subst",variants:[{match:Ne(/\\/,ke,/[0\\tnr"']/)},{match:Ne(/\\/,ke,/u\{[0-9a-fA-F]{1,8}\}/)}]}),j=(ke="")=>({className:"subst",match:Ne(/\\/,ke,/[\t ]*(?:[\r\n]|\r\n)/)}),N=(ke="")=>({className:"subst",label:"interpol",begin:Ne(/\\/,ke,/\(/),end:/\)/}),B=(ke="")=>({begin:Ne(ke,/"""/),end:Ne(/"""/,ke),contains:[O(ke),j(ke),N(ke)]}),D=(ke="")=>({begin:Ne(ke,/"/),end:Ne(/"/,ke),contains:[O(ke),N(ke)]}),R={className:"string",variants:[B(),B("#"),B("##"),B("###"),D(),D("#"),D("##"),D("###")]},S=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],T={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:S},L=ke=>{const lt=Ne(ke,/\//),rt=Ne(/\//,ke);return{begin:lt,end:rt,contains:[...S,{scope:"comment",begin:`#(?!.*${rt})`,end:/$/}]}},M={scope:"regexp",variants:[L("###"),L("##"),L("#"),T]},w={match:Ne(/`/,mt,/`/)},k={className:"variable",match:/\$\d+/},I={className:"variable",match:`\\$${Gn}+`},W=[w,k,I],U={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Mh,contains:[...v,C,R]}]}},q={scope:"keyword",match:Ne(/@/,qe(...Ah),dn(qe(/\(/,/\s+/)))},g={scope:"meta",match:Ne(/@/,mt)},F=[U,q,g],$={match:dn(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Ne(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Gn,"+")},{className:"type",match:Pn,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Ne(/\s+&\s+/,dn(Pn)),relevance:0}]},E={begin://,keywords:c,contains:[...r,...d,...F,b,$]};$.contains.push(E);const ie={match:Ne(mt,/\s*:/),keywords:"_|0",relevance:0},K={begin:/\(/,end:/\)/,relevance:0,keywords:c,contains:["self",ie,...r,M,...d,...f,...v,C,R,...W,...F,$]},H={begin://,keywords:"repeat each",contains:[...r,$]},re={begin:qe(dn(Ne(mt,/\s*:/)),dn(Ne(mt,/\s+/,mt,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:mt}]},de={begin:/\(/,end:/\)/,keywords:c,contains:[re,...r,...d,...v,C,R,...F,$,K],endsParent:!0,illegal:/["']/},xe={match:[/(func|macro)/,/\s+/,qe(w.match,mt,Cr)],className:{1:"keyword",3:"title.function"},contains:[H,de,t],illegal:[/\[/,/%/]},Oe={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[H,de,t],illegal:/\[|%/},Ie={match:[/operator/,/\s+/,Cr],className:{1:"keyword",3:"title"}},at={begin:[/precedencegroup/,/\s+/,Pn],className:{1:"keyword",3:"title"},contains:[$],keywords:[...Th,...as],end:/}/},St={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Pt={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},yt={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,mt,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:c,contains:[H,...d,{begin:/:/,end:/\{/,keywords:c,contains:[{scope:"title.class.inherited",match:Pn},...d],relevance:0}]};for(const ke of R.variants){const lt=ke.contains.find(vt=>vt.label==="interpol");lt.keywords=c;const rt=[...d,...f,...v,C,R,...W];lt.contains=[...rt,{begin:/\(/,end:/\)/,contains:["self",...rt]}]}return{name:"Swift",keywords:c,contains:[...r,xe,Oe,St,Pt,yt,Ie,at,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},M,...d,...f,...v,C,R,...W,...F,$,K]}}const qn="[A-Za-z$_][0-9A-Za-z$_]*",Ia=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Ra=["true","false","null","undefined","NaN","Infinity"],Oa=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],La=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ja=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Da=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Pa=[].concat(ja,Oa,La);function Rh(e){const t=e.regex,n=(U,{after:q})=>{const g="",end:""},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(U,q)=>{const g=U[0].length+U.index,F=U.input[g];if(F==="<"||F===","){q.ignoreMatch();return}F===">"&&(n(U,{after:g})||q.ignoreMatch());let $;const E=U.input.substring(g);if($=E.match(/^\s*=/)){q.ignoreMatch();return}if(($=E.match(/^\s+extends\s+/))&&$.index===0){q.ignoreMatch();return}}},l={$pattern:qn,keyword:Ia,literal:Ra,built_in:Pa,"variable.language":Da},u="[0-9](_?[0-9])*",c=`\\.(${u})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${d})((${c})|\\.)?|(${c}))[eE][+-]?(${u})\\b`},{begin:`\\b(${d})\\b((${c})\\b|\\.)?|(${c})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},m={className:"subst",begin:"\\$\\{",end:"\\}",keywords:l,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"xml"}},b={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"css"}},h={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,m],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,m]},x={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},C=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,b,h,v,{match:/\$\d+/},p];m.contains=C.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(C)});const O=[].concat(x,m.contains),j=O.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(O)}]),N={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:j},B={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},D={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Oa,...La]}},R={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},S={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[N],illegal:/%/},T={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function L(U){return t.concat("(?!",U.join("|"),")")}const M={match:t.concat(/\b/,L([...ja,"super","import"].map(U=>`${U}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},w={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},k={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},N]},I="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",W={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(I)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[N]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:j,CLASS_REFERENCE:D},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),R,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,b,h,v,x,{match:/\$\d+/},p,D,{scope:"attr",match:r+t.lookahead(":"),relevance:0},W,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[x,e.REGEXP_MODE,{className:"function",begin:I,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:j}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},S,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[N,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},w,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[N]},M,T,B,k,{match:/\$[(.]/}]}}function Oh(e){const t=e.regex,n=Rh(e),r=qn,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],s={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[n.exports.CLASS_REFERENCE]},l={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],c={$pattern:qn,keyword:Ia.concat(u),literal:Ra,built_in:Pa.concat(i),"variable.language":Da},d={className:"meta",begin:"@"+r},p=(h,v,y)=>{const x=h.contains.findIndex(C=>C.label===v);if(x===-1)throw new Error("can not find mode to replace");h.contains.splice(x,1,y)};Object.assign(n.keywords,c),n.exports.PARAMS_CONTAINS.push(d);const m=n.contains.find(h=>h.scope==="attr"),f=Object.assign({},m,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,m,f]),n.contains=n.contains.concat([d,s,o,f]),p(n,"shebang",e.SHEBANG()),p(n,"use_strict",l);const b=n.contains.find(h=>h.label==="func.def");return b.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Lh(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,u={className:"literal",variants:[{begin:t.concat(/# */,t.either(s,i),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(s,i),/ +/,t.either(o,l),/ *#/)}]},c={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},d={className:"label",begin:/^\w+:/},p=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),m=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,u,c,d,p,m,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[m]}]}}function jh(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},u={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},c={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,i,e.QUOTE_STRING_MODE,u,c,l]}}function Dh(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(s,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),u=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),c={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[s,u,l,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[s,o,u,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[c],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[c],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:c}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Ph(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},o={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},l=e.inherit(o,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),m={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},f={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},b={begin:/\{/,end:/\}/,contains:[f],illegal:"\\n",relevance:0},h={begin:"\\[",end:"\\]",contains:[f],illegal:"\\n",relevance:0},v=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},m,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},b,h,s,o],y=[...v];return y.pop(),y.push(l),f.contains=y,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}const Bh={arduino:yg,bash:vg,c:kg,cpp:Eg,csharp:wg,css:Rg,diff:Og,go:Lg,graphql:jg,ini:Dg,java:Pg,javascript:Ug,json:Hg,kotlin:Kg,less:Qg,lua:eh,makefile:th,markdown:nh,objectivec:rh,perl:ih,php:oh,"php-template":sh,plaintext:ah,python:lh,"python-repl":ch,r:uh,ruby:dh,rust:ph,scss:kh,shell:Eh,sql:wh,swift:Ih,typescript:Oh,vbnet:Lh,wasm:jh,xml:Dh,yaml:Ph};var Ar,cs;function Fh(){if(cs)return Ar;cs=1;function e(A){return A instanceof Map?A.clear=A.delete=A.set=function(){throw new Error("map is read-only")}:A instanceof Set&&(A.add=A.clear=A.delete=function(){throw new Error("set is read-only")}),Object.freeze(A),Object.getOwnPropertyNames(A).forEach(z=>{const X=A[z],ce=typeof X;(ce==="object"||ce==="function")&&!Object.isFrozen(X)&&e(X)}),A}class t{constructor(z){z.data===void 0&&(z.data={}),this.data=z.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(A){return A.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function r(A,...z){const X=Object.create(null);for(const ce in A)X[ce]=A[ce];return z.forEach(function(ce){for(const Le in ce)X[Le]=ce[Le]}),X}const i="",s=A=>!!A.scope,o=(A,{prefix:z})=>{if(A.startsWith("language:"))return A.replace("language:","language-");if(A.includes(".")){const X=A.split(".");return[`${z}${X.shift()}`,...X.map((ce,Le)=>`${ce}${"_".repeat(Le+1)}`)].join(" ")}return`${z}${A}`};class l{constructor(z,X){this.buffer="",this.classPrefix=X.classPrefix,z.walk(this)}addText(z){this.buffer+=n(z)}openNode(z){if(!s(z))return;const X=o(z.scope,{prefix:this.classPrefix});this.span(X)}closeNode(z){s(z)&&(this.buffer+=i)}value(){return this.buffer}span(z){this.buffer+=``}}const u=(A={})=>{const z={children:[]};return Object.assign(z,A),z};class c{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(z){this.top.children.push(z)}openNode(z){const X=u({scope:z});this.add(X),this.stack.push(X)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(z){return this.constructor._walk(z,this.rootNode)}static _walk(z,X){return typeof X=="string"?z.addText(X):X.children&&(z.openNode(X),X.children.forEach(ce=>this._walk(z,ce)),z.closeNode(X)),z}static _collapse(z){typeof z!="string"&&z.children&&(z.children.every(X=>typeof X=="string")?z.children=[z.children.join("")]:z.children.forEach(X=>{c._collapse(X)}))}}class d extends c{constructor(z){super(),this.options=z}addText(z){z!==""&&this.add(z)}startScope(z){this.openNode(z)}endScope(){this.closeNode()}__addSublanguage(z,X){const ce=z.root;X&&(ce.scope=`language:${X}`),this.add(ce)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(A){return A?typeof A=="string"?A:A.source:null}function m(A){return h("(?=",A,")")}function f(A){return h("(?:",A,")*")}function b(A){return h("(?:",A,")?")}function h(...A){return A.map(X=>p(X)).join("")}function v(A){const z=A[A.length-1];return typeof z=="object"&&z.constructor===Object?(A.splice(A.length-1,1),z):{}}function y(...A){return"("+(v(A).capture?"":"?:")+A.map(ce=>p(ce)).join("|")+")"}function x(A){return new RegExp(A.toString()+"|").exec("").length-1}function C(A,z){const X=A&&A.exec(z);return X&&X.index===0}const O=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function j(A,{joinWith:z}){let X=0;return A.map(ce=>{X+=1;const Le=X;let je=p(ce),te="";for(;je.length>0;){const Q=O.exec(je);if(!Q){te+=je;break}te+=je.substring(0,Q.index),je=je.substring(Q.index+Q[0].length),Q[0][0]==="\\"&&Q[1]?te+="\\"+String(Number(Q[1])+Le):(te+=Q[0],Q[0]==="("&&X++)}return te}).map(ce=>`(${ce})`).join(z)}const N=/\b\B/,B="[a-zA-Z]\\w*",D="[a-zA-Z_]\\w*",R="\\b\\d+(\\.\\d+)?",S="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",T="\\b(0b[01]+)",L="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",M=(A={})=>{const z=/^#![ ]*\//;return A.binary&&(A.begin=h(z,/.*\b/,A.binary,/\b.*/)),r({scope:"meta",begin:z,end:/$/,relevance:0,"on:begin":(X,ce)=>{X.index!==0&&ce.ignoreMatch()}},A)},w={begin:"\\\\[\\s\\S]",relevance:0},k={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[w]},I={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[w]},W={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},U=function(A,z,X={}){const ce=r({scope:"comment",begin:A,end:z,contains:[]},X);ce.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Le=y("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return ce.contains.push({begin:h(/[ ]+/,"(",Le,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),ce},q=U("//","$"),g=U("/\\*","\\*/"),F=U("#","$"),$={scope:"number",begin:R,relevance:0},E={scope:"number",begin:S,relevance:0},ie={scope:"number",begin:T,relevance:0},K={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[w,{begin:/\[/,end:/\]/,relevance:0,contains:[w]}]},H={scope:"title",begin:B,relevance:0},re={scope:"title",begin:D,relevance:0},de={begin:"\\.\\s*"+D,relevance:0};var Oe=Object.freeze({__proto__:null,APOS_STRING_MODE:k,BACKSLASH_ESCAPE:w,BINARY_NUMBER_MODE:ie,BINARY_NUMBER_RE:T,COMMENT:U,C_BLOCK_COMMENT_MODE:g,C_LINE_COMMENT_MODE:q,C_NUMBER_MODE:E,C_NUMBER_RE:S,END_SAME_AS_BEGIN:function(A){return Object.assign(A,{"on:begin":(z,X)=>{X.data._beginMatch=z[1]},"on:end":(z,X)=>{X.data._beginMatch!==z[1]&&X.ignoreMatch()}})},HASH_COMMENT_MODE:F,IDENT_RE:B,MATCH_NOTHING_RE:N,METHOD_GUARD:de,NUMBER_MODE:$,NUMBER_RE:R,PHRASAL_WORDS_MODE:W,QUOTE_STRING_MODE:I,REGEXP_MODE:K,RE_STARTERS_RE:L,SHEBANG:M,TITLE_MODE:H,UNDERSCORE_IDENT_RE:D,UNDERSCORE_TITLE_MODE:re});function Ie(A,z){A.input[A.index-1]==="."&&z.ignoreMatch()}function at(A,z){A.className!==void 0&&(A.scope=A.className,delete A.className)}function St(A,z){z&&A.beginKeywords&&(A.begin="\\b("+A.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",A.__beforeBegin=Ie,A.keywords=A.keywords||A.beginKeywords,delete A.beginKeywords,A.relevance===void 0&&(A.relevance=0))}function Pt(A,z){Array.isArray(A.illegal)&&(A.illegal=y(...A.illegal))}function yt(A,z){if(A.match){if(A.begin||A.end)throw new Error("begin & end are not supported with match");A.begin=A.match,delete A.match}}function ke(A,z){A.relevance===void 0&&(A.relevance=1)}const lt=(A,z)=>{if(!A.beforeMatch)return;if(A.starts)throw new Error("beforeMatch cannot be used with starts");const X=Object.assign({},A);Object.keys(A).forEach(ce=>{delete A[ce]}),A.keywords=X.keywords,A.begin=h(X.beforeMatch,m(X.begin)),A.starts={relevance:0,contains:[Object.assign(X,{endsParent:!0})]},A.relevance=0,delete X.beforeMatch},rt=["of","and","for","in","not","or","if","then","parent","list","value"],vt="keyword";function Bt(A,z,X=vt){const ce=Object.create(null);return typeof A=="string"?Le(X,A.split(" ")):Array.isArray(A)?Le(X,A):Object.keys(A).forEach(function(je){Object.assign(ce,Bt(A[je],z,je))}),ce;function Le(je,te){z&&(te=te.map(Q=>Q.toLowerCase())),te.forEach(function(Q){const le=Q.split("|");ce[le[0]]=[je,qt(le[0],le[1])]})}}function qt(A,z){return z?Number(z):J(A)?0:1}function J(A){return rt.includes(A.toLowerCase())}const ge={},Re=A=>{console.error(A)},fe=(A,...z)=>{console.log(`WARN: ${A}`,...z)},P=(A,z)=>{ge[`${A}/${z}`]||(console.log(`Deprecated as of ${A}. ${z}`),ge[`${A}/${z}`]=!0)},G=new Error;function ee(A,z,{key:X}){let ce=0;const Le=A[X],je={},te={};for(let Q=1;Q<=z.length;Q++)te[Q+ce]=Le[Q],je[Q+ce]=!0,ce+=x(z[Q-1]);A[X]=te,A[X]._emit=je,A[X]._multi=!0}function ae(A){if(Array.isArray(A.begin)){if(A.skip||A.excludeBegin||A.returnBegin)throw Re("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),G;if(typeof A.beginScope!="object"||A.beginScope===null)throw Re("beginScope must be object"),G;ee(A,A.begin,{key:"beginScope"}),A.begin=j(A.begin,{joinWith:""})}}function we(A){if(Array.isArray(A.end)){if(A.skip||A.excludeEnd||A.returnEnd)throw Re("skip, excludeEnd, returnEnd not compatible with endScope: {}"),G;if(typeof A.endScope!="object"||A.endScope===null)throw Re("endScope must be object"),G;ee(A,A.end,{key:"endScope"}),A.end=j(A.end,{joinWith:""})}}function Ke(A){A.scope&&typeof A.scope=="object"&&A.scope!==null&&(A.beginScope=A.scope,delete A.scope)}function kt(A){Ke(A),typeof A.beginScope=="string"&&(A.beginScope={_wrap:A.beginScope}),typeof A.endScope=="string"&&(A.endScope={_wrap:A.endScope}),ae(A),we(A)}function ct(A){function z(te,Q){return new RegExp(p(te),"m"+(A.case_insensitive?"i":"")+(A.unicodeRegex?"u":"")+(Q?"g":""))}class X{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Q,le){le.position=this.position++,this.matchIndexes[this.matchAt]=le,this.regexes.push([le,Q]),this.matchAt+=x(Q)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Q=this.regexes.map(le=>le[1]);this.matcherRe=z(j(Q,{joinWith:"|"}),!0),this.lastIndex=0}exec(Q){this.matcherRe.lastIndex=this.lastIndex;const le=this.matcherRe.exec(Q);if(!le)return null;const Fe=le.findIndex((sn,rr)=>rr>0&&sn!==void 0),De=this.matchIndexes[Fe];return le.splice(0,Fe),Object.assign(le,De)}}class ce{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Q){if(this.multiRegexes[Q])return this.multiRegexes[Q];const le=new X;return this.rules.slice(Q).forEach(([Fe,De])=>le.addRule(Fe,De)),le.compile(),this.multiRegexes[Q]=le,le}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Q,le){this.rules.push([Q,le]),le.type==="begin"&&this.count++}exec(Q){const le=this.getMatcher(this.regexIndex);le.lastIndex=this.lastIndex;let Fe=le.exec(Q);if(this.resumingScanAtSamePosition()&&!(Fe&&Fe.index===this.lastIndex)){const De=this.getMatcher(0);De.lastIndex=this.lastIndex+1,Fe=De.exec(Q)}return Fe&&(this.regexIndex+=Fe.position+1,this.regexIndex===this.count&&this.considerAll()),Fe}}function Le(te){const Q=new ce;return te.contains.forEach(le=>Q.addRule(le.begin,{rule:le,type:"begin"})),te.terminatorEnd&&Q.addRule(te.terminatorEnd,{type:"end"}),te.illegal&&Q.addRule(te.illegal,{type:"illegal"}),Q}function je(te,Q){const le=te;if(te.isCompiled)return le;[at,yt,kt,lt].forEach(De=>De(te,Q)),A.compilerExtensions.forEach(De=>De(te,Q)),te.__beforeBegin=null,[St,Pt,ke].forEach(De=>De(te,Q)),te.isCompiled=!0;let Fe=null;return typeof te.keywords=="object"&&te.keywords.$pattern&&(te.keywords=Object.assign({},te.keywords),Fe=te.keywords.$pattern,delete te.keywords.$pattern),Fe=Fe||/\w+/,te.keywords&&(te.keywords=Bt(te.keywords,A.case_insensitive)),le.keywordPatternRe=z(Fe,!0),Q&&(te.begin||(te.begin=/\B|\b/),le.beginRe=z(le.begin),!te.end&&!te.endsWithParent&&(te.end=/\B|\b/),te.end&&(le.endRe=z(le.end)),le.terminatorEnd=p(le.end)||"",te.endsWithParent&&Q.terminatorEnd&&(le.terminatorEnd+=(te.end?"|":"")+Q.terminatorEnd)),te.illegal&&(le.illegalRe=z(te.illegal)),te.contains||(te.contains=[]),te.contains=[].concat(...te.contains.map(function(De){return Ft(De==="self"?te:De)})),te.contains.forEach(function(De){je(De,le)}),te.starts&&je(te.starts,Q),le.matcher=Le(le),le}if(A.compilerExtensions||(A.compilerExtensions=[]),A.contains&&A.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return A.classNameAliases=r(A.classNameAliases||{}),je(A)}function Tt(A){return A?A.endsWithParent||Tt(A.starts):!1}function Ft(A){return A.variants&&!A.cachedVariants&&(A.cachedVariants=A.variants.map(function(z){return r(A,{variants:null},z)})),A.cachedVariants?A.cachedVariants:Tt(A)?r(A,{starts:A.starts?r(A.starts):null}):Object.isFrozen(A)?r(A):A}var Ge="11.11.1";class Ct extends Error{constructor(z,X){super(z),this.name="HTMLInjectionError",this.html=X}}const Ze=n,vi=r,ki=Symbol("nomatch"),al=7,Ei=function(A){const z=Object.create(null),X=Object.create(null),ce=[];let Le=!0;const je="Could not find the language '{}', did you forget to load/include a language module?",te={disableAutodetect:!0,name:"Plain text",contains:[]};let Q={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:d};function le(Y){return Q.noHighlightRe.test(Y)}function Fe(Y){let oe=Y.className+" ";oe+=Y.parentNode?Y.parentNode.className:"";const ye=Q.languageDetectRe.exec(oe);if(ye){const Te=At(ye[1]);return Te||(fe(je.replace("{}",ye[1])),fe("Falling back to no-highlight mode for this block.",Y)),Te?ye[1]:"no-highlight"}return oe.split(/\s+/).find(Te=>le(Te)||At(Te))}function De(Y,oe,ye){let Te="",Be="";typeof oe=="object"?(Te=Y,ye=oe.ignoreIllegals,Be=oe.language):(P("10.7.0","highlight(lang, code, ...args) has been deprecated."),P("10.7.0",`Please use highlight(code, options) instead. -https://github.com/highlightjs/highlight.js/issues/2277`),Be=Y,Te=oe),ye===void 0&&(ye=!0);const ut={code:Te,language:Be};wn("before:highlight",ut);const Mt=ut.result?ut.result:sn(ut.language,ut.code,ye);return Mt.code=ut.code,wn("after:highlight",Mt),Mt}function sn(Y,oe,ye,Te){const Be=Object.create(null);function ut(Z,ne){return Z.keywords[ne]}function Mt(){if(!ue.keywords){$e.addText(Ce);return}let Z=0;ue.keywordPatternRe.lastIndex=0;let ne=ue.keywordPatternRe.exec(Ce),me="";for(;ne;){me+=Ce.substring(Z,ne.index);const _e=ft.case_insensitive?ne[0].toLowerCase():ne[0],Ue=ut(ue,_e);if(Ue){const[Et,_l]=Ue;if($e.addText(me),me="",Be[_e]=(Be[_e]||0)+1,Be[_e]<=al&&(Sn+=_l),Et.startsWith("_"))me+=ne[0];else{const Nl=ft.classNameAliases[Et]||Et;pt(ne[0],Nl)}}else me+=ne[0];Z=ue.keywordPatternRe.lastIndex,ne=ue.keywordPatternRe.exec(Ce)}me+=Ce.substring(Z),$e.addText(me)}function _n(){if(Ce==="")return;let Z=null;if(typeof ue.subLanguage=="string"){if(!z[ue.subLanguage]){$e.addText(Ce);return}Z=sn(ue.subLanguage,Ce,!0,Mi[ue.subLanguage]),Mi[ue.subLanguage]=Z._top}else Z=ir(Ce,ue.subLanguage.length?ue.subLanguage:null);ue.relevance>0&&(Sn+=Z.relevance),$e.__addSublanguage(Z._emitter,Z.language)}function Je(){ue.subLanguage!=null?_n():Mt(),Ce=""}function pt(Z,ne){Z!==""&&($e.startScope(ne),$e.addText(Z),$e.endScope())}function Si(Z,ne){let me=1;const _e=ne.length-1;for(;me<=_e;){if(!Z._emit[me]){me++;continue}const Ue=ft.classNameAliases[Z[me]]||Z[me],Et=ne[me];Ue?pt(Et,Ue):(Ce=Et,Mt(),Ce=""),me++}}function Ti(Z,ne){return Z.scope&&typeof Z.scope=="string"&&$e.openNode(ft.classNameAliases[Z.scope]||Z.scope),Z.beginScope&&(Z.beginScope._wrap?(pt(Ce,ft.classNameAliases[Z.beginScope._wrap]||Z.beginScope._wrap),Ce=""):Z.beginScope._multi&&(Si(Z.beginScope,ne),Ce="")),ue=Object.create(Z,{parent:{value:ue}}),ue}function Ci(Z,ne,me){let _e=C(Z.endRe,me);if(_e){if(Z["on:end"]){const Ue=new t(Z);Z["on:end"](ne,Ue),Ue.isMatchIgnored&&(_e=!1)}if(_e){for(;Z.endsParent&&Z.parent;)Z=Z.parent;return Z}}if(Z.endsWithParent)return Ci(Z.parent,ne,me)}function yl(Z){return ue.matcher.regexIndex===0?(Ce+=Z[0],1):(lr=!0,0)}function vl(Z){const ne=Z[0],me=Z.rule,_e=new t(me),Ue=[me.__beforeBegin,me["on:begin"]];for(const Et of Ue)if(Et&&(Et(Z,_e),_e.isMatchIgnored))return yl(ne);return me.skip?Ce+=ne:(me.excludeBegin&&(Ce+=ne),Je(),!me.returnBegin&&!me.excludeBegin&&(Ce=ne)),Ti(me,Z),me.returnBegin?0:ne.length}function kl(Z){const ne=Z[0],me=oe.substring(Z.index),_e=Ci(ue,Z,me);if(!_e)return ki;const Ue=ue;ue.endScope&&ue.endScope._wrap?(Je(),pt(ne,ue.endScope._wrap)):ue.endScope&&ue.endScope._multi?(Je(),Si(ue.endScope,Z)):Ue.skip?Ce+=ne:(Ue.returnEnd||Ue.excludeEnd||(Ce+=ne),Je(),Ue.excludeEnd&&(Ce=ne));do ue.scope&&$e.closeNode(),!ue.skip&&!ue.subLanguage&&(Sn+=ue.relevance),ue=ue.parent;while(ue!==_e.parent);return _e.starts&&Ti(_e.starts,Z),Ue.returnEnd?0:ne.length}function El(){const Z=[];for(let ne=ue;ne!==ft;ne=ne.parent)ne.scope&&Z.unshift(ne.scope);Z.forEach(ne=>$e.openNode(ne))}let Nn={};function Ai(Z,ne){const me=ne&&ne[0];if(Ce+=Z,me==null)return Je(),0;if(Nn.type==="begin"&&ne.type==="end"&&Nn.index===ne.index&&me===""){if(Ce+=oe.slice(ne.index,ne.index+1),!Le){const _e=new Error(`0 width match regex (${Y})`);throw _e.languageName=Y,_e.badRule=Nn.rule,_e}return 1}if(Nn=ne,ne.type==="begin")return vl(ne);if(ne.type==="illegal"&&!ye){const _e=new Error('Illegal lexeme "'+me+'" for mode "'+(ue.scope||"")+'"');throw _e.mode=ue,_e}else if(ne.type==="end"){const _e=kl(ne);if(_e!==ki)return _e}if(ne.type==="illegal"&&me==="")return Ce+=` -`,1;if(ar>1e5&&ar>ne.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ce+=me,me.length}const ft=At(Y);if(!ft)throw Re(je.replace("{}",Y)),new Error('Unknown language: "'+Y+'"');const wl=ct(ft);let sr="",ue=Te||wl;const Mi={},$e=new Q.__emitter(Q);El();let Ce="",Sn=0,zt=0,ar=0,lr=!1;try{if(ft.__emitTokens)ft.__emitTokens(oe,$e);else{for(ue.matcher.considerAll();;){ar++,lr?lr=!1:ue.matcher.considerAll(),ue.matcher.lastIndex=zt;const Z=ue.matcher.exec(oe);if(!Z)break;const ne=oe.substring(zt,Z.index),me=Ai(ne,Z);zt=Z.index+me}Ai(oe.substring(zt))}return $e.finalize(),sr=$e.toHTML(),{language:Y,value:sr,relevance:Sn,illegal:!1,_emitter:$e,_top:ue}}catch(Z){if(Z.message&&Z.message.includes("Illegal"))return{language:Y,value:Ze(oe),illegal:!0,relevance:0,_illegalBy:{message:Z.message,index:zt,context:oe.slice(zt-100,zt+100),mode:Z.mode,resultSoFar:sr},_emitter:$e};if(Le)return{language:Y,value:Ze(oe),illegal:!1,relevance:0,errorRaised:Z,_emitter:$e,_top:ue};throw Z}}function rr(Y){const oe={value:Ze(Y),illegal:!1,relevance:0,_top:te,_emitter:new Q.__emitter(Q)};return oe._emitter.addText(Y),oe}function ir(Y,oe){oe=oe||Q.languages||Object.keys(z);const ye=rr(Y),Te=oe.filter(At).filter(Ni).map(Je=>sn(Je,Y,!1));Te.unshift(ye);const Be=Te.sort((Je,pt)=>{if(Je.relevance!==pt.relevance)return pt.relevance-Je.relevance;if(Je.language&&pt.language){if(At(Je.language).supersetOf===pt.language)return 1;if(At(pt.language).supersetOf===Je.language)return-1}return 0}),[ut,Mt]=Be,_n=ut;return _n.secondBest=Mt,_n}function ll(Y,oe,ye){const Te=oe&&X[oe]||ye;Y.classList.add("hljs"),Y.classList.add(`language-${Te}`)}function or(Y){let oe=null;const ye=Fe(Y);if(le(ye))return;if(wn("before:highlightElement",{el:Y,language:ye}),Y.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",Y);return}if(Y.children.length>0&&(Q.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(Y)),Q.throwUnescapedHTML))throw new Ct("One of your code blocks includes unescaped HTML.",Y.innerHTML);oe=Y;const Te=oe.textContent,Be=ye?De(Te,{language:ye,ignoreIllegals:!0}):ir(Te);Y.innerHTML=Be.value,Y.dataset.highlighted="yes",ll(Y,ye,Be.language),Y.result={language:Be.language,re:Be.relevance,relevance:Be.relevance},Be.secondBest&&(Y.secondBest={language:Be.secondBest.language,relevance:Be.secondBest.relevance}),wn("after:highlightElement",{el:Y,result:Be,text:Te})}function cl(Y){Q=vi(Q,Y)}const ul=()=>{En(),P("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function dl(){En(),P("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let wi=!1;function En(){function Y(){En()}if(document.readyState==="loading"){wi||window.addEventListener("DOMContentLoaded",Y,!1),wi=!0;return}document.querySelectorAll(Q.cssSelector).forEach(or)}function pl(Y,oe){let ye=null;try{ye=oe(A)}catch(Te){if(Re("Language definition for '{}' could not be registered.".replace("{}",Y)),Le)Re(Te);else throw Te;ye=te}ye.name||(ye.name=Y),z[Y]=ye,ye.rawDefinition=oe.bind(null,A),ye.aliases&&_i(ye.aliases,{languageName:Y})}function fl(Y){delete z[Y];for(const oe of Object.keys(X))X[oe]===Y&&delete X[oe]}function ml(){return Object.keys(z)}function At(Y){return Y=(Y||"").toLowerCase(),z[Y]||z[X[Y]]}function _i(Y,{languageName:oe}){typeof Y=="string"&&(Y=[Y]),Y.forEach(ye=>{X[ye.toLowerCase()]=oe})}function Ni(Y){const oe=At(Y);return oe&&!oe.disableAutodetect}function gl(Y){Y["before:highlightBlock"]&&!Y["before:highlightElement"]&&(Y["before:highlightElement"]=oe=>{Y["before:highlightBlock"](Object.assign({block:oe.el},oe))}),Y["after:highlightBlock"]&&!Y["after:highlightElement"]&&(Y["after:highlightElement"]=oe=>{Y["after:highlightBlock"](Object.assign({block:oe.el},oe))})}function hl(Y){gl(Y),ce.push(Y)}function bl(Y){const oe=ce.indexOf(Y);oe!==-1&&ce.splice(oe,1)}function wn(Y,oe){const ye=Y;ce.forEach(function(Te){Te[ye]&&Te[ye](oe)})}function xl(Y){return P("10.7.0","highlightBlock will be removed entirely in v12.0"),P("10.7.0","Please use highlightElement now."),or(Y)}Object.assign(A,{highlight:De,highlightAuto:ir,highlightAll:En,highlightElement:or,highlightBlock:xl,configure:cl,initHighlighting:ul,initHighlightingOnLoad:dl,registerLanguage:pl,unregisterLanguage:fl,listLanguages:ml,getLanguage:At,registerAliases:_i,autoDetection:Ni,inherit:vi,addPlugin:hl,removePlugin:bl}),A.debugMode=function(){Le=!1},A.safeMode=function(){Le=!0},A.versionString=Ge,A.regex={concat:h,lookahead:m,either:y,optional:b,anyNumberOfTimes:f};for(const Y in Oe)typeof Oe[Y]=="object"&&e(Oe[Y]);return Object.assign(A,Oe),A},Vt=Ei({});return Vt.newInstance=()=>Ei({}),Ar=Vt,Vt.HighlightJS=Vt,Vt.default=Vt,Ar}var zh=Fh();const $h=Xr(zh),us={},Uh="hljs-";function Hh(e){const t=$h.newInstance();return e&&s(e),{highlight:n,highlightAuto:r,listLanguages:i,register:s,registerAlias:o,registered:l};function n(u,c,d){const p=d||us,m=typeof p.prefix=="string"?p.prefix:Uh;if(!t.getLanguage(u))throw new Error("Unknown language: `"+u+"` is not registered");t.configure({__emitter:Wh,classPrefix:m});const f=t.highlight(c,{ignoreIllegals:!0,language:u});if(f.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:f.errorRaised});const b=f._emitter.root,h=b.data;return h.language=f.language,h.relevance=f.relevance,b}function r(u,c){const p=(c||us).subset||i();let m=-1,f=0,b;for(;++mf&&(f=v.data.relevance,b=v)}return b||{type:"root",children:[],data:{language:void 0,relevance:f}}}function i(){return t.listLanguages()}function s(u,c){if(typeof u=="string")t.registerLanguage(u,c);else{let d;for(d in u)Object.hasOwn(u,d)&&t.registerLanguage(d,u[d])}}function o(u,c){if(typeof u=="string")t.registerAliases(typeof c=="string"?c:[...c],{languageName:u});else{let d;for(d in u)if(Object.hasOwn(u,d)){const p=u[d];t.registerAliases(typeof p=="string"?p:[...p],{languageName:d})}}}function l(u){return!!t.getLanguage(u)}}class Wh{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],i=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:i}):r.children.push(...i)}openNode(t){const n=this,r=t.split(".").map(function(o,l){return l?o+"_".repeat(l):n.options.classPrefix+o}),i=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:r},children:[]};i.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Kh={};function Gh(e){const t=e||Kh,n=t.aliases,r=t.detect||!1,i=t.languages||Bh,s=t.plainText,o=t.prefix,l=t.subset;let u="hljs";const c=Hh(i);if(n&&c.registerAlias(n),o){const d=o.indexOf("-");u=d===-1?o:o.slice(0,d)}return function(d,p){nr(d,"element",function(m,f,b){if(m.tagName!=="code"||!b||b.type!=="element"||b.tagName!=="pre")return;const h=qh(m);if(h===!1||!h&&!r||h&&s&&s.includes(h))return;Array.isArray(m.properties.className)||(m.properties.className=[]),m.properties.className.includes(u)||m.properties.className.unshift(u);const v=dg(m,{whitespace:"pre"});let y;try{y=h?c.highlight(h,v,{prefix:o}):c.highlightAuto(v,{prefix:o,subset:l})}catch(x){const C=x;if(h&&/Unknown language/.test(C.message)){p.message("Cannot highlight as `"+h+"`, it’s not registered",{ancestors:[b,m],cause:C,place:m.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw C}!h&&y.data&&y.data.language&&m.properties.className.push("language-"+y.data.language),y.children.length>0&&(m.children=y.children)})}}function qh(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n0?{type:"text",value:N}:void 0),N===!1?m.lastIndex=O+1:(b!==O&&x.push({type:"text",value:c.value.slice(b,O)}),Array.isArray(N)?x.push(...N):N&&x.push(N),b=O+C[0].length,y=!0),!m.global)break;C=m.exec(c.value)}return y?(b?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=ds(e,"(");let s=ds(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function Ba(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Wt(n)||Jn(n))&&(!t||n!==47)}Fa.peek=yb;function db(){this.buffer()}function pb(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function fb(){this.buffer()}function mb(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function gb(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=dt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hb(e){this.exit(e)}function bb(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=dt(this.sliceSerialize(e)).toLowerCase(),n.label=t}function xb(e){this.exit(e)}function yb(){return"["}function Fa(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),l=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),l(),o(),s+=i.move("]"),s}function vb(){return{enter:{gfmFootnoteCallString:db,gfmFootnoteCall:pb,gfmFootnoteDefinitionLabelString:fb,gfmFootnoteDefinition:mb},exit:{gfmFootnoteCallString:gb,gfmFootnoteCall:hb,gfmFootnoteDefinitionLabelString:bb,gfmFootnoteDefinition:xb}}}function kb(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Fa},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const l=s.createTracker(o);let u=l.move("[^");const c=s.enter("footnoteDefinition"),d=s.enter("label");return u+=l.move(s.safe(s.associationId(r),{before:u,after:"]"})),d(),u+=l.move("]:"),r.children&&r.children.length>0&&(l.shift(4),u+=l.move((t?` -`:" ")+s.indentLines(s.containerFlow(r,l.current()),t?za:Eb))),c(),u}}function Eb(e,t,n){return t===0?e:za(e,t,n)}function za(e,t,n){return(n?"":" ")+e}const wb=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];$a.peek=Cb;function _b(){return{canContainEols:["delete"],enter:{strikethrough:Sb},exit:{strikethrough:Tb}}}function Nb(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:wb}],handlers:{delete:$a}}}function Sb(e){this.enter({type:"delete",children:[]},e)}function Tb(e){this.exit(e)}function $a(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function Cb(){return"~"}function Ab(e){return e.length}function Mb(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Ab,s=[],o=[],l=[],u=[];let c=0,d=-1;for(;++dc&&(c=e[d].length);++yu[y])&&(u[y]=C)}h.push(x)}o[d]=h,l[d]=v}let p=-1;if(typeof r=="object"&&"length"in r)for(;++pu[p]&&(u[p]=x),f[p]=x),m[p]=C}o.splice(1,0,m),l.splice(1,0,f),d=-1;const b=[];for(;++d "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),Ob);return i(),o}function Ob(e,t,n){return">"+(n?"":" ")+e}function Lb(e,t){return fs(e,t.inConstruct,!0)&&!fs(e,t.notInConstruct,!1)}function fs(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ro&&(o=s):s=1,i=r+t.length,r=n.indexOf(t,i);return o}function Db(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function Pb(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Bb(e,t,n,r){const i=Pb(n),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(Db(e,n)){const p=n.enter("codeIndented"),m=n.indentLines(s,Fb);return p(),m}const l=n.createTracker(r),u=i.repeat(Math.max(jb(s,i)+1,3)),c=n.enter("codeFenced");let d=l.move(u);if(e.lang){const p=n.enter(`codeFencedLang${o}`);d+=l.move(n.safe(e.lang,{before:d,after:" ",encode:["`"],...l.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${o}`);d+=l.move(" "),d+=l.move(n.safe(e.meta,{before:d,after:` -`,encode:["`"],...l.current()})),p()}return d+=l.move(` -`),s&&(d+=l.move(s+` -`)),d+=l.move(u),c(),d}function Fb(e,t,n){return(n?"":" ")+e}function bi(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function zb(e,t,n,r){const i=bi(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let l=n.enter("label");const u=n.createTracker(r);let c=u.move("[");return c+=u.move(n.safe(n.associationId(e),{before:c,after:"]",...u.current()})),c+=u.move("]: "),l(),!e.url||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(l=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":` -`,...u.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),l()),o(),c}function $b(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function bn(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Vn(e,t,n){const r=nn(e),i=nn(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Ua.peek=Ub;function Ua(e,t,n,r){const i=$b(n),s=n.enter("emphasis"),o=n.createTracker(r),l=o.move(i);let u=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const c=u.charCodeAt(0),d=Vn(r.before.charCodeAt(r.before.length-1),c,i);d.inside&&(u=bn(c)+u.slice(1));const p=u.charCodeAt(u.length-1),m=Vn(r.after.charCodeAt(0),p,i);m.inside&&(u=u.slice(0,-1)+bn(p));const f=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:m.outside,before:d.outside},l+u+f}function Ub(e,t,n){return n.options.emphasis||"*"}function Hb(e,t){let n=!1;return nr(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Wr}),!!((!e.depth||e.depth<3)&&ai(e)&&(t.options.setext||n))}function Wb(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(Hb(e,n)){const d=n.enter("headingSetext"),p=n.enter("phrasing"),m=n.containerPhrasing(e,{...s.current(),before:` -`,after:` -`});return p(),d(),m+` -`+(i===1?"=":"-").repeat(m.length-(Math.max(m.lastIndexOf("\r"),m.lastIndexOf(` -`))+1))}const o="#".repeat(i),l=n.enter("headingAtx"),u=n.enter("phrasing");s.move(o+" ");let c=n.containerPhrasing(e,{before:"# ",after:` -`,...s.current()});return/^[\t ]/.test(c)&&(c=bn(c.charCodeAt(0))+c.slice(1)),c=c?o+" "+c:o,n.options.closeAtx&&(c+=" "+o),u(),l(),c}Ha.peek=Kb;function Ha(e){return e.value||""}function Kb(){return"<"}Wa.peek=Gb;function Wa(e,t,n,r){const i=bi(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let l=n.enter("label");const u=n.createTracker(r);let c=u.move("![");return c+=u.move(n.safe(e.alt,{before:c,after:"]",...u.current()})),c+=u.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),c+=u.move("<"),c+=u.move(n.safe(e.url,{before:c,after:">",...u.current()})),c+=u.move(">")):(l=n.enter("destinationRaw"),c+=u.move(n.safe(e.url,{before:c,after:e.title?" ":")",...u.current()}))),l(),e.title&&(l=n.enter(`title${s}`),c+=u.move(" "+i),c+=u.move(n.safe(e.title,{before:c,after:i,...u.current()})),c+=u.move(i),l()),c+=u.move(")"),o(),c}function Gb(){return"!"}Ka.peek=qb;function Ka(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("![");const c=n.safe(e.alt,{before:u,after:"]",...l.current()});u+=l.move(c+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return o(),n.stack=d,s(),i==="full"||!c||c!==p?u+=l.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function qb(){return"!"}Ga.peek=Vb;function Ga(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s\u007F]/.test(e.url))}Va.peek=Yb;function Va(e,t,n,r){const i=bi(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let l,u;if(qa(e,n)){const d=n.stack;n.stack=[],l=n.enter("autolink");let p=o.move("<");return p+=o.move(n.containerPhrasing(e,{before:p,after:">",...o.current()})),p+=o.move(">"),l(),n.stack=d,p}l=n.enter("link"),u=n.enter("label");let c=o.move("[");return c+=o.move(n.containerPhrasing(e,{before:c,after:"](",...o.current()})),c+=o.move("]("),u(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),c+=o.move("<"),c+=o.move(n.safe(e.url,{before:c,after:">",...o.current()})),c+=o.move(">")):(u=n.enter("destinationRaw"),c+=o.move(n.safe(e.url,{before:c,after:e.title?" ":")",...o.current()}))),u(),e.title&&(u=n.enter(`title${s}`),c+=o.move(" "+i),c+=o.move(n.safe(e.title,{before:c,after:i,...o.current()})),c+=o.move(i),u()),c+=o.move(")"),l(),c}function Yb(e,t,n){return qa(e,n)?"<":"["}Ya.peek=Xb;function Ya(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const l=n.createTracker(r);let u=l.move("[");const c=n.containerPhrasing(e,{before:u,after:"]",...l.current()});u+=l.move(c+"]["),o();const d=n.stack;n.stack=[],o=n.enter("reference");const p=n.safe(n.associationId(e),{before:u,after:"]",...l.current()});return o(),n.stack=d,s(),i==="full"||!c||c!==p?u+=l.move(p+"]"):i==="shortcut"?u=u.slice(0,-1):u+=l.move("]"),u}function Xb(){return"["}function xi(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Zb(e){const t=xi(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Jb(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Xa(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function Qb(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?Jb(n):xi(n);const l=e.ordered?o==="."?")":".":Zb(n);let u=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const d=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(u=!0),Xa(n)===o&&d){let p=-1;for(;++p-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const l=n.createTracker(r);l.move(s+" ".repeat(o-s.length)),l.shift(o);const u=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,l.current()),d);return u(),c;function d(p,m,f){return m?(f?"":" ".repeat(o))+p:(f?s:s+" ".repeat(o-s.length))+p}}function nx(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const rx=vn(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function ix(e,t,n,r){return(e.children.some(function(o){return rx(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function ox(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Za.peek=sx;function Za(e,t,n,r){const i=ox(n),s=n.enter("strong"),o=n.createTracker(r),l=o.move(i+i);let u=o.move(n.containerPhrasing(e,{after:i,before:l,...o.current()}));const c=u.charCodeAt(0),d=Vn(r.before.charCodeAt(r.before.length-1),c,i);d.inside&&(u=bn(c)+u.slice(1));const p=u.charCodeAt(u.length-1),m=Vn(r.after.charCodeAt(0),p,i);m.inside&&(u=u.slice(0,-1)+bn(p));const f=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:m.outside,before:d.outside},l+u+f}function sx(e,t,n){return n.options.strong||"*"}function ax(e,t,n,r){return n.safe(e.value,r)}function lx(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function cx(e,t,n){const r=(Xa(n)+(n.options.ruleSpaces?" ":"")).repeat(lx(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Ja={blockquote:Rb,break:ms,code:Bb,definition:zb,emphasis:Ua,hardBreak:ms,heading:Wb,html:Ha,image:Wa,imageReference:Ka,inlineCode:Ga,link:Va,linkReference:Ya,list:Qb,listItem:tx,paragraph:nx,root:ix,strong:Za,text:ax,thematicBreak:cx};function ux(){return{enter:{table:dx,tableData:gs,tableHeader:gs,tableRow:fx},exit:{codeText:mx,table:px,tableData:Or,tableHeader:Or,tableRow:Or}}}function dx(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function px(e){this.exit(e),this.data.inTable=void 0}function fx(e){this.enter({type:"tableRow",children:[]},e)}function Or(e){this.exit(e)}function gs(e){this.enter({type:"tableCell",children:[]},e)}function mx(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,gx));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function gx(e,t){return t==="|"?t:e}function hx(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` -`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:m,table:o,tableCell:u,tableRow:l}};function o(f,b,h,v){return c(d(f,h,v),f.align)}function l(f,b,h,v){const y=p(f,h,v),x=c([y]);return x.slice(0,x.indexOf(` -`))}function u(f,b,h,v){const y=h.enter("tableCell"),x=h.enter("phrasing"),C=h.containerPhrasing(f,{...v,before:s,after:s});return x(),y(),C}function c(f,b){return Mb(f,{align:b,alignDelimiters:r,padding:n,stringLength:i})}function d(f,b,h){const v=f.children;let y=-1;const x=[],C=b.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const Lx={tokenize:Ux,partial:!0};function jx(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:Fx,continuation:{tokenize:zx},exit:$x}},text:{91:{name:"gfmFootnoteCall",tokenize:Bx},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:Dx,resolveTo:Px}}}}function Dx(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const u=r.events[i][1];if(u.type==="labelImage"){o=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return l;function l(u){if(!o||!o._balanced)return n(u);const c=dt(r.sliceSerialize({start:o.end,end:r.now()}));return c.codePointAt(0)!==94||!s.includes(c.slice(1))?n(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),t(u))}}function Px(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},l=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...l),e}function Bx(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return l;function l(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),u}function u(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",c)}function c(p){if(s>999||p===93&&!o||p===null||p===91||Se(p))return n(p);if(p===93){e.exit("chunkString");const m=e.exit("gfmFootnoteCallString");return i.includes(dt(r.sliceSerialize(m)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return Se(p)||(o=!0),s++,e.consume(p),p===92?d:c}function d(p){return p===91||p===92||p===93?(e.consume(p),s++,c):c(p)}}function Fx(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,l;return u;function u(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),c}function c(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",d):n(b)}function d(b){if(o>999||b===93&&!l||b===null||b===91||Se(b))return n(b);if(b===93){e.exit("chunkString");const h=e.exit("gfmFootnoteDefinitionLabelString");return s=dt(r.sliceSerialize(h)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),m}return Se(b)||(l=!0),o++,e.consume(b),b===92?p:d}function p(b){return b===91||b===92||b===93?(e.consume(b),o++,d):d(b)}function m(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),i.includes(s)||i.push(s),Ee(e,f,"gfmFootnoteDefinitionWhitespace")):n(b)}function f(b){return t(b)}}function zx(e,t,n){return e.check(yn,t,e.attempt(Lx,t,n))}function $x(e){e.exit("gfmFootnoteDefinition")}function Ux(e,t,n){const r=this;return Ee(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function Hx(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,l){let u=-1;for(;++u1?u(b):(o.consume(b),p++,f);if(p<2&&!n)return u(b);const v=o.exit("strikethroughSequenceTemporary"),y=nn(b);return v._open=!y||y===2&&!!h,v._close=!h||h===2&&!!y,l(b)}}}class Wx{constructor(){this.map=[]}add(t,n,r){Kx(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function Kx(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i-1;){const w=r.events[T][1].type;if(w==="lineEnding"||w==="linePrefix")T--;else break}const L=T>-1?r.events[T][1].type:null,M=L==="tableHead"||L==="tableRow"?N:u;return M===N&&r.parser.lazy[r.now().line]?n(S):M(S)}function u(S){return e.enter("tableHead"),e.enter("tableRow"),c(S)}function c(S){return S===124||(o=!0,s+=1),d(S)}function d(S){return S===null?n(S):se(S)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),f):n(S):he(S)?Ee(e,d,"whitespace")(S):(s+=1,o&&(o=!1,i+=1),S===124?(e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),o=!0,d):(e.enter("data"),p(S)))}function p(S){return S===null||S===124||Se(S)?(e.exit("data"),d(S)):(e.consume(S),S===92?m:p)}function m(S){return S===92||S===124?(e.consume(S),p):p(S)}function f(S){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(S):(e.enter("tableDelimiterRow"),o=!1,he(S)?Ee(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(S):b(S))}function b(S){return S===45||S===58?v(S):S===124?(o=!0,e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),h):j(S)}function h(S){return he(S)?Ee(e,v,"whitespace")(S):v(S)}function v(S){return S===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(S),e.exit("tableDelimiterMarker"),y):S===45?(s+=1,y(S)):S===null||se(S)?O(S):j(S)}function y(S){return S===45?(e.enter("tableDelimiterFiller"),x(S)):j(S)}function x(S){return S===45?(e.consume(S),x):S===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(S),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(S))}function C(S){return he(S)?Ee(e,O,"whitespace")(S):O(S)}function O(S){return S===124?b(S):S===null||se(S)?!o||i!==s?j(S):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(S)):j(S)}function j(S){return n(S)}function N(S){return e.enter("tableRow"),B(S)}function B(S){return S===124?(e.enter("tableCellDivider"),e.consume(S),e.exit("tableCellDivider"),B):S===null||se(S)?(e.exit("tableRow"),t(S)):he(S)?Ee(e,B,"whitespace")(S):(e.enter("data"),D(S))}function D(S){return S===null||S===124||Se(S)?(e.exit("data"),B(S)):(e.consume(S),S===92?R:D)}function R(S){return S===92||S===124?(e.consume(S),D):D(S)}}function Yx(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],l=!1,u=0,c,d,p;const m=new Wx;for(;++nn[2]+1){const b=n[2]+1,h=n[3]-n[2]-1;e.add(b,h,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return i!==void 0&&(s.end=Object.assign({},Qt(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function bs(e,t,n,r,i){const s=[],o=Qt(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function Qt(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const Xx={name:"tasklistCheck",tokenize:Jx};function Zx(){return{text:{91:Xx}}}function Jx(e,t,n){const r=this;return i;function i(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),s)}function s(u){return Se(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),o):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),o):n(u)}function o(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),l):n(u)}function l(u){return se(u)?t(u):he(u)?e.check({tokenize:Qx},t,n)(u):n(u)}}function Qx(e,t,n){return Ee(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function ey(e){return Xs([Nx(),jx(),Hx(e),qx(),Zx()])}const ty={};function ny(e){const t=this,n=e||ty,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(ey(n)),s.push(kx()),o.push(Ex(n))}const ry={user:{label:"You",color:"var(--info)"},assistant:{label:"AI",color:"var(--success)"},tool:{label:"Tool",color:"var(--warning)"},plan:{label:"Plan",color:"var(--accent)"},thinking:{label:"Reasoning",color:"var(--text-muted)"}};function iy({message:e}){const[t,n]=_.useState(!1);return a.jsxs("div",{className:"py-1.5",children:[a.jsxs("button",{onClick:()=>n(!t),className:"flex items-center gap-1.5 mb-0.5 cursor-pointer",style:{background:"none",border:"none",padding:0},children:[a.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:"var(--text-muted)",opacity:.5}}),a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--text-muted)"},children:"Reasoning"}),a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-muted)",strokeWidth:"2",style:{transform:t?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.15s",marginLeft:2},children:a.jsx("path",{d:"M6 9l6 6 6-6"})})]}),t&&a.jsx("div",{className:"text-[12px] leading-relaxed pl-2.5 max-w-prose whitespace-pre-wrap",style:{color:"var(--text-muted)",fontStyle:"italic"},children:e.content})]})}function oy({message:e}){const t=e.planItems??[];return a.jsxs("div",{className:"py-1.5",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:"var(--accent)"}}),a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--accent)"},children:"Plan"})]}),a.jsx("div",{className:"pl-2.5 space-y-1 mt-1",children:t.map((n,r)=>a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[n.status==="completed"?a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--success)",strokeWidth:"2.5",strokeLinecap:"round",children:a.jsx("path",{d:"M20 6L9 17l-5-5"})}):n.status==="in_progress"?a.jsx("span",{className:"w-3.5 h-3.5 flex items-center justify-center",children:a.jsx("span",{className:"w-2 h-2 rounded-full animate-pulse",style:{background:"var(--accent)"}})}):a.jsx("span",{className:"w-3.5 h-3.5 flex items-center justify-center",children:a.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:"var(--text-muted)",opacity:.4}})}),a.jsx("span",{style:{color:n.status==="completed"?"var(--text-muted)":"var(--text-primary)",textDecoration:n.status==="completed"?"line-through":"none"},children:n.title})]},r))})]})}function sy({tc:e}){const t=n=>{if(!e.tool_call_id)return;const r=ze.getState().sessionId;r&&(ze.getState().resolveToolApproval(e.tool_call_id,n),Xn().sendToolApproval(r,e.tool_call_id,n))};return a.jsxs("div",{className:"rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--warning) 40%, var(--border))"},children:[a.jsxs("div",{className:"px-3 py-2 flex items-center gap-2",style:{background:"color-mix(in srgb, var(--warning) 10%, var(--bg-secondary))"},children:[a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--warning)"},children:"Action Required"}),a.jsx("span",{className:"text-[11px] font-mono px-1.5 py-0.5 rounded",style:{background:"color-mix(in srgb, var(--warning) 15%, var(--bg-secondary))",color:"var(--text-primary)"},children:e.tool})]}),e.args!=null&&a.jsx("pre",{className:"px-3 py-2 text-[11px] font-mono whitespace-pre-wrap break-words overflow-y-auto leading-normal",style:{background:"var(--bg-secondary)",color:"var(--text-secondary)",maxHeight:200},children:JSON.stringify(e.args,null,2)}),a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",style:{background:"var(--bg-secondary)",borderTop:"1px solid var(--border)"},children:[a.jsx("button",{onClick:()=>t(!0),className:"text-xs font-semibold px-3 py-1.5 rounded cursor-pointer transition-colors",style:{background:"color-mix(in srgb, var(--success) 15%, var(--bg-secondary))",color:"var(--success)",border:"1px solid color-mix(in srgb, var(--success) 30%, var(--border))"},onMouseEnter:n=>{n.currentTarget.style.background="color-mix(in srgb, var(--success) 25%, var(--bg-secondary))"},onMouseLeave:n=>{n.currentTarget.style.background="color-mix(in srgb, var(--success) 15%, var(--bg-secondary))"},children:"Approve"}),a.jsx("button",{onClick:()=>t(!1),className:"text-xs font-semibold px-3 py-1.5 rounded cursor-pointer transition-colors",style:{background:"color-mix(in srgb, var(--error) 15%, var(--bg-secondary))",color:"var(--error)",border:"1px solid color-mix(in srgb, var(--error) 30%, var(--border))"},onMouseEnter:n=>{n.currentTarget.style.background="color-mix(in srgb, var(--error) 25%, var(--bg-secondary))"},onMouseLeave:n=>{n.currentTarget.style.background="color-mix(in srgb, var(--error) 15%, var(--bg-secondary))"},children:"Reject"})]})]})}function ay({tc:e,active:t,onClick:n}){const r=e.status==="denied",i=e.result!==void 0,s=r?"var(--error)":i?e.is_error?"var(--error)":"var(--success)":"var(--text-muted)",o=r?"✗":i?e.is_error?"✗":"✓":"•";return a.jsxs("button",{onClick:n,className:"inline-flex items-center gap-1 text-[11px] font-mono px-2 py-1 rounded cursor-pointer transition-all",style:{background:t?"var(--bg-secondary)":"var(--bg-primary)",border:t?"1px solid var(--text-muted)":"1px solid var(--border)",color:s},children:[o," ",e.tool,r&&a.jsx("span",{className:"ml-1 text-[10px] uppercase",children:"Denied"})]})}function ly({tc:e}){const t=e.result!==void 0,n=e.args!=null&&Object.keys(e.args).length>0;return a.jsxs("div",{className:"rounded-lg overflow-hidden",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5",style:{borderBottom:"1px solid var(--border)"},children:[a.jsx("span",{className:"text-[11px] font-mono font-semibold",style:{color:"var(--text-primary)"},children:e.tool}),e.is_error&&a.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 rounded",style:{background:"color-mix(in srgb, var(--error) 15%, transparent)",color:"var(--error)"},children:"Error"})]}),a.jsxs("div",{className:"flex flex-col gap-0",children:[n&&a.jsxs("div",{style:{borderBottom:t?"1px solid var(--border)":"none"},children:[a.jsx("div",{className:"px-3 pt-1.5 pb-0.5",children:a.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold",style:{color:"var(--text-muted)"},children:"Input"})}),a.jsx("pre",{className:"px-3 pb-2 text-[11px] font-mono whitespace-pre-wrap break-words overflow-y-auto leading-relaxed",style:{color:"var(--text-secondary)",maxHeight:160},children:JSON.stringify(e.args,null,2)})]}),t&&a.jsxs("div",{children:[a.jsx("div",{className:"px-3 pt-1.5 pb-0.5",children:a.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold",style:{color:e.is_error?"var(--error)":"var(--text-muted)"},children:"Output"})}),a.jsx("pre",{className:"px-3 pb-2 text-[11px] font-mono whitespace-pre-wrap break-words overflow-y-auto leading-relaxed",style:{color:e.is_error?"var(--error)":"var(--text-secondary)",maxHeight:240},children:e.result})]})]})]})}const xs=3;function cy({message:e}){const t=e.toolCalls??(e.toolCall?[e.toolCall]:[]),[n,r]=_.useState(!1),[i,s]=_.useState(null);if(t.length===0)return null;const o=t.find(p=>p.status==="pending");if(o)return a.jsx("div",{className:"py-1.5 pl-2.5",children:a.jsx(sy,{tc:o})});const l=t.length-xs,u=l>0&&!n,c=u?t.slice(-xs):t,d=u?l:0;return a.jsxs("div",{className:"py-1.5",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:"var(--warning)"}}),a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--warning)"},children:t.length===1?"Tool":`Tools (${t.length})`})]}),a.jsxs("div",{className:"pl-2.5 space-y-1.5",children:[a.jsxs("div",{className:"flex flex-wrap gap-1",children:[u&&a.jsxs("button",{onClick:()=>r(!0),className:"inline-flex items-center gap-1 text-[11px] font-mono px-2 py-1 rounded cursor-pointer hover:brightness-125",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-muted)"},children:["+",l," more"]}),c.map((p,m)=>{const f=m+d;return a.jsx(ay,{tc:p,active:i===f,onClick:()=>s(i===f?null:f)},f)})]}),i!==null&&t[i]&&a.jsx(ly,{tc:t[i]})]})]})}function uy(e){const t=e.total_prompt_tokens+e.total_completion_tokens;let n=`## Agent Diagnostics -- Model: ${e.model} -- Turns: ${e.turn_count}/50 (max reached) -- Tokens: ${e.total_prompt_tokens} prompt + ${e.total_completion_tokens} completion = ${t} total -- Compactions: ${e.compaction_count}`;const r=e.tool_summary;if(r&&r.length>0){n+=` - -## Tool Usage`;for(const o of r)n+=` -- ${o.tool}: ${o.calls} call${o.calls!==1?"s":""}`,o.errors&&(n+=` (${o.errors} error${o.errors!==1?"s":""})`)}const i=e.tasks;if(i&&i.length>0){n+=` - -## Tasks`;for(const o of i)n+=` -- [${o.status}] ${o.title}`}const s=e.last_messages;return s&&s.length>0&&(n+=` - -## Last Messages`,s.forEach((o,l)=>{const u=o.tool?`${o.role}:${o.tool}`:o.role,c=o.content?o.content.replace(/\n/g," "):"";n+=` -${l+1}. [${u}] ${c}`})),n}function dy(){const[e,t]=_.useState("idle"),n=async()=>{const r=ze.getState().sessionId;if(r){t("loading");try{const i=await zu(r),s=uy(i);await navigator.clipboard.writeText(s),t("copied"),setTimeout(()=>t("idle"),2e3)}catch{t("idle")}}};return a.jsx("button",{onClick:n,disabled:e==="loading",className:"inline-flex items-center gap-1 text-[11px] font-mono px-2 py-1 rounded cursor-pointer hover:brightness-125 mt-1",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:e==="copied"?"var(--success)":"var(--text-muted)"},children:e==="copied"?"Copied!":e==="loading"?"Loading...":"Copy Diagnostics"})}function py({message:e}){if(e.role==="thinking")return a.jsx(iy,{message:e});if(e.role==="plan")return a.jsx(oy,{message:e});if(e.role==="tool")return a.jsx(cy,{message:e});const t=e.role==="user"?"user":"assistant",n=ry[t];return a.jsxs("div",{className:"py-1.5",children:[a.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:n.color}}),a.jsx("span",{className:"text-[11px] font-semibold",style:{color:n.color},children:n.label})]}),e.content&&(e.role==="user"?a.jsx("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose",style:{color:"var(--text-primary)"},children:e.content}):a.jsxs("div",{className:"text-sm leading-relaxed pl-2.5 max-w-prose chat-markdown",style:{color:"var(--text-secondary)"},children:[a.jsx(eg,{remarkPlugins:[ny],rehypePlugins:[Gh],children:e.content}),e.content.includes("Reached maximum iterations")&&a.jsx(dy,{})]}))]})}function fy(){const e=ze(l=>l.activeQuestion),t=ze(l=>l.sessionId),n=ze(l=>l.setActiveQuestion),[r,i]=_.useState("");if(!e)return null;const s=l=>{t&&(Xn().sendQuestionResponse(t,e.question_id,l),n(null),i(""))},o=e.options.length>0;return a.jsxs("div",{className:"mx-3 mb-2 rounded-lg overflow-hidden",style:{border:"1px solid color-mix(in srgb, var(--accent) 40%, var(--border))"},children:[a.jsx("div",{className:"px-3 py-2",style:{background:"color-mix(in srgb, var(--accent) 10%, var(--bg-secondary))"},children:a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--accent)"},children:"Question"})}),a.jsxs("div",{className:"px-3 py-2",style:{background:"var(--bg-secondary)"},children:[a.jsx("p",{className:"text-sm mb-2",style:{color:"var(--text-primary)"},children:e.question}),o&&a.jsx("div",{className:"flex flex-col gap-1 mb-2",children:e.options.map((l,u)=>a.jsxs("button",{onClick:()=>s(l),className:"w-full text-left text-[13px] py-2 px-3 rounded cursor-pointer transition-colors flex items-center gap-2",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",borderLeft:"2px solid transparent",color:"var(--text-primary)",fontFamily:"var(--font-mono, ui-monospace, monospace)"},onMouseEnter:c=>{c.currentTarget.style.borderLeftColor="var(--accent)",c.currentTarget.style.background="color-mix(in srgb, var(--accent) 8%, var(--bg-primary))"},onMouseLeave:c=>{c.currentTarget.style.borderLeftColor="transparent",c.currentTarget.style.background="var(--bg-primary)"},children:[a.jsxs("span",{className:"text-[11px] font-semibold shrink-0",style:{color:"var(--text-muted)"},children:[u+1,"."]}),a.jsx("span",{className:"truncate",children:l})]},u))}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{type:"text",value:r,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Enter"&&r.trim()&&s(r.trim())},placeholder:o?"Or type a custom answer...":"Type your answer...",className:"flex-1 text-sm px-2 py-1.5 rounded outline-none",style:{background:"var(--bg-primary)",border:"1px solid var(--border)",color:"var(--text-primary)"}}),a.jsx("button",{onClick:()=>{r.trim()&&s(r.trim())},disabled:!r.trim(),className:"text-xs font-semibold px-3 py-1.5 rounded cursor-pointer transition-colors disabled:opacity-30 disabled:cursor-not-allowed",style:{background:"color-mix(in srgb, var(--accent) 15%, var(--bg-secondary))",color:"var(--accent)",border:"1px solid color-mix(in srgb, var(--accent) 30%, var(--border))"},children:"Send"})]})]})]})}function my(){const e=_.useRef(Xn()).current,[t,n]=_.useState(""),r=_.useRef(null),i=_.useRef(!0),s=zn(K=>K.enabled),o=zn(K=>K.status),l=!s||o==="authenticated",{sessionId:u,status:c,messages:d,plan:p,models:m,selectedModel:f,modelsLoading:b,skills:h,selectedSkillIds:v,skillsLoading:y,setModels:x,setSelectedModel:C,setModelsLoading:O,setSkills:j,setSelectedSkillIds:N,toggleSkill:B,setSkillsLoading:D,addUserMessage:R,hydrateSession:S,clearSession:T}=ze();_.useEffect(()=>{l&&(m.length>0||(O(!0),Fu().then(K=>{if(x(K),K.length>0&&!f){const H=K.find(re=>re.model_name.includes("claude"));C(H?H.model_name:K[0].model_name)}}).catch(console.error).finally(()=>O(!1))))},[l,m.length,f,x,C,O]),_.useEffect(()=>{h.length>0||(D(!0),Uu().then(K=>{j(K),N(K.map(H=>H.id))}).catch(console.error).finally(()=>D(!1)))},[h.length,j,N,D]),_.useEffect(()=>{if(u)return;const K=sessionStorage.getItem("agent_session_id");K&&$u(K).then(H=>{H?S(H):sessionStorage.removeItem("agent_session_id")}).catch(()=>{sessionStorage.removeItem("agent_session_id")})},[]);const[L,M]=_.useState(!1),w=()=>{const K=r.current;if(!K)return;const H=K.scrollHeight-K.scrollTop-K.clientHeight<40;i.current=H,M(K.scrollTop>100)};_.useEffect(()=>{i.current&&r.current&&(r.current.scrollTop=r.current.scrollHeight)});const k=c==="thinking"||c==="executing"||c==="planning"||c==="awaiting_input",I=d[d.length-1],W=k&&(I==null?void 0:I.role)==="assistant"&&!I.done,U=k&&!W,q=_.useRef(null),g=()=>{const K=q.current;K&&(K.style.height="auto",K.style.height=Math.min(K.scrollHeight,200)+"px")},F=_.useCallback(()=>{const K=t.trim();!K||!f||k||(i.current=!0,R(K),e.sendAgentMessage(K,f,u,v),n(""),requestAnimationFrame(()=>{const H=q.current;H&&(H.style.height="auto")}))},[t,f,k,u,v,R,e]),$=_.useCallback(()=>{u&&e.sendAgentStop(u)},[u,e]),E=K=>{K.key==="Enter"&&!K.shiftKey&&(K.preventDefault(),F())},ie=!k&&!!f&&t.trim().length>0;return l?a.jsxs("div",{className:"flex flex-col h-full",style:{background:"var(--bg-primary)"},children:[a.jsx(ys,{selectedModel:f,models:m,modelsLoading:b,onModelChange:C,skills:h,selectedSkillIds:v,skillsLoading:y,onToggleSkill:B,onClear:T,onStop:$,hasMessages:d.length>0,isBusy:k}),a.jsx(hy,{plan:p}),a.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[a.jsxs("div",{ref:r,onScroll:w,className:"h-full overflow-y-auto px-3 py-2 space-y-0.5",children:[d.length===0&&a.jsxs("div",{className:"flex flex-col items-center justify-center py-10 px-4 gap-3",style:{color:"var(--text-muted)"},children:[a.jsx("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})}),a.jsxs("div",{className:"text-center space-y-1.5",children:[a.jsx("p",{className:"text-sm font-medium",style:{color:"var(--text-secondary)"},children:"Ask the agent to help you code"}),a.jsxs("p",{className:"text-xs leading-relaxed",children:["Create agents, functions, evaluations,",a.jsx("br",{}),"or ask questions about your project."]})]})]}),d.filter(K=>K.role!=="plan").map(K=>a.jsx(py,{message:K},K.id)),U&&a.jsx("div",{className:"py-1.5",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("div",{className:"w-2 h-2 rounded-full animate-pulse",style:{background:"var(--success)"}}),a.jsx("span",{className:"text-[11px] font-semibold",style:{color:"var(--success)"},children:c==="thinking"?"Thinking...":c==="executing"?"Executing...":c==="awaiting_input"?"Waiting for answer...":"Planning..."})]})})]}),L&&a.jsx("button",{onClick:()=>{var K;i.current=!1,(K=r.current)==null||K.scrollTo({top:0,behavior:"smooth"})},className:"absolute top-2 right-3 w-6 h-6 flex items-center justify-center rounded-full cursor-pointer transition-opacity opacity-70 hover:opacity-100",style:{background:"var(--bg-tertiary)",color:"var(--text-primary)"},title:"Scroll to top",children:a.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"18 15 12 9 6 15"})})})]}),a.jsx(fy,{}),a.jsxs("div",{className:"flex items-end gap-2 px-3 py-2 border-t",style:{borderColor:"var(--border)"},children:[a.jsx("textarea",{ref:q,value:t,onChange:K=>{n(K.target.value),g()},onKeyDown:E,disabled:k||!f,placeholder:k?"Waiting for response...":"Message...",rows:2,className:"flex-1 bg-transparent text-sm py-1 disabled:opacity-40 placeholder:text-[var(--text-muted)] resize-none",style:{color:"var(--text-primary)",maxHeight:200,overflow:"auto"}}),a.jsx("button",{onClick:F,disabled:!ie,className:"text-xs font-semibold px-3 py-1.5 rounded transition-colors cursor-pointer disabled:opacity-30 disabled:cursor-not-allowed shrink-0","aria-label":"Send message",style:{color:ie?"var(--accent)":"var(--text-muted)",background:"transparent"},onMouseEnter:K=>{ie&&(K.currentTarget.style.background="color-mix(in srgb, var(--accent) 10%, transparent)")},onMouseLeave:K=>{K.currentTarget.style.background="transparent"},children:"Send"})]})]}):a.jsxs("div",{className:"flex flex-col h-full",style:{background:"var(--bg-primary)"},children:[a.jsx(ys,{selectedModel:f,models:m,modelsLoading:b,onModelChange:C,skills:h,selectedSkillIds:v,skillsLoading:y,onToggleSkill:B,onClear:T,onStop:$,hasMessages:!1,isBusy:!1}),a.jsx("div",{className:"flex-1 flex items-center justify-center p-4",children:a.jsxs("div",{className:"text-center",style:{color:"var(--text-muted)"},children:[a.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"mx-auto mb-2",strokeLinecap:"round",children:[a.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),a.jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),a.jsx("p",{className:"text-sm font-medium mb-1",children:"Sign in to use Agent"}),a.jsx("p",{className:"text-xs",children:"Authentication is required to access the coding agent."})]})})]})}function ys({selectedModel:e,models:t,modelsLoading:n,onModelChange:r,skills:i,selectedSkillIds:s,skillsLoading:o,onToggleSkill:l,onClear:u,onStop:c,hasMessages:d,isBusy:p}){const[m,f]=_.useState(!1),b=_.useRef(null);return _.useEffect(()=>{if(!m)return;const h=v=>{b.current&&!b.current.contains(v.target)&&f(!1)};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[m]),a.jsxs("div",{className:"shrink-0 flex items-center gap-2 px-3 h-10 border-b",style:{borderColor:"var(--border)",background:"var(--bg-primary)"},children:[a.jsx("span",{className:"text-[11px] uppercase tracking-wider font-semibold shrink-0",style:{color:"var(--text-muted)"},children:"Agent"}),a.jsxs("select",{value:e??"",onChange:h=>r(h.target.value),className:"flex-1 text-[11px] rounded px-1.5 py-1 outline-none min-w-0 cursor-pointer",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",color:"var(--text-primary)"},disabled:n,children:[n&&a.jsx("option",{value:"",children:"Loading models..."}),!n&&t.length===0&&a.jsx("option",{value:"",children:"No models"}),t.map(h=>a.jsx("option",{value:h.model_name,children:h.model_name},h.model_name))]}),!o&&i.length>0&&a.jsxs("div",{className:"relative shrink-0",ref:b,children:[a.jsxs("button",{onClick:()=>f(!m),className:"text-[11px] font-semibold px-2 py-1 rounded cursor-pointer flex items-center gap-1",style:{background:s.length>0?"color-mix(in srgb, var(--accent) 15%, transparent)":"transparent",border:`1px solid ${s.length>0?"var(--accent)":"var(--border)"}`,color:s.length>0?"var(--accent)":"var(--text-muted)"},title:"Skills",children:[a.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"}),a.jsx("path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"})]}),s.length>0&&a.jsx("span",{children:s.length})]}),m&&a.jsx("div",{className:"absolute top-full right-0 mt-1 rounded shadow-lg z-50 py-1 max-h-64 overflow-y-auto",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)",width:"190px"},children:i.map(h=>a.jsxs("button",{onClick:()=>l(h.id),className:"w-full text-left px-2 py-1 text-[11px] flex items-center gap-1.5 cursor-pointer",style:{color:"var(--text-primary)"},title:h.description,onMouseEnter:v=>{v.currentTarget.style.background="var(--bg-tertiary)"},onMouseLeave:v=>{v.currentTarget.style.background="transparent"},children:[a.jsx("span",{className:"w-3 h-3 rounded border flex items-center justify-center shrink-0",style:{borderColor:s.includes(h.id)?"var(--accent)":"var(--border)",background:s.includes(h.id)?"var(--accent)":"transparent"},children:s.includes(h.id)&&a.jsx("svg",{width:"8",height:"8",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:a.jsx("polyline",{points:"20 6 9 17 4 12"})})}),a.jsx("span",{className:"truncate",children:h.name})]},h.id))})]}),p&&a.jsx("button",{onClick:c,className:"shrink-0 text-[11px] font-semibold px-2 py-1 rounded cursor-pointer",style:{background:"transparent",border:"1px solid var(--error)",color:"var(--error)"},title:"Stop",onMouseEnter:h=>{h.currentTarget.style.background="color-mix(in srgb, var(--error) 10%, transparent)"},onMouseLeave:h=>{h.currentTarget.style.background="transparent"},children:"Stop"}),d&&!p&&a.jsx("button",{onClick:u,className:"shrink-0 w-6 h-6 flex items-center justify-center rounded cursor-pointer",style:{background:"transparent",border:"none",color:"var(--text-muted)"},title:"New session",onMouseEnter:h=>{h.currentTarget.style.color="var(--text-primary)"},onMouseLeave:h=>{h.currentTarget.style.color="var(--text-muted)"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("polyline",{points:"1 4 1 10 7 10"}),a.jsx("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]})})]})}const gy=10;function hy({plan:e}){const t=e.filter(m=>m.status==="completed").length,n=e.filter(m=>m.status!=="completed"),r=e.length>0&&t===e.length,[i,s]=_.useState(!1),o=_.useRef(n.length);if(_.useEffect(()=>{r&&s(!0)},[r]),_.useEffect(()=>{n.length>o.current&&s(!1),o.current=n.length},[n.length]),e.length===0)return null;const l=e.filter(m=>m.status==="completed"),u=Math.max(0,gy-n.length),d=[...l.slice(-u),...n],p=e.length-d.length;return a.jsxs("div",{className:"shrink-0 border-b",style:{borderColor:"var(--border)",background:"var(--bg-secondary)"},children:[a.jsxs("button",{onClick:()=>s(!i),className:"w-full flex items-center gap-2 px-3 py-1.5 cursor-pointer",style:{background:"none",border:"none"},children:[a.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:"var(--accent)"}}),a.jsxs("span",{className:"text-[11px] font-semibold",style:{color:"var(--accent)"},children:["Plan (",t,"/",e.length," completed)"]}),a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"var(--text-muted)",strokeWidth:"2",className:"ml-auto",style:{transform:i?"rotate(0deg)":"rotate(180deg)",transition:"transform 0.15s"},children:a.jsx("path",{d:"M6 9l6 6 6-6"})})]}),!i&&a.jsxs("div",{className:"px-3 pb-2 space-y-1",children:[p>0&&a.jsxs("div",{className:"text-[11px]",style:{color:"var(--text-muted)"},children:[p," earlier completed task",p!==1?"s":""," hidden"]}),d.map((m,f)=>a.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[m.status==="completed"?a.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--success)",strokeWidth:"2.5",strokeLinecap:"round",children:a.jsx("path",{d:"M20 6L9 17l-5-5"})}):m.status==="in_progress"?a.jsx("span",{className:"w-3.5 h-3.5 flex items-center justify-center",children:a.jsx("span",{className:"w-2 h-2 rounded-full animate-pulse",style:{background:"var(--accent)"}})}):a.jsx("span",{className:"w-3.5 h-3.5 flex items-center justify-center",children:a.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:"var(--text-muted)",opacity:.4}})}),a.jsx("span",{style:{color:m.status==="completed"?"var(--text-muted)":"var(--text-primary)",textDecoration:m.status==="completed"?"line-through":"none"},children:m.title})]},f))]})]})}function by(){const e=nc(),t=sc(),[n,r]=_.useState(!1),[i,s]=_.useState(248),[o,l]=_.useState(!1),[u,c]=_.useState(380),[d,p]=_.useState(!1),{runs:m,selectedRunId:f,setRuns:b,upsertRun:h,selectRun:v,setTraces:y,setLogs:x,setChatMessages:C,setEntrypoints:O,setStateEvents:j,setGraphCache:N,setActiveNode:B,removeActiveNode:D}=ve(),{section:R,view:S,runId:T,setupEntrypoint:L,setupMode:M,evalCreating:w,evalSetId:k,evalRunId:I,evalRunItemName:W,evaluatorCreateType:U,evaluatorId:q,evaluatorFilter:g,explorerFile:F,navigate:$}=st(),{setEvalSets:E,setEvaluators:ie,setLocalEvaluators:K,setEvalRuns:H}=Me();_.useEffect(()=>{R==="debug"&&S==="details"&&T&&T!==f&&v(T)},[R,S,T,f,v]);const re=zn(J=>J.init),de=ks(J=>J.init);_.useEffect(()=>{Jl().then(b).catch(console.error),Zr().then(J=>O(J.map(ge=>ge.name))).catch(console.error),re(),de()},[b,O,re,de]),_.useEffect(()=>{R==="evals"&&(Es().then(J=>E(J)).catch(console.error),gc().then(J=>H(J)).catch(console.error)),(R==="evals"||R==="evaluators")&&(cc().then(J=>ie(J)).catch(console.error),ei().then(J=>K(J)).catch(console.error))},[R,E,ie,K,H]);const xe=Me(J=>J.evalSets),Oe=Me(J=>J.evalRuns);_.useEffect(()=>{if(R!=="evals"||w||k||I)return;const J=Object.values(Oe).sort((Re,fe)=>new Date(fe.start_time??0).getTime()-new Date(Re.start_time??0).getTime());if(J.length>0){$(`#/evals/runs/${J[0].id}`);return}const ge=Object.values(xe);ge.length>0&&$(`#/evals/sets/${ge[0].id}`)},[R,w,k,I,Oe,xe,$]),_.useEffect(()=>{const J=ge=>{ge.key==="Escape"&&n&&r(!1)};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},[n]);const Ie=f?m[f]:null,at=_.useCallback((J,ge)=>{h(ge),y(J,ge.traces),x(J,ge.logs);const Re=ge.messages.map(fe=>{const P=fe.contentParts??fe.content_parts??[],G=fe.toolCalls??fe.tool_calls??[];return{message_id:fe.messageId??fe.message_id,role:fe.role??"assistant",content:P.filter(ee=>{const ae=ee.mimeType??ee.mime_type??"";return ae.startsWith("text/")||ae==="application/json"}).map(ee=>{const ae=ee.data;return(ae==null?void 0:ae.inline)??""}).join(` -`).trim()??"",tool_calls:G.length>0?G.map(ee=>({name:ee.name??"",has_result:!!ee.result})):void 0}});if(C(J,Re),ge.graph&&ge.graph.nodes.length>0&&N(J,ge.graph),ge.states&&ge.states.length>0&&(j(J,ge.states.map(fe=>({node_name:fe.node_name,qualified_node_name:fe.qualified_node_name,phase:fe.phase,timestamp:new Date(fe.timestamp).getTime(),payload:fe.payload}))),ge.status!=="completed"&&ge.status!=="failed"))for(const fe of ge.states)fe.phase==="started"?B(J,fe.node_name,fe.qualified_node_name):fe.phase==="completed"&&D(J,fe.node_name)},[h,y,x,C,j,N,B,D]);_.useEffect(()=>{if(!f)return;e.subscribe(f),ur(f).then(ge=>at(f,ge)).catch(console.error);const J=setTimeout(()=>{const ge=ve.getState().runs[f];ge&&(ge.status==="pending"||ge.status==="running")&&ur(f).then(Re=>at(f,Re)).catch(console.error)},2e3);return()=>{clearTimeout(J),e.unsubscribe(f)}},[f,e,at]);const St=_.useRef(null);_.useEffect(()=>{var Re,fe;if(!f)return;const J=Ie==null?void 0:Ie.status,ge=St.current;if(St.current=J??null,J&&(J==="completed"||J==="failed")&&ge!==J){const P=ve.getState(),G=((Re=P.traces[f])==null?void 0:Re.length)??0,ee=((fe=P.logs[f])==null?void 0:fe.length)??0,ae=(Ie==null?void 0:Ie.trace_count)??0,we=(Ie==null?void 0:Ie.log_count)??0;(Gat(f,Ke)).catch(console.error)}},[f,Ie==null?void 0:Ie.status,at]);const Pt=J=>{$(`#/debug/runs/${J}/traces`),v(J),r(!1)},yt=J=>{$(`#/debug/runs/${J}/traces`),v(J),r(!1)},ke=()=>{$("#/debug/new"),r(!1)},lt=J=>{J==="debug"?$("#/debug/new"):J==="evals"?$("#/evals"):J==="evaluators"?$("#/evaluators"):J==="explorer"&&$("#/explorer")},rt=_.useCallback(J=>{J.preventDefault(),l(!0);const ge="touches"in J?J.touches[0].clientX:J.clientX,Re=i,fe=G=>{const ee="touches"in G?G.touches[0].clientX:G.clientX,ae=Math.max(200,Math.min(480,Re+(ee-ge)));s(ae)},P=()=>{l(!1),document.removeEventListener("mousemove",fe),document.removeEventListener("mouseup",P),document.removeEventListener("touchmove",fe),document.removeEventListener("touchend",P),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",fe),document.addEventListener("mouseup",P),document.addEventListener("touchmove",fe,{passive:!1}),document.addEventListener("touchend",P)},[i]),vt=_.useCallback(J=>{J.preventDefault(),p(!0);const ge="touches"in J?J.touches[0].clientX:J.clientX,Re=u,fe=G=>{const ee="touches"in G?G.touches[0].clientX:G.clientX,ae=Math.max(280,Math.min(700,Re-(ee-ge)));c(ae)},P=()=>{p(!1),document.removeEventListener("mousemove",fe),document.removeEventListener("mouseup",P),document.removeEventListener("touchmove",fe),document.removeEventListener("touchend",P),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",fe),document.addEventListener("mouseup",P),document.addEventListener("touchmove",fe,{passive:!1}),document.addEventListener("touchend",P)},[u]),Bt=be(J=>J.openTabs),qt=()=>R==="explorer"?Bt.length>0||F?a.jsx(Bu,{}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Select a file to view"}):R==="evals"?w?a.jsx(uo,{}):I?a.jsx(wu,{evalRunId:I,itemName:W}):k?a.jsx(yu,{evalSetId:k}):a.jsx(uo,{}):R==="evaluators"?U?a.jsx(Du,{category:U}):a.jsx(Ru,{evaluatorId:q,evaluatorFilter:g}):S==="new"?a.jsx(Nc,{}):S==="setup"&&L&&M?a.jsx(Xc,{entrypoint:L,mode:M,ws:e,onRunCreated:Pt,isMobile:t}):Ie?a.jsx(gu,{run:Ie,ws:e,isMobile:t}):a.jsx("div",{className:"flex items-center justify-center h-full text-[var(--text-muted)]",children:"Select a run or create a new one"});return t?a.jsxs("div",{className:"flex flex-col h-screen w-screen",children:[a.jsxs("div",{className:"flex flex-1 overflow-hidden relative",children:[!n&&a.jsx("button",{onClick:()=>r(!0),className:"fixed top-2 left-2 z-40 w-9 h-9 flex items-center justify-center rounded-lg cursor-pointer",style:{background:"var(--bg-secondary)",border:"1px solid var(--border)"},children:a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"3",y1:"6",x2:"21",y2:"6"}),a.jsx("line",{x1:"3",y1:"12",x2:"21",y2:"12"}),a.jsx("line",{x1:"3",y1:"18",x2:"21",y2:"18"})]})}),n&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"fixed inset-0 z-50",style:{background:"rgba(0,0,0,0.5)"},onClick:()=>r(!1)}),a.jsxs("aside",{className:"fixed inset-y-0 left-0 z-50 w-64 bg-[var(--sidebar-bg)] border-r border-[var(--border)] flex flex-col",children:[a.jsxs("div",{className:"px-3 h-10 border-b border-[var(--border)] flex items-center justify-between",children:[a.jsxs("button",{onClick:()=>{$("#/debug/new"),r(!1)},className:"flex items-center gap-2 cursor-pointer",style:{background:"none",border:"none"},children:[a.jsx("img",{src:"/favicon.ico",width:"14",height:"14",alt:"UiPath"}),a.jsx("span",{className:"text-[10px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:"Developer Console"})]}),a.jsx("button",{onClick:()=>r(!1),className:"w-6 h-6 flex items-center justify-center rounded cursor-pointer transition-colors",style:{color:"var(--text-muted)",background:"transparent",border:"none"},children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),R==="debug"&&a.jsx(Di,{runs:Object.values(m),selectedRunId:f,onSelectRun:yt,onNewRun:ke}),R==="evals"&&a.jsx(io,{}),R==="evaluators"&&a.jsx(po,{}),R==="explorer"&&a.jsx(mo,{})]})]}),a.jsx("main",{className:"flex-1 overflow-hidden bg-[var(--bg-primary)]",children:qt()})]}),a.jsx(Pi,{}),a.jsx(Qi,{}),a.jsx(no,{})]}):a.jsxs("div",{className:"flex flex-col h-screen w-screen",children:[a.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[a.jsxs("aside",{className:"shrink-0 flex flex-col",style:{width:i,background:"var(--sidebar-bg)"},children:[a.jsxs("div",{className:"flex h-10 border-b shrink-0",style:{borderColor:"var(--border)"},children:[a.jsx("button",{onClick:()=>$("#/debug/new"),className:"w-12 shrink-0 flex items-center justify-center cursor-pointer transition-colors border-r",style:{background:"var(--activity-bar-bg)",border:"none",borderRight:"1px solid var(--border)"},onMouseEnter:J=>{J.currentTarget.style.background="var(--bg-hover)"},onMouseLeave:J=>{J.currentTarget.style.background="var(--activity-bar-bg)"},children:a.jsx("img",{src:"/favicon.ico",width:"20",height:"20",alt:"UiPath"})}),a.jsx("div",{className:"flex-1 flex items-center px-3",style:{background:"var(--sidebar-bg)"},children:a.jsx("span",{className:"text-[11px] uppercase tracking-widest font-semibold",style:{color:"var(--text-muted)"},children:R==="debug"?"Developer Console":R==="evals"?"Evaluations":R==="evaluators"?"Evaluators":"Explorer"})})]}),a.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[a.jsx(lc,{section:R,onSectionChange:lt}),a.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[R==="debug"&&a.jsx(Di,{runs:Object.values(m),selectedRunId:f,onSelectRun:yt,onNewRun:ke}),R==="evals"&&a.jsx(io,{}),R==="evaluators"&&a.jsx(po,{}),R==="explorer"&&a.jsx(mo,{})]})]})]}),a.jsx("div",{onMouseDown:rt,onTouchStart:rt,className:"shrink-0 drag-handle-col",style:o?{background:"var(--accent)"}:void 0}),a.jsxs("main",{className:"flex-1 overflow-hidden bg-[var(--bg-primary)] flex",children:[a.jsx("div",{className:"flex-1 overflow-hidden",children:qt()}),R==="explorer"&&a.jsxs(a.Fragment,{children:[a.jsx("div",{onMouseDown:vt,onTouchStart:vt,className:"shrink-0 drag-handle-col",style:d?{background:"var(--accent)"}:void 0}),a.jsx("div",{className:"shrink-0 overflow-hidden",style:{width:u,borderLeft:"1px solid var(--border)"},children:a.jsx(my,{})})]})]})]}),a.jsx(Pi,{}),a.jsx(Qi,{}),a.jsx(no,{})]})}Ml.createRoot(document.getElementById("root")).render(a.jsx(_.StrictMode,{children:a.jsx(by,{})}));export{eg as M,ny as a,Gh as r,ve as u}; diff --git a/src/uipath/dev/server/static/assets/index-YAcg9zUx.css b/src/uipath/dev/server/static/assets/index-YAcg9zUx.css new file mode 100644 index 0000000..cc7e87b --- /dev/null +++ b/src/uipath/dev/server/static/assets/index-YAcg9zUx.css @@ -0,0 +1 @@ +/*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-duration:initial;--tw-ease:initial;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--spacing:.25rem;--container-xs:20rem;--container-xl:36rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height: 1.5 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-normal:0em;--tracking-wide:.025em;--tracking-wider:.05em;--tracking-widest:.1em;--leading-normal:1.5;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.top-1{top:calc(var(--spacing) * 1)}.top-1\.5{top:calc(var(--spacing) * 1.5)}.top-2{top:calc(var(--spacing) * 2)}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-1{right:calc(var(--spacing) * 1)}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.bottom-1\.5{bottom:calc(var(--spacing) * 1.5)}.bottom-8{bottom:calc(var(--spacing) * 8)}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.z-\[100\]{z-index:100}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing) * 0)}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-3{margin-inline:calc(var(--spacing) * 3)}.mx-auto{margin-inline:auto}.my-2{margin-block:calc(var(--spacing) * 2)}.my-3{margin-block:calc(var(--spacing) * 3)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.mr-0\.5{margin-right:calc(var(--spacing) * .5)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-\[14px\]{height:14px}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-32{max-height:calc(var(--spacing) * 32)}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-52{max-height:calc(var(--spacing) * 52)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-\[85vh\]{max-height:85vh}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-full{min-height:100%}.w-0\.5{width:calc(var(--spacing) * .5)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-12{width:calc(var(--spacing) * 12)}.w-14{width:calc(var(--spacing) * 14)}.w-24{width:calc(var(--spacing) * 24)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-44{width:calc(var(--spacing) * 44)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-\[200px\]{width:200px}.w-\[calc\(100\%-24px\)\]{width:calc(100% - 24px)}.w-full{width:100%}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.max-w-\[160px\]{max-width:160px}.max-w-\[200px\]{max-width:200px}.max-w-prose{max-width:65ch}.max-w-xl{max-width:var(--container-xl)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\[140px\]{min-width:140px}.min-w-\[180px\]{min-width:180px}.flex-1{flex:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\[slideIn_0\.2s_ease-out\]{animation:.2s ease-out slideIn}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.resize-y{resize:vertical}.appearance-auto{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-\[var\(--border\)\]{border-color:var(--border)}.bg-\[var\(--bg-primary\)\]{background-color:var(--bg-primary)}.bg-\[var\(--sidebar-bg\)\]{background-color:var(--sidebar-bg)}.bg-transparent{background-color:#0000}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.px-0\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-10{padding-block:calc(var(--spacing) * 10)}.py-\[3px\]{padding-block:3px}.py-px{padding-block:1px}.pt-0{padding-top:calc(var(--spacing) * 0)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-1\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-px{padding-top:1px}.pr-0{padding-right:calc(var(--spacing) * 0)}.pr-1{padding-right:calc(var(--spacing) * 1)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pb-0\.5{padding-bottom:calc(var(--spacing) * .5)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-2\.5{padding-bottom:calc(var(--spacing) * 2.5)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-1{padding-left:calc(var(--spacing) * 1)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-2\.5{padding-left:calc(var(--spacing) * 2.5)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-\[22px\]{padding-left:22px}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-\[inherit\]{font-family:inherit}.font-mono{font-family:var(--font-mono)}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.tracking-widest{--tw-tracking:var(--tracking-widest);letter-spacing:var(--tracking-widest)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[var\(--text-muted\)\]{color:var(--text-muted)}.text-\[var\(--text-primary\)\]{color:var(--text-primary)}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.accent-\[var\(--accent\)\]{accent-color:var(--accent)}.opacity-0{opacity:0}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\[width\]{transition-property:width;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-\[var\(--text-muted\)\]::placeholder{color:var(--text-muted)}@media(hover:hover){.hover\:bg-\[var\(--bg-hover\)\]:hover{background-color:var(--bg-hover)}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-100:hover{opacity:1}.hover\:brightness-125:hover{--tw-brightness:brightness(125%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}}pre code.hljs{padding:1em;display:block;overflow-x:auto}code.hljs{padding:3px 5px}.hljs{color:#c9d1d9;background:#0d1117}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#ff7b72}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#d2a8ff}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-variable,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id{color:#79c0ff}.hljs-regexp,.hljs-string,.hljs-meta .hljs-string{color:#a5d6ff}.hljs-built_in,.hljs-symbol{color:#ffa657}.hljs-comment,.hljs-code,.hljs-formula{color:#8b949e}.hljs-name,.hljs-quote,.hljs-selector-tag,.hljs-selector-pseudo{color:#7ee787}.hljs-subst{color:#c9d1d9}.hljs-section{color:#1f6feb;font-weight:700}.hljs-bullet{color:#f2cc60}.hljs-emphasis{color:#c9d1d9;font-style:italic}.hljs-strong{color:#c9d1d9;font-weight:700}.hljs-addition{color:#aff5b4;background-color:#033a16}.hljs-deletion{color:#ffdcd7;background-color:#67060c}:root,[data-theme=dark]{--bg-primary:#0f172a;--bg-secondary:#1e293b;--bg-tertiary:#334155;--bg-hover:#263348;--bg-elevated:#253041;--text-primary:#cbd5e1;--text-secondary:#94a3b8;--text-muted:#64748b;--border:#334155;--accent:#fa4616;--accent-hover:#e03d12;--accent-light:#ff6a3d;--success:#22c55e;--warning:#eab308;--error:#ef4444;--info:#3b82f6;--sidebar-bg:#0e1526;--activity-bar-bg:#0a1020;--card-bg:#1e293b;--input-bg:#0f172a;--code-bg:#0f172a;--tab-active:#fa4616;--tab-text:#94a3b8;--tab-text-active:#fa4616;--node-bg:#1e293b;--node-border:#475569;--scrollbar-thumb:#334155;color-scheme:dark}[data-theme=light]{--bg-primary:#f8fafc;--bg-secondary:#fff;--bg-tertiary:#cbd5e1;--bg-hover:#f1f5f9;--bg-elevated:#fff;--text-primary:#0f172a;--text-secondary:#475569;--text-muted:#94a3b8;--border:#e2e8f0;--accent:#fa4616;--accent-hover:#e03d12;--accent-light:#ff6a3d;--success:#22c55e;--warning:#ca8a04;--error:#ef4444;--info:#2563eb;--sidebar-bg:#fff;--activity-bar-bg:#f1f5f9;--card-bg:#fff;--input-bg:#f8fafc;--code-bg:#e8ecf1;--tab-active:#fa4616;--tab-text:#64748b;--tab-text-active:#fa4616;--node-bg:#fff;--node-border:#cbd5e1;--scrollbar-thumb:#d1d5db;color-scheme:light}body{background:var(--bg-primary);color:var(--text-primary);margin:0;font-family:Inter,system-ui,-apple-system,sans-serif;transition:background-color .2s,color .2s}#root{height:100dvh;display:flex}:focus-visible{outline:2px solid var(--accent);outline-offset:1px}button:focus-visible,[role=button]:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid var(--accent)}@supports (color:color-mix(in lab,red,red)){button:focus-visible,[role=button]:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid color-mix(in srgb,var(--accent) 60%,transparent)}}button:focus-visible,[role=button]:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline-offset:0px;border-radius:3px}.drag-handle-row{cursor:row-resize;background:var(--border);height:3px;transition:background .15s;position:relative}.drag-handle-row:before{content:"";position:absolute;top:-5px;right:0;bottom:-5px;left:0}.drag-handle-row:hover,.drag-handle-row:active{background:var(--accent)}.drag-handle-col{cursor:col-resize;background:var(--border);width:3px;transition:background .15s;position:relative}.drag-handle-col:before{content:"";position:absolute;top:0;right:-5px;bottom:0;left:-5px}.drag-handle-col:hover,.drag-handle-col:active{background:var(--accent)}@keyframes skeleton-pulse{0%,to{opacity:.4}50%{opacity:.7}}.skeleton{background:var(--bg-tertiary);border-radius:4px;animation:1.5s ease-in-out infinite skeleton-pulse}.react-flow__node{font-size:12px}.react-flow__node-default{background:var(--node-bg)!important;color:var(--text-primary)!important;border-color:var(--node-border)!important}.react-flow__background{background:var(--bg-primary)!important}.react-flow__controls button{background:var(--bg-secondary)!important;color:var(--text-primary)!important;border-color:var(--border)!important}.react-flow__controls button:hover{background:var(--bg-hover)!important}.react-flow__controls button svg{fill:var(--text-primary)!important}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:var(--bg-secondary)}::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb);border-radius:3px}select{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}select option{background:var(--bg-secondary);color:var(--text-primary)}.chat-markdown p{margin:.25em 0}.chat-markdown p:first-child{margin-top:0}.chat-markdown p:last-child{margin-bottom:0}.chat-markdown code{background:var(--code-bg);border:1px solid var(--border);border-radius:3px;padding:.1em .35em;font-size:.85em}.chat-markdown pre{background:var(--code-bg);border:1px solid var(--border);border-radius:6px;margin:.5em 0;padding:.75em;overflow-x:auto}.chat-markdown pre code{background:0 0;border:none;padding:0;font-size:.85em}.chat-markdown ul,.chat-markdown ol{margin:.25em 0;padding-left:1.5em}.chat-markdown li{margin:.1em 0}.chat-markdown h1,.chat-markdown h2,.chat-markdown h3{margin:.5em 0 .25em;font-weight:600}.chat-markdown h1{font-size:1.2em}.chat-markdown h2{font-size:1.1em}.chat-markdown h3{font-size:1em}.chat-markdown blockquote{border-left:3px solid var(--border);color:var(--text-secondary);margin:.25em 0;padding-left:.75em}.chat-markdown strong{font-weight:600}.chat-markdown a{color:var(--accent);text-decoration:underline}.chat-markdown table{border-collapse:collapse;width:100%;margin:.5em 0}.chat-markdown th,.chat-markdown td{border:1px solid var(--border);text-align:left;padding:.3em .6em}.chat-markdown th{background:var(--code-bg);font-weight:600}.chat-markdown tr:nth-child(2n){background:var(--code-bg)}.chat-markdown .hljs{background:0 0}[data-theme=light] .chat-markdown .hljs{color:#24292e}[data-theme=light] .chat-markdown .hljs-doctag,[data-theme=light] .chat-markdown .hljs-keyword,[data-theme=light] .chat-markdown .hljs-meta .hljs-keyword,[data-theme=light] .chat-markdown .hljs-template-tag,[data-theme=light] .chat-markdown .hljs-template-variable,[data-theme=light] .chat-markdown .hljs-type,[data-theme=light] .chat-markdown .hljs-variable.language_{color:#d73a49}[data-theme=light] .chat-markdown .hljs-title,[data-theme=light] .chat-markdown .hljs-title.class_,[data-theme=light] .chat-markdown .hljs-title.class_.inherited__,[data-theme=light] .chat-markdown .hljs-title.function_{color:#6f42c1}[data-theme=light] .chat-markdown .hljs-attr,[data-theme=light] .chat-markdown .hljs-attribute,[data-theme=light] .chat-markdown .hljs-literal,[data-theme=light] .chat-markdown .hljs-meta,[data-theme=light] .chat-markdown .hljs-number,[data-theme=light] .chat-markdown .hljs-operator,[data-theme=light] .chat-markdown .hljs-variable,[data-theme=light] .chat-markdown .hljs-selector-attr,[data-theme=light] .chat-markdown .hljs-selector-class,[data-theme=light] .chat-markdown .hljs-selector-id{color:#005cc5}[data-theme=light] .chat-markdown .hljs-regexp,[data-theme=light] .chat-markdown .hljs-string,[data-theme=light] .chat-markdown .hljs-meta .hljs-string{color:#032f62}[data-theme=light] .chat-markdown .hljs-built_in,[data-theme=light] .chat-markdown .hljs-symbol{color:#e36209}[data-theme=light] .chat-markdown .hljs-comment,[data-theme=light] .chat-markdown .hljs-code,[data-theme=light] .chat-markdown .hljs-formula{color:#6a737d}[data-theme=light] .chat-markdown .hljs-name,[data-theme=light] .chat-markdown .hljs-quote,[data-theme=light] .chat-markdown .hljs-selector-tag,[data-theme=light] .chat-markdown .hljs-selector-pseudo{color:#22863a}[data-theme=light] .chat-markdown .hljs-subst{color:#24292e}[data-theme=light] .chat-markdown .hljs-section{color:#005cc5}[data-theme=light] .chat-markdown .hljs-bullet{color:#735c0f}[data-theme=light] .chat-markdown .hljs-addition{color:#22863a;background-color:#f0fff4}[data-theme=light] .chat-markdown .hljs-deletion{color:#b31d28;background-color:#ffeef0}@keyframes agent-changed-pulse{0%,to{box-shadow:inset 0 0 0 50px color-mix(in srgb,var(--success) 20%,transparent)}50%{box-shadow:none}}.agent-changed-file{animation:2s ease-in-out 3 agent-changed-pulse}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{opacity:.5}} diff --git a/src/uipath/dev/server/static/index.html b/src/uipath/dev/server/static/index.html index 89e1060..02e93f4 100644 --- a/src/uipath/dev/server/static/index.html +++ b/src/uipath/dev/server/static/index.html @@ -5,11 +5,11 @@ UiPath Developer Console - + - +
diff --git a/src/uipath/dev/services/agent/loop.py b/src/uipath/dev/services/agent/loop.py index d36b248..21e16dc 100644 --- a/src/uipath/dev/services/agent/loop.py +++ b/src/uipath/dev/services/agent/loop.py @@ -7,6 +7,7 @@ import logging import platform import sys +import time from collections.abc import AsyncIterator, Callable from typing import Any @@ -46,6 +47,7 @@ else ("macOS" if sys.platform == "darwin" else "Linux") ) _SHELL_HINT = ( + "The `bash` tool runs commands via `cmd.exe` (shell=True). " "Use Windows-compatible commands (e.g., `dir` instead of `ls`, `type` instead of `cat`, " "backslashes in paths). PowerShell and cmd builtins are available." if sys.platform == "win32" @@ -92,8 +94,7 @@ 1. **Plan first**: Use `create_task` to add individual steps before doing anything else. 2. **Explore**: Use `glob` and `grep` to find relevant files. Read them with `read_file`. 3. **Implement**: Use `edit_file` for targeted changes, `write_file` only for new files. -4. **Execute**: Use `bash` to run commands — installations, tests, linters, builds, `uv run` commands, etc. \ -When the user asks you to run something, always use the `bash` tool to execute it. Never tell the user to run commands themselves — you have a shell, use it. +4. **Execute**: Use `bash` to run commands — installations, tests, linters, builds, `uv run` commands, etc. 5. **Verify**: Read back edited files to confirm correctness. Run tests or linters via `bash`. 6. **Update progress**: When starting a step, call `update_task` to set it to "in_progress". \ After completing each step, call `update_task` to mark it "completed" BEFORE moving on. @@ -110,7 +111,8 @@ 3. **Write evaluations** — create BOTH: - **Evaluator files** in `evaluations/evaluators/` (e.g. `exact-match.json`, `json-similarity.json`) — these must exist first. - **Eval set files** in `evaluations/eval-sets/` with test cases that reference the evaluator IDs. -4. **Run the evaluations** — execute `uv run uipath eval` via `bash` and report results. +4. **Run the evaluations** — execute `uv run uipath eval ` via `bash` and report results. \ +The `` is the agent key from the active framework config. The `` is the path to the eval set JSON. 5. **Pack & publish** — when the user asks to deploy, run via `bash`: - `uv run uipath pack` — create a .nupkg package - `uv run uipath publish -w` — publish to personal workspace (default) @@ -118,15 +120,15 @@ Never stop after just writing code. If you create an agent/function, you must also create evaluations and run them. \ If you create eval sets, you must also create the evaluator files they reference — otherwise the eval run will fail. \ -If the user asks you to publish or deploy, use `bash` to run the commands — don't tell them to do it. \ Default to publishing to personal workspace (`-w`) unless the user specifies a tenant folder. ## UiPath Project Structure A typical UiPath Python project has: - `main.py` or `src//main.py` — agent/function entry point (can be at root or in src/) -- `uipath.json` — registers agents: `{{"agents": {{"main": "main.py:main"}}}}` or `{{"agents": {{"main": "src/agent/main.py:main"}}}}` -- `langgraph.json` — alternative config for LangGraph agents +- **Framework config** — one of these registers agents/functions (check which one has `"agents"` or `"functions"` keys): + - `uipath.json`, `pydantic_ai.json`, `langgraph.json`, `llama_index.json`, `google_adk.json`, `openai_agents.json` + - Format: `{{"agents": {{"name": "file.py:func"}}}}` — the key is the agent name used in CLI commands - `pyproject.toml` — Python dependencies (managed via `uv`) - `bindings.json` — UiPath resource bindings (queues, buckets) - `evaluations/` — test suites @@ -135,13 +137,17 @@ - `entry-points.json` — auto-generated by `uv run uipath init` - `src/` — alternative location for agent/function source code +IMPORTANT: A project may have multiple config files (e.g. both `uipath.json` and `pydantic_ai.json`). \ +Only the one with non-empty `"agents"` or `"functions"` is the active framework config. \ +NEVER add agents to the wrong config file — check the Current Project section to see which config is active. + ## Search Strategy - When searching Python code, ALWAYS use `include: '*.py'` with grep - Use `glob` to discover file structure first, then `grep` for content - Start with targeted searches (specific filenames, class names) before broad patterns - For evaluations: look in `evaluations/eval-sets/` and `evaluations/evaluators/` -- For agent code: check `uipath.json` first to find entry points, then look in both root and `src/` for Python files +- For agent code: check the active framework config (shown in Current Project) to find entry points, then look in both root and `src/` for Python files - Check `pyproject.toml` for dependencies and project name - NEVER search without a file type filter — it wastes time on binary/generated files @@ -166,7 +172,7 @@ - `read_file` — Read file contents (always use before editing). Supports offset/limit for large files. - `write_file` — Create or overwrite a file - `edit_file` — Surgical string replacement (old_string must be unique) -- `bash` — Execute a shell command (timeout: 30s). USE THIS to run commands for the user. +- `bash` — Execute a shell command (timeout: 120s). - `glob` — Find files matching a pattern (e.g. `**/*.py`). Excludes .venv, node_modules, __pycache__, .git. - `grep` — Search file contents with regex. Excludes .venv, node_modules, __pycache__, .git. - `create_task` — Add a new step to your task plan @@ -284,11 +290,39 @@ async def run(self, session: AgentSession, system_prompt: str) -> None: *session.messages, ] + # --- Trace: snapshot start --- + span_start = time.monotonic() + span_input_messages: list[dict[str, Any]] = [] + for m in llm_messages: + if m.get("role") == "system": + continue + entry: dict[str, Any] = { + "role": m.get("role", ""), + "content": (m.get("content") or "")[:500], + } + # Preserve tool_calls on assistant messages + if m.get("tool_calls"): + entry["tool_calls"] = [ + { + "name": tc.get("function", {}).get("name", ""), + "arguments": tc.get("function", {}).get( + "arguments", "" + )[:200], + } + for tc in m["tool_calls"] + ] + # Preserve tool_call_id on tool result messages + if m.get("role") == "tool" and m.get("tool_call_id"): + entry["tool_call_id"] = m["tool_call_id"] + span_input_messages.append(entry) + # Stream the response accumulated_content = "" accumulated_thinking = "" tool_calls: list[ToolCall] = [] finish_reason = "" + span_prompt_tokens = 0 + span_completion_tokens = 0 stream = await self._call_model_with_retry( llm_messages, tool_schemas, session @@ -310,21 +344,25 @@ async def run(self, session: AgentSession, system_prompt: str) -> None: finish_reason = event.finish_reason # Track token usage if event.usage: - session.total_prompt_tokens += event.usage.prompt_tokens + span_prompt_tokens = event.usage.prompt_tokens + span_completion_tokens = event.usage.completion_tokens + session.total_prompt_tokens += span_prompt_tokens session.total_completion_tokens += ( - event.usage.completion_tokens + span_completion_tokens ) session.turn_count += 1 self.emit( TokenUsageUpdated( session.id, - prompt_tokens=event.usage.prompt_tokens, - completion_tokens=event.usage.completion_tokens, + prompt_tokens=span_prompt_tokens, + completion_tokens=span_completion_tokens, total_session_tokens=session.total_prompt_tokens + session.total_completion_tokens, ) ) + span_duration_ms = int((time.monotonic() - span_start) * 1000) + # Build assistant message for conversation history assistant_msg: dict[str, Any] = { "role": "assistant", @@ -344,8 +382,27 @@ async def run(self, session: AgentSession, system_prompt: str) -> None: ] session.messages.append(assistant_msg) + # --- Trace: build span --- + span: dict[str, Any] = { + "turn_index": _iteration, + "input_messages": span_input_messages, + "output_content": accumulated_content, + "output_tool_calls": [ + {"name": tc.name, "arguments": tc.arguments} + for tc in tool_calls + ], + "prompt_tokens": span_prompt_tokens, + "completion_tokens": span_completion_tokens, + "duration_ms": span_duration_ms, + "model": session.model, + "status": "completed", + } + if accumulated_thinking: + span["output_thinking"] = accumulated_thinking + # If no tool calls, we're done if finish_reason == "stop" or not tool_calls: + session.traces.append(span) # Content already streamed via TextDelta — just mark done self._complete_remaining_tasks(session) self.emit(TextGenerated(session.id, content="", done=True)) @@ -356,6 +413,26 @@ async def run(self, session: AgentSession, system_prompt: str) -> None: # Execute tool calls (parallel where possible) await self._execute_tools_parallel(tool_calls, session, tool_map) + # --- Trace: attach tool results --- + tool_results_for_span: list[dict[str, Any]] = [] + for tc in tool_calls: + # Find the matching tool result in session.messages + for msg in reversed(session.messages): + if ( + msg.get("role") == "tool" + and msg.get("tool_call_id") == tc.id + ): + tool_results_for_span.append( + { + "tool_call_id": tc.id, + "name": tc.name, + "result": msg.get("content", ""), + } + ) + break + span["tool_results"] = tool_results_for_span + session.traces.append(span) + # After tools, set status back to thinking self.emit(StatusChanged(session.id, status="thinking")) diff --git a/src/uipath/dev/services/agent/service.py b/src/uipath/dev/services/agent/service.py index 7808b08..a69171c 100644 --- a/src/uipath/dev/services/agent/service.py +++ b/src/uipath/dev/services/agent/service.py @@ -45,7 +45,8 @@ def _detect_project_context(project_root: Path) -> str: except Exception: pass - # Detect agentic framework config files + # Detect agentic framework config files — only show configs that define + # agents or functions so the model knows which framework is active. framework_configs = [ "uipath.json", "langgraph.json", @@ -57,13 +58,19 @@ def _detect_project_context(project_root: Path) -> str: ] for config_name in framework_configs: config_path = project_root / config_name - if config_path.is_file(): - try: - parts.append( - f"{config_name}: {config_path.read_text(encoding='utf-8').strip()}" - ) - except Exception: - pass + if not config_path.is_file(): + continue + try: + raw = config_path.read_text(encoding="utf-8").strip() + data = json.loads(raw) + # Skip configs that have no agents or functions defined + has_agents = bool(data.get("agents")) + has_functions = bool(data.get("functions")) + if not has_agents and not has_functions: + continue + parts.append(f"{config_name}: {raw}") + except Exception: + pass evals_dir = project_root / "evaluations" if evals_dir.is_dir(): @@ -462,6 +469,24 @@ def get_session_diagnostics(self, session_id: str) -> dict[str, Any] | None: "last_messages": last_messages, } + def get_session_raw_state(self, session_id: str) -> dict[str, Any] | None: + """Return raw trace data for the agent trace inspector.""" + session = self._sessions.get(session_id) + if session is None: + return None + + return { + "session_id": session.id, + "model": session.model, + "status": session.status, + "turn_count": session.turn_count, + "total_prompt_tokens": session.total_prompt_tokens, + "total_completion_tokens": session.total_completion_tokens, + "system_prompt": session.last_system_prompt, + "tool_schemas": session.last_tool_schemas, + "traces": session.traces, + } + @staticmethod def _resolve_tool_name(session: AgentSession, tool_call_id: str) -> str: """Find the tool name for a given tool_call_id from assistant messages.""" @@ -485,6 +510,14 @@ async def _run_agent_loop(self, session: AgentSession) -> None: system_prompt += f"\n\n## Active Skill: {sid}\n\n{summary}" except FileNotFoundError: pass + # Append reference file list once (shared across all skills) + ref_files = self._skill_service.get_reference_files() + if ref_files: + system_prompt += ( + "\n\n## Reference Files\n" + "Use `read_reference` with a filename to view:\n" + + "\n".join(f" - {f}" for f in ref_files) + ) # Inject dynamic project context system_prompt += _detect_project_context(_PROJECT_ROOT) @@ -497,6 +530,13 @@ async def _run_agent_loop(self, session: AgentSession) -> None: if session.skill_ids and self._skill_service: tools.append(create_read_reference_tool()) + # Persist system prompt + tool schemas on session for trace inspection + session.last_system_prompt = system_prompt + session.last_tool_schemas = sorted( + [t.to_openai_schema() for t in tools], + key=lambda s: s["function"]["name"], + ) + loop = AgentLoop( provider=provider, tools=tools, diff --git a/src/uipath/dev/services/agent/session.py b/src/uipath/dev/services/agent/session.py index b893987..4bbb8a5 100644 --- a/src/uipath/dev/services/agent/session.py +++ b/src/uipath/dev/services/agent/session.py @@ -20,6 +20,10 @@ class AgentSession: tasks: dict[str, dict[str, str]] = field(default_factory=dict) _next_task_id: int = field(default=1, repr=False) status: str = "idle" + # Trace spans (one per LLM call) + traces: list[dict[str, Any]] = field(default_factory=list) + last_system_prompt: str = "" + last_tool_schemas: list[dict[str, Any]] = field(default_factory=list) # Token tracking total_prompt_tokens: int = 0 total_completion_tokens: int = 0 diff --git a/src/uipath/dev/services/agent/tools.py b/src/uipath/dev/services/agent/tools.py index c9e11d7..f506977 100644 --- a/src/uipath/dev/services/agent/tools.py +++ b/src/uipath/dev/services/agent/tools.py @@ -17,7 +17,7 @@ MAX_FILE_CHARS = 100_000 MAX_GLOB_RESULTS = 200 MAX_GREP_MATCHES = 100 -BASH_TIMEOUT = 30 +BASH_TIMEOUT = 120 TOOLS_REQUIRING_APPROVAL = {"write_file", "edit_file", "bash"} # Directories to exclude from glob/grep results. @@ -72,7 +72,9 @@ def _resolve_safe(project_root: Path, path_str: str) -> Path: if not p.is_absolute(): p = project_root / p resolved = p.resolve() - if not str(resolved).startswith(str(project_root)): + if not os.path.normcase(str(resolved)).startswith( + os.path.normcase(str(project_root)) + ): raise PermissionError(f"Path escapes project root: {path_str}") return resolved @@ -225,21 +227,30 @@ def handler(args: dict[str, Any]) -> str: if not base.is_dir(): return f"Error: directory not found: {args.get('path', '.')}" matches = sorted(base.glob(pattern)) - matches = [ - m - for m in matches - if str(m.resolve()).startswith(str(project_root)) - and not any( - p.startswith(".") or p in EXCLUDED_DIRS - for p in m.relative_to(project_root).parts - ) - ] + root_normed = os.path.normcase(str(project_root)) + filtered: list[Path] = [] + for m in matches: + if not os.path.normcase(str(m.resolve())).startswith(root_normed): + continue + try: + parts = m.relative_to(project_root).parts + except ValueError: + # Fallback for case-mismatch on Windows + rel_path = os.path.relpath(str(m), str(project_root)) + parts = Path(rel_path).parts + if any(p.startswith(".") or p in EXCLUDED_DIRS for p in parts): + continue + filtered.append(m) + matches = filtered if len(matches) > MAX_GLOB_RESULTS: matches = matches[:MAX_GLOB_RESULTS] truncated = True else: truncated = False - rel = [str(m.relative_to(project_root)) for m in matches] + rel = [ + os.path.relpath(str(m), str(project_root)).replace("\\", "/") + for m in matches + ] result = "\n".join(rel) if rel else "No matches found" if truncated: result += f"\n... [truncated at {MAX_GLOB_RESULTS} results]" @@ -286,7 +297,9 @@ def handler(args: dict[str, Any]) -> str: continue for i, line in enumerate(text.splitlines(), 1): if regex.search(line): - rel = str(fpath.relative_to(project_root)) + rel = os.path.relpath(str(fpath), str(project_root)).replace( + "\\", "/" + ) matches.append(f"{rel}:{i}: {line.rstrip()}") if len(matches) >= MAX_GREP_MATCHES: break diff --git a/src/uipath/dev/services/skill_service.py b/src/uipath/dev/services/skill_service.py index ef7b6e3..33fba5b 100644 --- a/src/uipath/dev/services/skill_service.py +++ b/src/uipath/dev/services/skill_service.py @@ -63,10 +63,12 @@ def get_skill_content(self, skill_id: str) -> str: return path.read_text(encoding="utf-8") def get_skill_summary(self, skill_id: str) -> str: - """Return a compact summary: title + description + section headings + reference files. + """Return a compact summary: title + description. This is injected into the system prompt instead of the full content, so the model can use ``read_reference`` to drill into details. + Keeps it short — no section TOCs or reference file lists (those are + appended once globally by the caller). """ path = self._resolve_skill_file(skill_id) if not path.is_file(): @@ -75,12 +77,10 @@ def get_skill_summary(self, skill_id: str) -> str: title = "" first_paragraph = "" - headings: list[str] = [] in_frontmatter = False past_title = False for line in text.splitlines(): stripped = line.strip() - # Skip YAML frontmatter if stripped == "---": in_frontmatter = not in_frontmatter continue @@ -93,32 +93,33 @@ def get_skill_summary(self, skill_id: str) -> str: ): title = stripped past_title = True - elif stripped.startswith("## "): - headings.append(stripped) elif past_title and not first_paragraph and stripped: first_paragraph = stripped - # List sibling reference files the model can read_reference into - refs_dir = path.parent - ref_files = sorted( - f.name for f in refs_dir.iterdir() if f.is_file() and f.suffix == ".md" - ) - parts = [title or f"# {skill_id}"] if first_paragraph: parts.append(first_paragraph) parts.append( - "\nTo use this skill: read the sections below, then call `read_reference` " - "with a filename to get full details on any topic." + "\nUse `read_reference` with a filename to get full details on any topic." ) - if headings: - parts.append("\nSections:") - parts.extend(f" - {h.lstrip('#').strip()}" for h in headings) - if ref_files: - parts.append("\nAvailable reference files (use read_reference to view):") - parts.extend(f" - {f}" for f in ref_files) return "\n".join(parts) + def get_reference_files(self) -> list[str]: + """Return a deduplicated list of all reference file names across skills.""" + seen: set[str] = set() + result: list[str] = [] + if not self._skills_dir.is_dir(): + return result + for child in sorted(self._skills_dir.iterdir()): + refs_dir = child / "references" + if not refs_dir.is_dir(): + continue + for f in sorted(refs_dir.iterdir()): + if f.is_file() and f.suffix == ".md" and f.name not in seen: + seen.add(f.name) + result.append(f.name) + return result + def get_reference(self, skill_id: str, ref_path: str) -> str: """Read a reference file relative to the skill's parent references dir.""" # Skill ID is like "uipath/authentication" — base dir is "uipath" diff --git a/src/uipath/dev/skills/uipath/references/creating-agents.md b/src/uipath/dev/skills/uipath/references/creating-agents.md index cc326a0..3afdb8c 100644 --- a/src/uipath/dev/skills/uipath/references/creating-agents.md +++ b/src/uipath/dev/skills/uipath/references/creating-agents.md @@ -44,19 +44,27 @@ All subsequent commands will be executed using `uv run` to ensure they run withi ## Project Configuration -### `uipath.json` +### Framework Config File -Create a `uipath.json` file in the project root to register your agent entry points: +Register your agent entry points in the appropriate framework config file. The project may already have one — check which file has a non-empty `"agents"` key: +- `uipath.json` — default UiPath agents +- `pydantic_ai.json` — PydanticAI agents +- `langgraph.json` — LangGraph agents +- `llama_index.json` — LlamaIndex agents +- `google_adk.json` — Google ADK agents +- `openai_agents.json` — OpenAI Agents SDK agents + +Format (all frameworks use the same structure): ```json { "agents": { - "main": "main.py:main" + "agent_name": "main.py:agent" } } ``` -The `"agents"` key maps agent names to their entry points in `file:function` format. For agent frameworks (e.g., LangGraph), use the framework's own config file (e.g., `langgraph.json`) instead. +The `"agents"` key maps agent names to their entry points in `file:variable_or_function` format. **IMPORTANT**: If a config file already exists with agents defined, use that one — do NOT create a new config or add agents to a different config file. ### `bindings.json` diff --git a/src/uipath/dev/skills/uipath/references/evaluations.md b/src/uipath/dev/skills/uipath/references/evaluations.md index 2e7716e..f9868f9 100644 --- a/src/uipath/dev/skills/uipath/references/evaluations.md +++ b/src/uipath/dev/skills/uipath/references/evaluations.md @@ -191,8 +191,8 @@ Creating evaluations involves defining test cases that validate your agent's beh Before creating evaluations, ensure your project has: -- `uipath.json` - Project configuration -- `entry-points.json` - Agent definitions +- A framework config file with agents/functions defined (e.g. `uipath.json`, `pydantic_ai.json`, `langgraph.json`) +- `entry-points.json` - Agent definitions (auto-generated by `uv run uipath init`) - `evaluations/` directory for test cases If missing, create an agent first. See the [Creating Agents](../../creating-agents.md) guide for setup instructions. @@ -1106,7 +1106,7 @@ uv run uipath eval \ ``` **Parameters:** -- `` - Agent/function name — the key from `uipath.json` (e.g., `"main"`), or from framework config files like `langgraph.json` / `llama-index.json`. This is the short name, **not** the file path. +- `` - Agent/function name — the key from the active framework config (e.g., `"agent"` from `pydantic_ai.json`, `"main"` from `uipath.json`). This is the short name, **not** the file path. Check which config file has `"agents"` or `"functions"` defined. - `` - Relative path to the evaluation set file (e.g., `evaluations/eval-sets/my-tests.json`). Required when the project has more than one eval set; can be omitted if there is only one. - `--workers` - Number of parallel workers (1-8) - `--no-report` - Don't report to UiPath Cloud diff --git a/src/uipath/dev/skills/uipath/references/running-agents.md b/src/uipath/dev/skills/uipath/references/running-agents.md index 1579cc4..d67202c 100644 --- a/src/uipath/dev/skills/uipath/references/running-agents.md +++ b/src/uipath/dev/skills/uipath/references/running-agents.md @@ -7,8 +7,8 @@ Execute your UiPath agent or function with interactive, schema-driven input coll ## Project Verification Before running an agent, your project should have: -- `uipath.json` - Project configuration -- `entry-points.json` - Agent entry points with schemas +- A framework config file with agents defined (e.g. `uipath.json`, `pydantic_ai.json`, `langgraph.json`) +- `entry-points.json` - Agent entry points with schemas (auto-generated by `uv run uipath init`) If missing, create an agent first. See the [Creating Agents](../creating-agents.md) guide for setup instructions. @@ -52,7 +52,7 @@ Your agent runs with: uv run uipath run '' ``` -Where `` is the key from `uipath.json` (e.g., `"main"` from `"agents": {"main": "main.py:main"}`), or the equivalent key from framework config files like `langgraph.json` or `llama-index.json`. It is **not** the file path — use the short name, not `main.py`. +Where `` is the agent key from the active framework config (e.g., `"agent"` from `pydantic_ai.json`, `"main"` from `uipath.json`). Check which config file has `"agents"` defined. It is **not** the file path — use the short name, not `main.py`. The agent runs with your provided inputs and returns structured output. diff --git a/uv.lock b/uv.lock index e12a37c..c088893 100644 --- a/uv.lock +++ b/uv.lock @@ -2266,7 +2266,7 @@ wheels = [ [[package]] name = "uipath-dev" -version = "0.0.70" +version = "0.0.71" source = { editable = "." } dependencies = [ { name = "fastapi" },