From 2dd67bc2cab3e1f60bc6932d5ac516de27773665 Mon Sep 17 00:00:00 2001 From: Daniel Kim <79390398+sox8502@users.noreply.github.com> Date: Mon, 20 Jul 2026 14:59:21 -0700 Subject: [PATCH] UI design-consistency pass: token scales, sentence case, sans-first, rounded everywhere (v0.1.68) (#103) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ui: add type/weight/radius token scales, drop dead CSS rules * ui: drop all uppercase transforms and tracking, sentence-case status strings * ui: reserve mono for code, paths, ids and terminal output * ui: primary content uses --text; grays reserved for true secondary text * ui: normalize font weights onto the --fw-* scale * ui: normalize radii and type sizes onto token scales, round callouts and inputs * ui: pin badges to sans in mono contexts, un-mono instance durations; rebuild dist * ui: sentence-case remaining status strings, fix stale ModelPicker comment * ui: promote composer reasoning pill to --text * ui: shared Wordmark component — logo mark + all-black OpenResearch text * ui: match home wordmark weight to the landing page (800 -> 700) * chore: bump version to 0.1.68 --- Cargo.lock | 2 +- Cargo.toml | 2 +- ui/dist/assets/index-B1p7OPJI.css | 32 - .../{index-DNALzhHF.js => index-DtLrlkjR.js} | 214 ++--- ui/dist/assets/index-FZ8l5lIQ.css | 32 + ui/dist/index.html | 4 +- ui/src/components/ChatPanel.tsx | 3 +- ui/src/components/LogTerminal.tsx | 6 +- ui/src/components/ModelPicker.tsx | 2 +- ui/src/components/Onboarding.tsx | 21 +- ui/src/components/ProjectsHome.tsx | 3 +- ui/src/components/SettingsPage.tsx | 76 +- ui/src/components/StatusBadge.tsx | 8 +- ui/src/components/TreeView.tsx | 4 +- ui/src/components/Wordmark.tsx | 16 + ui/src/styles.css | 827 ++++++++---------- 16 files changed, 612 insertions(+), 640 deletions(-) delete mode 100644 ui/dist/assets/index-B1p7OPJI.css rename ui/dist/assets/{index-DNALzhHF.js => index-DtLrlkjR.js} (61%) create mode 100644 ui/dist/assets/index-FZ8l5lIQ.css create mode 100644 ui/src/components/Wordmark.tsx diff --git a/Cargo.lock b/Cargo.lock index e26ae4eb..24623b49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -928,7 +928,7 @@ checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "openresearch-cli" -version = "0.1.67" +version = "0.1.68" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 2dffd761..377a7fd6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "openresearch-cli" -version = "0.1.67" +version = "0.1.68" edition = "2021" description = "OpenResearch CLI (orx) — Rust port" repository = "https://github.com/alphaXiv/openresearch-cli" diff --git a/ui/dist/assets/index-B1p7OPJI.css b/ui/dist/assets/index-B1p7OPJI.css deleted file mode 100644 index cebe2312..00000000 --- a/ui/dist/assets/index-B1p7OPJI.css +++ /dev/null @@ -1,32 +0,0 @@ -:root{--diff-background-color:initial;--diff-text-color:initial;--diff-font-family:Consolas,Courier,monospace;--diff-selection-background-color:#b3d7ff;--diff-selection-text-color:var(--diff-text-color);--diff-gutter-insert-background-color:#d6fedb;--diff-gutter-insert-text-color:var(--diff-text-color);--diff-gutter-delete-background-color:#fadde0;--diff-gutter-delete-text-color:var(--diff-text-color);--diff-gutter-selected-background-color:#fffce0;--diff-gutter-selected-text-color:var(--diff-text-color);--diff-code-insert-background-color:#eaffee;--diff-code-insert-text-color:var(--diff-text-color);--diff-code-delete-background-color:#fdeff0;--diff-code-delete-text-color:var(--diff-text-color);--diff-code-insert-edit-background-color:#c0dc91;--diff-code-insert-edit-text-color:var(--diff-text-color);--diff-code-delete-edit-background-color:#f39ea2;--diff-code-delete-edit-text-color:var(--diff-text-color);--diff-code-selected-background-color:#fffce0;--diff-code-selected-text-color:var(--diff-text-color);--diff-omit-gutter-line-color:#cb2a1d}.diff{background-color:var(--diff-background-color);border-collapse:collapse;color:var(--diff-text-color);table-layout:fixed;width:100%}.diff::-moz-selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-text-color);color:var(--diff-selection-text-color)}.diff::selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-text-color);color:var(--diff-selection-text-color)}.diff td{padding-bottom:0;padding-top:0;vertical-align:top}.diff-line{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);line-height:1.5}.diff-gutter>a{color:inherit;display:block}.diff-gutter{cursor:pointer;padding:0 1ch;text-align:right;-webkit-user-select:none;-moz-user-select:none;user-select:none}.diff-gutter-insert{background-color:#d6fedb;background-color:var(--diff-gutter-insert-background-color);color:var(--diff-text-color);color:var(--diff-gutter-insert-text-color)}.diff-gutter-delete{background-color:#fadde0;background-color:var(--diff-gutter-delete-background-color);color:var(--diff-text-color);color:var(--diff-gutter-delete-text-color)}.diff-gutter-omit{cursor:default}.diff-gutter-selected{background-color:#fffce0;background-color:var(--diff-gutter-selected-background-color);color:var(--diff-text-color);color:var(--diff-gutter-selected-text-color)}.diff-code{word-wrap:break-word;padding:0 0 0 .5em;white-space:pre-wrap;word-break:break-all}.diff-code-edit{color:inherit}.diff-code-insert{background-color:#eaffee;background-color:var(--diff-code-insert-background-color);color:var(--diff-text-color);color:var(--diff-code-insert-text-color)}.diff-code-insert .diff-code-edit{background-color:#c0dc91;background-color:var(--diff-code-insert-edit-background-color);color:var(--diff-text-color);color:var(--diff-code-insert-edit-text-color)}.diff-code-delete{background-color:#fdeff0;background-color:var(--diff-code-delete-background-color);color:var(--diff-text-color);color:var(--diff-code-delete-text-color)}.diff-code-delete .diff-code-edit{background-color:#f39ea2;background-color:var(--diff-code-delete-edit-background-color);color:var(--diff-text-color);color:var(--diff-code-delete-edit-text-color)}.diff-code-selected{background-color:#fffce0;background-color:var(--diff-code-selected-background-color);color:var(--diff-text-color);color:var(--diff-code-selected-text-color)}.diff-widget-content{vertical-align:top}.diff-gutter-col{width:7ch}.diff-gutter-omit{height:0}.diff-gutter-omit:before{background-color:#cb2a1d;background-color:var(--diff-omit-gutter-line-color);content:" ";display:block;height:100%;margin-left:4.6ch;overflow:hidden;white-space:pre;width:2px}.diff-decoration{line-height:1.5;-webkit-user-select:none;-moz-user-select:none;user-select:none}.diff-decoration-content{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);padding:0}:root{--base: #ffffff;--canvas: #faf8f4;--panel: #f3f0ea;--surface: #faf7f2;--surface-bright: #fdfbfb;--highlight: #fdf3f1;--text: #1d1b1a;--subtext: #737373;--muted: #a1a1a1;--primary: #9a2036;--primary-subtle: #f7e9ec;--secondary: #4a90e2;--error: #e2a100;--border: #d4d4d4;--border-variant: #e5e5e5;--accent-orange: #da642c;--accent-red: #d94654;--accent-teal: #209a84;--accent-blue: #3a8dff;--accent-pink: #ff2b90;--accent-amber: #da9100;--accent-green: #5eb64c;--accent-purple: #9c5cff;--accent-green-subtle: #e7f4e5;--accent-amber-subtle: #fff3e1;--accent-teal-subtle: #e1f3f0;--accent-red-subtle: #fbe9ea;--accent-blue-subtle: #e5f0ff;--accent-purple-subtle: #f1e8ff;--dots-muted: #e3ded5;--dots-strong: #bdb6a8;--mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;--readable-col: 760px;--bg: var(--base);--bg-canvas: var(--canvas);--surface-2: var(--panel);--border-strong: var(--border);--accent: var(--primary);--teal: var(--accent-teal);--green: var(--accent-green);--red: var(--accent-red);--amber: var(--accent-amber);--purple: var(--accent-purple);color-scheme:light}@media(prefers-color-scheme:dark){:root{--base: #0e0c0c;--canvas: #141110;--panel: #221f1e;--surface: #1d1b1a;--surface-bright: #130f0f;--highlight: #393433;--text: #e6e1e0;--subtext: #a68e8b;--muted: #737373;--primary: #ffb3ad;--primary-subtle: #33191b;--secondary: #3e7fcf;--error: #ffb951;--border: #525252;--border-variant: #404040;--accent-amber: #e67e22;--accent-green-subtle: #1c2b18;--accent-amber-subtle: #33260f;--accent-teal-subtle: #12332d;--accent-red-subtle: #331418;--accent-blue-subtle: #10233a;--accent-purple-subtle: #251933;--dots-muted: #2a2523;--dots-strong: #555555;color-scheme:dark}}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--base);color:var(--text);font-family:var(--sans);font-size:14px;line-height:1.45;overflow:hidden}::selection{background:var(--highlight)}button{font:inherit;color:inherit;background:none;border:none;cursor:pointer;padding:0}input,textarea,select{font:inherit;color:var(--text);background:var(--base);border:1px solid var(--border);border-radius:0;padding:6px 10px;outline:none}input:focus,textarea:focus,select:focus{border-color:var(--text)}input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--border);border-radius:5px;border:2px solid transparent;background-clip:padding-box}::-webkit-scrollbar-track{background:transparent}@keyframes pulse{50%{opacity:.35}}@keyframes spin{to{transform:rotate(360deg)}}.app{display:flex;flex-direction:column;height:100%}.app-body{display:flex;flex:1;min-height:0;padding:0 14px}.home{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges;background:var(--canvas)}.home-inner{max-width:620px;margin:0 auto;padding:48px 24px 64px}.home-brand{font-weight:800;font-size:28px;letter-spacing:-.02em;margin-bottom:36px}.home-brand span{color:var(--primary)}.home-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.home-head h2{margin:0;font-size:18px;letter-spacing:-.01em}.home-list{display:flex;flex-direction:column;gap:10px}.project-card{position:relative;display:flex;flex-direction:column;gap:4px;text-align:left;padding:14px 16px;background:var(--base);border:1px solid var(--border);border-radius:10px;cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease}.project-card:hover{border-color:var(--text);box-shadow:0 2px 10px #0000000f}.project-delete{position:absolute;top:10px;right:10px;display:none;padding:5px;border-radius:6px;color:var(--muted);line-height:0}.project-card:hover .project-delete{display:block}.project-delete:hover{color:var(--danger, #d33);background:var(--overlay, rgba(0, 0, 0, .05))}.project-card .name{font-weight:600;font-size:14px}.project-card .repo{color:var(--subtext)}.project-card .paper,.project-card .time{font-size:11px;color:var(--muted)}.rail-brand{display:flex;align-items:center;gap:4px;height:48px;padding:0 8px 0 12px;border-bottom:1px solid var(--border);flex-shrink:0}.rail-brand .brand{display:flex;align-items:center;gap:8px;flex:1;min-width:0;font-weight:600;font-size:13px;color:var(--text);padding:4px 6px 4px 0;border-radius:6px}.rail-brand .brand:hover{color:var(--subtext)}.rail-brand .brand svg{flex-shrink:0}.rail-brand .brand .brand-project{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.icon-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;color:var(--subtext)}.icon-btn:hover{color:var(--text);background:var(--surface)}[data-tip]{position:relative}[data-tip]:after{content:attr(data-tip);position:absolute;top:calc(100% + 6px);right:-4px;background:var(--text);color:var(--base);font-size:11px;font-weight:500;line-height:1;padding:5px 8px;border-radius:6px;white-space:nowrap;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .1s ease .3s,visibility 0s linear .4s;z-index:60}[data-tip]:hover:after{opacity:1;visibility:visible}.tip-up[data-tip]:after{top:auto;bottom:calc(100% + 6px)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 14px;font-size:12px;font-weight:600;border:1px solid var(--border);border-radius:8px;background:var(--base);color:var(--text);white-space:nowrap;transition:background .12s ease,border-color .12s ease,color .12s ease}.btn:hover:not(:disabled){background:var(--surface)}.btn:active:not(:disabled){background:var(--highlight)}.btn:disabled{opacity:.45;cursor:default}.btn.primary{background:var(--primary);border-color:var(--primary);color:var(--base)}.btn.primary:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text));border-color:color-mix(in oklab,var(--primary) 88%,var(--text))}.btn.primary:active:not(:disabled){background:color-mix(in oklab,var(--primary) 80%,var(--text));border-color:color-mix(in oklab,var(--primary) 80%,var(--text))}.btn.danger{color:var(--accent-red)}.btn.danger:hover:not(:disabled){background:color-mix(in oklab,var(--accent-red) 8%,transparent)}.btn.danger:active:not(:disabled){background:color-mix(in oklab,var(--accent-red) 14%,transparent)}.btn.ghost{border-color:transparent;color:var(--subtext)}.btn.ghost:hover:not(:disabled){color:var(--text);background:var(--surface)}.btn.sm{padding:3px 9px;font-size:11px;border-radius:6px}.status-badge{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:500;color:var(--subtext);text-transform:capitalize;white-space:nowrap}.status-badge .dot{width:7px;height:7px;border-radius:50%;background:currentColor;flex-shrink:0}.status-badge.live .dot{animation:pulse 1.2s ease-in-out infinite}.st-done .dot{color:var(--accent-green)}.st-failed .dot{color:var(--accent-red)}.st-running .dot{color:var(--accent-teal)}.st-starting .dot{color:var(--accent-amber)}.st-cancelled .dot{color:var(--accent-orange)}.st-editing .dot{color:var(--accent-purple)}.st-idle .dot{color:var(--muted)}.floating-panel{border:1px solid var(--border);border-radius:10px;box-shadow:0 6px 24px color-mix(in oklab,var(--text) 5%,transparent),0 1px 4px color-mix(in oklab,var(--text) 4%,transparent);overflow:hidden}.session-rail{width:232px;flex-shrink:0;display:flex;flex-direction:column;margin:10px 14px 10px 0;background:var(--base);min-height:0}.rail-nav{display:flex;flex-direction:column;gap:2px;padding:8px;flex-shrink:0}.rail-nav-item{display:flex;align-items:center;gap:10px;padding:7px 10px;font-size:12.5px;color:var(--subtext);border-radius:8px;text-align:left}.rail-nav-item:hover{background:var(--surface);color:var(--text)}.rail-nav-item.active{background:var(--panel);color:var(--text);font-weight:600}.rail-section-label{padding:10px 10px 6px;font-size:12px;font-weight:500;color:var(--muted)}.rail-section-head{display:flex;align-items:center;justify-content:space-between}.rail-filter{position:relative;display:inline-flex;margin-right:2px}.rail-filter-btn{width:24px;height:24px;border-radius:6px}.rail-empty{padding:6px 10px;font-size:12px;color:var(--muted)}.session-rail .rail-body{flex:1;min-height:0;overflow-y:auto;padding:4px 8px}.chat-pane{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--base);min-height:0}.right-pane{position:relative;flex-shrink:0;min-width:0;display:flex;flex-direction:column;margin:10px 0 10px 14px;background:var(--canvas)}.right-pane.max{position:fixed;top:10px;right:10px;bottom:10px;left:10px;margin:0;z-index:60;box-shadow:0 12px 40px color-mix(in oklab,var(--text) 22%,transparent)}.panel-resizer{position:absolute;left:0;top:0;bottom:0;width:6px;cursor:col-resize;z-index:30}.panel-resizer:hover,.panel-resizer:active{background:color-mix(in oklab,var(--text) 12%,transparent)}.panel-controls{display:inline-flex;align-items:center;gap:2px;flex-shrink:0}.tabs{display:flex;align-items:center;gap:4px;padding:0 10px;height:40px;border-bottom:1px solid var(--border);background:var(--base);flex-shrink:0}.tab-strip{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none}.tab-strip::-webkit-scrollbar{display:none}.tab.closable{max-width:176px;padding-right:4px}.tab .tab-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tab .tab-close{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:4px;color:var(--muted);flex-shrink:0}.tab .tab-close:hover{background:color-mix(in oklab,var(--text) 15%,transparent);color:var(--text)}.tab{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;font-size:12px;font-weight:600;color:var(--subtext);border-radius:6px;white-space:nowrap;flex-shrink:0}.tab:hover{color:var(--text)}.tab.active{color:var(--text);background:var(--surface)}.tab .tab-count{font-family:var(--mono);font-weight:400;color:var(--muted)}.tab-body{flex:1;min-height:0;position:relative;display:flex;flex-direction:column}.pane-toolbar{display:flex;align-items:center;justify-content:flex-end;padding:10px 12px 0;flex-shrink:0}.pane-content{flex:1;min-height:0;position:relative}.plan-tab-content{overflow-y:auto;background:var(--base);padding:18px 24px}.plan-tab-content .md{max-width:var(--readable-col)}.seg{display:inline-flex;align-items:center;gap:2px;padding:3px;border-radius:9px;background:color-mix(in oklab,var(--text) 10%,transparent)}.seg button{padding:3px 12px;font-size:12px;font-weight:600;color:var(--subtext);border-radius:6px}.seg button:hover{color:var(--text)}.seg button.active{background:var(--base);color:var(--text);box-shadow:0 1px 3px color-mix(in oklab,var(--text) 25%,transparent)}.chat-header{display:flex;align-items:center;gap:8px;padding:0 16px;background:var(--base);flex-shrink:0;height:48px;position:relative;z-index:4;width:100%;max-width:var(--readable-col);margin:0 auto}.chat-header.rail-hidden{max-width:none;padding:0 2px}.chat-header.rail-hidden>.icon-btn:first-child{margin-right:12px}.chat-header:after{content:"";position:absolute;top:100%;left:0;right:0;height:24px;background:linear-gradient(to bottom,var(--base),transparent);pointer-events:none}.chat-header .title{font-size:13px;font-weight:600;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row{position:relative;display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:7px 10px;border-radius:8px;font-size:12.5px;color:var(--subtext);cursor:pointer;-webkit-user-select:none;user-select:none}.session-row:hover{background:var(--surface);color:var(--text)}.session-row.active{color:var(--text);background:var(--surface);font-weight:500}.session-row .session-dot{width:14px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.session-row .session-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row .session-time{font-size:10px;font-family:var(--mono);color:var(--muted);flex-shrink:0}.session-row .session-menu-btn{display:none;align-items:center;justify-content:center;width:18px;height:18px;margin:-2px 0;border-radius:5px;color:var(--muted);flex-shrink:0}.session-row .session-menu-btn:hover{color:var(--text);background:var(--panel)}.session-row:hover .session-menu-btn,.session-row:focus-within .session-menu-btn,.session-row.menu-open .session-menu-btn{display:inline-flex}.session-row:hover .session-time,.session-row:focus-within .session-time,.session-row.menu-open .session-time{display:none}.session-row .busy-dot{width:7px;height:7px;border-radius:50%;background:var(--primary);animation:pulse 1.2s infinite;flex-shrink:0}.session-row .busy-dot.waiting{animation:none}.session-row .session-title-input{flex:1;min-width:0;padding:1px 5px;margin:-2px 0;font:inherit;color:var(--text);background:var(--base);border:1px solid var(--primary);border-radius:5px;outline:none}.session-row.editing{background:var(--surface);cursor:default}.session-row.editing .session-menu-btn,.session-row.editing .session-time{display:none}.chat-thread{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.chat-thread-inner{max-width:var(--readable-col);margin:0 auto;padding:16px 16px 32px;display:flex;flex-direction:column;gap:16px}.chat-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:var(--subtext);padding:20px;text-align:center}.chat-empty h2{margin:0;font-size:34px;font-weight:700;letter-spacing:-.02em;color:var(--text)}.chat-empty h2 span{color:var(--primary)}.chat-empty .chat-empty-hint{font-size:12px;color:var(--muted);max-width:340px;text-align:center}.chat-empty p{margin:0;font-size:13px;max-width:320px}.chat-empty .chat-suggest{font-family:var(--mono);font-size:12px;color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:999px;padding:6px 14px;cursor:pointer;transition:border-color .12s ease}.chat-empty .chat-suggest:hover{border-color:var(--text)}.msg-user{align-self:flex-end;max-width:88%;background:var(--surface);border-radius:16px;padding:10px 15px;font-size:13px;white-space:pre-wrap;word-break:break-word}.msg-images{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.msg-images img{max-width:220px;max-height:160px;border:1px solid var(--border-variant);border-radius:4px;display:block}.msg-assistant{font-size:14px;line-height:1.62;color:var(--text);min-width:0}.reasoning{color:var(--muted);font-size:12px;margin:2px 0}.reasoning summary{cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;font-weight:600}.reasoning[open]{white-space:pre-wrap}.tool-group{margin:2px 0}.tool-group-summary{display:flex;align-items:center;gap:8px;width:100%;padding:3px 2px;cursor:pointer;color:var(--muted);font-size:12.5px;text-align:left;border-radius:6px}.tool-group-summary:hover{color:var(--subtext);background:var(--surface)}.tool-group.has-error .tool-group-summary{color:var(--accent-red)}.tool-chevron{flex-shrink:0;color:var(--muted);transition:transform .12s ease}.tool-chevron.open{transform:rotate(90deg)}.tool-group-rows{display:flex;flex-direction:column;gap:1px;margin:2px 0 4px 7px;padding-left:10px;border-left:1px solid var(--border-variant)}.tool-row{display:flex;flex-direction:column}.tool-row summary{display:flex;align-items:center;gap:8px;padding:3px 4px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;min-width:0;border-radius:5px}.tool-row summary:hover{background:var(--surface)}.tool-row summary::-webkit-details-marker{display:none}.tool-line{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px;color:var(--subtext)}.tool-open{flex-shrink:0;font-size:11px;color:var(--primary)}.tool-open:hover{text-decoration:underline}.tool-status{width:6px;height:6px;border-radius:50%;flex-shrink:0;background:var(--muted)}.tool-status.running{background:var(--accent-amber);animation:pulse 1.2s ease-in-out infinite}.tool-status.error{background:var(--accent-red)}.tool-detail{margin:2px 0 4px 14px}.tool-cmd-full{padding:6px 10px;font-family:var(--mono);font-size:11px;color:var(--text);background:var(--surface);border-radius:5px;white-space:pre-wrap;word-break:break-word}.tool-output{margin-top:3px;padding:6px 10px;font-family:var(--mono);font-size:11px;color:var(--subtext);white-space:pre-wrap;word-break:break-word;max-height:260px;overflow-y:auto;background:var(--base);border:1px solid var(--border-variant);border-radius:5px}.working{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:12.5px;padding:2px 0 8px}.working.awaiting{font-style:italic}.spinner{width:13px;height:13px;border:2px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite;flex-shrink:0}.composer{padding:0 12px 12px;flex-shrink:0;position:relative;z-index:4;background:var(--base);width:100%;max-width:var(--readable-col);margin:0 auto}.composer:before{content:"";position:absolute;bottom:100%;left:0;right:0;height:24px;background:linear-gradient(to top,var(--base),transparent);pointer-events:none}.composer-box{position:relative;display:flex;flex-direction:column;border:1px solid var(--border);border-radius:8px;background:var(--base)}.composer textarea{border:none;background:none;resize:none;padding:10px 12px 4px;font-size:13px;min-height:42px;max-height:180px}.composer-attachments{display:flex;flex-wrap:wrap;gap:6px;padding:8px 12px 0}.attachment-thumb{position:relative}.attachment-thumb img{width:52px;height:52px;object-fit:cover;border:1px solid var(--border);border-radius:6px;display:block}.attachment-thumb button{position:absolute;top:-5px;right:-5px;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:1px solid var(--border);border-radius:50%;background:var(--surface);color:var(--text);cursor:pointer}.attachment-thumb button:hover{background:var(--text);color:var(--base)}.composer-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;padding:6px 8px 8px}.send-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:8px;background:var(--primary);color:var(--base);transition:background .1s ease,opacity .1s ease}.send-btn:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text))}.send-btn:disabled{opacity:.4;cursor:default}.send-btn.stop{background:var(--surface);color:var(--text)}.send-btn.stop:hover:not(:disabled){background:color-mix(in oklab,var(--surface) 88%,var(--text))}.md{min-width:0;word-break:break-word;color:var(--text);line-height:1.62}.md>*:first-child{margin-top:0}.md>*:last-child{margin-bottom:0}.md p{margin:10px 0}.md strong{color:var(--text);font-weight:600}.md pre{background:var(--surface);border:1px solid color-mix(in oklab,var(--border) 50%,transparent);border-radius:8px;padding:8px 12px;overflow-x:auto;font-size:12px;color:var(--text)}.md code{font-family:var(--mono);font-size:.9em;font-weight:500;color:var(--primary);background:var(--panel);border:1px solid var(--border-variant);padding:1px 5px}.md .file-chip{display:inline-flex;align-items:center;gap:4px;max-width:100%;margin:0 1px;padding:0 6px;vertical-align:baseline;font-family:var(--mono);font-size:.9em;font-weight:500;color:var(--text);background:var(--panel);border:1px solid var(--border-variant);cursor:pointer}.md .file-chip:hover:not(:disabled){background:var(--surface);color:var(--primary)}.md .file-chip svg{flex:none;opacity:.6}.md .file-chip-label{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.md pre code{background:none;border:none;color:inherit;padding:0;font-weight:400}.md-code{position:relative;margin:10px 0}.md-code pre{margin:0}.md-code-copy{position:absolute;top:6px;right:6px;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;color:var(--muted);background:var(--base);border:1px solid var(--border-variant);border-radius:6px;opacity:0;transition:opacity .12s ease,color .12s ease}.md-code:hover .md-code-copy{opacity:1}.md-code-copy:hover{color:var(--text);border-color:var(--muted)}.md h1,.md h2,.md h3,.md h4{color:var(--text);font-size:1.05em;font-weight:600;margin:12px 0 6px}.md ul,.md ol{margin:6px 0;padding-left:22px}.md li::marker{color:var(--primary)}.md a{color:var(--primary)}.md table{border-collapse:collapse;width:100%;font-size:13px;margin:10px 0;border:1px solid var(--border);border-radius:8px;overflow:hidden}.md th,.md td{border-bottom:1px solid var(--border-variant);padding:8px 14px;text-align:left;color:var(--text)}.md tr:last-child td{border-bottom:none}.md thead th{background:var(--surface);font-weight:500;color:var(--subtext);border-bottom:1px solid var(--border)}.md tbody tr:hover td{background:var(--surface-bright)}.md blockquote{margin:6px 0;padding:2px 0 2px 10px;border-left:3px solid var(--border);color:var(--subtext)}.react-flow__node.react-flow__node-exp.selectable{cursor:default}.exp-node{width:264px;border:1px solid var(--border);background:var(--base);padding:10px 12px;box-shadow:0 1px 2px #0000000a;font-size:12.5px;transition:box-shadow .12s ease}.exp-node:hover{box-shadow:0 2px 8px #00000014}.exp-node.live{border-color:var(--accent-teal);box-shadow:0 2px 12px #209a8433}.exp-node .node-eyebrow{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;font-family:var(--mono);font-size:9.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.exp-node .node-head{display:flex;align-items:center;gap:7px;min-width:0}.exp-node .node-status{width:8px;height:8px;border-radius:50%;flex-shrink:0}.exp-node .node-slug{font-family:var(--mono);font-size:12px;font-weight:700;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.exp-node .node-title{margin-top:4px;color:var(--subtext);font-size:11.5px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.exp-node .node-meta{margin-top:8px;display:flex;align-items:center;gap:8px;font-size:10px;color:var(--muted);font-family:var(--mono);text-transform:uppercase;letter-spacing:.05em}.exp-node .baseline-chip{font-size:9px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);border:1px solid var(--border);padding:0 4px;flex-shrink:0}.exp-node .node-actions{margin-top:8px;padding-top:6px;border-top:1px solid var(--border-variant);display:flex;align-items:center;gap:3px}.exp-node .node-action{display:inline-flex;align-items:center;gap:5px;padding:3px 6px;font-size:10.5px;font-weight:700;color:var(--subtext);border-radius:6px;text-decoration:none}.exp-node .node-action:hover{color:var(--text);background:var(--surface)}.exp-node .node-action-ext{margin-left:auto;padding:3px 5px}.run-squares{display:flex;align-items:center;gap:3px}.run-sq{width:9px;height:9px;flex-shrink:0}.run-sq.pass{background:var(--accent-green)}.run-sq.fail{border:1.5px solid color-mix(in oklab,var(--accent-red) 55%,transparent)}.run-sq.live{background:var(--accent-teal);animation:pulse 1.2s ease-in-out infinite}.run-sq.other{border:1.5px solid var(--border)}.react-flow__handle{opacity:0;pointer-events:none}.react-flow__attribution{display:none!important}.runs-table-wrap{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto;padding:12px}.runs-table{width:100%;border-collapse:separate;border-spacing:0;font-size:12.5px;background:var(--base);border:1px solid var(--border);border-radius:10px;overflow:hidden}.runs-table th{text-align:left;color:var(--muted);font-size:10.5px;text-transform:uppercase;letter-spacing:.06em;font-weight:600;padding:8px 12px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--base);z-index:1}.runs-table td{padding:8px 12px;border-bottom:1px solid color-mix(in oklab,var(--text) 6%,transparent);white-space:nowrap}.runs-table tr:last-child td{border-bottom:none}.runs-table tr.clickable{cursor:pointer}.runs-table tr.clickable:hover td{background:var(--canvas)}.mono{font-family:var(--mono);font-size:11.5px}.instances-section-title{display:flex;align-items:center;gap:8px;margin:22px 0 10px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}.instances-section-title .count-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--canvas);border:1px solid var(--border);font-size:11px;font-weight:500;letter-spacing:0;color:var(--text)}.instances-table-wrap{overflow-x:auto}.instances-empty{margin:0;padding:14px 16px;border:1px solid var(--border);border-radius:10px;background:var(--base);color:var(--subtext);font-size:12.5px}.backend-cell{display:inline-flex;align-items:center;gap:2px}.backend-cell .icon-btn{width:22px;height:22px}.backend-badge{display:inline-flex;align-items:center;gap:7px}.backend-badge svg{flex:none;display:block}.backend-badge .backend-name{font-weight:500}.backend-badge .backend-detail,.backend-badge.muted{color:var(--muted)}.status-chip{display:inline-flex;align-items:center;gap:6px;font-size:10px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;font-family:var(--mono)}.status-chip .dot{width:8px;height:8px;border-radius:50%}.drawer{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--base);display:flex;flex-direction:column;z-index:20}.drawer-body{flex:1;min-height:0;overflow-y:auto;padding:0 16px 24px;display:flex;flex-direction:column;gap:22px}.drawer-body>:first-child{margin-top:18px}.drawer-section h3{margin:0 0 10px;font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--muted)}.kv{display:grid;grid-template-columns:auto 1fr;gap:3px 14px;font-size:12.5px}.kv .k{color:var(--muted)}.kv .v{font-family:var(--mono);font-size:11.5px;word-break:break-all}.term-view{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;background:var(--base);z-index:20}.term-bar{display:flex;align-items:center;gap:8px;height:40px;padding:0 10px;border-bottom:1px solid var(--border);flex-shrink:0}.term-title{min-width:0;font-size:13px;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.term-bar .error{font-size:11.5px;color:var(--accent-red)}.term-bar .btn{display:inline-flex;align-items:center;gap:5px}.term-fill{flex:1;min-height:0;background:#1a1a1a;padding:4px 0 4px 6px}.term-empty{height:100%;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;font-size:12.5px;color:var(--muted)}.run-history{position:relative;flex-shrink:0}.run-picker{display:inline-flex;align-items:center;gap:8px;padding:4px 6px 4px 10px;border:1px solid var(--border);border-radius:8px;background:var(--base);color:var(--text)}.run-picker:hover{background:var(--surface)}.run-picker .run-label{font-size:12px;font-weight:600}.run-picker-chev{color:var(--muted);flex-shrink:0}.history-menu{position:absolute;top:calc(100% + 6px);right:0;min-width:230px;max-height:320px;overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 32px #0000002e;padding:5px;z-index:50}.history-item{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:12px;border-radius:6px}.history-item:hover,.history-item.active{background:var(--surface)}.history-item .run-label{font-weight:600}.history-item .when{margin-left:auto;font-size:11px;color:var(--muted)}.changes-branch{display:flex;align-items:center;gap:8px;margin-bottom:10px}.commit-picker{display:flex;align-items:center;gap:8px}.ctl-label{flex-shrink:0;font-family:var(--mono);font-size:9.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.commit-picker select{flex:1;min-width:0;font-family:var(--mono);font-size:11.5px}.uncommitted-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--accent-purple);flex-shrink:0}.changes-note{font-size:11.5px;color:var(--muted)}.empty-state{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:24px;text-align:center;color:var(--subtext)}.empty-state p{max-width:46ch;margin:0;font-size:13px;line-height:1.5;text-wrap:balance}.empty-state-cta{gap:6px}.empty-state p.empty-state-title{font-size:18px;font-weight:400;color:var(--text)}.empty-state p.empty-state-hint{font-size:15px;color:var(--subtext)}.onboarding .home-inner{max-width:560px;padding-top:96px}.onb-eyebrow{font-family:var(--mono);font-size:10px;font-weight:600;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin-bottom:14px}.onb-eyebrow span{color:var(--primary)}.onb-title{margin:0 0 6px;font-size:22px;letter-spacing:-.01em}.onb-sub{color:var(--subtext);font-size:13.5px;line-height:1.55;margin:0 0 22px;max-width:480px}.onb-cards{display:flex;flex-direction:column;gap:10px}.onb-card{display:flex;flex-direction:column;gap:5px;background:var(--base);border:1px solid var(--border);border-radius:10px;padding:18px 20px}.onb-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.onb-card-name{font-weight:600;font-size:14px}.onb-card-detail{font-size:12px}.onb-card-meta{font-size:12px;color:var(--subtext)}.onb-card-meta code{font-family:var(--mono);font-size:11px}.onb-card-row{display:grid;grid-template-columns:56px 1fr auto;align-items:baseline;gap:12px;padding:3px 0}.onb-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:13px;padding:8px 0}.onb-gh-options{display:flex;flex-direction:column;gap:16px;margin-top:12px;padding-top:14px;border-top:1px solid var(--border-variant)}.onb-gh-option{display:flex;flex-direction:column;gap:8px}.onb-gh-option-label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--subtext)}.onb-gh-option-body{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.onb-gh-cmd{font-family:var(--mono);font-size:12px;background:var(--panel);border:1px solid var(--border-variant);border-radius:5px;padding:3px 8px}.onb-gh-hint{font-size:12px;color:var(--subtext)}.onb-gh-hint code{font-family:var(--mono);font-size:11px}.onb-gh-or{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.05em}.onb-gh-or:before,.onb-gh-or:after{content:"";flex:1;height:1px;background:var(--border-variant)}.onb-gh-option .onb-token-form{flex:1;min-width:0;margin-top:0}.onb-token-form{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:8px}.onb-token-form input{flex:1;min-width:220px;font-family:var(--mono);font-size:12px}.onb-token-form a{font-size:12px;color:var(--subtext);white-space:nowrap}.onb-token-form .error{flex-basis:100%;color:var(--accent-red);font-size:12.5px;white-space:pre-wrap}.onb-actions{display:flex;align-items:center;gap:10px;margin-top:22px}.form .form-seg{align-self:flex-start;margin-bottom:2px}.form .form-seg button{padding:5px 12px}.form .repo-hint{font-family:var(--mono);font-weight:400;text-transform:none;letter-spacing:normal;font-size:11px;color:var(--muted)}.form .repo-hint.ok{color:var(--accent-teal)}.form .paper-results{display:flex;flex-direction:column;border:1px solid var(--border);border-radius:8px;max-height:240px;overflow-y:auto}.form .paper-results button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:8px 10px;background:none;border:none;border-bottom:1px solid var(--border-variant);text-align:left;font:inherit;color:var(--text);cursor:pointer}.form .paper-results button:last-child{border-bottom:none}.form .paper-results button:hover{background:var(--surface)}.form .paper-results .title{font-size:12.5px;font-weight:500}.form .paper-results .id,.form .paper-pick .id{font-family:var(--mono);font-size:11px;color:var(--muted)}.form .paper-pick{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:8px;background:var(--surface)}.form .paper-pick .meta{min-width:0}.form .paper-pick .title{font-size:13px;font-weight:600}.form{display:flex;flex-direction:column;gap:10px}.form label{display:flex;flex-direction:column;gap:4px;font-size:11px;color:var(--subtext);font-weight:700;text-transform:uppercase;letter-spacing:.05em}.form .row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}.form .actions{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}.form .error,.settings-card>.error{color:var(--accent-red);font-size:12.5px;white-space:pre-wrap;text-transform:none}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#1d1b1a66;display:flex;align-items:center;justify-content:center;z-index:100}.modal{width:480px;max-width:94vw;max-height:88vh;overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:12px;box-shadow:0 24px 60px #00000038;padding:24px}.modal h2{margin:0 0 14px;font-size:16px}:is(.modal,.home) :is(input,select,textarea){border-radius:8px}.settings-section+.settings-section{margin-top:18px;padding-top:16px;border-top:1px solid var(--border)}.settings-section h3{margin:0 0 8px;font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--muted)}.settings-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:12.5px;padding:4px 0}.settings-note{margin:10px 0 0;font-size:12px;padding:8px 10px;border:2px solid var(--accent-amber);background:var(--accent-amber-subtle);color:var(--accent-amber);font-weight:600}.progress{margin:12px 0 4px}.progress-track{height:8px;border-radius:999px;background:var(--surface);border:1px solid var(--border);overflow:hidden}.progress-fill{height:100%;background:var(--accent);border-radius:999px;transition:width .2s ease}.progress-caption{display:flex;justify-content:space-between;margin-top:6px;font-size:12px;color:var(--muted)}.settings-form{margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}.badge{display:inline-flex;align-items:center;font-size:10px;font-weight:700;font-family:var(--mono);text-transform:uppercase;letter-spacing:.06em;padding:1px 7px;border:1px solid var(--border);color:var(--muted)}.badge.ok{color:var(--accent-green);border-color:var(--accent-green);background:var(--accent-green-subtle)}.badge.err{color:var(--accent-red);border-color:var(--accent-red);background:var(--accent-red-subtle)}.badge.warn{color:var(--accent-amber);border-color:var(--accent-amber);background:var(--accent-amber-subtle)}.files-tab{height:100%;min-height:0;display:flex;background:var(--base)}.files-pill{display:inline-flex;align-items:center;gap:8px;min-width:0;border:1px solid var(--border);border-radius:8px;padding:7px 11px;background:var(--base);color:var(--text);text-decoration:none}.files-pill code{font-family:var(--mono);font-size:11.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.files-pill>svg{flex-shrink:0;color:var(--muted)}a.files-pill:hover{border-color:var(--muted)}.ftree-pane{position:relative;flex-shrink:0;display:flex;flex-direction:column;min-height:0;border-left:1px solid var(--border-variant);border-right:1px solid var(--border-variant);background:var(--base)}.ftree-resizer{position:absolute;right:-3px;top:0;bottom:0;width:6px;cursor:col-resize;z-index:30}.ftree-resizer:hover,.ftree-resizer:active{background:color-mix(in oklab,var(--text) 12%,transparent)}.ftree-scroll{flex:1;min-height:0;overflow-y:auto;padding:10px 8px}.ft-row{display:flex;align-items:center;gap:6px;padding:5px 8px;border-radius:7px;cursor:pointer}.ft-row:hover{background:var(--surface)}.ft-row.selected,.ft-row.selected:hover{background:var(--panel)}.ft-chevron{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex-shrink:0;color:var(--muted);transition:transform .12s ease}.ft-chevron.open{transform:rotate(90deg)}.ft-chevron.spacer{visibility:hidden}.ft-title{flex:1;min-width:0;font-size:12.5px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ft-dirname,.ft-name{flex:1;min-width:0;font-family:var(--mono);font-size:11.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ft-dirname{color:var(--text)}.ft-thumb{width:18px;height:18px;object-fit:cover;border-radius:4px;border:1px solid var(--border-variant);flex-shrink:0}.ft-divider{padding:12px 8px 4px;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}.ftree-footer{flex-shrink:0;display:flex;align-items:center;gap:2px;padding:5px 8px;border-top:1px solid var(--border-variant)}.ftree-footer code{flex:1;min-width:0;direction:rtl;text-align:left;font-family:var(--mono);font-size:10.5px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftree-footer .icon-btn{width:22px;height:22px}.fpreview{flex:1;min-width:0;display:flex;flex-direction:column;min-height:0;background:var(--base)}.fpreview-none{align-items:center;justify-content:center;gap:8px;font-size:12.5px;color:var(--muted)}.fpreview-head{height:40px;display:flex;align-items:center;gap:8px;padding:0 14px;border-bottom:1px solid var(--border-variant);color:var(--subtext);flex-shrink:0}.fpreview-path{font-family:var(--mono);font-size:12px;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fpreview-date,.fpreview-size{font-size:11px;color:var(--muted);white-space:nowrap;flex-shrink:0}.fpreview-size{font-family:var(--mono)}.fpreview-body{flex:1;min-height:0;overflow:auto}.fpreview-body.doc{padding:18px 28px 48px}.fpreview-body.doc .report-md{max-width:var(--readable-col);margin:0 auto}.fpreview-image{display:flex;align-items:flex-start;justify-content:center;padding:24px}.fpreview-image img{max-width:100%;height:auto;border:1px solid var(--border);border-radius:6px}.fpreview-pdf{display:block;width:100%;height:100%;border:0}.files-empty-state{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:24px;text-align:center;color:var(--muted)}.files-empty-state h3{margin:6px 0 0;font-size:14px;font-weight:600;color:var(--text)}.files-empty-state p{margin:0;max-width:420px;font-size:12.5px;line-height:1.55;color:var(--subtext)}.files-empty-state .ftree-footer{margin-top:10px;max-width:100%;border:1px solid var(--border);border-radius:8px;padding:6px 10px;background:var(--base)}.files-empty-state .ftree-footer code{max-width:380px}.files-truncated{margin:0;padding:8px 14px;font-size:11px;color:var(--muted)}.report-md{font-size:15px}.report-md h1{font-size:2em;line-height:1.18;margin:28px 0 14px}.report-md h2{font-size:1.5em;line-height:1.25;margin:28px 0 10px}.report-md h3{font-size:1.2em;line-height:1.35;margin:22px 0 8px}.report-md h4{font-size:1em;line-height:1.4;margin:18px 0 6px}.report-md table{display:block;width:max-content;max-width:100%;overflow-x:auto}.report-md .report-img{display:block;margin:12px 0}.report-md .report-img img{max-width:100%;height:auto;border:1px solid var(--border)}.report-md .report-img-caption{display:block;margin-top:4px;text-align:center;font-size:11.5px;color:var(--subtext)}.openresearch-diff{display:flex;flex-direction:column;gap:16px}.diff-file-card{border:1px solid var(--border);border-radius:8px;background:var(--base)}.diff-file-header{position:sticky;top:0;z-index:10;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-1px -1px 0;width:calc(100% + 2px);text-align:left;padding:8px 12px;cursor:pointer}.diff-file-header:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-2;background:var(--base)}.diff-file-header:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;background:var(--canvas);border:1px solid var(--border);border-radius:8px 8px 0 0}.diff-file-header .chev{color:var(--muted);font-size:10px;flex-shrink:0;width:12px}.diff-file-header .path{display:flex;align-items:center;gap:8px;min-width:0;flex:1}.diff-file-header .path code{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--mono);font-size:.7rem;font-weight:700;color:var(--text)}.diff-file-header .stats{display:flex;align-items:center;gap:8px;flex-shrink:0;font-family:var(--mono);font-size:.65rem;font-weight:700;font-variant-numeric:tabular-nums}.diff-stat-add{color:var(--accent-green)}.diff-stat-del{color:var(--accent-red)}.diff-empty{padding:8px 12px;color:var(--muted);font-size:12.5px}.truncated-notice{border:2px solid var(--accent-amber);background:var(--accent-amber-subtle);padding:12px 14px;font-size:12.5px}.truncated-notice h4{margin:0 0 4px;font-size:13px;color:var(--accent-amber)}.truncated-notice p{margin:0;color:var(--subtext)}.openresearch-diff .openresearch-diff-file{--openresearch-diff-selection-background-color: color-mix( in oklab, var(--surface) 76%, var(--primary) );--openresearch-diff-gutter-selection-background-color: color-mix( in oklab, var(--surface) 68%, var(--primary) );--openresearch-diff-insert-gutter-background-color: color-mix( in oklab, var(--base) 84%, var(--accent-green) );--openresearch-diff-delete-gutter-background-color: color-mix( in oklab, var(--base) 86%, var(--accent-red) );--openresearch-diff-insert-code-background-color: color-mix( in oklab, var(--base) 91%, var(--accent-green) );--openresearch-diff-delete-code-background-color: color-mix( in oklab, var(--base) 92%, var(--accent-red) );--openresearch-diff-insert-edit-background-color: color-mix( in oklab, var(--base) 72%, var(--accent-green) );--openresearch-diff-delete-edit-background-color: color-mix( in oklab, var(--base) 78%, var(--accent-red) );--openresearch-diff-divider-color: var(--border);--openresearch-diff-omit-gutter-line-color: color-mix(in oklab, var(--base) 86%, var(--text));--openresearch-diff-unified-gutter-text-color: color-mix(in oklab, var(--text) 45%, var(--base));--diff-background-color: var(--base);--diff-text-color: var(--text);--diff-font-family: var(--mono);--diff-selection-text-color: var(--primary);--diff-selection-background-color: var(--openresearch-diff-selection-background-color);--diff-gutter-selected-text-color: var(--diff-selection-text-color);--diff-gutter-selected-background-color: var( --openresearch-diff-gutter-selection-background-color );--diff-code-selected-text-color: var(--diff-selection-text-color);--diff-code-selected-background-color: var(--diff-selection-background-color);--diff-gutter-insert-text-color: var(--accent-green);--diff-gutter-insert-background-color: var(--openresearch-diff-insert-gutter-background-color);--diff-gutter-delete-text-color: var(--accent-red);--diff-gutter-delete-background-color: var(--openresearch-diff-delete-gutter-background-color);--diff-code-insert-text-color: var(--diff-text-color);--diff-code-insert-background-color: var(--openresearch-diff-insert-code-background-color);--diff-code-delete-text-color: var(--diff-text-color);--diff-code-delete-background-color: var(--openresearch-diff-delete-code-background-color);--diff-code-insert-edit-text-color: var(--diff-text-color);--diff-code-insert-edit-background-color: var(--openresearch-diff-insert-edit-background-color);--diff-code-delete-edit-text-color: var(--diff-text-color);--diff-code-delete-edit-background-color: var(--openresearch-diff-delete-edit-background-color);--diff-omit-gutter-line-color: var(--openresearch-diff-omit-gutter-line-color);width:100%;font-size:12px;line-height:1.5}.openresearch-diff .openresearch-diff-file.diff-unified{table-layout:auto}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:first-child{display:none}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){width:0%;padding:0 .5rem 0 .625rem;white-space:nowrap;text-align:right;color:var(--openresearch-diff-unified-gutter-text-color);border-right:1px solid var(--openresearch-diff-divider-color);-webkit-user-select:none;user-select:none;cursor:default}.openresearch-diff .openresearch-diff-file .diff-line{line-height:1.5}.openresearch-diff .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top:1px solid var(--openresearch-diff-divider-color)}:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#a0a1a7}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#383a42}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#a626a4}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#4078f2}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#383a42}@media(prefers-color-scheme:dark){:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#7f848e}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#abb2bf}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#c678dd}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#61afef}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#abb2bf}}.settings-view-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.settings-view{max-width:var(--readable-col);margin:0 auto;padding:24px 32px 60px}.settings-view h1{margin:0 0 6px;font-size:22px}.settings-head-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.settings-head-row h1{margin:0}.settings-view>.error{color:var(--accent-red);font-size:12.5px;white-space:pre-wrap;text-transform:none;margin:0 0 12px}.settings-sub{margin:0 0 18px;color:var(--subtext);font-size:13px}.settings-card{background:var(--base);border:1px solid var(--border);border-radius:10px;padding:16px 18px;margin-bottom:16px}.settings-card h3{margin:0 0 10px;font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:700;color:var(--muted)}.settings-card .settings-sub{margin-bottom:12px}.settings-card-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}.settings-card .kv{gap:6px 18px}.settings-empty{color:var(--muted);font-size:12.5px;margin:4px 0 0}.muted{color:var(--muted)}.compute-list{display:flex;flex-direction:column;gap:10px;margin-bottom:14px}.compute-row{background:var(--base);border:1px solid var(--border);border-radius:10px}.compute-row-head{display:flex;align-items:center;gap:10px;padding:12px 14px;cursor:pointer;-webkit-user-select:none;user-select:none}.compute-row-head:hover{background:var(--surface);border-radius:10px}.compute-row.open .compute-row-head:hover{border-radius:10px 10px 0 0}.compute-row-logo{display:inline-flex;align-items:center;flex:none}.compute-row-name{font-size:13px;font-weight:600;color:var(--text);flex:none}.compute-row-summary{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:12px}.compute-row-head .badge,.compute-make-default,.compute-default-pill{flex:none}.compute-default-pill{color:var(--primary);border-color:var(--primary)}.compute-chevron-btn{flex:none;display:inline-flex;align-items:center;padding:2px;border-radius:6px}.compute-chevron-btn:hover{background:var(--panel)}.compute-chevron{color:var(--muted);transition:transform .12s ease}.compute-row.open .compute-chevron{transform:rotate(180deg)}.compute-row-body{border-top:1px solid var(--border);padding:14px}.compute-row-body .settings-card{margin-bottom:0;margin-top:14px}.compute-default-note{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.compute-flavor-form{margin-bottom:14px}.compute-flavor-form label{max-width:320px}.compute-flavor-hint{font-size:12px}.compute-footnote{display:flex;align-items:flex-start;gap:6px;margin:2px 0 0;font-size:12px;color:var(--muted)}.compute-footnote svg{flex:none;margin-top:1px}.harness-tabs{display:flex;gap:4px;margin-bottom:14px;border-bottom:1px solid var(--border-variant)}.harness-tabs button{display:inline-flex;align-items:center;gap:7px;padding:7px 12px;font-size:13px;font-weight:600;color:var(--subtext);border-bottom:2px solid transparent;margin-bottom:-1px}.harness-tabs button:hover{color:var(--text)}.harness-tabs button.active{color:var(--text);border-bottom-color:var(--primary)}.harness-dot{width:7px;height:7px;border-radius:50%;background:var(--muted)}.harness-dot.ok{background:var(--accent-green)}.harness-dot.err{background:var(--accent-red)}.harness-dot.warn{background:var(--accent-amber)}.env-table{width:100%;border-collapse:collapse;font-size:12.5px;table-layout:fixed}.env-table td:first-child{width:32%;overflow-wrap:anywhere}.env-table .badge{margin-left:8px}.env-table input{width:100%;border:none;background:transparent;padding:0}.env-table input:focus{box-shadow:0 1px 0 0 var(--text)}.env-table td{height:36px;padding:0 10px 0 0;vertical-align:middle;border-bottom:1px solid var(--border-variant)}.env-table td:last-child{width:116px;white-space:nowrap;text-align:right}.env-table td[colspan]{white-space:normal;text-align:left}.env-table .icon-btn{margin-left:8px;vertical-align:middle}.env-table .icon-btn:hover{color:var(--accent-red)}.flavor-table{width:100%;border-collapse:collapse;font-size:12.5px}.flavor-table th{padding:5px 10px 5px 0;border-bottom:1px solid var(--border);text-align:left;font-weight:500;color:var(--muted)}.flavor-table td{padding:5px 10px 5px 0;border-bottom:1px solid var(--border-variant)}.ssh-table{table-layout:fixed}.ssh-table th:nth-child(1){width:20%}.ssh-table th:nth-child(2){width:26%}.ssh-table th:nth-child(4){width:108px}.ssh-table th:nth-child(5){width:52px}.ssh-table td{overflow-wrap:anywhere}.ssh-table td:last-child{padding-right:0;text-align:right}.ssh-tested-at{display:block;margin-top:2px;color:var(--muted);font-size:11px}@keyframes settings-spin{to{transform:rotate(360deg)}}.spin{animation:settings-spin .9s linear infinite}.model-picker,.option-picker{position:relative;display:inline-flex}.composer-pill{display:inline-flex;align-items:center;gap:5px;font-family:var(--mono);font-size:11.5px;color:var(--subtext);padding:5px 8px;border-radius:6px}.composer-pill:hover{background:var(--surface);color:var(--text)}.composer-bare{display:inline-flex;align-items:center;gap:3px;font-size:11.5px;color:var(--subtext);padding:5px 4px;border-radius:6px}.composer-bare:hover{color:var(--text)}.model-menu,.option-menu{position:absolute;bottom:calc(100% + 8px);left:0;max-height:380px;display:flex;flex-direction:column;background:var(--base);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 32px #0000002e;z-index:50;overflow:hidden}.model-menu{width:320px}.option-menu{min-width:190px;padding:6px}.model-menu.align-right,.option-menu.align-right{left:auto;right:0}.option-menu.drop-down{bottom:auto;top:calc(100% + 4px)}.option-menu.session-menu{left:auto;right:6px;top:calc(100% - 2px);min-width:140px}.model-item.danger,.model-item.danger:hover{color:var(--accent-red)}.option-default{color:var(--muted);font-weight:400}.option-sep{height:1px;margin:5px 4px;background:var(--border-variant)}.option-num{color:var(--muted);font-size:11px;font-variant-numeric:tabular-nums}.model-menu input{border:none;border-bottom:1px solid var(--border-variant);background:none;padding:9px 12px;font-size:12.5px;outline:none}.model-menu-list{overflow-y:auto;padding:6px}.model-group{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);padding:8px 8px 4px}.model-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:12.5px;border-radius:6px}.model-item:hover{background:var(--surface)}.model-item .model-id{display:block;font-family:var(--mono);font-size:10px;color:var(--muted)}.model-more{padding:4px 8px 8px;font-size:11px;color:var(--muted)}.model-locked-note{display:flex;align-items:center;gap:6px;padding:7px 12px;font-size:11px;color:var(--muted);border-top:1px solid var(--border-variant)}.model-locked-note svg{flex-shrink:0}.skill-menu{position:absolute;bottom:calc(100% + 8px);left:0;min-width:340px;max-width:100%;padding:6px;background:var(--base);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 32px #0000002e;z-index:50;overflow:hidden}.skill-item{display:flex;flex-direction:column;gap:2px;width:100%;text-align:left;padding:7px 8px;border-radius:6px}.skill-item.active{background:var(--surface)}.skill-item .skill-name{font-family:var(--mono);font-size:12px}.skill-item .skill-hint{color:var(--muted)}.skill-item .skill-desc{font-size:11px;color:var(--subtext)}.file-view{display:flex;flex-direction:column;height:100%;min-height:0}.file-view-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);color:var(--subtext);flex-shrink:0}.file-view-path{font-family:var(--mono);font-size:12px;color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-view-ref{font-family:var(--mono);font-size:11px;color:var(--muted);border:1px solid var(--border-variant);border-radius:6px;padding:1px 6px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:0}.file-view-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.file-view-codewrap{display:flex;align-items:flex-start;min-width:max-content}.file-view-gutter,.file-view-code{margin:0;padding-top:14px;padding-bottom:14px;font-family:var(--mono);font-size:12px;line-height:1.55}.file-view-gutter{padding-left:14px;padding-right:10px;text-align:right;color:var(--muted);-webkit-user-select:none;user-select:none;position:sticky;left:0;background:var(--base);border-right:1px solid var(--border-variant);flex-shrink:0}.file-view-code{padding-left:16px;padding-right:16px;-moz-tab-size:4;tab-size:4;min-width:max-content}.file-view-note{padding:10px 16px;font-size:12px;color:var(--muted)}.file-view-md{max-width:var(--readable-col);padding:18px 20px 32px}.file-view-md .md{font-size:13.5px}.file-view-md .md h1{font-size:1.5em;margin:18px 0 8px}.file-view-md .md h2{font-size:1.25em;margin:16px 0 8px}.file-view-md .md h3{font-size:1.1em}.icon-btn.active{color:var(--primary);background:var(--surface)}.prompt-card{margin:8px 0;padding:12px 14px;border:1px solid var(--border);border-left:3px solid var(--border);border-radius:6px;background:var(--surface);display:flex;flex-direction:column;gap:9px}.prompt-card.plan{border-left-color:var(--accent-blue)}.prompt-card.permission{border-left-color:var(--accent-amber)}.prompt-card.question{border-left-color:var(--accent-purple)}.prompt-card.readonly{opacity:.6}.prompt-head{font-size:11px;font-weight:600;letter-spacing:.03em;text-transform:uppercase;color:var(--muted)}.prompt-head code{font-family:var(--mono);font-size:11.5px;text-transform:none;color:var(--text)}.prompt-sub{font-family:var(--mono);font-size:12px;color:var(--subtext);word-break:break-word}.prompt-q{font-size:14px;font-weight:600;line-height:1.5;color:var(--text)}.prompt-plan{font-size:13.5px;line-height:1.6;color:var(--text);max-height:340px;overflow-y:auto}.prompt-options{display:flex;flex-direction:column;gap:6px}.prompt-option{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;padding:8px 11px;text-align:left;border:1px solid var(--border);border-radius:5px;background:var(--base);color:var(--text);cursor:pointer;transition:border-color 80ms ease,background 80ms ease}.prompt-option:hover:not(:disabled){border-color:var(--border-strong);background:var(--surface)}.prompt-option.sel{border-color:var(--primary);background:var(--primary-subtle)}.prompt-option:disabled{cursor:default}.prompt-option-label{display:block;font-size:13px;font-weight:600}.prompt-option-desc{display:block;font-size:12px;font-weight:400;line-height:1.45;color:var(--subtext)}.prompt-actions{display:flex;flex-wrap:wrap;gap:8px}.prompt-actions .btn-primary,.prompt-actions .btn-ghost{display:inline-flex;align-items:center;gap:6px;padding:6px 13px;font-family:inherit;font-size:12px;font-weight:600;border:1px solid transparent;border-radius:5px;cursor:pointer;transition:background 80ms ease,border-color 80ms ease}.prompt-actions .btn-primary{background:var(--primary);color:var(--base)}.prompt-actions .btn-primary:hover:not(:disabled){opacity:.9}.prompt-actions .btn-ghost{background:transparent;border-color:var(--border);color:var(--subtext)}.prompt-actions .btn-ghost:hover:not(:disabled){border-color:var(--border-strong);color:var(--text);background:var(--surface)}.prompt-actions button:disabled{opacity:.5;cursor:default}.prompt-collapsed{color:var(--muted);font-size:13px;margin:4px 0}.prompt-collapsed summary{display:flex;align-items:baseline;gap:8px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none}.prompt-collapsed summary::-webkit-details-marker{display:none}.prompt-collapsed summary:after{content:"›";color:var(--muted);transition:transform 80ms ease}.prompt-collapsed[open] summary:after{transform:rotate(90deg)}.prompt-collapsed-title{font-weight:600;word-break:break-word}.prompt-outcome{font-size:12px;color:var(--subtext);word-break:break-word}.prompt-outcome.approved,.prompt-outcome.chosen{color:var(--accent-green)}.prompt-outcome.approved:before,.prompt-outcome.chosen:before{content:"✓ "}.prompt-outcome.revised,.prompt-outcome.rejected{color:var(--accent-amber)}.prompt-collapsed-body{margin-top:6px;padding-left:12px;border-left:2px solid var(--border);font-size:13px;color:var(--subtext)}.prompt-collapsed-options{margin:6px 0 0;padding-left:18px}.prompt-collapsed-options .sel{color:var(--text);font-weight:600}.prompt-collapsed-note{margin-top:6px;font-style:italic}.plan-strip{position:relative;width:100%;margin:0 0 10px;padding:11px 13px;display:flex;flex-direction:column;align-items:stretch;gap:10px;border:1px solid var(--border);border-left:3px solid var(--accent-blue);border-radius:8px;background:var(--surface);box-shadow:0 2px 10px #0000000f}.plan-strip-info{display:flex;align-items:baseline;gap:8px;min-width:0}.plan-strip-open{margin-left:auto;padding:0;border:none;background:none;color:var(--accent-blue);font-size:12.5px;cursor:pointer;white-space:nowrap;flex-shrink:0}.plan-strip-open:hover{text-decoration:underline}.plan-strip-spacer{flex:1}.plan-strip-revise-input{width:100%;resize:none;border:1px solid var(--border);border-radius:8px;padding:9px 11px;font-size:13px;font-family:inherit;background:var(--base);color:var(--text)}.plan-strip-revise-input:focus{border-color:var(--accent-blue)}.plan-strip-icon{color:var(--accent-blue);flex-shrink:0;align-self:center}.plan-strip-title{font-size:13px;font-weight:600;white-space:nowrap}.plan-strip-actions{gap:6px 8px;justify-content:flex-end}.plan-strip-actions .btn-primary,.plan-strip-actions .btn-ghost{background:transparent;border:1px solid var(--text);color:var(--text)}.plan-strip-actions .btn-primary:hover:not(:disabled),.plan-strip-actions .btn-ghost:hover:not(:disabled){background:var(--surface-2, rgb(0 0 0 / 5%));border-color:var(--text);color:var(--text);opacity:1}.plan-strip-actions .plan-strip-primary{background:var(--text);border-color:var(--text);color:var(--base)}.plan-strip-actions .plan-strip-primary:hover:not(:disabled){background:color-mix(in oklab,var(--text) 85%,var(--base));border-color:var(--text);color:var(--base)}.plan-strip-approve{position:relative;display:flex}.plan-strip-approve .btn-primary:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.plan-strip-actions .plan-strip-caret{border-top-left-radius:0;border-bottom-left-radius:0;padding:0 6px;display:flex;align-items:center;border-left:1px solid color-mix(in oklab,var(--base) 35%,var(--text))}.plan-strip-menu{position:absolute;right:0;bottom:calc(100% + 4px);display:flex;flex-direction:column;min-width:190px;padding:4px;border:1px solid var(--border);border-radius:8px;background:var(--surface);box-shadow:0 6px 20px #0000001f;z-index:6}.plan-strip-menu button{text-align:left;padding:7px 9px;border:none;border-radius:5px;background:transparent;color:var(--text);font-size:12.5px;cursor:pointer}.plan-strip-menu button:hover{background:var(--surface-2, rgb(0 0 0 / 5%))}.prompt-plan.clamped{max-height:9.5em;overflow:hidden;position:relative}.prompt-plan.clamped:after{content:"";position:absolute;inset:auto 0 0 0;height:34px;background:linear-gradient(to bottom,transparent,var(--surface));pointer-events:none}.prompt-plan-open{align-self:flex-start;border:none;background:transparent;color:var(--accent-blue);font-size:12px;padding:0;cursor:pointer}.prompt-plan-open:hover{text-decoration:underline}.code-tab{display:flex;flex-direction:column;height:100%;min-height:0}.code-tab-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-select{max-width:280px;min-width:0;padding:3px 8px;font-size:12px}.code-tab-note{padding:8px 16px;font-size:12px;color:var(--muted);border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.code-tree{padding:6px 0;font-size:12.5px}.code-tree-row{display:flex;align-items:center;gap:6px;width:100%;padding:3px 10px;border:none;background:transparent;color:var(--text);text-align:left;cursor:pointer;font-family:inherit;font-size:inherit}.code-tree-row:hover{background:var(--panel)}.code-tree-row>svg{flex-shrink:0;color:var(--subtext)}.code-tree-row>svg.code-tree-chev{color:var(--muted)}.code-tree-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tour-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:200}.tour-dim{position:absolute;top:0;right:0;bottom:0;left:0;background:#0000008c}.tour-spotlight{position:absolute;border-radius:10px;box-shadow:0 0 0 9999px #0000008c;transition:all .3s ease}.tour-ring{position:absolute;border-radius:10px;border:2px solid var(--primary);transition:all .3s ease}.tour-card{position:absolute;width:340px;max-width:calc(100vw - 32px);background:var(--base);border:1px solid var(--border);border-radius:12px;box-shadow:0 24px 60px #00000038;padding:18px 20px 0;transition:left .2s ease,top .2s ease}.tour-card.centered{left:50%;top:50%;transform:translate(-50%,-50%);transition:none}.tour-card h3{margin:0 24px 6px 0;font-size:14px;font-weight:600}.tour-card p{margin:0;font-size:12.5px;line-height:1.5;color:var(--subtext)}.tour-card .tour-close{position:absolute;top:10px;right:10px}.tour-footer{display:flex;align-items:center;border-top:1px solid var(--border-variant);margin-top:14px;padding:10px 0}.tour-footer-side{flex:1;display:flex}.tour-footer-side.end{justify-content:flex-end}.tour-count{font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}.tour-arrow{position:absolute;width:12px;height:12px;background:var(--base);rotate:45deg;pointer-events:none}.tour-arrow.above{bottom:-6.5px;left:calc(50% - 6px);border-right:1px solid var(--border);border-bottom:1px solid var(--border)}.tour-arrow.below{top:-6.5px;left:calc(50% - 6px);border-left:1px solid var(--border);border-top:1px solid var(--border)}.tour-arrow.left{right:-6.5px;top:calc(50% - 6px);border-top:1px solid var(--border);border-right:1px solid var(--border)}.tour-arrow.right{left:-6.5px;top:calc(50% - 6px);border-bottom:1px solid var(--border);border-left:1px solid var(--border)}.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}/** - * Copyright (c) 2014 The xterm.js authors. All rights reserved. - * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) - * https://github.com/chjj/term.js - * @license MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * Originally forked from (with the author's permission): - * Fabrice Bellard's javascript vt100 for jslinux: - * http://bellard.org/jslinux/ - * Copyright (c) 2011 Fabrice Bellard - * The original design remains. The terminal itself - * has been extended to include xterm CSI codes, among - * other features. - */.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative} diff --git a/ui/dist/assets/index-DNALzhHF.js b/ui/dist/assets/index-DtLrlkjR.js similarity index 61% rename from ui/dist/assets/index-DNALzhHF.js rename to ui/dist/assets/index-DtLrlkjR.js index 0567dc59..7d6cc80d 100644 --- a/ui/dist/assets/index-DNALzhHF.js +++ b/ui/dist/assets/index-DtLrlkjR.js @@ -1,4 +1,4 @@ -var AA=Object.defineProperty;var By=e=>{throw TypeError(e)};var NA=(e,t,n)=>t in e?AA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Qr=(e,t,n)=>NA(e,typeof t!="symbol"?t+"":t,n),TA=(e,t,n)=>t.has(e)||By("Cannot "+n);var Iy=(e,t,n)=>t.has(e)?By("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);var Jr=(e,t,n)=>(TA(e,t,"access private method"),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();function Yu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ud={exports:{}},Ao={};/** +var NA=Object.defineProperty;var Iy=e=>{throw TypeError(e)};var TA=(e,t,n)=>t in e?NA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Qr=(e,t,n)=>TA(e,typeof t!="symbol"?t+"":t,n),DA=(e,t,n)=>t.has(e)||Iy("Cannot "+n);var zy=(e,t,n)=>t.has(e)?Iy("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n);var Jr=(e,t,n)=>(DA(e,t,"access private method"),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();function Yu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gd={exports:{}},No={};/** * @license React * react-jsx-runtime.production.js * @@ -6,7 +6,7 @@ var AA=Object.defineProperty;var By=e=>{throw TypeError(e)};var NA=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var zy;function RA(){if(zy)return Ao;zy=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,l){var u=null;if(l!==void 0&&(u=""+l),a.key!==void 0&&(u=""+a.key),"key"in a){l={};for(var o in a)o!=="key"&&(l[o]=a[o])}else l=a;return a=l.ref,{$$typeof:e,type:r,key:u,ref:a!==void 0?a:null,props:l}}return Ao.Fragment=t,Ao.jsx=n,Ao.jsxs=n,Ao}var Hy;function DA(){return Hy||(Hy=1,Ud.exports=RA()),Ud.exports}var g=DA(),Gd={exports:{}},He={};/** + */var Hy;function RA(){if(Hy)return No;Hy=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,l){var u=null;if(l!==void 0&&(u=""+l),a.key!==void 0&&(u=""+a.key),"key"in a){l={};for(var o in a)o!=="key"&&(l[o]=a[o])}else l=a;return a=l.ref,{$$typeof:e,type:r,key:u,ref:a!==void 0?a:null,props:l}}return No.Fragment=t,No.jsx=n,No.jsxs=n,No}var Fy;function MA(){return Fy||(Fy=1,Gd.exports=RA()),Gd.exports}var g=MA(),qd={exports:{}},He={};/** * @license React * react.production.js * @@ -14,7 +14,7 @@ var AA=Object.defineProperty;var By=e=>{throw TypeError(e)};var NA=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Fy;function MA(){if(Fy)return He;Fy=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),v=Symbol.iterator;function _(O){return O===null||typeof O!="object"?null:(O=v&&O[v]||O["@@iterator"],typeof O=="function"?O:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,S={};function y(O,U,$){this.props=O,this.context=U,this.refs=S,this.updater=$||C}y.prototype.isReactComponent={},y.prototype.setState=function(O,U){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,U,"setState")},y.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function x(){}x.prototype=y.prototype;function b(O,U,$){this.props=O,this.context=U,this.refs=S,this.updater=$||C}var E=b.prototype=new x;E.constructor=b,w(E,y.prototype),E.isPureReactComponent=!0;var R=Array.isArray;function N(){}var D={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function j(O,U,$){var Q=$.ref;return{$$typeof:e,type:O,key:U,ref:Q!==void 0?Q:null,props:$}}function B(O,U){return j(O.type,U,O.props)}function z(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function V(O){var U={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function($){return U[$]})}var F=/\/+/g;function P(O,U){return typeof O=="object"&&O!==null&&O.key!=null?V(""+O.key):U.toString(36)}function Y(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(N,N):(O.status="pending",O.then(function(U){O.status==="pending"&&(O.status="fulfilled",O.value=U)},function(U){O.status==="pending"&&(O.status="rejected",O.reason=U)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function q(O,U,$,Q,re){var se=typeof O;(se==="undefined"||se==="boolean")&&(O=null);var Z=!1;if(O===null)Z=!0;else switch(se){case"bigint":case"string":case"number":Z=!0;break;case"object":switch(O.$$typeof){case e:case t:Z=!0;break;case p:return Z=O._init,q(Z(O._payload),U,$,Q,re)}}if(Z)return re=re(O),Z=Q===""?"."+P(O,0):Q,R(re)?($="",Z!=null&&($=Z.replace(F,"$&/")+"/"),q(re,U,$,"",function(ne){return ne})):re!=null&&(z(re)&&(re=B(re,$+(re.key==null||O&&O.key===re.key?"":(""+re.key).replace(F,"$&/")+"/")+Z)),U.push(re)),1;Z=0;var H=Q===""?".":Q+":";if(R(O))for(var ee=0;ee{throw TypeError(e)};var NA=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var $y;function LA(){return $y||($y=1,(function(e){function t(q,X){var K=q.length;q.push(X);e:for(;0>>1,M=q[L];if(0>>1;La($,K))Qa(re,$)?(q[L]=re,q[Q]=K,L=Q):(q[L]=$,q[U]=K,L=U);else if(Qa(re,K))q[L]=re,q[Q]=K,L=Q;else break e}}return X}function a(q,X){var K=q.sortIndex-X.sortIndex;return K!==0?K:q.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,o=u.now();e.unstable_now=function(){return u.now()-o}}var c=[],f=[],p=1,d=null,v=3,_=!1,C=!1,w=!1,S=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function E(q){for(var X=n(f);X!==null;){if(X.callback===null)r(f);else if(X.startTime<=q)r(f),X.sortIndex=X.expirationTime,t(c,X);else break;X=n(f)}}function R(q){if(w=!1,E(q),!C)if(n(c)!==null)C=!0,N||(N=!0,V());else{var X=n(f);X!==null&&Y(R,X.startTime-q)}}var N=!1,D=-1,T=5,j=-1;function B(){return S?!0:!(e.unstable_now()-jq&&B());){var L=d.callback;if(typeof L=="function"){d.callback=null,v=d.priorityLevel;var M=L(d.expirationTime<=q);if(q=e.unstable_now(),typeof M=="function"){d.callback=M,E(q),X=!0;break t}d===n(c)&&r(c),E(q)}else r(c);d=n(c)}if(d!==null)X=!0;else{var O=n(f);O!==null&&Y(R,O.startTime-q),X=!1}}break e}finally{d=null,v=K,_=!1}X=void 0}}finally{X?V():N=!1}}}var V;if(typeof b=="function")V=function(){b(z)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,P=F.port2;F.port1.onmessage=z,V=function(){P.postMessage(null)}}else V=function(){y(z,0)};function Y(q,X){D=y(function(){q(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125L?(q.sortIndex=K,t(f,q),n(c)===null&&q===n(f)&&(w?(x(D),D=-1):w=!0,Y(R,K-L))):(q.sortIndex=M,t(c,q),C||_||(C=!0,N||(N=!0,V()))),q},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(q){var X=v;return function(){var K=v;v=X;try{return q.apply(this,arguments)}finally{v=K}}}})(Yd)),Yd}var Uy;function OA(){return Uy||(Uy=1,Vd.exports=LA()),Vd.exports}var Wd={exports:{}},Qt={};/** + */var Uy;function OA(){return Uy||(Uy=1,(function(e){function t(q,X){var K=q.length;q.push(X);e:for(;0>>1,M=q[L];if(0>>1;La($,K))Qa(re,$)?(q[L]=re,q[Q]=K,L=Q):(q[L]=$,q[U]=K,L=U);else if(Qa(re,K))q[L]=re,q[Q]=K,L=Q;else break e}}return X}function a(q,X){var K=q.sortIndex-X.sortIndex;return K!==0?K:q.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,o=u.now();e.unstable_now=function(){return u.now()-o}}var c=[],f=[],p=1,d=null,v=3,_=!1,C=!1,w=!1,S=!1,y=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;function E(q){for(var X=n(f);X!==null;){if(X.callback===null)r(f);else if(X.startTime<=q)r(f),X.sortIndex=X.expirationTime,t(c,X);else break;X=n(f)}}function D(q){if(w=!1,E(q),!C)if(n(c)!==null)C=!0,N||(N=!0,V());else{var X=n(f);X!==null&&W(D,X.startTime-q)}}var N=!1,R=-1,T=5,j=-1;function B(){return S?!0:!(e.unstable_now()-jq&&B());){var L=d.callback;if(typeof L=="function"){d.callback=null,v=d.priorityLevel;var M=L(d.expirationTime<=q);if(q=e.unstable_now(),typeof M=="function"){d.callback=M,E(q),X=!0;break t}d===n(c)&&r(c),E(q)}else r(c);d=n(c)}if(d!==null)X=!0;else{var O=n(f);O!==null&&W(D,O.startTime-q),X=!1}}break e}finally{d=null,v=K,_=!1}X=void 0}}finally{X?V():N=!1}}}var V;if(typeof b=="function")V=function(){b(z)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,P=F.port2;F.port1.onmessage=z,V=function(){P.postMessage(null)}}else V=function(){y(z,0)};function W(q,X){R=y(function(){q(e.unstable_now())},X)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125L?(q.sortIndex=K,t(f,q),n(c)===null&&q===n(f)&&(w?(x(R),R=-1):w=!0,W(D,K-L))):(q.sortIndex=M,t(c,q),C||_||(C=!0,N||(N=!0,V()))),q},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(q){var X=v;return function(){var K=v;v=X;try{return q.apply(this,arguments)}finally{v=K}}}})(Yd)),Yd}var Gy;function BA(){return Gy||(Gy=1,Wd.exports=OA()),Wd.exports}var Xd={exports:{}},Qt={};/** * @license React * react-dom.production.js * @@ -30,7 +30,7 @@ var AA=Object.defineProperty;var By=e=>{throw TypeError(e)};var NA=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Gy;function BA(){if(Gy)return Qt;Gy=1;var e=cl();function t(c){var f="https://react.dev/errors/"+c;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Wd.exports=BA(),Wd.exports}/** + */var qy;function IA(){if(qy)return Qt;qy=1;var e=ul();function t(c){var f="https://react.dev/errors/"+c;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Xd.exports=IA(),Xd.exports}/** * @license React * react-dom-client.production.js * @@ -38,340 +38,340 @@ var AA=Object.defineProperty;var By=e=>{throw TypeError(e)};var NA=(e,t,n)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Vy;function IA(){if(Vy)return No;Vy=1;var e=OA(),t=cl(),n=JS();function r(i){var s="https://react.dev/errors/"+i;if(1M||(i.current=L[M],L[M]=null,M--)}function $(i,s){M++,L[M]=i.current,i.current=s}var Q=O(null),re=O(null),se=O(null),Z=O(null);function H(i,s){switch($(se,s),$(re,i),$(Q,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?sy(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=sy(s),i=ay(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}U(Q),$(Q,i)}function ee(){U(Q),U(re),U(se)}function ne(i){i.memoizedState!==null&&$(Z,i);var s=Q.current,h=ay(s,i.type);s!==h&&($(re,i),$(Q,h))}function pe(i){re.current===i&&(U(Q),U(re)),Z.current===i&&(U(Z),wo._currentValue=K)}var fe,ye;function Ce(i){if(fe===void 0)try{throw Error()}catch(h){var s=h.stack.trim().match(/\n( *(at )?)/);fe=s&&s[1]||"",ye=-1M||(i.current=L[M],L[M]=null,M--)}function $(i,s){M++,L[M]=i.current,i.current=s}var Q=O(null),re=O(null),se=O(null),Z=O(null);function H(i,s){switch($(se,s),$(re,i),$(Q,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?ay(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=ay(s),i=oy(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}U(Q),$(Q,i)}function ee(){U(Q),U(re),U(se)}function ne(i){i.memoizedState!==null&&$(Z,i);var s=Q.current,h=oy(s,i.type);s!==h&&($(re,i),$(Q,h))}function pe(i){re.current===i&&(U(Q),U(re)),Z.current===i&&(U(Z),Co._currentValue=K)}var fe,ye;function Ce(i){if(fe===void 0)try{throw Error()}catch(h){var s=h.stack.trim().match(/\n( *(at )?)/);fe=s&&s[1]||"",ye=-1)":-1k||J[m]!==le[k]){var ge=` `+J[m].replace(" at new "," at ");return i.displayName&&ge.includes("")&&(ge=ge.replace("",i.displayName)),ge}while(1<=m&&0<=k);break}}}finally{Ee=!1,Error.prepareStackTrace=h}return(h=i?i.displayName||i.name:"")?Ce(h):""}function we(i,s){switch(i.tag){case 26:case 27:case 5:return Ce(i.type);case 16:return Ce("Lazy");case 13:return i.child!==s&&s!==null?Ce("Suspense Fallback"):Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return Ne(i.type,!1);case 11:return Ne(i.type.render,!1);case 1:return Ne(i.type,!0);case 31:return Ce("Activity");default:return""}}function ft(i){try{var s="",h=null;do s+=we(i,h),h=i,i=i.return;while(i);return s}catch(m){return` Error generating stack: `+m.message+` -`+m.stack}}var Ct=Object.prototype.hasOwnProperty,st=e.unstable_scheduleCallback,Ye=e.unstable_cancelCallback,vt=e.unstable_shouldYield,dt=e.unstable_requestPaint,qe=e.unstable_now,Pe=e.unstable_getCurrentPriorityLevel,ue=e.unstable_ImmediatePriority,_e=e.unstable_UserBlockingPriority,ke=e.unstable_NormalPriority,he=e.unstable_LowPriority,be=e.unstable_IdlePriority,De=e.log,Re=e.unstable_setDisableYieldValue,$e=null,rt=null;function ct(i){if(typeof De=="function"&&Re(i),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode($e,i)}catch{}}var Ve=Math.clz32?Math.clz32:mi,Ln=Math.log,tn=Math.LN2;function mi(i){return i>>>=0,i===0?32:31-(Ln(i)/tn|0)|0}var vi=256,_i=262144,yi=4194304;function On(i){var s=i&42;if(s!==0)return s;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function bi(i,s,h){var m=i.pendingLanes;if(m===0)return 0;var k=0,A=i.suspendedLanes,I=i.pingedLanes;i=i.warmLanes;var W=m&134217727;return W!==0?(m=W&~A,m!==0?k=On(m):(I&=W,I!==0?k=On(I):h||(h=W&~i,h!==0&&(k=On(h))))):(W=m&~A,W!==0?k=On(W):I!==0?k=On(I):h||(h=m&~i,h!==0&&(k=On(h)))),k===0?0:s!==0&&s!==k&&(s&A)===0&&(A=k&-k,h=s&-s,A>=h||A===32&&(h&4194048)!==0)?s:k}function ii(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function bs(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ae(){var i=yi;return yi<<=1,(yi&62914560)===0&&(yi=4194304),i}function xe(i){for(var s=[],h=0;31>h;h++)s.push(i);return s}function Ae(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function tt(i,s,h,m,k,A){var I=i.pendingLanes;i.pendingLanes=h,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=h,i.entangledLanes&=h,i.errorRecoveryDisabledLanes&=h,i.shellSuspendCounter=0;var W=i.entanglements,J=i.expirationTimes,le=i.hiddenUpdates;for(h=I&~h;0"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Rl=/[\n"\\]/g;function on(i){return i.replace(Rl,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Ba(i,s,h,m,k,A,I,W){i.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?i.type=I:i.removeAttribute("type"),s!=null?I==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+an(s)):i.value!==""+an(s)&&(i.value=""+an(s)):I!=="submit"&&I!=="reset"||i.removeAttribute("value"),s!=null?Ia(i,I,an(s)):h!=null?Ia(i,I,an(h)):m!=null&&i.removeAttribute("value"),k==null&&A!=null&&(i.defaultChecked=!!A),k!=null&&(i.checked=k&&typeof k!="function"&&typeof k!="symbol"),W!=null&&typeof W!="function"&&typeof W!="symbol"&&typeof W!="boolean"?i.name=""+an(W):i.removeAttribute("name")}function Es(i,s,h,m,k,A,I,W){if(A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(i.type=A),s!=null||h!=null){if(!(A!=="submit"&&A!=="reset"||s!=null)){Oa(i);return}h=h!=null?""+an(h):"",s=s!=null?""+an(s):h,W||s===i.value||(i.value=s),i.defaultValue=s}m=m??k,m=typeof m!="function"&&typeof m!="symbol"&&!!m,i.checked=W?i.checked:!!m,i.defaultChecked=!!m,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(i.name=I),Oa(i)}function Ia(i,s,h){s==="number"&&Cs(i.ownerDocument)===i||i.defaultValue===""+h||(i.defaultValue=""+h)}function er(i,s,h,m){if(i=i.options,s){s={};for(var k=0;k"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$h=!1;if(Ei)try{var Fa={};Object.defineProperty(Fa,"passive",{get:function(){$h=!0}}),window.addEventListener("test",Fa,Fa),window.removeEventListener("test",Fa,Fa)}catch{$h=!1}var tr=null,Uh=null,Ml=null;function a0(){if(Ml)return Ml;var i,s=Uh,h=s.length,m,k="value"in tr?tr.value:tr.textContent,A=k.length;for(i=0;i=Ua),f0=" ",d0=!1;function p0(i,s){switch(i){case"keyup":return XE.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function g0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ts=!1;function ZE(i,s){switch(i){case"compositionend":return g0(s);case"keypress":return s.which!==32?null:(d0=!0,f0);case"textInput":return i=s.data,i===f0&&d0?null:i;default:return null}}function QE(i,s){if(Ts)return i==="compositionend"||!Wh&&p0(i,s)?(i=a0(),Ml=Uh=tr=null,Ts=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:h,offset:s-i};i=m}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=w0(h)}}function E0(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?E0(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function k0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Cs(i.document);s instanceof i.HTMLIFrameElement;){try{var h=typeof s.contentWindow.location.href=="string"}catch{h=!1}if(h)i=s.contentWindow;else break;s=Cs(i.document)}return s}function Zh(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var ak=Ei&&"documentMode"in document&&11>=document.documentMode,Rs=null,Qh=null,Ya=null,Jh=!1;function A0(i,s,h){var m=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Jh||Rs==null||Rs!==Cs(m)||(m=Rs,"selectionStart"in m&&Zh(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Ya&&Va(Ya,m)||(Ya=m,m=Ec(Qh,"onSelect"),0>=I,k-=I,si=1<<32-Ve(s)+k|h<Ge?(Qe=Me,Me=null):Qe=Me.sibling;var lt=ce(ie,Me,oe[Ge],me);if(lt===null){Me===null&&(Me=Qe);break}i&&Me&<.alternate===null&&s(ie,Me),te=A(lt,te,Ge),ot===null?Oe=lt:ot.sibling=lt,ot=lt,Me=Qe}if(Ge===oe.length)return h(ie,Me),Je&&Ai(ie,Ge),Oe;if(Me===null){for(;GeGe?(Qe=Me,Me=null):Qe=Me.sibling;var wr=ce(ie,Me,lt.value,me);if(wr===null){Me===null&&(Me=Qe);break}i&&Me&&wr.alternate===null&&s(ie,Me),te=A(wr,te,Ge),ot===null?Oe=wr:ot.sibling=wr,ot=wr,Me=Qe}if(lt.done)return h(ie,Me),Je&&Ai(ie,Ge),Oe;if(Me===null){for(;!lt.done;Ge++,lt=oe.next())lt=ve(ie,lt.value,me),lt!==null&&(te=A(lt,te,Ge),ot===null?Oe=lt:ot.sibling=lt,ot=lt);return Je&&Ai(ie,Ge),Oe}for(Me=m(Me);!lt.done;Ge++,lt=oe.next())lt=de(Me,ie,Ge,lt.value,me),lt!==null&&(i&<.alternate!==null&&Me.delete(lt.key===null?Ge:lt.key),te=A(lt,te,Ge),ot===null?Oe=lt:ot.sibling=lt,ot=lt);return i&&Me.forEach(function(kA){return s(ie,kA)}),Je&&Ai(ie,Ge),Oe}function bt(ie,te,oe,me){if(typeof oe=="object"&&oe!==null&&oe.type===w&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case _:e:{for(var Oe=oe.key;te!==null;){if(te.key===Oe){if(Oe=oe.type,Oe===w){if(te.tag===7){h(ie,te.sibling),me=k(te,oe.props.children),me.return=ie,ie=me;break e}}else if(te.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===T&&qr(Oe)===te.type){h(ie,te.sibling),me=k(te,oe.props),Ja(me,oe),me.return=ie,ie=me;break e}h(ie,te);break}else s(ie,te);te=te.sibling}oe.type===w?(me=Fr(oe.props.children,ie.mode,me,oe.key),me.return=ie,ie=me):(me=$l(oe.type,oe.key,oe.props,null,ie.mode,me),Ja(me,oe),me.return=ie,ie=me)}return I(ie);case C:e:{for(Oe=oe.key;te!==null;){if(te.key===Oe)if(te.tag===4&&te.stateNode.containerInfo===oe.containerInfo&&te.stateNode.implementation===oe.implementation){h(ie,te.sibling),me=k(te,oe.children||[]),me.return=ie,ie=me;break e}else{h(ie,te);break}else s(ie,te);te=te.sibling}me=of(oe,ie.mode,me),me.return=ie,ie=me}return I(ie);case T:return oe=qr(oe),bt(ie,te,oe,me)}if(Y(oe))return Te(ie,te,oe,me);if(V(oe)){if(Oe=V(oe),typeof Oe!="function")throw Error(r(150));return oe=Oe.call(oe),Ie(ie,te,oe,me)}if(typeof oe.then=="function")return bt(ie,te,Xl(oe),me);if(oe.$$typeof===b)return bt(ie,te,ql(ie,oe),me);Kl(ie,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,te!==null&&te.tag===6?(h(ie,te.sibling),me=k(te,oe),me.return=ie,ie=me):(h(ie,te),me=af(oe,ie.mode,me),me.return=ie,ie=me),I(ie)):h(ie,te)}return function(ie,te,oe,me){try{Qa=0;var Oe=bt(ie,te,oe,me);return Ps=null,Oe}catch(Me){if(Me===Fs||Me===Yl)throw Me;var ot=bn(29,Me,null,ie.mode);return ot.lanes=me,ot.return=ie,ot}finally{}}}var Yr=K0(!0),Z0=K0(!1),ar=!1;function yf(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bf(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function or(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function lr(i,s,h){var m=i.updateQueue;if(m===null)return null;if(m=m.shared,(ut&2)!==0){var k=m.pending;return k===null?s.next=s:(s.next=k.next,k.next=s),m.pending=s,s=Pl(i),L0(i,null,h),s}return Fl(i,m,s,h),Pl(i)}function eo(i,s,h){if(s=s.updateQueue,s!==null&&(s=s.shared,(h&4194048)!==0)){var m=s.lanes;m&=i.pendingLanes,h|=m,s.lanes=h,Si(i,h)}}function Sf(i,s){var h=i.updateQueue,m=i.alternate;if(m!==null&&(m=m.updateQueue,h===m)){var k=null,A=null;if(h=h.firstBaseUpdate,h!==null){do{var I={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};A===null?k=A=I:A=A.next=I,h=h.next}while(h!==null);A===null?k=A=s:A=A.next=s}else k=A=s;h={baseState:m.baseState,firstBaseUpdate:k,lastBaseUpdate:A,shared:m.shared,callbacks:m.callbacks},i.updateQueue=h;return}i=h.lastBaseUpdate,i===null?h.firstBaseUpdate=s:i.next=s,h.lastBaseUpdate=s}var xf=!1;function to(){if(xf){var i=Hs;if(i!==null)throw i}}function no(i,s,h,m){xf=!1;var k=i.updateQueue;ar=!1;var A=k.firstBaseUpdate,I=k.lastBaseUpdate,W=k.shared.pending;if(W!==null){k.shared.pending=null;var J=W,le=J.next;J.next=null,I===null?A=le:I.next=le,I=J;var ge=i.alternate;ge!==null&&(ge=ge.updateQueue,W=ge.lastBaseUpdate,W!==I&&(W===null?ge.firstBaseUpdate=le:W.next=le,ge.lastBaseUpdate=J))}if(A!==null){var ve=k.baseState;I=0,ge=le=J=null,W=A;do{var ce=W.lane&-536870913,de=ce!==W.lane;if(de?(Ze&ce)===ce:(m&ce)===ce){ce!==0&&ce===zs&&(xf=!0),ge!==null&&(ge=ge.next={lane:0,tag:W.tag,payload:W.payload,callback:null,next:null});e:{var Te=i,Ie=W;ce=s;var bt=h;switch(Ie.tag){case 1:if(Te=Ie.payload,typeof Te=="function"){ve=Te.call(bt,ve,ce);break e}ve=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Ie.payload,ce=typeof Te=="function"?Te.call(bt,ve,ce):Te,ce==null)break e;ve=d({},ve,ce);break e;case 2:ar=!0}}ce=W.callback,ce!==null&&(i.flags|=64,de&&(i.flags|=8192),de=k.callbacks,de===null?k.callbacks=[ce]:de.push(ce))}else de={lane:ce,tag:W.tag,payload:W.payload,callback:W.callback,next:null},ge===null?(le=ge=de,J=ve):ge=ge.next=de,I|=ce;if(W=W.next,W===null){if(W=k.shared.pending,W===null)break;de=W,W=de.next,de.next=null,k.lastBaseUpdate=de,k.shared.pending=null}}while(!0);ge===null&&(J=ve),k.baseState=J,k.firstBaseUpdate=le,k.lastBaseUpdate=ge,A===null&&(k.shared.lanes=0),dr|=I,i.lanes=I,i.memoizedState=ve}}function Q0(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function J0(i,s){var h=i.callbacks;if(h!==null)for(i.callbacks=null,i=0;iA?A:8;var I=q.T,W={};q.T=W,Pf(i,!1,s,h);try{var J=k(),le=q.S;if(le!==null&&le(W,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var ge=gk(J,m);so(i,s,ge,En(i))}else so(i,s,m,En(i))}catch(ve){so(i,s,{then:function(){},status:"rejected",reason:ve},En())}finally{X.p=A,I!==null&&W.types!==null&&(I.types=W.types),q.T=I}}function Sk(){}function Hf(i,s,h,m){if(i.tag!==5)throw Error(r(476));var k=Dv(i).queue;Rv(i,k,s,K,h===null?Sk:function(){return Mv(i),h(m)})}function Dv(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:K},next:null};var h={};return s.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:h},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function Mv(i){var s=Dv(i);s.next===null&&(s=i.alternate.memoizedState),so(i,s.next.queue,{},En())}function Ff(){return Wt(wo)}function jv(){return Ot().memoizedState}function Lv(){return Ot().memoizedState}function xk(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var h=En();i=or(h);var m=lr(s,i,h);m!==null&&(dn(m,s,h),eo(m,s,h)),s={cache:gf()},i.payload=s;return}s=s.return}}function wk(i,s,h){var m=En();h={lane:m,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},ac(i)?Bv(s,h):(h=rf(i,s,h,m),h!==null&&(dn(h,i,m),Iv(h,s,m)))}function Ov(i,s,h){var m=En();so(i,s,h,m)}function so(i,s,h,m){var k={lane:m,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(ac(i))Bv(s,k);else{var A=i.alternate;if(i.lanes===0&&(A===null||A.lanes===0)&&(A=s.lastRenderedReducer,A!==null))try{var I=s.lastRenderedState,W=A(I,h);if(k.hasEagerState=!0,k.eagerState=W,yn(W,I))return Fl(i,s,k,0),St===null&&Hl(),!1}catch{}finally{}if(h=rf(i,s,k,m),h!==null)return dn(h,i,m),Iv(h,s,m),!0}return!1}function Pf(i,s,h,m){if(m={lane:2,revertLane:yd(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},ac(i)){if(s)throw Error(r(479))}else s=rf(i,h,m,2),s!==null&&dn(s,i,2)}function ac(i){var s=i.alternate;return i===Ue||s!==null&&s===Ue}function Bv(i,s){Us=Jl=!0;var h=i.pending;h===null?s.next=s:(s.next=h.next,h.next=s),i.pending=s}function Iv(i,s,h){if((h&4194048)!==0){var m=s.lanes;m&=i.pendingLanes,h|=m,s.lanes=h,Si(i,h)}}var ao={readContext:Wt,use:nc,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useLayoutEffect:Dt,useInsertionEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useSyncExternalStore:Dt,useId:Dt,useHostTransitionStatus:Dt,useFormState:Dt,useActionState:Dt,useOptimistic:Dt,useMemoCache:Dt,useCacheRefresh:Dt};ao.useEffectEvent=Dt;var zv={readContext:Wt,use:nc,useCallback:function(i,s){return rn().memoizedState=[i,s===void 0?null:s],i},useContext:Wt,useEffect:Sv,useImperativeHandle:function(i,s,h){h=h!=null?h.concat([i]):null,rc(4194308,4,Ev.bind(null,s,i),h)},useLayoutEffect:function(i,s){return rc(4194308,4,i,s)},useInsertionEffect:function(i,s){rc(4,2,i,s)},useMemo:function(i,s){var h=rn();s=s===void 0?null:s;var m=i();if(Wr){ct(!0);try{i()}finally{ct(!1)}}return h.memoizedState=[m,s],m},useReducer:function(i,s,h){var m=rn();if(h!==void 0){var k=h(s);if(Wr){ct(!0);try{h(s)}finally{ct(!1)}}}else k=s;return m.memoizedState=m.baseState=k,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:k},m.queue=i,i=i.dispatch=wk.bind(null,Ue,i),[m.memoizedState,i]},useRef:function(i){var s=rn();return i={current:i},s.memoizedState=i},useState:function(i){i=Lf(i);var s=i.queue,h=Ov.bind(null,Ue,s);return s.dispatch=h,[i.memoizedState,h]},useDebugValue:If,useDeferredValue:function(i,s){var h=rn();return zf(h,i,s)},useTransition:function(){var i=Lf(!1);return i=Rv.bind(null,Ue,i.queue,!0,!1),rn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,h){var m=Ue,k=rn();if(Je){if(h===void 0)throw Error(r(407));h=h()}else{if(h=s(),St===null)throw Error(r(349));(Ze&127)!==0||sv(m,s,h)}k.memoizedState=h;var A={value:h,getSnapshot:s};return k.queue=A,Sv(ov.bind(null,m,A,i),[i]),m.flags|=2048,qs(9,{destroy:void 0},av.bind(null,m,A,h,s),null),h},useId:function(){var i=rn(),s=St.identifierPrefix;if(Je){var h=ai,m=si;h=(m&~(1<<32-Ve(m)-1)).toString(32)+h,s="_"+s+"R_"+h,h=ec++,0<\/script>",A=A.removeChild(A.firstChild);break;case"select":A=typeof m.is=="string"?I.createElement("select",{is:m.is}):I.createElement("select"),m.multiple?A.multiple=!0:m.size&&(A.size=m.size);break;default:A=typeof m.is=="string"?I.createElement(k,{is:m.is}):I.createElement(k)}}A[Ut]=s,A[Zt]=m;e:for(I=s.child;I!==null;){if(I.tag===5||I.tag===6)A.appendChild(I.stateNode);else if(I.tag!==4&&I.tag!==27&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===s)break e;for(;I.sibling===null;){if(I.return===null||I.return===s)break e;I=I.return}I.sibling.return=I.return,I=I.sibling}s.stateNode=A;e:switch(Kt(A,k,m),k){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&ji(s)}}return kt(s),td(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,h),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==m&&ji(s);else{if(typeof m!="string"&&s.stateNode===null)throw Error(r(166));if(i=se.current,Bs(s)){if(i=s.stateNode,h=s.memoizedProps,m=null,k=Yt,k!==null)switch(k.tag){case 27:case 5:m=k.memoizedProps}i[Ut]=s,i=!!(i.nodeValue===h||m!==null&&m.suppressHydrationWarning===!0||iy(i.nodeValue,h)),i||rr(s,!0)}else i=kc(i).createTextNode(m),i[Ut]=s,s.stateNode=i}return kt(s),null;case 31:if(h=s.memoizedState,i===null||i.memoizedState!==null){if(m=Bs(s),h!==null){if(i===null){if(!m)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Ut]=s}else Pr(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;kt(s),i=!1}else h=hf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=h),i=!0;if(!i)return s.flags&256?(xn(s),s):(xn(s),null);if((s.flags&128)!==0)throw Error(r(558))}return kt(s),null;case 13:if(m=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(k=Bs(s),m!==null&&m.dehydrated!==null){if(i===null){if(!k)throw Error(r(318));if(k=s.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(r(317));k[Ut]=s}else Pr(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;kt(s),k=!1}else k=hf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=k),k=!0;if(!k)return s.flags&256?(xn(s),s):(xn(s),null)}return xn(s),(s.flags&128)!==0?(s.lanes=h,s):(h=m!==null,i=i!==null&&i.memoizedState!==null,h&&(m=s.child,k=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(k=m.alternate.memoizedState.cachePool.pool),A=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(A=m.memoizedState.cachePool.pool),A!==k&&(m.flags|=2048)),h!==i&&h&&(s.child.flags|=8192),hc(s,s.updateQueue),kt(s),null);case 4:return ee(),i===null&&wd(s.stateNode.containerInfo),kt(s),null;case 10:return Ti(s.type),kt(s),null;case 19:if(U(Lt),m=s.memoizedState,m===null)return kt(s),null;if(k=(s.flags&128)!==0,A=m.rendering,A===null)if(k)lo(m,!1);else{if(Mt!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(A=Ql(i),A!==null){for(s.flags|=128,lo(m,!1),i=A.updateQueue,s.updateQueue=i,hc(s,i),s.subtreeFlags=0,i=h,h=s.child;h!==null;)O0(h,i),h=h.sibling;return $(Lt,Lt.current&1|2),Je&&Ai(s,m.treeForkCount),s.child}i=i.sibling}m.tail!==null&&qe()>mc&&(s.flags|=128,k=!0,lo(m,!1),s.lanes=4194304)}else{if(!k)if(i=Ql(A),i!==null){if(s.flags|=128,k=!0,i=i.updateQueue,s.updateQueue=i,hc(s,i),lo(m,!0),m.tail===null&&m.tailMode==="hidden"&&!A.alternate&&!Je)return kt(s),null}else 2*qe()-m.renderingStartTime>mc&&h!==536870912&&(s.flags|=128,k=!0,lo(m,!1),s.lanes=4194304);m.isBackwards?(A.sibling=s.child,s.child=A):(i=m.last,i!==null?i.sibling=A:s.child=A,m.last=A)}return m.tail!==null?(i=m.tail,m.rendering=i,m.tail=i.sibling,m.renderingStartTime=qe(),i.sibling=null,h=Lt.current,$(Lt,k?h&1|2:h&1),Je&&Ai(s,m.treeForkCount),i):(kt(s),null);case 22:case 23:return xn(s),Cf(),m=s.memoizedState!==null,i!==null?i.memoizedState!==null!==m&&(s.flags|=8192):m&&(s.flags|=8192),m?(h&536870912)!==0&&(s.flags&128)===0&&(kt(s),s.subtreeFlags&6&&(s.flags|=8192)):kt(s),h=s.updateQueue,h!==null&&hc(s,h.retryQueue),h=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),m=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(m=s.memoizedState.cachePool.pool),m!==h&&(s.flags|=2048),i!==null&&U(Gr),null;case 24:return h=null,i!==null&&(h=i.memoizedState.cache),s.memoizedState.cache!==h&&(s.flags|=2048),Ti(It),kt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function Nk(i,s){switch(cf(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Ti(It),ee(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return pe(s),null;case 31:if(s.memoizedState!==null){if(xn(s),s.alternate===null)throw Error(r(340));Pr()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(xn(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Pr()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return U(Lt),null;case 4:return ee(),null;case 10:return Ti(s.type),null;case 22:case 23:return xn(s),Cf(),i!==null&&U(Gr),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Ti(It),null;case 25:return null;default:return null}}function l_(i,s){switch(cf(s),s.tag){case 3:Ti(It),ee();break;case 26:case 27:case 5:pe(s);break;case 4:ee();break;case 31:s.memoizedState!==null&&xn(s);break;case 13:xn(s);break;case 19:U(Lt);break;case 10:Ti(s.type);break;case 22:case 23:xn(s),Cf(),i!==null&&U(Gr);break;case 24:Ti(It)}}function co(i,s){try{var h=s.updateQueue,m=h!==null?h.lastEffect:null;if(m!==null){var k=m.next;h=k;do{if((h.tag&i)===i){m=void 0;var A=h.create,I=h.inst;m=A(),I.destroy=m}h=h.next}while(h!==k)}}catch(W){mt(s,s.return,W)}}function hr(i,s,h){try{var m=s.updateQueue,k=m!==null?m.lastEffect:null;if(k!==null){var A=k.next;m=A;do{if((m.tag&i)===i){var I=m.inst,W=I.destroy;if(W!==void 0){I.destroy=void 0,k=s;var J=h,le=W;try{le()}catch(ge){mt(k,J,ge)}}}m=m.next}while(m!==A)}}catch(ge){mt(s,s.return,ge)}}function c_(i){var s=i.updateQueue;if(s!==null){var h=i.stateNode;try{J0(s,h)}catch(m){mt(i,i.return,m)}}}function u_(i,s,h){h.props=Xr(i.type,i.memoizedProps),h.state=i.memoizedState;try{h.componentWillUnmount()}catch(m){mt(i,s,m)}}function uo(i,s){try{var h=i.ref;if(h!==null){switch(i.tag){case 26:case 27:case 5:var m=i.stateNode;break;case 30:m=i.stateNode;break;default:m=i.stateNode}typeof h=="function"?i.refCleanup=h(m):h.current=m}}catch(k){mt(i,s,k)}}function oi(i,s){var h=i.ref,m=i.refCleanup;if(h!==null)if(typeof m=="function")try{m()}catch(k){mt(i,s,k)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(k){mt(i,s,k)}else h.current=null}function h_(i){var s=i.type,h=i.memoizedProps,m=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":h.autoFocus&&m.focus();break e;case"img":h.src?m.src=h.src:h.srcSet&&(m.srcset=h.srcSet)}}catch(k){mt(i,i.return,k)}}function nd(i,s,h){try{var m=i.stateNode;Kk(m,i.type,h,s),m[Zt]=s}catch(k){mt(i,i.return,k)}}function f_(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&_r(i.type)||i.tag===4}function id(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||f_(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&_r(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function rd(i,s,h){var m=i.tag;if(m===5||m===6)i=i.stateNode,s?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(i,s):(s=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,s.appendChild(i),h=h._reactRootContainer,h!=null||s.onclick!==null||(s.onclick=Ci));else if(m!==4&&(m===27&&_r(i.type)&&(h=i.stateNode,s=null),i=i.child,i!==null))for(rd(i,s,h),i=i.sibling;i!==null;)rd(i,s,h),i=i.sibling}function fc(i,s,h){var m=i.tag;if(m===5||m===6)i=i.stateNode,s?h.insertBefore(i,s):h.appendChild(i);else if(m!==4&&(m===27&&_r(i.type)&&(h=i.stateNode),i=i.child,i!==null))for(fc(i,s,h),i=i.sibling;i!==null;)fc(i,s,h),i=i.sibling}function d_(i){var s=i.stateNode,h=i.memoizedProps;try{for(var m=i.type,k=s.attributes;k.length;)s.removeAttributeNode(k[0]);Kt(s,m,h),s[Ut]=i,s[Zt]=h}catch(A){mt(i,i.return,A)}}var Li=!1,Ft=!1,sd=!1,p_=typeof WeakSet=="function"?WeakSet:Set,qt=null;function Tk(i,s){if(i=i.containerInfo,kd=jc,i=k0(i),Zh(i)){if("selectionStart"in i)var h={start:i.selectionStart,end:i.selectionEnd};else e:{h=(h=i.ownerDocument)&&h.defaultView||window;var m=h.getSelection&&h.getSelection();if(m&&m.rangeCount!==0){h=m.anchorNode;var k=m.anchorOffset,A=m.focusNode;m=m.focusOffset;try{h.nodeType,A.nodeType}catch{h=null;break e}var I=0,W=-1,J=-1,le=0,ge=0,ve=i,ce=null;t:for(;;){for(var de;ve!==h||k!==0&&ve.nodeType!==3||(W=I+k),ve!==A||m!==0&&ve.nodeType!==3||(J=I+m),ve.nodeType===3&&(I+=ve.nodeValue.length),(de=ve.firstChild)!==null;)ce=ve,ve=de;for(;;){if(ve===i)break t;if(ce===h&&++le===k&&(W=I),ce===A&&++ge===m&&(J=I),(de=ve.nextSibling)!==null)break;ve=ce,ce=ve.parentNode}ve=de}h=W===-1||J===-1?null:{start:W,end:J}}else h=null}h=h||{start:0,end:0}}else h=null;for(Ad={focusedElem:i,selectionRange:h},jc=!1,qt=s;qt!==null;)if(s=qt,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,qt=i;else for(;qt!==null;){switch(s=qt,A=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(h=0;h title"))),Kt(A,m,h),A[Ut]=i,Bt(A),m=A;break e;case"link":var I=by("link","href",k).get(m+(h.href||""));if(I){for(var W=0;Wbt&&(I=bt,bt=Ie,Ie=I);var ie=C0(W,Ie),te=C0(W,bt);if(ie&&te&&(de.rangeCount!==1||de.anchorNode!==ie.node||de.anchorOffset!==ie.offset||de.focusNode!==te.node||de.focusOffset!==te.offset)){var oe=ve.createRange();oe.setStart(ie.node,ie.offset),de.removeAllRanges(),Ie>bt?(de.addRange(oe),de.extend(te.node,te.offset)):(oe.setEnd(te.node,te.offset),de.addRange(oe))}}}}for(ve=[],de=W;de=de.parentNode;)de.nodeType===1&&ve.push({element:de,left:de.scrollLeft,top:de.scrollTop});for(typeof W.focus=="function"&&W.focus(),W=0;Wh?32:h,q.T=null,h=fd,fd=null;var A=gr,I=Hi;if(Gt=0,Ks=gr=null,Hi=0,(ut&6)!==0)throw Error(r(331));var W=ut;if(ut|=4,E_(A.current),x_(A,A.current,I,h),ut=W,vo(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot($e,A)}catch{}return!0}finally{X.p=k,q.T=m,U_(i,s)}}function q_(i,s,h){s=In(h,s),s=qf(i.stateNode,s,2),i=lr(i,s,2),i!==null&&(Ae(i,2),li(i))}function mt(i,s,h){if(i.tag===3)q_(i,i,h);else for(;s!==null;){if(s.tag===3){q_(s,i,h);break}else if(s.tag===1){var m=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(pr===null||!pr.has(m))){i=In(h,i),h=Vv(2),m=lr(s,h,2),m!==null&&(Yv(h,m,s,i),Ae(m,2),li(m));break}}s=s.return}}function md(i,s,h){var m=i.pingCache;if(m===null){m=i.pingCache=new Mk;var k=new Set;m.set(s,k)}else k=m.get(s),k===void 0&&(k=new Set,m.set(s,k));k.has(h)||(ld=!0,k.add(h),i=Ik.bind(null,i,s,h),s.then(i,i))}function Ik(i,s,h){var m=i.pingCache;m!==null&&m.delete(s),i.pingedLanes|=i.suspendedLanes&h,i.warmLanes&=~h,St===i&&(Ze&h)===h&&(Mt===4||Mt===3&&(Ze&62914560)===Ze&&300>qe()-gc?(ut&2)===0&&Zs(i,0):cd|=h,Xs===Ze&&(Xs=0)),li(i)}function V_(i,s){s===0&&(s=ae()),i=Hr(i,s),i!==null&&(Ae(i,s),li(i))}function zk(i){var s=i.memoizedState,h=0;s!==null&&(h=s.retryLane),V_(i,h)}function Hk(i,s){var h=0;switch(i.tag){case 31:case 13:var m=i.stateNode,k=i.memoizedState;k!==null&&(h=k.retryLane);break;case 19:m=i.stateNode;break;case 22:m=i.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(s),V_(i,h)}function Fk(i,s){return st(i,s)}var xc=null,Js=null,vd=!1,wc=!1,_d=!1,vr=0;function li(i){i!==Js&&i.next===null&&(Js===null?xc=Js=i:Js=Js.next=i),wc=!0,vd||(vd=!0,$k())}function vo(i,s){if(!_d&&wc){_d=!0;do for(var h=!1,m=xc;m!==null;){if(i!==0){var k=m.pendingLanes;if(k===0)var A=0;else{var I=m.suspendedLanes,W=m.pingedLanes;A=(1<<31-Ve(42|i)+1)-1,A&=k&~(I&~W),A=A&201326741?A&201326741|1:A?A|2:0}A!==0&&(h=!0,K_(m,A))}else A=Ze,A=bi(m,m===St?A:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(A&3)===0||ii(m,A)||(h=!0,K_(m,A));m=m.next}while(h);_d=!1}}function Pk(){Y_()}function Y_(){wc=vd=!1;var i=0;vr!==0&&Qk()&&(i=vr);for(var s=qe(),h=null,m=xc;m!==null;){var k=m.next,A=W_(m,s);A===0?(m.next=null,h===null?xc=k:h.next=k,k===null&&(Js=h)):(h=m,(i!==0||(A&3)!==0)&&(wc=!0)),m=k}Gt!==0&&Gt!==5||vo(i),vr!==0&&(vr=0)}function W_(i,s){for(var h=i.suspendedLanes,m=i.pingedLanes,k=i.expirationTimes,A=i.pendingLanes&-62914561;0W)break;var ge=J.transferSize,ve=J.initiatorType;ge&&ry(ve)&&(J=J.responseEnd,I+=ge*(J"u"?null:document;function my(i,s,h){var m=ea;if(m&&typeof s=="string"&&s){var k=on(s);k='link[rel="'+i+'"][href="'+k+'"]',typeof h=="string"&&(k+='[crossorigin="'+h+'"]'),gy.has(k)||(gy.add(k),i={rel:i,crossOrigin:h,href:s},m.querySelector(k)===null&&(s=m.createElement("link"),Kt(s,"link",i),Bt(s),m.head.appendChild(s)))}}function oA(i){Fi.D(i),my("dns-prefetch",i,null)}function lA(i,s){Fi.C(i,s),my("preconnect",i,s)}function cA(i,s,h){Fi.L(i,s,h);var m=ea;if(m&&i&&s){var k='link[rel="preload"][as="'+on(s)+'"]';s==="image"&&h&&h.imageSrcSet?(k+='[imagesrcset="'+on(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(k+='[imagesizes="'+on(h.imageSizes)+'"]')):k+='[href="'+on(i)+'"]';var A=k;switch(s){case"style":A=ta(i);break;case"script":A=na(i)}Un.has(A)||(i=d({rel:"preload",href:s==="image"&&h&&h.imageSrcSet?void 0:i,as:s},h),Un.set(A,i),m.querySelector(k)!==null||s==="style"&&m.querySelector(So(A))||s==="script"&&m.querySelector(xo(A))||(s=m.createElement("link"),Kt(s,"link",i),Bt(s),m.head.appendChild(s)))}}function uA(i,s){Fi.m(i,s);var h=ea;if(h&&i){var m=s&&typeof s.as=="string"?s.as:"script",k='link[rel="modulepreload"][as="'+on(m)+'"][href="'+on(i)+'"]',A=k;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":A=na(i)}if(!Un.has(A)&&(i=d({rel:"modulepreload",href:i},s),Un.set(A,i),h.querySelector(k)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(xo(A)))return}m=h.createElement("link"),Kt(m,"link",i),Bt(m),h.head.appendChild(m)}}}function hA(i,s,h){Fi.S(i,s,h);var m=ea;if(m&&i){var k=Qi(m).hoistableStyles,A=ta(i);s=s||"default";var I=k.get(A);if(!I){var W={loading:0,preload:null};if(I=m.querySelector(So(A)))W.loading=5;else{i=d({rel:"stylesheet",href:i,"data-precedence":s},h),(h=Un.get(A))&&Ld(i,h);var J=I=m.createElement("link");Bt(J),Kt(J,"link",i),J._p=new Promise(function(le,ge){J.onload=le,J.onerror=ge}),J.addEventListener("load",function(){W.loading|=1}),J.addEventListener("error",function(){W.loading|=2}),W.loading|=4,Nc(I,s,m)}I={type:"stylesheet",instance:I,count:1,state:W},k.set(A,I)}}}function fA(i,s){Fi.X(i,s);var h=ea;if(h&&i){var m=Qi(h).hoistableScripts,k=na(i),A=m.get(k);A||(A=h.querySelector(xo(k)),A||(i=d({src:i,async:!0},s),(s=Un.get(k))&&Od(i,s),A=h.createElement("script"),Bt(A),Kt(A,"link",i),h.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},m.set(k,A))}}function dA(i,s){Fi.M(i,s);var h=ea;if(h&&i){var m=Qi(h).hoistableScripts,k=na(i),A=m.get(k);A||(A=h.querySelector(xo(k)),A||(i=d({src:i,async:!0,type:"module"},s),(s=Un.get(k))&&Od(i,s),A=h.createElement("script"),Bt(A),Kt(A,"link",i),h.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},m.set(k,A))}}function vy(i,s,h,m){var k=(k=se.current)?Ac(k):null;if(!k)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(s=ta(h.href),h=Qi(k).hoistableStyles,m=h.get(s),m||(m={type:"style",instance:null,count:0,state:null},h.set(s,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){i=ta(h.href);var A=Qi(k).hoistableStyles,I=A.get(i);if(I||(k=k.ownerDocument||k,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},A.set(i,I),(A=k.querySelector(So(i)))&&!A._p&&(I.instance=A,I.state.loading=5),Un.has(i)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},Un.set(i,h),A||pA(k,i,h,I.state))),s&&m===null)throw Error(r(528,""));return I}if(s&&m!==null)throw Error(r(529,""));return null;case"script":return s=h.async,h=h.src,typeof h=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=na(h),h=Qi(k).hoistableScripts,m=h.get(s),m||(m={type:"script",instance:null,count:0,state:null},h.set(s,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function ta(i){return'href="'+on(i)+'"'}function So(i){return'link[rel="stylesheet"]['+i+"]"}function _y(i){return d({},i,{"data-precedence":i.precedence,precedence:null})}function pA(i,s,h,m){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?m.loading=1:(s=i.createElement("link"),m.preload=s,s.addEventListener("load",function(){return m.loading|=1}),s.addEventListener("error",function(){return m.loading|=2}),Kt(s,"link",h),Bt(s),i.head.appendChild(s))}function na(i){return'[src="'+on(i)+'"]'}function xo(i){return"script[async]"+i}function yy(i,s,h){if(s.count++,s.instance===null)switch(s.type){case"style":var m=i.querySelector('style[data-href~="'+on(h.href)+'"]');if(m)return s.instance=m,Bt(m),m;var k=d({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return m=(i.ownerDocument||i).createElement("style"),Bt(m),Kt(m,"style",k),Nc(m,h.precedence,i),s.instance=m;case"stylesheet":k=ta(h.href);var A=i.querySelector(So(k));if(A)return s.state.loading|=4,s.instance=A,Bt(A),A;m=_y(h),(k=Un.get(k))&&Ld(m,k),A=(i.ownerDocument||i).createElement("link"),Bt(A);var I=A;return I._p=new Promise(function(W,J){I.onload=W,I.onerror=J}),Kt(A,"link",m),s.state.loading|=4,Nc(A,h.precedence,i),s.instance=A;case"script":return A=na(h.src),(k=i.querySelector(xo(A)))?(s.instance=k,Bt(k),k):(m=h,(k=Un.get(A))&&(m=d({},h),Od(m,k)),i=i.ownerDocument||i,k=i.createElement("script"),Bt(k),Kt(k,"link",m),i.head.appendChild(k),s.instance=k);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(m=s.instance,s.state.loading|=4,Nc(m,h.precedence,i));return s.instance}function Nc(i,s,h){for(var m=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),k=m.length?m[m.length-1]:null,A=k,I=0;I title"):null)}function gA(i,s,h){if(h===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return i=s.disabled,typeof s.precedence=="string"&&i==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function xy(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function mA(i,s,h,m){if(h.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var k=ta(m.href),A=s.querySelector(So(k));if(A){s=A._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Rc.bind(i),s.then(i,i)),h.state.loading|=4,h.instance=A,Bt(A);return}A=s.ownerDocument||s,m=_y(m),(k=Un.get(k))&&Ld(m,k),A=A.createElement("link"),Bt(A);var I=A;I._p=new Promise(function(W,J){I.onload=W,I.onerror=J}),Kt(A,"link",m),h.instance=A}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(h,s),(s=h.state.preload)&&(h.state.loading&3)===0&&(i.count++,h=Rc.bind(i),s.addEventListener("load",h),s.addEventListener("error",h))}}var Bd=0;function vA(i,s){return i.stylesheets&&i.count===0&&Mc(i,i.stylesheets),0Bd?50:800)+s);return i.unsuspend=h,function(){i.unsuspend=null,clearTimeout(m),clearTimeout(k)}}:null}function Rc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mc(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Dc=null;function Mc(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Dc=new Map,s.forEach(_A,i),Dc=null,Rc.call(i))}function _A(i,s){if(!(s.state.loading&4)){var h=Dc.get(i);if(h)var m=h.get(null);else{h=new Map,Dc.set(i,h);for(var k=i.querySelectorAll("link[data-precedence],style[data-precedence]"),A=0;A"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),qd.exports=IA(),qd.exports}var HA=zA();/** +`+m.stack}}var Ct=Object.prototype.hasOwnProperty,st=e.unstable_scheduleCallback,We=e.unstable_cancelCallback,vt=e.unstable_shouldYield,dt=e.unstable_requestPaint,qe=e.unstable_now,Pe=e.unstable_getCurrentPriorityLevel,ue=e.unstable_ImmediatePriority,_e=e.unstable_UserBlockingPriority,ke=e.unstable_NormalPriority,he=e.unstable_LowPriority,be=e.unstable_IdlePriority,Re=e.log,De=e.unstable_setDisableYieldValue,$e=null,rt=null;function ct(i){if(typeof Re=="function"&&De(i),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode($e,i)}catch{}}var Ve=Math.clz32?Math.clz32:mi,Ln=Math.log,tn=Math.LN2;function mi(i){return i>>>=0,i===0?32:31-(Ln(i)/tn|0)|0}var vi=256,_i=262144,yi=4194304;function On(i){var s=i&42;if(s!==0)return s;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function bi(i,s,h){var m=i.pendingLanes;if(m===0)return 0;var k=0,A=i.suspendedLanes,I=i.pingedLanes;i=i.warmLanes;var Y=m&134217727;return Y!==0?(m=Y&~A,m!==0?k=On(m):(I&=Y,I!==0?k=On(I):h||(h=Y&~i,h!==0&&(k=On(h))))):(Y=m&~A,Y!==0?k=On(Y):I!==0?k=On(I):h||(h=m&~i,h!==0&&(k=On(h)))),k===0?0:s!==0&&s!==k&&(s&A)===0&&(A=k&-k,h=s&-s,A>=h||A===32&&(h&4194048)!==0)?s:k}function ii(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function bs(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ae(){var i=yi;return yi<<=1,(yi&62914560)===0&&(yi=4194304),i}function xe(i){for(var s=[],h=0;31>h;h++)s.push(i);return s}function Ae(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function tt(i,s,h,m,k,A){var I=i.pendingLanes;i.pendingLanes=h,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=h,i.entangledLanes&=h,i.errorRecoveryDisabledLanes&=h,i.shellSuspendCounter=0;var Y=i.entanglements,J=i.expirationTimes,le=i.hiddenUpdates;for(h=I&~h;0"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Rl=/[\n"\\]/g;function on(i){return i.replace(Rl,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Ia(i,s,h,m,k,A,I,Y){i.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?i.type=I:i.removeAttribute("type"),s!=null?I==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+an(s)):i.value!==""+an(s)&&(i.value=""+an(s)):I!=="submit"&&I!=="reset"||i.removeAttribute("value"),s!=null?za(i,I,an(s)):h!=null?za(i,I,an(h)):m!=null&&i.removeAttribute("value"),k==null&&A!=null&&(i.defaultChecked=!!A),k!=null&&(i.checked=k&&typeof k!="function"&&typeof k!="symbol"),Y!=null&&typeof Y!="function"&&typeof Y!="symbol"&&typeof Y!="boolean"?i.name=""+an(Y):i.removeAttribute("name")}function Es(i,s,h,m,k,A,I,Y){if(A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(i.type=A),s!=null||h!=null){if(!(A!=="submit"&&A!=="reset"||s!=null)){Ba(i);return}h=h!=null?""+an(h):"",s=s!=null?""+an(s):h,Y||s===i.value||(i.value=s),i.defaultValue=s}m=m??k,m=typeof m!="function"&&typeof m!="symbol"&&!!m,i.checked=Y?i.checked:!!m,i.defaultChecked=!!m,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(i.name=I),Ba(i)}function za(i,s,h){s==="number"&&Cs(i.ownerDocument)===i||i.defaultValue===""+h||(i.defaultValue=""+h)}function er(i,s,h,m){if(i=i.options,s){s={};for(var k=0;k"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Uh=!1;if(Ei)try{var Pa={};Object.defineProperty(Pa,"passive",{get:function(){Uh=!0}}),window.addEventListener("test",Pa,Pa),window.removeEventListener("test",Pa,Pa)}catch{Uh=!1}var tr=null,Gh=null,jl=null;function o0(){if(jl)return jl;var i,s=Gh,h=s.length,m,k="value"in tr?tr.value:tr.textContent,A=k.length;for(i=0;i=Ga),d0=" ",p0=!1;function g0(i,s){switch(i){case"keyup":return KE.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function m0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ts=!1;function QE(i,s){switch(i){case"compositionend":return m0(s);case"keypress":return s.which!==32?null:(p0=!0,d0);case"textInput":return i=s.data,i===d0&&p0?null:i;default:return null}}function JE(i,s){if(Ts)return i==="compositionend"||!Xh&&g0(i,s)?(i=o0(),jl=Gh=tr=null,Ts=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:h,offset:s-i};i=m}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=C0(h)}}function k0(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?k0(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function A0(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Cs(i.document);s instanceof i.HTMLIFrameElement;){try{var h=typeof s.contentWindow.location.href=="string"}catch{h=!1}if(h)i=s.contentWindow;else break;s=Cs(i.document)}return s}function Qh(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var ok=Ei&&"documentMode"in document&&11>=document.documentMode,Ds=null,Jh=null,Ya=null,ef=!1;function N0(i,s,h){var m=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;ef||Ds==null||Ds!==Cs(m)||(m=Ds,"selectionStart"in m&&Qh(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Ya&&Wa(Ya,m)||(Ya=m,m=kc(Jh,"onSelect"),0>=I,k-=I,si=1<<32-Ve(s)+k|h<Ge?(Qe=Me,Me=null):Qe=Me.sibling;var lt=ce(ie,Me,oe[Ge],me);if(lt===null){Me===null&&(Me=Qe);break}i&&Me&<.alternate===null&&s(ie,Me),te=A(lt,te,Ge),ot===null?Oe=lt:ot.sibling=lt,ot=lt,Me=Qe}if(Ge===oe.length)return h(ie,Me),Je&&Ai(ie,Ge),Oe;if(Me===null){for(;GeGe?(Qe=Me,Me=null):Qe=Me.sibling;var wr=ce(ie,Me,lt.value,me);if(wr===null){Me===null&&(Me=Qe);break}i&&Me&&wr.alternate===null&&s(ie,Me),te=A(wr,te,Ge),ot===null?Oe=wr:ot.sibling=wr,ot=wr,Me=Qe}if(lt.done)return h(ie,Me),Je&&Ai(ie,Ge),Oe;if(Me===null){for(;!lt.done;Ge++,lt=oe.next())lt=ve(ie,lt.value,me),lt!==null&&(te=A(lt,te,Ge),ot===null?Oe=lt:ot.sibling=lt,ot=lt);return Je&&Ai(ie,Ge),Oe}for(Me=m(Me);!lt.done;Ge++,lt=oe.next())lt=de(Me,ie,Ge,lt.value,me),lt!==null&&(i&<.alternate!==null&&Me.delete(lt.key===null?Ge:lt.key),te=A(lt,te,Ge),ot===null?Oe=lt:ot.sibling=lt,ot=lt);return i&&Me.forEach(function(AA){return s(ie,AA)}),Je&&Ai(ie,Ge),Oe}function bt(ie,te,oe,me){if(typeof oe=="object"&&oe!==null&&oe.type===w&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case _:e:{for(var Oe=oe.key;te!==null;){if(te.key===Oe){if(Oe=oe.type,Oe===w){if(te.tag===7){h(ie,te.sibling),me=k(te,oe.props.children),me.return=ie,ie=me;break e}}else if(te.elementType===Oe||typeof Oe=="object"&&Oe!==null&&Oe.$$typeof===T&&qr(Oe)===te.type){h(ie,te.sibling),me=k(te,oe.props),eo(me,oe),me.return=ie,ie=me;break e}h(ie,te);break}else s(ie,te);te=te.sibling}oe.type===w?(me=Fr(oe.props.children,ie.mode,me,oe.key),me.return=ie,ie=me):(me=Ul(oe.type,oe.key,oe.props,null,ie.mode,me),eo(me,oe),me.return=ie,ie=me)}return I(ie);case C:e:{for(Oe=oe.key;te!==null;){if(te.key===Oe)if(te.tag===4&&te.stateNode.containerInfo===oe.containerInfo&&te.stateNode.implementation===oe.implementation){h(ie,te.sibling),me=k(te,oe.children||[]),me.return=ie,ie=me;break e}else{h(ie,te);break}else s(ie,te);te=te.sibling}me=lf(oe,ie.mode,me),me.return=ie,ie=me}return I(ie);case T:return oe=qr(oe),bt(ie,te,oe,me)}if(W(oe))return Te(ie,te,oe,me);if(V(oe)){if(Oe=V(oe),typeof Oe!="function")throw Error(r(150));return oe=Oe.call(oe),Ie(ie,te,oe,me)}if(typeof oe.then=="function")return bt(ie,te,Kl(oe),me);if(oe.$$typeof===b)return bt(ie,te,Vl(ie,oe),me);Zl(ie,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,te!==null&&te.tag===6?(h(ie,te.sibling),me=k(te,oe),me.return=ie,ie=me):(h(ie,te),me=of(oe,ie.mode,me),me.return=ie,ie=me),I(ie)):h(ie,te)}return function(ie,te,oe,me){try{Ja=0;var Oe=bt(ie,te,oe,me);return Ps=null,Oe}catch(Me){if(Me===Fs||Me===Yl)throw Me;var ot=bn(29,Me,null,ie.mode);return ot.lanes=me,ot.return=ie,ot}finally{}}}var Wr=Z0(!0),Q0=Z0(!1),ar=!1;function bf(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Sf(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function or(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function lr(i,s,h){var m=i.updateQueue;if(m===null)return null;if(m=m.shared,(ut&2)!==0){var k=m.pending;return k===null?s.next=s:(s.next=k.next,k.next=s),m.pending=s,s=$l(i),O0(i,null,h),s}return Pl(i,m,s,h),$l(i)}function to(i,s,h){if(s=s.updateQueue,s!==null&&(s=s.shared,(h&4194048)!==0)){var m=s.lanes;m&=i.pendingLanes,h|=m,s.lanes=h,Si(i,h)}}function xf(i,s){var h=i.updateQueue,m=i.alternate;if(m!==null&&(m=m.updateQueue,h===m)){var k=null,A=null;if(h=h.firstBaseUpdate,h!==null){do{var I={lane:h.lane,tag:h.tag,payload:h.payload,callback:null,next:null};A===null?k=A=I:A=A.next=I,h=h.next}while(h!==null);A===null?k=A=s:A=A.next=s}else k=A=s;h={baseState:m.baseState,firstBaseUpdate:k,lastBaseUpdate:A,shared:m.shared,callbacks:m.callbacks},i.updateQueue=h;return}i=h.lastBaseUpdate,i===null?h.firstBaseUpdate=s:i.next=s,h.lastBaseUpdate=s}var wf=!1;function no(){if(wf){var i=Hs;if(i!==null)throw i}}function io(i,s,h,m){wf=!1;var k=i.updateQueue;ar=!1;var A=k.firstBaseUpdate,I=k.lastBaseUpdate,Y=k.shared.pending;if(Y!==null){k.shared.pending=null;var J=Y,le=J.next;J.next=null,I===null?A=le:I.next=le,I=J;var ge=i.alternate;ge!==null&&(ge=ge.updateQueue,Y=ge.lastBaseUpdate,Y!==I&&(Y===null?ge.firstBaseUpdate=le:Y.next=le,ge.lastBaseUpdate=J))}if(A!==null){var ve=k.baseState;I=0,ge=le=J=null,Y=A;do{var ce=Y.lane&-536870913,de=ce!==Y.lane;if(de?(Ze&ce)===ce:(m&ce)===ce){ce!==0&&ce===zs&&(wf=!0),ge!==null&&(ge=ge.next={lane:0,tag:Y.tag,payload:Y.payload,callback:null,next:null});e:{var Te=i,Ie=Y;ce=s;var bt=h;switch(Ie.tag){case 1:if(Te=Ie.payload,typeof Te=="function"){ve=Te.call(bt,ve,ce);break e}ve=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Ie.payload,ce=typeof Te=="function"?Te.call(bt,ve,ce):Te,ce==null)break e;ve=d({},ve,ce);break e;case 2:ar=!0}}ce=Y.callback,ce!==null&&(i.flags|=64,de&&(i.flags|=8192),de=k.callbacks,de===null?k.callbacks=[ce]:de.push(ce))}else de={lane:ce,tag:Y.tag,payload:Y.payload,callback:Y.callback,next:null},ge===null?(le=ge=de,J=ve):ge=ge.next=de,I|=ce;if(Y=Y.next,Y===null){if(Y=k.shared.pending,Y===null)break;de=Y,Y=de.next,de.next=null,k.lastBaseUpdate=de,k.shared.pending=null}}while(!0);ge===null&&(J=ve),k.baseState=J,k.firstBaseUpdate=le,k.lastBaseUpdate=ge,A===null&&(k.shared.lanes=0),dr|=I,i.lanes=I,i.memoizedState=ve}}function J0(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function ev(i,s){var h=i.callbacks;if(h!==null)for(i.callbacks=null,i=0;iA?A:8;var I=q.T,Y={};q.T=Y,$f(i,!1,s,h);try{var J=k(),le=q.S;if(le!==null&&le(Y,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var ge=mk(J,m);ao(i,s,ge,En(i))}else ao(i,s,m,En(i))}catch(ve){ao(i,s,{then:function(){},status:"rejected",reason:ve},En())}finally{X.p=A,I!==null&&Y.types!==null&&(I.types=Y.types),q.T=I}}function xk(){}function Ff(i,s,h,m){if(i.tag!==5)throw Error(r(476));var k=Mv(i).queue;Rv(i,k,s,K,h===null?xk:function(){return jv(i),h(m)})}function Mv(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:K,baseState:K,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:K},next:null};var h={};return s.next={memoizedState:h,baseState:h,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:h},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function jv(i){var s=Mv(i);s.next===null&&(s=i.alternate.memoizedState),ao(i,s.next.queue,{},En())}function Pf(){return Yt(Co)}function Lv(){return Ot().memoizedState}function Ov(){return Ot().memoizedState}function wk(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var h=En();i=or(h);var m=lr(s,i,h);m!==null&&(dn(m,s,h),to(m,s,h)),s={cache:mf()},i.payload=s;return}s=s.return}}function Ck(i,s,h){var m=En();h={lane:m,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},oc(i)?Iv(s,h):(h=sf(i,s,h,m),h!==null&&(dn(h,i,m),zv(h,s,m)))}function Bv(i,s,h){var m=En();ao(i,s,h,m)}function ao(i,s,h,m){var k={lane:m,revertLane:0,gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null};if(oc(i))Iv(s,k);else{var A=i.alternate;if(i.lanes===0&&(A===null||A.lanes===0)&&(A=s.lastRenderedReducer,A!==null))try{var I=s.lastRenderedState,Y=A(I,h);if(k.hasEagerState=!0,k.eagerState=Y,yn(Y,I))return Pl(i,s,k,0),St===null&&Fl(),!1}catch{}finally{}if(h=sf(i,s,k,m),h!==null)return dn(h,i,m),zv(h,s,m),!0}return!1}function $f(i,s,h,m){if(m={lane:2,revertLane:bd(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},oc(i)){if(s)throw Error(r(479))}else s=sf(i,h,m,2),s!==null&&dn(s,i,2)}function oc(i){var s=i.alternate;return i===Ue||s!==null&&s===Ue}function Iv(i,s){Us=ec=!0;var h=i.pending;h===null?s.next=s:(s.next=h.next,h.next=s),i.pending=s}function zv(i,s,h){if((h&4194048)!==0){var m=s.lanes;m&=i.pendingLanes,h|=m,s.lanes=h,Si(i,h)}}var oo={readContext:Yt,use:ic,useCallback:Rt,useContext:Rt,useEffect:Rt,useImperativeHandle:Rt,useLayoutEffect:Rt,useInsertionEffect:Rt,useMemo:Rt,useReducer:Rt,useRef:Rt,useState:Rt,useDebugValue:Rt,useDeferredValue:Rt,useTransition:Rt,useSyncExternalStore:Rt,useId:Rt,useHostTransitionStatus:Rt,useFormState:Rt,useActionState:Rt,useOptimistic:Rt,useMemoCache:Rt,useCacheRefresh:Rt};oo.useEffectEvent=Rt;var Hv={readContext:Yt,use:ic,useCallback:function(i,s){return rn().memoizedState=[i,s===void 0?null:s],i},useContext:Yt,useEffect:xv,useImperativeHandle:function(i,s,h){h=h!=null?h.concat([i]):null,sc(4194308,4,kv.bind(null,s,i),h)},useLayoutEffect:function(i,s){return sc(4194308,4,i,s)},useInsertionEffect:function(i,s){sc(4,2,i,s)},useMemo:function(i,s){var h=rn();s=s===void 0?null:s;var m=i();if(Yr){ct(!0);try{i()}finally{ct(!1)}}return h.memoizedState=[m,s],m},useReducer:function(i,s,h){var m=rn();if(h!==void 0){var k=h(s);if(Yr){ct(!0);try{h(s)}finally{ct(!1)}}}else k=s;return m.memoizedState=m.baseState=k,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:k},m.queue=i,i=i.dispatch=Ck.bind(null,Ue,i),[m.memoizedState,i]},useRef:function(i){var s=rn();return i={current:i},s.memoizedState=i},useState:function(i){i=Of(i);var s=i.queue,h=Bv.bind(null,Ue,s);return s.dispatch=h,[i.memoizedState,h]},useDebugValue:zf,useDeferredValue:function(i,s){var h=rn();return Hf(h,i,s)},useTransition:function(){var i=Of(!1);return i=Rv.bind(null,Ue,i.queue,!0,!1),rn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,h){var m=Ue,k=rn();if(Je){if(h===void 0)throw Error(r(407));h=h()}else{if(h=s(),St===null)throw Error(r(349));(Ze&127)!==0||av(m,s,h)}k.memoizedState=h;var A={value:h,getSnapshot:s};return k.queue=A,xv(lv.bind(null,m,A,i),[i]),m.flags|=2048,qs(9,{destroy:void 0},ov.bind(null,m,A,h,s),null),h},useId:function(){var i=rn(),s=St.identifierPrefix;if(Je){var h=ai,m=si;h=(m&~(1<<32-Ve(m)-1)).toString(32)+h,s="_"+s+"R_"+h,h=tc++,0<\/script>",A=A.removeChild(A.firstChild);break;case"select":A=typeof m.is=="string"?I.createElement("select",{is:m.is}):I.createElement("select"),m.multiple?A.multiple=!0:m.size&&(A.size=m.size);break;default:A=typeof m.is=="string"?I.createElement(k,{is:m.is}):I.createElement(k)}}A[Ut]=s,A[Zt]=m;e:for(I=s.child;I!==null;){if(I.tag===5||I.tag===6)A.appendChild(I.stateNode);else if(I.tag!==4&&I.tag!==27&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===s)break e;for(;I.sibling===null;){if(I.return===null||I.return===s)break e;I=I.return}I.sibling.return=I.return,I=I.sibling}s.stateNode=A;e:switch(Kt(A,k,m),k){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&ji(s)}}return kt(s),nd(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,h),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==m&&ji(s);else{if(typeof m!="string"&&s.stateNode===null)throw Error(r(166));if(i=se.current,Bs(s)){if(i=s.stateNode,h=s.memoizedProps,m=null,k=Wt,k!==null)switch(k.tag){case 27:case 5:m=k.memoizedProps}i[Ut]=s,i=!!(i.nodeValue===h||m!==null&&m.suppressHydrationWarning===!0||ry(i.nodeValue,h)),i||rr(s,!0)}else i=Ac(i).createTextNode(m),i[Ut]=s,s.stateNode=i}return kt(s),null;case 31:if(h=s.memoizedState,i===null||i.memoizedState!==null){if(m=Bs(s),h!==null){if(i===null){if(!m)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Ut]=s}else Pr(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;kt(s),i=!1}else h=ff(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=h),i=!0;if(!i)return s.flags&256?(xn(s),s):(xn(s),null);if((s.flags&128)!==0)throw Error(r(558))}return kt(s),null;case 13:if(m=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(k=Bs(s),m!==null&&m.dehydrated!==null){if(i===null){if(!k)throw Error(r(318));if(k=s.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(r(317));k[Ut]=s}else Pr(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;kt(s),k=!1}else k=ff(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=k),k=!0;if(!k)return s.flags&256?(xn(s),s):(xn(s),null)}return xn(s),(s.flags&128)!==0?(s.lanes=h,s):(h=m!==null,i=i!==null&&i.memoizedState!==null,h&&(m=s.child,k=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(k=m.alternate.memoizedState.cachePool.pool),A=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(A=m.memoizedState.cachePool.pool),A!==k&&(m.flags|=2048)),h!==i&&h&&(s.child.flags|=8192),fc(s,s.updateQueue),kt(s),null);case 4:return ee(),i===null&&Cd(s.stateNode.containerInfo),kt(s),null;case 10:return Ti(s.type),kt(s),null;case 19:if(U(Lt),m=s.memoizedState,m===null)return kt(s),null;if(k=(s.flags&128)!==0,A=m.rendering,A===null)if(k)co(m,!1);else{if(Mt!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(A=Jl(i),A!==null){for(s.flags|=128,co(m,!1),i=A.updateQueue,s.updateQueue=i,fc(s,i),s.subtreeFlags=0,i=h,h=s.child;h!==null;)B0(h,i),h=h.sibling;return $(Lt,Lt.current&1|2),Je&&Ai(s,m.treeForkCount),s.child}i=i.sibling}m.tail!==null&&qe()>vc&&(s.flags|=128,k=!0,co(m,!1),s.lanes=4194304)}else{if(!k)if(i=Jl(A),i!==null){if(s.flags|=128,k=!0,i=i.updateQueue,s.updateQueue=i,fc(s,i),co(m,!0),m.tail===null&&m.tailMode==="hidden"&&!A.alternate&&!Je)return kt(s),null}else 2*qe()-m.renderingStartTime>vc&&h!==536870912&&(s.flags|=128,k=!0,co(m,!1),s.lanes=4194304);m.isBackwards?(A.sibling=s.child,s.child=A):(i=m.last,i!==null?i.sibling=A:s.child=A,m.last=A)}return m.tail!==null?(i=m.tail,m.rendering=i,m.tail=i.sibling,m.renderingStartTime=qe(),i.sibling=null,h=Lt.current,$(Lt,k?h&1|2:h&1),Je&&Ai(s,m.treeForkCount),i):(kt(s),null);case 22:case 23:return xn(s),Ef(),m=s.memoizedState!==null,i!==null?i.memoizedState!==null!==m&&(s.flags|=8192):m&&(s.flags|=8192),m?(h&536870912)!==0&&(s.flags&128)===0&&(kt(s),s.subtreeFlags&6&&(s.flags|=8192)):kt(s),h=s.updateQueue,h!==null&&fc(s,h.retryQueue),h=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),m=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(m=s.memoizedState.cachePool.pool),m!==h&&(s.flags|=2048),i!==null&&U(Gr),null;case 24:return h=null,i!==null&&(h=i.memoizedState.cache),s.memoizedState.cache!==h&&(s.flags|=2048),Ti(It),kt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function Tk(i,s){switch(uf(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Ti(It),ee(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return pe(s),null;case 31:if(s.memoizedState!==null){if(xn(s),s.alternate===null)throw Error(r(340));Pr()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(xn(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Pr()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return U(Lt),null;case 4:return ee(),null;case 10:return Ti(s.type),null;case 22:case 23:return xn(s),Ef(),i!==null&&U(Gr),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Ti(It),null;case 25:return null;default:return null}}function c_(i,s){switch(uf(s),s.tag){case 3:Ti(It),ee();break;case 26:case 27:case 5:pe(s);break;case 4:ee();break;case 31:s.memoizedState!==null&&xn(s);break;case 13:xn(s);break;case 19:U(Lt);break;case 10:Ti(s.type);break;case 22:case 23:xn(s),Ef(),i!==null&&U(Gr);break;case 24:Ti(It)}}function uo(i,s){try{var h=s.updateQueue,m=h!==null?h.lastEffect:null;if(m!==null){var k=m.next;h=k;do{if((h.tag&i)===i){m=void 0;var A=h.create,I=h.inst;m=A(),I.destroy=m}h=h.next}while(h!==k)}}catch(Y){mt(s,s.return,Y)}}function hr(i,s,h){try{var m=s.updateQueue,k=m!==null?m.lastEffect:null;if(k!==null){var A=k.next;m=A;do{if((m.tag&i)===i){var I=m.inst,Y=I.destroy;if(Y!==void 0){I.destroy=void 0,k=s;var J=h,le=Y;try{le()}catch(ge){mt(k,J,ge)}}}m=m.next}while(m!==A)}}catch(ge){mt(s,s.return,ge)}}function u_(i){var s=i.updateQueue;if(s!==null){var h=i.stateNode;try{ev(s,h)}catch(m){mt(i,i.return,m)}}}function h_(i,s,h){h.props=Xr(i.type,i.memoizedProps),h.state=i.memoizedState;try{h.componentWillUnmount()}catch(m){mt(i,s,m)}}function ho(i,s){try{var h=i.ref;if(h!==null){switch(i.tag){case 26:case 27:case 5:var m=i.stateNode;break;case 30:m=i.stateNode;break;default:m=i.stateNode}typeof h=="function"?i.refCleanup=h(m):h.current=m}}catch(k){mt(i,s,k)}}function oi(i,s){var h=i.ref,m=i.refCleanup;if(h!==null)if(typeof m=="function")try{m()}catch(k){mt(i,s,k)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof h=="function")try{h(null)}catch(k){mt(i,s,k)}else h.current=null}function f_(i){var s=i.type,h=i.memoizedProps,m=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":h.autoFocus&&m.focus();break e;case"img":h.src?m.src=h.src:h.srcSet&&(m.srcset=h.srcSet)}}catch(k){mt(i,i.return,k)}}function id(i,s,h){try{var m=i.stateNode;Zk(m,i.type,h,s),m[Zt]=s}catch(k){mt(i,i.return,k)}}function d_(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&_r(i.type)||i.tag===4}function rd(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||d_(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&_r(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function sd(i,s,h){var m=i.tag;if(m===5||m===6)i=i.stateNode,s?(h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h).insertBefore(i,s):(s=h.nodeType===9?h.body:h.nodeName==="HTML"?h.ownerDocument.body:h,s.appendChild(i),h=h._reactRootContainer,h!=null||s.onclick!==null||(s.onclick=Ci));else if(m!==4&&(m===27&&_r(i.type)&&(h=i.stateNode,s=null),i=i.child,i!==null))for(sd(i,s,h),i=i.sibling;i!==null;)sd(i,s,h),i=i.sibling}function dc(i,s,h){var m=i.tag;if(m===5||m===6)i=i.stateNode,s?h.insertBefore(i,s):h.appendChild(i);else if(m!==4&&(m===27&&_r(i.type)&&(h=i.stateNode),i=i.child,i!==null))for(dc(i,s,h),i=i.sibling;i!==null;)dc(i,s,h),i=i.sibling}function p_(i){var s=i.stateNode,h=i.memoizedProps;try{for(var m=i.type,k=s.attributes;k.length;)s.removeAttributeNode(k[0]);Kt(s,m,h),s[Ut]=i,s[Zt]=h}catch(A){mt(i,i.return,A)}}var Li=!1,Ft=!1,ad=!1,g_=typeof WeakSet=="function"?WeakSet:Set,qt=null;function Dk(i,s){if(i=i.containerInfo,Ad=Lc,i=A0(i),Qh(i)){if("selectionStart"in i)var h={start:i.selectionStart,end:i.selectionEnd};else e:{h=(h=i.ownerDocument)&&h.defaultView||window;var m=h.getSelection&&h.getSelection();if(m&&m.rangeCount!==0){h=m.anchorNode;var k=m.anchorOffset,A=m.focusNode;m=m.focusOffset;try{h.nodeType,A.nodeType}catch{h=null;break e}var I=0,Y=-1,J=-1,le=0,ge=0,ve=i,ce=null;t:for(;;){for(var de;ve!==h||k!==0&&ve.nodeType!==3||(Y=I+k),ve!==A||m!==0&&ve.nodeType!==3||(J=I+m),ve.nodeType===3&&(I+=ve.nodeValue.length),(de=ve.firstChild)!==null;)ce=ve,ve=de;for(;;){if(ve===i)break t;if(ce===h&&++le===k&&(Y=I),ce===A&&++ge===m&&(J=I),(de=ve.nextSibling)!==null)break;ve=ce,ce=ve.parentNode}ve=de}h=Y===-1||J===-1?null:{start:Y,end:J}}else h=null}h=h||{start:0,end:0}}else h=null;for(Nd={focusedElem:i,selectionRange:h},Lc=!1,qt=s;qt!==null;)if(s=qt,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,qt=i;else for(;qt!==null;){switch(s=qt,A=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(h=0;h title"))),Kt(A,m,h),A[Ut]=i,Bt(A),m=A;break e;case"link":var I=Sy("link","href",k).get(m+(h.href||""));if(I){for(var Y=0;Ybt&&(I=bt,bt=Ie,Ie=I);var ie=E0(Y,Ie),te=E0(Y,bt);if(ie&&te&&(de.rangeCount!==1||de.anchorNode!==ie.node||de.anchorOffset!==ie.offset||de.focusNode!==te.node||de.focusOffset!==te.offset)){var oe=ve.createRange();oe.setStart(ie.node,ie.offset),de.removeAllRanges(),Ie>bt?(de.addRange(oe),de.extend(te.node,te.offset)):(oe.setEnd(te.node,te.offset),de.addRange(oe))}}}}for(ve=[],de=Y;de=de.parentNode;)de.nodeType===1&&ve.push({element:de,left:de.scrollLeft,top:de.scrollTop});for(typeof Y.focus=="function"&&Y.focus(),Y=0;Yh?32:h,q.T=null,h=dd,dd=null;var A=gr,I=Hi;if(Gt=0,Ks=gr=null,Hi=0,(ut&6)!==0)throw Error(r(331));var Y=ut;if(ut|=4,k_(A.current),w_(A,A.current,I,h),ut=Y,_o(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot($e,A)}catch{}return!0}finally{X.p=k,q.T=m,G_(i,s)}}function V_(i,s,h){s=In(h,s),s=Vf(i.stateNode,s,2),i=lr(i,s,2),i!==null&&(Ae(i,2),li(i))}function mt(i,s,h){if(i.tag===3)V_(i,i,h);else for(;s!==null;){if(s.tag===3){V_(s,i,h);break}else if(s.tag===1){var m=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(pr===null||!pr.has(m))){i=In(h,i),h=Wv(2),m=lr(s,h,2),m!==null&&(Yv(h,m,s,i),Ae(m,2),li(m));break}}s=s.return}}function vd(i,s,h){var m=i.pingCache;if(m===null){m=i.pingCache=new jk;var k=new Set;m.set(s,k)}else k=m.get(s),k===void 0&&(k=new Set,m.set(s,k));k.has(h)||(cd=!0,k.add(h),i=zk.bind(null,i,s,h),s.then(i,i))}function zk(i,s,h){var m=i.pingCache;m!==null&&m.delete(s),i.pingedLanes|=i.suspendedLanes&h,i.warmLanes&=~h,St===i&&(Ze&h)===h&&(Mt===4||Mt===3&&(Ze&62914560)===Ze&&300>qe()-mc?(ut&2)===0&&Zs(i,0):ud|=h,Xs===Ze&&(Xs=0)),li(i)}function W_(i,s){s===0&&(s=ae()),i=Hr(i,s),i!==null&&(Ae(i,s),li(i))}function Hk(i){var s=i.memoizedState,h=0;s!==null&&(h=s.retryLane),W_(i,h)}function Fk(i,s){var h=0;switch(i.tag){case 31:case 13:var m=i.stateNode,k=i.memoizedState;k!==null&&(h=k.retryLane);break;case 19:m=i.stateNode;break;case 22:m=i.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(s),W_(i,h)}function Pk(i,s){return st(i,s)}var wc=null,Js=null,_d=!1,Cc=!1,yd=!1,vr=0;function li(i){i!==Js&&i.next===null&&(Js===null?wc=Js=i:Js=Js.next=i),Cc=!0,_d||(_d=!0,Uk())}function _o(i,s){if(!yd&&Cc){yd=!0;do for(var h=!1,m=wc;m!==null;){if(i!==0){var k=m.pendingLanes;if(k===0)var A=0;else{var I=m.suspendedLanes,Y=m.pingedLanes;A=(1<<31-Ve(42|i)+1)-1,A&=k&~(I&~Y),A=A&201326741?A&201326741|1:A?A|2:0}A!==0&&(h=!0,Z_(m,A))}else A=Ze,A=bi(m,m===St?A:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(A&3)===0||ii(m,A)||(h=!0,Z_(m,A));m=m.next}while(h);yd=!1}}function $k(){Y_()}function Y_(){Cc=_d=!1;var i=0;vr!==0&&Jk()&&(i=vr);for(var s=qe(),h=null,m=wc;m!==null;){var k=m.next,A=X_(m,s);A===0?(m.next=null,h===null?wc=k:h.next=k,k===null&&(Js=h)):(h=m,(i!==0||(A&3)!==0)&&(Cc=!0)),m=k}Gt!==0&&Gt!==5||_o(i),vr!==0&&(vr=0)}function X_(i,s){for(var h=i.suspendedLanes,m=i.pingedLanes,k=i.expirationTimes,A=i.pendingLanes&-62914561;0Y)break;var ge=J.transferSize,ve=J.initiatorType;ge&&sy(ve)&&(J=J.responseEnd,I+=ge*(J"u"?null:document;function vy(i,s,h){var m=ea;if(m&&typeof s=="string"&&s){var k=on(s);k='link[rel="'+i+'"][href="'+k+'"]',typeof h=="string"&&(k+='[crossorigin="'+h+'"]'),my.has(k)||(my.add(k),i={rel:i,crossOrigin:h,href:s},m.querySelector(k)===null&&(s=m.createElement("link"),Kt(s,"link",i),Bt(s),m.head.appendChild(s)))}}function lA(i){Fi.D(i),vy("dns-prefetch",i,null)}function cA(i,s){Fi.C(i,s),vy("preconnect",i,s)}function uA(i,s,h){Fi.L(i,s,h);var m=ea;if(m&&i&&s){var k='link[rel="preload"][as="'+on(s)+'"]';s==="image"&&h&&h.imageSrcSet?(k+='[imagesrcset="'+on(h.imageSrcSet)+'"]',typeof h.imageSizes=="string"&&(k+='[imagesizes="'+on(h.imageSizes)+'"]')):k+='[href="'+on(i)+'"]';var A=k;switch(s){case"style":A=ta(i);break;case"script":A=na(i)}Un.has(A)||(i=d({rel:"preload",href:s==="image"&&h&&h.imageSrcSet?void 0:i,as:s},h),Un.set(A,i),m.querySelector(k)!==null||s==="style"&&m.querySelector(xo(A))||s==="script"&&m.querySelector(wo(A))||(s=m.createElement("link"),Kt(s,"link",i),Bt(s),m.head.appendChild(s)))}}function hA(i,s){Fi.m(i,s);var h=ea;if(h&&i){var m=s&&typeof s.as=="string"?s.as:"script",k='link[rel="modulepreload"][as="'+on(m)+'"][href="'+on(i)+'"]',A=k;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":A=na(i)}if(!Un.has(A)&&(i=d({rel:"modulepreload",href:i},s),Un.set(A,i),h.querySelector(k)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(h.querySelector(wo(A)))return}m=h.createElement("link"),Kt(m,"link",i),Bt(m),h.head.appendChild(m)}}}function fA(i,s,h){Fi.S(i,s,h);var m=ea;if(m&&i){var k=Qi(m).hoistableStyles,A=ta(i);s=s||"default";var I=k.get(A);if(!I){var Y={loading:0,preload:null};if(I=m.querySelector(xo(A)))Y.loading=5;else{i=d({rel:"stylesheet",href:i,"data-precedence":s},h),(h=Un.get(A))&&Od(i,h);var J=I=m.createElement("link");Bt(J),Kt(J,"link",i),J._p=new Promise(function(le,ge){J.onload=le,J.onerror=ge}),J.addEventListener("load",function(){Y.loading|=1}),J.addEventListener("error",function(){Y.loading|=2}),Y.loading|=4,Tc(I,s,m)}I={type:"stylesheet",instance:I,count:1,state:Y},k.set(A,I)}}}function dA(i,s){Fi.X(i,s);var h=ea;if(h&&i){var m=Qi(h).hoistableScripts,k=na(i),A=m.get(k);A||(A=h.querySelector(wo(k)),A||(i=d({src:i,async:!0},s),(s=Un.get(k))&&Bd(i,s),A=h.createElement("script"),Bt(A),Kt(A,"link",i),h.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},m.set(k,A))}}function pA(i,s){Fi.M(i,s);var h=ea;if(h&&i){var m=Qi(h).hoistableScripts,k=na(i),A=m.get(k);A||(A=h.querySelector(wo(k)),A||(i=d({src:i,async:!0,type:"module"},s),(s=Un.get(k))&&Bd(i,s),A=h.createElement("script"),Bt(A),Kt(A,"link",i),h.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},m.set(k,A))}}function _y(i,s,h,m){var k=(k=se.current)?Nc(k):null;if(!k)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof h.precedence=="string"&&typeof h.href=="string"?(s=ta(h.href),h=Qi(k).hoistableStyles,m=h.get(s),m||(m={type:"style",instance:null,count:0,state:null},h.set(s,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(h.rel==="stylesheet"&&typeof h.href=="string"&&typeof h.precedence=="string"){i=ta(h.href);var A=Qi(k).hoistableStyles,I=A.get(i);if(I||(k=k.ownerDocument||k,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},A.set(i,I),(A=k.querySelector(xo(i)))&&!A._p&&(I.instance=A,I.state.loading=5),Un.has(i)||(h={rel:"preload",as:"style",href:h.href,crossOrigin:h.crossOrigin,integrity:h.integrity,media:h.media,hrefLang:h.hrefLang,referrerPolicy:h.referrerPolicy},Un.set(i,h),A||gA(k,i,h,I.state))),s&&m===null)throw Error(r(528,""));return I}if(s&&m!==null)throw Error(r(529,""));return null;case"script":return s=h.async,h=h.src,typeof h=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=na(h),h=Qi(k).hoistableScripts,m=h.get(s),m||(m={type:"script",instance:null,count:0,state:null},h.set(s,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function ta(i){return'href="'+on(i)+'"'}function xo(i){return'link[rel="stylesheet"]['+i+"]"}function yy(i){return d({},i,{"data-precedence":i.precedence,precedence:null})}function gA(i,s,h,m){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?m.loading=1:(s=i.createElement("link"),m.preload=s,s.addEventListener("load",function(){return m.loading|=1}),s.addEventListener("error",function(){return m.loading|=2}),Kt(s,"link",h),Bt(s),i.head.appendChild(s))}function na(i){return'[src="'+on(i)+'"]'}function wo(i){return"script[async]"+i}function by(i,s,h){if(s.count++,s.instance===null)switch(s.type){case"style":var m=i.querySelector('style[data-href~="'+on(h.href)+'"]');if(m)return s.instance=m,Bt(m),m;var k=d({},h,{"data-href":h.href,"data-precedence":h.precedence,href:null,precedence:null});return m=(i.ownerDocument||i).createElement("style"),Bt(m),Kt(m,"style",k),Tc(m,h.precedence,i),s.instance=m;case"stylesheet":k=ta(h.href);var A=i.querySelector(xo(k));if(A)return s.state.loading|=4,s.instance=A,Bt(A),A;m=yy(h),(k=Un.get(k))&&Od(m,k),A=(i.ownerDocument||i).createElement("link"),Bt(A);var I=A;return I._p=new Promise(function(Y,J){I.onload=Y,I.onerror=J}),Kt(A,"link",m),s.state.loading|=4,Tc(A,h.precedence,i),s.instance=A;case"script":return A=na(h.src),(k=i.querySelector(wo(A)))?(s.instance=k,Bt(k),k):(m=h,(k=Un.get(A))&&(m=d({},h),Bd(m,k)),i=i.ownerDocument||i,k=i.createElement("script"),Bt(k),Kt(k,"link",m),i.head.appendChild(k),s.instance=k);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(m=s.instance,s.state.loading|=4,Tc(m,h.precedence,i));return s.instance}function Tc(i,s,h){for(var m=h.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),k=m.length?m[m.length-1]:null,A=k,I=0;I title"):null)}function mA(i,s,h){if(h===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return i=s.disabled,typeof s.precedence=="string"&&i==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function wy(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function vA(i,s,h,m){if(h.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(h.state.loading&4)===0){if(h.instance===null){var k=ta(m.href),A=s.querySelector(xo(k));if(A){s=A._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Rc.bind(i),s.then(i,i)),h.state.loading|=4,h.instance=A,Bt(A);return}A=s.ownerDocument||s,m=yy(m),(k=Un.get(k))&&Od(m,k),A=A.createElement("link"),Bt(A);var I=A;I._p=new Promise(function(Y,J){I.onload=Y,I.onerror=J}),Kt(A,"link",m),h.instance=A}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(h,s),(s=h.state.preload)&&(h.state.loading&3)===0&&(i.count++,h=Rc.bind(i),s.addEventListener("load",h),s.addEventListener("error",h))}}var Id=0;function _A(i,s){return i.stylesheets&&i.count===0&&jc(i,i.stylesheets),0Id?50:800)+s);return i.unsuspend=h,function(){i.unsuspend=null,clearTimeout(m),clearTimeout(k)}}:null}function Rc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jc(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Mc=null;function jc(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Mc=new Map,s.forEach(yA,i),Mc=null,Rc.call(i))}function yA(i,s){if(!(s.state.loading&4)){var h=Mc.get(i);if(h)var m=h.get(null);else{h=new Map,Mc.set(i,h);for(var k=i.querySelectorAll("link[data-precedence],style[data-precedence]"),A=0;A"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Vd.exports=zA(),Vd.exports}var FA=HA();/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ex=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** + */const tx=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const FA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + */const PA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const PA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/** + */const $A=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Wy=e=>{const t=PA(e);return t.charAt(0).toUpperCase()+t.slice(1)};/** + */const Xy=e=>{const t=$A(e);return t.charAt(0).toUpperCase()+t.slice(1)};/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var Xd={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */var Kd={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $A=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},UA=G.createContext({}),GA=()=>G.useContext(UA),qA=G.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:a="",children:l,iconNode:u,...o},c)=>{const{size:f=24,strokeWidth:p=2,absoluteStrokeWidth:d=!1,color:v="currentColor",className:_=""}=GA()??{},C=r??d?Number(n??p)*24/Number(t??f):n??p;return G.createElement("svg",{ref:c,...Xd,width:t??f??Xd.width,height:t??f??Xd.height,stroke:e??v,strokeWidth:C,className:ex("lucide",_,a),...!l&&!$A(o)&&{"aria-hidden":"true"},...o},[...u.map(([w,S])=>G.createElement(w,S)),...Array.isArray(l)?l:[l]])});/** + */const UA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1},GA=G.createContext({}),qA=()=>G.useContext(GA),VA=G.forwardRef(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:a="",children:l,iconNode:u,...o},c)=>{const{size:f=24,strokeWidth:p=2,absoluteStrokeWidth:d=!1,color:v="currentColor",className:_=""}=qA()??{},C=r??d?Number(n??p)*24/Number(t??f):n??p;return G.createElement("svg",{ref:c,...Kd,width:t??f??Kd.width,height:t??f??Kd.height,stroke:e??v,strokeWidth:C,className:tx("lucide",_,a),...!l&&!UA(o)&&{"aria-hidden":"true"},...o},[...u.map(([w,S])=>G.createElement(w,S)),...Array.isArray(l)?l:[l]])});/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Fe=(e,t)=>{const n=G.forwardRef(({className:r,...a},l)=>G.createElement(qA,{ref:l,iconNode:t,className:ex(`lucide-${FA(Wy(e))}`,`lucide-${e}`,r),...a}));return n.displayName=Wy(e),n};/** + */const Fe=(e,t)=>{const n=G.forwardRef(({className:r,...a},l)=>G.createElement(VA,{ref:l,iconNode:t,className:tx(`lucide-${PA(Xy(e))}`,`lucide-${e}`,r),...a}));return n.displayName=Xy(e),n};/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const VA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],du=Fe("arrow-left",VA);/** + */const WA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],pu=Fe("arrow-left",WA);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const YA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Fc=Fe("arrow-right",YA);/** + */const YA=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Pc=Fe("arrow-right",YA);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const WA=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],XA=Fe("blocks",WA);/** + */const XA=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],KA=Fe("blocks",XA);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const KA=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],ZA=Fe("boxes",KA);/** + */const ZA=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],QA=Fe("boxes",ZA);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const QA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vn=Fe("check",QA);/** + */const JA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],vn=Fe("check",JA);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const JA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],gs=Fe("chevron-down",JA);/** + */const eN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],gs=Fe("chevron-down",eN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const eN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Wu=Fe("chevron-right",eN);/** + */const tN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Xu=Fe("chevron-right",tN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],nN=Fe("circle-question-mark",tN);/** + */const nN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],iN=Fe("circle-question-mark",nN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],rN=Fe("circle-stop",iN);/** + */const rN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]],sN=Fe("circle-stop",rN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sN=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],aN=Fe("cloud",sN);/** + */const aN=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],oN=Fe("cloud",aN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oN=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],tx=Fe("code",oN);/** + */const lN=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],nx=Fe("code",lN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lN=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Ng=Fe("copy",lN);/** + */const cN=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Tg=Fe("copy",cN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cN=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],nx=Fe("corner-down-left",cN);/** + */const uN=[["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}],["path",{d:"m9 10-5 5 5 5",key:"1kshq7"}]],ix=Fe("corner-down-left",uN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uN=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],hN=Fe("cpu",uN);/** + */const hN=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],fN=Fe("cpu",hN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fN=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],dN=Fe("ellipsis",fN);/** + */const dN=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],pN=Fe("ellipsis",dN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pN=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ix=Fe("external-link",pN);/** + */const gN=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],rx=Fe("external-link",gN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gN=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],rx=Fe("file-code",gN);/** + */const mN=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],sx=Fe("file-code",mN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mN=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],sx=Fe("file-text",mN);/** + */const vN=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ax=Fe("file-text",vN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vN=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],_N=Fe("file",vN);/** + */const _N=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],yN=Fe("file",_N);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yN=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],bN=Fe("flask-conical",yN);/** + */const bN=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],SN=Fe("flask-conical",bN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const SN=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Tg=Fe("folder-open",SN);/** + */const xN=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Dg=Fe("folder-open",xN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xN=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],ax=Fe("folder-tree",xN);/** + */const wN=[["path",{d:"M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"hod4my"}],["path",{d:"M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z",key:"w4yl2u"}],["path",{d:"M3 5a2 2 0 0 0 2 2h3",key:"f2jnh7"}],["path",{d:"M3 3v13a2 2 0 0 0 2 2h3",key:"k8epm1"}]],ox=Fe("folder-tree",wN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wN=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],CN=Fe("folder",wN);/** + */const CN=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],EN=Fe("folder",CN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const EN=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Xu=Fe("git-branch",EN);/** + */const kN=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Ku=Fe("git-branch",kN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const kN=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],AN=Fe("hard-drive",kN);/** + */const AN=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],NN=Fe("hard-drive",AN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const NN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],TN=Fe("info",NN);/** + */const TN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],DN=Fe("info",TN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const RN=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],DN=Fe("laptop",RN);/** + */const RN=[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]],MN=Fe("laptop",RN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const MN=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],jN=Fe("lock",MN);/** + */const jN=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],LN=Fe("lock",jN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const LN=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],ON=Fe("maximize-2",LN);/** + */const ON=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],BN=Fe("maximize-2",ON);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const BN=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],IN=Fe("minimize-2",BN);/** + */const IN=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],zN=Fe("minimize-2",IN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zN=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],HN=Fe("mouse-pointer-click",zN);/** + */const HN=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],FN=Fe("mouse-pointer-click",HN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const FN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],ox=Fe("panel-left",FN);/** + */const PN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],lx=Fe("panel-left",PN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const PN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Rg=Fe("plus",PN);/** + */const $N=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Rg=Fe("plus",$N);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const $N=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],ku=Fe("refresh-cw",$N);/** + */const UN=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Au=Fe("refresh-cw",UN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const UN=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Dg=Fe("rotate-cw",UN);/** + */const GN=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Mg=Fe("rotate-cw",GN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const GN=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],lx=Fe("scroll-text",GN);/** + */const qN=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],cx=Fe("scroll-text",qN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qN=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],jp=Fe("server",qN);/** + */const VN=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Lp=Fe("server",VN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const VN=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],YN=Fe("settings-2",VN);/** + */const WN=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],YN=Fe("settings-2",WN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const WN=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],XN=Fe("sliders-horizontal",WN);/** + */const XN=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],KN=Fe("sliders-horizontal",XN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const KN=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],ZN=Fe("square-terminal",KN);/** + */const ZN=[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]],QN=Fe("square-terminal",ZN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const QN=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],cx=Fe("terminal",QN);/** + */const JN=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],ux=Fe("terminal",JN);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const JN=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Mg=Fe("trash-2",JN);/** + */const eT=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],jg=Fe("trash-2",eT);/** * @license lucide-react v1.23.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const eT=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],va=Fe("x",eT);async function ms(e){if(!e.ok){const t=await e.text().catch(()=>"");let n=t;try{const r=JSON.parse(t);r.error&&(n=r.error)}catch{}throw new Error(n||`HTTP ${e.status}`)}return await e.json()}const pt=e=>fetch(e).then(t=>ms(t)),jt=(e,t)=>fetch(e,{method:"POST",headers:t===void 0?{}:{"content-type":"application/json"},body:t===void 0?void 0:JSON.stringify(t)}).then(n=>ms(n)),ux=(e,t)=>fetch(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(n=>ms(n)),tT=()=>pt("/api/projects").then(e=>e.projects),nT=e=>jt("/api/projects",e).then(t=>t.project),iT=e=>pt(`/api/papers/search?q=${encodeURIComponent(e)}`).then(t=>t.papers),rT=e=>pt(`/api/papers/resolve?id=${encodeURIComponent(e)}`).then(t=>t.paper),sT=e=>jt(`/api/projects/${e}/open`).then(t=>t.project),aT=e=>fetch(`/api/projects/${e}`,{method:"DELETE"}).then(async t=>{if(!t.ok){const n=await t.json().catch(()=>null);throw new Error((n==null?void 0:n.error)??`delete failed (${t.status})`)}}),oT=e=>pt(`/api/projects/${e}/experiments`).then(t=>t.experiments),lT=e=>pt(`/api/projects/${e}/runs`).then(t=>t.runs),cT=()=>pt("/api/instances").then(e=>e.instances),hx=e=>jt(`/api/runs/${e}/cancel`),uT=(e,t)=>pt(`/api/runs/${e}/log?offset=${t}`),hT=e=>pt(`/api/experiments/${e}/commits`).then(t=>t.commits),fT=(e,t)=>pt(`/api/experiments/${e}/commits/${t}/diff`),Xy=e=>pt(`/api/projects/${e}/working-tree`),fx=(e,t=new URLSearchParams)=>(e.sessionId&&t.set("sessionId",e.sessionId),e.ref&&t.set("ref",e.ref),t),dT=(e,t,n={})=>pt(`/api/projects/${e}/file?${fx(n,new URLSearchParams({path:t}))}`),pT=(e,t={})=>{const n=fx(t).toString();return pt(`/api/projects/${e}/code-tree${n?`?${n}`:""}`)},jg=(e,t,n)=>`https://github.com/${e}/${t}/tree/${n.split("/").map(encodeURIComponent).join("/")}`,gT=()=>pt("/api/settings/hf"),mT=e=>jt("/api/settings/hf",{token:e}),vT=()=>pt("/api/settings/k8s"),_T=e=>jt("/api/settings/k8s",e),yT=()=>pt("/api/settings/modal"),bT=()=>jt("/api/settings/modal/provision"),ST=()=>pt("/api/settings/env").then(e=>e.vars),dx=(e,t)=>jt("/api/settings/env",{key:e,value:t}).then(n=>n.vars),xT=e=>fetch(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(t=>ms(t)).then(t=>t.vars),px=()=>pt("/api/settings/data-dir"),wT=e=>jt("/api/settings/data-dir/validate",{path:e}),CT=e=>jt("/api/settings/data-dir",{path:e}),ET=e=>jt("/api/settings/data-dir/move",{path:e}),kT=()=>pt("/api/settings/ssh").then(e=>e.hosts),AT=e=>jt("/api/settings/ssh/preflight",{host:e}),NT=()=>pt("/api/settings/slurm"),TT=e=>jt("/api/settings/slurm",e),RT=e=>jt("/api/settings/slurm/preflight",{host:e}),DT=()=>pt("/api/settings/compute"),gx=e=>jt("/api/settings/compute/default",e),MT=()=>pt("/api/settings/local"),jT=()=>pt("/api/settings/openresearch"),Ky=e=>pt(`/api/projects/${e}/files`),LT=(e,t)=>pt(`/api/projects/${e}/files/report?path=${encodeURIComponent(t)}`),OT=(e,t)=>fetch(`/api/projects/${e}/files?path=${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>ms(n)),Ku=(e,t)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(t)}`,mx=()=>pt("/api/settings/git"),BT=e=>jt("/api/settings/git",e),IT=e=>jt("/api/settings/git/token",{token:e}),zT=()=>fetch("/api/settings/git/token",{method:"DELETE"}).then(e=>ms(e)),HT=()=>pt("/api/settings/telemetry"),FT=e=>jt("/api/settings/telemetry",{enabled:e}),PT=e=>jt("/api/settings/telemetry/consent",{enabled:e}),Lg=(e=!1)=>pt(`/api/harnesses${e?"?refresh=1":""}`).then(t=>t.harnesses),$T=()=>pt("/api/skills").then(e=>e.skills);function Au(e){const t=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),n=[],r=[];for(const a of t.split("-"))/^\d+(\.\d+)?$/.test(a)?r.push(a):(r.length&&n.push(r.splice(0).join(".")),n.push(a==="gpt"?"GPT":a.charAt(0).toUpperCase()+a.slice(1)));return r.length&&n.push(r.join(".")),n.join(" ")}const Zy=e=>pt(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`).then(t=>t.sessions),UT=(e,t,n={})=>jt("/api/chat/sessions",{projectId:e,harness:t,...n}).then(r=>r.session),GT=e=>fetch(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(t=>ms(t)),qT=(e,t)=>ux(`/api/chat/sessions/${e}`,{archived:t}).then(n=>n.session),VT=(e,t)=>ux(`/api/chat/sessions/${e}`,{title:t}).then(n=>n.session),Qy=e=>pt(`/api/chat/sessions/${e}/messages`).then(t=>t.messages),YT=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,WT=(e,t,n={},r)=>jt(`/api/chat/sessions/${e}/message`,{text:t,model:n.model,permissionMode:n.permissionMode,reasoningLevel:n.reasoningLevel,images:r}),XT=e=>jt(`/api/chat/sessions/${e}/interrupt`),KT=(e,t)=>jt(`/api/chat/sessions/${e}/respond`,t);function Aa(e){const t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return`${t}s ago`;const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Jy(e){const t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;const n=Math.floor(t/60);if(n<60)return`${n}m`;const r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d ${r%24}h`}function ls(e){const t=["B","KB","MB","GB","TB"];let n=e,r=0;for(;n>=1024&&r10?`${e.slice(0,10)}…`:e}function vx(e){return e?typeof e.kind=="string"?e.kind:typeof e.type=="string"?e.type:"":""}function _x(e){return e?typeof e.flavor=="string"&&e.flavor?e.flavor:typeof e.manifest=="string"&&e.manifest?e.manifest:typeof e.namespace=="string"&&e.namespace?e.namespace:"":""}const pu=new Map;function ZT(e,t){let n=pu.get(e);return n||(n=new Set,pu.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&pu.delete(e)}}function QT(e){var t;(t=pu.get(e.runId))==null||t.forEach(n=>n(e))}const Op=new Set;function JT(e){return Op.add(e),()=>{Op.delete(e)}}function Pc(e){Op.forEach(t=>t(e))}const Bp=new Set;function e3(e){return Bp.add(e),()=>{Bp.delete(e)}}function Kd(e){Bp.forEach(t=>t(e))}function t3(e){const t=G.useRef(e);t.current=e,G.useEffect(()=>{const n=new EventSource("/api/events"),r=a=>{try{return JSON.parse(a.data)}catch{return null}};return n.addEventListener("run.updated",a=>{const l=r(a);l!=null&&l.run&&t.current.onRun(l.run)}),n.addEventListener("experiment.updated",a=>{const l=r(a);l!=null&&l.experiment&&t.current.onExperiment(l.experiment)}),n.addEventListener("project.updated",a=>{const l=r(a);l!=null&&l.project&&t.current.onProject(l.project)}),n.addEventListener("files.updated",a=>{var u,o;const l=r(a);l!=null&&l.projectId&&((o=(u=t.current).onFiles)==null||o.call(u,l.projectId))}),n.addEventListener("run.log",a=>{const l=r(a);l!=null&&l.runId&&QT(l)}),n.addEventListener("chat.session",a=>{const l=r(a);l!=null&&l.session&&Pc({type:"session",session:l.session})}),n.addEventListener("chat.session.deleted",a=>{const l=r(a);l!=null&&l.sessionId&&Pc({type:"sessionDeleted",sessionId:l.sessionId})}),n.addEventListener("chat.message",a=>{const l=r(a);l!=null&&l.message&&Pc({type:"message",sessionId:l.sessionId,message:l.message})}),n.addEventListener("chat.busy",a=>{const l=r(a);l!=null&&l.sessionId&&Pc({type:"busy",sessionId:l.sessionId,busy:l.busy})}),n.addEventListener("datadir.move.progress",a=>{const l=r(a);l&&Kd({type:"progress",...l})}),n.addEventListener("datadir.move.done",a=>{const l=r(a);l&&Kd({type:"done",path:l.path,oldPathLeft:l.oldPathLeft})}),n.addEventListener("datadir.move.error",a=>{const l=r(a);l&&Kd({type:"error",error:l.error})}),()=>n.close()},[])}function e1(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,l=!1;for(;!l;){r===-1&&(r=n.length,l=!0);const u=n.slice(a,r).trim();(u||!l)&&t.push(u),a=r+1,r=n.indexOf(",",a)}return t}function n3(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const i3=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,r3=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,s3={};function t1(e,t){return(s3.jsx?r3:i3).test(e)}const a3=/[ \t\n\f\r]/g;function o3(e){return typeof e=="object"?e.type==="text"?n1(e.value):!1:n1(e)}function n1(e){return e.replace(a3,"")===""}class ul{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ul.prototype.normal={};ul.prototype.property={};ul.prototype.space=void 0;function yx(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new ul(n,r,t)}function Go(e){return e.toLowerCase()}class _n{constructor(t,n){this.attribute=n,this.property=t}}_n.prototype.attribute="";_n.prototype.booleanish=!1;_n.prototype.boolean=!1;_n.prototype.commaOrSpaceSeparated=!1;_n.prototype.commaSeparated=!1;_n.prototype.defined=!1;_n.prototype.mustUseProperty=!1;_n.prototype.number=!1;_n.prototype.overloadedBoolean=!1;_n.prototype.property="";_n.prototype.spaceSeparated=!1;_n.prototype.space=void 0;let l3=0;const ze=vs(),Pt=vs(),Ip=vs(),Se=vs(),xt=vs(),ss=vs(),kn=vs();function vs(){return 2**++l3}const zp=Object.freeze(Object.defineProperty({__proto__:null,boolean:ze,booleanish:Pt,commaOrSpaceSeparated:kn,commaSeparated:ss,number:Se,overloadedBoolean:Ip,spaceSeparated:xt},Symbol.toStringTag,{value:"Module"})),Zd=Object.keys(zp);class Og extends _n{constructor(t,n,r,a){let l=-1;if(super(t,n),i1(this,"space",a),typeof r=="number")for(;++l4&&n.slice(0,4)==="data"&&d3.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(r1,g3);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!r1.test(l)){let u=l.replace(f3,p3);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}a=Og}return new a(r,t)}function p3(e){return"-"+e.toLowerCase()}function g3(e){return e.charAt(1).toUpperCase()}const Ax=yx([bx,c3,wx,Cx,Ex],"html"),Zu=yx([bx,u3,wx,Cx,Ex],"svg");function s1(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function m3(e){return e.join(" ").trim()}var ra={},Qd,a1;function v3(){if(a1)return Qd;a1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,o=/^\s+|\s+$/g,c=` -`,f="/",p="*",d="",v="comment",_="declaration";function C(S,y){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];y=y||{};var x=1,b=1;function E(P){var Y=P.match(t);Y&&(x+=Y.length);var q=P.lastIndexOf(c);b=~q?P.length-q:b+P.length}function R(){var P={line:x,column:b};return function(Y){return Y.position=new N(P),j(),Y}}function N(P){this.start=P,this.end={line:x,column:b},this.source=y.source}N.prototype.content=S;function D(P){var Y=new Error(y.source+":"+x+":"+b+": "+P);if(Y.reason=P,Y.filename=y.source,Y.line=x,Y.column=b,Y.source=S,!y.silent)throw Y}function T(P){var Y=P.exec(S);if(Y){var q=Y[0];return E(q),S=S.slice(q.length),Y}}function j(){T(n)}function B(P){var Y;for(P=P||[];Y=z();)Y!==!1&&P.push(Y);return P}function z(){var P=R();if(!(f!=S.charAt(0)||p!=S.charAt(1))){for(var Y=2;d!=S.charAt(Y)&&(p!=S.charAt(Y)||f!=S.charAt(Y+1));)++Y;if(Y+=2,d===S.charAt(Y-1))return D("End of comment missing");var q=S.slice(2,Y-2);return b+=2,E(q),S=S.slice(Y),b+=2,P({type:v,comment:q})}}function V(){var P=R(),Y=T(r);if(Y){if(z(),!T(a))return D("property missing ':'");var q=T(l),X=P({type:_,property:w(Y[0].replace(e,d)),value:q?w(q[0].replace(e,d)):d});return T(u),X}}function F(){var P=[];B(P);for(var Y;Y=V();)Y!==!1&&(P.push(Y),B(P));return P}return j(),F()}function w(S){return S?S.replace(o,d):d}return Qd=C,Qd}var o1;function _3(){if(o1)return ra;o1=1;var e=ra&&ra.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ra,"__esModule",{value:!0}),ra.default=n;const t=e(v3());function n(r,a){let l=null;if(!r||typeof r!="string")return l;const u=(0,t.default)(r),o=typeof a=="function";return u.forEach(c=>{if(c.type!=="declaration")return;const{property:f,value:p}=c;o?a(f,p,c):p&&(l=l||{},l[f]=p)}),l}return ra}var To={},l1;function y3(){if(l1)return To;l1=1,Object.defineProperty(To,"__esModule",{value:!0}),To.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,l=function(f){return!f||n.test(f)||e.test(f)},u=function(f,p){return p.toUpperCase()},o=function(f,p){return"".concat(p,"-")},c=function(f,p){return p===void 0&&(p={}),l(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(a,o):f=f.replace(r,o),f.replace(t,u))};return To.camelCase=c,To}var Ro,c1;function b3(){if(c1)return Ro;c1=1;var e=Ro&&Ro.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(_3()),n=y3();function r(a,l){var u={};return!a||typeof a!="string"||(0,t.default)(a,function(o,c){o&&c&&(u[(0,n.camelCase)(o,l)]=c)}),u}return r.default=r,Ro=r,Ro}var S3=b3();const x3=Yu(S3),Nx=Tx("end"),Bg=Tx("start");function Tx(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 w3(e){const t=Bg(e),n=Nx(e);if(t&&n)return{start:t,end:n}}function zo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?u1(e.position):"start"in e||"end"in e?u1(e):"line"in e||"column"in e?Hp(e):""}function Hp(e){return h1(e&&e.line)+":"+h1(e&&e.column)}function u1(e){return Hp(e&&e.start)+"-"+Hp(e&&e.end)}function h1(e){return e&&typeof e=="number"?e:1}class en extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",l={},u=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?a=t:!l.cause&&t&&(u=!0,a=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?l.ruleId=r:(l.source=r.slice(0,c),l.ruleId=r.slice(c+1))}if(!l.place&&l.ancestors&&l.ancestors){const c=l.ancestors[l.ancestors.length-1];c&&(l.place=c.position)}const o=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=o?o.line:void 0,this.name=zo(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=u&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}en.prototype.file="";en.prototype.name="";en.prototype.reason="";en.prototype.message="";en.prototype.stack="";en.prototype.column=void 0;en.prototype.line=void 0;en.prototype.ancestors=void 0;en.prototype.cause=void 0;en.prototype.fatal=void 0;en.prototype.place=void 0;en.prototype.ruleId=void 0;en.prototype.source=void 0;const Ig={}.hasOwnProperty,C3=new Map,E3=/[A-Z]/g,k3=new Set(["table","tbody","thead","tfoot","tr"]),A3=new Set(["td","th"]),Rx="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function N3(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=B3(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=O3(n,t.jsx,t.jsxs)}const a={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"?Zu:Ax,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=Dx(a,e,void 0);return l&&typeof l!="string"?l:a.create(e,a.Fragment,{children:l||void 0},void 0)}function Dx(e,t,n){if(t.type==="element")return T3(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return R3(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return M3(e,t,n);if(t.type==="mdxjsEsm")return D3(e,t);if(t.type==="root")return j3(e,t,n);if(t.type==="text")return L3(e,t)}function T3(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=Zu,e.schema=a),e.ancestors.push(t);const l=jx(e,t.tagName,!1),u=I3(e,t);let o=Hg(e,t);return k3.has(t.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!o3(c):!0})),Mx(e,u,l,t),zg(u,o),e.ancestors.pop(),e.schema=r,e.create(t,l,u,n)}function R3(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)}qo(e,t.position)}function D3(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);qo(e,t.position)}function M3(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=Zu,e.schema=a),e.ancestors.push(t);const l=t.name===null?e.Fragment:jx(e,t.name,!0),u=z3(e,t),o=Hg(e,t);return Mx(e,u,l,t),zg(u,o),e.ancestors.pop(),e.schema=r,e.create(t,l,u,n)}function j3(e,t,n){const r={};return zg(r,Hg(e,t)),e.create(t,e.Fragment,r,n)}function L3(e,t){return t.value}function Mx(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function zg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function O3(e,t,n){return r;function r(a,l,u,o){const f=Array.isArray(u.children)?n:t;return o?f(l,u,o):f(l,u)}}function B3(e,t){return n;function n(r,a,l,u){const o=Array.isArray(l.children),c=Bg(r);return t(a,l,u,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function I3(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&Ig.call(t.properties,a)){const l=H3(e,a,t.properties[a]);if(l){const[u,o]=l;e.tableCellAlignToStyle&&u==="align"&&typeof o=="string"&&A3.has(t.tagName)?r=o:n[u]=o}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function z3(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const u=l.expression;u.type;const o=u.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else qo(e,t.position);else{const a=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,l=e.evaluater.evaluateExpression(o.expression)}else qo(e,t.position);else l=r.value===null?!0:r.value;n[a]=l}return n}function Hg(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:C3;for(;++ra?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)u=Array.from(r),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);l0?(Tn(e,e.length,0,t),e):t}const p1={}.hasOwnProperty;function Ox(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 Jn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const sn=Dr(/[A-Za-z]/),Jt=Dr(/[\dA-Za-z]/),W3=Dr(/[#-'*+\--9=?A-Z^-~]/);function Nu(e){return e!==null&&(e<32||e===127)}const Fp=Dr(/\d/),X3=Dr(/[\dA-Fa-f]/),K3=Dr(/[!-/:-@[-`{-~]/);function Be(e){return e!==null&&e<-2}function wt(e){return e!==null&&(e<0||e===32)}function Ke(e){return e===-2||e===-1||e===32}const Qu=Dr(new RegExp("\\p{P}|\\p{S}","u")),cs=Dr(/\s/);function Dr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ta(e){const t=[];let n=-1,r=0,a=0;for(;++n55295&&l<57344){const o=e.charCodeAt(n+1);l<56320&&o>56319&&o<57344?(u=String.fromCharCode(l,o),a=1):u="�"}else u=String.fromCharCode(l);u&&(t.push(e.slice(r,n),encodeURIComponent(u)),r=n+a+1,u=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function nt(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let l=0;return u;function u(c){return Ke(c)?(e.enter(n),o(c)):t(c)}function o(c){return Ke(c)&&l++u))return;const D=t.events.length;let T=D,j,B;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(j){B=t.events[T][1].end;break}j=!0}for(y(r),N=D;Nb;){const R=n[E];t.containerState=R[1],R[0].exit.call(t,e)}n.length=b}function x(){a.write([null]),l=void 0,a=void 0,t.containerState._closeFlow=void 0}}function t5(e,t,n){return nt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function _a(e){if(e===null||wt(e)||cs(e))return 1;if(Qu(e))return 2}function Ju(e,t,n){const r=[];let a=-1;for(;++a1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},v={...e[n][1].start};m1(d,-c),m1(v,c),u={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},l={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:c>1?"strong":"emphasis",start:{...u.start},end:{...o.end}},e[r][1].end={...u.start},e[n][1].start={...o.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Gn(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Gn(f,[["enter",a,t],["enter",u,t],["exit",u,t],["enter",l,t]]),f=Gn(f,Ju(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Gn(f,[["exit",l,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=Gn(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Tn(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n0&&Ke(N)?nt(e,x,"linePrefix",l+1)(N):x(N)}function x(N){return N===null||Be(N)?e.check(v1,w,E)(N):(e.enter("codeFlowValue"),b(N))}function b(N){return N===null||Be(N)?(e.exit("codeFlowValue"),x(N)):(e.consume(N),b)}function E(N){return e.exit("codeFenced"),t(N)}function R(N,D,T){let j=0;return B;function B(Y){return N.enter("lineEnding"),N.consume(Y),N.exit("lineEnding"),z}function z(Y){return N.enter("codeFencedFence"),Ke(Y)?nt(N,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Y):V(Y)}function V(Y){return Y===o?(N.enter("codeFencedFenceSequence"),F(Y)):T(Y)}function F(Y){return Y===o?(j++,N.consume(Y),F):j>=u?(N.exit("codeFencedFenceSequence"),Ke(Y)?nt(N,P,"whitespace")(Y):P(Y)):T(Y)}function P(Y){return Y===null||Be(Y)?(N.exit("codeFencedFence"),D(Y)):T(Y)}}}function d5(e,t,n){const r=this;return a;function a(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l)}function l(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}const ep={name:"codeIndented",tokenize:g5},p5={partial:!0,tokenize:m5};function g5(e,t,n){const r=this;return a;function a(f){return e.enter("codeIndented"),nt(e,l,"linePrefix",5)(f)}function l(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?u(f):n(f)}function u(f){return f===null?c(f):Be(f)?e.attempt(p5,u,c)(f):(e.enter("codeFlowValue"),o(f))}function o(f){return f===null||Be(f)?(e.exit("codeFlowValue"),u(f)):(e.consume(f),o)}function c(f){return e.exit("codeIndented"),t(f)}}function m5(e,t,n){const r=this;return a;function a(u){return r.parser.lazy[r.now().line]?n(u):Be(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a):nt(e,l,"linePrefix",5)(u)}function l(u){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(u):Be(u)?a(u):n(u)}}const v5={name:"codeText",previous:y5,resolve:_5,tokenize:b5};function _5(e){let t=e.length-4,n=3,r,a;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 a=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&Do(this.left,r),l.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),Do(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Do(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(u):e.interrupt(r.parser.constructs.flow,n,t)(u)}}function Px(e,t,n,r,a,l,u,o,c){const f=c||Number.POSITIVE_INFINITY;let p=0;return d;function d(y){return y===60?(e.enter(r),e.enter(a),e.enter(l),e.consume(y),e.exit(l),v):y===null||y===32||y===41||Nu(y)?n(y):(e.enter(r),e.enter(u),e.enter(o),e.enter("chunkString",{contentType:"string"}),w(y))}function v(y){return y===62?(e.enter(l),e.consume(y),e.exit(l),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),_(y))}function _(y){return y===62?(e.exit("chunkString"),e.exit(o),v(y)):y===null||y===60||Be(y)?n(y):(e.consume(y),y===92?C:_)}function C(y){return y===60||y===62||y===92?(e.consume(y),_):_(y)}function w(y){return!p&&(y===null||y===41||wt(y))?(e.exit("chunkString"),e.exit(o),e.exit(u),e.exit(r),t(y)):p999||_===null||_===91||_===93&&!c||_===94&&!o&&"_hiddenFootnoteSupport"in u.parser.constructs?n(_):_===93?(e.exit(l),e.enter(a),e.consume(_),e.exit(a),e.exit(r),t):Be(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),d(_))}function d(_){return _===null||_===91||_===93||Be(_)||o++>999?(e.exit("chunkString"),p(_)):(e.consume(_),c||(c=!Ke(_)),_===92?v:d)}function v(_){return _===91||_===92||_===93?(e.consume(_),o++,d):d(_)}}function Ux(e,t,n,r,a,l){let u;return o;function o(v){return v===34||v===39||v===40?(e.enter(r),e.enter(a),e.consume(v),e.exit(a),u=v===40?41:v,c):n(v)}function c(v){return v===u?(e.enter(a),e.consume(v),e.exit(a),e.exit(r),t):(e.enter(l),f(v))}function f(v){return v===u?(e.exit(l),c(u)):v===null?n(v):Be(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),nt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===u||v===null||Be(v)?(e.exit("chunkString"),f(v)):(e.consume(v),v===92?d:p)}function d(v){return v===u||v===92?(e.consume(v),p):p(v)}}function Ho(e,t){let n;return r;function r(a){return Be(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Ke(a)?nt(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const N5={name:"definition",tokenize:R5},T5={partial:!0,tokenize:D5};function R5(e,t,n){const r=this;let a;return l;function l(_){return e.enter("definition"),u(_)}function u(_){return $x.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(_)}function o(_){return a=Jn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),_===58?(e.enter("definitionMarker"),e.consume(_),e.exit("definitionMarker"),c):n(_)}function c(_){return wt(_)?Ho(e,f)(_):f(_)}function f(_){return Px(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(_)}function p(_){return e.attempt(T5,d,d)(_)}function d(_){return Ke(_)?nt(e,v,"whitespace")(_):v(_)}function v(_){return _===null||Be(_)?(e.exit("definition"),r.parser.defined.push(a),t(_)):n(_)}}function D5(e,t,n){return r;function r(o){return wt(o)?Ho(e,a)(o):n(o)}function a(o){return Ux(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function l(o){return Ke(o)?nt(e,u,"whitespace")(o):u(o)}function u(o){return o===null||Be(o)?t(o):n(o)}}const M5={name:"hardBreakEscape",tokenize:j5};function j5(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),a}function a(l){return Be(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const L5={name:"headingAtx",resolve:O5,tokenize:B5};function O5(e,t){let n=e.length-2,r=3,a,l;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&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Tn(e,r,n-r+1,[["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t]])),e}function B5(e,t,n){let r=0;return a;function a(p){return e.enter("atxHeading"),l(p)}function l(p){return e.enter("atxHeadingSequence"),u(p)}function u(p){return p===35&&r++<6?(e.consume(p),u):p===null||wt(p)?(e.exit("atxHeadingSequence"),o(p)):n(p)}function o(p){return p===35?(e.enter("atxHeadingSequence"),c(p)):p===null||Be(p)?(e.exit("atxHeading"),t(p)):Ke(p)?nt(e,o,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function c(p){return p===35?(e.consume(p),c):(e.exit("atxHeadingSequence"),o(p))}function f(p){return p===null||p===35||wt(p)?(e.exit("atxHeadingText"),o(p)):(e.consume(p),f)}}const I5=["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"],y1=["pre","script","style","textarea"],z5={concrete:!0,name:"htmlFlow",resolveTo:P5,tokenize:$5},H5={partial:!0,tokenize:G5},F5={partial:!0,tokenize:U5};function P5(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 $5(e,t,n){const r=this;let a,l,u,o,c;return f;function f($){return p($)}function p($){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume($),d}function d($){return $===33?(e.consume($),v):$===47?(e.consume($),l=!0,w):$===63?(e.consume($),a=3,r.interrupt?t:M):sn($)?(e.consume($),u=String.fromCharCode($),S):n($)}function v($){return $===45?(e.consume($),a=2,_):$===91?(e.consume($),a=5,o=0,C):sn($)?(e.consume($),a=4,r.interrupt?t:M):n($)}function _($){return $===45?(e.consume($),r.interrupt?t:M):n($)}function C($){const Q="CDATA[";return $===Q.charCodeAt(o++)?(e.consume($),o===Q.length?r.interrupt?t:V:C):n($)}function w($){return sn($)?(e.consume($),u=String.fromCharCode($),S):n($)}function S($){if($===null||$===47||$===62||wt($)){const Q=$===47,re=u.toLowerCase();return!Q&&!l&&y1.includes(re)?(a=1,r.interrupt?t($):V($)):I5.includes(u.toLowerCase())?(a=6,Q?(e.consume($),y):r.interrupt?t($):V($)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n($):l?x($):b($))}return $===45||Jt($)?(e.consume($),u+=String.fromCharCode($),S):n($)}function y($){return $===62?(e.consume($),r.interrupt?t:V):n($)}function x($){return Ke($)?(e.consume($),x):B($)}function b($){return $===47?(e.consume($),B):$===58||$===95||sn($)?(e.consume($),E):Ke($)?(e.consume($),b):B($)}function E($){return $===45||$===46||$===58||$===95||Jt($)?(e.consume($),E):R($)}function R($){return $===61?(e.consume($),N):Ke($)?(e.consume($),R):b($)}function N($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(e.consume($),c=$,D):Ke($)?(e.consume($),N):T($)}function D($){return $===c?(e.consume($),c=null,j):$===null||Be($)?n($):(e.consume($),D)}function T($){return $===null||$===34||$===39||$===47||$===60||$===61||$===62||$===96||wt($)?R($):(e.consume($),T)}function j($){return $===47||$===62||Ke($)?b($):n($)}function B($){return $===62?(e.consume($),z):n($)}function z($){return $===null||Be($)?V($):Ke($)?(e.consume($),z):n($)}function V($){return $===45&&a===2?(e.consume($),q):$===60&&a===1?(e.consume($),X):$===62&&a===4?(e.consume($),O):$===63&&a===3?(e.consume($),M):$===93&&a===5?(e.consume($),L):Be($)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(H5,U,F)($)):$===null||Be($)?(e.exit("htmlFlowData"),F($)):(e.consume($),V)}function F($){return e.check(F5,P,U)($)}function P($){return e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),Y}function Y($){return $===null||Be($)?F($):(e.enter("htmlFlowData"),V($))}function q($){return $===45?(e.consume($),M):V($)}function X($){return $===47?(e.consume($),u="",K):V($)}function K($){if($===62){const Q=u.toLowerCase();return y1.includes(Q)?(e.consume($),O):V($)}return sn($)&&u.length<8?(e.consume($),u+=String.fromCharCode($),K):V($)}function L($){return $===93?(e.consume($),M):V($)}function M($){return $===62?(e.consume($),O):$===45&&a===2?(e.consume($),M):V($)}function O($){return $===null||Be($)?(e.exit("htmlFlowData"),U($)):(e.consume($),O)}function U($){return e.exit("htmlFlow"),t($)}}function U5(e,t,n){const r=this;return a;function a(u){return Be(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):n(u)}function l(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}function G5(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(hl,t,n)}}const q5={name:"htmlText",tokenize:V5};function V5(e,t,n){const r=this;let a,l,u;return o;function o(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),c}function c(M){return M===33?(e.consume(M),f):M===47?(e.consume(M),R):M===63?(e.consume(M),b):sn(M)?(e.consume(M),T):n(M)}function f(M){return M===45?(e.consume(M),p):M===91?(e.consume(M),l=0,C):sn(M)?(e.consume(M),x):n(M)}function p(M){return M===45?(e.consume(M),_):n(M)}function d(M){return M===null?n(M):M===45?(e.consume(M),v):Be(M)?(u=d,X(M)):(e.consume(M),d)}function v(M){return M===45?(e.consume(M),_):d(M)}function _(M){return M===62?q(M):M===45?v(M):d(M)}function C(M){const O="CDATA[";return M===O.charCodeAt(l++)?(e.consume(M),l===O.length?w:C):n(M)}function w(M){return M===null?n(M):M===93?(e.consume(M),S):Be(M)?(u=w,X(M)):(e.consume(M),w)}function S(M){return M===93?(e.consume(M),y):w(M)}function y(M){return M===62?q(M):M===93?(e.consume(M),y):w(M)}function x(M){return M===null||M===62?q(M):Be(M)?(u=x,X(M)):(e.consume(M),x)}function b(M){return M===null?n(M):M===63?(e.consume(M),E):Be(M)?(u=b,X(M)):(e.consume(M),b)}function E(M){return M===62?q(M):b(M)}function R(M){return sn(M)?(e.consume(M),N):n(M)}function N(M){return M===45||Jt(M)?(e.consume(M),N):D(M)}function D(M){return Be(M)?(u=D,X(M)):Ke(M)?(e.consume(M),D):q(M)}function T(M){return M===45||Jt(M)?(e.consume(M),T):M===47||M===62||wt(M)?j(M):n(M)}function j(M){return M===47?(e.consume(M),q):M===58||M===95||sn(M)?(e.consume(M),B):Be(M)?(u=j,X(M)):Ke(M)?(e.consume(M),j):q(M)}function B(M){return M===45||M===46||M===58||M===95||Jt(M)?(e.consume(M),B):z(M)}function z(M){return M===61?(e.consume(M),V):Be(M)?(u=z,X(M)):Ke(M)?(e.consume(M),z):j(M)}function V(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),a=M,F):Be(M)?(u=V,X(M)):Ke(M)?(e.consume(M),V):(e.consume(M),P)}function F(M){return M===a?(e.consume(M),a=void 0,Y):M===null?n(M):Be(M)?(u=F,X(M)):(e.consume(M),F)}function P(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||wt(M)?j(M):(e.consume(M),P)}function Y(M){return M===47||M===62||wt(M)?j(M):n(M)}function q(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function X(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),K}function K(M){return Ke(M)?nt(e,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):L(M)}function L(M){return e.enter("htmlTextData"),u(M)}}const Pg={name:"labelEnd",resolveAll:K5,resolveTo:Z5,tokenize:Q5},Y5={tokenize:J5},W5={tokenize:e4},X5={tokenize:t4};function K5(e){let t=-1;const n=[];for(;++t=3&&(f===null||Be(f))?(e.exit("thematicBreak"),t(f)):n(f)}function c(f){return f===a?(e.consume(f),r++,c):(e.exit("thematicBreakSequence"),Ke(f)?nt(e,o,"whitespace")(f):o(f))}}const pn={continuation:{tokenize:h4},exit:d4,name:"list",tokenize:u4},l4={partial:!0,tokenize:p4},c4={partial:!0,tokenize:f4};function u4(e,t,n){const r=this,a=r.events[r.events.length-1];let l=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,u=0;return o;function o(_){const C=r.containerState.type||(_===42||_===43||_===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!r.containerState.marker||_===r.containerState.marker:Fp(_)){if(r.containerState.type||(r.containerState.type=C,e.enter(C,{_container:!0})),C==="listUnordered")return e.enter("listItemPrefix"),_===42||_===45?e.check(gu,n,f)(_):f(_);if(!r.interrupt||_===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(_)}return n(_)}function c(_){return Fp(_)&&++u<10?(e.consume(_),c):(!r.interrupt||u<2)&&(r.containerState.marker?_===r.containerState.marker:_===41||_===46)?(e.exit("listItemValue"),f(_)):n(_)}function f(_){return e.enter("listItemMarker"),e.consume(_),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||_,e.check(hl,r.interrupt?n:p,e.attempt(l4,v,d))}function p(_){return r.containerState.initialBlankLine=!0,l++,v(_)}function d(_){return Ke(_)?(e.enter("listItemPrefixWhitespace"),e.consume(_),e.exit("listItemPrefixWhitespace"),v):n(_)}function v(_){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(_)}}function h4(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(hl,a,l);function a(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,nt(e,t,"listItemIndent",r.containerState.size+1)(o)}function l(o){return r.containerState.furtherBlankLines||!Ke(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,u(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(c4,t,u)(o))}function u(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,nt(e,e.attempt(pn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function f4(e,t,n){const r=this;return nt(e,a,"listItemIndent",r.containerState.size+1);function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===r.containerState.size?t(l):n(l)}}function d4(e){e.exit(this.containerState.type)}function p4(e,t,n){const r=this;return nt(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(l){const u=r.events[r.events.length-1];return!Ke(l)&&u&&u[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const b1={name:"setextUnderline",resolveTo:g4,tokenize:m4};function g4(e,t){let n=e.length,r,a,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const u={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",l?(e.splice(a,0,["enter",u,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=u,e.push(["exit",u,t]),e}function m4(e,t,n){const r=this;let a;return l;function l(f){let p=r.events.length,d;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){d=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),a=f,u(f)):n(f)}function u(f){return e.enter("setextHeadingLineSequence"),o(f)}function o(f){return f===a?(e.consume(f),o):(e.exit("setextHeadingLineSequence"),Ke(f)?nt(e,c,"lineSuffix")(f):c(f))}function c(f){return f===null||Be(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const v4={tokenize:_4};function _4(e){const t=this,n=e.attempt(hl,r,e.attempt(this.parser.constructs.flowInitial,a,nt(e,e.attempt(this.parser.constructs.flow,a,e.attempt(w5,a)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const y4={resolveAll:qx()},b4=Gx("string"),S4=Gx("text");function Gx(e){return{resolveAll:qx(e==="text"?x4:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],l=n.attempt(a,u,o);return u;function u(p){return f(p)?l(p):o(p)}function o(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),c}function c(p){return f(p)?(n.exit("data"),l(p)):(n.consume(p),c)}function f(p){if(p===null)return!0;const d=a[p];let v=-1;if(d)for(;++v-1){const o=u[0];typeof o=="string"?u[0]=o.slice(r):u.shift()}l>0&&u.push(e[a].slice(0,l))}return u}function O4(e,t){let n=-1;const r=[];let a;for(;++n"");let n=t;try{const r=JSON.parse(t);r.error&&(n=r.error)}catch{}throw new Error(n||`HTTP ${e.status}`)}return await e.json()}const pt=e=>fetch(e).then(t=>ms(t)),jt=(e,t)=>fetch(e,{method:"POST",headers:t===void 0?{}:{"content-type":"application/json"},body:t===void 0?void 0:JSON.stringify(t)}).then(n=>ms(n)),hx=(e,t)=>fetch(e,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)}).then(n=>ms(n)),nT=()=>pt("/api/projects").then(e=>e.projects),iT=e=>jt("/api/projects",e).then(t=>t.project),rT=e=>pt(`/api/papers/search?q=${encodeURIComponent(e)}`).then(t=>t.papers),sT=e=>pt(`/api/papers/resolve?id=${encodeURIComponent(e)}`).then(t=>t.paper),aT=e=>jt(`/api/projects/${e}/open`).then(t=>t.project),oT=e=>fetch(`/api/projects/${e}`,{method:"DELETE"}).then(async t=>{if(!t.ok){const n=await t.json().catch(()=>null);throw new Error((n==null?void 0:n.error)??`delete failed (${t.status})`)}}),lT=e=>pt(`/api/projects/${e}/experiments`).then(t=>t.experiments),cT=e=>pt(`/api/projects/${e}/runs`).then(t=>t.runs),uT=()=>pt("/api/instances").then(e=>e.instances),fx=e=>jt(`/api/runs/${e}/cancel`),hT=(e,t)=>pt(`/api/runs/${e}/log?offset=${t}`),fT=e=>pt(`/api/experiments/${e}/commits`).then(t=>t.commits),dT=(e,t)=>pt(`/api/experiments/${e}/commits/${t}/diff`),Ky=e=>pt(`/api/projects/${e}/working-tree`),dx=(e,t=new URLSearchParams)=>(e.sessionId&&t.set("sessionId",e.sessionId),e.ref&&t.set("ref",e.ref),t),pT=(e,t,n={})=>pt(`/api/projects/${e}/file?${dx(n,new URLSearchParams({path:t}))}`),gT=(e,t={})=>{const n=dx(t).toString();return pt(`/api/projects/${e}/code-tree${n?`?${n}`:""}`)},Lg=(e,t,n)=>`https://github.com/${e}/${t}/tree/${n.split("/").map(encodeURIComponent).join("/")}`,mT=()=>pt("/api/settings/hf"),vT=e=>jt("/api/settings/hf",{token:e}),_T=()=>pt("/api/settings/k8s"),yT=e=>jt("/api/settings/k8s",e),bT=()=>pt("/api/settings/modal"),ST=()=>jt("/api/settings/modal/provision"),xT=()=>pt("/api/settings/env").then(e=>e.vars),px=(e,t)=>jt("/api/settings/env",{key:e,value:t}).then(n=>n.vars),wT=e=>fetch(`/api/settings/env/${encodeURIComponent(e)}`,{method:"DELETE"}).then(t=>ms(t)).then(t=>t.vars),gx=()=>pt("/api/settings/data-dir"),CT=e=>jt("/api/settings/data-dir/validate",{path:e}),ET=e=>jt("/api/settings/data-dir",{path:e}),kT=e=>jt("/api/settings/data-dir/move",{path:e}),AT=()=>pt("/api/settings/ssh").then(e=>e.hosts),NT=e=>jt("/api/settings/ssh/preflight",{host:e}),TT=()=>pt("/api/settings/slurm"),DT=e=>jt("/api/settings/slurm",e),RT=e=>jt("/api/settings/slurm/preflight",{host:e}),MT=()=>pt("/api/settings/compute"),mx=e=>jt("/api/settings/compute/default",e),jT=()=>pt("/api/settings/local"),LT=()=>pt("/api/settings/openresearch"),Zy=e=>pt(`/api/projects/${e}/files`),OT=(e,t)=>pt(`/api/projects/${e}/files/report?path=${encodeURIComponent(t)}`),BT=(e,t)=>fetch(`/api/projects/${e}/files?path=${encodeURIComponent(t)}`,{method:"DELETE"}).then(n=>ms(n)),Zu=(e,t)=>`/api/projects/${e}/files/file?path=${encodeURIComponent(t)}`,vx=()=>pt("/api/settings/git"),IT=e=>jt("/api/settings/git",e),zT=e=>jt("/api/settings/git/token",{token:e}),HT=()=>fetch("/api/settings/git/token",{method:"DELETE"}).then(e=>ms(e)),FT=()=>pt("/api/settings/telemetry"),PT=e=>jt("/api/settings/telemetry",{enabled:e}),$T=e=>jt("/api/settings/telemetry/consent",{enabled:e}),Og=(e=!1)=>pt(`/api/harnesses${e?"?refresh=1":""}`).then(t=>t.harnesses),UT=()=>pt("/api/skills").then(e=>e.skills);function Nu(e){const t=(e.split("/").pop()??e).replace(/^~/,"").replace(/^claude-/,""),n=[],r=[];for(const a of t.split("-"))/^\d+(\.\d+)?$/.test(a)?r.push(a):(r.length&&n.push(r.splice(0).join(".")),n.push(a==="gpt"?"GPT":a.charAt(0).toUpperCase()+a.slice(1)));return r.length&&n.push(r.join(".")),n.join(" ")}const Qy=e=>pt(`/api/chat/sessions?projectId=${encodeURIComponent(e)}`).then(t=>t.sessions),GT=(e,t,n={})=>jt("/api/chat/sessions",{projectId:e,harness:t,...n}).then(r=>r.session),qT=e=>fetch(`/api/chat/sessions/${e}`,{method:"DELETE"}).then(t=>ms(t)),VT=(e,t)=>hx(`/api/chat/sessions/${e}`,{archived:t}).then(n=>n.session),WT=(e,t)=>hx(`/api/chat/sessions/${e}`,{title:t}).then(n=>n.session),Jy=e=>pt(`/api/chat/sessions/${e}/messages`).then(t=>t.messages),YT=e=>`/api/chat/attachments/${encodeURIComponent(e)}`,XT=(e,t,n={},r)=>jt(`/api/chat/sessions/${e}/message`,{text:t,model:n.model,permissionMode:n.permissionMode,reasoningLevel:n.reasoningLevel,images:r}),KT=e=>jt(`/api/chat/sessions/${e}/interrupt`),ZT=(e,t)=>jt(`/api/chat/sessions/${e}/respond`,t);function Na(e){const t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return`${t}s ago`;const n=Math.floor(t/60);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function e1(e){const t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;const n=Math.floor(t/60);if(n<60)return`${n}m`;const r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d ${r%24}h`}function ls(e){const t=["B","KB","MB","GB","TB"];let n=e,r=0;for(;n>=1024&&r10?`${e.slice(0,10)}…`:e}function _x(e){return e?typeof e.kind=="string"?e.kind:typeof e.type=="string"?e.type:"":""}function yx(e){return e?typeof e.flavor=="string"&&e.flavor?e.flavor:typeof e.manifest=="string"&&e.manifest?e.manifest:typeof e.namespace=="string"&&e.namespace?e.namespace:"":""}function fa(){return g.jsxs("span",{className:"wordmark",children:[g.jsxs("svg",{viewBox:"0 0 100 100","aria-hidden":"true",children:[g.jsx("rect",{width:"100",height:"100",rx:"8",fill:"#9a2036"}),g.jsx("path",{d:"M15.375 16.782v63.843a4 4 0 0 0 4 4h63.843c3.564 0 5.348-4.309 2.829-6.828L22.203 13.953c-2.52-2.52-6.828-.735-6.828 2.829",fill:"#fff"})]}),"OpenResearch"]})}const gu=new Map;function QT(e,t){let n=gu.get(e);return n||(n=new Set,gu.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&gu.delete(e)}}function JT(e){var t;(t=gu.get(e.runId))==null||t.forEach(n=>n(e))}const Bp=new Set;function e3(e){return Bp.add(e),()=>{Bp.delete(e)}}function $c(e){Bp.forEach(t=>t(e))}const Ip=new Set;function t3(e){return Ip.add(e),()=>{Ip.delete(e)}}function Zd(e){Ip.forEach(t=>t(e))}function n3(e){const t=G.useRef(e);t.current=e,G.useEffect(()=>{const n=new EventSource("/api/events"),r=a=>{try{return JSON.parse(a.data)}catch{return null}};return n.addEventListener("run.updated",a=>{const l=r(a);l!=null&&l.run&&t.current.onRun(l.run)}),n.addEventListener("experiment.updated",a=>{const l=r(a);l!=null&&l.experiment&&t.current.onExperiment(l.experiment)}),n.addEventListener("project.updated",a=>{const l=r(a);l!=null&&l.project&&t.current.onProject(l.project)}),n.addEventListener("files.updated",a=>{var u,o;const l=r(a);l!=null&&l.projectId&&((o=(u=t.current).onFiles)==null||o.call(u,l.projectId))}),n.addEventListener("run.log",a=>{const l=r(a);l!=null&&l.runId&&JT(l)}),n.addEventListener("chat.session",a=>{const l=r(a);l!=null&&l.session&&$c({type:"session",session:l.session})}),n.addEventListener("chat.session.deleted",a=>{const l=r(a);l!=null&&l.sessionId&&$c({type:"sessionDeleted",sessionId:l.sessionId})}),n.addEventListener("chat.message",a=>{const l=r(a);l!=null&&l.message&&$c({type:"message",sessionId:l.sessionId,message:l.message})}),n.addEventListener("chat.busy",a=>{const l=r(a);l!=null&&l.sessionId&&$c({type:"busy",sessionId:l.sessionId,busy:l.busy})}),n.addEventListener("datadir.move.progress",a=>{const l=r(a);l&&Zd({type:"progress",...l})}),n.addEventListener("datadir.move.done",a=>{const l=r(a);l&&Zd({type:"done",path:l.path,oldPathLeft:l.oldPathLeft})}),n.addEventListener("datadir.move.error",a=>{const l=r(a);l&&Zd({type:"error",error:l.error})}),()=>n.close()},[])}function t1(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,l=!1;for(;!l;){r===-1&&(r=n.length,l=!0);const u=n.slice(a,r).trim();(u||!l)&&t.push(u),a=r+1,r=n.indexOf(",",a)}return t}function i3(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const r3=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,s3=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,a3={};function n1(e,t){return(a3.jsx?s3:r3).test(e)}const o3=/[ \t\n\f\r]/g;function l3(e){return typeof e=="object"?e.type==="text"?i1(e.value):!1:i1(e)}function i1(e){return e.replace(o3,"")===""}class hl{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}hl.prototype.normal={};hl.prototype.property={};hl.prototype.space=void 0;function bx(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new hl(n,r,t)}function qo(e){return e.toLowerCase()}class _n{constructor(t,n){this.attribute=n,this.property=t}}_n.prototype.attribute="";_n.prototype.booleanish=!1;_n.prototype.boolean=!1;_n.prototype.commaOrSpaceSeparated=!1;_n.prototype.commaSeparated=!1;_n.prototype.defined=!1;_n.prototype.mustUseProperty=!1;_n.prototype.number=!1;_n.prototype.overloadedBoolean=!1;_n.prototype.property="";_n.prototype.spaceSeparated=!1;_n.prototype.space=void 0;let c3=0;const ze=vs(),Pt=vs(),zp=vs(),Se=vs(),xt=vs(),ss=vs(),kn=vs();function vs(){return 2**++c3}const Hp=Object.freeze(Object.defineProperty({__proto__:null,boolean:ze,booleanish:Pt,commaOrSpaceSeparated:kn,commaSeparated:ss,number:Se,overloadedBoolean:zp,spaceSeparated:xt},Symbol.toStringTag,{value:"Module"})),Qd=Object.keys(Hp);class Bg extends _n{constructor(t,n,r,a){let l=-1;if(super(t,n),r1(this,"space",a),typeof r=="number")for(;++l4&&n.slice(0,4)==="data"&&p3.test(t)){if(t.charAt(4)==="-"){const l=t.slice(5).replace(s1,m3);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=t.slice(4);if(!s1.test(l)){let u=l.replace(d3,g3);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}a=Bg}return new a(r,t)}function g3(e){return"-"+e.toLowerCase()}function m3(e){return e.charAt(1).toUpperCase()}const Nx=bx([Sx,u3,Cx,Ex,kx],"html"),Qu=bx([Sx,h3,Cx,Ex,kx],"svg");function a1(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function v3(e){return e.join(" ").trim()}var ra={},Jd,o1;function _3(){if(o1)return Jd;o1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,l=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,o=/^\s+|\s+$/g,c=` +`,f="/",p="*",d="",v="comment",_="declaration";function C(S,y){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];y=y||{};var x=1,b=1;function E(P){var W=P.match(t);W&&(x+=W.length);var q=P.lastIndexOf(c);b=~q?P.length-q:b+P.length}function D(){var P={line:x,column:b};return function(W){return W.position=new N(P),j(),W}}function N(P){this.start=P,this.end={line:x,column:b},this.source=y.source}N.prototype.content=S;function R(P){var W=new Error(y.source+":"+x+":"+b+": "+P);if(W.reason=P,W.filename=y.source,W.line=x,W.column=b,W.source=S,!y.silent)throw W}function T(P){var W=P.exec(S);if(W){var q=W[0];return E(q),S=S.slice(q.length),W}}function j(){T(n)}function B(P){var W;for(P=P||[];W=z();)W!==!1&&P.push(W);return P}function z(){var P=D();if(!(f!=S.charAt(0)||p!=S.charAt(1))){for(var W=2;d!=S.charAt(W)&&(p!=S.charAt(W)||f!=S.charAt(W+1));)++W;if(W+=2,d===S.charAt(W-1))return R("End of comment missing");var q=S.slice(2,W-2);return b+=2,E(q),S=S.slice(W),b+=2,P({type:v,comment:q})}}function V(){var P=D(),W=T(r);if(W){if(z(),!T(a))return R("property missing ':'");var q=T(l),X=P({type:_,property:w(W[0].replace(e,d)),value:q?w(q[0].replace(e,d)):d});return T(u),X}}function F(){var P=[];B(P);for(var W;W=V();)W!==!1&&(P.push(W),B(P));return P}return j(),F()}function w(S){return S?S.replace(o,d):d}return Jd=C,Jd}var l1;function y3(){if(l1)return ra;l1=1;var e=ra&&ra.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ra,"__esModule",{value:!0}),ra.default=n;const t=e(_3());function n(r,a){let l=null;if(!r||typeof r!="string")return l;const u=(0,t.default)(r),o=typeof a=="function";return u.forEach(c=>{if(c.type!=="declaration")return;const{property:f,value:p}=c;o?a(f,p,c):p&&(l=l||{},l[f]=p)}),l}return ra}var Do={},c1;function b3(){if(c1)return Do;c1=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,l=function(f){return!f||n.test(f)||e.test(f)},u=function(f,p){return p.toUpperCase()},o=function(f,p){return"".concat(p,"-")},c=function(f,p){return p===void 0&&(p={}),l(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(a,o):f=f.replace(r,o),f.replace(t,u))};return Do.camelCase=c,Do}var Ro,u1;function S3(){if(u1)return Ro;u1=1;var e=Ro&&Ro.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(y3()),n=b3();function r(a,l){var u={};return!a||typeof a!="string"||(0,t.default)(a,function(o,c){o&&c&&(u[(0,n.camelCase)(o,l)]=c)}),u}return r.default=r,Ro=r,Ro}var x3=S3();const w3=Yu(x3),Tx=Dx("end"),Ig=Dx("start");function Dx(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 C3(e){const t=Ig(e),n=Tx(e);if(t&&n)return{start:t,end:n}}function Ho(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?h1(e.position):"start"in e||"end"in e?h1(e):"line"in e||"column"in e?Fp(e):""}function Fp(e){return f1(e&&e.line)+":"+f1(e&&e.column)}function h1(e){return Fp(e&&e.start)+"-"+Fp(e&&e.end)}function f1(e){return e&&typeof e=="number"?e:1}class en extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",l={},u=!1;if(n&&("line"in n&&"column"in n?l={place:n}:"start"in n&&"end"in n?l={place:n}:"type"in n?l={ancestors:[n],place:n.position}:l={...n}),typeof t=="string"?a=t:!l.cause&&t&&(u=!0,a=t.message,l.cause=t),!l.ruleId&&!l.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?l.ruleId=r:(l.source=r.slice(0,c),l.ruleId=r.slice(c+1))}if(!l.place&&l.ancestors&&l.ancestors){const c=l.ancestors[l.ancestors.length-1];c&&(l.place=c.position)}const o=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=o?o.line:void 0,this.name=Ho(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=u&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}en.prototype.file="";en.prototype.name="";en.prototype.reason="";en.prototype.message="";en.prototype.stack="";en.prototype.column=void 0;en.prototype.line=void 0;en.prototype.ancestors=void 0;en.prototype.cause=void 0;en.prototype.fatal=void 0;en.prototype.place=void 0;en.prototype.ruleId=void 0;en.prototype.source=void 0;const zg={}.hasOwnProperty,E3=new Map,k3=/[A-Z]/g,A3=new Set(["table","tbody","thead","tfoot","tr"]),N3=new Set(["td","th"]),Rx="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function T3(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=I3(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=B3(n,t.jsx,t.jsxs)}const a={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"?Qu:Nx,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},l=Mx(a,e,void 0);return l&&typeof l!="string"?l:a.create(e,a.Fragment,{children:l||void 0},void 0)}function Mx(e,t,n){if(t.type==="element")return D3(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return R3(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return j3(e,t,n);if(t.type==="mdxjsEsm")return M3(e,t);if(t.type==="root")return L3(e,t,n);if(t.type==="text")return O3(e,t)}function D3(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=Qu,e.schema=a),e.ancestors.push(t);const l=Lx(e,t.tagName,!1),u=z3(e,t);let o=Fg(e,t);return A3.has(t.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!l3(c):!0})),jx(e,u,l,t),Hg(u,o),e.ancestors.pop(),e.schema=r,e.create(t,l,u,n)}function R3(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)}Vo(e,t.position)}function M3(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Vo(e,t.position)}function j3(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=Qu,e.schema=a),e.ancestors.push(t);const l=t.name===null?e.Fragment:Lx(e,t.name,!0),u=H3(e,t),o=Fg(e,t);return jx(e,u,l,t),Hg(u,o),e.ancestors.pop(),e.schema=r,e.create(t,l,u,n)}function L3(e,t,n){const r={};return Hg(r,Fg(e,t)),e.create(t,e.Fragment,r,n)}function O3(e,t){return t.value}function jx(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Hg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function B3(e,t,n){return r;function r(a,l,u,o){const f=Array.isArray(u.children)?n:t;return o?f(l,u,o):f(l,u)}}function I3(e,t){return n;function n(r,a,l,u){const o=Array.isArray(l.children),c=Ig(r);return t(a,l,u,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function z3(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&zg.call(t.properties,a)){const l=F3(e,a,t.properties[a]);if(l){const[u,o]=l;e.tableCellAlignToStyle&&u==="align"&&typeof o=="string"&&N3.has(t.tagName)?r=o:n[u]=o}}if(r){const l=n.style||(n.style={});l[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function H3(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const l=r.data.estree.body[0];l.type;const u=l.expression;u.type;const o=u.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else Vo(e,t.position);else{const a=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,l=e.evaluater.evaluateExpression(o.expression)}else Vo(e,t.position);else l=r.value===null?!0:r.value;n[a]=l}return n}function Fg(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:E3;for(;++ra?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)u=Array.from(r),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);l0?(Tn(e,e.length,0,t),e):t}const g1={}.hasOwnProperty;function Bx(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 Jn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const sn=Rr(/[A-Za-z]/),Jt=Rr(/[\dA-Za-z]/),X3=Rr(/[#-'*+\--9=?A-Z^-~]/);function Tu(e){return e!==null&&(e<32||e===127)}const Pp=Rr(/\d/),K3=Rr(/[\dA-Fa-f]/),Z3=Rr(/[!-/:-@[-`{-~]/);function Be(e){return e!==null&&e<-2}function wt(e){return e!==null&&(e<0||e===32)}function Ke(e){return e===-2||e===-1||e===32}const Ju=Rr(new RegExp("\\p{P}|\\p{S}","u")),cs=Rr(/\s/);function Rr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Da(e){const t=[];let n=-1,r=0,a=0;for(;++n55295&&l<57344){const o=e.charCodeAt(n+1);l<56320&&o>56319&&o<57344?(u=String.fromCharCode(l,o),a=1):u="�"}else u=String.fromCharCode(l);u&&(t.push(e.slice(r,n),encodeURIComponent(u)),r=n+a+1,u=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function nt(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let l=0;return u;function u(c){return Ke(c)?(e.enter(n),o(c)):t(c)}function o(c){return Ke(c)&&l++u))return;const R=t.events.length;let T=R,j,B;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if(j){B=t.events[T][1].end;break}j=!0}for(y(r),N=R;Nb;){const D=n[E];t.containerState=D[1],D[0].exit.call(t,e)}n.length=b}function x(){a.write([null]),l=void 0,a=void 0,t.containerState._closeFlow=void 0}}function n5(e,t,n){return nt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ya(e){if(e===null||wt(e)||cs(e))return 1;if(Ju(e))return 2}function eh(e,t,n){const r=[];let a=-1;for(;++a1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},v={...e[n][1].start};v1(d,-c),v1(v,c),u={type:c>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},l={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:c>1?"strong":"emphasis",start:{...u.start},end:{...o.end}},e[r][1].end={...u.start},e[n][1].start={...o.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Gn(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Gn(f,[["enter",a,t],["enter",u,t],["exit",u,t],["enter",l,t]]),f=Gn(f,eh(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Gn(f,[["exit",l,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=Gn(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,Tn(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n0&&Ke(N)?nt(e,x,"linePrefix",l+1)(N):x(N)}function x(N){return N===null||Be(N)?e.check(_1,w,E)(N):(e.enter("codeFlowValue"),b(N))}function b(N){return N===null||Be(N)?(e.exit("codeFlowValue"),x(N)):(e.consume(N),b)}function E(N){return e.exit("codeFenced"),t(N)}function D(N,R,T){let j=0;return B;function B(W){return N.enter("lineEnding"),N.consume(W),N.exit("lineEnding"),z}function z(W){return N.enter("codeFencedFence"),Ke(W)?nt(N,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):V(W)}function V(W){return W===o?(N.enter("codeFencedFenceSequence"),F(W)):T(W)}function F(W){return W===o?(j++,N.consume(W),F):j>=u?(N.exit("codeFencedFenceSequence"),Ke(W)?nt(N,P,"whitespace")(W):P(W)):T(W)}function P(W){return W===null||Be(W)?(N.exit("codeFencedFence"),R(W)):T(W)}}}function p5(e,t,n){const r=this;return a;function a(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l)}function l(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}const tp={name:"codeIndented",tokenize:m5},g5={partial:!0,tokenize:v5};function m5(e,t,n){const r=this;return a;function a(f){return e.enter("codeIndented"),nt(e,l,"linePrefix",5)(f)}function l(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?u(f):n(f)}function u(f){return f===null?c(f):Be(f)?e.attempt(g5,u,c)(f):(e.enter("codeFlowValue"),o(f))}function o(f){return f===null||Be(f)?(e.exit("codeFlowValue"),u(f)):(e.consume(f),o)}function c(f){return e.exit("codeIndented"),t(f)}}function v5(e,t,n){const r=this;return a;function a(u){return r.parser.lazy[r.now().line]?n(u):Be(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a):nt(e,l,"linePrefix",5)(u)}function l(u){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(u):Be(u)?a(u):n(u)}}const _5={name:"codeText",previous:b5,resolve:y5,tokenize:S5};function y5(e){let t=e.length-4,n=3,r,a;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 a=n||0;this.setCursor(Math.trunc(t));const l=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&Mo(this.left,r),l.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),Mo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Mo(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(u):e.interrupt(r.parser.constructs.flow,n,t)(u)}}function $x(e,t,n,r,a,l,u,o,c){const f=c||Number.POSITIVE_INFINITY;let p=0;return d;function d(y){return y===60?(e.enter(r),e.enter(a),e.enter(l),e.consume(y),e.exit(l),v):y===null||y===32||y===41||Tu(y)?n(y):(e.enter(r),e.enter(u),e.enter(o),e.enter("chunkString",{contentType:"string"}),w(y))}function v(y){return y===62?(e.enter(l),e.consume(y),e.exit(l),e.exit(a),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),_(y))}function _(y){return y===62?(e.exit("chunkString"),e.exit(o),v(y)):y===null||y===60||Be(y)?n(y):(e.consume(y),y===92?C:_)}function C(y){return y===60||y===62||y===92?(e.consume(y),_):_(y)}function w(y){return!p&&(y===null||y===41||wt(y))?(e.exit("chunkString"),e.exit(o),e.exit(u),e.exit(r),t(y)):p999||_===null||_===91||_===93&&!c||_===94&&!o&&"_hiddenFootnoteSupport"in u.parser.constructs?n(_):_===93?(e.exit(l),e.enter(a),e.consume(_),e.exit(a),e.exit(r),t):Be(_)?(e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),d(_))}function d(_){return _===null||_===91||_===93||Be(_)||o++>999?(e.exit("chunkString"),p(_)):(e.consume(_),c||(c=!Ke(_)),_===92?v:d)}function v(_){return _===91||_===92||_===93?(e.consume(_),o++,d):d(_)}}function Gx(e,t,n,r,a,l){let u;return o;function o(v){return v===34||v===39||v===40?(e.enter(r),e.enter(a),e.consume(v),e.exit(a),u=v===40?41:v,c):n(v)}function c(v){return v===u?(e.enter(a),e.consume(v),e.exit(a),e.exit(r),t):(e.enter(l),f(v))}function f(v){return v===u?(e.exit(l),c(u)):v===null?n(v):Be(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),nt(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===u||v===null||Be(v)?(e.exit("chunkString"),f(v)):(e.consume(v),v===92?d:p)}function d(v){return v===u||v===92?(e.consume(v),p):p(v)}}function Fo(e,t){let n;return r;function r(a){return Be(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Ke(a)?nt(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const T5={name:"definition",tokenize:R5},D5={partial:!0,tokenize:M5};function R5(e,t,n){const r=this;let a;return l;function l(_){return e.enter("definition"),u(_)}function u(_){return Ux.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(_)}function o(_){return a=Jn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),_===58?(e.enter("definitionMarker"),e.consume(_),e.exit("definitionMarker"),c):n(_)}function c(_){return wt(_)?Fo(e,f)(_):f(_)}function f(_){return $x(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(_)}function p(_){return e.attempt(D5,d,d)(_)}function d(_){return Ke(_)?nt(e,v,"whitespace")(_):v(_)}function v(_){return _===null||Be(_)?(e.exit("definition"),r.parser.defined.push(a),t(_)):n(_)}}function M5(e,t,n){return r;function r(o){return wt(o)?Fo(e,a)(o):n(o)}function a(o){return Gx(e,l,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function l(o){return Ke(o)?nt(e,u,"whitespace")(o):u(o)}function u(o){return o===null||Be(o)?t(o):n(o)}}const j5={name:"hardBreakEscape",tokenize:L5};function L5(e,t,n){return r;function r(l){return e.enter("hardBreakEscape"),e.consume(l),a}function a(l){return Be(l)?(e.exit("hardBreakEscape"),t(l)):n(l)}}const O5={name:"headingAtx",resolve:B5,tokenize:I5};function B5(e,t){let n=e.length-2,r=3,a,l;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&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},l={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Tn(e,r,n-r+1,[["enter",a,t],["enter",l,t],["exit",l,t],["exit",a,t]])),e}function I5(e,t,n){let r=0;return a;function a(p){return e.enter("atxHeading"),l(p)}function l(p){return e.enter("atxHeadingSequence"),u(p)}function u(p){return p===35&&r++<6?(e.consume(p),u):p===null||wt(p)?(e.exit("atxHeadingSequence"),o(p)):n(p)}function o(p){return p===35?(e.enter("atxHeadingSequence"),c(p)):p===null||Be(p)?(e.exit("atxHeading"),t(p)):Ke(p)?nt(e,o,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function c(p){return p===35?(e.consume(p),c):(e.exit("atxHeadingSequence"),o(p))}function f(p){return p===null||p===35||wt(p)?(e.exit("atxHeadingText"),o(p)):(e.consume(p),f)}}const z5=["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"],b1=["pre","script","style","textarea"],H5={concrete:!0,name:"htmlFlow",resolveTo:$5,tokenize:U5},F5={partial:!0,tokenize:q5},P5={partial:!0,tokenize:G5};function $5(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 U5(e,t,n){const r=this;let a,l,u,o,c;return f;function f($){return p($)}function p($){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume($),d}function d($){return $===33?(e.consume($),v):$===47?(e.consume($),l=!0,w):$===63?(e.consume($),a=3,r.interrupt?t:M):sn($)?(e.consume($),u=String.fromCharCode($),S):n($)}function v($){return $===45?(e.consume($),a=2,_):$===91?(e.consume($),a=5,o=0,C):sn($)?(e.consume($),a=4,r.interrupt?t:M):n($)}function _($){return $===45?(e.consume($),r.interrupt?t:M):n($)}function C($){const Q="CDATA[";return $===Q.charCodeAt(o++)?(e.consume($),o===Q.length?r.interrupt?t:V:C):n($)}function w($){return sn($)?(e.consume($),u=String.fromCharCode($),S):n($)}function S($){if($===null||$===47||$===62||wt($)){const Q=$===47,re=u.toLowerCase();return!Q&&!l&&b1.includes(re)?(a=1,r.interrupt?t($):V($)):z5.includes(u.toLowerCase())?(a=6,Q?(e.consume($),y):r.interrupt?t($):V($)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n($):l?x($):b($))}return $===45||Jt($)?(e.consume($),u+=String.fromCharCode($),S):n($)}function y($){return $===62?(e.consume($),r.interrupt?t:V):n($)}function x($){return Ke($)?(e.consume($),x):B($)}function b($){return $===47?(e.consume($),B):$===58||$===95||sn($)?(e.consume($),E):Ke($)?(e.consume($),b):B($)}function E($){return $===45||$===46||$===58||$===95||Jt($)?(e.consume($),E):D($)}function D($){return $===61?(e.consume($),N):Ke($)?(e.consume($),D):b($)}function N($){return $===null||$===60||$===61||$===62||$===96?n($):$===34||$===39?(e.consume($),c=$,R):Ke($)?(e.consume($),N):T($)}function R($){return $===c?(e.consume($),c=null,j):$===null||Be($)?n($):(e.consume($),R)}function T($){return $===null||$===34||$===39||$===47||$===60||$===61||$===62||$===96||wt($)?D($):(e.consume($),T)}function j($){return $===47||$===62||Ke($)?b($):n($)}function B($){return $===62?(e.consume($),z):n($)}function z($){return $===null||Be($)?V($):Ke($)?(e.consume($),z):n($)}function V($){return $===45&&a===2?(e.consume($),q):$===60&&a===1?(e.consume($),X):$===62&&a===4?(e.consume($),O):$===63&&a===3?(e.consume($),M):$===93&&a===5?(e.consume($),L):Be($)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(F5,U,F)($)):$===null||Be($)?(e.exit("htmlFlowData"),F($)):(e.consume($),V)}function F($){return e.check(P5,P,U)($)}function P($){return e.enter("lineEnding"),e.consume($),e.exit("lineEnding"),W}function W($){return $===null||Be($)?F($):(e.enter("htmlFlowData"),V($))}function q($){return $===45?(e.consume($),M):V($)}function X($){return $===47?(e.consume($),u="",K):V($)}function K($){if($===62){const Q=u.toLowerCase();return b1.includes(Q)?(e.consume($),O):V($)}return sn($)&&u.length<8?(e.consume($),u+=String.fromCharCode($),K):V($)}function L($){return $===93?(e.consume($),M):V($)}function M($){return $===62?(e.consume($),O):$===45&&a===2?(e.consume($),M):V($)}function O($){return $===null||Be($)?(e.exit("htmlFlowData"),U($)):(e.consume($),O)}function U($){return e.exit("htmlFlow"),t($)}}function G5(e,t,n){const r=this;return a;function a(u){return Be(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),l):n(u)}function l(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}function q5(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(fl,t,n)}}const V5={name:"htmlText",tokenize:W5};function W5(e,t,n){const r=this;let a,l,u;return o;function o(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),c}function c(M){return M===33?(e.consume(M),f):M===47?(e.consume(M),D):M===63?(e.consume(M),b):sn(M)?(e.consume(M),T):n(M)}function f(M){return M===45?(e.consume(M),p):M===91?(e.consume(M),l=0,C):sn(M)?(e.consume(M),x):n(M)}function p(M){return M===45?(e.consume(M),_):n(M)}function d(M){return M===null?n(M):M===45?(e.consume(M),v):Be(M)?(u=d,X(M)):(e.consume(M),d)}function v(M){return M===45?(e.consume(M),_):d(M)}function _(M){return M===62?q(M):M===45?v(M):d(M)}function C(M){const O="CDATA[";return M===O.charCodeAt(l++)?(e.consume(M),l===O.length?w:C):n(M)}function w(M){return M===null?n(M):M===93?(e.consume(M),S):Be(M)?(u=w,X(M)):(e.consume(M),w)}function S(M){return M===93?(e.consume(M),y):w(M)}function y(M){return M===62?q(M):M===93?(e.consume(M),y):w(M)}function x(M){return M===null||M===62?q(M):Be(M)?(u=x,X(M)):(e.consume(M),x)}function b(M){return M===null?n(M):M===63?(e.consume(M),E):Be(M)?(u=b,X(M)):(e.consume(M),b)}function E(M){return M===62?q(M):b(M)}function D(M){return sn(M)?(e.consume(M),N):n(M)}function N(M){return M===45||Jt(M)?(e.consume(M),N):R(M)}function R(M){return Be(M)?(u=R,X(M)):Ke(M)?(e.consume(M),R):q(M)}function T(M){return M===45||Jt(M)?(e.consume(M),T):M===47||M===62||wt(M)?j(M):n(M)}function j(M){return M===47?(e.consume(M),q):M===58||M===95||sn(M)?(e.consume(M),B):Be(M)?(u=j,X(M)):Ke(M)?(e.consume(M),j):q(M)}function B(M){return M===45||M===46||M===58||M===95||Jt(M)?(e.consume(M),B):z(M)}function z(M){return M===61?(e.consume(M),V):Be(M)?(u=z,X(M)):Ke(M)?(e.consume(M),z):j(M)}function V(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),a=M,F):Be(M)?(u=V,X(M)):Ke(M)?(e.consume(M),V):(e.consume(M),P)}function F(M){return M===a?(e.consume(M),a=void 0,W):M===null?n(M):Be(M)?(u=F,X(M)):(e.consume(M),F)}function P(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||wt(M)?j(M):(e.consume(M),P)}function W(M){return M===47||M===62||wt(M)?j(M):n(M)}function q(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function X(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),K}function K(M){return Ke(M)?nt(e,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):L(M)}function L(M){return e.enter("htmlTextData"),u(M)}}const $g={name:"labelEnd",resolveAll:Z5,resolveTo:Q5,tokenize:J5},Y5={tokenize:e4},X5={tokenize:t4},K5={tokenize:n4};function Z5(e){let t=-1;const n=[];for(;++t=3&&(f===null||Be(f))?(e.exit("thematicBreak"),t(f)):n(f)}function c(f){return f===a?(e.consume(f),r++,c):(e.exit("thematicBreakSequence"),Ke(f)?nt(e,o,"whitespace")(f):o(f))}}const pn={continuation:{tokenize:f4},exit:p4,name:"list",tokenize:h4},c4={partial:!0,tokenize:g4},u4={partial:!0,tokenize:d4};function h4(e,t,n){const r=this,a=r.events[r.events.length-1];let l=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,u=0;return o;function o(_){const C=r.containerState.type||(_===42||_===43||_===45?"listUnordered":"listOrdered");if(C==="listUnordered"?!r.containerState.marker||_===r.containerState.marker:Pp(_)){if(r.containerState.type||(r.containerState.type=C,e.enter(C,{_container:!0})),C==="listUnordered")return e.enter("listItemPrefix"),_===42||_===45?e.check(mu,n,f)(_):f(_);if(!r.interrupt||_===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(_)}return n(_)}function c(_){return Pp(_)&&++u<10?(e.consume(_),c):(!r.interrupt||u<2)&&(r.containerState.marker?_===r.containerState.marker:_===41||_===46)?(e.exit("listItemValue"),f(_)):n(_)}function f(_){return e.enter("listItemMarker"),e.consume(_),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||_,e.check(fl,r.interrupt?n:p,e.attempt(c4,v,d))}function p(_){return r.containerState.initialBlankLine=!0,l++,v(_)}function d(_){return Ke(_)?(e.enter("listItemPrefixWhitespace"),e.consume(_),e.exit("listItemPrefixWhitespace"),v):n(_)}function v(_){return r.containerState.size=l+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(_)}}function f4(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(fl,a,l);function a(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,nt(e,t,"listItemIndent",r.containerState.size+1)(o)}function l(o){return r.containerState.furtherBlankLines||!Ke(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,u(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(u4,t,u)(o))}function u(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,nt(e,e.attempt(pn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function d4(e,t,n){const r=this;return nt(e,a,"listItemIndent",r.containerState.size+1);function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===r.containerState.size?t(l):n(l)}}function p4(e){e.exit(this.containerState.type)}function g4(e,t,n){const r=this;return nt(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(l){const u=r.events[r.events.length-1];return!Ke(l)&&u&&u[1].type==="listItemPrefixWhitespace"?t(l):n(l)}}const S1={name:"setextUnderline",resolveTo:m4,tokenize:v4};function m4(e,t){let n=e.length,r,a,l;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!l&&e[n][1].type==="definition"&&(l=n);const u={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",l?(e.splice(a,0,["enter",u,t]),e.splice(l+1,0,["exit",e[r][1],t]),e[r][1].end={...e[l][1].end}):e[r][1]=u,e.push(["exit",u,t]),e}function v4(e,t,n){const r=this;let a;return l;function l(f){let p=r.events.length,d;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){d=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),a=f,u(f)):n(f)}function u(f){return e.enter("setextHeadingLineSequence"),o(f)}function o(f){return f===a?(e.consume(f),o):(e.exit("setextHeadingLineSequence"),Ke(f)?nt(e,c,"lineSuffix")(f):c(f))}function c(f){return f===null||Be(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const _4={tokenize:y4};function y4(e){const t=this,n=e.attempt(fl,r,e.attempt(this.parser.constructs.flowInitial,a,nt(e,e.attempt(this.parser.constructs.flow,a,e.attempt(C5,a)),"linePrefix")));return n;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEndingBlank"),e.consume(l),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const b4={resolveAll:Vx()},S4=qx("string"),x4=qx("text");function qx(e){return{resolveAll:Vx(e==="text"?w4:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],l=n.attempt(a,u,o);return u;function u(p){return f(p)?l(p):o(p)}function o(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),c}function c(p){return f(p)?(n.exit("data"),l(p)):(n.consume(p),c)}function f(p){if(p===null)return!0;const d=a[p];let v=-1;if(d)for(;++v-1){const o=u[0];typeof o=="string"?u[0]=o.slice(r):u.shift()}l>0&&u.push(e[a].slice(0,l))}return u}function B4(e,t){let n=-1;const r=[];let a;for(;++n0){const De=ke.tokenStack[ke.tokenStack.length-1];(De[1]||x1).call(ke,void 0,De[0])}for(_e.position={start:Cr(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:Cr(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},be=-1;++be0&&(r.className=["language-"+a[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function X4(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function K4(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Z4(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=Ta(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let u,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),u=e.footnoteOrder.length):u=l+1,o+=1,e.footnoteCounts.set(r,o);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,c);const f={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,f),e.applyData(t,f)}function Q4(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 J4(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Wx(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 a=e.all(t),l=a[0];l&&l.type==="text"?l.value="["+l.value:a.unshift({type:"text",value:"["});const u=a[a.length-1];return u&&u.type==="text"?u.value+=r:a.push({type:"text",value:r}),a}function eR(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Wx(e,t);const a={src:Ta(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const l={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,l),e.applyData(t,l)}function tR(e,t){const n={src:Ta(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 nR(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 iR(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Wx(e,t);const a={href:Ta(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const l={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function rR(e,t){const n={href:Ta(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 sR(e,t,n){const r=e.all(t),a=n?aR(n):Xx(t),l={},u=[];if(typeof t.checked=="boolean"){const p=r[0];let d;p&&p.type==="element"&&p.tagName==="p"?d=p:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let o=-1;for(;++o0){const Re=ke.tokenStack[ke.tokenStack.length-1];(Re[1]||w1).call(ke,void 0,Re[0])}for(_e.position={start:Cr(ue.length>0?ue[0][1].start:{line:1,column:1,offset:0}),end:Cr(ue.length>0?ue[ue.length-2][1].end:{line:1,column:1,offset:0})},be=-1;++be0&&(r.className=["language-"+a[0]]);let l={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(l.data={meta:t.meta}),e.patch(t,l),l=e.applyData(t,l),l={type:"element",tagName:"pre",properties:{},children:[l]},e.patch(t,l),l}function K4(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Z4(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Q4(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=Da(r.toLowerCase()),l=e.footnoteOrder.indexOf(r);let u,o=e.footnoteCounts.get(r);o===void 0?(o=0,e.footnoteOrder.push(r),u=e.footnoteOrder.length):u=l+1,o+=1,e.footnoteCounts.set(r,o);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,c);const f={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,f),e.applyData(t,f)}function J4(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 eD(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Xx(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 a=e.all(t),l=a[0];l&&l.type==="text"?l.value="["+l.value:a.unshift({type:"text",value:"["});const u=a[a.length-1];return u&&u.type==="text"?u.value+=r:a.push({type:"text",value:r}),a}function tD(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Xx(e,t);const a={src:Da(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const l={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,l),e.applyData(t,l)}function nD(e,t){const n={src:Da(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 iD(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 rD(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Xx(e,t);const a={href:Da(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const l={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,l),e.applyData(t,l)}function sD(e,t){const n={href:Da(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 aD(e,t,n){const r=e.all(t),a=n?oD(n):Kx(t),l={},u=[];if(typeof t.checked=="boolean"){const p=r[0];let d;p&&p.type==="element"&&p.tagName==="p"?d=p:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),l.className=["task-list-item"]}let o=-1;for(;++o1}function oR(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Bg(t.children[1]),c=Nx(t.children[t.children.length-1]);o&&c&&(u.position={start:o,end:c}),a.push(u)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,l),e.applyData(t,l)}function fR(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,o=u?u.length:t.children.length;let c=-1;const f=[];for(;++c0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return l.push(E1(t.slice(a),a>0,!1)),l.join("")}function E1(e,t,n){let r=0,a=e.length;if(t){let l=e.codePointAt(r);for(;l===w1||l===C1;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(a-1);for(;l===w1||l===C1;)a--,l=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function gR(e,t){const n={type:"text",value:pR(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function mR(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const vR={blockquote:V4,break:Y4,code:W4,delete:X4,emphasis:K4,footnoteReference:Z4,heading:Q4,html:J4,imageReference:eR,image:tR,inlineCode:nR,linkReference:iR,link:rR,listItem:sR,list:oR,paragraph:lR,root:cR,strong:uR,table:hR,tableCell:dR,tableRow:fR,text:gR,thematicBreak:mR,toml:$c,yaml:$c,definition:$c,footnoteDefinition:$c};function $c(){}const Kx=-1,eh=0,Fo=1,Tu=2,$g=3,Ug=4,Gg=5,qg=6,Zx=7,Qx=8,_R=typeof self=="object"?self:globalThis,k1=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new _R[e](t)},yR=(e,t)=>{const n=(a,l)=>(e.set(l,a),a),r=a=>{if(e.has(a))return e.get(a);const[l,u]=t[a];switch(l){case eh:case Kx:return n(u,a);case Fo:{const o=n([],a);for(const c of u)o.push(r(c));return o}case Tu:{const o=n({},a);for(const[c,f]of u)o[r(c)]=r(f);return o}case $g:return n(new Date(u),a);case Ug:{const{source:o,flags:c}=u;return n(new RegExp(o,c),a)}case Gg:{const o=n(new Map,a);for(const[c,f]of u)o.set(r(c),r(f));return o}case qg:{const o=n(new Set,a);for(const c of u)o.add(r(c));return o}case Zx:{const{name:o,message:c}=u;return n(k1(o,c),a)}case Qx:return n(BigInt(u),a);case"BigInt":return n(Object(BigInt(u)),a);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:o}=new Uint8Array(u);return n(new DataView(o),u)}}return n(k1(l,u),a)};return r},A1=e=>yR(new Map,e)(0),ts="",{toString:bR}={},{keys:SR}=Object,Mo=e=>{const t=typeof e;if(t!=="object"||!e)return[eh,t];const n=bR.call(e).slice(8,-1);switch(n){case"Array":return[Fo,ts];case"Object":return[Tu,ts];case"Date":return[$g,ts];case"RegExp":return[Ug,ts];case"Map":return[Gg,ts];case"Set":return[qg,ts];case"DataView":return[Fo,n]}return n.includes("Array")?[Fo,n]:n.includes("Error")?[Zx,n]:[Tu,n]},Uc=([e,t])=>e===eh&&(t==="function"||t==="symbol"),xR=(e,t,n,r)=>{const a=(u,o)=>{const c=r.push(u)-1;return n.set(o,c),c},l=u=>{if(n.has(u))return n.get(u);let[o,c]=Mo(u);switch(o){case eh:{let p=u;switch(c){case"bigint":o=Qx,p=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return a([Kx],u)}return a([o,p],u)}case Fo:{if(c){let v=u;return c==="DataView"?v=new Uint8Array(u.buffer):c==="ArrayBuffer"&&(v=new Uint8Array(u)),a([c,[...v]],u)}const p=[],d=a([o,p],u);for(const v of u)p.push(l(v));return d}case Tu:{if(c)switch(c){case"BigInt":return a([c,u.toString()],u);case"Boolean":case"Number":case"String":return a([c,u.valueOf()],u)}if(t&&"toJSON"in u)return l(u.toJSON());const p=[],d=a([o,p],u);for(const v of SR(u))(e||!Uc(Mo(u[v])))&&p.push([l(v),l(u[v])]);return d}case $g:return a([o,isNaN(u.getTime())?ts:u.toISOString()],u);case Ug:{const{source:p,flags:d}=u;return a([o,{source:p,flags:d}],u)}case Gg:{const p=[],d=a([o,p],u);for(const[v,_]of u)(e||!(Uc(Mo(v))||Uc(Mo(_))))&&p.push([l(v),l(_)]);return d}case qg:{const p=[],d=a([o,p],u);for(const v of u)(e||!Uc(Mo(v)))&&p.push(l(v));return d}}const{message:f}=u;return a([o,{name:c,message:f}],u)};return l},N1=(e,{json:t,lossy:n}={})=>{const r=[];return xR(!(t||n),!!t,new Map,r)(e),r},Ru=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?A1(N1(e,t)):structuredClone(e):(e,t)=>A1(N1(e,t));function wR(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 CR(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function ER(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||wR,r=e.options.footnoteBackLabel||CR,a=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c0&&C.push({type:"text",value:" "});let x=typeof n=="string"?n:n(c,_);typeof x=="string"&&(x={type:"text",value:x}),C.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(_>1?"-"+_:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,_),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const S=p[p.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const x=S.children[S.children.length-1];x&&x.type==="text"?x.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...C)}else p.push(...C);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(p,!0)};e.patch(f,y),o.push(y)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Ru(u),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:` +`});const f={type:"element",tagName:"li",properties:l,children:u};return e.patch(t,f),e.applyData(t,f)}function oD(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r1}function lD(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=Ig(t.children[1]),c=Tx(t.children[t.children.length-1]);o&&c&&(u.position={start:o,end:c}),a.push(u)}const l={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,l),e.applyData(t,l)}function dD(e,t,n){const r=n?n.children:void 0,l=(r?r.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,o=u?u.length:t.children.length;let c=-1;const f=[];for(;++c0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return l.push(k1(t.slice(a),a>0,!1)),l.join("")}function k1(e,t,n){let r=0,a=e.length;if(t){let l=e.codePointAt(r);for(;l===C1||l===E1;)r++,l=e.codePointAt(r)}if(n){let l=e.codePointAt(a-1);for(;l===C1||l===E1;)a--,l=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function mD(e,t){const n={type:"text",value:gD(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function vD(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const _D={blockquote:W4,break:Y4,code:X4,delete:K4,emphasis:Z4,footnoteReference:Q4,heading:J4,html:eD,imageReference:tD,image:nD,inlineCode:iD,linkReference:rD,link:sD,listItem:aD,list:lD,paragraph:cD,root:uD,strong:hD,table:fD,tableCell:pD,tableRow:dD,text:mD,thematicBreak:vD,toml:Uc,yaml:Uc,definition:Uc,footnoteDefinition:Uc};function Uc(){}const Zx=-1,th=0,Po=1,Du=2,Ug=3,Gg=4,qg=5,Vg=6,Qx=7,Jx=8,yD=typeof self=="object"?self:globalThis,A1=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new yD[e](t)},bD=(e,t)=>{const n=(a,l)=>(e.set(l,a),a),r=a=>{if(e.has(a))return e.get(a);const[l,u]=t[a];switch(l){case th:case Zx:return n(u,a);case Po:{const o=n([],a);for(const c of u)o.push(r(c));return o}case Du:{const o=n({},a);for(const[c,f]of u)o[r(c)]=r(f);return o}case Ug:return n(new Date(u),a);case Gg:{const{source:o,flags:c}=u;return n(new RegExp(o,c),a)}case qg:{const o=n(new Map,a);for(const[c,f]of u)o.set(r(c),r(f));return o}case Vg:{const o=n(new Set,a);for(const c of u)o.add(r(c));return o}case Qx:{const{name:o,message:c}=u;return n(A1(o,c),a)}case Jx:return n(BigInt(u),a);case"BigInt":return n(Object(BigInt(u)),a);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:o}=new Uint8Array(u);return n(new DataView(o),u)}}return n(A1(l,u),a)};return r},N1=e=>bD(new Map,e)(0),ts="",{toString:SD}={},{keys:xD}=Object,jo=e=>{const t=typeof e;if(t!=="object"||!e)return[th,t];const n=SD.call(e).slice(8,-1);switch(n){case"Array":return[Po,ts];case"Object":return[Du,ts];case"Date":return[Ug,ts];case"RegExp":return[Gg,ts];case"Map":return[qg,ts];case"Set":return[Vg,ts];case"DataView":return[Po,n]}return n.includes("Array")?[Po,n]:n.includes("Error")?[Qx,n]:[Du,n]},Gc=([e,t])=>e===th&&(t==="function"||t==="symbol"),wD=(e,t,n,r)=>{const a=(u,o)=>{const c=r.push(u)-1;return n.set(o,c),c},l=u=>{if(n.has(u))return n.get(u);let[o,c]=jo(u);switch(o){case th:{let p=u;switch(c){case"bigint":o=Jx,p=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);p=null;break;case"undefined":return a([Zx],u)}return a([o,p],u)}case Po:{if(c){let v=u;return c==="DataView"?v=new Uint8Array(u.buffer):c==="ArrayBuffer"&&(v=new Uint8Array(u)),a([c,[...v]],u)}const p=[],d=a([o,p],u);for(const v of u)p.push(l(v));return d}case Du:{if(c)switch(c){case"BigInt":return a([c,u.toString()],u);case"Boolean":case"Number":case"String":return a([c,u.valueOf()],u)}if(t&&"toJSON"in u)return l(u.toJSON());const p=[],d=a([o,p],u);for(const v of xD(u))(e||!Gc(jo(u[v])))&&p.push([l(v),l(u[v])]);return d}case Ug:return a([o,isNaN(u.getTime())?ts:u.toISOString()],u);case Gg:{const{source:p,flags:d}=u;return a([o,{source:p,flags:d}],u)}case qg:{const p=[],d=a([o,p],u);for(const[v,_]of u)(e||!(Gc(jo(v))||Gc(jo(_))))&&p.push([l(v),l(_)]);return d}case Vg:{const p=[],d=a([o,p],u);for(const v of u)(e||!Gc(jo(v)))&&p.push(l(v));return d}}const{message:f}=u;return a([o,{name:c,message:f}],u)};return l},T1=(e,{json:t,lossy:n}={})=>{const r=[];return wD(!(t||n),!!t,new Map,r)(e),r},Ru=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?N1(T1(e,t)):structuredClone(e):(e,t)=>N1(T1(e,t));function CD(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 ED(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function kD(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||CD,r=e.options.footnoteBackLabel||ED,a=e.options.footnoteLabel||"Footnotes",l=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c0&&C.push({type:"text",value:" "});let x=typeof n=="string"?n:n(c,_);typeof x=="string"&&(x={type:"text",value:x}),C.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(_>1?"-"+_:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,_),className:["data-footnote-backref"]},children:Array.isArray(x)?x:[x]})}const S=p[p.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const x=S.children[S.children.length-1];x&&x.type==="text"?x.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...C)}else p.push(...C);const y={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(p,!0)};e.patch(f,y),o.push(y)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:l,properties:{...Ru(u),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(o,!0)},{type:"text",value:` -`}]}}const th=(function(e){if(e==null)return TR;if(typeof e=="function")return nh(e);if(typeof e=="object")return Array.isArray(e)?kR(e):AR(e);if(typeof e=="string")return NR(e);throw new Error("Expected function, string, or object as test")});function kR(e){const t=[];let n=-1;for(;++n":""))+")"})}return v;function v(){let _=Jx,C,w,S;if((!t||l(c,f,p[p.length-1]||void 0))&&(_=jR(n(c,p)),_[0]===$p))return _;if("children"in c&&c.children){const y=c;if(y.children&&_[0]!==MR)for(w=(r?y.children.length:-1)+u,S=p.concat(y);w>-1&&w":""))+")"})}return v;function v(){let _=ew,C,w,S;if((!t||l(c,f,p[p.length-1]||void 0))&&(_=LD(n(c,p)),_[0]===Up))return _;if("children"in c&&c.children){const y=c;if(y.children&&_[0]!==jD)for(w=(r?y.children.length:-1)+u,S=p.concat(y);w>-1&&w0&&n.push({type:"text",value:` -`}),n}function T1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function R1(e,t){const n=OR(e,t),r=n.one(e,void 0),a=ER(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&l.children.push({type:"text",value:` -`},a),l}function FR(e,t){return e&&"run"in e?async function(n,r){const a=R1(n,{file:r,...t});await e.run(a,r)}:function(n,r){return R1(n,{file:r,...e||t})}}function D1(e){if(e)throw e}var np,M1;function PR(){if(M1)return np;M1=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},l=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),d=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!d)return!1;var v;for(v in f);return typeof v>"u"||e.call(f,v)},u=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},o=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return np=function c(){var f,p,d,v,_,C,w=arguments[0],S=1,y=arguments.length,x=!1;for(typeof w=="boolean"&&(x=w,w=arguments[1]||{},S=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});Su.length;let c;o&&u.push(a);try{c=e.apply(this,u)}catch(f){const p=f;if(o&&n)throw p;return a(p)}o||(c&&c.then&&typeof c.then=="function"?c.then(l,a):c instanceof Error?a(c):l(c))}function a(u,...o){n||(n=!0,t(u,...o))}function l(u){a(null,u)}}const ci={basename:qR,dirname:VR,extname:YR,join:WR,sep:"/"};function qR(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');fl(e);let n=0,r=-1,a=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else r<0&&(l=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let u=-1,o=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else u<0&&(l=!0,u=a+1),o>-1&&(e.codePointAt(a)===t.codePointAt(o--)?o<0&&(r=a):(o=-1,r=u));return n===r?r=u:r<0&&(r=e.length),e.slice(n,r)}function VR(e){if(fl(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 YR(e){fl(e);let t=e.length,n=-1,r=0,a=-1,l=0,u;for(;t--;){const o=e.codePointAt(t);if(o===47){if(u){r=t+1;break}continue}n<0&&(u=!0,n=t+1),o===46?a<0?a=t:l!==1&&(l=1):a>-1&&(l=-1)}return a<0||n<0||l===0||l===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function WR(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function KR(e,t){let n="",r=0,a=-1,l=0,u=-1,o,c;for(;++u<=e.length;){if(u2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),a=u,l=0;continue}}else if(n.length>0){n="",r=0,a=u,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,u):n=e.slice(a+1,u),r=u-a-1;a=u,l=0}else o===46&&l>-1?l++:l=-1}return n}function fl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const ZR={cwd:QR};function QR(){return"/"}function qp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function JR(e){if(typeof e=="string")e=new URL(e);else if(!qp(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 eD(e)}function eD(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[_,...C]=p;const w=r[v][1];Gp(w)&&Gp(_)&&(_=ip(!0,w,_)),r[v]=[f,_,...C]}}}}const rD=new Yg().freeze();function op(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function lp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function cp(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 L1(e){if(!Gp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function O1(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Gc(e){return sD(e)?e:new tw(e)}function sD(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function aD(e){return typeof e=="string"||oD(e)}function oD(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const lD="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",B1=[],I1={allowDangerousHtml:!0},cD=/^(https?|ircs?|mailto|xmpp)$/i,uD=[{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 nw(e){const t=hD(e),n=fD(e);return dD(t.runSync(t.parse(n),n),e)}function hD(e){const t=e.rehypePlugins||B1,n=e.remarkPlugins||B1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...I1}:I1;return rD().use(q4).use(n).use(FR,r).use(t)}function fD(e){const t=e.children||"",n=new tw;return typeof t=="string"&&(n.value=t),n}function dD(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,l=t.disallowedElements,u=t.skipHtml,o=t.unwrapDisallowed,c=t.urlTransform||pD;for(const p of uD)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+lD+p.id,void 0);return Vg(e,f),N3(e,{Fragment:g.Fragment,components:a,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function f(p,d,v){if(p.type==="raw"&&v&&typeof d=="number")return u?v.children.splice(d,1):v.children[d]={type:"text",value:p.value},d;if(p.type==="element"){let _;for(_ in Jd)if(Object.hasOwn(Jd,_)&&Object.hasOwn(p.properties,_)){const C=p.properties[_],w=Jd[_];(w===null||w.includes(p.tagName))&&(p.properties[_]=c(String(C||""),_,p))}}if(p.type==="element"){let _=n?!n.includes(p.tagName):l?l.includes(p.tagName):!1;if(!_&&r&&typeof d=="number"&&(_=!r(p,d,v)),_&&v&&typeof d=="number")return o&&p.children?v.children.splice(d,1,...p.children):v.children.splice(d,1),d}}}function pD(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||cD.test(e.slice(0,t))?e:""}function z1(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function gD(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function mD(e,t,n){const a=th((n||{}).ignore||[]),l=vD(t);let u=-1;for(;++u0?{type:"text",value:N}:void 0),N===!1?v.lastIndex=E+1:(C!==E&&x.push({type:"text",value:f.value.slice(C,E)}),Array.isArray(N)?x.push(...N):N&&x.push(N),C=E+b[0].length,y=!0),!v.global)break;b=v.exec(f.value)}return y?(C?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=z1(e,"(");let l=z1(e,")");for(;r!==-1&&a>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function iw(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||cs(n)||Qu(n))&&(!t||n!==47)}rw.peek=FD;function MD(){this.buffer()}function jD(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function LD(){this.buffer()}function OD(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function BD(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function ID(e){this.exit(e)}function zD(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function HD(e){this.exit(e)}function FD(){return"["}function rw(e,t,n,r){const a=n.createTracker(r);let l=a.move("[^");const u=n.enter("footnoteReference"),o=n.enter("reference");return l+=a.move(n.safe(n.associationId(e),{after:"]",before:l})),o(),u(),l+=a.move("]"),l}function PD(){return{enter:{gfmFootnoteCallString:MD,gfmFootnoteCall:jD,gfmFootnoteDefinitionLabelString:LD,gfmFootnoteDefinition:OD},exit:{gfmFootnoteCallString:BD,gfmFootnoteCall:ID,gfmFootnoteDefinitionLabelString:zD,gfmFootnoteDefinition:HD}}}function $D(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:rw},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,l,u){const o=l.createTracker(u);let c=o.move("[^");const f=l.enter("footnoteDefinition"),p=l.enter("label");return c+=o.move(l.safe(l.associationId(r),{before:c,after:"]"})),p(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((t?` -`:" ")+l.indentLines(l.containerFlow(r,o.current()),t?sw:UD))),f(),c}}function UD(e,t,n){return t===0?e:sw(e,t,n)}function sw(e,t,n){return(n?"":" ")+e}const GD=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];aw.peek=XD;function qD(){return{canContainEols:["delete"],enter:{strikethrough:YD},exit:{strikethrough:WD}}}function VD(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:GD}],handlers:{delete:aw}}}function YD(e){this.enter({type:"delete",children:[]},e)}function WD(e){this.exit(e)}function aw(e,t,n,r){const a=n.createTracker(r),l=n.enter("strikethrough");let u=a.move("~~");return u+=n.containerPhrasing(e,{...a.current(),before:u,after:"~"}),u+=a.move("~~"),l(),u}function XD(){return"~"}function KD(e){return e.length}function ZD(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||KD,l=[],u=[],o=[],c=[];let f=0,p=-1;for(;++pf&&(f=e[p].length);++yc[y])&&(c[y]=b)}w.push(x)}u[p]=w,o[p]=S}let d=-1;if(typeof r=="object"&&"length"in r)for(;++dc[d]&&(c[d]=x),_[d]=x),v[d]=b}u.splice(1,0,v),o.splice(1,0,_),p=-1;const C=[];for(;++p "),l.shift(2);const u=n.indentLines(n.containerFlow(e,l.current()),eM);return a(),u}function eM(e,t,n){return">"+(n?"":" ")+e}function tM(e,t){return F1(e,t.inConstruct,!0)&&!F1(e,t.notInConstruct,!1)}function F1(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ru&&(u=l):l=1,a=r+t.length,r=n.indexOf(t,a);return u}function iM(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 rM(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 sM(e,t,n,r){const a=rM(n),l=e.value||"",u=a==="`"?"GraveAccent":"Tilde";if(iM(e,n)){const d=n.enter("codeIndented"),v=n.indentLines(l,aM);return d(),v}const o=n.createTracker(r),c=a.repeat(Math.max(nM(l,a)+1,3)),f=n.enter("codeFenced");let p=o.move(c);if(e.lang){const d=n.enter(`codeFencedLang${u}`);p+=o.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...o.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${u}`);p+=o.move(" "),p+=o.move(n.safe(e.meta,{before:p,after:` +`}),n}function D1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function R1(e,t){const n=BD(e,t),r=n.one(e,void 0),a=kD(n),l=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&l.children.push({type:"text",value:` +`},a),l}function PD(e,t){return e&&"run"in e?async function(n,r){const a=R1(n,{file:r,...t});await e.run(a,r)}:function(n,r){return R1(n,{file:r,...e||t})}}function M1(e){if(e)throw e}var ip,j1;function $D(){if(j1)return ip;j1=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},l=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),d=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!d)return!1;var v;for(v in f);return typeof v>"u"||e.call(f,v)},u=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},o=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return ip=function c(){var f,p,d,v,_,C,w=arguments[0],S=1,y=arguments.length,x=!1;for(typeof w=="boolean"&&(x=w,w=arguments[1]||{},S=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});Su.length;let c;o&&u.push(a);try{c=e.apply(this,u)}catch(f){const p=f;if(o&&n)throw p;return a(p)}o||(c&&c.then&&typeof c.then=="function"?c.then(l,a):c instanceof Error?a(c):l(c))}function a(u,...o){n||(n=!0,t(u,...o))}function l(u){a(null,u)}}const ci={basename:VD,dirname:WD,extname:YD,join:XD,sep:"/"};function VD(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');dl(e);let n=0,r=-1,a=e.length,l;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else r<0&&(l=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let u=-1,o=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(l){n=a+1;break}}else u<0&&(l=!0,u=a+1),o>-1&&(e.codePointAt(a)===t.codePointAt(o--)?o<0&&(r=a):(o=-1,r=u));return n===r?r=u:r<0&&(r=e.length),e.slice(n,r)}function WD(e){if(dl(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 YD(e){dl(e);let t=e.length,n=-1,r=0,a=-1,l=0,u;for(;t--;){const o=e.codePointAt(t);if(o===47){if(u){r=t+1;break}continue}n<0&&(u=!0,n=t+1),o===46?a<0?a=t:l!==1&&(l=1):a>-1&&(l=-1)}return a<0||n<0||l===0||l===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function XD(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function ZD(e,t){let n="",r=0,a=-1,l=0,u=-1,o,c;for(;++u<=e.length;){if(u2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),a=u,l=0;continue}}else if(n.length>0){n="",r=0,a=u,l=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,u):n=e.slice(a+1,u),r=u-a-1;a=u,l=0}else o===46&&l>-1?l++:l=-1}return n}function dl(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const QD={cwd:JD};function JD(){return"/"}function Vp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function eR(e){if(typeof e=="string")e=new URL(e);else if(!Vp(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 tR(e)}function tR(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[_,...C]=p;const w=r[v][1];qp(w)&&qp(_)&&(_=rp(!0,w,_)),r[v]=[f,_,...C]}}}}const sR=new Yg().freeze();function lp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function cp(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function up(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 O1(e){if(!qp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function B1(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function qc(e){return aR(e)?e:new nw(e)}function aR(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function oR(e){return typeof e=="string"||lR(e)}function lR(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const cR="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",I1=[],z1={allowDangerousHtml:!0},uR=/^(https?|ircs?|mailto|xmpp)$/i,hR=[{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 iw(e){const t=fR(e),n=dR(e);return pR(t.runSync(t.parse(n),n),e)}function fR(e){const t=e.rehypePlugins||I1,n=e.remarkPlugins||I1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...z1}:z1;return sR().use(V4).use(n).use(PD,r).use(t)}function dR(e){const t=e.children||"",n=new nw;return typeof t=="string"&&(n.value=t),n}function pR(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,l=t.disallowedElements,u=t.skipHtml,o=t.unwrapDisallowed,c=t.urlTransform||gR;for(const p of hR)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+cR+p.id,void 0);return Wg(e,f),T3(e,{Fragment:g.Fragment,components:a,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function f(p,d,v){if(p.type==="raw"&&v&&typeof d=="number")return u?v.children.splice(d,1):v.children[d]={type:"text",value:p.value},d;if(p.type==="element"){let _;for(_ in ep)if(Object.hasOwn(ep,_)&&Object.hasOwn(p.properties,_)){const C=p.properties[_],w=ep[_];(w===null||w.includes(p.tagName))&&(p.properties[_]=c(String(C||""),_,p))}}if(p.type==="element"){let _=n?!n.includes(p.tagName):l?l.includes(p.tagName):!1;if(!_&&r&&typeof d=="number"&&(_=!r(p,d,v)),_&&v&&typeof d=="number")return o&&p.children?v.children.splice(d,1,...p.children):v.children.splice(d,1),d}}}function gR(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||uR.test(e.slice(0,t))?e:""}function H1(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function mR(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function vR(e,t,n){const a=nh((n||{}).ignore||[]),l=_R(t);let u=-1;for(;++u0?{type:"text",value:N}:void 0),N===!1?v.lastIndex=E+1:(C!==E&&x.push({type:"text",value:f.value.slice(C,E)}),Array.isArray(N)?x.push(...N):N&&x.push(N),C=E+b[0].length,y=!0),!v.global)break;b=v.exec(f.value)}return y?(C?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=H1(e,"(");let l=H1(e,")");for(;r!==-1&&a>l;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),l++;return[e,n]}function rw(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||cs(n)||Ju(n))&&(!t||n!==47)}sw.peek=PR;function jR(){this.buffer()}function LR(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function OR(){this.buffer()}function BR(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function IR(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function zR(e){this.exit(e)}function HR(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Jn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function FR(e){this.exit(e)}function PR(){return"["}function sw(e,t,n,r){const a=n.createTracker(r);let l=a.move("[^");const u=n.enter("footnoteReference"),o=n.enter("reference");return l+=a.move(n.safe(n.associationId(e),{after:"]",before:l})),o(),u(),l+=a.move("]"),l}function $R(){return{enter:{gfmFootnoteCallString:jR,gfmFootnoteCall:LR,gfmFootnoteDefinitionLabelString:OR,gfmFootnoteDefinition:BR},exit:{gfmFootnoteCallString:IR,gfmFootnoteCall:zR,gfmFootnoteDefinitionLabelString:HR,gfmFootnoteDefinition:FR}}}function UR(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:sw},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,l,u){const o=l.createTracker(u);let c=o.move("[^");const f=l.enter("footnoteDefinition"),p=l.enter("label");return c+=o.move(l.safe(l.associationId(r),{before:c,after:"]"})),p(),c+=o.move("]:"),r.children&&r.children.length>0&&(o.shift(4),c+=o.move((t?` +`:" ")+l.indentLines(l.containerFlow(r,o.current()),t?aw:GR))),f(),c}}function GR(e,t,n){return t===0?e:aw(e,t,n)}function aw(e,t,n){return(n?"":" ")+e}const qR=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ow.peek=KR;function VR(){return{canContainEols:["delete"],enter:{strikethrough:YR},exit:{strikethrough:XR}}}function WR(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:qR}],handlers:{delete:ow}}}function YR(e){this.enter({type:"delete",children:[]},e)}function XR(e){this.exit(e)}function ow(e,t,n,r){const a=n.createTracker(r),l=n.enter("strikethrough");let u=a.move("~~");return u+=n.containerPhrasing(e,{...a.current(),before:u,after:"~"}),u+=a.move("~~"),l(),u}function KR(){return"~"}function ZR(e){return e.length}function QR(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||ZR,l=[],u=[],o=[],c=[];let f=0,p=-1;for(;++pf&&(f=e[p].length);++yc[y])&&(c[y]=b)}w.push(x)}u[p]=w,o[p]=S}let d=-1;if(typeof r=="object"&&"length"in r)for(;++dc[d]&&(c[d]=x),_[d]=x),v[d]=b}u.splice(1,0,v),o.splice(1,0,_),p=-1;const C=[];for(;++p "),l.shift(2);const u=n.indentLines(n.containerFlow(e,l.current()),tM);return a(),u}function tM(e,t,n){return">"+(n?"":" ")+e}function nM(e,t){return P1(e,t.inConstruct,!0)&&!P1(e,t.notInConstruct,!1)}function P1(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ru&&(u=l):l=1,a=r+t.length,r=n.indexOf(t,a);return u}function rM(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 sM(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 aM(e,t,n,r){const a=sM(n),l=e.value||"",u=a==="`"?"GraveAccent":"Tilde";if(rM(e,n)){const d=n.enter("codeIndented"),v=n.indentLines(l,oM);return d(),v}const o=n.createTracker(r),c=a.repeat(Math.max(iM(l,a)+1,3)),f=n.enter("codeFenced");let p=o.move(c);if(e.lang){const d=n.enter(`codeFencedLang${u}`);p+=o.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...o.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${u}`);p+=o.move(" "),p+=o.move(n.safe(e.meta,{before:p,after:` `,encode:["`"],...o.current()})),d()}return p+=o.move(` `),l&&(p+=o.move(l+` -`)),p+=o.move(c),f(),p}function aM(e,t,n){return(n?"":" ")+e}function Wg(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 oM(e,t,n,r){const a=Wg(n),l=a==='"'?"Quote":"Apostrophe",u=n.enter("definition");let o=n.enter("label");const c=n.createTracker(r);let f=c.move("[");return f+=c.move(n.safe(n.associationId(e),{before:f,after:"]",...c.current()})),f+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(o=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":` -`,...c.current()}))),o(),e.title&&(o=n.enter(`title${l}`),f+=c.move(" "+a),f+=c.move(n.safe(e.title,{before:f,after:a,...c.current()})),f+=c.move(a),o()),u(),f}function lM(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 Yo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Du(e,t,n){const r=_a(e),a=_a(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}ow.peek=cM;function ow(e,t,n,r){const a=lM(n),l=n.enter("emphasis"),u=n.createTracker(r),o=u.move(a);let c=u.move(n.containerPhrasing(e,{after:a,before:o,...u.current()}));const f=c.charCodeAt(0),p=Du(r.before.charCodeAt(r.before.length-1),f,a);p.inside&&(c=Yo(f)+c.slice(1));const d=c.charCodeAt(c.length-1),v=Du(r.after.charCodeAt(0),d,a);v.inside&&(c=c.slice(0,-1)+Yo(d));const _=u.move(a);return l(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},o+c+_}function cM(e,t,n){return n.options.emphasis||"*"}function uM(e,t){let n=!1;return Vg(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,$p}),!!((!e.depth||e.depth<3)&&Fg(e)&&(t.options.setext||n))}function hM(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(uM(e,n)){const p=n.enter("headingSetext"),d=n.enter("phrasing"),v=n.containerPhrasing(e,{...l.current(),before:` +`)),p+=o.move(c),f(),p}function oM(e,t,n){return(n?"":" ")+e}function Xg(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 lM(e,t,n,r){const a=Xg(n),l=a==='"'?"Quote":"Apostrophe",u=n.enter("definition");let o=n.enter("label");const c=n.createTracker(r);let f=c.move("[");return f+=c.move(n.safe(n.associationId(e),{before:f,after:"]",...c.current()})),f+=c.move("]: "),o(),!e.url||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(o=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":` +`,...c.current()}))),o(),e.title&&(o=n.enter(`title${l}`),f+=c.move(" "+a),f+=c.move(n.safe(e.title,{before:f,after:a,...c.current()})),f+=c.move(a),o()),u(),f}function cM(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 Yo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Mu(e,t,n){const r=ya(e),a=ya(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}lw.peek=uM;function lw(e,t,n,r){const a=cM(n),l=n.enter("emphasis"),u=n.createTracker(r),o=u.move(a);let c=u.move(n.containerPhrasing(e,{after:a,before:o,...u.current()}));const f=c.charCodeAt(0),p=Mu(r.before.charCodeAt(r.before.length-1),f,a);p.inside&&(c=Yo(f)+c.slice(1));const d=c.charCodeAt(c.length-1),v=Mu(r.after.charCodeAt(0),d,a);v.inside&&(c=c.slice(0,-1)+Yo(d));const _=u.move(a);return l(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},o+c+_}function uM(e,t,n){return n.options.emphasis||"*"}function hM(e,t){let n=!1;return Wg(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Up}),!!((!e.depth||e.depth<3)&&Pg(e)&&(t.options.setext||n))}function fM(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),l=n.createTracker(r);if(hM(e,n)){const p=n.enter("headingSetext"),d=n.enter("phrasing"),v=n.containerPhrasing(e,{...l.current(),before:` `,after:` `});return d(),p(),v+` `+(a===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(` `))+1))}const u="#".repeat(a),o=n.enter("headingAtx"),c=n.enter("phrasing");l.move(u+" ");let f=n.containerPhrasing(e,{before:"# ",after:` -`,...l.current()});return/^[\t ]/.test(f)&&(f=Yo(f.charCodeAt(0))+f.slice(1)),f=f?u+" "+f:u,n.options.closeAtx&&(f+=" "+u),c(),o(),f}lw.peek=fM;function lw(e){return e.value||""}function fM(){return"<"}cw.peek=dM;function cw(e,t,n,r){const a=Wg(n),l=a==='"'?"Quote":"Apostrophe",u=n.enter("image");let o=n.enter("label");const c=n.createTracker(r);let f=c.move("![");return f+=c.move(n.safe(e.alt,{before:f,after:"]",...c.current()})),f+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(o=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=n.enter(`title${l}`),f+=c.move(" "+a),f+=c.move(n.safe(e.title,{before:f,after:a,...c.current()})),f+=c.move(a),o()),f+=c.move(")"),u(),f}function dM(){return"!"}uw.peek=pM;function uw(e,t,n,r){const a=e.referenceType,l=n.enter("imageReference");let u=n.enter("label");const o=n.createTracker(r);let c=o.move("![");const f=n.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(f+"]["),u();const p=n.stack;n.stack=[],u=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return u(),n.stack=p,l(),a==="full"||!f||f!==d?c+=o.move(d+"]"):a==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function pM(){return"!"}hw.peek=gM;function hw(e,t,n){let r=e.value||"",a="`",l=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l\u007F]/.test(e.url))}dw.peek=mM;function dw(e,t,n,r){const a=Wg(n),l=a==='"'?"Quote":"Apostrophe",u=n.createTracker(r);let o,c;if(fw(e,n)){const p=n.stack;n.stack=[],o=n.enter("autolink");let d=u.move("<");return d+=u.move(n.containerPhrasing(e,{before:d,after:">",...u.current()})),d+=u.move(">"),o(),n.stack=p,d}o=n.enter("link"),c=n.enter("label");let f=u.move("[");return f+=u.move(n.containerPhrasing(e,{before:f,after:"](",...u.current()})),f+=u.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(n.safe(e.url,{before:f,after:">",...u.current()})),f+=u.move(">")):(c=n.enter("destinationRaw"),f+=u.move(n.safe(e.url,{before:f,after:e.title?" ":")",...u.current()}))),c(),e.title&&(c=n.enter(`title${l}`),f+=u.move(" "+a),f+=u.move(n.safe(e.title,{before:f,after:a,...u.current()})),f+=u.move(a),c()),f+=u.move(")"),o(),f}function mM(e,t,n){return fw(e,n)?"<":"["}pw.peek=vM;function pw(e,t,n,r){const a=e.referenceType,l=n.enter("linkReference");let u=n.enter("label");const o=n.createTracker(r);let c=o.move("[");const f=n.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(f+"]["),u();const p=n.stack;n.stack=[],u=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return u(),n.stack=p,l(),a==="full"||!f||f!==d?c+=o.move(d+"]"):a==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function vM(){return"["}function Xg(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 _M(e){const t=Xg(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 yM(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 gw(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 bM(e,t,n,r){const a=n.enter("list"),l=n.bulletCurrent;let u=e.ordered?yM(n):Xg(n);const o=e.ordered?u==="."?")":".":_M(n);let c=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&p&&(!p.children||!p.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),gw(n)===u&&p){let d=-1;for(;++d-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let u=l.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const o=n.createTracker(r);o.move(l+" ".repeat(u-l.length)),o.shift(u);const c=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,o.current()),p);return c(),f;function p(d,v,_){return v?(_?"":" ".repeat(u))+d:(_?l:l+" ".repeat(u-l.length))+d}}function wM(e,t,n,r){const a=n.enter("paragraph"),l=n.enter("phrasing"),u=n.containerPhrasing(e,r);return l(),a(),u}const CM=th(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function EM(e,t,n,r){return(e.children.some(function(u){return CM(u)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function kM(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}mw.peek=AM;function mw(e,t,n,r){const a=kM(n),l=n.enter("strong"),u=n.createTracker(r),o=u.move(a+a);let c=u.move(n.containerPhrasing(e,{after:a,before:o,...u.current()}));const f=c.charCodeAt(0),p=Du(r.before.charCodeAt(r.before.length-1),f,a);p.inside&&(c=Yo(f)+c.slice(1));const d=c.charCodeAt(c.length-1),v=Du(r.after.charCodeAt(0),d,a);v.inside&&(c=c.slice(0,-1)+Yo(d));const _=u.move(a+a);return l(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},o+c+_}function AM(e,t,n){return n.options.strong||"*"}function NM(e,t,n,r){return n.safe(e.value,r)}function TM(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 RM(e,t,n){const r=(gw(n)+(n.options.ruleSpaces?" ":"")).repeat(TM(n));return n.options.ruleSpaces?r.slice(0,-1):r}const vw={blockquote:JD,break:P1,code:sM,definition:oM,emphasis:ow,hardBreak:P1,heading:hM,html:lw,image:cw,imageReference:uw,inlineCode:hw,link:dw,linkReference:pw,list:bM,listItem:xM,paragraph:wM,root:EM,strong:mw,text:NM,thematicBreak:RM};function DM(){return{enter:{table:MM,tableData:$1,tableHeader:$1,tableRow:LM},exit:{codeText:OM,table:jM,tableData:dp,tableHeader:dp,tableRow:dp}}}function MM(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 jM(e){this.exit(e),this.data.inTable=void 0}function LM(e){this.enter({type:"tableRow",children:[]},e)}function dp(e){this.exit(e)}function $1(e){this.enter({type:"tableCell",children:[]},e)}function OM(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,BM));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function BM(e,t){return t==="|"?t:e}function IM(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,l=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` +`,...l.current()});return/^[\t ]/.test(f)&&(f=Yo(f.charCodeAt(0))+f.slice(1)),f=f?u+" "+f:u,n.options.closeAtx&&(f+=" "+u),c(),o(),f}cw.peek=dM;function cw(e){return e.value||""}function dM(){return"<"}uw.peek=pM;function uw(e,t,n,r){const a=Xg(n),l=a==='"'?"Quote":"Apostrophe",u=n.enter("image");let o=n.enter("label");const c=n.createTracker(r);let f=c.move("![");return f+=c.move(n.safe(e.alt,{before:f,after:"]",...c.current()})),f+=c.move("]("),o(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(o=n.enter("destinationLiteral"),f+=c.move("<"),f+=c.move(n.safe(e.url,{before:f,after:">",...c.current()})),f+=c.move(">")):(o=n.enter("destinationRaw"),f+=c.move(n.safe(e.url,{before:f,after:e.title?" ":")",...c.current()}))),o(),e.title&&(o=n.enter(`title${l}`),f+=c.move(" "+a),f+=c.move(n.safe(e.title,{before:f,after:a,...c.current()})),f+=c.move(a),o()),f+=c.move(")"),u(),f}function pM(){return"!"}hw.peek=gM;function hw(e,t,n,r){const a=e.referenceType,l=n.enter("imageReference");let u=n.enter("label");const o=n.createTracker(r);let c=o.move("![");const f=n.safe(e.alt,{before:c,after:"]",...o.current()});c+=o.move(f+"]["),u();const p=n.stack;n.stack=[],u=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return u(),n.stack=p,l(),a==="full"||!f||f!==d?c+=o.move(d+"]"):a==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function gM(){return"!"}fw.peek=mM;function fw(e,t,n){let r=e.value||"",a="`",l=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++l\u007F]/.test(e.url))}pw.peek=vM;function pw(e,t,n,r){const a=Xg(n),l=a==='"'?"Quote":"Apostrophe",u=n.createTracker(r);let o,c;if(dw(e,n)){const p=n.stack;n.stack=[],o=n.enter("autolink");let d=u.move("<");return d+=u.move(n.containerPhrasing(e,{before:d,after:">",...u.current()})),d+=u.move(">"),o(),n.stack=p,d}o=n.enter("link"),c=n.enter("label");let f=u.move("[");return f+=u.move(n.containerPhrasing(e,{before:f,after:"](",...u.current()})),f+=u.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(n.safe(e.url,{before:f,after:">",...u.current()})),f+=u.move(">")):(c=n.enter("destinationRaw"),f+=u.move(n.safe(e.url,{before:f,after:e.title?" ":")",...u.current()}))),c(),e.title&&(c=n.enter(`title${l}`),f+=u.move(" "+a),f+=u.move(n.safe(e.title,{before:f,after:a,...u.current()})),f+=u.move(a),c()),f+=u.move(")"),o(),f}function vM(e,t,n){return dw(e,n)?"<":"["}gw.peek=_M;function gw(e,t,n,r){const a=e.referenceType,l=n.enter("linkReference");let u=n.enter("label");const o=n.createTracker(r);let c=o.move("[");const f=n.containerPhrasing(e,{before:c,after:"]",...o.current()});c+=o.move(f+"]["),u();const p=n.stack;n.stack=[],u=n.enter("reference");const d=n.safe(n.associationId(e),{before:c,after:"]",...o.current()});return u(),n.stack=p,l(),a==="full"||!f||f!==d?c+=o.move(d+"]"):a==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function _M(){return"["}function Kg(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 yM(e){const t=Kg(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 bM(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 mw(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 SM(e,t,n,r){const a=n.enter("list"),l=n.bulletCurrent;let u=e.ordered?bM(n):Kg(n);const o=e.ordered?u==="."?")":".":yM(n);let c=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&p&&(!p.children||!p.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),mw(n)===u&&p){let d=-1;for(;++d-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+l);let u=l.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const o=n.createTracker(r);o.move(l+" ".repeat(u-l.length)),o.shift(u);const c=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,o.current()),p);return c(),f;function p(d,v,_){return v?(_?"":" ".repeat(u))+d:(_?l:l+" ".repeat(u-l.length))+d}}function CM(e,t,n,r){const a=n.enter("paragraph"),l=n.enter("phrasing"),u=n.containerPhrasing(e,r);return l(),a(),u}const EM=nh(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function kM(e,t,n,r){return(e.children.some(function(u){return EM(u)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function AM(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}vw.peek=NM;function vw(e,t,n,r){const a=AM(n),l=n.enter("strong"),u=n.createTracker(r),o=u.move(a+a);let c=u.move(n.containerPhrasing(e,{after:a,before:o,...u.current()}));const f=c.charCodeAt(0),p=Mu(r.before.charCodeAt(r.before.length-1),f,a);p.inside&&(c=Yo(f)+c.slice(1));const d=c.charCodeAt(c.length-1),v=Mu(r.after.charCodeAt(0),d,a);v.inside&&(c=c.slice(0,-1)+Yo(d));const _=u.move(a+a);return l(),n.attentionEncodeSurroundingInfo={after:v.outside,before:p.outside},o+c+_}function NM(e,t,n){return n.options.strong||"*"}function TM(e,t,n,r){return n.safe(e.value,r)}function DM(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 RM(e,t,n){const r=(mw(n)+(n.options.ruleSpaces?" ":"")).repeat(DM(n));return n.options.ruleSpaces?r.slice(0,-1):r}const _w={blockquote:eM,break:$1,code:aM,definition:lM,emphasis:lw,hardBreak:$1,heading:fM,html:cw,image:uw,imageReference:hw,inlineCode:fw,link:pw,linkReference:gw,list:SM,listItem:wM,paragraph:CM,root:kM,strong:vw,text:TM,thematicBreak:RM};function MM(){return{enter:{table:jM,tableData:U1,tableHeader:U1,tableRow:OM},exit:{codeText:BM,table:LM,tableData:pp,tableHeader:pp,tableRow:pp}}}function jM(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 LM(e){this.exit(e),this.data.inTable=void 0}function OM(e){this.enter({type:"tableRow",children:[]},e)}function pp(e){this.exit(e)}function U1(e){this.enter({type:"tableCell",children:[]},e)}function BM(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,IM));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function IM(e,t){return t==="|"?t:e}function zM(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,l=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:v,table:u,tableCell:c,tableRow:o}};function u(_,C,w,S){return f(p(_,w,S),_.align)}function o(_,C,w,S){const y=d(_,w,S),x=f([y]);return x.slice(0,x.indexOf(` -`))}function c(_,C,w,S){const y=w.enter("tableCell"),x=w.enter("phrasing"),b=w.containerPhrasing(_,{...S,before:l,after:l});return x(),y(),b}function f(_,C){return ZD(_,{align:C,alignDelimiters:r,padding:n,stringLength:a})}function p(_,C,w){const S=_.children;let y=-1;const x=[],b=C.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const tj={tokenize:cj,partial:!0};function nj(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:aj,continuation:{tokenize:oj},exit:lj}},text:{91:{name:"gfmFootnoteCall",tokenize:sj},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:ij,resolveTo:rj}}}}function ij(e,t,n){const r=this;let a=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u;for(;a--;){const c=r.events[a][1];if(c.type==="labelImage"){u=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!u||!u._balanced)return n(c);const f=Jn(r.sliceSerialize({start:u.end,end:r.now()}));return f.codePointAt(0)!==94||!l.includes(f.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function rj(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)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",l,t],["enter",u,t],["exit",u,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function sj(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,u;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),c}function c(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(d){if(l>999||d===93&&!u||d===null||d===91||wt(d))return n(d);if(d===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return a.includes(Jn(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return wt(d)||(u=!0),l++,e.consume(d),d===92?p:f}function p(d){return d===91||d===92||d===93?(e.consume(d),l++,f):f(d)}}function aj(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,u=0,o;return c;function c(C){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(C){return C===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(C)}function p(C){if(u>999||C===93&&!o||C===null||C===91||wt(C))return n(C);if(C===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return l=Jn(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return wt(C)||(o=!0),u++,e.consume(C),C===92?d:p}function d(C){return C===91||C===92||C===93?(e.consume(C),u++,p):p(C)}function v(C){return C===58?(e.enter("definitionMarker"),e.consume(C),e.exit("definitionMarker"),a.includes(l)||a.push(l),nt(e,_,"gfmFootnoteDefinitionWhitespace")):n(C)}function _(C){return t(C)}}function oj(e,t,n){return e.check(hl,t,e.attempt(tj,t,n))}function lj(e){e.exit("gfmFootnoteDefinition")}function cj(e,t,n){const r=this;return nt(e,a,"gfmFootnoteDefinitionIndent",5);function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(l):n(l)}}function uj(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(u,o){let c=-1;for(;++c1?c(C):(u.consume(C),d++,_);if(d<2&&!n)return c(C);const S=u.exit("strikethroughSequenceTemporary"),y=_a(C);return S._open=!y||y===2&&!!w,S._close=!w||w===2&&!!y,o(C)}}}class hj{constructor(){this.map=[]}add(t,n,r){fj(this,t,n,r)}consume(t){if(this.map.sort(function(l,u){return l[0]-u[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 a=r.pop();for(;a;){for(const l of a)t.push(l);a=r.pop()}this.map.length=0}}function fj(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a-1;){const P=r.events[z][1].type;if(P==="lineEnding"||P==="linePrefix")z--;else break}const V=z>-1?r.events[z][1].type:null,F=V==="tableHead"||V==="tableRow"?N:c;return F===N&&r.parser.lazy[r.now().line]?n(B):F(B)}function c(B){return e.enter("tableHead"),e.enter("tableRow"),f(B)}function f(B){return B===124||(u=!0,l+=1),p(B)}function p(B){return B===null?n(B):Be(B)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),_):n(B):Ke(B)?nt(e,p,"whitespace")(B):(l+=1,u&&(u=!1,a+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),u=!0,p):(e.enter("data"),d(B)))}function d(B){return B===null||B===124||wt(B)?(e.exit("data"),p(B)):(e.consume(B),B===92?v:d)}function v(B){return B===92||B===124?(e.consume(B),d):d(B)}function _(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(B):(e.enter("tableDelimiterRow"),u=!1,Ke(B)?nt(e,C,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):C(B))}function C(B){return B===45||B===58?S(B):B===124?(u=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),w):R(B)}function w(B){return Ke(B)?nt(e,S,"whitespace")(B):S(B)}function S(B){return B===58?(l+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),y):B===45?(l+=1,y(B)):B===null||Be(B)?E(B):R(B)}function y(B){return B===45?(e.enter("tableDelimiterFiller"),x(B)):R(B)}function x(B){return B===45?(e.consume(B),x):B===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(B))}function b(B){return Ke(B)?nt(e,E,"whitespace")(B):E(B)}function E(B){return B===124?C(B):B===null||Be(B)?!u||a!==l?R(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(B)):R(B)}function R(B){return n(B)}function N(B){return e.enter("tableRow"),D(B)}function D(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),D):B===null||Be(B)?(e.exit("tableRow"),t(B)):Ke(B)?nt(e,D,"whitespace")(B):(e.enter("data"),T(B))}function T(B){return B===null||B===124||wt(B)?(e.exit("data"),D(B)):(e.consume(B),B===92?j:T)}function j(B){return B===92||B===124?(e.consume(B),T):T(B)}}function mj(e,t){let n=-1,r=!0,a=0,l=[0,0,0,0],u=[0,0,0,0],o=!1,c=0,f,p,d;const v=new hj;for(;++nn[2]+1){const C=n[2]+1,w=n[3]-n[2]-1;e.add(C,w,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return a!==void 0&&(l.end=Object.assign({},oa(t.events,a)),e.add(a,0,[["exit",l,t]]),l=void 0),l}function G1(e,t,n,r,a){const l=[],u=oa(t.events,n);a&&(a.end=Object.assign({},u),l.push(["exit",a,t])),r.end=Object.assign({},u),l.push(["exit",r,t]),e.add(n+1,0,l)}function oa(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const vj={name:"tasklistCheck",tokenize:yj};function _j(){return{text:{91:vj}}}function yj(e,t,n){const r=this;return a;function a(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),l)}function l(c){return wt(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),u):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),u):n(c)}function u(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(c)}function o(c){return Be(c)?t(c):Ke(c)?e.check({tokenize:bj},t,n)(c):n(c)}}function bj(e,t,n){return nt(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function Sj(e){return Ox([VM(),nj(),uj(e),pj(),_j()])}const xj={};function kw(e){const t=this,n=e||xj,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),u=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(Sj(n)),l.push($M()),u.push(UM(n))}const wj={cjs:"javascript",console:"bash",cts:"typescript",fish:"bash",html:"markup",js:"javascript",jsx:"javascript",md:"markdown",mjs:"javascript",mts:"typescript",py:"python",rb:"ruby",sh:"bash",shell:"bash",svg:"markup",terminal:"bash",ts:"typescript",tsx:"typescript",xml:"markup",yml:"yaml",zsh:"bash"},Cj={containerfile:"docker",dockerfile:"docker",justfile:"makefile",makefile:"makefile"};function Yp(e){const t=e.trim().toLowerCase();return wj[t]??t}function Aw(e){var a;if(!e)return null;const t=((a=e.split("/").pop())==null?void 0:a.toLowerCase())??"",n=Cj[t];if(n)return Yp(n);const r=t.lastIndexOf(".");return r===-1||r===t.length-1?null:Yp(t.slice(r+1))}pi.displayName="clike";pi.aliases=[];function pi(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}dl.displayName="c";dl.aliases=[];function dl(e){e.register(pi),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}ih.displayName="cpp";ih.aliases=[];function ih(e){e.register(dl),(function(t){var n=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return n.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return n.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:n,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])})(e)}Zg.displayName="arduino";Zg.aliases=["ino"];function Zg(e){e.register(ih),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}Qg.displayName="bash";Qg.aliases=["sh","shell"];function Qg(e){(function(t){var n="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},a={bash:r,environment:{pattern:RegExp("\\$"+n),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+n),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};t.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+n),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:a},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:a},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:a.entity}}],environment:{pattern:RegExp("\\$?"+n),alias:"constant"},variable:a.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=t.languages.bash;for(var l=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],u=a.variable[1].inside,o=0;o>/g,function(U,$){return"(?:"+O[+$]+")"})}function r(M,O,U){return RegExp(n(M,O),"")}function a(M,O){for(var U=0;U>/g,function(){return"(?:"+M+")"});return M.replace(/<>/g,"[^\\s\\S]")}var l={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function u(M){return"\\b(?:"+M.trim().replace(/ /g,"|")+")\\b"}var o=u(l.typeDeclaration),c=RegExp(u(l.type+" "+l.typeDeclaration+" "+l.contextual+" "+l.other)),f=u(l.typeDeclaration+" "+l.contextual+" "+l.other),p=u(l.type+" "+l.typeDeclaration+" "+l.other),d=a(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),v=a(/\((?:[^()]|<>)*\)/.source,2),_=/@?\b[A-Za-z_]\w*\b/.source,C=n(/<<0>>(?:\s*<<1>>)?/.source,[_,d]),w=n(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[f,C]),S=/\[\s*(?:,\s*)*\]/.source,y=n(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[w,S]),x=n(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[d,v,S]),b=n(/\(<<0>>+(?:,<<0>>+)+\)/.source,[x]),E=n(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[b,w,S]),R={keyword:c,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,D=/"(?:\\.|[^\\"\r\n])*"/.source,T=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;t.languages.csharp=t.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[D]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[w]),lookbehind:!0,inside:R},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[_,E]),lookbehind:!0,inside:R},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[_]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,C]),lookbehind:!0,inside:R},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[w]),lookbehind:!0,inside:R},{pattern:r(/(\bwhere\s+)<<0>>/.source,[_]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[y]),lookbehind:!0,inside:R},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[E,p,_]),inside:R}],keyword:c,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),t.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),t.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[_]),lookbehind:!0,alias:"punctuation"}}),t.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[_]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[v]),lookbehind:!0,alias:"class-name",inside:R},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[E,w]),inside:R,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[E]),lookbehind:!0,inside:R,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[_,d]),inside:{function:r(/^<<0>>/.source,[_]),generic:{pattern:RegExp(d),alias:"class-name",inside:R}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,C,_,E,c.source,v,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[C,v]),lookbehind:!0,greedy:!0,inside:t.languages.csharp},keyword:c,"class-name":{pattern:RegExp(E),greedy:!0,inside:R},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var j=D+"|"+N,B=n(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[j]),z=a(n(/[^"'/()]|<<0>>|\(<>*\)/.source,[B]),2),V=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,F=n(/<<0>>(?:\s*\(<<1>>*\))?/.source,[w,z]);t.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[V,F]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[V]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[z]),inside:t.languages.csharp},"class-name":{pattern:RegExp(w),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var P=/:[^}\r\n]+/.source,Y=a(n(/[^"'/()]|<<0>>|\(<>*\)/.source,[B]),2),q=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[Y,P]),X=a(n(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[j]),2),K=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,P]);function L(M,O){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[M]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[O,P]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:t.languages.csharp}}},string:/[\s\S]+/}}t.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[q]),lookbehind:!0,greedy:!0,inside:L(q,Y)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[K]),lookbehind:!0,greedy:!0,inside:L(K,X)}],char:{pattern:RegExp(N),greedy:!0}}),t.languages.dotnet=t.languages.cs=t.languages.csharp})(e)}pl.displayName="markup";pl.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function pl(e){e.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(n,r){var a={};a["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},a.cdata=/^$/i;var l={"included-cdata":{pattern://i,inside:a}};l["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var u={};u[n]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:l},e.languages.insertBefore("markup","cdata",u)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}Ra.displayName="css";Ra.aliases=[];function Ra(e){(function(t){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var r=t.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}em.displayName="diff";em.aliases=[];function em(e){(function(t){t.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var n={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(n).forEach(function(r){var a=n[r],l=[];/^\w+$/.test(r)||l.push(/\w+/.exec(r)[0]),r==="diff"&&l.push("bold"),t.languages.diff[r]={pattern:RegExp("^(?:["+a+`].*(?:\r +`))}function c(_,C,w,S){const y=w.enter("tableCell"),x=w.enter("phrasing"),b=w.containerPhrasing(_,{...S,before:l,after:l});return x(),y(),b}function f(_,C){return QR(_,{align:C,alignDelimiters:r,padding:n,stringLength:a})}function p(_,C,w){const S=_.children;let y=-1;const x=[],b=C.enter("table");for(;++y0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const nj={tokenize:uj,partial:!0};function ij(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:oj,continuation:{tokenize:lj},exit:cj}},text:{91:{name:"gfmFootnoteCall",tokenize:aj},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:rj,resolveTo:sj}}}}function rj(e,t,n){const r=this;let a=r.events.length;const l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u;for(;a--;){const c=r.events[a][1];if(c.type==="labelImage"){u=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!u||!u._balanced)return n(c);const f=Jn(r.sliceSerialize({start:u.end,end:r.now()}));return f.codePointAt(0)!==94||!l.includes(f.slice(1))?n(c):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),t(c))}}function sj(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)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const l={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},l.start),end:Object.assign({},l.end)},o=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",l,t],["enter",u,t],["exit",u,t],["exit",l,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...o),e}function aj(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l=0,u;return o;function o(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),c}function c(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(d){if(l>999||d===93&&!u||d===null||d===91||wt(d))return n(d);if(d===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return a.includes(Jn(r.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return wt(d)||(u=!0),l++,e.consume(d),d===92?p:f}function p(d){return d===91||d===92||d===93?(e.consume(d),l++,f):f(d)}}function oj(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l,u=0,o;return c;function c(C){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(C){return C===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(C)}function p(C){if(u>999||C===93&&!o||C===null||C===91||wt(C))return n(C);if(C===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return l=Jn(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(C),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return wt(C)||(o=!0),u++,e.consume(C),C===92?d:p}function d(C){return C===91||C===92||C===93?(e.consume(C),u++,p):p(C)}function v(C){return C===58?(e.enter("definitionMarker"),e.consume(C),e.exit("definitionMarker"),a.includes(l)||a.push(l),nt(e,_,"gfmFootnoteDefinitionWhitespace")):n(C)}function _(C){return t(C)}}function lj(e,t,n){return e.check(fl,t,e.attempt(nj,t,n))}function cj(e){e.exit("gfmFootnoteDefinition")}function uj(e,t,n){const r=this;return nt(e,a,"gfmFootnoteDefinitionIndent",5);function a(l){const u=r.events[r.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(l):n(l)}}function hj(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:l,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(u,o){let c=-1;for(;++c1?c(C):(u.consume(C),d++,_);if(d<2&&!n)return c(C);const S=u.exit("strikethroughSequenceTemporary"),y=ya(C);return S._open=!y||y===2&&!!w,S._close=!w||w===2&&!!y,o(C)}}}class fj{constructor(){this.map=[]}add(t,n,r){dj(this,t,n,r)}consume(t){if(this.map.sort(function(l,u){return l[0]-u[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 a=r.pop();for(;a;){for(const l of a)t.push(l);a=r.pop()}this.map.length=0}}function dj(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a-1;){const P=r.events[z][1].type;if(P==="lineEnding"||P==="linePrefix")z--;else break}const V=z>-1?r.events[z][1].type:null,F=V==="tableHead"||V==="tableRow"?N:c;return F===N&&r.parser.lazy[r.now().line]?n(B):F(B)}function c(B){return e.enter("tableHead"),e.enter("tableRow"),f(B)}function f(B){return B===124||(u=!0,l+=1),p(B)}function p(B){return B===null?n(B):Be(B)?l>1?(l=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),_):n(B):Ke(B)?nt(e,p,"whitespace")(B):(l+=1,u&&(u=!1,a+=1),B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),u=!0,p):(e.enter("data"),d(B)))}function d(B){return B===null||B===124||wt(B)?(e.exit("data"),p(B)):(e.consume(B),B===92?v:d)}function v(B){return B===92||B===124?(e.consume(B),d):d(B)}function _(B){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(B):(e.enter("tableDelimiterRow"),u=!1,Ke(B)?nt(e,C,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):C(B))}function C(B){return B===45||B===58?S(B):B===124?(u=!0,e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),w):D(B)}function w(B){return Ke(B)?nt(e,S,"whitespace")(B):S(B)}function S(B){return B===58?(l+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),y):B===45?(l+=1,y(B)):B===null||Be(B)?E(B):D(B)}function y(B){return B===45?(e.enter("tableDelimiterFiller"),x(B)):D(B)}function x(B){return B===45?(e.consume(B),x):B===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(B),e.exit("tableDelimiterMarker"),b):(e.exit("tableDelimiterFiller"),b(B))}function b(B){return Ke(B)?nt(e,E,"whitespace")(B):E(B)}function E(B){return B===124?C(B):B===null||Be(B)?!u||a!==l?D(B):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(B)):D(B)}function D(B){return n(B)}function N(B){return e.enter("tableRow"),R(B)}function R(B){return B===124?(e.enter("tableCellDivider"),e.consume(B),e.exit("tableCellDivider"),R):B===null||Be(B)?(e.exit("tableRow"),t(B)):Ke(B)?nt(e,R,"whitespace")(B):(e.enter("data"),T(B))}function T(B){return B===null||B===124||wt(B)?(e.exit("data"),R(B)):(e.consume(B),B===92?j:T)}function j(B){return B===92||B===124?(e.consume(B),T):T(B)}}function vj(e,t){let n=-1,r=!0,a=0,l=[0,0,0,0],u=[0,0,0,0],o=!1,c=0,f,p,d;const v=new fj;for(;++nn[2]+1){const C=n[2]+1,w=n[3]-n[2]-1;e.add(C,w,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return a!==void 0&&(l.end=Object.assign({},oa(t.events,a)),e.add(a,0,[["exit",l,t]]),l=void 0),l}function q1(e,t,n,r,a){const l=[],u=oa(t.events,n);a&&(a.end=Object.assign({},u),l.push(["exit",a,t])),r.end=Object.assign({},u),l.push(["exit",r,t]),e.add(n+1,0,l)}function oa(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const _j={name:"tasklistCheck",tokenize:bj};function yj(){return{text:{91:_j}}}function bj(e,t,n){const r=this;return a;function a(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),l)}function l(c){return wt(c)?(e.enter("taskListCheckValueUnchecked"),e.consume(c),e.exit("taskListCheckValueUnchecked"),u):c===88||c===120?(e.enter("taskListCheckValueChecked"),e.consume(c),e.exit("taskListCheckValueChecked"),u):n(c)}function u(c){return c===93?(e.enter("taskListCheckMarker"),e.consume(c),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),o):n(c)}function o(c){return Be(c)?t(c):Ke(c)?e.check({tokenize:Sj},t,n)(c):n(c)}}function Sj(e,t,n){return nt(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function xj(e){return Bx([WM(),ij(),hj(e),gj(),yj()])}const wj={};function Aw(e){const t=this,n=e||wj,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),l=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),u=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(xj(n)),l.push(UM()),u.push(GM(n))}const Cj={cjs:"javascript",console:"bash",cts:"typescript",fish:"bash",html:"markup",js:"javascript",jsx:"javascript",md:"markdown",mjs:"javascript",mts:"typescript",py:"python",rb:"ruby",sh:"bash",shell:"bash",svg:"markup",terminal:"bash",ts:"typescript",tsx:"typescript",xml:"markup",yml:"yaml",zsh:"bash"},Ej={containerfile:"docker",dockerfile:"docker",justfile:"makefile",makefile:"makefile"};function Yp(e){const t=e.trim().toLowerCase();return Cj[t]??t}function Nw(e){var a;if(!e)return null;const t=((a=e.split("/").pop())==null?void 0:a.toLowerCase())??"",n=Ej[t];if(n)return Yp(n);const r=t.lastIndexOf(".");return r===-1||r===t.length-1?null:Yp(t.slice(r+1))}pi.displayName="clike";pi.aliases=[];function pi(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}pl.displayName="c";pl.aliases=[];function pl(e){e.register(pi),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}rh.displayName="cpp";rh.aliases=[];function rh(e){e.register(pl),(function(t){var n=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,function(){return n.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,function(){return n.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:n,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])})(e)}Qg.displayName="arduino";Qg.aliases=["ino"];function Qg(e){e.register(rh),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}Jg.displayName="bash";Jg.aliases=["sh","shell"];function Jg(e){(function(t){var n="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},a={bash:r,environment:{pattern:RegExp("\\$"+n),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+n),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};t.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+n),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:a},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:a},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:a.entity}}],environment:{pattern:RegExp("\\$?"+n),alias:"constant"},variable:a.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=t.languages.bash;for(var l=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],u=a.variable[1].inside,o=0;o>/g,function(U,$){return"(?:"+O[+$]+")"})}function r(M,O,U){return RegExp(n(M,O),"")}function a(M,O){for(var U=0;U>/g,function(){return"(?:"+M+")"});return M.replace(/<>/g,"[^\\s\\S]")}var l={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function u(M){return"\\b(?:"+M.trim().replace(/ /g,"|")+")\\b"}var o=u(l.typeDeclaration),c=RegExp(u(l.type+" "+l.typeDeclaration+" "+l.contextual+" "+l.other)),f=u(l.typeDeclaration+" "+l.contextual+" "+l.other),p=u(l.type+" "+l.typeDeclaration+" "+l.other),d=a(/<(?:[^<>;=+\-*/%&|^]|<>)*>/.source,2),v=a(/\((?:[^()]|<>)*\)/.source,2),_=/@?\b[A-Za-z_]\w*\b/.source,C=n(/<<0>>(?:\s*<<1>>)?/.source,[_,d]),w=n(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[f,C]),S=/\[\s*(?:,\s*)*\]/.source,y=n(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[w,S]),x=n(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[d,v,S]),b=n(/\(<<0>>+(?:,<<0>>+)+\)/.source,[x]),E=n(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[b,w,S]),D={keyword:c,punctuation:/[<>()?,.:[\]]/},N=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,R=/"(?:\\.|[^\\"\r\n])*"/.source,T=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;t.languages.csharp=t.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[T]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[R]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[w]),lookbehind:!0,inside:D},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[_,E]),lookbehind:!0,inside:D},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[_]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[o,C]),lookbehind:!0,inside:D},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[w]),lookbehind:!0,inside:D},{pattern:r(/(\bwhere\s+)<<0>>/.source,[_]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[y]),lookbehind:!0,inside:D},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[E,p,_]),inside:D}],keyword:c,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),t.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),t.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[_]),lookbehind:!0,alias:"punctuation"}}),t.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[_]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[v]),lookbehind:!0,alias:"class-name",inside:D},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[E,w]),inside:D,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[E]),lookbehind:!0,inside:D,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[_,d]),inside:{function:r(/^<<0>>/.source,[_]),generic:{pattern:RegExp(d),alias:"class-name",inside:D}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[o,C,_,E,c.source,v,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[C,v]),lookbehind:!0,greedy:!0,inside:t.languages.csharp},keyword:c,"class-name":{pattern:RegExp(E),greedy:!0,inside:D},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var j=R+"|"+N,B=n(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[j]),z=a(n(/[^"'/()]|<<0>>|\(<>*\)/.source,[B]),2),V=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,F=n(/<<0>>(?:\s*\(<<1>>*\))?/.source,[w,z]);t.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[V,F]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[V]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[z]),inside:t.languages.csharp},"class-name":{pattern:RegExp(w),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var P=/:[^}\r\n]+/.source,W=a(n(/[^"'/()]|<<0>>|\(<>*\)/.source,[B]),2),q=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[W,P]),X=a(n(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<>*\)/.source,[j]),2),K=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[X,P]);function L(M,O){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[M]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[O,P]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:t.languages.csharp}}},string:/[\s\S]+/}}t.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[q]),lookbehind:!0,greedy:!0,inside:L(q,W)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[K]),lookbehind:!0,greedy:!0,inside:L(K,X)}],char:{pattern:RegExp(N),greedy:!0}}),t.languages.dotnet=t.languages.cs=t.languages.csharp})(e)}gl.displayName="markup";gl.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function gl(e){e.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(n,r){var a={};a["language-"+r]={pattern:/(^$)/i,lookbehind:!0,inside:e.languages[r]},a.cdata=/^$/i;var l={"included-cdata":{pattern://i,inside:a}};l["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var u={};u[n]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:l},e.languages.insertBefore("markup","cdata",u)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}Ra.displayName="css";Ra.aliases=[];function Ra(e){(function(t){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var r=t.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}tm.displayName="diff";tm.aliases=[];function tm(e){(function(t){t.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var n={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(n).forEach(function(r){var a=n[r],l=[];/^\w+$/.test(r)||l.push(/\w+/.exec(r)[0]),r==="diff"&&l.push("bold"),t.languages.diff[r]={pattern:RegExp("^(?:["+a+`].*(?:\r ?| -|(?![\\s\\S])))+`,"m"),alias:l,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(t.languages.diff,"PREFIXES",{value:n})})(e)}tm.displayName="go";tm.aliases=[];function tm(e){e.register(pi),e.languages.go=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}nm.displayName="ini";nm.aliases=[];function nm(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}im.displayName="java";im.aliases=[];function im(e){e.register(pi),(function(t){var n=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,a={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[a,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:a.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:a.inside}],keyword:n,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":a,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:a.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:a.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return n.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}rm.displayName="regex";rm.aliases=[];function rm(e){(function(t){var n={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,a={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},l={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},u="(?:[^\\\\-]|"+r.source+")",o=RegExp(u+"-"+u),c={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};t.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,"char-set":l,escape:r}},"special-escape":n,"char-set":a,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":c}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]||&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}sm.displayName="json";sm.aliases=["webmanifest"];function sm(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}am.displayName="kotlin";am.aliases=["kt","kts"];function am(e){e.register(pi),(function(t){t.languages.kotlin=t.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete t.languages.kotlin["class-name"];var n={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:t.languages.kotlin}};t.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:n},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:n},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete t.languages.kotlin.string,t.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),t.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),t.languages.kt=t.languages.kotlin,t.languages.kts=t.languages.kotlin})(e)}om.displayName="less";om.aliases=[];function om(e){e.register(Ra),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}lm.displayName="lua";lm.aliases=[];function lm(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}cm.displayName="makefile";cm.aliases=[];function cm(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}um.displayName="yaml";um.aliases=["yml"];function um(e){(function(t){var n=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,a="(?:"+r.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+r.source+")?)",l=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),u=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(c,f){f=(f||"").replace(/m/g,"")+"m";var p=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return a}).replace(/<>/g,function(){return c});return RegExp(p,f)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return a})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return a}).replace(/<>/g,function(){return"(?:"+l+"|"+u+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(u),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(e)}hm.displayName="markdown";hm.aliases=["md"];function hm(e){e.register(pl),(function(t){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(//g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var a=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,l=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return a}),u=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+l+u+"(?:"+l+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+l+u+")(?:"+l+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(a),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+l+")"+u+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+l+"$"),inside:{"table-header":{pattern:RegExp(a),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(o){["url","bold","italic","strike","code-snippet"].forEach(function(c){o!==c&&(t.languages.markdown[o].inside.content.inside[c]=t.languages.markdown[c])})}),t.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function c(f){if(!(!f||typeof f=="string"))for(var p=0,d=f.length;p]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}dm.displayName="perl";dm.aliases=[];function dm(e){(function(t){var n=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;t.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,n].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,n].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,n+/\s*/.source+n].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}sh.displayName="markup-templating";sh.aliases=[];function sh(e){e.register(pl),(function(t){function n(r,a){return"___"+r.toUpperCase()+a+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,a,l,u){if(r.language===a){var o=r.tokenStack=[];r.code=r.code.replace(l,function(c){if(typeof u=="function"&&!u(c))return c;for(var f=o.length,p;r.code.indexOf(p=n(a,f))!==-1;)++f;return o[f]=c,p}),r.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(r,a){if(r.language!==a||!r.tokenStack)return;r.grammar=t.languages[a];var l=0,u=Object.keys(r.tokenStack);function o(c){for(var f=0;f=u.length);f++){var p=c[f];if(typeof p=="string"||p.content&&typeof p.content=="string"){var d=u[l],v=r.tokenStack[d],_=typeof p=="string"?p:p.content,C=n(a,d),w=_.indexOf(C);if(w>-1){++l;var S=_.substring(0,w),y=new t.Token(a,t.tokenize(v,r.grammar),"language-"+a,v),x=_.substring(w+C.length),b=[];S&&b.push.apply(b,o([S])),b.push(y),x&&b.push.apply(b,o([x])),typeof p=="string"?c.splice.apply(c,[f,1].concat(b)):p.content=b}}else p.content&&o(p.content)}return c}o(r.tokens)}}})})(e)}pm.displayName="php";pm.aliases=[];function pm(e){e.register(sh),(function(t){var n=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],a=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,l=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,u=/[{}\[\](),:;]/;t.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:n,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:a,operator:l,punctuation:u};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:t.languages.php},c=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];t.languages.insertBefore("php","variable",{string:c,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:n,string:c,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:a,operator:l,punctuation:u}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(f){if(/<\?/.test(f.code)){var p=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;t.languages["markup-templating"].buildPlaceholders(f,"php",p)}}),t.hooks.add("after-tokenize",function(f){t.languages["markup-templating"].tokenizePlaceholders(f,"php")})})(e)}gm.displayName="python";gm.aliases=["py"];function gm(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}mm.displayName="r";mm.aliases=[];function mm(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}vm.displayName="ruby";vm.aliases=["rb"];function vm(e){e.register(pi),(function(t){t.languages.ruby=t.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===||[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),t.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var n={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:t.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete t.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",a=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;t.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+a),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+a+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),t.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete t.languages.ruby.string,t.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),t.languages.rb=t.languages.ruby})(e)}_m.displayName="rust";_m.aliases=[];function _m(e){(function(t){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)n=n.replace(//g,function(){return n});n=n.replace(//g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string})(e)}ym.displayName="sass";ym.aliases=[];function ym(e){e.register(Ra),(function(t){t.languages.sass=t.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),t.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete t.languages.sass.atrule;var n=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];t.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:n,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:n,operator:r,important:t.languages.sass.important}}}),delete t.languages.sass.property,delete t.languages.sass.important,t.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}bm.displayName="scss";bm.aliases=[];function bm(e){e.register(Ra),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}Sm.displayName="sql";Sm.aliases=[];function Sm(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}xm.displayName="swift";xm.aliases=[];function xm(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach(function(t){t.inside.interpolation.inside=e.languages.swift})}wm.displayName="typescript";wm.aliases=["ts"];function wm(e){e.register(rh),(function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var n=t.languages.extend("typescript",{});delete n["class-name"],t.languages.typescript["class-name"].inside=n,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n}}}}),t.languages.ts=t.languages.typescript})(e)}ah.displayName="basic";ah.aliases=[];function ah(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}Cm.displayName="vbnet";Cm.aliases=[];function Cm(e){e.register(ah),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}const q1=/[#.]/g;function Ej(e,t){const n=e||"",r={};let a=0,l,u;for(;a=48&&t<=57}function jj(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function Lj(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function W1(e){return Lj(e)||Tw(e)}const Oj=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Bj(e,t){const n={},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,a=[];let l=0,u=-1,o="",c,f;n.position&&("start"in n.position||"indent"in n.position?(f=n.position.indent,c=n.position.start):c=n.position);let p=(c?c.line:0)||1,d=(c?c.column:0)||1,v=C(),_;for(l--;++l<=e.length;)if(_===10&&(d=(f?f[u]:0)||1),_=e.charCodeAt(l),_===38){const y=e.charCodeAt(l+1);if(y===9||y===10||y===12||y===32||y===38||y===60||Number.isNaN(y)||r&&y===r){o+=String.fromCharCode(_),d++;continue}const x=l+1;let b=x,E=x,R;if(y===35){E=++b;const F=e.charCodeAt(E);F===88||F===120?(R="hexadecimal",E=++b):R="decimal"}else R="named";let N="",D="",T="";const j=R==="named"?W1:R==="decimal"?Tw:jj;for(E--;++E<=e.length;){const F=e.charCodeAt(E);if(!j(F))break;T+=String.fromCharCode(F),R==="named"&&Mj.includes(T)&&(N=T,D=Vo(T))}let B=e.charCodeAt(E)===59;if(B){E++;const F=R==="named"?Vo(T):!1;F&&(N=T,D=F)}let z=1+E-x,V="";if(!(!B&&n.nonTerminated===!1))if(!T)R!=="named"&&w(4,z);else if(R==="named"){if(B&&!D)w(5,1);else if(N!==T&&(E=b+N.length,z=1+E-b,B=!1),!B){const F=N?1:3;if(n.attribute){const P=e.charCodeAt(E);P===61?(w(F,z),D=""):W1(P)?D="":w(F,z)}else w(F,z)}V=D}else{B||w(2,z);let F=Number.parseInt(T,R==="hexadecimal"?16:10);if(Ij(F))w(7,z),V="�";else if(F in Y1)w(6,z),V=Y1[F];else{let P="";zj(F)&&w(6,z),F>65535&&(F-=65536,P+=String.fromCharCode(F>>>10|55296),F=56320|F&1023),V=P+String.fromCharCode(F)}}if(V){S(),v=C(),l=E-1,d+=E-x+1,a.push(V);const F=C();F.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,V,{start:v,end:F},e.slice(x-1,E)),v=F}else T=e.slice(x-1,E),o+=T,d+=T.length,l=E-1}else _===10&&(p++,u++,d=0),Number.isNaN(_)?S():(o+=String.fromCharCode(_),d++);return a.join("");function C(){return{line:p,column:d,offset:l+((c?c.offset:0)||0)}}function w(y,x){let b;n.warning&&(b=C(),b.column+=x,b.offset+=x,n.warning.call(n.warningContext||void 0,Oj[y],b,y))}function S(){o&&(a.push(o),n.text&&n.text.call(n.textContext||void 0,o,{start:v,end:C()}),o="")}}function Ij(e){return e>=55296&&e<=57343||e>1114111}function zj(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var Hj=0,Vc={},Vt={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++Hj}),e.__id},clone:function e(t,n){n=n||{};var r,a;switch(Vt.util.type(t)){case"Object":if(a=Vt.util.objId(t),n[a])return n[a];r={},n[a]=r;for(var l in t)t.hasOwnProperty(l)&&(r[l]=e(t[l],n));return r;case"Array":return a=Vt.util.objId(t),n[a]?n[a]:(r=[],n[a]=r,t.forEach(function(u,o){r[o]=e(u,n)}),r);default:return t}}},languages:{plain:Vc,plaintext:Vc,text:Vc,txt:Vc,extend:function(e,t){var n=Vt.util.clone(Vt.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r=r||Vt.languages;var a=r[e],l={};for(var u in a)if(a.hasOwnProperty(u)){if(u==t)for(var o in n)n.hasOwnProperty(o)&&(l[o]=n[o]);n.hasOwnProperty(u)||(l[u]=a[u])}var c=r[e];return r[e]=l,Vt.languages.DFS(Vt.languages,function(f,p){p===c&&f!=e&&(this[f]=l)}),l},DFS:function e(t,n,r,a){a=a||{};var l=Vt.util.objId;for(var u in t)if(t.hasOwnProperty(u)){n.call(t,u,t[u],r||u);var o=t[u],c=Vt.util.type(o);c==="Object"&&!a[l(o)]?(a[l(o)]=!0,e(o,n,null,a)):c==="Array"&&!a[l(o)]&&(a[l(o)]=!0,e(o,n,u,a))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(Vt.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Vt.tokenize(r.code,r.grammar),Vt.hooks.run("after-tokenize",r),Po.stringify(Vt.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var a=new Fj;return mu(a,a.head,e),Rw(e,a,t,a.head,0),$j(a)},hooks:{all:{},add:function(e,t){var n=Vt.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=Vt.hooks.all[e];if(!(!n||!n.length))for(var r=0,a;a=n[r++];)a(t)}},Token:Po};function Po(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||"").length|0}function X1(e,t,n,r){e.lastIndex=t;var a=e.exec(n);if(a&&r&&a[1]){var l=a[1].length;a.index+=l,a[0]=a[0].slice(l)}return a}function Rw(e,t,n,r,a,l){for(var u in n)if(!(!n.hasOwnProperty(u)||!n[u])){var o=n[u];o=Array.isArray(o)?o:[o];for(var c=0;c=l.reach);y+=S.value.length,S=S.next){var x=S.value;if(t.length>e.length)return;if(!(x instanceof Po)){var b=1,E;if(v){if(E=X1(w,y,e,d),!E||E.index>=e.length)break;var T=E.index,R=E.index+E[0].length,N=y;for(N+=S.value.length;T>=N;)S=S.next,N+=S.value.length;if(N-=S.value.length,y=N,S.value instanceof Po)continue;for(var D=S;D!==t.tail&&(Nl.reach&&(l.reach=V);var F=S.prev;B&&(F=mu(t,F,B),y+=B.length),Pj(t,F,b);var P=new Po(u,p?Vt.tokenize(j,p):j,_,j);if(S=mu(t,F,P),z&&mu(t,S,z),b>1){var Y={cause:u+","+c,reach:V};Rw(e,t,n,S.prev,y,Y),l&&Y.reach>l.reach&&(l.reach=Y.reach)}}}}}}function Fj(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function mu(e,t,n){var r=t.next,a={value:n,prev:t,next:r};return t.next=a,r.prev=a,e.length++,a}function Pj(e,t,n){for(var r=t.next,a=0;an)return e;try{return Le.highlight(e,t).children.map(jw)}catch{return e}}const Kj=1e5;function Zj({code:e,lang:t}){const[n,r]=G.useState(!1),a=()=>{var l;(l=navigator.clipboard)==null||l.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return g.jsxs("div",{className:"md-code",children:[g.jsx("button",{className:"md-code-copy",title:"Copy","aria-label":"Copy code",onClick:a,children:n?g.jsx(vn,{size:13}):g.jsx(Ng,{size:13})}),g.jsx("pre",{children:g.jsx("code",{children:Lw(e,t,Kj)})})]})}function Qj(e){const t={};for(const n of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=n[1];r&&(t[r.toLowerCase()]=n[3]??"")}return t}function Jj(e){const t=/]*?)\/?>/gi,n=[];let r=0,a=!1;for(const l of e.matchAll(t)){const u=Qj(l[1]??"");u.path&&(a=!0,l.index>r&&n.push({type:"text",value:e.slice(r,l.index)}),n.push({children:[],data:{hName:"file-mention",hProperties:u},type:"fileMention"}),r=l.index+l[0].length)}return a?(rOw(e)}function K1({path:e,lines:t,onOpenFile:n}){const r=e.split("/").pop()||e,a=t&&Number.parseInt(t,10)||void 0,l=a!=null?`${r}:${a}`:r;return g.jsxs("button",{className:"file-chip",title:`Open ${e}`,onClick:()=>n==null?void 0:n(e),disabled:!n,children:[g.jsx(rx,{size:12}),g.jsx("span",{className:"file-chip-label",children:l})]})}function tL(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const Bw={code:({node:e,className:t,children:n,...r})=>{const a=t??"",l=/language-(\w+)/.exec(a),u=String(n??"").replace(/\n$/,"");if(!(l!=null||u.includes(` -`)))return g.jsx("code",{className:a,...r,children:n});const c=l?Yp(l[1]):null;return g.jsx(Zj,{code:u,lang:c})},pre:({children:e})=>g.jsx(g.Fragment,{children:e})};function Wo({text:e,onOpenFile:t}){const n={"file-mention":r=>g.jsx(K1,{path:r.path,lines:r.lines,onOpenFile:t}),a:({node:r,href:a,children:l,...u})=>a&&tL(a)&&t?g.jsx(K1,{path:decodeURI(a),onOpenFile:t}):g.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",...u,children:l}),...Bw};return g.jsx("div",{className:"md",children:g.jsx(nw,{remarkPlugins:[kw,eL],components:n,children:e})})}function nL({synthesized:e,agentLabel:t,onView:n,onApprove:r,onReject:a,onRevise:l}){const[u,o]=G.useState(!1),c=G.useRef(null),[f,p]=G.useState(!1),[d,v]=G.useState(""),_=G.useRef(null);G.useEffect(()=>{if(!u)return;const w=S=>{c.current&&!c.current.contains(S.target)&&o(!1)};return window.addEventListener("pointerdown",w),()=>window.removeEventListener("pointerdown",w)},[u]),G.useEffect(()=>{var w;f&&((w=_.current)==null||w.focus())},[f]);const C=()=>{l(d.trim()||"no specific feedback — use your judgment"),v(""),p(!1)};return g.jsxs("div",{className:"plan-strip",children:[g.jsxs("div",{className:"plan-strip-info",children:[g.jsx(lx,{size:14,className:"plan-strip-icon"}),g.jsx("span",{className:"plan-strip-title",children:e?`${t} is ready to proceed`:`${t} proposed a plan`}),g.jsx("button",{className:"plan-strip-open",onClick:n,children:"Open plan"})]}),f?g.jsxs(g.Fragment,{children:[g.jsx("textarea",{ref:_,className:"plan-strip-revise-input",placeholder:"What should change? (optional)",rows:2,value:d,onChange:w=>v(w.target.value),onKeyDown:w=>{w.key==="Escape"?(w.preventDefault(),v(""),p(!1)):w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),C())}}),g.jsxs("div",{className:"prompt-actions plan-strip-actions",children:[g.jsx("button",{className:"btn-ghost",onClick:()=>{v(""),p(!1)},children:"Back"}),g.jsx("span",{className:"plan-strip-spacer"}),g.jsxs("button",{className:"btn-primary plan-strip-primary",onClick:C,children:["Revise",g.jsx(nx,{size:13})]})]})]}):g.jsxs("div",{className:"prompt-actions plan-strip-actions",children:[g.jsx("button",{className:"btn-ghost",onClick:a,children:"Reject"}),g.jsx("button",{className:"btn-ghost",onClick:()=>p(!0),children:"Revise…"}),g.jsx("span",{className:"plan-strip-spacer"}),g.jsxs("div",{className:"plan-strip-approve",ref:c,children:[g.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>r("auto"),children:"Accept and auto mode"}),g.jsx("button",{className:"btn-primary plan-strip-primary plan-strip-caret","aria-label":"More approval options",onClick:()=>o(w=>!w),children:g.jsx(gs,{size:13})}),u&&g.jsx("div",{className:"plan-strip-menu",children:g.jsx("button",{onClick:()=>{o(!1),r("bypass")},children:"Accept and bypass all"})})]})]})]})}function Iw({onSaved:e}){const[t,n]=G.useState(""),[r,a]=G.useState(!1),[l,u]=G.useState(null);async function o(c){if(c.preventDefault(),!(r||!t.trim())){a(!0),u(null);try{e(await IT(t.trim())),n("")}catch(f){u(f instanceof Error?f.message:String(f))}finally{a(!1)}}}return g.jsxs("form",{className:"onb-token-form",onSubmit:o,children:[g.jsx("input",{type:"password",value:t,onChange:c=>n(c.target.value),placeholder:"ghp_… personal access token",autoComplete:"off"}),g.jsx("button",{type:"submit",className:"btn",disabled:r||!t.trim(),children:r?"Checking…":"Save"}),g.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo,workflow&description=orx",target:"_blank",rel:"noreferrer",children:"Create a token ↗"}),l&&g.jsx("div",{className:"error",children:l})]})}function iL(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"openresearch_job":return"OpenResearch";case"local_job":return"This machine";default:return e||"—"}}function rL({size:e=16}){return g.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[g.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),g.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),g.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-.576-.393-.394-1.023-.089-.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),g.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),g.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),g.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),g.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-.573.534-.375-.677-1.405-2.416-1.94-2.751-.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-.522z",fill:"#FFD21E"})]})}function sL({size:e=16}){return g.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[g.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),g.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),g.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),g.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),g.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),g.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),g.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),g.jsxs("defs",{children:[g.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[g.jsx("stop",{stopColor:"#BFF9B4"}),g.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),g.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[g.jsx("stop",{stopColor:"#80EE64"}),g.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),g.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),g.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),g.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),g.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),g.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),g.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[g.jsx("stop",{stopColor:"#BFF9B4"}),g.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),g.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[g.jsx("stop",{stopColor:"#80EE64"}),g.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),g.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),g.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),g.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),g.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),g.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function aL({size:e=16}){return g.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:g.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-.5-.623h-.804l-.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-.52.123-.736-.172-.216-.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-.555-.5-.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function Em({size:e=16}){return g.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:g.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"})})}function zw({kind:e,size:t=16}){switch(e){case"modal_job":return g.jsx(sL,{size:t});case"hf_job":return g.jsx(rL,{size:t});case"k8s_job":return g.jsx(aL,{size:t});case"ssh_job":return g.jsx(jp,{size:t});case"slurm_job":return g.jsx(ZA,{size:t});case"openresearch_job":return g.jsx(aN,{size:t});case"local_job":return g.jsx(DN,{size:t});default:return g.jsx(jp,{size:t})}}function oL({backend:e}){const t=vx(e),n=_x(e);return t?g.jsxs("span",{className:"backend-badge",children:[g.jsx(zw,{kind:t}),g.jsx("span",{className:"backend-name",children:iL(t)}),n&&g.jsx("span",{className:"backend-detail mono",children:n})]}):g.jsx("span",{className:"backend-badge muted",children:"—"})}const Z1={done:{className:"st-done",live:!1},failed:{className:"st-failed",live:!1},running:{className:"st-running",live:!0},starting:{className:"st-starting",live:!0},cancelled:{className:"st-cancelled",live:!1},editing:{className:"st-editing",live:!0},idle:{className:"st-idle",live:!1}};function lL(e){return Z1[e]??Z1.idle}function Xo({status:e,label:t}){const n=lL(e);return g.jsxs("span",{className:`status-badge ${n.className}${n.live?" live":""}`,children:[g.jsx("span",{className:"dot"}),t??e]})}function pp(e){return e.installed&&e.authenticated?{cls:"ok",label:"Connected"}:e.installed?{cls:"warn",label:"Not signed in"}:{cls:"warn",label:"Not installed"}}function cL({h:e}){return e.authMethod?g.jsx(g.Fragment,{children:e.authMethod==="oauth"?"OAuth (subscription login)":"API key"}):g.jsx(g.Fragment,{children:"—"})}function uL(){const[e,t]=G.useState(null),[n,r]=G.useState("claude-code"),[a,l]=G.useState(!1),u=c=>{l(!0),Lg(c).then(t).catch(()=>{}).finally(()=>l(!1))};G.useEffect(()=>u(!1),[]);const o=e==null?void 0:e.find(c=>c.id===n);return g.jsxs(g.Fragment,{children:[g.jsx("h1",{children:"Harnesses"}),g.jsx("p",{className:"settings-sub",children:"Coding-agent setups detected on this machine. The research agent chat is served by OpenCode; Claude Code and Codex accounts surface their models in the composer's model picker."}),g.jsx("div",{className:"harness-tabs",children:(e??[]).map(c=>g.jsxs("button",{className:c.id===n?"active":"",onClick:()=>r(c.id),children:[c.name,g.jsx("span",{className:`harness-dot ${pp(c).cls}`})]},c.id))}),e?o?g.jsxs("div",{className:"settings-card",children:[g.jsxs("div",{className:"settings-card-head",children:[g.jsx("span",{className:`badge ${pp(o).cls}`,children:pp(o).label}),g.jsx("div",{className:"spacer",style:{flex:1}}),g.jsxs("button",{className:"btn sm",onClick:()=>u(!0),disabled:a,children:[g.jsx(ku,{size:12,className:a?"spin":""})," Refresh"]})]}),g.jsxs("div",{className:"kv",children:[g.jsx("span",{className:"k",children:"Binary"}),g.jsx("span",{className:"v",children:o.binPath??"not found on PATH"}),g.jsx("span",{className:"k",children:"Version"}),g.jsx("span",{className:"v",children:o.version??"—"}),g.jsx("span",{className:"k",children:"Auth"}),g.jsx("span",{className:"v",children:g.jsx(cL,{h:o})}),o.account&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"k",children:o.id==="opencode"?"Providers":"Account"}),g.jsx("span",{className:"v",children:o.account})]}),o.org&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"k",children:"Org"}),g.jsx("span",{className:"v",children:o.org})]}),o.plan&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"k",children:"Plan"}),g.jsx("span",{className:"v",children:o.plan})]}),g.jsx("span",{className:"k",children:"Agent models"}),g.jsx("span",{className:"v",children:o.models.length>0?`${o.models.length} available — ${o.models.slice(0,4).map(c=>Au(c.id)).join(", ")}${o.models.length>4?", …":""}`:"none"})]}),!o.agentReady&&o.agentNote&&g.jsx("p",{className:"settings-note",children:o.agentNote})]}):null:g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Detecting harnesses…"]})]})}function hL({s:e}){if(!e.configured)return g.jsx("span",{className:"badge",children:"not configured"});const t=e.preflight;return t.kubectlFound?t.reachable?t.canCreateJobs?g.jsx("span",{className:"badge ok",children:"connected"}):g.jsx("span",{className:"badge err",children:"no job-create permission"}):g.jsx("span",{className:"badge err",children:"cluster unreachable"}):g.jsx("span",{className:"badge err",children:"kubectl not found"})}function fL(){const[e,t]=G.useState(null),[n,r]=G.useState(null),[a,l]=G.useState(""),[u,o]=G.useState(""),[c,f]=G.useState(!1),[p,d]=G.useState(null),v=w=>{t(w),l(w.context??""),o(w.namespace)};G.useEffect(()=>{vT().then(v).catch(w=>r(w instanceof Error?w.message:String(w)))},[]);const _=e!==null&&a===(e.context??"")&&u.trim()===e.namespace;async function C(w){if(w.preventDefault(),!c){f(!0),d(null);try{v(await _T({context:a,namespace:u.trim()}))}catch(S){d(S instanceof Error?S.message:String(S))}finally{f(!1)}}}return g.jsxs(g.Fragment,{children:[g.jsxs("p",{className:"settings-sub",children:["Run on your own cluster with ",g.jsx("code",{children:"--backend k8s"}),". The run's resources (image, GPUs, topology) come from a manifest committed on the experiment branch (default ",g.jsx("code",{children:".orx/k8s.yaml"}),"); only the cluster context and namespace live here. Auth comes from your kubeconfig."]}),n?g.jsx("div",{className:"error",children:n}):e?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"kv",children:[g.jsx("span",{className:"k",children:"Cluster"}),g.jsx("span",{className:"v",children:g.jsx(hL,{s:e})})]}),e.preflight.error&&g.jsx("p",{className:"settings-note",children:e.preflight.error}),g.jsxs("form",{className:"form settings-form",onSubmit:C,children:[g.jsxs("div",{className:"row2",children:[g.jsxs("label",{children:["Context",g.jsxs("select",{value:a,onChange:w=>l(w.target.value),children:[g.jsxs("option",{value:"",children:["kubectl default",e.currentContext?` (${e.currentContext})`:""]}),e.contexts.map(w=>g.jsx("option",{value:w,children:w},w))]})]}),g.jsxs("label",{children:["Namespace",g.jsx("input",{className:"mono",type:"text",value:u,onChange:w=>o(w.target.value),placeholder:"default",autoComplete:"off",spellCheck:!1})]})]}),p&&g.jsx("div",{className:"error",children:p}),g.jsx("div",{className:"actions",children:g.jsx("button",{type:"submit",className:"btn primary",disabled:c||_,children:c?"Saving…":"Save"})})]}),g.jsxs("div",{className:"settings-card",children:[g.jsx("div",{className:"settings-card-head",children:g.jsx("h3",{children:"Run manifest"})}),g.jsxs("p",{className:"settings-sub",children:["Each run applies the manifest committed on its experiment branch — default"," ",g.jsx("code",{children:".orx/k8s.yaml"}),", or ",g.jsx("code",{children:"--manifest "}),". It declares whatever the run needs (image, GPU requests, an Indexed Job across nodes, extra Services, …); orx injects the run script as ",g.jsx("code",{children:"$ORX_SCRIPT"}),", the"," ",g.jsx("code",{children:"orx-env"})," Secret, run labels, and a default timeout, and requires exactly one Job (or one labelled ",g.jsx("code",{children:'orx-primary: "true"'}),") whose completion is the run's. Logs follow that Job's leader pod. Use"," ",g.jsx("code",{children:"{{ORX_RUN}}"})," in resource names to keep re-runs collision-free."]})]})]}):g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Checking kubectl…"]})]})}const dL={env:"MODAL_TOKEN_ID env var",syncedEnv:"~/.openresearch/env",modalToml:"~/.modal.toml (modal token new)"};function pL({s:e}){return e.ready?g.jsx("span",{className:"badge ok",children:"connected"}):!e.tokenConfigured&&!e.modalImportable?g.jsx("span",{className:"badge",children:"not set up"}):e.modalImportable?e.tokenConfigured?g.jsx("span",{className:"badge",children:"unknown"}):g.jsx("span",{className:"badge err",children:"no token"}):g.jsx("span",{className:"badge err",children:e.envProvisioned?"env broken":"env not built"})}function gL(){const[e,t]=G.useState(null),[n,r]=G.useState(null),[a,l]=G.useState(!1),[u,o]=G.useState(null);G.useEffect(()=>{yT().then(t).catch(f=>r(f instanceof Error?f.message:String(f)))},[]);async function c(){if(!a){l(!0),o(null);try{t(await bT())}catch(f){o(f instanceof Error?f.message:String(f))}finally{l(!1)}}}return g.jsxs(g.Fragment,{children:[g.jsxs("p",{className:"settings-sub",children:["Serverless GPUs on your own Modal account with"," ",g.jsx("code",{children:"--backend modal --flavor "})," (t4, a10g, a100-80gb, h100, …). orx manages a dedicated Python env with the Modal SDK; sandboxes scale to zero between runs."]}),n?g.jsx("div",{className:"error",children:n}):e?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"kv",children:[g.jsx("span",{className:"k",children:"Status"}),g.jsx("span",{className:"v",children:g.jsx(pL,{s:e})}),g.jsx("span",{className:"k",children:"Environment"}),g.jsx("span",{className:"v",children:e.modalImportable?"ready":e.envProvisioned?"provisioned (modal import failing)":"not built yet"}),g.jsx("span",{className:"k",children:"Token"}),g.jsx("span",{className:"v",children:e.tokenSource?dL[e.tokenSource]:"not configured"})]}),!e.tokenConfigured&&g.jsxs("p",{className:"settings-note",children:["No Modal token found. Run ",g.jsx("code",{children:"modal token new"}),", or add"," ",g.jsx("code",{children:"MODAL_TOKEN_ID"})," and ",g.jsx("code",{children:"MODAL_TOKEN_SECRET"})," in the Environment tab."]}),e.error&&e.envProvisioned&&!e.modalImportable&&g.jsx("p",{className:"settings-note",children:e.error}),u&&g.jsx("div",{className:"error",children:u}),!e.modalImportable&&g.jsx("div",{className:"actions",children:g.jsx("button",{className:"btn primary",onClick:()=>void c(),disabled:a,children:a?"Setting up… (~30–60s)":"Set up environment"})})]}):g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Checking Modal…"]})]})}function mL({test:e}){if(e===void 0)return g.jsx("span",{className:"muted",children:"never tested"});if(e==="testing")return g.jsx("span",{className:"spinner"});const t=e.reachable?e.gitFound?g.jsx("span",{className:"badge ok",children:"ready"}):g.jsx("span",{className:"badge err",children:"no git"}):g.jsx("span",{className:"badge err",title:e.error??void 0,children:"unreachable"});return g.jsxs(g.Fragment,{children:[t,g.jsx("span",{className:"ssh-tested-at",children:Aa(e.testedAt)})]})}function vL(){const[e,t]=G.useState(null),[n,r]=G.useState({});G.useEffect(()=>{kT().then(t).catch(()=>t([]))},[]);async function a(l){r(u=>({...u,[l]:"testing"}));try{const u=await AT(l);r(o=>({...o,[l]:u}))}catch(u){r(o=>({...o,[l]:{reachable:!1,gitFound:!1,error:u instanceof Error?u.message:String(u),testedAt:Date.now()}}))}}return g.jsxs(g.Fragment,{children:[g.jsxs("p",{className:"settings-sub",children:["Run experiments directly on your own boxes with"," ",g.jsx("code",{children:"--backend ssh --host "}),". Hosts come from"," ",g.jsx("code",{children:"~/.ssh/config"}),"; auth uses your keys/agent (orx never reads a key). The host just needs ",g.jsx("code",{children:"git"})," and ",g.jsx("code",{children:"bash"}),"."]}),e===null?g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Reading ~/.ssh/config…"]}):e.length===0?g.jsx("p",{className:"settings-empty",children:"No hosts found in ~/.ssh/config."}):g.jsxs("table",{className:"flavor-table ssh-table",children:[g.jsx("thead",{children:g.jsxs("tr",{children:[g.jsx("th",{children:"Host"}),g.jsx("th",{children:"Address"}),g.jsx("th",{children:"Identity"}),g.jsx("th",{children:"Status"}),g.jsx("th",{})]})}),g.jsx("tbody",{children:e.map(l=>g.jsxs("tr",{children:[g.jsx("td",{className:"mono",children:l.host}),g.jsxs("td",{className:"mono muted",children:[[l.user,l.hostname??"—"].filter(Boolean).join("@"),l.port?`:${l.port}`:""]}),g.jsx("td",{className:"mono muted",children:l.identityFile??"—"}),g.jsx("td",{children:g.jsx(mL,{test:n[l.host]??l.lastTest})}),g.jsx("td",{children:g.jsx("button",{className:"btn sm",onClick:()=>void a(l.host),disabled:n[l.host]==="testing",children:"Test"})})]},l.host))})]})]})}function _L({test:e}){return e===null?null:e==="testing"?g.jsx("span",{className:"spinner"}):e.reachable?e.slurmFound?e.gitFound?g.jsx("span",{className:"badge ok",children:"ready"}):g.jsx("span",{className:"badge err",children:"no git"}):g.jsx("span",{className:"badge err",children:"no slurm CLI"}):g.jsx("span",{className:"badge err",title:e.error??void 0,children:"unreachable"})}function yL(){const[e,t]=G.useState(null),[n,r]=G.useState(null),[a,l]=G.useState(""),[u,o]=G.useState(""),[c,f]=G.useState(""),[p,d]=G.useState(""),[v,_]=G.useState(!1),[C,w]=G.useState(null),[S,y]=G.useState(null),x=S!==null&&S!=="testing"?S:null,b=D=>{t(D),l(D.host??""),o(D.partition??""),f(D.account??""),d(D.timeLimit??"")};G.useEffect(()=>{NT().then(b).catch(D=>r(D instanceof Error?D.message:String(D)))},[]);const E=e!==null&&a===(e.host??"")&&u.trim()===(e.partition??"")&&c.trim()===(e.account??"")&&p.trim()===(e.timeLimit??"");async function R(D){if(D.preventDefault(),!v){_(!0),w(null);try{b(await TT({host:a,partition:u.trim(),account:c.trim(),timeLimit:p.trim()}))}catch(T){w(T instanceof Error?T.message:String(T))}finally{_(!1)}}}async function N(D){y("testing");try{y(await RT(D))}catch(T){y({reachable:!1,slurmFound:!1,gitFound:!1,partitions:[],error:T instanceof Error?T.message:String(T)})}}return g.jsxs(g.Fragment,{children:[g.jsxs("p",{className:"settings-sub",children:["Run on your own cluster with ",g.jsx("code",{children:"--backend slurm [--flavor h100:2]"}),". orx submits via ",g.jsx("code",{children:"sbatch"})," on the login node over ssh (auth is your keys/agent; orx never reads a key) and the job runs in your cluster environment. The defaults below apply when a launch doesn't override them."]}),n?g.jsx("div",{className:"error",children:n}):e?g.jsxs(g.Fragment,{children:[(x==null?void 0:x.error)&&g.jsx("p",{className:"settings-note",children:x.error}),x&&x.partitions.length>0&&g.jsxs("p",{className:"settings-note",children:["Partitions: ",g.jsx("code",{children:x.partitions.join(", ")})]}),g.jsxs("form",{className:"form settings-form",onSubmit:R,children:[g.jsxs("div",{className:"row2",children:[g.jsxs("label",{children:["Login node",g.jsxs("select",{value:a,onChange:D=>{l(D.target.value),y(null)},children:[g.jsx("option",{value:"",children:"not set (pass --host per launch)"}),a&&!e.hosts.some(D=>D.host===a)&&g.jsxs("option",{value:a,children:[a," (not in ~/.ssh/config)"]}),e.hosts.map(D=>g.jsx("option",{value:D.host,children:D.host},D.host))]})]}),g.jsxs("label",{children:["Partition",g.jsx("input",{className:"mono",type:"text",list:"slurm-partitions",value:u,onChange:D=>o(D.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1}),g.jsx("datalist",{id:"slurm-partitions",children:x==null?void 0:x.partitions.map(D=>g.jsx("option",{value:D},D))})]})]}),g.jsxs("div",{className:"row2",children:[g.jsxs("label",{children:["Account",g.jsx("input",{className:"mono",type:"text",value:c,onChange:D=>f(D.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1})]}),g.jsxs("label",{children:["Time limit",g.jsx("input",{className:"mono",type:"text",value:p,onChange:D=>d(D.target.value),placeholder:"cluster default (e.g. 4h, 30m)",autoComplete:"off",spellCheck:!1})]})]}),C&&g.jsx("div",{className:"error",children:C}),g.jsxs("div",{className:"actions",children:[g.jsx("button",{type:"submit",className:"btn primary",disabled:v||E,children:v?"Saving…":"Save"}),g.jsx("button",{type:"button",className:"btn",onClick:()=>void N(a),disabled:!a||S==="testing",title:a?void 0:"Pick a login node first",children:"Test connection"}),g.jsx(_L,{test:S})]})]})]}):g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Loading slurm settings…"]})]})}function bL(){const[e,t]=G.useState(null),[n,r]=G.useState(null);return G.useEffect(()=>{MT().then(t).catch(a=>r(a instanceof Error?a.message:String(a)))},[]),g.jsxs(g.Fragment,{children:[g.jsxs("p",{className:"settings-sub",children:["Run experiments as detached, supervised processes on the machine running orx with"," ",g.jsx("code",{children:"--backend local"})," — handy when you're already on a GPU box and using this dashboard over port forwarding. Runs share CPU/RAM/GPU with the dashboard itself, so prefer a remote backend for anything heavy."]}),n?g.jsx("div",{className:"error",children:n}):e?g.jsxs("div",{className:"kv",children:[g.jsx("span",{className:"k",children:"Hostname"}),g.jsx("span",{className:"v mono",children:e.hostname}),g.jsx("span",{className:"k",children:"System"}),g.jsxs("span",{className:"v",children:[e.os,"/",e.arch,e.chip?` — ${e.chip}`:""]}),g.jsx("span",{className:"k",children:"CPU"}),g.jsx("span",{className:"v",children:e.cpuCount>0?`${e.cpuCount} cores`:"—"}),g.jsx("span",{className:"k",children:"RAM"}),g.jsx("span",{className:"v",children:e.memBytes!==null?ls(e.memBytes):"—"}),g.jsx("span",{className:"k",children:"GPUs"}),g.jsx("span",{className:"v",children:e.gpus.length===0?"none detected (nvidia-smi)":e.gpus.map(a=>`${a.name}${a.memMib!==null?` — ${ls(a.memMib*1024*1024)}`:""}`).join(", ")})]}):g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Detecting hardware…"]})]})}function SL(){const[e,t]=G.useState(null),[n,r]=G.useState(null);return G.useEffect(()=>{jT().then(t).catch(a=>r(a instanceof Error?a.message:String(a)))},[]),g.jsxs(g.Fragment,{children:[g.jsxs("p",{className:"settings-sub",children:["Run on an ephemeral OpenResearch box billed to your org with"," ",g.jsx("code",{children:"--backend openresearch --flavor "})," (h100_sxm, cpu5c, …; browse with ",g.jsx("code",{children:"orx compute"}),"). The box is provisioned for the run and deleted when it ends. Needs ",g.jsx("code",{children:"orx login"})," and a registered SSH key."]}),n?g.jsx("div",{className:"error",children:n}):e?e.loggedIn?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"kv",children:[g.jsx("span",{className:"k",children:"Status"}),g.jsx("span",{className:"v",children:g.jsx("span",{className:"badge ok",children:"signed in"})}),g.jsx("span",{className:"k",children:"Orgs"}),g.jsx("span",{className:"v",children:e.orgs.length>0?e.orgs.join(", "):"—"}),g.jsx("span",{className:"k",children:"SSH key"}),g.jsx("span",{className:"v",children:e.sshKeyRegistered===!0?g.jsx("span",{className:"badge ok",children:"registered"}):e.sshKeyRegistered===!1?g.jsx("span",{className:"badge err",children:"none registered"}):g.jsx("span",{className:"badge",children:"unknown"})})]}),e.sshKeyRegistered===!1&&g.jsxs("p",{className:"settings-note",children:["Launches need a registered SSH key. Add one with"," ",g.jsx("code",{children:"orx ssh-key add ~/.ssh/id_ed25519.pub"}),"."]}),e.error&&g.jsx("p",{className:"settings-note",children:e.error})]}):g.jsxs("p",{className:"settings-note",children:["Not signed in. Run ",g.jsx("code",{children:"orx login"})," in a terminal to connect your OpenResearch account."]}):g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Checking credentials…"]})]})}const Q1={local:"This machine",hf:"HF Jobs",modal:"Modal",k8s:"Kubernetes",ssh:"SSH",slurm:"Slurm",openresearch:"OpenResearch"},xL={local:"local_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",openresearch:"openresearch_job"},wL=["hf","modal","slurm","openresearch"],J1=["hf","modal","openresearch"],eb={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]};function CL({t:e,isDefault:t}){return e.id==="local"?g.jsx("span",{className:"badge ok",children:"ready"}):!e.configured&&t?g.jsx("span",{className:"badge warn",children:"not configured"}):e.configured?g.jsx("span",{className:"badge ok",children:"configured"}):g.jsx("span",{className:"badge",children:"not set up"})}function EL({target:e,flavor:t,onSaved:n}){var d;const[r,a]=G.useState(t??""),[l,u]=G.useState(!1),[o,c]=G.useState(null);G.useEffect(()=>a(t??""),[t]);async function f(v){if(v.preventDefault(),!l){u(!0),c(null);try{n(await gx({backend:e,flavor:r.trim()||null}))}catch(_){c(_ instanceof Error?_.message:String(_))}finally{u(!1)}}}const p=r.trim()===(t??"");return g.jsxs("form",{className:"form settings-form compute-flavor-form",onSubmit:f,children:[g.jsxs("label",{children:["Default flavor",g.jsx("input",{className:"mono",type:"text",list:`flavors-${e}`,value:r,onChange:v=>a(v.target.value),placeholder:J1.includes(e)?`e.g. ${((d=eb[e])==null?void 0:d[1])??""}`:"none (CPU-only)",autoComplete:"off",spellCheck:!1}),g.jsx("datalist",{id:`flavors-${e}`,children:(eb[e]??[]).map(v=>g.jsx("option",{value:v},v))})]}),o&&g.jsx("div",{className:"error",children:o}),g.jsxs("div",{className:"actions",children:[g.jsx("button",{type:"submit",className:"btn sm",disabled:l||p,children:l?"Saving…":"Save flavor"}),J1.includes(e)&&!t&&g.jsxs("span",{className:"muted compute-flavor-hint",children:["This backend requires a flavor — without a default one, each launch must pass"," ",g.jsx("code",{children:"--flavor"}),"."]})]})]})}function kL({target:e,isDefault:t,defaultFlavor:n,open:r,onToggle:a,onSettings:l,onError:u}){const[o,c]=G.useState(!1),[f,p]=G.useState(!1);r&&!o&&c(!0);async function d(v){if(!f){p(!0);try{l(await gx({backend:v}))}catch(_){u(_ instanceof Error?_.message:String(_))}finally{p(!1)}}}return g.jsxs("div",{className:`compute-row${r?" open":""}`,children:[g.jsxs("div",{className:"compute-row-head",onClick:a,children:[g.jsx("span",{className:"compute-row-logo",children:g.jsx(zw,{kind:xL[e.id],size:18})}),g.jsx("span",{className:"compute-row-name",children:Q1[e.id]}),g.jsx("span",{className:"compute-row-summary",children:e.summary}),g.jsx(CL,{t:e,isDefault:t}),t?g.jsx("span",{className:"badge compute-default-pill",children:"Default"}):g.jsx("button",{type:"button",className:"btn sm compute-make-default",onClick:v=>{v.stopPropagation(),d(e.id)},disabled:f,children:"Make default"}),g.jsx("button",{type:"button",className:"compute-chevron-btn","aria-expanded":r,"aria-label":`${r?"Collapse":"Expand"} ${Q1[e.id]}`,onClick:v=>{v.stopPropagation(),a()},children:g.jsx(gs,{size:16,className:"compute-chevron"})})]}),o&&g.jsxs("div",{className:"compute-row-body",hidden:!r,children:[t&&g.jsxs("p",{className:"settings-note compute-default-note",children:["The agent launches runs here unless you tell it otherwise, and so does"," ",g.jsx("code",{children:"orx exp run"})," with no ",g.jsx("code",{children:"--backend"})," flag."," ",g.jsx("button",{type:"button",className:"btn sm",onClick:()=>void d(null),disabled:f,children:"Clear default"})]}),t&&!e.configured&&g.jsx("p",{className:"settings-note",children:"This target is the default but isn't configured — launches will fail until it's set up below."}),t&&wL.includes(e.id)&&g.jsx(EL,{target:e.id,flavor:n,onSaved:l}),e.id==="local"&&g.jsx(bL,{}),e.id==="hf"&&g.jsx(DL,{}),e.id==="modal"&&g.jsx(gL,{}),e.id==="k8s"&&g.jsx(fL,{}),e.id==="ssh"&&g.jsx(vL,{}),e.id==="slurm"&&g.jsx(yL,{}),e.id==="openresearch"&&g.jsx(SL,{})]})]})}function AL(){const[e,t]=G.useState(null),[n,r]=G.useState(null),[a,l]=G.useState(null),[u,o]=G.useState(null),c=G.useRef(0);G.useEffect(()=>{const d=++c.current;DT().then(v=>{d===c.current&&(t(v),r(null))}).catch(v=>{if(d!==c.current)return;const _=v instanceof Error?v.message:String(v);t(C=>(C===null?r(_):o(_),C))})},[a]);const f=d=>{c.current++,t(d),o(null)},p=e?e.targets:null;return g.jsxs(g.Fragment,{children:[g.jsx("h1",{children:"Compute"}),g.jsxs("p",{className:"settings-sub",children:["Where ",g.jsx("code",{children:"orx exp run"})," executes. Pick a default target; the agent uses it when a launch doesn't name a backend (",g.jsx("code",{children:"--backend "})," always wins)."]}),n?g.jsx("div",{className:"error",children:n}):p?g.jsxs(g.Fragment,{children:[u&&g.jsx("div",{className:"error",children:u}),g.jsx("div",{className:"compute-list",children:p.map(d=>g.jsx(kL,{target:d,isDefault:(e==null?void 0:e.defaultBackend)===d.id,defaultFlavor:(e==null?void 0:e.defaultFlavor)??null,open:a===d.id,onToggle:()=>l(v=>v===d.id?null:d.id),onSettings:f,onError:o},d.id))}),g.jsxs("p",{className:"compute-footnote",children:[g.jsx(TN,{size:14,"aria-hidden":"true"}),g.jsx("span",{children:"The default target and flavor are included in the research agent's instructions — it launches runs there unless you name another backend. No other compute settings are shared with it."})]})]}):g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Checking compute targets…"]})]})}const NL={env:"HF_TOKEN env var",openresearchEnv:"~/.openresearch/env",hfCache:"~/.cache/huggingface/token (hf auth login)"};function TL({settings:e}){return e.configured?e.valid?g.jsx("span",{className:"badge ok",children:"connected"}):g.jsx("span",{className:"badge err",children:"invalid token"}):g.jsx("span",{className:"badge",children:"not configured"})}function RL({settings:e}){return!e.configured||!e.valid?null:e.jobsWrite===!0?g.jsx("span",{className:"badge ok",children:"jobs: write OK"}):e.jobsWrite===!1?g.jsx("span",{className:"badge err",children:"no job.write permission"}):g.jsx("span",{className:"badge",children:"jobs permission unknown"})}function DL(){const[e,t]=G.useState(null),[n,r]=G.useState(null),[a,l]=G.useState(""),[u,o]=G.useState(!1),[c,f]=G.useState(null),p=G.useRef(!1);G.useEffect(()=>{gT().then(v=>{p.current||t(v)}).catch(v=>{p.current||r(v instanceof Error?v.message:String(v))})},[]);async function d(v){if(v.preventDefault(),!(!a.trim()||u)){o(!0),f(null);try{const _=await mT(a.trim());p.current=!0,t(_),r(null),l("")}catch(_){f(_ instanceof Error?_.message:String(_))}finally{o(!1)}}}return g.jsxs(g.Fragment,{children:[g.jsxs("p",{className:"settings-sub",children:["Run experiments on your Hugging Face account with"," ",g.jsx("code",{children:"--backend hf --flavor "})," (t4-small, a10g-small, a100-large, …). Billed to HF per minute."]}),n?g.jsx("div",{className:"error",children:n}):e?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"kv",children:[g.jsx("span",{className:"k",children:"Status"}),g.jsx("span",{className:"v",children:g.jsx(TL,{settings:e})}),g.jsx("span",{className:"k",children:"Account"}),g.jsx("span",{className:"v",children:e.username??"—"}),g.jsx("span",{className:"k",children:"Token"}),g.jsx("span",{className:"v",children:e.maskedToken??"—"}),g.jsx("span",{className:"k",children:"Source"}),g.jsx("span",{className:"v",children:e.source?NL[e.source]:"not configured"}),g.jsx("span",{className:"k",children:"Jobs"}),g.jsxs("span",{className:"v",children:[g.jsx(RL,{settings:e}),(!e.configured||!e.valid)&&"—"]})]}),e.source==="env"&&g.jsx("p",{className:"settings-note",children:"HF_TOKEN is set in the environment and overrides any token saved here."}),e.valid&&e.jobsWrite===null&&g.jsxs("p",{className:"settings-note",children:["This token is valid but doesn't report whether it can launch Jobs — OAuth tokens from ",g.jsx("code",{children:"hf auth login"})," never do. Launches may still work; for a definitive check, save a write-scoped token from"," ",g.jsx("a",{href:"https://huggingface.co/settings/tokens",target:"_blank",rel:"noreferrer",children:"huggingface.co/settings/tokens"}),"."]})]}):g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Loading status…"]}),g.jsxs("form",{className:"form settings-form",onSubmit:d,children:[g.jsxs("label",{children:[e!=null&&e.configured?"Replace token":"New token",g.jsx("input",{type:"password",value:a,onChange:v=>l(v.target.value),placeholder:"hf_…",autoComplete:"off"})]}),c&&g.jsx("div",{className:"error",children:c}),g.jsx("div",{className:"actions",children:g.jsx("button",{type:"submit",className:"btn primary",disabled:!a.trim()||u,children:u?"Validating…":"Save"})})]})]})}const Hw=/^hf_[A-Za-z0-9]{10,}$/;function Fw(){return g.jsx("tr",{children:g.jsx("td",{colSpan:3,children:g.jsxs("p",{className:"settings-note",children:["This value looks like a Hugging Face token — compute runs only read it from"," ",g.jsx("code",{children:"HF_TOKEN"}),". Save it under that key if it's meant for HF Jobs."]})})})}const tb=["HF_TOKEN","WANDB_API_KEY"];function ML({name:e,entry:t,onVars:n,onError:r}){const[a,l]=G.useState(""),[u,o]=G.useState(!1),c=d=>r(`${e}: ${d instanceof Error?d.message:String(d)}`);async function f(){if(!(!a.trim()||u)){o(!0);try{n(await dx(e,a.trim())),l("")}catch(d){c(d)}finally{o(!1)}}}async function p(){if(!u){o(!0);try{n(await xT(e))}catch(d){c(d)}finally{o(!1)}}}return g.jsxs(g.Fragment,{children:[g.jsxs("tr",{children:[g.jsx("td",{className:"mono",children:e}),g.jsx("td",{className:"mono muted",children:t?g.jsxs(g.Fragment,{children:[t.maskedValue,t.inProcessEnv&&g.jsx("span",{className:"badge",children:"overridden by env"})]}):g.jsx("input",{className:"mono",type:"password",value:a,onChange:d=>l(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),f()),d.key==="Escape"&&!u&&l("")},placeholder:"value","aria-label":`Value for ${e}`,autoComplete:"new-password",disabled:u})}),g.jsx("td",{children:t?g.jsx("button",{className:"icon-btn",title:`Delete ${e}`,"aria-label":`Delete ${e}`,onClick:()=>void p(),disabled:u,children:g.jsx(Mg,{size:13})}):a.trim()&&g.jsx("button",{className:"btn sm",onClick:()=>void f(),disabled:u,children:u?"Saving…":"Save"})})]}),!t&&e!=="HF_TOKEN"&&Hw.test(a.trim())&&g.jsx(Fw,{})]})}function jL({onVars:e,onError:t,onDone:n}){const[r,a]=G.useState(""),[l,u]=G.useState(""),[o,c]=G.useState(!1);async function f(){if(!(!r.trim()||!l.trim()||o)){c(!0);try{e(await dx(r.trim(),l.trim())),n()}catch(d){t(`${r.trim()}: ${d instanceof Error?d.message:String(d)}`)}finally{c(!1)}}}const p=d=>{d.key==="Enter"&&(d.preventDefault(),f()),d.key==="Escape"&&!o&&n()};return g.jsxs(g.Fragment,{children:[g.jsxs("tr",{children:[g.jsx("td",{children:g.jsx("input",{autoFocus:!0,className:"mono",type:"text",value:r,onChange:d=>a(d.target.value),onKeyDown:p,placeholder:"MY_API_KEY","aria-label":"New variable key",autoComplete:"off",spellCheck:!1,disabled:o})}),g.jsx("td",{children:g.jsx("input",{className:"mono",type:"password",value:l,onChange:d=>u(d.target.value),onKeyDown:p,placeholder:"value","aria-label":"New variable value",autoComplete:"new-password",disabled:o})}),g.jsxs("td",{children:[g.jsx("button",{className:"btn sm",onClick:()=>void f(),disabled:o||!r.trim()||!l.trim(),children:o?"Saving…":"Save"}),g.jsx("button",{className:"icon-btn",title:"Cancel","aria-label":"Cancel new variable",onClick:n,disabled:o,children:g.jsx(va,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&Hw.test(l.trim())&&g.jsx(Fw,{})]})}function LL(){const[e,t]=G.useState(null),[n,r]=G.useState(null),[a,l]=G.useState(!1),[u,o]=G.useState(null);G.useEffect(()=>{ST().then(t).catch(d=>r(d instanceof Error?d.message:String(d)))},[]);const c=d=>{t(d),o(null)},f=e===null?[]:e.map(d=>d.key).filter(d=>!tb.includes(d)),p=[...tb,...f];return g.jsxs("div",{className:"settings-card",children:[g.jsxs("div",{className:"settings-card-head",children:[g.jsx("h3",{children:"Environment variables"}),g.jsx("div",{className:"spacer",style:{flex:1}}),g.jsxs("button",{className:"btn sm",onClick:()=>l(!0),disabled:a||e===null,children:[g.jsx(Rg,{size:12})," Add variable"]})]}),g.jsxs("p",{className:"settings-sub",children:["Stored in ",g.jsx("code",{children:"~/.openresearch/env"})," and passed to runs and the research agent."," ",g.jsx("code",{children:"HF_TOKEN"})," and ",g.jsx("code",{children:"WANDB_API_KEY"})," are always listed since runs typically need them. Variables set in orx's own environment win on conflicts."]}),n?g.jsx("div",{className:"error",children:n}):e===null?g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Loading…"]}):g.jsx("table",{className:"env-table",children:g.jsxs("tbody",{children:[p.map(d=>g.jsx(ML,{name:d,entry:e.find(v=>v.key===d),onVars:c,onError:o},d)),a&&g.jsx(jL,{onVars:c,onError:o,onDone:()=>l(!1)})]})}),u&&g.jsx("div",{className:"error",children:u})]})}function OL(){const[e,t]=G.useState(null),[n,r]=G.useState(""),[a,l]=G.useState(""),[u,o]=G.useState(!1),[c,f]=G.useState(null);G.useEffect(()=>{mx().then(v=>{t(v),r(v.userName??""),l(v.userEmail??"")}).catch(()=>{})},[]);const p=e!==null&&n.trim()===(e.userName??"")&&a.trim()===(e.userEmail??"");async function d(v){if(v.preventDefault(),!(u||p)){o(!0),f(null);try{const _=await BT({userName:n.trim(),userEmail:a.trim()});t(_),r(_.userName??""),l(_.userEmail??"")}catch(_){f(_ instanceof Error?_.message:String(_))}finally{o(!1)}}}return g.jsxs(g.Fragment,{children:[g.jsx("h1",{children:"Git"}),g.jsx("p",{className:"settings-sub",children:"Experiment branches are committed and pushed from local clones with this identity."}),e?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"settings-card",children:[g.jsx("h3",{children:"Identity"}),g.jsxs("form",{className:"form",onSubmit:d,children:[g.jsxs("div",{className:"row2",children:[g.jsxs("label",{children:["user.name",g.jsx("input",{type:"text",value:n,onChange:v=>r(v.target.value),autoComplete:"off"})]}),g.jsxs("label",{children:["user.email",g.jsx("input",{type:"text",value:a,onChange:v=>l(v.target.value),autoComplete:"off"})]})]}),c&&g.jsx("div",{className:"error",children:c}),g.jsx("div",{className:"actions",children:g.jsx("button",{type:"submit",className:"btn primary",disabled:u||p||!n.trim()&&!a.trim(),children:u?"Saving…":"Save"})})]})]}),g.jsxs("div",{className:"settings-card",children:[g.jsx("h3",{children:"GitHub access"}),g.jsxs("div",{className:"kv",children:[g.jsx("span",{className:"k",children:"git"}),g.jsx("span",{className:"v",children:e.gitVersion??"not found"}),g.jsx("span",{className:"k",children:"Token"}),g.jsx("span",{className:"v",children:e.githubTokenSource==="env"?"GITHUB_TOKEN env var":e.githubTokenSource==="stored"?"token saved in orx":e.githubTokenSource==="gh"?"gh CLI (gh auth token)":"none found"})]}),!e.githubTokenSource&&g.jsxs(g.Fragment,{children:[g.jsxs("p",{className:"settings-note",children:["No GitHub token found — private repo clones and branch pushes will fail. Run"," ",g.jsx("code",{children:"gh auth login"}),", or paste a personal access token:"]}),g.jsx(Iw,{onSaved:t})]}),e.githubTokenSource==="stored"&&g.jsx("div",{className:"actions",children:g.jsx("button",{className:"btn",onClick:()=>{zT().then(t).catch(()=>{})},children:"Remove saved token"})})]})]}):g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Loading…"]})]})}function BL({value:e,max:t,label:n}){const r=t>0?Math.min(100,Math.round(e/t*100)):0;return g.jsxs("div",{className:"progress",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:[g.jsx("div",{className:"progress-track",children:g.jsx("div",{className:"progress-fill",style:{width:`${r}%`}})}),g.jsxs("div",{className:"progress-caption",children:[g.jsx("span",{children:n??`${r}%`}),t>0&&g.jsxs("span",{className:"mono",children:[ls(e)," / ",ls(t)]})]})]})}const IL={env:"ORX_DATA_DIR environment variable",config:"your saved setting",xdg:"XDG_DATA_HOME",default:"default location"};function zL(){const[e,t]=G.useState(null),[n,r]=G.useState(null),[a,l]=G.useState(""),[u,o]=G.useState(!1),[c,f]=G.useState(null),[p,d]=G.useState({kind:"idle"}),[v,_]=G.useState(null),C=()=>px().then(E=>{t(E),l(R=>R||E.current)}).catch(E=>r(E instanceof Error?E.message:String(E)));G.useEffect(()=>{C()},[]),G.useEffect(()=>e3(E=>{E.type==="progress"?d(R=>{const N=R.kind==="moving"?R.total:0;return{kind:"moving",phase:E.phase,copied:E.copiedBytes,total:E.totalBytes||N}}):E.type==="done"?(d({kind:"done",oldPathLeft:E.oldPathLeft}),f(null),l(""),C()):E.type==="error"&&d({kind:"error",message:E.error})}),[]);const w=(e==null?void 0:e.source)==="env",S=a.trim(),y=e!==null&&S===e.current;async function x(){if(!(u||!S)){o(!0),_(null),f(null);try{f(await wT(S))}catch(E){_(E instanceof Error?E.message:String(E))}finally{o(!1)}}}async function b(E){if(E.preventDefault(),!(p.kind==="moving"||!S||y)&&(_(null),!!window.confirm(`Move all orx data to: +|(?![\\s\\S])))+`,"m"),alias:l,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(t.languages.diff,"PREFIXES",{value:n})})(e)}nm.displayName="go";nm.aliases=[];function nm(e){e.register(pi),e.languages.go=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}im.displayName="ini";im.aliases=[];function im(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}rm.displayName="java";rm.aliases=[];function rm(e){e.register(pi),(function(t){var n=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,a={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[a,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:a.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:a.inside}],keyword:n,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":a,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:a.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:a.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(//g,function(){return n.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}sm.displayName="regex";sm.aliases=[];function sm(e){(function(t){var n={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,a={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},l={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},u="(?:[^\\\\-]|"+r.source+")",o=RegExp(u+"-"+u),c={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};t.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:o,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,"char-set":l,escape:r}},"special-escape":n,"char-set":a,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":c}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]||&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}am.displayName="json";am.aliases=["webmanifest"];function am(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}om.displayName="kotlin";om.aliases=["kt","kts"];function om(e){e.register(pi),(function(t){t.languages.kotlin=t.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete t.languages.kotlin["class-name"];var n={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:t.languages.kotlin}};t.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:n},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:n},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete t.languages.kotlin.string,t.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),t.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),t.languages.kt=t.languages.kotlin,t.languages.kts=t.languages.kotlin})(e)}lm.displayName="less";lm.aliases=[];function lm(e){e.register(Ra),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}cm.displayName="lua";cm.aliases=[];function cm(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}um.displayName="makefile";um.aliases=[];function um(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}hm.displayName="yaml";hm.aliases=["yml"];function hm(e){(function(t){var n=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,a="(?:"+r.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+r.source+")?)",l=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),u=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function o(c,f){f=(f||"").replace(/m/g,"")+"m";var p=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,function(){return a}).replace(/<>/g,function(){return c});return RegExp(p,f)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,function(){return a})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,function(){return a}).replace(/<>/g,function(){return"(?:"+l+"|"+u+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:o(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:o(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:o(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:o(u),lookbehind:!0,greedy:!0},number:{pattern:o(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(e)}fm.displayName="markdown";fm.aliases=["md"];function fm(e){e.register(gl),(function(t){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(o){return o=o.replace(//g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+o+")")}var a=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,l=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return a}),u=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+l+u+"(?:"+l+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+l+u+")(?:"+l+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(a),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+l+")"+u+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+l+"$"),inside:{"table-header":{pattern:RegExp(a),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(o){["url","bold","italic","strike","code-snippet"].forEach(function(c){o!==c&&(t.languages.markdown[o].inside.content.inside[c]=t.languages.markdown[c])})}),t.hooks.add("after-tokenize",function(o){if(o.language!=="markdown"&&o.language!=="md")return;function c(f){if(!(!f||typeof f=="string"))for(var p=0,d=f.length;p]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}pm.displayName="perl";pm.aliases=[];function pm(e){(function(t){var n=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;t.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,n].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,n].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,n+/\s*/.source+n].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}ah.displayName="markup-templating";ah.aliases=[];function ah(e){e.register(gl),(function(t){function n(r,a){return"___"+r.toUpperCase()+a+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,a,l,u){if(r.language===a){var o=r.tokenStack=[];r.code=r.code.replace(l,function(c){if(typeof u=="function"&&!u(c))return c;for(var f=o.length,p;r.code.indexOf(p=n(a,f))!==-1;)++f;return o[f]=c,p}),r.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(r,a){if(r.language!==a||!r.tokenStack)return;r.grammar=t.languages[a];var l=0,u=Object.keys(r.tokenStack);function o(c){for(var f=0;f=u.length);f++){var p=c[f];if(typeof p=="string"||p.content&&typeof p.content=="string"){var d=u[l],v=r.tokenStack[d],_=typeof p=="string"?p:p.content,C=n(a,d),w=_.indexOf(C);if(w>-1){++l;var S=_.substring(0,w),y=new t.Token(a,t.tokenize(v,r.grammar),"language-"+a,v),x=_.substring(w+C.length),b=[];S&&b.push.apply(b,o([S])),b.push(y),x&&b.push.apply(b,o([x])),typeof p=="string"?c.splice.apply(c,[f,1].concat(b)):p.content=b}}else p.content&&o(p.content)}return c}o(r.tokens)}}})})(e)}gm.displayName="php";gm.aliases=[];function gm(e){e.register(ah),(function(t){var n=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],a=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,l=/|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,u=/[{}\[\](),:;]/;t.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:n,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:a,operator:l,punctuation:u};var o={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:t.languages.php},c=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:o}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:o}}];t.languages.insertBefore("php","variable",{string:c,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:n,string:c,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:a,operator:l,punctuation:u}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(f){if(/<\?/.test(f.code)){var p=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;t.languages["markup-templating"].buildPlaceholders(f,"php",p)}}),t.hooks.add("after-tokenize",function(f){t.languages["markup-templating"].tokenizePlaceholders(f,"php")})})(e)}mm.displayName="python";mm.aliases=["py"];function mm(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}vm.displayName="r";vm.aliases=[];function vm(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}_m.displayName="ruby";_m.aliases=["rb"];function _m(e){e.register(pi),(function(t){t.languages.ruby=t.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===||[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),t.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var n={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:t.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete t.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",a=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;t.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+a),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+a+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),t.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete t.languages.ruby.string,t.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),t.languages.rb=t.languages.ruby})(e)}ym.displayName="rust";ym.aliases=[];function ym(e){(function(t){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|)*\*\//.source,r=0;r<2;r++)n=n.replace(//g,function(){return n});n=n.replace(//g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string})(e)}bm.displayName="sass";bm.aliases=[];function bm(e){e.register(Ra),(function(t){t.languages.sass=t.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),t.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete t.languages.sass.atrule;var n=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];t.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:n,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:n,operator:r,important:t.languages.sass.important}}}),delete t.languages.sass.property,delete t.languages.sass.important,t.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}Sm.displayName="scss";Sm.aliases=[];function Sm(e){e.register(Ra),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}xm.displayName="sql";xm.aliases=[];function xm(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}wm.displayName="swift";wm.aliases=[];function wm(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach(function(t){t.inside.interpolation.inside=e.languages.swift})}Cm.displayName="typescript";Cm.aliases=["ts"];function Cm(e){e.register(sh),(function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var n=t.languages.extend("typescript",{});delete n["class-name"],t.languages.typescript["class-name"].inside=n,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n}}}}),t.languages.ts=t.languages.typescript})(e)}oh.displayName="basic";oh.aliases=[];function oh(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}Em.displayName="vbnet";Em.aliases=[];function Em(e){e.register(oh),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}const V1=/[#.]/g;function kj(e,t){const n=e||"",r={};let a=0,l,u;for(;a=48&&t<=57}function Lj(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function Oj(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function X1(e){return Oj(e)||Dw(e)}const Bj=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Ij(e,t){const n={},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,a=[];let l=0,u=-1,o="",c,f;n.position&&("start"in n.position||"indent"in n.position?(f=n.position.indent,c=n.position.start):c=n.position);let p=(c?c.line:0)||1,d=(c?c.column:0)||1,v=C(),_;for(l--;++l<=e.length;)if(_===10&&(d=(f?f[u]:0)||1),_=e.charCodeAt(l),_===38){const y=e.charCodeAt(l+1);if(y===9||y===10||y===12||y===32||y===38||y===60||Number.isNaN(y)||r&&y===r){o+=String.fromCharCode(_),d++;continue}const x=l+1;let b=x,E=x,D;if(y===35){E=++b;const F=e.charCodeAt(E);F===88||F===120?(D="hexadecimal",E=++b):D="decimal"}else D="named";let N="",R="",T="";const j=D==="named"?X1:D==="decimal"?Dw:Lj;for(E--;++E<=e.length;){const F=e.charCodeAt(E);if(!j(F))break;T+=String.fromCharCode(F),D==="named"&&jj.includes(T)&&(N=T,R=Wo(T))}let B=e.charCodeAt(E)===59;if(B){E++;const F=D==="named"?Wo(T):!1;F&&(N=T,R=F)}let z=1+E-x,V="";if(!(!B&&n.nonTerminated===!1))if(!T)D!=="named"&&w(4,z);else if(D==="named"){if(B&&!R)w(5,1);else if(N!==T&&(E=b+N.length,z=1+E-b,B=!1),!B){const F=N?1:3;if(n.attribute){const P=e.charCodeAt(E);P===61?(w(F,z),R=""):X1(P)?R="":w(F,z)}else w(F,z)}V=R}else{B||w(2,z);let F=Number.parseInt(T,D==="hexadecimal"?16:10);if(zj(F))w(7,z),V="�";else if(F in Y1)w(6,z),V=Y1[F];else{let P="";Hj(F)&&w(6,z),F>65535&&(F-=65536,P+=String.fromCharCode(F>>>10|55296),F=56320|F&1023),V=P+String.fromCharCode(F)}}if(V){S(),v=C(),l=E-1,d+=E-x+1,a.push(V);const F=C();F.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,V,{start:v,end:F},e.slice(x-1,E)),v=F}else T=e.slice(x-1,E),o+=T,d+=T.length,l=E-1}else _===10&&(p++,u++,d=0),Number.isNaN(_)?S():(o+=String.fromCharCode(_),d++);return a.join("");function C(){return{line:p,column:d,offset:l+((c?c.offset:0)||0)}}function w(y,x){let b;n.warning&&(b=C(),b.column+=x,b.offset+=x,n.warning.call(n.warningContext||void 0,Bj[y],b,y))}function S(){o&&(a.push(o),n.text&&n.text.call(n.textContext||void 0,o,{start:v,end:C()}),o="")}}function zj(e){return e>=55296&&e<=57343||e>1114111}function Hj(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var Fj=0,Wc={},Vt={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++Fj}),e.__id},clone:function e(t,n){n=n||{};var r,a;switch(Vt.util.type(t)){case"Object":if(a=Vt.util.objId(t),n[a])return n[a];r={},n[a]=r;for(var l in t)t.hasOwnProperty(l)&&(r[l]=e(t[l],n));return r;case"Array":return a=Vt.util.objId(t),n[a]?n[a]:(r=[],n[a]=r,t.forEach(function(u,o){r[o]=e(u,n)}),r);default:return t}}},languages:{plain:Wc,plaintext:Wc,text:Wc,txt:Wc,extend:function(e,t){var n=Vt.util.clone(Vt.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r=r||Vt.languages;var a=r[e],l={};for(var u in a)if(a.hasOwnProperty(u)){if(u==t)for(var o in n)n.hasOwnProperty(o)&&(l[o]=n[o]);n.hasOwnProperty(u)||(l[u]=a[u])}var c=r[e];return r[e]=l,Vt.languages.DFS(Vt.languages,function(f,p){p===c&&f!=e&&(this[f]=l)}),l},DFS:function e(t,n,r,a){a=a||{};var l=Vt.util.objId;for(var u in t)if(t.hasOwnProperty(u)){n.call(t,u,t[u],r||u);var o=t[u],c=Vt.util.type(o);c==="Object"&&!a[l(o)]?(a[l(o)]=!0,e(o,n,null,a)):c==="Array"&&!a[l(o)]&&(a[l(o)]=!0,e(o,n,u,a))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(Vt.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Vt.tokenize(r.code,r.grammar),Vt.hooks.run("after-tokenize",r),$o.stringify(Vt.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var a=new Pj;return vu(a,a.head,e),Rw(e,a,t,a.head,0),Uj(a)},hooks:{all:{},add:function(e,t){var n=Vt.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=Vt.hooks.all[e];if(!(!n||!n.length))for(var r=0,a;a=n[r++];)a(t)}},Token:$o};function $o(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||"").length|0}function K1(e,t,n,r){e.lastIndex=t;var a=e.exec(n);if(a&&r&&a[1]){var l=a[1].length;a.index+=l,a[0]=a[0].slice(l)}return a}function Rw(e,t,n,r,a,l){for(var u in n)if(!(!n.hasOwnProperty(u)||!n[u])){var o=n[u];o=Array.isArray(o)?o:[o];for(var c=0;c=l.reach);y+=S.value.length,S=S.next){var x=S.value;if(t.length>e.length)return;if(!(x instanceof $o)){var b=1,E;if(v){if(E=K1(w,y,e,d),!E||E.index>=e.length)break;var T=E.index,D=E.index+E[0].length,N=y;for(N+=S.value.length;T>=N;)S=S.next,N+=S.value.length;if(N-=S.value.length,y=N,S.value instanceof $o)continue;for(var R=S;R!==t.tail&&(Nl.reach&&(l.reach=V);var F=S.prev;B&&(F=vu(t,F,B),y+=B.length),$j(t,F,b);var P=new $o(u,p?Vt.tokenize(j,p):j,_,j);if(S=vu(t,F,P),z&&vu(t,S,z),b>1){var W={cause:u+","+c,reach:V};Rw(e,t,n,S.prev,y,W),l&&W.reach>l.reach&&(l.reach=W.reach)}}}}}}function Pj(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function vu(e,t,n){var r=t.next,a={value:n,prev:t,next:r};return t.next=a,r.prev=a,e.length++,a}function $j(e,t,n){for(var r=t.next,a=0;an)return e;try{return Le.highlight(e,t).children.map(Lw)}catch{return e}}const Zj=1e5;function Qj({code:e,lang:t}){const[n,r]=G.useState(!1),a=()=>{var l;(l=navigator.clipboard)==null||l.writeText(e).then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};return g.jsxs("div",{className:"md-code",children:[g.jsx("button",{className:"md-code-copy",title:"Copy","aria-label":"Copy code",onClick:a,children:n?g.jsx(vn,{size:13}):g.jsx(Tg,{size:13})}),g.jsx("pre",{children:g.jsx("code",{children:Ow(e,t,Zj)})})]})}function Jj(e){const t={};for(const n of e.matchAll(/([\w-]+)=(["'])(.*?)\2/g)){const r=n[1];r&&(t[r.toLowerCase()]=n[3]??"")}return t}function eL(e){const t=/]*?)\/?>/gi,n=[];let r=0,a=!1;for(const l of e.matchAll(t)){const u=Jj(l[1]??"");u.path&&(a=!0,l.index>r&&n.push({type:"text",value:e.slice(r,l.index)}),n.push({children:[],data:{hName:"file-mention",hProperties:u},type:"fileMention"}),r=l.index+l[0].length)}return a?(rBw(e)}function Z1({path:e,lines:t,onOpenFile:n}){const r=e.split("/").pop()||e,a=t&&Number.parseInt(t,10)||void 0,l=a!=null?`${r}:${a}`:r;return g.jsxs("button",{className:"file-chip",title:`Open ${e}`,onClick:()=>n==null?void 0:n(e),disabled:!n,children:[g.jsx(sx,{size:12}),g.jsx("span",{className:"file-chip-label",children:l})]})}function nL(e){return!(/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("#")||e.startsWith("//"))}const Iw={code:({node:e,className:t,children:n,...r})=>{const a=t??"",l=/language-(\w+)/.exec(a),u=String(n??"").replace(/\n$/,"");if(!(l!=null||u.includes(` +`)))return g.jsx("code",{className:a,...r,children:n});const c=l?Yp(l[1]):null;return g.jsx(Qj,{code:u,lang:c})},pre:({children:e})=>g.jsx(g.Fragment,{children:e})};function Xo({text:e,onOpenFile:t}){const n={"file-mention":r=>g.jsx(Z1,{path:r.path,lines:r.lines,onOpenFile:t}),a:({node:r,href:a,children:l,...u})=>a&&nL(a)&&t?g.jsx(Z1,{path:decodeURI(a),onOpenFile:t}):g.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",...u,children:l}),...Iw};return g.jsx("div",{className:"md",children:g.jsx(iw,{remarkPlugins:[Aw,tL],components:n,children:e})})}function iL({synthesized:e,agentLabel:t,onView:n,onApprove:r,onReject:a,onRevise:l}){const[u,o]=G.useState(!1),c=G.useRef(null),[f,p]=G.useState(!1),[d,v]=G.useState(""),_=G.useRef(null);G.useEffect(()=>{if(!u)return;const w=S=>{c.current&&!c.current.contains(S.target)&&o(!1)};return window.addEventListener("pointerdown",w),()=>window.removeEventListener("pointerdown",w)},[u]),G.useEffect(()=>{var w;f&&((w=_.current)==null||w.focus())},[f]);const C=()=>{l(d.trim()||"no specific feedback — use your judgment"),v(""),p(!1)};return g.jsxs("div",{className:"plan-strip",children:[g.jsxs("div",{className:"plan-strip-info",children:[g.jsx(cx,{size:14,className:"plan-strip-icon"}),g.jsx("span",{className:"plan-strip-title",children:e?`${t} is ready to proceed`:`${t} proposed a plan`}),g.jsx("button",{className:"plan-strip-open",onClick:n,children:"Open plan"})]}),f?g.jsxs(g.Fragment,{children:[g.jsx("textarea",{ref:_,className:"plan-strip-revise-input",placeholder:"What should change? (optional)",rows:2,value:d,onChange:w=>v(w.target.value),onKeyDown:w=>{w.key==="Escape"?(w.preventDefault(),v(""),p(!1)):w.key==="Enter"&&!w.shiftKey&&(w.preventDefault(),C())}}),g.jsxs("div",{className:"prompt-actions plan-strip-actions",children:[g.jsx("button",{className:"btn-ghost",onClick:()=>{v(""),p(!1)},children:"Back"}),g.jsx("span",{className:"plan-strip-spacer"}),g.jsxs("button",{className:"btn-primary plan-strip-primary",onClick:C,children:["Revise",g.jsx(ix,{size:13})]})]})]}):g.jsxs("div",{className:"prompt-actions plan-strip-actions",children:[g.jsx("button",{className:"btn-ghost",onClick:a,children:"Reject"}),g.jsx("button",{className:"btn-ghost",onClick:()=>p(!0),children:"Revise…"}),g.jsx("span",{className:"plan-strip-spacer"}),g.jsxs("div",{className:"plan-strip-approve",ref:c,children:[g.jsx("button",{className:"btn-primary plan-strip-primary",onClick:()=>r("auto"),children:"Accept and auto mode"}),g.jsx("button",{className:"btn-primary plan-strip-primary plan-strip-caret","aria-label":"More approval options",onClick:()=>o(w=>!w),children:g.jsx(gs,{size:13})}),u&&g.jsx("div",{className:"plan-strip-menu",children:g.jsx("button",{onClick:()=>{o(!1),r("bypass")},children:"Accept and bypass all"})})]})]})]})}function zw({onSaved:e}){const[t,n]=G.useState(""),[r,a]=G.useState(!1),[l,u]=G.useState(null);async function o(c){if(c.preventDefault(),!(r||!t.trim())){a(!0),u(null);try{e(await zT(t.trim())),n("")}catch(f){u(f instanceof Error?f.message:String(f))}finally{a(!1)}}}return g.jsxs("form",{className:"onb-token-form",onSubmit:o,children:[g.jsx("input",{type:"password",value:t,onChange:c=>n(c.target.value),placeholder:"ghp_… personal access token",autoComplete:"off"}),g.jsx("button",{type:"submit",className:"btn",disabled:r||!t.trim(),children:r?"Checking…":"Save"}),g.jsx("a",{href:"https://github.com/settings/tokens/new?scopes=repo,workflow&description=orx",target:"_blank",rel:"noreferrer",children:"Create a token ↗"}),l&&g.jsx("div",{className:"error",children:l})]})}function rL(e){switch(e){case"modal_job":return"Modal";case"hf_job":return"Hugging Face";case"k8s_job":return"Kubernetes";case"ssh_job":return"SSH";case"slurm_job":return"Slurm";case"openresearch_job":return"OpenResearch";case"local_job":return"This machine";default:return e||"—"}}function sL({size:e=16}){return g.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:[g.jsx("path",{d:"M2.25 11.535c0-3.407 1.847-6.554 4.844-8.258a9.822 9.822 0 019.687 0c2.997 1.704 4.844 4.851 4.844 8.258 0 5.266-4.337 9.535-9.687 9.535S2.25 16.8 2.25 11.535z",fill:"#FF9D0B"}),g.jsx("path",{d:"M11.938 20.086c4.797 0 8.687-3.829 8.687-8.551 0-4.722-3.89-8.55-8.687-8.55-4.798 0-8.688 3.828-8.688 8.55 0 4.722 3.89 8.55 8.688 8.55z",fill:"#FFD21E"}),g.jsx("path",{d:"M11.875 15.113c2.457 0 3.25-2.156 3.25-3.263 0-.576-.393-.394-1.023-.089-.582.283-1.365.675-2.224.675-1.798 0-3.25-1.693-3.25-.586 0 1.107.79 3.263 3.25 3.263h-.003z",fill:"#FF323D"}),g.jsx("path",{d:"M14.76 9.21c.32.108.445.753.767.585.447-.233.707-.708.659-1.204a1.235 1.235 0 00-.879-1.059 1.262 1.262 0 00-1.33.394c-.322.384-.377.92-.14 1.36.153.283.638-.177.925-.079l-.002.003zm-5.887 0c-.32.108-.448.753-.768.585a1.226 1.226 0 01-.658-1.204c.048-.495.395-.913.878-1.059a1.262 1.262 0 011.33.394c.322.384.377.92.14 1.36-.152.283-.64-.177-.925-.079l.003.003z",fill:"#3A3B45"}),g.jsx("path",{d:"M17.812 10.366a.806.806 0 00.813-.8c0-.441-.364-.8-.813-.8a.806.806 0 00-.812.8c0 .442.364.8.812.8zm-11.624 0a.806.806 0 00.812-.8c0-.441-.364-.8-.812-.8a.806.806 0 00-.813.8c0 .442.364.8.813.8z",fill:"#3A3B45"}),g.jsx("path",{d:"M4.515 13.073c-.405 0-.765.162-1.017.46a1.455 1.455 0 00-.333.925 1.801 1.801 0 00-.485-.074c-.387 0-.737.146-.985.409a1.41 1.41 0 00-.2 1.722 1.302 1.302 0 00-.447.694c-.06.222-.12.69.2 1.166a1.267 1.267 0 00-.093 1.236c.238.533.81.958 1.89 1.405l.24.096c.768.3 1.473.492 1.478.494.89.243 1.808.375 2.732.394 1.465 0 2.513-.443 3.115-1.314.93-1.342.842-2.575-.274-3.763l-.151-.154c-.692-.684-1.155-1.69-1.25-1.912-.195-.655-.71-1.383-1.562-1.383-.46.007-.889.233-1.15.605-.25-.31-.495-.553-.715-.694a1.87 1.87 0 00-.993-.312zm14.97 0c.405 0 .767.162 1.017.46.216.262.333.588.333.925.158-.047.322-.071.487-.074.388 0 .738.146.985.409a1.41 1.41 0 01.2 1.722c.22.178.377.422.445.694.06.222.12.69-.2 1.166.244.37.279.836.093 1.236-.238.533-.81.958-1.889 1.405l-.239.096c-.77.3-1.475.492-1.48.494-.89.243-1.808.375-2.732.394-1.465 0-2.513-.443-3.115-1.314-.93-1.342-.842-2.575.274-3.763l.151-.154c.695-.684 1.157-1.69 1.252-1.912.195-.655.708-1.383 1.56-1.383.46.007.889.233 1.15.605.25-.31.495-.553.718-.694.244-.162.523-.265.814-.3l.176-.012z",fill:"#FF9D0B"}),g.jsx("path",{d:"M9.785 20.132c.688-.994.638-1.74-.305-2.667-.945-.928-1.495-2.288-1.495-2.288s-.205-.788-.672-.714c-.468.074-.81 1.25.17 1.971.977.721-.195 1.21-.573.534-.375-.677-1.405-2.416-1.94-2.751-.532-.332-.907-.148-.782.541.125.687 2.357 2.35 2.14 2.707-.218.362-.983-.42-.983-.42S2.953 14.9 2.43 15.46c-.52.558.398 1.026 1.7 1.803 1.308.778 1.41.985 1.225 1.28-.187.295-3.07-2.1-3.34-1.083-.27 1.011 2.943 1.304 2.745 2.006-.2.7-2.265-1.324-2.685-.537-.425.79 2.913 1.718 2.94 1.725 1.075.276 3.813.859 4.77-.522zm4.432 0c-.687-.994-.64-1.74.305-2.667.943-.928 1.493-2.288 1.493-2.288s.205-.788.675-.714c.465.074.807 1.25-.17 1.971-.98.721.195 1.21.57.534.377-.677 1.407-2.416 1.94-2.751.532-.332.91-.148.782.541-.125.687-2.355 2.35-2.137 2.707.215.362.98-.42.98-.42S21.05 14.9 21.57 15.46c.52.558-.395 1.026-1.7 1.803-1.308.778-1.408.985-1.225 1.28.187.295 3.07-2.1 3.34-1.083.27 1.011-2.94 1.304-2.743 2.006.2.7 2.263-1.324 2.685-.537.423.79-2.912 1.718-2.94 1.725-1.077.276-3.815.859-4.77-.522z",fill:"#FFD21E"})]})}function aL({size:e=16}){return g.jsxs("svg",{width:e,height:e,viewBox:"0 0 300 300",fill:"none","aria-hidden":"true",children:[g.jsx("path",{d:"M121.683 75.25L149.997 124L91.4816 224.75C90.3128 226.757 88.155 228 85.8174 228H32.9664C31.7976 228 30.6778 227.691 29.697 227.131C28.7161 226.57 27.8906 225.758 27.3021 224.75L0.876625 179.25C-0.292208 177.243 -0.292208 174.765 0.876625 172.75L57.512 75.25C58.0923 74.2425 58.9259 73.43 59.9068 72.8694C60.8876 72.3088 62.0074 72 63.1762 72H116.027C118.365 72 120.523 73.2431 121.692 75.25H121.683ZM299.125 172.75L242.49 75.25C241.91 74.2425 241.076 73.43 240.095 72.8694C239.114 72.3088 237.995 72 236.826 72H183.975C181.637 72 179.479 73.2431 178.311 75.25L149.997 124L208.512 224.75C209.681 226.757 211.839 228 214.177 228H267.027C268.196 228 269.316 227.691 270.297 227.131C271.278 226.57 272.103 225.758 272.692 224.75L299.117 179.25C300.286 177.243 300.286 174.765 299.117 172.75H299.125Z",fill:"#62DE61"}),g.jsx("path",{d:"M89.6018 124H150.005L121.692 75.25C120.523 73.2431 118.365 72 116.027 72H63.1763C62.0074 72 60.8876 72.3088 59.9068 72.8694L89.6018 124Z",fill:"url(#orxModalA)"}),g.jsx("path",{d:"M89.6018 124L59.9068 72.8694C58.9259 73.43 58.1005 74.2425 57.512 75.25L0.876625 172.75C-0.292208 174.765 -0.292208 177.235 0.876625 179.25L27.3021 224.75C27.8825 225.758 28.7161 226.57 29.697 227.131L89.5936 124H89.6018Z",fill:"url(#orxModalB)"}),g.jsx("path",{d:"M149.997 124H89.5936L29.697 227.131C30.6778 227.691 31.7976 228 32.9664 228H85.8174C88.155 228 90.3128 226.757 91.4816 224.75L149.997 124Z",fill:"#09AF58"}),g.jsx("path",{d:"M299.125 179.25C299.706 178.243 300 177.121 300 176H240.61L210.915 227.131C211.896 227.691 213.016 228 214.185 228H267.036C269.373 228 271.531 226.757 272.7 224.75L299.125 179.25Z",fill:"#09AF58"}),g.jsx("path",{d:"M183.975 72C182.806 72 181.686 72.3088 180.705 72.8694L240.602 176H299.992C299.992 174.879 299.698 173.758 299.117 172.75L242.49 75.25C241.321 73.2431 239.163 72 236.826 72H183.967H183.975Z",fill:"url(#orxModalC)"}),g.jsx("path",{d:"M210.907 227.131L240.602 176L180.705 72.8694C179.725 73.43 178.899 74.2425 178.311 75.25L149.997 124L208.512 224.75C209.093 225.758 209.926 226.57 210.907 227.131Z",fill:"url(#orxModalD)"}),g.jsxs("defs",{children:[g.jsxs("linearGradient",{id:"orxModalA",x1:"127.348",y1:"137",x2:"82.9561",y2:"59.6398",gradientUnits:"userSpaceOnUse",children:[g.jsx("stop",{stopColor:"#BFF9B4"}),g.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),g.jsxs("linearGradient",{id:"orxModalB",x1:"7.04774",y1:"214.131",x2:"81.1284",y2:"85.0556",gradientUnits:"userSpaceOnUse",children:[g.jsx("stop",{stopColor:"#80EE64"}),g.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),g.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),g.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),g.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),g.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),g.jsx("stop",{offset:"1",stopColor:"#09AF58"})]}),g.jsxs("linearGradient",{id:"orxModalC",x1:"278.103",y1:"188.561",x2:"204.022",y2:"59.4863",gradientUnits:"userSpaceOnUse",children:[g.jsx("stop",{stopColor:"#BFF9B4"}),g.jsx("stop",{offset:"1",stopColor:"#80EE64"})]}),g.jsxs("linearGradient",{id:"orxModalD",x1:"232.804",y1:"214.569",x2:"158.724",y2:"85.4864",gradientUnits:"userSpaceOnUse",children:[g.jsx("stop",{stopColor:"#80EE64"}),g.jsx("stop",{offset:"0.18",stopColor:"#7BEB63"}),g.jsx("stop",{offset:"0.36",stopColor:"#6FE562"}),g.jsx("stop",{offset:"0.55",stopColor:"#5ADA60"}),g.jsx("stop",{offset:"0.74",stopColor:"#3DCA5D"}),g.jsx("stop",{offset:"0.93",stopColor:"#18B759"}),g.jsx("stop",{offset:"1",stopColor:"#09AF58"})]})]})]})}function oL({size:e=16}){return g.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"#326CE5","aria-hidden":"true",children:g.jsx("path",{d:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-.5-.623h-.804l-.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-.52.123-.736-.172-.216-.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-.555-.5-.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"})})}function km({size:e=16}){return g.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:g.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"})})}function Hw({kind:e,size:t=16}){switch(e){case"modal_job":return g.jsx(aL,{size:t});case"hf_job":return g.jsx(sL,{size:t});case"k8s_job":return g.jsx(oL,{size:t});case"ssh_job":return g.jsx(Lp,{size:t});case"slurm_job":return g.jsx(QA,{size:t});case"openresearch_job":return g.jsx(oN,{size:t});case"local_job":return g.jsx(MN,{size:t});default:return g.jsx(Lp,{size:t})}}function lL({backend:e}){const t=_x(e),n=yx(e);return t?g.jsxs("span",{className:"backend-badge",children:[g.jsx(Hw,{kind:t}),g.jsx("span",{className:"backend-name",children:rL(t)}),n&&g.jsx("span",{className:"backend-detail mono",children:n})]}):g.jsx("span",{className:"backend-badge muted",children:"—"})}const Q1={done:{className:"st-done",live:!1},failed:{className:"st-failed",live:!1},running:{className:"st-running",live:!0},starting:{className:"st-starting",live:!0},cancelled:{className:"st-cancelled",live:!1},editing:{className:"st-editing",live:!0},idle:{className:"st-idle",live:!1}};function cL(e){return Q1[e]??Q1.idle}function uL(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Ko({status:e,label:t}){const n=cL(e);return g.jsxs("span",{className:`status-badge ${n.className}${n.live?" live":""}`,children:[g.jsx("span",{className:"dot"}),t??uL(e)]})}function gp(e){return e.installed&&e.authenticated?{cls:"ok",label:"Connected"}:e.installed?{cls:"warn",label:"Not signed in"}:{cls:"warn",label:"Not installed"}}function hL({h:e}){return e.authMethod?g.jsx(g.Fragment,{children:e.authMethod==="oauth"?"OAuth (subscription login)":"API key"}):g.jsx(g.Fragment,{children:"—"})}function fL(){const[e,t]=G.useState(null),[n,r]=G.useState("claude-code"),[a,l]=G.useState(!1),u=c=>{l(!0),Og(c).then(t).catch(()=>{}).finally(()=>l(!1))};G.useEffect(()=>u(!1),[]);const o=e==null?void 0:e.find(c=>c.id===n);return g.jsxs(g.Fragment,{children:[g.jsx("h1",{children:"Harnesses"}),g.jsx("p",{className:"settings-sub",children:"Coding-agent setups detected on this machine. The research agent chat is served by OpenCode; Claude Code and Codex accounts surface their models in the composer's model picker."}),g.jsx("div",{className:"harness-tabs",children:(e??[]).map(c=>g.jsxs("button",{className:c.id===n?"active":"",onClick:()=>r(c.id),children:[c.name,g.jsx("span",{className:`harness-dot ${gp(c).cls}`})]},c.id))}),e?o?g.jsxs("div",{className:"settings-card",children:[g.jsxs("div",{className:"settings-card-head",children:[g.jsx("span",{className:`badge ${gp(o).cls}`,children:gp(o).label}),g.jsx("div",{className:"spacer",style:{flex:1}}),g.jsxs("button",{className:"btn sm",onClick:()=>u(!0),disabled:a,children:[g.jsx(Au,{size:12,className:a?"spin":""})," Refresh"]})]}),g.jsxs("div",{className:"kv",children:[g.jsx("span",{className:"k",children:"Binary"}),g.jsx("span",{className:"v",children:o.binPath??"not found on PATH"}),g.jsx("span",{className:"k",children:"Version"}),g.jsx("span",{className:"v",children:o.version??"—"}),g.jsx("span",{className:"k",children:"Auth"}),g.jsx("span",{className:"v",children:g.jsx(hL,{h:o})}),o.account&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"k",children:o.id==="opencode"?"Providers":"Account"}),g.jsx("span",{className:"v",children:o.account})]}),o.org&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"k",children:"Org"}),g.jsx("span",{className:"v",children:o.org})]}),o.plan&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"k",children:"Plan"}),g.jsx("span",{className:"v",children:o.plan})]}),g.jsx("span",{className:"k",children:"Agent models"}),g.jsx("span",{className:"v",children:o.models.length>0?`${o.models.length} available — ${o.models.slice(0,4).map(c=>Nu(c.id)).join(", ")}${o.models.length>4?", …":""}`:"none"})]}),!o.agentReady&&o.agentNote&&g.jsx("p",{className:"settings-note",children:o.agentNote})]}):null:g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Detecting harnesses…"]})]})}function dL({s:e}){if(!e.configured)return g.jsx("span",{className:"badge",children:"Not configured"});const t=e.preflight;return t.kubectlFound?t.reachable?t.canCreateJobs?g.jsx("span",{className:"badge ok",children:"Connected"}):g.jsx("span",{className:"badge err",children:"No job-create permission"}):g.jsx("span",{className:"badge err",children:"Cluster unreachable"}):g.jsx("span",{className:"badge err",children:"kubectl not found"})}function pL(){const[e,t]=G.useState(null),[n,r]=G.useState(null),[a,l]=G.useState(""),[u,o]=G.useState(""),[c,f]=G.useState(!1),[p,d]=G.useState(null),v=w=>{t(w),l(w.context??""),o(w.namespace)};G.useEffect(()=>{_T().then(v).catch(w=>r(w instanceof Error?w.message:String(w)))},[]);const _=e!==null&&a===(e.context??"")&&u.trim()===e.namespace;async function C(w){if(w.preventDefault(),!c){f(!0),d(null);try{v(await yT({context:a,namespace:u.trim()}))}catch(S){d(S instanceof Error?S.message:String(S))}finally{f(!1)}}}return g.jsxs(g.Fragment,{children:[g.jsxs("p",{className:"settings-sub",children:["Run on your own cluster with ",g.jsx("code",{children:"--backend k8s"}),". The run's resources (image, GPUs, topology) come from a manifest committed on the experiment branch (default ",g.jsx("code",{children:".orx/k8s.yaml"}),"); only the cluster context and namespace live here. Auth comes from your kubeconfig."]}),n?g.jsx("div",{className:"error",children:n}):e?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"kv",children:[g.jsx("span",{className:"k",children:"Cluster"}),g.jsx("span",{className:"v",children:g.jsx(dL,{s:e})})]}),e.preflight.error&&g.jsx("p",{className:"settings-note",children:e.preflight.error}),g.jsxs("form",{className:"form settings-form",onSubmit:C,children:[g.jsxs("div",{className:"row2",children:[g.jsxs("label",{children:["Context",g.jsxs("select",{value:a,onChange:w=>l(w.target.value),children:[g.jsxs("option",{value:"",children:["kubectl default",e.currentContext?` (${e.currentContext})`:""]}),e.contexts.map(w=>g.jsx("option",{value:w,children:w},w))]})]}),g.jsxs("label",{children:["Namespace",g.jsx("input",{className:"mono",type:"text",value:u,onChange:w=>o(w.target.value),placeholder:"default",autoComplete:"off",spellCheck:!1})]})]}),p&&g.jsx("div",{className:"error",children:p}),g.jsx("div",{className:"actions",children:g.jsx("button",{type:"submit",className:"btn primary",disabled:c||_,children:c?"Saving…":"Save"})})]}),g.jsxs("div",{className:"settings-card",children:[g.jsx("div",{className:"settings-card-head",children:g.jsx("h3",{children:"Run manifest"})}),g.jsxs("p",{className:"settings-sub",children:["Each run applies the manifest committed on its experiment branch — default"," ",g.jsx("code",{children:".orx/k8s.yaml"}),", or ",g.jsx("code",{children:"--manifest "}),". It declares whatever the run needs (image, GPU requests, an Indexed Job across nodes, extra Services, …); orx injects the run script as ",g.jsx("code",{children:"$ORX_SCRIPT"}),", the"," ",g.jsx("code",{children:"orx-env"})," Secret, run labels, and a default timeout, and requires exactly one Job (or one labelled ",g.jsx("code",{children:'orx-primary: "true"'}),") whose completion is the run's. Logs follow that Job's leader pod. Use"," ",g.jsx("code",{children:"{{ORX_RUN}}"})," in resource names to keep re-runs collision-free."]})]})]}):g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Checking kubectl…"]})]})}const gL={env:"MODAL_TOKEN_ID env var",syncedEnv:"~/.openresearch/env",modalToml:"~/.modal.toml (modal token new)"};function mL({s:e}){return e.ready?g.jsx("span",{className:"badge ok",children:"Connected"}):!e.tokenConfigured&&!e.modalImportable?g.jsx("span",{className:"badge",children:"Not set up"}):e.modalImportable?e.tokenConfigured?g.jsx("span",{className:"badge",children:"Unknown"}):g.jsx("span",{className:"badge err",children:"No token"}):g.jsx("span",{className:"badge err",children:e.envProvisioned?"Env broken":"Env not built"})}function vL(){const[e,t]=G.useState(null),[n,r]=G.useState(null),[a,l]=G.useState(!1),[u,o]=G.useState(null);G.useEffect(()=>{bT().then(t).catch(f=>r(f instanceof Error?f.message:String(f)))},[]);async function c(){if(!a){l(!0),o(null);try{t(await ST())}catch(f){o(f instanceof Error?f.message:String(f))}finally{l(!1)}}}return g.jsxs(g.Fragment,{children:[g.jsxs("p",{className:"settings-sub",children:["Serverless GPUs on your own Modal account with"," ",g.jsx("code",{children:"--backend modal --flavor "})," (t4, a10g, a100-80gb, h100, …). orx manages a dedicated Python env with the Modal SDK; sandboxes scale to zero between runs."]}),n?g.jsx("div",{className:"error",children:n}):e?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"kv",children:[g.jsx("span",{className:"k",children:"Status"}),g.jsx("span",{className:"v",children:g.jsx(mL,{s:e})}),g.jsx("span",{className:"k",children:"Environment"}),g.jsx("span",{className:"v",children:e.modalImportable?"Ready":e.envProvisioned?"Provisioned (modal import failing)":"Not built yet"}),g.jsx("span",{className:"k",children:"Token"}),g.jsx("span",{className:"v",children:e.tokenSource?gL[e.tokenSource]:"Not configured"})]}),!e.tokenConfigured&&g.jsxs("p",{className:"settings-note",children:["No Modal token found. Run ",g.jsx("code",{children:"modal token new"}),", or add"," ",g.jsx("code",{children:"MODAL_TOKEN_ID"})," and ",g.jsx("code",{children:"MODAL_TOKEN_SECRET"})," in the Environment tab."]}),e.error&&e.envProvisioned&&!e.modalImportable&&g.jsx("p",{className:"settings-note",children:e.error}),u&&g.jsx("div",{className:"error",children:u}),!e.modalImportable&&g.jsx("div",{className:"actions",children:g.jsx("button",{className:"btn primary",onClick:()=>void c(),disabled:a,children:a?"Setting up… (~30–60s)":"Set up environment"})})]}):g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Checking Modal…"]})]})}function _L({test:e}){if(e===void 0)return g.jsx("span",{className:"muted",children:"never tested"});if(e==="testing")return g.jsx("span",{className:"spinner"});const t=e.reachable?e.gitFound?g.jsx("span",{className:"badge ok",children:"Ready"}):g.jsx("span",{className:"badge err",children:"No git"}):g.jsx("span",{className:"badge err",title:e.error??void 0,children:"Unreachable"});return g.jsxs(g.Fragment,{children:[t,g.jsx("span",{className:"ssh-tested-at",children:Na(e.testedAt)})]})}function yL(){const[e,t]=G.useState(null),[n,r]=G.useState({});G.useEffect(()=>{AT().then(t).catch(()=>t([]))},[]);async function a(l){r(u=>({...u,[l]:"testing"}));try{const u=await NT(l);r(o=>({...o,[l]:u}))}catch(u){r(o=>({...o,[l]:{reachable:!1,gitFound:!1,error:u instanceof Error?u.message:String(u),testedAt:Date.now()}}))}}return g.jsxs(g.Fragment,{children:[g.jsxs("p",{className:"settings-sub",children:["Run experiments directly on your own boxes with"," ",g.jsx("code",{children:"--backend ssh --host "}),". Hosts come from"," ",g.jsx("code",{children:"~/.ssh/config"}),"; auth uses your keys/agent (orx never reads a key). The host just needs ",g.jsx("code",{children:"git"})," and ",g.jsx("code",{children:"bash"}),"."]}),e===null?g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Reading ~/.ssh/config…"]}):e.length===0?g.jsx("p",{className:"settings-empty",children:"No hosts found in ~/.ssh/config."}):g.jsxs("table",{className:"flavor-table ssh-table",children:[g.jsx("thead",{children:g.jsxs("tr",{children:[g.jsx("th",{children:"Host"}),g.jsx("th",{children:"Address"}),g.jsx("th",{children:"Identity"}),g.jsx("th",{children:"Status"}),g.jsx("th",{})]})}),g.jsx("tbody",{children:e.map(l=>g.jsxs("tr",{children:[g.jsx("td",{className:"mono",children:l.host}),g.jsxs("td",{className:"mono muted",children:[[l.user,l.hostname??"—"].filter(Boolean).join("@"),l.port?`:${l.port}`:""]}),g.jsx("td",{className:"mono muted",children:l.identityFile??"—"}),g.jsx("td",{children:g.jsx(_L,{test:n[l.host]??l.lastTest})}),g.jsx("td",{children:g.jsx("button",{className:"btn sm",onClick:()=>void a(l.host),disabled:n[l.host]==="testing",children:"Test"})})]},l.host))})]})]})}function bL({test:e}){return e===null?null:e==="testing"?g.jsx("span",{className:"spinner"}):e.reachable?e.slurmFound?e.gitFound?g.jsx("span",{className:"badge ok",children:"Ready"}):g.jsx("span",{className:"badge err",children:"No git"}):g.jsx("span",{className:"badge err",children:"No Slurm CLI"}):g.jsx("span",{className:"badge err",title:e.error??void 0,children:"Unreachable"})}function SL(){const[e,t]=G.useState(null),[n,r]=G.useState(null),[a,l]=G.useState(""),[u,o]=G.useState(""),[c,f]=G.useState(""),[p,d]=G.useState(""),[v,_]=G.useState(!1),[C,w]=G.useState(null),[S,y]=G.useState(null),x=S!==null&&S!=="testing"?S:null,b=R=>{t(R),l(R.host??""),o(R.partition??""),f(R.account??""),d(R.timeLimit??"")};G.useEffect(()=>{TT().then(b).catch(R=>r(R instanceof Error?R.message:String(R)))},[]);const E=e!==null&&a===(e.host??"")&&u.trim()===(e.partition??"")&&c.trim()===(e.account??"")&&p.trim()===(e.timeLimit??"");async function D(R){if(R.preventDefault(),!v){_(!0),w(null);try{b(await DT({host:a,partition:u.trim(),account:c.trim(),timeLimit:p.trim()}))}catch(T){w(T instanceof Error?T.message:String(T))}finally{_(!1)}}}async function N(R){y("testing");try{y(await RT(R))}catch(T){y({reachable:!1,slurmFound:!1,gitFound:!1,partitions:[],error:T instanceof Error?T.message:String(T)})}}return g.jsxs(g.Fragment,{children:[g.jsxs("p",{className:"settings-sub",children:["Run on your own cluster with ",g.jsx("code",{children:"--backend slurm [--flavor h100:2]"}),". orx submits via ",g.jsx("code",{children:"sbatch"})," on the login node over ssh (auth is your keys/agent; orx never reads a key) and the job runs in your cluster environment. The defaults below apply when a launch doesn't override them."]}),n?g.jsx("div",{className:"error",children:n}):e?g.jsxs(g.Fragment,{children:[(x==null?void 0:x.error)&&g.jsx("p",{className:"settings-note",children:x.error}),x&&x.partitions.length>0&&g.jsxs("p",{className:"settings-note",children:["Partitions: ",g.jsx("code",{children:x.partitions.join(", ")})]}),g.jsxs("form",{className:"form settings-form",onSubmit:D,children:[g.jsxs("div",{className:"row2",children:[g.jsxs("label",{children:["Login node",g.jsxs("select",{value:a,onChange:R=>{l(R.target.value),y(null)},children:[g.jsx("option",{value:"",children:"not set (pass --host per launch)"}),a&&!e.hosts.some(R=>R.host===a)&&g.jsxs("option",{value:a,children:[a," (not in ~/.ssh/config)"]}),e.hosts.map(R=>g.jsx("option",{value:R.host,children:R.host},R.host))]})]}),g.jsxs("label",{children:["Partition",g.jsx("input",{className:"mono",type:"text",list:"slurm-partitions",value:u,onChange:R=>o(R.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1}),g.jsx("datalist",{id:"slurm-partitions",children:x==null?void 0:x.partitions.map(R=>g.jsx("option",{value:R},R))})]})]}),g.jsxs("div",{className:"row2",children:[g.jsxs("label",{children:["Account",g.jsx("input",{className:"mono",type:"text",value:c,onChange:R=>f(R.target.value),placeholder:"cluster default",autoComplete:"off",spellCheck:!1})]}),g.jsxs("label",{children:["Time limit",g.jsx("input",{className:"mono",type:"text",value:p,onChange:R=>d(R.target.value),placeholder:"cluster default (e.g. 4h, 30m)",autoComplete:"off",spellCheck:!1})]})]}),C&&g.jsx("div",{className:"error",children:C}),g.jsxs("div",{className:"actions",children:[g.jsx("button",{type:"submit",className:"btn primary",disabled:v||E,children:v?"Saving…":"Save"}),g.jsx("button",{type:"button",className:"btn",onClick:()=>void N(a),disabled:!a||S==="testing",title:a?void 0:"Pick a login node first",children:"Test connection"}),g.jsx(bL,{test:S})]})]})]}):g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Loading slurm settings…"]})]})}function xL(){const[e,t]=G.useState(null),[n,r]=G.useState(null);return G.useEffect(()=>{jT().then(t).catch(a=>r(a instanceof Error?a.message:String(a)))},[]),g.jsxs(g.Fragment,{children:[g.jsxs("p",{className:"settings-sub",children:["Run experiments as detached, supervised processes on the machine running orx with"," ",g.jsx("code",{children:"--backend local"})," — handy when you're already on a GPU box and using this dashboard over port forwarding. Runs share CPU/RAM/GPU with the dashboard itself, so prefer a remote backend for anything heavy."]}),n?g.jsx("div",{className:"error",children:n}):e?g.jsxs("div",{className:"kv",children:[g.jsx("span",{className:"k",children:"Hostname"}),g.jsx("span",{className:"v mono",children:e.hostname}),g.jsx("span",{className:"k",children:"System"}),g.jsxs("span",{className:"v",children:[e.os,"/",e.arch,e.chip?` — ${e.chip}`:""]}),g.jsx("span",{className:"k",children:"CPU"}),g.jsx("span",{className:"v",children:e.cpuCount>0?`${e.cpuCount} cores`:"—"}),g.jsx("span",{className:"k",children:"RAM"}),g.jsx("span",{className:"v",children:e.memBytes!==null?ls(e.memBytes):"—"}),g.jsx("span",{className:"k",children:"GPUs"}),g.jsx("span",{className:"v",children:e.gpus.length===0?"none detected (nvidia-smi)":e.gpus.map(a=>`${a.name}${a.memMib!==null?` — ${ls(a.memMib*1024*1024)}`:""}`).join(", ")})]}):g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Detecting hardware…"]})]})}function wL(){const[e,t]=G.useState(null),[n,r]=G.useState(null);return G.useEffect(()=>{LT().then(t).catch(a=>r(a instanceof Error?a.message:String(a)))},[]),g.jsxs(g.Fragment,{children:[g.jsxs("p",{className:"settings-sub",children:["Run on an ephemeral OpenResearch box billed to your org with"," ",g.jsx("code",{children:"--backend openresearch --flavor "})," (h100_sxm, cpu5c, …; browse with ",g.jsx("code",{children:"orx compute"}),"). The box is provisioned for the run and deleted when it ends. Needs ",g.jsx("code",{children:"orx login"})," and a registered SSH key."]}),n?g.jsx("div",{className:"error",children:n}):e?e.loggedIn?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"kv",children:[g.jsx("span",{className:"k",children:"Status"}),g.jsx("span",{className:"v",children:g.jsx("span",{className:"badge ok",children:"Signed in"})}),g.jsx("span",{className:"k",children:"Orgs"}),g.jsx("span",{className:"v",children:e.orgs.length>0?e.orgs.join(", "):"—"}),g.jsx("span",{className:"k",children:"SSH key"}),g.jsx("span",{className:"v",children:e.sshKeyRegistered===!0?g.jsx("span",{className:"badge ok",children:"Registered"}):e.sshKeyRegistered===!1?g.jsx("span",{className:"badge err",children:"None registered"}):g.jsx("span",{className:"badge",children:"Unknown"})})]}),e.sshKeyRegistered===!1&&g.jsxs("p",{className:"settings-note",children:["Launches need a registered SSH key. Add one with"," ",g.jsx("code",{children:"orx ssh-key add ~/.ssh/id_ed25519.pub"}),"."]}),e.error&&g.jsx("p",{className:"settings-note",children:e.error})]}):g.jsxs("p",{className:"settings-note",children:["Not signed in. Run ",g.jsx("code",{children:"orx login"})," in a terminal to connect your OpenResearch account."]}):g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Checking credentials…"]})]})}const J1={local:"This machine",hf:"HF Jobs",modal:"Modal",k8s:"Kubernetes",ssh:"SSH",slurm:"Slurm",openresearch:"OpenResearch"},CL={local:"local_job",hf:"hf_job",modal:"modal_job",k8s:"k8s_job",ssh:"ssh_job",slurm:"slurm_job",openresearch:"openresearch_job"},EL=["hf","modal","slurm","openresearch"],eb=["hf","modal","openresearch"],tb={hf:["cpu-basic","t4-small","a10g-small","a10g-large","a100-large","h100","h200"],modal:["cpu","t4","l4","a10g","a100","a100-80gb","l40s","h100","h100:2"],slurm:["gpu","h100:1","h100:2","a100:4"],openresearch:["h100_sxm","h100_sxm:2","cpu5c","cpu5g","cpu5m"]};function kL({t:e,isDefault:t}){return e.id==="local"?g.jsx("span",{className:"badge ok",children:"Ready"}):!e.configured&&t?g.jsx("span",{className:"badge warn",children:"Not configured"}):e.configured?g.jsx("span",{className:"badge ok",children:"Configured"}):g.jsx("span",{className:"badge",children:"Not set up"})}function AL({target:e,flavor:t,onSaved:n}){var d;const[r,a]=G.useState(t??""),[l,u]=G.useState(!1),[o,c]=G.useState(null);G.useEffect(()=>a(t??""),[t]);async function f(v){if(v.preventDefault(),!l){u(!0),c(null);try{n(await mx({backend:e,flavor:r.trim()||null}))}catch(_){c(_ instanceof Error?_.message:String(_))}finally{u(!1)}}}const p=r.trim()===(t??"");return g.jsxs("form",{className:"form settings-form compute-flavor-form",onSubmit:f,children:[g.jsxs("label",{children:["Default flavor",g.jsx("input",{className:"mono",type:"text",list:`flavors-${e}`,value:r,onChange:v=>a(v.target.value),placeholder:eb.includes(e)?`e.g. ${((d=tb[e])==null?void 0:d[1])??""}`:"none (CPU-only)",autoComplete:"off",spellCheck:!1}),g.jsx("datalist",{id:`flavors-${e}`,children:(tb[e]??[]).map(v=>g.jsx("option",{value:v},v))})]}),o&&g.jsx("div",{className:"error",children:o}),g.jsxs("div",{className:"actions",children:[g.jsx("button",{type:"submit",className:"btn sm",disabled:l||p,children:l?"Saving…":"Save flavor"}),eb.includes(e)&&!t&&g.jsxs("span",{className:"muted compute-flavor-hint",children:["This backend requires a flavor — without a default one, each launch must pass"," ",g.jsx("code",{children:"--flavor"}),"."]})]})]})}function NL({target:e,isDefault:t,defaultFlavor:n,open:r,onToggle:a,onSettings:l,onError:u}){const[o,c]=G.useState(!1),[f,p]=G.useState(!1);r&&!o&&c(!0);async function d(v){if(!f){p(!0);try{l(await mx({backend:v}))}catch(_){u(_ instanceof Error?_.message:String(_))}finally{p(!1)}}}return g.jsxs("div",{className:`compute-row${r?" open":""}`,children:[g.jsxs("div",{className:"compute-row-head",onClick:a,children:[g.jsx("span",{className:"compute-row-logo",children:g.jsx(Hw,{kind:CL[e.id],size:18})}),g.jsx("span",{className:"compute-row-name",children:J1[e.id]}),g.jsx("span",{className:"compute-row-summary",children:e.summary}),g.jsx(kL,{t:e,isDefault:t}),t?g.jsx("span",{className:"badge compute-default-pill",children:"Default"}):g.jsx("button",{type:"button",className:"btn sm compute-make-default",onClick:v=>{v.stopPropagation(),d(e.id)},disabled:f,children:"Make default"}),g.jsx("button",{type:"button",className:"compute-chevron-btn","aria-expanded":r,"aria-label":`${r?"Collapse":"Expand"} ${J1[e.id]}`,onClick:v=>{v.stopPropagation(),a()},children:g.jsx(gs,{size:16,className:"compute-chevron"})})]}),o&&g.jsxs("div",{className:"compute-row-body",hidden:!r,children:[t&&g.jsxs("p",{className:"settings-note compute-default-note",children:["The agent launches runs here unless you tell it otherwise, and so does"," ",g.jsx("code",{children:"orx exp run"})," with no ",g.jsx("code",{children:"--backend"})," flag."," ",g.jsx("button",{type:"button",className:"btn sm",onClick:()=>void d(null),disabled:f,children:"Clear default"})]}),t&&!e.configured&&g.jsx("p",{className:"settings-note",children:"This target is the default but isn't configured — launches will fail until it's set up below."}),t&&EL.includes(e.id)&&g.jsx(AL,{target:e.id,flavor:n,onSaved:l}),e.id==="local"&&g.jsx(xL,{}),e.id==="hf"&&g.jsx(jL,{}),e.id==="modal"&&g.jsx(vL,{}),e.id==="k8s"&&g.jsx(pL,{}),e.id==="ssh"&&g.jsx(yL,{}),e.id==="slurm"&&g.jsx(SL,{}),e.id==="openresearch"&&g.jsx(wL,{})]})]})}function TL(){const[e,t]=G.useState(null),[n,r]=G.useState(null),[a,l]=G.useState(null),[u,o]=G.useState(null),c=G.useRef(0);G.useEffect(()=>{const d=++c.current;MT().then(v=>{d===c.current&&(t(v),r(null))}).catch(v=>{if(d!==c.current)return;const _=v instanceof Error?v.message:String(v);t(C=>(C===null?r(_):o(_),C))})},[a]);const f=d=>{c.current++,t(d),o(null)},p=e?e.targets:null;return g.jsxs(g.Fragment,{children:[g.jsx("h1",{children:"Compute"}),g.jsxs("p",{className:"settings-sub",children:["Where ",g.jsx("code",{children:"orx exp run"})," executes. Pick a default target; the agent uses it when a launch doesn't name a backend (",g.jsx("code",{children:"--backend "})," always wins)."]}),n?g.jsx("div",{className:"error",children:n}):p?g.jsxs(g.Fragment,{children:[u&&g.jsx("div",{className:"error",children:u}),g.jsx("div",{className:"compute-list",children:p.map(d=>g.jsx(NL,{target:d,isDefault:(e==null?void 0:e.defaultBackend)===d.id,defaultFlavor:(e==null?void 0:e.defaultFlavor)??null,open:a===d.id,onToggle:()=>l(v=>v===d.id?null:d.id),onSettings:f,onError:o},d.id))}),g.jsxs("p",{className:"compute-footnote",children:[g.jsx(DN,{size:14,"aria-hidden":"true"}),g.jsx("span",{children:"The default target and flavor are included in the research agent's instructions — it launches runs there unless you name another backend. No other compute settings are shared with it."})]})]}):g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Checking compute targets…"]})]})}const DL={env:"HF_TOKEN env var",openresearchEnv:"~/.openresearch/env",hfCache:"~/.cache/huggingface/token (hf auth login)"};function RL({settings:e}){return e.configured?e.valid?g.jsx("span",{className:"badge ok",children:"Connected"}):g.jsx("span",{className:"badge err",children:"Invalid token"}):g.jsx("span",{className:"badge",children:"Not configured"})}function ML({settings:e}){return!e.configured||!e.valid?null:e.jobsWrite===!0?g.jsx("span",{className:"badge ok",children:"Jobs: write OK"}):e.jobsWrite===!1?g.jsx("span",{className:"badge err",children:"No job.write permission"}):g.jsx("span",{className:"badge",children:"Jobs permission unknown"})}function jL(){const[e,t]=G.useState(null),[n,r]=G.useState(null),[a,l]=G.useState(""),[u,o]=G.useState(!1),[c,f]=G.useState(null),p=G.useRef(!1);G.useEffect(()=>{mT().then(v=>{p.current||t(v)}).catch(v=>{p.current||r(v instanceof Error?v.message:String(v))})},[]);async function d(v){if(v.preventDefault(),!(!a.trim()||u)){o(!0),f(null);try{const _=await vT(a.trim());p.current=!0,t(_),r(null),l("")}catch(_){f(_ instanceof Error?_.message:String(_))}finally{o(!1)}}}return g.jsxs(g.Fragment,{children:[g.jsxs("p",{className:"settings-sub",children:["Run experiments on your Hugging Face account with"," ",g.jsx("code",{children:"--backend hf --flavor "})," (t4-small, a10g-small, a100-large, …). Billed to HF per minute."]}),n?g.jsx("div",{className:"error",children:n}):e?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"kv",children:[g.jsx("span",{className:"k",children:"Status"}),g.jsx("span",{className:"v",children:g.jsx(RL,{settings:e})}),g.jsx("span",{className:"k",children:"Account"}),g.jsx("span",{className:"v",children:e.username??"—"}),g.jsx("span",{className:"k",children:"Token"}),g.jsx("span",{className:"v",children:e.maskedToken??"—"}),g.jsx("span",{className:"k",children:"Source"}),g.jsx("span",{className:"v",children:e.source?DL[e.source]:"Not configured"}),g.jsx("span",{className:"k",children:"Jobs"}),g.jsxs("span",{className:"v",children:[g.jsx(ML,{settings:e}),(!e.configured||!e.valid)&&"—"]})]}),e.source==="env"&&g.jsx("p",{className:"settings-note",children:"HF_TOKEN is set in the environment and overrides any token saved here."}),e.valid&&e.jobsWrite===null&&g.jsxs("p",{className:"settings-note",children:["This token is valid but doesn't report whether it can launch Jobs — OAuth tokens from ",g.jsx("code",{children:"hf auth login"})," never do. Launches may still work; for a definitive check, save a write-scoped token from"," ",g.jsx("a",{href:"https://huggingface.co/settings/tokens",target:"_blank",rel:"noreferrer",children:"huggingface.co/settings/tokens"}),"."]})]}):g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Loading status…"]}),g.jsxs("form",{className:"form settings-form",onSubmit:d,children:[g.jsxs("label",{children:[e!=null&&e.configured?"Replace token":"New token",g.jsx("input",{type:"password",value:a,onChange:v=>l(v.target.value),placeholder:"hf_…",autoComplete:"off"})]}),c&&g.jsx("div",{className:"error",children:c}),g.jsx("div",{className:"actions",children:g.jsx("button",{type:"submit",className:"btn primary",disabled:!a.trim()||u,children:u?"Validating…":"Save"})})]})]})}const Fw=/^hf_[A-Za-z0-9]{10,}$/;function Pw(){return g.jsx("tr",{children:g.jsx("td",{colSpan:3,children:g.jsxs("p",{className:"settings-note",children:["This value looks like a Hugging Face token — compute runs only read it from"," ",g.jsx("code",{children:"HF_TOKEN"}),". Save it under that key if it's meant for HF Jobs."]})})})}const nb=["HF_TOKEN","WANDB_API_KEY"];function LL({name:e,entry:t,onVars:n,onError:r}){const[a,l]=G.useState(""),[u,o]=G.useState(!1),c=d=>r(`${e}: ${d instanceof Error?d.message:String(d)}`);async function f(){if(!(!a.trim()||u)){o(!0);try{n(await px(e,a.trim())),l("")}catch(d){c(d)}finally{o(!1)}}}async function p(){if(!u){o(!0);try{n(await wT(e))}catch(d){c(d)}finally{o(!1)}}}return g.jsxs(g.Fragment,{children:[g.jsxs("tr",{children:[g.jsx("td",{className:"mono",children:e}),g.jsx("td",{className:"mono muted",children:t?g.jsxs(g.Fragment,{children:[t.maskedValue,t.inProcessEnv&&g.jsx("span",{className:"badge",children:"Overridden by env"})]}):g.jsx("input",{className:"mono",type:"password",value:a,onChange:d=>l(d.target.value),onKeyDown:d=>{d.key==="Enter"&&(d.preventDefault(),f()),d.key==="Escape"&&!u&&l("")},placeholder:"value","aria-label":`Value for ${e}`,autoComplete:"new-password",disabled:u})}),g.jsx("td",{children:t?g.jsx("button",{className:"icon-btn",title:`Delete ${e}`,"aria-label":`Delete ${e}`,onClick:()=>void p(),disabled:u,children:g.jsx(jg,{size:13})}):a.trim()&&g.jsx("button",{className:"btn sm",onClick:()=>void f(),disabled:u,children:u?"Saving…":"Save"})})]}),!t&&e!=="HF_TOKEN"&&Fw.test(a.trim())&&g.jsx(Pw,{})]})}function OL({onVars:e,onError:t,onDone:n}){const[r,a]=G.useState(""),[l,u]=G.useState(""),[o,c]=G.useState(!1);async function f(){if(!(!r.trim()||!l.trim()||o)){c(!0);try{e(await px(r.trim(),l.trim())),n()}catch(d){t(`${r.trim()}: ${d instanceof Error?d.message:String(d)}`)}finally{c(!1)}}}const p=d=>{d.key==="Enter"&&(d.preventDefault(),f()),d.key==="Escape"&&!o&&n()};return g.jsxs(g.Fragment,{children:[g.jsxs("tr",{children:[g.jsx("td",{children:g.jsx("input",{autoFocus:!0,className:"mono",type:"text",value:r,onChange:d=>a(d.target.value),onKeyDown:p,placeholder:"MY_API_KEY","aria-label":"New variable key",autoComplete:"off",spellCheck:!1,disabled:o})}),g.jsx("td",{children:g.jsx("input",{className:"mono",type:"password",value:l,onChange:d=>u(d.target.value),onKeyDown:p,placeholder:"value","aria-label":"New variable value",autoComplete:"new-password",disabled:o})}),g.jsxs("td",{children:[g.jsx("button",{className:"btn sm",onClick:()=>void f(),disabled:o||!r.trim()||!l.trim(),children:o?"Saving…":"Save"}),g.jsx("button",{className:"icon-btn",title:"Cancel","aria-label":"Cancel new variable",onClick:n,disabled:o,children:g.jsx(_a,{size:13})})]})]}),r.trim()!=="HF_TOKEN"&&Fw.test(l.trim())&&g.jsx(Pw,{})]})}function BL(){const[e,t]=G.useState(null),[n,r]=G.useState(null),[a,l]=G.useState(!1),[u,o]=G.useState(null);G.useEffect(()=>{xT().then(t).catch(d=>r(d instanceof Error?d.message:String(d)))},[]);const c=d=>{t(d),o(null)},f=e===null?[]:e.map(d=>d.key).filter(d=>!nb.includes(d)),p=[...nb,...f];return g.jsxs("div",{className:"settings-card",children:[g.jsxs("div",{className:"settings-card-head",children:[g.jsx("h3",{children:"Environment variables"}),g.jsx("div",{className:"spacer",style:{flex:1}}),g.jsxs("button",{className:"btn sm",onClick:()=>l(!0),disabled:a||e===null,children:[g.jsx(Rg,{size:12})," Add variable"]})]}),g.jsxs("p",{className:"settings-sub",children:["Stored in ",g.jsx("code",{children:"~/.openresearch/env"})," and passed to runs and the research agent."," ",g.jsx("code",{children:"HF_TOKEN"})," and ",g.jsx("code",{children:"WANDB_API_KEY"})," are always listed since runs typically need them. Variables set in orx's own environment win on conflicts."]}),n?g.jsx("div",{className:"error",children:n}):e===null?g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Loading…"]}):g.jsx("table",{className:"env-table",children:g.jsxs("tbody",{children:[p.map(d=>g.jsx(LL,{name:d,entry:e.find(v=>v.key===d),onVars:c,onError:o},d)),a&&g.jsx(OL,{onVars:c,onError:o,onDone:()=>l(!1)})]})}),u&&g.jsx("div",{className:"error",children:u})]})}function IL(){const[e,t]=G.useState(null),[n,r]=G.useState(""),[a,l]=G.useState(""),[u,o]=G.useState(!1),[c,f]=G.useState(null);G.useEffect(()=>{vx().then(v=>{t(v),r(v.userName??""),l(v.userEmail??"")}).catch(()=>{})},[]);const p=e!==null&&n.trim()===(e.userName??"")&&a.trim()===(e.userEmail??"");async function d(v){if(v.preventDefault(),!(u||p)){o(!0),f(null);try{const _=await IT({userName:n.trim(),userEmail:a.trim()});t(_),r(_.userName??""),l(_.userEmail??"")}catch(_){f(_ instanceof Error?_.message:String(_))}finally{o(!1)}}}return g.jsxs(g.Fragment,{children:[g.jsx("h1",{children:"Git"}),g.jsx("p",{className:"settings-sub",children:"Experiment branches are committed and pushed from local clones with this identity."}),e?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"settings-card",children:[g.jsx("h3",{children:"Identity"}),g.jsxs("form",{className:"form",onSubmit:d,children:[g.jsxs("div",{className:"row2",children:[g.jsxs("label",{children:["user.name",g.jsx("input",{type:"text",value:n,onChange:v=>r(v.target.value),autoComplete:"off"})]}),g.jsxs("label",{children:["user.email",g.jsx("input",{type:"text",value:a,onChange:v=>l(v.target.value),autoComplete:"off"})]})]}),c&&g.jsx("div",{className:"error",children:c}),g.jsx("div",{className:"actions",children:g.jsx("button",{type:"submit",className:"btn primary",disabled:u||p||!n.trim()&&!a.trim(),children:u?"Saving…":"Save"})})]})]}),g.jsxs("div",{className:"settings-card",children:[g.jsx("h3",{children:"GitHub access"}),g.jsxs("div",{className:"kv",children:[g.jsx("span",{className:"k",children:"git"}),g.jsx("span",{className:"v",children:e.gitVersion??"not found"}),g.jsx("span",{className:"k",children:"Token"}),g.jsx("span",{className:"v",children:e.githubTokenSource==="env"?"GITHUB_TOKEN env var":e.githubTokenSource==="stored"?"token saved in orx":e.githubTokenSource==="gh"?"gh CLI (gh auth token)":"none found"})]}),!e.githubTokenSource&&g.jsxs(g.Fragment,{children:[g.jsxs("p",{className:"settings-note",children:["No GitHub token found — private repo clones and branch pushes will fail. Run"," ",g.jsx("code",{children:"gh auth login"}),", or paste a personal access token:"]}),g.jsx(zw,{onSaved:t})]}),e.githubTokenSource==="stored"&&g.jsx("div",{className:"actions",children:g.jsx("button",{className:"btn",onClick:()=>{HT().then(t).catch(()=>{})},children:"Remove saved token"})})]})]}):g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Loading…"]})]})}function zL({value:e,max:t,label:n}){const r=t>0?Math.min(100,Math.round(e/t*100)):0;return g.jsxs("div",{className:"progress",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:[g.jsx("div",{className:"progress-track",children:g.jsx("div",{className:"progress-fill",style:{width:`${r}%`}})}),g.jsxs("div",{className:"progress-caption",children:[g.jsx("span",{children:n??`${r}%`}),t>0&&g.jsxs("span",{className:"mono",children:[ls(e)," / ",ls(t)]})]})]})}const HL={env:"ORX_DATA_DIR environment variable",config:"your saved setting",xdg:"XDG_DATA_HOME",default:"default location"};function FL(){const[e,t]=G.useState(null),[n,r]=G.useState(null),[a,l]=G.useState(""),[u,o]=G.useState(!1),[c,f]=G.useState(null),[p,d]=G.useState({kind:"idle"}),[v,_]=G.useState(null),C=()=>gx().then(E=>{t(E),l(D=>D||E.current)}).catch(E=>r(E instanceof Error?E.message:String(E)));G.useEffect(()=>{C()},[]),G.useEffect(()=>t3(E=>{E.type==="progress"?d(D=>{const N=D.kind==="moving"?D.total:0;return{kind:"moving",phase:E.phase,copied:E.copiedBytes,total:E.totalBytes||N}}):E.type==="done"?(d({kind:"done",oldPathLeft:E.oldPathLeft}),f(null),l(""),C()):E.type==="error"&&d({kind:"error",message:E.error})}),[]);const w=(e==null?void 0:e.source)==="env",S=a.trim(),y=e!==null&&S===e.current;async function x(){if(!(u||!S)){o(!0),_(null),f(null);try{f(await CT(S))}catch(E){_(E instanceof Error?E.message:String(E))}finally{o(!1)}}}async function b(E){if(E.preventDefault(),!(p.kind==="moving"||!S||y)&&(_(null),!!window.confirm(`Move all orx data to: ${S} -The store is copied to the new location and activated there. Active runs or chats will block the move.`))){d({kind:"moving",phase:"preparing",copied:0,total:(c==null?void 0:c.treeBytes)??0});try{await ET(S)}catch(R){d({kind:"idle"}),_(R instanceof Error?R.message:String(R))}}}return g.jsxs(g.Fragment,{children:[g.jsx("h1",{children:"Storage"}),g.jsxs("p",{className:"settings-sub",children:["Where orx keeps everything on this machine — the local database, run logs, artifacts, and chat attachments for ",g.jsx("strong",{children:"all"})," projects. Moving it copies the whole store to the new location and activates it there."]}),n?g.jsx("div",{className:"settings-card",children:g.jsx("div",{className:"error",children:n})}):e?g.jsxs("div",{className:"settings-card",children:[g.jsxs("div",{className:"settings-card-head",children:[g.jsx("h3",{children:"Data directory"}),g.jsx("div",{className:"spacer",style:{flex:1}}),g.jsx("span",{className:"badge",children:e.isDefault?"default":"custom"})]}),g.jsxs("div",{className:"kv",children:[g.jsx("span",{className:"k",children:"Current"}),g.jsx("span",{className:"v mono",children:e.current}),g.jsx("span",{className:"k",children:"Source"}),g.jsx("span",{className:"v",children:IL[e.source]}),!e.isDefault&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"k",children:"Default"}),g.jsx("span",{className:"v mono",children:e.defaultPath})]})]}),w?g.jsxs("p",{className:"settings-note",children:["The data directory is pinned by the ",g.jsx("code",{children:"ORX_DATA_DIR"})," environment variable, which overrides this setting. Unset it to choose a location here."]}):g.jsxs("form",{className:"form settings-form",onSubmit:b,children:[g.jsxs("label",{children:["New location",g.jsx("input",{className:"mono",type:"text",value:a,onChange:E=>{l(E.target.value),f(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:p.kind==="moving"})]}),c&&!c.error&&c.ok&&g.jsxs("p",{className:"settings-note",children:["Ready to move ",ls(c.treeBytes??0),c.freeBytes!=null&&` — ${ls(c.freeBytes)} free at target`,c.sameFilesystem?" (same disk, instant)":"","."]}),c&&c.ok===!1&&c.error&&g.jsx("div",{className:"error",children:c.error}),v&&g.jsx("div",{className:"error",children:v}),p.kind==="moving"&&g.jsx(BL,{value:p.copied,max:p.total,label:`${p.phase.charAt(0).toUpperCase()}${p.phase.slice(1)}…`}),p.kind==="done"&&g.jsxs("p",{className:"settings-note",children:["Moved. orx is now using the new location.",p.oldPathLeft&&g.jsxs(g.Fragment,{children:[" ","The old copy was left at ",g.jsx("code",{children:p.oldPathLeft})," (different disk) — you can delete it once you've confirmed everything works."]})]}),p.kind==="error"&&g.jsxs("div",{className:"error",children:["Move failed: ",p.message]}),g.jsxs("div",{className:"actions",children:[g.jsx("button",{type:"button",className:"btn",onClick:x,disabled:u||!S||y||p.kind==="moving",children:u?"Checking…":"Check"}),g.jsx("button",{type:"submit",className:"btn primary",disabled:!S||y||p.kind==="moving",children:p.kind==="moving"?"Moving…":"Move data here"})]})]})]}):g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Loading…"]})]})}const Kp=e=>e==="running"||e==="starting";function HL(e){return Kp(e.status)?Jy(Date.now()-e.createdAt):e.endedAt?Jy(e.endedAt-e.createdAt):"—"}function nb({instances:e,emptyLabel:t}){return e.length===0?g.jsx("p",{className:"instances-empty",children:t}):g.jsx("div",{className:"instances-table-wrap",children:g.jsxs("table",{className:"runs-table",children:[g.jsx("thead",{children:g.jsxs("tr",{children:[g.jsx("th",{children:"Backend"}),g.jsx("th",{children:"Project"}),g.jsx("th",{children:"Status"}),g.jsx("th",{children:"Started"}),g.jsx("th",{children:"Runtime"})]})}),g.jsx("tbody",{children:e.map(n=>{var a;const r=typeof((a=n.backend)==null?void 0:a.url)=="string"?n.backend.url:void 0;return g.jsxs("tr",{children:[g.jsx("td",{children:g.jsxs("span",{className:"backend-cell",children:[g.jsx(oL,{backend:n.backend}),r&&g.jsx("a",{className:"icon-btn",href:r,target:"_blank",rel:"noreferrer",title:"Open job page","aria-label":"Open job page",onClick:l=>l.stopPropagation(),children:g.jsx(ix,{size:12})})]})}),g.jsx("td",{children:n.projectName??Lp(n.projectId)}),g.jsx("td",{children:g.jsx(Xo,{status:n.status})}),g.jsx("td",{children:Aa(n.createdAt)}),g.jsx("td",{className:"mono",children:HL(n)})]},n.id)})})]})})}function FL(){const[e,t]=G.useState(null),[n,r]=G.useState(null),[a,l]=G.useState(!1),[,u]=G.useState(0);G.useEffect(()=>{const d=setInterval(()=>u(v=>v+1),3e4);return()=>clearInterval(d)},[]);const o=()=>{l(!0),cT().then(d=>{t(d),r(null)}).catch(d=>{r(d instanceof Error?d.message:String(d)),t(v=>v??[])}).finally(()=>l(!1))};G.useEffect(()=>o(),[]);const c=(d,v)=>v.createdAt-d.createdAt,f=e==null?void 0:e.filter(d=>Kp(d.status)).sort(c),p=e==null?void 0:e.filter(d=>!Kp(d.status)).sort(c);return g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"settings-head-row",children:[g.jsx("h1",{children:"Instances"}),g.jsxs("button",{className:"btn sm",onClick:o,disabled:a,children:[g.jsx(ku,{size:12,className:a?"spin":""})," Refresh"]})]}),g.jsx("p",{className:"settings-sub",children:"Compute spun up across all projects — this machine, Modal, Hugging Face, SSH, Kubernetes, Slurm, and OpenResearch."}),n&&g.jsx("div",{className:"error",children:n}),!f||!p?g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Loading…"]}):g.jsxs(g.Fragment,{children:[g.jsxs("h2",{className:"instances-section-title",children:["Running",f.length>0&&g.jsx("span",{className:"count-badge",children:f.length})]}),g.jsx(nb,{instances:f,emptyLabel:"Nothing running right now."}),g.jsx("h2",{className:"instances-section-title",children:"Past"}),g.jsx(nb,{instances:p,emptyLabel:"No past instances yet."})]})]})}const PL=[{id:"harnesses",label:"Harnesses",icon:g.jsx(XA,{size:15})},{id:"compute",label:"Compute",icon:g.jsx(hN,{size:15})},{id:"instances",label:"Instances",icon:g.jsx(jp,{size:15})},{id:"environment",label:"Environment",icon:g.jsx(ZN,{size:15})},{id:"git",label:"Git",icon:g.jsx(Xu,{size:15})},{id:"storage",label:"Storage",icon:g.jsx(AN,{size:15})}];function $L({tab:e}){return g.jsxs("div",{className:"settings-view",children:[e==="harnesses"&&g.jsx(uL,{}),e==="compute"&&g.jsx(AL,{}),e==="environment"&&g.jsxs(g.Fragment,{children:[g.jsx("h1",{children:"Environment"}),g.jsx("p",{className:"settings-sub",children:"Variables available to runs and the research agent (API keys, tokens)."}),g.jsx(LL,{})]}),e==="instances"&&g.jsx(FL,{}),e==="git"&&g.jsx(OL,{}),e==="storage"&&g.jsx(zL,{})]})}function UL({skills:e,activeIndex:t,onPick:n,onHover:r}){return g.jsx("div",{className:"skill-menu",children:e.map((a,l)=>g.jsxs("button",{type:"button",className:`skill-item ${l===t?"active":""}`,onMouseDown:u=>{u.preventDefault(),n(a)},onMouseEnter:()=>r(l),children:[g.jsxs("span",{className:"skill-name",children:["/",a.name," ",g.jsx("span",{className:"skill-hint",children:a.argHint})]}),g.jsx("span",{className:"skill-desc",children:a.description})]},a.name))})}const Zp={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode"};function ib(e){var n,r,a;const t=e.find(l=>l.agentReady);return t?{harness:t.id,model:((n=t.models[0])==null?void 0:n.id)??null,permissionMode:((r=t.options)==null?void 0:r.defaultPermissionMode)??null,reasoningLevel:((a=t.options)==null?void 0:a.defaultReasoningLevel)??null}:null}function oh(){const[e,t]=G.useState(!1),n=G.useRef(null);return G.useEffect(()=>{if(!e)return;const r=l=>{var u;(u=n.current)!=null&&u.contains(l.target)||t(!1)},a=l=>{l.key==="Escape"&&(l.preventDefault(),l.stopPropagation(),t(!1))};return document.addEventListener("mousedown",r),document.addEventListener("keydown",a,!0),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",a,!0)}},[e]),{open:e,setOpen:t,ref:n}}function GL({value:e,onSelect:t,onHarnesses:n,lockHarness:r=!1}){const[a,l]=G.useState([]),{open:u,setOpen:o,ref:c}=oh(),[f,p]=G.useState("");G.useEffect(()=>{Lg().then(C=>{l(C),n==null||n(C)}).catch(()=>{})},[]);const d=G.useMemo(()=>{const C=f.trim().toLowerCase();return(r&&e?a.filter(S=>S.id===e.harness):a).map(S=>{let y=S.models;return C?y=y.filter(x=>x.id.toLowerCase().includes(C)):S.id==="opencode"&&(y=y.slice(0,6)),{harness:S,models:y,hidden:C?0:S.models.length-y.length}})},[a,f,r,e]),v=(C,w)=>{var y,x;const S=(e==null?void 0:e.harness)===C.id;t({harness:C.id,model:w,permissionMode:S?e.permissionMode:((y=C.options)==null?void 0:y.defaultPermissionMode)??null,reasoningLevel:S?e.reasoningLevel:((x=C.options)==null?void 0:x.defaultReasoningLevel)??null}),o(!1),p("")},_=e?e.model?Au(e.model):"Default model":"Model";return g.jsxs("div",{className:"model-picker","data-onboarding":"model-picker",ref:c,children:[g.jsxs("button",{type:"button",className:"composer-pill",title:"Harness + model for this chat",onClick:()=>o(C=>!C),children:[_,g.jsx(gs,{size:12})]}),u&&g.jsxs("div",{className:"model-menu align-right",children:[g.jsx("input",{autoFocus:!0,type:"text",placeholder:"Search models…",value:f,onChange:C=>p(C.target.value)}),g.jsxs("div",{className:"model-menu-list",children:[d.map(({harness:C,models:w,hidden:S})=>g.jsxs("div",{children:[g.jsx("div",{className:"model-group",children:C.name}),C.agentReady?g.jsxs(g.Fragment,{children:[w.map(y=>g.jsxs("button",{className:"model-item",onClick:()=>v(C,y.id),children:[g.jsxs("span",{children:[Au(y.id),g.jsx("span",{className:"model-id",children:y.id})]}),(e==null?void 0:e.harness)===C.id&&(e==null?void 0:e.model)===y.id&&g.jsx(vn,{size:13})]},y.id)),S>0&&g.jsxs("div",{className:"model-more",children:[S," more — search to find"]})]}):g.jsx("div",{className:"model-more",children:C.agentNote??"Not available"})]},C.id)),a.length===0&&g.jsx("div",{className:"model-more",children:"Detecting harnesses…"})]}),r&&e&&a.length>1&&g.jsxs("div",{className:"model-locked-note",children:[g.jsx(jN,{size:11}),"Sessions keep their harness — new chat to switch"]})]})]})}function rb({choices:e,value:t,defaultId:n,header:r,align:a="left",variant:l="pill",title:u,numbered:o=!1,onSelect:c}){var y,x;const{open:f,setOpen:p,ref:d}=oh();if(e.length===0)return null;const v=t??n??((y=e[0])==null?void 0:y.id)??null,_=e.find(b=>b.id===v),C=e.find(b=>b.id===n),w=(_==null?void 0:_.label)??((x=e[0])==null?void 0:x.label)??"",S=b=>{c(b),p(!1)};return g.jsxs("div",{className:"option-picker",ref:d,children:[g.jsxs("button",{type:"button",className:l==="pill"?"composer-pill":"composer-bare",title:u,onClick:()=>p(b=>!b),children:[w,g.jsx(gs,{size:12})]}),f&&g.jsxs("div",{className:`option-menu ${a==="right"?"align-right":""}`,children:[r&&g.jsx("div",{className:"model-group",children:r}),C&&g.jsxs(g.Fragment,{children:[g.jsxs("button",{className:"model-item",onClick:()=>S(C.id),children:[g.jsxs("span",{children:[C.label," ",g.jsx("span",{className:"option-default",children:"· Default"})]}),v===C.id&&g.jsx(vn,{size:13})]}),g.jsx("div",{className:"option-sep"})]}),e.map((b,E)=>g.jsxs("button",{className:"model-item",onClick:()=>S(b.id),children:[g.jsx("span",{children:b.label}),v===b.id?g.jsx(vn,{size:13}):o&&g.jsx("span",{className:"option-num",children:E+1})]},b.id))]})]})}const Pw="orx:agent-selection";function qL(){try{const e=localStorage.getItem(Pw);return e?JSON.parse(e):null}catch{return null}}const $w="local-";function VL(e,t){const n=e.findIndex(a=>a.id===t.id);if(n>=0){const a=e.slice();return a[n]=t,a}return[...t.role==="user"?e.filter(a=>!a.id.startsWith($w)):e,t]}function YL(e,t){switch(t.type){case"reset":return{messagesBySession:{},busySessions:new Set};case"seed":return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:t.messages}};case"upsertMessage":{const n=e.messagesBySession[t.sessionId]??[];return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:VL(n,t.message)}}}case"optimisticUser":{const n=e.messagesBySession[t.sessionId]??[],r=t.text?[{id:"p0",type:"text",text:t.text}]:[];t.imageUrls.forEach((l,u)=>r.push({id:`img${u}`,type:"image",text:l}));const a={id:`${$w}${Date.now()}`,role:"user",parts:r,createdAt:Date.now()};return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:[...n,a]}}}case"busy":{const n=new Set(e.busySessions);return t.busy?n.add(t.sessionId):n.delete(t.sessionId),{...e,busySessions:n}}case"seedBusy":return{...e,busySessions:new Set(t.sessions)};case"forget":{const n={...e.messagesBySession};delete n[t.sessionId];const r=new Set(e.busySessions);return r.delete(t.sessionId),{messagesBySession:n,busySessions:r}}}}function WL({harnesses:e,selection:t}){if(e.length===0)return null;const n=t?e.find(r=>r.id===t.harness):void 0;return n?g.jsxs("p",{className:"chat-empty-hint",children:["Chatting with ",n.name,n.account?` as ${n.account}`:""," — detected automatically, switch in the model picker below."]}):g.jsx("p",{className:"chat-empty-hint",children:"No coding agent detected on this machine — install Claude Code, Codex or opencode and sign in, then re-open the model picker below."})}function Uw(e){return e==="error"?"tool-status error":e==="completed"?"tool-status":"tool-status running"}function XL(e){if(!e)return"";const t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return"now";const n=Math.floor(t/60);if(n<60)return`${n}m`;const r=Math.floor(n/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}function sb(e){const t=e.replace(/\/+$/,"");return t.slice(t.lastIndexOf("/")+1)||t}function Qp(e){var u,o;const t=e.tool??"tool",n=((u=e.state)==null?void 0:u.input)??{},r=typeof n.command=="string"?n.command:null,a=typeof n.filePath=="string"?n.filePath:null,l=typeof n.description=="string"?n.description:null;switch(t){case"Bash":case"bash":return r?`Ran ${r}`:"Ran command";case"Read":return a?`Read ${sb(a)}`:"Read file";case"Edit":case"Write":case"NotebookEdit":return a?`Edited ${sb(a)}`:"Edited file";case"Grep":return typeof n.pattern=="string"?`Searched “${n.pattern}”`:"Searched";case"Glob":return typeof n.pattern=="string"?`Found ${n.pattern}`:"Listed files";case"WebFetch":case"WebSearch":return l??"Searched the web";case"Task":return l??"Ran a subagent";case"error":return"Error";default:{const c=l??a??r??((o=e.state)==null?void 0:o.title)??"";return c?`${t}: ${c}`:t}}}function KL({part:e,onOpenFile:t}){var o,c;const n=e.state,r=(n==null?void 0:n.error)||(n==null?void 0:n.output)||"",a=typeof((o=n==null?void 0:n.input)==null?void 0:o.command)=="string"?n.input.command:null,l=typeof((c=n==null?void 0:n.input)==null?void 0:c.filePath)=="string"?n.input.filePath:null,u=!!(r||a||l);return g.jsxs("details",{className:"tool-row",open:!1,children:[g.jsxs("summary",{children:[g.jsx("span",{className:Uw(n==null?void 0:n.status)}),g.jsx("span",{className:"tool-line",children:Qp(e)}),l&&t&&g.jsx("button",{className:"tool-open file-link",title:`Open ${l}`,onClick:f=>{f.preventDefault(),f.stopPropagation(),t(l)},children:"open"})]}),u&&g.jsxs("div",{className:"tool-detail",children:[a&&g.jsx("div",{className:"tool-cmd-full",children:a}),r&&g.jsx("div",{className:"tool-output",children:r.slice(0,2e4)})]})]})}function ZL({parts:e,onOpenFile:t}){const n=e.some(c=>{var f;return((f=c.state)==null?void 0:f.status)==="running"}),r=e.some(c=>{var f;return((f=c.state)==null?void 0:f.status)==="error"}),[a,l]=G.useState(!1),u=a||n,o=e.length===1?Qp(e[0]):n?Qp(e.find(c=>{var f;return((f=c.state)==null?void 0:f.status)==="running"})??e[e.length-1]):`Used ${e.length} tools`;return g.jsxs("div",{className:`tool-group ${r?"has-error":""}`,children:[g.jsxs("button",{className:"tool-group-summary",onClick:()=>l(c=>!c),children:[g.jsx("span",{className:Uw(n?"running":r?"error":"completed")}),g.jsx("span",{className:"tool-line",children:o}),g.jsx(Wu,{size:12,className:`tool-chevron ${u?"open":""}`})]}),u&&g.jsx("div",{className:"tool-group-rows",children:e.map(c=>g.jsx(KL,{part:c,onOpenFile:t},c.id))})]})}function QL({part:e,onRespond:t,onOpenFile:n,onOpenPlan:r}){var p,d,v;const a=e.prompt,[l,u]=G.useState([]),o=!t,c=_=>t==null?void 0:t({promptId:e.id,..._});if(a.resolved){if(a.kind==="permission")return null;if(a.kind==="plan"){const C=a.approved===!0?"Plan approved":a.approved===!1?a.note?"Revision requested":"Rejected":"Resolved",w=a.approved===!0?"approved":a.approved===!1?a.note?"revised":"rejected":"";return g.jsxs("details",{className:"prompt-collapsed",children:[g.jsxs("summary",{children:[g.jsx("span",{className:"prompt-collapsed-title",children:a.synthesized?"Plan":"Proposed plan"}),g.jsx("span",{className:`prompt-outcome ${w}`,children:C})]}),g.jsxs("div",{className:"prompt-collapsed-body",children:[g.jsx(Wo,{text:a.plan??"",onOpenFile:n}),a.note&&g.jsx("div",{className:"prompt-collapsed-note",children:a.note})]})]})}const _=(a.answers??[]).join(", ")||a.note||"";return g.jsxs("details",{className:"prompt-collapsed",children:[g.jsxs("summary",{children:[g.jsx("span",{className:"prompt-collapsed-title",children:a.header||a.question||"Question"}),g.jsx("span",{className:`prompt-outcome ${_?"chosen":""}`,children:_||"Resolved"})]}),g.jsxs("div",{className:"prompt-collapsed-body",children:[a.header&&a.question&&g.jsx("div",{className:"prompt-q",children:a.question}),(a.options??[]).length>0&&g.jsx("ul",{className:"prompt-collapsed-options",children:(a.options??[]).map(C=>{var w;return g.jsx("li",{className:(w=a.answers)!=null&&w.includes(C.label)?"sel":"",children:C.label},C.label)})}),a.note&&a.note!==_&&g.jsx("div",{className:"prompt-collapsed-note",children:a.note})]})]})}if(a.kind==="plan"){const _=!!r;return g.jsxs("div",{className:`prompt-card plan ${o?"readonly":""}`,children:[g.jsx("div",{className:"prompt-head",children:a.synthesized?"Plan mode — ready to proceed?":"Proposed plan"}),g.jsx("div",{className:`prompt-plan ${_?"clamped":""}`,children:g.jsx(Wo,{text:a.plan??"",onOpenFile:n})}),_&&g.jsx("button",{className:"prompt-plan-open",onClick:()=>r(a.plan??"",e.id),children:"View full plan"}),!o&&!_&&g.jsxs("div",{className:"prompt-actions",children:[g.jsx("button",{className:"btn-primary",onClick:()=>c({approve:!0,resumeMode:"auto"}),children:"Accept and auto mode"}),g.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!0,resumeMode:"bypass"}),children:"Accept and bypass all"}),g.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!1}),children:"Reject"})]})]})}if(a.kind==="permission"){const _=typeof((p=a.toolInput)==null?void 0:p.command)=="string"&&a.toolInput.command||typeof((d=a.toolInput)==null?void 0:d.filePath)=="string"&&a.toolInput.filePath||"",C=typeof((v=a.toolInput)==null?void 0:v.reason)=="string"&&a.toolInput.reason||"";return g.jsxs("div",{className:`prompt-card permission ${o?"readonly":""}`,children:[g.jsxs("div",{className:"prompt-head",children:["Permission needed: ",g.jsx("code",{children:a.tool})]}),_&&g.jsx("div",{className:"prompt-sub",children:_}),C&&g.jsx("div",{className:"prompt-sub",children:C}),!o&&g.jsxs("div",{className:"prompt-actions",children:[g.jsx("button",{className:"btn-primary",onClick:()=>c({approve:!0}),children:"Allow"}),g.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!1}),children:"Deny"})]})]})}const f=_=>u(C=>a.multiSelect?C.includes(_)?C.filter(w=>w!==_):[...C,_]:[_]);return g.jsxs("div",{className:`prompt-card question ${o?"readonly":""}`,children:[a.header&&g.jsx("div",{className:"prompt-head",children:a.header}),a.question&&g.jsx("div",{className:"prompt-q",children:a.question}),g.jsx("div",{className:"prompt-options",children:(a.options??[]).map(_=>{const C=l.includes(_.label);return g.jsxs("button",{className:`prompt-option ${C?"sel":""}`,disabled:o,onClick:()=>o?void 0:a.multiSelect?f(_.label):c({answers:[_.label]}),children:[g.jsx("span",{className:"prompt-option-label",children:_.label}),_.description&&g.jsx("span",{className:"prompt-option-desc",children:_.description})]},_.label)})}),a.multiSelect&&!o&&g.jsx("div",{className:"prompt-actions",children:g.jsx("button",{className:"btn-primary",disabled:l.length===0,onClick:()=>c({answers:l}),children:"Submit"})})]})}function JL(e){return e.role==="user"?!0:e.parts.some(t=>t.type==="prompt"?!!t.prompt&&!(t.prompt.resolved&&t.prompt.kind==="permission"):t.type==="text"||t.type==="reasoning"?!!t.text:!0)}function eO({message:e,onOpenFile:t,onRespond:n,onOpenPlan:r}){if(e.role==="user"){const o=e.parts.filter(f=>f.type==="text").map(f=>f.text??"").join(` -`),c=e.parts.filter(f=>f.type==="image"&&f.text).map(f=>f.text.startsWith("data:")?f.text:YT(f.text));return g.jsxs("div",{className:"msg-user",children:[o,c.length>0&&g.jsx("div",{className:"msg-images",children:c.map((f,p)=>g.jsx("a",{href:f,target:"_blank",rel:"noreferrer",children:g.jsx("img",{src:f,alt:"attachment"})},p))})]})}const a=[];let l=[];const u=()=>{l.length!==0&&(a.push(g.jsx(ZL,{parts:l,onOpenFile:t},`tg-${l[0].id}`)),l=[])};for(const o of e.parts){if(o.type==="tool"){l.push(o);continue}u(),o.type==="text"&&o.text?a.push(g.jsx(Wo,{text:o.text,onOpenFile:t},o.id)):o.type==="reasoning"&&o.text?a.push(g.jsxs("details",{className:"reasoning",children:[g.jsx("summary",{children:"thinking…"}),o.text]},o.id)):o.type==="prompt"&&o.prompt&&a.push(g.jsx(QL,{part:o,onRespond:n,onOpenFile:t,onOpenPlan:r},o.id))}return u(),g.jsx("div",{className:"msg-assistant",children:a})}const Gw=[{id:"active",label:"Active",railLabel:"Recents"},{id:"archived",label:"Archived",railLabel:"Archived"},{id:"all",label:"All",railLabel:"All sessions"}];function tO({value:e,onChange:t}){const{open:n,setOpen:r,ref:a}=oh();return g.jsxs("div",{className:"rail-filter",ref:a,children:[g.jsx("button",{className:`icon-btn rail-filter-btn ${e!=="active"?"active":""}`,title:"Filter sessions","aria-label":"Filter sessions",onClick:()=>r(l=>!l),children:g.jsx(XN,{size:13})}),n&&g.jsx("div",{className:"option-menu drop-down align-right",children:Gw.map(l=>g.jsxs("button",{className:"model-item",onClick:()=>{t(l.id),r(!1)},children:[g.jsx("span",{children:l.label}),e===l.id&&g.jsx(vn,{size:13})]},l.id))})]})}function nO({session:e,active:t,busy:n,waiting:r,onOpen:a,onRename:l,onSetArchived:u,onDelete:o}){var b;const{open:c,setOpen:f,ref:p}=oh(),d=((b=e.title)==null?void 0:b.trim())||"Untitled",[v,_]=G.useState(!1),[C,w]=G.useState(""),S=G.useRef(null);function y(){var E;w(((E=e.title)==null?void 0:E.trim())||""),_(!0)}function x(){var R;const E=C.trim();_(!1),E&&E!==(((R=e.title)==null?void 0:R.trim())||"")&&l(E)}return G.useEffect(()=>{var E,R;v&&((E=S.current)==null||E.focus(),(R=S.current)==null||R.select())},[v]),g.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row ${t?"active":""} ${c?"menu-open":""} ${v?"editing":""}`,title:`${Zp[e.harness]}${e.model?` · ${e.model}`:""}`,onClick:()=>{v||(c?f(!1):a())},onKeyDown:E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),c?f(!1):a())},children:[g.jsx("span",{className:"session-dot",children:n&&g.jsx("span",{className:`busy-dot ${r?"waiting":""}`})}),v?g.jsx("input",{ref:S,className:"session-title-input","aria-label":"Session title",value:C,onChange:E=>w(E.target.value),onClick:E=>E.stopPropagation(),onBlur:x,onKeyDown:E=>{E.stopPropagation(),E.key==="Enter"?(E.preventDefault(),x()):E.key==="Escape"&&(E.preventDefault(),_(!1))}}):g.jsx("span",{className:"session-title",children:d}),g.jsx("span",{className:"session-time",children:XL(e.updatedAt)}),g.jsx("button",{className:"session-menu-btn",title:"Session options","aria-label":"Session options",onClick:E=>{E.stopPropagation(),f(R=>!R)},children:g.jsx(dN,{size:14})}),c&&g.jsxs("div",{className:"option-menu drop-down session-menu",children:[g.jsx("button",{className:"model-item",onClick:E=>{E.stopPropagation(),f(!1),y()},children:g.jsx("span",{children:"Rename"})}),g.jsx("button",{className:"model-item",onClick:E=>{E.stopPropagation(),f(!1),u(!e.archived)},children:g.jsx("span",{children:e.archived?"Unarchive":"Archive"})}),g.jsx("button",{className:"model-item danger",onClick:E=>{E.stopPropagation(),f(!1),o()},children:g.jsx("span",{children:"Delete"})})]})]})}function iO({projectId:e,paperId:t,railHeader:n,railOpen:r,onShowRail:a,mainView:l,onSelectMainView:u,panelOpen:o,onTogglePanel:c,onOpenFile:f,onOpenPlan:p,onStartTour:d,children:v}){var bi,ii,bs;const[_,C]=G.useState([]),[w,S]=G.useState(null),[y,x]=G.useState("active"),[b,E]=G.useState(""),[R,N]=G.useState([]),[D,T]=G.useReducer(YL,{messagesBySession:{},busySessions:new Set}),[j,B]=G.useState([]),[z,V]=G.useState(qL),[F,P]=G.useState({}),Y=G.useRef(new Set),q=G.useRef(new Set),X=G.useRef(null),K=G.useRef(null),L=G.useRef(!0),M=G.useRef(null),[O,U]=G.useState([]),[$,Q]=G.useState(0),[re,se]=G.useState(!1);G.useEffect(()=>{$T().then(U).catch(()=>{})},[]);const Z=b.startsWith("/")&&!/\s/.test(b)?b.slice(1):null,H=Z!==null&&!re?O.filter(ae=>ae.name.startsWith(Z.toLowerCase())):[],ee=H.length>0,ne=Math.min($,Math.max(0,H.length-1));G.useEffect(()=>Q(0),[Z]);function pe(ae){var xe;E(`/${ae.name} `),(xe=M.current)==null||xe.focus()}function fe(ae){for(const xe of ae){if(!/^image\/(png|jpeg|gif|webp)$/.test(xe.type))continue;const Ae=new FileReader;Ae.onload=()=>{const tt=Ae.result;N(at=>[...at,{dataUrl:tt,mediaType:xe.type}])},Ae.readAsDataURL(xe)}}function ye(ae){const xe=Array.from(ae.clipboardData.items).filter(Ae=>Ae.kind==="file"&&Ae.type.startsWith("image/")).map(Ae=>Ae.getAsFile()).filter(Ae=>Ae!==null);xe.length>0&&(ae.preventDefault(),fe(xe))}const Ce=_.find(ae=>ae.id===w),Ee=Ce?{harness:Ce.harness,model:F.model??Ce.model,permissionMode:F.permissionMode??Ce.permissionMode,reasoningLevel:F.reasoningLevel??Ce.reasoningLevel}:z??ib(j),Ne=Ee?j.find(ae=>ae.id===Ee.harness):void 0,we=Ne==null?void 0:Ne.options,ft=ae=>{Ce?P({model:ae.model,permissionMode:ae.permissionMode,reasoningLevel:ae.reasoningLevel}):(V(ae),localStorage.setItem(Pw,JSON.stringify(ae)))},Ct=ae=>{Ee&&ft({...Ee,permissionMode:ae})},st=ae=>{Ee&&ft({...Ee,reasoningLevel:ae})};G.useEffect(()=>{C([]),S(null),E(""),N([]),T({type:"reset"}),Y.current=new Set,Zy(e).then(ae=>{C(ae),S(xe=>{var Ae;return xe??((Ae=ae.find(tt=>!tt.archived))==null?void 0:Ae.id)??null}),T({type:"seedBusy",sessions:ae.filter(xe=>xe.busy).map(xe=>xe.id)})}).catch(()=>{})},[e]),G.useEffect(()=>{!w||Y.current.has(w)||(Y.current.add(w),Qy(w).then(ae=>T({type:"seed",sessionId:w,messages:ae})).catch(()=>Y.current.delete(w)))},[w]),G.useEffect(()=>JT(ae=>{switch(ae.type){case"session":if(ae.session.projectId!==e||q.current.has(ae.session.id))return;C(xe=>{const Ae=xe.findIndex(at=>at.id===ae.session.id);if(Ae<0)return[ae.session,...xe];const tt=xe.slice();return tt[Ae]=ae.session,tt});break;case"sessionDeleted":ct(ae.sessionId);break;case"message":T({type:"upsertMessage",sessionId:ae.sessionId,message:ae.message});break;case"busy":T({type:"busy",sessionId:ae.sessionId,busy:ae.busy});break}}),[e]);const Ye=w?D.messagesBySession[w]??[]:[],vt=w?D.busySessions.has(w):!1,dt=ae=>D.busySessions.has(ae)&&(D.messagesBySession[ae]??[]).some(xe=>xe.parts.some(Ae=>Ae.type==="prompt"&&Ae.prompt&&!Ae.prompt.resolved&&Ae.prompt.nativeId)),qe=w?dt(w):!1,Pe=Ce,ue=G.useMemo(()=>{var ae;for(let xe=Ye.length-1;xe>=0;xe--)for(const Ae of Ye[xe].parts)if(Ae.type==="prompt"&&((ae=Ae.prompt)==null?void 0:ae.kind)==="plan"&&!Ae.prompt.resolved)return{promptId:Ae.id,plan:Ae.prompt.plan??"",synthesized:!!Ae.prompt.synthesized};return null},[Ye]),_e=G.useMemo(()=>{const ae=Pe==null?void 0:Pe.harness;if(!w||ae!=="claude-code"&&ae!=="codex")return null;for(let xe=Ye.length-1;xe>=0;xe--)for(const Ae of Ye[xe].parts)if(!(Ae.type!=="prompt"||!Ae.prompt||Ae.prompt.resolved)&&Ae.prompt.kind==="question")return Ae.prompt.nativeId&&!D.busySessions.has(w)?null:Ae.id;return null},[Ye,Pe==null?void 0:Pe.harness,w,D.busySessions]),[ke,he]=G.useState(null),be=ke&&ke.sessionId===w?ke:null;G.useEffect(()=>{if(!ke)return;const ae=D.busySessions.has(ke.sessionId),xe=ke.sessionId===w&&ue&&ue.promptId!==ke.promptId;(!ae||xe)&&he(null)},[ke,ue,D.busySessions,w]);const De=p&&w?(ae,xe)=>p(ae,w,xe):void 0;G.useEffect(()=>P({}),[w]);const Re=l==="chat"&&(Ye.length>0||vt);G.useLayoutEffect(()=>{L.current=!0;const ae=X.current;ae&&(ae.scrollTop=ae.scrollHeight)},[w,Re]),G.useLayoutEffect(()=>{const ae=X.current;ae&&L.current&&(ae.scrollTop=ae.scrollHeight)},[Ye,vt]),G.useEffect(()=>{const ae=X.current,xe=K.current;if(!ae||!xe)return;const Ae=new ResizeObserver(()=>{L.current&&(ae.scrollTop=ae.scrollHeight)});return Ae.observe(xe),Ae.observe(ae),()=>Ae.disconnect()},[Re]);async function $e(){const ae=b.trim(),xe=R;if(!ae&&xe.length===0)return;if(ae&&_e&&xe.length===0){E(""),mi({promptId:_e,answers:[],note:ae}).then(at=>{at||E(Si=>Si||ae)});return}if(vt)return;const Ae=Ee;if(!Ae&&!w)return;E(""),N([]);let tt=w;try{if(!tt){const nn=await UT(e,Ae.harness,{model:Ae.model,permissionMode:Ae.permissionMode,reasoningLevel:Ae.reasoningLevel});Y.current.add(nn.id),C(jr=>[nn,...jr]),S(nn.id),tt=nn.id}T({type:"optimisticUser",sessionId:tt,text:ae,imageUrls:xe.map(nn=>nn.dataUrl)}),T({type:"busy",sessionId:tt,busy:!0}),L.current=!0,y==="archived"&&x("active");const at=Ae?{model:Ae.model,permissionMode:Ae.permissionMode,reasoningLevel:Ae.reasoningLevel}:{};P({});const Si=xe.map(nn=>({mediaType:nn.mediaType,dataBase64:nn.dataUrl.slice(nn.dataUrl.indexOf(",")+1)}));await WT(tt,ae,at,Si.length?Si:void 0)}catch{tt&&T({type:"busy",sessionId:tt,busy:!1})}}function rt(){w&&XT(w)}G.useEffect(()=>{if(!vt||l!=="chat")return;function ae(xe){var Ae;xe.key!=="Escape"||xe.defaultPrevented||(xe.preventDefault(),rt(),(Ae=M.current)==null||Ae.focus())}return document.addEventListener("keydown",ae),()=>document.removeEventListener("keydown",ae)},[vt,w,l]);function ct(ae){q.current.add(ae),C(xe=>xe.filter(Ae=>Ae.id!==ae)),S(xe=>xe===ae?null:xe),Y.current.delete(ae),T({type:"forget",sessionId:ae})}function Ve(ae,xe){const Ae=ae.archived;C(tt=>tt.map(at=>at.id===ae.id?{...at,archived:xe}:at)),qT(ae.id,xe).catch(()=>{C(tt=>tt.map(at=>at.id===ae.id?{...at,archived:Ae}:at))})}function Ln(ae,xe){const Ae=ae.title;C(tt=>tt.map(at=>at.id===ae.id?{...at,title:xe}:at)),VT(ae.id,xe).catch(()=>{C(tt=>tt.map(at=>at.id===ae.id?{...at,title:Ae}:at))})}async function tn(ae){var Ae;const xe=((Ae=ae.title)==null?void 0:Ae.trim())||"Untitled";if(window.confirm(`Delete "${xe}"? +The store is copied to the new location and activated there. Active runs or chats will block the move.`))){d({kind:"moving",phase:"preparing",copied:0,total:(c==null?void 0:c.treeBytes)??0});try{await kT(S)}catch(D){d({kind:"idle"}),_(D instanceof Error?D.message:String(D))}}}return g.jsxs(g.Fragment,{children:[g.jsx("h1",{children:"Storage"}),g.jsxs("p",{className:"settings-sub",children:["Where orx keeps everything on this machine — the local database, run logs, artifacts, and chat attachments for ",g.jsx("strong",{children:"all"})," projects. Moving it copies the whole store to the new location and activates it there."]}),n?g.jsx("div",{className:"settings-card",children:g.jsx("div",{className:"error",children:n})}):e?g.jsxs("div",{className:"settings-card",children:[g.jsxs("div",{className:"settings-card-head",children:[g.jsx("h3",{children:"Data directory"}),g.jsx("div",{className:"spacer",style:{flex:1}}),g.jsx("span",{className:"badge",children:e.isDefault?"Default":"Custom"})]}),g.jsxs("div",{className:"kv",children:[g.jsx("span",{className:"k",children:"Current"}),g.jsx("span",{className:"v mono",children:e.current}),g.jsx("span",{className:"k",children:"Source"}),g.jsx("span",{className:"v",children:HL[e.source]}),!e.isDefault&&g.jsxs(g.Fragment,{children:[g.jsx("span",{className:"k",children:"Default"}),g.jsx("span",{className:"v mono",children:e.defaultPath})]})]}),w?g.jsxs("p",{className:"settings-note",children:["The data directory is pinned by the ",g.jsx("code",{children:"ORX_DATA_DIR"})," environment variable, which overrides this setting. Unset it to choose a location here."]}):g.jsxs("form",{className:"form settings-form",onSubmit:b,children:[g.jsxs("label",{children:["New location",g.jsx("input",{className:"mono",type:"text",value:a,onChange:E=>{l(E.target.value),f(null)},placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,disabled:p.kind==="moving"})]}),c&&!c.error&&c.ok&&g.jsxs("p",{className:"settings-note",children:["Ready to move ",ls(c.treeBytes??0),c.freeBytes!=null&&` — ${ls(c.freeBytes)} free at target`,c.sameFilesystem?" (same disk, instant)":"","."]}),c&&c.ok===!1&&c.error&&g.jsx("div",{className:"error",children:c.error}),v&&g.jsx("div",{className:"error",children:v}),p.kind==="moving"&&g.jsx(zL,{value:p.copied,max:p.total,label:`${p.phase.charAt(0).toUpperCase()}${p.phase.slice(1)}…`}),p.kind==="done"&&g.jsxs("p",{className:"settings-note",children:["Moved. orx is now using the new location.",p.oldPathLeft&&g.jsxs(g.Fragment,{children:[" ","The old copy was left at ",g.jsx("code",{children:p.oldPathLeft})," (different disk) — you can delete it once you've confirmed everything works."]})]}),p.kind==="error"&&g.jsxs("div",{className:"error",children:["Move failed: ",p.message]}),g.jsxs("div",{className:"actions",children:[g.jsx("button",{type:"button",className:"btn",onClick:x,disabled:u||!S||y||p.kind==="moving",children:u?"Checking…":"Check"}),g.jsx("button",{type:"submit",className:"btn primary",disabled:!S||y||p.kind==="moving",children:p.kind==="moving"?"Moving…":"Move data here"})]})]})]}):g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Loading…"]})]})}const Zp=e=>e==="running"||e==="starting";function PL(e){return Zp(e.status)?e1(Date.now()-e.createdAt):e.endedAt?e1(e.endedAt-e.createdAt):"—"}function ib({instances:e,emptyLabel:t}){return e.length===0?g.jsx("p",{className:"instances-empty",children:t}):g.jsx("div",{className:"instances-table-wrap",children:g.jsxs("table",{className:"runs-table",children:[g.jsx("thead",{children:g.jsxs("tr",{children:[g.jsx("th",{children:"Backend"}),g.jsx("th",{children:"Project"}),g.jsx("th",{children:"Status"}),g.jsx("th",{children:"Started"}),g.jsx("th",{children:"Runtime"})]})}),g.jsx("tbody",{children:e.map(n=>{var a;const r=typeof((a=n.backend)==null?void 0:a.url)=="string"?n.backend.url:void 0;return g.jsxs("tr",{children:[g.jsx("td",{children:g.jsxs("span",{className:"backend-cell",children:[g.jsx(lL,{backend:n.backend}),r&&g.jsx("a",{className:"icon-btn",href:r,target:"_blank",rel:"noreferrer",title:"Open job page","aria-label":"Open job page",onClick:l=>l.stopPropagation(),children:g.jsx(rx,{size:12})})]})}),g.jsx("td",{children:n.projectName??Op(n.projectId)}),g.jsx("td",{children:g.jsx(Ko,{status:n.status})}),g.jsx("td",{children:Na(n.createdAt)}),g.jsx("td",{children:PL(n)})]},n.id)})})]})})}function $L(){const[e,t]=G.useState(null),[n,r]=G.useState(null),[a,l]=G.useState(!1),[,u]=G.useState(0);G.useEffect(()=>{const d=setInterval(()=>u(v=>v+1),3e4);return()=>clearInterval(d)},[]);const o=()=>{l(!0),uT().then(d=>{t(d),r(null)}).catch(d=>{r(d instanceof Error?d.message:String(d)),t(v=>v??[])}).finally(()=>l(!1))};G.useEffect(()=>o(),[]);const c=(d,v)=>v.createdAt-d.createdAt,f=e==null?void 0:e.filter(d=>Zp(d.status)).sort(c),p=e==null?void 0:e.filter(d=>!Zp(d.status)).sort(c);return g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"settings-head-row",children:[g.jsx("h1",{children:"Instances"}),g.jsxs("button",{className:"btn sm",onClick:o,disabled:a,children:[g.jsx(Au,{size:12,className:a?"spin":""})," Refresh"]})]}),g.jsx("p",{className:"settings-sub",children:"Compute spun up across all projects — this machine, Modal, Hugging Face, SSH, Kubernetes, Slurm, and OpenResearch."}),n&&g.jsx("div",{className:"error",children:n}),!f||!p?g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Loading…"]}):g.jsxs(g.Fragment,{children:[g.jsxs("h2",{className:"instances-section-title",children:["Running",f.length>0&&g.jsx("span",{className:"count-badge",children:f.length})]}),g.jsx(ib,{instances:f,emptyLabel:"Nothing running right now."}),g.jsx("h2",{className:"instances-section-title",children:"Past"}),g.jsx(ib,{instances:p,emptyLabel:"No past instances yet."})]})]})}const UL=[{id:"harnesses",label:"Harnesses",icon:g.jsx(KA,{size:15})},{id:"compute",label:"Compute",icon:g.jsx(fN,{size:15})},{id:"instances",label:"Instances",icon:g.jsx(Lp,{size:15})},{id:"environment",label:"Environment",icon:g.jsx(QN,{size:15})},{id:"git",label:"Git",icon:g.jsx(Ku,{size:15})},{id:"storage",label:"Storage",icon:g.jsx(NN,{size:15})}];function GL({tab:e}){return g.jsxs("div",{className:"settings-view",children:[e==="harnesses"&&g.jsx(fL,{}),e==="compute"&&g.jsx(TL,{}),e==="environment"&&g.jsxs(g.Fragment,{children:[g.jsx("h1",{children:"Environment"}),g.jsx("p",{className:"settings-sub",children:"Variables available to runs and the research agent (API keys, tokens)."}),g.jsx(BL,{})]}),e==="instances"&&g.jsx($L,{}),e==="git"&&g.jsx(IL,{}),e==="storage"&&g.jsx(FL,{})]})}function qL({skills:e,activeIndex:t,onPick:n,onHover:r}){return g.jsx("div",{className:"skill-menu",children:e.map((a,l)=>g.jsxs("button",{type:"button",className:`skill-item ${l===t?"active":""}`,onMouseDown:u=>{u.preventDefault(),n(a)},onMouseEnter:()=>r(l),children:[g.jsxs("span",{className:"skill-name",children:["/",a.name," ",g.jsx("span",{className:"skill-hint",children:a.argHint})]}),g.jsx("span",{className:"skill-desc",children:a.description})]},a.name))})}const Qp={"claude-code":"Claude Code",codex:"Codex",opencode:"OpenCode"};function rb(e){var n,r,a;const t=e.find(l=>l.agentReady);return t?{harness:t.id,model:((n=t.models[0])==null?void 0:n.id)??null,permissionMode:((r=t.options)==null?void 0:r.defaultPermissionMode)??null,reasoningLevel:((a=t.options)==null?void 0:a.defaultReasoningLevel)??null}:null}function lh(){const[e,t]=G.useState(!1),n=G.useRef(null);return G.useEffect(()=>{if(!e)return;const r=l=>{var u;(u=n.current)!=null&&u.contains(l.target)||t(!1)},a=l=>{l.key==="Escape"&&(l.preventDefault(),l.stopPropagation(),t(!1))};return document.addEventListener("mousedown",r),document.addEventListener("keydown",a,!0),()=>{document.removeEventListener("mousedown",r),document.removeEventListener("keydown",a,!0)}},[e]),{open:e,setOpen:t,ref:n}}function VL({value:e,onSelect:t,onHarnesses:n,lockHarness:r=!1}){const[a,l]=G.useState([]),{open:u,setOpen:o,ref:c}=lh(),[f,p]=G.useState("");G.useEffect(()=>{Og().then(C=>{l(C),n==null||n(C)}).catch(()=>{})},[]);const d=G.useMemo(()=>{const C=f.trim().toLowerCase();return(r&&e?a.filter(S=>S.id===e.harness):a).map(S=>{let y=S.models;return C?y=y.filter(x=>x.id.toLowerCase().includes(C)):S.id==="opencode"&&(y=y.slice(0,6)),{harness:S,models:y,hidden:C?0:S.models.length-y.length}})},[a,f,r,e]),v=(C,w)=>{var y,x;const S=(e==null?void 0:e.harness)===C.id;t({harness:C.id,model:w,permissionMode:S?e.permissionMode:((y=C.options)==null?void 0:y.defaultPermissionMode)??null,reasoningLevel:S?e.reasoningLevel:((x=C.options)==null?void 0:x.defaultReasoningLevel)??null}),o(!1),p("")},_=e?e.model?Nu(e.model):"Default model":"Model";return g.jsxs("div",{className:"model-picker","data-onboarding":"model-picker",ref:c,children:[g.jsxs("button",{type:"button",className:"composer-pill",title:"Harness + model for this chat",onClick:()=>o(C=>!C),children:[_,g.jsx(gs,{size:12})]}),u&&g.jsxs("div",{className:"model-menu align-right",children:[g.jsx("input",{autoFocus:!0,type:"text",placeholder:"Search models…",value:f,onChange:C=>p(C.target.value)}),g.jsxs("div",{className:"model-menu-list",children:[d.map(({harness:C,models:w,hidden:S})=>g.jsxs("div",{children:[g.jsx("div",{className:"model-group",children:C.name}),C.agentReady?g.jsxs(g.Fragment,{children:[w.map(y=>g.jsxs("button",{className:"model-item",onClick:()=>v(C,y.id),children:[g.jsxs("span",{children:[Nu(y.id),g.jsx("span",{className:"model-id",children:y.id})]}),(e==null?void 0:e.harness)===C.id&&(e==null?void 0:e.model)===y.id&&g.jsx(vn,{size:13})]},y.id)),S>0&&g.jsxs("div",{className:"model-more",children:[S," more — search to find"]})]}):g.jsx("div",{className:"model-more",children:C.agentNote??"Not available"})]},C.id)),a.length===0&&g.jsx("div",{className:"model-more",children:"Detecting harnesses…"})]}),r&&e&&a.length>1&&g.jsxs("div",{className:"model-locked-note",children:[g.jsx(LN,{size:11}),"Sessions keep their harness — new chat to switch"]})]})]})}function sb({choices:e,value:t,defaultId:n,header:r,align:a="left",variant:l="pill",title:u,numbered:o=!1,onSelect:c}){var y,x;const{open:f,setOpen:p,ref:d}=lh();if(e.length===0)return null;const v=t??n??((y=e[0])==null?void 0:y.id)??null,_=e.find(b=>b.id===v),C=e.find(b=>b.id===n),w=(_==null?void 0:_.label)??((x=e[0])==null?void 0:x.label)??"",S=b=>{c(b),p(!1)};return g.jsxs("div",{className:"option-picker",ref:d,children:[g.jsxs("button",{type:"button",className:l==="pill"?"composer-pill":"composer-bare",title:u,onClick:()=>p(b=>!b),children:[w,g.jsx(gs,{size:12})]}),f&&g.jsxs("div",{className:`option-menu ${a==="right"?"align-right":""}`,children:[r&&g.jsx("div",{className:"model-group",children:r}),C&&g.jsxs(g.Fragment,{children:[g.jsxs("button",{className:"model-item",onClick:()=>S(C.id),children:[g.jsxs("span",{children:[C.label," ",g.jsx("span",{className:"option-default",children:"· Default"})]}),v===C.id&&g.jsx(vn,{size:13})]}),g.jsx("div",{className:"option-sep"})]}),e.map((b,E)=>g.jsxs("button",{className:"model-item",onClick:()=>S(b.id),children:[g.jsx("span",{children:b.label}),v===b.id?g.jsx(vn,{size:13}):o&&g.jsx("span",{className:"option-num",children:E+1})]},b.id))]})]})}const $w="orx:agent-selection";function WL(){try{const e=localStorage.getItem($w);return e?JSON.parse(e):null}catch{return null}}const Uw="local-";function YL(e,t){const n=e.findIndex(a=>a.id===t.id);if(n>=0){const a=e.slice();return a[n]=t,a}return[...t.role==="user"?e.filter(a=>!a.id.startsWith(Uw)):e,t]}function XL(e,t){switch(t.type){case"reset":return{messagesBySession:{},busySessions:new Set};case"seed":return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:t.messages}};case"upsertMessage":{const n=e.messagesBySession[t.sessionId]??[];return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:YL(n,t.message)}}}case"optimisticUser":{const n=e.messagesBySession[t.sessionId]??[],r=t.text?[{id:"p0",type:"text",text:t.text}]:[];t.imageUrls.forEach((l,u)=>r.push({id:`img${u}`,type:"image",text:l}));const a={id:`${Uw}${Date.now()}`,role:"user",parts:r,createdAt:Date.now()};return{...e,messagesBySession:{...e.messagesBySession,[t.sessionId]:[...n,a]}}}case"busy":{const n=new Set(e.busySessions);return t.busy?n.add(t.sessionId):n.delete(t.sessionId),{...e,busySessions:n}}case"seedBusy":return{...e,busySessions:new Set(t.sessions)};case"forget":{const n={...e.messagesBySession};delete n[t.sessionId];const r=new Set(e.busySessions);return r.delete(t.sessionId),{messagesBySession:n,busySessions:r}}}}function KL({harnesses:e,selection:t}){if(e.length===0)return null;const n=t?e.find(r=>r.id===t.harness):void 0;return n?g.jsxs("p",{className:"chat-empty-hint",children:["Chatting with ",n.name,n.account?` as ${n.account}`:""," — detected automatically, switch in the model picker below."]}):g.jsx("p",{className:"chat-empty-hint",children:"No coding agent detected on this machine — install Claude Code, Codex or opencode and sign in, then re-open the model picker below."})}function Gw(e){return e==="error"?"tool-status error":e==="completed"?"tool-status":"tool-status running"}function ZL(e){if(!e)return"";const t=Math.max(0,Math.floor((Date.now()-e)/1e3));if(t<60)return"now";const n=Math.floor(t/60);if(n<60)return`${n}m`;const r=Math.floor(n/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}function ab(e){const t=e.replace(/\/+$/,"");return t.slice(t.lastIndexOf("/")+1)||t}function Jp(e){var u,o;const t=e.tool??"tool",n=((u=e.state)==null?void 0:u.input)??{},r=typeof n.command=="string"?n.command:null,a=typeof n.filePath=="string"?n.filePath:null,l=typeof n.description=="string"?n.description:null;switch(t){case"Bash":case"bash":return r?`Ran ${r}`:"Ran command";case"Read":return a?`Read ${ab(a)}`:"Read file";case"Edit":case"Write":case"NotebookEdit":return a?`Edited ${ab(a)}`:"Edited file";case"Grep":return typeof n.pattern=="string"?`Searched “${n.pattern}”`:"Searched";case"Glob":return typeof n.pattern=="string"?`Found ${n.pattern}`:"Listed files";case"WebFetch":case"WebSearch":return l??"Searched the web";case"Task":return l??"Ran a subagent";case"error":return"Error";default:{const c=l??a??r??((o=e.state)==null?void 0:o.title)??"";return c?`${t}: ${c}`:t}}}function QL({part:e,onOpenFile:t}){var o,c;const n=e.state,r=(n==null?void 0:n.error)||(n==null?void 0:n.output)||"",a=typeof((o=n==null?void 0:n.input)==null?void 0:o.command)=="string"?n.input.command:null,l=typeof((c=n==null?void 0:n.input)==null?void 0:c.filePath)=="string"?n.input.filePath:null,u=!!(r||a||l);return g.jsxs("details",{className:"tool-row",open:!1,children:[g.jsxs("summary",{children:[g.jsx("span",{className:Gw(n==null?void 0:n.status)}),g.jsx("span",{className:"tool-line",children:Jp(e)}),l&&t&&g.jsx("button",{className:"tool-open file-link",title:`Open ${l}`,onClick:f=>{f.preventDefault(),f.stopPropagation(),t(l)},children:"open"})]}),u&&g.jsxs("div",{className:"tool-detail",children:[a&&g.jsx("div",{className:"tool-cmd-full",children:a}),r&&g.jsx("div",{className:"tool-output",children:r.slice(0,2e4)})]})]})}function JL({parts:e,onOpenFile:t}){const n=e.some(c=>{var f;return((f=c.state)==null?void 0:f.status)==="running"}),r=e.some(c=>{var f;return((f=c.state)==null?void 0:f.status)==="error"}),[a,l]=G.useState(!1),u=a||n,o=e.length===1?Jp(e[0]):n?Jp(e.find(c=>{var f;return((f=c.state)==null?void 0:f.status)==="running"})??e[e.length-1]):`Used ${e.length} tools`;return g.jsxs("div",{className:`tool-group ${r?"has-error":""}`,children:[g.jsxs("button",{className:"tool-group-summary",onClick:()=>l(c=>!c),children:[g.jsx("span",{className:Gw(n?"running":r?"error":"completed")}),g.jsx("span",{className:"tool-line",children:o}),g.jsx(Xu,{size:12,className:`tool-chevron ${u?"open":""}`})]}),u&&g.jsx("div",{className:"tool-group-rows",children:e.map(c=>g.jsx(QL,{part:c,onOpenFile:t},c.id))})]})}function eO({part:e,onRespond:t,onOpenFile:n,onOpenPlan:r}){var p,d,v;const a=e.prompt,[l,u]=G.useState([]),o=!t,c=_=>t==null?void 0:t({promptId:e.id,..._});if(a.resolved){if(a.kind==="permission")return null;if(a.kind==="plan"){const C=a.approved===!0?"Plan approved":a.approved===!1?a.note?"Revision requested":"Rejected":"Resolved",w=a.approved===!0?"approved":a.approved===!1?a.note?"revised":"rejected":"";return g.jsxs("details",{className:"prompt-collapsed",children:[g.jsxs("summary",{children:[g.jsx("span",{className:"prompt-collapsed-title",children:a.synthesized?"Plan":"Proposed plan"}),g.jsx("span",{className:`prompt-outcome ${w}`,children:C})]}),g.jsxs("div",{className:"prompt-collapsed-body",children:[g.jsx(Xo,{text:a.plan??"",onOpenFile:n}),a.note&&g.jsx("div",{className:"prompt-collapsed-note",children:a.note})]})]})}const _=(a.answers??[]).join(", ")||a.note||"";return g.jsxs("details",{className:"prompt-collapsed",children:[g.jsxs("summary",{children:[g.jsx("span",{className:"prompt-collapsed-title",children:a.header||a.question||"Question"}),g.jsx("span",{className:`prompt-outcome ${_?"chosen":""}`,children:_||"Resolved"})]}),g.jsxs("div",{className:"prompt-collapsed-body",children:[a.header&&a.question&&g.jsx("div",{className:"prompt-q",children:a.question}),(a.options??[]).length>0&&g.jsx("ul",{className:"prompt-collapsed-options",children:(a.options??[]).map(C=>{var w;return g.jsx("li",{className:(w=a.answers)!=null&&w.includes(C.label)?"sel":"",children:C.label},C.label)})}),a.note&&a.note!==_&&g.jsx("div",{className:"prompt-collapsed-note",children:a.note})]})]})}if(a.kind==="plan"){const _=!!r;return g.jsxs("div",{className:`prompt-card plan ${o?"readonly":""}`,children:[g.jsx("div",{className:"prompt-head",children:a.synthesized?"Plan mode — ready to proceed?":"Proposed plan"}),g.jsx("div",{className:`prompt-plan ${_?"clamped":""}`,children:g.jsx(Xo,{text:a.plan??"",onOpenFile:n})}),_&&g.jsx("button",{className:"prompt-plan-open",onClick:()=>r(a.plan??"",e.id),children:"View full plan"}),!o&&!_&&g.jsxs("div",{className:"prompt-actions",children:[g.jsx("button",{className:"btn-primary",onClick:()=>c({approve:!0,resumeMode:"auto"}),children:"Accept and auto mode"}),g.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!0,resumeMode:"bypass"}),children:"Accept and bypass all"}),g.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!1}),children:"Reject"})]})]})}if(a.kind==="permission"){const _=typeof((p=a.toolInput)==null?void 0:p.command)=="string"&&a.toolInput.command||typeof((d=a.toolInput)==null?void 0:d.filePath)=="string"&&a.toolInput.filePath||"",C=typeof((v=a.toolInput)==null?void 0:v.reason)=="string"&&a.toolInput.reason||"";return g.jsxs("div",{className:`prompt-card permission ${o?"readonly":""}`,children:[g.jsxs("div",{className:"prompt-head",children:["Permission needed: ",g.jsx("code",{children:a.tool})]}),_&&g.jsx("div",{className:"prompt-sub",children:_}),C&&g.jsx("div",{className:"prompt-sub",children:C}),!o&&g.jsxs("div",{className:"prompt-actions",children:[g.jsx("button",{className:"btn-primary",onClick:()=>c({approve:!0}),children:"Allow"}),g.jsx("button",{className:"btn-ghost",onClick:()=>c({approve:!1}),children:"Deny"})]})]})}const f=_=>u(C=>a.multiSelect?C.includes(_)?C.filter(w=>w!==_):[...C,_]:[_]);return g.jsxs("div",{className:`prompt-card question ${o?"readonly":""}`,children:[a.header&&g.jsx("div",{className:"prompt-head",children:a.header}),a.question&&g.jsx("div",{className:"prompt-q",children:a.question}),g.jsx("div",{className:"prompt-options",children:(a.options??[]).map(_=>{const C=l.includes(_.label);return g.jsxs("button",{className:`prompt-option ${C?"sel":""}`,disabled:o,onClick:()=>o?void 0:a.multiSelect?f(_.label):c({answers:[_.label]}),children:[g.jsx("span",{className:"prompt-option-label",children:_.label}),_.description&&g.jsx("span",{className:"prompt-option-desc",children:_.description})]},_.label)})}),a.multiSelect&&!o&&g.jsx("div",{className:"prompt-actions",children:g.jsx("button",{className:"btn-primary",disabled:l.length===0,onClick:()=>c({answers:l}),children:"Submit"})})]})}function tO(e){return e.role==="user"?!0:e.parts.some(t=>t.type==="prompt"?!!t.prompt&&!(t.prompt.resolved&&t.prompt.kind==="permission"):t.type==="text"||t.type==="reasoning"?!!t.text:!0)}function nO({message:e,onOpenFile:t,onRespond:n,onOpenPlan:r}){if(e.role==="user"){const o=e.parts.filter(f=>f.type==="text").map(f=>f.text??"").join(` +`),c=e.parts.filter(f=>f.type==="image"&&f.text).map(f=>f.text.startsWith("data:")?f.text:YT(f.text));return g.jsxs("div",{className:"msg-user",children:[o,c.length>0&&g.jsx("div",{className:"msg-images",children:c.map((f,p)=>g.jsx("a",{href:f,target:"_blank",rel:"noreferrer",children:g.jsx("img",{src:f,alt:"attachment"})},p))})]})}const a=[];let l=[];const u=()=>{l.length!==0&&(a.push(g.jsx(JL,{parts:l,onOpenFile:t},`tg-${l[0].id}`)),l=[])};for(const o of e.parts){if(o.type==="tool"){l.push(o);continue}u(),o.type==="text"&&o.text?a.push(g.jsx(Xo,{text:o.text,onOpenFile:t},o.id)):o.type==="reasoning"&&o.text?a.push(g.jsxs("details",{className:"reasoning",children:[g.jsx("summary",{children:"thinking…"}),o.text]},o.id)):o.type==="prompt"&&o.prompt&&a.push(g.jsx(eO,{part:o,onRespond:n,onOpenFile:t,onOpenPlan:r},o.id))}return u(),g.jsx("div",{className:"msg-assistant",children:a})}const qw=[{id:"active",label:"Active",railLabel:"Recents"},{id:"archived",label:"Archived",railLabel:"Archived"},{id:"all",label:"All",railLabel:"All sessions"}];function iO({value:e,onChange:t}){const{open:n,setOpen:r,ref:a}=lh();return g.jsxs("div",{className:"rail-filter",ref:a,children:[g.jsx("button",{className:`icon-btn rail-filter-btn ${e!=="active"?"active":""}`,title:"Filter sessions","aria-label":"Filter sessions",onClick:()=>r(l=>!l),children:g.jsx(KN,{size:13})}),n&&g.jsx("div",{className:"option-menu drop-down align-right",children:qw.map(l=>g.jsxs("button",{className:"model-item",onClick:()=>{t(l.id),r(!1)},children:[g.jsx("span",{children:l.label}),e===l.id&&g.jsx(vn,{size:13})]},l.id))})]})}function rO({session:e,active:t,busy:n,waiting:r,onOpen:a,onRename:l,onSetArchived:u,onDelete:o}){var b;const{open:c,setOpen:f,ref:p}=lh(),d=((b=e.title)==null?void 0:b.trim())||"Untitled",[v,_]=G.useState(!1),[C,w]=G.useState(""),S=G.useRef(null);function y(){var E;w(((E=e.title)==null?void 0:E.trim())||""),_(!0)}function x(){var D;const E=C.trim();_(!1),E&&E!==(((D=e.title)==null?void 0:D.trim())||"")&&l(E)}return G.useEffect(()=>{var E,D;v&&((E=S.current)==null||E.focus(),(D=S.current)==null||D.select())},[v]),g.jsxs("div",{ref:p,role:"button",tabIndex:0,className:`session-row ${t?"active":""} ${c?"menu-open":""} ${v?"editing":""}`,title:`${Qp[e.harness]}${e.model?` · ${e.model}`:""}`,onClick:()=>{v||(c?f(!1):a())},onKeyDown:E=>{E.target===E.currentTarget&&(E.key==="Enter"||E.key===" ")&&(E.preventDefault(),c?f(!1):a())},children:[g.jsx("span",{className:"session-dot",children:n&&g.jsx("span",{className:`busy-dot ${r?"waiting":""}`})}),v?g.jsx("input",{ref:S,className:"session-title-input","aria-label":"Session title",value:C,onChange:E=>w(E.target.value),onClick:E=>E.stopPropagation(),onBlur:x,onKeyDown:E=>{E.stopPropagation(),E.key==="Enter"?(E.preventDefault(),x()):E.key==="Escape"&&(E.preventDefault(),_(!1))}}):g.jsx("span",{className:"session-title",children:d}),g.jsx("span",{className:"session-time",children:ZL(e.updatedAt)}),g.jsx("button",{className:"session-menu-btn",title:"Session options","aria-label":"Session options",onClick:E=>{E.stopPropagation(),f(D=>!D)},children:g.jsx(pN,{size:14})}),c&&g.jsxs("div",{className:"option-menu drop-down session-menu",children:[g.jsx("button",{className:"model-item",onClick:E=>{E.stopPropagation(),f(!1),y()},children:g.jsx("span",{children:"Rename"})}),g.jsx("button",{className:"model-item",onClick:E=>{E.stopPropagation(),f(!1),u(!e.archived)},children:g.jsx("span",{children:e.archived?"Unarchive":"Archive"})}),g.jsx("button",{className:"model-item danger",onClick:E=>{E.stopPropagation(),f(!1),o()},children:g.jsx("span",{children:"Delete"})})]})]})}function sO({projectId:e,paperId:t,railHeader:n,railOpen:r,onShowRail:a,mainView:l,onSelectMainView:u,panelOpen:o,onTogglePanel:c,onOpenFile:f,onOpenPlan:p,onStartTour:d,children:v}){var bi,ii,bs;const[_,C]=G.useState([]),[w,S]=G.useState(null),[y,x]=G.useState("active"),[b,E]=G.useState(""),[D,N]=G.useState([]),[R,T]=G.useReducer(XL,{messagesBySession:{},busySessions:new Set}),[j,B]=G.useState([]),[z,V]=G.useState(WL),[F,P]=G.useState({}),W=G.useRef(new Set),q=G.useRef(new Set),X=G.useRef(null),K=G.useRef(null),L=G.useRef(!0),M=G.useRef(null),[O,U]=G.useState([]),[$,Q]=G.useState(0),[re,se]=G.useState(!1);G.useEffect(()=>{UT().then(U).catch(()=>{})},[]);const Z=b.startsWith("/")&&!/\s/.test(b)?b.slice(1):null,H=Z!==null&&!re?O.filter(ae=>ae.name.startsWith(Z.toLowerCase())):[],ee=H.length>0,ne=Math.min($,Math.max(0,H.length-1));G.useEffect(()=>Q(0),[Z]);function pe(ae){var xe;E(`/${ae.name} `),(xe=M.current)==null||xe.focus()}function fe(ae){for(const xe of ae){if(!/^image\/(png|jpeg|gif|webp)$/.test(xe.type))continue;const Ae=new FileReader;Ae.onload=()=>{const tt=Ae.result;N(at=>[...at,{dataUrl:tt,mediaType:xe.type}])},Ae.readAsDataURL(xe)}}function ye(ae){const xe=Array.from(ae.clipboardData.items).filter(Ae=>Ae.kind==="file"&&Ae.type.startsWith("image/")).map(Ae=>Ae.getAsFile()).filter(Ae=>Ae!==null);xe.length>0&&(ae.preventDefault(),fe(xe))}const Ce=_.find(ae=>ae.id===w),Ee=Ce?{harness:Ce.harness,model:F.model??Ce.model,permissionMode:F.permissionMode??Ce.permissionMode,reasoningLevel:F.reasoningLevel??Ce.reasoningLevel}:z??rb(j),Ne=Ee?j.find(ae=>ae.id===Ee.harness):void 0,we=Ne==null?void 0:Ne.options,ft=ae=>{Ce?P({model:ae.model,permissionMode:ae.permissionMode,reasoningLevel:ae.reasoningLevel}):(V(ae),localStorage.setItem($w,JSON.stringify(ae)))},Ct=ae=>{Ee&&ft({...Ee,permissionMode:ae})},st=ae=>{Ee&&ft({...Ee,reasoningLevel:ae})};G.useEffect(()=>{C([]),S(null),E(""),N([]),T({type:"reset"}),W.current=new Set,Qy(e).then(ae=>{C(ae),S(xe=>{var Ae;return xe??((Ae=ae.find(tt=>!tt.archived))==null?void 0:Ae.id)??null}),T({type:"seedBusy",sessions:ae.filter(xe=>xe.busy).map(xe=>xe.id)})}).catch(()=>{})},[e]),G.useEffect(()=>{!w||W.current.has(w)||(W.current.add(w),Jy(w).then(ae=>T({type:"seed",sessionId:w,messages:ae})).catch(()=>W.current.delete(w)))},[w]),G.useEffect(()=>e3(ae=>{switch(ae.type){case"session":if(ae.session.projectId!==e||q.current.has(ae.session.id))return;C(xe=>{const Ae=xe.findIndex(at=>at.id===ae.session.id);if(Ae<0)return[ae.session,...xe];const tt=xe.slice();return tt[Ae]=ae.session,tt});break;case"sessionDeleted":ct(ae.sessionId);break;case"message":T({type:"upsertMessage",sessionId:ae.sessionId,message:ae.message});break;case"busy":T({type:"busy",sessionId:ae.sessionId,busy:ae.busy});break}}),[e]);const We=w?R.messagesBySession[w]??[]:[],vt=w?R.busySessions.has(w):!1,dt=ae=>R.busySessions.has(ae)&&(R.messagesBySession[ae]??[]).some(xe=>xe.parts.some(Ae=>Ae.type==="prompt"&&Ae.prompt&&!Ae.prompt.resolved&&Ae.prompt.nativeId)),qe=w?dt(w):!1,Pe=Ce,ue=G.useMemo(()=>{var ae;for(let xe=We.length-1;xe>=0;xe--)for(const Ae of We[xe].parts)if(Ae.type==="prompt"&&((ae=Ae.prompt)==null?void 0:ae.kind)==="plan"&&!Ae.prompt.resolved)return{promptId:Ae.id,plan:Ae.prompt.plan??"",synthesized:!!Ae.prompt.synthesized};return null},[We]),_e=G.useMemo(()=>{const ae=Pe==null?void 0:Pe.harness;if(!w||ae!=="claude-code"&&ae!=="codex")return null;for(let xe=We.length-1;xe>=0;xe--)for(const Ae of We[xe].parts)if(!(Ae.type!=="prompt"||!Ae.prompt||Ae.prompt.resolved)&&Ae.prompt.kind==="question")return Ae.prompt.nativeId&&!R.busySessions.has(w)?null:Ae.id;return null},[We,Pe==null?void 0:Pe.harness,w,R.busySessions]),[ke,he]=G.useState(null),be=ke&&ke.sessionId===w?ke:null;G.useEffect(()=>{if(!ke)return;const ae=R.busySessions.has(ke.sessionId),xe=ke.sessionId===w&&ue&&ue.promptId!==ke.promptId;(!ae||xe)&&he(null)},[ke,ue,R.busySessions,w]);const Re=p&&w?(ae,xe)=>p(ae,w,xe):void 0;G.useEffect(()=>P({}),[w]);const De=l==="chat"&&(We.length>0||vt);G.useLayoutEffect(()=>{L.current=!0;const ae=X.current;ae&&(ae.scrollTop=ae.scrollHeight)},[w,De]),G.useLayoutEffect(()=>{const ae=X.current;ae&&L.current&&(ae.scrollTop=ae.scrollHeight)},[We,vt]),G.useEffect(()=>{const ae=X.current,xe=K.current;if(!ae||!xe)return;const Ae=new ResizeObserver(()=>{L.current&&(ae.scrollTop=ae.scrollHeight)});return Ae.observe(xe),Ae.observe(ae),()=>Ae.disconnect()},[De]);async function $e(){const ae=b.trim(),xe=D;if(!ae&&xe.length===0)return;if(ae&&_e&&xe.length===0){E(""),mi({promptId:_e,answers:[],note:ae}).then(at=>{at||E(Si=>Si||ae)});return}if(vt)return;const Ae=Ee;if(!Ae&&!w)return;E(""),N([]);let tt=w;try{if(!tt){const nn=await GT(e,Ae.harness,{model:Ae.model,permissionMode:Ae.permissionMode,reasoningLevel:Ae.reasoningLevel});W.current.add(nn.id),C(jr=>[nn,...jr]),S(nn.id),tt=nn.id}T({type:"optimisticUser",sessionId:tt,text:ae,imageUrls:xe.map(nn=>nn.dataUrl)}),T({type:"busy",sessionId:tt,busy:!0}),L.current=!0,y==="archived"&&x("active");const at=Ae?{model:Ae.model,permissionMode:Ae.permissionMode,reasoningLevel:Ae.reasoningLevel}:{};P({});const Si=xe.map(nn=>({mediaType:nn.mediaType,dataBase64:nn.dataUrl.slice(nn.dataUrl.indexOf(",")+1)}));await XT(tt,ae,at,Si.length?Si:void 0)}catch{tt&&T({type:"busy",sessionId:tt,busy:!1})}}function rt(){w&&KT(w)}G.useEffect(()=>{if(!vt||l!=="chat")return;function ae(xe){var Ae;xe.key!=="Escape"||xe.defaultPrevented||(xe.preventDefault(),rt(),(Ae=M.current)==null||Ae.focus())}return document.addEventListener("keydown",ae),()=>document.removeEventListener("keydown",ae)},[vt,w,l]);function ct(ae){q.current.add(ae),C(xe=>xe.filter(Ae=>Ae.id!==ae)),S(xe=>xe===ae?null:xe),W.current.delete(ae),T({type:"forget",sessionId:ae})}function Ve(ae,xe){const Ae=ae.archived;C(tt=>tt.map(at=>at.id===ae.id?{...at,archived:xe}:at)),VT(ae.id,xe).catch(()=>{C(tt=>tt.map(at=>at.id===ae.id?{...at,archived:Ae}:at))})}function Ln(ae,xe){const Ae=ae.title;C(tt=>tt.map(at=>at.id===ae.id?{...at,title:xe}:at)),WT(ae.id,xe).catch(()=>{C(tt=>tt.map(at=>at.id===ae.id?{...at,title:Ae}:at))})}async function tn(ae){var Ae;const xe=((Ae=ae.title)==null?void 0:Ae.trim())||"Untitled";if(window.confirm(`Delete "${xe}"? -Its transcript is permanently removed.`)){try{await GT(ae.id)}catch(tt){window.alert(`Failed to delete "${xe}": ${tt instanceof Error?tt.message:String(tt)}`);return}ct(ae.id)}}function mi(ae){if(!w)return Promise.resolve(!1);const xe=w;return T({type:"busy",sessionId:xe,busy:!0}),KT(xe,ae).then(()=>!0).catch(()=>!1).finally(()=>{Qy(xe).then(Ae=>T({type:"seed",sessionId:xe,messages:Ae})).catch(()=>{}),Zy(e).then(Ae=>{var tt;return T({type:"busy",sessionId:xe,busy:!!((tt=Ae.find(at=>at.id===xe))!=null&&tt.busy)})}).catch(()=>{})})}const vi=_.filter(ae=>y==="all"?!0:y==="archived"?ae.archived:!ae.archived),_i=g.jsxs("aside",{className:"session-rail floating-panel",children:[n,g.jsxs("nav",{className:"rail-nav",children:[g.jsxs("button",{className:"rail-nav-item","data-onboarding":"new-session",onClick:()=>{S(null),u("chat")},children:[g.jsx(Rg,{size:15}),"New session"]}),g.jsxs("button",{className:`rail-nav-item ${l==="files"?"active":""}`,"data-onboarding":"nav-files",onClick:()=>u("files"),children:[g.jsx(Tg,{size:15}),"Files"]}),PL.map(ae=>g.jsxs("button",{className:`rail-nav-item ${l===ae.id?"active":""}`,"data-onboarding":ae.id==="compute"?"nav-compute":void 0,onClick:()=>u(ae.id),children:[ae.icon,ae.label]},ae.id))]}),g.jsxs("div",{className:"rail-body",children:[g.jsxs("div",{className:"rail-section-head",children:[g.jsx("div",{className:"rail-section-label",children:((bi=Gw.find(ae=>ae.id===y))==null?void 0:bi.railLabel)??"Recents"}),g.jsx(tO,{value:y,onChange:x})]}),vi.map(ae=>g.jsx(nO,{session:ae,active:ae.id===w&&l==="chat",busy:D.busySessions.has(ae.id),waiting:dt(ae.id),onOpen:()=>{S(ae.id),u("chat")},onRename:xe=>Ln(ae,xe),onSetArchived:xe=>Ve(ae,xe),onDelete:()=>void tn(ae)},ae.id)),vi.length===0&&g.jsx("div",{className:"rail-empty",children:y==="archived"?"No archived sessions":_.length>0?"No active sessions":"No sessions yet"})]})]}),yi=`chat-header${r?"":" rail-hidden"}`,On=!r&&g.jsx("button",{className:"icon-btn",title:"Show sidebar","aria-label":"Show sidebar",onClick:a,children:g.jsx(ox,{size:15})});return l!=="chat"?g.jsxs(g.Fragment,{children:[r&&_i,g.jsxs("section",{className:"chat-pane",children:[!r&&g.jsx("div",{className:yi,children:On}),g.jsx("div",{className:"settings-view-scroll",children:v})]})]}):g.jsxs(g.Fragment,{children:[r&&_i,g.jsxs("section",{className:"chat-pane",children:[g.jsxs("div",{className:yi,children:[On,g.jsx("div",{className:"title",title:Pe?((ii=Pe.title)==null?void 0:ii.trim())||"Untitled":"New session",children:Pe?((bs=Pe.title)==null?void 0:bs.trim())||"Untitled":"New session"}),d&&g.jsx("button",{className:"icon-btn","data-tip":"Replay tour","aria-label":"Replay tour",onClick:d,children:g.jsx(nN,{size:15})}),g.jsx("button",{className:`icon-btn ${o?"active":""}`,title:"Experiments","aria-label":"Experiments",onClick:c,children:g.jsx(bN,{size:15})})]}),Re?g.jsx("div",{className:"chat-thread",ref:X,onScroll:ae=>{const xe=ae.currentTarget;L.current=xe.scrollHeight-xe.scrollTop-xe.clientHeight<60},children:g.jsxs("div",{className:"chat-thread-inner",ref:K,children:[Ye.filter(JL).map(ae=>g.jsx(eO,{message:ae,onOpenFile:f&&(xe=>f(xe,w??void 0)),onRespond:mi,onOpenPlan:De},ae.id)),vt&&(qe?g.jsx("div",{className:"working awaiting",children:"Waiting for your input…"}):g.jsxs("div",{className:"working",children:[g.jsx("span",{className:"spinner"})," Working…"]}))]})}):g.jsxs("div",{className:"chat-empty",children:[g.jsxs("h2",{children:["Open",g.jsx("span",{children:"Research"})]}),g.jsx("p",{children:"Ask the agent to explore your codebase, create and run your baseline experiment, and branch variants off it."}),g.jsx(WL,{harnesses:j,selection:z??ib(j)}),t&&g.jsxs("button",{type:"button",className:"chat-suggest mono",title:"Prefills the composer — add the compute to run on, then send",onClick:()=>{var ae;E(`/reproduce-paper ${t} on `),(ae=M.current)==null||ae.focus()},children:["/reproduce-paper ",t," on [describe your compute setup]"]})]}),g.jsxs("div",{className:"composer",children:[ue&&!(be&&ue.promptId===be.promptId)&&g.jsx(nL,{synthesized:ue.synthesized,agentLabel:Pe?Zp[Pe.harness]:"The agent",onView:()=>De==null?void 0:De(ue.plan,ue.promptId),onApprove:ae=>mi({promptId:ue.promptId,approve:!0,resumeMode:ae}),onReject:()=>mi({promptId:ue.promptId,approve:!1}),onRevise:ae=>{w&&he({sessionId:w,promptId:ue.promptId}),mi({promptId:ue.promptId,approve:!1,note:ae})}}),g.jsxs("div",{className:"composer-box","data-onboarding":"composer",children:[ee&&g.jsx(UL,{skills:H,activeIndex:ne,onPick:pe,onHover:Q}),R.length>0&&g.jsx("div",{className:"composer-attachments",children:R.map((ae,xe)=>g.jsxs("div",{className:"attachment-thumb",children:[g.jsx("img",{src:ae.dataUrl,alt:"pasted"}),g.jsx("button",{title:"Remove image","aria-label":"Remove image",onClick:()=>N(Ae=>Ae.filter((tt,at)=>at!==xe)),children:g.jsx(va,{size:11})})]},xe))}),g.jsx("textarea",{ref:M,value:b,placeholder:_e?"Type a custom answer…":Ee?`Message ${Zp[Ee.harness]}… ( / for skills)`:"Ask the research agent… ( / for skills)",rows:2,onPaste:ye,onDragOver:ae=>{ae.dataTransfer.types.includes("Files")&&ae.preventDefault()},onDrop:ae=>{ae.dataTransfer.files.length!==0&&(ae.preventDefault(),fe(Array.from(ae.dataTransfer.files)))},onChange:ae=>{E(ae.target.value),se(!1)},onKeyDown:ae=>{if(ee){if(ae.key==="ArrowDown"||ae.key==="ArrowUp"){ae.preventDefault();const xe=ae.key==="ArrowDown"?1:-1;Q((ne+xe+H.length)%H.length);return}if(ae.key==="Enter"||ae.key==="Tab"){ae.preventDefault(),pe(H[ne]);return}if(ae.key==="Escape"){ae.preventDefault(),se(!0);return}}ae.key==="Enter"&&!ae.shiftKey&&(ae.preventDefault(),$e())}}),g.jsxs("div",{className:"composer-actions",children:[g.jsx(rb,{choices:(we==null?void 0:we.permissionModes)??[],value:(Ee==null?void 0:Ee.permissionMode)??null,defaultId:(we==null?void 0:we.defaultPermissionMode)??null,header:"Mode",align:"left",variant:"pill",numbered:!0,title:"Permission mode for this chat",onSelect:Ct}),g.jsx("div",{style:{flex:1}}),g.jsx(GL,{value:Ee,onSelect:ft,onHarnesses:B,lockHarness:!!Ce}),g.jsx(rb,{choices:(we==null?void 0:we.reasoningLevels)??[],value:(Ee==null?void 0:Ee.reasoningLevel)??null,defaultId:(we==null?void 0:we.defaultReasoningLevel)??null,header:"Reasoning",align:"right",variant:"bare",title:"Reasoning level for this chat",onSelect:st}),vt&&!_e?g.jsx("button",{className:"send-btn stop",title:"Stop","aria-label":"Stop",onClick:rt,children:g.jsx(va,{size:16})}):g.jsx("button",{className:"send-btn",title:"Send","aria-label":"Send",onClick:()=>void $e(),disabled:!b.trim()&&R.length===0,children:g.jsx(nx,{size:16})})]})]})]})]})]})}function ab(){return{dirs:new Map,files:[]}}function rO(e){const t=ab();for(const n of e){const r=n.split("/");let a=t;for(let l=0;ll(n),title:n,children:[c?g.jsx(gs,{size:13,className:"code-tree-chev"}):g.jsx(Wu,{size:13,className:"code-tree-chev"}),c?g.jsx(Tg,{size:13}):g.jsx(CN,{size:13}),g.jsx("span",{className:"code-tree-name",children:e})]}),c&&g.jsx(qw,{node:t,parentPath:n,depth:r+1,toggled:a,onToggle:l,onOpenFile:u})]})}function qw({node:e,parentPath:t,depth:n,toggled:r,onToggle:a,onOpenFile:l}){const u=[...e.dirs.keys()].sort((c,f)=>c.localeCompare(f)),o=[...e.files].sort((c,f)=>c.localeCompare(f));return g.jsxs(g.Fragment,{children:[u.map(c=>{const f=t?`${t}/${c}`:c;return g.jsx(sO,{name:c,node:e.dirs.get(c),path:f,depth:n,toggled:r,onToggle:a,onOpenFile:l},`d:${f}`)}),o.map(c=>{const f=t?`${t}/${c}`:c;return g.jsxs("button",{type:"button",className:"code-tree-row",style:{paddingLeft:8+n*14},onClick:()=>l(f),title:f,children:[g.jsx(_N,{size:13}),g.jsx("span",{className:"code-tree-name",children:c})]},`f:${f}`)})]})}function aO({projectId:e,project:t,experiments:n,sel:r,toggled:a,onSelChange:l,onToggledChange:u,onOpenFile:o}){const[c,f]=G.useState(null),[p,d]=G.useState(null),[v,_]=G.useState(!0),C=G.useRef(0),w=G.useCallback(()=>{const E=++C.current;_(!0),pT(e,r?{ref:r}:{}).then(R=>{E===C.current&&(f(R),d(null))}).catch(R=>{E===C.current&&d(R.message)}).finally(()=>{E===C.current&&_(!1)})},[e,r]);G.useEffect(()=>(f(null),d(null),w(),()=>{C.current++}),[w]);const S=G.useMemo(()=>c?rO(c.entries):null,[c]),y=G.useCallback(E=>{const R=new Set(a);R.has(E)?R.delete(E):R.add(E),u(R)},[a,u]),x=G.useMemo(()=>{const E=new Set,R=[];for(const N of n)E.has(N.branchName)||(E.add(N.branchName),R.push({branch:N.branchName,label:N.slug}));return R},[n]),b=r||(c==null?void 0:c.branch)||null;return g.jsxs("div",{className:"code-tab",children:[g.jsxs("div",{className:"code-tab-header",children:[g.jsx("span",{className:"ctl-label",children:"Source"}),g.jsxs("select",{className:"input sm code-tab-select",value:r,onChange:E=>l(E.target.value),title:"Source to browse",children:[g.jsx("option",{value:"",children:"project clone"}),r&&!x.some(E=>E.branch===r)&&g.jsx("option",{value:r,children:r}),x.map(E=>g.jsx("option",{value:E.branch,children:E.label},E.branch))]}),b&&g.jsx("a",{className:"icon-btn",href:jg(t.githubOwner,t.githubRepo,b),target:"_blank",rel:"noopener noreferrer",title:`Open ${b} on GitHub`,children:g.jsx(Em,{size:13})}),g.jsx("span",{style:{flex:1}}),g.jsx("button",{className:"icon-btn",title:"Refresh","aria-label":"Refresh",onClick:w,children:v?g.jsx("span",{className:"spinner"}):g.jsx(Dg,{size:13})})]}),(c==null?void 0:c.truncated)&&g.jsx("div",{className:"code-tab-note",children:"listing truncated"}),p&&S&&g.jsxs("div",{className:"code-tab-note",children:["Refresh failed: ",p]}),g.jsx("div",{className:"code-tab-body",children:S?S.dirs.size===0&&S.files.length===0?g.jsx("div",{className:"code-tab-note",children:"No files."}):g.jsx("div",{className:"code-tree",children:g.jsx(qw,{node:S,parentPath:"",depth:0,toggled:a,onToggle:y,onOpenFile:E=>o(E,void 0,r||void 0)})}):g.jsx("div",{className:"code-tab-note",children:p?`Failed to load: ${p}`:"Loading…"})})]})}function Vw({text:e,path:t}){const n=G.useMemo(()=>Lw(e,Aw(t)),[e,t]),r=e?e.split(` +Its transcript is permanently removed.`)){try{await qT(ae.id)}catch(tt){window.alert(`Failed to delete "${xe}": ${tt instanceof Error?tt.message:String(tt)}`);return}ct(ae.id)}}function mi(ae){if(!w)return Promise.resolve(!1);const xe=w;return T({type:"busy",sessionId:xe,busy:!0}),ZT(xe,ae).then(()=>!0).catch(()=>!1).finally(()=>{Jy(xe).then(Ae=>T({type:"seed",sessionId:xe,messages:Ae})).catch(()=>{}),Qy(e).then(Ae=>{var tt;return T({type:"busy",sessionId:xe,busy:!!((tt=Ae.find(at=>at.id===xe))!=null&&tt.busy)})}).catch(()=>{})})}const vi=_.filter(ae=>y==="all"?!0:y==="archived"?ae.archived:!ae.archived),_i=g.jsxs("aside",{className:"session-rail floating-panel",children:[n,g.jsxs("nav",{className:"rail-nav",children:[g.jsxs("button",{className:"rail-nav-item","data-onboarding":"new-session",onClick:()=>{S(null),u("chat")},children:[g.jsx(Rg,{size:15}),"New session"]}),g.jsxs("button",{className:`rail-nav-item ${l==="files"?"active":""}`,"data-onboarding":"nav-files",onClick:()=>u("files"),children:[g.jsx(Dg,{size:15}),"Files"]}),UL.map(ae=>g.jsxs("button",{className:`rail-nav-item ${l===ae.id?"active":""}`,"data-onboarding":ae.id==="compute"?"nav-compute":void 0,onClick:()=>u(ae.id),children:[ae.icon,ae.label]},ae.id))]}),g.jsxs("div",{className:"rail-body",children:[g.jsxs("div",{className:"rail-section-head",children:[g.jsx("div",{className:"rail-section-label",children:((bi=qw.find(ae=>ae.id===y))==null?void 0:bi.railLabel)??"Recents"}),g.jsx(iO,{value:y,onChange:x})]}),vi.map(ae=>g.jsx(rO,{session:ae,active:ae.id===w&&l==="chat",busy:R.busySessions.has(ae.id),waiting:dt(ae.id),onOpen:()=>{S(ae.id),u("chat")},onRename:xe=>Ln(ae,xe),onSetArchived:xe=>Ve(ae,xe),onDelete:()=>void tn(ae)},ae.id)),vi.length===0&&g.jsx("div",{className:"rail-empty",children:y==="archived"?"No archived sessions":_.length>0?"No active sessions":"No sessions yet"})]})]}),yi=`chat-header${r?"":" rail-hidden"}`,On=!r&&g.jsx("button",{className:"icon-btn",title:"Show sidebar","aria-label":"Show sidebar",onClick:a,children:g.jsx(lx,{size:15})});return l!=="chat"?g.jsxs(g.Fragment,{children:[r&&_i,g.jsxs("section",{className:"chat-pane",children:[!r&&g.jsx("div",{className:yi,children:On}),g.jsx("div",{className:"settings-view-scroll",children:v})]})]}):g.jsxs(g.Fragment,{children:[r&&_i,g.jsxs("section",{className:"chat-pane",children:[g.jsxs("div",{className:yi,children:[On,g.jsx("div",{className:"title",title:Pe?((ii=Pe.title)==null?void 0:ii.trim())||"Untitled":"New session",children:Pe?((bs=Pe.title)==null?void 0:bs.trim())||"Untitled":"New session"}),d&&g.jsx("button",{className:"icon-btn","data-tip":"Replay tour","aria-label":"Replay tour",onClick:d,children:g.jsx(iN,{size:15})}),g.jsx("button",{className:`icon-btn ${o?"active":""}`,title:"Experiments","aria-label":"Experiments",onClick:c,children:g.jsx(SN,{size:15})})]}),De?g.jsx("div",{className:"chat-thread",ref:X,onScroll:ae=>{const xe=ae.currentTarget;L.current=xe.scrollHeight-xe.scrollTop-xe.clientHeight<60},children:g.jsxs("div",{className:"chat-thread-inner",ref:K,children:[We.filter(tO).map(ae=>g.jsx(nO,{message:ae,onOpenFile:f&&(xe=>f(xe,w??void 0)),onRespond:mi,onOpenPlan:Re},ae.id)),vt&&(qe?g.jsx("div",{className:"working awaiting",children:"Waiting for your input…"}):g.jsxs("div",{className:"working",children:[g.jsx("span",{className:"spinner"})," Working…"]}))]})}):g.jsxs("div",{className:"chat-empty",children:[g.jsx("h2",{children:g.jsx(fa,{})}),g.jsx("p",{children:"Ask the agent to explore your codebase, create and run your baseline experiment, and branch variants off it."}),g.jsx(KL,{harnesses:j,selection:z??rb(j)}),t&&g.jsxs("button",{type:"button",className:"chat-suggest mono",title:"Prefills the composer — add the compute to run on, then send",onClick:()=>{var ae;E(`/reproduce-paper ${t} on `),(ae=M.current)==null||ae.focus()},children:["/reproduce-paper ",t," on [describe your compute setup]"]})]}),g.jsxs("div",{className:"composer",children:[ue&&!(be&&ue.promptId===be.promptId)&&g.jsx(iL,{synthesized:ue.synthesized,agentLabel:Pe?Qp[Pe.harness]:"The agent",onView:()=>Re==null?void 0:Re(ue.plan,ue.promptId),onApprove:ae=>mi({promptId:ue.promptId,approve:!0,resumeMode:ae}),onReject:()=>mi({promptId:ue.promptId,approve:!1}),onRevise:ae=>{w&&he({sessionId:w,promptId:ue.promptId}),mi({promptId:ue.promptId,approve:!1,note:ae})}}),g.jsxs("div",{className:"composer-box","data-onboarding":"composer",children:[ee&&g.jsx(qL,{skills:H,activeIndex:ne,onPick:pe,onHover:Q}),D.length>0&&g.jsx("div",{className:"composer-attachments",children:D.map((ae,xe)=>g.jsxs("div",{className:"attachment-thumb",children:[g.jsx("img",{src:ae.dataUrl,alt:"pasted"}),g.jsx("button",{title:"Remove image","aria-label":"Remove image",onClick:()=>N(Ae=>Ae.filter((tt,at)=>at!==xe)),children:g.jsx(_a,{size:11})})]},xe))}),g.jsx("textarea",{ref:M,value:b,placeholder:_e?"Type a custom answer…":Ee?`Message ${Qp[Ee.harness]}… ( / for skills)`:"Ask the research agent… ( / for skills)",rows:2,onPaste:ye,onDragOver:ae=>{ae.dataTransfer.types.includes("Files")&&ae.preventDefault()},onDrop:ae=>{ae.dataTransfer.files.length!==0&&(ae.preventDefault(),fe(Array.from(ae.dataTransfer.files)))},onChange:ae=>{E(ae.target.value),se(!1)},onKeyDown:ae=>{if(ee){if(ae.key==="ArrowDown"||ae.key==="ArrowUp"){ae.preventDefault();const xe=ae.key==="ArrowDown"?1:-1;Q((ne+xe+H.length)%H.length);return}if(ae.key==="Enter"||ae.key==="Tab"){ae.preventDefault(),pe(H[ne]);return}if(ae.key==="Escape"){ae.preventDefault(),se(!0);return}}ae.key==="Enter"&&!ae.shiftKey&&(ae.preventDefault(),$e())}}),g.jsxs("div",{className:"composer-actions",children:[g.jsx(sb,{choices:(we==null?void 0:we.permissionModes)??[],value:(Ee==null?void 0:Ee.permissionMode)??null,defaultId:(we==null?void 0:we.defaultPermissionMode)??null,header:"Mode",align:"left",variant:"pill",numbered:!0,title:"Permission mode for this chat",onSelect:Ct}),g.jsx("div",{style:{flex:1}}),g.jsx(VL,{value:Ee,onSelect:ft,onHarnesses:B,lockHarness:!!Ce}),g.jsx(sb,{choices:(we==null?void 0:we.reasoningLevels)??[],value:(Ee==null?void 0:Ee.reasoningLevel)??null,defaultId:(we==null?void 0:we.defaultReasoningLevel)??null,header:"Reasoning",align:"right",variant:"bare",title:"Reasoning level for this chat",onSelect:st}),vt&&!_e?g.jsx("button",{className:"send-btn stop",title:"Stop","aria-label":"Stop",onClick:rt,children:g.jsx(_a,{size:16})}):g.jsx("button",{className:"send-btn",title:"Send","aria-label":"Send",onClick:()=>void $e(),disabled:!b.trim()&&D.length===0,children:g.jsx(ix,{size:16})})]})]})]})]})]})}function ob(){return{dirs:new Map,files:[]}}function aO(e){const t=ob();for(const n of e){const r=n.split("/");let a=t;for(let l=0;ll(n),title:n,children:[c?g.jsx(gs,{size:13,className:"code-tree-chev"}):g.jsx(Xu,{size:13,className:"code-tree-chev"}),c?g.jsx(Dg,{size:13}):g.jsx(EN,{size:13}),g.jsx("span",{className:"code-tree-name",children:e})]}),c&&g.jsx(Vw,{node:t,parentPath:n,depth:r+1,toggled:a,onToggle:l,onOpenFile:u})]})}function Vw({node:e,parentPath:t,depth:n,toggled:r,onToggle:a,onOpenFile:l}){const u=[...e.dirs.keys()].sort((c,f)=>c.localeCompare(f)),o=[...e.files].sort((c,f)=>c.localeCompare(f));return g.jsxs(g.Fragment,{children:[u.map(c=>{const f=t?`${t}/${c}`:c;return g.jsx(oO,{name:c,node:e.dirs.get(c),path:f,depth:n,toggled:r,onToggle:a,onOpenFile:l},`d:${f}`)}),o.map(c=>{const f=t?`${t}/${c}`:c;return g.jsxs("button",{type:"button",className:"code-tree-row",style:{paddingLeft:8+n*14},onClick:()=>l(f),title:f,children:[g.jsx(yN,{size:13}),g.jsx("span",{className:"code-tree-name",children:c})]},`f:${f}`)})]})}function lO({projectId:e,project:t,experiments:n,sel:r,toggled:a,onSelChange:l,onToggledChange:u,onOpenFile:o}){const[c,f]=G.useState(null),[p,d]=G.useState(null),[v,_]=G.useState(!0),C=G.useRef(0),w=G.useCallback(()=>{const E=++C.current;_(!0),gT(e,r?{ref:r}:{}).then(D=>{E===C.current&&(f(D),d(null))}).catch(D=>{E===C.current&&d(D.message)}).finally(()=>{E===C.current&&_(!1)})},[e,r]);G.useEffect(()=>(f(null),d(null),w(),()=>{C.current++}),[w]);const S=G.useMemo(()=>c?aO(c.entries):null,[c]),y=G.useCallback(E=>{const D=new Set(a);D.has(E)?D.delete(E):D.add(E),u(D)},[a,u]),x=G.useMemo(()=>{const E=new Set,D=[];for(const N of n)E.has(N.branchName)||(E.add(N.branchName),D.push({branch:N.branchName,label:N.slug}));return D},[n]),b=r||(c==null?void 0:c.branch)||null;return g.jsxs("div",{className:"code-tab",children:[g.jsxs("div",{className:"code-tab-header",children:[g.jsx("span",{className:"ctl-label",children:"Source"}),g.jsxs("select",{className:"input sm code-tab-select",value:r,onChange:E=>l(E.target.value),title:"Source to browse",children:[g.jsx("option",{value:"",children:"project clone"}),r&&!x.some(E=>E.branch===r)&&g.jsx("option",{value:r,children:r}),x.map(E=>g.jsx("option",{value:E.branch,children:E.label},E.branch))]}),b&&g.jsx("a",{className:"icon-btn",href:Lg(t.githubOwner,t.githubRepo,b),target:"_blank",rel:"noopener noreferrer",title:`Open ${b} on GitHub`,children:g.jsx(km,{size:13})}),g.jsx("span",{style:{flex:1}}),g.jsx("button",{className:"icon-btn",title:"Refresh","aria-label":"Refresh",onClick:w,children:v?g.jsx("span",{className:"spinner"}):g.jsx(Mg,{size:13})})]}),(c==null?void 0:c.truncated)&&g.jsx("div",{className:"code-tab-note",children:"listing truncated"}),p&&S&&g.jsxs("div",{className:"code-tab-note",children:["Refresh failed: ",p]}),g.jsx("div",{className:"code-tab-body",children:S?S.dirs.size===0&&S.files.length===0?g.jsx("div",{className:"code-tab-note",children:"No files."}):g.jsx("div",{className:"code-tree",children:g.jsx(Vw,{node:S,parentPath:"",depth:0,toggled:a,onToggle:y,onOpenFile:E=>o(E,void 0,r||void 0)})}):g.jsx("div",{className:"code-tab-note",children:p?`Failed to load: ${p}`:"Loading…"})})]})}function Ww({text:e,path:t}){const n=G.useMemo(()=>Ow(e,Nw(t)),[e,t]),r=e?e.split(` `).length-(e.endsWith(` `)?1:0):0;return g.jsxs("div",{className:"file-view-codewrap",children:[r>0&&g.jsx("pre",{className:"file-view-gutter","aria-hidden":"true",children:Array.from({length:r},(a,l)=>l+1).join(` -`)}),g.jsx("pre",{className:"file-view-code",children:g.jsx("code",{children:n})})]})}const oO="project";function lO(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function cO(e){if(!e.startsWith("---"))return e;const t=e.indexOf(` ----`,3);return t===-1?e:e.slice(t+4).replace(/^\r?\n/,"")}const Yw=/\.(png|jpe?g|gif|webp|svg)$/i,uO=/\.(md|mdx|markdown)$/i,hO=512*1024,Ww="orx:files-tree-width",Xw=180,Kw=560,fO=280;function dO(){try{const e=Number(localStorage.getItem(Ww));if(Number.isFinite(e)&&e>=Xw&&e<=Kw)return e}catch{}return fO}function Jp(e,t){for(const n of e){if(n.path===t)return n;if(n.isDir&&t.startsWith(n.path+"/")){const r=Jp(n.children??[],t);if(r)return r}}return null}function Zw(e){const t=[];for(const n of e)n.isDir&&(n.reportTitle!==void 0&&t.push(n),t.push(...Zw(n.children??[])));return t}function pO({projectId:e,folder:t,markdown:n}){const r=a=>{if(lO(a))return a;const l=a.replace(/^\.?\//,"");return Ku(e,t?`${t}/${l}`:l)};return g.jsx("div",{className:"md report-md",children:g.jsx(nw,{remarkPlugins:[kw],components:{a:({href:a,children:l,...u})=>{const o=!a||a.startsWith("#");return g.jsx("a",{...u,href:o?a:r(a),...o?{}:{target:"_blank",rel:"noopener noreferrer"},children:l})},img:({src:a,alt:l})=>{if(!a||typeof a!="string")return null;const u=r(a);return g.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"report-img",children:[g.jsx("img",{src:u,alt:l??"",loading:"lazy"}),l&&g.jsx("span",{className:"report-img-caption",children:l})]})},...Bw},children:cO(n)})})}function gO(e){return e.isDir?"report":uO.test(e.name)?"markdown":Yw.test(e.name)?"image":/\.pdf$/i.test(e.name)?"pdf":"text"}function mO(e,t,n){const[r,a]=G.useState(null),[l,u]=G.useState(!1),[o,c]=G.useState(null),f=n==="report"||n==="markdown"||n==="text"&&t.size<=hO;return G.useEffect(()=>{if(a(null),u(!1),c(null),!f)return;let p=!1;return(n==="report"?LT(e,t.path).then(v=>v.markdown):fetch(Ku(e,t.path)).then(v=>{if(!v.ok)throw new Error(`Failed to load file (${v.status})`);return v.text()})).then(v=>{p||(v.includes("\0")?u(!0):a(v))}).catch(v=>{p||c(v instanceof Error?v.message:String(v))}),()=>{p=!0}},[e,t.path,t.modifiedAt,n,f]),{text:r,binary:l,error:o,wantsText:f}}function vO({projectId:e,entry:t,onDelete:n}){const r=gO(t),{text:a,binary:l,error:u,wantsText:o}=mO(e,t,r),[c,f]=G.useState(!1),p=r==="report"||r==="markdown",d=t.isDir?t.path:t.path.split("/").slice(0,-1).join("/"),v=Ku(e,t.isDir?`${t.path}/report.md`:t.path);let _;return r==="image"?_=g.jsx("a",{className:"fpreview-image",href:v,target:"_blank",rel:"noopener noreferrer",children:g.jsx("img",{src:v,alt:t.name})}):r==="pdf"?_=g.jsx("iframe",{className:"fpreview-pdf",title:t.name,src:v}):!o||l?_=g.jsxs("div",{className:"file-view-note",children:[l?"Binary file — no inline preview.":"File too large to preview inline."," ",g.jsx("a",{href:v,target:"_blank",rel:"noopener noreferrer",children:"Open raw"})]}):u?_=g.jsxs("div",{className:"file-view-note",children:["Failed to load: ",u]}):a===null?_=g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Loading…"]}):p&&!c?_=g.jsx(pO,{projectId:e,folder:d,markdown:a}):_=g.jsx(Vw,{text:a,path:t.isDir?"report.md":t.path}),g.jsxs("div",{className:"fpreview file-view",children:[g.jsxs("div",{className:"fpreview-head",children:[g.jsx(sx,{size:13,style:{flexShrink:0}}),g.jsx("code",{className:"fpreview-path",title:t.path,children:t.isDir?`${t.path}/report.md`:t.path}),g.jsxs("span",{className:"fpreview-date",children:["Modified"," ",new Date(t.modifiedAt).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})]}),!t.isDir&&r==="text"&&g.jsx("span",{className:"fpreview-size",children:ls(t.size)}),p&&g.jsx("button",{className:`icon-btn ${c?"active":""}`,"data-tip":c?"Rendered view":"View source","aria-label":c?"Rendered view":"View source",onClick:()=>f(C=>!C),children:g.jsx(tx,{size:13})}),g.jsx("a",{className:"icon-btn",href:v,target:"_blank",rel:"noopener noreferrer","data-tip":"Open raw in new tab","aria-label":"Open raw in new tab",children:g.jsx(ix,{size:13})}),g.jsx("button",{className:"icon-btn","data-tip":t.isDir?"Delete report folder":"Delete file","aria-label":t.isDir?"Delete report folder":"Delete file",onClick:()=>{window.confirm(`Delete "${t.path}" from the files dir?`)&&n(t.path)},children:g.jsx(Mg,{size:13})})]}),g.jsx("div",{className:`fpreview-body ${p&&!c?"doc":""}`,children:_})]})}function Qw({projectId:e,entries:t,depth:n,collapsed:r,selected:a,onToggle:l,onSelect:u}){return g.jsx(g.Fragment,{children:t.map(o=>{var f,p;const c={paddingLeft:8+n*14};if(o.isDir){const d=o.reportTitle!==void 0,v=!r.has(o.path),_=d?o.reportTitle:`${o.name}/`,C=d?[o.name,(f=o.experiment)==null?void 0:f.latestRunStatus].filter(Boolean).join(" — "):void 0;return g.jsxs("div",{children:[g.jsxs("div",{className:`ft-row ${a===o.path?"selected":""}`,style:c,title:C,onClick:()=>d?u(o.path):l(o.path),children:[g.jsx("button",{className:`ft-chevron ${v?"open":""}`,"aria-label":v?`Collapse ${o.name}`:`Expand ${o.name}`,onClick:w=>{w.stopPropagation(),l(o.path)},children:g.jsx(Wu,{size:12})}),g.jsx("span",{className:d?"ft-title":"ft-dirname",children:_})]}),v&&(((p=o.children)==null?void 0:p.length)??0)>0&&g.jsx(Qw,{projectId:e,entries:o.children??[],depth:n+1,collapsed:r,selected:a,onToggle:l,onSelect:u})]},o.path)}return g.jsxs("div",{className:`ft-row file ${a===o.path?"selected":""}`,style:c,title:o.path,onClick:()=>u(o.path),children:[g.jsx("span",{className:"ft-chevron spacer"}),Yw.test(o.name)&&g.jsx("img",{className:"ft-thumb",src:Ku(e,o.path),alt:"",loading:"lazy"}),g.jsx("span",{className:"ft-name",children:o.name})]},o.path)})})}function _O(e){const t=[],n=[],r=[];for(const a of e)a.isDir&&a.name===oO?t.push(a):a.isDir&&a.experiment?n.push(a):r.push(a);return{project:t,experiments:n,other:r}}function ob({dir:e,onOpenStorage:t}){const[n,r]=G.useState(!1);return g.jsxs("div",{className:"ftree-footer",title:e,children:[g.jsx("code",{children:e}),g.jsx("button",{className:"icon-btn tip-up","data-tip":n?"Copied!":"Copy path","aria-label":"Copy files directory path",onClick:()=>{var a;(a=navigator.clipboard)==null||a.writeText(e),r(!0),setTimeout(()=>r(!1),1200)},children:n?g.jsx(vn,{size:12}):g.jsx(Ng,{size:12})}),g.jsx("button",{className:"icon-btn tip-up","data-tip":"Storage settings","aria-label":"Storage settings",onClick:t,children:g.jsx(YN,{size:12})})]})}function yO({project:e,files:t,onChanged:n,onOpenStorage:r}){const[a,l]=G.useState(null),[u,o]=G.useState(new Set),[c,f]=G.useState(!1),[p,d]=G.useState(dO),v=G.useRef(null),_=R=>{var B;R.preventDefault(),R.currentTarget.setPointerCapture(R.pointerId);const N=((B=v.current)==null?void 0:B.getBoundingClientRect().left)??0,D=document.body.style.userSelect;document.body.style.userSelect="none";const T=z=>{const V=Math.round(z.clientX-N),F=Math.min(Math.max(V,Xw),Kw);d(F);try{localStorage.setItem(Ww,String(F))}catch{}},j=()=>{window.removeEventListener("pointermove",T),window.removeEventListener("pointerup",j),window.removeEventListener("pointercancel",j),document.body.style.userSelect=D};window.addEventListener("pointermove",T),window.addEventListener("pointerup",j),window.addEventListener("pointercancel",j)};G.useEffect(()=>{if(!t||c||(f(!0),a))return;const R=Zw(t.entries);if(R.length===0)return;const N=R.reduce((D,T)=>T.modifiedAt>D.modifiedAt?T:D);l(N.path)},[t,c,a]),G.useEffect(()=>{a&&t&&!Jp(t.entries,a)&&l(null)},[a,t]);const C=R=>o(N=>{const D=new Set(N);return D.has(R)?D.delete(R):D.add(R),D}),w=R=>{(a===R||a!=null&&a.startsWith(R+"/"))&&l(null),OT(e.id,R).catch(()=>{}).finally(n)};if(!t)return g.jsx("div",{className:"files-tab",children:g.jsxs("div",{className:"settings-loading",style:{padding:20},children:[g.jsx("span",{className:"spinner"})," Loading files…"]})});const{project:S,experiments:y,other:x}=_O(t.entries),b=R=>g.jsx(Qw,{projectId:e.id,entries:R,depth:0,collapsed:u,selected:a,onToggle:C,onSelect:l}),E=a?Jp(t.entries,a):null;return t.entries.length===0?g.jsx("div",{className:"files-tab",children:g.jsxs("div",{className:"files-empty-state",children:[g.jsx(Tg,{size:28,strokeWidth:1.5}),g.jsx("h3",{children:"No files yet"}),g.jsx("p",{children:"This is where the agent saves the project's files — experiment reports, figures, and other artifacts. Ask it for a write-up of its findings and the report will land here. You can also drop your own files into the folder:"}),g.jsx(ob,{dir:t.dir,onOpenStorage:r})]})}):g.jsxs("div",{className:"files-tab",children:[g.jsxs("div",{className:"ftree-pane",ref:v,style:{width:p},children:[g.jsx("div",{className:"ftree-resizer",onPointerDown:_}),g.jsxs("div",{className:"ftree-scroll",children:[b(S),b(y),x.length>0&&(y.length>0||S.length>0)&&g.jsx("div",{className:"ft-divider",children:"Other files"}),b(x),t.truncated&&g.jsx("p",{className:"files-truncated",children:"Listing truncated — the folder has more files."})]}),g.jsx(ob,{dir:t.dir,onOpenStorage:r})]}),E?g.jsx(vO,{projectId:e.id,entry:E,onDelete:w},E.path):g.jsxs("div",{className:"fpreview fpreview-none",children:[g.jsx(HN,{size:22,strokeWidth:1.5}),g.jsx("span",{children:"Click a file to view it"})]})]})}function Yc({active:e,label:t,icon:n,onSelect:r,onClose:a}){return g.jsxs("button",{className:`tab closable ${e?"active":""}`,onClick:r,title:t,children:[n,g.jsx("span",{className:"tab-label",children:t}),g.jsx("span",{role:"button",className:"tab-close",title:"Close tab",onClick:l=>{l.stopPropagation(),a()},children:g.jsx(va,{size:12})})]})}function bO({owner:e,repo:t,branch:n}){return g.jsxs("a",{className:"files-pill",href:jg(e,t,n),target:"_blank",rel:"noopener noreferrer",title:`Open ${n} on GitHub`,children:[g.jsx("code",{children:n}),g.jsx(Em,{size:12})]})}function lb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,r)}return n}function ht(e){for(var t=1;t=0||(p[c]=u[c]);return p})(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function et(e,t){return eC(e)||(function(n,r){var a=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(a!=null){var l,u,o,c,f=[],p=!0,d=!1;try{if(o=(a=a.call(n)).next,r===0){if(Object(a)!==a)return;p=!1}else for(;!(p=(l=o.call(a)).done)&&(f.push(l.value),f.length!==r);p=!0);}catch(v){d=!0,u=v}finally{try{if(!p&&a.return!=null&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw u}}return f}})(e,t)||lh(e,t)||nC()}function Jw(e){return eC(e)||tC(e)||lh(e)||nC()}function Rn(e){return(function(t){if(Array.isArray(t))return tg(t)})(e)||tC(e)||lh(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function eC(e){if(Array.isArray(e))return e}function tC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lh(e,t){if(e){if(typeof e=="string")return tg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?tg(e,t):void 0}}function tg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l,u=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return u=c.done,c},e:function(c){o=!0,l=c},f:function(){try{u||n.return==null||n.return()}finally{if(o)throw l}}}}var Wc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gl(e,t){return e(t={exports:{}},t.exports),t.exports}var Nn=gl((function(e){/*! +`)}),g.jsx("pre",{className:"file-view-code",children:g.jsx("code",{children:n})})]})}const cO="project";function uO(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function hO(e){if(!e.startsWith("---"))return e;const t=e.indexOf(` +---`,3);return t===-1?e:e.slice(t+4).replace(/^\r?\n/,"")}const Yw=/\.(png|jpe?g|gif|webp|svg)$/i,fO=/\.(md|mdx|markdown)$/i,dO=512*1024,Xw="orx:files-tree-width",Kw=180,Zw=560,pO=280;function gO(){try{const e=Number(localStorage.getItem(Xw));if(Number.isFinite(e)&&e>=Kw&&e<=Zw)return e}catch{}return pO}function eg(e,t){for(const n of e){if(n.path===t)return n;if(n.isDir&&t.startsWith(n.path+"/")){const r=eg(n.children??[],t);if(r)return r}}return null}function Qw(e){const t=[];for(const n of e)n.isDir&&(n.reportTitle!==void 0&&t.push(n),t.push(...Qw(n.children??[])));return t}function mO({projectId:e,folder:t,markdown:n}){const r=a=>{if(uO(a))return a;const l=a.replace(/^\.?\//,"");return Zu(e,t?`${t}/${l}`:l)};return g.jsx("div",{className:"md report-md",children:g.jsx(iw,{remarkPlugins:[Aw],components:{a:({href:a,children:l,...u})=>{const o=!a||a.startsWith("#");return g.jsx("a",{...u,href:o?a:r(a),...o?{}:{target:"_blank",rel:"noopener noreferrer"},children:l})},img:({src:a,alt:l})=>{if(!a||typeof a!="string")return null;const u=r(a);return g.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"report-img",children:[g.jsx("img",{src:u,alt:l??"",loading:"lazy"}),l&&g.jsx("span",{className:"report-img-caption",children:l})]})},...Iw},children:hO(n)})})}function vO(e){return e.isDir?"report":fO.test(e.name)?"markdown":Yw.test(e.name)?"image":/\.pdf$/i.test(e.name)?"pdf":"text"}function _O(e,t,n){const[r,a]=G.useState(null),[l,u]=G.useState(!1),[o,c]=G.useState(null),f=n==="report"||n==="markdown"||n==="text"&&t.size<=dO;return G.useEffect(()=>{if(a(null),u(!1),c(null),!f)return;let p=!1;return(n==="report"?OT(e,t.path).then(v=>v.markdown):fetch(Zu(e,t.path)).then(v=>{if(!v.ok)throw new Error(`Failed to load file (${v.status})`);return v.text()})).then(v=>{p||(v.includes("\0")?u(!0):a(v))}).catch(v=>{p||c(v instanceof Error?v.message:String(v))}),()=>{p=!0}},[e,t.path,t.modifiedAt,n,f]),{text:r,binary:l,error:o,wantsText:f}}function yO({projectId:e,entry:t,onDelete:n}){const r=vO(t),{text:a,binary:l,error:u,wantsText:o}=_O(e,t,r),[c,f]=G.useState(!1),p=r==="report"||r==="markdown",d=t.isDir?t.path:t.path.split("/").slice(0,-1).join("/"),v=Zu(e,t.isDir?`${t.path}/report.md`:t.path);let _;return r==="image"?_=g.jsx("a",{className:"fpreview-image",href:v,target:"_blank",rel:"noopener noreferrer",children:g.jsx("img",{src:v,alt:t.name})}):r==="pdf"?_=g.jsx("iframe",{className:"fpreview-pdf",title:t.name,src:v}):!o||l?_=g.jsxs("div",{className:"file-view-note",children:[l?"Binary file — no inline preview.":"File too large to preview inline."," ",g.jsx("a",{href:v,target:"_blank",rel:"noopener noreferrer",children:"Open raw"})]}):u?_=g.jsxs("div",{className:"file-view-note",children:["Failed to load: ",u]}):a===null?_=g.jsxs("div",{className:"settings-loading",children:[g.jsx("span",{className:"spinner"})," Loading…"]}):p&&!c?_=g.jsx(mO,{projectId:e,folder:d,markdown:a}):_=g.jsx(Ww,{text:a,path:t.isDir?"report.md":t.path}),g.jsxs("div",{className:"fpreview file-view",children:[g.jsxs("div",{className:"fpreview-head",children:[g.jsx(ax,{size:13,style:{flexShrink:0}}),g.jsx("code",{className:"fpreview-path",title:t.path,children:t.isDir?`${t.path}/report.md`:t.path}),g.jsxs("span",{className:"fpreview-date",children:["Modified"," ",new Date(t.modifiedAt).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})]}),!t.isDir&&r==="text"&&g.jsx("span",{className:"fpreview-size",children:ls(t.size)}),p&&g.jsx("button",{className:`icon-btn ${c?"active":""}`,"data-tip":c?"Rendered view":"View source","aria-label":c?"Rendered view":"View source",onClick:()=>f(C=>!C),children:g.jsx(nx,{size:13})}),g.jsx("a",{className:"icon-btn",href:v,target:"_blank",rel:"noopener noreferrer","data-tip":"Open raw in new tab","aria-label":"Open raw in new tab",children:g.jsx(rx,{size:13})}),g.jsx("button",{className:"icon-btn","data-tip":t.isDir?"Delete report folder":"Delete file","aria-label":t.isDir?"Delete report folder":"Delete file",onClick:()=>{window.confirm(`Delete "${t.path}" from the files dir?`)&&n(t.path)},children:g.jsx(jg,{size:13})})]}),g.jsx("div",{className:`fpreview-body ${p&&!c?"doc":""}`,children:_})]})}function Jw({projectId:e,entries:t,depth:n,collapsed:r,selected:a,onToggle:l,onSelect:u}){return g.jsx(g.Fragment,{children:t.map(o=>{var f,p;const c={paddingLeft:8+n*14};if(o.isDir){const d=o.reportTitle!==void 0,v=!r.has(o.path),_=d?o.reportTitle:`${o.name}/`,C=d?[o.name,(f=o.experiment)==null?void 0:f.latestRunStatus].filter(Boolean).join(" — "):void 0;return g.jsxs("div",{children:[g.jsxs("div",{className:`ft-row ${a===o.path?"selected":""}`,style:c,title:C,onClick:()=>d?u(o.path):l(o.path),children:[g.jsx("button",{className:`ft-chevron ${v?"open":""}`,"aria-label":v?`Collapse ${o.name}`:`Expand ${o.name}`,onClick:w=>{w.stopPropagation(),l(o.path)},children:g.jsx(Xu,{size:12})}),g.jsx("span",{className:d?"ft-title":"ft-dirname",children:_})]}),v&&(((p=o.children)==null?void 0:p.length)??0)>0&&g.jsx(Jw,{projectId:e,entries:o.children??[],depth:n+1,collapsed:r,selected:a,onToggle:l,onSelect:u})]},o.path)}return g.jsxs("div",{className:`ft-row file ${a===o.path?"selected":""}`,style:c,title:o.path,onClick:()=>u(o.path),children:[g.jsx("span",{className:"ft-chevron spacer"}),Yw.test(o.name)&&g.jsx("img",{className:"ft-thumb",src:Zu(e,o.path),alt:"",loading:"lazy"}),g.jsx("span",{className:"ft-name",children:o.name})]},o.path)})})}function bO(e){const t=[],n=[],r=[];for(const a of e)a.isDir&&a.name===cO?t.push(a):a.isDir&&a.experiment?n.push(a):r.push(a);return{project:t,experiments:n,other:r}}function lb({dir:e,onOpenStorage:t}){const[n,r]=G.useState(!1);return g.jsxs("div",{className:"ftree-footer",title:e,children:[g.jsx("code",{children:e}),g.jsx("button",{className:"icon-btn tip-up","data-tip":n?"Copied!":"Copy path","aria-label":"Copy files directory path",onClick:()=>{var a;(a=navigator.clipboard)==null||a.writeText(e),r(!0),setTimeout(()=>r(!1),1200)},children:n?g.jsx(vn,{size:12}):g.jsx(Tg,{size:12})}),g.jsx("button",{className:"icon-btn tip-up","data-tip":"Storage settings","aria-label":"Storage settings",onClick:t,children:g.jsx(YN,{size:12})})]})}function SO({project:e,files:t,onChanged:n,onOpenStorage:r}){const[a,l]=G.useState(null),[u,o]=G.useState(new Set),[c,f]=G.useState(!1),[p,d]=G.useState(gO),v=G.useRef(null),_=D=>{var B;D.preventDefault(),D.currentTarget.setPointerCapture(D.pointerId);const N=((B=v.current)==null?void 0:B.getBoundingClientRect().left)??0,R=document.body.style.userSelect;document.body.style.userSelect="none";const T=z=>{const V=Math.round(z.clientX-N),F=Math.min(Math.max(V,Kw),Zw);d(F);try{localStorage.setItem(Xw,String(F))}catch{}},j=()=>{window.removeEventListener("pointermove",T),window.removeEventListener("pointerup",j),window.removeEventListener("pointercancel",j),document.body.style.userSelect=R};window.addEventListener("pointermove",T),window.addEventListener("pointerup",j),window.addEventListener("pointercancel",j)};G.useEffect(()=>{if(!t||c||(f(!0),a))return;const D=Qw(t.entries);if(D.length===0)return;const N=D.reduce((R,T)=>T.modifiedAt>R.modifiedAt?T:R);l(N.path)},[t,c,a]),G.useEffect(()=>{a&&t&&!eg(t.entries,a)&&l(null)},[a,t]);const C=D=>o(N=>{const R=new Set(N);return R.has(D)?R.delete(D):R.add(D),R}),w=D=>{(a===D||a!=null&&a.startsWith(D+"/"))&&l(null),BT(e.id,D).catch(()=>{}).finally(n)};if(!t)return g.jsx("div",{className:"files-tab",children:g.jsxs("div",{className:"settings-loading",style:{padding:20},children:[g.jsx("span",{className:"spinner"})," Loading files…"]})});const{project:S,experiments:y,other:x}=bO(t.entries),b=D=>g.jsx(Jw,{projectId:e.id,entries:D,depth:0,collapsed:u,selected:a,onToggle:C,onSelect:l}),E=a?eg(t.entries,a):null;return t.entries.length===0?g.jsx("div",{className:"files-tab",children:g.jsxs("div",{className:"files-empty-state",children:[g.jsx(Dg,{size:28,strokeWidth:1.5}),g.jsx("h3",{children:"No files yet"}),g.jsx("p",{children:"This is where the agent saves the project's files — experiment reports, figures, and other artifacts. Ask it for a write-up of its findings and the report will land here. You can also drop your own files into the folder:"}),g.jsx(lb,{dir:t.dir,onOpenStorage:r})]})}):g.jsxs("div",{className:"files-tab",children:[g.jsxs("div",{className:"ftree-pane",ref:v,style:{width:p},children:[g.jsx("div",{className:"ftree-resizer",onPointerDown:_}),g.jsxs("div",{className:"ftree-scroll",children:[b(S),b(y),x.length>0&&(y.length>0||S.length>0)&&g.jsx("div",{className:"ft-divider",children:"Other files"}),b(x),t.truncated&&g.jsx("p",{className:"files-truncated",children:"Listing truncated — the folder has more files."})]}),g.jsx(lb,{dir:t.dir,onOpenStorage:r})]}),E?g.jsx(yO,{projectId:e.id,entry:E,onDelete:w},E.path):g.jsxs("div",{className:"fpreview fpreview-none",children:[g.jsx(FN,{size:22,strokeWidth:1.5}),g.jsx("span",{children:"Click a file to view it"})]})]})}function Yc({active:e,label:t,icon:n,onSelect:r,onClose:a}){return g.jsxs("button",{className:`tab closable ${e?"active":""}`,onClick:r,title:t,children:[n,g.jsx("span",{className:"tab-label",children:t}),g.jsx("span",{role:"button",className:"tab-close",title:"Close tab",onClick:l=>{l.stopPropagation(),a()},children:g.jsx(_a,{size:12})})]})}function xO({owner:e,repo:t,branch:n}){return g.jsxs("a",{className:"files-pill",href:Lg(e,t,n),target:"_blank",rel:"noopener noreferrer",title:`Open ${n} on GitHub`,children:[g.jsx("code",{children:n}),g.jsx(km,{size:12})]})}function cb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,r)}return n}function ht(e){for(var t=1;t=0||(p[c]=u[c]);return p})(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function et(e,t){return tC(e)||(function(n,r){var a=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(a!=null){var l,u,o,c,f=[],p=!0,d=!1;try{if(o=(a=a.call(n)).next,r===0){if(Object(a)!==a)return;p=!1}else for(;!(p=(l=o.call(a)).done)&&(f.push(l.value),f.length!==r);p=!0);}catch(v){d=!0,u=v}finally{try{if(!p&&a.return!=null&&(c=a.return(),Object(c)!==c))return}finally{if(d)throw u}}return f}})(e,t)||ch(e,t)||iC()}function eC(e){return tC(e)||nC(e)||ch(e)||iC()}function Dn(e){return(function(t){if(Array.isArray(t))return ng(t)})(e)||nC(e)||ch(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function tC(e){if(Array.isArray(e))return e}function nC(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ch(e,t){if(e){if(typeof e=="string")return ng(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ng(e,t):void 0}}function ng(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(c){throw c},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l,u=!0,o=!1;return{s:function(){n=n.call(e)},n:function(){var c=n.next();return u=c.done,c},e:function(c){o=!0,l=c},f:function(){try{u||n.return==null||n.return()}finally{if(o)throw l}}}}var Xc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ml(e,t){return e(t={exports:{}},t.exports),t.exports}var Nn=ml((function(e){/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames -*/(function(){var t={}.hasOwnProperty;function n(){for(var r=[],a=0;a-1?y.slice(0,b):E;switch(E){case"diff":w--;break e;case"deleted":case"new":var R=y.slice(b+1);R.indexOf("file mode")===0&&(u[E==="new"?"newMode":"oldMode"]=R.slice(10));break;case"similarity":u.similarity=parseInt(y.split(" ")[2],10);break;case"index":var N=y.slice(b+1).split(" "),D=N[0].split("..");u.oldRevision=D[0],u.newRevision=D[1],N[1]&&(u.oldMode=u.newMode=N[1]);break;case"copy":case"rename":var T=y.slice(b+1);T.indexOf("from")===0?u.oldPath=T.slice(5):u.newPath=T.slice(3),x=E;break;case"---":var j=y.slice(b+1),B=_[++w].slice(4);j==="/dev/null"?(B=B.slice(2),x="add"):B==="/dev/null"?(j=j.slice(2),x="delete"):(x="modify",j=j.slice(2),B=B.slice(2)),j&&(u.oldPath=j),B&&(u.newPath=B),v=5;break e}}u.type=x||"modify"}else if(S.indexOf("Binary")===0)u.isBinary=!0,u.type=S.indexOf("/dev/null and")>=0?"add":S.indexOf("and /dev/null")>=0?"delete":"modify",v=2,u=null;else if(v===5)if(S.indexOf("@@")===0){var z=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(S);o={content:S,oldStart:z[1]-0,newStart:z[4]-0,oldLines:z[3]-0||1,newLines:z[6]-0||1,changes:[]},u.hunks.push(o),c=o.oldStart,f=o.newStart}else{var V=S.slice(0,1),F={content:S.slice(1)};switch(V){case"+":F.type="insert",F.isInsert=!0,F.lineNumber=f,f++;break;case"-":F.type="delete",F.isDelete=!0,F.lineNumber=c,c++;break;case" ":F.type="normal",F.isNormal=!0,F.oldLineNumber=c,F.newLineNumber=f,c++,f++;break;case"\\":var P=o.changes[o.changes.length-1];P.isDelete||(u.newEndingNewLine=!1),P.isInsert||(u.oldEndingNewLine=!1)}F.type&&o.changes.push(F)}w++}return d}};e.exports=a})()}));function Mr(e){return e.type==="insert"}function Dn(e){return e.type==="delete"}function Gi(e){return e.type==="normal"}function CO(e,t){var n=t.nearbySequences==="zip"?(function(r){var a=r.reduce((function(l,u,o){var c=et(l,3),f=c[0],p=c[1],d=c[2];return p?Mr(u)&&d>=0?(f.splice(d+1,0,u),[f,u,d+2]):(f.push(u),[f,u,Dn(u)&&Dn(p)?d:o]):(f.push(u),[f,u,Dn(u)?o:-1])}),[[],null,-1]);return et(a,1)[0]})(e.changes):e.changes;return ht(ht({},e),{},{isPlain:!1,changes:n})}function EO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=(function(r){if(r.startsWith("diff --git"))return r;var a=r.indexOf(` +*/(function(){var t={}.hasOwnProperty;function n(){for(var r=[],a=0;a-1?y.slice(0,b):E;switch(E){case"diff":w--;break e;case"deleted":case"new":var D=y.slice(b+1);D.indexOf("file mode")===0&&(u[E==="new"?"newMode":"oldMode"]=D.slice(10));break;case"similarity":u.similarity=parseInt(y.split(" ")[2],10);break;case"index":var N=y.slice(b+1).split(" "),R=N[0].split("..");u.oldRevision=R[0],u.newRevision=R[1],N[1]&&(u.oldMode=u.newMode=N[1]);break;case"copy":case"rename":var T=y.slice(b+1);T.indexOf("from")===0?u.oldPath=T.slice(5):u.newPath=T.slice(3),x=E;break;case"---":var j=y.slice(b+1),B=_[++w].slice(4);j==="/dev/null"?(B=B.slice(2),x="add"):B==="/dev/null"?(j=j.slice(2),x="delete"):(x="modify",j=j.slice(2),B=B.slice(2)),j&&(u.oldPath=j),B&&(u.newPath=B),v=5;break e}}u.type=x||"modify"}else if(S.indexOf("Binary")===0)u.isBinary=!0,u.type=S.indexOf("/dev/null and")>=0?"add":S.indexOf("and /dev/null")>=0?"delete":"modify",v=2,u=null;else if(v===5)if(S.indexOf("@@")===0){var z=/^@@\s+-([0-9]+)(,([0-9]+))?\s+\+([0-9]+)(,([0-9]+))?/.exec(S);o={content:S,oldStart:z[1]-0,newStart:z[4]-0,oldLines:z[3]-0||1,newLines:z[6]-0||1,changes:[]},u.hunks.push(o),c=o.oldStart,f=o.newStart}else{var V=S.slice(0,1),F={content:S.slice(1)};switch(V){case"+":F.type="insert",F.isInsert=!0,F.lineNumber=f,f++;break;case"-":F.type="delete",F.isDelete=!0,F.lineNumber=c,c++;break;case" ":F.type="normal",F.isNormal=!0,F.oldLineNumber=c,F.newLineNumber=f,c++,f++;break;case"\\":var P=o.changes[o.changes.length-1];P.isDelete||(u.newEndingNewLine=!1),P.isInsert||(u.oldEndingNewLine=!1)}F.type&&o.changes.push(F)}w++}return d}};e.exports=a})()}));function Mr(e){return e.type==="insert"}function Rn(e){return e.type==="delete"}function Gi(e){return e.type==="normal"}function kO(e,t){var n=t.nearbySequences==="zip"?(function(r){var a=r.reduce((function(l,u,o){var c=et(l,3),f=c[0],p=c[1],d=c[2];return p?Mr(u)&&d>=0?(f.splice(d+1,0,u),[f,u,d+2]):(f.push(u),[f,u,Rn(u)&&Rn(p)?d:o]):(f.push(u),[f,u,Rn(u)?o:-1])}),[[],null,-1]);return et(a,1)[0]})(e.changes):e.changes;return ht(ht({},e),{},{isPlain:!1,changes:n})}function AO(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=(function(r){if(r.startsWith("diff --git"))return r;var a=r.indexOf(` `),l=r.indexOf(` `,a+1),u=r.slice(0,a),o=r.slice(a+1,l),c=u.split(" ").slice(1,-3).join(" "),f=o.split(" ").slice(1,-3).join(" ");return["diff --git a/".concat(c," b/").concat(f),"index 1111111..2222222 100644","--- a/".concat(c),"+++ b/".concat(f),r.slice(l+1)].join(` -`)})(e.trimStart());return wO.parse(n).map((function(r){return(function(a,l){var u=a.hunks.map((function(o){return CO(o,l)}));return ht(ht({},a),{},{hunks:u})})(r,t)}))}function kO(e){return e[0]}function AO(e){return e[e.length-1]}function ng(e){return["".concat(e,"Start"),"".concat(e,"Lines")]}function Ko(e){return e==="old"?function(t){return Mr(t)?-1:Gi(t)?t.oldLineNumber:t.lineNumber}:function(t){return Dn(t)?-1:Gi(t)?t.newLineNumber:t.lineNumber}}function rC(e,t){return function(n,r){var a=n[e],l=a+n[t];return r>=a&&r=l&&a-1},OO=function(e,t){var n=this.__data__,r=ch(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function la(e){var t=-1,n=e==null?0:e.length;for(this.clear();++to))return!1;var f=l.get(e),p=l.get(t);if(f&&p)return f==t&&p==e;var d=-1,v=!0,_=2&n?new _6:void 0;for(l.set(e,t),l.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},At={};At["[object Float32Array]"]=At["[object Float64Array]"]=At["[object Int8Array]"]=At["[object Int16Array]"]=At["[object Int32Array]"]=At["[object Uint8Array]"]=At["[object Uint8ClampedArray]"]=At["[object Uint16Array]"]=At["[object Uint32Array]"]=!0,At["[object Arguments]"]=At["[object Array]"]=At["[object ArrayBuffer]"]=At["[object Boolean]"]=At["[object DataView]"]=At["[object Date]"]=At["[object Error]"]=At["[object Function]"]=At["[object Map]"]=At["[object Number]"]=At["[object Object]"]=At["[object RegExp]"]=At["[object Set]"]=At["[object String]"]=At["[object WeakMap]"]=!1;var L6=function(e){return ya(e)&&Nm(e.length)&&!!At[Da(e)]},O6=function(e){return function(t){return e(t)}},mb=gl((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,a=r&&r.exports===n&&oC.process,l=(function(){try{var u=r&&r.require&&r.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}})();e.exports=l})),vb=mb&&mb.isTypedArray,Tm=vb?O6(vb):L6,B6=Object.prototype.hasOwnProperty,I6=function(e,t){var n=Mn(e),r=!n&&dh(e),a=!n&&!r&&Mu(e),l=!n&&!r&&!a&&Tm(e),u=n||r||a||l,o=u?T6(e.length,String):[],c=o.length;for(var f in e)!B6.call(e,f)||u&&(f=="length"||a&&(f=="offset"||f=="parent")||l&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||dC(f,c))||o.push(f);return o},z6=Object.prototype,pC=function(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||z6)},H6=(function(e,t){return function(n){return e(t(n))}})(Object.keys,Object),F6=Object.prototype.hasOwnProperty,gC=function(e){if(!pC(e))return H6(e);var t=[];for(var n in Object(e))F6.call(e,n)&&n!="constructor"&&t.push(n);return t},ph=function(e){return e!=null&&Nm(e.length)&&!cC(e)},Rm=function(e){return ph(e)?I6(e):gC(e)},_b=function(e){return C6(e,Rm,N6)},P6=Object.prototype.hasOwnProperty,$6=function(e,t,n,r,a,l){var u=1&n,o=_b(e),c=o.length;if(c!=_b(t).length&&!u)return!1;for(var f=c;f--;){var p=o[f];if(!(u?p in t:P6.call(t,p)))return!1}var d=l.get(e),v=l.get(t);if(d&&v)return d==t&&v==e;var _=!0;l.set(e,t),l.set(t,e);for(var C=u;++f1)return!1;if(e.length===1){var t=et(e,1)[0];return t.type==="text"&&!t.value}return!0}function R8(e){var t=e.changeKey,n=e.text,r=e.tokens,a=e.renderToken,l=Rr(e,N8),u=a?function(o,c){return a(o,wb,c)}:wb;return g.jsx("td",ht(ht({},l),{},{"data-change-key":t,children:r?T8(r)?" ":r.map(u):n||" "}))}var wC=G.memo(R8);function CC(e,t){return function(){var n=t==="old"?yh(e):bh(e);return n===-1?void 0:n}}function EC(e,t){return function(n){return e&&n?g.jsx("a",{href:t?"#"+t:void 0,children:n}):n}}function ju(e,t){return t?function(n){e(),t(n)}:e}function Cb(e,t,n,r){return G.useMemo((function(){var a=xC(e,(function(l){return function(u){return l&&l(t,u)}}));return a.onMouseEnter=ju(n,a.onMouseEnter),a.onMouseLeave=ju(r,a.onMouseLeave),a}),[e,n,r,t])}function Eb(e,t,n,r,a,l,u,o,c){var f={change:t,side:r,inHoverState:o,renderDefault:CC(t,r),wrapInAnchor:EC(a,l)};return g.jsx("td",ht(ht({className:e},u),{},{"data-change-key":n,children:c(f)}))}function D8(e){var t,n,r,a=e.change,l=e.selected,u=e.tokens,o=e.className,c=e.generateLineClassName,f=e.gutterClassName,p=e.codeClassName,d=e.gutterEvents,v=e.codeEvents,_=e.hideGutter,C=e.gutterAnchor,w=e.generateAnchorID,S=e.renderToken,y=e.renderGutter,x=a.type,b=a.content,E=Tr(a),R=(t=et(G.useState(!1),2),n=t[0],r=t[1],[n,G.useCallback((function(){return r(!0)}),[]),G.useCallback((function(){return r(!1)}),[])]),N=et(R,3),D=N[0],T=N[1],j=N[2],B=G.useMemo((function(){return{change:a}}),[a]),z=Cb(d,B,T,j),V=Cb(v,B,T,j),F=w(a),P=c({changes:[a],defaultGenerate:function(){return o}}),Y=Nn("diff-gutter","diff-gutter-".concat(x),f,{"diff-gutter-selected":l}),q=Nn("diff-code","diff-code-".concat(x),p,{"diff-code-selected":l});return g.jsxs("tr",{id:F,className:Nn("diff-line",P),children:[!_&&Eb(Y,a,E,"old",C,F,z,D,y),!_&&Eb(Y,a,E,"new",C,F,z,D,y),g.jsx(wC,ht({className:q,changeKey:E,text:b,tokens:u,renderToken:S},V))]})}var M8=G.memo(D8);function j8(e){var t=e.hideGutter,n=e.element;return g.jsx("tr",{className:"diff-widget",children:g.jsx("td",{colSpan:t?1:3,className:"diff-widget-content",children:n})})}var L8=["hideGutter","selectedChanges","tokens","lineClassName"],O8=["hunk","widgets","className"];function B8(e){var t=e.hunk,n=e.widgets,r=e.className,a=Rr(e,O8),l=(function(u,o){return u.reduce((function(c,f){var p=Tr(f);c.push(["change",p,f]);var d=o[p];return d&&c.push(["widget",p,d]),c}),[])})(t.changes,n);return g.jsx("tbody",{className:Nn("diff-hunk",r),children:l.map((function(u){return(function(o,c){var f=et(o,3),p=f[0],d=f[1],v=f[2],_=c.hideGutter,C=c.selectedChanges,w=c.tokens,S=c.lineClassName,y=Rr(c,L8);if(p==="change"){var x=Dn(v)?"old":"new",b=Dn(v)?yh(v):bh(v),E=w?w[x][b-1]:null;return g.jsx(M8,ht({className:S,change:v,hideGutter:_,selected:C.includes(d),tokens:E},y),"change".concat(d))}return p==="widget"?g.jsx(j8,{hideGutter:_,element:v},"widget".concat(d)):null})(u,a)}))})}var kC=0;function Kc(e,t,n,r){var a=G.useCallback((function(){return t(e)}),[e,t]),l=G.useCallback((function(){return t("")}),[t]);return G.useMemo((function(){var u=xC(r,(function(o){return function(c){return o&&o({side:e,change:n},c)}}));return u.onMouseEnter=ju(a,u.onMouseEnter),u.onMouseLeave=ju(l,u.onMouseLeave),u}),[n,r,a,e,l])}function vp(e){var t=e.change,n=e.side,r=e.selected,a=e.tokens,l=e.gutterClassName,u=e.codeClassName,o=e.gutterEvents,c=e.codeEvents,f=e.anchorID,p=e.gutterAnchor,d=e.gutterAnchorTarget,v=e.hideGutter,_=e.hover,C=e.renderToken,w=e.renderGutter;if(!t){var S=Nn("diff-gutter","diff-gutter-omit",l),y=Nn("diff-code","diff-code-omit",u);return[!v&&g.jsx("td",{className:S},"gutter"),g.jsx("td",{className:y},"code")]}var x=t.type,b=t.content,E=Tr(t),R=n===kC?"old":"new",N=ht({id:f||void 0,className:Nn("diff-gutter","diff-gutter-".concat(x),eg({"diff-gutter-selected":r},"diff-line-hover-"+R,_),l),children:w({change:t,side:R,inHoverState:_,renderDefault:CC(t,R),wrapInAnchor:EC(p,d)})},o),D=Nn("diff-code","diff-code-".concat(x),eg({"diff-code-selected":r},"diff-line-hover-"+R,_),u);return[!v&&g.jsx("td",ht(ht({},N),{},{"data-change-key":E}),"gutter"),g.jsx(wC,ht({className:D,changeKey:E,text:b,tokens:a,renderToken:C},c),"code")]}function I8(e){var t=e.className,n=e.oldChange,r=e.newChange,a=e.oldSelected,l=e.newSelected,u=e.oldTokens,o=e.newTokens,c=e.monotonous,f=e.gutterClassName,p=e.codeClassName,d=e.gutterEvents,v=e.codeEvents,_=e.hideGutter,C=e.generateAnchorID,w=e.generateLineClassName,S=e.gutterAnchor,y=e.renderToken,x=e.renderGutter,b=et(G.useState(""),2),E=b[0],R=b[1],N=Kc("old",R,n,d),D=Kc("new",R,r,d),T=Kc("old",R,n,v),j=Kc("new",R,r,v),B=n&&C(n),z=r&&C(r),V=w({changes:[n,r],defaultGenerate:function(){return t}}),F={monotonous:c,hideGutter:_,gutterClassName:f,codeClassName:p,gutterEvents:d,codeEvents:v,renderToken:y,renderGutter:x},P=ht(ht({},F),{},{change:n,side:kC,selected:a,tokens:u,gutterEvents:N,codeEvents:T,anchorID:B,gutterAnchor:S,gutterAnchorTarget:B,hover:E==="old"}),Y=ht(ht({},F),{},{change:r,side:1,selected:l,tokens:o,gutterEvents:D,codeEvents:j,anchorID:n===r?null:z,gutterAnchor:S,gutterAnchorTarget:n===r?B:z,hover:E==="new"});if(c)return g.jsx("tr",{className:Nn("diff-line",V),children:vp(n?P:Y)});var q=(function(X,K){return X&&!K?"diff-line-old-only":!X&&K?"diff-line-new-only":X===K?"diff-line-normal":"diff-line-compare"})(n,r);return g.jsxs("tr",{className:Nn("diff-line",q,V),children:[vp(P),vp(Y)]})}var z8=G.memo(I8);function H8(e){var t=e.hideGutter,n=e.oldElement,r=e.newElement;return e.monotonous?g.jsx("tr",{className:"diff-widget",children:g.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n||r})}):n===r?g.jsx("tr",{className:"diff-widget",children:g.jsx("td",{colSpan:t?2:4,className:"diff-widget-content",children:n})}):g.jsxs("tr",{className:"diff-widget",children:[g.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n}),g.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:r})]})}var F8=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],P8=["hunk","widgets","className"];function Zc(e,t){return(e?Tr(e):"00")+(t?Tr(t):"00")}function $8(e){var t=e.hunk,n=e.widgets,r=e.className,a=Rr(e,P8),l=(function(u,o){for(var c=function(y){if(!y)return null;var x=Tr(y);return o[x]||null},f=[],p=0;p=a&&r=l&&a-1},IO=function(e,t){var n=this.__data__,r=uh(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function la(e){var t=-1,n=e==null?0:e.length;for(this.clear();++to))return!1;var f=l.get(e),p=l.get(t);if(f&&p)return f==t&&p==e;var d=-1,v=!0,_=2&n?new b6:void 0;for(l.set(e,t),l.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},At={};At["[object Float32Array]"]=At["[object Float64Array]"]=At["[object Int8Array]"]=At["[object Int16Array]"]=At["[object Int32Array]"]=At["[object Uint8Array]"]=At["[object Uint8ClampedArray]"]=At["[object Uint16Array]"]=At["[object Uint32Array]"]=!0,At["[object Arguments]"]=At["[object Array]"]=At["[object ArrayBuffer]"]=At["[object Boolean]"]=At["[object DataView]"]=At["[object Date]"]=At["[object Error]"]=At["[object Function]"]=At["[object Map]"]=At["[object Number]"]=At["[object Object]"]=At["[object RegExp]"]=At["[object Set]"]=At["[object String]"]=At["[object WeakMap]"]=!1;var B6=function(e){return ba(e)&&Tm(e.length)&&!!At[Ma(e)]},I6=function(e){return function(t){return e(t)}},vb=ml((function(e,t){var n=t&&!t.nodeType&&t,r=n&&e&&!e.nodeType&&e,a=r&&r.exports===n&&lC.process,l=(function(){try{var u=r&&r.require&&r.require("util").types;return u||a&&a.binding&&a.binding("util")}catch{}})();e.exports=l})),_b=vb&&vb.isTypedArray,Dm=_b?I6(_b):B6,z6=Object.prototype.hasOwnProperty,H6=function(e,t){var n=Mn(e),r=!n&&ph(e),a=!n&&!r&&ju(e),l=!n&&!r&&!a&&Dm(e),u=n||r||a||l,o=u?R6(e.length,String):[],c=o.length;for(var f in e)!z6.call(e,f)||u&&(f=="length"||a&&(f=="offset"||f=="parent")||l&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||pC(f,c))||o.push(f);return o},F6=Object.prototype,gC=function(e){var t=e&&e.constructor;return e===(typeof t=="function"&&t.prototype||F6)},P6=(function(e,t){return function(n){return e(t(n))}})(Object.keys,Object),$6=Object.prototype.hasOwnProperty,mC=function(e){if(!gC(e))return P6(e);var t=[];for(var n in Object(e))$6.call(e,n)&&n!="constructor"&&t.push(n);return t},gh=function(e){return e!=null&&Tm(e.length)&&!uC(e)},Rm=function(e){return gh(e)?H6(e):mC(e)},yb=function(e){return k6(e,Rm,D6)},U6=Object.prototype.hasOwnProperty,G6=function(e,t,n,r,a,l){var u=1&n,o=yb(e),c=o.length;if(c!=yb(t).length&&!u)return!1;for(var f=c;f--;){var p=o[f];if(!(u?p in t:U6.call(t,p)))return!1}var d=l.get(e),v=l.get(t);if(d&&v)return d==t&&v==e;var _=!0;l.set(e,t),l.set(t,e);for(var C=u;++f1)return!1;if(e.length===1){var t=et(e,1)[0];return t.type==="text"&&!t.value}return!0}function M8(e){var t=e.changeKey,n=e.text,r=e.tokens,a=e.renderToken,l=Dr(e,D8),u=a?function(o,c){return a(o,Cb,c)}:Cb;return g.jsx("td",ht(ht({},l),{},{"data-change-key":t,children:r?R8(r)?" ":r.map(u):n||" "}))}var CC=G.memo(M8);function EC(e,t){return function(){var n=t==="old"?bh(e):Sh(e);return n===-1?void 0:n}}function kC(e,t){return function(n){return e&&n?g.jsx("a",{href:t?"#"+t:void 0,children:n}):n}}function Lu(e,t){return t?function(n){e(),t(n)}:e}function Eb(e,t,n,r){return G.useMemo((function(){var a=wC(e,(function(l){return function(u){return l&&l(t,u)}}));return a.onMouseEnter=Lu(n,a.onMouseEnter),a.onMouseLeave=Lu(r,a.onMouseLeave),a}),[e,n,r,t])}function kb(e,t,n,r,a,l,u,o,c){var f={change:t,side:r,inHoverState:o,renderDefault:EC(t,r),wrapInAnchor:kC(a,l)};return g.jsx("td",ht(ht({className:e},u),{},{"data-change-key":n,children:c(f)}))}function j8(e){var t,n,r,a=e.change,l=e.selected,u=e.tokens,o=e.className,c=e.generateLineClassName,f=e.gutterClassName,p=e.codeClassName,d=e.gutterEvents,v=e.codeEvents,_=e.hideGutter,C=e.gutterAnchor,w=e.generateAnchorID,S=e.renderToken,y=e.renderGutter,x=a.type,b=a.content,E=Tr(a),D=(t=et(G.useState(!1),2),n=t[0],r=t[1],[n,G.useCallback((function(){return r(!0)}),[]),G.useCallback((function(){return r(!1)}),[])]),N=et(D,3),R=N[0],T=N[1],j=N[2],B=G.useMemo((function(){return{change:a}}),[a]),z=Eb(d,B,T,j),V=Eb(v,B,T,j),F=w(a),P=c({changes:[a],defaultGenerate:function(){return o}}),W=Nn("diff-gutter","diff-gutter-".concat(x),f,{"diff-gutter-selected":l}),q=Nn("diff-code","diff-code-".concat(x),p,{"diff-code-selected":l});return g.jsxs("tr",{id:F,className:Nn("diff-line",P),children:[!_&&kb(W,a,E,"old",C,F,z,R,y),!_&&kb(W,a,E,"new",C,F,z,R,y),g.jsx(CC,ht({className:q,changeKey:E,text:b,tokens:u,renderToken:S},V))]})}var L8=G.memo(j8);function O8(e){var t=e.hideGutter,n=e.element;return g.jsx("tr",{className:"diff-widget",children:g.jsx("td",{colSpan:t?1:3,className:"diff-widget-content",children:n})})}var B8=["hideGutter","selectedChanges","tokens","lineClassName"],I8=["hunk","widgets","className"];function z8(e){var t=e.hunk,n=e.widgets,r=e.className,a=Dr(e,I8),l=(function(u,o){return u.reduce((function(c,f){var p=Tr(f);c.push(["change",p,f]);var d=o[p];return d&&c.push(["widget",p,d]),c}),[])})(t.changes,n);return g.jsx("tbody",{className:Nn("diff-hunk",r),children:l.map((function(u){return(function(o,c){var f=et(o,3),p=f[0],d=f[1],v=f[2],_=c.hideGutter,C=c.selectedChanges,w=c.tokens,S=c.lineClassName,y=Dr(c,B8);if(p==="change"){var x=Rn(v)?"old":"new",b=Rn(v)?bh(v):Sh(v),E=w?w[x][b-1]:null;return g.jsx(L8,ht({className:S,change:v,hideGutter:_,selected:C.includes(d),tokens:E},y),"change".concat(d))}return p==="widget"?g.jsx(O8,{hideGutter:_,element:v},"widget".concat(d)):null})(u,a)}))})}var AC=0;function Zc(e,t,n,r){var a=G.useCallback((function(){return t(e)}),[e,t]),l=G.useCallback((function(){return t("")}),[t]);return G.useMemo((function(){var u=wC(r,(function(o){return function(c){return o&&o({side:e,change:n},c)}}));return u.onMouseEnter=Lu(a,u.onMouseEnter),u.onMouseLeave=Lu(l,u.onMouseLeave),u}),[n,r,a,e,l])}function _p(e){var t=e.change,n=e.side,r=e.selected,a=e.tokens,l=e.gutterClassName,u=e.codeClassName,o=e.gutterEvents,c=e.codeEvents,f=e.anchorID,p=e.gutterAnchor,d=e.gutterAnchorTarget,v=e.hideGutter,_=e.hover,C=e.renderToken,w=e.renderGutter;if(!t){var S=Nn("diff-gutter","diff-gutter-omit",l),y=Nn("diff-code","diff-code-omit",u);return[!v&&g.jsx("td",{className:S},"gutter"),g.jsx("td",{className:y},"code")]}var x=t.type,b=t.content,E=Tr(t),D=n===AC?"old":"new",N=ht({id:f||void 0,className:Nn("diff-gutter","diff-gutter-".concat(x),tg({"diff-gutter-selected":r},"diff-line-hover-"+D,_),l),children:w({change:t,side:D,inHoverState:_,renderDefault:EC(t,D),wrapInAnchor:kC(p,d)})},o),R=Nn("diff-code","diff-code-".concat(x),tg({"diff-code-selected":r},"diff-line-hover-"+D,_),u);return[!v&&g.jsx("td",ht(ht({},N),{},{"data-change-key":E}),"gutter"),g.jsx(CC,ht({className:R,changeKey:E,text:b,tokens:a,renderToken:C},c),"code")]}function H8(e){var t=e.className,n=e.oldChange,r=e.newChange,a=e.oldSelected,l=e.newSelected,u=e.oldTokens,o=e.newTokens,c=e.monotonous,f=e.gutterClassName,p=e.codeClassName,d=e.gutterEvents,v=e.codeEvents,_=e.hideGutter,C=e.generateAnchorID,w=e.generateLineClassName,S=e.gutterAnchor,y=e.renderToken,x=e.renderGutter,b=et(G.useState(""),2),E=b[0],D=b[1],N=Zc("old",D,n,d),R=Zc("new",D,r,d),T=Zc("old",D,n,v),j=Zc("new",D,r,v),B=n&&C(n),z=r&&C(r),V=w({changes:[n,r],defaultGenerate:function(){return t}}),F={monotonous:c,hideGutter:_,gutterClassName:f,codeClassName:p,gutterEvents:d,codeEvents:v,renderToken:y,renderGutter:x},P=ht(ht({},F),{},{change:n,side:AC,selected:a,tokens:u,gutterEvents:N,codeEvents:T,anchorID:B,gutterAnchor:S,gutterAnchorTarget:B,hover:E==="old"}),W=ht(ht({},F),{},{change:r,side:1,selected:l,tokens:o,gutterEvents:R,codeEvents:j,anchorID:n===r?null:z,gutterAnchor:S,gutterAnchorTarget:n===r?B:z,hover:E==="new"});if(c)return g.jsx("tr",{className:Nn("diff-line",V),children:_p(n?P:W)});var q=(function(X,K){return X&&!K?"diff-line-old-only":!X&&K?"diff-line-new-only":X===K?"diff-line-normal":"diff-line-compare"})(n,r);return g.jsxs("tr",{className:Nn("diff-line",q,V),children:[_p(P),_p(W)]})}var F8=G.memo(H8);function P8(e){var t=e.hideGutter,n=e.oldElement,r=e.newElement;return e.monotonous?g.jsx("tr",{className:"diff-widget",children:g.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n||r})}):n===r?g.jsx("tr",{className:"diff-widget",children:g.jsx("td",{colSpan:t?2:4,className:"diff-widget-content",children:n})}):g.jsxs("tr",{className:"diff-widget",children:[g.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:n}),g.jsx("td",{colSpan:t?1:2,className:"diff-widget-content",children:r})]})}var $8=["selectedChanges","monotonous","hideGutter","tokens","lineClassName"],U8=["hunk","widgets","className"];function Qc(e,t){return(e?Tr(e):"00")+(t?Tr(t):"00")}function G8(e){var t=e.hunk,n=e.widgets,r=e.className,a=Dr(e,U8),l=(function(u,o){for(var c=function(y){if(!y)return null;var x=Tr(y);return o[x]||null},f=[],p=0;p=(l==null?void 0:l.value.length))return[e];var o=function(d,v){var _=l.value.slice(d,v);return[].concat(Rn(a),[ht(ht({},l),{},{value:_})])};if(t>0){var c=o(0,t);u.push(fa(c))}var f=o(Math.max(t,0),n);if(u.push(r?(function(d,v){return[v].concat(Rn(fa(d)))})(f,r):fa(f)),n1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,a=Rr(e,lB);n.push(a);var l,u=km(r);try{for(u.s();!(l=u.n()).done;)RC(l.value,t,n)}catch(o){u.e(o)}finally{u.f()}n.pop()}else t.push(fa([].concat(Rn(n.slice(1)),[e])));return t}function cB(e){return e.reduce((function(t,n){var r=t[t.length-1],a=(function(c){var f=Om(c);return f.value.includes(` +`)})(t.oldSource,e),r=t.highlight?function(c){return t.refractor.highlight(c,t.language)}:function(c){return[{type:"text",value:c}]};return[Jc(r(t.oldSource)),Jc(r(n))]}var a=et(sB(e),2),l=a[0],u=a[1],o=t.highlight?function(c){return Jc(t.refractor.highlight(c,t.language))}:function(c){return Jc([{type:"text",value:c}])};return[o(l),o(u)]}function da(e){return e.map((function(t){return ht({},t)}))}function oB(e,t){return[].concat(Dn(da(e.slice(0,-1))),[t])}function lB(e){return e.type==="text"}function Bm(e){var t=e[e.length-1];if(lB(t))return t;throw new Error("Invalid token path with leaf of type ".concat(t.type))}function cB(e,t,n,r){var a=e.slice(0,-1),l=Bm(e),u=[];if(n<=0||t>=(l==null?void 0:l.value.length))return[e];var o=function(d,v){var _=l.value.slice(d,v);return[].concat(Dn(a),[ht(ht({},l),{},{value:_})])};if(t>0){var c=o(0,t);u.push(da(c))}var f=o(Math.max(t,0),n);if(u.push(r?(function(d,v){return[v].concat(Dn(da(d)))})(f,r):da(f)),n1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(e.children){var r=e.children,a=Dr(e,uB);n.push(a);var l,u=Am(r);try{for(u.s();!(l=u.n()).done;)RC(l.value,t,n)}catch(o){u.e(o)}finally{u.f()}n.pop()}else t.push(da([].concat(Dn(n.slice(1)),[e])));return t}function hB(e){return e.reduce((function(t,n){var r=t[t.length-1],a=(function(c){var f=Bm(c);return f.value.includes(` `)?f.value.split(` -`).map((function(p){return sB(c,ht(ht({},f),{},{value:p}))})):[c]})(n),l=Jw(a),u=l[0],o=l.slice(1);return[].concat(Rn(t.slice(0,-1)),[[].concat(Rn(r),[u])],Rn(o.map((function(c){return[c]}))))}),[[]])}function Tb(e){return cB(RC(e))}var uB=function(e,t,n){var r=(n=typeof n=="function"?n:void 0)?n(e,t):void 0;return r===void 0?gh(e,t,void 0,n):!!r},hB=function(e,t){return gh(e,t)},fB=function(e){var t=e==null?0:e.length;return t?e[t-1]:void 0};function dB(e,t){if(!e.children)throw new Error("parent node missing children property");var n,r,a=fB(e.children);return a&&(r=t,(n=a).type===r.type&&(n.type==="text"||n.children&&r.children&&uB(n,r,(function(l,u,o){return o==="chlidren"||hB(l,u)}))))?e.children[e.children.length-1]=(function(l,u){return"value"in l&&"value"in u?ht(ht({},l),{},{value:"".concat(l.value).concat(u.value)}):l})(a,t):e.children.push(t),e.children[e.children.length-1]}function Rb(e){var t,n={type:"root",children:[]},r=km(e);try{var a=function(){var l=t.value;l.reduce((function(u,o,c){return dB(u,c===l.length-1?ht({},o):ht(ht({},o),{},{children:[]}))}),n)};for(r.s();!(t=r.n()).done;)a()}catch(l){r.e(l)}finally{r.f()}return n}var pB=Object.prototype.hasOwnProperty,gB=NC((function(e,t,n){pB.call(e,n)?e[n].push(t):jm(e,n,[t])})),mB=Object.prototype.hasOwnProperty,vB=function(e){if(e==null)return!0;if(ph(e)&&(Mn(e)||typeof e=="string"||typeof e.splice=="function"||Mu(e)||Tm(e)||dh(e)))return!e.length;var t=og(e);if(t=="[object Map]"||t=="[object Set]")return!e.size;if(pC(e))return!gC(e).length;for(var n in e)if(mB.call(e,n))return!1;return!0},_B=function(e,t){var n=t.start,r=t.length,a=n+r,l=e.reduce((function(u,o){var c=et(u,2),f=c[0],p=c[1],d=p+Om(o).value.length;if(p>a||dr.length?n:r,c=n.length>r.length?r:n,f=o.indexOf(c);if(f!=-1)return u=[new t.Diff(1,o.substring(0,f)),new t.Diff(0,c),new t.Diff(1,o.substring(f+c.length))],n.length>r.length&&(u[0][0]=u[2][0]=-1),u;if(c.length==1)return[new t.Diff(-1,n),new t.Diff(1,r)];var p=this.diff_halfMatch_(n,r);if(p){var d=p[0],v=p[1],_=p[2],C=p[3],w=p[4],S=this.diff_main(d,_,a,l),y=this.diff_main(v,C,a,l);return S.concat([new t.Diff(0,w)],y)}return a&&n.length>100&&r.length>100?this.diff_lineMode_(n,r,l):this.diff_bisect_(n,r,l)},t.prototype.diff_lineMode_=function(n,r,a){var l=this.diff_linesToChars_(n,r);n=l.chars1,r=l.chars2;var u=l.lineArray,o=this.diff_main(n,r,!1,a);this.diff_charsToLines_(o,u),this.diff_cleanupSemantic(o),o.push(new t.Diff(0,""));for(var c=0,f=0,p=0,d="",v="";c=1&&p>=1){o.splice(c-f-p,f+p),c=c-f-p;for(var _=this.diff_main(d,v,!1,a),C=_.length-1;C>=0;C--)o.splice(c,0,_[C]);c+=_.length}p=0,f=0,d="",v=""}c++}return o.pop(),o},t.prototype.diff_bisect_=function(n,r,a){for(var l=n.length,u=r.length,o=Math.ceil((l+u)/2),c=o,f=2*o,p=new Array(f),d=new Array(f),v=0;va);b++){for(var E=-b+w;E<=b-S;E+=2){for(var R=c+E,N=(z=E==-b||E!=b&&p[R-1]l)S+=2;else if(N>u)w+=2;else if(C&&(j=c+_-E)>=0&&j=(T=l-d[j]))return this.diff_bisectSplit_(n,r,z,N,a)}for(var D=-b+y;D<=b-x;D+=2){for(var T,j=c+D,B=(T=D==-b||D!=b&&d[j-1]l)x+=2;else if(B>u)y+=2;else if(!C&&(R=c+_-D)>=0&&R=(T=l-T))return this.diff_bisectSplit_(n,r,z,N,a)}}}return[new t.Diff(-1,n),new t.Diff(1,r)]},t.prototype.diff_bisectSplit_=function(n,r,a,l,u){var o=n.substring(0,a),c=r.substring(0,l),f=n.substring(a),p=r.substring(l),d=this.diff_main(o,c,!1,u),v=this.diff_main(f,p,!1,u);return d.concat(v)},t.prototype.diff_linesToChars_=function(n,r){var a=[],l={};function u(f){for(var p="",d=0,v=-1,_=a.length;vl?n=n.substring(a-l):ar.length?n:r,l=n.length>r.length?r:n;if(a.length<4||2*l.length=w.length?[x,b,E,R,T]:null}var c,f,p,d,v,_=o(a,l,Math.ceil(a.length/4)),C=o(a,l,Math.ceil(a.length/2));return _||C?(c=C?_&&_[4].length>C[4].length?_:C:_,n.length>r.length?(f=c[0],p=c[1],d=c[2],v=c[3]):(d=c[0],v=c[1],f=c[2],p=c[3]),[f,p,d,v,c[4]]):null},t.prototype.diff_cleanupSemantic=function(n){for(var r=!1,a=[],l=0,u=null,o=0,c=0,f=0,p=0,d=0;o0?a[l-1]:-1,c=0,f=0,p=0,d=0,u=null,r=!0)),o++;for(r&&this.diff_cleanupMerge(n),this.diff_cleanupSemanticLossless(n),o=1;o=w?(C>=v.length/2||C>=_.length/2)&&(n.splice(o,0,new t.Diff(0,_.substring(0,C))),n[o-1][1]=v.substring(0,v.length-C),n[o+1][1]=_.substring(C),o++):(w>=v.length/2||w>=_.length/2)&&(n.splice(o,0,new t.Diff(0,v.substring(0,w))),n[o-1][0]=1,n[o-1][1]=_.substring(0,_.length-w),n[o+1][0]=-1,n[o+1][1]=v.substring(w),o++),o++}o++}},t.prototype.diff_cleanupSemanticLossless=function(n){function r(w,S){if(!w||!S)return 6;var y=w.charAt(w.length-1),x=S.charAt(0),b=y.match(t.nonAlphaNumericRegex_),E=x.match(t.nonAlphaNumericRegex_),R=b&&y.match(t.whitespaceRegex_),N=E&&x.match(t.whitespaceRegex_),D=R&&y.match(t.linebreakRegex_),T=N&&x.match(t.linebreakRegex_),j=D&&w.match(t.blanklineEndRegex_),B=T&&S.match(t.blanklineStartRegex_);return j||B?5:D||T?4:b&&!R&&N?3:R||N?2:b||E?1:0}for(var a=1;a=_&&(_=C,p=l,d=u,v=o)}n[a-1][1]!=p&&(p?n[a-1][1]=p:(n.splice(a-1,1),a--),n[a][1]=d,v?n[a+1][1]=v:(n.splice(a+1,1),a--))}a++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(n){for(var r=!1,a=[],l=0,u=null,o=0,c=!1,f=!1,p=!1,d=!1;o0?a[l-1]:-1,p=d=!1),r=!0)),o++;r&&this.diff_cleanupMerge(n)},t.prototype.diff_cleanupMerge=function(n){n.push(new t.Diff(0,""));for(var r,a=0,l=0,u=0,o="",c="";a1?(l!==0&&u!==0&&((r=this.diff_commonPrefix(c,o))!==0&&(a-l-u>0&&n[a-l-u-1][0]==0?n[a-l-u-1][1]+=c.substring(0,r):(n.splice(0,0,new t.Diff(0,c.substring(0,r))),a++),c=c.substring(r),o=o.substring(r)),(r=this.diff_commonSuffix(c,o))!==0&&(n[a][1]=c.substring(c.length-r)+n[a][1],c=c.substring(0,c.length-r),o=o.substring(0,o.length-r))),a-=l+u,n.splice(a,l+u),o.length&&(n.splice(a,0,new t.Diff(-1,o)),a++),c.length&&(n.splice(a,0,new t.Diff(1,c)),a++),a++):a!==0&&n[a-1][0]==0?(n[a-1][1]+=n[a][1],n.splice(a,1)):a++,u=0,l=0,o="",c=""}n[n.length-1][1]===""&&n.pop();var f=!1;for(a=1;ar));a++)o=l,c=u;return n.length!=a&&n[a][0]===-1?c:c+(r-o)},t.prototype.diff_prettyHtml=function(n){for(var r=[],a=/&/g,l=//g,o=/\n/g,c=0;c");switch(f){case 1:r[c]=''+p+"";break;case-1:r[c]=''+p+"";break;case 0:r[c]=""+p+""}}return r.join("")},t.prototype.diff_text1=function(n){for(var r=[],a=0;athis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var l=this.match_alphabet_(r),u=this;function o(N,D){var T=N/r.length,j=Math.abs(a-D);return u.Match_Distance?T+j/u.Match_Distance:j?1:T}var c=this.Match_Threshold,f=n.indexOf(r,a);f!=-1&&(c=Math.min(o(0,f),c),(f=n.lastIndexOf(r,a+r.length))!=-1&&(c=Math.min(o(0,f),c)));var p,d,v=1<=S;b--){var E=l[n.charAt(b-1)];if(x[b]=w===0?(x[b+1]<<1|1)&E:(x[b+1]<<1|1)&E|(_[b+1]|_[b])<<1|1|_[b+1],x[b]&v){var R=o(w,b-1);if(R<=c){if(c=R,!((f=b-1)>a))break;S=Math.max(1,2*a-f)}}}if(o(w+1,a)>c)break;_=x}return f},t.prototype.match_alphabet_=function(n){for(var r={},a=0;a2&&(this.diff_cleanupSemantic(u),this.diff_cleanupEfficiency(u));else if(n&&typeof n=="object"&&r===void 0&&a===void 0)u=n,l=this.diff_text1(u);else if(typeof n=="string"&&r&&typeof r=="object"&&a===void 0)l=n,u=r;else{if(typeof n!="string"||typeof r!="string"||!a||typeof a!="object")throw new Error("Unknown call format to patch_make.");l=n,u=a}if(u.length===0)return[];for(var o=[],c=new t.patch_obj,f=0,p=0,d=0,v=l,_=l,C=0;C=2*this.Patch_Margin&&f&&(this.patch_addContext_(c,v),o.push(c),c=new t.patch_obj,f=0,v=_,p=d)}w!==1&&(p+=S.length),w!==-1&&(d+=S.length)}return f&&(this.patch_addContext_(c,v),o.push(c)),o},t.prototype.patch_deepCopy=function(n){for(var r=[],a=0;athis.Match_MaxBits?(c=this.match_main(r,d.substring(0,this.Match_MaxBits),p))!=-1&&((v=this.match_main(r,d.substring(d.length-this.Match_MaxBits),p+d.length-this.Match_MaxBits))==-1||c>=v)&&(c=-1):c=this.match_main(r,d,p),c==-1)u[o]=!1,l-=n[o].length2-n[o].length1;else if(u[o]=!0,l=c-p,d==(f=v==-1?r.substring(c,c+d.length):r.substring(c,v+this.Match_MaxBits)))r=r.substring(0,c)+this.diff_text2(n[o].diffs)+r.substring(c+d.length);else{var _=this.diff_main(d,f,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(_)/d.length>this.Patch_DeleteThreshold)u[o]=!1;else{this.diff_cleanupSemanticLossless(_);for(var C,w=0,S=0;So[0][1].length){var c=r-o[0][1].length;o[0][1]=a.substring(o[0][1].length)+o[0][1],u.start1-=c,u.start2-=c,u.length1+=c,u.length2+=c}return(o=(u=n[n.length-1]).diffs).length==0||o[o.length-1][0]!=0?(o.push(new t.Diff(0,a)),u.length1+=r,u.length2+=r):r>o[o.length-1][1].length&&(c=r-o[o.length-1][1].length,o[o.length-1][1]+=a.substring(0,c),u.length1+=c,u.length2+=c),a},t.prototype.patch_splitMax=function(n){for(var r=this.Match_MaxBits,a=0;a2*r?(f.length1+=v.length,u+=v.length,p=!1,f.diffs.push(new t.Diff(d,v)),l.diffs.shift()):(v=v.substring(0,r-f.length1-this.Patch_Margin),f.length1+=v.length,u+=v.length,d===0?(f.length2+=v.length,o+=v.length):p=!1,f.diffs.push(new t.Diff(d,v)),v==l.diffs[0][1]?l.diffs.shift():l.diffs[0][1]=l.diffs[0][1].substring(v.length))}c=(c=this.diff_text2(f.diffs)).substring(c.length-this.Patch_Margin);var _=this.diff_text1(l.diffs).substring(0,this.Patch_Margin);_!==""&&(f.length1+=_.length,f.length2+=_.length,f.diffs.length!==0&&f.diffs[f.diffs.length-1][0]===0?f.diffs[f.diffs.length-1][1]+=_:f.diffs.push(new t.Diff(0,_))),p||n.splice(++a,0,f)}}},t.prototype.patch_toText=function(n){for(var r=[],a=0;aa||dr.length?n:r,c=n.length>r.length?r:n,f=o.indexOf(c);if(f!=-1)return u=[new t.Diff(1,o.substring(0,f)),new t.Diff(0,c),new t.Diff(1,o.substring(f+c.length))],n.length>r.length&&(u[0][0]=u[2][0]=-1),u;if(c.length==1)return[new t.Diff(-1,n),new t.Diff(1,r)];var p=this.diff_halfMatch_(n,r);if(p){var d=p[0],v=p[1],_=p[2],C=p[3],w=p[4],S=this.diff_main(d,_,a,l),y=this.diff_main(v,C,a,l);return S.concat([new t.Diff(0,w)],y)}return a&&n.length>100&&r.length>100?this.diff_lineMode_(n,r,l):this.diff_bisect_(n,r,l)},t.prototype.diff_lineMode_=function(n,r,a){var l=this.diff_linesToChars_(n,r);n=l.chars1,r=l.chars2;var u=l.lineArray,o=this.diff_main(n,r,!1,a);this.diff_charsToLines_(o,u),this.diff_cleanupSemantic(o),o.push(new t.Diff(0,""));for(var c=0,f=0,p=0,d="",v="";c=1&&p>=1){o.splice(c-f-p,f+p),c=c-f-p;for(var _=this.diff_main(d,v,!1,a),C=_.length-1;C>=0;C--)o.splice(c,0,_[C]);c+=_.length}p=0,f=0,d="",v=""}c++}return o.pop(),o},t.prototype.diff_bisect_=function(n,r,a){for(var l=n.length,u=r.length,o=Math.ceil((l+u)/2),c=o,f=2*o,p=new Array(f),d=new Array(f),v=0;va);b++){for(var E=-b+w;E<=b-S;E+=2){for(var D=c+E,N=(z=E==-b||E!=b&&p[D-1]l)S+=2;else if(N>u)w+=2;else if(C&&(j=c+_-E)>=0&&j=(T=l-d[j]))return this.diff_bisectSplit_(n,r,z,N,a)}for(var R=-b+y;R<=b-x;R+=2){for(var T,j=c+R,B=(T=R==-b||R!=b&&d[j-1]l)x+=2;else if(B>u)y+=2;else if(!C&&(D=c+_-R)>=0&&D=(T=l-T))return this.diff_bisectSplit_(n,r,z,N,a)}}}return[new t.Diff(-1,n),new t.Diff(1,r)]},t.prototype.diff_bisectSplit_=function(n,r,a,l,u){var o=n.substring(0,a),c=r.substring(0,l),f=n.substring(a),p=r.substring(l),d=this.diff_main(o,c,!1,u),v=this.diff_main(f,p,!1,u);return d.concat(v)},t.prototype.diff_linesToChars_=function(n,r){var a=[],l={};function u(f){for(var p="",d=0,v=-1,_=a.length;vl?n=n.substring(a-l):ar.length?n:r,l=n.length>r.length?r:n;if(a.length<4||2*l.length=w.length?[x,b,E,D,T]:null}var c,f,p,d,v,_=o(a,l,Math.ceil(a.length/4)),C=o(a,l,Math.ceil(a.length/2));return _||C?(c=C?_&&_[4].length>C[4].length?_:C:_,n.length>r.length?(f=c[0],p=c[1],d=c[2],v=c[3]):(d=c[0],v=c[1],f=c[2],p=c[3]),[f,p,d,v,c[4]]):null},t.prototype.diff_cleanupSemantic=function(n){for(var r=!1,a=[],l=0,u=null,o=0,c=0,f=0,p=0,d=0;o0?a[l-1]:-1,c=0,f=0,p=0,d=0,u=null,r=!0)),o++;for(r&&this.diff_cleanupMerge(n),this.diff_cleanupSemanticLossless(n),o=1;o=w?(C>=v.length/2||C>=_.length/2)&&(n.splice(o,0,new t.Diff(0,_.substring(0,C))),n[o-1][1]=v.substring(0,v.length-C),n[o+1][1]=_.substring(C),o++):(w>=v.length/2||w>=_.length/2)&&(n.splice(o,0,new t.Diff(0,v.substring(0,w))),n[o-1][0]=1,n[o-1][1]=_.substring(0,_.length-w),n[o+1][0]=-1,n[o+1][1]=v.substring(w),o++),o++}o++}},t.prototype.diff_cleanupSemanticLossless=function(n){function r(w,S){if(!w||!S)return 6;var y=w.charAt(w.length-1),x=S.charAt(0),b=y.match(t.nonAlphaNumericRegex_),E=x.match(t.nonAlphaNumericRegex_),D=b&&y.match(t.whitespaceRegex_),N=E&&x.match(t.whitespaceRegex_),R=D&&y.match(t.linebreakRegex_),T=N&&x.match(t.linebreakRegex_),j=R&&w.match(t.blanklineEndRegex_),B=T&&S.match(t.blanklineStartRegex_);return j||B?5:R||T?4:b&&!D&&N?3:D||N?2:b||E?1:0}for(var a=1;a=_&&(_=C,p=l,d=u,v=o)}n[a-1][1]!=p&&(p?n[a-1][1]=p:(n.splice(a-1,1),a--),n[a][1]=d,v?n[a+1][1]=v:(n.splice(a+1,1),a--))}a++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(n){for(var r=!1,a=[],l=0,u=null,o=0,c=!1,f=!1,p=!1,d=!1;o0?a[l-1]:-1,p=d=!1),r=!0)),o++;r&&this.diff_cleanupMerge(n)},t.prototype.diff_cleanupMerge=function(n){n.push(new t.Diff(0,""));for(var r,a=0,l=0,u=0,o="",c="";a1?(l!==0&&u!==0&&((r=this.diff_commonPrefix(c,o))!==0&&(a-l-u>0&&n[a-l-u-1][0]==0?n[a-l-u-1][1]+=c.substring(0,r):(n.splice(0,0,new t.Diff(0,c.substring(0,r))),a++),c=c.substring(r),o=o.substring(r)),(r=this.diff_commonSuffix(c,o))!==0&&(n[a][1]=c.substring(c.length-r)+n[a][1],c=c.substring(0,c.length-r),o=o.substring(0,o.length-r))),a-=l+u,n.splice(a,l+u),o.length&&(n.splice(a,0,new t.Diff(-1,o)),a++),c.length&&(n.splice(a,0,new t.Diff(1,c)),a++),a++):a!==0&&n[a-1][0]==0?(n[a-1][1]+=n[a][1],n.splice(a,1)):a++,u=0,l=0,o="",c=""}n[n.length-1][1]===""&&n.pop();var f=!1;for(a=1;ar));a++)o=l,c=u;return n.length!=a&&n[a][0]===-1?c:c+(r-o)},t.prototype.diff_prettyHtml=function(n){for(var r=[],a=/&/g,l=//g,o=/\n/g,c=0;c");switch(f){case 1:r[c]=''+p+"";break;case-1:r[c]=''+p+"";break;case 0:r[c]=""+p+""}}return r.join("")},t.prototype.diff_text1=function(n){for(var r=[],a=0;athis.Match_MaxBits)throw new Error("Pattern too long for this browser.");var l=this.match_alphabet_(r),u=this;function o(N,R){var T=N/r.length,j=Math.abs(a-R);return u.Match_Distance?T+j/u.Match_Distance:j?1:T}var c=this.Match_Threshold,f=n.indexOf(r,a);f!=-1&&(c=Math.min(o(0,f),c),(f=n.lastIndexOf(r,a+r.length))!=-1&&(c=Math.min(o(0,f),c)));var p,d,v=1<=S;b--){var E=l[n.charAt(b-1)];if(x[b]=w===0?(x[b+1]<<1|1)&E:(x[b+1]<<1|1)&E|(_[b+1]|_[b])<<1|1|_[b+1],x[b]&v){var D=o(w,b-1);if(D<=c){if(c=D,!((f=b-1)>a))break;S=Math.max(1,2*a-f)}}}if(o(w+1,a)>c)break;_=x}return f},t.prototype.match_alphabet_=function(n){for(var r={},a=0;a2&&(this.diff_cleanupSemantic(u),this.diff_cleanupEfficiency(u));else if(n&&typeof n=="object"&&r===void 0&&a===void 0)u=n,l=this.diff_text1(u);else if(typeof n=="string"&&r&&typeof r=="object"&&a===void 0)l=n,u=r;else{if(typeof n!="string"||typeof r!="string"||!a||typeof a!="object")throw new Error("Unknown call format to patch_make.");l=n,u=a}if(u.length===0)return[];for(var o=[],c=new t.patch_obj,f=0,p=0,d=0,v=l,_=l,C=0;C=2*this.Patch_Margin&&f&&(this.patch_addContext_(c,v),o.push(c),c=new t.patch_obj,f=0,v=_,p=d)}w!==1&&(p+=S.length),w!==-1&&(d+=S.length)}return f&&(this.patch_addContext_(c,v),o.push(c)),o},t.prototype.patch_deepCopy=function(n){for(var r=[],a=0;athis.Match_MaxBits?(c=this.match_main(r,d.substring(0,this.Match_MaxBits),p))!=-1&&((v=this.match_main(r,d.substring(d.length-this.Match_MaxBits),p+d.length-this.Match_MaxBits))==-1||c>=v)&&(c=-1):c=this.match_main(r,d,p),c==-1)u[o]=!1,l-=n[o].length2-n[o].length1;else if(u[o]=!0,l=c-p,d==(f=v==-1?r.substring(c,c+d.length):r.substring(c,v+this.Match_MaxBits)))r=r.substring(0,c)+this.diff_text2(n[o].diffs)+r.substring(c+d.length);else{var _=this.diff_main(d,f,!1);if(d.length>this.Match_MaxBits&&this.diff_levenshtein(_)/d.length>this.Patch_DeleteThreshold)u[o]=!1;else{this.diff_cleanupSemanticLossless(_);for(var C,w=0,S=0;So[0][1].length){var c=r-o[0][1].length;o[0][1]=a.substring(o[0][1].length)+o[0][1],u.start1-=c,u.start2-=c,u.length1+=c,u.length2+=c}return(o=(u=n[n.length-1]).diffs).length==0||o[o.length-1][0]!=0?(o.push(new t.Diff(0,a)),u.length1+=r,u.length2+=r):r>o[o.length-1][1].length&&(c=r-o[o.length-1][1].length,o[o.length-1][1]+=a.substring(0,c),u.length1+=c,u.length2+=c),a},t.prototype.patch_splitMax=function(n){for(var r=this.Match_MaxBits,a=0;a2*r?(f.length1+=v.length,u+=v.length,p=!1,f.diffs.push(new t.Diff(d,v)),l.diffs.shift()):(v=v.substring(0,r-f.length1-this.Patch_Margin),f.length1+=v.length,u+=v.length,d===0?(f.length2+=v.length,o+=v.length):p=!1,f.diffs.push(new t.Diff(d,v)),v==l.diffs[0][1]?l.diffs.shift():l.diffs[0][1]=l.diffs[0][1].substring(v.length))}c=(c=this.diff_text2(f.diffs)).substring(c.length-this.Patch_Margin);var _=this.diff_text1(l.diffs).substring(0,this.Patch_Margin);_!==""&&(f.length1+=_.length,f.length2+=_.length,f.diffs.length!==0&&f.diffs[f.diffs.length-1][0]===0?f.diffs[f.diffs.length-1][1]+=_:f.diffs.push(new t.Diff(0,_))),p||n.splice(++a,0,f)}}},t.prototype.patch_toText=function(n){for(var r=[],a=0;a1&&arguments[1]!==void 0?arguments[1]:{}).type,n=(t===void 0?"block":t)==="block"?CB:EB,r=Lm(e.map((function(o){return o.changes})),DC).map(n).reduce((function(o,c){var f=et(o,2),p=f[0],d=f[1],v=et(c,2),_=v[0],C=v[1];return[p.concat(_),d.concat(C)]}),[[],[]]),a=et(r,2),l=a[0],u=a[1];return yB(Mb(l),Mb(u))}var AB=["enhancers"],Bb=function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.enhancers,a=r===void 0?[]:r,l=et(rB(e,Rr(n,AB)),2),u=l[0],o=l[1],c=[Tb(u),Tb(o)],f=(t=[c[0],c[1]],a.reduce((function(w,S){return S(w)}),t)),p=et(f,2),d=p[0],v=p[1],_=[d.map(Rb),v.map(Rb)],C=_[1];return{old:_[0].map((function(w){var S;return(S=w.children)!==null&&S!==void 0?S:[]})),new:C.map((function(w){var S;return(S=w.children)!==null&&S!==void 0?S:[]}))}};const NB=2e3,TB={highlight(e,t){return Le.highlight(e,t).children}};function RB(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function DB(e){let t=0,n=0;for(const r of e.hunks)for(const a of r.changes)a.type==="insert"?t++:a.type==="delete"&&n++;return{additions:t,deletions:n}}function MB(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function jB(e){switch(e.type){case"delete":return e.oldPath;case"add":case"modify":return e.newPath;case"rename":case"copy":return`${e.oldPath} → ${e.newPath}`}}function LB(e){const t=[kB(e.hunks,{type:"line"})],n=Aw(MB(e));return n&&Le.registered(n)?Bb(e.hunks,{enhancers:t,highlight:!0,language:n,refractor:TB}):Bb(e.hunks,{enhancers:t,highlight:!1})}const OB=({change:e,side:t})=>t==="old"?null:RB(e);function Ib(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/1024).toFixed(1)} KB`}function BB({bytesRead:e,byteLimit:t}){return g.jsxs("div",{className:"truncated-notice",children:[g.jsx("h4",{children:"Diff too large to display"}),g.jsxs("p",{children:["This diff is larger than ",Ib(t)," (",Ib(e)," read). View it locally with git."]})]})}function IB({file:e,defaultExpanded:t}){const[n,r]=G.useState(t),{additions:a,deletions:l}=G.useMemo(()=>DB(e),[e]),u=n&&a+l<=NB,o=G.useMemo(()=>{if(u)try{return LB(e)}catch{return}},[e,u]);return g.jsxs("section",{className:"diff-file-card",children:[g.jsxs("button",{className:"diff-file-header",onClick:()=>r(c=>!c),children:[g.jsx("span",{className:"chev",children:n?g.jsx(gs,{size:14}):g.jsx(Wu,{size:14})}),g.jsx("span",{className:"path",children:g.jsx("code",{children:jB(e)})}),g.jsxs("span",{className:"stats",children:[g.jsxs("span",{className:"diff-stat-add",children:["+",a]}),g.jsxs("span",{className:"diff-stat-del",children:["−",l]})]})]}),n&&(e.hunks.length===0?g.jsx("div",{className:"diff-empty",children:"No textual diff for this file."}):g.jsx(W8,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:OB,tokens:o,viewType:"unified"}))]})}function jC({diff:e,className:t}){const n=G.useMemo(()=>{if(!e.trim())return[];try{return EO(e,{nearbySequences:"zip"})}catch{return[]}},[e]);return n.length===0?g.jsx("div",{className:"diff-empty",children:"No changes."}):g.jsx("div",{className:t?`openresearch-diff ${t}`:"openresearch-diff",children:n.map((r,a)=>g.jsx(IB,{file:r,defaultExpanded:a===0},`${r.oldPath}→${r.newPath}#${a}`))})}var _p={exports:{}},zb;function zB(){return zb||(zb=1,(function(e,t){(function(n,r){e.exports=r()})(self,(()=>(()=>{var n={};return(()=>{var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(a){this._terminal=a}dispose(){}fit(){const a=this.proposeDimensions();if(!a||!this._terminal||isNaN(a.cols)||isNaN(a.rows))return;const l=this._terminal._core;this._terminal.rows===a.rows&&this._terminal.cols===a.cols||(l._renderService.clear(),this._terminal.resize(a.cols,a.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const a=this._terminal._core,l=a._renderService.dimensions;if(l.css.cell.width===0||l.css.cell.height===0)return;const u=this._terminal.options.scrollback===0?0:a.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),f=Math.max(0,parseInt(o.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),d=c-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),v=f-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-u;return{cols:Math.max(2,Math.floor(v/l.css.cell.width)),rows:Math.max(1,Math.floor(d/l.css.cell.height))}}}})(),n})()))})(_p)),_p.exports}var HB=zB(),yp={exports:{}},Hb;function FB(){return Hb||(Hb=1,(function(e,t){(function(n,r){e.exports=r()})(globalThis,(()=>(()=>{var n={4567:function(u,o,c){var f=this&&this.__decorate||function(x,b,E,R){var N,D=arguments.length,T=D<3?b:R===null?R=Object.getOwnPropertyDescriptor(b,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,b,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(b,E,T):N(b,E))||T);return D>3&&T&&Object.defineProperty(b,E,T),T},p=this&&this.__param||function(x,b){return function(E,R){b(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=c(9042),v=c(9924),_=c(844),C=c(4725),w=c(2585),S=c(3656);let y=o.AccessibilityManager=class extends _.Disposable{constructor(x,b,E,R){super(),this._terminal=x,this._coreBrowserService=E,this._renderService=R,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let N=0;Nthis._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new v.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` +`:"")+p.content]}),["",""]),n=et(t,2),r=et(jC(n[0],n[1]),2),a=r[0],l=r[1];if(a.length===0&&l.length===0)return[[],[]];var u=function(f){if(f&&!Gi(f))return f.lineNumber},o=u(e.find(Rn)),c=u(e.find(Mr));if(o===void 0||c===void 0)throw new Error("Could not find start line number for edit");return[Bb(Ob(a),o),Bb(Ob(l),c)]}function AB(e){var t=e.reduce((function(r,a){var l=et(r,3),u=l[0],o=l[1],c=l[2];if(!c||!Rn(c)||!Mr(a))return[u,o,a];var f=et(jC(c.content,a.content),2),p=f[0],d=f[1];return[u.concat(cg(p,c.lineNumber)),o.concat(cg(d,a.lineNumber)),a]}),[[],[],null]),n=et(t,2);return[n[0],n[1]]}function NB(e){var t=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{}).type,n=(t===void 0?"block":t)==="block"?kB:AB,r=Om(e.map((function(o){return o.changes})),MC).map(n).reduce((function(o,c){var f=et(o,2),p=f[0],d=f[1],v=et(c,2),_=v[0],C=v[1];return[p.concat(_),d.concat(C)]}),[[],[]]),a=et(r,2),l=a[0],u=a[1];return SB(jb(l),jb(u))}var TB=["enhancers"],Ib=function(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.enhancers,a=r===void 0?[]:r,l=et(aB(e,Dr(n,TB)),2),u=l[0],o=l[1],c=[Db(u),Db(o)],f=(t=[c[0],c[1]],a.reduce((function(w,S){return S(w)}),t)),p=et(f,2),d=p[0],v=p[1],_=[d.map(Rb),v.map(Rb)],C=_[1];return{old:_[0].map((function(w){var S;return(S=w.children)!==null&&S!==void 0?S:[]})),new:C.map((function(w){var S;return(S=w.children)!==null&&S!==void 0?S:[]}))}};const DB=2e3,RB={highlight(e,t){return Le.highlight(e,t).children}};function MB(e){return e.type==="normal"?e.newLineNumber:e.lineNumber}function jB(e){let t=0,n=0;for(const r of e.hunks)for(const a of r.changes)a.type==="insert"?t++:a.type==="delete"&&n++;return{additions:t,deletions:n}}function LB(e){return e.newPath==="/dev/null"?e.oldPath:(e.oldPath==="/dev/null",e.newPath)}function OB(e){switch(e.type){case"delete":return e.oldPath;case"add":case"modify":return e.newPath;case"rename":case"copy":return`${e.oldPath} → ${e.newPath}`}}function BB(e){const t=[NB(e.hunks,{type:"line"})],n=Nw(LB(e));return n&&Le.registered(n)?Ib(e.hunks,{enhancers:t,highlight:!0,language:n,refractor:RB}):Ib(e.hunks,{enhancers:t,highlight:!1})}const IB=({change:e,side:t})=>t==="old"?null:MB(e);function zb(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${(e/1024).toFixed(1)} KB`}function zB({bytesRead:e,byteLimit:t}){return g.jsxs("div",{className:"truncated-notice",children:[g.jsx("h4",{children:"Diff too large to display"}),g.jsxs("p",{children:["This diff is larger than ",zb(t)," (",zb(e)," read). View it locally with git."]})]})}function HB({file:e,defaultExpanded:t}){const[n,r]=G.useState(t),{additions:a,deletions:l}=G.useMemo(()=>jB(e),[e]),u=n&&a+l<=DB,o=G.useMemo(()=>{if(u)try{return BB(e)}catch{return}},[e,u]);return g.jsxs("section",{className:"diff-file-card",children:[g.jsxs("button",{className:"diff-file-header",onClick:()=>r(c=>!c),children:[g.jsx("span",{className:"chev",children:n?g.jsx(gs,{size:14}):g.jsx(Xu,{size:14})}),g.jsx("span",{className:"path",children:g.jsx("code",{children:OB(e)})}),g.jsxs("span",{className:"stats",children:[g.jsxs("span",{className:"diff-stat-add",children:["+",a]}),g.jsxs("span",{className:"diff-stat-del",children:["−",l]})]})]}),n&&(e.hunks.length===0?g.jsx("div",{className:"diff-empty",children:"No textual diff for this file."}):g.jsx(K8,{className:"openresearch-diff-file",diffType:e.type,gutterType:"default",hunks:e.hunks,renderGutter:IB,tokens:o,viewType:"unified"}))]})}function LC({diff:e,className:t}){const n=G.useMemo(()=>{if(!e.trim())return[];try{return AO(e,{nearbySequences:"zip"})}catch{return[]}},[e]);return n.length===0?g.jsx("div",{className:"diff-empty",children:"No changes."}):g.jsx("div",{className:t?`openresearch-diff ${t}`:"openresearch-diff",children:n.map((r,a)=>g.jsx(HB,{file:r,defaultExpanded:a===0},`${r.oldPath}→${r.newPath}#${a}`))})}var yp={exports:{}},Hb;function FB(){return Hb||(Hb=1,(function(e,t){(function(n,r){e.exports=r()})(self,(()=>(()=>{var n={};return(()=>{var r=n;Object.defineProperty(r,"__esModule",{value:!0}),r.FitAddon=void 0,r.FitAddon=class{activate(a){this._terminal=a}dispose(){}fit(){const a=this.proposeDimensions();if(!a||!this._terminal||isNaN(a.cols)||isNaN(a.rows))return;const l=this._terminal._core;this._terminal.rows===a.rows&&this._terminal.cols===a.cols||(l._renderService.clear(),this._terminal.resize(a.cols,a.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const a=this._terminal._core,l=a._renderService.dimensions;if(l.css.cell.width===0||l.css.cell.height===0)return;const u=this._terminal.options.scrollback===0?0:a.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),f=Math.max(0,parseInt(o.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),d=c-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),v=f-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-u;return{cols:Math.max(2,Math.floor(v/l.css.cell.width)),rows:Math.max(1,Math.floor(d/l.css.cell.height))}}}})(),n})()))})(yp)),yp.exports}var PB=FB(),bp={exports:{}},Fb;function $B(){return Fb||(Fb=1,(function(e,t){(function(n,r){e.exports=r()})(globalThis,(()=>(()=>{var n={4567:function(u,o,c){var f=this&&this.__decorate||function(x,b,E,D){var N,R=arguments.length,T=R<3?b:D===null?D=Object.getOwnPropertyDescriptor(b,E):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,b,E,D);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(R<3?N(T):R>3?N(b,E,T):N(b,E))||T);return R>3&&T&&Object.defineProperty(b,E,T),T},p=this&&this.__param||function(x,b){return function(E,D){b(E,D,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=c(9042),v=c(9924),_=c(844),C=c(4725),w=c(2585),S=c(3656);let y=o.AccessibilityManager=class extends _.Disposable{constructor(x,b,E,D){super(),this._terminal=x,this._coreBrowserService=E,this._renderService=D,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let N=0;Nthis._handleBoundaryFocus(N,0),this._bottomBoundaryFocusListener=N=>this._handleBoundaryFocus(N,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new v.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((N=>this._handleResize(N.rows)))),this.register(this._terminal.onRender((N=>this._refreshRows(N.start,N.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((N=>this._handleChar(N)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(` `)))),this.register(this._terminal.onA11yTab((N=>this._handleTab(N)))),this.register(this._terminal.onKey((N=>this._handleKey(N.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,S.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,_.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(x){for(let b=0;b0?this._charsToConsume.shift()!==x&&(this._charsToAnnounce+=x):this._charsToAnnounce+=x,x===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(x){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(x)||this._charsToConsume.push(x)}_refreshRows(x,b){this._liveRegionDebouncer.refresh(x,b,this._terminal.rows)}_renderRows(x,b){const E=this._terminal.buffer,R=E.lines.length.toString();for(let N=x;N<=b;N++){const D=E.lines.get(E.ydisp+N),T=[],j=(D==null?void 0:D.translateToString(!0,void 0,void 0,T))||"",B=(E.ydisp+N+1).toString(),z=this._rowElements[N];z&&(j.length===0?(z.innerText=" ",this._rowColumns.set(z,[0,1])):(z.textContent=j,this._rowColumns.set(z,T)),z.setAttribute("aria-posinset",B),z.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(x,b){const E=x.target,R=this._rowElements[b===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||x.relatedTarget!==R)return;let N,D;if(b===0?(N=E,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(N=this._rowElements.shift(),D=E,this._rowContainer.removeChild(N)),N.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),b===0){const T=this._createAccessibilityTreeNode();this._rowElements.unshift(T),this._rowContainer.insertAdjacentElement("afterbegin",T)}else{const T=this._createAccessibilityTreeNode();this._rowElements.push(T),this._rowContainer.appendChild(T)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(b===0?-1:1),this._rowElements[b===0?1:this._rowElements.length-2].focus(),x.preventDefault(),x.stopImmediatePropagation()}_handleSelectionChange(){var j;if(this._rowElements.length===0)return;const x=document.getSelection();if(!x)return;if(x.isCollapsed)return void(this._rowContainer.contains(x.anchorNode)&&this._terminal.clearSelection());if(!x.anchorNode||!x.focusNode)return void console.error("anchorNode and/or focusNode are null");let b={node:x.anchorNode,offset:x.anchorOffset},E={node:x.focusNode,offset:x.focusOffset};if((b.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||b.node===E.node&&b.offset>E.offset)&&([b,E]=[E,b]),b.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(b={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(b.node))return;const R=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:R,offset:((j=R.textContent)==null?void 0:j.length)??0}),!this._rowContainer.contains(E.node))return;const N=({node:B,offset:z})=>{const V=B instanceof Text?B.parentNode:B;let F=parseInt(V==null?void 0:V.getAttribute("aria-posinset"),10)-1;if(isNaN(F))return console.warn("row is invalid. Race condition?"),null;const P=this._rowColumns.get(V);if(!P)return console.warn("columns is null. Race condition?"),null;let Y=z=this._terminal.cols&&(++F,Y=0),{row:F,column:Y}},D=N(b),T=N(E);if(D&&T){if(D.row>T.row||D.row===T.row&&D.column>=T.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(T.row-D.row)*this._terminal.cols-D.column+T.column)}}_handleResize(x){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let b=this._rowContainer.children.length;bx;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const x=this._coreBrowserService.mainDocument.createElement("div");return x.setAttribute("role","listitem"),x.tabIndex=-1,this._refreshRowDimensions(x),x}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let x=0;x{function c(v){return v.replace(/\r?\n/g,"\r")}function f(v,_){return _?"\x1B[200~"+v+"\x1B[201~":v}function p(v,_,C,w){v=f(v=c(v),C.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(v,!0),_.value=""}function d(v,_,C){const w=C.getBoundingClientRect(),S=v.clientX-w.left-10,y=v.clientY-w.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${S}px`,_.style.top=`${y}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=f,o.copyHandler=function(v,_){v.clipboardData&&v.clipboardData.setData("text/plain",_.selectionText),v.preventDefault()},o.handlePasteEvent=function(v,_,C,w){v.stopPropagation(),v.clipboardData&&p(v.clipboardData.getData("text/plain"),_,C,w)},o.paste=p,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(v,_,C,w,S){d(v,_,C),S&&w.rightClickSelect(v),_.value=w.selectionText,_.select()}},7239:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const f=c(1505);o.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(p,d,v){this._css.set(p,d,v)}getCss(p,d){return this._css.get(p,d)}setColor(p,d,v){this._color.set(p,d,v)}getColor(p,d){return this._color.get(p,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,f,p,d){c.addEventListener(f,p,d);let v=!1;return{dispose:()=>{v||(v=!0,c.removeEventListener(f,p,d))}}}},3551:function(u,o,c){var f=this&&this.__decorate||function(y,x,b,E){var R,N=arguments.length,D=N<3?x:E===null?E=Object.getOwnPropertyDescriptor(x,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,x,b,E);else for(var T=y.length-1;T>=0;T--)(R=y[T])&&(D=(N<3?R(D):N>3?R(x,b,D):R(x,b))||D);return N>3&&D&&Object.defineProperty(x,b,D),D},p=this&&this.__param||function(y,x){return function(b,E){x(b,E,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const d=c(3656),v=c(8460),_=c(844),C=c(2585),w=c(4725);let S=o.Linkifier=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(y,x,b,E,R){super(),this._element=y,this._mouseService=x,this._renderService=b,this._bufferService=E,this._linkProviderService=R,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.toDisposable)((()=>{var N;this._lastMouseEvent=void 0,(N=this._activeProviderReplies)==null||N.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(y){this._lastMouseEvent=y;const x=this._positionFromMouseEvent(y,this._element,this._mouseService);if(!x)return;this._isMouseOut=!1;const b=y.composedPath();for(let E=0;E{N==null||N.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=y.y);let b=!1;for(const[N,D]of this._linkProviderService.linkProviders.entries())x?(R=this._activeProviderReplies)!=null&&R.get(N)&&(b=this._checkLinkProviderResult(N,y,b)):D.provideLinks(y.y,(T=>{var B,z;if(this._isMouseOut)return;const j=T==null?void 0:T.map((V=>({link:V})));(B=this._activeProviderReplies)==null||B.set(N,j),b=this._checkLinkProviderResult(N,y,b),((z=this._activeProviderReplies)==null?void 0:z.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(y.y,this._activeProviderReplies)}))}_removeIntersectingLinks(y,x){const b=new Set;for(let E=0;Ey?this._bufferService.cols:D.link.range.end.x;for(let B=T;B<=j;B++){if(b.has(B)){R.splice(N--,1);break}b.add(B)}}}}_checkLinkProviderResult(y,x,b){var N;if(!this._activeProviderReplies)return b;const E=this._activeProviderReplies.get(y);let R=!1;for(let D=0;Dthis._linkAtPosition(T.link,x)));D&&(b=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!b)for(let D=0;Dthis._linkAtPosition(j.link,x)));if(T){b=!0,this._handleNewLink(T);break}}return b}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(y){if(!this._currentLink)return;const x=this._positionFromMouseEvent(y,this._element,this._mouseService);x&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,x)&&this._currentLink.link.activate(y,this._currentLink.link.text)}_clearCurrentLink(y,x){this._currentLink&&this._lastMouseEvent&&(!y||!x||this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=x)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(y){if(!this._lastMouseEvent)return;const x=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);x&&this._linkAtPosition(y.link,x)&&(this._currentLink=y,this._currentLink.state={decorations:{underline:y.link.decorations===void 0||y.link.decorations.underline,pointerCursor:y.link.decorations===void 0||y.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,y.link,this._lastMouseEvent),y.link.decorations={},Object.defineProperties(y.link.decorations,{pointerCursor:{get:()=>{var b,E;return(E=(b=this._currentLink)==null?void 0:b.state)==null?void 0:E.decorations.pointerCursor},set:b=>{var E;(E=this._currentLink)!=null&&E.state&&this._currentLink.state.decorations.pointerCursor!==b&&(this._currentLink.state.decorations.pointerCursor=b,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",b))}},underline:{get:()=>{var b,E;return(E=(b=this._currentLink)==null?void 0:b.state)==null?void 0:E.decorations.underline},set:b=>{var E,R,N;(E=this._currentLink)!=null&&E.state&&((N=(R=this._currentLink)==null?void 0:R.state)==null?void 0:N.decorations.underline)!==b&&(this._currentLink.state.decorations.underline=b,this._currentLink.state.isHovered&&this._fireUnderlineEvent(y.link,b))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((b=>{if(!this._currentLink)return;const E=b.start===0?0:b.start+1+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.ydisp+1+b.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(E,R),this._lastMouseEvent)){const N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!1)}}))))}_linkHover(y,x,b){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!0),this._currentLink.state.decorations.pointerCursor&&y.classList.add("xterm-cursor-pointer")),x.hover&&x.hover(b,x.text)}_fireUnderlineEvent(y,x){const b=y.range,E=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(b.start.x-1,b.start.y-E-1,b.end.x,b.end.y-E-1,void 0);(x?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(y,x,b){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!1),this._currentLink.state.decorations.pointerCursor&&y.classList.remove("xterm-cursor-pointer")),x.leave&&x.leave(b,x.text)}_linkAtPosition(y,x){const b=y.range.start.y*this._bufferService.cols+y.range.start.x,E=y.range.end.y*this._bufferService.cols+y.range.end.x,R=x.y*this._bufferService.cols+x.x;return b<=R&&R<=E}_positionFromMouseEvent(y,x,b){const E=b.getCoords(y,x,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(y,x,b,E,R){return{x1:y,y1:x,x2:b,y2:E,cols:this._bufferService.cols,fg:R}}};o.Linkifier=S=f([p(1,w.IMouseService),p(2,w.IRenderService),p(3,C.IBufferService),p(4,w.ILinkProviderService)],S)},9042:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(u,o,c){var f=this&&this.__decorate||function(w,S,y,x){var b,E=arguments.length,R=E<3?S:x===null?x=Object.getOwnPropertyDescriptor(S,y):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(w,S,y,x);else for(var N=w.length-1;N>=0;N--)(b=w[N])&&(R=(E<3?b(R):E>3?b(S,y,R):b(S,y))||R);return E>3&&R&&Object.defineProperty(S,y,R),R},p=this&&this.__param||function(w,S){return function(y,x){S(y,x,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=c(511),v=c(2585);let _=o.OscLinkProvider=class{constructor(w,S,y){this._bufferService=w,this._optionsService=S,this._oscLinkService=y}provideLinks(w,S){var j;const y=this._bufferService.buffer.lines.get(w-1);if(!y)return void S(void 0);const x=[],b=this._optionsService.rawOptions.linkHandler,E=new d.CellData,R=y.getTrimmedLength();let N=-1,D=-1,T=!1;for(let B=0;Bb?b.activate(P,Y,V):C(0,Y),hover:(P,Y)=>{var q;return(q=b==null?void 0:b.hover)==null?void 0:q.call(b,P,Y,V)},leave:(P,Y)=>{var q;return(q=b==null?void 0:b.leave)==null?void 0:q.call(b,P,Y,V)}})}T=!1,E.hasExtendedAttrs()&&E.extended.urlId?(D=B,N=E.extended.urlId):(D=-1,N=-1)}}S(x)}};function C(w,S){if(confirm(`Do you want to navigate to ${S}? +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(x){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(x)||this._charsToConsume.push(x)}_refreshRows(x,b){this._liveRegionDebouncer.refresh(x,b,this._terminal.rows)}_renderRows(x,b){const E=this._terminal.buffer,D=E.lines.length.toString();for(let N=x;N<=b;N++){const R=E.lines.get(E.ydisp+N),T=[],j=(R==null?void 0:R.translateToString(!0,void 0,void 0,T))||"",B=(E.ydisp+N+1).toString(),z=this._rowElements[N];z&&(j.length===0?(z.innerText=" ",this._rowColumns.set(z,[0,1])):(z.textContent=j,this._rowColumns.set(z,T)),z.setAttribute("aria-posinset",B),z.setAttribute("aria-setsize",D))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(x,b){const E=x.target,D=this._rowElements[b===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||x.relatedTarget!==D)return;let N,R;if(b===0?(N=E,R=this._rowElements.pop(),this._rowContainer.removeChild(R)):(N=this._rowElements.shift(),R=E,this._rowContainer.removeChild(N)),N.removeEventListener("focus",this._topBoundaryFocusListener),R.removeEventListener("focus",this._bottomBoundaryFocusListener),b===0){const T=this._createAccessibilityTreeNode();this._rowElements.unshift(T),this._rowContainer.insertAdjacentElement("afterbegin",T)}else{const T=this._createAccessibilityTreeNode();this._rowElements.push(T),this._rowContainer.appendChild(T)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(b===0?-1:1),this._rowElements[b===0?1:this._rowElements.length-2].focus(),x.preventDefault(),x.stopImmediatePropagation()}_handleSelectionChange(){var j;if(this._rowElements.length===0)return;const x=document.getSelection();if(!x)return;if(x.isCollapsed)return void(this._rowContainer.contains(x.anchorNode)&&this._terminal.clearSelection());if(!x.anchorNode||!x.focusNode)return void console.error("anchorNode and/or focusNode are null");let b={node:x.anchorNode,offset:x.anchorOffset},E={node:x.focusNode,offset:x.focusOffset};if((b.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||b.node===E.node&&b.offset>E.offset)&&([b,E]=[E,b]),b.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(b={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(b.node))return;const D=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(D)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:D,offset:((j=D.textContent)==null?void 0:j.length)??0}),!this._rowContainer.contains(E.node))return;const N=({node:B,offset:z})=>{const V=B instanceof Text?B.parentNode:B;let F=parseInt(V==null?void 0:V.getAttribute("aria-posinset"),10)-1;if(isNaN(F))return console.warn("row is invalid. Race condition?"),null;const P=this._rowColumns.get(V);if(!P)return console.warn("columns is null. Race condition?"),null;let W=z=this._terminal.cols&&(++F,W=0),{row:F,column:W}},R=N(b),T=N(E);if(R&&T){if(R.row>T.row||R.row===T.row&&R.column>=T.column)throw new Error("invalid range");this._terminal.select(R.column,R.row,(T.row-R.row)*this._terminal.cols-R.column+T.column)}}_handleResize(x){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let b=this._rowContainer.children.length;bx;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const x=this._coreBrowserService.mainDocument.createElement("div");return x.setAttribute("role","listitem"),x.tabIndex=-1,this._refreshRowDimensions(x),x}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let x=0;x{function c(v){return v.replace(/\r?\n/g,"\r")}function f(v,_){return _?"\x1B[200~"+v+"\x1B[201~":v}function p(v,_,C,w){v=f(v=c(v),C.decPrivateModes.bracketedPasteMode&&w.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(v,!0),_.value=""}function d(v,_,C){const w=C.getBoundingClientRect(),S=v.clientX-w.left-10,y=v.clientY-w.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${S}px`,_.style.top=`${y}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=f,o.copyHandler=function(v,_){v.clipboardData&&v.clipboardData.setData("text/plain",_.selectionText),v.preventDefault()},o.handlePasteEvent=function(v,_,C,w){v.stopPropagation(),v.clipboardData&&p(v.clipboardData.getData("text/plain"),_,C,w)},o.paste=p,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(v,_,C,w,S){d(v,_,C),S&&w.rightClickSelect(v),_.value=w.selectionText,_.select()}},7239:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const f=c(1505);o.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(p,d,v){this._css.set(p,d,v)}getCss(p,d){return this._css.get(p,d)}setColor(p,d,v){this._color.set(p,d,v)}getColor(p,d){return this._color.get(p,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,f,p,d){c.addEventListener(f,p,d);let v=!1;return{dispose:()=>{v||(v=!0,c.removeEventListener(f,p,d))}}}},3551:function(u,o,c){var f=this&&this.__decorate||function(y,x,b,E){var D,N=arguments.length,R=N<3?x:E===null?E=Object.getOwnPropertyDescriptor(x,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,x,b,E);else for(var T=y.length-1;T>=0;T--)(D=y[T])&&(R=(N<3?D(R):N>3?D(x,b,R):D(x,b))||R);return N>3&&R&&Object.defineProperty(x,b,R),R},p=this&&this.__param||function(y,x){return function(b,E){x(b,E,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const d=c(3656),v=c(8460),_=c(844),C=c(2585),w=c(4725);let S=o.Linkifier=class extends _.Disposable{get currentLink(){return this._currentLink}constructor(y,x,b,E,D){super(),this._element=y,this._mouseService=x,this._renderService=b,this._bufferService=E,this._linkProviderService=D,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,_.toDisposable)((()=>{var N;this._lastMouseEvent=void 0,(N=this._activeProviderReplies)==null||N.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(y){this._lastMouseEvent=y;const x=this._positionFromMouseEvent(y,this._element,this._mouseService);if(!x)return;this._isMouseOut=!1;const b=y.composedPath();for(let E=0;E{N==null||N.forEach((R=>{R.link.dispose&&R.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=y.y);let b=!1;for(const[N,R]of this._linkProviderService.linkProviders.entries())x?(D=this._activeProviderReplies)!=null&&D.get(N)&&(b=this._checkLinkProviderResult(N,y,b)):R.provideLinks(y.y,(T=>{var B,z;if(this._isMouseOut)return;const j=T==null?void 0:T.map((V=>({link:V})));(B=this._activeProviderReplies)==null||B.set(N,j),b=this._checkLinkProviderResult(N,y,b),((z=this._activeProviderReplies)==null?void 0:z.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(y.y,this._activeProviderReplies)}))}_removeIntersectingLinks(y,x){const b=new Set;for(let E=0;Ey?this._bufferService.cols:R.link.range.end.x;for(let B=T;B<=j;B++){if(b.has(B)){D.splice(N--,1);break}b.add(B)}}}}_checkLinkProviderResult(y,x,b){var N;if(!this._activeProviderReplies)return b;const E=this._activeProviderReplies.get(y);let D=!1;for(let R=0;Rthis._linkAtPosition(T.link,x)));R&&(b=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!b)for(let R=0;Rthis._linkAtPosition(j.link,x)));if(T){b=!0,this._handleNewLink(T);break}}return b}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(y){if(!this._currentLink)return;const x=this._positionFromMouseEvent(y,this._element,this._mouseService);x&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,x)&&this._currentLink.link.activate(y,this._currentLink.link.text)}_clearCurrentLink(y,x){this._currentLink&&this._lastMouseEvent&&(!y||!x||this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=x)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(y){if(!this._lastMouseEvent)return;const x=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);x&&this._linkAtPosition(y.link,x)&&(this._currentLink=y,this._currentLink.state={decorations:{underline:y.link.decorations===void 0||y.link.decorations.underline,pointerCursor:y.link.decorations===void 0||y.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,y.link,this._lastMouseEvent),y.link.decorations={},Object.defineProperties(y.link.decorations,{pointerCursor:{get:()=>{var b,E;return(E=(b=this._currentLink)==null?void 0:b.state)==null?void 0:E.decorations.pointerCursor},set:b=>{var E;(E=this._currentLink)!=null&&E.state&&this._currentLink.state.decorations.pointerCursor!==b&&(this._currentLink.state.decorations.pointerCursor=b,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",b))}},underline:{get:()=>{var b,E;return(E=(b=this._currentLink)==null?void 0:b.state)==null?void 0:E.decorations.underline},set:b=>{var E,D,N;(E=this._currentLink)!=null&&E.state&&((N=(D=this._currentLink)==null?void 0:D.state)==null?void 0:N.decorations.underline)!==b&&(this._currentLink.state.decorations.underline=b,this._currentLink.state.isHovered&&this._fireUnderlineEvent(y.link,b))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((b=>{if(!this._currentLink)return;const E=b.start===0?0:b.start+1+this._bufferService.buffer.ydisp,D=this._bufferService.buffer.ydisp+1+b.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=D&&(this._clearCurrentLink(E,D),this._lastMouseEvent)){const N=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);N&&this._askForLink(N,!1)}}))))}_linkHover(y,x,b){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!0),this._currentLink.state.decorations.pointerCursor&&y.classList.add("xterm-cursor-pointer")),x.hover&&x.hover(b,x.text)}_fireUnderlineEvent(y,x){const b=y.range,E=this._bufferService.buffer.ydisp,D=this._createLinkUnderlineEvent(b.start.x-1,b.start.y-E-1,b.end.x,b.end.y-E-1,void 0);(x?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(D)}_linkLeave(y,x,b){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(x,!1),this._currentLink.state.decorations.pointerCursor&&y.classList.remove("xterm-cursor-pointer")),x.leave&&x.leave(b,x.text)}_linkAtPosition(y,x){const b=y.range.start.y*this._bufferService.cols+y.range.start.x,E=y.range.end.y*this._bufferService.cols+y.range.end.x,D=x.y*this._bufferService.cols+x.x;return b<=D&&D<=E}_positionFromMouseEvent(y,x,b){const E=b.getCoords(y,x,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(y,x,b,E,D){return{x1:y,y1:x,x2:b,y2:E,cols:this._bufferService.cols,fg:D}}};o.Linkifier=S=f([p(1,w.IMouseService),p(2,w.IRenderService),p(3,C.IBufferService),p(4,w.ILinkProviderService)],S)},9042:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(u,o,c){var f=this&&this.__decorate||function(w,S,y,x){var b,E=arguments.length,D=E<3?S:x===null?x=Object.getOwnPropertyDescriptor(S,y):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(w,S,y,x);else for(var N=w.length-1;N>=0;N--)(b=w[N])&&(D=(E<3?b(D):E>3?b(S,y,D):b(S,y))||D);return E>3&&D&&Object.defineProperty(S,y,D),D},p=this&&this.__param||function(w,S){return function(y,x){S(y,x,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=c(511),v=c(2585);let _=o.OscLinkProvider=class{constructor(w,S,y){this._bufferService=w,this._optionsService=S,this._oscLinkService=y}provideLinks(w,S){var j;const y=this._bufferService.buffer.lines.get(w-1);if(!y)return void S(void 0);const x=[],b=this._optionsService.rawOptions.linkHandler,E=new d.CellData,D=y.getTrimmedLength();let N=-1,R=-1,T=!1;for(let B=0;Bb?b.activate(P,W,V):C(0,W),hover:(P,W)=>{var q;return(q=b==null?void 0:b.hover)==null?void 0:q.call(b,P,W,V)},leave:(P,W)=>{var q;return(q=b==null?void 0:b.leave)==null?void 0:q.call(b,P,W,V)}})}T=!1,E.hasExtendedAttrs()&&E.extended.urlId?(R=B,N=E.extended.urlId):(R=-1,N=-1)}}S(x)}};function C(w,S){if(confirm(`Do you want to navigate to ${S}? -WARNING: This link could potentially be dangerous`)){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=S}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=_=f([p(0,v.IBufferService),p(1,v.IOptionsService),p(2,v.IOscLinkService)],_)},6193:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,f){this._renderCallback=c,this._coreBrowserService=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,f,p){this._rowCount=p,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const f=c(3614),p=c(3656),d=c(3551),v=c(9042),_=c(3730),C=c(1680),w=c(3107),S=c(5744),y=c(2950),x=c(1296),b=c(428),E=c(4269),R=c(5114),N=c(8934),D=c(3230),T=c(9312),j=c(4725),B=c(6731),z=c(8055),V=c(8969),F=c(8460),P=c(844),Y=c(6114),q=c(8437),X=c(2584),K=c(7399),L=c(5941),M=c(9074),O=c(2585),U=c(5435),$=c(4567),Q=c(779);class re extends V.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(Z={}){super(Z),this.browser=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new P.MutableDisposable),this._onCursorMove=this.register(new F.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new F.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new F.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new F.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new F.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new F.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new F.EventEmitter),this._onBlur=this.register(new F.EventEmitter),this._onA11yCharEmitter=this.register(new F.EventEmitter),this._onA11yTabEmitter=this.register(new F.EventEmitter),this._onWillOpen=this.register(new F.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(M.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Q.LinkProviderService),this._instantiationService.setService(j.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((H,ee)=>this.refresh(H,ee)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((H=>this._reportWindowsOptions(H)))),this.register(this._inputHandler.onColor((H=>this._handleColorEvent(H)))),this.register((0,F.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,F.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((H=>this._afterResize(H.cols,H.rows)))),this.register((0,P.toDisposable)((()=>{var H,ee;this._customKeyEventHandler=void 0,(ee=(H=this.element)==null?void 0:H.parentNode)==null||ee.removeChild(this.element)})))}_handleColorEvent(Z){if(this._themeService)for(const H of Z){let ee,ne="";switch(H.index){case 256:ee="foreground",ne="10";break;case 257:ee="background",ne="11";break;case 258:ee="cursor",ne="12";break;default:ee="ansi",ne="4;"+H.index}switch(H.type){case 0:const pe=z.color.toColorRGB(ee==="ansi"?this._themeService.colors.ansi[H.index]:this._themeService.colors[ee]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${ne};${(0,L.toRgbString)(pe)}${X.C1_ESCAPED.ST}`);break;case 1:if(ee==="ansi")this._themeService.modifyColors((fe=>fe.ansi[H.index]=z.channels.toColor(...H.color)));else{const fe=ee;this._themeService.modifyColors((ye=>ye[fe]=z.channels.toColor(...H.color)))}break;case 2:this._themeService.restoreColor(H.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Z){Z?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance($.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Z){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Z;return(Z=this.textarea)==null?void 0:Z.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const Z=this.buffer.ybase+this.buffer.y,H=this.buffer.lines.get(Z);if(!H)return;const ee=Math.min(this.buffer.x,this.cols-1),ne=this._renderService.dimensions.css.cell.height,pe=H.getWidth(ee),fe=this._renderService.dimensions.css.cell.width*pe,ye=this.buffer.y*this._renderService.dimensions.css.cell.height,Ce=ee*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ce+"px",this.textarea.style.top=ye+"px",this.textarea.style.width=fe+"px",this.textarea.style.height=ne+"px",this.textarea.style.lineHeight=ne+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",(H=>{this.hasSelection()&&(0,f.copyHandler)(H,this._selectionService)})));const Z=H=>(0,f.handlePasteEvent)(H,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",Z)),this.register((0,p.addDisposableDomListener)(this.element,"paste",Z)),Y.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(H=>{H.button===2&&(0,f.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(H=>{(0,f.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Y.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(H=>{H.button===1&&(0,f.moveTextAreaUnderMouseCursor)(H,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(Z=>this._keyUp(Z)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(Z=>this._keyDown(Z)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(Z=>this._keyPress(Z)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(Z=>this._compositionHelper.compositionupdate(Z)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(Z=>this._inputEvent(Z)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Z){var ee;if(!Z)throw new Error("Terminal requires a parent element.");if(Z.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ee=this.element)==null?void 0:ee.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Z.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),Z.appendChild(this.element);const H=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),H.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,p.addDisposableDomListener)(this.screenElement,"mousemove",(ne=>this.updateCursorStyle(ne)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),H.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel),Y.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(R.CoreBrowserService,this.textarea,Z.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(j.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(ne=>this._handleTextAreaFocus(ne)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(b.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(j.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(B.ThemeService),this._instantiationService.setService(j.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(j.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(j.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ne=>this._onRender.fire(ne)))),this.onResize((ne=>this._renderService.resize(ne.cols,ne.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(y.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(N.MouseService),this._instantiationService.setService(j.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(H);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(T.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(j.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ne=>this._renderService.handleSelectionChanged(ne.start,ne.end,ne.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ne=>{this.textarea.value=ne,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ne=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(ne=>this._selectionService.handleMouseDown(ne)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance($.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ne=>this._handleScreenReaderModeOptionChange(ne)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(S.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ne=>{!this._overviewRulerRenderer&&ne&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(S.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(x.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Z=this,H=this.element;function ee(fe){const ye=Z._mouseService.getMouseReportCoords(fe,Z.screenElement);if(!ye)return!1;let Ce,Ee;switch(fe.overrideType||fe.type){case"mousemove":Ee=32,fe.buttons===void 0?(Ce=3,fe.button!==void 0&&(Ce=fe.button<3?fe.button:3)):Ce=1&fe.buttons?0:4&fe.buttons?1:2&fe.buttons?2:3;break;case"mouseup":Ee=0,Ce=fe.button<3?fe.button:3;break;case"mousedown":Ee=1,Ce=fe.button<3?fe.button:3;break;case"wheel":if(Z._customWheelEventHandler&&Z._customWheelEventHandler(fe)===!1||Z.viewport.getLinesScrolled(fe)===0)return!1;Ee=fe.deltaY<0?0:1,Ce=4;break;default:return!1}return!(Ee===void 0||Ce===void 0||Ce>4)&&Z.coreMouseService.triggerMouseEvent({col:ye.col,row:ye.row,x:ye.x,y:ye.y,button:Ce,action:Ee,ctrl:fe.ctrlKey,alt:fe.altKey,shift:fe.shiftKey})}const ne={mouseup:null,wheel:null,mousedrag:null,mousemove:null},pe={mouseup:fe=>(ee(fe),fe.buttons||(this._document.removeEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.removeEventListener("mousemove",ne.mousedrag)),this.cancel(fe)),wheel:fe=>(ee(fe),this.cancel(fe,!0)),mousedrag:fe=>{fe.buttons&&ee(fe)},mousemove:fe=>{fe.buttons||ee(fe)}};this.register(this.coreMouseService.onProtocolChange((fe=>{fe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(fe)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&fe?ne.mousemove||(H.addEventListener("mousemove",pe.mousemove),ne.mousemove=pe.mousemove):(H.removeEventListener("mousemove",ne.mousemove),ne.mousemove=null),16&fe?ne.wheel||(H.addEventListener("wheel",pe.wheel,{passive:!1}),ne.wheel=pe.wheel):(H.removeEventListener("wheel",ne.wheel),ne.wheel=null),2&fe?ne.mouseup||(ne.mouseup=pe.mouseup):(this._document.removeEventListener("mouseup",ne.mouseup),ne.mouseup=null),4&fe?ne.mousedrag||(ne.mousedrag=pe.mousedrag):(this._document.removeEventListener("mousemove",ne.mousedrag),ne.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(H,"mousedown",(fe=>{if(fe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(fe))return ee(fe),ne.mouseup&&this._document.addEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.addEventListener("mousemove",ne.mousedrag),this.cancel(fe)}))),this.register((0,p.addDisposableDomListener)(H,"wheel",(fe=>{if(!ne.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(fe)===!1)return!1;if(!this.buffer.hasScrollback){const ye=this.viewport.getLinesScrolled(fe);if(ye===0)return;const Ce=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(fe.deltaY<0?"A":"B");let Ee="";for(let Ne=0;Ne{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(fe),this.cancel(fe)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(H,"touchmove",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(fe)?void 0:this.cancel(fe)}),{passive:!1}))}refresh(Z,H){var ee;(ee=this._renderService)==null||ee.refreshRows(Z,H)}updateCursorStyle(Z){var H;(H=this._selectionService)!=null&&H.shouldColumnSelect(Z)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(Z,H,ee=0){var ne;ee===1?(super.scrollLines(Z,H,ee),this.refresh(0,this.rows-1)):(ne=this.viewport)==null||ne.scrollLines(Z)}paste(Z){(0,f.paste)(Z,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Z){this._customKeyEventHandler=Z}attachCustomWheelEventHandler(Z){this._customWheelEventHandler=Z}registerLinkProvider(Z){return this._linkProviderService.registerLinkProvider(Z)}registerCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const H=this._characterJoinerService.register(Z);return this.refresh(0,this.rows-1),H}deregisterCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Z)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Z){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Z)}registerDecoration(Z){return this._decorationService.registerDecoration(Z)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Z,H,ee){this._selectionService.setSelection(Z,H,ee)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var Z;(Z=this._selectionService)==null||Z.clearSelection()}selectAll(){var Z;(Z=this._selectionService)==null||Z.selectAll()}selectLines(Z,H){var ee;(ee=this._selectionService)==null||ee.selectLines(Z,H)}_keyDown(Z){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;const H=this.browser.isMac&&this.options.macOptionIsMeta&&Z.altKey;if(!H&&!this._compositionHelper.keydown(Z))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;H||Z.key!=="Dead"&&Z.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ee=(0,K.evaluateKeyboardEvent)(Z,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Z),ee.type===3||ee.type===2){const ne=this.rows-1;return this.scrollLines(ee.type===2?-ne:ne),this.cancel(Z,!0)}return ee.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Z)||(ee.cancel&&this.cancel(Z,!0),!ee.key||!!(Z.key&&!Z.ctrlKey&&!Z.altKey&&!Z.metaKey&&Z.key.length===1&&Z.key.charCodeAt(0)>=65&&Z.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ee.key!==X.C0.ETX&&ee.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ee.key,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(ee.key,!0),!this.optionsService.rawOptions.screenReaderMode||Z.altKey||Z.ctrlKey?this.cancel(Z,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Z,H){const ee=Z.isMac&&!this.options.macOptionIsMeta&&H.altKey&&!H.ctrlKey&&!H.metaKey||Z.isWindows&&H.altKey&&H.ctrlKey&&!H.metaKey||Z.isWindows&&H.getModifierState("AltGraph");return H.type==="keypress"?ee:ee&&(!H.keyCode||H.keyCode>47)}_keyUp(Z){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1||((function(H){return H.keyCode===16||H.keyCode===17||H.keyCode===18})(Z)||this.focus(),this.updateCursorStyle(Z),this._keyPressHandled=!1)}_keyPress(Z){let H;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;if(this.cancel(Z),Z.charCode)H=Z.charCode;else if(Z.which===null||Z.which===void 0)H=Z.keyCode;else{if(Z.which===0||Z.charCode===0)return!1;H=Z.which}return!(!H||(Z.altKey||Z.ctrlKey||Z.metaKey)&&!this._isThirdLevelShift(this.browser,Z)||(H=String.fromCharCode(H),this._onKey.fire({key:H,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(H,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Z){if(Z.data&&Z.inputType==="insertText"&&(!Z.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const H=Z.data;return this.coreService.triggerDataEvent(H,!0),this.cancel(Z),!0}return!1}resize(Z,H){Z!==this.cols||H!==this.rows?super.resize(Z,H):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Z,H){var ee,ne;(ee=this._charSizeService)==null||ee.measure(),(ne=this.viewport)==null||ne.syncScrollArea(!0)}clear(){var Z;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let H=1;H{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,f=1e3){this._renderCallback=c,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,f,p){this._rowCount=p,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const v=d-this._lastRefreshMs,_=this._debounceThresholdMS-v;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f)}}},1680:function(u,o,c){var f=this&&this.__decorate||function(y,x,b,E){var R,N=arguments.length,D=N<3?x:E===null?E=Object.getOwnPropertyDescriptor(x,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,x,b,E);else for(var T=y.length-1;T>=0;T--)(R=y[T])&&(D=(N<3?R(D):N>3?R(x,b,D):R(x,b))||D);return N>3&&D&&Object.defineProperty(x,b,D),D},p=this&&this.__param||function(y,x){return function(b,E){x(b,E,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const d=c(3656),v=c(4725),_=c(8460),C=c(844),w=c(2585);let S=o.Viewport=class extends C.Disposable{constructor(y,x,b,E,R,N,D,T){super(),this._viewportElement=y,this._scrollArea=x,this._bufferService=b,this._optionsService=E,this._charSizeService=R,this._renderService=N,this._coreBrowserService=D,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((j=>this._activeBuffer=j.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((j=>this._renderDimensions=j))),this._handleThemeChange(T.colors),this.register(T.onChangeColors((j=>this._handleThemeChange(j)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(y){this._viewportElement.style.backgroundColor=y.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(y){if(y)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const x=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==x&&(this._lastRecordedBufferHeight=x,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const y=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==y&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=y),this._refreshAnimationFrame=null}syncScrollArea(y=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(y);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(y)}_handleScroll(y){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const x=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:x,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const y=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(y*(this._smoothScrollState.target-this._smoothScrollState.origin)),y<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(y,x){const b=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(x<0&&this._viewportElement.scrollTop!==0||x>0&&b0&&(b=V),E=""}}return{bufferElements:R,cursorElement:b}}getLinesScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let x=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(x/=this._currentRowHeight+0,this._wheelPartialScroll+=x,x=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(x*=this._bufferService.rows),x}_applyScrollModifier(y,x){const b=this._optionsService.rawOptions.fastScrollModifier;return b==="alt"&&x.altKey||b==="ctrl"&&x.ctrlKey||b==="shift"&&x.shiftKey?y*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:y*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(y){this._lastTouchY=y.touches[0].pageY}handleTouchMove(y){const x=this._lastTouchY-y.touches[0].pageY;return this._lastTouchY=y.touches[0].pageY,x!==0&&(this._viewportElement.scrollTop+=x,this._bubbleScroll(y,x))}};o.Viewport=S=f([p(2,w.IBufferService),p(3,w.IOptionsService),p(4,v.ICharSizeService),p(5,v.IRenderService),p(6,v.ICoreBrowserService),p(7,v.IThemeService)],S)},3107:function(u,o,c){var f=this&&this.__decorate||function(w,S,y,x){var b,E=arguments.length,R=E<3?S:x===null?x=Object.getOwnPropertyDescriptor(S,y):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(w,S,y,x);else for(var N=w.length-1;N>=0;N--)(b=w[N])&&(R=(E<3?b(R):E>3?b(S,y,R):b(S,y))||R);return E>3&&R&&Object.defineProperty(S,y,R),R},p=this&&this.__param||function(w,S){return function(y,x){S(y,x,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const d=c(4725),v=c(844),_=c(2585);let C=o.BufferDecorationRenderer=class extends v.Disposable{constructor(w,S,y,x,b){super(),this._screenElement=w,this._bufferService=S,this._coreBrowserService=y,this._decorationService=x,this._renderService=b,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((E=>this._removeDecoration(E)))),this.register((0,v.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const w of this._decorationService.decorations)this._renderDecoration(w);this._dimensionsChanged=!1}_renderDecoration(w){this._refreshStyle(w),this._dimensionsChanged&&this._refreshXPosition(w)}_createElement(w){var x;const S=this._coreBrowserService.mainDocument.createElement("div");S.classList.add("xterm-decoration"),S.classList.toggle("xterm-decoration-top-layer",((x=w==null?void 0:w.options)==null?void 0:x.layer)==="top"),S.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,S.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",S.style.top=(w.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",S.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const y=w.options.x??0;return y&&y>this._bufferService.cols&&(S.style.display="none"),this._refreshXPosition(w,S),S}_refreshStyle(w){const S=w.marker.line-this._bufferService.buffers.active.ydisp;if(S<0||S>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let y=this._decorationElements.get(w);y||(y=this._createElement(w),w.element=y,this._decorationElements.set(w,y),this._container.appendChild(y),w.onDispose((()=>{this._decorationElements.delete(w),y.remove()}))),y.style.top=S*this._renderService.dimensions.css.cell.height+"px",y.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(y)}}_refreshXPosition(w,S=w.element){if(!S)return;const y=w.options.x??0;(w.options.anchor||"left")==="right"?S.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":S.style.left=y?y*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(w){var S;(S=this._decorationElements.get(w))==null||S.remove(),this._decorationElements.delete(w),w.dispose()}};o.BufferDecorationRenderer=C=f([p(1,_.IBufferService),p(2,d.ICoreBrowserService),p(3,_.IDecorationService),p(4,d.IRenderService)],C)},5871:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const f of this._zones)if(f.color===c.options.overviewRulerOptions.color&&f.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,c.marker.line))return;if(this._lineAdjacentToZone(f,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(f,c.marker.line)}if(this._zonePoolIndex=c.startBufferLine&&f<=c.endBufferLine}_lineAdjacentToZone(c,f,p){return f>=c.startBufferLine-this._linePadding[p||"full"]&&f<=c.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(c,f){c.startBufferLine=Math.min(c.startBufferLine,f),c.endBufferLine=Math.max(c.endBufferLine,f)}}},5744:function(u,o,c){var f=this&&this.__decorate||function(b,E,R,N){var D,T=arguments.length,j=T<3?E:N===null?N=Object.getOwnPropertyDescriptor(E,R):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(b,E,R,N);else for(var B=b.length-1;B>=0;B--)(D=b[B])&&(j=(T<3?D(j):T>3?D(E,R,j):D(E,R))||j);return T>3&&j&&Object.defineProperty(E,R,j),j},p=this&&this.__param||function(b,E){return function(R,N){E(R,N,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const d=c(5871),v=c(4725),_=c(844),C=c(2585),w={full:0,left:0,center:0,right:0},S={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0};let x=o.OverviewRulerRenderer=class extends _.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(b,E,R,N,D,T,j){var z;super(),this._viewportElement=b,this._screenElement=E,this._bufferService=R,this._decorationService=N,this._renderService=D,this._optionsService=T,this._coreBrowserService=j,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(z=this._viewportElement.parentElement)==null||z.insertBefore(this._canvas,this._viewportElement);const B=this._canvas.getContext("2d");if(!B)throw new Error("Ctx cannot be null");this._ctx=B,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,_.toDisposable)((()=>{var V;(V=this._canvas)==null||V.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const b=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);S.full=this._canvas.width,S.left=b,S.center=E,S.right=b,this._refreshDrawHeightConstants(),y.full=0,y.left=0,y.center=S.left,y.right=S.left+S.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const b=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(b,12),6)*this._coreBrowserService.dpr);w.left=E,w.center=E,w.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;const b=this._colorZoneStore.zones;for(const E of b)E.position!=="full"&&this._renderColorZone(E);for(const E of b)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(b){this._ctx.fillStyle=b.color,this._ctx.fillRect(y[b.position||"full"],Math.round((this._canvas.height-1)*(b.startBufferLine/this._bufferService.buffers.active.lines.length)-w[b.position||"full"]/2),S[b.position||"full"],Math.round((this._canvas.height-1)*((b.endBufferLine-b.startBufferLine)/this._bufferService.buffers.active.lines.length)+w[b.position||"full"]))}_queueRefresh(b,E){this._shouldUpdateDimensions=b||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=x=f([p(2,C.IBufferService),p(3,C.IDecorationService),p(4,v.IRenderService),p(5,C.IOptionsService),p(6,v.ICoreBrowserService)],x)},2950:function(u,o,c){var f=this&&this.__decorate||function(w,S,y,x){var b,E=arguments.length,R=E<3?S:x===null?x=Object.getOwnPropertyDescriptor(S,y):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(w,S,y,x);else for(var N=w.length-1;N>=0;N--)(b=w[N])&&(R=(E<3?b(R):E>3?b(S,y,R):b(S,y))||R);return E>3&&R&&Object.defineProperty(S,y,R),R},p=this&&this.__param||function(w,S){return function(y,x){S(y,x,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const d=c(4725),v=c(2585),_=c(2584);let C=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,S,y,x,b,E){this._textarea=w,this._compositionView=S,this._bufferService=y,this._optionsService=x,this._coreService=b,this._renderService=E,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(w){this._compositionView.textContent=w.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(w){if(this._isComposing||this._isSendingComposition){if(w.keyCode===229||w.keyCode===16||w.keyCode===17||w.keyCode===18)return!1;this._finalizeComposition(!1)}return w.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(w){if(this._compositionView.classList.remove("active"),this._isComposing=!1,w){const S={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let y;this._isSendingComposition=!1,S.start+=this._dataAlreadySent.length,y=this._isComposing?this._textarea.value.substring(S.start,S.end):this._textarea.value.substring(S.start),y.length>0&&this._coreService.triggerDataEvent(y,!0)}}),0)}else{this._isSendingComposition=!1;const S=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(S,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const S=this._textarea.value,y=S.replace(w,"");this._dataAlreadySent=y,S.length>w.length?this._coreService.triggerDataEvent(y,!0):S.lengththis.updateCompositionElements(!0)),0)}}};o.CompositionHelper=C=f([p(2,v.IBufferService),p(3,v.IOptionsService),p(4,v.ICoreService),p(5,d.IRenderService)],C)},9806:(u,o)=>{function c(f,p,d){const v=d.getBoundingClientRect(),_=f.getComputedStyle(d),C=parseInt(_.getPropertyValue("padding-left")),w=parseInt(_.getPropertyValue("padding-top"));return[p.clientX-v.left-C,p.clientY-v.top-w]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(f,p,d,v,_,C,w,S,y){if(!C)return;const x=c(f,p,d);return x?(x[0]=Math.ceil((x[0]+(y?w/2:0))/w),x[1]=Math.ceil(x[1]/S),x[0]=Math.min(Math.max(x[0],1),v+(y?1:0)),x[1]=Math.min(Math.max(x[1],1),_),x):void 0}},9504:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const f=c(2584);function p(S,y,x,b){const E=S-d(S,x),R=y-d(y,x),N=Math.abs(E-R)-(function(D,T,j){let B=0;const z=D-d(D,j),V=T-d(T,j);for(let F=0;F=0&&Sy?"A":"B"}function _(S,y,x,b,E,R){let N=S,D=y,T="";for(;N!==x||D!==b;)N+=E?1:-1,E&&N>R.cols-1?(T+=R.buffer.translateBufferLineToString(D,!1,S,N),N=0,S=0,D++):!E&&N<0&&(T+=R.buffer.translateBufferLineToString(D,!1,0,S+1),N=R.cols-1,S=N,D--);return T+R.buffer.translateBufferLineToString(D,!1,S,N)}function C(S,y){const x=y?"O":"[";return f.C0.ESC+x+S}function w(S,y){S=Math.floor(S);let x="";for(let b=0;b0?z-d(z,V):j;const Y=z,q=(function(X,K,L,M,O,U){let $;return $=p(L,M,O,U).length>0?M-d(M,O):K,X=L&&$S?"D":"C",w(Math.abs(E-S),C(N,b));N=R>y?"D":"C";const D=Math.abs(R-y);return w((function(T,j){return j.cols-T})(R>y?S:E,x)+(D-1)*x.cols+1+((R>y?E:S)-1),C(N,b))}},1296:function(u,o,c){var f=this&&this.__decorate||function(F,P,Y,q){var X,K=arguments.length,L=K<3?P:q===null?q=Object.getOwnPropertyDescriptor(P,Y):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(F,P,Y,q);else for(var M=F.length-1;M>=0;M--)(X=F[M])&&(L=(K<3?X(L):K>3?X(P,Y,L):X(P,Y))||L);return K>3&&L&&Object.defineProperty(P,Y,L),L},p=this&&this.__param||function(F,P){return function(Y,q){P(Y,q,F)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const d=c(3787),v=c(2550),_=c(2223),C=c(6171),w=c(6052),S=c(4725),y=c(8055),x=c(8460),b=c(844),E=c(2585),R="xterm-dom-renderer-owner-",N="xterm-rows",D="xterm-fg-",T="xterm-bg-",j="xterm-focus",B="xterm-selection";let z=1,V=o.DomRenderer=class extends b.Disposable{constructor(F,P,Y,q,X,K,L,M,O,U,$,Q,re){super(),this._terminal=F,this._document=P,this._element=Y,this._screenElement=q,this._viewportElement=X,this._helperContainer=K,this._linkifier2=L,this._charSizeService=O,this._optionsService=U,this._bufferService=$,this._coreBrowserService=Q,this._themeService=re,this._terminalClass=z++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new x.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(N),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(B),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((se=>this._injectCss(se)))),this._injectCss(this._themeService.colors),this._rowFactory=M.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(R+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((se=>this._handleLinkHover(se)))),this.register(this._linkifier2.onHideLinkUnderline((se=>this._handleLinkLeave(se)))),this.register((0,b.toDisposable)((()=>{this._element.classList.remove(R+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new v.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const F=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*F,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*F),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/F),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/F),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const P=`${this._terminalSelector} .${N} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=P,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(F){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let P=`${this._terminalSelector} .${N} { color: ${F.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;P+=`${this._terminalSelector} .${N} .xterm-dim { color: ${y.color.multiplyOpacity(F.foreground,.5).css};}`,P+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const Y=`blink_underline_${this._terminalClass}`,q=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;P+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,P+=`@keyframes ${q} { 50% { box-shadow: none; }}`,P+=`@keyframes ${X} { 0% { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css}; } 50% { background-color: inherit; color: ${F.cursor.css}; }}`,P+=`${this._terminalSelector} .${N}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${N}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${N}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css};}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${F.cursor.css} !important; color: ${F.cursorAccent.css} !important;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${F.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${F.cursor.css} inset;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${F.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,P+=`${this._terminalSelector} .${B} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${B} div { position: absolute; background-color: ${F.selectionBackgroundOpaque.css};}${this._terminalSelector} .${B} div { position: absolute; background-color: ${F.selectionInactiveBackgroundOpaque.css};}`;for(const[K,L]of F.ansi.entries())P+=`${this._terminalSelector} .${D}${K} { color: ${L.css}; }${this._terminalSelector} .${D}${K}.xterm-dim { color: ${y.color.multiplyOpacity(L,.5).css}; }${this._terminalSelector} .${T}${K} { background-color: ${L.css}; }`;P+=`${this._terminalSelector} .${D}${_.INVERTED_DEFAULT_COLOR} { color: ${y.color.opaque(F.background).css}; }${this._terminalSelector} .${D}${_.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${y.color.multiplyOpacity(y.color.opaque(F.background),.5).css}; }${this._terminalSelector} .${T}${_.INVERTED_DEFAULT_COLOR} { background-color: ${F.foreground.css}; }`,this._themeStyleElement.textContent=P}_setDefaultSpacing(){const F=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${F}px`,this._rowFactory.defaultSpacing=F}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(F,P){for(let Y=this._rowElements.length;Y<=P;Y++){const q=this._document.createElement("div");this._rowContainer.appendChild(q),this._rowElements.push(q)}for(;this._rowElements.length>P;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(F,P){this._refreshRowElements(F,P),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(j),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(j),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(F,P,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(F,P,Y),this.renderRows(0,this._bufferService.rows-1),!F||!P)return;this._selectionRenderModel.update(this._terminal,F,P,Y);const q=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,K=this._selectionRenderModel.viewportCappedStartRow,L=this._selectionRenderModel.viewportCappedEndRow;if(K>=this._bufferService.rows||L<0)return;const M=this._document.createDocumentFragment();if(Y){const O=F[0]>P[0];M.appendChild(this._createSelectionElement(K,O?P[0]:F[0],O?F[0]:P[0],L-K+1))}else{const O=q===K?F[0]:0,U=K===X?P[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(K,O,U));const $=L-K-1;if(M.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,$)),K!==L){const Q=X===L?P[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(L,0,Q))}}this._selectionContainer.appendChild(M)}_createSelectionElement(F,P,Y,q=1){const X=this._document.createElement("div"),K=P*this.dimensions.css.cell.width;let L=this.dimensions.css.cell.width*(Y-P);return K+L>this.dimensions.css.canvas.width&&(L=this.dimensions.css.canvas.width-K),X.style.height=q*this.dimensions.css.cell.height+"px",X.style.top=F*this.dimensions.css.cell.height+"px",X.style.left=`${K}px`,X.style.width=`${L}px`,X}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const F of this._rowElements)F.replaceChildren()}renderRows(F,P){const Y=this._bufferService.buffer,q=Y.ybase+Y.y,X=Math.min(Y.x,this._bufferService.cols-1),K=this._optionsService.rawOptions.cursorBlink,L=this._optionsService.rawOptions.cursorStyle,M=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=F;O<=P;O++){const U=O+Y.ydisp,$=this._rowElements[O],Q=Y.lines.get(U);if(!$||!Q)break;$.replaceChildren(...this._rowFactory.createRow(Q,U,U===q,L,M,X,K,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!0)}_handleLinkLeave(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!1)}_setCellUnderline(F,P,Y,q,X,K){Y<0&&(F=0),q<0&&(P=0);const L=this._bufferService.rows-1;Y=Math.max(Math.min(Y,L),0),q=Math.max(Math.min(q,L),0),X=Math.min(X,this._bufferService.cols);const M=this._bufferService.buffer,O=M.ybase+M.y,U=Math.min(M.x,X-1),$=this._optionsService.rawOptions.cursorBlink,Q=this._optionsService.rawOptions.cursorStyle,re=this._optionsService.rawOptions.cursorInactiveStyle;for(let se=Y;se<=q;++se){const Z=se+M.ydisp,H=this._rowElements[se],ee=M.lines.get(Z);if(!H||!ee)break;H.replaceChildren(...this._rowFactory.createRow(ee,Z,Z===O,Q,re,U,$,this.dimensions.css.cell.width,this._widthCache,K?se===Y?F:0:-1,K?(se===q?P:X)-1:-1))}}};o.DomRenderer=V=f([p(7,E.IInstantiationService),p(8,S.ICharSizeService),p(9,E.IOptionsService),p(10,E.IBufferService),p(11,S.ICoreBrowserService),p(12,S.IThemeService)],V)},3787:function(u,o,c){var f=this&&this.__decorate||function(N,D,T,j){var B,z=arguments.length,V=z<3?D:j===null?j=Object.getOwnPropertyDescriptor(D,T):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(N,D,T,j);else for(var F=N.length-1;F>=0;F--)(B=N[F])&&(V=(z<3?B(V):z>3?B(D,T,V):B(D,T))||V);return z>3&&V&&Object.defineProperty(D,T,V),V},p=this&&this.__param||function(N,D){return function(T,j){D(T,j,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const d=c(2223),v=c(643),_=c(511),C=c(2585),w=c(8055),S=c(4725),y=c(4269),x=c(6171),b=c(3734);let E=o.DomRendererRowFactory=class{constructor(N,D,T,j,B,z,V){this._document=N,this._characterJoinerService=D,this._optionsService=T,this._coreBrowserService=j,this._coreService=B,this._decorationService=z,this._themeService=V,this._workCell=new _.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(N,D,T){this._selectionStart=N,this._selectionEnd=D,this._columnSelectMode=T}createRow(N,D,T,j,B,z,V,F,P,Y,q){const X=[],K=this._characterJoinerService.getJoinedCharacters(D),L=this._themeService.colors;let M,O=N.getNoBgTrimmedLength();T&&O0&&ye===K[0][0]){Ee=!0;const Re=K.shift();we=new y.JoinedCellData(this._workCell,N.translateToString(!0,Re[0],Re[1]),Re[1]-Re[0]),Ne=Re[1]-1,Ce=we.getWidth()}const ft=this._isCellInSelection(ye,D),Ct=T&&ye===z,st=fe&&ye>=Y&&ye<=q;let Ye=!1;this._decorationService.forEachDecorationAtCell(ye,D,void 0,(Re=>{Ye=!0}));let vt=we.getChars()||v.WHITESPACE_CELL_CHAR;if(vt===" "&&(we.isUnderline()||we.isOverline())&&(vt=" "),ne=Ce*F-P.get(vt,we.isBold(),we.isItalic()),M){if(U&&(ft&&ee||!ft&&!ee&&we.bg===Q)&&(ft&&ee&&L.selectionForeground||we.fg===re)&&we.extended.ext===se&&st===Z&&ne===H&&!Ct&&!Ee&&!Ye){we.isInvisible()?$+=v.WHITESPACE_CELL_CHAR:$+=vt,U++;continue}U&&(M.textContent=$),M=this._document.createElement("span"),U=0,$=""}else M=this._document.createElement("span");if(Q=we.bg,re=we.fg,se=we.extended.ext,Z=st,H=ne,ee=ft,Ee&&z>=ye&&z<=Ne&&(z=ye),!this._coreService.isCursorHidden&&Ct&&this._coreService.isCursorInitialized){if(pe.push("xterm-cursor"),this._coreBrowserService.isFocused)V&&pe.push("xterm-cursor-blink"),pe.push(j==="bar"?"xterm-cursor-bar":j==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){case"outline":pe.push("xterm-cursor-outline");break;case"block":pe.push("xterm-cursor-block");break;case"bar":pe.push("xterm-cursor-bar");break;case"underline":pe.push("xterm-cursor-underline")}}if(we.isBold()&&pe.push("xterm-bold"),we.isItalic()&&pe.push("xterm-italic"),we.isDim()&&pe.push("xterm-dim"),$=we.isInvisible()?v.WHITESPACE_CELL_CHAR:we.getChars()||v.WHITESPACE_CELL_CHAR,we.isUnderline()&&(pe.push(`xterm-underline-${we.extended.underlineStyle}`),$===" "&&($=" "),!we.isUnderlineColorDefault()))if(we.isUnderlineColorRGB())M.style.textDecorationColor=`rgb(${b.AttributeData.toColorRGB(we.getUnderlineColor()).join(",")})`;else{let Re=we.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&we.isBold()&&Re<8&&(Re+=8),M.style.textDecorationColor=L.ansi[Re].css}we.isOverline()&&(pe.push("xterm-overline"),$===" "&&($=" ")),we.isStrikethrough()&&pe.push("xterm-strikethrough"),st&&(M.style.textDecoration="underline");let dt=we.getFgColor(),qe=we.getFgColorMode(),Pe=we.getBgColor(),ue=we.getBgColorMode();const _e=!!we.isInverse();if(_e){const Re=dt;dt=Pe,Pe=Re;const $e=qe;qe=ue,ue=$e}let ke,he,be,De=!1;switch(this._decorationService.forEachDecorationAtCell(ye,D,void 0,(Re=>{Re.options.layer!=="top"&&De||(Re.backgroundColorRGB&&(ue=50331648,Pe=Re.backgroundColorRGB.rgba>>8&16777215,ke=Re.backgroundColorRGB),Re.foregroundColorRGB&&(qe=50331648,dt=Re.foregroundColorRGB.rgba>>8&16777215,he=Re.foregroundColorRGB),De=Re.options.layer==="top")})),!De&&ft&&(ke=this._coreBrowserService.isFocused?L.selectionBackgroundOpaque:L.selectionInactiveBackgroundOpaque,Pe=ke.rgba>>8&16777215,ue=50331648,De=!0,L.selectionForeground&&(qe=50331648,dt=L.selectionForeground.rgba>>8&16777215,he=L.selectionForeground)),De&&pe.push("xterm-decoration-top"),ue){case 16777216:case 33554432:be=L.ansi[Pe],pe.push(`xterm-bg-${Pe}`);break;case 50331648:be=w.channels.toColor(Pe>>16,Pe>>8&255,255&Pe),this._addStyle(M,`background-color:#${R((Pe>>>0).toString(16),"0",6)}`);break;default:_e?(be=L.foreground,pe.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):be=L.background}switch(ke||we.isDim()&&(ke=w.color.multiplyOpacity(be,.5)),qe){case 16777216:case 33554432:we.isBold()&&dt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(dt+=8),this._applyMinimumContrast(M,be,L.ansi[dt],we,ke,void 0)||pe.push(`xterm-fg-${dt}`);break;case 50331648:const Re=w.channels.toColor(dt>>16&255,dt>>8&255,255&dt);this._applyMinimumContrast(M,be,Re,we,ke,he)||this._addStyle(M,`color:#${R(dt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(M,be,L.foreground,we,ke,he)||_e&&pe.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}pe.length&&(M.className=pe.join(" "),pe.length=0),Ct||Ee||Ye?M.textContent=$:U++,ne!==this.defaultSpacing&&(M.style.letterSpacing=`${ne}px`),X.push(M),ye=Ne}return M&&U&&(M.textContent=$),X}_applyMinimumContrast(N,D,T,j,B,z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,x.treatGlyphAsBackgroundColor)(j.getCode()))return!1;const V=this._getContrastCache(j);let F;if(B||z||(F=V.getColor(D.rgba,T.rgba)),F===void 0){const P=this._optionsService.rawOptions.minimumContrastRatio/(j.isDim()?2:1);F=w.color.ensureContrastRatio(B||D,z||T,P),V.setColor((B||D).rgba,(z||T).rgba,F??null)}return!!F&&(this._addStyle(N,`color:${F.css}`),!0)}_getContrastCache(N){return N.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(N,D){N.setAttribute("style",`${N.getAttribute("style")||""}${D};`)}_isCellInSelection(N,D){const T=this._selectionStart,j=this._selectionEnd;return!(!T||!j)&&(this._columnSelectMode?T[0]<=j[0]?N>=T[0]&&D>=T[1]&&N=T[1]&&N>=j[0]&&D<=j[1]:D>T[1]&&D=T[0]&&N=T[0])}};function R(N,D,T){for(;N.length{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const p=c.createElement("span");p.classList.add("xterm-char-measure-element");const d=c.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const v=c.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontStyle="italic";const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontWeight="bold",_.style.fontStyle="italic",this._measureElements=[p,d,v,_],this._container.appendChild(p),this._container.appendChild(d),this._container.appendChild(v),this._container.appendChild(_),f.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,f,p,d){c===this._font&&f===this._fontSize&&p===this._weight&&d===this._weightBold||(this._font=c,this._fontSize=f,this._weight=p,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(c,f,p){let d=0;if(!f&&!p&&c.length===1&&(d=c.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const C=this._measure(c,0);return C>0&&(this._flat[d]=C),C}let v=c;f&&(v+="B"),p&&(v+="I");let _=this._holey.get(v);if(_===void 0){let C=0;f&&(C|=1),p&&(C|=2),_=this._measure(c,C),_>0&&this._holey.set(v,_)}return _}_measure(c,f){const p=this._measureElements[f];return p.textContent=c.repeat(32),p.offsetWidth/32}}},2223:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const f=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(u,o)=>{function c(p){return 57508<=p&&p<=57558}function f(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},o.isEmoji=f,o.allowRescaling=function(p,d,v,_){return d===1&&v>Math.ceil(1.5*_)&&p!==void 0&&p>255&&!f(p)&&!c(p)&&!(function(C){return 57344<=C&&C<=63743})(p)},o.treatGlyphAsBackgroundColor=function(p){return c(p)||(function(d){return 9472<=d&&d<=9631})(p)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(p,d,v=0){return(p-(2*Math.round(d)-v))%(2*Math.round(d))}},6052:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(p,d,v,_=!1){if(this.selectionStart=d,this.selectionEnd=v,!d||!v||d[0]===v[0]&&d[1]===v[1])return void this.clear();const C=p.buffers.active.ydisp,w=d[1]-C,S=v[1]-C,y=Math.max(w,0),x=Math.min(S,p.rows-1);y>=p.rows||x<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=w,this.viewportEndRow=S,this.viewportCappedStartRow=y,this.viewportCappedEndRow=x,this.startCol=d[0],this.endCol=v[0])}isCellSelected(p,d,v){return!!this.hasSelection&&(v-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&v>=this.viewportCappedStartRow&&d=this.viewportCappedStartRow&&d>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v=this.startCol&&d=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,f=this.selectionEnd;return!(!c||!f)&&(c[1]>f[1]||c[1]===f[1]&&c[0]>f[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(u,o,c){var f=this&&this.__decorate||function(x,b,E,R){var N,D=arguments.length,T=D<3?b:R===null?R=Object.getOwnPropertyDescriptor(b,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,b,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(b,E,T):N(b,E))||T);return D>3&&T&&Object.defineProperty(b,E,T),T},p=this&&this.__param||function(x,b){return function(E,R){b(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const d=c(2585),v=c(8460),_=c(844);let C=o.CharSizeService=class extends _.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(x,b,E){super(),this._optionsService=E,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new y(this._optionsService))}catch{this._measureStrategy=this.register(new S(x,b,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const x=this._measureStrategy.measure();x.width===this.width&&x.height===this.height||(this.width=x.width,this.height=x.height,this._onCharSizeChange.fire())}};o.CharSizeService=C=f([p(2,d.IOptionsService)],C);class w extends _.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(b,E){b!==void 0&&b>0&&E!==void 0&&E>0&&(this._result.width=b,this._result.height=E)}}class S extends w{constructor(b,E,R){super(),this._document=b,this._parentElement=E,this._optionsService=R,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class y extends w{constructor(b){super(),this._optionsService=b,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const E=this._ctx.measureText("W");if(!("width"in E&&"fontBoundingBoxAscent"in E&&"fontBoundingBoxDescent"in E))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const b=this._ctx.measureText("W");return this._validateAndSet(b.width,b.fontBoundingBoxAscent+b.fontBoundingBoxDescent),this._result}}},4269:function(u,o,c){var f=this&&this.__decorate||function(y,x,b,E){var R,N=arguments.length,D=N<3?x:E===null?E=Object.getOwnPropertyDescriptor(x,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(y,x,b,E);else for(var T=y.length-1;T>=0;T--)(R=y[T])&&(D=(N<3?R(D):N>3?R(x,b,D):R(x,b))||D);return N>3&&D&&Object.defineProperty(x,b,D),D},p=this&&this.__param||function(y,x){return function(b,E){x(b,E,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=c(3734),v=c(643),_=c(511),C=c(2585);class w extends d.AttributeData{constructor(x,b,E){super(),this.content=0,this.combinedData="",this.fg=x.fg,this.bg=x.bg,this.combinedData=b,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(x){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=w;let S=o.CharacterJoinerService=class LC{constructor(x){this._bufferService=x,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(x){const b={id:this._nextCharacterJoinerId++,handler:x};return this._characterJoiners.push(b),b.id}deregister(x){for(let b=0;b1){const V=this._getJoinedRanges(R,T,D,b,N);for(let F=0;F1){const z=this._getJoinedRanges(R,T,D,b,N);for(let V=0;V{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const f=c(844),p=c(8460),d=c(3656);class v extends f.Disposable{constructor(w,S,y){super(),this._textarea=w,this._window=S,this.mainDocument=y,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new _(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((x=>this._screenDprMonitor.setWindow(x)))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(w){this._window!==w&&(this._window=w,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=v;class _ extends f.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new f.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,f.toDisposable)((()=>this.clearListener())))}setWindow(w){this._parentWindow=w,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var w;this._outerListener&&((w=this._resolutionMediaMatchList)==null||w.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const f=c(844);class p extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(v){return this.linkProviders.push(v),{dispose:()=>{const _=this.linkProviders.indexOf(v);_!==-1&&this.linkProviders.splice(_,1)}}}}o.LinkProviderService=p},8934:function(u,o,c){var f=this&&this.__decorate||function(C,w,S,y){var x,b=arguments.length,E=b<3?w:y===null?y=Object.getOwnPropertyDescriptor(w,S):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(C,w,S,y);else for(var R=C.length-1;R>=0;R--)(x=C[R])&&(E=(b<3?x(E):b>3?x(w,S,E):x(w,S))||E);return b>3&&E&&Object.defineProperty(w,S,E),E},p=this&&this.__param||function(C,w){return function(S,y){w(S,y,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const d=c(4725),v=c(9806);let _=o.MouseService=class{constructor(C,w){this._renderService=C,this._charSizeService=w}getCoords(C,w,S,y,x){return(0,v.getCoords)(window,C,w,S,y,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,x)}getMouseReportCoords(C,w){const S=(0,v.getCoordsRelativeToElement)(window,C,w);if(this._charSizeService.hasValidSize)return S[0]=Math.min(Math.max(S[0],0),this._renderService.dimensions.css.canvas.width-1),S[1]=Math.min(Math.max(S[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(S[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(S[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(S[0]),y:Math.floor(S[1])}}};o.MouseService=_=f([p(0,d.IRenderService),p(1,d.ICharSizeService)],_)},3230:function(u,o,c){var f=this&&this.__decorate||function(x,b,E,R){var N,D=arguments.length,T=D<3?b:R===null?R=Object.getOwnPropertyDescriptor(b,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,b,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(b,E,T):N(b,E))||T);return D>3&&T&&Object.defineProperty(b,E,T),T},p=this&&this.__param||function(x,b){return function(E,R){b(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const d=c(6193),v=c(4725),_=c(8460),C=c(844),w=c(7226),S=c(2585);let y=o.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(x,b,E,R,N,D,T,j){super(),this._rowCount=x,this._charSizeService=R,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new C.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new _.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new _.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new _.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new _.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer(((B,z)=>this._renderRows(B,z)),T),this.register(this._renderDebouncer),this.register(T.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>{var B;return(B=this._renderer.value)==null?void 0:B.clear()}))),this.register(E.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(N.onDecorationRegistered((()=>this._fullRefresh()))),this.register(N.onDecorationRemoved((()=>this._fullRefresh()))),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(j.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(T.window,b),this.register(T.onWindowChange((B=>this._registerIntersectionObserver(B,b))))}_registerIntersectionObserver(x,b){if("IntersectionObserver"in x){const E=new x.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});E.observe(b),this._observerDisposable.value=(0,C.toDisposable)((()=>E.disconnect()))}}_handleIntersectionChange(x){this._isPaused=x.isIntersecting===void 0?x.intersectionRatio===0:!x.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(x,b,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(x,b,this._rowCount))}_renderRows(x,b){this._renderer.value&&(x=Math.min(x,this._rowCount-1),b=Math.min(b,this._rowCount-1),this._renderer.value.renderRows(x,b),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:x,end:b}),this._onRender.fire({start:x,end:b}),this._isNextRenderRedrawOnly=!0)}resize(x,b){this._rowCount=b,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(x){this._renderer.value=x,this._renderer.value&&(this._renderer.value.onRequestRedraw((b=>this.refreshRows(b.start,b.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(x){return this._renderDebouncer.addRefreshCallback(x)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var x,b;this._renderer.value&&((b=(x=this._renderer.value).clearTextureAtlas)==null||b.call(x),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(x,b){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var E;return(E=this._renderer.value)==null?void 0:E.handleResize(x,b)})):this._renderer.value.handleResize(x,b),this._fullRefresh())}handleCharSizeChanged(){var x;(x=this._renderer.value)==null||x.handleCharSizeChanged()}handleBlur(){var x;(x=this._renderer.value)==null||x.handleBlur()}handleFocus(){var x;(x=this._renderer.value)==null||x.handleFocus()}handleSelectionChanged(x,b,E){var R;this._selectionState.start=x,this._selectionState.end=b,this._selectionState.columnSelectMode=E,(R=this._renderer.value)==null||R.handleSelectionChanged(x,b,E)}handleCursorMove(){var x;(x=this._renderer.value)==null||x.handleCursorMove()}clear(){var x;(x=this._renderer.value)==null||x.clear()}};o.RenderService=y=f([p(2,S.IOptionsService),p(3,v.ICharSizeService),p(4,S.IDecorationService),p(5,S.IBufferService),p(6,v.ICoreBrowserService),p(7,v.IThemeService)],y)},9312:function(u,o,c){var f=this&&this.__decorate||function(T,j,B,z){var V,F=arguments.length,P=F<3?j:z===null?z=Object.getOwnPropertyDescriptor(j,B):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(T,j,B,z);else for(var Y=T.length-1;Y>=0;Y--)(V=T[Y])&&(P=(F<3?V(P):F>3?V(j,B,P):V(j,B))||P);return F>3&&P&&Object.defineProperty(j,B,P),P},p=this&&this.__param||function(T,j){return function(B,z){j(B,z,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const d=c(9806),v=c(9504),_=c(456),C=c(4725),w=c(8460),S=c(844),y=c(6114),x=c(4841),b=c(511),E=c(2585),R=" ",N=new RegExp(R,"g");let D=o.SelectionService=class extends S.Disposable{constructor(T,j,B,z,V,F,P,Y,q){super(),this._element=T,this._screenElement=j,this._linkifier=B,this._bufferService=z,this._coreService=V,this._mouseService=F,this._optionsService=P,this._renderService=Y,this._coreBrowserService=q,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new b.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new w.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new w.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,S.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!T||!j||T[0]===j[0]&&T[1]===j[1])}get selectionText(){const T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;if(!T||!j)return"";const B=this._bufferService.buffer,z=[];if(this._activeSelectionMode===3){if(T[0]===j[0])return"";const V=T[0]V.replace(N," "))).join(y.isWindows?`\r +WARNING: This link could potentially be dangerous`)){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=S}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=_=f([p(0,v.IBufferService),p(1,v.IOptionsService),p(2,v.IOscLinkService)],_)},6193:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,f){this._renderCallback=c,this._coreBrowserService=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(c,f,p){this._rowCount=p,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const f=c(3614),p=c(3656),d=c(3551),v=c(9042),_=c(3730),C=c(1680),w=c(3107),S=c(5744),y=c(2950),x=c(1296),b=c(428),E=c(4269),D=c(5114),N=c(8934),R=c(3230),T=c(9312),j=c(4725),B=c(6731),z=c(8055),V=c(8969),F=c(8460),P=c(844),W=c(6114),q=c(8437),X=c(2584),K=c(7399),L=c(5941),M=c(9074),O=c(2585),U=c(5435),$=c(4567),Q=c(779);class re extends V.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(Z={}){super(Z),this.browser=W,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new P.MutableDisposable),this._onCursorMove=this.register(new F.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new F.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new F.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new F.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new F.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new F.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new F.EventEmitter),this._onBlur=this.register(new F.EventEmitter),this._onA11yCharEmitter=this.register(new F.EventEmitter),this._onA11yTabEmitter=this.register(new F.EventEmitter),this._onWillOpen=this.register(new F.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(M.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Q.LinkProviderService),this._instantiationService.setService(j.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(_.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((H,ee)=>this.refresh(H,ee)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((H=>this._reportWindowsOptions(H)))),this.register(this._inputHandler.onColor((H=>this._handleColorEvent(H)))),this.register((0,F.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,F.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,F.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((H=>this._afterResize(H.cols,H.rows)))),this.register((0,P.toDisposable)((()=>{var H,ee;this._customKeyEventHandler=void 0,(ee=(H=this.element)==null?void 0:H.parentNode)==null||ee.removeChild(this.element)})))}_handleColorEvent(Z){if(this._themeService)for(const H of Z){let ee,ne="";switch(H.index){case 256:ee="foreground",ne="10";break;case 257:ee="background",ne="11";break;case 258:ee="cursor",ne="12";break;default:ee="ansi",ne="4;"+H.index}switch(H.type){case 0:const pe=z.color.toColorRGB(ee==="ansi"?this._themeService.colors.ansi[H.index]:this._themeService.colors[ee]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${ne};${(0,L.toRgbString)(pe)}${X.C1_ESCAPED.ST}`);break;case 1:if(ee==="ansi")this._themeService.modifyColors((fe=>fe.ansi[H.index]=z.channels.toColor(...H.color)));else{const fe=ee;this._themeService.modifyColors((ye=>ye[fe]=z.channels.toColor(...H.color)))}break;case 2:this._themeService.restoreColor(H.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(Z){Z?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance($.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Z){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var Z;return(Z=this.textarea)==null?void 0:Z.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const Z=this.buffer.ybase+this.buffer.y,H=this.buffer.lines.get(Z);if(!H)return;const ee=Math.min(this.buffer.x,this.cols-1),ne=this._renderService.dimensions.css.cell.height,pe=H.getWidth(ee),fe=this._renderService.dimensions.css.cell.width*pe,ye=this.buffer.y*this._renderService.dimensions.css.cell.height,Ce=ee*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ce+"px",this.textarea.style.top=ye+"px",this.textarea.style.width=fe+"px",this.textarea.style.height=ne+"px",this.textarea.style.lineHeight=ne+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",(H=>{this.hasSelection()&&(0,f.copyHandler)(H,this._selectionService)})));const Z=H=>(0,f.handlePasteEvent)(H,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",Z)),this.register((0,p.addDisposableDomListener)(this.element,"paste",Z)),W.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(H=>{H.button===2&&(0,f.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",(H=>{(0,f.rightClickHandler)(H,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),W.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",(H=>{H.button===1&&(0,f.moveTextAreaUnderMouseCursor)(H,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",(Z=>this._keyUp(Z)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",(Z=>this._keyDown(Z)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",(Z=>this._keyPress(Z)),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",(Z=>this._compositionHelper.compositionupdate(Z)))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,p.addDisposableDomListener)(this.textarea,"input",(Z=>this._inputEvent(Z)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Z){var ee;if(!Z)throw new Error("Terminal requires a parent element.");if(Z.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ee=this.element)==null?void 0:ee.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=Z.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),Z.appendChild(this.element);const H=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),H.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,p.addDisposableDomListener)(this.screenElement,"mousemove",(ne=>this.updateCursorStyle(ne)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),H.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel),W.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(D.CoreBrowserService,this.textarea,Z.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(j.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",(ne=>this._handleTextAreaFocus(ne)))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(b.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(j.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(B.ThemeService),this._instantiationService.setService(j.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(j.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(R.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(j.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ne=>this._onRender.fire(ne)))),this.onResize((ne=>this._renderService.resize(ne.cols,ne.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(y.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(N.MouseService),this._instantiationService.setService(j.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(H);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(T.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(j.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ne=>this._renderService.handleSelectionChanged(ne.start,ne.end,ne.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ne=>{this.textarea.value=ne,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ne=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(w.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",(ne=>this._selectionService.handleMouseDown(ne)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance($.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ne=>this._handleScreenReaderModeOptionChange(ne)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(S.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ne=>{!this._overviewRulerRenderer&&ne&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(S.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(x.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const Z=this,H=this.element;function ee(fe){const ye=Z._mouseService.getMouseReportCoords(fe,Z.screenElement);if(!ye)return!1;let Ce,Ee;switch(fe.overrideType||fe.type){case"mousemove":Ee=32,fe.buttons===void 0?(Ce=3,fe.button!==void 0&&(Ce=fe.button<3?fe.button:3)):Ce=1&fe.buttons?0:4&fe.buttons?1:2&fe.buttons?2:3;break;case"mouseup":Ee=0,Ce=fe.button<3?fe.button:3;break;case"mousedown":Ee=1,Ce=fe.button<3?fe.button:3;break;case"wheel":if(Z._customWheelEventHandler&&Z._customWheelEventHandler(fe)===!1||Z.viewport.getLinesScrolled(fe)===0)return!1;Ee=fe.deltaY<0?0:1,Ce=4;break;default:return!1}return!(Ee===void 0||Ce===void 0||Ce>4)&&Z.coreMouseService.triggerMouseEvent({col:ye.col,row:ye.row,x:ye.x,y:ye.y,button:Ce,action:Ee,ctrl:fe.ctrlKey,alt:fe.altKey,shift:fe.shiftKey})}const ne={mouseup:null,wheel:null,mousedrag:null,mousemove:null},pe={mouseup:fe=>(ee(fe),fe.buttons||(this._document.removeEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.removeEventListener("mousemove",ne.mousedrag)),this.cancel(fe)),wheel:fe=>(ee(fe),this.cancel(fe,!0)),mousedrag:fe=>{fe.buttons&&ee(fe)},mousemove:fe=>{fe.buttons||ee(fe)}};this.register(this.coreMouseService.onProtocolChange((fe=>{fe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(fe)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&fe?ne.mousemove||(H.addEventListener("mousemove",pe.mousemove),ne.mousemove=pe.mousemove):(H.removeEventListener("mousemove",ne.mousemove),ne.mousemove=null),16&fe?ne.wheel||(H.addEventListener("wheel",pe.wheel,{passive:!1}),ne.wheel=pe.wheel):(H.removeEventListener("wheel",ne.wheel),ne.wheel=null),2&fe?ne.mouseup||(ne.mouseup=pe.mouseup):(this._document.removeEventListener("mouseup",ne.mouseup),ne.mouseup=null),4&fe?ne.mousedrag||(ne.mousedrag=pe.mousedrag):(this._document.removeEventListener("mousemove",ne.mousedrag),ne.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(H,"mousedown",(fe=>{if(fe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(fe))return ee(fe),ne.mouseup&&this._document.addEventListener("mouseup",ne.mouseup),ne.mousedrag&&this._document.addEventListener("mousemove",ne.mousedrag),this.cancel(fe)}))),this.register((0,p.addDisposableDomListener)(H,"wheel",(fe=>{if(!ne.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(fe)===!1)return!1;if(!this.buffer.hasScrollback){const ye=this.viewport.getLinesScrolled(fe);if(ye===0)return;const Ce=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(fe.deltaY<0?"A":"B");let Ee="";for(let Ne=0;Ne{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(fe),this.cancel(fe)}),{passive:!0})),this.register((0,p.addDisposableDomListener)(H,"touchmove",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(fe)?void 0:this.cancel(fe)}),{passive:!1}))}refresh(Z,H){var ee;(ee=this._renderService)==null||ee.refreshRows(Z,H)}updateCursorStyle(Z){var H;(H=this._selectionService)!=null&&H.shouldColumnSelect(Z)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(Z,H,ee=0){var ne;ee===1?(super.scrollLines(Z,H,ee),this.refresh(0,this.rows-1)):(ne=this.viewport)==null||ne.scrollLines(Z)}paste(Z){(0,f.paste)(Z,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Z){this._customKeyEventHandler=Z}attachCustomWheelEventHandler(Z){this._customWheelEventHandler=Z}registerLinkProvider(Z){return this._linkProviderService.registerLinkProvider(Z)}registerCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const H=this._characterJoinerService.register(Z);return this.refresh(0,this.rows-1),H}deregisterCharacterJoiner(Z){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Z)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Z){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Z)}registerDecoration(Z){return this._decorationService.registerDecoration(Z)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Z,H,ee){this._selectionService.setSelection(Z,H,ee)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var Z;(Z=this._selectionService)==null||Z.clearSelection()}selectAll(){var Z;(Z=this._selectionService)==null||Z.selectAll()}selectLines(Z,H){var ee;(ee=this._selectionService)==null||ee.selectLines(Z,H)}_keyDown(Z){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;const H=this.browser.isMac&&this.options.macOptionIsMeta&&Z.altKey;if(!H&&!this._compositionHelper.keydown(Z))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;H||Z.key!=="Dead"&&Z.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ee=(0,K.evaluateKeyboardEvent)(Z,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Z),ee.type===3||ee.type===2){const ne=this.rows-1;return this.scrollLines(ee.type===2?-ne:ne),this.cancel(Z,!0)}return ee.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Z)||(ee.cancel&&this.cancel(Z,!0),!ee.key||!!(Z.key&&!Z.ctrlKey&&!Z.altKey&&!Z.metaKey&&Z.key.length===1&&Z.key.charCodeAt(0)>=65&&Z.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ee.key!==X.C0.ETX&&ee.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ee.key,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(ee.key,!0),!this.optionsService.rawOptions.screenReaderMode||Z.altKey||Z.ctrlKey?this.cancel(Z,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Z,H){const ee=Z.isMac&&!this.options.macOptionIsMeta&&H.altKey&&!H.ctrlKey&&!H.metaKey||Z.isWindows&&H.altKey&&H.ctrlKey&&!H.metaKey||Z.isWindows&&H.getModifierState("AltGraph");return H.type==="keypress"?ee:ee&&(!H.keyCode||H.keyCode>47)}_keyUp(Z){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1||((function(H){return H.keyCode===16||H.keyCode===17||H.keyCode===18})(Z)||this.focus(),this.updateCursorStyle(Z),this._keyPressHandled=!1)}_keyPress(Z){let H;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Z)===!1)return!1;if(this.cancel(Z),Z.charCode)H=Z.charCode;else if(Z.which===null||Z.which===void 0)H=Z.keyCode;else{if(Z.which===0||Z.charCode===0)return!1;H=Z.which}return!(!H||(Z.altKey||Z.ctrlKey||Z.metaKey)&&!this._isThirdLevelShift(this.browser,Z)||(H=String.fromCharCode(H),this._onKey.fire({key:H,domEvent:Z}),this._showCursor(),this.coreService.triggerDataEvent(H,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Z){if(Z.data&&Z.inputType==="insertText"&&(!Z.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const H=Z.data;return this.coreService.triggerDataEvent(H,!0),this.cancel(Z),!0}return!1}resize(Z,H){Z!==this.cols||H!==this.rows?super.resize(Z,H):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Z,H){var ee,ne;(ee=this._charSizeService)==null||ee.measure(),(ne=this.viewport)==null||ne.syncScrollArea(!0)}clear(){var Z;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let H=1;H{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,f=1e3){this._renderCallback=c,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,f,p){this._rowCount=p,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const v=d-this._lastRefreshMs,_=this._debounceThresholdMS-v;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f)}}},1680:function(u,o,c){var f=this&&this.__decorate||function(y,x,b,E){var D,N=arguments.length,R=N<3?x:E===null?E=Object.getOwnPropertyDescriptor(x,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,x,b,E);else for(var T=y.length-1;T>=0;T--)(D=y[T])&&(R=(N<3?D(R):N>3?D(x,b,R):D(x,b))||R);return N>3&&R&&Object.defineProperty(x,b,R),R},p=this&&this.__param||function(y,x){return function(b,E){x(b,E,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const d=c(3656),v=c(4725),_=c(8460),C=c(844),w=c(2585);let S=o.Viewport=class extends C.Disposable{constructor(y,x,b,E,D,N,R,T){super(),this._viewportElement=y,this._scrollArea=x,this._bufferService=b,this._optionsService=E,this._charSizeService=D,this._renderService=N,this._coreBrowserService=R,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new _.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((j=>this._activeBuffer=j.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((j=>this._renderDimensions=j))),this._handleThemeChange(T.colors),this.register(T.onChangeColors((j=>this._handleThemeChange(j)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(y){this._viewportElement.style.backgroundColor=y.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(y){if(y)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const x=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==x&&(this._lastRecordedBufferHeight=x,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const y=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==y&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=y),this._refreshAnimationFrame=null}syncScrollArea(y=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(y);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(y)}_handleScroll(y){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const x=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:x,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const y=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(y*(this._smoothScrollState.target-this._smoothScrollState.origin)),y<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(y,x){const b=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(x<0&&this._viewportElement.scrollTop!==0||x>0&&b0&&(b=V),E=""}}return{bufferElements:D,cursorElement:b}}getLinesScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let x=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(x/=this._currentRowHeight+0,this._wheelPartialScroll+=x,x=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(x*=this._bufferService.rows),x}_applyScrollModifier(y,x){const b=this._optionsService.rawOptions.fastScrollModifier;return b==="alt"&&x.altKey||b==="ctrl"&&x.ctrlKey||b==="shift"&&x.shiftKey?y*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:y*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(y){this._lastTouchY=y.touches[0].pageY}handleTouchMove(y){const x=this._lastTouchY-y.touches[0].pageY;return this._lastTouchY=y.touches[0].pageY,x!==0&&(this._viewportElement.scrollTop+=x,this._bubbleScroll(y,x))}};o.Viewport=S=f([p(2,w.IBufferService),p(3,w.IOptionsService),p(4,v.ICharSizeService),p(5,v.IRenderService),p(6,v.ICoreBrowserService),p(7,v.IThemeService)],S)},3107:function(u,o,c){var f=this&&this.__decorate||function(w,S,y,x){var b,E=arguments.length,D=E<3?S:x===null?x=Object.getOwnPropertyDescriptor(S,y):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(w,S,y,x);else for(var N=w.length-1;N>=0;N--)(b=w[N])&&(D=(E<3?b(D):E>3?b(S,y,D):b(S,y))||D);return E>3&&D&&Object.defineProperty(S,y,D),D},p=this&&this.__param||function(w,S){return function(y,x){S(y,x,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const d=c(4725),v=c(844),_=c(2585);let C=o.BufferDecorationRenderer=class extends v.Disposable{constructor(w,S,y,x,b){super(),this._screenElement=w,this._bufferService=S,this._coreBrowserService=y,this._decorationService=x,this._renderService=b,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((E=>this._removeDecoration(E)))),this.register((0,v.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const w of this._decorationService.decorations)this._renderDecoration(w);this._dimensionsChanged=!1}_renderDecoration(w){this._refreshStyle(w),this._dimensionsChanged&&this._refreshXPosition(w)}_createElement(w){var x;const S=this._coreBrowserService.mainDocument.createElement("div");S.classList.add("xterm-decoration"),S.classList.toggle("xterm-decoration-top-layer",((x=w==null?void 0:w.options)==null?void 0:x.layer)==="top"),S.style.width=`${Math.round((w.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,S.style.height=(w.options.height||1)*this._renderService.dimensions.css.cell.height+"px",S.style.top=(w.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",S.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const y=w.options.x??0;return y&&y>this._bufferService.cols&&(S.style.display="none"),this._refreshXPosition(w,S),S}_refreshStyle(w){const S=w.marker.line-this._bufferService.buffers.active.ydisp;if(S<0||S>=this._bufferService.rows)w.element&&(w.element.style.display="none",w.onRenderEmitter.fire(w.element));else{let y=this._decorationElements.get(w);y||(y=this._createElement(w),w.element=y,this._decorationElements.set(w,y),this._container.appendChild(y),w.onDispose((()=>{this._decorationElements.delete(w),y.remove()}))),y.style.top=S*this._renderService.dimensions.css.cell.height+"px",y.style.display=this._altBufferIsActive?"none":"block",w.onRenderEmitter.fire(y)}}_refreshXPosition(w,S=w.element){if(!S)return;const y=w.options.x??0;(w.options.anchor||"left")==="right"?S.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":S.style.left=y?y*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(w){var S;(S=this._decorationElements.get(w))==null||S.remove(),this._decorationElements.delete(w),w.dispose()}};o.BufferDecorationRenderer=C=f([p(1,_.IBufferService),p(2,d.ICoreBrowserService),p(3,_.IDecorationService),p(4,d.IRenderService)],C)},5871:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(c){if(c.options.overviewRulerOptions){for(const f of this._zones)if(f.color===c.options.overviewRulerOptions.color&&f.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,c.marker.line))return;if(this._lineAdjacentToZone(f,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(f,c.marker.line)}if(this._zonePoolIndex=c.startBufferLine&&f<=c.endBufferLine}_lineAdjacentToZone(c,f,p){return f>=c.startBufferLine-this._linePadding[p||"full"]&&f<=c.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(c,f){c.startBufferLine=Math.min(c.startBufferLine,f),c.endBufferLine=Math.max(c.endBufferLine,f)}}},5744:function(u,o,c){var f=this&&this.__decorate||function(b,E,D,N){var R,T=arguments.length,j=T<3?E:N===null?N=Object.getOwnPropertyDescriptor(E,D):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(b,E,D,N);else for(var B=b.length-1;B>=0;B--)(R=b[B])&&(j=(T<3?R(j):T>3?R(E,D,j):R(E,D))||j);return T>3&&j&&Object.defineProperty(E,D,j),j},p=this&&this.__param||function(b,E){return function(D,N){E(D,N,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const d=c(5871),v=c(4725),_=c(844),C=c(2585),w={full:0,left:0,center:0,right:0},S={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0};let x=o.OverviewRulerRenderer=class extends _.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(b,E,D,N,R,T,j){var z;super(),this._viewportElement=b,this._screenElement=E,this._bufferService=D,this._decorationService=N,this._renderService=R,this._optionsService=T,this._coreBrowserService=j,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(z=this._viewportElement.parentElement)==null||z.insertBefore(this._canvas,this._viewportElement);const B=this._canvas.getContext("2d");if(!B)throw new Error("Ctx cannot be null");this._ctx=B,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,_.toDisposable)((()=>{var V;(V=this._canvas)==null||V.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const b=Math.floor(this._canvas.width/3),E=Math.ceil(this._canvas.width/3);S.full=this._canvas.width,S.left=b,S.center=E,S.right=b,this._refreshDrawHeightConstants(),y.full=0,y.left=0,y.center=S.left,y.right=S.left+S.center}_refreshDrawHeightConstants(){w.full=Math.round(2*this._coreBrowserService.dpr);const b=this._canvas.height/this._bufferService.buffer.lines.length,E=Math.round(Math.max(Math.min(b,12),6)*this._coreBrowserService.dpr);w.left=E,w.center=E,w.right=E}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*w.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const E of this._decorationService.decorations)this._colorZoneStore.addDecoration(E);this._ctx.lineWidth=1;const b=this._colorZoneStore.zones;for(const E of b)E.position!=="full"&&this._renderColorZone(E);for(const E of b)E.position==="full"&&this._renderColorZone(E);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(b){this._ctx.fillStyle=b.color,this._ctx.fillRect(y[b.position||"full"],Math.round((this._canvas.height-1)*(b.startBufferLine/this._bufferService.buffers.active.lines.length)-w[b.position||"full"]/2),S[b.position||"full"],Math.round((this._canvas.height-1)*((b.endBufferLine-b.startBufferLine)/this._bufferService.buffers.active.lines.length)+w[b.position||"full"]))}_queueRefresh(b,E){this._shouldUpdateDimensions=b||this._shouldUpdateDimensions,this._shouldUpdateAnchor=E||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};o.OverviewRulerRenderer=x=f([p(2,C.IBufferService),p(3,C.IDecorationService),p(4,v.IRenderService),p(5,C.IOptionsService),p(6,v.ICoreBrowserService)],x)},2950:function(u,o,c){var f=this&&this.__decorate||function(w,S,y,x){var b,E=arguments.length,D=E<3?S:x===null?x=Object.getOwnPropertyDescriptor(S,y):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(w,S,y,x);else for(var N=w.length-1;N>=0;N--)(b=w[N])&&(D=(E<3?b(D):E>3?b(S,y,D):b(S,y))||D);return E>3&&D&&Object.defineProperty(S,y,D),D},p=this&&this.__param||function(w,S){return function(y,x){S(y,x,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const d=c(4725),v=c(2585),_=c(2584);let C=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(w,S,y,x,b,E){this._textarea=w,this._compositionView=S,this._bufferService=y,this._optionsService=x,this._coreService=b,this._renderService=E,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(w){this._compositionView.textContent=w.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(w){if(this._isComposing||this._isSendingComposition){if(w.keyCode===229||w.keyCode===16||w.keyCode===17||w.keyCode===18)return!1;this._finalizeComposition(!1)}return w.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(w){if(this._compositionView.classList.remove("active"),this._isComposing=!1,w){const S={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let y;this._isSendingComposition=!1,S.start+=this._dataAlreadySent.length,y=this._isComposing?this._textarea.value.substring(S.start,S.end):this._textarea.value.substring(S.start),y.length>0&&this._coreService.triggerDataEvent(y,!0)}}),0)}else{this._isSendingComposition=!1;const S=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(S,!0)}}_handleAnyTextareaChanges(){const w=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const S=this._textarea.value,y=S.replace(w,"");this._dataAlreadySent=y,S.length>w.length?this._coreService.triggerDataEvent(y,!0):S.lengththis.updateCompositionElements(!0)),0)}}};o.CompositionHelper=C=f([p(2,v.IBufferService),p(3,v.IOptionsService),p(4,v.ICoreService),p(5,d.IRenderService)],C)},9806:(u,o)=>{function c(f,p,d){const v=d.getBoundingClientRect(),_=f.getComputedStyle(d),C=parseInt(_.getPropertyValue("padding-left")),w=parseInt(_.getPropertyValue("padding-top"));return[p.clientX-v.left-C,p.clientY-v.top-w]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(f,p,d,v,_,C,w,S,y){if(!C)return;const x=c(f,p,d);return x?(x[0]=Math.ceil((x[0]+(y?w/2:0))/w),x[1]=Math.ceil(x[1]/S),x[0]=Math.min(Math.max(x[0],1),v+(y?1:0)),x[1]=Math.min(Math.max(x[1],1),_),x):void 0}},9504:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const f=c(2584);function p(S,y,x,b){const E=S-d(S,x),D=y-d(y,x),N=Math.abs(E-D)-(function(R,T,j){let B=0;const z=R-d(R,j),V=T-d(T,j);for(let F=0;F=0&&Sy?"A":"B"}function _(S,y,x,b,E,D){let N=S,R=y,T="";for(;N!==x||R!==b;)N+=E?1:-1,E&&N>D.cols-1?(T+=D.buffer.translateBufferLineToString(R,!1,S,N),N=0,S=0,R++):!E&&N<0&&(T+=D.buffer.translateBufferLineToString(R,!1,0,S+1),N=D.cols-1,S=N,R--);return T+D.buffer.translateBufferLineToString(R,!1,S,N)}function C(S,y){const x=y?"O":"[";return f.C0.ESC+x+S}function w(S,y){S=Math.floor(S);let x="";for(let b=0;b0?z-d(z,V):j;const W=z,q=(function(X,K,L,M,O,U){let $;return $=p(L,M,O,U).length>0?M-d(M,O):K,X=L&&$S?"D":"C",w(Math.abs(E-S),C(N,b));N=D>y?"D":"C";const R=Math.abs(D-y);return w((function(T,j){return j.cols-T})(D>y?S:E,x)+(R-1)*x.cols+1+((D>y?E:S)-1),C(N,b))}},1296:function(u,o,c){var f=this&&this.__decorate||function(F,P,W,q){var X,K=arguments.length,L=K<3?P:q===null?q=Object.getOwnPropertyDescriptor(P,W):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(F,P,W,q);else for(var M=F.length-1;M>=0;M--)(X=F[M])&&(L=(K<3?X(L):K>3?X(P,W,L):X(P,W))||L);return K>3&&L&&Object.defineProperty(P,W,L),L},p=this&&this.__param||function(F,P){return function(W,q){P(W,q,F)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const d=c(3787),v=c(2550),_=c(2223),C=c(6171),w=c(6052),S=c(4725),y=c(8055),x=c(8460),b=c(844),E=c(2585),D="xterm-dom-renderer-owner-",N="xterm-rows",R="xterm-fg-",T="xterm-bg-",j="xterm-focus",B="xterm-selection";let z=1,V=o.DomRenderer=class extends b.Disposable{constructor(F,P,W,q,X,K,L,M,O,U,$,Q,re){super(),this._terminal=F,this._document=P,this._element=W,this._screenElement=q,this._viewportElement=X,this._helperContainer=K,this._linkifier2=L,this._charSizeService=O,this._optionsService=U,this._bufferService=$,this._coreBrowserService=Q,this._themeService=re,this._terminalClass=z++,this._rowElements=[],this._selectionRenderModel=(0,w.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new x.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(N),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(B),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((se=>this._injectCss(se)))),this._injectCss(this._themeService.colors),this._rowFactory=M.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(D+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((se=>this._handleLinkHover(se)))),this.register(this._linkifier2.onHideLinkUnderline((se=>this._handleLinkLeave(se)))),this.register((0,b.toDisposable)((()=>{this._element.classList.remove(D+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new v.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const F=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*F,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*F),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/F),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/F),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const W of this._rowElements)W.style.width=`${this.dimensions.css.canvas.width}px`,W.style.height=`${this.dimensions.css.cell.height}px`,W.style.lineHeight=`${this.dimensions.css.cell.height}px`,W.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const P=`${this._terminalSelector} .${N} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=P,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(F){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let P=`${this._terminalSelector} .${N} { color: ${F.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;P+=`${this._terminalSelector} .${N} .xterm-dim { color: ${y.color.multiplyOpacity(F.foreground,.5).css};}`,P+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const W=`blink_underline_${this._terminalClass}`,q=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;P+=`@keyframes ${W} { 50% { border-bottom-style: hidden; }}`,P+=`@keyframes ${q} { 50% { box-shadow: none; }}`,P+=`@keyframes ${X} { 0% { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css}; } 50% { background-color: inherit; color: ${F.cursor.css}; }}`,P+=`${this._terminalSelector} .${N}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${N}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${N}.${j} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block { background-color: ${F.cursor.css}; color: ${F.cursorAccent.css};}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${F.cursor.css} !important; color: ${F.cursorAccent.css} !important;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${F.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${F.cursor.css} inset;}${this._terminalSelector} .${N} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${F.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,P+=`${this._terminalSelector} .${B} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${B} div { position: absolute; background-color: ${F.selectionBackgroundOpaque.css};}${this._terminalSelector} .${B} div { position: absolute; background-color: ${F.selectionInactiveBackgroundOpaque.css};}`;for(const[K,L]of F.ansi.entries())P+=`${this._terminalSelector} .${R}${K} { color: ${L.css}; }${this._terminalSelector} .${R}${K}.xterm-dim { color: ${y.color.multiplyOpacity(L,.5).css}; }${this._terminalSelector} .${T}${K} { background-color: ${L.css}; }`;P+=`${this._terminalSelector} .${R}${_.INVERTED_DEFAULT_COLOR} { color: ${y.color.opaque(F.background).css}; }${this._terminalSelector} .${R}${_.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${y.color.multiplyOpacity(y.color.opaque(F.background),.5).css}; }${this._terminalSelector} .${T}${_.INVERTED_DEFAULT_COLOR} { background-color: ${F.foreground.css}; }`,this._themeStyleElement.textContent=P}_setDefaultSpacing(){const F=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${F}px`,this._rowFactory.defaultSpacing=F}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(F,P){for(let W=this._rowElements.length;W<=P;W++){const q=this._document.createElement("div");this._rowContainer.appendChild(q),this._rowElements.push(q)}for(;this._rowElements.length>P;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(F,P){this._refreshRowElements(F,P),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(j),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(j),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(F,P,W){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(F,P,W),this.renderRows(0,this._bufferService.rows-1),!F||!P)return;this._selectionRenderModel.update(this._terminal,F,P,W);const q=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,K=this._selectionRenderModel.viewportCappedStartRow,L=this._selectionRenderModel.viewportCappedEndRow;if(K>=this._bufferService.rows||L<0)return;const M=this._document.createDocumentFragment();if(W){const O=F[0]>P[0];M.appendChild(this._createSelectionElement(K,O?P[0]:F[0],O?F[0]:P[0],L-K+1))}else{const O=q===K?F[0]:0,U=K===X?P[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(K,O,U));const $=L-K-1;if(M.appendChild(this._createSelectionElement(K+1,0,this._bufferService.cols,$)),K!==L){const Q=X===L?P[0]:this._bufferService.cols;M.appendChild(this._createSelectionElement(L,0,Q))}}this._selectionContainer.appendChild(M)}_createSelectionElement(F,P,W,q=1){const X=this._document.createElement("div"),K=P*this.dimensions.css.cell.width;let L=this.dimensions.css.cell.width*(W-P);return K+L>this.dimensions.css.canvas.width&&(L=this.dimensions.css.canvas.width-K),X.style.height=q*this.dimensions.css.cell.height+"px",X.style.top=F*this.dimensions.css.cell.height+"px",X.style.left=`${K}px`,X.style.width=`${L}px`,X}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const F of this._rowElements)F.replaceChildren()}renderRows(F,P){const W=this._bufferService.buffer,q=W.ybase+W.y,X=Math.min(W.x,this._bufferService.cols-1),K=this._optionsService.rawOptions.cursorBlink,L=this._optionsService.rawOptions.cursorStyle,M=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=F;O<=P;O++){const U=O+W.ydisp,$=this._rowElements[O],Q=W.lines.get(U);if(!$||!Q)break;$.replaceChildren(...this._rowFactory.createRow(Q,U,U===q,L,M,X,K,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${D}${this._terminalClass}`}_handleLinkHover(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!0)}_handleLinkLeave(F){this._setCellUnderline(F.x1,F.x2,F.y1,F.y2,F.cols,!1)}_setCellUnderline(F,P,W,q,X,K){W<0&&(F=0),q<0&&(P=0);const L=this._bufferService.rows-1;W=Math.max(Math.min(W,L),0),q=Math.max(Math.min(q,L),0),X=Math.min(X,this._bufferService.cols);const M=this._bufferService.buffer,O=M.ybase+M.y,U=Math.min(M.x,X-1),$=this._optionsService.rawOptions.cursorBlink,Q=this._optionsService.rawOptions.cursorStyle,re=this._optionsService.rawOptions.cursorInactiveStyle;for(let se=W;se<=q;++se){const Z=se+M.ydisp,H=this._rowElements[se],ee=M.lines.get(Z);if(!H||!ee)break;H.replaceChildren(...this._rowFactory.createRow(ee,Z,Z===O,Q,re,U,$,this.dimensions.css.cell.width,this._widthCache,K?se===W?F:0:-1,K?(se===q?P:X)-1:-1))}}};o.DomRenderer=V=f([p(7,E.IInstantiationService),p(8,S.ICharSizeService),p(9,E.IOptionsService),p(10,E.IBufferService),p(11,S.ICoreBrowserService),p(12,S.IThemeService)],V)},3787:function(u,o,c){var f=this&&this.__decorate||function(N,R,T,j){var B,z=arguments.length,V=z<3?R:j===null?j=Object.getOwnPropertyDescriptor(R,T):j;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(N,R,T,j);else for(var F=N.length-1;F>=0;F--)(B=N[F])&&(V=(z<3?B(V):z>3?B(R,T,V):B(R,T))||V);return z>3&&V&&Object.defineProperty(R,T,V),V},p=this&&this.__param||function(N,R){return function(T,j){R(T,j,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const d=c(2223),v=c(643),_=c(511),C=c(2585),w=c(8055),S=c(4725),y=c(4269),x=c(6171),b=c(3734);let E=o.DomRendererRowFactory=class{constructor(N,R,T,j,B,z,V){this._document=N,this._characterJoinerService=R,this._optionsService=T,this._coreBrowserService=j,this._coreService=B,this._decorationService=z,this._themeService=V,this._workCell=new _.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(N,R,T){this._selectionStart=N,this._selectionEnd=R,this._columnSelectMode=T}createRow(N,R,T,j,B,z,V,F,P,W,q){const X=[],K=this._characterJoinerService.getJoinedCharacters(R),L=this._themeService.colors;let M,O=N.getNoBgTrimmedLength();T&&O0&&ye===K[0][0]){Ee=!0;const De=K.shift();we=new y.JoinedCellData(this._workCell,N.translateToString(!0,De[0],De[1]),De[1]-De[0]),Ne=De[1]-1,Ce=we.getWidth()}const ft=this._isCellInSelection(ye,R),Ct=T&&ye===z,st=fe&&ye>=W&&ye<=q;let We=!1;this._decorationService.forEachDecorationAtCell(ye,R,void 0,(De=>{We=!0}));let vt=we.getChars()||v.WHITESPACE_CELL_CHAR;if(vt===" "&&(we.isUnderline()||we.isOverline())&&(vt=" "),ne=Ce*F-P.get(vt,we.isBold(),we.isItalic()),M){if(U&&(ft&&ee||!ft&&!ee&&we.bg===Q)&&(ft&&ee&&L.selectionForeground||we.fg===re)&&we.extended.ext===se&&st===Z&&ne===H&&!Ct&&!Ee&&!We){we.isInvisible()?$+=v.WHITESPACE_CELL_CHAR:$+=vt,U++;continue}U&&(M.textContent=$),M=this._document.createElement("span"),U=0,$=""}else M=this._document.createElement("span");if(Q=we.bg,re=we.fg,se=we.extended.ext,Z=st,H=ne,ee=ft,Ee&&z>=ye&&z<=Ne&&(z=ye),!this._coreService.isCursorHidden&&Ct&&this._coreService.isCursorInitialized){if(pe.push("xterm-cursor"),this._coreBrowserService.isFocused)V&&pe.push("xterm-cursor-blink"),pe.push(j==="bar"?"xterm-cursor-bar":j==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(B)switch(B){case"outline":pe.push("xterm-cursor-outline");break;case"block":pe.push("xterm-cursor-block");break;case"bar":pe.push("xterm-cursor-bar");break;case"underline":pe.push("xterm-cursor-underline")}}if(we.isBold()&&pe.push("xterm-bold"),we.isItalic()&&pe.push("xterm-italic"),we.isDim()&&pe.push("xterm-dim"),$=we.isInvisible()?v.WHITESPACE_CELL_CHAR:we.getChars()||v.WHITESPACE_CELL_CHAR,we.isUnderline()&&(pe.push(`xterm-underline-${we.extended.underlineStyle}`),$===" "&&($=" "),!we.isUnderlineColorDefault()))if(we.isUnderlineColorRGB())M.style.textDecorationColor=`rgb(${b.AttributeData.toColorRGB(we.getUnderlineColor()).join(",")})`;else{let De=we.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&we.isBold()&&De<8&&(De+=8),M.style.textDecorationColor=L.ansi[De].css}we.isOverline()&&(pe.push("xterm-overline"),$===" "&&($=" ")),we.isStrikethrough()&&pe.push("xterm-strikethrough"),st&&(M.style.textDecoration="underline");let dt=we.getFgColor(),qe=we.getFgColorMode(),Pe=we.getBgColor(),ue=we.getBgColorMode();const _e=!!we.isInverse();if(_e){const De=dt;dt=Pe,Pe=De;const $e=qe;qe=ue,ue=$e}let ke,he,be,Re=!1;switch(this._decorationService.forEachDecorationAtCell(ye,R,void 0,(De=>{De.options.layer!=="top"&&Re||(De.backgroundColorRGB&&(ue=50331648,Pe=De.backgroundColorRGB.rgba>>8&16777215,ke=De.backgroundColorRGB),De.foregroundColorRGB&&(qe=50331648,dt=De.foregroundColorRGB.rgba>>8&16777215,he=De.foregroundColorRGB),Re=De.options.layer==="top")})),!Re&&ft&&(ke=this._coreBrowserService.isFocused?L.selectionBackgroundOpaque:L.selectionInactiveBackgroundOpaque,Pe=ke.rgba>>8&16777215,ue=50331648,Re=!0,L.selectionForeground&&(qe=50331648,dt=L.selectionForeground.rgba>>8&16777215,he=L.selectionForeground)),Re&&pe.push("xterm-decoration-top"),ue){case 16777216:case 33554432:be=L.ansi[Pe],pe.push(`xterm-bg-${Pe}`);break;case 50331648:be=w.channels.toColor(Pe>>16,Pe>>8&255,255&Pe),this._addStyle(M,`background-color:#${D((Pe>>>0).toString(16),"0",6)}`);break;default:_e?(be=L.foreground,pe.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):be=L.background}switch(ke||we.isDim()&&(ke=w.color.multiplyOpacity(be,.5)),qe){case 16777216:case 33554432:we.isBold()&&dt<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(dt+=8),this._applyMinimumContrast(M,be,L.ansi[dt],we,ke,void 0)||pe.push(`xterm-fg-${dt}`);break;case 50331648:const De=w.channels.toColor(dt>>16&255,dt>>8&255,255&dt);this._applyMinimumContrast(M,be,De,we,ke,he)||this._addStyle(M,`color:#${D(dt.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(M,be,L.foreground,we,ke,he)||_e&&pe.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}pe.length&&(M.className=pe.join(" "),pe.length=0),Ct||Ee||We?M.textContent=$:U++,ne!==this.defaultSpacing&&(M.style.letterSpacing=`${ne}px`),X.push(M),ye=Ne}return M&&U&&(M.textContent=$),X}_applyMinimumContrast(N,R,T,j,B,z){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,x.treatGlyphAsBackgroundColor)(j.getCode()))return!1;const V=this._getContrastCache(j);let F;if(B||z||(F=V.getColor(R.rgba,T.rgba)),F===void 0){const P=this._optionsService.rawOptions.minimumContrastRatio/(j.isDim()?2:1);F=w.color.ensureContrastRatio(B||R,z||T,P),V.setColor((B||R).rgba,(z||T).rgba,F??null)}return!!F&&(this._addStyle(N,`color:${F.css}`),!0)}_getContrastCache(N){return N.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(N,R){N.setAttribute("style",`${N.getAttribute("style")||""}${R};`)}_isCellInSelection(N,R){const T=this._selectionStart,j=this._selectionEnd;return!(!T||!j)&&(this._columnSelectMode?T[0]<=j[0]?N>=T[0]&&R>=T[1]&&N=T[1]&&N>=j[0]&&R<=j[1]:R>T[1]&&R=T[0]&&N=T[0])}};function D(N,R,T){for(;N.length{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const p=c.createElement("span");p.classList.add("xterm-char-measure-element");const d=c.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const v=c.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontStyle="italic";const _=c.createElement("span");_.classList.add("xterm-char-measure-element"),_.style.fontWeight="bold",_.style.fontStyle="italic",this._measureElements=[p,d,v,_],this._container.appendChild(p),this._container.appendChild(d),this._container.appendChild(v),this._container.appendChild(_),f.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(c,f,p,d){c===this._font&&f===this._fontSize&&p===this._weight&&d===this._weightBold||(this._font=c,this._fontSize=f,this._weight=p,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(c,f,p){let d=0;if(!f&&!p&&c.length===1&&(d=c.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const C=this._measure(c,0);return C>0&&(this._flat[d]=C),C}let v=c;f&&(v+="B"),p&&(v+="I");let _=this._holey.get(v);if(_===void 0){let C=0;f&&(C|=1),p&&(C|=2),_=this._measure(c,C),_>0&&this._holey.set(v,_)}return _}_measure(c,f){const p=this._measureElements[f];return p.textContent=c.repeat(32),p.offsetWidth/32}}},2223:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const f=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(u,o)=>{function c(p){return 57508<=p&&p<=57558}function f(p){return p>=128512&&p<=128591||p>=127744&&p<=128511||p>=128640&&p<=128767||p>=9728&&p<=9983||p>=9984&&p<=10175||p>=65024&&p<=65039||p>=129280&&p<=129535||p>=127462&&p<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(p){if(!p)throw new Error("value must not be falsy");return p},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(p){return 57520<=p&&p<=57527},o.isEmoji=f,o.allowRescaling=function(p,d,v,_){return d===1&&v>Math.ceil(1.5*_)&&p!==void 0&&p>255&&!f(p)&&!c(p)&&!(function(C){return 57344<=C&&C<=63743})(p)},o.treatGlyphAsBackgroundColor=function(p){return c(p)||(function(d){return 9472<=d&&d<=9631})(p)},o.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},o.computeNextVariantOffset=function(p,d,v=0){return(p-(2*Math.round(d)-v))%(2*Math.round(d))}},6052:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(p,d,v,_=!1){if(this.selectionStart=d,this.selectionEnd=v,!d||!v||d[0]===v[0]&&d[1]===v[1])return void this.clear();const C=p.buffers.active.ydisp,w=d[1]-C,S=v[1]-C,y=Math.max(w,0),x=Math.min(S,p.rows-1);y>=p.rows||x<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=_,this.viewportStartRow=w,this.viewportEndRow=S,this.viewportCappedStartRow=y,this.viewportCappedEndRow=x,this.startCol=d[0],this.endCol=v[0])}isCellSelected(p,d,v){return!!this.hasSelection&&(v-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&v>=this.viewportCappedStartRow&&d=this.viewportCappedStartRow&&d>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v=this.startCol&&d=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,f=this.selectionEnd;return!(!c||!f)&&(c[1]>f[1]||c[1]===f[1]&&c[0]>f[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(u,o,c){var f=this&&this.__decorate||function(x,b,E,D){var N,R=arguments.length,T=R<3?b:D===null?D=Object.getOwnPropertyDescriptor(b,E):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,b,E,D);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(R<3?N(T):R>3?N(b,E,T):N(b,E))||T);return R>3&&T&&Object.defineProperty(b,E,T),T},p=this&&this.__param||function(x,b){return function(E,D){b(E,D,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const d=c(2585),v=c(8460),_=c(844);let C=o.CharSizeService=class extends _.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(x,b,E){super(),this._optionsService=E,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new y(this._optionsService))}catch{this._measureStrategy=this.register(new S(x,b,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const x=this._measureStrategy.measure();x.width===this.width&&x.height===this.height||(this.width=x.width,this.height=x.height,this._onCharSizeChange.fire())}};o.CharSizeService=C=f([p(2,d.IOptionsService)],C);class w extends _.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(b,E){b!==void 0&&b>0&&E!==void 0&&E>0&&(this._result.width=b,this._result.height=E)}}class S extends w{constructor(b,E,D){super(),this._document=b,this._parentElement=E,this._optionsService=D,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class y extends w{constructor(b){super(),this._optionsService=b,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const E=this._ctx.measureText("W");if(!("width"in E&&"fontBoundingBoxAscent"in E&&"fontBoundingBoxDescent"in E))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const b=this._ctx.measureText("W");return this._validateAndSet(b.width,b.fontBoundingBoxAscent+b.fontBoundingBoxDescent),this._result}}},4269:function(u,o,c){var f=this&&this.__decorate||function(y,x,b,E){var D,N=arguments.length,R=N<3?x:E===null?E=Object.getOwnPropertyDescriptor(x,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,x,b,E);else for(var T=y.length-1;T>=0;T--)(D=y[T])&&(R=(N<3?D(R):N>3?D(x,b,R):D(x,b))||R);return N>3&&R&&Object.defineProperty(x,b,R),R},p=this&&this.__param||function(y,x){return function(b,E){x(b,E,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=c(3734),v=c(643),_=c(511),C=c(2585);class w extends d.AttributeData{constructor(x,b,E){super(),this.content=0,this.combinedData="",this.fg=x.fg,this.bg=x.bg,this.combinedData=b,this._width=E}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(x){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=w;let S=o.CharacterJoinerService=class OC{constructor(x){this._bufferService=x,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(x){const b={id:this._nextCharacterJoinerId++,handler:x};return this._characterJoiners.push(b),b.id}deregister(x){for(let b=0;b1){const V=this._getJoinedRanges(D,T,R,b,N);for(let F=0;F1){const z=this._getJoinedRanges(D,T,R,b,N);for(let V=0;V{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const f=c(844),p=c(8460),d=c(3656);class v extends f.Disposable{constructor(w,S,y){super(),this._textarea=w,this._window=S,this.mainDocument=y,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new _(this._window),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new p.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((x=>this._screenDprMonitor.setWindow(x)))),this.register((0,p.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(w){this._window!==w&&(this._window=w,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}o.CoreBrowserService=v;class _ extends f.Disposable{constructor(w){super(),this._parentWindow=w,this._windowResizeListener=this.register(new f.MutableDisposable),this._onDprChange=this.register(new p.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,f.toDisposable)((()=>this.clearListener())))}setWindow(w){this._parentWindow=w,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var w;this._outerListener&&((w=this._resolutionMediaMatchList)==null||w.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const f=c(844);class p extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(v){return this.linkProviders.push(v),{dispose:()=>{const _=this.linkProviders.indexOf(v);_!==-1&&this.linkProviders.splice(_,1)}}}}o.LinkProviderService=p},8934:function(u,o,c){var f=this&&this.__decorate||function(C,w,S,y){var x,b=arguments.length,E=b<3?w:y===null?y=Object.getOwnPropertyDescriptor(w,S):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(C,w,S,y);else for(var D=C.length-1;D>=0;D--)(x=C[D])&&(E=(b<3?x(E):b>3?x(w,S,E):x(w,S))||E);return b>3&&E&&Object.defineProperty(w,S,E),E},p=this&&this.__param||function(C,w){return function(S,y){w(S,y,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const d=c(4725),v=c(9806);let _=o.MouseService=class{constructor(C,w){this._renderService=C,this._charSizeService=w}getCoords(C,w,S,y,x){return(0,v.getCoords)(window,C,w,S,y,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,x)}getMouseReportCoords(C,w){const S=(0,v.getCoordsRelativeToElement)(window,C,w);if(this._charSizeService.hasValidSize)return S[0]=Math.min(Math.max(S[0],0),this._renderService.dimensions.css.canvas.width-1),S[1]=Math.min(Math.max(S[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(S[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(S[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(S[0]),y:Math.floor(S[1])}}};o.MouseService=_=f([p(0,d.IRenderService),p(1,d.ICharSizeService)],_)},3230:function(u,o,c){var f=this&&this.__decorate||function(x,b,E,D){var N,R=arguments.length,T=R<3?b:D===null?D=Object.getOwnPropertyDescriptor(b,E):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,b,E,D);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(R<3?N(T):R>3?N(b,E,T):N(b,E))||T);return R>3&&T&&Object.defineProperty(b,E,T),T},p=this&&this.__param||function(x,b){return function(E,D){b(E,D,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const d=c(6193),v=c(4725),_=c(8460),C=c(844),w=c(7226),S=c(2585);let y=o.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(x,b,E,D,N,R,T,j){super(),this._rowCount=x,this._charSizeService=D,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new w.DebouncedIdleTask,this._observerDisposable=this.register(new C.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new _.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new _.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new _.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new _.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer(((B,z)=>this._renderRows(B,z)),T),this.register(this._renderDebouncer),this.register(T.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(R.onResize((()=>this._fullRefresh()))),this.register(R.buffers.onBufferActivate((()=>{var B;return(B=this._renderer.value)==null?void 0:B.clear()}))),this.register(E.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(N.onDecorationRegistered((()=>this._fullRefresh()))),this.register(N.onDecorationRemoved((()=>this._fullRefresh()))),this.register(E.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(R.cols,R.rows),this._fullRefresh()}))),this.register(E.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(R.buffer.y,R.buffer.y,!0)))),this.register(j.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(T.window,b),this.register(T.onWindowChange((B=>this._registerIntersectionObserver(B,b))))}_registerIntersectionObserver(x,b){if("IntersectionObserver"in x){const E=new x.IntersectionObserver((D=>this._handleIntersectionChange(D[D.length-1])),{threshold:0});E.observe(b),this._observerDisposable.value=(0,C.toDisposable)((()=>E.disconnect()))}}_handleIntersectionChange(x){this._isPaused=x.isIntersecting===void 0?x.intersectionRatio===0:!x.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(x,b,E=!1){this._isPaused?this._needsFullRefresh=!0:(E||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(x,b,this._rowCount))}_renderRows(x,b){this._renderer.value&&(x=Math.min(x,this._rowCount-1),b=Math.min(b,this._rowCount-1),this._renderer.value.renderRows(x,b),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:x,end:b}),this._onRender.fire({start:x,end:b}),this._isNextRenderRedrawOnly=!0)}resize(x,b){this._rowCount=b,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(x){this._renderer.value=x,this._renderer.value&&(this._renderer.value.onRequestRedraw((b=>this.refreshRows(b.start,b.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(x){return this._renderDebouncer.addRefreshCallback(x)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var x,b;this._renderer.value&&((b=(x=this._renderer.value).clearTextureAtlas)==null||b.call(x),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(x,b){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var E;return(E=this._renderer.value)==null?void 0:E.handleResize(x,b)})):this._renderer.value.handleResize(x,b),this._fullRefresh())}handleCharSizeChanged(){var x;(x=this._renderer.value)==null||x.handleCharSizeChanged()}handleBlur(){var x;(x=this._renderer.value)==null||x.handleBlur()}handleFocus(){var x;(x=this._renderer.value)==null||x.handleFocus()}handleSelectionChanged(x,b,E){var D;this._selectionState.start=x,this._selectionState.end=b,this._selectionState.columnSelectMode=E,(D=this._renderer.value)==null||D.handleSelectionChanged(x,b,E)}handleCursorMove(){var x;(x=this._renderer.value)==null||x.handleCursorMove()}clear(){var x;(x=this._renderer.value)==null||x.clear()}};o.RenderService=y=f([p(2,S.IOptionsService),p(3,v.ICharSizeService),p(4,S.IDecorationService),p(5,S.IBufferService),p(6,v.ICoreBrowserService),p(7,v.IThemeService)],y)},9312:function(u,o,c){var f=this&&this.__decorate||function(T,j,B,z){var V,F=arguments.length,P=F<3?j:z===null?z=Object.getOwnPropertyDescriptor(j,B):z;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(T,j,B,z);else for(var W=T.length-1;W>=0;W--)(V=T[W])&&(P=(F<3?V(P):F>3?V(j,B,P):V(j,B))||P);return F>3&&P&&Object.defineProperty(j,B,P),P},p=this&&this.__param||function(T,j){return function(B,z){j(B,z,T)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const d=c(9806),v=c(9504),_=c(456),C=c(4725),w=c(8460),S=c(844),y=c(6114),x=c(4841),b=c(511),E=c(2585),D=" ",N=new RegExp(D,"g");let R=o.SelectionService=class extends S.Disposable{constructor(T,j,B,z,V,F,P,W,q){super(),this._element=T,this._screenElement=j,this._linkifier=B,this._bufferService=z,this._coreService=V,this._mouseService=F,this._optionsService=P,this._renderService=W,this._coreBrowserService=q,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new b.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new w.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new w.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new w.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new w.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new _.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,S.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;return!(!T||!j||T[0]===j[0]&&T[1]===j[1])}get selectionText(){const T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd;if(!T||!j)return"";const B=this._bufferService.buffer,z=[];if(this._activeSelectionMode===3){if(T[0]===j[0])return"";const V=T[0]V.replace(N," "))).join(y.isWindows?`\r `:` -`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(T){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),y.isLinux&&T&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(T){const j=this._getMouseBufferCoords(T),B=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!!(B&&z&&j)&&this._areCoordsInSelection(j,B,z)}isCellInSelection(T,j){const B=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!(!B||!z)&&this._areCoordsInSelection([T,j],B,z)}_areCoordsInSelection(T,j,B){return T[1]>j[1]&&T[1]=j[0]&&T[0]=j[0]}_selectWordAtCursor(T,j){var V,F;const B=(F=(V=this._linkifier.currentLink)==null?void 0:V.link)==null?void 0:F.range;if(B)return this._model.selectionStart=[B.start.x-1,B.start.y-1],this._model.selectionStartLength=(0,x.getRangeLength)(B,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const z=this._getMouseBufferCoords(T);return!!z&&(this._selectWordAt(z,j),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(T,j){this._model.clearSelection(),T=Math.max(T,0),j=Math.min(j,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,T],this._model.selectionEnd=[this._bufferService.cols,j],this.refresh(),this._onSelectionChange.fire()}_handleTrim(T){this._model.handleTrim(T)&&this.refresh()}_getMouseBufferCoords(T){const j=this._mouseService.getCoords(T,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(j)return j[0]--,j[1]--,j[1]+=this._bufferService.buffer.ydisp,j}_getMouseEventScrollAmount(T){let j=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,T,this._screenElement)[1];const B=this._renderService.dimensions.css.canvas.height;return j>=0&&j<=B?0:(j>B&&(j-=B),j=Math.min(Math.max(j,-50),50),j/=50,j/Math.abs(j)+Math.round(14*j))}shouldForceSelection(T){return y.isMac?T.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:T.shiftKey}handleMouseDown(T){if(this._mouseDownTimeStamp=T.timeStamp,(T.button!==2||!this.hasSelection)&&T.button===0){if(!this._enabled){if(!this.shouldForceSelection(T))return;T.stopPropagation()}T.preventDefault(),this._dragScrollAmount=0,this._enabled&&T.shiftKey?this._handleIncrementalClick(T):T.detail===1?this._handleSingleClick(T):T.detail===2?this._handleDoubleClick(T):T.detail===3&&this._handleTripleClick(T),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(T){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(T))}_handleSingleClick(T){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(T)?3:0,this._model.selectionStart=this._getMouseBufferCoords(T),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const j=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);j&&j.length!==this._model.selectionStart[0]&&j.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(T){this._selectWordAtCursor(T,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(T){const j=this._getMouseBufferCoords(T);j&&(this._activeSelectionMode=2,this._selectLineAt(j[1]))}shouldColumnSelect(T){return T.altKey&&!(y.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(T){if(T.stopImmediatePropagation(),!this._model.selectionStart)return;const j=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(T),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const B=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(T.ydisp+this._bufferService.rows,T.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=T.ydisp),this.refresh()}}_handleMouseUp(T){const j=T.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&j<500&&T.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const B=this._mouseService.getCoords(T,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(B&&B[0]!==void 0&&B[1]!==void 0){const z=(0,v.moveToCellSequence)(B[0]-1,B[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd,B=!(!T||!j||T[0]===j[0]&&T[1]===j[1]);B?T&&j&&(this._oldSelectionStart&&this._oldSelectionEnd&&T[0]===this._oldSelectionStart[0]&&T[1]===this._oldSelectionStart[1]&&j[0]===this._oldSelectionEnd[0]&&j[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(T,j,B)):this._oldHasSelection&&this._fireOnSelectionChange(T,j,B)}_fireOnSelectionChange(T,j,B){this._oldSelectionStart=T,this._oldSelectionEnd=j,this._oldHasSelection=B,this._onSelectionChange.fire()}_handleBufferActivate(T){this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim((j=>this._handleTrim(j)))}_convertViewportColToCharacterIndex(T,j){let B=j;for(let z=0;j>=z;z++){const V=T.loadCell(z,this._workCell).getChars().length;this._workCell.getWidth()===0?B--:V>1&&j!==z&&(B+=V-1)}return B}setSelection(T,j,B){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,j],this._model.selectionStartLength=B,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(T){this._isClickInSelection(T)||(this._selectWordAtCursor(T,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(T,j,B=!0,z=!0){if(T[0]>=this._bufferService.cols)return;const V=this._bufferService.buffer,F=V.lines.get(T[1]);if(!F)return;const P=V.translateBufferLineToString(T[1],!1);let Y=this._convertViewportColToCharacterIndex(F,T[0]),q=Y;const X=T[0]-Y;let K=0,L=0,M=0,O=0;if(P.charAt(Y)===" "){for(;Y>0&&P.charAt(Y-1)===" ";)Y--;for(;q1&&(O+=se-1,q+=se-1);Q>0&&Y>0&&!this._isCharWordSeparator(F.loadCell(Q-1,this._workCell));){F.loadCell(Q-1,this._workCell);const Z=this._workCell.getChars().length;this._workCell.getWidth()===0?(K++,Q--):Z>1&&(M+=Z-1,Y-=Z-1),Y--,Q--}for(;re1&&(O+=Z-1,q+=Z-1),q++,re++}}q++;let U=Y+X-K+M,$=Math.min(this._bufferService.cols,q-Y+K+L-M-O);if(j||P.slice(Y,q).trim()!==""){if(B&&U===0&&F.getCodePoint(0)!==32){const Q=V.lines.get(T[1]-1);if(Q&&F.isWrapped&&Q.getCodePoint(this._bufferService.cols-1)!==32){const re=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(re){const se=this._bufferService.cols-re.start;U-=se,$+=se}}}if(z&&U+$===this._bufferService.cols&&F.getCodePoint(this._bufferService.cols-1)!==32){const Q=V.lines.get(T[1]+1);if(Q!=null&&Q.isWrapped&&Q.getCodePoint(0)!==32){const re=this._getWordAt([0,T[1]+1],!1,!1,!0);re&&($+=re.length)}}return{start:U,length:$}}}_selectWordAt(T,j){const B=this._getWordAt(T,j);if(B){for(;B.start<0;)B.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[B.start,T[1]],this._model.selectionStartLength=B.length}}_selectToWordAt(T){const j=this._getWordAt(T,!0);if(j){let B=T[1];for(;j.start<0;)j.start+=this._bufferService.cols,B--;if(!this._model.areSelectionValuesReversed())for(;j.start+j.length>this._bufferService.cols;)j.length-=this._bufferService.cols,B++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?j.start:j.start+j.length,B]}}_isCharWordSeparator(T){return T.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(T.getChars())>=0}_selectLineAt(T){const j=this._bufferService.buffer.getWrappedRangeForLine(T),B={start:{x:0,y:j.first},end:{x:this._bufferService.cols-1,y:j.last}};this._model.selectionStart=[0,j.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,x.getRangeLength)(B,this._bufferService.cols)}};o.SelectionService=D=f([p(3,E.IBufferService),p(4,E.ICoreService),p(5,C.IMouseService),p(6,E.IOptionsService),p(7,C.IRenderService),p(8,C.ICoreBrowserService)],D)},4725:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const f=c(8343);o.ICharSizeService=(0,f.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),o.IMouseService=(0,f.createDecorator)("MouseService"),o.IRenderService=(0,f.createDecorator)("RenderService"),o.ISelectionService=(0,f.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,f.createDecorator)("ThemeService"),o.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(u,o,c){var f=this&&this.__decorate||function(D,T,j,B){var z,V=arguments.length,F=V<3?T:B===null?B=Object.getOwnPropertyDescriptor(T,j):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(D,T,j,B);else for(var P=D.length-1;P>=0;P--)(z=D[P])&&(F=(V<3?z(F):V>3?z(T,j,F):z(T,j))||F);return V>3&&F&&Object.defineProperty(T,j,F),F},p=this&&this.__param||function(D,T){return function(j,B){T(j,B,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=c(7239),v=c(8055),_=c(8460),C=c(844),w=c(2585),S=v.css.toColor("#ffffff"),y=v.css.toColor("#000000"),x=v.css.toColor("#ffffff"),b=v.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],T=[0,95,135,175,215,255];for(let j=0;j<216;j++){const B=T[j/36%6|0],z=T[j/6%6|0],V=T[j%6];D.push({css:v.channels.toCss(B,z,V),rgba:v.channels.toRgba(B,z,V)})}for(let j=0;j<24;j++){const B=8+10*j;D.push({css:v.channels.toCss(B,B,B),rgba:v.channels.toRgba(B,B,B)})}return D})());let R=o.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:S,background:y,cursor:x,cursorAccent:b,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:v.color.blend(y,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:v.color.blend(y,E),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const T=this._colors;if(T.foreground=N(D.foreground,S),T.background=N(D.background,y),T.cursor=N(D.cursor,x),T.cursorAccent=N(D.cursorAccent,b),T.selectionBackgroundTransparent=N(D.selectionBackground,E),T.selectionBackgroundOpaque=v.color.blend(T.background,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundTransparent=N(D.selectionInactiveBackground,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundOpaque=v.color.blend(T.background,T.selectionInactiveBackgroundTransparent),T.selectionForeground=D.selectionForeground?N(D.selectionForeground,v.NULL_COLOR):void 0,T.selectionForeground===v.NULL_COLOR&&(T.selectionForeground=void 0),v.color.isOpaque(T.selectionBackgroundTransparent)&&(T.selectionBackgroundTransparent=v.color.opacity(T.selectionBackgroundTransparent,.3)),v.color.isOpaque(T.selectionInactiveBackgroundTransparent)&&(T.selectionInactiveBackgroundTransparent=v.color.opacity(T.selectionInactiveBackgroundTransparent,.3)),T.ansi=o.DEFAULT_ANSI_COLORS.slice(),T.ansi[0]=N(D.black,o.DEFAULT_ANSI_COLORS[0]),T.ansi[1]=N(D.red,o.DEFAULT_ANSI_COLORS[1]),T.ansi[2]=N(D.green,o.DEFAULT_ANSI_COLORS[2]),T.ansi[3]=N(D.yellow,o.DEFAULT_ANSI_COLORS[3]),T.ansi[4]=N(D.blue,o.DEFAULT_ANSI_COLORS[4]),T.ansi[5]=N(D.magenta,o.DEFAULT_ANSI_COLORS[5]),T.ansi[6]=N(D.cyan,o.DEFAULT_ANSI_COLORS[6]),T.ansi[7]=N(D.white,o.DEFAULT_ANSI_COLORS[7]),T.ansi[8]=N(D.brightBlack,o.DEFAULT_ANSI_COLORS[8]),T.ansi[9]=N(D.brightRed,o.DEFAULT_ANSI_COLORS[9]),T.ansi[10]=N(D.brightGreen,o.DEFAULT_ANSI_COLORS[10]),T.ansi[11]=N(D.brightYellow,o.DEFAULT_ANSI_COLORS[11]),T.ansi[12]=N(D.brightBlue,o.DEFAULT_ANSI_COLORS[12]),T.ansi[13]=N(D.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),T.ansi[14]=N(D.brightCyan,o.DEFAULT_ANSI_COLORS[14]),T.ansi[15]=N(D.brightWhite,o.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const j=Math.min(T.ansi.length-16,D.extendedAnsi.length);for(let B=0;B{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const f=c(8460),p=c(844);class d extends p.Disposable{constructor(_){super(),this._maxLength=_,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(_){if(this._maxLength===_)return;const C=new Array(_);for(let w=0;wthis._length)for(let C=this._length;C<_;C++)this._array[C]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,C){this._array[this._getCyclicIndex(_)]=C}push(_){this._array[this._getCyclicIndex(this._length)]=_,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(_,C,...w){if(C){for(let S=_;S=_;S--)this._array[this._getCyclicIndex(S+w.length)]=this._array[this._getCyclicIndex(S)];for(let S=0;Sthis._maxLength){const S=this._length+w.length-this._maxLength;this._startIndex+=S,this._length=this._maxLength,this.onTrimEmitter.fire(S)}else this._length+=w.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,C,w){if(!(C<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let y=C-1;y>=0;y--)this.set(_+y+w,this.get(_+y));const S=_+C+w-this._length;if(S>0)for(this._length+=S;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let S=0;S{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(f,p=5){if(typeof f!="object")return f;const d=Array.isArray(f)?[]:{};for(const v in f)d[v]=p<=1?f[v]:f[v]&&c(f[v],p-1);return d}},8055:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,f=0,p=0,d=0;var v,_,C,w,S;function y(b){const E=b.toString(16);return E.length<2?"0"+E:E}function x(b,E){return b>>0},b.toColor=function(E,R,N,D){return{css:b.toCss(E,R,N,D),rgba:b.toRgba(E,R,N,D)}}})(v||(o.channels=v={})),(function(b){function E(R,N){return d=Math.round(255*N),[c,f,p]=S.toChannels(R.rgba),{css:v.toCss(c,f,p,d),rgba:v.toRgba(c,f,p,d)}}b.blend=function(R,N){if(d=(255&N.rgba)/255,d===1)return{css:N.css,rgba:N.rgba};const D=N.rgba>>24&255,T=N.rgba>>16&255,j=N.rgba>>8&255,B=R.rgba>>24&255,z=R.rgba>>16&255,V=R.rgba>>8&255;return c=B+Math.round((D-B)*d),f=z+Math.round((T-z)*d),p=V+Math.round((j-V)*d),{css:v.toCss(c,f,p),rgba:v.toRgba(c,f,p)}},b.isOpaque=function(R){return(255&R.rgba)==255},b.ensureContrastRatio=function(R,N,D){const T=S.ensureContrastRatio(R.rgba,N.rgba,D);if(T)return v.toColor(T>>24&255,T>>16&255,T>>8&255)},b.opaque=function(R){const N=(255|R.rgba)>>>0;return[c,f,p]=S.toChannels(N),{css:v.toCss(c,f,p),rgba:N}},b.opacity=E,b.multiplyOpacity=function(R,N){return d=255&R.rgba,E(R,d*N/255)},b.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(_||(o.color=_={})),(function(b){let E,R;try{const N=document.createElement("canvas");N.width=1,N.height=1;const D=N.getContext("2d",{willReadFrequently:!0});D&&(E=D,E.globalCompositeOperation="copy",R=E.createLinearGradient(0,0,1,1))}catch{}b.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return c=parseInt(N.slice(1,2).repeat(2),16),f=parseInt(N.slice(2,3).repeat(2),16),p=parseInt(N.slice(3,4).repeat(2),16),v.toColor(c,f,p);case 5:return c=parseInt(N.slice(1,2).repeat(2),16),f=parseInt(N.slice(2,3).repeat(2),16),p=parseInt(N.slice(3,4).repeat(2),16),d=parseInt(N.slice(4,5).repeat(2),16),v.toColor(c,f,p,d);case 7:return{css:N,rgba:(parseInt(N.slice(1),16)<<8|255)>>>0};case 9:return{css:N,rgba:parseInt(N.slice(1),16)>>>0}}const D=N.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return c=parseInt(D[1]),f=parseInt(D[2]),p=parseInt(D[3]),d=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),v.toColor(c,f,p,d);if(!E||!R)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=R,E.fillStyle=N,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[c,f,p,d]=E.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:v.toRgba(c,f,p,d),css:N}}})(C||(o.css=C={})),(function(b){function E(R,N,D){const T=R/255,j=N/255,B=D/255;return .2126*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.7152*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.0722*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))}b.relativeLuminance=function(R){return E(R>>16&255,R>>8&255,255&R)},b.relativeLuminance2=E})(w||(o.rgb=w={})),(function(b){function E(N,D,T){const j=N>>24&255,B=N>>16&255,z=N>>8&255;let V=D>>24&255,F=D>>16&255,P=D>>8&255,Y=x(w.relativeLuminance2(V,F,P),w.relativeLuminance2(j,B,z));for(;Y0||F>0||P>0);)V-=Math.max(0,Math.ceil(.1*V)),F-=Math.max(0,Math.ceil(.1*F)),P-=Math.max(0,Math.ceil(.1*P)),Y=x(w.relativeLuminance2(V,F,P),w.relativeLuminance2(j,B,z));return(V<<24|F<<16|P<<8|255)>>>0}function R(N,D,T){const j=N>>24&255,B=N>>16&255,z=N>>8&255;let V=D>>24&255,F=D>>16&255,P=D>>8&255,Y=x(w.relativeLuminance2(V,F,P),w.relativeLuminance2(j,B,z));for(;Y>>0}b.blend=function(N,D){if(d=(255&D)/255,d===1)return D;const T=D>>24&255,j=D>>16&255,B=D>>8&255,z=N>>24&255,V=N>>16&255,F=N>>8&255;return c=z+Math.round((T-z)*d),f=V+Math.round((j-V)*d),p=F+Math.round((B-F)*d),v.toRgba(c,f,p)},b.ensureContrastRatio=function(N,D,T){const j=w.relativeLuminance(N>>8),B=w.relativeLuminance(D>>8);if(x(j,B)>8));if(Px(j,w.relativeLuminance(Y>>8))?F:Y}return F}const z=R(N,D,T),V=x(j,w.relativeLuminance(z>>8));if(Vx(j,w.relativeLuminance(F>>8))?z:F}return z}},b.reduceLuminance=E,b.increaseLuminance=R,b.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(S||(o.rgba=S={})),o.toPaddedHex=y,o.contrastRatio=x},8969:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const f=c(844),p=c(2585),d=c(4348),v=c(7866),_=c(744),C=c(7302),w=c(6975),S=c(8460),y=c(1753),x=c(1480),b=c(7994),E=c(9282),R=c(5435),N=c(5981),D=c(2660);let T=!1;class j extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new S.EventEmitter),this._onScroll.event((z=>{var V;(V=this._onScrollApi)==null||V.fire(z.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(z){for(const V in z)this.optionsService.options[V]=z[V]}constructor(z){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new S.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new S.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new S.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new S.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new S.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new S.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new C.OptionsService(z)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(v.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(y.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(x.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(b.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new R.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,S.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,S.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,S.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,S.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((V=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((V=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new N.WriteBuffer(((V,F)=>this._inputHandler.parse(V,F)))),this.register((0,S.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(z,V){this._writeBuffer.write(z,V)}writeSync(z,V){this._logService.logLevel<=p.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync(z,V)}input(z,V=!0){this.coreService.triggerDataEvent(z,V)}resize(z,V){isNaN(z)||isNaN(V)||(z=Math.max(z,_.MINIMUM_COLS),V=Math.max(V,_.MINIMUM_ROWS),this._bufferService.resize(z,V))}scroll(z,V=!1){this._bufferService.scroll(z,V)}scrollLines(z,V,F){this._bufferService.scrollLines(z,V,F)}scrollPages(z){this.scrollLines(z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(z){const V=z-this._bufferService.buffer.ydisp;V!==0&&this.scrollLines(V)}registerEscHandler(z,V){return this._inputHandler.registerEscHandler(z,V)}registerDcsHandler(z,V){return this._inputHandler.registerDcsHandler(z,V)}registerCsiHandler(z,V){return this._inputHandler.registerCsiHandler(z,V)}registerOscHandler(z,V){return this._inputHandler.registerOscHandler(z,V)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let z=!1;const V=this.optionsService.rawOptions.windowsPty;V&&V.buildNumber!==void 0&&V.buildNumber!==void 0?z=V.backend==="conpty"&&V.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(z=!0),z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const z=[];z.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),z.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)((()=>{for(const V of z)V.dispose()}))}}}o.CoreTerminal=j},8460:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let f=0;ff.fire(p)))},o.runAndSubscribe=function(c,f){return f(void 0),c((p=>f(p)))}},5435:function(u,o,c){var f=this&&this.__decorate||function(K,L,M,O){var U,$=arguments.length,Q=$<3?L:O===null?O=Object.getOwnPropertyDescriptor(L,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(K,L,M,O);else for(var re=K.length-1;re>=0;re--)(U=K[re])&&(Q=($<3?U(Q):$>3?U(L,M,Q):U(L,M))||Q);return $>3&&Q&&Object.defineProperty(L,M,Q),Q},p=this&&this.__param||function(K,L){return function(M,O){L(M,O,K)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=c(2584),v=c(7116),_=c(2015),C=c(844),w=c(482),S=c(8437),y=c(8460),x=c(643),b=c(511),E=c(3734),R=c(2585),N=c(1480),D=c(6242),T=c(6351),j=c(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},z=131072;function V(K,L){if(K>24)return L.setWinLines||!1;switch(K){case 1:return!!L.restoreWin;case 2:return!!L.minimizeWin;case 3:return!!L.setWinPosition;case 4:return!!L.setWinSizePixels;case 5:return!!L.raiseWin;case 6:return!!L.lowerWin;case 7:return!!L.refreshWin;case 8:return!!L.setWinSizeChars;case 9:return!!L.maximizeWin;case 10:return!!L.fullscreenWin;case 11:return!!L.getWinState;case 13:return!!L.getWinPosition;case 14:return!!L.getWinSizePixels;case 15:return!!L.getScreenSizePixels;case 16:return!!L.getCellSizePixels;case 18:return!!L.getWinSizeChars;case 19:return!!L.getScreenSizeChars;case 20:return!!L.getIconTitle;case 21:return!!L.getWinTitle;case 22:return!!L.pushTitle;case 23:return!!L.popTitle;case 24:return!!L.setWinLines}return!1}var F;(function(K){K[K.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",K[K.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(F||(o.WindowsOptionsReportType=F={}));let P=0;class Y extends C.Disposable{getAttrData(){return this._curAttrData}constructor(L,M,O,U,$,Q,re,se,Z=new _.EscapeSequenceParser){super(),this._bufferService=L,this._charsetService=M,this._coreService=O,this._logService=U,this._optionsService=$,this._oscLinkService=Q,this._coreMouseService=re,this._unicodeService=se,this._parser=Z,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new b.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=S.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=S.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new y.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new y.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new y.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new y.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new y.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new y.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new y.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new y.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new y.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new y.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new y.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new y.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new q(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((H=>this._activeBuffer=H.activeBuffer))),this._parser.setCsiHandlerFallback(((H,ee)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(H),params:ee.toArray()})})),this._parser.setEscHandlerFallback((H=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(H)})})),this._parser.setExecuteHandlerFallback((H=>{this._logService.debug("Unknown EXECUTE code: ",{code:H})})),this._parser.setOscHandlerFallback(((H,ee,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:H,action:ee,data:ne})})),this._parser.setDcsHandlerFallback(((H,ee,ne)=>{ee==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(H),action:ee,payload:ne})})),this._parser.setPrintHandler(((H,ee,ne)=>this.print(H,ee,ne))),this._parser.registerCsiHandler({final:"@"},(H=>this.insertChars(H))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(H=>this.scrollLeft(H))),this._parser.registerCsiHandler({final:"A"},(H=>this.cursorUp(H))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(H=>this.scrollRight(H))),this._parser.registerCsiHandler({final:"B"},(H=>this.cursorDown(H))),this._parser.registerCsiHandler({final:"C"},(H=>this.cursorForward(H))),this._parser.registerCsiHandler({final:"D"},(H=>this.cursorBackward(H))),this._parser.registerCsiHandler({final:"E"},(H=>this.cursorNextLine(H))),this._parser.registerCsiHandler({final:"F"},(H=>this.cursorPrecedingLine(H))),this._parser.registerCsiHandler({final:"G"},(H=>this.cursorCharAbsolute(H))),this._parser.registerCsiHandler({final:"H"},(H=>this.cursorPosition(H))),this._parser.registerCsiHandler({final:"I"},(H=>this.cursorForwardTab(H))),this._parser.registerCsiHandler({final:"J"},(H=>this.eraseInDisplay(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(H=>this.eraseInDisplay(H,!0))),this._parser.registerCsiHandler({final:"K"},(H=>this.eraseInLine(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(H=>this.eraseInLine(H,!0))),this._parser.registerCsiHandler({final:"L"},(H=>this.insertLines(H))),this._parser.registerCsiHandler({final:"M"},(H=>this.deleteLines(H))),this._parser.registerCsiHandler({final:"P"},(H=>this.deleteChars(H))),this._parser.registerCsiHandler({final:"S"},(H=>this.scrollUp(H))),this._parser.registerCsiHandler({final:"T"},(H=>this.scrollDown(H))),this._parser.registerCsiHandler({final:"X"},(H=>this.eraseChars(H))),this._parser.registerCsiHandler({final:"Z"},(H=>this.cursorBackwardTab(H))),this._parser.registerCsiHandler({final:"`"},(H=>this.charPosAbsolute(H))),this._parser.registerCsiHandler({final:"a"},(H=>this.hPositionRelative(H))),this._parser.registerCsiHandler({final:"b"},(H=>this.repeatPrecedingCharacter(H))),this._parser.registerCsiHandler({final:"c"},(H=>this.sendDeviceAttributesPrimary(H))),this._parser.registerCsiHandler({prefix:">",final:"c"},(H=>this.sendDeviceAttributesSecondary(H))),this._parser.registerCsiHandler({final:"d"},(H=>this.linePosAbsolute(H))),this._parser.registerCsiHandler({final:"e"},(H=>this.vPositionRelative(H))),this._parser.registerCsiHandler({final:"f"},(H=>this.hVPosition(H))),this._parser.registerCsiHandler({final:"g"},(H=>this.tabClear(H))),this._parser.registerCsiHandler({final:"h"},(H=>this.setMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(H=>this.setModePrivate(H))),this._parser.registerCsiHandler({final:"l"},(H=>this.resetMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(H=>this.resetModePrivate(H))),this._parser.registerCsiHandler({final:"m"},(H=>this.charAttributes(H))),this._parser.registerCsiHandler({final:"n"},(H=>this.deviceStatus(H))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(H=>this.deviceStatusPrivate(H))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(H=>this.softReset(H))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(H=>this.setCursorStyle(H))),this._parser.registerCsiHandler({final:"r"},(H=>this.setScrollRegion(H))),this._parser.registerCsiHandler({final:"s"},(H=>this.saveCursor(H))),this._parser.registerCsiHandler({final:"t"},(H=>this.windowOptions(H))),this._parser.registerCsiHandler({final:"u"},(H=>this.restoreCursor(H))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(H=>this.insertColumns(H))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(H=>this.deleteColumns(H))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(H=>this.selectProtected(H))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(H=>this.requestMode(H,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(H=>this.requestMode(H,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((H=>(this.setTitle(H),this.setIconName(H),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((H=>this.setIconName(H)))),this._parser.registerOscHandler(2,new D.OscHandler((H=>this.setTitle(H)))),this._parser.registerOscHandler(4,new D.OscHandler((H=>this.setOrReportIndexedColor(H)))),this._parser.registerOscHandler(8,new D.OscHandler((H=>this.setHyperlink(H)))),this._parser.registerOscHandler(10,new D.OscHandler((H=>this.setOrReportFgColor(H)))),this._parser.registerOscHandler(11,new D.OscHandler((H=>this.setOrReportBgColor(H)))),this._parser.registerOscHandler(12,new D.OscHandler((H=>this.setOrReportCursorColor(H)))),this._parser.registerOscHandler(104,new D.OscHandler((H=>this.restoreIndexedColor(H)))),this._parser.registerOscHandler(110,new D.OscHandler((H=>this.restoreFgColor(H)))),this._parser.registerOscHandler(111,new D.OscHandler((H=>this.restoreBgColor(H)))),this._parser.registerOscHandler(112,new D.OscHandler((H=>this.restoreCursorColor(H)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const H in v.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:H},(()=>this.selectCharset("("+H))),this._parser.registerEscHandler({intermediates:")",final:H},(()=>this.selectCharset(")"+H))),this._parser.registerEscHandler({intermediates:"*",final:H},(()=>this.selectCharset("*"+H))),this._parser.registerEscHandler({intermediates:"+",final:H},(()=>this.selectCharset("+"+H))),this._parser.registerEscHandler({intermediates:"-",final:H},(()=>this.selectCharset("-"+H))),this._parser.registerEscHandler({intermediates:".",final:H},(()=>this.selectCharset("."+H))),this._parser.registerEscHandler({intermediates:"/",final:H},(()=>this.selectCharset("/"+H)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((H=>(this._logService.error("Parsing error: ",H),H))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new T.DcsHandler(((H,ee)=>this.requestStatusString(H,ee))))}_preserveStack(L,M,O,U){this._parseStack.paused=!0,this._parseStack.cursorStartX=L,this._parseStack.cursorStartY=M,this._parseStack.decodedLength=O,this._parseStack.position=U}_logSlowResolvingAsync(L){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([L,new Promise(((M,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch((M=>{if(M!=="#SLOW_TIMEOUT")throw M;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(L,M){let O,U=this._activeBuffer.x,$=this._activeBuffer.y,Q=0;const re=this._parseStack.paused;if(re){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,M))return this._logSlowResolvingAsync(O),O;U=this._parseStack.cursorStartX,$=this._parseStack.cursorStartY,this._parseStack.paused=!1,L.length>z&&(Q=this._parseStack.position+z)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof L=="string"?` "${L}"`:` "${Array.prototype.map.call(L,(H=>String.fromCharCode(H))).join("")}"`),typeof L=="string"?L.split("").map((H=>H.charCodeAt(0))):L),this._parseBuffer.lengthz)for(let H=Q;H0&&ne.getWidth(this._activeBuffer.x-1)===2&&ne.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ee);let pe=this._parser.precedingJoinState;for(let fe=M;fese){if(Z){const Ne=ne;let we=this._activeBuffer.x-Ee;for(this._activeBuffer.x=Ee,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ee>0&&ne instanceof S.BufferLine&&ne.copyCellsFrom(Ne,we,0,Ee,!1);we=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}else if(H&&(ne.insertCells(this._activeBuffer.x,$-Ee,this._activeBuffer.getNullCell(ee)),ne.getWidth(se-1)===2&&ne.setCellFromCodepoint(se-1,x.NULL_CELL_CODE,x.NULL_CELL_WIDTH,ee)),ne.setCellFromCodepoint(this._activeBuffer.x++,U,$,ee),$>0)for(;--$;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}this._parser.precedingJoinState=pe,this._activeBuffer.x0&&ne.getWidth(this._activeBuffer.x)===0&&!ne.hasContent(this._activeBuffer.x)&&ne.setCellFromCodepoint(this._activeBuffer.x,0,1,ee),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(L,M){return L.final!=="t"||L.prefix||L.intermediates?this._parser.registerCsiHandler(L,M):this._parser.registerCsiHandler(L,(O=>!V(O.params[0],this._optionsService.rawOptions.windowOptions)||M(O)))}registerDcsHandler(L,M){return this._parser.registerDcsHandler(L,new T.DcsHandler(M))}registerEscHandler(L,M){return this._parser.registerEscHandler(L,M)}registerOscHandler(L,M){return this._parser.registerOscHandler(L,new D.OscHandler(M))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var L;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&L.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);M.hasWidth(this._activeBuffer.x)&&!M.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const L=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-L),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(L=this._bufferService.cols-1){this._activeBuffer.x=Math.min(L,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(L,M){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=L,this._activeBuffer.y=this._activeBuffer.scrollTop+M):(this._activeBuffer.x=L,this._activeBuffer.y=M),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(L,M){this._restrictCursor(),this._setCursor(this._activeBuffer.x+L,this._activeBuffer.y+M)}cursorUp(L){const M=this._activeBuffer.y-this._activeBuffer.scrollTop;return M>=0?this._moveCursor(0,-Math.min(M,L.params[0]||1)):this._moveCursor(0,-(L.params[0]||1)),!0}cursorDown(L){const M=this._activeBuffer.scrollBottom-this._activeBuffer.y;return M>=0?this._moveCursor(0,Math.min(M,L.params[0]||1)):this._moveCursor(0,L.params[0]||1),!0}cursorForward(L){return this._moveCursor(L.params[0]||1,0),!0}cursorBackward(L){return this._moveCursor(-(L.params[0]||1),0),!0}cursorNextLine(L){return this.cursorDown(L),this._activeBuffer.x=0,!0}cursorPrecedingLine(L){return this.cursorUp(L),this._activeBuffer.x=0,!0}cursorCharAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(L){return this._setCursor(L.length>=2?(L.params[1]||1)-1:0,(L.params[0]||1)-1),!0}charPosAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(L){return this._moveCursor(L.params[0]||1,0),!0}linePosAbsolute(L){return this._setCursor(this._activeBuffer.x,(L.params[0]||1)-1),!0}vPositionRelative(L){return this._moveCursor(0,L.params[0]||1),!0}hVPosition(L){return this.cursorPosition(L),!0}tabClear(L){const M=L.params[0];return M===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:M===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=L.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=L.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(L){const M=L.params[0];return M===1&&(this._curAttrData.bg|=536870912),M!==2&&M!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(L,M,O,U=!1,$=!1){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);Q.replaceCells(M,O,this._activeBuffer.getNullCell(this._eraseAttrData()),$),U&&(Q.isWrapped=!1)}_resetBufferLine(L,M=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),M),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+L),O.isWrapped=!1)}eraseInDisplay(L,M=!1){let O;switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);O=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,M);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,M);this._dirtyRowTracker.markDirty(0);break;case 3:const U=this._activeBuffer.lines.length-this._bufferService.rows;U>0&&(this._activeBuffer.lines.trimStart(U),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-U,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-U,0),this._onScroll.fire(0))}return!0}eraseInLine(L,M=!1){switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,M);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,M)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(L){this._restrictCursor();let M=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let Z=se;for(let H=1;H0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(L){return L.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(L.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(L){return(this._optionsService.rawOptions.termName+"").indexOf(L)===0}setMode(L){for(let M=0;MCe?1:2,pe=L.params[0];return fe=pe,ye=M?pe===2?4:pe===4?ne(Q.modes.insertMode):pe===12?3:pe===20?ne(ee.convertEol):0:pe===1?ne(O.applicationCursorKeys):pe===3?ee.windowOptions.setWinLines?se===80?2:se===132?1:0:0:pe===6?ne(O.origin):pe===7?ne(O.wraparound):pe===8?3:pe===9?ne(U==="X10"):pe===12?ne(ee.cursorBlink):pe===25?ne(!Q.isCursorHidden):pe===45?ne(O.reverseWraparound):pe===66?ne(O.applicationKeypad):pe===67?4:pe===1e3?ne(U==="VT200"):pe===1002?ne(U==="DRAG"):pe===1003?ne(U==="ANY"):pe===1004?ne(O.sendFocus):pe===1005?4:pe===1006?ne($==="SGR"):pe===1015?4:pe===1016?ne($==="SGR_PIXELS"):pe===1048?1:pe===47||pe===1047||pe===1049?ne(Z===H):pe===2004?ne(O.bracketedPasteMode):0,Q.triggerDataEvent(`${d.C0.ESC}[${M?"":"?"}${fe};${ye}$y`),!0;var fe,ye}_updateAttrColor(L,M,O,U,$){return M===2?(L|=50331648,L&=-16777216,L|=E.AttributeData.fromColorRGB([O,U,$])):M===5&&(L&=-50331904,L|=33554432|255&O),L}_extractColor(L,M,O){const U=[0,0,-1,0,0,0];let $=0,Q=0;do{if(U[Q+$]=L.params[M+Q],L.hasSubParams(M+Q)){const re=L.getSubParams(M+Q);let se=0;do U[1]===5&&($=1),U[Q+se+1+$]=re[se];while(++se=2||U[1]===2&&Q+$>=5)break;U[1]&&($=1)}while(++Q+M5)&&(L=1),M.extended.underlineStyle=L,M.fg|=268435456,L===0&&(M.fg&=-268435457),M.updateExtended()}_processSGR0(L){L.fg=S.DEFAULT_ATTR_DATA.fg,L.bg=S.DEFAULT_ATTR_DATA.bg,L.extended=L.extended.clone(),L.extended.underlineStyle=0,L.extended.underlineColor&=-67108864,L.updateExtended()}charAttributes(L){if(L.length===1&&L.params[0]===0)return this._processSGR0(this._curAttrData),!0;const M=L.length;let O;const U=this._curAttrData;for(let $=0;$=30&&O<=37?(U.fg&=-50331904,U.fg|=16777216|O-30):O>=40&&O<=47?(U.bg&=-50331904,U.bg|=16777216|O-40):O>=90&&O<=97?(U.fg&=-50331904,U.fg|=16777224|O-90):O>=100&&O<=107?(U.bg&=-50331904,U.bg|=16777224|O-100):O===0?this._processSGR0(U):O===1?U.fg|=134217728:O===3?U.bg|=67108864:O===4?(U.fg|=268435456,this._processUnderline(L.hasSubParams($)?L.getSubParams($)[0]:1,U)):O===5?U.fg|=536870912:O===7?U.fg|=67108864:O===8?U.fg|=1073741824:O===9?U.fg|=2147483648:O===2?U.bg|=134217728:O===21?this._processUnderline(2,U):O===22?(U.fg&=-134217729,U.bg&=-134217729):O===23?U.bg&=-67108865:O===24?(U.fg&=-268435457,this._processUnderline(0,U)):O===25?U.fg&=-536870913:O===27?U.fg&=-67108865:O===28?U.fg&=-1073741825:O===29?U.fg&=2147483647:O===39?(U.fg&=-67108864,U.fg|=16777215&S.DEFAULT_ATTR_DATA.fg):O===49?(U.bg&=-67108864,U.bg|=16777215&S.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?$+=this._extractColor(L,$,U):O===53?U.bg|=1073741824:O===55?U.bg&=-1073741825:O===59?(U.extended=U.extended.clone(),U.extended.underlineColor=-1,U.updateExtended()):O===100?(U.fg&=-67108864,U.fg|=16777215&S.DEFAULT_ATTR_DATA.fg,U.bg&=-67108864,U.bg|=16777215&S.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(L){switch(L.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const M=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${M};${O}R`)}return!0}deviceStatusPrivate(L){if(L.params[0]===6){const M=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${M};${O}R`)}return!0}softReset(L){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=S.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(L){const M=L.params[0]||1;switch(M){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const O=M%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(L){const M=L.params[0]||1;let O;return(L.length<2||(O=L.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>M&&(this._activeBuffer.scrollTop=M-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(L){if(!V(L.params[0],this._optionsService.rawOptions.windowOptions))return!0;const M=L.length>1?L.params[1]:0;switch(L.params[0]){case 14:M!==2&&this._onRequestWindowsOptionsReport.fire(F.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(F.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:M!==0&&M!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),M!==0&&M!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:M!==0&&M!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),M!==0&&M!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(L){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(L){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(L){return this._windowTitle=L,this._onTitleChange.fire(L),!0}setIconName(L){return this._iconName=L,!0}setOrReportIndexedColor(L){const M=[],O=L.split(";");for(;O.length>1;){const U=O.shift(),$=O.shift();if(/^\d+$/.exec(U)){const Q=parseInt(U);if(X(Q))if($==="?")M.push({type:0,index:Q});else{const re=(0,j.parseColor)($);re&&M.push({type:1,index:Q,color:re})}}}return M.length&&this._onColor.fire(M),!0}setHyperlink(L){const M=L.split(";");return!(M.length<2)&&(M[1]?this._createHyperlink(M[0],M[1]):!M[0]&&this._finishHyperlink())}_createHyperlink(L,M){this._getCurrentLinkId()&&this._finishHyperlink();const O=L.split(":");let U;const $=O.findIndex((Q=>Q.startsWith("id=")));return $!==-1&&(U=O[$].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:U,uri:M}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(L,M){const O=L.split(";");for(let U=0;U=this._specialColors.length);++U,++M)if(O[U]==="?")this._onColor.fire([{type:0,index:this._specialColors[M]}]);else{const $=(0,j.parseColor)(O[U]);$&&this._onColor.fire([{type:1,index:this._specialColors[M],color:$}])}return!0}setOrReportFgColor(L){return this._setOrReportSpecialColor(L,0)}setOrReportBgColor(L){return this._setOrReportSpecialColor(L,1)}setOrReportCursorColor(L){return this._setOrReportSpecialColor(L,2)}restoreIndexedColor(L){if(!L)return this._onColor.fire([{type:2}]),!0;const M=[],O=L.split(";");for(let U=0;U=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const L=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,L,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=S.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=S.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(L){return this._charsetService.setgLevel(L),!0}screenAlignmentPattern(){const L=new b.CellData;L.content=4194373,L.fg=this._curAttrData.fg,L.bg=this._curAttrData.bg,this._setCursor(0,0);for(let M=0;M(this._coreService.triggerDataEvent(`${d.C0.ESC}${$}${d.C0.ESC}\\`),!0))(L==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:L==='"p'?'P1$r61;1"p':L==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:L==="m"?"P1$r0m":L===" q"?`P1$r${{block:2,underline:4,bar:6}[U.cursorStyle]-(U.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(L,M){this._dirtyRowTracker.markRangeDirty(L,M)}}o.InputHandler=Y;let q=class{constructor(K){this._bufferService=K,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(K){Kthis.end&&(this.end=K)}markRangeDirty(K,L){K>L&&(P=K,K=L,L=P),Kthis.end&&(this.end=L)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(K){return 0<=K&&K<256}q=f([p(0,R.IBufferService)],q)},844:(u,o)=>{function c(f){for(const p of f)p.dispose();f.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const p=this._disposables.indexOf(f);p!==-1&&this._disposables.splice(p,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var p;this._isDisposed||f===this._value||((p=this._value)==null||p.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},o.toDisposable=function(f){return{dispose:f}},o.disposeArray=c,o.getDisposeArrayDisposable=function(f){return{dispose:()=>c(f)}}},1505:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(p,d,v){this._data[p]||(this._data[p]={}),this._data[p][d]=v}get(p,d){return this._data[p]?this._data[p][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(f,p,d,v,_){this._data.get(f,p)||this._data.set(f,p,new c),this._data.get(f,p).set(d,v,_)}get(f,p,d,v){var _;return(_=this._data.get(f,p))==null?void 0:_.get(d,v)}clear(){this._data.clear()}}},6114:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,f=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const p=c.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),o.isIpad=f==="iPad",o.isIphone=f==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),o.isLinux=f.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(c=this._search(this._getKey(f)),this._array.splice(c,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const p=this._getKey(f);if(p===void 0||(c=this._search(p),c===-1)||this._getKey(this._array[c])!==p)return!1;do if(this._array[c]===f)return this._array.splice(c,1),!0;while(++c=this._array.length)&&this._getKey(this._array[c])===f))do yield this._array[c];while(++c=this._array.length)&&this._getKey(this._array[c])===f))do p(this._array[c]);while(++c=p;){let v=p+d>>1;const _=this._getKey(this._array[v]);if(_>f)d=v-1;else{if(!(_0&&this._getKey(this._array[v-1])===f;)v--;return v}p=v+1}}return p}}},7226:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const f=c(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),this._start()}flush(){for(;this._iy)return S-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(S-C))}ms`),void this._start();S=y}this.clear()}}class d extends p{_requestCallback(_){return setTimeout((()=>_(this._createDeadline(16))))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const C=Date.now()+_;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const f=c(643);o.updateWindowsModeWrappedState=function(p){const d=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),v=d==null?void 0:d.get(p.cols-1),_=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);_&&v&&(_.isWrapped=v[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&v[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new c;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=c;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,v=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=v}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=f},9092:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const f=c(6349),p=c(7226),d=c(3734),v=c(8437),_=c(4634),C=c(511),w=c(643),S=c(4863),y=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(x,b,E){this._hasScrollback=x,this._optionsService=b,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=y.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(x){return x?(this._nullCell.fg=x.fg,this._nullCell.bg=x.bg,this._nullCell.extended=x.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(x){return x?(this._whitespaceCell.fg=x.fg,this._whitespaceCell.bg=x.bg,this._whitespaceCell.extended=x.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(x,b){return new v.BufferLine(this._bufferService.cols,this.getNullCell(x),b)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const x=this.ybase+this.y-this.ydisp;return x>=0&&xo.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:b}fillViewportRows(x){if(this.lines.length===0){x===void 0&&(x=v.DEFAULT_ATTR_DATA);let b=this._rows;for(;b--;)this.lines.push(this.getBlankLine(x))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(x,b){const E=this.getNullCell(v.DEFAULT_ATTR_DATA);let R=0;const N=this._getCorrectBufferLength(b);if(N>this.lines.maxLength&&(this.lines.maxLength=N),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(x,E)));else for(let T=this._rows;T>b;T--)this.lines.length>b+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(N0&&(this.lines.trimStart(T),this.ybase=Math.max(this.ybase-T,0),this.ydisp=Math.max(this.ydisp-T,0),this.savedY=Math.max(this.savedY-T,0)),this.lines.maxLength=N}this.x=Math.min(this.x,x-1),this.y=Math.min(this.y,b-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,x-1),this.scrollTop=0}if(this.scrollBottom=b-1,this._isReflowEnabled&&(this._reflow(x,b),this._cols>x))for(let D=0;D.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let x=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,x=!1);let b=0;for(;this._memoryCleanupPosition100)return!0;return x}get _isReflowEnabled(){const x=this._optionsService.rawOptions.windowsPty;return x&&x.buildNumber?this._hasScrollback&&x.backend==="conpty"&&x.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(x,b){this._cols!==x&&(x>this._cols?this._reflowLarger(x,b):this._reflowSmaller(x,b))}_reflowLarger(x,b){const E=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,x,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(E.length>0){const R=(0,_.reflowLargerCreateNewLayout)(this.lines,E);(0,_.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(x,b,R.countRemoved)}}_reflowLargerAdjustViewport(x,b,E){const R=this.getNullCell(v.DEFAULT_ATTR_DATA);let N=E;for(;N-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;D--){let T=this.lines.get(D);if(!T||!T.isWrapped&&T.getTrimmedLength()<=x)continue;const j=[T];for(;T.isWrapped&&D>0;)T=this.lines.get(--D),j.unshift(T);const B=this.ybase+this.y;if(B>=D&&B0&&(R.push({start:D+j.length+N,newLines:Y}),N+=Y.length),j.push(...Y);let q=V.length-1,X=V[q];X===0&&(q--,X=V[q]);let K=j.length-F-1,L=z;for(;K>=0;){const O=Math.min(L,X);if(j[q]===void 0)break;if(j[q].copyCellsFrom(j[K],L-O,X-O,O,!0),X-=O,X===0&&(q--,X=V[q]),L-=O,L===0){K--;const U=Math.max(K,0);L=(0,_.getWrappedLineTrimmedLength)(j,U,this._cols)}}for(let O=0;O0;)this.ybase===0?this.y0){const D=[],T=[];for(let q=0;q=0;q--)if(V&&V.start>B+F){for(let X=V.newLines.length-1;X>=0;X--)this.lines.set(q--,V.newLines[X]);q++,D.push({index:B+1,amount:V.newLines.length}),F+=V.newLines.length,V=R[++z]}else this.lines.set(q,T[B--]);let P=0;for(let q=D.length-1;q>=0;q--)D[q].index+=P,this.lines.onInsertEmitter.fire(D[q]),P+=D[q].amount;const Y=Math.max(0,j+N-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(x,b,E=0,R){const N=this.lines.get(x);return N?N.translateToString(b,E,R):""}getWrappedRangeForLine(x){let b=x,E=x;for(;b>0&&this.lines.get(b).isWrapped;)b--;for(;E+10;);return x>=this._cols?this._cols-1:x<0?0:x}nextStop(x){for(x==null&&(x=this.x);!this.tabs[++x]&&x=this._cols?this._cols-1:x<0?0:x}clearMarkers(x){this._isClearing=!0;for(let b=0;b{b.line-=E,b.line<0&&b.dispose()}))),b.register(this.lines.onInsert((E=>{b.line>=E.index&&(b.line+=E.amount)}))),b.register(this.lines.onDelete((E=>{b.line>=E.index&&b.lineE.index&&(b.line-=E.amount)}))),b.register(b.onDispose((()=>this._removeMarker(b)))),b}_removeMarker(x){this._isClearing||this.markers.splice(this.markers.indexOf(x),1)}}},8437:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const f=c(3734),p=c(511),d=c(643),v=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let _=0;class C{constructor(S,y,x=!1){this.isWrapped=x,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*S);const b=y||p.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let E=0;E>22,2097152&y?this._combined[S].charCodeAt(this._combined[S].length-1):x]}set(S,y){this._data[3*S+1]=y[d.CHAR_DATA_ATTR_INDEX],y[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[S]=y[1],this._data[3*S+0]=2097152|S|y[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*S+0]=y[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(S){return this._data[3*S+0]>>22}hasWidth(S){return 12582912&this._data[3*S+0]}getFg(S){return this._data[3*S+1]}getBg(S){return this._data[3*S+2]}hasContent(S){return 4194303&this._data[3*S+0]}getCodePoint(S){const y=this._data[3*S+0];return 2097152&y?this._combined[S].charCodeAt(this._combined[S].length-1):2097151&y}isCombined(S){return 2097152&this._data[3*S+0]}getString(S){const y=this._data[3*S+0];return 2097152&y?this._combined[S]:2097151&y?(0,v.stringFromCodePoint)(2097151&y):""}isProtected(S){return 536870912&this._data[3*S+2]}loadCell(S,y){return _=3*S,y.content=this._data[_+0],y.fg=this._data[_+1],y.bg=this._data[_+2],2097152&y.content&&(y.combinedData=this._combined[S]),268435456&y.bg&&(y.extended=this._extendedAttrs[S]),y}setCell(S,y){2097152&y.content&&(this._combined[S]=y.combinedData),268435456&y.bg&&(this._extendedAttrs[S]=y.extended),this._data[3*S+0]=y.content,this._data[3*S+1]=y.fg,this._data[3*S+2]=y.bg}setCellFromCodepoint(S,y,x,b){268435456&b.bg&&(this._extendedAttrs[S]=b.extended),this._data[3*S+0]=y|x<<22,this._data[3*S+1]=b.fg,this._data[3*S+2]=b.bg}addCodepointToCell(S,y,x){let b=this._data[3*S+0];2097152&b?this._combined[S]+=(0,v.stringFromCodePoint)(y):2097151&b?(this._combined[S]=(0,v.stringFromCodePoint)(2097151&b)+(0,v.stringFromCodePoint)(y),b&=-2097152,b|=2097152):b=y|4194304,x&&(b&=-12582913,b|=x<<22),this._data[3*S+0]=b}insertCells(S,y,x){if((S%=this.length)&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S-1,0,1,x),y=0;--E)this.setCell(S+y+E,this.loadCell(S+E,b));for(let E=0;Ethis.length){if(this._data.buffer.byteLength>=4*x)this._data=new Uint32Array(this._data.buffer,0,x);else{const b=new Uint32Array(x);b.set(this._data),this._data=b}for(let b=this.length;b=S&&delete this._combined[N]}const E=Object.keys(this._extendedAttrs);for(let R=0;R=S&&delete this._extendedAttrs[N]}}return this.length=S,4*x*2=0;--S)if(4194303&this._data[3*S+0])return S+(this._data[3*S+0]>>22);return 0}getNoBgTrimmedLength(){for(let S=this.length-1;S>=0;--S)if(4194303&this._data[3*S+0]||50331648&this._data[3*S+2])return S+(this._data[3*S+0]>>22);return 0}copyCellsFrom(S,y,x,b,E){const R=S._data;if(E)for(let D=b-1;D>=0;D--){for(let T=0;T<3;T++)this._data[3*(x+D)+T]=R[3*(y+D)+T];268435456&R[3*(y+D)+2]&&(this._extendedAttrs[x+D]=S._extendedAttrs[y+D])}else for(let D=0;D=y&&(this._combined[T-y+x]=S._combined[T])}}translateToString(S,y,x,b){y=y??0,x=x??this.length,S&&(x=Math.min(x,this.getTrimmedLength())),b&&(b.length=0);let E="";for(;y>22||1}return b&&b.push(y),E}}o.BufferLine=C},4841:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,f){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return f*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(u,o)=>{function c(f,p,d){if(p===f.length-1)return f[p].getTrimmedLength();const v=!f[p].hasContent(d-1)&&f[p].getWidth(d-1)===1,_=f[p+1].getWidth(0)===2;return v&&_?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(f,p,d,v,_){const C=[];for(let w=0;w=w&&v0&&(T>b||x[T].getTrimmedLength()===0);T--)D++;D>0&&(C.push(w+x.length-D),C.push(D)),w+=x.length-1}return C},o.reflowLargerCreateNewLayout=function(f,p){const d=[];let v=0,_=p[v],C=0;for(let w=0;wc(f,x,p))).reduce(((y,x)=>y+x));let C=0,w=0,S=0;for(;S<_;){if(_-Sy&&(C-=y,w++);const x=f[w].getWidth(C-1)===2;x&&C--;const b=x?d-1:d;v.push(b),S+=b}return v},o.getWrappedLineTrimmedLength=c},5295:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const f=c(8460),p=c(844),d=c(9092);class v extends p.Disposable{constructor(C,w){super(),this._optionsService=C,this._bufferService=w,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(C,w){this._normal.resize(C,w),this._alt.resize(C,w),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}o.BufferSet=v},511:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const f=c(482),p=c(643),d=c(3734);class v extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const w=new v;return w.setFromCharData(C),w}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(C[p.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(C[p.CHAR_DATA_CHAR_INDEX].length===2){const S=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=S&&S<=56319){const y=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=y&&y<=57343?this.content=1024*(S-55296)+y-56320+65536|C[p.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[p.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=C[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=v},643:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const f=c(8460),p=c(844);class d{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}o.Marker=d,d._nextId=1},7116:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(u,o)=>{var c,f,p;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=` -`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(c||(o.C0=c={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(f||(o.C1=f={})),(function(d){d.ST=`${c.ESC}\\`})(p||(o.C1_ESCAPED=p={}))},7399:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const f=c(2584),p={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(d,v,_,C){const w={type:0,cancel:!1,key:void 0},S=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?w.key=v?f.C0.ESC+"OA":f.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?w.key=v?f.C0.ESC+"OD":f.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?w.key=v?f.C0.ESC+"OC":f.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(w.key=v?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:w.key=d.ctrlKey?"\b":f.C0.DEL,d.altKey&&(w.key=f.C0.ESC+w.key);break;case 9:if(d.shiftKey){w.key=f.C0.ESC+"[Z";break}w.key=f.C0.HT,w.cancel=!0;break;case 13:w.key=d.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,w.cancel=!0;break;case 27:w.key=f.C0.ESC,d.altKey&&(w.key=f.C0.ESC+f.C0.ESC),w.cancel=!0;break;case 37:if(d.metaKey)break;S?(w.key=f.C0.ESC+"[1;"+(S+1)+"D",w.key===f.C0.ESC+"[1;3D"&&(w.key=f.C0.ESC+(_?"b":"[1;5D"))):w.key=v?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(d.metaKey)break;S?(w.key=f.C0.ESC+"[1;"+(S+1)+"C",w.key===f.C0.ESC+"[1;3C"&&(w.key=f.C0.ESC+(_?"f":"[1;5C"))):w.key=v?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(d.metaKey)break;S?(w.key=f.C0.ESC+"[1;"+(S+1)+"A",_||w.key!==f.C0.ESC+"[1;3A"||(w.key=f.C0.ESC+"[1;5A")):w.key=v?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(d.metaKey)break;S?(w.key=f.C0.ESC+"[1;"+(S+1)+"B",_||w.key!==f.C0.ESC+"[1;3B"||(w.key=f.C0.ESC+"[1;5B")):w.key=v?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(w.key=f.C0.ESC+"[2~");break;case 46:w.key=S?f.C0.ESC+"[3;"+(S+1)+"~":f.C0.ESC+"[3~";break;case 36:w.key=S?f.C0.ESC+"[1;"+(S+1)+"H":v?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:w.key=S?f.C0.ESC+"[1;"+(S+1)+"F":v?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:d.shiftKey?w.type=2:d.ctrlKey?w.key=f.C0.ESC+"[5;"+(S+1)+"~":w.key=f.C0.ESC+"[5~";break;case 34:d.shiftKey?w.type=3:d.ctrlKey?w.key=f.C0.ESC+"[6;"+(S+1)+"~":w.key=f.C0.ESC+"[6~";break;case 112:w.key=S?f.C0.ESC+"[1;"+(S+1)+"P":f.C0.ESC+"OP";break;case 113:w.key=S?f.C0.ESC+"[1;"+(S+1)+"Q":f.C0.ESC+"OQ";break;case 114:w.key=S?f.C0.ESC+"[1;"+(S+1)+"R":f.C0.ESC+"OR";break;case 115:w.key=S?f.C0.ESC+"[1;"+(S+1)+"S":f.C0.ESC+"OS";break;case 116:w.key=S?f.C0.ESC+"[15;"+(S+1)+"~":f.C0.ESC+"[15~";break;case 117:w.key=S?f.C0.ESC+"[17;"+(S+1)+"~":f.C0.ESC+"[17~";break;case 118:w.key=S?f.C0.ESC+"[18;"+(S+1)+"~":f.C0.ESC+"[18~";break;case 119:w.key=S?f.C0.ESC+"[19;"+(S+1)+"~":f.C0.ESC+"[19~";break;case 120:w.key=S?f.C0.ESC+"[20;"+(S+1)+"~":f.C0.ESC+"[20~";break;case 121:w.key=S?f.C0.ESC+"[21;"+(S+1)+"~":f.C0.ESC+"[21~";break;case 122:w.key=S?f.C0.ESC+"[23;"+(S+1)+"~":f.C0.ESC+"[23~";break;case 123:w.key=S?f.C0.ESC+"[24;"+(S+1)+"~":f.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(_&&!C||!d.altKey||d.metaKey)!_||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?w.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(w.key=f.C0.US),d.key==="@"&&(w.key=f.C0.NUL)):d.keyCode===65&&(w.type=1);else{const y=p[d.keyCode],x=y==null?void 0:y[d.shiftKey?1:0];if(x)w.key=f.C0.ESC+x;else if(d.keyCode>=65&&d.keyCode<=90){const b=d.ctrlKey?d.keyCode-64:d.keyCode+32;let E=String.fromCharCode(b);d.shiftKey&&(E=E.toUpperCase()),w.key=f.C0.ESC+E}else if(d.keyCode===32)w.key=f.C0.ESC+(d.ctrlKey?f.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let b=d.code.slice(3,4);d.shiftKey||(b=b.toLowerCase()),w.key=f.C0.ESC+b,w.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?w.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?w.key=f.C0.NUL:d.keyCode>=51&&d.keyCode<=55?w.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?w.key=f.C0.DEL:d.keyCode===219?w.key=f.C0.ESC:d.keyCode===220?w.key=f.C0.FS:d.keyCode===221&&(w.key=f.C0.GS)}return w}},482:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,f=0,p=c.length){let d="";for(let v=f;v65535?(_-=65536,d+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):d+=String.fromCharCode(_)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,f){const p=c.length;if(!p)return 0;let d=0,v=0;if(this._interim){const _=c.charCodeAt(v++);56320<=_&&_<=57343?f[d++]=1024*(this._interim-55296)+_-56320+65536:(f[d++]=this._interim,f[d++]=_),this._interim=0}for(let _=v;_=p)return this._interim=C,d;const w=c.charCodeAt(_);56320<=w&&w<=57343?f[d++]=1024*(C-55296)+w-56320+65536:(f[d++]=C,f[d++]=w)}else C!==65279&&(f[d++]=C)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,f){const p=c.length;if(!p)return 0;let d,v,_,C,w=0,S=0,y=0;if(this.interim[0]){let E=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let N,D=0;for(;(N=63&this.interim[++D])&&D<4;)R<<=6,R|=N;const T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,j=T-D;for(;y=p)return 0;if(N=c[y++],(192&N)!=128){y--,E=!0;break}this.interim[D++]=N,R<<=6,R|=63&N}E||(T===2?R<128?y--:f[w++]=R:T===3?R<2048||R>=55296&&R<=57343||R===65279||(f[w++]=R):R<65536||R>1114111||(f[w++]=R)),this.interim.fill(0)}const x=p-4;let b=y;for(;b=p)return this.interim[0]=d,w;if(v=c[b++],(192&v)!=128){b--;continue}if(S=(31&d)<<6|63&v,S<128){b--;continue}f[w++]=S}else if((240&d)==224){if(b>=p)return this.interim[0]=d,w;if(v=c[b++],(192&v)!=128){b--;continue}if(b>=p)return this.interim[0]=d,this.interim[1]=v,w;if(_=c[b++],(192&_)!=128){b--;continue}if(S=(15&d)<<12|(63&v)<<6|63&_,S<2048||S>=55296&&S<=57343||S===65279)continue;f[w++]=S}else if((248&d)==240){if(b>=p)return this.interim[0]=d,w;if(v=c[b++],(192&v)!=128){b--;continue}if(b>=p)return this.interim[0]=d,this.interim[1]=v,w;if(_=c[b++],(192&_)!=128){b--;continue}if(b>=p)return this.interim[0]=d,this.interim[1]=v,this.interim[2]=_,w;if(C=c[b++],(192&C)!=128){b--;continue}if(S=(7&d)<<18|(63&v)<<12|(63&_)<<6|63&C,S<65536||S>1114111)continue;f[w++]=S}}return w}}},225:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const f=c(1480),p=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let v;o.UnicodeV6=class{constructor(){if(this.version="6",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160),v.fill(2,4352,4448),v[9001]=2,v[9002]=2,v.fill(2,11904,42192),v[12351]=1,v.fill(2,44032,55204),v.fill(2,63744,64256),v.fill(2,65040,65050),v.fill(2,65072,65136),v.fill(2,65280,65377),v.fill(2,65504,65511);for(let _=0;_w[x][1])return!1;for(;x>=y;)if(S=y+x>>1,C>w[S][1])y=S+1;else{if(!(C=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,C){let w=this.wcwidth(_),S=w===0&&C!==0;if(S){const y=f.UnicodeService.extractWidth(C);y===0?S=!1:y>w&&(w=y)}return f.UnicodeService.createPropertyValue(0,w,S)}}},5981:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const f=c(8460),p=c(844);class d extends p.Disposable{constructor(_){super(),this._action=_,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(_,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const S=this._callbacks.shift();S&&S()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(_,C){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(C)}_innerWrite(_=0,C=!0){const w=_||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const S=this._writeBuffer[this._bufferOffset],y=this._action(S,C);if(y){const b=E=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(w,E);return void y.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(b)}const x=this._callbacks[this._bufferOffset];if(x&&x(),this._bufferOffset++,this._pendingData-=S.length,Date.now()-w>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=d},5941:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,f=/^[\da-f]+$/;function p(d,v){const _=d.toString(16),C=_.length<2?"0"+_:_;switch(v){case 4:return _[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}o.parseColor=function(d){if(!d)return;let v=d.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const _=c.exec(v);if(_){const C=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/C*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/C*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/C*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),f.exec(v)&&[3,6,9,12].includes(v.length))){const _=v.length/3,C=[0,0,0];for(let w=0;w<3;++w){const S=parseInt(v.slice(_*w,_*w+_),16);C[w]=_===1?S<<4:_===2?S:_===3?S>>4:S>>8}return C}},o.toRgbString=function(d,v=16){const[_,C,w]=d;return`rgb:${p(_,v)}/${p(C,v)}/${p(w,v)}`}},5770:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const f=c(482),p=c(8742),d=c(5770),v=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(C,w){this._handlers[C]===void 0&&(this._handlers[C]=[]);const S=this._handlers[C];return S.push(w),{dispose:()=>{const y=S.indexOf(w);y!==-1&&S.splice(y,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(C,w){if(this.reset(),this._ident=C,this._active=this._handlers[C]||v,this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(C,w,S){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(C,w,S);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(C,w,S))}unhook(C,w=!0){if(this._active.length){let S=!1,y=this._active.length-1,x=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,S=w,x=this._stack.fallThrough,this._stack.paused=!1),!x&&S===!1){for(;y>=0&&(S=this._active[y].unhook(C),S!==!0);y--)if(S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,S;y--}for(;y>=0;y--)if(S=this._active[y].unhook(!1),S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,S}else this._handlerFb(this._ident,"UNHOOK",C);this._active=v,this._ident=0}};const _=new p.Params;_.addParam(0),o.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=_,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():_,this._data="",this._hitLimit=!1}put(C,w,S){this._hitLimit||(this._data+=(0,f.utf32ToString)(C,w,S),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let w=!1;if(this._hitLimit)w=!1;else if(C&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((S=>(this._params=_,this._data="",this._hitLimit=!1,S)));return this._params=_,this._data="",this._hitLimit=!1,w}}},2015:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const f=c(844),p=c(8742),d=c(6242),v=c(6351);class _{constructor(y){this.table=new Uint8Array(y)}setDefault(y,x){this.table.fill(y<<4|x)}add(y,x,b,E){this.table[x<<8|y]=b<<4|E}addMany(y,x,b,E){for(let R=0;RT)),x=(D,T)=>y.slice(D,T),b=x(32,127),E=x(0,24);E.push(25),E.push.apply(E,x(28,32));const R=x(0,14);let N;for(N in S.setDefault(1,0),S.addMany(b,0,2,0),R)S.addMany([24,26,153,154],N,3,0),S.addMany(x(128,144),N,3,0),S.addMany(x(144,152),N,3,0),S.add(156,N,0,0),S.add(27,N,11,1),S.add(157,N,4,8),S.addMany([152,158,159],N,0,7),S.add(155,N,11,3),S.add(144,N,11,9);return S.addMany(E,0,3,0),S.addMany(E,1,3,1),S.add(127,1,0,1),S.addMany(E,8,0,8),S.addMany(E,3,3,3),S.add(127,3,0,3),S.addMany(E,4,3,4),S.add(127,4,0,4),S.addMany(E,6,3,6),S.addMany(E,5,3,5),S.add(127,5,0,5),S.addMany(E,2,3,2),S.add(127,2,0,2),S.add(93,1,4,8),S.addMany(b,8,5,8),S.add(127,8,5,8),S.addMany([156,27,24,26,7],8,6,0),S.addMany(x(28,32),8,0,8),S.addMany([88,94,95],1,0,7),S.addMany(b,7,0,7),S.addMany(E,7,0,7),S.add(156,7,0,0),S.add(127,7,0,7),S.add(91,1,11,3),S.addMany(x(64,127),3,7,0),S.addMany(x(48,60),3,8,4),S.addMany([60,61,62,63],3,9,4),S.addMany(x(48,60),4,8,4),S.addMany(x(64,127),4,7,0),S.addMany([60,61,62,63],4,0,6),S.addMany(x(32,64),6,0,6),S.add(127,6,0,6),S.addMany(x(64,127),6,0,0),S.addMany(x(32,48),3,9,5),S.addMany(x(32,48),5,9,5),S.addMany(x(48,64),5,0,6),S.addMany(x(64,127),5,7,0),S.addMany(x(32,48),4,9,5),S.addMany(x(32,48),1,9,2),S.addMany(x(32,48),2,9,2),S.addMany(x(48,127),2,10,0),S.addMany(x(48,80),1,10,0),S.addMany(x(81,88),1,10,0),S.addMany([89,90,92],1,10,0),S.addMany(x(96,127),1,10,0),S.add(80,1,11,9),S.addMany(E,9,0,9),S.add(127,9,0,9),S.addMany(x(28,32),9,0,9),S.addMany(x(32,48),9,9,12),S.addMany(x(48,60),9,8,10),S.addMany([60,61,62,63],9,9,10),S.addMany(E,11,0,11),S.addMany(x(32,128),11,0,11),S.addMany(x(28,32),11,0,11),S.addMany(E,10,0,10),S.add(127,10,0,10),S.addMany(x(28,32),10,0,10),S.addMany(x(48,60),10,8,10),S.addMany([60,61,62,63],10,0,11),S.addMany(x(32,48),10,9,12),S.addMany(E,12,0,12),S.add(127,12,0,12),S.addMany(x(28,32),12,0,12),S.addMany(x(32,48),12,9,12),S.addMany(x(48,64),12,0,11),S.addMany(x(64,127),12,12,13),S.addMany(x(64,127),10,12,13),S.addMany(x(64,127),9,12,13),S.addMany(E,13,13,13),S.addMany(b,13,13,13),S.add(127,13,0,13),S.addMany([27,156,24,26],13,14,0),S.add(C,0,2,0),S.add(C,8,5,8),S.add(C,6,0,6),S.add(C,11,0,11),S.add(C,13,13,13),S})();class w extends f.Disposable{constructor(y=o.VT500_TRANSITION_TABLE){super(),this._transitions=y,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(x,b,E)=>{},this._executeHandlerFb=x=>{},this._csiHandlerFb=(x,b)=>{},this._escHandlerFb=x=>{},this._errorHandlerFb=x=>x,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(y,x=[64,126]){let b=0;if(y.prefix){if(y.prefix.length>1)throw new Error("only one byte as prefix supported");if(b=y.prefix.charCodeAt(0),b&&60>b||b>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(y.intermediates){if(y.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let R=0;RN||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");b<<=8,b|=N}}if(y.final.length!==1)throw new Error("final must be a single byte");const E=y.final.charCodeAt(0);if(x[0]>E||E>x[1])throw new Error(`final must be in range ${x[0]} .. ${x[1]}`);return b<<=8,b|=E,b}identToString(y){const x=[];for(;y;)x.push(String.fromCharCode(255&y)),y>>=8;return x.reverse().join("")}setPrintHandler(y){this._printHandler=y}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(y,x){const b=this._identifier(y,[48,126]);this._escHandlers[b]===void 0&&(this._escHandlers[b]=[]);const E=this._escHandlers[b];return E.push(x),{dispose:()=>{const R=E.indexOf(x);R!==-1&&E.splice(R,1)}}}clearEscHandler(y){this._escHandlers[this._identifier(y,[48,126])]&&delete this._escHandlers[this._identifier(y,[48,126])]}setEscHandlerFallback(y){this._escHandlerFb=y}setExecuteHandler(y,x){this._executeHandlers[y.charCodeAt(0)]=x}clearExecuteHandler(y){this._executeHandlers[y.charCodeAt(0)]&&delete this._executeHandlers[y.charCodeAt(0)]}setExecuteHandlerFallback(y){this._executeHandlerFb=y}registerCsiHandler(y,x){const b=this._identifier(y);this._csiHandlers[b]===void 0&&(this._csiHandlers[b]=[]);const E=this._csiHandlers[b];return E.push(x),{dispose:()=>{const R=E.indexOf(x);R!==-1&&E.splice(R,1)}}}clearCsiHandler(y){this._csiHandlers[this._identifier(y)]&&delete this._csiHandlers[this._identifier(y)]}setCsiHandlerFallback(y){this._csiHandlerFb=y}registerDcsHandler(y,x){return this._dcsParser.registerHandler(this._identifier(y),x)}clearDcsHandler(y){this._dcsParser.clearHandler(this._identifier(y))}setDcsHandlerFallback(y){this._dcsParser.setHandlerFallback(y)}registerOscHandler(y,x){return this._oscParser.registerHandler(y,x)}clearOscHandler(y){this._oscParser.clearHandler(y)}setOscHandlerFallback(y){this._oscParser.setHandlerFallback(y)}setErrorHandler(y){this._errorHandler=y}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(y,x,b,E,R){this._parseStack.state=y,this._parseStack.handlers=x,this._parseStack.handlerPos=b,this._parseStack.transition=E,this._parseStack.chunkPos=R}parse(y,x,b){let E,R=0,N=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(b===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const T=this._parseStack.handlers;let j=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(b===!1&&j>-1){for(;j>=0&&(E=T[j](this._params),E!==!0);j--)if(E instanceof Promise)return this._parseStack.handlerPos=j,E}this._parseStack.handlers=[];break;case 4:if(b===!1&&j>-1){for(;j>=0&&(E=T[j](),E!==!0);j--)if(E instanceof Promise)return this._parseStack.handlerPos=j,E}this._parseStack.handlers=[];break;case 6:if(R=y[this._parseStack.chunkPos],E=this._dcsParser.unhook(R!==24&&R!==26,b),E)return E;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=y[this._parseStack.chunkPos],E=this._oscParser.end(R!==24&&R!==26,b),E)return E;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let T=D;T>4){case 2:for(let F=T+1;;++F){if(F>=x||(R=y[F])<32||R>126&&R=x||(R=y[F])<32||R>126&&R=x||(R=y[F])<32||R>126&&R=x||(R=y[F])<32||R>126&&R=0&&(E=j[B](this._params),E!==!0);B--)if(E instanceof Promise)return this._preserveStack(3,j,B,N,T),E;B<0&&this._csiHandlerFb(this._collect<<8|R,this._params),this.precedingJoinState=0;break;case 8:do switch(R){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(R-48)}while(++T47&&R<60);T--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const z=this._escHandlers[this._collect<<8|R];let V=z?z.length-1:-1;for(;V>=0&&(E=z[V](),E!==!0);V--)if(E instanceof Promise)return this._preserveStack(4,z,V,N,T),E;V<0&&this._escHandlerFb(this._collect<<8|R),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|R,this._params);break;case 13:for(let F=T+1;;++F)if(F>=x||(R=y[F])===24||R===26||R===27||R>127&&R=x||(R=y[F])<32||R>127&&R{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const f=c(5770),p=c(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(v,_){this._handlers[v]===void 0&&(this._handlers[v]=[]);const C=this._handlers[v];return C.push(_),{dispose:()=>{const w=C.indexOf(_);w!==-1&&C.splice(w,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,_,C){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(v,_,C);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(v,_,C))}start(){this.reset(),this._state=1}put(v,_,C){if(this._state!==3){if(this._state===1)for(;_0&&this._put(v,_,C)}}end(v,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,w=this._active.length-1,S=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,C=_,S=this._stack.fallThrough,this._stack.paused=!1),!S&&C===!1){for(;w>=0&&(C=this._active[w].end(v),C!==!0);w--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,C;w--}for(;w>=0;w--)if(C=this._active[w].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",v);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,_,C){this._hitLimit||(this._data+=(0,p.utf32ToString)(v,_,C),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let _=!1;if(this._hitLimit)_=!1;else if(v&&(_=this._handler(this._data),_ instanceof Promise))return _.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,_}}},8742:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class f{static fromArray(d){const v=new f;if(!d.length)return v;for(let _=Array.isArray(d[0])?1:0;_256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(v),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new f(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let v=0;v>8,C=255&this._subParamsIdx[v];C-_>0&&d.push(Array.prototype.slice.call(this._subParams,_,C))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>c?c:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>c?c:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const v=this._subParamsIdx[d]>>8,_=255&this._subParamsIdx[d];return _-v>0?this._subParams.subarray(v,_):null}getSubParamsAll(){const d={};for(let v=0;v>8,C=255&this._subParamsIdx[v];C-_>0&&(d[v]=this._subParams.slice(_,C))}return d}addDigit(d){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const _=this._digitIsSub?this._subParams:this.params,C=_[v-1];_[v-1]=~C?Math.min(10*C+d,c):d}}o.Params=f},5741:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,f){const p={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(p),f.dispose=()=>this._wrappedAddonDispose(p),f.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let f=-1;for(let p=0;p{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const f=c(3785),p=c(511);o.BufferApiView=class{constructor(d,v){this._buffer=d,this.type=v}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const v=this._buffer.lines.get(d);if(v)return new f.BufferLineApiView(v)}getNullCell(){return new p.CellData}}},3785:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const f=c(511);o.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,d){if(!(p<0||p>=this._line.length))return d?(this._line.loadCell(p,d),d):this._line.loadCell(p,new f.CellData)}translateToString(p,d,v){return this._line.translateToString(p,d,v)}}},8285:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const f=c(8771),p=c(8460),d=c(844);class v extends d.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=v},7975:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,f){return this._core.registerCsiHandler(c,(p=>f(p.toArray())))}addCsiHandler(c,f){return this.registerCsiHandler(c,f)}registerDcsHandler(c,f){return this._core.registerDcsHandler(c,((p,d)=>f(p,d.toArray())))}addDcsHandler(c,f){return this.registerDcsHandler(c,f)}registerEscHandler(c,f){return this._core.registerEscHandler(c,f)}addEscHandler(c,f){return this.registerEscHandler(c,f)}registerOscHandler(c,f){return this._core.registerOscHandler(c,f)}addOscHandler(c,f){return this.registerOscHandler(c,f)}}},7090:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(u,o,c){var f=this&&this.__decorate||function(S,y,x,b){var E,R=arguments.length,N=R<3?y:b===null?b=Object.getOwnPropertyDescriptor(y,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,y,x,b);else for(var D=S.length-1;D>=0;D--)(E=S[D])&&(N=(R<3?E(N):R>3?E(y,x,N):E(y,x))||N);return R>3&&N&&Object.defineProperty(y,x,N),N},p=this&&this.__param||function(S,y){return function(x,b){y(x,b,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=c(8460),v=c(844),_=c(5295),C=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let w=o.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(S){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(S.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(S.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(S,this))}resize(S,y){this.cols=S,this.rows=y,this.buffers.resize(S,y),this._onResize.fire({cols:S,rows:y})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(S,y=!1){const x=this.buffer;let b;b=this._cachedBlankLine,b&&b.length===this.cols&&b.getFg(0)===S.fg&&b.getBg(0)===S.bg||(b=x.getBlankLine(S,y),this._cachedBlankLine=b),b.isWrapped=y;const E=x.ybase+x.scrollTop,R=x.ybase+x.scrollBottom;if(x.scrollTop===0){const N=x.lines.isFull;R===x.lines.length-1?N?x.lines.recycle().copyFrom(b):x.lines.push(b.clone()):x.lines.splice(R+1,0,b.clone()),N?this.isUserScrolling&&(x.ydisp=Math.max(x.ydisp-1,0)):(x.ybase++,this.isUserScrolling||x.ydisp++)}else{const N=R-E+1;x.lines.shiftElements(E+1,N-1,-1),x.lines.set(R,b.clone())}this.isUserScrolling||(x.ydisp=x.ybase),this._onScroll.fire(x.ydisp)}scrollLines(S,y,x){const b=this.buffer;if(S<0){if(b.ydisp===0)return;this.isUserScrolling=!0}else S+b.ydisp>=b.ybase&&(this.isUserScrolling=!1);const E=b.ydisp;b.ydisp=Math.max(Math.min(b.ydisp+S,b.ybase),0),E!==b.ydisp&&(y||this._onScroll.fire(b.ydisp))}};o.BufferService=w=f([p(0,C.IOptionsService)],w)},7994:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,f){this._charsets[c]=f,this.glevel===c&&(this.charset=f)}}},1753:function(u,o,c){var f=this&&this.__decorate||function(b,E,R,N){var D,T=arguments.length,j=T<3?E:N===null?N=Object.getOwnPropertyDescriptor(E,R):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(b,E,R,N);else for(var B=b.length-1;B>=0;B--)(D=b[B])&&(j=(T<3?D(j):T>3?D(E,R,j):D(E,R))||j);return T>3&&j&&Object.defineProperty(E,R,j),j},p=this&&this.__param||function(b,E){return function(R,N){E(R,N,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=c(2585),v=c(8460),_=c(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:b=>b.button!==4&&b.action===1&&(b.ctrl=!1,b.alt=!1,b.shift=!1,!0)},VT200:{events:19,restrict:b=>b.action!==32},DRAG:{events:23,restrict:b=>b.action!==32||b.button!==3},ANY:{events:31,restrict:b=>!0}};function w(b,E){let R=(b.ctrl?16:0)|(b.shift?4:0)|(b.alt?8:0);return b.button===4?(R|=64,R|=b.action):(R|=3&b.button,4&b.button&&(R|=64),8&b.button&&(R|=128),b.action===32?R|=32:b.action!==0||E||(R|=3)),R}const S=String.fromCharCode,y={DEFAULT:b=>{const E=[w(b,!1)+32,b.col+32,b.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${S(E[0])}${S(E[1])}${S(E[2])}`},SGR:b=>{const E=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${w(b,!0)};${b.col};${b.row}${E}`},SGR_PIXELS:b=>{const E=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${w(b,!0)};${b.x};${b.y}${E}`}};let x=o.CoreMouseService=class extends _.Disposable{constructor(b,E){super(),this._bufferService=b,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const R of Object.keys(C))this.addProtocol(R,C[R]);for(const R of Object.keys(y))this.addEncoding(R,y[R]);this.reset()}addProtocol(b,E){this._protocols[b]=E}addEncoding(b,E){this._encodings[b]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(b){if(!this._protocols[b])throw new Error(`unknown protocol "${b}"`);this._activeProtocol=b,this._onProtocolChange.fire(this._protocols[b].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(b){if(!this._encodings[b])throw new Error(`unknown encoding "${b}"`);this._activeEncoding=b}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(b){if(b.col<0||b.col>=this._bufferService.cols||b.row<0||b.row>=this._bufferService.rows||b.button===4&&b.action===32||b.button===3&&b.action!==32||b.button!==4&&(b.action===2||b.action===3)||(b.col++,b.row++,b.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,b,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(b))return!1;const E=this._encodings[this._activeEncoding](b);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=b,!0}explainEvents(b){return{down:!!(1&b),up:!!(2&b),drag:!!(4&b),move:!!(8&b),wheel:!!(16&b)}}_equalEvents(b,E,R){if(R){if(b.x!==E.x||b.y!==E.y)return!1}else if(b.col!==E.col||b.row!==E.row)return!1;return b.button===E.button&&b.action===E.action&&b.ctrl===E.ctrl&&b.alt===E.alt&&b.shift===E.shift}};o.CoreMouseService=x=f([p(0,d.IBufferService),p(1,d.ICoreService)],x)},6975:function(u,o,c){var f=this&&this.__decorate||function(x,b,E,R){var N,D=arguments.length,T=D<3?b:R===null?R=Object.getOwnPropertyDescriptor(b,E):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,b,E,R);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(D<3?N(T):D>3?N(b,E,T):N(b,E))||T);return D>3&&T&&Object.defineProperty(b,E,T),T},p=this&&this.__param||function(x,b){return function(E,R){b(E,R,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=c(1439),v=c(8460),_=c(844),C=c(2585),w=Object.freeze({insertMode:!1}),S=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let y=o.CoreService=class extends _.Disposable{constructor(x,b,E){super(),this._bufferService=x,this._logService=b,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(w),this.decPrivateModes=(0,d.clone)(S)}reset(){this.modes=(0,d.clone)(w),this.decPrivateModes=(0,d.clone)(S)}triggerDataEvent(x,b=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;b&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),b&&this._onUserInput.fire(),this._logService.debug(`sending data "${x}"`,(()=>x.split("").map((R=>R.charCodeAt(0))))),this._onData.fire(x)}triggerBinaryEvent(x){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${x}"`,(()=>x.split("").map((b=>b.charCodeAt(0))))),this._onBinary.fire(x))}};o.CoreService=y=f([p(0,C.IBufferService),p(1,C.ILogService),p(2,C.IOptionsService)],y)},9074:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const f=c(8055),p=c(8460),d=c(844),v=c(6106);let _=0,C=0;class w extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList((x=>x==null?void 0:x.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(x){if(x.marker.isDisposed)return;const b=new S(x);if(b){const E=b.marker.onDispose((()=>b.dispose()));b.onDispose((()=>{b&&(this._decorations.delete(b)&&this._onDecorationRemoved.fire(b),E.dispose())})),this._decorations.insert(b),this._onDecorationRegistered.fire(b)}return b}reset(){for(const x of this._decorations.values())x.dispose();this._decorations.clear()}*getDecorationsAtCell(x,b,E){let R=0,N=0;for(const D of this._decorations.getKeyIterator(b))R=D.options.x??0,N=R+(D.options.width??1),x>=R&&x{_=N.options.x??0,C=_+(N.options.width??1),x>=_&&x{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const f=c(2585),p=c(8343);class d{constructor(..._){this._entries=new Map;for(const[C,w]of _)this.set(C,w)}set(_,C){const w=this._entries.get(_);return this._entries.set(_,C),w}forEach(_){for(const[C,w]of this._entries.entries())_(C,w)}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(f.IInstantiationService,this)}setService(v,_){this._services.set(v,_)}getService(v){return this._services.get(v)}createInstance(v,..._){const C=(0,p.getServiceDependencies)(v).sort(((y,x)=>y.index-x.index)),w=[];for(const y of C){const x=this._services.get(y.id);if(!x)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${y.id}.`);w.push(x)}const S=C.length>0?C[0].index:_.length;if(_.length!==S)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${S+1} conflicts with ${_.length} static arguments`);return new v(..._,...w)}}},7866:function(u,o,c){var f=this&&this.__decorate||function(S,y,x,b){var E,R=arguments.length,N=R<3?y:b===null?b=Object.getOwnPropertyDescriptor(y,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,y,x,b);else for(var D=S.length-1;D>=0;D--)(E=S[D])&&(N=(R<3?E(N):R>3?E(y,x,N):E(y,x))||N);return R>3&&N&&Object.defineProperty(y,x,N),N},p=this&&this.__param||function(S,y){return function(x,b){y(x,b,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=c(844),v=c(2585),_={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let C,w=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(S){super(),this._optionsService=S,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(S){for(let y=0;yJSON.stringify(N))).join(", ")})`);const R=b.apply(this,E);return C.trace(`GlyphRenderer#${b.name} return`,R),R}}},7302:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const f=c(8460),p=c(844),d=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const v=["normal","bold","100","200","300","400","500","600","700","800","900"];class _ extends p.Disposable{constructor(w){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const S={...o.DEFAULT_OPTIONS};for(const y in w)if(y in S)try{const x=w[y];S[y]=this._sanitizeAndValidateOption(y,x)}catch(x){console.error(x)}this.rawOptions=S,this.options={...S},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,S){return this.onOptionChange((y=>{y===w&&S(this.rawOptions[w])}))}onMultipleOptionChange(w,S){return this.onOptionChange((y=>{w.indexOf(y)!==-1&&S()}))}_setupOptions(){const w=y=>{if(!(y in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);return this.rawOptions[y]},S=(y,x)=>{if(!(y in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);x=this._sanitizeAndValidateOption(y,x),this.rawOptions[y]!==x&&(this.rawOptions[y]=x,this._onOptionChange.fire(y))};for(const y in this.rawOptions){const x={get:w.bind(this,y),set:S.bind(this,y)};Object.defineProperty(this.options,y,x)}}_sanitizeAndValidateOption(w,S){switch(w){case"cursorStyle":if(S||(S=o.DEFAULT_OPTIONS[w]),!(function(y){return y==="block"||y==="underline"||y==="bar"})(S))throw new Error(`"${S}" is not a valid value for ${w}`);break;case"wordSeparator":S||(S=o.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof S=="number"&&1<=S&&S<=1e3)break;S=v.includes(S)?S:o.DEFAULT_OPTIONS[w];break;case"cursorWidth":S=Math.floor(S);case"lineHeight":case"tabStopWidth":if(S<1)throw new Error(`${w} cannot be less than 1, value: ${S}`);break;case"minimumContrastRatio":S=Math.max(1,Math.min(21,Math.round(10*S)/10));break;case"scrollback":if((S=Math.min(S,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${S}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(S<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${S}`);break;case"rows":case"cols":if(!S&&S!==0)throw new Error(`${w} must be numeric, value: ${S}`);break;case"windowsPty":S=S??{}}return S}}o.OptionsService=_},2660:function(u,o,c){var f=this&&this.__decorate||function(_,C,w,S){var y,x=arguments.length,b=x<3?C:S===null?S=Object.getOwnPropertyDescriptor(C,w):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(_,C,w,S);else for(var E=_.length-1;E>=0;E--)(y=_[E])&&(b=(x<3?y(b):x>3?y(C,w,b):y(C,w))||b);return x>3&&b&&Object.defineProperty(C,w,b),b},p=this&&this.__param||function(_,C){return function(w,S){C(w,S,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=c(2585);let v=o.OscLinkService=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){const C=this._bufferService.buffer;if(_.id===void 0){const E=C.addMarker(C.ybase+C.y),R={data:_,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(R,E))),this._dataByLinkId.set(R.id,R),R.id}const w=_,S=this._getEntryIdKey(w),y=this._entriesWithId.get(S);if(y)return this.addLineToLink(y.id,C.ybase+C.y),y.id;const x=C.addMarker(C.ybase+C.y),b={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[x]};return x.onDispose((()=>this._removeMarkerFromLink(b,x))),this._entriesWithId.set(b.key,b),this._dataByLinkId.set(b.id,b),b.id}addLineToLink(_,C){const w=this._dataByLinkId.get(_);if(w&&w.lines.every((S=>S.line!==C))){const S=this._bufferService.buffer.addMarker(C);w.lines.push(S),S.onDispose((()=>this._removeMarkerFromLink(w,S)))}}getLinkData(_){var C;return(C=this._dataByLinkId.get(_))==null?void 0:C.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,C){const w=_.lines.indexOf(C);w!==-1&&(_.lines.splice(w,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};o.OscLinkService=v=f([p(0,d.IBufferService)],v)},8343:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",f="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(p){return p[f]||[]},o.createDecorator=function(p){if(o.serviceRegistry.has(p))return o.serviceRegistry.get(p);const d=function(v,_,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,S,y){S[c]===S?S[f].push({id:w,index:y}):(S[f]=[{id:w,index:y}],S[c]=S)})(d,v,C)};return d.toString=()=>p,o.serviceRegistry.set(p,d),d}},2585:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const f=c(8343);var p;o.IBufferService=(0,f.createDecorator)("BufferService"),o.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),o.ICoreService=(0,f.createDecorator)("CoreService"),o.ICharsetService=(0,f.createDecorator)("CharsetService"),o.IInstantiationService=(0,f.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(p||(o.LogLevelEnum=p={})),o.ILogService=(0,f.createDecorator)("LogService"),o.IOptionsService=(0,f.createDecorator)("OptionsService"),o.IOscLinkService=(0,f.createDecorator)("OscLinkService"),o.IUnicodeService=(0,f.createDecorator)("UnicodeService"),o.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const f=c(8460),p=c(225);class d{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,C,w=!1){return(16777215&_)<<3|(3&C)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const _=new p.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let C=0,w=0;const S=_.length;for(let y=0;y=S)return C+this.wcwidth(x);const R=_.charCodeAt(y);56320<=R&&R<=57343?x=1024*(x-55296)+R-56320+65536:C+=this.wcwidth(R)}const b=this.charProperties(x,w);let E=d.extractWidth(b);d.extractShouldJoin(b)&&(E-=d.extractWidth(w)),C+=E,w=b}return C}charProperties(_,C){return this._activeProvider.charProperties(_,C)}}o.UnicodeService=d}},r={};function a(u){var o=r[u];if(o!==void 0)return o.exports;var c=r[u]={exports:{}};return n[u].call(c.exports,c,c.exports,a),c.exports}var l={};return(()=>{var u=l;Object.defineProperty(u,"__esModule",{value:!0}),u.Terminal=void 0;const o=a(9042),c=a(3236),f=a(844),p=a(5741),d=a(8285),v=a(7975),_=a(7090),C=["cols","rows"];class w extends f.Disposable{constructor(y){super(),this._core=this.register(new c.Terminal(y)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const x=E=>this._core.options[E],b=(E,R)=>{this._checkReadonlyOptions(E),this._core.options[E]=R};for(const E in this._core.options){const R={get:x.bind(this,E),set:b.bind(this,E)};Object.defineProperty(this._publicOptions,E,R)}}_checkReadonlyOptions(y){if(C.includes(y))throw new Error(`Option "${y}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new v.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new _.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const y=this._core.coreService.decPrivateModes;let x="none";switch(this._core.coreMouseService.activeProtocol){case"X10":x="x10";break;case"VT200":x="vt200";break;case"DRAG":x="drag";break;case"ANY":x="any"}return{applicationCursorKeysMode:y.applicationCursorKeys,applicationKeypadMode:y.applicationKeypad,bracketedPasteMode:y.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:x,originMode:y.origin,reverseWraparoundMode:y.reverseWraparound,sendFocusMode:y.sendFocus,wraparoundMode:y.wraparound}}get options(){return this._publicOptions}set options(y){for(const x in y)this._publicOptions[x]=y[x]}blur(){this._core.blur()}focus(){this._core.focus()}input(y,x=!0){this._core.input(y,x)}resize(y,x){this._verifyIntegers(y,x),this._core.resize(y,x)}open(y){this._core.open(y)}attachCustomKeyEventHandler(y){this._core.attachCustomKeyEventHandler(y)}attachCustomWheelEventHandler(y){this._core.attachCustomWheelEventHandler(y)}registerLinkProvider(y){return this._core.registerLinkProvider(y)}registerCharacterJoiner(y){return this._checkProposedApi(),this._core.registerCharacterJoiner(y)}deregisterCharacterJoiner(y){this._checkProposedApi(),this._core.deregisterCharacterJoiner(y)}registerMarker(y=0){return this._verifyIntegers(y),this._core.registerMarker(y)}registerDecoration(y){return this._checkProposedApi(),this._verifyPositiveIntegers(y.x??0,y.width??0,y.height??0),this._core.registerDecoration(y)}hasSelection(){return this._core.hasSelection()}select(y,x,b){this._verifyIntegers(y,x,b),this._core.select(y,x,b)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(y,x){this._verifyIntegers(y,x),this._core.selectLines(y,x)}dispose(){super.dispose()}scrollLines(y){this._verifyIntegers(y),this._core.scrollLines(y)}scrollPages(y){this._verifyIntegers(y),this._core.scrollPages(y)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(y){this._verifyIntegers(y),this._core.scrollToLine(y)}clear(){this._core.clear()}write(y,x){this._core.write(y,x)}writeln(y,x){this._core.write(y),this._core.write(`\r -`,x)}paste(y){this._core.paste(y)}refresh(y,x){this._verifyIntegers(y,x),this._core.refresh(y,x)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(y){this._addonManager.loadAddon(this,y)}static get strings(){return o}_verifyIntegers(...y){for(const x of y)if(x===1/0||isNaN(x)||x%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...y){for(const x of y)if(x&&(x===1/0||isNaN(x)||x%1!=0||x<0))throw new Error("This API only accepts positive integers")}}u.Terminal=w})(),l})()))})(yp)),yp.exports}var PB=FB();function Fb(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r{const n=t.current;if(!n)return;const r=new PB.Terminal({convertEol:!0,disableStdin:!0,fontSize:12,fontFamily:'ui-monospace, "SF Mono", Menlo, Consolas, monospace',scrollback:2e4,theme:{background:"#1a1a1a",foreground:"#e6e1e0",cursor:"#1a1a1a",selectionBackground:"#2c3441"}}),a=new HB.FitAddon;r.loadAddon(a),r.open(n);try{a.fit()}catch{}const l=new ResizeObserver(()=>{try{a.fit()}catch{}});l.observe(n);let u=!1,o=0,c=!1,f=!1;async function p(){if(c){f=!0;return}c=!0;try{for(;;){const v=await uT(e,o);if(u)return;if(v.dataBase64&&r.write(Fb(v.dataBase64)),o=v.nextOffset,v.eof)break}}catch{}finally{c=!1,f&&!u&&(f=!1,p())}}const d=ZT(e,v=>{if(u)return;const _=Fb(v.dataBase64);!c&&v.offset===o?(r.write(_),o+=_.length):v.offset+_.length>o&&p()});return p(),()=>{u=!0,d(),l.disconnect(),r.dispose()}},[e]),g.jsx("div",{ref:t,style:{width:"100%",height:"100%"}})}const sa="__uncommitted__";function UB({state:e}){return!e||e.loading?g.jsx("div",{className:"changes-note",children:"Loading diff…"}):e.error?g.jsx("div",{className:"error",children:e.error}):e.payload?e.payload.truncated?g.jsx(BB,{bytesRead:e.payload.bytesRead,byteLimit:e.payload.byteLimit}):g.jsx(jC,{diff:e.payload.diff}):g.jsx("div",{className:"diff-empty",children:"No changes."})}function GB({experiment:e,project:t,view:n,runs:r,selectedRunId:a,onSelectRun:l}){const u=r.filter(o=>o.experimentId===e.id).sort((o,c)=>c.createdAt-o.createdAt);return n==="terminal"?g.jsx(qB,{experiment:e,expRuns:u,selectedRunId:a,onSelectRun:l}):g.jsx(VB,{experiment:e,project:t})}function qB({experiment:e,expRuns:t,selectedRunId:n,onSelectRun:r}){const[a,l]=G.useState(null),[u,o]=G.useState(!1),c=G.useRef(null),f=n&&t.find(C=>C.id===n)||t[0]||null,p=(f==null?void 0:f.status)==="running"||(f==null?void 0:f.status)==="starting",d=C=>{const w=t.findIndex(S=>S.id===C);return w===-1?t.length:t.length-w},v=G.useRef(null);G.useEffect(()=>{if(v.current===null){v.current=new Set(t.map(w=>w.id));return}const C=t.find(w=>!v.current.has(w.id));for(const w of t)v.current.add(w.id);C&&r(C.id)},[t,r]),G.useEffect(()=>{if(!u)return;const C=w=>{var S;(S=c.current)!=null&&S.contains(w.target)||o(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[u]);async function _(){if(f){l(null);try{await hx(f.id)}catch(C){l(C instanceof Error?C.message:String(C))}}}return g.jsxs("div",{className:"term-view",children:[g.jsxs("div",{className:"term-bar",children:[g.jsx("div",{className:"term-title",title:e.title||e.slug,children:e.title||e.slug}),g.jsx("span",{style:{flex:1}}),a&&g.jsx("span",{className:"error",children:a}),p&&g.jsxs("button",{className:"btn sm ghost",onClick:()=>void _(),children:[g.jsx(rN,{size:13}),"Stop"]}),t.length>0&&f&&g.jsxs("div",{className:"run-history",ref:c,children:[g.jsxs("button",{className:"run-picker",title:"Switch run",onClick:()=>o(C=>!C),children:[g.jsxs("span",{className:"run-label",children:["Run ",d(f.id)]}),g.jsx(Xo,{status:f.status}),g.jsx(gs,{size:14,className:"run-picker-chev"})]}),u&&g.jsx("div",{className:"history-menu",children:t.map(C=>g.jsxs("button",{className:`history-item ${C.id===(f==null?void 0:f.id)?"active":""}`,onClick:()=>{r(C.id),o(!1)},children:[g.jsxs("span",{className:"run-label",children:["Run ",d(C.id)]}),g.jsx(Xo,{status:C.status}),g.jsx("span",{className:"when",children:Aa(C.createdAt)})]},C.id))})]})]}),g.jsx("div",{className:"term-fill",children:f?g.jsx($B,{runId:f.id},f.id):g.jsx("div",{className:"term-empty",children:"No runs yet — ask the agent to launch one."})})]})}function VB({experiment:e,project:t}){const[n,r]=G.useState(null),[a,l]=G.useState(null),[u,o]=G.useState(null),[c,f]=G.useState(null),[p,d]=G.useState({}),v=!!(u&&u.diff.trim()!==""&&u.experimentId===e.id);async function _(){l(null);try{const[w,S]=await Promise.all([hT(e.id),Xy(e.projectId)]);r(w),o(S),f(y=>{var b;return y!==null?y:S.diff.trim()!==""&&S.experimentId===e.id?sa:((b=w[0])==null?void 0:b.sha)??null})}catch(w){l(w instanceof Error?w.message:String(w))}}G.useEffect(()=>{n===null&&!a&&_()},[n,a,e.id]),G.useEffect(()=>{const w=setInterval(()=>{Xy(e.projectId).then(o).catch(()=>{})},5e3);return()=>clearInterval(w)},[e.projectId]),G.useEffect(()=>{var w;c===sa&&u&&!v&&f(((w=n==null?void 0:n[0])==null?void 0:w.sha)??null)},[c,u,v,n]),G.useEffect(()=>{if(!c||c===sa||p[c])return;const w=c;d(S=>({...S,[w]:{loading:!0}})),fT(e.id,w).then(S=>d(y=>({...y,[w]:{loading:!1,payload:S}}))).catch(S=>d(y=>({...y,[w]:{loading:!1,error:S instanceof Error?S.message:String(S)}})))},[c,p,e.id]);const C=!v&&((n==null?void 0:n.length)??0)===0;return g.jsx("div",{className:"drawer",children:g.jsx("div",{className:"drawer-body",children:g.jsxs("div",{className:"drawer-section",children:[g.jsxs("div",{className:"changes-branch",children:[g.jsx("span",{className:"ctl-label",children:"Branch"}),g.jsx(bO,{owner:t.githubOwner,repo:t.githubRepo,branch:e.branchName})]}),a?g.jsx("div",{className:"error",children:a}):n===null?g.jsx("div",{className:"changes-note",children:"Loading changes…"}):C?g.jsx("div",{className:"changes-note",children:"No changes yet — the agent hasn't committed on this branch."}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"commit-picker",children:[g.jsx("span",{className:"ctl-label",children:"Commit"}),c===sa&&g.jsx("span",{className:"uncommitted-dot"}),g.jsxs("select",{className:"input sm",value:c??"",onChange:w=>f(w.target.value),children:[v&&g.jsx("option",{value:sa,children:"● Uncommitted changes"}),n.map(w=>g.jsxs("option",{value:w.sha,children:[w.sha.slice(0,7)," — ",w.subject]},w.sha))]}),g.jsx("button",{className:"icon-btn",title:"Refresh","aria-label":"Refresh",onClick:()=>void _(),children:g.jsx(Dg,{size:14})})]}),g.jsx("div",{style:{marginTop:10},children:c===sa&&u?u.truncated?g.jsxs("div",{className:"truncated-notice",children:[g.jsx("h4",{children:"Diff too large to display"}),g.jsx("p",{children:"The uncommitted diff is too large to display. View it locally with git."})]}):g.jsx(jC,{diff:u.diff}):c?g.jsx(UB,{state:p[c]}):g.jsx("div",{className:"changes-note",children:"Select a commit to view its diff."})})]})]})})})}function YB({projectId:e,path:t,sessionId:n,gitRef:r,onOpenFile:a}){const[l,u]=G.useState(null),[o,c]=G.useState(null),[f,p]=G.useState(!0),[d,v]=G.useState(0),_=/\.(md|mdx|markdown)$/i.test(t),[C,w]=G.useState(!1);G.useEffect(()=>{let y=!1;return p(!0),dT(e,t,{sessionId:n,ref:r}).then(x=>{y||(u(x),c(null))}).catch(x=>{y||c(x.message)}).finally(()=>{y||p(!1)}),()=>{y=!0}},[e,t,n,r,d]);const S=y=>r?`File not found on branch ${r}.`:n&&y.root==="clone"?"This session's worktree isn't available, and the file isn't in the project clone.":`File not found in the ${y.root==="worktree"?"session's worktree":"project clone"}.`;return g.jsxs("div",{className:"file-view",children:[g.jsxs("div",{className:"file-view-header",children:[g.jsx(sx,{size:13,style:{flexShrink:0}}),g.jsx("code",{className:"file-view-path",title:t,children:t}),r&&g.jsx("code",{className:"file-view-ref",title:`Committed state of ${r}`,children:r}),_&&g.jsx("button",{className:`icon-btn ${C?"active":""}`,"data-tip":C?"Rendered view":"View source","aria-label":C?"Rendered view":"View source",onClick:()=>w(y=>!y),children:g.jsx(tx,{size:13})}),g.jsx("button",{className:"icon-btn","data-tip":"Reload file","aria-label":"Reload file",onClick:()=>v(y=>y+1),children:f?g.jsx("span",{className:"spinner"}):g.jsx(Dg,{size:13})})]}),g.jsx("div",{className:"file-view-body",children:o?g.jsxs("div",{className:"file-view-note",children:["Failed to load file: ",o]}):l===null?g.jsx("div",{className:"file-view-note",children:"Loading…"}):l.notFound?g.jsx("div",{className:"file-view-note",children:S(l)}):g.jsxs(g.Fragment,{children:[!r&&n&&l.root==="clone"&&g.jsx("div",{className:"file-view-note",children:"This session's worktree isn't available — showing the project clone's copy."}),_&&!C?g.jsx("div",{className:"file-view-md",children:g.jsx(Wo,{text:l.content,onOpenFile:a&&(y=>a(y,n,r))})}):g.jsx(Vw,{text:l.content,path:t}),l.truncated&&g.jsx("div",{className:"file-view-note",children:"File truncated — showing the first 512 KB."})]})})]})}function WB({projectName:e,onHome:t,onCollapse:n}){return g.jsxs("div",{className:"rail-brand",children:[g.jsxs("button",{className:"brand",onClick:t,title:"All projects",children:[g.jsx(du,{size:15}),g.jsx("span",{className:"brand-project",children:e})]}),n&&g.jsx("button",{className:"icon-btn",title:"Hide sidebar","aria-label":"Hide sidebar",onClick:n,children:g.jsx(ox,{size:15})})]})}function XB({onDone:e}){const[t,n]=G.useState(0),[r,a]=G.useState(null),[l,u]=G.useState(null),[o,c]=G.useState(null),[f,p]=G.useState(null),[d,v]=G.useState(!1),_=w=>{v(!0),Promise.allSettled([Lg(w).then(a),mx().then(u),px().then(c),HT().then(p)]).finally(()=>v(!1))};G.useEffect(()=>_(!1),[]);const C=()=>{PT((f==null?void 0:f.enabled)??!0).catch(()=>{}),e()};return g.jsx("div",{className:"home onboarding",children:g.jsx("div",{className:"home-inner",children:t===0?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"onb-eyebrow",children:["Open",g.jsx("span",{children:"Research"})," · step 1 of 4"]}),g.jsx("h2",{className:"onb-title",children:"Your coding agents"}),g.jsx("p",{className:"onb-sub",children:"orx found the agent CLIs on this machine and drives them directly — chat and autoresearch run on your own logins, no extra API keys."}),g.jsx("div",{className:"onb-cards",children:r===null?g.jsxs("div",{className:"onb-loading",children:[g.jsx("span",{className:"spinner"})," Detecting Claude Code, Codex, OpenCode…"]}):r.map(w=>g.jsx(ZB,{h:w},w.id))}),g.jsxs("div",{className:"onb-actions",children:[g.jsxs("button",{className:"btn ghost",onClick:()=>_(!0),disabled:d,children:[g.jsx(ku,{size:12,className:d?"spin":""})," Re-check"]}),g.jsx("div",{style:{flex:1}}),g.jsxs("button",{className:"btn primary",onClick:()=>n(1),children:["Continue ",g.jsx(Fc,{size:13})]})]})]}):t===1?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"onb-eyebrow",children:["Open",g.jsx("span",{children:"Research"})," · step 2 of 4"]}),g.jsx("h2",{className:"onb-title",children:"Git & GitHub"}),g.jsx("p",{className:"onb-sub",children:"A project is a clone of one of your GitHub repos, made with your own git credentials. Every experiment becomes a branch pushed to that repo — compute jobs clone it from there."}),g.jsx("div",{className:"onb-cards",children:g.jsx(QB,{git:l,onUpdate:u})}),g.jsxs("div",{className:"onb-actions",children:[g.jsxs("button",{className:"btn ghost",onClick:()=>n(0),children:[g.jsx(du,{size:12})," Back"]}),g.jsxs("button",{className:"btn ghost",onClick:()=>_(!1),disabled:d,children:[g.jsx(ku,{size:12,className:d?"spin":""})," Re-check"]}),g.jsx("div",{style:{flex:1}}),g.jsxs("button",{className:"btn primary",onClick:()=>n(2),children:["Continue ",g.jsx(Fc,{size:13})]})]})]}):t===2?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"onb-eyebrow",children:["Open",g.jsx("span",{children:"Research"})," · step 3 of 4"]}),g.jsx("h2",{className:"onb-title",children:"Where orx keeps your data"}),g.jsx("p",{className:"onb-sub",children:"Your local database, run logs, artifacts, and chat attachments live in one folder on this machine. The default works for most people — change it if you'd rather keep it on another disk."}),g.jsx("div",{className:"onb-cards",children:g.jsx(JB,{dataDir:o,onUpdate:c})}),g.jsxs("div",{className:"onb-actions",children:[g.jsxs("button",{className:"btn ghost",onClick:()=>n(1),children:[g.jsx(du,{size:12})," Back"]}),g.jsx("div",{style:{flex:1}}),g.jsxs("button",{className:"btn primary",onClick:()=>n(3),children:["Continue ",g.jsx(Fc,{size:13})]})]})]}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"onb-eyebrow",children:["Open",g.jsx("span",{children:"Research"})," · step 4 of 4"]}),g.jsx("h2",{className:"onb-title",children:"Usage analytics"}),g.jsx("p",{className:"onb-sub",children:"orx can send anonymous usage analytics to help improve the tool. No code, prompts, file contents, or identifiers are ever sent — just a random per-install id, the command run, and your OS."}),g.jsx("div",{className:"onb-cards",children:g.jsx(eI,{telemetry:f,onUpdate:p})}),g.jsxs("div",{className:"onb-actions",children:[g.jsxs("button",{className:"btn ghost",onClick:()=>n(2),children:[g.jsx(du,{size:12})," Back"]}),g.jsx("div",{style:{flex:1}}),g.jsxs("button",{className:"btn primary",onClick:C,children:["Create your first project ",g.jsx(Fc,{size:13})]})]})]})})})}function KB(e){return e.agentReady?{cls:"st-done",label:"connected"}:e.installed?{cls:"st-starting",label:"not signed in"}:{cls:"st-idle",label:"not detected"}}function ZB({h:e}){var r,a;const t=KB(e),n=(r=e.version)==null?void 0:r.replace(/\s*\(.*\)$/,"");return g.jsxs("div",{className:"onb-card",children:[g.jsxs("div",{className:"onb-card-head",children:[g.jsx("span",{className:"onb-card-name",children:e.name}),g.jsxs("span",{className:`status-badge ${t.cls}`,children:[e.agentReady?g.jsx(vn,{size:12,strokeWidth:3}):g.jsx("span",{className:"dot"}),t.label]})]}),e.agentReady?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"onb-card-detail mono",children:[e.account??"API key",e.plan?` · ${e.plan}`:""]}),g.jsx("div",{className:"onb-card-meta",children:[n,e.models.length>0&&`${e.models.length} model${e.models.length===1?"":"s"} — ${e.models.slice(0,3).map(l=>Au(l.id)).join(", ")}${e.models.length>3?", …":""}`].filter(Boolean).join(" · ")})]}):g.jsx("div",{className:"onb-card-meta",children:(a=e.agentNote)==null?void 0:a.replace(/`/g,"")})]})}function QB({git:e,onUpdate:t}){const[n,r]=G.useState(!1),a=()=>{navigator.clipboard.writeText("gh auth login").then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};if(e===null)return g.jsxs("div",{className:"onb-loading",children:[g.jsx("span",{className:"spinner"})," Checking git…"]});if(!e.gitVersion)return g.jsxs("div",{className:"onb-card",children:[g.jsxs("div",{className:"onb-card-head",children:[g.jsx("span",{className:"onb-card-name",children:"git"}),g.jsxs("span",{className:"status-badge st-failed",children:[g.jsx("span",{className:"dot"})," not found"]})]}),g.jsx("div",{className:"onb-card-meta",children:"Install git to clone projects, then re-open orx."})]});const l=[e.userName,e.userEmail&&`<${e.userEmail}>`].filter(Boolean).join(" ");return g.jsxs("div",{className:"onb-card",children:[g.jsxs("div",{className:"onb-card-row",children:[g.jsx("span",{className:"onb-card-name",children:"git"}),g.jsxs("span",{className:"onb-card-detail mono",children:[e.gitVersion.replace(/^git version /,""),l?` · ${l}`:""]}),g.jsxs("span",{className:`status-badge ${l?"st-done":"st-starting"}`,children:[l?g.jsx(vn,{size:12,strokeWidth:3}):g.jsx("span",{className:"dot"}),l?"ready":"no identity"]})]}),g.jsxs("div",{className:"onb-card-row",children:[g.jsx("span",{className:"onb-card-name",children:"GitHub"}),g.jsx("span",{className:"onb-card-detail mono",children:e.githubTokenSource==="env"?"token from GITHUB_TOKEN":e.githubTokenSource==="stored"?"token saved in orx":e.githubTokenSource==="gh"?"signed in via gh CLI":"not connected"}),g.jsxs("span",{className:`status-badge ${e.githubTokenSource?"st-done":"st-starting"}`,children:[e.githubTokenSource?g.jsx(vn,{size:12,strokeWidth:3}):g.jsx("span",{className:"dot"}),e.githubTokenSource?"ready":"check"]})]}),!l&&g.jsxs("div",{className:"onb-card-meta",children:["Set ",g.jsx("code",{children:"git config --global user.name / user.email"})," so the agent can commit."]}),!e.githubTokenSource&&g.jsxs("div",{className:"onb-gh-options",children:[g.jsx("div",{className:"onb-card-meta",children:"GitHub access is used to clone your repos and push experiment branches. Connect either way:"}),g.jsxs("div",{className:"onb-gh-option",children:[g.jsx("span",{className:"onb-gh-option-label",children:"GitHub CLI"}),g.jsx("div",{className:"onb-gh-option-body",children:e.ghInstalled?g.jsxs(g.Fragment,{children:[g.jsx("code",{className:"onb-gh-cmd",children:"gh auth login"}),g.jsxs("button",{className:"btn ghost",onClick:a,children:[n?g.jsx(vn,{size:12,strokeWidth:3}):g.jsx(Ng,{size:12}),n?"Copied":"Copy"]}),g.jsx("span",{className:"onb-gh-hint",children:"run in a terminal, then Re-check"})]}):g.jsxs("span",{className:"onb-gh-hint",children:["install the GitHub CLI, run ",g.jsx("code",{children:"gh auth login"}),", then Re-check"]})})]}),g.jsx("div",{className:"onb-gh-or",children:"or"}),g.jsxs("div",{className:"onb-gh-option",children:[g.jsx("span",{className:"onb-gh-option-label",children:"Paste a token"}),g.jsx(Iw,{onSaved:t})]})]})]})}function JB({dataDir:e,onUpdate:t}){const[n,r]=G.useState(""),[a,l]=G.useState(!1),[u,o]=G.useState(!1),[c,f]=G.useState(null);if(G.useEffect(()=>{e&&!n&&r(e.current)},[e,n]),e===null)return g.jsxs("div",{className:"onb-loading",children:[g.jsx("span",{className:"spinner"})," Checking storage…"]});if(e.source==="env")return g.jsxs("div",{className:"onb-card",children:[g.jsxs("div",{className:"onb-card-row",children:[g.jsx("span",{className:"onb-card-name",children:"Data folder"}),g.jsx("span",{className:"onb-card-detail mono",children:e.current}),g.jsxs("span",{className:"status-badge st-done",children:[g.jsx(vn,{size:12,strokeWidth:3})," pinned"]})]}),g.jsxs("div",{className:"onb-card-meta",children:["Set by the ",g.jsx("code",{children:"ORX_DATA_DIR"})," environment variable."]})]});const p=n.trim(),d=p!==""&&p!==e.current;async function v(){if(!(u||!d)){o(!0),f(null);try{t(await CT(p)),l(!1)}catch(_){f(_ instanceof Error?_.message:String(_))}finally{o(!1)}}}return g.jsxs("div",{className:"onb-card",children:[g.jsxs("div",{className:"onb-card-row",children:[g.jsx("span",{className:"onb-card-name",children:"Data folder"}),g.jsx("span",{className:"onb-card-detail mono",children:e.current}),g.jsxs("span",{className:`status-badge ${e.isDefault?"st-idle":"st-done"}`,children:[e.isDefault?g.jsx("span",{className:"dot"}):g.jsx(vn,{size:12,strokeWidth:3}),e.isDefault?"default":"custom"]})]}),a?g.jsxs(g.Fragment,{children:[g.jsx("input",{className:"mono",type:"text",value:n,onChange:_=>r(_.target.value),placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,style:{width:"100%",marginTop:10}}),c&&g.jsx("div",{className:"error",style:{marginTop:8},children:c}),g.jsxs("div",{style:{display:"flex",gap:6,marginTop:10},children:[g.jsx("button",{className:"btn primary",onClick:v,disabled:u||!d,children:u?"Saving…":"Use this folder"}),g.jsx("button",{className:"btn ghost",onClick:()=>{l(!1),r(e.current),f(null)},disabled:u,children:"Cancel"})]})]}):g.jsxs("div",{className:"onb-card-meta",style:{display:"flex",gap:10,alignItems:"center"},children:["The default is fine for most setups.",g.jsx("button",{className:"btn ghost",onClick:()=>l(!0),children:"Change…"})]})]})}function eI({telemetry:e,onUpdate:t}){const[n,r]=G.useState(!1);if(e===null)return g.jsxs("div",{className:"onb-loading",children:[g.jsx("span",{className:"spinner"})," Checking analytics…"]});const a=e.enabled,l=!a&&e.reason!==null&&e.reason!=="disabled via `orx telemetry off`",u=o=>{n||o===a||(r(!0),FT(o).then(t).finally(()=>r(!1)))};return g.jsxs("div",{className:"onb-card",children:[g.jsxs("div",{className:"onb-card-head",children:[g.jsxs("div",{children:[g.jsx("div",{className:"onb-card-name",children:"Share anonymous usage analytics"}),g.jsx("div",{className:"onb-card-meta",style:{marginTop:2},children:a?"On — helps prioritize what to build next.":l?`Off — ${e.reason}.`:"Off — you can turn it back on anytime."})]}),g.jsxs("div",{style:{display:"flex",gap:6,flex:"none"},children:[g.jsxs("button",{className:`btn ${a?"primary":"ghost"}`,onClick:()=>u(!0),disabled:n,"aria-pressed":a,children:[a?g.jsx(vn,{size:12,strokeWidth:3}):null," On"]}),g.jsxs("button",{className:`btn ${a?"ghost":"primary"}`,onClick:()=>u(!1),disabled:n,"aria-pressed":!a,children:[a?null:g.jsx(vn,{size:12,strokeWidth:3})," Off"]})]})]}),g.jsxs("div",{className:"onb-card-meta",style:{marginTop:12},children:["Sent: a random per-install id, the command run, CLI version, and OS. Never sent: code, prompts, file contents, paths, or repo names. Change anytime in Settings or with"," ",g.jsx("code",{children:"orx telemetry off"}),"."]}),l&&g.jsxs("div",{className:"onb-card-meta",style:{marginTop:8},children:["Note: this run is off because of ",e.reason,", which overrides the saved choice."]})]})}function Jc(e){const t=e.trim().replace(/^git@github\.com:/i,"").replace(/^https?:\/\/(www\.)?github\.com\//i,"").replace(/\.git$/i,"").replace(/^\/+|\/+$/g,""),[n,r]=t.split("/");return!n||!r||/[\s:@]/.test(n)||/[\s:@]/.test(r)?null:{owner:n,repo:r}}function Pb(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/,"")||"experiment"}function tI(e){const r=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(r)?r:null}function nI(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function iI({onCreated:e,onCancel:t}){var $;const[n,r]=G.useState("paper"),[a,l]=G.useState("use"),[u,o]=G.useState(""),[c,f]=G.useState(""),[p,d]=G.useState(!1),[v,_]=G.useState("main"),[C,w]=G.useState(!1),[S,y]=G.useState(null),[x,b]=G.useState(""),[E,R]=G.useState([]),[N,D]=G.useState(!1),[T,j]=G.useState(null),[B,z]=G.useState(!1),[V,F]=G.useState(null),P=G.useRef(0),Y=Jc(u),q=!!(c.trim()&&(n==="new"||n==="existing"&&Y!==null||n==="paper"&&T!==null&&(u.trim()===""||Y!==null))),X=Q=>{var re;o(Q),p||f(((re=Jc(Q))==null?void 0:re.repo)??"")};async function K(Q){const re=++P.current;R([]),D(!1),z(!0),F(null);try{const se=await rT(Q);if(re!==P.current)return;j(se);const Z=se.repoUrl?Jc(se.repoUrl):null;o(Z?`${Z.owner}/${Z.repo}`:""),l("fork"),p||f((Z==null?void 0:Z.repo)??(se.title??"").trim().slice(0,60))}catch(se){if(re!==P.current)return;F(se instanceof Error?se.message:String(se))}finally{re===P.current&&z(!1)}}function L(){P.current++,j(null),b(""),R([]),F(null),o(""),p||f("")}G.useEffect(()=>{if(n!=="paper"||T)return;const Q=x.trim(),re=tI(Q);if(!re&&Q.length<3){R([]),D(!1);return}const se=++P.current;re||D(!0);const Z=setTimeout(()=>{if(re){K(re);return}iT(Q).then(H=>{se===P.current&&R(H)}).catch(H=>{se===P.current&&(R([]),F(H instanceof Error?H.message:String(H)))}).finally(()=>{se===P.current&&D(!1)})},350);return()=>clearTimeout(Z)},[n,T,x]);async function M(Q){if(Q.preventDefault(),!(!q||C)){w(!0),y(null);try{const re=await nT(n==="new"?{name:c.trim(),createRepo:!0}:n==="paper"&&!Y?{name:c.trim(),createRepo:!0,paperId:T.paperId}:{name:c.trim(),githubOwner:Y.owner,githubRepo:Y.repo,baselineBranch:v.trim()||"main",forkRepo:a==="fork",...n==="paper"?{paperId:T.paperId}:{}});e(re)}catch(re){y(re instanceof Error?re.message:String(re))}finally{w(!1)}}}const O=n==="new"||n==="paper"&&!Y,U=g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"seg form-seg",children:[g.jsx("button",{type:"button",className:a==="use"?"active":"",onClick:()=>l("use"),children:"Use this repo"}),g.jsx("button",{type:"button",className:a==="fork"?"active":"",onClick:()=>l("fork"),children:"Fork a copy"})]}),g.jsx("span",{className:"repo-hint",children:a==="fork"?`snapshots ${Y?`${Y.owner}/${Y.repo}`:"the repo"} into a private repo on your account`:"experiments push branches here — if you can't push to it, a fork is made automatically"}),g.jsxs("div",{className:"row2",children:[g.jsxs("label",{children:["Project name",g.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research"})]}),g.jsxs("label",{children:["Branch",g.jsx("input",{value:v,onChange:Q=>_(Q.target.value),placeholder:"main"})]})]})]});return g.jsxs("form",{className:"form",onSubmit:M,children:[g.jsxs("div",{className:"seg form-seg",children:[g.jsx("button",{type:"button",className:n==="paper"?"active":"",onClick:()=>r("paper"),children:"From a paper"}),g.jsx("button",{type:"button",className:n==="existing"?"active":"",onClick:()=>r("existing"),children:"Existing repo"}),g.jsx("button",{type:"button",className:n==="new"?"active":"",onClick:()=>r("new"),children:"New blank repo"})]}),n==="existing"&&g.jsxs(g.Fragment,{children:[g.jsxs("label",{children:["GitHub repository",g.jsx("input",{value:u,onChange:Q=>X(Q.target.value),placeholder:"https://github.com/karpathy/nanoGPT",autoFocus:!0,spellCheck:!1}),g.jsx("span",{className:`repo-hint mono ${Y?"ok":""}`,children:Y?`${Y.owner} / ${Y.repo}`:u.trim()?"paste a GitHub URL or owner/repo":"URL or owner/repo — cloned with your git credentials"})]}),U]}),n==="paper"&&(T===null?g.jsxs(g.Fragment,{children:[g.jsxs("label",{children:["Paper",g.jsx("input",{value:x,onChange:Q=>b(Q.target.value),placeholder:"arXiv id, URL, or title — e.g. 1706.03762",autoFocus:!0,spellCheck:!1}),g.jsx("span",{className:`repo-hint ${V?"":"mono"}`,children:B?"looking up paper…":N?"searching alphaXiv…":V??"searches alphaXiv by title — or paste an arXiv id / URL"})]}),E.length>0&&g.jsx("div",{className:"paper-results",children:E.map(Q=>g.jsxs("button",{type:"button",onClick:()=>void K(Q.paperId),children:[g.jsx("span",{className:"title",children:nI(Q.title)}),g.jsx("span",{className:"id",children:Q.paperId})]},Q.paperId))})]}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"paper-pick",children:[g.jsxs("div",{className:"meta",children:[g.jsx("div",{className:"title",children:T.title||T.paperId}),g.jsxs("div",{className:"id",children:["arXiv ",T.paperId]})]}),g.jsx("button",{type:"button",className:"btn ghost",onClick:L,children:"Change"})]}),g.jsxs("label",{children:["GitHub repository",T.repoUrl?"":" (optional)",g.jsx("input",{value:u,onChange:Q=>X(Q.target.value),placeholder:"owner/repo — leave blank for a new private repo",spellCheck:!1}),g.jsx("span",{className:`repo-hint mono ${Y?"ok":""}`,children:Y?`${Y.owner} / ${Y.repo}`+(T.repoUrl&&(($=Jc(T.repoUrl))==null?void 0:$.repo)===Y.repo?` · linked on alphaXiv${T.repoStars!=null?` · ★ ${T.repoStars}`:""}`:""):u.trim()?"paste a GitHub URL or owner/repo":"no code linked to this paper — a blank private repo will be created"})]}),Y?U:g.jsxs("label",{children:["Project name",g.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research"}),g.jsx("span",{className:`repo-hint mono ${c.trim()?"ok":""}`,children:c.trim()?`creates github.com/you/${Pb(c)} · private`:"a blank private repo is created on your GitHub account"})]})]})),n==="new"&&g.jsxs("label",{children:["Project name",g.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research",autoFocus:!0}),g.jsx("span",{className:`repo-hint mono ${c.trim()?"ok":""}`,children:c.trim()?`creates github.com/you/${Pb(c)} · private`:"a blank private repo is created on your GitHub account"})]}),S&&g.jsx("div",{className:"error",children:S}),g.jsxs("div",{className:"actions",children:[t&&g.jsx("button",{type:"button",className:"btn ghost",onClick:t,children:"Cancel"}),g.jsx("button",{type:"submit",className:"btn primary",disabled:!q||C,children:C?O?"Creating repo…":a==="fork"?"Forking repo…":"Cloning repo…":"Create project"})]})]})}function $b({projects:e,onOpen:t,onCreated:n,onDeleted:r}){const[a,l]=G.useState(!1),[u,o]=G.useState(null);async function c(f){if(window.confirm(`Delete project "${f.name}"? +`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(T){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),y.isLinux&&T&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(T){const j=this._getMouseBufferCoords(T),B=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!!(B&&z&&j)&&this._areCoordsInSelection(j,B,z)}isCellInSelection(T,j){const B=this._model.finalSelectionStart,z=this._model.finalSelectionEnd;return!(!B||!z)&&this._areCoordsInSelection([T,j],B,z)}_areCoordsInSelection(T,j,B){return T[1]>j[1]&&T[1]=j[0]&&T[0]=j[0]}_selectWordAtCursor(T,j){var V,F;const B=(F=(V=this._linkifier.currentLink)==null?void 0:V.link)==null?void 0:F.range;if(B)return this._model.selectionStart=[B.start.x-1,B.start.y-1],this._model.selectionStartLength=(0,x.getRangeLength)(B,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const z=this._getMouseBufferCoords(T);return!!z&&(this._selectWordAt(z,j),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(T,j){this._model.clearSelection(),T=Math.max(T,0),j=Math.min(j,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,T],this._model.selectionEnd=[this._bufferService.cols,j],this.refresh(),this._onSelectionChange.fire()}_handleTrim(T){this._model.handleTrim(T)&&this.refresh()}_getMouseBufferCoords(T){const j=this._mouseService.getCoords(T,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(j)return j[0]--,j[1]--,j[1]+=this._bufferService.buffer.ydisp,j}_getMouseEventScrollAmount(T){let j=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,T,this._screenElement)[1];const B=this._renderService.dimensions.css.canvas.height;return j>=0&&j<=B?0:(j>B&&(j-=B),j=Math.min(Math.max(j,-50),50),j/=50,j/Math.abs(j)+Math.round(14*j))}shouldForceSelection(T){return y.isMac?T.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:T.shiftKey}handleMouseDown(T){if(this._mouseDownTimeStamp=T.timeStamp,(T.button!==2||!this.hasSelection)&&T.button===0){if(!this._enabled){if(!this.shouldForceSelection(T))return;T.stopPropagation()}T.preventDefault(),this._dragScrollAmount=0,this._enabled&&T.shiftKey?this._handleIncrementalClick(T):T.detail===1?this._handleSingleClick(T):T.detail===2?this._handleDoubleClick(T):T.detail===3&&this._handleTripleClick(T),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(T){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(T))}_handleSingleClick(T){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(T)?3:0,this._model.selectionStart=this._getMouseBufferCoords(T),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const j=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);j&&j.length!==this._model.selectionStart[0]&&j.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(T){this._selectWordAtCursor(T,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(T){const j=this._getMouseBufferCoords(T);j&&(this._activeSelectionMode=2,this._selectLineAt(j[1]))}shouldColumnSelect(T){return T.altKey&&!(y.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(T){if(T.stopImmediatePropagation(),!this._model.selectionStart)return;const j=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(T),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const B=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(T.ydisp+this._bufferService.rows,T.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=T.ydisp),this.refresh()}}_handleMouseUp(T){const j=T.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&j<500&&T.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const B=this._mouseService.getCoords(T,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(B&&B[0]!==void 0&&B[1]!==void 0){const z=(0,v.moveToCellSequence)(B[0]-1,B[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(z,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const T=this._model.finalSelectionStart,j=this._model.finalSelectionEnd,B=!(!T||!j||T[0]===j[0]&&T[1]===j[1]);B?T&&j&&(this._oldSelectionStart&&this._oldSelectionEnd&&T[0]===this._oldSelectionStart[0]&&T[1]===this._oldSelectionStart[1]&&j[0]===this._oldSelectionEnd[0]&&j[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(T,j,B)):this._oldHasSelection&&this._fireOnSelectionChange(T,j,B)}_fireOnSelectionChange(T,j,B){this._oldSelectionStart=T,this._oldSelectionEnd=j,this._oldHasSelection=B,this._onSelectionChange.fire()}_handleBufferActivate(T){this.clearSelection(),this._trimListener.dispose(),this._trimListener=T.activeBuffer.lines.onTrim((j=>this._handleTrim(j)))}_convertViewportColToCharacterIndex(T,j){let B=j;for(let z=0;j>=z;z++){const V=T.loadCell(z,this._workCell).getChars().length;this._workCell.getWidth()===0?B--:V>1&&j!==z&&(B+=V-1)}return B}setSelection(T,j,B){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[T,j],this._model.selectionStartLength=B,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(T){this._isClickInSelection(T)||(this._selectWordAtCursor(T,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(T,j,B=!0,z=!0){if(T[0]>=this._bufferService.cols)return;const V=this._bufferService.buffer,F=V.lines.get(T[1]);if(!F)return;const P=V.translateBufferLineToString(T[1],!1);let W=this._convertViewportColToCharacterIndex(F,T[0]),q=W;const X=T[0]-W;let K=0,L=0,M=0,O=0;if(P.charAt(W)===" "){for(;W>0&&P.charAt(W-1)===" ";)W--;for(;q1&&(O+=se-1,q+=se-1);Q>0&&W>0&&!this._isCharWordSeparator(F.loadCell(Q-1,this._workCell));){F.loadCell(Q-1,this._workCell);const Z=this._workCell.getChars().length;this._workCell.getWidth()===0?(K++,Q--):Z>1&&(M+=Z-1,W-=Z-1),W--,Q--}for(;re1&&(O+=Z-1,q+=Z-1),q++,re++}}q++;let U=W+X-K+M,$=Math.min(this._bufferService.cols,q-W+K+L-M-O);if(j||P.slice(W,q).trim()!==""){if(B&&U===0&&F.getCodePoint(0)!==32){const Q=V.lines.get(T[1]-1);if(Q&&F.isWrapped&&Q.getCodePoint(this._bufferService.cols-1)!==32){const re=this._getWordAt([this._bufferService.cols-1,T[1]-1],!1,!0,!1);if(re){const se=this._bufferService.cols-re.start;U-=se,$+=se}}}if(z&&U+$===this._bufferService.cols&&F.getCodePoint(this._bufferService.cols-1)!==32){const Q=V.lines.get(T[1]+1);if(Q!=null&&Q.isWrapped&&Q.getCodePoint(0)!==32){const re=this._getWordAt([0,T[1]+1],!1,!1,!0);re&&($+=re.length)}}return{start:U,length:$}}}_selectWordAt(T,j){const B=this._getWordAt(T,j);if(B){for(;B.start<0;)B.start+=this._bufferService.cols,T[1]--;this._model.selectionStart=[B.start,T[1]],this._model.selectionStartLength=B.length}}_selectToWordAt(T){const j=this._getWordAt(T,!0);if(j){let B=T[1];for(;j.start<0;)j.start+=this._bufferService.cols,B--;if(!this._model.areSelectionValuesReversed())for(;j.start+j.length>this._bufferService.cols;)j.length-=this._bufferService.cols,B++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?j.start:j.start+j.length,B]}}_isCharWordSeparator(T){return T.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(T.getChars())>=0}_selectLineAt(T){const j=this._bufferService.buffer.getWrappedRangeForLine(T),B={start:{x:0,y:j.first},end:{x:this._bufferService.cols-1,y:j.last}};this._model.selectionStart=[0,j.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,x.getRangeLength)(B,this._bufferService.cols)}};o.SelectionService=R=f([p(3,E.IBufferService),p(4,E.ICoreService),p(5,C.IMouseService),p(6,E.IOptionsService),p(7,C.IRenderService),p(8,C.ICoreBrowserService)],R)},4725:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const f=c(8343);o.ICharSizeService=(0,f.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),o.IMouseService=(0,f.createDecorator)("MouseService"),o.IRenderService=(0,f.createDecorator)("RenderService"),o.ISelectionService=(0,f.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,f.createDecorator)("ThemeService"),o.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(u,o,c){var f=this&&this.__decorate||function(R,T,j,B){var z,V=arguments.length,F=V<3?T:B===null?B=Object.getOwnPropertyDescriptor(T,j):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(R,T,j,B);else for(var P=R.length-1;P>=0;P--)(z=R[P])&&(F=(V<3?z(F):V>3?z(T,j,F):z(T,j))||F);return V>3&&F&&Object.defineProperty(T,j,F),F},p=this&&this.__param||function(R,T){return function(j,B){T(j,B,R)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=c(7239),v=c(8055),_=c(8460),C=c(844),w=c(2585),S=v.css.toColor("#ffffff"),y=v.css.toColor("#000000"),x=v.css.toColor("#ffffff"),b=v.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const R=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],T=[0,95,135,175,215,255];for(let j=0;j<216;j++){const B=T[j/36%6|0],z=T[j/6%6|0],V=T[j%6];R.push({css:v.channels.toCss(B,z,V),rgba:v.channels.toRgba(B,z,V)})}for(let j=0;j<24;j++){const B=8+10*j;R.push({css:v.channels.toCss(B,B,B),rgba:v.channels.toRgba(B,B,B)})}return R})());let D=o.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(R){super(),this._optionsService=R,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new _.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:S,background:y,cursor:x,cursorAccent:b,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:v.color.blend(y,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:v.color.blend(y,E),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(R={}){const T=this._colors;if(T.foreground=N(R.foreground,S),T.background=N(R.background,y),T.cursor=N(R.cursor,x),T.cursorAccent=N(R.cursorAccent,b),T.selectionBackgroundTransparent=N(R.selectionBackground,E),T.selectionBackgroundOpaque=v.color.blend(T.background,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundTransparent=N(R.selectionInactiveBackground,T.selectionBackgroundTransparent),T.selectionInactiveBackgroundOpaque=v.color.blend(T.background,T.selectionInactiveBackgroundTransparent),T.selectionForeground=R.selectionForeground?N(R.selectionForeground,v.NULL_COLOR):void 0,T.selectionForeground===v.NULL_COLOR&&(T.selectionForeground=void 0),v.color.isOpaque(T.selectionBackgroundTransparent)&&(T.selectionBackgroundTransparent=v.color.opacity(T.selectionBackgroundTransparent,.3)),v.color.isOpaque(T.selectionInactiveBackgroundTransparent)&&(T.selectionInactiveBackgroundTransparent=v.color.opacity(T.selectionInactiveBackgroundTransparent,.3)),T.ansi=o.DEFAULT_ANSI_COLORS.slice(),T.ansi[0]=N(R.black,o.DEFAULT_ANSI_COLORS[0]),T.ansi[1]=N(R.red,o.DEFAULT_ANSI_COLORS[1]),T.ansi[2]=N(R.green,o.DEFAULT_ANSI_COLORS[2]),T.ansi[3]=N(R.yellow,o.DEFAULT_ANSI_COLORS[3]),T.ansi[4]=N(R.blue,o.DEFAULT_ANSI_COLORS[4]),T.ansi[5]=N(R.magenta,o.DEFAULT_ANSI_COLORS[5]),T.ansi[6]=N(R.cyan,o.DEFAULT_ANSI_COLORS[6]),T.ansi[7]=N(R.white,o.DEFAULT_ANSI_COLORS[7]),T.ansi[8]=N(R.brightBlack,o.DEFAULT_ANSI_COLORS[8]),T.ansi[9]=N(R.brightRed,o.DEFAULT_ANSI_COLORS[9]),T.ansi[10]=N(R.brightGreen,o.DEFAULT_ANSI_COLORS[10]),T.ansi[11]=N(R.brightYellow,o.DEFAULT_ANSI_COLORS[11]),T.ansi[12]=N(R.brightBlue,o.DEFAULT_ANSI_COLORS[12]),T.ansi[13]=N(R.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),T.ansi[14]=N(R.brightCyan,o.DEFAULT_ANSI_COLORS[14]),T.ansi[15]=N(R.brightWhite,o.DEFAULT_ANSI_COLORS[15]),R.extendedAnsi){const j=Math.min(T.ansi.length-16,R.extendedAnsi.length);for(let B=0;B{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const f=c(8460),p=c(844);class d extends p.Disposable{constructor(_){super(),this._maxLength=_,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(_){if(this._maxLength===_)return;const C=new Array(_);for(let w=0;wthis._length)for(let C=this._length;C<_;C++)this._array[C]=void 0;this._length=_}get(_){return this._array[this._getCyclicIndex(_)]}set(_,C){this._array[this._getCyclicIndex(_)]=C}push(_){this._array[this._getCyclicIndex(this._length)]=_,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(_,C,...w){if(C){for(let S=_;S=_;S--)this._array[this._getCyclicIndex(S+w.length)]=this._array[this._getCyclicIndex(S)];for(let S=0;Sthis._maxLength){const S=this._length+w.length-this._maxLength;this._startIndex+=S,this._length=this._maxLength,this.onTrimEmitter.fire(S)}else this._length+=w.length}trimStart(_){_>this._length&&(_=this._length),this._startIndex+=_,this._length-=_,this.onTrimEmitter.fire(_)}shiftElements(_,C,w){if(!(C<=0)){if(_<0||_>=this._length)throw new Error("start argument out of range");if(_+w<0)throw new Error("Cannot shift elements in list beyond index 0");if(w>0){for(let y=C-1;y>=0;y--)this.set(_+y+w,this.get(_+y));const S=_+C+w-this._length;if(S>0)for(this._length+=S;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let S=0;S{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(f,p=5){if(typeof f!="object")return f;const d=Array.isArray(f)?[]:{};for(const v in f)d[v]=p<=1?f[v]:f[v]&&c(f[v],p-1);return d}},8055:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,f=0,p=0,d=0;var v,_,C,w,S;function y(b){const E=b.toString(16);return E.length<2?"0"+E:E}function x(b,E){return b>>0},b.toColor=function(E,D,N,R){return{css:b.toCss(E,D,N,R),rgba:b.toRgba(E,D,N,R)}}})(v||(o.channels=v={})),(function(b){function E(D,N){return d=Math.round(255*N),[c,f,p]=S.toChannels(D.rgba),{css:v.toCss(c,f,p,d),rgba:v.toRgba(c,f,p,d)}}b.blend=function(D,N){if(d=(255&N.rgba)/255,d===1)return{css:N.css,rgba:N.rgba};const R=N.rgba>>24&255,T=N.rgba>>16&255,j=N.rgba>>8&255,B=D.rgba>>24&255,z=D.rgba>>16&255,V=D.rgba>>8&255;return c=B+Math.round((R-B)*d),f=z+Math.round((T-z)*d),p=V+Math.round((j-V)*d),{css:v.toCss(c,f,p),rgba:v.toRgba(c,f,p)}},b.isOpaque=function(D){return(255&D.rgba)==255},b.ensureContrastRatio=function(D,N,R){const T=S.ensureContrastRatio(D.rgba,N.rgba,R);if(T)return v.toColor(T>>24&255,T>>16&255,T>>8&255)},b.opaque=function(D){const N=(255|D.rgba)>>>0;return[c,f,p]=S.toChannels(N),{css:v.toCss(c,f,p),rgba:N}},b.opacity=E,b.multiplyOpacity=function(D,N){return d=255&D.rgba,E(D,d*N/255)},b.toColorRGB=function(D){return[D.rgba>>24&255,D.rgba>>16&255,D.rgba>>8&255]}})(_||(o.color=_={})),(function(b){let E,D;try{const N=document.createElement("canvas");N.width=1,N.height=1;const R=N.getContext("2d",{willReadFrequently:!0});R&&(E=R,E.globalCompositeOperation="copy",D=E.createLinearGradient(0,0,1,1))}catch{}b.toColor=function(N){if(N.match(/#[\da-f]{3,8}/i))switch(N.length){case 4:return c=parseInt(N.slice(1,2).repeat(2),16),f=parseInt(N.slice(2,3).repeat(2),16),p=parseInt(N.slice(3,4).repeat(2),16),v.toColor(c,f,p);case 5:return c=parseInt(N.slice(1,2).repeat(2),16),f=parseInt(N.slice(2,3).repeat(2),16),p=parseInt(N.slice(3,4).repeat(2),16),d=parseInt(N.slice(4,5).repeat(2),16),v.toColor(c,f,p,d);case 7:return{css:N,rgba:(parseInt(N.slice(1),16)<<8|255)>>>0};case 9:return{css:N,rgba:parseInt(N.slice(1),16)>>>0}}const R=N.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(R)return c=parseInt(R[1]),f=parseInt(R[2]),p=parseInt(R[3]),d=Math.round(255*(R[5]===void 0?1:parseFloat(R[5]))),v.toColor(c,f,p,d);if(!E||!D)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=D,E.fillStyle=N,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[c,f,p,d]=E.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:v.toRgba(c,f,p,d),css:N}}})(C||(o.css=C={})),(function(b){function E(D,N,R){const T=D/255,j=N/255,B=R/255;return .2126*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.7152*(j<=.03928?j/12.92:Math.pow((j+.055)/1.055,2.4))+.0722*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))}b.relativeLuminance=function(D){return E(D>>16&255,D>>8&255,255&D)},b.relativeLuminance2=E})(w||(o.rgb=w={})),(function(b){function E(N,R,T){const j=N>>24&255,B=N>>16&255,z=N>>8&255;let V=R>>24&255,F=R>>16&255,P=R>>8&255,W=x(w.relativeLuminance2(V,F,P),w.relativeLuminance2(j,B,z));for(;W0||F>0||P>0);)V-=Math.max(0,Math.ceil(.1*V)),F-=Math.max(0,Math.ceil(.1*F)),P-=Math.max(0,Math.ceil(.1*P)),W=x(w.relativeLuminance2(V,F,P),w.relativeLuminance2(j,B,z));return(V<<24|F<<16|P<<8|255)>>>0}function D(N,R,T){const j=N>>24&255,B=N>>16&255,z=N>>8&255;let V=R>>24&255,F=R>>16&255,P=R>>8&255,W=x(w.relativeLuminance2(V,F,P),w.relativeLuminance2(j,B,z));for(;W>>0}b.blend=function(N,R){if(d=(255&R)/255,d===1)return R;const T=R>>24&255,j=R>>16&255,B=R>>8&255,z=N>>24&255,V=N>>16&255,F=N>>8&255;return c=z+Math.round((T-z)*d),f=V+Math.round((j-V)*d),p=F+Math.round((B-F)*d),v.toRgba(c,f,p)},b.ensureContrastRatio=function(N,R,T){const j=w.relativeLuminance(N>>8),B=w.relativeLuminance(R>>8);if(x(j,B)>8));if(Px(j,w.relativeLuminance(W>>8))?F:W}return F}const z=D(N,R,T),V=x(j,w.relativeLuminance(z>>8));if(Vx(j,w.relativeLuminance(F>>8))?z:F}return z}},b.reduceLuminance=E,b.increaseLuminance=D,b.toChannels=function(N){return[N>>24&255,N>>16&255,N>>8&255,255&N]}})(S||(o.rgba=S={})),o.toPaddedHex=y,o.contrastRatio=x},8969:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const f=c(844),p=c(2585),d=c(4348),v=c(7866),_=c(744),C=c(7302),w=c(6975),S=c(8460),y=c(1753),x=c(1480),b=c(7994),E=c(9282),D=c(5435),N=c(5981),R=c(2660);let T=!1;class j extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new S.EventEmitter),this._onScroll.event((z=>{var V;(V=this._onScrollApi)==null||V.fire(z.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(z){for(const V in z)this.optionsService.options[V]=z[V]}constructor(z){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new S.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new S.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new S.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new S.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new S.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new S.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new C.OptionsService(z)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(v.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(w.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(y.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(x.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(b.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(R.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new D.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,S.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,S.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,S.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,S.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((V=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((V=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new N.WriteBuffer(((V,F)=>this._inputHandler.parse(V,F)))),this.register((0,S.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(z,V){this._writeBuffer.write(z,V)}writeSync(z,V){this._logService.logLevel<=p.LogLevelEnum.WARN&&!T&&(this._logService.warn("writeSync is unreliable and will be removed soon."),T=!0),this._writeBuffer.writeSync(z,V)}input(z,V=!0){this.coreService.triggerDataEvent(z,V)}resize(z,V){isNaN(z)||isNaN(V)||(z=Math.max(z,_.MINIMUM_COLS),V=Math.max(V,_.MINIMUM_ROWS),this._bufferService.resize(z,V))}scroll(z,V=!1){this._bufferService.scroll(z,V)}scrollLines(z,V,F){this._bufferService.scrollLines(z,V,F)}scrollPages(z){this.scrollLines(z*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(z){const V=z-this._bufferService.buffer.ydisp;V!==0&&this.scrollLines(V)}registerEscHandler(z,V){return this._inputHandler.registerEscHandler(z,V)}registerDcsHandler(z,V){return this._inputHandler.registerDcsHandler(z,V)}registerCsiHandler(z,V){return this._inputHandler.registerCsiHandler(z,V)}registerOscHandler(z,V){return this._inputHandler.registerOscHandler(z,V)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let z=!1;const V=this.optionsService.rawOptions.windowsPty;V&&V.buildNumber!==void 0&&V.buildNumber!==void 0?z=V.backend==="conpty"&&V.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(z=!0),z?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const z=[];z.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),z.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)((()=>{for(const V of z)V.dispose()}))}}}o.CoreTerminal=j},8460:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let f=0;ff.fire(p)))},o.runAndSubscribe=function(c,f){return f(void 0),c((p=>f(p)))}},5435:function(u,o,c){var f=this&&this.__decorate||function(K,L,M,O){var U,$=arguments.length,Q=$<3?L:O===null?O=Object.getOwnPropertyDescriptor(L,M):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(K,L,M,O);else for(var re=K.length-1;re>=0;re--)(U=K[re])&&(Q=($<3?U(Q):$>3?U(L,M,Q):U(L,M))||Q);return $>3&&Q&&Object.defineProperty(L,M,Q),Q},p=this&&this.__param||function(K,L){return function(M,O){L(M,O,K)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=c(2584),v=c(7116),_=c(2015),C=c(844),w=c(482),S=c(8437),y=c(8460),x=c(643),b=c(511),E=c(3734),D=c(2585),N=c(1480),R=c(6242),T=c(6351),j=c(5941),B={"(":0,")":1,"*":2,"+":3,"-":1,".":2},z=131072;function V(K,L){if(K>24)return L.setWinLines||!1;switch(K){case 1:return!!L.restoreWin;case 2:return!!L.minimizeWin;case 3:return!!L.setWinPosition;case 4:return!!L.setWinSizePixels;case 5:return!!L.raiseWin;case 6:return!!L.lowerWin;case 7:return!!L.refreshWin;case 8:return!!L.setWinSizeChars;case 9:return!!L.maximizeWin;case 10:return!!L.fullscreenWin;case 11:return!!L.getWinState;case 13:return!!L.getWinPosition;case 14:return!!L.getWinSizePixels;case 15:return!!L.getScreenSizePixels;case 16:return!!L.getCellSizePixels;case 18:return!!L.getWinSizeChars;case 19:return!!L.getScreenSizeChars;case 20:return!!L.getIconTitle;case 21:return!!L.getWinTitle;case 22:return!!L.pushTitle;case 23:return!!L.popTitle;case 24:return!!L.setWinLines}return!1}var F;(function(K){K[K.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",K[K.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(F||(o.WindowsOptionsReportType=F={}));let P=0;class W extends C.Disposable{getAttrData(){return this._curAttrData}constructor(L,M,O,U,$,Q,re,se,Z=new _.EscapeSequenceParser){super(),this._bufferService=L,this._charsetService=M,this._coreService=O,this._logService=U,this._optionsService=$,this._oscLinkService=Q,this._coreMouseService=re,this._unicodeService=se,this._parser=Z,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new w.StringToUtf32,this._utf8Decoder=new w.Utf8ToUtf32,this._workCell=new b.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=S.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=S.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new y.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new y.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new y.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new y.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new y.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new y.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new y.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new y.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new y.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new y.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new y.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new y.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new q(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((H=>this._activeBuffer=H.activeBuffer))),this._parser.setCsiHandlerFallback(((H,ee)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(H),params:ee.toArray()})})),this._parser.setEscHandlerFallback((H=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(H)})})),this._parser.setExecuteHandlerFallback((H=>{this._logService.debug("Unknown EXECUTE code: ",{code:H})})),this._parser.setOscHandlerFallback(((H,ee,ne)=>{this._logService.debug("Unknown OSC code: ",{identifier:H,action:ee,data:ne})})),this._parser.setDcsHandlerFallback(((H,ee,ne)=>{ee==="HOOK"&&(ne=ne.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(H),action:ee,payload:ne})})),this._parser.setPrintHandler(((H,ee,ne)=>this.print(H,ee,ne))),this._parser.registerCsiHandler({final:"@"},(H=>this.insertChars(H))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(H=>this.scrollLeft(H))),this._parser.registerCsiHandler({final:"A"},(H=>this.cursorUp(H))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(H=>this.scrollRight(H))),this._parser.registerCsiHandler({final:"B"},(H=>this.cursorDown(H))),this._parser.registerCsiHandler({final:"C"},(H=>this.cursorForward(H))),this._parser.registerCsiHandler({final:"D"},(H=>this.cursorBackward(H))),this._parser.registerCsiHandler({final:"E"},(H=>this.cursorNextLine(H))),this._parser.registerCsiHandler({final:"F"},(H=>this.cursorPrecedingLine(H))),this._parser.registerCsiHandler({final:"G"},(H=>this.cursorCharAbsolute(H))),this._parser.registerCsiHandler({final:"H"},(H=>this.cursorPosition(H))),this._parser.registerCsiHandler({final:"I"},(H=>this.cursorForwardTab(H))),this._parser.registerCsiHandler({final:"J"},(H=>this.eraseInDisplay(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(H=>this.eraseInDisplay(H,!0))),this._parser.registerCsiHandler({final:"K"},(H=>this.eraseInLine(H,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(H=>this.eraseInLine(H,!0))),this._parser.registerCsiHandler({final:"L"},(H=>this.insertLines(H))),this._parser.registerCsiHandler({final:"M"},(H=>this.deleteLines(H))),this._parser.registerCsiHandler({final:"P"},(H=>this.deleteChars(H))),this._parser.registerCsiHandler({final:"S"},(H=>this.scrollUp(H))),this._parser.registerCsiHandler({final:"T"},(H=>this.scrollDown(H))),this._parser.registerCsiHandler({final:"X"},(H=>this.eraseChars(H))),this._parser.registerCsiHandler({final:"Z"},(H=>this.cursorBackwardTab(H))),this._parser.registerCsiHandler({final:"`"},(H=>this.charPosAbsolute(H))),this._parser.registerCsiHandler({final:"a"},(H=>this.hPositionRelative(H))),this._parser.registerCsiHandler({final:"b"},(H=>this.repeatPrecedingCharacter(H))),this._parser.registerCsiHandler({final:"c"},(H=>this.sendDeviceAttributesPrimary(H))),this._parser.registerCsiHandler({prefix:">",final:"c"},(H=>this.sendDeviceAttributesSecondary(H))),this._parser.registerCsiHandler({final:"d"},(H=>this.linePosAbsolute(H))),this._parser.registerCsiHandler({final:"e"},(H=>this.vPositionRelative(H))),this._parser.registerCsiHandler({final:"f"},(H=>this.hVPosition(H))),this._parser.registerCsiHandler({final:"g"},(H=>this.tabClear(H))),this._parser.registerCsiHandler({final:"h"},(H=>this.setMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(H=>this.setModePrivate(H))),this._parser.registerCsiHandler({final:"l"},(H=>this.resetMode(H))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(H=>this.resetModePrivate(H))),this._parser.registerCsiHandler({final:"m"},(H=>this.charAttributes(H))),this._parser.registerCsiHandler({final:"n"},(H=>this.deviceStatus(H))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(H=>this.deviceStatusPrivate(H))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(H=>this.softReset(H))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(H=>this.setCursorStyle(H))),this._parser.registerCsiHandler({final:"r"},(H=>this.setScrollRegion(H))),this._parser.registerCsiHandler({final:"s"},(H=>this.saveCursor(H))),this._parser.registerCsiHandler({final:"t"},(H=>this.windowOptions(H))),this._parser.registerCsiHandler({final:"u"},(H=>this.restoreCursor(H))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(H=>this.insertColumns(H))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(H=>this.deleteColumns(H))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(H=>this.selectProtected(H))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(H=>this.requestMode(H,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(H=>this.requestMode(H,!1))),this._parser.setExecuteHandler(d.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(d.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(d.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(d.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(d.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(d.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(d.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(d.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(d.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(d.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new R.OscHandler((H=>(this.setTitle(H),this.setIconName(H),!0)))),this._parser.registerOscHandler(1,new R.OscHandler((H=>this.setIconName(H)))),this._parser.registerOscHandler(2,new R.OscHandler((H=>this.setTitle(H)))),this._parser.registerOscHandler(4,new R.OscHandler((H=>this.setOrReportIndexedColor(H)))),this._parser.registerOscHandler(8,new R.OscHandler((H=>this.setHyperlink(H)))),this._parser.registerOscHandler(10,new R.OscHandler((H=>this.setOrReportFgColor(H)))),this._parser.registerOscHandler(11,new R.OscHandler((H=>this.setOrReportBgColor(H)))),this._parser.registerOscHandler(12,new R.OscHandler((H=>this.setOrReportCursorColor(H)))),this._parser.registerOscHandler(104,new R.OscHandler((H=>this.restoreIndexedColor(H)))),this._parser.registerOscHandler(110,new R.OscHandler((H=>this.restoreFgColor(H)))),this._parser.registerOscHandler(111,new R.OscHandler((H=>this.restoreBgColor(H)))),this._parser.registerOscHandler(112,new R.OscHandler((H=>this.restoreCursorColor(H)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const H in v.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:H},(()=>this.selectCharset("("+H))),this._parser.registerEscHandler({intermediates:")",final:H},(()=>this.selectCharset(")"+H))),this._parser.registerEscHandler({intermediates:"*",final:H},(()=>this.selectCharset("*"+H))),this._parser.registerEscHandler({intermediates:"+",final:H},(()=>this.selectCharset("+"+H))),this._parser.registerEscHandler({intermediates:"-",final:H},(()=>this.selectCharset("-"+H))),this._parser.registerEscHandler({intermediates:".",final:H},(()=>this.selectCharset("."+H))),this._parser.registerEscHandler({intermediates:"/",final:H},(()=>this.selectCharset("/"+H)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((H=>(this._logService.error("Parsing error: ",H),H))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new T.DcsHandler(((H,ee)=>this.requestStatusString(H,ee))))}_preserveStack(L,M,O,U){this._parseStack.paused=!0,this._parseStack.cursorStartX=L,this._parseStack.cursorStartY=M,this._parseStack.decodedLength=O,this._parseStack.position=U}_logSlowResolvingAsync(L){this._logService.logLevel<=D.LogLevelEnum.WARN&&Promise.race([L,new Promise(((M,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch((M=>{if(M!=="#SLOW_TIMEOUT")throw M;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(L,M){let O,U=this._activeBuffer.x,$=this._activeBuffer.y,Q=0;const re=this._parseStack.paused;if(re){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,M))return this._logSlowResolvingAsync(O),O;U=this._parseStack.cursorStartX,$=this._parseStack.cursorStartY,this._parseStack.paused=!1,L.length>z&&(Q=this._parseStack.position+z)}if(this._logService.logLevel<=D.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof L=="string"?` "${L}"`:` "${Array.prototype.map.call(L,(H=>String.fromCharCode(H))).join("")}"`),typeof L=="string"?L.split("").map((H=>H.charCodeAt(0))):L),this._parseBuffer.lengthz)for(let H=Q;H0&&ne.getWidth(this._activeBuffer.x-1)===2&&ne.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ee);let pe=this._parser.precedingJoinState;for(let fe=M;fese){if(Z){const Ne=ne;let we=this._activeBuffer.x-Ee;for(this._activeBuffer.x=Ee,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ee>0&&ne instanceof S.BufferLine&&ne.copyCellsFrom(Ne,we,0,Ee,!1);we=0;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}else if(H&&(ne.insertCells(this._activeBuffer.x,$-Ee,this._activeBuffer.getNullCell(ee)),ne.getWidth(se-1)===2&&ne.setCellFromCodepoint(se-1,x.NULL_CELL_CODE,x.NULL_CELL_WIDTH,ee)),ne.setCellFromCodepoint(this._activeBuffer.x++,U,$,ee),$>0)for(;--$;)ne.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}this._parser.precedingJoinState=pe,this._activeBuffer.x0&&ne.getWidth(this._activeBuffer.x)===0&&!ne.hasContent(this._activeBuffer.x)&&ne.setCellFromCodepoint(this._activeBuffer.x,0,1,ee),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(L,M){return L.final!=="t"||L.prefix||L.intermediates?this._parser.registerCsiHandler(L,M):this._parser.registerCsiHandler(L,(O=>!V(O.params[0],this._optionsService.rawOptions.windowOptions)||M(O)))}registerDcsHandler(L,M){return this._parser.registerDcsHandler(L,new T.DcsHandler(M))}registerEscHandler(L,M){return this._parser.registerEscHandler(L,M)}registerOscHandler(L,M){return this._parser.registerOscHandler(L,new R.OscHandler(M))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var L;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((L=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&L.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);M.hasWidth(this._activeBuffer.x)&&!M.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const L=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-L),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(L=this._bufferService.cols-1){this._activeBuffer.x=Math.min(L,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(L,M){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=L,this._activeBuffer.y=this._activeBuffer.scrollTop+M):(this._activeBuffer.x=L,this._activeBuffer.y=M),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(L,M){this._restrictCursor(),this._setCursor(this._activeBuffer.x+L,this._activeBuffer.y+M)}cursorUp(L){const M=this._activeBuffer.y-this._activeBuffer.scrollTop;return M>=0?this._moveCursor(0,-Math.min(M,L.params[0]||1)):this._moveCursor(0,-(L.params[0]||1)),!0}cursorDown(L){const M=this._activeBuffer.scrollBottom-this._activeBuffer.y;return M>=0?this._moveCursor(0,Math.min(M,L.params[0]||1)):this._moveCursor(0,L.params[0]||1),!0}cursorForward(L){return this._moveCursor(L.params[0]||1,0),!0}cursorBackward(L){return this._moveCursor(-(L.params[0]||1),0),!0}cursorNextLine(L){return this.cursorDown(L),this._activeBuffer.x=0,!0}cursorPrecedingLine(L){return this.cursorUp(L),this._activeBuffer.x=0,!0}cursorCharAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(L){return this._setCursor(L.length>=2?(L.params[1]||1)-1:0,(L.params[0]||1)-1),!0}charPosAbsolute(L){return this._setCursor((L.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(L){return this._moveCursor(L.params[0]||1,0),!0}linePosAbsolute(L){return this._setCursor(this._activeBuffer.x,(L.params[0]||1)-1),!0}vPositionRelative(L){return this._moveCursor(0,L.params[0]||1),!0}hVPosition(L){return this.cursorPosition(L),!0}tabClear(L){const M=L.params[0];return M===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:M===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=L.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(L){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let M=L.params[0]||1;for(;M--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(L){const M=L.params[0];return M===1&&(this._curAttrData.bg|=536870912),M!==2&&M!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(L,M,O,U=!1,$=!1){const Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);Q.replaceCells(M,O,this._activeBuffer.getNullCell(this._eraseAttrData()),$),U&&(Q.isWrapped=!1)}_resetBufferLine(L,M=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+L);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),M),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+L),O.isWrapped=!1)}eraseInDisplay(L,M=!1){let O;switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);O=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,M);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,M);this._dirtyRowTracker.markDirty(0);break;case 3:const U=this._activeBuffer.lines.length-this._bufferService.rows;U>0&&(this._activeBuffer.lines.trimStart(U),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-U,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-U,0),this._onScroll.fire(0))}return!0}eraseInLine(L,M=!1){switch(this._restrictCursor(this._bufferService.cols),L.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,M);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,M);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,M)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(L){this._restrictCursor();let M=L.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let Z=se;for(let H=1;H0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(L){return L.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(L.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(L){return(this._optionsService.rawOptions.termName+"").indexOf(L)===0}setMode(L){for(let M=0;MCe?1:2,pe=L.params[0];return fe=pe,ye=M?pe===2?4:pe===4?ne(Q.modes.insertMode):pe===12?3:pe===20?ne(ee.convertEol):0:pe===1?ne(O.applicationCursorKeys):pe===3?ee.windowOptions.setWinLines?se===80?2:se===132?1:0:0:pe===6?ne(O.origin):pe===7?ne(O.wraparound):pe===8?3:pe===9?ne(U==="X10"):pe===12?ne(ee.cursorBlink):pe===25?ne(!Q.isCursorHidden):pe===45?ne(O.reverseWraparound):pe===66?ne(O.applicationKeypad):pe===67?4:pe===1e3?ne(U==="VT200"):pe===1002?ne(U==="DRAG"):pe===1003?ne(U==="ANY"):pe===1004?ne(O.sendFocus):pe===1005?4:pe===1006?ne($==="SGR"):pe===1015?4:pe===1016?ne($==="SGR_PIXELS"):pe===1048?1:pe===47||pe===1047||pe===1049?ne(Z===H):pe===2004?ne(O.bracketedPasteMode):0,Q.triggerDataEvent(`${d.C0.ESC}[${M?"":"?"}${fe};${ye}$y`),!0;var fe,ye}_updateAttrColor(L,M,O,U,$){return M===2?(L|=50331648,L&=-16777216,L|=E.AttributeData.fromColorRGB([O,U,$])):M===5&&(L&=-50331904,L|=33554432|255&O),L}_extractColor(L,M,O){const U=[0,0,-1,0,0,0];let $=0,Q=0;do{if(U[Q+$]=L.params[M+Q],L.hasSubParams(M+Q)){const re=L.getSubParams(M+Q);let se=0;do U[1]===5&&($=1),U[Q+se+1+$]=re[se];while(++se=2||U[1]===2&&Q+$>=5)break;U[1]&&($=1)}while(++Q+M5)&&(L=1),M.extended.underlineStyle=L,M.fg|=268435456,L===0&&(M.fg&=-268435457),M.updateExtended()}_processSGR0(L){L.fg=S.DEFAULT_ATTR_DATA.fg,L.bg=S.DEFAULT_ATTR_DATA.bg,L.extended=L.extended.clone(),L.extended.underlineStyle=0,L.extended.underlineColor&=-67108864,L.updateExtended()}charAttributes(L){if(L.length===1&&L.params[0]===0)return this._processSGR0(this._curAttrData),!0;const M=L.length;let O;const U=this._curAttrData;for(let $=0;$=30&&O<=37?(U.fg&=-50331904,U.fg|=16777216|O-30):O>=40&&O<=47?(U.bg&=-50331904,U.bg|=16777216|O-40):O>=90&&O<=97?(U.fg&=-50331904,U.fg|=16777224|O-90):O>=100&&O<=107?(U.bg&=-50331904,U.bg|=16777224|O-100):O===0?this._processSGR0(U):O===1?U.fg|=134217728:O===3?U.bg|=67108864:O===4?(U.fg|=268435456,this._processUnderline(L.hasSubParams($)?L.getSubParams($)[0]:1,U)):O===5?U.fg|=536870912:O===7?U.fg|=67108864:O===8?U.fg|=1073741824:O===9?U.fg|=2147483648:O===2?U.bg|=134217728:O===21?this._processUnderline(2,U):O===22?(U.fg&=-134217729,U.bg&=-134217729):O===23?U.bg&=-67108865:O===24?(U.fg&=-268435457,this._processUnderline(0,U)):O===25?U.fg&=-536870913:O===27?U.fg&=-67108865:O===28?U.fg&=-1073741825:O===29?U.fg&=2147483647:O===39?(U.fg&=-67108864,U.fg|=16777215&S.DEFAULT_ATTR_DATA.fg):O===49?(U.bg&=-67108864,U.bg|=16777215&S.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?$+=this._extractColor(L,$,U):O===53?U.bg|=1073741824:O===55?U.bg&=-1073741825:O===59?(U.extended=U.extended.clone(),U.extended.underlineColor=-1,U.updateExtended()):O===100?(U.fg&=-67108864,U.fg|=16777215&S.DEFAULT_ATTR_DATA.fg,U.bg&=-67108864,U.bg|=16777215&S.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(L){switch(L.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const M=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${M};${O}R`)}return!0}deviceStatusPrivate(L){if(L.params[0]===6){const M=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${M};${O}R`)}return!0}softReset(L){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=S.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(L){const M=L.params[0]||1;switch(M){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const O=M%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(L){const M=L.params[0]||1;let O;return(L.length<2||(O=L.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>M&&(this._activeBuffer.scrollTop=M-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(L){if(!V(L.params[0],this._optionsService.rawOptions.windowOptions))return!0;const M=L.length>1?L.params[1]:0;switch(L.params[0]){case 14:M!==2&&this._onRequestWindowsOptionsReport.fire(F.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(F.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:M!==0&&M!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),M!==0&&M!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:M!==0&&M!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),M!==0&&M!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(L){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(L){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(L){return this._windowTitle=L,this._onTitleChange.fire(L),!0}setIconName(L){return this._iconName=L,!0}setOrReportIndexedColor(L){const M=[],O=L.split(";");for(;O.length>1;){const U=O.shift(),$=O.shift();if(/^\d+$/.exec(U)){const Q=parseInt(U);if(X(Q))if($==="?")M.push({type:0,index:Q});else{const re=(0,j.parseColor)($);re&&M.push({type:1,index:Q,color:re})}}}return M.length&&this._onColor.fire(M),!0}setHyperlink(L){const M=L.split(";");return!(M.length<2)&&(M[1]?this._createHyperlink(M[0],M[1]):!M[0]&&this._finishHyperlink())}_createHyperlink(L,M){this._getCurrentLinkId()&&this._finishHyperlink();const O=L.split(":");let U;const $=O.findIndex((Q=>Q.startsWith("id=")));return $!==-1&&(U=O[$].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:U,uri:M}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(L,M){const O=L.split(";");for(let U=0;U=this._specialColors.length);++U,++M)if(O[U]==="?")this._onColor.fire([{type:0,index:this._specialColors[M]}]);else{const $=(0,j.parseColor)(O[U]);$&&this._onColor.fire([{type:1,index:this._specialColors[M],color:$}])}return!0}setOrReportFgColor(L){return this._setOrReportSpecialColor(L,0)}setOrReportBgColor(L){return this._setOrReportSpecialColor(L,1)}setOrReportCursorColor(L){return this._setOrReportSpecialColor(L,2)}restoreIndexedColor(L){if(!L)return this._onColor.fire([{type:2}]),!0;const M=[],O=L.split(";");for(let U=0;U=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const L=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,L,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=S.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=S.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(L){return this._charsetService.setgLevel(L),!0}screenAlignmentPattern(){const L=new b.CellData;L.content=4194373,L.fg=this._curAttrData.fg,L.bg=this._curAttrData.bg,this._setCursor(0,0);for(let M=0;M(this._coreService.triggerDataEvent(`${d.C0.ESC}${$}${d.C0.ESC}\\`),!0))(L==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:L==='"p'?'P1$r61;1"p':L==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:L==="m"?"P1$r0m":L===" q"?`P1$r${{block:2,underline:4,bar:6}[U.cursorStyle]-(U.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(L,M){this._dirtyRowTracker.markRangeDirty(L,M)}}o.InputHandler=W;let q=class{constructor(K){this._bufferService=K,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(K){Kthis.end&&(this.end=K)}markRangeDirty(K,L){K>L&&(P=K,K=L,L=P),Kthis.end&&(this.end=L)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(K){return 0<=K&&K<256}q=f([p(0,D.IBufferService)],q)},844:(u,o)=>{function c(f){for(const p of f)p.dispose();f.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const p=this._disposables.indexOf(f);p!==-1&&this._disposables.splice(p,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var p;this._isDisposed||f===this._value||((p=this._value)==null||p.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},o.toDisposable=function(f){return{dispose:f}},o.disposeArray=c,o.getDisposeArrayDisposable=function(f){return{dispose:()=>c(f)}}},1505:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(p,d,v){this._data[p]||(this._data[p]={}),this._data[p][d]=v}get(p,d){return this._data[p]?this._data[p][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(f,p,d,v,_){this._data.get(f,p)||this._data.set(f,p,new c),this._data.get(f,p).set(d,v,_)}get(f,p,d,v){var _;return(_=this._data.get(f,p))==null?void 0:_.get(d,v)}clear(){this._data.clear()}}},6114:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,f=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const p=c.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),o.isIpad=f==="iPad",o.isIphone=f==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),o.isLinux=f.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(c=this._search(this._getKey(f)),this._array.splice(c,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const p=this._getKey(f);if(p===void 0||(c=this._search(p),c===-1)||this._getKey(this._array[c])!==p)return!1;do if(this._array[c]===f)return this._array.splice(c,1),!0;while(++c=this._array.length)&&this._getKey(this._array[c])===f))do yield this._array[c];while(++c=this._array.length)&&this._getKey(this._array[c])===f))do p(this._array[c]);while(++c=p;){let v=p+d>>1;const _=this._getKey(this._array[v]);if(_>f)d=v-1;else{if(!(_0&&this._getKey(this._array[v-1])===f;)v--;return v}p=v+1}}return p}}},7226:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const f=c(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(_){this._tasks.push(_),this._start()}flush(){for(;this._iy)return S-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(S-C))}ms`),void this._start();S=y}this.clear()}}class d extends p{_requestCallback(_){return setTimeout((()=>_(this._createDeadline(16))))}_cancelCallback(_){clearTimeout(_)}_createDeadline(_){const C=Date.now()+_;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const f=c(643);o.updateWindowsModeWrappedState=function(p){const d=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),v=d==null?void 0:d.get(p.cols-1),_=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);_&&v&&(_.isWrapped=v[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&v[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new c;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=c;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,v=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=v}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=f},9092:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const f=c(6349),p=c(7226),d=c(3734),v=c(8437),_=c(4634),C=c(511),w=c(643),S=c(4863),y=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(x,b,E){this._hasScrollback=x,this._optionsService=b,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=y.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,w.NULL_CELL_CHAR,w.NULL_CELL_WIDTH,w.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,w.WHITESPACE_CELL_CHAR,w.WHITESPACE_CELL_WIDTH,w.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(x){return x?(this._nullCell.fg=x.fg,this._nullCell.bg=x.bg,this._nullCell.extended=x.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(x){return x?(this._whitespaceCell.fg=x.fg,this._whitespaceCell.bg=x.bg,this._whitespaceCell.extended=x.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(x,b){return new v.BufferLine(this._bufferService.cols,this.getNullCell(x),b)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const x=this.ybase+this.y-this.ydisp;return x>=0&&xo.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:b}fillViewportRows(x){if(this.lines.length===0){x===void 0&&(x=v.DEFAULT_ATTR_DATA);let b=this._rows;for(;b--;)this.lines.push(this.getBlankLine(x))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(x,b){const E=this.getNullCell(v.DEFAULT_ATTR_DATA);let D=0;const N=this._getCorrectBufferLength(b);if(N>this.lines.maxLength&&(this.lines.maxLength=N),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+R+1?(this.ybase--,R++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(x,E)));else for(let T=this._rows;T>b;T--)this.lines.length>b+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(N0&&(this.lines.trimStart(T),this.ybase=Math.max(this.ybase-T,0),this.ydisp=Math.max(this.ydisp-T,0),this.savedY=Math.max(this.savedY-T,0)),this.lines.maxLength=N}this.x=Math.min(this.x,x-1),this.y=Math.min(this.y,b-1),R&&(this.y+=R),this.savedX=Math.min(this.savedX,x-1),this.scrollTop=0}if(this.scrollBottom=b-1,this._isReflowEnabled&&(this._reflow(x,b),this._cols>x))for(let R=0;R.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let x=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,x=!1);let b=0;for(;this._memoryCleanupPosition100)return!0;return x}get _isReflowEnabled(){const x=this._optionsService.rawOptions.windowsPty;return x&&x.buildNumber?this._hasScrollback&&x.backend==="conpty"&&x.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(x,b){this._cols!==x&&(x>this._cols?this._reflowLarger(x,b):this._reflowSmaller(x,b))}_reflowLarger(x,b){const E=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,x,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(E.length>0){const D=(0,_.reflowLargerCreateNewLayout)(this.lines,E);(0,_.reflowLargerApplyNewLayout)(this.lines,D.layout),this._reflowLargerAdjustViewport(x,b,D.countRemoved)}}_reflowLargerAdjustViewport(x,b,E){const D=this.getNullCell(v.DEFAULT_ATTR_DATA);let N=E;for(;N-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;R--){let T=this.lines.get(R);if(!T||!T.isWrapped&&T.getTrimmedLength()<=x)continue;const j=[T];for(;T.isWrapped&&R>0;)T=this.lines.get(--R),j.unshift(T);const B=this.ybase+this.y;if(B>=R&&B0&&(D.push({start:R+j.length+N,newLines:W}),N+=W.length),j.push(...W);let q=V.length-1,X=V[q];X===0&&(q--,X=V[q]);let K=j.length-F-1,L=z;for(;K>=0;){const O=Math.min(L,X);if(j[q]===void 0)break;if(j[q].copyCellsFrom(j[K],L-O,X-O,O,!0),X-=O,X===0&&(q--,X=V[q]),L-=O,L===0){K--;const U=Math.max(K,0);L=(0,_.getWrappedLineTrimmedLength)(j,U,this._cols)}}for(let O=0;O0;)this.ybase===0?this.y0){const R=[],T=[];for(let q=0;q=0;q--)if(V&&V.start>B+F){for(let X=V.newLines.length-1;X>=0;X--)this.lines.set(q--,V.newLines[X]);q++,R.push({index:B+1,amount:V.newLines.length}),F+=V.newLines.length,V=D[++z]}else this.lines.set(q,T[B--]);let P=0;for(let q=R.length-1;q>=0;q--)R[q].index+=P,this.lines.onInsertEmitter.fire(R[q]),P+=R[q].amount;const W=Math.max(0,j+N-this.lines.maxLength);W>0&&this.lines.onTrimEmitter.fire(W)}}translateBufferLineToString(x,b,E=0,D){const N=this.lines.get(x);return N?N.translateToString(b,E,D):""}getWrappedRangeForLine(x){let b=x,E=x;for(;b>0&&this.lines.get(b).isWrapped;)b--;for(;E+10;);return x>=this._cols?this._cols-1:x<0?0:x}nextStop(x){for(x==null&&(x=this.x);!this.tabs[++x]&&x=this._cols?this._cols-1:x<0?0:x}clearMarkers(x){this._isClearing=!0;for(let b=0;b{b.line-=E,b.line<0&&b.dispose()}))),b.register(this.lines.onInsert((E=>{b.line>=E.index&&(b.line+=E.amount)}))),b.register(this.lines.onDelete((E=>{b.line>=E.index&&b.lineE.index&&(b.line-=E.amount)}))),b.register(b.onDispose((()=>this._removeMarker(b)))),b}_removeMarker(x){this._isClearing||this.markers.splice(this.markers.indexOf(x),1)}}},8437:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const f=c(3734),p=c(511),d=c(643),v=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let _=0;class C{constructor(S,y,x=!1){this.isWrapped=x,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*S);const b=y||p.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let E=0;E>22,2097152&y?this._combined[S].charCodeAt(this._combined[S].length-1):x]}set(S,y){this._data[3*S+1]=y[d.CHAR_DATA_ATTR_INDEX],y[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[S]=y[1],this._data[3*S+0]=2097152|S|y[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*S+0]=y[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(S){return this._data[3*S+0]>>22}hasWidth(S){return 12582912&this._data[3*S+0]}getFg(S){return this._data[3*S+1]}getBg(S){return this._data[3*S+2]}hasContent(S){return 4194303&this._data[3*S+0]}getCodePoint(S){const y=this._data[3*S+0];return 2097152&y?this._combined[S].charCodeAt(this._combined[S].length-1):2097151&y}isCombined(S){return 2097152&this._data[3*S+0]}getString(S){const y=this._data[3*S+0];return 2097152&y?this._combined[S]:2097151&y?(0,v.stringFromCodePoint)(2097151&y):""}isProtected(S){return 536870912&this._data[3*S+2]}loadCell(S,y){return _=3*S,y.content=this._data[_+0],y.fg=this._data[_+1],y.bg=this._data[_+2],2097152&y.content&&(y.combinedData=this._combined[S]),268435456&y.bg&&(y.extended=this._extendedAttrs[S]),y}setCell(S,y){2097152&y.content&&(this._combined[S]=y.combinedData),268435456&y.bg&&(this._extendedAttrs[S]=y.extended),this._data[3*S+0]=y.content,this._data[3*S+1]=y.fg,this._data[3*S+2]=y.bg}setCellFromCodepoint(S,y,x,b){268435456&b.bg&&(this._extendedAttrs[S]=b.extended),this._data[3*S+0]=y|x<<22,this._data[3*S+1]=b.fg,this._data[3*S+2]=b.bg}addCodepointToCell(S,y,x){let b=this._data[3*S+0];2097152&b?this._combined[S]+=(0,v.stringFromCodePoint)(y):2097151&b?(this._combined[S]=(0,v.stringFromCodePoint)(2097151&b)+(0,v.stringFromCodePoint)(y),b&=-2097152,b|=2097152):b=y|4194304,x&&(b&=-12582913,b|=x<<22),this._data[3*S+0]=b}insertCells(S,y,x){if((S%=this.length)&&this.getWidth(S-1)===2&&this.setCellFromCodepoint(S-1,0,1,x),y=0;--E)this.setCell(S+y+E,this.loadCell(S+E,b));for(let E=0;Ethis.length){if(this._data.buffer.byteLength>=4*x)this._data=new Uint32Array(this._data.buffer,0,x);else{const b=new Uint32Array(x);b.set(this._data),this._data=b}for(let b=this.length;b=S&&delete this._combined[N]}const E=Object.keys(this._extendedAttrs);for(let D=0;D=S&&delete this._extendedAttrs[N]}}return this.length=S,4*x*2=0;--S)if(4194303&this._data[3*S+0])return S+(this._data[3*S+0]>>22);return 0}getNoBgTrimmedLength(){for(let S=this.length-1;S>=0;--S)if(4194303&this._data[3*S+0]||50331648&this._data[3*S+2])return S+(this._data[3*S+0]>>22);return 0}copyCellsFrom(S,y,x,b,E){const D=S._data;if(E)for(let R=b-1;R>=0;R--){for(let T=0;T<3;T++)this._data[3*(x+R)+T]=D[3*(y+R)+T];268435456&D[3*(y+R)+2]&&(this._extendedAttrs[x+R]=S._extendedAttrs[y+R])}else for(let R=0;R=y&&(this._combined[T-y+x]=S._combined[T])}}translateToString(S,y,x,b){y=y??0,x=x??this.length,S&&(x=Math.min(x,this.getTrimmedLength())),b&&(b.length=0);let E="";for(;y>22||1}return b&&b.push(y),E}}o.BufferLine=C},4841:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,f){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return f*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(u,o)=>{function c(f,p,d){if(p===f.length-1)return f[p].getTrimmedLength();const v=!f[p].hasContent(d-1)&&f[p].getWidth(d-1)===1,_=f[p+1].getWidth(0)===2;return v&&_?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(f,p,d,v,_){const C=[];for(let w=0;w=w&&v0&&(T>b||x[T].getTrimmedLength()===0);T--)R++;R>0&&(C.push(w+x.length-R),C.push(R)),w+=x.length-1}return C},o.reflowLargerCreateNewLayout=function(f,p){const d=[];let v=0,_=p[v],C=0;for(let w=0;wc(f,x,p))).reduce(((y,x)=>y+x));let C=0,w=0,S=0;for(;S<_;){if(_-Sy&&(C-=y,w++);const x=f[w].getWidth(C-1)===2;x&&C--;const b=x?d-1:d;v.push(b),S+=b}return v},o.getWrappedLineTrimmedLength=c},5295:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const f=c(8460),p=c(844),d=c(9092);class v extends p.Disposable{constructor(C,w){super(),this._optionsService=C,this._bufferService=w,this._onBufferActivate=this.register(new f.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(C,w){this._normal.resize(C,w),this._alt.resize(C,w),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}o.BufferSet=v},511:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const f=c(482),p=c(643),d=c(3734);class v extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const w=new v;return w.setFromCharData(C),w}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(C){this.fg=C[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let w=!1;if(C[p.CHAR_DATA_CHAR_INDEX].length>2)w=!0;else if(C[p.CHAR_DATA_CHAR_INDEX].length===2){const S=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=S&&S<=56319){const y=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=y&&y<=57343?this.content=1024*(S-55296)+y-56320+65536|C[p.CHAR_DATA_WIDTH_INDEX]<<22:w=!0}else w=!0}else this.content=C[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[p.CHAR_DATA_WIDTH_INDEX]<<22;w&&(this.combinedData=C[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=v},643:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const f=c(8460),p=c(844);class d{get id(){return this._id}constructor(_){this.line=_,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(_){return this._disposables.push(_),_}}o.Marker=d,d._nextId=1},7116:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(u,o)=>{var c,f,p;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=` +`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""})(c||(o.C0=c={})),(function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"})(f||(o.C1=f={})),(function(d){d.ST=`${c.ESC}\\`})(p||(o.C1_ESCAPED=p={}))},7399:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const f=c(2584),p={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(d,v,_,C){const w={type:0,cancel:!1,key:void 0},S=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?w.key=v?f.C0.ESC+"OA":f.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?w.key=v?f.C0.ESC+"OD":f.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?w.key=v?f.C0.ESC+"OC":f.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(w.key=v?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:w.key=d.ctrlKey?"\b":f.C0.DEL,d.altKey&&(w.key=f.C0.ESC+w.key);break;case 9:if(d.shiftKey){w.key=f.C0.ESC+"[Z";break}w.key=f.C0.HT,w.cancel=!0;break;case 13:w.key=d.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,w.cancel=!0;break;case 27:w.key=f.C0.ESC,d.altKey&&(w.key=f.C0.ESC+f.C0.ESC),w.cancel=!0;break;case 37:if(d.metaKey)break;S?(w.key=f.C0.ESC+"[1;"+(S+1)+"D",w.key===f.C0.ESC+"[1;3D"&&(w.key=f.C0.ESC+(_?"b":"[1;5D"))):w.key=v?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(d.metaKey)break;S?(w.key=f.C0.ESC+"[1;"+(S+1)+"C",w.key===f.C0.ESC+"[1;3C"&&(w.key=f.C0.ESC+(_?"f":"[1;5C"))):w.key=v?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(d.metaKey)break;S?(w.key=f.C0.ESC+"[1;"+(S+1)+"A",_||w.key!==f.C0.ESC+"[1;3A"||(w.key=f.C0.ESC+"[1;5A")):w.key=v?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(d.metaKey)break;S?(w.key=f.C0.ESC+"[1;"+(S+1)+"B",_||w.key!==f.C0.ESC+"[1;3B"||(w.key=f.C0.ESC+"[1;5B")):w.key=v?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(w.key=f.C0.ESC+"[2~");break;case 46:w.key=S?f.C0.ESC+"[3;"+(S+1)+"~":f.C0.ESC+"[3~";break;case 36:w.key=S?f.C0.ESC+"[1;"+(S+1)+"H":v?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:w.key=S?f.C0.ESC+"[1;"+(S+1)+"F":v?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:d.shiftKey?w.type=2:d.ctrlKey?w.key=f.C0.ESC+"[5;"+(S+1)+"~":w.key=f.C0.ESC+"[5~";break;case 34:d.shiftKey?w.type=3:d.ctrlKey?w.key=f.C0.ESC+"[6;"+(S+1)+"~":w.key=f.C0.ESC+"[6~";break;case 112:w.key=S?f.C0.ESC+"[1;"+(S+1)+"P":f.C0.ESC+"OP";break;case 113:w.key=S?f.C0.ESC+"[1;"+(S+1)+"Q":f.C0.ESC+"OQ";break;case 114:w.key=S?f.C0.ESC+"[1;"+(S+1)+"R":f.C0.ESC+"OR";break;case 115:w.key=S?f.C0.ESC+"[1;"+(S+1)+"S":f.C0.ESC+"OS";break;case 116:w.key=S?f.C0.ESC+"[15;"+(S+1)+"~":f.C0.ESC+"[15~";break;case 117:w.key=S?f.C0.ESC+"[17;"+(S+1)+"~":f.C0.ESC+"[17~";break;case 118:w.key=S?f.C0.ESC+"[18;"+(S+1)+"~":f.C0.ESC+"[18~";break;case 119:w.key=S?f.C0.ESC+"[19;"+(S+1)+"~":f.C0.ESC+"[19~";break;case 120:w.key=S?f.C0.ESC+"[20;"+(S+1)+"~":f.C0.ESC+"[20~";break;case 121:w.key=S?f.C0.ESC+"[21;"+(S+1)+"~":f.C0.ESC+"[21~";break;case 122:w.key=S?f.C0.ESC+"[23;"+(S+1)+"~":f.C0.ESC+"[23~";break;case 123:w.key=S?f.C0.ESC+"[24;"+(S+1)+"~":f.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(_&&!C||!d.altKey||d.metaKey)!_||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?w.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(w.key=f.C0.US),d.key==="@"&&(w.key=f.C0.NUL)):d.keyCode===65&&(w.type=1);else{const y=p[d.keyCode],x=y==null?void 0:y[d.shiftKey?1:0];if(x)w.key=f.C0.ESC+x;else if(d.keyCode>=65&&d.keyCode<=90){const b=d.ctrlKey?d.keyCode-64:d.keyCode+32;let E=String.fromCharCode(b);d.shiftKey&&(E=E.toUpperCase()),w.key=f.C0.ESC+E}else if(d.keyCode===32)w.key=f.C0.ESC+(d.ctrlKey?f.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let b=d.code.slice(3,4);d.shiftKey||(b=b.toLowerCase()),w.key=f.C0.ESC+b,w.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?w.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?w.key=f.C0.NUL:d.keyCode>=51&&d.keyCode<=55?w.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?w.key=f.C0.DEL:d.keyCode===219?w.key=f.C0.ESC:d.keyCode===220?w.key=f.C0.FS:d.keyCode===221&&(w.key=f.C0.GS)}return w}},482:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,f=0,p=c.length){let d="";for(let v=f;v65535?(_-=65536,d+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):d+=String.fromCharCode(_)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,f){const p=c.length;if(!p)return 0;let d=0,v=0;if(this._interim){const _=c.charCodeAt(v++);56320<=_&&_<=57343?f[d++]=1024*(this._interim-55296)+_-56320+65536:(f[d++]=this._interim,f[d++]=_),this._interim=0}for(let _=v;_=p)return this._interim=C,d;const w=c.charCodeAt(_);56320<=w&&w<=57343?f[d++]=1024*(C-55296)+w-56320+65536:(f[d++]=C,f[d++]=w)}else C!==65279&&(f[d++]=C)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,f){const p=c.length;if(!p)return 0;let d,v,_,C,w=0,S=0,y=0;if(this.interim[0]){let E=!1,D=this.interim[0];D&=(224&D)==192?31:(240&D)==224?15:7;let N,R=0;for(;(N=63&this.interim[++R])&&R<4;)D<<=6,D|=N;const T=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,j=T-R;for(;y=p)return 0;if(N=c[y++],(192&N)!=128){y--,E=!0;break}this.interim[R++]=N,D<<=6,D|=63&N}E||(T===2?D<128?y--:f[w++]=D:T===3?D<2048||D>=55296&&D<=57343||D===65279||(f[w++]=D):D<65536||D>1114111||(f[w++]=D)),this.interim.fill(0)}const x=p-4;let b=y;for(;b=p)return this.interim[0]=d,w;if(v=c[b++],(192&v)!=128){b--;continue}if(S=(31&d)<<6|63&v,S<128){b--;continue}f[w++]=S}else if((240&d)==224){if(b>=p)return this.interim[0]=d,w;if(v=c[b++],(192&v)!=128){b--;continue}if(b>=p)return this.interim[0]=d,this.interim[1]=v,w;if(_=c[b++],(192&_)!=128){b--;continue}if(S=(15&d)<<12|(63&v)<<6|63&_,S<2048||S>=55296&&S<=57343||S===65279)continue;f[w++]=S}else if((248&d)==240){if(b>=p)return this.interim[0]=d,w;if(v=c[b++],(192&v)!=128){b--;continue}if(b>=p)return this.interim[0]=d,this.interim[1]=v,w;if(_=c[b++],(192&_)!=128){b--;continue}if(b>=p)return this.interim[0]=d,this.interim[1]=v,this.interim[2]=_,w;if(C=c[b++],(192&C)!=128){b--;continue}if(S=(7&d)<<18|(63&v)<<12|(63&_)<<6|63&C,S<65536||S>1114111)continue;f[w++]=S}}return w}}},225:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const f=c(1480),p=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let v;o.UnicodeV6=class{constructor(){if(this.version="6",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160),v.fill(2,4352,4448),v[9001]=2,v[9002]=2,v.fill(2,11904,42192),v[12351]=1,v.fill(2,44032,55204),v.fill(2,63744,64256),v.fill(2,65040,65050),v.fill(2,65072,65136),v.fill(2,65280,65377),v.fill(2,65504,65511);for(let _=0;_w[x][1])return!1;for(;x>=y;)if(S=y+x>>1,C>w[S][1])y=S+1;else{if(!(C=131072&&_<=196605||_>=196608&&_<=262141?2:1}charProperties(_,C){let w=this.wcwidth(_),S=w===0&&C!==0;if(S){const y=f.UnicodeService.extractWidth(C);y===0?S=!1:y>w&&(w=y)}return f.UnicodeService.createPropertyValue(0,w,S)}}},5981:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const f=c(8460),p=c(844);class d extends p.Disposable{constructor(_){super(),this._action=_,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(_,C){if(C!==void 0&&this._syncCalls>C)return void(this._syncCalls=0);if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let w;for(this._isSyncWriting=!0;w=this._writeBuffer.shift();){this._action(w);const S=this._callbacks.shift();S&&S()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(_,C){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(C)}_innerWrite(_=0,C=!0){const w=_||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const S=this._writeBuffer[this._bufferOffset],y=this._action(S,C);if(y){const b=E=>Date.now()-w>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(w,E);return void y.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(b)}const x=this._callbacks[this._bufferOffset];if(x&&x(),this._bufferOffset++,this._pendingData-=S.length,Date.now()-w>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=d},5941:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,f=/^[\da-f]+$/;function p(d,v){const _=d.toString(16),C=_.length<2?"0"+_:_;switch(v){case 4:return _[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}o.parseColor=function(d){if(!d)return;let v=d.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const _=c.exec(v);if(_){const C=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/C*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/C*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/C*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),f.exec(v)&&[3,6,9,12].includes(v.length))){const _=v.length/3,C=[0,0,0];for(let w=0;w<3;++w){const S=parseInt(v.slice(_*w,_*w+_),16);C[w]=_===1?S<<4:_===2?S:_===3?S>>4:S>>8}return C}},o.toRgbString=function(d,v=16){const[_,C,w]=d;return`rgb:${p(_,v)}/${p(C,v)}/${p(w,v)}`}},5770:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const f=c(482),p=c(8742),d=c(5770),v=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(C,w){this._handlers[C]===void 0&&(this._handlers[C]=[]);const S=this._handlers[C];return S.push(w),{dispose:()=>{const y=S.indexOf(w);y!==-1&&S.splice(y,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(C,w){if(this.reset(),this._ident=C,this._active=this._handlers[C]||v,this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].hook(w);else this._handlerFb(this._ident,"HOOK",w)}put(C,w,S){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(C,w,S);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(C,w,S))}unhook(C,w=!0){if(this._active.length){let S=!1,y=this._active.length-1,x=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,S=w,x=this._stack.fallThrough,this._stack.paused=!1),!x&&S===!1){for(;y>=0&&(S=this._active[y].unhook(C),S!==!0);y--)if(S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,S;y--}for(;y>=0;y--)if(S=this._active[y].unhook(!1),S instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,S}else this._handlerFb(this._ident,"UNHOOK",C);this._active=v,this._ident=0}};const _=new p.Params;_.addParam(0),o.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=_,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():_,this._data="",this._hitLimit=!1}put(C,w,S){this._hitLimit||(this._data+=(0,f.utf32ToString)(C,w,S),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let w=!1;if(this._hitLimit)w=!1;else if(C&&(w=this._handler(this._data,this._params),w instanceof Promise))return w.then((S=>(this._params=_,this._data="",this._hitLimit=!1,S)));return this._params=_,this._data="",this._hitLimit=!1,w}}},2015:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const f=c(844),p=c(8742),d=c(6242),v=c(6351);class _{constructor(y){this.table=new Uint8Array(y)}setDefault(y,x){this.table.fill(y<<4|x)}add(y,x,b,E){this.table[x<<8|y]=b<<4|E}addMany(y,x,b,E){for(let D=0;DT)),x=(R,T)=>y.slice(R,T),b=x(32,127),E=x(0,24);E.push(25),E.push.apply(E,x(28,32));const D=x(0,14);let N;for(N in S.setDefault(1,0),S.addMany(b,0,2,0),D)S.addMany([24,26,153,154],N,3,0),S.addMany(x(128,144),N,3,0),S.addMany(x(144,152),N,3,0),S.add(156,N,0,0),S.add(27,N,11,1),S.add(157,N,4,8),S.addMany([152,158,159],N,0,7),S.add(155,N,11,3),S.add(144,N,11,9);return S.addMany(E,0,3,0),S.addMany(E,1,3,1),S.add(127,1,0,1),S.addMany(E,8,0,8),S.addMany(E,3,3,3),S.add(127,3,0,3),S.addMany(E,4,3,4),S.add(127,4,0,4),S.addMany(E,6,3,6),S.addMany(E,5,3,5),S.add(127,5,0,5),S.addMany(E,2,3,2),S.add(127,2,0,2),S.add(93,1,4,8),S.addMany(b,8,5,8),S.add(127,8,5,8),S.addMany([156,27,24,26,7],8,6,0),S.addMany(x(28,32),8,0,8),S.addMany([88,94,95],1,0,7),S.addMany(b,7,0,7),S.addMany(E,7,0,7),S.add(156,7,0,0),S.add(127,7,0,7),S.add(91,1,11,3),S.addMany(x(64,127),3,7,0),S.addMany(x(48,60),3,8,4),S.addMany([60,61,62,63],3,9,4),S.addMany(x(48,60),4,8,4),S.addMany(x(64,127),4,7,0),S.addMany([60,61,62,63],4,0,6),S.addMany(x(32,64),6,0,6),S.add(127,6,0,6),S.addMany(x(64,127),6,0,0),S.addMany(x(32,48),3,9,5),S.addMany(x(32,48),5,9,5),S.addMany(x(48,64),5,0,6),S.addMany(x(64,127),5,7,0),S.addMany(x(32,48),4,9,5),S.addMany(x(32,48),1,9,2),S.addMany(x(32,48),2,9,2),S.addMany(x(48,127),2,10,0),S.addMany(x(48,80),1,10,0),S.addMany(x(81,88),1,10,0),S.addMany([89,90,92],1,10,0),S.addMany(x(96,127),1,10,0),S.add(80,1,11,9),S.addMany(E,9,0,9),S.add(127,9,0,9),S.addMany(x(28,32),9,0,9),S.addMany(x(32,48),9,9,12),S.addMany(x(48,60),9,8,10),S.addMany([60,61,62,63],9,9,10),S.addMany(E,11,0,11),S.addMany(x(32,128),11,0,11),S.addMany(x(28,32),11,0,11),S.addMany(E,10,0,10),S.add(127,10,0,10),S.addMany(x(28,32),10,0,10),S.addMany(x(48,60),10,8,10),S.addMany([60,61,62,63],10,0,11),S.addMany(x(32,48),10,9,12),S.addMany(E,12,0,12),S.add(127,12,0,12),S.addMany(x(28,32),12,0,12),S.addMany(x(32,48),12,9,12),S.addMany(x(48,64),12,0,11),S.addMany(x(64,127),12,12,13),S.addMany(x(64,127),10,12,13),S.addMany(x(64,127),9,12,13),S.addMany(E,13,13,13),S.addMany(b,13,13,13),S.add(127,13,0,13),S.addMany([27,156,24,26],13,14,0),S.add(C,0,2,0),S.add(C,8,5,8),S.add(C,6,0,6),S.add(C,11,0,11),S.add(C,13,13,13),S})();class w extends f.Disposable{constructor(y=o.VT500_TRANSITION_TABLE){super(),this._transitions=y,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(x,b,E)=>{},this._executeHandlerFb=x=>{},this._csiHandlerFb=(x,b)=>{},this._escHandlerFb=x=>{},this._errorHandlerFb=x=>x,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(y,x=[64,126]){let b=0;if(y.prefix){if(y.prefix.length>1)throw new Error("only one byte as prefix supported");if(b=y.prefix.charCodeAt(0),b&&60>b||b>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(y.intermediates){if(y.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let D=0;DN||N>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");b<<=8,b|=N}}if(y.final.length!==1)throw new Error("final must be a single byte");const E=y.final.charCodeAt(0);if(x[0]>E||E>x[1])throw new Error(`final must be in range ${x[0]} .. ${x[1]}`);return b<<=8,b|=E,b}identToString(y){const x=[];for(;y;)x.push(String.fromCharCode(255&y)),y>>=8;return x.reverse().join("")}setPrintHandler(y){this._printHandler=y}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(y,x){const b=this._identifier(y,[48,126]);this._escHandlers[b]===void 0&&(this._escHandlers[b]=[]);const E=this._escHandlers[b];return E.push(x),{dispose:()=>{const D=E.indexOf(x);D!==-1&&E.splice(D,1)}}}clearEscHandler(y){this._escHandlers[this._identifier(y,[48,126])]&&delete this._escHandlers[this._identifier(y,[48,126])]}setEscHandlerFallback(y){this._escHandlerFb=y}setExecuteHandler(y,x){this._executeHandlers[y.charCodeAt(0)]=x}clearExecuteHandler(y){this._executeHandlers[y.charCodeAt(0)]&&delete this._executeHandlers[y.charCodeAt(0)]}setExecuteHandlerFallback(y){this._executeHandlerFb=y}registerCsiHandler(y,x){const b=this._identifier(y);this._csiHandlers[b]===void 0&&(this._csiHandlers[b]=[]);const E=this._csiHandlers[b];return E.push(x),{dispose:()=>{const D=E.indexOf(x);D!==-1&&E.splice(D,1)}}}clearCsiHandler(y){this._csiHandlers[this._identifier(y)]&&delete this._csiHandlers[this._identifier(y)]}setCsiHandlerFallback(y){this._csiHandlerFb=y}registerDcsHandler(y,x){return this._dcsParser.registerHandler(this._identifier(y),x)}clearDcsHandler(y){this._dcsParser.clearHandler(this._identifier(y))}setDcsHandlerFallback(y){this._dcsParser.setHandlerFallback(y)}registerOscHandler(y,x){return this._oscParser.registerHandler(y,x)}clearOscHandler(y){this._oscParser.clearHandler(y)}setOscHandlerFallback(y){this._oscParser.setHandlerFallback(y)}setErrorHandler(y){this._errorHandler=y}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(y,x,b,E,D){this._parseStack.state=y,this._parseStack.handlers=x,this._parseStack.handlerPos=b,this._parseStack.transition=E,this._parseStack.chunkPos=D}parse(y,x,b){let E,D=0,N=0,R=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,R=this._parseStack.chunkPos+1;else{if(b===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const T=this._parseStack.handlers;let j=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(b===!1&&j>-1){for(;j>=0&&(E=T[j](this._params),E!==!0);j--)if(E instanceof Promise)return this._parseStack.handlerPos=j,E}this._parseStack.handlers=[];break;case 4:if(b===!1&&j>-1){for(;j>=0&&(E=T[j](),E!==!0);j--)if(E instanceof Promise)return this._parseStack.handlerPos=j,E}this._parseStack.handlers=[];break;case 6:if(D=y[this._parseStack.chunkPos],E=this._dcsParser.unhook(D!==24&&D!==26,b),E)return E;D===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(D=y[this._parseStack.chunkPos],E=this._oscParser.end(D!==24&&D!==26,b),E)return E;D===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,R=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let T=R;T>4){case 2:for(let F=T+1;;++F){if(F>=x||(D=y[F])<32||D>126&&D=x||(D=y[F])<32||D>126&&D=x||(D=y[F])<32||D>126&&D=x||(D=y[F])<32||D>126&&D=0&&(E=j[B](this._params),E!==!0);B--)if(E instanceof Promise)return this._preserveStack(3,j,B,N,T),E;B<0&&this._csiHandlerFb(this._collect<<8|D,this._params),this.precedingJoinState=0;break;case 8:do switch(D){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(D-48)}while(++T47&&D<60);T--;break;case 9:this._collect<<=8,this._collect|=D;break;case 10:const z=this._escHandlers[this._collect<<8|D];let V=z?z.length-1:-1;for(;V>=0&&(E=z[V](),E!==!0);V--)if(E instanceof Promise)return this._preserveStack(4,z,V,N,T),E;V<0&&this._escHandlerFb(this._collect<<8|D),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|D,this._params);break;case 13:for(let F=T+1;;++F)if(F>=x||(D=y[F])===24||D===26||D===27||D>127&&D=x||(D=y[F])<32||D>127&&D{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const f=c(5770),p=c(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(v,_){this._handlers[v]===void 0&&(this._handlers[v]=[]);const C=this._handlers[v];return C.push(_),{dispose:()=>{const w=C.indexOf(_);w!==-1&&C.splice(w,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,_,C){if(this._active.length)for(let w=this._active.length-1;w>=0;w--)this._active[w].put(v,_,C);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(v,_,C))}start(){this.reset(),this._state=1}put(v,_,C){if(this._state!==3){if(this._state===1)for(;_0&&this._put(v,_,C)}}end(v,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,w=this._active.length-1,S=!1;if(this._stack.paused&&(w=this._stack.loopPosition-1,C=_,S=this._stack.fallThrough,this._stack.paused=!1),!S&&C===!1){for(;w>=0&&(C=this._active[w].end(v),C!==!0);w--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!1,C;w--}for(;w>=0;w--)if(C=this._active[w].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=w,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",v);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,_,C){this._hitLimit||(this._data+=(0,p.utf32ToString)(v,_,C),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let _=!1;if(this._hitLimit)_=!1;else if(v&&(_=this._handler(this._data),_ instanceof Promise))return _.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,_}}},8742:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class f{static fromArray(d){const v=new f;if(!d.length)return v;for(let _=Array.isArray(d[0])?1:0;_256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(v),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new f(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let v=0;v>8,C=255&this._subParamsIdx[v];C-_>0&&d.push(Array.prototype.slice.call(this._subParams,_,C))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>c?c:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>c?c:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const v=this._subParamsIdx[d]>>8,_=255&this._subParamsIdx[d];return _-v>0?this._subParams.subarray(v,_):null}getSubParamsAll(){const d={};for(let v=0;v>8,C=255&this._subParamsIdx[v];C-_>0&&(d[v]=this._subParams.slice(_,C))}return d}addDigit(d){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const _=this._digitIsSub?this._subParams:this.params,C=_[v-1];_[v-1]=~C?Math.min(10*C+d,c):d}}o.Params=f},5741:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,f){const p={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(p),f.dispose=()=>this._wrappedAddonDispose(p),f.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let f=-1;for(let p=0;p{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const f=c(3785),p=c(511);o.BufferApiView=class{constructor(d,v){this._buffer=d,this.type=v}init(d){return this._buffer=d,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(d){const v=this._buffer.lines.get(d);if(v)return new f.BufferLineApiView(v)}getNullCell(){return new p.CellData}}},3785:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const f=c(511);o.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,d){if(!(p<0||p>=this._line.length))return d?(this._line.loadCell(p,d),d):this._line.loadCell(p,new f.CellData)}translateToString(p,d,v){return this._line.translateToString(p,d,v)}}},8285:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const f=c(8771),p=c(8460),d=c(844);class v extends d.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=v},7975:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,f){return this._core.registerCsiHandler(c,(p=>f(p.toArray())))}addCsiHandler(c,f){return this.registerCsiHandler(c,f)}registerDcsHandler(c,f){return this._core.registerDcsHandler(c,((p,d)=>f(p,d.toArray())))}addDcsHandler(c,f){return this.registerDcsHandler(c,f)}registerEscHandler(c,f){return this._core.registerEscHandler(c,f)}addEscHandler(c,f){return this.registerEscHandler(c,f)}registerOscHandler(c,f){return this._core.registerOscHandler(c,f)}addOscHandler(c,f){return this.registerOscHandler(c,f)}}},7090:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(u,o,c){var f=this&&this.__decorate||function(S,y,x,b){var E,D=arguments.length,N=D<3?y:b===null?b=Object.getOwnPropertyDescriptor(y,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,y,x,b);else for(var R=S.length-1;R>=0;R--)(E=S[R])&&(N=(D<3?E(N):D>3?E(y,x,N):E(y,x))||N);return D>3&&N&&Object.defineProperty(y,x,N),N},p=this&&this.__param||function(S,y){return function(x,b){y(x,b,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=c(8460),v=c(844),_=c(5295),C=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let w=o.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(S){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(S.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(S.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new _.BufferSet(S,this))}resize(S,y){this.cols=S,this.rows=y,this.buffers.resize(S,y),this._onResize.fire({cols:S,rows:y})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(S,y=!1){const x=this.buffer;let b;b=this._cachedBlankLine,b&&b.length===this.cols&&b.getFg(0)===S.fg&&b.getBg(0)===S.bg||(b=x.getBlankLine(S,y),this._cachedBlankLine=b),b.isWrapped=y;const E=x.ybase+x.scrollTop,D=x.ybase+x.scrollBottom;if(x.scrollTop===0){const N=x.lines.isFull;D===x.lines.length-1?N?x.lines.recycle().copyFrom(b):x.lines.push(b.clone()):x.lines.splice(D+1,0,b.clone()),N?this.isUserScrolling&&(x.ydisp=Math.max(x.ydisp-1,0)):(x.ybase++,this.isUserScrolling||x.ydisp++)}else{const N=D-E+1;x.lines.shiftElements(E+1,N-1,-1),x.lines.set(D,b.clone())}this.isUserScrolling||(x.ydisp=x.ybase),this._onScroll.fire(x.ydisp)}scrollLines(S,y,x){const b=this.buffer;if(S<0){if(b.ydisp===0)return;this.isUserScrolling=!0}else S+b.ydisp>=b.ybase&&(this.isUserScrolling=!1);const E=b.ydisp;b.ydisp=Math.max(Math.min(b.ydisp+S,b.ybase),0),E!==b.ydisp&&(y||this._onScroll.fire(b.ydisp))}};o.BufferService=w=f([p(0,C.IOptionsService)],w)},7994:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,f){this._charsets[c]=f,this.glevel===c&&(this.charset=f)}}},1753:function(u,o,c){var f=this&&this.__decorate||function(b,E,D,N){var R,T=arguments.length,j=T<3?E:N===null?N=Object.getOwnPropertyDescriptor(E,D):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(b,E,D,N);else for(var B=b.length-1;B>=0;B--)(R=b[B])&&(j=(T<3?R(j):T>3?R(E,D,j):R(E,D))||j);return T>3&&j&&Object.defineProperty(E,D,j),j},p=this&&this.__param||function(b,E){return function(D,N){E(D,N,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=c(2585),v=c(8460),_=c(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:b=>b.button!==4&&b.action===1&&(b.ctrl=!1,b.alt=!1,b.shift=!1,!0)},VT200:{events:19,restrict:b=>b.action!==32},DRAG:{events:23,restrict:b=>b.action!==32||b.button!==3},ANY:{events:31,restrict:b=>!0}};function w(b,E){let D=(b.ctrl?16:0)|(b.shift?4:0)|(b.alt?8:0);return b.button===4?(D|=64,D|=b.action):(D|=3&b.button,4&b.button&&(D|=64),8&b.button&&(D|=128),b.action===32?D|=32:b.action!==0||E||(D|=3)),D}const S=String.fromCharCode,y={DEFAULT:b=>{const E=[w(b,!1)+32,b.col+32,b.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${S(E[0])}${S(E[1])}${S(E[2])}`},SGR:b=>{const E=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${w(b,!0)};${b.col};${b.row}${E}`},SGR_PIXELS:b=>{const E=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${w(b,!0)};${b.x};${b.y}${E}`}};let x=o.CoreMouseService=class extends _.Disposable{constructor(b,E){super(),this._bufferService=b,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const D of Object.keys(C))this.addProtocol(D,C[D]);for(const D of Object.keys(y))this.addEncoding(D,y[D]);this.reset()}addProtocol(b,E){this._protocols[b]=E}addEncoding(b,E){this._encodings[b]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(b){if(!this._protocols[b])throw new Error(`unknown protocol "${b}"`);this._activeProtocol=b,this._onProtocolChange.fire(this._protocols[b].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(b){if(!this._encodings[b])throw new Error(`unknown encoding "${b}"`);this._activeEncoding=b}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(b){if(b.col<0||b.col>=this._bufferService.cols||b.row<0||b.row>=this._bufferService.rows||b.button===4&&b.action===32||b.button===3&&b.action!==32||b.button!==4&&(b.action===2||b.action===3)||(b.col++,b.row++,b.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,b,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(b))return!1;const E=this._encodings[this._activeEncoding](b);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=b,!0}explainEvents(b){return{down:!!(1&b),up:!!(2&b),drag:!!(4&b),move:!!(8&b),wheel:!!(16&b)}}_equalEvents(b,E,D){if(D){if(b.x!==E.x||b.y!==E.y)return!1}else if(b.col!==E.col||b.row!==E.row)return!1;return b.button===E.button&&b.action===E.action&&b.ctrl===E.ctrl&&b.alt===E.alt&&b.shift===E.shift}};o.CoreMouseService=x=f([p(0,d.IBufferService),p(1,d.ICoreService)],x)},6975:function(u,o,c){var f=this&&this.__decorate||function(x,b,E,D){var N,R=arguments.length,T=R<3?b:D===null?D=Object.getOwnPropertyDescriptor(b,E):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,b,E,D);else for(var j=x.length-1;j>=0;j--)(N=x[j])&&(T=(R<3?N(T):R>3?N(b,E,T):N(b,E))||T);return R>3&&T&&Object.defineProperty(b,E,T),T},p=this&&this.__param||function(x,b){return function(E,D){b(E,D,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=c(1439),v=c(8460),_=c(844),C=c(2585),w=Object.freeze({insertMode:!1}),S=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let y=o.CoreService=class extends _.Disposable{constructor(x,b,E){super(),this._bufferService=x,this._logService=b,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(w),this.decPrivateModes=(0,d.clone)(S)}reset(){this.modes=(0,d.clone)(w),this.decPrivateModes=(0,d.clone)(S)}triggerDataEvent(x,b=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;b&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),b&&this._onUserInput.fire(),this._logService.debug(`sending data "${x}"`,(()=>x.split("").map((D=>D.charCodeAt(0))))),this._onData.fire(x)}triggerBinaryEvent(x){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${x}"`,(()=>x.split("").map((b=>b.charCodeAt(0))))),this._onBinary.fire(x))}};o.CoreService=y=f([p(0,C.IBufferService),p(1,C.ILogService),p(2,C.IOptionsService)],y)},9074:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const f=c(8055),p=c(8460),d=c(844),v=c(6106);let _=0,C=0;class w extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList((x=>x==null?void 0:x.marker.line)),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)((()=>this.reset())))}registerDecoration(x){if(x.marker.isDisposed)return;const b=new S(x);if(b){const E=b.marker.onDispose((()=>b.dispose()));b.onDispose((()=>{b&&(this._decorations.delete(b)&&this._onDecorationRemoved.fire(b),E.dispose())})),this._decorations.insert(b),this._onDecorationRegistered.fire(b)}return b}reset(){for(const x of this._decorations.values())x.dispose();this._decorations.clear()}*getDecorationsAtCell(x,b,E){let D=0,N=0;for(const R of this._decorations.getKeyIterator(b))D=R.options.x??0,N=D+(R.options.width??1),x>=D&&x{_=N.options.x??0,C=_+(N.options.width??1),x>=_&&x{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const f=c(2585),p=c(8343);class d{constructor(..._){this._entries=new Map;for(const[C,w]of _)this.set(C,w)}set(_,C){const w=this._entries.get(_);return this._entries.set(_,C),w}forEach(_){for(const[C,w]of this._entries.entries())_(C,w)}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(f.IInstantiationService,this)}setService(v,_){this._services.set(v,_)}getService(v){return this._services.get(v)}createInstance(v,..._){const C=(0,p.getServiceDependencies)(v).sort(((y,x)=>y.index-x.index)),w=[];for(const y of C){const x=this._services.get(y.id);if(!x)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${y.id}.`);w.push(x)}const S=C.length>0?C[0].index:_.length;if(_.length!==S)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${S+1} conflicts with ${_.length} static arguments`);return new v(..._,...w)}}},7866:function(u,o,c){var f=this&&this.__decorate||function(S,y,x,b){var E,D=arguments.length,N=D<3?y:b===null?b=Object.getOwnPropertyDescriptor(y,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(S,y,x,b);else for(var R=S.length-1;R>=0;R--)(E=S[R])&&(N=(D<3?E(N):D>3?E(y,x,N):E(y,x))||N);return D>3&&N&&Object.defineProperty(y,x,N),N},p=this&&this.__param||function(S,y){return function(x,b){y(x,b,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=c(844),v=c(2585),_={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let C,w=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(S){super(),this._optionsService=S,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=_[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(S){for(let y=0;yJSON.stringify(N))).join(", ")})`);const D=b.apply(this,E);return C.trace(`GlyphRenderer#${b.name} return`,D),D}}},7302:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const f=c(8460),p=c(844),d=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const v=["normal","bold","100","200","300","400","500","600","700","800","900"];class _ extends p.Disposable{constructor(w){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const S={...o.DEFAULT_OPTIONS};for(const y in w)if(y in S)try{const x=w[y];S[y]=this._sanitizeAndValidateOption(y,x)}catch(x){console.error(x)}this.rawOptions=S,this.options={...S},this._setupOptions(),this.register((0,p.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(w,S){return this.onOptionChange((y=>{y===w&&S(this.rawOptions[w])}))}onMultipleOptionChange(w,S){return this.onOptionChange((y=>{w.indexOf(y)!==-1&&S()}))}_setupOptions(){const w=y=>{if(!(y in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);return this.rawOptions[y]},S=(y,x)=>{if(!(y in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);x=this._sanitizeAndValidateOption(y,x),this.rawOptions[y]!==x&&(this.rawOptions[y]=x,this._onOptionChange.fire(y))};for(const y in this.rawOptions){const x={get:w.bind(this,y),set:S.bind(this,y)};Object.defineProperty(this.options,y,x)}}_sanitizeAndValidateOption(w,S){switch(w){case"cursorStyle":if(S||(S=o.DEFAULT_OPTIONS[w]),!(function(y){return y==="block"||y==="underline"||y==="bar"})(S))throw new Error(`"${S}" is not a valid value for ${w}`);break;case"wordSeparator":S||(S=o.DEFAULT_OPTIONS[w]);break;case"fontWeight":case"fontWeightBold":if(typeof S=="number"&&1<=S&&S<=1e3)break;S=v.includes(S)?S:o.DEFAULT_OPTIONS[w];break;case"cursorWidth":S=Math.floor(S);case"lineHeight":case"tabStopWidth":if(S<1)throw new Error(`${w} cannot be less than 1, value: ${S}`);break;case"minimumContrastRatio":S=Math.max(1,Math.min(21,Math.round(10*S)/10));break;case"scrollback":if((S=Math.min(S,4294967295))<0)throw new Error(`${w} cannot be less than 0, value: ${S}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(S<=0)throw new Error(`${w} cannot be less than or equal to 0, value: ${S}`);break;case"rows":case"cols":if(!S&&S!==0)throw new Error(`${w} must be numeric, value: ${S}`);break;case"windowsPty":S=S??{}}return S}}o.OptionsService=_},2660:function(u,o,c){var f=this&&this.__decorate||function(_,C,w,S){var y,x=arguments.length,b=x<3?C:S===null?S=Object.getOwnPropertyDescriptor(C,w):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(_,C,w,S);else for(var E=_.length-1;E>=0;E--)(y=_[E])&&(b=(x<3?y(b):x>3?y(C,w,b):y(C,w))||b);return x>3&&b&&Object.defineProperty(C,w,b),b},p=this&&this.__param||function(_,C){return function(w,S){C(w,S,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=c(2585);let v=o.OscLinkService=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){const C=this._bufferService.buffer;if(_.id===void 0){const E=C.addMarker(C.ybase+C.y),D={data:_,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(D,E))),this._dataByLinkId.set(D.id,D),D.id}const w=_,S=this._getEntryIdKey(w),y=this._entriesWithId.get(S);if(y)return this.addLineToLink(y.id,C.ybase+C.y),y.id;const x=C.addMarker(C.ybase+C.y),b={id:this._nextId++,key:this._getEntryIdKey(w),data:w,lines:[x]};return x.onDispose((()=>this._removeMarkerFromLink(b,x))),this._entriesWithId.set(b.key,b),this._dataByLinkId.set(b.id,b),b.id}addLineToLink(_,C){const w=this._dataByLinkId.get(_);if(w&&w.lines.every((S=>S.line!==C))){const S=this._bufferService.buffer.addMarker(C);w.lines.push(S),S.onDispose((()=>this._removeMarkerFromLink(w,S)))}}getLinkData(_){var C;return(C=this._dataByLinkId.get(_))==null?void 0:C.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,C){const w=_.lines.indexOf(C);w!==-1&&(_.lines.splice(w,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};o.OscLinkService=v=f([p(0,d.IBufferService)],v)},8343:(u,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",f="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(p){return p[f]||[]},o.createDecorator=function(p){if(o.serviceRegistry.has(p))return o.serviceRegistry.get(p);const d=function(v,_,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(w,S,y){S[c]===S?S[f].push({id:w,index:y}):(S[f]=[{id:w,index:y}],S[c]=S)})(d,v,C)};return d.toString=()=>p,o.serviceRegistry.set(p,d),d}},2585:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const f=c(8343);var p;o.IBufferService=(0,f.createDecorator)("BufferService"),o.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),o.ICoreService=(0,f.createDecorator)("CoreService"),o.ICharsetService=(0,f.createDecorator)("CharsetService"),o.IInstantiationService=(0,f.createDecorator)("InstantiationService"),(function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"})(p||(o.LogLevelEnum=p={})),o.ILogService=(0,f.createDecorator)("LogService"),o.IOptionsService=(0,f.createDecorator)("OptionsService"),o.IOscLinkService=(0,f.createDecorator)("OscLinkService"),o.IUnicodeService=(0,f.createDecorator)("UnicodeService"),o.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(u,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const f=c(8460),p=c(225);class d{static extractShouldJoin(_){return(1&_)!=0}static extractWidth(_){return _>>1&3}static extractCharKind(_){return _>>3}static createPropertyValue(_,C,w=!1){return(16777215&_)<<3|(3&C)<<1|(w?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const _=new p.UnicodeV6;this.register(_),this._active=_.version,this._activeProvider=_}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(_){if(!this._providers[_])throw new Error(`unknown Unicode version "${_}"`);this._active=_,this._activeProvider=this._providers[_],this._onChange.fire(_)}register(_){this._providers[_.version]=_}wcwidth(_){return this._activeProvider.wcwidth(_)}getStringCellWidth(_){let C=0,w=0;const S=_.length;for(let y=0;y=S)return C+this.wcwidth(x);const D=_.charCodeAt(y);56320<=D&&D<=57343?x=1024*(x-55296)+D-56320+65536:C+=this.wcwidth(D)}const b=this.charProperties(x,w);let E=d.extractWidth(b);d.extractShouldJoin(b)&&(E-=d.extractWidth(w)),C+=E,w=b}return C}charProperties(_,C){return this._activeProvider.charProperties(_,C)}}o.UnicodeService=d}},r={};function a(u){var o=r[u];if(o!==void 0)return o.exports;var c=r[u]={exports:{}};return n[u].call(c.exports,c,c.exports,a),c.exports}var l={};return(()=>{var u=l;Object.defineProperty(u,"__esModule",{value:!0}),u.Terminal=void 0;const o=a(9042),c=a(3236),f=a(844),p=a(5741),d=a(8285),v=a(7975),_=a(7090),C=["cols","rows"];class w extends f.Disposable{constructor(y){super(),this._core=this.register(new c.Terminal(y)),this._addonManager=this.register(new p.AddonManager),this._publicOptions={...this._core.options};const x=E=>this._core.options[E],b=(E,D)=>{this._checkReadonlyOptions(E),this._core.options[E]=D};for(const E in this._core.options){const D={get:x.bind(this,E),set:b.bind(this,E)};Object.defineProperty(this._publicOptions,E,D)}}_checkReadonlyOptions(y){if(C.includes(y))throw new Error(`Option "${y}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new v.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new _.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const y=this._core.coreService.decPrivateModes;let x="none";switch(this._core.coreMouseService.activeProtocol){case"X10":x="x10";break;case"VT200":x="vt200";break;case"DRAG":x="drag";break;case"ANY":x="any"}return{applicationCursorKeysMode:y.applicationCursorKeys,applicationKeypadMode:y.applicationKeypad,bracketedPasteMode:y.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:x,originMode:y.origin,reverseWraparoundMode:y.reverseWraparound,sendFocusMode:y.sendFocus,wraparoundMode:y.wraparound}}get options(){return this._publicOptions}set options(y){for(const x in y)this._publicOptions[x]=y[x]}blur(){this._core.blur()}focus(){this._core.focus()}input(y,x=!0){this._core.input(y,x)}resize(y,x){this._verifyIntegers(y,x),this._core.resize(y,x)}open(y){this._core.open(y)}attachCustomKeyEventHandler(y){this._core.attachCustomKeyEventHandler(y)}attachCustomWheelEventHandler(y){this._core.attachCustomWheelEventHandler(y)}registerLinkProvider(y){return this._core.registerLinkProvider(y)}registerCharacterJoiner(y){return this._checkProposedApi(),this._core.registerCharacterJoiner(y)}deregisterCharacterJoiner(y){this._checkProposedApi(),this._core.deregisterCharacterJoiner(y)}registerMarker(y=0){return this._verifyIntegers(y),this._core.registerMarker(y)}registerDecoration(y){return this._checkProposedApi(),this._verifyPositiveIntegers(y.x??0,y.width??0,y.height??0),this._core.registerDecoration(y)}hasSelection(){return this._core.hasSelection()}select(y,x,b){this._verifyIntegers(y,x,b),this._core.select(y,x,b)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(y,x){this._verifyIntegers(y,x),this._core.selectLines(y,x)}dispose(){super.dispose()}scrollLines(y){this._verifyIntegers(y),this._core.scrollLines(y)}scrollPages(y){this._verifyIntegers(y),this._core.scrollPages(y)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(y){this._verifyIntegers(y),this._core.scrollToLine(y)}clear(){this._core.clear()}write(y,x){this._core.write(y,x)}writeln(y,x){this._core.write(y),this._core.write(`\r +`,x)}paste(y){this._core.paste(y)}refresh(y,x){this._verifyIntegers(y,x),this._core.refresh(y,x)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(y){this._addonManager.loadAddon(this,y)}static get strings(){return o}_verifyIntegers(...y){for(const x of y)if(x===1/0||isNaN(x)||x%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...y){for(const x of y)if(x&&(x===1/0||isNaN(x)||x%1!=0||x<0))throw new Error("This API only accepts positive integers")}}u.Terminal=w})(),l})()))})(bp)),bp.exports}var UB=$B();function Pb(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r{const n=t.current;if(!n)return;const r=new UB.Terminal({convertEol:!0,disableStdin:!0,fontSize:12,fontFamily:getComputedStyle(document.documentElement).getPropertyValue("--mono").trim()||"ui-monospace, Menlo, Consolas, monospace",scrollback:2e4,theme:{background:"#1a1a1a",foreground:"#e6e1e0",cursor:"#1a1a1a",selectionBackground:"#2c3441"}}),a=new PB.FitAddon;r.loadAddon(a),r.open(n);try{a.fit()}catch{}const l=new ResizeObserver(()=>{try{a.fit()}catch{}});l.observe(n);let u=!1,o=0,c=!1,f=!1;async function p(){if(c){f=!0;return}c=!0;try{for(;;){const v=await hT(e,o);if(u)return;if(v.dataBase64&&r.write(Pb(v.dataBase64)),o=v.nextOffset,v.eof)break}}catch{}finally{c=!1,f&&!u&&(f=!1,p())}}const d=QT(e,v=>{if(u)return;const _=Pb(v.dataBase64);!c&&v.offset===o?(r.write(_),o+=_.length):v.offset+_.length>o&&p()});return p(),()=>{u=!0,d(),l.disconnect(),r.dispose()}},[e]),g.jsx("div",{ref:t,style:{width:"100%",height:"100%"}})}const sa="__uncommitted__";function qB({state:e}){return!e||e.loading?g.jsx("div",{className:"changes-note",children:"Loading diff…"}):e.error?g.jsx("div",{className:"error",children:e.error}):e.payload?e.payload.truncated?g.jsx(zB,{bytesRead:e.payload.bytesRead,byteLimit:e.payload.byteLimit}):g.jsx(LC,{diff:e.payload.diff}):g.jsx("div",{className:"diff-empty",children:"No changes."})}function VB({experiment:e,project:t,view:n,runs:r,selectedRunId:a,onSelectRun:l}){const u=r.filter(o=>o.experimentId===e.id).sort((o,c)=>c.createdAt-o.createdAt);return n==="terminal"?g.jsx(WB,{experiment:e,expRuns:u,selectedRunId:a,onSelectRun:l}):g.jsx(YB,{experiment:e,project:t})}function WB({experiment:e,expRuns:t,selectedRunId:n,onSelectRun:r}){const[a,l]=G.useState(null),[u,o]=G.useState(!1),c=G.useRef(null),f=n&&t.find(C=>C.id===n)||t[0]||null,p=(f==null?void 0:f.status)==="running"||(f==null?void 0:f.status)==="starting",d=C=>{const w=t.findIndex(S=>S.id===C);return w===-1?t.length:t.length-w},v=G.useRef(null);G.useEffect(()=>{if(v.current===null){v.current=new Set(t.map(w=>w.id));return}const C=t.find(w=>!v.current.has(w.id));for(const w of t)v.current.add(w.id);C&&r(C.id)},[t,r]),G.useEffect(()=>{if(!u)return;const C=w=>{var S;(S=c.current)!=null&&S.contains(w.target)||o(!1)};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[u]);async function _(){if(f){l(null);try{await fx(f.id)}catch(C){l(C instanceof Error?C.message:String(C))}}}return g.jsxs("div",{className:"term-view",children:[g.jsxs("div",{className:"term-bar",children:[g.jsx("div",{className:"term-title",title:e.title||e.slug,children:e.title||e.slug}),g.jsx("span",{style:{flex:1}}),a&&g.jsx("span",{className:"error",children:a}),p&&g.jsxs("button",{className:"btn sm ghost",onClick:()=>void _(),children:[g.jsx(sN,{size:13}),"Stop"]}),t.length>0&&f&&g.jsxs("div",{className:"run-history",ref:c,children:[g.jsxs("button",{className:"run-picker",title:"Switch run",onClick:()=>o(C=>!C),children:[g.jsxs("span",{className:"run-label",children:["Run ",d(f.id)]}),g.jsx(Ko,{status:f.status}),g.jsx(gs,{size:14,className:"run-picker-chev"})]}),u&&g.jsx("div",{className:"history-menu",children:t.map(C=>g.jsxs("button",{className:`history-item ${C.id===(f==null?void 0:f.id)?"active":""}`,onClick:()=>{r(C.id),o(!1)},children:[g.jsxs("span",{className:"run-label",children:["Run ",d(C.id)]}),g.jsx(Ko,{status:C.status}),g.jsx("span",{className:"when",children:Na(C.createdAt)})]},C.id))})]})]}),g.jsx("div",{className:"term-fill",children:f?g.jsx(GB,{runId:f.id},f.id):g.jsx("div",{className:"term-empty",children:"No runs yet — ask the agent to launch one."})})]})}function YB({experiment:e,project:t}){const[n,r]=G.useState(null),[a,l]=G.useState(null),[u,o]=G.useState(null),[c,f]=G.useState(null),[p,d]=G.useState({}),v=!!(u&&u.diff.trim()!==""&&u.experimentId===e.id);async function _(){l(null);try{const[w,S]=await Promise.all([fT(e.id),Ky(e.projectId)]);r(w),o(S),f(y=>{var b;return y!==null?y:S.diff.trim()!==""&&S.experimentId===e.id?sa:((b=w[0])==null?void 0:b.sha)??null})}catch(w){l(w instanceof Error?w.message:String(w))}}G.useEffect(()=>{n===null&&!a&&_()},[n,a,e.id]),G.useEffect(()=>{const w=setInterval(()=>{Ky(e.projectId).then(o).catch(()=>{})},5e3);return()=>clearInterval(w)},[e.projectId]),G.useEffect(()=>{var w;c===sa&&u&&!v&&f(((w=n==null?void 0:n[0])==null?void 0:w.sha)??null)},[c,u,v,n]),G.useEffect(()=>{if(!c||c===sa||p[c])return;const w=c;d(S=>({...S,[w]:{loading:!0}})),dT(e.id,w).then(S=>d(y=>({...y,[w]:{loading:!1,payload:S}}))).catch(S=>d(y=>({...y,[w]:{loading:!1,error:S instanceof Error?S.message:String(S)}})))},[c,p,e.id]);const C=!v&&((n==null?void 0:n.length)??0)===0;return g.jsx("div",{className:"drawer",children:g.jsx("div",{className:"drawer-body",children:g.jsxs("div",{className:"drawer-section",children:[g.jsxs("div",{className:"changes-branch",children:[g.jsx("span",{className:"ctl-label",children:"Branch"}),g.jsx(xO,{owner:t.githubOwner,repo:t.githubRepo,branch:e.branchName})]}),a?g.jsx("div",{className:"error",children:a}):n===null?g.jsx("div",{className:"changes-note",children:"Loading changes…"}):C?g.jsx("div",{className:"changes-note",children:"No changes yet — the agent hasn't committed on this branch."}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"commit-picker",children:[g.jsx("span",{className:"ctl-label",children:"Commit"}),c===sa&&g.jsx("span",{className:"uncommitted-dot"}),g.jsxs("select",{className:"input sm",value:c??"",onChange:w=>f(w.target.value),children:[v&&g.jsx("option",{value:sa,children:"● Uncommitted changes"}),n.map(w=>g.jsxs("option",{value:w.sha,children:[w.sha.slice(0,7)," — ",w.subject]},w.sha))]}),g.jsx("button",{className:"icon-btn",title:"Refresh","aria-label":"Refresh",onClick:()=>void _(),children:g.jsx(Mg,{size:14})})]}),g.jsx("div",{style:{marginTop:10},children:c===sa&&u?u.truncated?g.jsxs("div",{className:"truncated-notice",children:[g.jsx("h4",{children:"Diff too large to display"}),g.jsx("p",{children:"The uncommitted diff is too large to display. View it locally with git."})]}):g.jsx(LC,{diff:u.diff}):c?g.jsx(qB,{state:p[c]}):g.jsx("div",{className:"changes-note",children:"Select a commit to view its diff."})})]})]})})})}function XB({projectId:e,path:t,sessionId:n,gitRef:r,onOpenFile:a}){const[l,u]=G.useState(null),[o,c]=G.useState(null),[f,p]=G.useState(!0),[d,v]=G.useState(0),_=/\.(md|mdx|markdown)$/i.test(t),[C,w]=G.useState(!1);G.useEffect(()=>{let y=!1;return p(!0),pT(e,t,{sessionId:n,ref:r}).then(x=>{y||(u(x),c(null))}).catch(x=>{y||c(x.message)}).finally(()=>{y||p(!1)}),()=>{y=!0}},[e,t,n,r,d]);const S=y=>r?`File not found on branch ${r}.`:n&&y.root==="clone"?"This session's worktree isn't available, and the file isn't in the project clone.":`File not found in the ${y.root==="worktree"?"session's worktree":"project clone"}.`;return g.jsxs("div",{className:"file-view",children:[g.jsxs("div",{className:"file-view-header",children:[g.jsx(ax,{size:13,style:{flexShrink:0}}),g.jsx("code",{className:"file-view-path",title:t,children:t}),r&&g.jsx("code",{className:"file-view-ref",title:`Committed state of ${r}`,children:r}),_&&g.jsx("button",{className:`icon-btn ${C?"active":""}`,"data-tip":C?"Rendered view":"View source","aria-label":C?"Rendered view":"View source",onClick:()=>w(y=>!y),children:g.jsx(nx,{size:13})}),g.jsx("button",{className:"icon-btn","data-tip":"Reload file","aria-label":"Reload file",onClick:()=>v(y=>y+1),children:f?g.jsx("span",{className:"spinner"}):g.jsx(Mg,{size:13})})]}),g.jsx("div",{className:"file-view-body",children:o?g.jsxs("div",{className:"file-view-note",children:["Failed to load file: ",o]}):l===null?g.jsx("div",{className:"file-view-note",children:"Loading…"}):l.notFound?g.jsx("div",{className:"file-view-note",children:S(l)}):g.jsxs(g.Fragment,{children:[!r&&n&&l.root==="clone"&&g.jsx("div",{className:"file-view-note",children:"This session's worktree isn't available — showing the project clone's copy."}),_&&!C?g.jsx("div",{className:"file-view-md",children:g.jsx(Xo,{text:l.content,onOpenFile:a&&(y=>a(y,n,r))})}):g.jsx(Ww,{text:l.content,path:t}),l.truncated&&g.jsx("div",{className:"file-view-note",children:"File truncated — showing the first 512 KB."})]})})]})}function KB({projectName:e,onHome:t,onCollapse:n}){return g.jsxs("div",{className:"rail-brand",children:[g.jsxs("button",{className:"brand",onClick:t,title:"All projects",children:[g.jsx(pu,{size:15}),g.jsx("span",{className:"brand-project",children:e})]}),n&&g.jsx("button",{className:"icon-btn",title:"Hide sidebar","aria-label":"Hide sidebar",onClick:n,children:g.jsx(lx,{size:15})})]})}function ZB({onDone:e}){const[t,n]=G.useState(0),[r,a]=G.useState(null),[l,u]=G.useState(null),[o,c]=G.useState(null),[f,p]=G.useState(null),[d,v]=G.useState(!1),_=w=>{v(!0),Promise.allSettled([Og(w).then(a),vx().then(u),gx().then(c),FT().then(p)]).finally(()=>v(!1))};G.useEffect(()=>_(!1),[]);const C=()=>{$T((f==null?void 0:f.enabled)??!0).catch(()=>{}),e()};return g.jsx("div",{className:"home onboarding",children:g.jsx("div",{className:"home-inner",children:t===0?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"onb-eyebrow",children:[g.jsx(fa,{})," · Step 1 of 4"]}),g.jsx("h2",{className:"onb-title",children:"Your coding agents"}),g.jsx("p",{className:"onb-sub",children:"orx found the agent CLIs on this machine and drives them directly — chat and autoresearch run on your own logins, no extra API keys."}),g.jsx("div",{className:"onb-cards",children:r===null?g.jsxs("div",{className:"onb-loading",children:[g.jsx("span",{className:"spinner"})," Detecting Claude Code, Codex, OpenCode…"]}):r.map(w=>g.jsx(JB,{h:w},w.id))}),g.jsxs("div",{className:"onb-actions",children:[g.jsxs("button",{className:"btn ghost",onClick:()=>_(!0),disabled:d,children:[g.jsx(Au,{size:12,className:d?"spin":""})," Re-check"]}),g.jsx("div",{style:{flex:1}}),g.jsxs("button",{className:"btn primary",onClick:()=>n(1),children:["Continue ",g.jsx(Pc,{size:13})]})]})]}):t===1?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"onb-eyebrow",children:[g.jsx(fa,{})," · Step 2 of 4"]}),g.jsx("h2",{className:"onb-title",children:"Git & GitHub"}),g.jsx("p",{className:"onb-sub",children:"A project is a clone of one of your GitHub repos, made with your own git credentials. Every experiment becomes a branch pushed to that repo — compute jobs clone it from there."}),g.jsx("div",{className:"onb-cards",children:g.jsx(eI,{git:l,onUpdate:u})}),g.jsxs("div",{className:"onb-actions",children:[g.jsxs("button",{className:"btn ghost",onClick:()=>n(0),children:[g.jsx(pu,{size:12})," Back"]}),g.jsxs("button",{className:"btn ghost",onClick:()=>_(!1),disabled:d,children:[g.jsx(Au,{size:12,className:d?"spin":""})," Re-check"]}),g.jsx("div",{style:{flex:1}}),g.jsxs("button",{className:"btn primary",onClick:()=>n(2),children:["Continue ",g.jsx(Pc,{size:13})]})]})]}):t===2?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"onb-eyebrow",children:[g.jsx(fa,{})," · Step 3 of 4"]}),g.jsx("h2",{className:"onb-title",children:"Where orx keeps your data"}),g.jsx("p",{className:"onb-sub",children:"Your local database, run logs, artifacts, and chat attachments live in one folder on this machine. The default works for most people — change it if you'd rather keep it on another disk."}),g.jsx("div",{className:"onb-cards",children:g.jsx(tI,{dataDir:o,onUpdate:c})}),g.jsxs("div",{className:"onb-actions",children:[g.jsxs("button",{className:"btn ghost",onClick:()=>n(1),children:[g.jsx(pu,{size:12})," Back"]}),g.jsx("div",{style:{flex:1}}),g.jsxs("button",{className:"btn primary",onClick:()=>n(3),children:["Continue ",g.jsx(Pc,{size:13})]})]})]}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"onb-eyebrow",children:[g.jsx(fa,{})," · Step 4 of 4"]}),g.jsx("h2",{className:"onb-title",children:"Usage analytics"}),g.jsx("p",{className:"onb-sub",children:"orx can send anonymous usage analytics to help improve the tool. No code, prompts, file contents, or identifiers are ever sent — just a random per-install id, the command run, and your OS."}),g.jsx("div",{className:"onb-cards",children:g.jsx(nI,{telemetry:f,onUpdate:p})}),g.jsxs("div",{className:"onb-actions",children:[g.jsxs("button",{className:"btn ghost",onClick:()=>n(2),children:[g.jsx(pu,{size:12})," Back"]}),g.jsx("div",{style:{flex:1}}),g.jsxs("button",{className:"btn primary",onClick:C,children:["Create your first project ",g.jsx(Pc,{size:13})]})]})]})})})}function QB(e){return e.agentReady?{cls:"st-done",label:"Connected"}:e.installed?{cls:"st-starting",label:"Not signed in"}:{cls:"st-idle",label:"Not detected"}}function JB({h:e}){var r,a;const t=QB(e),n=(r=e.version)==null?void 0:r.replace(/\s*\(.*\)$/,"");return g.jsxs("div",{className:"onb-card",children:[g.jsxs("div",{className:"onb-card-head",children:[g.jsx("span",{className:"onb-card-name",children:e.name}),g.jsxs("span",{className:`status-badge ${t.cls}`,children:[e.agentReady?g.jsx(vn,{size:12,strokeWidth:3}):g.jsx("span",{className:"dot"}),t.label]})]}),e.agentReady?g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"onb-card-detail mono",children:[e.account??"API key",e.plan?` · ${e.plan}`:""]}),g.jsx("div",{className:"onb-card-meta",children:[n,e.models.length>0&&`${e.models.length} model${e.models.length===1?"":"s"} — ${e.models.slice(0,3).map(l=>Nu(l.id)).join(", ")}${e.models.length>3?", …":""}`].filter(Boolean).join(" · ")})]}):g.jsx("div",{className:"onb-card-meta",children:(a=e.agentNote)==null?void 0:a.replace(/`/g,"")})]})}function eI({git:e,onUpdate:t}){const[n,r]=G.useState(!1),a=()=>{navigator.clipboard.writeText("gh auth login").then(()=>{r(!0),setTimeout(()=>r(!1),1500)})};if(e===null)return g.jsxs("div",{className:"onb-loading",children:[g.jsx("span",{className:"spinner"})," Checking git…"]});if(!e.gitVersion)return g.jsxs("div",{className:"onb-card",children:[g.jsxs("div",{className:"onb-card-head",children:[g.jsx("span",{className:"onb-card-name",children:"git"}),g.jsxs("span",{className:"status-badge st-failed",children:[g.jsx("span",{className:"dot"})," not found"]})]}),g.jsx("div",{className:"onb-card-meta",children:"Install git to clone projects, then re-open orx."})]});const l=[e.userName,e.userEmail&&`<${e.userEmail}>`].filter(Boolean).join(" ");return g.jsxs("div",{className:"onb-card",children:[g.jsxs("div",{className:"onb-card-row",children:[g.jsx("span",{className:"onb-card-name",children:"git"}),g.jsxs("span",{className:"onb-card-detail mono",children:[e.gitVersion.replace(/^git version /,""),l?` · ${l}`:""]}),g.jsxs("span",{className:`status-badge ${l?"st-done":"st-starting"}`,children:[l?g.jsx(vn,{size:12,strokeWidth:3}):g.jsx("span",{className:"dot"}),l?"ready":"no identity"]})]}),g.jsxs("div",{className:"onb-card-row",children:[g.jsx("span",{className:"onb-card-name",children:"GitHub"}),g.jsx("span",{className:"onb-card-detail mono",children:e.githubTokenSource==="env"?"token from GITHUB_TOKEN":e.githubTokenSource==="stored"?"Token saved in orx":e.githubTokenSource==="gh"?"Signed in via gh CLI":"Not connected"}),g.jsxs("span",{className:`status-badge ${e.githubTokenSource?"st-done":"st-starting"}`,children:[e.githubTokenSource?g.jsx(vn,{size:12,strokeWidth:3}):g.jsx("span",{className:"dot"}),e.githubTokenSource?"ready":"check"]})]}),!l&&g.jsxs("div",{className:"onb-card-meta",children:["Set ",g.jsx("code",{children:"git config --global user.name / user.email"})," so the agent can commit."]}),!e.githubTokenSource&&g.jsxs("div",{className:"onb-gh-options",children:[g.jsx("div",{className:"onb-card-meta",children:"GitHub access is used to clone your repos and push experiment branches. Connect either way:"}),g.jsxs("div",{className:"onb-gh-option",children:[g.jsx("span",{className:"onb-gh-option-label",children:"GitHub CLI"}),g.jsx("div",{className:"onb-gh-option-body",children:e.ghInstalled?g.jsxs(g.Fragment,{children:[g.jsx("code",{className:"onb-gh-cmd",children:"gh auth login"}),g.jsxs("button",{className:"btn ghost",onClick:a,children:[n?g.jsx(vn,{size:12,strokeWidth:3}):g.jsx(Tg,{size:12}),n?"Copied":"Copy"]}),g.jsx("span",{className:"onb-gh-hint",children:"run in a terminal, then Re-check"})]}):g.jsxs("span",{className:"onb-gh-hint",children:["install the GitHub CLI, run ",g.jsx("code",{children:"gh auth login"}),", then Re-check"]})})]}),g.jsx("div",{className:"onb-gh-or",children:"or"}),g.jsxs("div",{className:"onb-gh-option",children:[g.jsx("span",{className:"onb-gh-option-label",children:"Paste a token"}),g.jsx(zw,{onSaved:t})]})]})]})}function tI({dataDir:e,onUpdate:t}){const[n,r]=G.useState(""),[a,l]=G.useState(!1),[u,o]=G.useState(!1),[c,f]=G.useState(null);if(G.useEffect(()=>{e&&!n&&r(e.current)},[e,n]),e===null)return g.jsxs("div",{className:"onb-loading",children:[g.jsx("span",{className:"spinner"})," Checking storage…"]});if(e.source==="env")return g.jsxs("div",{className:"onb-card",children:[g.jsxs("div",{className:"onb-card-row",children:[g.jsx("span",{className:"onb-card-name",children:"Data folder"}),g.jsx("span",{className:"onb-card-detail mono",children:e.current}),g.jsxs("span",{className:"status-badge st-done",children:[g.jsx(vn,{size:12,strokeWidth:3})," pinned"]})]}),g.jsxs("div",{className:"onb-card-meta",children:["Set by the ",g.jsx("code",{children:"ORX_DATA_DIR"})," environment variable."]})]});const p=n.trim(),d=p!==""&&p!==e.current;async function v(){if(!(u||!d)){o(!0),f(null);try{t(await ET(p)),l(!1)}catch(_){f(_ instanceof Error?_.message:String(_))}finally{o(!1)}}}return g.jsxs("div",{className:"onb-card",children:[g.jsxs("div",{className:"onb-card-row",children:[g.jsx("span",{className:"onb-card-name",children:"Data folder"}),g.jsx("span",{className:"onb-card-detail mono",children:e.current}),g.jsxs("span",{className:`status-badge ${e.isDefault?"st-idle":"st-done"}`,children:[e.isDefault?g.jsx("span",{className:"dot"}):g.jsx(vn,{size:12,strokeWidth:3}),e.isDefault?"default":"custom"]})]}),a?g.jsxs(g.Fragment,{children:[g.jsx("input",{className:"mono",type:"text",value:n,onChange:_=>r(_.target.value),placeholder:"/absolute/path/to/openresearch",autoComplete:"off",spellCheck:!1,style:{width:"100%",marginTop:10}}),c&&g.jsx("div",{className:"error",style:{marginTop:8},children:c}),g.jsxs("div",{style:{display:"flex",gap:6,marginTop:10},children:[g.jsx("button",{className:"btn primary",onClick:v,disabled:u||!d,children:u?"Saving…":"Use this folder"}),g.jsx("button",{className:"btn ghost",onClick:()=>{l(!1),r(e.current),f(null)},disabled:u,children:"Cancel"})]})]}):g.jsxs("div",{className:"onb-card-meta",style:{display:"flex",gap:10,alignItems:"center"},children:["The default is fine for most setups.",g.jsx("button",{className:"btn ghost",onClick:()=>l(!0),children:"Change…"})]})]})}function nI({telemetry:e,onUpdate:t}){const[n,r]=G.useState(!1);if(e===null)return g.jsxs("div",{className:"onb-loading",children:[g.jsx("span",{className:"spinner"})," Checking analytics…"]});const a=e.enabled,l=!a&&e.reason!==null&&e.reason!=="disabled via `orx telemetry off`",u=o=>{n||o===a||(r(!0),PT(o).then(t).finally(()=>r(!1)))};return g.jsxs("div",{className:"onb-card",children:[g.jsxs("div",{className:"onb-card-head",children:[g.jsxs("div",{children:[g.jsx("div",{className:"onb-card-name",children:"Share anonymous usage analytics"}),g.jsx("div",{className:"onb-card-meta",style:{marginTop:2},children:a?"On — helps prioritize what to build next.":l?`Off — ${e.reason}.`:"Off — you can turn it back on anytime."})]}),g.jsxs("div",{style:{display:"flex",gap:6,flex:"none"},children:[g.jsxs("button",{className:`btn ${a?"primary":"ghost"}`,onClick:()=>u(!0),disabled:n,"aria-pressed":a,children:[a?g.jsx(vn,{size:12,strokeWidth:3}):null," On"]}),g.jsxs("button",{className:`btn ${a?"ghost":"primary"}`,onClick:()=>u(!1),disabled:n,"aria-pressed":!a,children:[a?null:g.jsx(vn,{size:12,strokeWidth:3})," Off"]})]})]}),g.jsxs("div",{className:"onb-card-meta",style:{marginTop:12},children:["Sent: a random per-install id, the command run, CLI version, and OS. Never sent: code, prompts, file contents, paths, or repo names. Change anytime in Settings or with"," ",g.jsx("code",{children:"orx telemetry off"}),"."]}),l&&g.jsxs("div",{className:"onb-card-meta",style:{marginTop:8},children:["Note: this run is off because of ",e.reason,", which overrides the saved choice."]})]})}function eu(e){const t=e.trim().replace(/^git@github\.com:/i,"").replace(/^https?:\/\/(www\.)?github\.com\//i,"").replace(/\.git$/i,"").replace(/^\/+|\/+$/g,""),[n,r]=t.split("/");return!n||!r||/[\s:@]/.test(n)||/[\s:@]/.test(r)?null:{owner:n,repo:r}}function $b(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48).replace(/-+$/,"")||"experiment"}function iI(e){const r=(e.trim().split(/[?#]/)[0].split("/").filter(Boolean).pop()??"").replace(/\.(pdf|md)$/i,"");return/^\d{4}\.\d{4,5}(v\d+)?$/.test(r)?r:null}function rI(e){return e.replace(/^\[[^\]]*\]\s*/,"").replace(/\s*[-–|]\s*arXiv\s*$/i,"")}function sI({onCreated:e,onCancel:t}){var $;const[n,r]=G.useState("paper"),[a,l]=G.useState("use"),[u,o]=G.useState(""),[c,f]=G.useState(""),[p,d]=G.useState(!1),[v,_]=G.useState("main"),[C,w]=G.useState(!1),[S,y]=G.useState(null),[x,b]=G.useState(""),[E,D]=G.useState([]),[N,R]=G.useState(!1),[T,j]=G.useState(null),[B,z]=G.useState(!1),[V,F]=G.useState(null),P=G.useRef(0),W=eu(u),q=!!(c.trim()&&(n==="new"||n==="existing"&&W!==null||n==="paper"&&T!==null&&(u.trim()===""||W!==null))),X=Q=>{var re;o(Q),p||f(((re=eu(Q))==null?void 0:re.repo)??"")};async function K(Q){const re=++P.current;D([]),R(!1),z(!0),F(null);try{const se=await sT(Q);if(re!==P.current)return;j(se);const Z=se.repoUrl?eu(se.repoUrl):null;o(Z?`${Z.owner}/${Z.repo}`:""),l("fork"),p||f((Z==null?void 0:Z.repo)??(se.title??"").trim().slice(0,60))}catch(se){if(re!==P.current)return;F(se instanceof Error?se.message:String(se))}finally{re===P.current&&z(!1)}}function L(){P.current++,j(null),b(""),D([]),F(null),o(""),p||f("")}G.useEffect(()=>{if(n!=="paper"||T)return;const Q=x.trim(),re=iI(Q);if(!re&&Q.length<3){D([]),R(!1);return}const se=++P.current;re||R(!0);const Z=setTimeout(()=>{if(re){K(re);return}rT(Q).then(H=>{se===P.current&&D(H)}).catch(H=>{se===P.current&&(D([]),F(H instanceof Error?H.message:String(H)))}).finally(()=>{se===P.current&&R(!1)})},350);return()=>clearTimeout(Z)},[n,T,x]);async function M(Q){if(Q.preventDefault(),!(!q||C)){w(!0),y(null);try{const re=await iT(n==="new"?{name:c.trim(),createRepo:!0}:n==="paper"&&!W?{name:c.trim(),createRepo:!0,paperId:T.paperId}:{name:c.trim(),githubOwner:W.owner,githubRepo:W.repo,baselineBranch:v.trim()||"main",forkRepo:a==="fork",...n==="paper"?{paperId:T.paperId}:{}});e(re)}catch(re){y(re instanceof Error?re.message:String(re))}finally{w(!1)}}}const O=n==="new"||n==="paper"&&!W,U=g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"seg form-seg",children:[g.jsx("button",{type:"button",className:a==="use"?"active":"",onClick:()=>l("use"),children:"Use this repo"}),g.jsx("button",{type:"button",className:a==="fork"?"active":"",onClick:()=>l("fork"),children:"Fork a copy"})]}),g.jsx("span",{className:"repo-hint",children:a==="fork"?`snapshots ${W?`${W.owner}/${W.repo}`:"the repo"} into a private repo on your account`:"experiments push branches here — if you can't push to it, a fork is made automatically"}),g.jsxs("div",{className:"row2",children:[g.jsxs("label",{children:["Project name",g.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research"})]}),g.jsxs("label",{children:["Branch",g.jsx("input",{value:v,onChange:Q=>_(Q.target.value),placeholder:"main"})]})]})]});return g.jsxs("form",{className:"form",onSubmit:M,children:[g.jsxs("div",{className:"seg form-seg",children:[g.jsx("button",{type:"button",className:n==="paper"?"active":"",onClick:()=>r("paper"),children:"From a paper"}),g.jsx("button",{type:"button",className:n==="existing"?"active":"",onClick:()=>r("existing"),children:"Existing repo"}),g.jsx("button",{type:"button",className:n==="new"?"active":"",onClick:()=>r("new"),children:"New blank repo"})]}),n==="existing"&&g.jsxs(g.Fragment,{children:[g.jsxs("label",{children:["GitHub repository",g.jsx("input",{value:u,onChange:Q=>X(Q.target.value),placeholder:"https://github.com/karpathy/nanoGPT",autoFocus:!0,spellCheck:!1}),g.jsx("span",{className:`repo-hint mono ${W?"ok":""}`,children:W?`${W.owner} / ${W.repo}`:u.trim()?"paste a GitHub URL or owner/repo":"URL or owner/repo — cloned with your git credentials"})]}),U]}),n==="paper"&&(T===null?g.jsxs(g.Fragment,{children:[g.jsxs("label",{children:["Paper",g.jsx("input",{value:x,onChange:Q=>b(Q.target.value),placeholder:"arXiv id, URL, or title — e.g. 1706.03762",autoFocus:!0,spellCheck:!1}),g.jsx("span",{className:`repo-hint ${V?"":"mono"}`,children:B?"looking up paper…":N?"searching alphaXiv…":V??"searches alphaXiv by title — or paste an arXiv id / URL"})]}),E.length>0&&g.jsx("div",{className:"paper-results",children:E.map(Q=>g.jsxs("button",{type:"button",onClick:()=>void K(Q.paperId),children:[g.jsx("span",{className:"title",children:rI(Q.title)}),g.jsx("span",{className:"id",children:Q.paperId})]},Q.paperId))})]}):g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"paper-pick",children:[g.jsxs("div",{className:"meta",children:[g.jsx("div",{className:"title",children:T.title||T.paperId}),g.jsxs("div",{className:"id",children:["arXiv ",T.paperId]})]}),g.jsx("button",{type:"button",className:"btn ghost",onClick:L,children:"Change"})]}),g.jsxs("label",{children:["GitHub repository",T.repoUrl?"":" (optional)",g.jsx("input",{value:u,onChange:Q=>X(Q.target.value),placeholder:"owner/repo — leave blank for a new private repo",spellCheck:!1}),g.jsx("span",{className:`repo-hint mono ${W?"ok":""}`,children:W?`${W.owner} / ${W.repo}`+(T.repoUrl&&(($=eu(T.repoUrl))==null?void 0:$.repo)===W.repo?` · linked on alphaXiv${T.repoStars!=null?` · ★ ${T.repoStars}`:""}`:""):u.trim()?"paste a GitHub URL or owner/repo":"no code linked to this paper — a blank private repo will be created"})]}),W?U:g.jsxs("label",{children:["Project name",g.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research"}),g.jsx("span",{className:`repo-hint mono ${c.trim()?"ok":""}`,children:c.trim()?`creates github.com/you/${$b(c)} · private`:"a blank private repo is created on your GitHub account"})]})]})),n==="new"&&g.jsxs("label",{children:["Project name",g.jsx("input",{value:c,onChange:Q=>{d(!0),f(Q.target.value)},placeholder:"my-research",autoFocus:!0}),g.jsx("span",{className:`repo-hint mono ${c.trim()?"ok":""}`,children:c.trim()?`creates github.com/you/${$b(c)} · private`:"a blank private repo is created on your GitHub account"})]}),S&&g.jsx("div",{className:"error",children:S}),g.jsxs("div",{className:"actions",children:[t&&g.jsx("button",{type:"button",className:"btn ghost",onClick:t,children:"Cancel"}),g.jsx("button",{type:"submit",className:"btn primary",disabled:!q||C,children:C?O?"Creating repo…":a==="fork"?"Forking repo…":"Cloning repo…":"Create project"})]})]})}function Ub({projects:e,onOpen:t,onCreated:n,onDeleted:r}){const[a,l]=G.useState(!1),[u,o]=G.useState(null);async function c(f){if(window.confirm(`Delete project "${f.name}"? -Its experiments, runs and chats are removed from orx. The GitHub repo (${f.githubOwner}/${f.githubRepo}) is kept.`)){o(f.id);try{await aT(f.id),r(f.id)}catch(d){window.alert(d instanceof Error?d.message:String(d))}finally{o(null)}}}return g.jsxs("div",{className:"home",children:[g.jsxs("div",{className:"home-inner",children:[g.jsxs("div",{className:"home-brand",children:["Open",g.jsx("span",{children:"Research"})]}),g.jsxs("div",{className:"home-head",children:[g.jsx("h2",{children:"Projects"}),g.jsxs("button",{className:"btn sm",onClick:()=>l(!0),children:[g.jsx(Rg,{size:13})," New project"]})]}),g.jsx("div",{className:"home-list",children:e.length===0?g.jsx("div",{className:"changes-note",children:"No projects yet — create one to get started."}):[...e].sort((f,p)=>p.updatedAt-f.updatedAt).map(f=>g.jsxs("div",{className:"project-card",role:"button",tabIndex:0,onClick:()=>t(f.id),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&t(f.id)},children:[g.jsx("span",{className:"name",children:f.name}),g.jsxs("span",{className:"repo mono",children:[f.githubOwner,"/",f.githubRepo," · ",f.baselineBranch]}),f.paperId&&g.jsxs("span",{className:"paper mono",children:["arXiv ",f.paperId]}),g.jsxs("span",{className:"time",children:["created ",Aa(f.createdAt)]}),g.jsx("button",{className:"project-delete",title:`Delete ${f.name}`,disabled:u===f.id,onClick:p=>{p.stopPropagation(),c(f)},children:g.jsx(Mg,{size:14})})]},f.id))})]}),a&&g.jsx("div",{className:"modal-backdrop",onClick:()=>l(!1),children:g.jsxs("div",{className:"modal",onClick:f=>f.stopPropagation(),children:[g.jsx("h2",{children:"New project"}),g.jsx(iI,{onCancel:()=>l(!1),onCreated:f=>{l(!1),n(f)}})]})})]})}function rI(e){const t=vx(e.backend);return t?[t,_x(e.backend)].filter(Boolean).join(" · "):"—"}function sI({runs:e,experiments:t,onOpen:n,onOpenChanges:r,onCancel:a}){const l=new Map(t.map(o=>[o.id,o.slug])),u=[...e].sort((o,c)=>c.createdAt-o.createdAt);return u.length===0?g.jsx("div",{className:"empty-state",children:g.jsx("p",{children:"No runs yet."})}):g.jsx("div",{className:"runs-table-wrap",children:g.jsxs("table",{className:"runs-table",children:[g.jsx("thead",{children:g.jsxs("tr",{children:[g.jsx("th",{children:"Run"}),g.jsx("th",{children:"Experiment"}),g.jsx("th",{children:"Status"}),g.jsx("th",{children:"Backend"}),g.jsx("th",{children:"Commit"}),g.jsx("th",{children:"Started"}),g.jsx("th",{children:"Exit"}),g.jsx("th",{})]})}),g.jsx("tbody",{children:u.map(o=>{const c=o.status==="running"||o.status==="starting";return g.jsxs("tr",{className:"clickable",onClick:()=>n(o),children:[g.jsx("td",{className:"mono",children:Lp(o.id)}),g.jsx("td",{className:"mono",children:l.get(o.experimentId)??Lp(o.experimentId)}),g.jsx("td",{children:g.jsx(Xo,{status:o.status})}),g.jsx("td",{className:"mono",children:rI(o)}),g.jsx("td",{className:"mono",children:o.commitSha?o.commitSha.slice(0,7):"—"}),g.jsx("td",{children:Aa(o.createdAt)}),g.jsx("td",{className:"mono",children:o.exitCode??"—"}),g.jsx("td",{children:g.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[g.jsx("button",{className:"icon-btn",title:"Open changes",onClick:f=>{f.stopPropagation(),r(o.experimentId)},children:g.jsx(Xu,{size:14})}),c&&g.jsx("button",{className:"btn sm danger",onClick:f=>{f.stopPropagation(),a(o.id)},children:"Cancel"})]})})]},o.id)})})]})})}var aI=JS();function oI(e){const[t,n]=G.useState(null),[,r]=G.useState({});return t==null||t.setTracked(e),G.useEffect(()=>{const a=new lI(()=>r({}));return a.setTracked(e),n(a),()=>a.dispose()},[]),(t==null?void 0:t.bounds)??null}var ti,cg,ug,hg;class lI{constructor(t){Iy(this,ti);Qr(this,"selectors",new Set);Qr(this,"elements",new Set);Qr(this,"onSizeChange",()=>Jr(this,ti,cg).call(this));Qr(this,"resizeObs",new ResizeObserver(this.onSizeChange));Qr(this,"mutationObs",new MutationObserver(t=>this.onMutation(t)));Qr(this,"bounds",null);this.onBoundsChange=t,window.addEventListener("resize",this.onSizeChange),document.addEventListener("scroll",this.onSizeChange,!0),this.mutationObs.observe(document.body,{childList:!0,subtree:!0})}dispose(){this.resizeObs.disconnect(),this.mutationObs.disconnect(),window.removeEventListener("resize",this.onSizeChange),document.removeEventListener("scroll",this.onSizeChange,!0)}setTracked(t){const n=new Set(t),r=[...n].filter(u=>!this.selectors.has(u)),a=[...this.selectors].filter(u=>!n.has(u));let l=!1;if(r.length>0){const u=r.map(c=>`[data-onboarding="${c}"]`).join(","),o=document.body.querySelectorAll(u);o.forEach(c=>{this.elements.add(c),this.resizeObs.observe(c)}),l||(l=o.length>0)}if(a.length>0){const u=a.map(c=>`[data-onboarding="${c}"]`).join(","),o=document.body.querySelectorAll(u);o.forEach(c=>{this.elements.delete(c),this.resizeObs.unobserve(c)}),l||(l=o.length>0)}l&&Jr(this,ti,ug).call(this),this.selectors=n}onMutation(t){if(this.selectors.size===0)return;const n=Array.from(this.selectors,a=>`[data-onboarding="${a}"]`).join(",");let r=!1;for(const a of t){for(const l of a.addedNodes)l instanceof Element&&(l.matches(n)&&(this.elements.add(l),this.resizeObs.observe(l),r=!0),l.querySelectorAll(n).forEach(u=>{this.elements.add(u),this.resizeObs.observe(u),r=!0}));for(const l of a.removedNodes)l instanceof Element&&(l.matches(n)&&(this.elements.delete(l),this.resizeObs.unobserve(l),r=!0),l.querySelectorAll(n).forEach(u=>{this.elements.delete(u),this.resizeObs.unobserve(u),r=!0}))}r&&Jr(this,ti,cg).call(this)}}ti=new WeakSet,cg=function(){const t=Jr(this,ti,hg).call(this);Jr(this,ti,ug).call(this),t!==Jr(this,ti,hg).call(this)&&this.onBoundsChange()},ug=function(){if(this.elements.size===0){this.bounds=null;return}const t=Array.from(this.elements,u=>u.getBoundingClientRect()).filter(u=>u.width>0&&u.height>0);if(t.length===0){this.bounds=null;return}const n=Math.min(...t.map(u=>u.left)),r=Math.min(...t.map(u=>u.top)),a=Math.max(...t.map(u=>u.right)),l=Math.max(...t.map(u=>u.bottom));this.bounds={x:n,y:r,width:a-n,height:l-r}},hg=function(){return this.bounds?[this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height].join(","):"null"};function cI(){const[e,t]=G.useState(0),[n,r]=G.useState(0);return{ref:G.useCallback(l=>{if(!l)return;function u(){t(l.offsetWidth),r(l.offsetHeight)}const o=new ResizeObserver(u),c=new MutationObserver(u);return o.observe(l),c.observe(l,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),u(),()=>{o.disconnect(),c.disconnect()}},[]),offsetWidth:e,offsetHeight:n}}const eu=8;function uI(e,t){const{offsetWidth:n,offsetHeight:r}=t,[{viewHeight:a,viewWidth:l},u]=G.useState({viewWidth:0,viewHeight:0});G.useEffect(()=>{function p(){u({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",p),p(),()=>window.removeEventListener("resize",p)},[]);let o=0,c=0,f=0;if(e){const{distance:p}=e;switch(e.anchor){case"left":o=e.x-n-p,c=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+p,c=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-n/2,c=e.y+e.height+p;break;case"above":o=e.x+e.width/2-n/2,c=e.y-r-p;break}const d=o,v=c;o=Math.min(Math.max(o,eu),l-n-eu),c=Math.min(Math.max(c,eu),a-r-eu),f=e.anchor==="left"||e.anchor==="right"?v-c:d-o}return{x:o,y:c,arrowAdjustment:f}}const Ub="orx:tour-done",Nr=8,hI=20,Lu=[{focus:null,anchor:null,title:"Welcome to OpenResearch",description:"This is your research workspace: agents on the left, conversation in the middle, experiments on the right. Here's a quick look around — about thirty seconds."},{focus:["composer"],anchor:"above",title:"Talk to your research agent",description:"This is how you communicate with research agents: describe the experiment you want, and the agent plans it, writes the code, and runs it. Type / for skills like /reproduce-paper."},{focus:["model-picker"],anchor:"above",title:"Pick your model",description:"Choose a model from any harness you've connected — Claude Code, Codex, or OpenCode. New sessions start with whatever you pick here; each session keeps its harness for life."},{focus:["nav-files"],anchor:"right",title:"Reports and outputs",description:"The agent writes its reports, figures, and other outputs here — and anything you drop in is visible to it too. Check Files after a run to see what came back."},{focus:["nav-compute"],anchor:"right",title:"Configure compute",description:"This is where compute is configured. Point runs at this machine, Modal, SSH boxes, Kubernetes, or Slurm — set it up once and agents pick the right hardware per run."},{focus:["experiments"],anchor:"left",title:"Follow every experiment",description:"Runs land here as a tree of experiments — branch variants off a baseline, compare results, and open any run's terminal or code changes in a tab."},{focus:["new-session"],anchor:"right",title:"Start a session",description:"Each session is its own agent working in its own branch, so you can run several lines of inquiry in parallel. That's the tour — ask for your first experiment whenever you're ready."}];function fI({onClose:e}){const[t,n]=G.useState(0),r=Lu[t],a=oI(r.focus??[]);G.useEffect(()=>{function u(o){o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),e())}return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[e]);const l=a?{left:a.x-Nr,top:a.y-Nr,width:a.width+Nr*2,height:a.height+Nr*2}:null;return aI.createPortal(g.jsxs("div",{className:"tour-overlay",children:[l?g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"tour-spotlight",style:l}),g.jsx("div",{className:"tour-ring",style:l})]}):g.jsx("div",{className:"tour-dim"}),g.jsx(dI,{step:r,bounds:a,index:t,onBack:()=>n(u=>Math.max(0,u-1)),onNext:()=>t+1>=Lu.length?e():n(t+1),onClose:e})]}),document.body)}function dI({step:e,bounds:t,index:n,onBack:r,onNext:a,onClose:l}){const u=cI(),o=uI(t&&e.anchor?{x:t.x-Nr,y:t.y-Nr,width:t.width+Nr*2,height:t.height+Nr*2,anchor:e.anchor,distance:hI}:null,u),c=e.anchor!=null&&t!=null&&o.x>0,f=n+1===Lu.length;return g.jsxs("div",{ref:u.ref,className:`tour-card ${c?"":"centered"}`,style:c?{left:o.x,top:o.y}:void 0,children:[c&&e.anchor&&g.jsx(pI,{anchor:e.anchor,adjustment:o.arrowAdjustment}),g.jsx("button",{className:"icon-btn tour-close",title:"Skip tour",onClick:l,children:g.jsx(va,{size:15})}),g.jsx("h3",{children:e.title}),g.jsx("p",{children:e.description}),g.jsxs("div",{className:"tour-footer",children:[g.jsx("div",{className:"tour-footer-side",children:n>0&&g.jsx("button",{className:"btn ghost sm",onClick:r,children:"Back"})}),g.jsxs("span",{className:"tour-count",children:[n+1," / ",Lu.length]}),g.jsx("div",{className:"tour-footer-side end",children:g.jsx("button",{className:"btn primary sm",onClick:a,children:f?"Done":"Next"})})]})]})}function pI({anchor:e,adjustment:t}){const n=e==="above"||e==="below"?`${t}px 0`:`0 ${t}px`;return g.jsx("div",{className:`tour-arrow ${e}`,style:{translate:n}})}function $t(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function xh(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}yu.prototype=xh.prototype={constructor:yu,on:function(e,t){var n=this._,r=mI(e+"",n),a,l=-1,u=r.length;if(arguments.length<2){for(;++l0)for(var n=new Array(a),r=0,a,l;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),qb.hasOwnProperty(t)?{space:qb[t],local:e}:e}function _I(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===fg&&t.documentElement.namespaceURI===fg?t.createElement(e):t.createElementNS(n,e)}}function yI(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function OC(e){var t=wh(e);return(t.local?yI:_I)(t)}function bI(){}function Bm(e){return e==null?bI:function(){return this.querySelector(e)}}function SI(e){typeof e!="function"&&(e=Bm(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a=b&&(b=x+1);!(R=S[b])&&++b=0;)(u=r[a])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function VI(e){e||(e=YI);function t(d,v){return d&&v?e(d.__data__,v.__data__):!d-!v}for(var n=this._groups,r=n.length,a=new Array(r),l=0;lt?1:e>=t?0:NaN}function WI(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function XI(){return Array.from(this)}function KI(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?o7:typeof t=="function"?c7:l7)(e,t,n??"")):ba(this.node(),e)}function ba(e,t){return e.style.getPropertyValue(t)||FC(e).getComputedStyle(e,null).getPropertyValue(t)}function h7(e){return function(){delete this[e]}}function f7(e,t){return function(){this[e]=t}}function d7(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function p7(e,t){return arguments.length>1?this.each((t==null?h7:typeof t=="function"?d7:f7)(e,t)):this.node()[e]}function PC(e){return e.trim().split(/^|\s+/)}function Im(e){return e.classList||new $C(e)}function $C(e){this._node=e,this._names=PC(e.getAttribute("class")||"")}$C.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function UC(e,t){for(var n=Im(e),r=-1,a=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function $7(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,l;n()=>e;function dg(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:l,x:u,y:o,dx:c,dy:f,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:p}})}dg.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Q7(e){return!e.ctrlKey&&!e.button}function J7(){return this.parentNode}function e9(e,t){return t??{x:e.x,y:e.y}}function t9(){return navigator.maxTouchPoints||"ontouchstart"in this}function XC(){var e=Q7,t=J7,n=e9,r=t9,a={},l=xh("start","drag","end"),u=0,o,c,f,p,d=0;function v(E){E.on("mousedown.drag",_).filter(r).on("touchstart.drag",S).on("touchmove.drag",y,Z7).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(E,R){if(!(p||!e.call(this,E,R))){var N=b(this,t.call(this,E,R),E,R,"mouse");N&&(An(E.view).on("mousemove.drag",C,el).on("mouseup.drag",w,el),YC(E.view),bp(E),f=!1,o=E.clientX,c=E.clientY,N("start",E))}}function C(E){if(ga(E),!f){var R=E.clientX-o,N=E.clientY-c;f=R*R+N*N>d}a.mouse("drag",E)}function w(E){An(E.view).on("mousemove.drag mouseup.drag",null),WC(E.view,f),ga(E),a.mouse("end",E)}function S(E,R){if(e.call(this,E,R)){var N=E.changedTouches,D=t.call(this,E,R),T=N.length,j,B;for(j=0;j>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?nu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?nu(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=i9.exec(e))?new mn(t[1],t[2],t[3],1):(t=r9.exec(e))?new mn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=s9.exec(e))?nu(t[1],t[2],t[3],t[4]):(t=a9.exec(e))?nu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=o9.exec(e))?Qb(t[1],t[2]/100,t[3]/100,1):(t=l9.exec(e))?Qb(t[1],t[2]/100,t[3]/100,t[4]):Vb.hasOwnProperty(e)?Xb(Vb[e]):e==="transparent"?new mn(NaN,NaN,NaN,0):null}function Xb(e){return new mn(e>>16&255,e>>8&255,e&255,1)}function nu(e,t,n,r){return r<=0&&(e=t=n=NaN),new mn(e,t,n,r)}function h9(e){return e instanceof vl||(e=us(e)),e?(e=e.rgb(),new mn(e.r,e.g,e.b,e.opacity)):new mn}function pg(e,t,n,r){return arguments.length===1?h9(e):new mn(e,t,n,r??1)}function mn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}zm(mn,pg,KC(vl,{brighter(e){return e=e==null?Bu:Math.pow(Bu,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?tl:Math.pow(tl,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new mn(as(this.r),as(this.g),as(this.b),Iu(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Kb,formatHex:Kb,formatHex8:f9,formatRgb:Zb,toString:Zb}));function Kb(){return`#${rs(this.r)}${rs(this.g)}${rs(this.b)}`}function f9(){return`#${rs(this.r)}${rs(this.g)}${rs(this.b)}${rs((isNaN(this.opacity)?1:this.opacity)*255)}`}function Zb(){const e=Iu(this.opacity);return`${e===1?"rgb(":"rgba("}${as(this.r)}, ${as(this.g)}, ${as(this.b)}${e===1?")":`, ${e})`}`}function Iu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function as(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rs(e){return e=as(e),(e<16?"0":"")+e.toString(16)}function Qb(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Kn(e,t,n,r)}function ZC(e){if(e instanceof Kn)return new Kn(e.h,e.s,e.l,e.opacity);if(e instanceof vl||(e=us(e)),!e)return new Kn;if(e instanceof Kn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),l=Math.max(t,n,r),u=NaN,o=l-a,c=(l+a)/2;return o?(t===l?u=(n-r)/o+(n0&&c<1?0:u,new Kn(u,o,c,e.opacity)}function d9(e,t,n,r){return arguments.length===1?ZC(e):new Kn(e,t,n,r??1)}function Kn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}zm(Kn,d9,KC(vl,{brighter(e){return e=e==null?Bu:Math.pow(Bu,e),new Kn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?tl:Math.pow(tl,e),new Kn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new mn(Sp(e>=240?e-240:e+120,a,r),Sp(e,a,r),Sp(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Kn(Jb(this.h),iu(this.s),iu(this.l),Iu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Iu(this.opacity);return`${e===1?"hsl(":"hsla("}${Jb(this.h)}, ${iu(this.s)*100}%, ${iu(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Jb(e){return e=(e||0)%360,e<0?e+360:e}function iu(e){return Math.max(0,Math.min(1,e||0))}function Sp(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Hm=e=>()=>e;function p9(e,t){return function(n){return e+n*t}}function g9(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function m9(e){return(e=+e)==1?QC:function(t,n){return n-t?g9(t,n,e):Hm(isNaN(t)?n:t)}}function QC(e,t){var n=t-e;return n?p9(e,n):Hm(isNaN(e)?t:e)}const zu=(function e(t){var n=m9(t);function r(a,l){var u=n((a=pg(a)).r,(l=pg(l)).r),o=n(a.g,l.g),c=n(a.b,l.b),f=QC(a.opacity,l.opacity);return function(p){return a.r=u(p),a.g=o(p),a.b=c(p),a.opacity=f(p),a+""}}return r.gamma=e,r})(1);function v9(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(l){for(a=0;an&&(l=t.slice(n,l),o[u]?o[u]+=l:o[++u]=l),(r=r[0])===(a=a[0])?o[u]?o[u]+=a:o[++u]=a:(o[++u]=null,c.push({i:u,x:ui(r,a)})),n=xp.lastIndex;return n180?p+=360:p-f>180&&(f+=360),v.push({i:d.push(a(d)+"rotate(",null,r)-2,x:ui(f,p)})):p&&d.push(a(d)+"rotate("+p+r)}function o(f,p,d,v){f!==p?v.push({i:d.push(a(d)+"skewX(",null,r)-2,x:ui(f,p)}):p&&d.push(a(d)+"skewX("+p+r)}function c(f,p,d,v,_,C){if(f!==d||p!==v){var w=_.push(a(_)+"scale(",null,",",null,")");C.push({i:w-4,x:ui(f,d)},{i:w-2,x:ui(p,v)})}else(d!==1||v!==1)&&_.push(a(_)+"scale("+d+","+v+")")}return function(f,p){var d=[],v=[];return f=e(f),p=e(p),l(f.translateX,f.translateY,p.translateX,p.translateY,d,v),u(f.rotate,p.rotate,d,v),o(f.skewX,p.skewX,d,v),c(f.scaleX,f.scaleY,p.scaleX,p.scaleY,d,v),f=p=null,function(_){for(var C=-1,w=v.length,S;++C=0&&e._call.call(void 0,t),e=e._next;--Sa}function nS(){hs=(Fu=il.now())+Ch,Sa=Bo=0;try{M9()}finally{Sa=0,L9(),hs=0}}function j9(){var e=il.now(),t=e-Fu;t>n2&&(Ch-=t,Fu=e)}function L9(){for(var e,t=Hu,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Hu=n);Io=e,vg(r)}function vg(e){if(!Sa){Bo&&(Bo=clearTimeout(Bo));var t=e-hs;t>24?(e<1/0&&(Bo=setTimeout(nS,e-il.now()-Ch)),Lo&&(Lo=clearInterval(Lo))):(Lo||(Fu=il.now(),Lo=setInterval(j9,n2)),Sa=1,i2(nS))}}function iS(e,t,n){var r=new Pu;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var O9=xh("start","end","cancel","interrupt"),B9=[],s2=0,rS=1,_g=2,Su=3,sS=4,yg=5,xu=6;function Eh(e,t,n,r,a,l){var u=e.__transition;if(!u)e.__transition={};else if(n in u)return;I9(e,n,{name:t,index:r,group:a,on:O9,tween:B9,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:s2})}function Pm(e,t){var n=ni(e,t);if(n.state>s2)throw new Error("too late; already scheduled");return n}function gi(e,t){var n=ni(e,t);if(n.state>Su)throw new Error("too late; already running");return n}function ni(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function I9(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=r2(l,0,n.time);function l(f){n.state=rS,n.timer.restart(u,n.delay,n.time),n.delay<=f&&u(f-n.delay)}function u(f){var p,d,v,_;if(n.state!==rS)return c();for(p in r)if(_=r[p],_.name===n.name){if(_.state===Su)return iS(u);_.state===sS?(_.state=xu,_.timer.stop(),_.on.call("interrupt",e,e.__data__,_.index,_.group),delete r[p]):+p_g&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function dz(e,t,n){var r,a,l=fz(t)?Pm:gi;return function(){var u=l(this,e),o=u.on;o!==r&&(a=(r=o).copy()).on(t,n),u.on=a}}function pz(e,t){var n=this._id;return arguments.length<2?ni(this.node(),n).on.on(e):this.each(dz(n,e,t))}function gz(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function mz(){return this.on("end.remove",gz(this._id))}function vz(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Bm(e));for(var r=this._groups,a=r.length,l=new Array(a),u=0;u()=>e;function $z(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:a}})}function $i(e,t,n){this.k=e,this.x=t,this.y=n}$i.prototype={constructor:$i,scale:function(e){return e===1?this:new $i(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new $i(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var kh=new $i(1,0,0);c2.prototype=$i.prototype;function c2(e){for(;!e.__zoom;)if(!(e=e.parentNode))return kh;return e.__zoom}function wp(e){e.stopImmediatePropagation()}function Oo(e){e.preventDefault(),e.stopImmediatePropagation()}function Uz(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Gz(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function aS(){return this.__zoom||kh}function qz(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Vz(){return navigator.maxTouchPoints||"ontouchstart"in this}function Yz(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],l=e.invertY(t[0][1])-n[0][1],u=e.invertY(t[1][1])-n[1][1];return e.translate(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function u2(){var e=Uz,t=Gz,n=Yz,r=qz,a=Vz,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],o=250,c=bu,f=xh("start","zoom","end"),p,d,v,_=500,C=150,w=0,S=10;function y(P){P.property("__zoom",aS).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",B).filter(a).on("touchstart.zoom",z).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(P,Y,q,X){var K=P.selection?P.selection():P;K.property("__zoom",aS),P!==K?R(P,Y,q,X):K.interrupt().each(function(){N(this,arguments).event(X).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},y.scaleBy=function(P,Y,q,X){y.scaleTo(P,function(){var K=this.__zoom.k,L=typeof Y=="function"?Y.apply(this,arguments):Y;return K*L},q,X)},y.scaleTo=function(P,Y,q,X){y.transform(P,function(){var K=t.apply(this,arguments),L=this.__zoom,M=q==null?E(K):typeof q=="function"?q.apply(this,arguments):q,O=L.invert(M),U=typeof Y=="function"?Y.apply(this,arguments):Y;return n(b(x(L,U),M,O),K,u)},q,X)},y.translateBy=function(P,Y,q,X){y.transform(P,function(){return n(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof q=="function"?q.apply(this,arguments):q),t.apply(this,arguments),u)},null,X)},y.translateTo=function(P,Y,q,X,K){y.transform(P,function(){var L=t.apply(this,arguments),M=this.__zoom,O=X==null?E(L):typeof X=="function"?X.apply(this,arguments):X;return n(kh.translate(O[0],O[1]).scale(M.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof q=="function"?-q.apply(this,arguments):-q),L,u)},X,K)};function x(P,Y){return Y=Math.max(l[0],Math.min(l[1],Y)),Y===P.k?P:new $i(Y,P.x,P.y)}function b(P,Y,q){var X=Y[0]-q[0]*P.k,K=Y[1]-q[1]*P.k;return X===P.x&&K===P.y?P:new $i(P.k,X,K)}function E(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function R(P,Y,q,X){P.on("start.zoom",function(){N(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(X).end()}).tween("zoom",function(){var K=this,L=arguments,M=N(K,L).event(X),O=t.apply(K,L),U=q==null?E(O):typeof q=="function"?q.apply(K,L):q,$=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),Q=K.__zoom,re=typeof Y=="function"?Y.apply(K,L):Y,se=c(Q.invert(U).concat($/Q.k),re.invert(U).concat($/re.k));return function(Z){if(Z===1)Z=re;else{var H=se(Z),ee=$/H[2];Z=new $i(ee,U[0]-H[0]*ee,U[1]-H[1]*ee)}M.zoom(null,Z)}})}function N(P,Y,q){return!q&&P.__zooming||new D(P,Y)}function D(P,Y){this.that=P,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,Y),this.taps=0}D.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,Y){return this.mouse&&P!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var Y=An(this.that).datum();f.call(P,this.that,new $z(P,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:f}),Y)}};function T(P,...Y){if(!e.apply(this,arguments))return;var q=N(this,Y).event(P),X=this.__zoom,K=Math.max(l[0],Math.min(l[1],X.k*Math.pow(2,r.apply(this,arguments)))),L=Xn(P);if(q.wheel)(q.mouse[0][0]!==L[0]||q.mouse[0][1]!==L[1])&&(q.mouse[1]=X.invert(q.mouse[0]=L)),clearTimeout(q.wheel);else{if(X.k===K)return;q.mouse=[L,X.invert(L)],wu(this),q.start()}Oo(P),q.wheel=setTimeout(M,C),q.zoom("mouse",n(b(x(X,K),q.mouse[0],q.mouse[1]),q.extent,u));function M(){q.wheel=null,q.end()}}function j(P,...Y){if(v||!e.apply(this,arguments))return;var q=P.currentTarget,X=N(this,Y,!0).event(P),K=An(P.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",$,!0),L=Xn(P,q),M=P.clientX,O=P.clientY;YC(P.view),wp(P),X.mouse=[L,this.__zoom.invert(L)],wu(this),X.start();function U(Q){if(Oo(Q),!X.moved){var re=Q.clientX-M,se=Q.clientY-O;X.moved=re*re+se*se>w}X.event(Q).zoom("mouse",n(b(X.that.__zoom,X.mouse[0]=Xn(Q,q),X.mouse[1]),X.extent,u))}function $(Q){K.on("mousemove.zoom mouseup.zoom",null),WC(Q.view,X.moved),Oo(Q),X.event(Q).end()}}function B(P,...Y){if(e.apply(this,arguments)){var q=this.__zoom,X=Xn(P.changedTouches?P.changedTouches[0]:P,this),K=q.invert(X),L=q.k*(P.shiftKey?.5:2),M=n(b(x(q,L),X,K),t.apply(this,Y),u);Oo(P),o>0?An(this).transition().duration(o).call(R,M,X,P):An(this).call(y.transform,M,X,P)}}function z(P,...Y){if(e.apply(this,arguments)){var q=P.touches,X=q.length,K=N(this,Y,P.changedTouches.length===X).event(P),L,M,O,U;for(wp(P),M=0;M`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},rl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],h2=["Enter"," ","Escape"],f2={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var xa;(function(e){e.Strict="strict",e.Loose="loose"})(xa||(xa={}));var os;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(os||(os={}));var sl;(function(e){e.Partial="partial",e.Full="full"})(sl||(sl={}));const d2={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ar;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ar||(Ar={}));var $u;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})($u||($u={}));var je;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(je||(je={}));const oS={[je.Left]:je.Right,[je.Right]:je.Left,[je.Top]:je.Bottom,[je.Bottom]:je.Top};function p2(e){return e===null?null:e?"valid":"invalid"}const g2=e=>"id"in e&&"source"in e&&"target"in e,Wz=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Um=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),_l=(e,t=[0,0])=>{const{width:n,height:r}=Wi(e),a=e.origin??t,l=n*a[0],u=r*a[1];return{x:e.position.x-l,y:e.position.y-u}},Xz=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,a)=>{const l=typeof a=="string";let u=!t.nodeLookup&&!l?a:void 0;t.nodeLookup&&(u=l?t.nodeLookup.get(a):Um(a)?a:t.nodeLookup.get(a.id));const o=u?Uu(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Ah(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Nh(n)},yl=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=Ah(n,Uu(a)),r=!0)}),r?Nh(n):{x:0,y:0,width:0,height:0}},Gm=(e,t,[n,r,a]=[0,0,1],l=!1,u=!1)=>{const o=(t.x-n)/a,c=(t.y-r)/a,f=t.width/a,p=t.height/a,d=[];for(const v of e.values()){const{measured:_,selectable:C=!0,hidden:w=!1}=v;if(u&&!C||w)continue;const S=_.width??v.width??v.initialWidth??0,y=_.height??v.height??v.initialHeight??0,{x,y:b}=v.internals.positionAbsolute,E=y2(o,c,f,p,x,b,S,y),R=S*y,N=l&&E>0;(!v.internals.handleBounds||N||E>=R||v.dragging)&&d.push(v)}return d},Kz=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Zz(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!a.hidden)&&(!r||r.has(a.id))&&n.set(a.id,a)}),n}async function Qz({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:l},u){if(e.size===0)return!0;const o=Zz(e,u),c=yl(o),f=Vm(c,t,n,(u==null?void 0:u.minZoom)??a,(u==null?void 0:u.maxZoom)??l,(u==null?void 0:u.padding)??.1);return await r.setViewport(f,{duration:u==null?void 0:u.duration,ease:u==null?void 0:u.ease,interpolate:u==null?void 0:u.interpolate}),!0}function m2({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:a,onError:l}){const u=n.get(e),o=u.parentId?n.get(u.parentId):void 0,{x:c,y:f}=o?o.internals.positionAbsolute:{x:0,y:0},p=u.origin??r;let d=u.extent||a;if(u.extent==="parent"&&!u.expandParent)if(!o)l==null||l("005",ei.error005());else{const _=o.measured.width,C=o.measured.height;_&&C&&(d=[[c,f],[c+_,f+C]])}else o&&ds(u.extent)&&(d=[[u.extent[0][0]+c,u.extent[0][1]+f],[u.extent[1][0]+c,u.extent[1][1]+f]]);const v=ds(d)?fs(t,d,u.measured):t;return(u.measured.width===void 0||u.measured.height===void 0)&&(l==null||l("015",ei.error015())),{position:{x:v.x-c+(u.measured.width??0)*p[0],y:v.y-f+(u.measured.height??0)*p[1]},positionAbsolute:v}}async function Jz({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:a}){const l=new Set(e.map(v=>v.id)),u=[];for(const v of n){if(v.deletable===!1)continue;const _=l.has(v.id),C=!_&&v.parentId&&u.find(w=>w.id===v.parentId);(_||C)&&u.push(v)}const o=new Set(t.map(v=>v.id)),c=r.filter(v=>v.deletable!==!1),p=Kz(u,c);for(const v of c)o.has(v.id)&&!p.find(C=>C.id===v.id)&&p.push(v);if(!a)return{edges:p,nodes:u};const d=await a({nodes:u,edges:p});return typeof d=="boolean"?d?{edges:p,nodes:u}:{edges:[],nodes:[]}:d}const wa=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),fs=(e={x:0,y:0},t,n)=>({x:wa(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:wa(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function v2(e,t,n){const{width:r,height:a}=Wi(n),{x:l,y:u}=n.internals.positionAbsolute;return fs(e,[[l,u],[l+r,u+a]],t)}const lS=(e,t,n)=>en?-wa(Math.abs(e-n),1,t)/t:0,qm=(e,t,n=15,r=40)=>{const a=lS(e.x,r,t.width-r)*n,l=lS(e.y,r,t.height-r)*n;return[a,l]},Ah=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),bg=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Nh=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),al=(e,t=[0,0])=>{var a,l;const{x:n,y:r}=Um(e)?e.internals.positionAbsolute:_l(e,t);return{x:n,y:r,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0}},Uu=(e,t=[0,0])=>{var a,l;const{x:n,y:r}=Um(e)?e.internals.positionAbsolute:_l(e,t);return{x:n,y:r,x2:n+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:r+(((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0)}},_2=(e,t)=>Nh(Ah(bg(e),bg(t))),y2=(e,t,n,r,a,l,u,o)=>{const c=Math.max(0,Math.min(e+n,a+u)-Math.max(e,a)),f=Math.max(0,Math.min(t+r,l+o)-Math.max(t,l));return Math.ceil(c*f)},Gu=(e,t)=>y2(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),cS=e=>Zn(e.width)&&Zn(e.height)&&Zn(e.x)&&Zn(e.y),Zn=e=>!isNaN(e)&&isFinite(e),b2=(e,t)=>(n,r)=>{},bl=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Sl=({x:e,y:t},[n,r,a],l=!1,u=[1,1])=>{const o={x:(e-n)/a,y:(t-r)/a};return l?bl(o,u):o},Ca=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function aa(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function eH(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=aa(e,n),a=aa(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){const r=aa(e.top??e.y??0,n),a=aa(e.bottom??e.y??0,n),l=aa(e.left??e.x??0,t),u=aa(e.right??e.x??0,t);return{top:r,right:u,bottom:a,left:l,x:l+u,y:r+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function tH(e,t,n,r,a,l){const{x:u,y:o}=Ca(e,[t,n,r]),{x:c,y:f}=Ca({x:e.x+e.width,y:e.y+e.height},[t,n,r]),p=a-c,d=l-f;return{left:Math.floor(u),top:Math.floor(o),right:Math.floor(p),bottom:Math.floor(d)}}const Vm=(e,t,n,r,a,l)=>{const u=eH(l,t,n),o=(t-u.x)/e.width,c=(n-u.y)/e.height,f=Math.min(o,c),p=wa(f,r,a),d=e.x+e.width/2,v=e.y+e.height/2,_=t/2-d*p,C=n/2-v*p,w=tH(e,_,C,p,t,n),S={left:Math.min(w.left-u.left,0),top:Math.min(w.top-u.top,0),right:Math.min(w.right-u.right,0),bottom:Math.min(w.bottom-u.bottom,0)};return{x:_-S.left+S.right,y:C-S.top+S.bottom,zoom:p}},ol=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ds(e){return e!=null&&e!=="parent"}function Wi(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function S2(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function x2(e,t={width:0,height:0},n,r,a){const l={...e},u=r.get(n);if(u){const o=u.origin||a;l.x+=u.internals.positionAbsolute.x-(t.width??0)*o[0],l.y+=u.internals.positionAbsolute.y-(t.height??0)*o[1]}return l}function uS(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function nH(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}function iH(e){return{...f2,...e||{}}}function Uo(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:l,y:u}=Qn(e),o=Sl({x:l-((a==null?void 0:a.left)??0),y:u-((a==null?void 0:a.top)??0)},r),{x:c,y:f}=n?bl(o,t):o;return{xSnapped:c,ySnapped:f,...o}}const Ym=e=>({width:e.offsetWidth,height:e.offsetHeight}),w2=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},rH=["INPUT","SELECT","TEXTAREA"];function C2(e){var r,a;const t=((a=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:a[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:rH.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const E2=e=>"clientX"in e,Qn=(e,t)=>{var l,u;const n=E2(e),r=n?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,a=n?e.clientY:(u=e.touches)==null?void 0:u[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},hS=(e,t,n,r,a)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(u=>{const o=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:a,position:u.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...Ym(u)}})};function k2({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:o}){const c=e*.125+a*.375+u*.375+n*.125,f=t*.125+l*.375+o*.375+r*.125,p=Math.abs(c-e),d=Math.abs(f-t);return[c,f,p,d]}function au(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function fS({pos:e,x1:t,y1:n,x2:r,y2:a,c:l}){switch(e){case je.Left:return[t-au(t-r,l),n];case je.Right:return[t+au(r-t,l),n];case je.Top:return[t,n-au(n-a,l)];case je.Bottom:return[t,n+au(a-n,l)]}}function A2({sourceX:e,sourceY:t,sourcePosition:n=je.Bottom,targetX:r,targetY:a,targetPosition:l=je.Top,curvature:u=.25}){const[o,c]=fS({pos:n,x1:e,y1:t,x2:r,y2:a,c:u}),[f,p]=fS({pos:l,x1:r,y1:a,x2:e,y2:t,c:u}),[d,v,_,C]=k2({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:o,sourceControlY:c,targetControlX:f,targetControlY:p});return[`M${e},${t} C${o},${c} ${f},${p} ${r},${a}`,d,v,_,C]}function N2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const a=Math.abs(n-e)/2,l=n0}const oH=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,lH=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),cH=(e,t,n={})=>{var l;if(!e.source||!e.target)return(l=n.onError)==null||l.call(n,"006",ei.error006()),t;const r=n.getEdgeId||oH;let a;return g2(e)?a={...e}:a={...e,id:r(e)},lH(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function T2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,l,u,o]=N2({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,l,u,o]}const dS={[je.Left]:{x:-1,y:0},[je.Right]:{x:1,y:0},[je.Top]:{x:0,y:-1},[je.Bottom]:{x:0,y:1}},uH=({source:e,sourcePosition:t=je.Bottom,target:n})=>t===je.Left||t===je.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function hH({source:e,sourcePosition:t=je.Bottom,target:n,targetPosition:r=je.Top,center:a,offset:l,stepPosition:u}){const o=dS[t],c=dS[r],f={x:e.x+o.x*l,y:e.y+o.y*l},p={x:n.x+c.x*l,y:n.y+c.y*l},d=uH({source:f,sourcePosition:t,target:p}),v=d.x!==0?"x":"y",_=d[v];let C=[],w,S;const y={x:0,y:0},x={x:0,y:0},[,,b,E]=N2({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[v]*c[v]===-1){v==="x"?(w=a.x??f.x+(p.x-f.x)*u,S=a.y??(f.y+p.y)/2):(w=a.x??(f.x+p.x)/2,S=a.y??f.y+(p.y-f.y)*u);const T=[{x:w,y:f.y},{x:w,y:p.y}],j=[{x:f.x,y:S},{x:p.x,y:S}];o[v]===_?C=v==="x"?T:j:C=v==="x"?j:T}else{const T=[{x:f.x,y:p.y}],j=[{x:p.x,y:f.y}];if(v==="x"?C=o.x===_?j:T:C=o.y===_?T:j,t===r){const P=Math.abs(e[v]-n[v]);if(P<=l){const Y=Math.min(l-1,l-P);o[v]===_?y[v]=(f[v]>e[v]?-1:1)*Y:x[v]=(p[v]>n[v]?-1:1)*Y}}if(t!==r){const P=v==="x"?"y":"x",Y=o[v]===c[P],q=f[P]>p[P],X=f[P]=F?(w=(B.x+z.x)/2,S=C[0].y):(w=C[0].x,S=(B.y+z.y)/2)}const R={x:f.x+y.x,y:f.y+y.y},N={x:p.x+x.x,y:p.y+x.y};return[[e,...R.x!==C[0].x||R.y!==C[0].y?[R]:[],...C,...N.x!==C[C.length-1].x||N.y!==C[C.length-1].y?[N]:[],n],w,S,b,E]}function fH(e,t,n,r){const a=Math.min(pS(e,t)/2,pS(t,n)/2,r),{x:l,y:u}=t;if(e.x===l&&l===n.x||e.y===u&&u===n.y)return`L${l} ${u}`;if(e.y===u){const f=e.xn.id===t):e[0])||null}function xg(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function pH(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:a}){const l=new Set;return e.reduce((u,o)=>([o.markerStart||r,o.markerEnd||a].forEach(c=>{if(c&&typeof c=="object"){const f=xg(c,t);l.has(f)||(u.push({id:f,color:c.color||n,...c}),l.add(f))}}),u),[]).sort((u,o)=>u.id.localeCompare(o.id))}const R2=1e3,gH=10,Wm={nodeOrigin:[0,0],nodeExtent:rl,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},mH={...Wm,checkEquality:!0};function Xm(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function vH(e,t,n){const r=Xm(Wm,n);for(const a of e.values())if(a.parentId)Zm(a,e,t,r);else{const l=_l(a,r.nodeOrigin),u=ds(a.extent)?a.extent:r.nodeExtent,o=fs(l,u,Wi(a));a.internals.positionAbsolute=o}}function _H(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const a of e.handles){const l={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(l):a.type==="target"&&r.push(l)}return{source:n,target:r}}function Km(e){return e==="manual"}function wg(e,t,n,r={}){var p,d;const a=Xm(mH,r),l={i:0},u=new Map(t),o=a!=null&&a.elevateNodesOnSelect&&!Km(a.zIndexMode)?R2:0;let c=e.length>0,f=!1;t.clear(),n.clear();for(const v of e){let _=u.get(v.id);if(a.checkEquality&&v===(_==null?void 0:_.internals.userNode))t.set(v.id,_);else{const C=_l(v,a.nodeOrigin),w=ds(v.extent)?v.extent:a.nodeExtent,S=fs(C,w,Wi(v));_={...a.defaults,...v,measured:{width:(p=v.measured)==null?void 0:p.width,height:(d=v.measured)==null?void 0:d.height},internals:{positionAbsolute:S,handleBounds:_H(v,_),z:D2(v,o,a.zIndexMode),userNode:v}},t.set(v.id,_)}(_.measured===void 0||_.measured.width===void 0||_.measured.height===void 0)&&!_.hidden&&(c=!1),v.parentId&&Zm(_,t,n,r,l),f||(f=v.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:f}}function yH(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Zm(e,t,n,r,a){const{elevateNodesOnSelect:l,nodeOrigin:u,nodeExtent:o,zIndexMode:c}=Xm(Wm,r),f=e.parentId,p=t.get(f);if(!p){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}yH(e,n),a&&!p.parentId&&p.internals.rootParentIndex===void 0&&c==="auto"&&(p.internals.rootParentIndex=++a.i,p.internals.z=p.internals.z+a.i*gH),a&&p.internals.rootParentIndex!==void 0&&(a.i=p.internals.rootParentIndex);const d=l&&!Km(c)?R2:0,{x:v,y:_,z:C}=bH(e,p,u,o,d,c),{positionAbsolute:w}=e.internals,S=v!==w.x||_!==w.y;(S||C!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:S?{x:v,y:_}:w,z:C}})}function D2(e,t,n){const r=Zn(e.zIndex)?e.zIndex:0;return Km(n)?r:r+(e.selected?t:0)}function bH(e,t,n,r,a,l){const{x:u,y:o}=t.internals.positionAbsolute,c=Wi(e),f=_l(e,n),p=ds(e.extent)?fs(f,e.extent,c):f;let d=fs({x:u+p.x,y:o+p.y},r,c);e.extent==="parent"&&(d=v2(d,c,t));const v=D2(e,a,l),_=t.internals.z??0;return{x:d.x,y:d.y,z:_>=v?_+1:v}}function Qm(e,t,n,r=[0,0]){var u;const a=[],l=new Map;for(const o of e){const c=t.get(o.parentId);if(!c)continue;const f=((u=l.get(o.parentId))==null?void 0:u.expandedRect)??al(c),p=_2(f,o.rect);l.set(o.parentId,{expandedRect:p,parent:c})}return l.size>0&&l.forEach(({expandedRect:o,parent:c},f)=>{var b;const p=c.internals.positionAbsolute,d=Wi(c),v=c.origin??r,_=o.x0||C>0||y||x)&&(a.push({id:f,type:"position",position:{x:c.position.x-_+y,y:c.position.y-C+x}}),(b=n.get(f))==null||b.forEach(E=>{e.some(R=>R.id===E.id)||a.push({id:E.id,type:"position",position:{x:E.position.x+_,y:E.position.y+C}})})),(d.width0){const _=Qm(v,t,n,a);f.push(..._)}return{changes:f,updatedInternals:c}}async function xH({delta:e,panZoom:t,transform:n,translateExtent:r,width:a,height:l}){if(!t||!e.x&&!e.y)return!1;const u=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,l]],r);return!!u&&(u.x!==n[0]||u.y!==n[1]||u.k!==n[2])}function _S(e,t,n,r,a,l){let u=a;const o=r.get(u)||new Map;r.set(u,o.set(n,t)),u=`${a}-${e}`;const c=r.get(u)||new Map;if(r.set(u,c.set(n,t)),l){u=`${a}-${e}-${l}`;const f=r.get(u)||new Map;r.set(u,f.set(n,t))}}function M2(e,t,n){e.clear(),t.clear();for(const r of n){const{source:a,target:l,sourceHandle:u=null,targetHandle:o=null}=r,c={edgeId:r.id,source:a,target:l,sourceHandle:u,targetHandle:o},f=`${a}-${u}--${l}-${o}`,p=`${l}-${o}--${a}-${u}`;_S("source",c,p,e,a,u),_S("target",c,f,e,l,o),t.set(r.id,r)}}function j2(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:j2(n,t):!1}function yS(e,t,n){var a;let r=e;do{if((a=r==null?void 0:r.matches)!=null&&a.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function wH(e,t,n,r){const a=new Map;for(const[l,u]of e)if((u.selected||u.id===r)&&(!u.parentId||!j2(u,e))&&(u.draggable||t&&typeof u.draggable>"u")){const o=e.get(l);o&&a.set(l,{id:l,position:o.position||{x:0,y:0},distance:{x:n.x-o.internals.positionAbsolute.x,y:n.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return a}function Cp({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var u,o,c;const a=[];for(const[f,p]of t){const d=(u=n.get(f))==null?void 0:u.internals.userNode;d&&a.push({...d,position:p.position,dragging:r})}if(!e)return[a[0],a];const l=(o=n.get(e))==null?void 0:o.internals.userNode;return[l?{...l,position:((c=t.get(e))==null?void 0:c.position)||l.position,dragging:r}:a[0],a]}function CH({dragItems:e,snapGrid:t,x:n,y:r}){const a=e.values().next().value;if(!a)return null;const l={x:n-a.distance.x,y:r-a.distance.y},u=bl(l,t);return{x:u.x-l.x,y:u.y-l.y}}function EH({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let l={x:null,y:null},u=0,o=new Map,c=!1,f={x:0,y:0},p=null,d=!1,v=null,_=!1,C=!1,w=null;function S({noDragClassName:x,handleSelector:b,domNode:E,isSelectable:R,nodeId:N,nodeClickDistance:D=0}){v=An(E);function T({x:V,y:F}){const{nodeLookup:P,nodeExtent:Y,snapGrid:q,snapToGrid:X,nodeOrigin:K,onNodeDrag:L,onSelectionDrag:M,onError:O,updateNodePositions:U}=t();l={x:V,y:F};let $=!1;const Q=o.size>1,re=Q&&Y?bg(yl(o)):null,se=Q&&X?CH({dragItems:o,snapGrid:q,x:V,y:F}):null;for(const[Z,H]of o){if(!P.has(Z))continue;let ee={x:V-H.distance.x,y:F-H.distance.y};X&&(ee=se?{x:Math.round(ee.x+se.x),y:Math.round(ee.y+se.y)}:bl(ee,q));let ne=null;if(Q&&Y&&!H.extent&&re){const{positionAbsolute:ye}=H.internals,Ce=ye.x-re.x+Y[0][0],Ee=ye.x+H.measured.width-re.x2+Y[1][0],Ne=ye.y-re.y+Y[0][1],we=ye.y+H.measured.height-re.y2+Y[1][1];ne=[[Ce,Ne],[Ee,we]]}const{position:pe,positionAbsolute:fe}=m2({nodeId:Z,nextPosition:ee,nodeLookup:P,nodeExtent:ne||Y,nodeOrigin:K,onError:O});$=$||H.position.x!==pe.x||H.position.y!==pe.y,H.position=pe,H.internals.positionAbsolute=fe}if(C=C||$,!!$&&(U(o,!0),w&&(r||L||!N&&M))){const[Z,H]=Cp({nodeId:N,dragItems:o,nodeLookup:P});r==null||r(w,o,Z,H),L==null||L(w,Z,H),N||M==null||M(w,H)}}async function j(){if(!p)return;const{transform:V,panBy:F,autoPanSpeed:P,autoPanOnNodeDrag:Y}=t();if(!Y){c=!1,cancelAnimationFrame(u);return}const[q,X]=qm(f,p,P);(q!==0||X!==0)&&(l.x=(l.x??0)-q/V[2],l.y=(l.y??0)-X/V[2],await F({x:q,y:X})&&T(l)),u=requestAnimationFrame(j)}function B(V){var Q;const{nodeLookup:F,multiSelectionActive:P,nodesDraggable:Y,transform:q,snapGrid:X,snapToGrid:K,selectNodesOnDrag:L,onNodeDragStart:M,onSelectionDragStart:O,unselectNodesAndEdges:U}=t();d=!0,(!L||!R)&&!P&&N&&((Q=F.get(N))!=null&&Q.selected||U()),R&&L&&N&&(e==null||e(N));const $=Uo(V.sourceEvent,{transform:q,snapGrid:X,snapToGrid:K,containerBounds:p});if(l=$,o=wH(F,Y,$,N),o.size>0&&(n||M||!N&&O)){const[re,se]=Cp({nodeId:N,dragItems:o,nodeLookup:F});n==null||n(V.sourceEvent,o,re,se),M==null||M(V.sourceEvent,re,se),N||O==null||O(V.sourceEvent,se)}}const z=XC().clickDistance(D).on("start",V=>{const{domNode:F,nodeDragThreshold:P,transform:Y,snapGrid:q,snapToGrid:X}=t();p=(F==null?void 0:F.getBoundingClientRect())||null,_=!1,C=!1,w=V.sourceEvent,P===0&&B(V),l=Uo(V.sourceEvent,{transform:Y,snapGrid:q,snapToGrid:X,containerBounds:p}),f=Qn(V.sourceEvent,p)}).on("drag",V=>{const{autoPanOnNodeDrag:F,transform:P,snapGrid:Y,snapToGrid:q,nodeDragThreshold:X,nodeLookup:K}=t(),L=Uo(V.sourceEvent,{transform:P,snapGrid:Y,snapToGrid:q,containerBounds:p});if(w=V.sourceEvent,(V.sourceEvent.type==="touchmove"&&V.sourceEvent.touches.length>1||N&&!K.has(N))&&(_=!0),!_){if(!c&&F&&d&&(c=!0,j()),!d){const M=Qn(V.sourceEvent,p),O=M.x-f.x,U=M.y-f.y;Math.sqrt(O*O+U*U)>X&&B(V)}(l.x!==L.xSnapped||l.y!==L.ySnapped)&&o&&d&&(f=Qn(V.sourceEvent,p),T(L))}}).on("end",V=>{if(!d||_){_&&o.size>0&&t().updateNodePositions(o,!1);return}if(c=!1,d=!1,cancelAnimationFrame(u),o.size>0){const{nodeLookup:F,updateNodePositions:P,onNodeDragStop:Y,onSelectionDragStop:q}=t();if(C&&(P(o,!1),C=!1),a||Y||!N&&q){const[X,K]=Cp({nodeId:N,dragItems:o,nodeLookup:F,dragging:!1});a==null||a(V.sourceEvent,o,X,K),Y==null||Y(V.sourceEvent,X,K),N||q==null||q(V.sourceEvent,K)}}}).filter(V=>{const F=V.target;return!V.button&&(!x||!yS(F,`.${x}`,E))&&(!b||yS(F,b,E))});v.call(z)}function y(){v==null||v.on(".drag",null)}return{update:S,destroy:y}}function kH(e,t,n){const r=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const l of t.values())Gu(a,al(l))>0&&r.push(l);return r}const AH=250;function NH(e,t,n,r){var o,c;let a=[],l=1/0;const u=kH(e,n,t+AH);for(const f of u){const p=[...((o=f.internals.handleBounds)==null?void 0:o.source)??[],...((c=f.internals.handleBounds)==null?void 0:c.target)??[]];for(const d of p){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:v,y:_}=ps(f,d,d.position,!0),C=Math.sqrt(Math.pow(v-e.x,2)+Math.pow(_-e.y,2));C>t||(C1){const f=r.type==="source"?"target":"source";return a.find(p=>p.type===f)??a[0]}return a[0]}function L2(e,t,n,r,a,l=!1){var f,p,d;const u=r.get(e);if(!u)return null;const o=a==="strict"?(f=u.internals.handleBounds)==null?void 0:f[t]:[...((p=u.internals.handleBounds)==null?void 0:p.source)??[],...((d=u.internals.handleBounds)==null?void 0:d.target)??[]],c=(n?o==null?void 0:o.find(v=>v.id===n):o==null?void 0:o[0])??null;return c&&l?{...c,...ps(u,c,c.position,!0)}:c}function O2(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function TH(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const B2=()=>!0;function RH(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:l,isTarget:u,domNode:o,nodeLookup:c,lib:f,autoPanOnConnect:p,flowId:d,panBy:v,cancelConnection:_,onConnectStart:C,onConnect:w,onConnectEnd:S,isValidConnection:y=B2,onReconnectEnd:x,updateConnection:b,getTransform:E,getFromHandle:R,autoPanSpeed:N,dragThreshold:D=1,handleDomNode:T}){const j=w2(e.target);let B=0,z;const{x:V,y:F}=Qn(e),P=O2(l,T),Y=o==null?void 0:o.getBoundingClientRect();let q=!1;if(!Y||!P)return;const X=L2(a,P,r,c,t);if(!X)return;let K=Qn(e,Y),L=!1,M=null,O=!1,U=null;function $(){if(!p||!Y)return;const[pe,fe]=qm(K,Y,N);v({x:pe,y:fe}),B=requestAnimationFrame($)}const Q={...X,nodeId:a,type:P,position:X.position},re=c.get(a);let Z={inProgress:!0,isValid:null,from:ps(re,Q,je.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:re,to:K,toHandle:null,toPosition:oS[Q.position],toNode:null,pointer:K};function H(){q=!0,b(Z),C==null||C(e,{nodeId:a,handleId:r,handleType:P})}D===0&&H();function ee(pe){if(!q){const{x:we,y:ft}=Qn(pe),Ct=we-V,st=ft-F;if(!(Ct*Ct+st*st>D*D))return;H()}if(!R()||!Q){ne(pe);return}const fe=E();K=Qn(pe,Y),z=NH(Sl(K,fe,!1,[1,1]),n,c,Q),L||($(),L=!0);const ye=I2(pe,{handle:z,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:u?"target":"source",isValidConnection:y,doc:j,lib:f,flowId:d,nodeLookup:c});U=ye.handleDomNode,M=ye.connection,O=TH(!!z,ye.isValid);const Ce=c.get(a),Ee=Ce?ps(Ce,Q,je.Left,!0):Z.from,Ne={...Z,from:Ee,isValid:O,to:ye.toHandle&&O?Ca({x:ye.toHandle.x,y:ye.toHandle.y},fe):K,toHandle:ye.toHandle,toPosition:O&&ye.toHandle?ye.toHandle.position:oS[Q.position],toNode:ye.toHandle?c.get(ye.toHandle.nodeId):null,pointer:K};b(Ne),Z=Ne}function ne(pe){if(!("touches"in pe&&pe.touches.length>0)){if(q){(z||U)&&M&&O&&(w==null||w(M));const{inProgress:fe,...ye}=Z,Ce={...ye,toPosition:Z.toHandle?Z.toPosition:null};S==null||S(pe,Ce),l&&(x==null||x(pe,Ce))}_(),cancelAnimationFrame(B),L=!1,O=!1,M=null,U=null,j.removeEventListener("mousemove",ee),j.removeEventListener("mouseup",ne),j.removeEventListener("touchmove",ee),j.removeEventListener("touchend",ne)}}j.addEventListener("mousemove",ee),j.addEventListener("mouseup",ne),j.addEventListener("touchmove",ee),j.addEventListener("touchend",ne)}function I2(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:l,doc:u,lib:o,flowId:c,isValidConnection:f=B2,nodeLookup:p}){const d=l==="target",v=t?u.querySelector(`.${o}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:_,y:C}=Qn(e),w=u.elementFromPoint(_,C),S=w!=null&&w.classList.contains(`${o}-flow__handle`)?w:v,y={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const x=O2(void 0,S),b=S.getAttribute("data-nodeid"),E=S.getAttribute("data-handleid"),R=S.classList.contains("connectable"),N=S.classList.contains("connectableend");if(!b||!x)return y;const D={source:d?b:r,sourceHandle:d?E:a,target:d?r:b,targetHandle:d?a:E};y.connection=D;const j=R&&N&&(n===xa.Strict?d&&x==="source"||!d&&x==="target":b!==r||E!==a);y.isValid=j&&f(D),y.toHandle=L2(b,x,E,p,n,!0)}return y}const Cg={onPointerDown:RH,isValid:I2};function DH({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=An(e);function l({translateExtent:o,width:c,height:f,zoomStep:p=1,pannable:d=!0,zoomable:v=!0,inversePan:_=!1}){const C=b=>{if(b.sourceEvent.type!=="wheel"||!t)return;const E=n(),R=b.sourceEvent.ctrlKey&&ol()?10:1,N=-b.sourceEvent.deltaY*(b.sourceEvent.deltaMode===1?.05:b.sourceEvent.deltaMode?1:.002)*p,D=E[2]*Math.pow(2,N*R);t.scaleTo(D)};let w=[0,0];const S=b=>{(b.sourceEvent.type==="mousedown"||b.sourceEvent.type==="touchstart")&&(w=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY])},y=b=>{const E=n();if(b.sourceEvent.type!=="mousemove"&&b.sourceEvent.type!=="touchmove"||!t)return;const R=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY],N=[R[0]-w[0],R[1]-w[1]];w=R;const D=r()*Math.max(E[2],Math.log(E[2]))*(_?-1:1),T={x:E[0]-N[0]*D,y:E[1]-N[1]*D},j=[[0,0],[c,f]];t.setViewportConstrained({x:T.x,y:T.y,zoom:E[2]},j,o)},x=u2().on("start",S).on("zoom",d?y:null).on("zoom.wheel",v?C:null);a.call(x,{})}function u(){a.on("zoom",null)}return{update:l,destroy:u,pointer:Xn}}const Th=e=>({x:e.x,y:e.y,zoom:e.k}),Ep=({x:e,y:t,zoom:n})=>kh.translate(e,t).scale(n),da=(e,t)=>e.target.closest(`.${t}`),z2=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),MH=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,kp=(e,t=0,n=MH,r=()=>{})=>{const a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},H2=e=>{const t=e.ctrlKey&&ol()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function jH({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:l,zoomOnPinch:u,onPanZoomStart:o,onPanZoom:c,onPanZoomEnd:f}){return p=>{if(da(p,t))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(p.ctrlKey&&u){const S=Xn(p),y=H2(p),x=d*Math.pow(2,y);r.scaleTo(n,x,S,p);return}const v=p.deltaMode===1?20:1;let _=a===os.Vertical?0:p.deltaX*v,C=a===os.Horizontal?0:p.deltaY*v;!ol()&&p.shiftKey&&a!==os.Vertical&&(_=p.deltaY*v,C=0),r.translateBy(n,-(_/d)*l,-(C/d)*l,{internal:!0});const w=Th(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(p,w),e.panScrollTimeout=setTimeout(()=>{f==null||f(p,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(p,w))}}function LH({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const l=r.type==="wheel",u=!t&&l&&!r.ctrlKey,o=da(r,e);if(r.ctrlKey&&l&&o&&r.preventDefault(),u||o)return null;r.preventDefault(),n.call(this,r,a)}}function OH({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var l,u,o;if((l=r.sourceEvent)!=null&&l.internal)return;const a=Th(r.transform);e.mouseButton=((u=r.sourceEvent)==null?void 0:u.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,a))}}function BH({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return l=>{var u,o;e.usedRightMouseButton=!!(n&&z2(t,e.mouseButton??0)),(u=l.sourceEvent)!=null&&u.sync||r([l.transform.x,l.transform.y,l.transform.k]),a&&!((o=l.sourceEvent)!=null&&o.internal)&&(a==null||a(l.sourceEvent,Th(l.transform)))}}function IH({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:a,onPaneContextMenu:l}){return u=>{var o;if(!((o=u.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,l&&z2(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&l(u.sourceEvent),e.usedRightMouseButton=!1,r(!1),a)){const c=Th(u.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(u.sourceEvent,c)},n?150:0)}}}function zH({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:a,zoomOnDoubleClick:l,userSelectionActive:u,noWheelClassName:o,noPanClassName:c,lib:f,connectionInProgress:p}){return d=>{var S;const v=e||t,_=n&&d.ctrlKey,C=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(da(d,`${f}-flow__node`)||da(d,`${f}-flow__edge`)))return!0;if(!r&&!v&&!a&&!l&&!n||u||p&&!C||da(d,o)&&C||da(d,c)&&(!C||a&&C&&!e)||!n&&d.ctrlKey&&C)return!1;if(!n&&d.type==="touchstart"&&((S=d.touches)==null?void 0:S.length)>1)return d.preventDefault(),!1;if(!v&&!a&&!_&&C||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||C)&&w}}function HH({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:a,onPanZoom:l,onPanZoomStart:u,onPanZoomEnd:o,onDraggingChange:c}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),d=u2().scaleExtent([t,n]).translateExtent(r),v=An(e).call(d);x({x:a.x,y:a.y,zoom:wa(a.zoom,t,n)},[[0,0],[p.width,p.height]],r);const _=v.on("wheel.zoom"),C=v.on("dblclick.zoom");d.wheelDelta(H2);async function w(z,V){return v?new Promise(F=>{d==null||d.interpolate((V==null?void 0:V.interpolate)==="linear"?$o:bu).transform(kp(v,V==null?void 0:V.duration,V==null?void 0:V.ease,()=>F(!0)),z)}):!1}function S({noWheelClassName:z,noPanClassName:V,onPaneContextMenu:F,userSelectionActive:P,panOnScroll:Y,panOnDrag:q,panOnScrollMode:X,panOnScrollSpeed:K,preventScrolling:L,zoomOnPinch:M,zoomOnScroll:O,zoomOnDoubleClick:U,zoomActivationKeyPressed:$,lib:Q,onTransformChange:re,connectionInProgress:se,paneClickDistance:Z,selectionOnDrag:H}){P&&!f.isZoomingOrPanning&&y();const ee=Y&&!$&&!P;d.clickDistance(H?1/0:!Zn(Z)||Z<0?0:Z);const ne=ee?jH({zoomPanValues:f,noWheelClassName:z,d3Selection:v,d3Zoom:d,panOnScrollMode:X,panOnScrollSpeed:K,zoomOnPinch:M,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:o}):LH({noWheelClassName:z,preventScrolling:L,d3ZoomHandler:_});v.on("wheel.zoom",ne,{passive:!1});const pe=OH({zoomPanValues:f,onDraggingChange:c,onPanZoomStart:u});d.on("start",pe);const fe=BH({zoomPanValues:f,panOnDrag:q,onPaneContextMenu:!!F,onPanZoom:l,onTransformChange:re});d.on("zoom",fe);const ye=IH({zoomPanValues:f,panOnDrag:q,panOnScroll:Y,onPaneContextMenu:F,onPanZoomEnd:o,onDraggingChange:c});d.on("end",ye);const Ce=zH({zoomActivationKeyPressed:$,panOnDrag:q,zoomOnScroll:O,panOnScroll:Y,zoomOnDoubleClick:U,zoomOnPinch:M,userSelectionActive:P,noPanClassName:V,noWheelClassName:z,lib:Q,connectionInProgress:se});d.filter(Ce),U?v.on("dblclick.zoom",C):v.on("dblclick.zoom",null)}function y(){d.on("zoom",null)}async function x(z,V,F){const P=Ep(z),Y=d==null?void 0:d.constrain()(P,V,F);return Y&&await w(Y),Y}async function b(z,V){const F=Ep(z);return await w(F,V),F}function E(z){if(v){const V=Ep(z),F=v.property("__zoom");(F.k!==z.zoom||F.x!==z.x||F.y!==z.y)&&(d==null||d.transform(v,V,null,{sync:!0}))}}function R(){const z=v?c2(v.node()):{x:0,y:0,k:1};return{x:z.x,y:z.y,zoom:z.k}}async function N(z,V){return v?new Promise(F=>{d==null||d.interpolate((V==null?void 0:V.interpolate)==="linear"?$o:bu).scaleTo(kp(v,V==null?void 0:V.duration,V==null?void 0:V.ease,()=>F(!0)),z)}):!1}async function D(z,V){return v?new Promise(F=>{d==null||d.interpolate((V==null?void 0:V.interpolate)==="linear"?$o:bu).scaleBy(kp(v,V==null?void 0:V.duration,V==null?void 0:V.ease,()=>F(!0)),z)}):!1}function T(z){d==null||d.scaleExtent(z)}function j(z){d==null||d.translateExtent(z)}function B(z){const V=!Zn(z)||z<0?0:z;d==null||d.clickDistance(V)}return{update:S,destroy:y,setViewport:b,setViewportConstrained:x,getViewport:R,scaleTo:N,scaleBy:D,setScaleExtent:T,setTranslateExtent:j,syncViewport:E,setClickDistance:B}}var Ea;(function(e){e.Line="line",e.Handle="handle"})(Ea||(Ea={}));function FH({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:l}){const u=e-t,o=n-r,c=[u>0?1:u<0?-1:0,o>0?1:o<0?-1:0];return u&&a&&(c[0]=c[0]*-1),o&&l&&(c[1]=c[1]*-1),c}function bS(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:a}}function Er(e,t){return Math.max(0,t-e)}function kr(e,t){return Math.max(0,e-t)}function ou(e,t,n){return Math.max(0,t-e,e-n)}function SS(e,t){return e?!t:t}function PH(e,t,n,r,a,l,u,o){let{affectsX:c,affectsY:f}=t;const{isHorizontal:p,isVertical:d}=t,v=p&&d,{xSnapped:_,ySnapped:C}=n,{minWidth:w,maxWidth:S,minHeight:y,maxHeight:x}=r,{x:b,y:E,width:R,height:N,aspectRatio:D}=e;let T=Math.floor(p?_-e.pointerX:0),j=Math.floor(d?C-e.pointerY:0);const B=R+(c?-T:T),z=N+(f?-j:j),V=-l[0]*R,F=-l[1]*N;let P=ou(B,w,S),Y=ou(z,y,x);if(u){let K=0,L=0;c&&T<0?K=Er(b+T+V,u[0][0]):!c&&T>0&&(K=kr(b+B+V,u[1][0])),f&&j<0?L=Er(E+j+F,u[0][1]):!f&&j>0&&(L=kr(E+z+F,u[1][1])),P=Math.max(P,K),Y=Math.max(Y,L)}if(o){let K=0,L=0;c&&T>0?K=kr(b+T,o[0][0]):!c&&T<0&&(K=Er(b+B,o[1][0])),f&&j>0?L=kr(E+j,o[0][1]):!f&&j<0&&(L=Er(E+z,o[1][1])),P=Math.max(P,K),Y=Math.max(Y,L)}if(a){if(p){const K=ou(B/D,y,x)*D;if(P=Math.max(P,K),u){let L=0;!c&&!f||c&&!f&&v?L=kr(E+F+B/D,u[1][1])*D:L=Er(E+F+(c?T:-T)/D,u[0][1])*D,P=Math.max(P,L)}if(o){let L=0;!c&&!f||c&&!f&&v?L=Er(E+B/D,o[1][1])*D:L=kr(E+(c?T:-T)/D,o[0][1])*D,P=Math.max(P,L)}}if(d){const K=ou(z*D,w,S)/D;if(Y=Math.max(Y,K),u){let L=0;!c&&!f||f&&!c&&v?L=kr(b+z*D+V,u[1][0])/D:L=Er(b+(f?j:-j)*D+V,u[0][0])/D,Y=Math.max(Y,L)}if(o){let L=0;!c&&!f||f&&!c&&v?L=Er(b+z*D,o[1][0])/D:L=kr(b+(f?j:-j)*D,o[0][0])/D,Y=Math.max(Y,L)}}}j=j+(j<0?Y:-Y),T=T+(T<0?P:-P),a&&(v?B>z*D?j=(SS(c,f)?-T:T)/D:T=(SS(c,f)?-j:j)*D:p?(j=T/D,f=c):(T=j*D,c=f));const q=c?b+T:b,X=f?E+j:E;return{width:R+(c?-T:T),height:N+(f?-j:j),x:l[0]*T*(c?-1:1)+q,y:l[1]*j*(f?-1:1)+X}}const F2={width:0,height:0,x:0,y:0},$H={...F2,pointerX:0,pointerY:0,aspectRatio:1};function UH(e,t,n){const r=t.position.x+e.position.x,a=t.position.y+e.position.y,l=e.measured.width??0,u=e.measured.height??0,o=n[0]*l,c=n[1]*u;return[[r-o,a-c],[r+l-o,a+u-c]]}function GH({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const l=An(e);let u={controlDirection:bS("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:f,boundaries:p,keepAspectRatio:d,resizeDirection:v,onResizeStart:_,onResize:C,onResizeEnd:w,shouldResize:S}){let y={...F2},x={...$H};u={boundaries:p,resizeDirection:v,keepAspectRatio:d,controlDirection:bS(f)};let b,E=null,R=[],N,D,T,j=!1;const B=XC().on("start",z=>{const{nodeLookup:V,transform:F,snapGrid:P,snapToGrid:Y,nodeOrigin:q,paneDomNode:X}=n();if(b=V.get(t),!b)return;E=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:K,ySnapped:L}=Uo(z.sourceEvent,{transform:F,snapGrid:P,snapToGrid:Y,containerBounds:E});y={width:b.measured.width??0,height:b.measured.height??0,x:b.position.x??0,y:b.position.y??0},x={...y,pointerX:K,pointerY:L,aspectRatio:y.width/y.height},N=void 0,D=ds(b.extent)?b.extent:void 0,b.parentId&&(b.extent==="parent"||b.expandParent)&&(N=V.get(b.parentId)),N&&b.extent==="parent"&&(D=[[0,0],[N.measured.width,N.measured.height]]),R=[],T=void 0;for(const[M,O]of V)if(O.parentId===t&&(R.push({id:M,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const U=UH(O,b,O.origin??q);T?T=[[Math.min(U[0][0],T[0][0]),Math.min(U[0][1],T[0][1])],[Math.max(U[1][0],T[1][0]),Math.max(U[1][1],T[1][1])]]:T=U}_==null||_(z,{...y})}).on("drag",z=>{const{transform:V,snapGrid:F,snapToGrid:P,nodeOrigin:Y}=n(),q=Uo(z.sourceEvent,{transform:V,snapGrid:F,snapToGrid:P,containerBounds:E}),X=[];if(!b)return;const{x:K,y:L,width:M,height:O}=y,U={},$=b.origin??Y,{width:Q,height:re,x:se,y:Z}=PH(x,u.controlDirection,q,u.boundaries,u.keepAspectRatio,$,D,T),H=Q!==M,ee=re!==O,ne=se!==K&&H,pe=Z!==L&ⅇif(!ne&&!pe&&!H&&!ee)return;if((ne||pe||$[0]===1||$[1]===1)&&(U.x=ne?se:y.x,U.y=pe?Z:y.y,y.x=U.x,y.y=U.y,R.length>0)){const Ee=se-K,Ne=Z-L;for(const we of R)we.position={x:we.position.x-Ee+$[0]*(Q-M),y:we.position.y-Ne+$[1]*(re-O)},X.push(we)}if((H||ee)&&(U.width=H&&(!u.resizeDirection||u.resizeDirection==="horizontal")?Q:y.width,U.height=ee&&(!u.resizeDirection||u.resizeDirection==="vertical")?re:y.height,y.width=U.width,y.height=U.height),N&&b.expandParent){const Ee=$[0]*(U.width??0);U.x&&U.x{j&&(w==null||w(z,{...y}),a==null||a({...y}),j=!1)});l.call(B)}function c(){l.on(".drag",null)}return{update:o,destroy:c}}var Ap={exports:{}},Np={},Tp={exports:{}},Rp={};/** +Its experiments, runs and chats are removed from orx. The GitHub repo (${f.githubOwner}/${f.githubRepo}) is kept.`)){o(f.id);try{await oT(f.id),r(f.id)}catch(d){window.alert(d instanceof Error?d.message:String(d))}finally{o(null)}}}return g.jsxs("div",{className:"home",children:[g.jsxs("div",{className:"home-inner",children:[g.jsx("div",{className:"home-brand",children:g.jsx(fa,{})}),g.jsxs("div",{className:"home-head",children:[g.jsx("h2",{children:"Projects"}),g.jsxs("button",{className:"btn sm",onClick:()=>l(!0),children:[g.jsx(Rg,{size:13})," New project"]})]}),g.jsx("div",{className:"home-list",children:e.length===0?g.jsx("div",{className:"changes-note",children:"No projects yet — create one to get started."}):[...e].sort((f,p)=>p.updatedAt-f.updatedAt).map(f=>g.jsxs("div",{className:"project-card",role:"button",tabIndex:0,onClick:()=>t(f.id),onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&t(f.id)},children:[g.jsx("span",{className:"name",children:f.name}),g.jsxs("span",{className:"repo mono",children:[f.githubOwner,"/",f.githubRepo," · ",f.baselineBranch]}),f.paperId&&g.jsxs("span",{className:"paper mono",children:["arXiv ",f.paperId]}),g.jsxs("span",{className:"time",children:["created ",Na(f.createdAt)]}),g.jsx("button",{className:"project-delete",title:`Delete ${f.name}`,disabled:u===f.id,onClick:p=>{p.stopPropagation(),c(f)},children:g.jsx(jg,{size:14})})]},f.id))})]}),a&&g.jsx("div",{className:"modal-backdrop",onClick:()=>l(!1),children:g.jsxs("div",{className:"modal",onClick:f=>f.stopPropagation(),children:[g.jsx("h2",{children:"New project"}),g.jsx(sI,{onCancel:()=>l(!1),onCreated:f=>{l(!1),n(f)}})]})})]})}function aI(e){const t=_x(e.backend);return t?[t,yx(e.backend)].filter(Boolean).join(" · "):"—"}function oI({runs:e,experiments:t,onOpen:n,onOpenChanges:r,onCancel:a}){const l=new Map(t.map(o=>[o.id,o.slug])),u=[...e].sort((o,c)=>c.createdAt-o.createdAt);return u.length===0?g.jsx("div",{className:"empty-state",children:g.jsx("p",{children:"No runs yet."})}):g.jsx("div",{className:"runs-table-wrap",children:g.jsxs("table",{className:"runs-table",children:[g.jsx("thead",{children:g.jsxs("tr",{children:[g.jsx("th",{children:"Run"}),g.jsx("th",{children:"Experiment"}),g.jsx("th",{children:"Status"}),g.jsx("th",{children:"Backend"}),g.jsx("th",{children:"Commit"}),g.jsx("th",{children:"Started"}),g.jsx("th",{children:"Exit"}),g.jsx("th",{})]})}),g.jsx("tbody",{children:u.map(o=>{const c=o.status==="running"||o.status==="starting";return g.jsxs("tr",{className:"clickable",onClick:()=>n(o),children:[g.jsx("td",{className:"mono",children:Op(o.id)}),g.jsx("td",{className:"mono",children:l.get(o.experimentId)??Op(o.experimentId)}),g.jsx("td",{children:g.jsx(Ko,{status:o.status})}),g.jsx("td",{className:"mono",children:aI(o)}),g.jsx("td",{className:"mono",children:o.commitSha?o.commitSha.slice(0,7):"—"}),g.jsx("td",{children:Na(o.createdAt)}),g.jsx("td",{className:"mono",children:o.exitCode??"—"}),g.jsx("td",{children:g.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4},children:[g.jsx("button",{className:"icon-btn",title:"Open changes",onClick:f=>{f.stopPropagation(),r(o.experimentId)},children:g.jsx(Ku,{size:14})}),c&&g.jsx("button",{className:"btn sm danger",onClick:f=>{f.stopPropagation(),a(o.id)},children:"Cancel"})]})})]},o.id)})})]})})}var lI=ex();function cI(e){const[t,n]=G.useState(null),[,r]=G.useState({});return t==null||t.setTracked(e),G.useEffect(()=>{const a=new uI(()=>r({}));return a.setTracked(e),n(a),()=>a.dispose()},[]),(t==null?void 0:t.bounds)??null}var ti,ug,hg,fg;class uI{constructor(t){zy(this,ti);Qr(this,"selectors",new Set);Qr(this,"elements",new Set);Qr(this,"onSizeChange",()=>Jr(this,ti,ug).call(this));Qr(this,"resizeObs",new ResizeObserver(this.onSizeChange));Qr(this,"mutationObs",new MutationObserver(t=>this.onMutation(t)));Qr(this,"bounds",null);this.onBoundsChange=t,window.addEventListener("resize",this.onSizeChange),document.addEventListener("scroll",this.onSizeChange,!0),this.mutationObs.observe(document.body,{childList:!0,subtree:!0})}dispose(){this.resizeObs.disconnect(),this.mutationObs.disconnect(),window.removeEventListener("resize",this.onSizeChange),document.removeEventListener("scroll",this.onSizeChange,!0)}setTracked(t){const n=new Set(t),r=[...n].filter(u=>!this.selectors.has(u)),a=[...this.selectors].filter(u=>!n.has(u));let l=!1;if(r.length>0){const u=r.map(c=>`[data-onboarding="${c}"]`).join(","),o=document.body.querySelectorAll(u);o.forEach(c=>{this.elements.add(c),this.resizeObs.observe(c)}),l||(l=o.length>0)}if(a.length>0){const u=a.map(c=>`[data-onboarding="${c}"]`).join(","),o=document.body.querySelectorAll(u);o.forEach(c=>{this.elements.delete(c),this.resizeObs.unobserve(c)}),l||(l=o.length>0)}l&&Jr(this,ti,hg).call(this),this.selectors=n}onMutation(t){if(this.selectors.size===0)return;const n=Array.from(this.selectors,a=>`[data-onboarding="${a}"]`).join(",");let r=!1;for(const a of t){for(const l of a.addedNodes)l instanceof Element&&(l.matches(n)&&(this.elements.add(l),this.resizeObs.observe(l),r=!0),l.querySelectorAll(n).forEach(u=>{this.elements.add(u),this.resizeObs.observe(u),r=!0}));for(const l of a.removedNodes)l instanceof Element&&(l.matches(n)&&(this.elements.delete(l),this.resizeObs.unobserve(l),r=!0),l.querySelectorAll(n).forEach(u=>{this.elements.delete(u),this.resizeObs.unobserve(u),r=!0}))}r&&Jr(this,ti,ug).call(this)}}ti=new WeakSet,ug=function(){const t=Jr(this,ti,fg).call(this);Jr(this,ti,hg).call(this),t!==Jr(this,ti,fg).call(this)&&this.onBoundsChange()},hg=function(){if(this.elements.size===0){this.bounds=null;return}const t=Array.from(this.elements,u=>u.getBoundingClientRect()).filter(u=>u.width>0&&u.height>0);if(t.length===0){this.bounds=null;return}const n=Math.min(...t.map(u=>u.left)),r=Math.min(...t.map(u=>u.top)),a=Math.max(...t.map(u=>u.right)),l=Math.max(...t.map(u=>u.bottom));this.bounds={x:n,y:r,width:a-n,height:l-r}},fg=function(){return this.bounds?[this.bounds.x,this.bounds.y,this.bounds.width,this.bounds.height].join(","):"null"};function hI(){const[e,t]=G.useState(0),[n,r]=G.useState(0);return{ref:G.useCallback(l=>{if(!l)return;function u(){t(l.offsetWidth),r(l.offsetHeight)}const o=new ResizeObserver(u),c=new MutationObserver(u);return o.observe(l),c.observe(l,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),u(),()=>{o.disconnect(),c.disconnect()}},[]),offsetWidth:e,offsetHeight:n}}const tu=8;function fI(e,t){const{offsetWidth:n,offsetHeight:r}=t,[{viewHeight:a,viewWidth:l},u]=G.useState({viewWidth:0,viewHeight:0});G.useEffect(()=>{function p(){u({viewWidth:window.innerWidth,viewHeight:window.innerHeight})}return window.addEventListener("resize",p),p(),()=>window.removeEventListener("resize",p)},[]);let o=0,c=0,f=0;if(e){const{distance:p}=e;switch(e.anchor){case"left":o=e.x-n-p,c=e.y+e.height/2-r/2;break;case"right":o=e.x+e.width+p,c=e.y+e.height/2-r/2;break;case"below":o=e.x+e.width/2-n/2,c=e.y+e.height+p;break;case"above":o=e.x+e.width/2-n/2,c=e.y-r-p;break}const d=o,v=c;o=Math.min(Math.max(o,tu),l-n-tu),c=Math.min(Math.max(c,tu),a-r-tu),f=e.anchor==="left"||e.anchor==="right"?v-c:d-o}return{x:o,y:c,arrowAdjustment:f}}const Gb="orx:tour-done",Nr=8,dI=20,Ou=[{focus:null,anchor:null,title:"Welcome to OpenResearch",description:"This is your research workspace: agents on the left, conversation in the middle, experiments on the right. Here's a quick look around — about thirty seconds."},{focus:["composer"],anchor:"above",title:"Talk to your research agent",description:"This is how you communicate with research agents: describe the experiment you want, and the agent plans it, writes the code, and runs it. Type / for skills like /reproduce-paper."},{focus:["model-picker"],anchor:"above",title:"Pick your model",description:"Choose a model from any harness you've connected — Claude Code, Codex, or OpenCode. New sessions start with whatever you pick here; each session keeps its harness for life."},{focus:["nav-files"],anchor:"right",title:"Reports and outputs",description:"The agent writes its reports, figures, and other outputs here — and anything you drop in is visible to it too. Check Files after a run to see what came back."},{focus:["nav-compute"],anchor:"right",title:"Configure compute",description:"This is where compute is configured. Point runs at this machine, Modal, SSH boxes, Kubernetes, or Slurm — set it up once and agents pick the right hardware per run."},{focus:["experiments"],anchor:"left",title:"Follow every experiment",description:"Runs land here as a tree of experiments — branch variants off a baseline, compare results, and open any run's terminal or code changes in a tab."},{focus:["new-session"],anchor:"right",title:"Start a session",description:"Each session is its own agent working in its own branch, so you can run several lines of inquiry in parallel. That's the tour — ask for your first experiment whenever you're ready."}];function pI({onClose:e}){const[t,n]=G.useState(0),r=Ou[t],a=cI(r.focus??[]);G.useEffect(()=>{function u(o){o.key==="Escape"&&(o.preventDefault(),o.stopPropagation(),e())}return document.addEventListener("keydown",u,!0),()=>document.removeEventListener("keydown",u,!0)},[e]);const l=a?{left:a.x-Nr,top:a.y-Nr,width:a.width+Nr*2,height:a.height+Nr*2}:null;return lI.createPortal(g.jsxs("div",{className:"tour-overlay",children:[l?g.jsxs(g.Fragment,{children:[g.jsx("div",{className:"tour-spotlight",style:l}),g.jsx("div",{className:"tour-ring",style:l})]}):g.jsx("div",{className:"tour-dim"}),g.jsx(gI,{step:r,bounds:a,index:t,onBack:()=>n(u=>Math.max(0,u-1)),onNext:()=>t+1>=Ou.length?e():n(t+1),onClose:e})]}),document.body)}function gI({step:e,bounds:t,index:n,onBack:r,onNext:a,onClose:l}){const u=hI(),o=fI(t&&e.anchor?{x:t.x-Nr,y:t.y-Nr,width:t.width+Nr*2,height:t.height+Nr*2,anchor:e.anchor,distance:dI}:null,u),c=e.anchor!=null&&t!=null&&o.x>0,f=n+1===Ou.length;return g.jsxs("div",{ref:u.ref,className:`tour-card ${c?"":"centered"}`,style:c?{left:o.x,top:o.y}:void 0,children:[c&&e.anchor&&g.jsx(mI,{anchor:e.anchor,adjustment:o.arrowAdjustment}),g.jsx("button",{className:"icon-btn tour-close",title:"Skip tour",onClick:l,children:g.jsx(_a,{size:15})}),g.jsx("h3",{children:e.title}),g.jsx("p",{children:e.description}),g.jsxs("div",{className:"tour-footer",children:[g.jsx("div",{className:"tour-footer-side",children:n>0&&g.jsx("button",{className:"btn ghost sm",onClick:r,children:"Back"})}),g.jsxs("span",{className:"tour-count",children:[n+1," / ",Ou.length]}),g.jsx("div",{className:"tour-footer-side end",children:g.jsx("button",{className:"btn primary sm",onClick:a,children:f?"Done":"Next"})})]})]})}function mI({anchor:e,adjustment:t}){const n=e==="above"||e==="below"?`${t}px 0`:`0 ${t}px`;return g.jsx("div",{className:`tour-arrow ${e}`,style:{translate:n}})}function $t(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function wh(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}bu.prototype=wh.prototype={constructor:bu,on:function(e,t){var n=this._,r=_I(e+"",n),a,l=-1,u=r.length;if(arguments.length<2){for(;++l0)for(var n=new Array(a),r=0,a,l;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Vb.hasOwnProperty(t)?{space:Vb[t],local:e}:e}function bI(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===dg&&t.documentElement.namespaceURI===dg?t.createElement(e):t.createElementNS(n,e)}}function SI(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function BC(e){var t=Ch(e);return(t.local?SI:bI)(t)}function xI(){}function Im(e){return e==null?xI:function(){return this.querySelector(e)}}function wI(e){typeof e!="function"&&(e=Im(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a=b&&(b=x+1);!(D=S[b])&&++b=0;)(u=r[a])&&(l&&u.compareDocumentPosition(l)^4&&l.parentNode.insertBefore(u,l),l=u);return this}function YI(e){e||(e=XI);function t(d,v){return d&&v?e(d.__data__,v.__data__):!d-!v}for(var n=this._groups,r=n.length,a=new Array(r),l=0;lt?1:e>=t?0:NaN}function KI(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function ZI(){return Array.from(this)}function QI(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?c7:typeof t=="function"?h7:u7)(e,t,n??"")):Sa(this.node(),e)}function Sa(e,t){return e.style.getPropertyValue(t)||PC(e).getComputedStyle(e,null).getPropertyValue(t)}function d7(e){return function(){delete this[e]}}function p7(e,t){return function(){this[e]=t}}function g7(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function m7(e,t){return arguments.length>1?this.each((t==null?d7:typeof t=="function"?g7:p7)(e,t)):this.node()[e]}function $C(e){return e.trim().split(/^|\s+/)}function zm(e){return e.classList||new UC(e)}function UC(e){this._node=e,this._names=$C(e.getAttribute("class")||"")}UC.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function GC(e,t){for(var n=zm(e),r=-1,a=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function G7(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,l;n()=>e;function pg(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:l,x:u,y:o,dx:c,dy:f,dispatch:p}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:l,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:o,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:p}})}pg.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function e9(e){return!e.ctrlKey&&!e.button}function t9(){return this.parentNode}function n9(e,t){return t??{x:e.x,y:e.y}}function i9(){return navigator.maxTouchPoints||"ontouchstart"in this}function KC(){var e=e9,t=t9,n=n9,r=i9,a={},l=wh("start","drag","end"),u=0,o,c,f,p,d=0;function v(E){E.on("mousedown.drag",_).filter(r).on("touchstart.drag",S).on("touchmove.drag",y,J7).on("touchend.drag touchcancel.drag",x).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function _(E,D){if(!(p||!e.call(this,E,D))){var N=b(this,t.call(this,E,D),E,D,"mouse");N&&(An(E.view).on("mousemove.drag",C,tl).on("mouseup.drag",w,tl),YC(E.view),Sp(E),f=!1,o=E.clientX,c=E.clientY,N("start",E))}}function C(E){if(ma(E),!f){var D=E.clientX-o,N=E.clientY-c;f=D*D+N*N>d}a.mouse("drag",E)}function w(E){An(E.view).on("mousemove.drag mouseup.drag",null),XC(E.view,f),ma(E),a.mouse("end",E)}function S(E,D){if(e.call(this,E,D)){var N=E.changedTouches,R=t.call(this,E,D),T=N.length,j,B;for(j=0;j>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?iu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?iu(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=s9.exec(e))?new mn(t[1],t[2],t[3],1):(t=a9.exec(e))?new mn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=o9.exec(e))?iu(t[1],t[2],t[3],t[4]):(t=l9.exec(e))?iu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=c9.exec(e))?Jb(t[1],t[2]/100,t[3]/100,1):(t=u9.exec(e))?Jb(t[1],t[2]/100,t[3]/100,t[4]):Wb.hasOwnProperty(e)?Kb(Wb[e]):e==="transparent"?new mn(NaN,NaN,NaN,0):null}function Kb(e){return new mn(e>>16&255,e>>8&255,e&255,1)}function iu(e,t,n,r){return r<=0&&(e=t=n=NaN),new mn(e,t,n,r)}function d9(e){return e instanceof _l||(e=us(e)),e?(e=e.rgb(),new mn(e.r,e.g,e.b,e.opacity)):new mn}function gg(e,t,n,r){return arguments.length===1?d9(e):new mn(e,t,n,r??1)}function mn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Hm(mn,gg,ZC(_l,{brighter(e){return e=e==null?Iu:Math.pow(Iu,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?nl:Math.pow(nl,e),new mn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new mn(as(this.r),as(this.g),as(this.b),zu(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Zb,formatHex:Zb,formatHex8:p9,formatRgb:Qb,toString:Qb}));function Zb(){return`#${rs(this.r)}${rs(this.g)}${rs(this.b)}`}function p9(){return`#${rs(this.r)}${rs(this.g)}${rs(this.b)}${rs((isNaN(this.opacity)?1:this.opacity)*255)}`}function Qb(){const e=zu(this.opacity);return`${e===1?"rgb(":"rgba("}${as(this.r)}, ${as(this.g)}, ${as(this.b)}${e===1?")":`, ${e})`}`}function zu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function as(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function rs(e){return e=as(e),(e<16?"0":"")+e.toString(16)}function Jb(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Kn(e,t,n,r)}function QC(e){if(e instanceof Kn)return new Kn(e.h,e.s,e.l,e.opacity);if(e instanceof _l||(e=us(e)),!e)return new Kn;if(e instanceof Kn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),l=Math.max(t,n,r),u=NaN,o=l-a,c=(l+a)/2;return o?(t===l?u=(n-r)/o+(n0&&c<1?0:u,new Kn(u,o,c,e.opacity)}function g9(e,t,n,r){return arguments.length===1?QC(e):new Kn(e,t,n,r??1)}function Kn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Hm(Kn,g9,ZC(_l,{brighter(e){return e=e==null?Iu:Math.pow(Iu,e),new Kn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?nl:Math.pow(nl,e),new Kn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new mn(xp(e>=240?e-240:e+120,a,r),xp(e,a,r),xp(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Kn(eS(this.h),ru(this.s),ru(this.l),zu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=zu(this.opacity);return`${e===1?"hsl(":"hsla("}${eS(this.h)}, ${ru(this.s)*100}%, ${ru(this.l)*100}%${e===1?")":`, ${e})`}`}}));function eS(e){return e=(e||0)%360,e<0?e+360:e}function ru(e){return Math.max(0,Math.min(1,e||0))}function xp(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Fm=e=>()=>e;function m9(e,t){return function(n){return e+n*t}}function v9(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function _9(e){return(e=+e)==1?JC:function(t,n){return n-t?v9(t,n,e):Fm(isNaN(t)?n:t)}}function JC(e,t){var n=t-e;return n?m9(e,n):Fm(isNaN(e)?t:e)}const Hu=(function e(t){var n=_9(t);function r(a,l){var u=n((a=gg(a)).r,(l=gg(l)).r),o=n(a.g,l.g),c=n(a.b,l.b),f=JC(a.opacity,l.opacity);return function(p){return a.r=u(p),a.g=o(p),a.b=c(p),a.opacity=f(p),a+""}}return r.gamma=e,r})(1);function y9(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(l){for(a=0;an&&(l=t.slice(n,l),o[u]?o[u]+=l:o[++u]=l),(r=r[0])===(a=a[0])?o[u]?o[u]+=a:o[++u]=a:(o[++u]=null,c.push({i:u,x:ui(r,a)})),n=wp.lastIndex;return n180?p+=360:p-f>180&&(f+=360),v.push({i:d.push(a(d)+"rotate(",null,r)-2,x:ui(f,p)})):p&&d.push(a(d)+"rotate("+p+r)}function o(f,p,d,v){f!==p?v.push({i:d.push(a(d)+"skewX(",null,r)-2,x:ui(f,p)}):p&&d.push(a(d)+"skewX("+p+r)}function c(f,p,d,v,_,C){if(f!==d||p!==v){var w=_.push(a(_)+"scale(",null,",",null,")");C.push({i:w-4,x:ui(f,d)},{i:w-2,x:ui(p,v)})}else(d!==1||v!==1)&&_.push(a(_)+"scale("+d+","+v+")")}return function(f,p){var d=[],v=[];return f=e(f),p=e(p),l(f.translateX,f.translateY,p.translateX,p.translateY,d,v),u(f.rotate,p.rotate,d,v),o(f.skewX,p.skewX,d,v),c(f.scaleX,f.scaleY,p.scaleX,p.scaleY,d,v),f=p=null,function(_){for(var C=-1,w=v.length,S;++C=0&&e._call.call(void 0,t),e=e._next;--xa}function iS(){hs=(Pu=rl.now())+Eh,xa=Io=0;try{L9()}finally{xa=0,B9(),hs=0}}function O9(){var e=rl.now(),t=e-Pu;t>i2&&(Eh-=t,Pu=e)}function B9(){for(var e,t=Fu,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Fu=n);zo=e,_g(r)}function _g(e){if(!xa){Io&&(Io=clearTimeout(Io));var t=e-hs;t>24?(e<1/0&&(Io=setTimeout(iS,e-rl.now()-Eh)),Oo&&(Oo=clearInterval(Oo))):(Oo||(Pu=rl.now(),Oo=setInterval(O9,i2)),xa=1,r2(iS))}}function rS(e,t,n){var r=new $u;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var I9=wh("start","end","cancel","interrupt"),z9=[],a2=0,sS=1,yg=2,xu=3,aS=4,bg=5,wu=6;function kh(e,t,n,r,a,l){var u=e.__transition;if(!u)e.__transition={};else if(n in u)return;H9(e,n,{name:t,index:r,group:a,on:I9,tween:z9,time:l.time,delay:l.delay,duration:l.duration,ease:l.ease,timer:null,state:a2})}function $m(e,t){var n=ni(e,t);if(n.state>a2)throw new Error("too late; already scheduled");return n}function gi(e,t){var n=ni(e,t);if(n.state>xu)throw new Error("too late; already running");return n}function ni(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function H9(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=s2(l,0,n.time);function l(f){n.state=sS,n.timer.restart(u,n.delay,n.time),n.delay<=f&&u(f-n.delay)}function u(f){var p,d,v,_;if(n.state!==sS)return c();for(p in r)if(_=r[p],_.name===n.name){if(_.state===xu)return rS(u);_.state===aS?(_.state=wu,_.timer.stop(),_.on.call("interrupt",e,e.__data__,_.index,_.group),delete r[p]):+pyg&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function gz(e,t,n){var r,a,l=pz(t)?$m:gi;return function(){var u=l(this,e),o=u.on;o!==r&&(a=(r=o).copy()).on(t,n),u.on=a}}function mz(e,t){var n=this._id;return arguments.length<2?ni(this.node(),n).on.on(e):this.each(gz(n,e,t))}function vz(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function _z(){return this.on("end.remove",vz(this._id))}function yz(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Im(e));for(var r=this._groups,a=r.length,l=new Array(a),u=0;u()=>e;function Gz(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:a}})}function $i(e,t,n){this.k=e,this.x=t,this.y=n}$i.prototype={constructor:$i,scale:function(e){return e===1?this:new $i(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new $i(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ah=new $i(1,0,0);u2.prototype=$i.prototype;function u2(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ah;return e.__zoom}function Cp(e){e.stopImmediatePropagation()}function Bo(e){e.preventDefault(),e.stopImmediatePropagation()}function qz(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Vz(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function oS(){return this.__zoom||Ah}function Wz(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Yz(){return navigator.maxTouchPoints||"ontouchstart"in this}function Xz(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],l=e.invertY(t[0][1])-n[0][1],u=e.invertY(t[1][1])-n[1][1];return e.translate(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),u>l?(l+u)/2:Math.min(0,l)||Math.max(0,u))}function h2(){var e=qz,t=Vz,n=Xz,r=Wz,a=Yz,l=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],o=250,c=Su,f=wh("start","zoom","end"),p,d,v,_=500,C=150,w=0,S=10;function y(P){P.property("__zoom",oS).on("wheel.zoom",T,{passive:!1}).on("mousedown.zoom",j).on("dblclick.zoom",B).filter(a).on("touchstart.zoom",z).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",F).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(P,W,q,X){var K=P.selection?P.selection():P;K.property("__zoom",oS),P!==K?D(P,W,q,X):K.interrupt().each(function(){N(this,arguments).event(X).start().zoom(null,typeof W=="function"?W.apply(this,arguments):W).end()})},y.scaleBy=function(P,W,q,X){y.scaleTo(P,function(){var K=this.__zoom.k,L=typeof W=="function"?W.apply(this,arguments):W;return K*L},q,X)},y.scaleTo=function(P,W,q,X){y.transform(P,function(){var K=t.apply(this,arguments),L=this.__zoom,M=q==null?E(K):typeof q=="function"?q.apply(this,arguments):q,O=L.invert(M),U=typeof W=="function"?W.apply(this,arguments):W;return n(b(x(L,U),M,O),K,u)},q,X)},y.translateBy=function(P,W,q,X){y.transform(P,function(){return n(this.__zoom.translate(typeof W=="function"?W.apply(this,arguments):W,typeof q=="function"?q.apply(this,arguments):q),t.apply(this,arguments),u)},null,X)},y.translateTo=function(P,W,q,X,K){y.transform(P,function(){var L=t.apply(this,arguments),M=this.__zoom,O=X==null?E(L):typeof X=="function"?X.apply(this,arguments):X;return n(Ah.translate(O[0],O[1]).scale(M.k).translate(typeof W=="function"?-W.apply(this,arguments):-W,typeof q=="function"?-q.apply(this,arguments):-q),L,u)},X,K)};function x(P,W){return W=Math.max(l[0],Math.min(l[1],W)),W===P.k?P:new $i(W,P.x,P.y)}function b(P,W,q){var X=W[0]-q[0]*P.k,K=W[1]-q[1]*P.k;return X===P.x&&K===P.y?P:new $i(P.k,X,K)}function E(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function D(P,W,q,X){P.on("start.zoom",function(){N(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(X).end()}).tween("zoom",function(){var K=this,L=arguments,M=N(K,L).event(X),O=t.apply(K,L),U=q==null?E(O):typeof q=="function"?q.apply(K,L):q,$=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),Q=K.__zoom,re=typeof W=="function"?W.apply(K,L):W,se=c(Q.invert(U).concat($/Q.k),re.invert(U).concat($/re.k));return function(Z){if(Z===1)Z=re;else{var H=se(Z),ee=$/H[2];Z=new $i(ee,U[0]-H[0]*ee,U[1]-H[1]*ee)}M.zoom(null,Z)}})}function N(P,W,q){return!q&&P.__zooming||new R(P,W)}function R(P,W){this.that=P,this.args=W,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,W),this.taps=0}R.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,W){return this.mouse&&P!=="mouse"&&(this.mouse[1]=W.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=W.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=W.invert(this.touch1[0])),this.that.__zoom=W,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var W=An(this.that).datum();f.call(P,this.that,new Gz(P,{sourceEvent:this.sourceEvent,target:y,transform:this.that.__zoom,dispatch:f}),W)}};function T(P,...W){if(!e.apply(this,arguments))return;var q=N(this,W).event(P),X=this.__zoom,K=Math.max(l[0],Math.min(l[1],X.k*Math.pow(2,r.apply(this,arguments)))),L=Xn(P);if(q.wheel)(q.mouse[0][0]!==L[0]||q.mouse[0][1]!==L[1])&&(q.mouse[1]=X.invert(q.mouse[0]=L)),clearTimeout(q.wheel);else{if(X.k===K)return;q.mouse=[L,X.invert(L)],Cu(this),q.start()}Bo(P),q.wheel=setTimeout(M,C),q.zoom("mouse",n(b(x(X,K),q.mouse[0],q.mouse[1]),q.extent,u));function M(){q.wheel=null,q.end()}}function j(P,...W){if(v||!e.apply(this,arguments))return;var q=P.currentTarget,X=N(this,W,!0).event(P),K=An(P.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",$,!0),L=Xn(P,q),M=P.clientX,O=P.clientY;YC(P.view),Cp(P),X.mouse=[L,this.__zoom.invert(L)],Cu(this),X.start();function U(Q){if(Bo(Q),!X.moved){var re=Q.clientX-M,se=Q.clientY-O;X.moved=re*re+se*se>w}X.event(Q).zoom("mouse",n(b(X.that.__zoom,X.mouse[0]=Xn(Q,q),X.mouse[1]),X.extent,u))}function $(Q){K.on("mousemove.zoom mouseup.zoom",null),XC(Q.view,X.moved),Bo(Q),X.event(Q).end()}}function B(P,...W){if(e.apply(this,arguments)){var q=this.__zoom,X=Xn(P.changedTouches?P.changedTouches[0]:P,this),K=q.invert(X),L=q.k*(P.shiftKey?.5:2),M=n(b(x(q,L),X,K),t.apply(this,W),u);Bo(P),o>0?An(this).transition().duration(o).call(D,M,X,P):An(this).call(y.transform,M,X,P)}}function z(P,...W){if(e.apply(this,arguments)){var q=P.touches,X=q.length,K=N(this,W,P.changedTouches.length===X).event(P),L,M,O,U;for(Cp(P),M=0;M`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},sl=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],f2=["Enter"," ","Escape"],d2={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var wa;(function(e){e.Strict="strict",e.Loose="loose"})(wa||(wa={}));var os;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(os||(os={}));var al;(function(e){e.Partial="partial",e.Full="full"})(al||(al={}));const p2={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Ar;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ar||(Ar={}));var Uu;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Uu||(Uu={}));var je;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(je||(je={}));const lS={[je.Left]:je.Right,[je.Right]:je.Left,[je.Top]:je.Bottom,[je.Bottom]:je.Top};function g2(e){return e===null?null:e?"valid":"invalid"}const m2=e=>"id"in e&&"source"in e&&"target"in e,Kz=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Gm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),yl=(e,t=[0,0])=>{const{width:n,height:r}=Yi(e),a=e.origin??t,l=n*a[0],u=r*a[1];return{x:e.position.x-l,y:e.position.y-u}},Zz=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,a)=>{const l=typeof a=="string";let u=!t.nodeLookup&&!l?a:void 0;t.nodeLookup&&(u=l?t.nodeLookup.get(a):Gm(a)?a:t.nodeLookup.get(a.id));const o=u?Gu(u,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Nh(r,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Th(n)},bl=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=Nh(n,Gu(a)),r=!0)}),r?Th(n):{x:0,y:0,width:0,height:0}},qm=(e,t,[n,r,a]=[0,0,1],l=!1,u=!1)=>{const o=(t.x-n)/a,c=(t.y-r)/a,f=t.width/a,p=t.height/a,d=[];for(const v of e.values()){const{measured:_,selectable:C=!0,hidden:w=!1}=v;if(u&&!C||w)continue;const S=_.width??v.width??v.initialWidth??0,y=_.height??v.height??v.initialHeight??0,{x,y:b}=v.internals.positionAbsolute,E=b2(o,c,f,p,x,b,S,y),D=S*y,N=l&&E>0;(!v.internals.handleBounds||N||E>=D||v.dragging)&&d.push(v)}return d},Qz=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Jz(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!a.hidden)&&(!r||r.has(a.id))&&n.set(a.id,a)}),n}async function eH({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:l},u){if(e.size===0)return!0;const o=Jz(e,u),c=bl(o),f=Wm(c,t,n,(u==null?void 0:u.minZoom)??a,(u==null?void 0:u.maxZoom)??l,(u==null?void 0:u.padding)??.1);return await r.setViewport(f,{duration:u==null?void 0:u.duration,ease:u==null?void 0:u.ease,interpolate:u==null?void 0:u.interpolate}),!0}function v2({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:a,onError:l}){const u=n.get(e),o=u.parentId?n.get(u.parentId):void 0,{x:c,y:f}=o?o.internals.positionAbsolute:{x:0,y:0},p=u.origin??r;let d=u.extent||a;if(u.extent==="parent"&&!u.expandParent)if(!o)l==null||l("005",ei.error005());else{const _=o.measured.width,C=o.measured.height;_&&C&&(d=[[c,f],[c+_,f+C]])}else o&&ds(u.extent)&&(d=[[u.extent[0][0]+c,u.extent[0][1]+f],[u.extent[1][0]+c,u.extent[1][1]+f]]);const v=ds(d)?fs(t,d,u.measured):t;return(u.measured.width===void 0||u.measured.height===void 0)&&(l==null||l("015",ei.error015())),{position:{x:v.x-c+(u.measured.width??0)*p[0],y:v.y-f+(u.measured.height??0)*p[1]},positionAbsolute:v}}async function tH({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:a}){const l=new Set(e.map(v=>v.id)),u=[];for(const v of n){if(v.deletable===!1)continue;const _=l.has(v.id),C=!_&&v.parentId&&u.find(w=>w.id===v.parentId);(_||C)&&u.push(v)}const o=new Set(t.map(v=>v.id)),c=r.filter(v=>v.deletable!==!1),p=Qz(u,c);for(const v of c)o.has(v.id)&&!p.find(C=>C.id===v.id)&&p.push(v);if(!a)return{edges:p,nodes:u};const d=await a({nodes:u,edges:p});return typeof d=="boolean"?d?{edges:p,nodes:u}:{edges:[],nodes:[]}:d}const Ca=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),fs=(e={x:0,y:0},t,n)=>({x:Ca(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Ca(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function _2(e,t,n){const{width:r,height:a}=Yi(n),{x:l,y:u}=n.internals.positionAbsolute;return fs(e,[[l,u],[l+r,u+a]],t)}const cS=(e,t,n)=>en?-Ca(Math.abs(e-n),1,t)/t:0,Vm=(e,t,n=15,r=40)=>{const a=cS(e.x,r,t.width-r)*n,l=cS(e.y,r,t.height-r)*n;return[a,l]},Nh=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Sg=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Th=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),ol=(e,t=[0,0])=>{var a,l;const{x:n,y:r}=Gm(e)?e.internals.positionAbsolute:yl(e,t);return{x:n,y:r,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0}},Gu=(e,t=[0,0])=>{var a,l;const{x:n,y:r}=Gm(e)?e.internals.positionAbsolute:yl(e,t);return{x:n,y:r,x2:n+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:r+(((l=e.measured)==null?void 0:l.height)??e.height??e.initialHeight??0)}},y2=(e,t)=>Th(Nh(Sg(e),Sg(t))),b2=(e,t,n,r,a,l,u,o)=>{const c=Math.max(0,Math.min(e+n,a+u)-Math.max(e,a)),f=Math.max(0,Math.min(t+r,l+o)-Math.max(t,l));return Math.ceil(c*f)},qu=(e,t)=>b2(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),uS=e=>Zn(e.width)&&Zn(e.height)&&Zn(e.x)&&Zn(e.y),Zn=e=>!isNaN(e)&&isFinite(e),S2=(e,t)=>(n,r)=>{},Sl=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),xl=({x:e,y:t},[n,r,a],l=!1,u=[1,1])=>{const o={x:(e-n)/a,y:(t-r)/a};return l?Sl(o,u):o},Ea=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function aa(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function nH(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=aa(e,n),a=aa(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){const r=aa(e.top??e.y??0,n),a=aa(e.bottom??e.y??0,n),l=aa(e.left??e.x??0,t),u=aa(e.right??e.x??0,t);return{top:r,right:u,bottom:a,left:l,x:l+u,y:r+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function iH(e,t,n,r,a,l){const{x:u,y:o}=Ea(e,[t,n,r]),{x:c,y:f}=Ea({x:e.x+e.width,y:e.y+e.height},[t,n,r]),p=a-c,d=l-f;return{left:Math.floor(u),top:Math.floor(o),right:Math.floor(p),bottom:Math.floor(d)}}const Wm=(e,t,n,r,a,l)=>{const u=nH(l,t,n),o=(t-u.x)/e.width,c=(n-u.y)/e.height,f=Math.min(o,c),p=Ca(f,r,a),d=e.x+e.width/2,v=e.y+e.height/2,_=t/2-d*p,C=n/2-v*p,w=iH(e,_,C,p,t,n),S={left:Math.min(w.left-u.left,0),top:Math.min(w.top-u.top,0),right:Math.min(w.right-u.right,0),bottom:Math.min(w.bottom-u.bottom,0)};return{x:_-S.left+S.right,y:C-S.top+S.bottom,zoom:p}},ll=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function ds(e){return e!=null&&e!=="parent"}function Yi(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function x2(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function w2(e,t={width:0,height:0},n,r,a){const l={...e},u=r.get(n);if(u){const o=u.origin||a;l.x+=u.internals.positionAbsolute.x-(t.width??0)*o[0],l.y+=u.internals.positionAbsolute.y-(t.height??0)*o[1]}return l}function hS(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function rH(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}function sH(e){return{...d2,...e||{}}}function Go(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:l,y:u}=Qn(e),o=xl({x:l-((a==null?void 0:a.left)??0),y:u-((a==null?void 0:a.top)??0)},r),{x:c,y:f}=n?Sl(o,t):o;return{xSnapped:c,ySnapped:f,...o}}const Ym=e=>({width:e.offsetWidth,height:e.offsetHeight}),C2=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},aH=["INPUT","SELECT","TEXTAREA"];function E2(e){var r,a;const t=((a=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:a[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:aH.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const k2=e=>"clientX"in e,Qn=(e,t)=>{var l,u;const n=k2(e),r=n?e.clientX:(l=e.touches)==null?void 0:l[0].clientX,a=n?e.clientY:(u=e.touches)==null?void 0:u[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},fS=(e,t,n,r,a)=>{const l=t.querySelectorAll(`.${e}`);return!l||!l.length?null:Array.from(l).map(u=>{const o=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:a,position:u.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...Ym(u)}})};function A2({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:l,targetControlX:u,targetControlY:o}){const c=e*.125+a*.375+u*.375+n*.125,f=t*.125+l*.375+o*.375+r*.125,p=Math.abs(c-e),d=Math.abs(f-t);return[c,f,p,d]}function ou(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function dS({pos:e,x1:t,y1:n,x2:r,y2:a,c:l}){switch(e){case je.Left:return[t-ou(t-r,l),n];case je.Right:return[t+ou(r-t,l),n];case je.Top:return[t,n-ou(n-a,l)];case je.Bottom:return[t,n+ou(a-n,l)]}}function N2({sourceX:e,sourceY:t,sourcePosition:n=je.Bottom,targetX:r,targetY:a,targetPosition:l=je.Top,curvature:u=.25}){const[o,c]=dS({pos:n,x1:e,y1:t,x2:r,y2:a,c:u}),[f,p]=dS({pos:l,x1:r,y1:a,x2:e,y2:t,c:u}),[d,v,_,C]=A2({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:o,sourceControlY:c,targetControlX:f,targetControlY:p});return[`M${e},${t} C${o},${c} ${f},${p} ${r},${a}`,d,v,_,C]}function T2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const a=Math.abs(n-e)/2,l=n0}const cH=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,uH=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),hH=(e,t,n={})=>{var l;if(!e.source||!e.target)return(l=n.onError)==null||l.call(n,"006",ei.error006()),t;const r=n.getEdgeId||cH;let a;return m2(e)?a={...e}:a={...e,id:r(e)},uH(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function D2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,l,u,o]=T2({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,l,u,o]}const pS={[je.Left]:{x:-1,y:0},[je.Right]:{x:1,y:0},[je.Top]:{x:0,y:-1},[je.Bottom]:{x:0,y:1}},fH=({source:e,sourcePosition:t=je.Bottom,target:n})=>t===je.Left||t===je.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function dH({source:e,sourcePosition:t=je.Bottom,target:n,targetPosition:r=je.Top,center:a,offset:l,stepPosition:u}){const o=pS[t],c=pS[r],f={x:e.x+o.x*l,y:e.y+o.y*l},p={x:n.x+c.x*l,y:n.y+c.y*l},d=fH({source:f,sourcePosition:t,target:p}),v=d.x!==0?"x":"y",_=d[v];let C=[],w,S;const y={x:0,y:0},x={x:0,y:0},[,,b,E]=T2({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(o[v]*c[v]===-1){v==="x"?(w=a.x??f.x+(p.x-f.x)*u,S=a.y??(f.y+p.y)/2):(w=a.x??(f.x+p.x)/2,S=a.y??f.y+(p.y-f.y)*u);const T=[{x:w,y:f.y},{x:w,y:p.y}],j=[{x:f.x,y:S},{x:p.x,y:S}];o[v]===_?C=v==="x"?T:j:C=v==="x"?j:T}else{const T=[{x:f.x,y:p.y}],j=[{x:p.x,y:f.y}];if(v==="x"?C=o.x===_?j:T:C=o.y===_?T:j,t===r){const P=Math.abs(e[v]-n[v]);if(P<=l){const W=Math.min(l-1,l-P);o[v]===_?y[v]=(f[v]>e[v]?-1:1)*W:x[v]=(p[v]>n[v]?-1:1)*W}}if(t!==r){const P=v==="x"?"y":"x",W=o[v]===c[P],q=f[P]>p[P],X=f[P]=F?(w=(B.x+z.x)/2,S=C[0].y):(w=C[0].x,S=(B.y+z.y)/2)}const D={x:f.x+y.x,y:f.y+y.y},N={x:p.x+x.x,y:p.y+x.y};return[[e,...D.x!==C[0].x||D.y!==C[0].y?[D]:[],...C,...N.x!==C[C.length-1].x||N.y!==C[C.length-1].y?[N]:[],n],w,S,b,E]}function pH(e,t,n,r){const a=Math.min(gS(e,t)/2,gS(t,n)/2,r),{x:l,y:u}=t;if(e.x===l&&l===n.x||e.y===u&&u===n.y)return`L${l} ${u}`;if(e.y===u){const f=e.xn.id===t):e[0])||null}function wg(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function mH(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:a}){const l=new Set;return e.reduce((u,o)=>([o.markerStart||r,o.markerEnd||a].forEach(c=>{if(c&&typeof c=="object"){const f=wg(c,t);l.has(f)||(u.push({id:f,color:c.color||n,...c}),l.add(f))}}),u),[]).sort((u,o)=>u.id.localeCompare(o.id))}const R2=1e3,vH=10,Xm={nodeOrigin:[0,0],nodeExtent:sl,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},_H={...Xm,checkEquality:!0};function Km(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function yH(e,t,n){const r=Km(Xm,n);for(const a of e.values())if(a.parentId)Qm(a,e,t,r);else{const l=yl(a,r.nodeOrigin),u=ds(a.extent)?a.extent:r.nodeExtent,o=fs(l,u,Yi(a));a.internals.positionAbsolute=o}}function bH(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const a of e.handles){const l={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(l):a.type==="target"&&r.push(l)}return{source:n,target:r}}function Zm(e){return e==="manual"}function Cg(e,t,n,r={}){var p,d;const a=Km(_H,r),l={i:0},u=new Map(t),o=a!=null&&a.elevateNodesOnSelect&&!Zm(a.zIndexMode)?R2:0;let c=e.length>0,f=!1;t.clear(),n.clear();for(const v of e){let _=u.get(v.id);if(a.checkEquality&&v===(_==null?void 0:_.internals.userNode))t.set(v.id,_);else{const C=yl(v,a.nodeOrigin),w=ds(v.extent)?v.extent:a.nodeExtent,S=fs(C,w,Yi(v));_={...a.defaults,...v,measured:{width:(p=v.measured)==null?void 0:p.width,height:(d=v.measured)==null?void 0:d.height},internals:{positionAbsolute:S,handleBounds:bH(v,_),z:M2(v,o,a.zIndexMode),userNode:v}},t.set(v.id,_)}(_.measured===void 0||_.measured.width===void 0||_.measured.height===void 0)&&!_.hidden&&(c=!1),v.parentId&&Qm(_,t,n,r,l),f||(f=v.selected??!1)}return{nodesInitialized:c,hasSelectedNodes:f}}function SH(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Qm(e,t,n,r,a){const{elevateNodesOnSelect:l,nodeOrigin:u,nodeExtent:o,zIndexMode:c}=Km(Xm,r),f=e.parentId,p=t.get(f);if(!p){console.warn(`Parent node ${f} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}SH(e,n),a&&!p.parentId&&p.internals.rootParentIndex===void 0&&c==="auto"&&(p.internals.rootParentIndex=++a.i,p.internals.z=p.internals.z+a.i*vH),a&&p.internals.rootParentIndex!==void 0&&(a.i=p.internals.rootParentIndex);const d=l&&!Zm(c)?R2:0,{x:v,y:_,z:C}=xH(e,p,u,o,d,c),{positionAbsolute:w}=e.internals,S=v!==w.x||_!==w.y;(S||C!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:S?{x:v,y:_}:w,z:C}})}function M2(e,t,n){const r=Zn(e.zIndex)?e.zIndex:0;return Zm(n)?r:r+(e.selected?t:0)}function xH(e,t,n,r,a,l){const{x:u,y:o}=t.internals.positionAbsolute,c=Yi(e),f=yl(e,n),p=ds(e.extent)?fs(f,e.extent,c):f;let d=fs({x:u+p.x,y:o+p.y},r,c);e.extent==="parent"&&(d=_2(d,c,t));const v=M2(e,a,l),_=t.internals.z??0;return{x:d.x,y:d.y,z:_>=v?_+1:v}}function Jm(e,t,n,r=[0,0]){var u;const a=[],l=new Map;for(const o of e){const c=t.get(o.parentId);if(!c)continue;const f=((u=l.get(o.parentId))==null?void 0:u.expandedRect)??ol(c),p=y2(f,o.rect);l.set(o.parentId,{expandedRect:p,parent:c})}return l.size>0&&l.forEach(({expandedRect:o,parent:c},f)=>{var b;const p=c.internals.positionAbsolute,d=Yi(c),v=c.origin??r,_=o.x0||C>0||y||x)&&(a.push({id:f,type:"position",position:{x:c.position.x-_+y,y:c.position.y-C+x}}),(b=n.get(f))==null||b.forEach(E=>{e.some(D=>D.id===E.id)||a.push({id:E.id,type:"position",position:{x:E.position.x+_,y:E.position.y+C}})})),(d.width0){const _=Jm(v,t,n,a);f.push(..._)}return{changes:f,updatedInternals:c}}async function CH({delta:e,panZoom:t,transform:n,translateExtent:r,width:a,height:l}){if(!t||!e.x&&!e.y)return!1;const u=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,l]],r);return!!u&&(u.x!==n[0]||u.y!==n[1]||u.k!==n[2])}function yS(e,t,n,r,a,l){let u=a;const o=r.get(u)||new Map;r.set(u,o.set(n,t)),u=`${a}-${e}`;const c=r.get(u)||new Map;if(r.set(u,c.set(n,t)),l){u=`${a}-${e}-${l}`;const f=r.get(u)||new Map;r.set(u,f.set(n,t))}}function j2(e,t,n){e.clear(),t.clear();for(const r of n){const{source:a,target:l,sourceHandle:u=null,targetHandle:o=null}=r,c={edgeId:r.id,source:a,target:l,sourceHandle:u,targetHandle:o},f=`${a}-${u}--${l}-${o}`,p=`${l}-${o}--${a}-${u}`;yS("source",c,p,e,a,u),yS("target",c,f,e,l,o),t.set(r.id,r)}}function L2(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:L2(n,t):!1}function bS(e,t,n){var a;let r=e;do{if((a=r==null?void 0:r.matches)!=null&&a.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function EH(e,t,n,r){const a=new Map;for(const[l,u]of e)if((u.selected||u.id===r)&&(!u.parentId||!L2(u,e))&&(u.draggable||t&&typeof u.draggable>"u")){const o=e.get(l);o&&a.set(l,{id:l,position:o.position||{x:0,y:0},distance:{x:n.x-o.internals.positionAbsolute.x,y:n.y-o.internals.positionAbsolute.y},extent:o.extent,parentId:o.parentId,origin:o.origin,expandParent:o.expandParent,internals:{positionAbsolute:o.internals.positionAbsolute||{x:0,y:0}},measured:{width:o.measured.width??0,height:o.measured.height??0}})}return a}function Ep({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var u,o,c;const a=[];for(const[f,p]of t){const d=(u=n.get(f))==null?void 0:u.internals.userNode;d&&a.push({...d,position:p.position,dragging:r})}if(!e)return[a[0],a];const l=(o=n.get(e))==null?void 0:o.internals.userNode;return[l?{...l,position:((c=t.get(e))==null?void 0:c.position)||l.position,dragging:r}:a[0],a]}function kH({dragItems:e,snapGrid:t,x:n,y:r}){const a=e.values().next().value;if(!a)return null;const l={x:n-a.distance.x,y:r-a.distance.y},u=Sl(l,t);return{x:u.x-l.x,y:u.y-l.y}}function AH({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let l={x:null,y:null},u=0,o=new Map,c=!1,f={x:0,y:0},p=null,d=!1,v=null,_=!1,C=!1,w=null;function S({noDragClassName:x,handleSelector:b,domNode:E,isSelectable:D,nodeId:N,nodeClickDistance:R=0}){v=An(E);function T({x:V,y:F}){const{nodeLookup:P,nodeExtent:W,snapGrid:q,snapToGrid:X,nodeOrigin:K,onNodeDrag:L,onSelectionDrag:M,onError:O,updateNodePositions:U}=t();l={x:V,y:F};let $=!1;const Q=o.size>1,re=Q&&W?Sg(bl(o)):null,se=Q&&X?kH({dragItems:o,snapGrid:q,x:V,y:F}):null;for(const[Z,H]of o){if(!P.has(Z))continue;let ee={x:V-H.distance.x,y:F-H.distance.y};X&&(ee=se?{x:Math.round(ee.x+se.x),y:Math.round(ee.y+se.y)}:Sl(ee,q));let ne=null;if(Q&&W&&!H.extent&&re){const{positionAbsolute:ye}=H.internals,Ce=ye.x-re.x+W[0][0],Ee=ye.x+H.measured.width-re.x2+W[1][0],Ne=ye.y-re.y+W[0][1],we=ye.y+H.measured.height-re.y2+W[1][1];ne=[[Ce,Ne],[Ee,we]]}const{position:pe,positionAbsolute:fe}=v2({nodeId:Z,nextPosition:ee,nodeLookup:P,nodeExtent:ne||W,nodeOrigin:K,onError:O});$=$||H.position.x!==pe.x||H.position.y!==pe.y,H.position=pe,H.internals.positionAbsolute=fe}if(C=C||$,!!$&&(U(o,!0),w&&(r||L||!N&&M))){const[Z,H]=Ep({nodeId:N,dragItems:o,nodeLookup:P});r==null||r(w,o,Z,H),L==null||L(w,Z,H),N||M==null||M(w,H)}}async function j(){if(!p)return;const{transform:V,panBy:F,autoPanSpeed:P,autoPanOnNodeDrag:W}=t();if(!W){c=!1,cancelAnimationFrame(u);return}const[q,X]=Vm(f,p,P);(q!==0||X!==0)&&(l.x=(l.x??0)-q/V[2],l.y=(l.y??0)-X/V[2],await F({x:q,y:X})&&T(l)),u=requestAnimationFrame(j)}function B(V){var Q;const{nodeLookup:F,multiSelectionActive:P,nodesDraggable:W,transform:q,snapGrid:X,snapToGrid:K,selectNodesOnDrag:L,onNodeDragStart:M,onSelectionDragStart:O,unselectNodesAndEdges:U}=t();d=!0,(!L||!D)&&!P&&N&&((Q=F.get(N))!=null&&Q.selected||U()),D&&L&&N&&(e==null||e(N));const $=Go(V.sourceEvent,{transform:q,snapGrid:X,snapToGrid:K,containerBounds:p});if(l=$,o=EH(F,W,$,N),o.size>0&&(n||M||!N&&O)){const[re,se]=Ep({nodeId:N,dragItems:o,nodeLookup:F});n==null||n(V.sourceEvent,o,re,se),M==null||M(V.sourceEvent,re,se),N||O==null||O(V.sourceEvent,se)}}const z=KC().clickDistance(R).on("start",V=>{const{domNode:F,nodeDragThreshold:P,transform:W,snapGrid:q,snapToGrid:X}=t();p=(F==null?void 0:F.getBoundingClientRect())||null,_=!1,C=!1,w=V.sourceEvent,P===0&&B(V),l=Go(V.sourceEvent,{transform:W,snapGrid:q,snapToGrid:X,containerBounds:p}),f=Qn(V.sourceEvent,p)}).on("drag",V=>{const{autoPanOnNodeDrag:F,transform:P,snapGrid:W,snapToGrid:q,nodeDragThreshold:X,nodeLookup:K}=t(),L=Go(V.sourceEvent,{transform:P,snapGrid:W,snapToGrid:q,containerBounds:p});if(w=V.sourceEvent,(V.sourceEvent.type==="touchmove"&&V.sourceEvent.touches.length>1||N&&!K.has(N))&&(_=!0),!_){if(!c&&F&&d&&(c=!0,j()),!d){const M=Qn(V.sourceEvent,p),O=M.x-f.x,U=M.y-f.y;Math.sqrt(O*O+U*U)>X&&B(V)}(l.x!==L.xSnapped||l.y!==L.ySnapped)&&o&&d&&(f=Qn(V.sourceEvent,p),T(L))}}).on("end",V=>{if(!d||_){_&&o.size>0&&t().updateNodePositions(o,!1);return}if(c=!1,d=!1,cancelAnimationFrame(u),o.size>0){const{nodeLookup:F,updateNodePositions:P,onNodeDragStop:W,onSelectionDragStop:q}=t();if(C&&(P(o,!1),C=!1),a||W||!N&&q){const[X,K]=Ep({nodeId:N,dragItems:o,nodeLookup:F,dragging:!1});a==null||a(V.sourceEvent,o,X,K),W==null||W(V.sourceEvent,X,K),N||q==null||q(V.sourceEvent,K)}}}).filter(V=>{const F=V.target;return!V.button&&(!x||!bS(F,`.${x}`,E))&&(!b||bS(F,b,E))});v.call(z)}function y(){v==null||v.on(".drag",null)}return{update:S,destroy:y}}function NH(e,t,n){const r=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const l of t.values())qu(a,ol(l))>0&&r.push(l);return r}const TH=250;function DH(e,t,n,r){var o,c;let a=[],l=1/0;const u=NH(e,n,t+TH);for(const f of u){const p=[...((o=f.internals.handleBounds)==null?void 0:o.source)??[],...((c=f.internals.handleBounds)==null?void 0:c.target)??[]];for(const d of p){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:v,y:_}=ps(f,d,d.position,!0),C=Math.sqrt(Math.pow(v-e.x,2)+Math.pow(_-e.y,2));C>t||(C1){const f=r.type==="source"?"target":"source";return a.find(p=>p.type===f)??a[0]}return a[0]}function O2(e,t,n,r,a,l=!1){var f,p,d;const u=r.get(e);if(!u)return null;const o=a==="strict"?(f=u.internals.handleBounds)==null?void 0:f[t]:[...((p=u.internals.handleBounds)==null?void 0:p.source)??[],...((d=u.internals.handleBounds)==null?void 0:d.target)??[]],c=(n?o==null?void 0:o.find(v=>v.id===n):o==null?void 0:o[0])??null;return c&&l?{...c,...ps(u,c,c.position,!0)}:c}function B2(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function RH(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const I2=()=>!0;function MH(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:l,isTarget:u,domNode:o,nodeLookup:c,lib:f,autoPanOnConnect:p,flowId:d,panBy:v,cancelConnection:_,onConnectStart:C,onConnect:w,onConnectEnd:S,isValidConnection:y=I2,onReconnectEnd:x,updateConnection:b,getTransform:E,getFromHandle:D,autoPanSpeed:N,dragThreshold:R=1,handleDomNode:T}){const j=C2(e.target);let B=0,z;const{x:V,y:F}=Qn(e),P=B2(l,T),W=o==null?void 0:o.getBoundingClientRect();let q=!1;if(!W||!P)return;const X=O2(a,P,r,c,t);if(!X)return;let K=Qn(e,W),L=!1,M=null,O=!1,U=null;function $(){if(!p||!W)return;const[pe,fe]=Vm(K,W,N);v({x:pe,y:fe}),B=requestAnimationFrame($)}const Q={...X,nodeId:a,type:P,position:X.position},re=c.get(a);let Z={inProgress:!0,isValid:null,from:ps(re,Q,je.Left,!0),fromHandle:Q,fromPosition:Q.position,fromNode:re,to:K,toHandle:null,toPosition:lS[Q.position],toNode:null,pointer:K};function H(){q=!0,b(Z),C==null||C(e,{nodeId:a,handleId:r,handleType:P})}R===0&&H();function ee(pe){if(!q){const{x:we,y:ft}=Qn(pe),Ct=we-V,st=ft-F;if(!(Ct*Ct+st*st>R*R))return;H()}if(!D()||!Q){ne(pe);return}const fe=E();K=Qn(pe,W),z=DH(xl(K,fe,!1,[1,1]),n,c,Q),L||($(),L=!0);const ye=z2(pe,{handle:z,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:u?"target":"source",isValidConnection:y,doc:j,lib:f,flowId:d,nodeLookup:c});U=ye.handleDomNode,M=ye.connection,O=RH(!!z,ye.isValid);const Ce=c.get(a),Ee=Ce?ps(Ce,Q,je.Left,!0):Z.from,Ne={...Z,from:Ee,isValid:O,to:ye.toHandle&&O?Ea({x:ye.toHandle.x,y:ye.toHandle.y},fe):K,toHandle:ye.toHandle,toPosition:O&&ye.toHandle?ye.toHandle.position:lS[Q.position],toNode:ye.toHandle?c.get(ye.toHandle.nodeId):null,pointer:K};b(Ne),Z=Ne}function ne(pe){if(!("touches"in pe&&pe.touches.length>0)){if(q){(z||U)&&M&&O&&(w==null||w(M));const{inProgress:fe,...ye}=Z,Ce={...ye,toPosition:Z.toHandle?Z.toPosition:null};S==null||S(pe,Ce),l&&(x==null||x(pe,Ce))}_(),cancelAnimationFrame(B),L=!1,O=!1,M=null,U=null,j.removeEventListener("mousemove",ee),j.removeEventListener("mouseup",ne),j.removeEventListener("touchmove",ee),j.removeEventListener("touchend",ne)}}j.addEventListener("mousemove",ee),j.addEventListener("mouseup",ne),j.addEventListener("touchmove",ee),j.addEventListener("touchend",ne)}function z2(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:l,doc:u,lib:o,flowId:c,isValidConnection:f=I2,nodeLookup:p}){const d=l==="target",v=t?u.querySelector(`.${o}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:_,y:C}=Qn(e),w=u.elementFromPoint(_,C),S=w!=null&&w.classList.contains(`${o}-flow__handle`)?w:v,y={handleDomNode:S,isValid:!1,connection:null,toHandle:null};if(S){const x=B2(void 0,S),b=S.getAttribute("data-nodeid"),E=S.getAttribute("data-handleid"),D=S.classList.contains("connectable"),N=S.classList.contains("connectableend");if(!b||!x)return y;const R={source:d?b:r,sourceHandle:d?E:a,target:d?r:b,targetHandle:d?a:E};y.connection=R;const j=D&&N&&(n===wa.Strict?d&&x==="source"||!d&&x==="target":b!==r||E!==a);y.isValid=j&&f(R),y.toHandle=O2(b,x,E,p,n,!0)}return y}const Eg={onPointerDown:MH,isValid:z2};function jH({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=An(e);function l({translateExtent:o,width:c,height:f,zoomStep:p=1,pannable:d=!0,zoomable:v=!0,inversePan:_=!1}){const C=b=>{if(b.sourceEvent.type!=="wheel"||!t)return;const E=n(),D=b.sourceEvent.ctrlKey&&ll()?10:1,N=-b.sourceEvent.deltaY*(b.sourceEvent.deltaMode===1?.05:b.sourceEvent.deltaMode?1:.002)*p,R=E[2]*Math.pow(2,N*D);t.scaleTo(R)};let w=[0,0];const S=b=>{(b.sourceEvent.type==="mousedown"||b.sourceEvent.type==="touchstart")&&(w=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY])},y=b=>{const E=n();if(b.sourceEvent.type!=="mousemove"&&b.sourceEvent.type!=="touchmove"||!t)return;const D=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY],N=[D[0]-w[0],D[1]-w[1]];w=D;const R=r()*Math.max(E[2],Math.log(E[2]))*(_?-1:1),T={x:E[0]-N[0]*R,y:E[1]-N[1]*R},j=[[0,0],[c,f]];t.setViewportConstrained({x:T.x,y:T.y,zoom:E[2]},j,o)},x=h2().on("start",S).on("zoom",d?y:null).on("zoom.wheel",v?C:null);a.call(x,{})}function u(){a.on("zoom",null)}return{update:l,destroy:u,pointer:Xn}}const Dh=e=>({x:e.x,y:e.y,zoom:e.k}),kp=({x:e,y:t,zoom:n})=>Ah.translate(e,t).scale(n),pa=(e,t)=>e.target.closest(`.${t}`),H2=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),LH=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Ap=(e,t=0,n=LH,r=()=>{})=>{const a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},F2=e=>{const t=e.ctrlKey&&ll()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function OH({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:l,zoomOnPinch:u,onPanZoomStart:o,onPanZoom:c,onPanZoomEnd:f}){return p=>{if(pa(p,t))return p.ctrlKey&&p.preventDefault(),!1;p.preventDefault(),p.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(p.ctrlKey&&u){const S=Xn(p),y=F2(p),x=d*Math.pow(2,y);r.scaleTo(n,x,S,p);return}const v=p.deltaMode===1?20:1;let _=a===os.Vertical?0:p.deltaX*v,C=a===os.Horizontal?0:p.deltaY*v;!ll()&&p.shiftKey&&a!==os.Vertical&&(_=p.deltaY*v,C=0),r.translateBy(n,-(_/d)*l,-(C/d)*l,{internal:!0});const w=Dh(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(p,w),e.panScrollTimeout=setTimeout(()=>{f==null||f(p,w),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,o==null||o(p,w))}}function BH({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const l=r.type==="wheel",u=!t&&l&&!r.ctrlKey,o=pa(r,e);if(r.ctrlKey&&l&&o&&r.preventDefault(),u||o)return null;r.preventDefault(),n.call(this,r,a)}}function IH({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var l,u,o;if((l=r.sourceEvent)!=null&&l.internal)return;const a=Dh(r.transform);e.mouseButton=((u=r.sourceEvent)==null?void 0:u.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((o=r.sourceEvent)==null?void 0:o.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,a))}}function zH({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return l=>{var u,o;e.usedRightMouseButton=!!(n&&H2(t,e.mouseButton??0)),(u=l.sourceEvent)!=null&&u.sync||r([l.transform.x,l.transform.y,l.transform.k]),a&&!((o=l.sourceEvent)!=null&&o.internal)&&(a==null||a(l.sourceEvent,Dh(l.transform)))}}function HH({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:a,onPaneContextMenu:l}){return u=>{var o;if(!((o=u.sourceEvent)!=null&&o.internal)&&(e.isZoomingOrPanning=!1,l&&H2(t,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&l(u.sourceEvent),e.usedRightMouseButton=!1,r(!1),a)){const c=Dh(u.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(u.sourceEvent,c)},n?150:0)}}}function FH({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:a,zoomOnDoubleClick:l,userSelectionActive:u,noWheelClassName:o,noPanClassName:c,lib:f,connectionInProgress:p}){return d=>{var S;const v=e||t,_=n&&d.ctrlKey,C=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(pa(d,`${f}-flow__node`)||pa(d,`${f}-flow__edge`)))return!0;if(!r&&!v&&!a&&!l&&!n||u||p&&!C||pa(d,o)&&C||pa(d,c)&&(!C||a&&C&&!e)||!n&&d.ctrlKey&&C)return!1;if(!n&&d.type==="touchstart"&&((S=d.touches)==null?void 0:S.length)>1)return d.preventDefault(),!1;if(!v&&!a&&!_&&C||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||C)&&w}}function PH({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:a,onPanZoom:l,onPanZoomStart:u,onPanZoomEnd:o,onDraggingChange:c}){const f={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},p=e.getBoundingClientRect(),d=h2().scaleExtent([t,n]).translateExtent(r),v=An(e).call(d);x({x:a.x,y:a.y,zoom:Ca(a.zoom,t,n)},[[0,0],[p.width,p.height]],r);const _=v.on("wheel.zoom"),C=v.on("dblclick.zoom");d.wheelDelta(F2);async function w(z,V){return v?new Promise(F=>{d==null||d.interpolate((V==null?void 0:V.interpolate)==="linear"?Uo:Su).transform(Ap(v,V==null?void 0:V.duration,V==null?void 0:V.ease,()=>F(!0)),z)}):!1}function S({noWheelClassName:z,noPanClassName:V,onPaneContextMenu:F,userSelectionActive:P,panOnScroll:W,panOnDrag:q,panOnScrollMode:X,panOnScrollSpeed:K,preventScrolling:L,zoomOnPinch:M,zoomOnScroll:O,zoomOnDoubleClick:U,zoomActivationKeyPressed:$,lib:Q,onTransformChange:re,connectionInProgress:se,paneClickDistance:Z,selectionOnDrag:H}){P&&!f.isZoomingOrPanning&&y();const ee=W&&!$&&!P;d.clickDistance(H?1/0:!Zn(Z)||Z<0?0:Z);const ne=ee?OH({zoomPanValues:f,noWheelClassName:z,d3Selection:v,d3Zoom:d,panOnScrollMode:X,panOnScrollSpeed:K,zoomOnPinch:M,onPanZoomStart:u,onPanZoom:l,onPanZoomEnd:o}):BH({noWheelClassName:z,preventScrolling:L,d3ZoomHandler:_});v.on("wheel.zoom",ne,{passive:!1});const pe=IH({zoomPanValues:f,onDraggingChange:c,onPanZoomStart:u});d.on("start",pe);const fe=zH({zoomPanValues:f,panOnDrag:q,onPaneContextMenu:!!F,onPanZoom:l,onTransformChange:re});d.on("zoom",fe);const ye=HH({zoomPanValues:f,panOnDrag:q,panOnScroll:W,onPaneContextMenu:F,onPanZoomEnd:o,onDraggingChange:c});d.on("end",ye);const Ce=FH({zoomActivationKeyPressed:$,panOnDrag:q,zoomOnScroll:O,panOnScroll:W,zoomOnDoubleClick:U,zoomOnPinch:M,userSelectionActive:P,noPanClassName:V,noWheelClassName:z,lib:Q,connectionInProgress:se});d.filter(Ce),U?v.on("dblclick.zoom",C):v.on("dblclick.zoom",null)}function y(){d.on("zoom",null)}async function x(z,V,F){const P=kp(z),W=d==null?void 0:d.constrain()(P,V,F);return W&&await w(W),W}async function b(z,V){const F=kp(z);return await w(F,V),F}function E(z){if(v){const V=kp(z),F=v.property("__zoom");(F.k!==z.zoom||F.x!==z.x||F.y!==z.y)&&(d==null||d.transform(v,V,null,{sync:!0}))}}function D(){const z=v?u2(v.node()):{x:0,y:0,k:1};return{x:z.x,y:z.y,zoom:z.k}}async function N(z,V){return v?new Promise(F=>{d==null||d.interpolate((V==null?void 0:V.interpolate)==="linear"?Uo:Su).scaleTo(Ap(v,V==null?void 0:V.duration,V==null?void 0:V.ease,()=>F(!0)),z)}):!1}async function R(z,V){return v?new Promise(F=>{d==null||d.interpolate((V==null?void 0:V.interpolate)==="linear"?Uo:Su).scaleBy(Ap(v,V==null?void 0:V.duration,V==null?void 0:V.ease,()=>F(!0)),z)}):!1}function T(z){d==null||d.scaleExtent(z)}function j(z){d==null||d.translateExtent(z)}function B(z){const V=!Zn(z)||z<0?0:z;d==null||d.clickDistance(V)}return{update:S,destroy:y,setViewport:b,setViewportConstrained:x,getViewport:D,scaleTo:N,scaleBy:R,setScaleExtent:T,setTranslateExtent:j,syncViewport:E,setClickDistance:B}}var ka;(function(e){e.Line="line",e.Handle="handle"})(ka||(ka={}));function $H({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:l}){const u=e-t,o=n-r,c=[u>0?1:u<0?-1:0,o>0?1:o<0?-1:0];return u&&a&&(c[0]=c[0]*-1),o&&l&&(c[1]=c[1]*-1),c}function SS(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:a}}function Er(e,t){return Math.max(0,t-e)}function kr(e,t){return Math.max(0,e-t)}function lu(e,t,n){return Math.max(0,t-e,e-n)}function xS(e,t){return e?!t:t}function UH(e,t,n,r,a,l,u,o){let{affectsX:c,affectsY:f}=t;const{isHorizontal:p,isVertical:d}=t,v=p&&d,{xSnapped:_,ySnapped:C}=n,{minWidth:w,maxWidth:S,minHeight:y,maxHeight:x}=r,{x:b,y:E,width:D,height:N,aspectRatio:R}=e;let T=Math.floor(p?_-e.pointerX:0),j=Math.floor(d?C-e.pointerY:0);const B=D+(c?-T:T),z=N+(f?-j:j),V=-l[0]*D,F=-l[1]*N;let P=lu(B,w,S),W=lu(z,y,x);if(u){let K=0,L=0;c&&T<0?K=Er(b+T+V,u[0][0]):!c&&T>0&&(K=kr(b+B+V,u[1][0])),f&&j<0?L=Er(E+j+F,u[0][1]):!f&&j>0&&(L=kr(E+z+F,u[1][1])),P=Math.max(P,K),W=Math.max(W,L)}if(o){let K=0,L=0;c&&T>0?K=kr(b+T,o[0][0]):!c&&T<0&&(K=Er(b+B,o[1][0])),f&&j>0?L=kr(E+j,o[0][1]):!f&&j<0&&(L=Er(E+z,o[1][1])),P=Math.max(P,K),W=Math.max(W,L)}if(a){if(p){const K=lu(B/R,y,x)*R;if(P=Math.max(P,K),u){let L=0;!c&&!f||c&&!f&&v?L=kr(E+F+B/R,u[1][1])*R:L=Er(E+F+(c?T:-T)/R,u[0][1])*R,P=Math.max(P,L)}if(o){let L=0;!c&&!f||c&&!f&&v?L=Er(E+B/R,o[1][1])*R:L=kr(E+(c?T:-T)/R,o[0][1])*R,P=Math.max(P,L)}}if(d){const K=lu(z*R,w,S)/R;if(W=Math.max(W,K),u){let L=0;!c&&!f||f&&!c&&v?L=kr(b+z*R+V,u[1][0])/R:L=Er(b+(f?j:-j)*R+V,u[0][0])/R,W=Math.max(W,L)}if(o){let L=0;!c&&!f||f&&!c&&v?L=Er(b+z*R,o[1][0])/R:L=kr(b+(f?j:-j)*R,o[0][0])/R,W=Math.max(W,L)}}}j=j+(j<0?W:-W),T=T+(T<0?P:-P),a&&(v?B>z*R?j=(xS(c,f)?-T:T)/R:T=(xS(c,f)?-j:j)*R:p?(j=T/R,f=c):(T=j*R,c=f));const q=c?b+T:b,X=f?E+j:E;return{width:D+(c?-T:T),height:N+(f?-j:j),x:l[0]*T*(c?-1:1)+q,y:l[1]*j*(f?-1:1)+X}}const P2={width:0,height:0,x:0,y:0},GH={...P2,pointerX:0,pointerY:0,aspectRatio:1};function qH(e,t,n){const r=t.position.x+e.position.x,a=t.position.y+e.position.y,l=e.measured.width??0,u=e.measured.height??0,o=n[0]*l,c=n[1]*u;return[[r-o,a-c],[r+l-o,a+u-c]]}function VH({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const l=An(e);let u={controlDirection:SS("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function o({controlPosition:f,boundaries:p,keepAspectRatio:d,resizeDirection:v,onResizeStart:_,onResize:C,onResizeEnd:w,shouldResize:S}){let y={...P2},x={...GH};u={boundaries:p,resizeDirection:v,keepAspectRatio:d,controlDirection:SS(f)};let b,E=null,D=[],N,R,T,j=!1;const B=KC().on("start",z=>{const{nodeLookup:V,transform:F,snapGrid:P,snapToGrid:W,nodeOrigin:q,paneDomNode:X}=n();if(b=V.get(t),!b)return;E=(X==null?void 0:X.getBoundingClientRect())??null;const{xSnapped:K,ySnapped:L}=Go(z.sourceEvent,{transform:F,snapGrid:P,snapToGrid:W,containerBounds:E});y={width:b.measured.width??0,height:b.measured.height??0,x:b.position.x??0,y:b.position.y??0},x={...y,pointerX:K,pointerY:L,aspectRatio:y.width/y.height},N=void 0,R=ds(b.extent)?b.extent:void 0,b.parentId&&(b.extent==="parent"||b.expandParent)&&(N=V.get(b.parentId)),N&&b.extent==="parent"&&(R=[[0,0],[N.measured.width,N.measured.height]]),D=[],T=void 0;for(const[M,O]of V)if(O.parentId===t&&(D.push({id:M,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const U=qH(O,b,O.origin??q);T?T=[[Math.min(U[0][0],T[0][0]),Math.min(U[0][1],T[0][1])],[Math.max(U[1][0],T[1][0]),Math.max(U[1][1],T[1][1])]]:T=U}_==null||_(z,{...y})}).on("drag",z=>{const{transform:V,snapGrid:F,snapToGrid:P,nodeOrigin:W}=n(),q=Go(z.sourceEvent,{transform:V,snapGrid:F,snapToGrid:P,containerBounds:E}),X=[];if(!b)return;const{x:K,y:L,width:M,height:O}=y,U={},$=b.origin??W,{width:Q,height:re,x:se,y:Z}=UH(x,u.controlDirection,q,u.boundaries,u.keepAspectRatio,$,R,T),H=Q!==M,ee=re!==O,ne=se!==K&&H,pe=Z!==L&ⅇif(!ne&&!pe&&!H&&!ee)return;if((ne||pe||$[0]===1||$[1]===1)&&(U.x=ne?se:y.x,U.y=pe?Z:y.y,y.x=U.x,y.y=U.y,D.length>0)){const Ee=se-K,Ne=Z-L;for(const we of D)we.position={x:we.position.x-Ee+$[0]*(Q-M),y:we.position.y-Ne+$[1]*(re-O)},X.push(we)}if((H||ee)&&(U.width=H&&(!u.resizeDirection||u.resizeDirection==="horizontal")?Q:y.width,U.height=ee&&(!u.resizeDirection||u.resizeDirection==="vertical")?re:y.height,y.width=U.width,y.height=U.height),N&&b.expandParent){const Ee=$[0]*(U.width??0);U.x&&U.x{j&&(w==null||w(z,{...y}),a==null||a({...y}),j=!1)});l.call(B)}function c(){l.on(".drag",null)}return{update:o,destroy:c}}var Np={exports:{}},Tp={},Dp={exports:{}},Rp={};/** * @license React * use-sync-external-store-shim.production.js * @@ -379,7 +379,7 @@ Its experiments, runs and chats are removed from orx. The GitHub repo (${f.githu * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var xS;function qH(){if(xS)return Rp;xS=1;var e=cl();function t(d,v){return d===v&&(d!==0||1/d===1/v)||d!==d&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function o(d,v){var _=v(),C=r({inst:{value:_,getSnapshot:v}}),w=C[0].inst,S=C[1];return l(function(){w.value=_,w.getSnapshot=v,c(w)&&S({inst:w})},[d,_,v]),a(function(){return c(w)&&S({inst:w}),d(function(){c(w)&&S({inst:w})})},[d]),u(_),_}function c(d){var v=d.getSnapshot;d=d.value;try{var _=v();return!n(d,_)}catch{return!0}}function f(d,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:o;return Rp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Rp}var wS;function VH(){return wS||(wS=1,Tp.exports=qH()),Tp.exports}/** + */var wS;function WH(){if(wS)return Rp;wS=1;var e=ul();function t(d,v){return d===v&&(d!==0||1/d===1/v)||d!==d&&v!==v}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function o(d,v){var _=v(),C=r({inst:{value:_,getSnapshot:v}}),w=C[0].inst,S=C[1];return l(function(){w.value=_,w.getSnapshot=v,c(w)&&S({inst:w})},[d,_,v]),a(function(){return c(w)&&S({inst:w}),d(function(){c(w)&&S({inst:w})})},[d]),u(_),_}function c(d){var v=d.getSnapshot;d=d.value;try{var _=v();return!n(d,_)}catch{return!0}}function f(d,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:o;return Rp.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Rp}var CS;function YH(){return CS||(CS=1,Dp.exports=WH()),Dp.exports}/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -387,10 +387,10 @@ Its experiments, runs and chats are removed from orx. The GitHub repo (${f.githu * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var CS;function YH(){if(CS)return Np;CS=1;var e=cl(),t=VH();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,o=e.useMemo,c=e.useDebugValue;return Np.useSyncExternalStoreWithSelector=function(f,p,d,v,_){var C=l(null);if(C.current===null){var w={hasValue:!1,value:null};C.current=w}else w=C.current;C=o(function(){function y(N){if(!x){if(x=!0,b=N,N=v(N),_!==void 0&&w.hasValue){var D=w.value;if(_(D,N))return E=D}return E=N}if(D=E,r(b,N))return D;var T=v(N);return _!==void 0&&_(D,T)?(b=N,D):(b=N,E=T)}var x=!1,b,E,R=d===void 0?null:d;return[function(){return y(p())},R===null?void 0:function(){return y(R())}]},[p,d,v,_]);var S=a(f,C[0],C[1]);return u(function(){w.hasValue=!0,w.value=S},[S]),c(S),S},Np}var ES;function WH(){return ES||(ES=1,Ap.exports=YH()),Ap.exports}var XH=WH();const KH=Yu(XH),ZH={},kS=e=>{let t;const n=new Set,r=(p,d)=>{const v=typeof p=="function"?p(t):p;if(!Object.is(v,t)){const _=t;t=d??(typeof v!="object"||v===null)?v:Object.assign({},t,v),n.forEach(C=>C(t,_))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>f,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(ZH?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=t=e(r,a,c);return c},QH=e=>e?kS(e):kS,{useDebugValue:JH}=jA,{useSyncExternalStoreWithSelector:eF}=KH,tF=e=>e;function P2(e,t=tF,n){const r=eF(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return JH(r),r}const AS=(e,t)=>{const n=QH(e),r=(a,l=t)=>P2(n,a,l);return Object.assign(r,n),r},nF=(e,t)=>e?AS(e,t):AS;function Tt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,a]of e)if(!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const Rh=G.createContext(null),iF=Rh.Provider,$2=ei.error001("react");function it(e,t){const n=G.useContext(Rh);if(n===null)throw new Error($2);return P2(n,e,t)}function Rt(){const e=G.useContext(Rh);if(e===null)throw new Error($2);return G.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const NS={display:"none"},rF={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},U2="react-flow__node-desc",G2="react-flow__edge-desc",sF="react-flow__aria-live",aF=e=>e.ariaLiveMessage,oF=e=>e.ariaLabelConfig;function lF({rfId:e}){const t=it(aF);return g.jsx("div",{id:`${sF}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:rF,children:t})}function cF({rfId:e,disableKeyboardA11y:t}){const n=it(oF);return g.jsxs(g.Fragment,{children:[g.jsx("div",{id:`${U2}-${e}`,style:NS,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),g.jsx("div",{id:`${G2}-${e}`,style:NS,children:n["edge.a11yDescription.default"]}),!t&&g.jsx(lF,{rfId:e})]})}const Dh=G.forwardRef(({position:e="top-left",children:t,className:n,style:r,...a},l)=>{const u=`${e}`.split("-");return g.jsx("div",{className:$t(["react-flow__panel",n,...u]),style:r,ref:l,...a,children:t})});Dh.displayName="Panel";const TS="https://reactflow.dev?utm_source=attribution";function uF({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:g.jsx(Dh,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${TS}`,children:g.jsx("a",{href:TS,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const hF=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},lu=e=>e.id;function fF(e,t){return Tt(e.selectedNodes.map(lu),t.selectedNodes.map(lu))&&Tt(e.selectedEdges.map(lu),t.selectedEdges.map(lu))}function dF({onSelectionChange:e}){const t=Rt(),{selectedNodes:n,selectedEdges:r}=it(hF,fF);return G.useEffect(()=>{const a={nodes:n,edges:r};e==null||e(a),t.getState().onSelectionChangeHandlers.forEach(l=>l(a))},[n,r,e]),null}const pF=e=>!!e.onSelectionChangeHandlers;function gF({onSelectionChange:e}){const t=it(pF);return e||t?g.jsx(dF,{onSelectionChange:e}):null}const q2=[0,0],mF={x:0,y:0,zoom:1},vF=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],RS=[...vF,"rfId"],_F=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),DS={translateExtent:rl,nodeOrigin:q2,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function yF(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:a,setTranslateExtent:l,setNodeExtent:u,reset:o,setDefaultNodesAndEdges:c}=it(_F,Tt),f=Rt();G.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{p.current=DS,o()}),[]);const p=G.useRef(DS);return G.useEffect(()=>{for(const d of RS){const v=e[d],_=p.current[d];v!==_&&(typeof e[d]>"u"||(d==="nodes"?t(v):d==="edges"?n(v):d==="minZoom"?r(v):d==="maxZoom"?a(v):d==="translateExtent"?l(v):d==="nodeExtent"?u(v):d==="ariaLabelConfig"?f.setState({ariaLabelConfig:iH(v)}):d==="fitView"?f.setState({fitViewQueued:v}):d==="fitViewOptions"?f.setState({fitViewOptions:v}):f.setState({[d]:v})))}p.current=e},RS.map(d=>e[d])),null}function MS(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function bF(e){var r;const[t,n]=G.useState(e==="system"?null:e);return G.useEffect(()=>{if(e!=="system"){n(e);return}const a=MS(),l=()=>n(a!=null&&a.matches?"dark":"light");return l(),a==null||a.addEventListener("change",l),()=>{a==null||a.removeEventListener("change",l)}},[e]),t!==null?t:(r=MS())!=null&&r.matches?"dark":"light"}const jS=typeof document<"u"?document:null;function ll(e=null,t={target:jS,actInsideInputWithModifier:!0}){const[n,r]=G.useState(!1),a=G.useRef(!1),l=G.useRef(new Set([])),[u,o]=G.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",` + */var ES;function XH(){if(ES)return Tp;ES=1;var e=ul(),t=YH();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,o=e.useMemo,c=e.useDebugValue;return Tp.useSyncExternalStoreWithSelector=function(f,p,d,v,_){var C=l(null);if(C.current===null){var w={hasValue:!1,value:null};C.current=w}else w=C.current;C=o(function(){function y(N){if(!x){if(x=!0,b=N,N=v(N),_!==void 0&&w.hasValue){var R=w.value;if(_(R,N))return E=R}return E=N}if(R=E,r(b,N))return R;var T=v(N);return _!==void 0&&_(R,T)?(b=N,R):(b=N,E=T)}var x=!1,b,E,D=d===void 0?null:d;return[function(){return y(p())},D===null?void 0:function(){return y(D())}]},[p,d,v,_]);var S=a(f,C[0],C[1]);return u(function(){w.hasValue=!0,w.value=S},[S]),c(S),S},Tp}var kS;function KH(){return kS||(kS=1,Np.exports=XH()),Np.exports}var ZH=KH();const QH=Yu(ZH),JH={},AS=e=>{let t;const n=new Set,r=(p,d)=>{const v=typeof p=="function"?p(t):p;if(!Object.is(v,t)){const _=t;t=d??(typeof v!="object"||v===null)?v:Object.assign({},t,v),n.forEach(C=>C(t,_))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>f,subscribe:p=>(n.add(p),()=>n.delete(p)),destroy:()=>{(JH?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=t=e(r,a,c);return c},eF=e=>e?AS(e):AS,{useDebugValue:tF}=LA,{useSyncExternalStoreWithSelector:nF}=QH,iF=e=>e;function $2(e,t=iF,n){const r=nF(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return tF(r),r}const NS=(e,t)=>{const n=eF(e),r=(a,l=t)=>$2(n,a,l);return Object.assign(r,n),r},rF=(e,t)=>e?NS(e,t):NS;function Tt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,a]of e)if(!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const Rh=G.createContext(null),sF=Rh.Provider,U2=ei.error001("react");function it(e,t){const n=G.useContext(Rh);if(n===null)throw new Error(U2);return $2(n,e,t)}function Dt(){const e=G.useContext(Rh);if(e===null)throw new Error(U2);return G.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const TS={display:"none"},aF={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},G2="react-flow__node-desc",q2="react-flow__edge-desc",oF="react-flow__aria-live",lF=e=>e.ariaLiveMessage,cF=e=>e.ariaLabelConfig;function uF({rfId:e}){const t=it(lF);return g.jsx("div",{id:`${oF}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:aF,children:t})}function hF({rfId:e,disableKeyboardA11y:t}){const n=it(cF);return g.jsxs(g.Fragment,{children:[g.jsx("div",{id:`${G2}-${e}`,style:TS,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),g.jsx("div",{id:`${q2}-${e}`,style:TS,children:n["edge.a11yDescription.default"]}),!t&&g.jsx(uF,{rfId:e})]})}const Mh=G.forwardRef(({position:e="top-left",children:t,className:n,style:r,...a},l)=>{const u=`${e}`.split("-");return g.jsx("div",{className:$t(["react-flow__panel",n,...u]),style:r,ref:l,...a,children:t})});Mh.displayName="Panel";const DS="https://reactflow.dev?utm_source=attribution";function fF({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:g.jsx(Mh,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${DS}`,children:g.jsx("a",{href:DS,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const dF=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},cu=e=>e.id;function pF(e,t){return Tt(e.selectedNodes.map(cu),t.selectedNodes.map(cu))&&Tt(e.selectedEdges.map(cu),t.selectedEdges.map(cu))}function gF({onSelectionChange:e}){const t=Dt(),{selectedNodes:n,selectedEdges:r}=it(dF,pF);return G.useEffect(()=>{const a={nodes:n,edges:r};e==null||e(a),t.getState().onSelectionChangeHandlers.forEach(l=>l(a))},[n,r,e]),null}const mF=e=>!!e.onSelectionChangeHandlers;function vF({onSelectionChange:e}){const t=it(mF);return e||t?g.jsx(gF,{onSelectionChange:e}):null}const V2=[0,0],_F={x:0,y:0,zoom:1},yF=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],RS=[...yF,"rfId"],bF=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),MS={translateExtent:sl,nodeOrigin:V2,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function SF(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:a,setTranslateExtent:l,setNodeExtent:u,reset:o,setDefaultNodesAndEdges:c}=it(bF,Tt),f=Dt();G.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{p.current=MS,o()}),[]);const p=G.useRef(MS);return G.useEffect(()=>{for(const d of RS){const v=e[d],_=p.current[d];v!==_&&(typeof e[d]>"u"||(d==="nodes"?t(v):d==="edges"?n(v):d==="minZoom"?r(v):d==="maxZoom"?a(v):d==="translateExtent"?l(v):d==="nodeExtent"?u(v):d==="ariaLabelConfig"?f.setState({ariaLabelConfig:sH(v)}):d==="fitView"?f.setState({fitViewQueued:v}):d==="fitViewOptions"?f.setState({fitViewOptions:v}):f.setState({[d]:v})))}p.current=e},RS.map(d=>e[d])),null}function jS(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function xF(e){var r;const[t,n]=G.useState(e==="system"?null:e);return G.useEffect(()=>{if(e!=="system"){n(e);return}const a=jS(),l=()=>n(a!=null&&a.matches?"dark":"light");return l(),a==null||a.addEventListener("change",l),()=>{a==null||a.removeEventListener("change",l)}},[e]),t!==null?t:(r=jS())!=null&&r.matches?"dark":"light"}const LS=typeof document<"u"?document:null;function cl(e=null,t={target:LS,actInsideInputWithModifier:!0}){const[n,r]=G.useState(!1),a=G.useRef(!1),l=G.useRef(new Set([])),[u,o]=G.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",` `).replace(` `,` +`).split(` -`)),p=f.reduce((d,v)=>d.concat(...v),[]);return[f,p]}return[[],[]]},[e]);return G.useEffect(()=>{const c=(t==null?void 0:t.target)??jS,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const p=_=>{var S,y;if(a.current=_.ctrlKey||_.metaKey||_.shiftKey||_.altKey,(!a.current||a.current&&!f)&&C2(_))return!1;const w=OS(_.code,o);if(l.current.add(_[w]),LS(u,l.current,!1)){const x=((y=(S=_.composedPath)==null?void 0:S.call(_))==null?void 0:y[0])||_.target,b=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";t.preventDefault!==!1&&(a.current||!b)&&_.preventDefault(),r(!0)}},d=_=>{const C=OS(_.code,o);LS(u,l.current,!0)?(r(!1),l.current.clear()):l.current.delete(_[C]),_.key==="Meta"&&l.current.clear(),a.current=!1},v=()=>{l.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",p),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",v),window.addEventListener("contextmenu",v),()=>{c==null||c.removeEventListener("keydown",p),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",v),window.removeEventListener("contextmenu",v)}}},[e,r]),n}function LS(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function OS(e,t){return t.includes(e)?"code":"key"}const SF=()=>{const e=Rt();return G.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,a,l],panZoom:u}=e.getState();return u?(await u.setViewport({x:t.x??r,y:t.y??a,zoom:t.zoom??l},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:a,minZoom:l,maxZoom:u,panZoom:o}=e.getState(),c=Vm(t,r,a,l,u,(n==null?void 0:n.padding)??.1);return o?(await o.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:a,snapToGrid:l,domNode:u}=e.getState();if(!u)return t;const{x:o,y:c}=u.getBoundingClientRect(),f={x:t.x-o,y:t.y-c},p=n.snapGrid??a,d=n.snapToGrid??l;return Sl(f,r,d,p)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:a,y:l}=r.getBoundingClientRect(),u=Ca(t,n);return{x:u.x+a,y:u.y+l}}}),[])};function V2(e,t){const n=[],r=new Map,a=[];for(const l of e)if(l.type==="add"){a.push(l);continue}else if(l.type==="remove"||l.type==="replace")r.set(l.id,[l]);else{const u=r.get(l.id);u?u.push(l):r.set(l.id,[l])}for(const l of t){const u=r.get(l.id);if(!u){n.push(l);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){n.push({...u[0].item});continue}const o={...l};for(const c of u)xF(c,o);n.push(o)}return a.length&&a.forEach(l=>{l.index!==void 0?n.splice(l.index,0,{...l.item}):n.push({...l.item})}),n}function xF(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function wF(e,t){return V2(e,t)}function CF(e,t){return V2(e,t)}function is(e,t){return{id:e,type:"select",selected:t}}function pa(e,t=new Set,n=!1){const r=[];for(const[a,l]of e){const u=t.has(a);!(l.selected===void 0&&!u)&&l.selected!==u&&(n&&(l.selected=u),r.push(is(l.id,u)))}return r}function BS({items:e=[],lookup:t}){var a;const n=[],r=new Map(e.map(l=>[l.id,l]));for(const[l,u]of e.entries()){const o=t.get(u.id),c=((a=o==null?void 0:o.internals)==null?void 0:a.userNode)??o;c!==void 0&&c!==u&&n.push({id:u.id,item:u,type:"replace"}),c===void 0&&n.push({item:u,type:"add",index:l})}for(const[l]of t)r.get(l)===void 0&&n.push({id:l,type:"remove"});return n}function IS(e){return{id:e.id,type:"remove"}}const EF=b2();function kF(e,t,n={}){return cH(e,t,{...n,onError:n.onError??EF})}const zS=e=>Wz(e),AF=e=>g2(e);function Y2(e){return G.forwardRef(e)}const NF=typeof window<"u"?G.useLayoutEffect:G.useEffect;function HS(e){const[t,n]=G.useState(BigInt(0)),[r]=G.useState(()=>TF(()=>n(a=>a+BigInt(1))));return NF(()=>{const a=r.get();a.length&&(e(a),r.reset())},[t]),r}function TF(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const W2=G.createContext(null);function RF({children:e}){const t=Rt(),n=G.useCallback(o=>{const{nodes:c=[],setNodes:f,hasDefaultNodes:p,onNodesChange:d,nodeLookup:v,fitViewQueued:_,onNodesChangeMiddlewareMap:C}=t.getState();let w=c;for(const y of o)w=typeof y=="function"?y(w):y;let S=BS({items:w,lookup:v});for(const y of C.values())S=y(S);p&&f(w),S.length>0?d==null||d(S):_&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:x,setNodes:b}=t.getState();y&&b(x)})},[]),r=HS(n),a=G.useCallback(o=>{const{edges:c=[],setEdges:f,hasDefaultEdges:p,onEdgesChange:d,edgeLookup:v}=t.getState();let _=c;for(const C of o)_=typeof C=="function"?C(_):C;p?f(_):d&&d(BS({items:_,lookup:v}))},[]),l=HS(a),u=G.useMemo(()=>({nodeQueue:r,edgeQueue:l}),[]);return g.jsx(W2.Provider,{value:u,children:e})}function DF(){const e=G.useContext(W2);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const MF=e=>!!e.panZoom;function Jm(){const e=SF(),t=Rt(),n=DF(),r=it(MF),a=G.useMemo(()=>{const l=d=>t.getState().nodeLookup.get(d),u=d=>{n.nodeQueue.push(d)},o=d=>{n.edgeQueue.push(d)},c=d=>{var y,x;const{nodeLookup:v,nodeOrigin:_}=t.getState(),C=zS(d)?d:v.get(d.id),w=C.parentId?x2(C.position,C.measured,C.parentId,v,_):C.position,S={...C,position:w,width:((y=C.measured)==null?void 0:y.width)??C.width,height:((x=C.measured)==null?void 0:x.height)??C.height};return al(S)},f=(d,v,_={replace:!1})=>{u(C=>C.map(w=>{if(w.id===d){const S=typeof v=="function"?v(w):v;return _.replace&&zS(S)?S:{...w,...S}}return w}))},p=(d,v,_={replace:!1})=>{o(C=>C.map(w=>{if(w.id===d){const S=typeof v=="function"?v(w):v;return _.replace&&AF(S)?S:{...w,...S}}return w}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var v;return(v=l(d))==null?void 0:v.internals.userNode},getInternalNode:l,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(v=>({...v}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:u,setEdges:o,addNodes:d=>{const v=Array.isArray(d)?d:[d];n.nodeQueue.push(_=>[..._,...v])},addEdges:d=>{const v=Array.isArray(d)?d:[d];n.edgeQueue.push(_=>[..._,...v])},toObject:()=>{const{nodes:d=[],edges:v=[],transform:_}=t.getState(),[C,w,S]=_;return{nodes:d.map(y=>({...y})),edges:v.map(y=>({...y})),viewport:{x:C,y:w,zoom:S}}},deleteElements:async({nodes:d=[],edges:v=[]})=>{const{nodes:_,edges:C,onNodesDelete:w,onEdgesDelete:S,triggerNodeChanges:y,triggerEdgeChanges:x,onDelete:b,onBeforeDelete:E}=t.getState(),{nodes:R,edges:N}=await Jz({nodesToRemove:d,edgesToRemove:v,nodes:_,edges:C,onBeforeDelete:E}),D=N.length>0,T=R.length>0;if(D){const j=N.map(IS);S==null||S(N),x(j)}if(T){const j=R.map(IS);w==null||w(R),y(j)}return(T||D)&&(b==null||b({nodes:R,edges:N})),{deletedNodes:R,deletedEdges:N}},getIntersectingNodes:(d,v=!0,_)=>{const C=cS(d),w=C?d:c(d),S=_!==void 0;return w?(_||t.getState().nodes).filter(y=>{const x=t.getState().nodeLookup.get(y.id);if(x&&!C&&(y.id===d.id||!x.internals.positionAbsolute))return!1;const b=al(S?y:x),E=Gu(b,w);return v&&E>0||E>=b.width*b.height||E>=w.width*w.height}):[]},isNodeIntersecting:(d,v,_=!0)=>{const w=cS(d)?d:c(d);if(!w)return!1;const S=Gu(w,v);return _&&S>0||S>=v.width*v.height||S>=w.width*w.height},updateNode:f,updateNodeData:(d,v,_={replace:!1})=>{f(d,C=>{const w=typeof v=="function"?v(C):v;return _.replace?{...C,data:w}:{...C,data:{...C.data,...w}}},_)},updateEdge:p,updateEdgeData:(d,v,_={replace:!1})=>{p(d,C=>{const w=typeof v=="function"?v(C):v;return _.replace?{...C,data:w}:{...C,data:{...C.data,...w}}},_)},getNodesBounds:d=>{const{nodeLookup:v,nodeOrigin:_}=t.getState();return Xz(d,{nodeLookup:v,nodeOrigin:_})},getHandleConnections:({type:d,id:v,nodeId:_})=>{var C;return Array.from(((C=t.getState().connectionLookup.get(`${_}-${d}${v?`-${v}`:""}`))==null?void 0:C.values())??[])},getNodeConnections:({type:d,handleId:v,nodeId:_})=>{var C;return Array.from(((C=t.getState().connectionLookup.get(`${_}${d?v?`-${d}-${v}`:`-${d}`:""}`))==null?void 0:C.values())??[])},fitView:async d=>{const v=t.getState().fitViewResolver??nH();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:v}),n.nodeQueue.push(_=>[..._]),v.promise}}},[]);return G.useMemo(()=>({...a,...e,viewportInitialized:r}),[r])}const FS=e=>e.selected,jF=typeof window<"u"?window:void 0;function LF({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Rt(),{deleteElements:r}=Jm(),a=ll(e,{actInsideInputWithModifier:!1}),l=ll(t,{target:jF});G.useEffect(()=>{if(a){const{edges:u,nodes:o}=n.getState();r({nodes:o.filter(FS),edges:u.filter(FS)}),n.setState({nodesSelectionActive:!1})}},[a]),G.useEffect(()=>{n.setState({multiSelectionActive:l})},[l])}function OF(e){const t=Rt();G.useEffect(()=>{const n=()=>{var a,l,u,o;if(!e.current||!(((l=(a=e.current).checkVisibility)==null?void 0:l.call(a))??!0))return!1;const r=Ym(e.current);(r.height===0||r.width===0)&&((o=(u=t.getState()).onError)==null||o.call(u,"004",ei.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Mh={position:"absolute",width:"100%",height:"100%",top:0,left:0},BF=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function IF({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=os.Free,zoomOnDoubleClick:u=!0,panOnDrag:o=!0,defaultViewport:c,translateExtent:f,minZoom:p,maxZoom:d,zoomActivationKeyCode:v,preventScrolling:_=!0,children:C,noWheelClassName:w,noPanClassName:S,onViewportChange:y,isControlledViewport:x,paneClickDistance:b,selectionOnDrag:E}){const R=Rt(),N=G.useRef(null),{userSelectionActive:D,lib:T,connectionInProgress:j}=it(BF,Tt),B=ll(v),z=G.useRef();OF(N);const V=G.useCallback(F=>{y==null||y({x:F[0],y:F[1],zoom:F[2]}),x||R.setState({transform:F})},[y,x]);return G.useEffect(()=>{if(N.current){z.current=HH({domNode:N.current,minZoom:p,maxZoom:d,translateExtent:f,viewport:c,onDraggingChange:q=>R.setState(X=>X.paneDragging===q?X:{paneDragging:q}),onPanZoomStart:(q,X)=>{const{onViewportChangeStart:K,onMoveStart:L}=R.getState();L==null||L(q,X),K==null||K(X)},onPanZoom:(q,X)=>{const{onViewportChange:K,onMove:L}=R.getState();L==null||L(q,X),K==null||K(X)},onPanZoomEnd:(q,X)=>{const{onViewportChangeEnd:K,onMoveEnd:L}=R.getState();L==null||L(q,X),K==null||K(X)}});const{x:F,y:P,zoom:Y}=z.current.getViewport();return R.setState({panZoom:z.current,transform:[F,P,Y],domNode:N.current.closest(".react-flow")}),()=>{var q;(q=z.current)==null||q.destroy()}}},[]),G.useEffect(()=>{var F;(F=z.current)==null||F.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:a,panOnScrollMode:l,zoomOnDoubleClick:u,panOnDrag:o,zoomActivationKeyPressed:B,preventScrolling:_,noPanClassName:S,userSelectionActive:D,noWheelClassName:w,lib:T,onTransformChange:V,connectionInProgress:j,selectionOnDrag:E,paneClickDistance:b})},[e,t,n,r,a,l,u,o,B,_,S,D,w,T,V,j,E,b]),g.jsx("div",{className:"react-flow__renderer",ref:N,style:Mh,children:C})}const zF=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function HF(){const{userSelectionActive:e,userSelectionRect:t}=it(zF,Tt);return e&&t?g.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Dp=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},FF=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function PF({isSelecting:e,selectionKeyPressed:t,selectionMode:n=sl.Full,panOnDrag:r,autoPanOnSelection:a,paneClickDistance:l,selectionOnDrag:u,onSelectionStart:o,onSelectionEnd:c,onPaneClick:f,onPaneContextMenu:p,onPaneScroll:d,onPaneMouseEnter:v,onPaneMouseMove:_,onPaneMouseLeave:C,children:w}){const S=G.useRef(0),y=Rt(),{userSelectionActive:x,elementsSelectable:b,dragging:E,panBy:R,autoPanSpeed:N}=it(FF,Tt),D=b&&(e||x),T=G.useRef(null),j=G.useRef(),B=G.useRef(new Set),z=G.useRef(new Set),V=G.useRef(!1),F=G.useRef(!1),P=G.useRef({x:0,y:0}),Y=G.useRef(!1),q=H=>{if(F.current||V.current||y.getState().connection.inProgress){F.current=!1,V.current=!1;return}f==null||f(H),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},X=H=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){H.preventDefault();return}p==null||p(H)},K=d?H=>d(H):void 0,L=H=>{F.current&&(H.stopPropagation(),F.current=!1)},M=H=>{var we,ft;const{domNode:ee,transform:ne}=y.getState();if(j.current=ee==null?void 0:ee.getBoundingClientRect(),!j.current)return;const pe=H.target===T.current;if(!pe&&!!H.target.closest(".nokey")||!e||!(u&&pe||t)||H.button!==0||!H.isPrimary)return;(ft=(we=H.target)==null?void 0:we.setPointerCapture)==null||ft.call(we,H.pointerId),F.current=!1;const{x:Ce,y:Ee}=Qn(H.nativeEvent,j.current),Ne=Sl({x:Ce,y:Ee},ne);y.setState({userSelectionRect:{width:0,height:0,startX:Ne.x,startY:Ne.y,x:Ce,y:Ee}}),pe||(H.stopPropagation(),H.preventDefault())};function O(H,ee){const{userSelectionRect:ne}=y.getState();if(!ne)return;const{transform:pe,nodeLookup:fe,edgeLookup:ye,connectionLookup:Ce,triggerNodeChanges:Ee,triggerEdgeChanges:Ne,defaultEdgeOptions:we}=y.getState(),ft={x:ne.startX,y:ne.startY},{x:Ct,y:st}=Ca(ft,pe),Ye={startX:ft.x,startY:ft.y,x:HPe.id)),z.current=new Set;const qe=(we==null?void 0:we.selectable)??!0;for(const Pe of B.current){const ue=Ce.get(Pe);if(ue)for(const{edgeId:_e}of ue.values()){const ke=ye.get(_e);ke&&(ke.selectable??qe)&&z.current.add(_e)}}if(!uS(vt,B.current)){const Pe=pa(fe,B.current,!0);Ee(Pe)}if(!uS(dt,z.current)){const Pe=pa(ye,z.current);Ne(Pe)}y.setState({userSelectionRect:Ye,userSelectionActive:!0,nodesSelectionActive:!1})}function U(){if(!a||!j.current)return;const[H,ee]=qm(P.current,j.current,N);R({x:H,y:ee}).then(ne=>{if(!F.current||!ne){S.current=requestAnimationFrame(U);return}const{x:pe,y:fe}=P.current;O(pe,fe),S.current=requestAnimationFrame(U)})}const $=()=>{cancelAnimationFrame(S.current),S.current=0,Y.current=!1};G.useEffect(()=>()=>$(),[]);const Q=H=>{const{userSelectionRect:ee,transform:ne,resetSelectedElements:pe}=y.getState();if(!j.current||!ee)return;const{x:fe,y:ye}=Qn(H.nativeEvent,j.current);P.current={x:fe,y:ye};const Ce=Ca({x:ee.startX,y:ee.startY},ne);if(!F.current){const Ee=t?0:l;if(Math.hypot(fe-Ce.x,ye-Ce.y)<=Ee)return;pe(),o==null||o(H)}F.current=!0,Y.current||(U(),Y.current=!0),O(fe,ye)},re=H=>{var ee,ne;if(!D){H.target===T.current&&y.getState().connection.inProgress&&(V.current=!0);return}H.button===0&&((ne=(ee=H.target)==null?void 0:ee.releasePointerCapture)==null||ne.call(ee,H.pointerId),!x&&H.target===T.current&&y.getState().userSelectionRect&&(q==null||q(H)),y.setState({userSelectionActive:!1,userSelectionRect:null}),F.current&&(c==null||c(H),y.setState({nodesSelectionActive:B.current.size>0})),$())},se=H=>{var ee,ne;(ne=(ee=H.target)==null?void 0:ee.releasePointerCapture)==null||ne.call(ee,H.pointerId),$()},Z=r===!0||Array.isArray(r)&&r.includes(0);return g.jsxs("div",{className:$t(["react-flow__pane",{draggable:Z,dragging:E,selection:e}]),onClick:D?void 0:Dp(q,T),onContextMenu:Dp(X,T),onWheel:Dp(K,T),onPointerEnter:D?void 0:v,onPointerMove:D?Q:_,onPointerUp:re,onPointerCancel:D?se:void 0,onPointerDownCapture:D?M:void 0,onClickCapture:D?L:void 0,onPointerLeave:C,ref:T,style:Mh,children:[w,g.jsx(HF,{})]})}function Eg({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:a,unselectNodesAndEdges:l,multiSelectionActive:u,nodeLookup:o,onError:c}=t.getState(),f=o.get(e);if(!f){c==null||c("012",ei.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&u)&&(l({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var p;return(p=r==null?void 0:r.current)==null?void 0:p.blur()})):a([e])}function X2({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:a,isSelectable:l,nodeClickDistance:u}){const o=Rt(),[c,f]=G.useState(!1),p=G.useRef();return G.useEffect(()=>{p.current=EH({getStoreItems:()=>o.getState(),onNodeMouseDown:d=>{Eg({id:d,store:o,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),G.useEffect(()=>{if(!(t||!e.current||!p.current))return p.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:l,nodeId:a,nodeClickDistance:u}),()=>{var d;(d=p.current)==null||d.destroy()}},[n,r,t,l,e,a,u]),c}const $F=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function K2(){const e=Rt();return G.useCallback(n=>{const{nodeExtent:r,snapToGrid:a,snapGrid:l,nodesDraggable:u,onError:o,updateNodePositions:c,nodeLookup:f,nodeOrigin:p}=e.getState(),d=new Map,v=$F(u),_=a?l[0]:5,C=a?l[1]:5,w=n.direction.x*_*n.factor,S=n.direction.y*C*n.factor;for(const[,y]of f){if(!v(y))continue;let x={x:y.internals.positionAbsolute.x+w,y:y.internals.positionAbsolute.y+S};a&&(x=bl(x,l));const{position:b,positionAbsolute:E}=m2({nodeId:y.id,nextPosition:x,nodeLookup:f,nodeExtent:r,nodeOrigin:p,onError:o});y.position=b,y.internals.positionAbsolute=E,d.set(y.id,y)}c(d)},[])}const e0=G.createContext(null),UF=e0.Provider;e0.Consumer;const Z2=()=>G.useContext(e0),GF=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),Q2=G.createContext(null);function qF({children:e}){const t=it(GF,Tt);return g.jsx(Q2.Provider,{value:t,children:e})}function VF(){const e=G.useContext(Q2);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const YF={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},WF=(e,t,n)=>r=>{const{connectionClickStartHandle:a,connectionMode:l,connection:u}=r,{fromHandle:o,toHandle:c,isValid:f}=u;if(!o&&!a)return YF;const p=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,connectingTo:p,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,isPossibleEndHandle:l===xa.Strict?(o==null?void 0:o.type)!==n:e!==(o==null?void 0:o.nodeId)||t!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!a,valid:p&&f}};function XF({type:e="source",position:t=je.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:l=!0,id:u,onConnect:o,children:c,className:f,onMouseDown:p,onTouchStart:d,...v},_){var Y,q;const C=u||null,w=e==="target",S=Rt(),y=Z2(),{connectOnClick:x,noPanClassName:b,rfId:E}=VF(),{connectingFrom:R,connectingTo:N,clickConnecting:D,isPossibleEndHandle:T,connectionInProcess:j,clickConnectionInProcess:B,valid:z}=it(WF(y,C,e),Tt);y||(q=(Y=S.getState()).onError)==null||q.call(Y,"010",ei.error010());const V=X=>{const{defaultEdgeOptions:K,onConnect:L,hasDefaultEdges:M}=S.getState(),O={...K,...X};if(M){const{edges:U,setEdges:$,onError:Q}=S.getState();$(kF(O,U,{onError:Q}))}L==null||L(O),o==null||o(O)},F=X=>{if(!y)return;const K=E2(X.nativeEvent);if(a&&(K&&X.button===0||!K)){const L=S.getState();Cg.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:L.autoPanOnConnect,connectionMode:L.connectionMode,connectionRadius:L.connectionRadius,domNode:L.domNode,nodeLookup:L.nodeLookup,lib:L.lib,isTarget:w,handleId:C,nodeId:y,flowId:L.rfId,panBy:L.panBy,cancelConnection:L.cancelConnection,onConnectStart:L.onConnectStart,onConnectEnd:(...M)=>{var O,U;return(U=(O=S.getState()).onConnectEnd)==null?void 0:U.call(O,...M)},updateConnection:L.updateConnection,onConnect:V,isValidConnection:n||((...M)=>{var O,U;return((U=(O=S.getState()).isValidConnection)==null?void 0:U.call(O,...M))??!0}),getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:L.autoPanSpeed,dragThreshold:L.connectionDragThreshold})}K?p==null||p(X):d==null||d(X)},P=X=>{const{onClickConnectStart:K,onClickConnectEnd:L,connectionClickStartHandle:M,connectionMode:O,isValidConnection:U,lib:$,rfId:Q,nodeLookup:re,connection:se}=S.getState();if(!y||!M&&!a)return;if(!M){K==null||K(X.nativeEvent,{nodeId:y,handleId:C,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:y,type:e,id:C}});return}const Z=w2(X.target),H=n||U,{connection:ee,isValid:ne}=Cg.isValid(X.nativeEvent,{handle:{nodeId:y,id:C,type:e},connectionMode:O,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:H,flowId:Q,doc:Z,lib:$,nodeLookup:re});ne&&ee&&V(ee);const pe=structuredClone(se);delete pe.inProgress,pe.toPosition=pe.toHandle?pe.toHandle.position:null,L==null||L(X,pe),S.setState({connectionClickStartHandle:null})};return g.jsx("div",{"data-handleid":C,"data-nodeid":y,"data-handlepos":t,"data-id":`${E}-${y}-${C}-${e}`,className:$t(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",b,f,{source:!w,target:w,connectable:r,connectablestart:a,connectableend:l,clickconnecting:D,connectingfrom:R,connectingto:N,valid:z,connectionindicator:r&&(!j||T)&&(j||B?l:a)}]),onMouseDown:F,onTouchStart:F,onClick:x?P:void 0,ref:_,...v,children:c})}const ka=G.memo(Y2(XF));function KF({data:e,isConnectable:t,sourcePosition:n=je.Bottom}){return g.jsxs(g.Fragment,{children:[e==null?void 0:e.label,g.jsx(ka,{type:"source",position:n,isConnectable:t})]})}function ZF({data:e,isConnectable:t,targetPosition:n=je.Top,sourcePosition:r=je.Bottom}){return g.jsxs(g.Fragment,{children:[g.jsx(ka,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,g.jsx(ka,{type:"source",position:r,isConnectable:t})]})}function QF(){return null}function JF({data:e,isConnectable:t,targetPosition:n=je.Top}){return g.jsxs(g.Fragment,{children:[g.jsx(ka,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const qu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},PS={input:KF,default:ZF,output:JF,group:QF};function eP(e){var t,n,r,a;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((a=e.style)==null?void 0:a.height)}}const tP=e=>{const{width:t,height:n,x:r,y:a}=yl(e.nodeLookup,{filter:l=>!!l.selected});return{width:Zn(t)?t:null,height:Zn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${a}px)`}};function nP({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Rt(),{width:a,height:l,transformString:u,userSelectionActive:o}=it(tP,Tt),c=K2(),f=G.useRef(null);G.useEffect(()=>{var _;n||(_=f.current)==null||_.focus({preventScroll:!0})},[n]);const p=!o&&a!==null&&l!==null;if(X2({nodeRef:f,disabled:!p}),!p)return null;const d=e?_=>{const C=r.getState().nodes.filter(w=>w.selected);e(_,C)}:void 0,v=_=>{Object.prototype.hasOwnProperty.call(qu,_.key)&&(_.preventDefault(),c({direction:qu[_.key],factor:_.shiftKey?4:1}))};return g.jsx("div",{className:$t(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u},children:g.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:v,style:{width:a,height:l}})})}const $S=typeof window<"u"?window:void 0,iP=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function J2({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:u,paneClickDistance:o,deleteKeyCode:c,selectionKeyCode:f,selectionOnDrag:p,selectionMode:d,onSelectionStart:v,onSelectionEnd:_,multiSelectionKeyCode:C,panActivationKeyCode:w,zoomActivationKeyCode:S,elementsSelectable:y,zoomOnScroll:x,zoomOnPinch:b,panOnScroll:E,panOnScrollSpeed:R,panOnScrollMode:N,zoomOnDoubleClick:D,panOnDrag:T,autoPanOnSelection:j,defaultViewport:B,translateExtent:z,minZoom:V,maxZoom:F,preventScrolling:P,onSelectionContextMenu:Y,noWheelClassName:q,noPanClassName:X,disableKeyboardA11y:K,onViewportChange:L,isControlledViewport:M}){const{nodesSelectionActive:O,userSelectionActive:U}=it(iP,Tt),$=ll(f,{target:$S}),Q=ll(w,{target:$S}),re=Q||T,se=Q||E,Z=p&&re!==!0,H=$||U||Z;return LF({deleteKeyCode:c,multiSelectionKeyCode:C}),g.jsx(IF,{onPaneContextMenu:l,elementsSelectable:y,zoomOnScroll:x,zoomOnPinch:b,panOnScroll:se,panOnScrollSpeed:R,panOnScrollMode:N,zoomOnDoubleClick:D,panOnDrag:!$&&re,defaultViewport:B,translateExtent:z,minZoom:V,maxZoom:F,zoomActivationKeyCode:S,preventScrolling:P,noWheelClassName:q,noPanClassName:X,onViewportChange:L,isControlledViewport:M,paneClickDistance:o,selectionOnDrag:Z,children:g.jsxs(PF,{onSelectionStart:v,onSelectionEnd:_,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:u,panOnDrag:re,autoPanOnSelection:j,isSelecting:!!H,selectionMode:d,selectionKeyPressed:$,paneClickDistance:o,selectionOnDrag:Z,children:[e,O&&g.jsx(nP,{onSelectionContextMenu:Y,noPanClassName:X,disableKeyboardA11y:K})]})})}J2.displayName="FlowRenderer";const rP=G.memo(J2),sP=e=>t=>e?Gm(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function aP(e){return it(G.useCallback(sP(e),[e]),Tt)}const oP=e=>e.updateNodeInternals;function lP(){const e=it(oP),[t]=G.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(a=>{const l=a.target.getAttribute("data-id");r.set(l,{id:l,nodeElement:a.target,force:!0})}),e(r)}));return G.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function cP({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const a=Rt(),l=G.useRef(null),u=G.useRef(null),o=G.useRef(e.sourcePosition),c=G.useRef(e.targetPosition),f=G.useRef(t),p=n&&!!e.internals.handleBounds;return G.useEffect(()=>{l.current&&!e.hidden&&(!p||u.current!==l.current)&&(u.current&&(r==null||r.unobserve(u.current)),r==null||r.observe(l.current),u.current=l.current)},[p,e.hidden]),G.useEffect(()=>()=>{u.current&&(r==null||r.unobserve(u.current),u.current=null)},[]),G.useEffect(()=>{if(l.current){const d=f.current!==t,v=o.current!==e.sourcePosition,_=c.current!==e.targetPosition;(d||v||_)&&(f.current=t,o.current=e.sourcePosition,c.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function uP({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:a,onContextMenu:l,onDoubleClick:u,nodesDraggable:o,elementsSelectable:c,nodesConnectable:f,nodesFocusable:p,resizeObserver:d,noDragClassName:v,noPanClassName:_,disableKeyboardA11y:C,rfId:w,nodeTypes:S,nodeClickDistance:y,onError:x}){const{node:b,internals:E,isParent:R}=it(H=>{const ee=H.nodeLookup.get(e),ne=H.parentLookup.has(e);return{node:ee,internals:ee.internals,isParent:ne}},Tt);let N=b.type||"default",D=(S==null?void 0:S[N])||PS[N];D===void 0&&(x==null||x("003",ei.error003(N)),N="default",D=(S==null?void 0:S.default)||PS.default);const T=!!(b.draggable||o&&typeof b.draggable>"u"),j=!!(b.selectable||c&&typeof b.selectable>"u"),B=!!(b.connectable||f&&typeof b.connectable>"u"),z=!!(b.focusable||p&&typeof b.focusable>"u"),V=Rt(),F=S2(b),P=cP({node:b,nodeType:N,hasDimensions:F,resizeObserver:d}),Y=X2({nodeRef:P,disabled:b.hidden||!T,noDragClassName:v,handleSelector:b.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:y}),q=K2();if(b.hidden)return null;const X=Wi(b),K=eP(b),L=j||T||t||n||r||a,M=n?H=>n(H,{...E.userNode}):void 0,O=r?H=>r(H,{...E.userNode}):void 0,U=a?H=>a(H,{...E.userNode}):void 0,$=l?H=>l(H,{...E.userNode}):void 0,Q=u?H=>u(H,{...E.userNode}):void 0,re=H=>{const{selectNodesOnDrag:ee,nodeDragThreshold:ne}=V.getState();j&&(!ee||!T||ne>0)&&Eg({id:e,store:V,nodeRef:P}),t&&t(H,{...E.userNode})},se=H=>{if(!(C2(H.nativeEvent)||C)){if(h2.includes(H.key)&&j){const ee=H.key==="Escape";Eg({id:e,store:V,unselect:ee,nodeRef:P})}else if(T&&b.selected&&Object.prototype.hasOwnProperty.call(qu,H.key)){H.preventDefault();const{ariaLabelConfig:ee}=V.getState();V.setState({ariaLiveMessage:ee["node.a11yDescription.ariaLiveMessage"]({direction:H.key.replace("Arrow","").toLowerCase(),x:~~E.positionAbsolute.x,y:~~E.positionAbsolute.y})}),q({direction:qu[H.key],factor:H.shiftKey?4:1})}}},Z=()=>{var Ce;if(C||!((Ce=P.current)!=null&&Ce.matches(":focus-visible")))return;const{transform:H,width:ee,height:ne,autoPanOnNodeFocus:pe,setCenter:fe}=V.getState();if(!pe)return;Gm(new Map([[e,b]]),{x:0,y:0,width:ee,height:ne},H,!0).length>0||fe(b.position.x+X.width/2,b.position.y+X.height/2,{zoom:H[2]})};return g.jsx("div",{className:$t(["react-flow__node",`react-flow__node-${N}`,{[_]:T},b.className,{selected:b.selected,selectable:j,parent:R,draggable:T,dragging:Y}]),ref:P,style:{zIndex:E.z,transform:`translate(${E.positionAbsolute.x}px,${E.positionAbsolute.y}px)`,pointerEvents:L?"all":"none",visibility:F?"visible":"hidden",...b.style,...K},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:M,onMouseMove:O,onMouseLeave:U,onContextMenu:$,onClick:re,onDoubleClick:Q,onKeyDown:z?se:void 0,tabIndex:z?0:void 0,onFocus:z?Z:void 0,role:b.ariaRole??(z?"group":void 0),"aria-roledescription":"node","aria-describedby":C?void 0:`${U2}-${w}`,"aria-label":b.ariaLabel,...b.domAttributes,children:g.jsx(UF,{value:e,children:g.jsx(D,{id:e,data:b.data,type:N,positionAbsoluteX:E.positionAbsolute.x,positionAbsoluteY:E.positionAbsolute.y,selected:b.selected??!1,selectable:j,draggable:T,deletable:b.deletable??!0,isConnectable:B,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:Y,dragHandle:b.dragHandle,zIndex:E.z,parentId:b.parentId,...X})})})}var hP=G.memo(uP);const fP=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function eE(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,onError:l}=it(fP,Tt),u=aP(e.onlyRenderVisibleElements),o=lP();return g.jsx("div",{className:"react-flow__nodes",style:Mh,children:u.map(c=>g.jsx(hP,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:l},c))})}eE.displayName="NodeRenderer";const dP=G.memo(eE);function pP(e){return it(G.useCallback(n=>{if(!e)return n.edges.map(a=>a.id);const r=[];if(n.width&&n.height)for(const a of n.edges){const l=n.nodeLookup.get(a.source),u=n.nodeLookup.get(a.target);l&&u&&aH({sourceNode:l,targetNode:u,width:n.width,height:n.height,transform:n.transform})&&r.push(a.id)}return r},[e]),Tt)}const gP=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return g.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},mP=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return g.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},US={[$u.Arrow]:gP,[$u.ArrowClosed]:mP};function vP(e){const t=Rt();return G.useMemo(()=>{var a,l;return Object.prototype.hasOwnProperty.call(US,e)?US[e]:((l=(a=t.getState()).onError)==null||l.call(a,"009",ei.error009(e)),null)},[e])}const _P=({id:e,type:t,color:n,width:r=12.5,height:a=12.5,markerUnits:l="strokeWidth",strokeWidth:u,orient:o="auto-start-reverse"})=>{const c=vP(t);return c?g.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:o,refX:"0",refY:"0",children:g.jsx(c,{color:n,strokeWidth:u})}):null},tE=({defaultColor:e,rfId:t})=>{const n=it(l=>l.edges),r=it(l=>l.defaultEdgeOptions),a=G.useMemo(()=>pH(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return a.length?g.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:g.jsx("defs",{children:a.map(l=>g.jsx(_P,{id:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,strokeWidth:l.strokeWidth,orient:l.orient},l.id))})}):null};tE.displayName="MarkerDefinitions";var yP=G.memo(tE);function nE({x:e,y:t,label:n,labelStyle:r,labelShowBg:a=!0,labelBgStyle:l,labelBgPadding:u=[2,4],labelBgBorderRadius:o=2,children:c,className:f,...p}){const[d,v]=G.useState({x:1,y:0,width:0,height:0}),_=$t(["react-flow__edge-textwrapper",f]),C=G.useRef(null);return G.useEffect(()=>{if(C.current){const w=C.current.getBBox();v({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?g.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:_,visibility:d.width?"visible":"hidden",...p,children:[a&&g.jsx("rect",{width:d.width+2*u[0],x:-u[0],y:-u[1],height:d.height+2*u[1],className:"react-flow__edge-textbg",style:l,rx:o,ry:o}),g.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:C,style:r,children:n}),c]}):null}nE.displayName="EdgeText";const bP=G.memo(nE);function jh({path:e,labelX:t,labelY:n,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:o,labelBgBorderRadius:c,interactionWidth:f=20,...p}){return g.jsxs(g.Fragment,{children:[g.jsx("path",{...p,d:e,fill:"none",className:$t(["react-flow__edge-path",p.className])}),f?g.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&Zn(t)&&Zn(n)?g.jsx(bP,{x:t,y:n,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:o,labelBgBorderRadius:c}):null]})}function GS({pos:e,x1:t,y1:n,x2:r,y2:a}){return e===je.Left||e===je.Right?[.5*(t+r),n]:[t,.5*(n+a)]}function iE({sourceX:e,sourceY:t,sourcePosition:n=je.Bottom,targetX:r,targetY:a,targetPosition:l=je.Top}){const[u,o]=GS({pos:n,x1:e,y1:t,x2:r,y2:a}),[c,f]=GS({pos:l,x1:r,y1:a,x2:e,y2:t}),[p,d,v,_]=k2({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:u,sourceControlY:o,targetControlX:c,targetControlY:f});return[`M${e},${t} C${u},${o} ${c},${f} ${r},${a}`,p,d,v,_]}function rE(e){return G.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,sourcePosition:u,targetPosition:o,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:v,labelBgBorderRadius:_,style:C,markerEnd:w,markerStart:S,interactionWidth:y})=>{const[x,b,E]=iE({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:l,targetPosition:o}),R=e.isInternal?void 0:t;return g.jsx(jh,{id:R,path:x,labelX:b,labelY:E,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:v,labelBgBorderRadius:_,style:C,markerEnd:w,markerStart:S,interactionWidth:y})})}const SP=rE({isInternal:!1}),sE=rE({isInternal:!0});SP.displayName="SimpleBezierEdge";sE.displayName="SimpleBezierEdgeInternal";function aE(e){return G.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:v,sourcePosition:_=je.Bottom,targetPosition:C=je.Top,markerEnd:w,markerStart:S,pathOptions:y,interactionWidth:x})=>{const[b,E,R]=Sg({sourceX:n,sourceY:r,sourcePosition:_,targetX:a,targetY:l,targetPosition:C,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset,stepPosition:y==null?void 0:y.stepPosition}),N=e.isInternal?void 0:t;return g.jsx(jh,{id:N,path:b,labelX:E,labelY:R,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:v,markerEnd:w,markerStart:S,interactionWidth:x})})}const oE=aE({isInternal:!1}),lE=aE({isInternal:!0});oE.displayName="SmoothStepEdge";lE.displayName="SmoothStepEdgeInternal";function cE(e){return G.memo(({id:t,...n})=>{var a;const r=e.isInternal?void 0:t;return g.jsx(oE,{...n,id:r,pathOptions:G.useMemo(()=>{var l;return{borderRadius:0,offset:(l=n.pathOptions)==null?void 0:l.offset}},[(a=n.pathOptions)==null?void 0:a.offset])})})}const xP=cE({isInternal:!1}),uE=cE({isInternal:!0});xP.displayName="StepEdge";uE.displayName="StepEdgeInternal";function hE(e){return G.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:v,markerEnd:_,markerStart:C,interactionWidth:w})=>{const[S,y,x]=T2({sourceX:n,sourceY:r,targetX:a,targetY:l}),b=e.isInternal?void 0:t;return g.jsx(jh,{id:b,path:S,labelX:y,labelY:x,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:v,markerEnd:_,markerStart:C,interactionWidth:w})})}const wP=hE({isInternal:!1}),fE=hE({isInternal:!0});wP.displayName="StraightEdge";fE.displayName="StraightEdgeInternal";function dE(e){return G.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,sourcePosition:u=je.Bottom,targetPosition:o=je.Top,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:v,labelBgBorderRadius:_,style:C,markerEnd:w,markerStart:S,pathOptions:y,interactionWidth:x})=>{const[b,E,R]=A2({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:l,targetPosition:o,curvature:y==null?void 0:y.curvature}),N=e.isInternal?void 0:t;return g.jsx(jh,{id:N,path:b,labelX:E,labelY:R,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:v,labelBgBorderRadius:_,style:C,markerEnd:w,markerStart:S,interactionWidth:x})})}const CP=dE({isInternal:!1}),pE=dE({isInternal:!0});CP.displayName="BezierEdge";pE.displayName="BezierEdgeInternal";const qS={default:pE,straight:fE,step:uE,smoothstep:lE,simplebezier:sE},VS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},EP=(e,t,n)=>n===je.Left?e-t:n===je.Right?e+t:e,kP=(e,t,n)=>n===je.Top?e-t:n===je.Bottom?e+t:e,YS="react-flow__edgeupdater";function WS({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:a,onMouseEnter:l,onMouseOut:u,type:o}){return g.jsx("circle",{onMouseDown:a,onMouseEnter:l,onMouseOut:u,className:$t([YS,`${YS}-${o}`]),cx:EP(t,r,e),cy:kP(n,r,e),r,stroke:"transparent",fill:"transparent"})}function AP({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:a,targetX:l,targetY:u,sourcePosition:o,targetPosition:c,onReconnect:f,onReconnectStart:p,onReconnectEnd:d,setReconnecting:v,setUpdateHover:_}){const C=Rt(),w=(E,R)=>{if(E.button!==0)return;const{autoPanOnConnect:N,domNode:D,connectionMode:T,connectionRadius:j,lib:B,onConnectStart:z,cancelConnection:V,nodeLookup:F,rfId:P,panBy:Y,updateConnection:q}=C.getState(),X=R.type==="target",K=(O,U)=>{v(!1),d==null||d(O,n,R.type,U)},L=O=>f==null?void 0:f(n,O),M=(O,U)=>{v(!0),p==null||p(E,n,R.type),z==null||z(O,U)};Cg.onPointerDown(E.nativeEvent,{autoPanOnConnect:N,connectionMode:T,connectionRadius:j,domNode:D,handleId:R.id,nodeId:R.nodeId,nodeLookup:F,isTarget:X,edgeUpdaterType:R.type,lib:B,flowId:P,cancelConnection:V,panBy:Y,isValidConnection:(...O)=>{var U,$;return(($=(U=C.getState()).isValidConnection)==null?void 0:$.call(U,...O))??!0},onConnect:L,onConnectStart:M,onConnectEnd:(...O)=>{var U,$;return($=(U=C.getState()).onConnectEnd)==null?void 0:$.call(U,...O)},onReconnectEnd:K,updateConnection:q,getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,dragThreshold:C.getState().connectionDragThreshold,handleDomNode:E.currentTarget})},S=E=>w(E,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=E=>w(E,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),x=()=>_(!0),b=()=>_(!1);return g.jsxs(g.Fragment,{children:[(e===!0||e==="source")&&g.jsx(WS,{position:o,centerX:r,centerY:a,radius:t,onMouseDown:S,onMouseEnter:x,onMouseOut:b,type:"source"}),(e===!0||e==="target")&&g.jsx(WS,{position:c,centerX:l,centerY:u,radius:t,onMouseDown:y,onMouseEnter:x,onMouseOut:b,type:"target"})]})}function NP({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:a,onDoubleClick:l,onContextMenu:u,onMouseEnter:o,onMouseMove:c,onMouseLeave:f,reconnectRadius:p,onReconnect:d,onReconnectStart:v,onReconnectEnd:_,rfId:C,edgeTypes:w,noPanClassName:S,onError:y,disableKeyboardA11y:x}){let b=it(fe=>fe.edgeLookup.get(e));const E=it(fe=>fe.defaultEdgeOptions);b=E?{...E,...b}:b;let R=b.type||"default",N=(w==null?void 0:w[R])||qS[R];N===void 0&&(y==null||y("011",ei.error011(R)),R="default",N=(w==null?void 0:w.default)||qS.default);const D=!!(b.focusable||t&&typeof b.focusable>"u"),T=typeof d<"u"&&(b.reconnectable||n&&typeof b.reconnectable>"u"),j=!!(b.selectable||r&&typeof b.selectable>"u"),B=G.useRef(null),[z,V]=G.useState(!1),[F,P]=G.useState(!1),Y=Rt(),{zIndex:q=b.zIndex,sourceX:X,sourceY:K,targetX:L,targetY:M,sourcePosition:O,targetPosition:U}=it(G.useCallback(fe=>{const ye=fe.nodeLookup.get(b.source),Ce=fe.nodeLookup.get(b.target);if(!ye||!Ce)return VS;const Ee=dH({id:e,sourceNode:ye,targetNode:Ce,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:fe.connectionMode,onError:y}),Ne=sH({selected:b.selected,zIndex:b.zIndex,sourceNode:ye,targetNode:Ce,elevateOnSelect:fe.elevateEdgesOnSelect,zIndexMode:fe.zIndexMode});return{...Ee||VS,zIndex:Ne}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex]),Tt),$=G.useMemo(()=>b.markerStart?`url('#${xg(b.markerStart,C)}')`:void 0,[b.markerStart,C]),Q=G.useMemo(()=>b.markerEnd?`url('#${xg(b.markerEnd,C)}')`:void 0,[b.markerEnd,C]);if(b.hidden||X===null||K===null||L===null||M===null)return null;const re=fe=>{var Ne;const{addSelectedEdges:ye,unselectNodesAndEdges:Ce,multiSelectionActive:Ee}=Y.getState();j&&(Y.setState({nodesSelectionActive:!1}),b.selected&&Ee?(Ce({nodes:[],edges:[b]}),(Ne=B.current)==null||Ne.blur()):ye([e])),a&&a(fe,b)},se=l?fe=>{l(fe,{...b})}:void 0,Z=u?fe=>{u(fe,{...b})}:void 0,H=o?fe=>{o(fe,{...b})}:void 0,ee=c?fe=>{c(fe,{...b})}:void 0,ne=f?fe=>{f(fe,{...b})}:void 0,pe=fe=>{var ye;if(!x&&h2.includes(fe.key)&&j){const{unselectNodesAndEdges:Ce,addSelectedEdges:Ee}=Y.getState();fe.key==="Escape"?((ye=B.current)==null||ye.blur(),Ce({edges:[b]})):Ee([e])}};return g.jsx("svg",{style:{zIndex:q},children:g.jsxs("g",{className:$t(["react-flow__edge",`react-flow__edge-${R}`,b.className,S,{selected:b.selected,animated:b.animated,inactive:!j&&!a,updating:z,selectable:j}]),onClick:re,onDoubleClick:se,onContextMenu:Z,onMouseEnter:H,onMouseMove:ee,onMouseLeave:ne,onKeyDown:D?pe:void 0,tabIndex:D?0:void 0,role:b.ariaRole??(D?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":b.ariaLabel===null?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":D?`${G2}-${C}`:void 0,ref:B,...b.domAttributes,children:[!F&&g.jsx(N,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:j,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:X,sourceY:K,targetX:L,targetY:M,sourcePosition:O,targetPosition:U,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:$,markerEnd:Q,pathOptions:"pathOptions"in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),T&&g.jsx(AP,{edge:b,isReconnectable:T,reconnectRadius:p,onReconnect:d,onReconnectStart:v,onReconnectEnd:_,sourceX:X,sourceY:K,targetX:L,targetY:M,sourcePosition:O,targetPosition:U,setUpdateHover:V,setReconnecting:P})]})})}var TP=G.memo(NP);const RP=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function gE({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:a,onReconnect:l,onEdgeContextMenu:u,onEdgeMouseEnter:o,onEdgeMouseMove:c,onEdgeMouseLeave:f,onEdgeClick:p,reconnectRadius:d,onEdgeDoubleClick:v,onReconnectStart:_,onReconnectEnd:C,disableKeyboardA11y:w}){const{edgesFocusable:S,edgesReconnectable:y,elementsSelectable:x,onError:b}=it(RP,Tt),E=pP(t);return g.jsxs("div",{className:"react-flow__edges",children:[g.jsx(yP,{defaultColor:e,rfId:n}),E.map(R=>g.jsx(TP,{id:R,edgesFocusable:S,edgesReconnectable:y,elementsSelectable:x,noPanClassName:a,onReconnect:l,onContextMenu:u,onMouseEnter:o,onMouseMove:c,onMouseLeave:f,onClick:p,reconnectRadius:d,onDoubleClick:v,onReconnectStart:_,onReconnectEnd:C,rfId:n,onError:b,edgeTypes:r,disableKeyboardA11y:w},R))]})}gE.displayName="EdgeRenderer";const DP=G.memo(gE),MP=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function jP({children:e}){const t=it(MP);return g.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function LP(e){const t=Jm(),n=G.useRef(!1);G.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const OP=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function BP(e){const t=it(OP),n=Rt();return G.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function IP(e){return e.connection.inProgress?{...e.connection,to:Sl(e.connection.to,e.transform)}:{...e.connection}}function zP(e){return IP}function HP(e){const t=zP();return it(t,Tt)}const FP=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function PP({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:a,width:l,height:u,isValid:o,inProgress:c}=it(FP,Tt);return!(l&&a&&c)?null:g.jsx("svg",{style:e,width:l,height:u,className:"react-flow__connectionline react-flow__container",children:g.jsx("g",{className:$t(["react-flow__connection",p2(o)]),children:g.jsx(mE,{style:t,type:n,CustomComponent:r,isValid:o})})})}const mE=({style:e,type:t=Ar.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:a,from:l,fromNode:u,fromHandle:o,fromPosition:c,to:f,toNode:p,toHandle:d,toPosition:v,pointer:_}=HP();if(!a)return;if(n)return g.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:u,fromHandle:o,fromX:l.x,fromY:l.y,toX:f.x,toY:f.y,fromPosition:c,toPosition:v,connectionStatus:p2(r),toNode:p,toHandle:d,pointer:_});let C="";const w={sourceX:l.x,sourceY:l.y,sourcePosition:c,targetX:f.x,targetY:f.y,targetPosition:v};switch(t){case Ar.Bezier:[C]=A2(w);break;case Ar.SimpleBezier:[C]=iE(w);break;case Ar.Step:[C]=Sg({...w,borderRadius:0});break;case Ar.SmoothStep:[C]=Sg(w);break;default:[C]=T2(w)}return g.jsx("path",{d:C,fill:"none",className:"react-flow__connection-path",style:e})};mE.displayName="ConnectionLine";const $P={};function XS(e=$P){G.useRef(e),Rt(),G.useEffect(()=>{},[e])}function UP(){Rt(),G.useRef(!1),G.useEffect(()=>{},[])}function vE({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:p,onSelectionContextMenu:d,onSelectionStart:v,onSelectionEnd:_,connectionLineType:C,connectionLineStyle:w,connectionLineComponent:S,connectionLineContainerStyle:y,selectionKeyCode:x,selectionOnDrag:b,selectionMode:E,multiSelectionKeyCode:R,panActivationKeyCode:N,zoomActivationKeyCode:D,deleteKeyCode:T,onlyRenderVisibleElements:j,elementsSelectable:B,defaultViewport:z,translateExtent:V,minZoom:F,maxZoom:P,preventScrolling:Y,defaultMarkerColor:q,zoomOnScroll:X,zoomOnPinch:K,panOnScroll:L,panOnScrollSpeed:M,panOnScrollMode:O,zoomOnDoubleClick:U,panOnDrag:$,autoPanOnSelection:Q,onPaneClick:re,onPaneMouseEnter:se,onPaneMouseMove:Z,onPaneMouseLeave:H,onPaneScroll:ee,onPaneContextMenu:ne,paneClickDistance:pe,nodeClickDistance:fe,onEdgeContextMenu:ye,onEdgeMouseEnter:Ce,onEdgeMouseMove:Ee,onEdgeMouseLeave:Ne,reconnectRadius:we,onReconnect:ft,onReconnectStart:Ct,onReconnectEnd:st,noDragClassName:Ye,noWheelClassName:vt,noPanClassName:dt,disableKeyboardA11y:qe,nodeExtent:Pe,rfId:ue,viewport:_e,onViewportChange:ke}){return XS(e),XS(t),UP(),LP(n),BP(_e),g.jsx(rP,{onPaneClick:re,onPaneMouseEnter:se,onPaneMouseMove:Z,onPaneMouseLeave:H,onPaneContextMenu:ne,onPaneScroll:ee,paneClickDistance:pe,deleteKeyCode:T,selectionKeyCode:x,selectionOnDrag:b,selectionMode:E,onSelectionStart:v,onSelectionEnd:_,multiSelectionKeyCode:R,panActivationKeyCode:N,zoomActivationKeyCode:D,elementsSelectable:B,zoomOnScroll:X,zoomOnPinch:K,zoomOnDoubleClick:U,panOnScroll:L,panOnScrollSpeed:M,panOnScrollMode:O,panOnDrag:$,autoPanOnSelection:Q,defaultViewport:z,translateExtent:V,minZoom:F,maxZoom:P,onSelectionContextMenu:d,preventScrolling:Y,noDragClassName:Ye,noWheelClassName:vt,noPanClassName:dt,disableKeyboardA11y:qe,onViewportChange:ke,isControlledViewport:!!_e,children:g.jsxs(jP,{children:[g.jsx(DP,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:u,onReconnect:ft,onReconnectStart:Ct,onReconnectEnd:st,onlyRenderVisibleElements:j,onEdgeContextMenu:ye,onEdgeMouseEnter:Ce,onEdgeMouseMove:Ee,onEdgeMouseLeave:Ne,reconnectRadius:we,defaultMarkerColor:q,noPanClassName:dt,disableKeyboardA11y:qe,rfId:ue}),g.jsx(PP,{style:w,type:C,component:S,containerStyle:y}),g.jsx("div",{className:"react-flow__edgelabel-renderer"}),g.jsx(dP,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:l,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:p,nodeClickDistance:fe,onlyRenderVisibleElements:j,noPanClassName:dt,noDragClassName:Ye,disableKeyboardA11y:qe,nodeExtent:Pe,rfId:ue}),g.jsx("div",{className:"react-flow__viewport-portal"})]})})}vE.displayName="GraphView";const GP=G.memo(vE),qP=b2(),KS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:u,fitViewOptions:o,minZoom:c=.5,maxZoom:f=2,nodeOrigin:p,nodeExtent:d,zIndexMode:v="basic"}={})=>{const _=new Map,C=new Map,w=new Map,S=new Map,y=r??t??[],x=n??e??[],b=p??[0,0],E=d??rl;M2(w,S,y);const{nodesInitialized:R}=wg(x,_,C,{nodeOrigin:b,nodeExtent:E,zIndexMode:v});let N=[0,0,1];if(u&&a&&l){const D=yl(_,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:T,y:j,zoom:B}=Vm(D,a,l,c,f,(o==null?void 0:o.padding)??.1);N=[T,j,B]}return{rfId:"1",width:a??0,height:l??0,transform:N,nodes:x,nodesInitialized:R,nodeLookup:_,parentLookup:C,edges:y,edgeLookup:S,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:f,translateExtent:rl,nodeExtent:E,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:xa.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:b,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:u??!1,fitViewOptions:o,fitViewResolver:null,connection:{...d2},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:qP,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:f2,zIndexMode:v,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},VP=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:u,fitViewOptions:o,minZoom:c,maxZoom:f,nodeOrigin:p,nodeExtent:d,zIndexMode:v})=>nF((_,C)=>{async function w(){const{nodeLookup:S,panZoom:y,fitViewOptions:x,fitViewResolver:b,width:E,height:R,minZoom:N,maxZoom:D}=C();y&&(await Qz({nodes:S,width:E,height:R,panZoom:y,minZoom:N,maxZoom:D},x),b==null||b.resolve(!0),_({fitViewResolver:null}))}return{...KS({nodes:e,edges:t,width:a,height:l,fitView:u,fitViewOptions:o,minZoom:c,maxZoom:f,nodeOrigin:p,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:v}),setNodes:S=>{const{nodeLookup:y,parentLookup:x,nodeOrigin:b,elevateNodesOnSelect:E,fitViewQueued:R,zIndexMode:N,nodesSelectionActive:D}=C(),{nodesInitialized:T,hasSelectedNodes:j}=wg(S,y,x,{nodeOrigin:b,nodeExtent:d,elevateNodesOnSelect:E,checkEquality:!0,zIndexMode:N}),B=D&&j;R&&T?(w(),_({nodes:S,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:B})):_({nodes:S,nodesInitialized:T,nodesSelectionActive:B})},setEdges:S=>{const{connectionLookup:y,edgeLookup:x}=C();M2(y,x,S),_({edges:S})},setDefaultNodesAndEdges:(S,y)=>{if(S){const{setNodes:x}=C();x(S),_({hasDefaultNodes:!0})}if(y){const{setEdges:x}=C();x(y),_({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:y,nodeLookup:x,parentLookup:b,domNode:E,nodeOrigin:R,nodeExtent:N,debug:D,fitViewQueued:T,zIndexMode:j}=C(),{changes:B,updatedInternals:z}=SH(S,x,b,E,R,N,j);z&&(vH(x,b,{nodeOrigin:R,nodeExtent:N,zIndexMode:j}),T?(w(),_({fitViewQueued:!1,fitViewOptions:void 0})):_({}),(B==null?void 0:B.length)>0&&(D&&console.log("React Flow: trigger node changes",B),y==null||y(B)))},updateNodePositions:(S,y=!1)=>{const x=[];let b=[];const{nodeLookup:E,triggerNodeChanges:R,connection:N,updateConnection:D,onNodesChangeMiddlewareMap:T}=C();for(const[j,B]of S){const z=E.get(j),V=!!(z!=null&&z.expandParent&&(z!=null&&z.parentId)&&(B!=null&&B.position)),F={id:j,type:"position",position:V?{x:Math.max(0,B.position.x),y:Math.max(0,B.position.y)}:B.position,dragging:y};if(z&&N.inProgress&&N.fromNode.id===z.id){const P=ps(z,N.fromHandle,je.Left,!0);D({...N,from:P})}V&&z.parentId&&x.push({id:j,parentId:z.parentId,rect:{...B.internals.positionAbsolute,width:B.measured.width??0,height:B.measured.height??0}}),b.push(F)}if(x.length>0){const{parentLookup:j,nodeOrigin:B}=C(),z=Qm(x,E,j,B);b.push(...z)}for(const j of T.values())b=j(b);R(b)},triggerNodeChanges:S=>{const{onNodesChange:y,setNodes:x,nodes:b,hasDefaultNodes:E,debug:R}=C();if(S!=null&&S.length){if(E){const N=wF(S,b);x(N)}R&&console.log("React Flow: trigger node changes",S),y==null||y(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:y,setEdges:x,edges:b,hasDefaultEdges:E,debug:R}=C();if(S!=null&&S.length){if(E){const N=CF(S,b);x(N)}R&&console.log("React Flow: trigger edge changes",S),y==null||y(S)}},addSelectedNodes:S=>{const{multiSelectionActive:y,edgeLookup:x,nodeLookup:b,triggerNodeChanges:E,triggerEdgeChanges:R}=C();if(y){const N=S.map(D=>is(D,!0));E(N);return}E(pa(b,new Set([...S]),!0)),R(pa(x))},addSelectedEdges:S=>{const{multiSelectionActive:y,edgeLookup:x,nodeLookup:b,triggerNodeChanges:E,triggerEdgeChanges:R}=C();if(y){const N=S.map(D=>is(D,!0));R(N);return}R(pa(x,new Set([...S]))),E(pa(b,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:y}={})=>{const{edges:x,nodes:b,nodeLookup:E,triggerNodeChanges:R,triggerEdgeChanges:N}=C(),D=S||b,T=y||x,j=[];for(const z of D){if(!z.selected)continue;const V=E.get(z.id);V&&(V.selected=!1),j.push(is(z.id,!1))}const B=[];for(const z of T)z.selected&&B.push(is(z.id,!1));R(j),N(B)},setMinZoom:S=>{const{panZoom:y,maxZoom:x}=C();y==null||y.setScaleExtent([S,x]),_({minZoom:S})},setMaxZoom:S=>{const{panZoom:y,minZoom:x}=C();y==null||y.setScaleExtent([x,S]),_({maxZoom:S})},setTranslateExtent:S=>{var y;(y=C().panZoom)==null||y.setTranslateExtent(S),_({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:y,triggerNodeChanges:x,triggerEdgeChanges:b,elementsSelectable:E}=C();if(!E)return;const R=y.reduce((D,T)=>T.selected?[...D,is(T.id,!1)]:D,[]),N=S.reduce((D,T)=>T.selected?[...D,is(T.id,!1)]:D,[]);x(R),b(N)},setNodeExtent:S=>{const{nodes:y,nodeLookup:x,parentLookup:b,nodeOrigin:E,elevateNodesOnSelect:R,nodeExtent:N,zIndexMode:D}=C();S[0][0]===N[0][0]&&S[0][1]===N[0][1]&&S[1][0]===N[1][0]&&S[1][1]===N[1][1]||(wg(y,x,b,{nodeOrigin:E,nodeExtent:S,elevateNodesOnSelect:R,checkEquality:!1,zIndexMode:D}),_({nodeExtent:S}))},panBy:S=>{const{transform:y,width:x,height:b,panZoom:E,translateExtent:R}=C();return xH({delta:S,panZoom:E,transform:y,translateExtent:R,width:x,height:b})},setCenter:async(S,y,x)=>{const{width:b,height:E,maxZoom:R,panZoom:N}=C();if(!N)return!1;const D=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:R;return await N.setViewport({x:b/2-S*D,y:E/2-y*D,zoom:D},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{_({connection:{...d2}})},updateConnection:S=>{_({connection:S})},reset:()=>_({...KS()})}},Object.is);function YP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:a,initialHeight:l,initialMinZoom:u,initialMaxZoom:o,initialFitViewOptions:c,fitView:f,nodeOrigin:p,nodeExtent:d,zIndexMode:v,children:_}){const[C]=G.useState(()=>VP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:f,minZoom:u,maxZoom:o,fitViewOptions:c,nodeOrigin:p,nodeExtent:d,zIndexMode:v}));return g.jsx(iF,{value:C,children:g.jsx(RF,{children:g.jsx(qF,{children:_})})})}function WP({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:a,width:l,height:u,fitView:o,fitViewOptions:c,minZoom:f,maxZoom:p,nodeOrigin:d,nodeExtent:v,zIndexMode:_}){return G.useContext(Rh)?g.jsx(g.Fragment,{children:e}):g.jsx(YP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:a,initialWidth:l,initialHeight:u,fitView:o,initialFitViewOptions:c,initialMinZoom:f,initialMaxZoom:p,nodeOrigin:d,nodeExtent:v,zIndexMode:_,children:e})}const XP={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function KP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:a,nodeTypes:l,edgeTypes:u,onNodeClick:o,onEdgeClick:c,onInit:f,onMove:p,onMoveStart:d,onMoveEnd:v,onConnect:_,onConnectStart:C,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:y,onNodeMouseEnter:x,onNodeMouseMove:b,onNodeMouseLeave:E,onNodeContextMenu:R,onNodeDoubleClick:N,onNodeDragStart:D,onNodeDrag:T,onNodeDragStop:j,onNodesDelete:B,onEdgesDelete:z,onDelete:V,onSelectionChange:F,onSelectionDragStart:P,onSelectionDrag:Y,onSelectionDragStop:q,onSelectionContextMenu:X,onSelectionStart:K,onSelectionEnd:L,onBeforeDelete:M,connectionMode:O,connectionLineType:U=Ar.Bezier,connectionLineStyle:$,connectionLineComponent:Q,connectionLineContainerStyle:re,deleteKeyCode:se="Backspace",selectionKeyCode:Z="Shift",selectionOnDrag:H=!1,selectionMode:ee=sl.Full,panActivationKeyCode:ne="Space",multiSelectionKeyCode:pe=ol()?"Meta":"Control",zoomActivationKeyCode:fe=ol()?"Meta":"Control",snapToGrid:ye,snapGrid:Ce,onlyRenderVisibleElements:Ee=!1,selectNodesOnDrag:Ne,nodesDraggable:we,autoPanOnNodeFocus:ft,nodesConnectable:Ct,nodesFocusable:st,nodeOrigin:Ye=q2,edgesFocusable:vt,edgesReconnectable:dt,elementsSelectable:qe=!0,defaultViewport:Pe=mF,minZoom:ue=.5,maxZoom:_e=2,translateExtent:ke=rl,preventScrolling:he=!0,nodeExtent:be,defaultMarkerColor:De="#b1b1b7",zoomOnScroll:Re=!0,zoomOnPinch:$e=!0,panOnScroll:rt=!1,panOnScrollSpeed:ct=.5,panOnScrollMode:Ve=os.Free,zoomOnDoubleClick:Ln=!0,panOnDrag:tn=!0,onPaneClick:mi,onPaneMouseEnter:vi,onPaneMouseMove:_i,onPaneMouseLeave:yi,onPaneScroll:On,onPaneContextMenu:bi,paneClickDistance:ii=1,nodeClickDistance:bs=0,children:ae,onReconnect:xe,onReconnectStart:Ae,onReconnectEnd:tt,onEdgeContextMenu:at,onEdgeDoubleClick:Si,onEdgeMouseEnter:nn,onEdgeMouseMove:jr,onEdgeMouseLeave:Ma,reconnectRadius:xl=10,onNodesChange:wl,onEdgesChange:ri,noDragClassName:Ut="nodrag",noWheelClassName:Zt="nowheel",noPanClassName:xi="nopan",fitView:Ss,fitViewOptions:Cl,connectOnClick:Lh,attributionPosition:El,proOptions:Lr,defaultEdgeOptions:ja,elevateNodesOnSelect:Xi=!0,elevateEdgesOnSelect:Ki=!1,disableKeyboardA11y:Zi=!1,autoPanOnConnect:Qi,autoPanOnNodeDrag:Bt,autoPanOnSelection:kl=!0,autoPanSpeed:Al,connectionRadius:wi,isValidConnection:Ji,onError:Oh,style:Nl,id:La,nodeDragThreshold:Bh,connectionDragThreshold:xs,viewport:ws,onViewportChange:qn,width:an,height:Tl,colorMode:Ih="light",debug:Oa,onScroll:Or,ariaLabelConfig:Cs,zIndexMode:Rl="basic",...on},Ba){const Es=La||"1",Ia=bF(Ih),er=G.useCallback(za=>{za.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Or==null||Or(za)},[Or]);return g.jsx("div",{"data-testid":"rf__wrapper",...on,onScroll:er,style:{...Nl,...XP},ref:Ba,className:$t(["react-flow",a,Ia]),id:La,role:"application",children:g.jsxs(WP,{nodes:e,edges:t,width:an,height:Tl,fitView:Ss,fitViewOptions:Cl,minZoom:ue,maxZoom:_e,nodeOrigin:Ye,nodeExtent:be,zIndexMode:Rl,children:[g.jsx(yF,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:_,onConnectStart:C,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:y,nodesDraggable:we,autoPanOnNodeFocus:ft,nodesConnectable:Ct,nodesFocusable:st,edgesFocusable:vt,edgesReconnectable:dt,elementsSelectable:qe,elevateNodesOnSelect:Xi,elevateEdgesOnSelect:Ki,minZoom:ue,maxZoom:_e,nodeExtent:be,onNodesChange:wl,onEdgesChange:ri,snapToGrid:ye,snapGrid:Ce,connectionMode:O,translateExtent:ke,connectOnClick:Lh,defaultEdgeOptions:ja,fitView:Ss,fitViewOptions:Cl,onNodesDelete:B,onEdgesDelete:z,onDelete:V,onNodeDragStart:D,onNodeDrag:T,onNodeDragStop:j,onSelectionDrag:Y,onSelectionDragStart:P,onSelectionDragStop:q,onMove:p,onMoveStart:d,onMoveEnd:v,noPanClassName:xi,nodeOrigin:Ye,rfId:Es,autoPanOnConnect:Qi,autoPanOnNodeDrag:Bt,autoPanSpeed:Al,onError:Oh,connectionRadius:wi,isValidConnection:Ji,selectNodesOnDrag:Ne,nodeDragThreshold:Bh,connectionDragThreshold:xs,onBeforeDelete:M,debug:Oa,ariaLabelConfig:Cs,zIndexMode:Rl}),g.jsx(GP,{onInit:f,onNodeClick:o,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:b,onNodeMouseLeave:E,onNodeContextMenu:R,onNodeDoubleClick:N,nodeTypes:l,edgeTypes:u,connectionLineType:U,connectionLineStyle:$,connectionLineComponent:Q,connectionLineContainerStyle:re,selectionKeyCode:Z,selectionOnDrag:H,selectionMode:ee,deleteKeyCode:se,multiSelectionKeyCode:pe,panActivationKeyCode:ne,zoomActivationKeyCode:fe,onlyRenderVisibleElements:Ee,defaultViewport:Pe,translateExtent:ke,minZoom:ue,maxZoom:_e,preventScrolling:he,zoomOnScroll:Re,zoomOnPinch:$e,zoomOnDoubleClick:Ln,panOnScroll:rt,panOnScrollSpeed:ct,panOnScrollMode:Ve,panOnDrag:tn,autoPanOnSelection:kl,onPaneClick:mi,onPaneMouseEnter:vi,onPaneMouseMove:_i,onPaneMouseLeave:yi,onPaneScroll:On,onPaneContextMenu:bi,paneClickDistance:ii,nodeClickDistance:bs,onSelectionContextMenu:X,onSelectionStart:K,onSelectionEnd:L,onReconnect:xe,onReconnectStart:Ae,onReconnectEnd:tt,onEdgeContextMenu:at,onEdgeDoubleClick:Si,onEdgeMouseEnter:nn,onEdgeMouseMove:jr,onEdgeMouseLeave:Ma,reconnectRadius:xl,defaultMarkerColor:De,noDragClassName:Ut,noWheelClassName:Zt,noPanClassName:xi,rfId:Es,disableKeyboardA11y:Zi,nodeExtent:be,viewport:ws,onViewportChange:qn}),g.jsx(gF,{onSelectionChange:F}),ae,g.jsx(uF,{proOptions:Lr,position:El}),g.jsx(cF,{rfId:Es,disableKeyboardA11y:Zi})]})})}var ZP=Y2(KP);function QP({dimensions:e,lineWidth:t,variant:n,className:r}){return g.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:$t(["react-flow__background-pattern",n,r])})}function JP({radius:e,className:t}){return g.jsx("circle",{cx:e,cy:e,r:e,className:$t(["react-flow__background-pattern","dots",t])})}var Ui;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ui||(Ui={}));const e$={[Ui.Dots]:1,[Ui.Lines]:1,[Ui.Cross]:6},t$=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function _E({id:e,variant:t=Ui.Dots,gap:n=20,size:r,lineWidth:a=1,offset:l=0,color:u,bgColor:o,style:c,className:f,patternClassName:p}){const d=G.useRef(null),{transform:v,patternId:_}=it(t$,Tt),C=r||e$[t],w=t===Ui.Dots,S=t===Ui.Cross,y=Array.isArray(n)?n:[n,n],x=[y[0]*v[2]||1,y[1]*v[2]||1],b=C*v[2],E=Array.isArray(l)?l:[l,l],R=S?[b,b]:x,N=[E[0]*v[2]||1+R[0]/2,E[1]*v[2]||1+R[1]/2],D=`${_}${e||""}`;return g.jsxs("svg",{className:$t(["react-flow__background",f]),style:{...c,...Mh,"--xy-background-color-props":o,"--xy-background-pattern-color-props":u},ref:d,"data-testid":"rf__background",children:[g.jsx("pattern",{id:D,x:v[0]%x[0],y:v[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:w?g.jsx(JP,{radius:b/2,className:p}):g.jsx(QP,{dimensions:R,lineWidth:a,variant:t,className:p})}),g.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${D})`})]})}_E.displayName="Background";const n$=G.memo(_E);function i$(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:g.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function r$(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:g.jsx("path",{d:"M0 0h32v4.2H0z"})})}function s$(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:g.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function a$(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:g.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function o$(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:g.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function cu({children:e,className:t,...n}){return g.jsx("button",{type:"button",className:$t(["react-flow__controls-button",t]),...n,children:e})}const l$=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function yE({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:a,onZoomIn:l,onZoomOut:u,onFitView:o,onInteractiveChange:c,className:f,children:p,position:d="bottom-left",orientation:v="vertical","aria-label":_}){const C=Rt(),{isInteractive:w,minZoomReached:S,maxZoomReached:y,ariaLabelConfig:x}=it(l$,Tt),{zoomIn:b,zoomOut:E,fitView:R}=Jm(),N=()=>{b(),l==null||l()},D=()=>{E(),u==null||u()},T=()=>{R(a),o==null||o()},j=()=>{C.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),c==null||c(!w)},B=v==="horizontal"?"horizontal":"vertical";return g.jsxs(Dh,{className:$t(["react-flow__controls",B,f]),position:d,style:e,"data-testid":"rf__controls","aria-label":_??x["controls.ariaLabel"],children:[t&&g.jsxs(g.Fragment,{children:[g.jsx(cu,{onClick:N,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:y,children:g.jsx(i$,{})}),g.jsx(cu,{onClick:D,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:S,children:g.jsx(r$,{})})]}),n&&g.jsx(cu,{className:"react-flow__controls-fitview",onClick:T,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:g.jsx(s$,{})}),r&&g.jsx(cu,{className:"react-flow__controls-interactive",onClick:j,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:w?g.jsx(o$,{}):g.jsx(a$,{})}),p]})}yE.displayName="Controls";G.memo(yE);function c$({id:e,x:t,y:n,width:r,height:a,style:l,color:u,strokeColor:o,strokeWidth:c,className:f,borderRadius:p,shapeRendering:d,selected:v,onClick:_}){const{background:C,backgroundColor:w}=l||{},S=u||C||w;return g.jsx("rect",{className:$t(["react-flow__minimap-node",{selected:v},f]),x:t,y:n,rx:p,ry:p,width:r,height:a,style:{fill:S,stroke:o,strokeWidth:c},shapeRendering:d,onClick:_?y=>_(y,e):void 0})}const u$=G.memo(c$),h$=e=>e.nodes.map(t=>t.id),Mp=e=>e instanceof Function?e:()=>e;function f$({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:l=u$,onClick:u}){const o=it(h$,Tt),c=Mp(t),f=Mp(e),p=Mp(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return g.jsx(g.Fragment,{children:o.map(v=>g.jsx(p$,{id:v,nodeColorFunc:c,nodeStrokeColorFunc:f,nodeClassNameFunc:p,nodeBorderRadius:r,nodeStrokeWidth:a,NodeComponent:l,onClick:u,shapeRendering:d},v))})}function d$({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:a,nodeStrokeWidth:l,shapeRendering:u,NodeComponent:o,onClick:c}){const{node:f,x:p,y:d,width:v,height:_}=it(C=>{const w=C.nodeLookup.get(e);if(!w)return{node:void 0,x:0,y:0,width:0,height:0};const S=w.internals.userNode,{x:y,y:x}=w.internals.positionAbsolute,{width:b,height:E}=Wi(S);return{node:S,x:y,y:x,width:b,height:E}},Tt);return!f||f.hidden||!S2(f)?null:g.jsx(o,{x:p,y:d,width:v,height:_,style:f.style,selected:!!f.selected,className:r(f),color:t(f),borderRadius:a,strokeColor:n(f),strokeWidth:l,shapeRendering:u,onClick:c,id:f.id})}const p$=G.memo(d$);var g$=G.memo(f$);const m$=200,v$=150,_$=e=>!e.hidden,y$=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?_2(yl(e.nodeLookup,{filter:_$}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},b$="react-flow__minimap-desc";function bE({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:a="",nodeBorderRadius:l=5,nodeStrokeWidth:u,nodeComponent:o,bgColor:c,maskColor:f,maskStrokeColor:p,maskStrokeWidth:d,position:v="bottom-right",onClick:_,onNodeClick:C,pannable:w=!1,zoomable:S=!1,ariaLabel:y,inversePan:x,zoomStep:b=1,offsetScale:E=5}){const R=Rt(),N=G.useRef(null),{boundingRect:D,viewBB:T,rfId:j,panZoom:B,translateExtent:z,flowWidth:V,flowHeight:F,ariaLabelConfig:P}=it(y$,Tt),Y=(e==null?void 0:e.width)??m$,q=(e==null?void 0:e.height)??v$,X=D.width/Y,K=D.height/q,L=Math.max(X,K),M=L*Y,O=L*q,U=E*L,$=D.x-(M-D.width)/2-U,Q=D.y-(O-D.height)/2-U,re=M+U*2,se=O+U*2,Z=`${b$}-${j}`,H=G.useRef(0),ee=G.useRef();H.current=L,G.useEffect(()=>{if(N.current&&B)return ee.current=DH({domNode:N.current,panZoom:B,getTransform:()=>R.getState().transform,getViewScale:()=>H.current}),()=>{var ye;(ye=ee.current)==null||ye.destroy()}},[B]),G.useEffect(()=>{var ye;(ye=ee.current)==null||ye.update({translateExtent:z,width:V,height:F,inversePan:x,pannable:w,zoomStep:b,zoomable:S})},[w,S,x,b,z,V,F]);const ne=_?ye=>{var Ne;const[Ce,Ee]=((Ne=ee.current)==null?void 0:Ne.pointer(ye))||[0,0];_(ye,{x:Ce,y:Ee})}:void 0,pe=C?G.useCallback((ye,Ce)=>{const Ee=R.getState().nodeLookup.get(Ce).internals.userNode;C(ye,Ee)},[]):void 0,fe=y??P["minimap.ariaLabel"];return g.jsx(Dh,{position:v,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*L:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:$t(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:g.jsxs("svg",{width:Y,height:q,viewBox:`${$} ${Q} ${re} ${se}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Z,ref:N,onClick:ne,children:[fe&&g.jsx("title",{id:Z,children:fe}),g.jsx(g$,{onClick:pe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:l,nodeClassName:a,nodeStrokeWidth:u,nodeComponent:o}),g.jsx("path",{className:"react-flow__minimap-mask",d:`M${$-U},${Q-U}h${re+U*2}v${se+U*2}h${-re-U*2}z - M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}bE.displayName="MiniMap";G.memo(bE);const S$=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,x$={[Ea.Line]:"right",[Ea.Handle]:"bottom-right"};function w$({nodeId:e,position:t,variant:n=Ea.Handle,className:r,style:a=void 0,children:l,color:u,minWidth:o=10,minHeight:c=10,maxWidth:f=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:v,autoScale:_=!0,shouldResize:C,onResizeStart:w,onResize:S,onResizeEnd:y}){const x=Z2(),b=typeof e=="string"?e:x,E=Rt(),R=G.useRef(null),N=n===Ea.Handle,D=it(G.useCallback(S$(N&&_),[N,_]),Tt),T=G.useRef(null),j=t??x$[n];G.useEffect(()=>{if(!(!R.current||!b))return T.current||(T.current=GH({domNode:R.current,nodeId:b,getStoreItems:()=>{const{nodeLookup:z,transform:V,snapGrid:F,snapToGrid:P,nodeOrigin:Y,domNode:q}=E.getState();return{nodeLookup:z,transform:V,snapGrid:F,snapToGrid:P,nodeOrigin:Y,paneDomNode:q}},onChange:(z,V)=>{const{triggerNodeChanges:F,nodeLookup:P,parentLookup:Y,nodeOrigin:q}=E.getState(),X=[],K={x:z.x,y:z.y},L=P.get(b);if(L&&L.expandParent&&L.parentId){const M=L.origin??q,O=z.width??L.measured.width??0,U=z.height??L.measured.height??0,$={id:L.id,parentId:L.parentId,rect:{width:O,height:U,...x2({x:z.x??L.position.x,y:z.y??L.position.y},{width:O,height:U},L.parentId,P,M)}},Q=Qm([$],P,Y,q);X.push(...Q),K.x=z.x?Math.max(M[0]*O,z.x):void 0,K.y=z.y?Math.max(M[1]*U,z.y):void 0}if(K.x!==void 0&&K.y!==void 0){const M={id:b,type:"position",position:{...K}};X.push(M)}if(z.width!==void 0&&z.height!==void 0){const O={id:b,type:"dimensions",resizing:!0,setAttributes:v?v==="horizontal"?"width":"height":!0,dimensions:{width:z.width,height:z.height}};X.push(O)}for(const M of V){const O={...M,type:"position"};X.push(O)}F(X)},onEnd:({width:z,height:V})=>{const F={id:b,type:"dimensions",resizing:!1,dimensions:{width:z,height:V}};E.getState().triggerNodeChanges([F])}})),T.current.update({controlPosition:j,boundaries:{minWidth:o,minHeight:c,maxWidth:f,maxHeight:p},keepAspectRatio:d,resizeDirection:v,onResizeStart:w,onResize:S,onResizeEnd:y,shouldResize:C}),()=>{var z;(z=T.current)==null||z.destroy()}},[j,o,c,f,p,d,w,S,y,C]);const B=j.split("-");return g.jsx("div",{className:$t(["react-flow__resize-control","nodrag",...B,n,r]),ref:R,style:{...a,scale:D,...u&&{[N?"backgroundColor":"borderColor"]:u}},children:l})}G.memo(w$);const kg=264,C$=132,Cu=44,E$=72;function k$(e){const t=new Map(e.map(l=>[l.id,{exp:l,children:[]}])),n=[];for(const l of e){const u=t.get(l.id),o=l.parentExperimentId?t.get(l.parentExperimentId):void 0;o?o.children.push(u):n.push(u)}const r=(l,u)=>l.exp.createdAt-u.exp.createdAt,a=l=>{l.children.sort(r),l.children.forEach(a)};return n.sort(r),n.forEach(a),n}function Eu(e){if(e.children.length===0)return kg;const t=e.children.reduce((n,r)=>n+Eu(r),0)+Cu*(e.children.length-1);return Math.max(kg,t)}function A$(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"?"live":"other"}const N$=G.memo(function({data:t}){const{exp:n,latestRun:r,runs:a,isBaseline:l,githubOwner:u,githubRepo:o,onOpenView:c,onOpenCodeBranch:f}=t,p=r==null?void 0:r.status,d=p==="running"||p==="starting",v=l?"BASELINE":d?"RUNNING":"EXPERIMENT",_=a.slice(-8);return g.jsxs("div",{className:`exp-node ${d?"live":""}`,children:[g.jsx(ka,{type:"target",position:je.Top}),g.jsxs("div",{className:"node-eyebrow",children:[g.jsx("span",{children:v}),g.jsx(Xo,{status:p??"idle"})]}),g.jsx("div",{className:"node-head",children:g.jsx("span",{className:"node-slug",children:n.slug})}),(n.title||n.description)&&g.jsx("div",{className:"node-title",children:n.title||n.description}),g.jsxs("div",{className:"node-meta",children:[g.jsx("span",{children:"RUNS"}),_.length>0?g.jsx("span",{className:"run-squares",children:_.map(C=>g.jsx("span",{className:`run-sq ${A$(C.status)}`,title:C.status},C.id))}):g.jsx("span",{children:"no runs"}),g.jsx("span",{style:{flex:1}}),r&&g.jsx("span",{children:Aa(r.createdAt)})]}),g.jsxs("div",{className:"node-actions",onClick:C=>C.stopPropagation(),children:[g.jsxs("button",{className:"node-action",title:"Open changes",onClick:()=>c(n.id,"changes"),children:[g.jsx(Xu,{size:13}),"Changes"]}),a.length>0&&g.jsxs("button",{className:"node-action",title:"Open logs",onClick:()=>c(n.id,"terminal"),children:[g.jsx(cx,{size:13}),"Logs"]}),g.jsxs("button",{className:"node-action",title:`Browse code on ${n.branchName}`,onClick:()=>f(n.branchName),children:[g.jsx(ax,{size:13}),"Code"]}),g.jsx("a",{className:"node-action node-action-ext",title:`Open ${n.branchName} on GitHub`,"aria-label":`Open ${n.branchName} on GitHub`,href:jg(u,o,n.branchName),target:"_blank",rel:"noopener noreferrer",onClick:C=>C.stopPropagation(),children:g.jsx(Em,{size:13})})]}),g.jsx(ka,{type:"source",position:je.Bottom})]})}),T$={exp:N$},R$={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}};function D$({experiments:e,runs:t,project:n,onOpenView:r,onOpenCodeBranch:a}){const{nodes:l,edges:u}=G.useMemo(()=>{const o=new Map;for(const _ of t){const C=o.get(_.experimentId);C?C.push(_):o.set(_.experimentId,[_])}for(const _ of o.values())_.sort((C,w)=>C.createdAt-w.createdAt);const c=[],f=[],p=k$(e);function d(_,C,w){const S=o.get(_.exp.id)??[];if(c.push({id:_.exp.id,type:"exp",position:{x:C-kg/2,y:w},data:{exp:_.exp,latestRun:S[S.length-1]??null,runs:S,isBaseline:!_.exp.parentExperimentId,githubOwner:n.githubOwner,githubRepo:n.githubRepo,onOpenView:r,onOpenCodeBranch:a}}),_.children.length===0)return;const y=_.children.reduce((b,E)=>b+Eu(E),0)+Cu*(_.children.length-1);let x=C-y/2;for(const b of _.children){const E=Eu(b);f.push({id:`e-${_.exp.id}-${b.exp.id}`,source:_.exp.id,target:b.exp.id}),d(b,x+E/2,w+C$+E$),x+=E+Cu}}let v=0;for(const _ of p){const C=Eu(_);d(_,v+C/2,0),v+=C+Cu}return{nodes:c,edges:f}},[e,t,r,a,n.githubOwner,n.githubRepo]);return e.length===0?g.jsxs("div",{className:"empty-state empty-state-cta",children:[g.jsx("p",{className:"empty-state-title",children:"No experiments yet"}),g.jsx("p",{className:"empty-state-hint",children:"Ask the agent in chat to create and run your first experiment."})]}):g.jsx(ZP,{nodes:l,edges:u,nodeTypes:T$,defaultEdgeOptions:R$,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,minZoom:.15,fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},children:g.jsx(n$,{variant:Ui.Dots,color:"var(--dots-strong)",gap:28,size:1.6})})}const uu=(e,t)=>e.id===t.id&&e.view===t.view,hu=(e,t)=>e.path===t.path&&e.sessionId===t.sessionId&&e.ref===t.ref,ZS=e=>`${e.sessionId??""}:${e.ref??""}:${e.path}`;function M$(e,t,n){let r=e,a;const l=t==null?void 0:t.replace(/\/+$/,"");if(!r.startsWith("/"))a=n;else if(l&&(r===l||r.startsWith(`${l}/`)))r=r.slice(l.length).replace(/^\/+/,"");else{const u=r.match(/\/openresearch\/worktrees\/[^/]+\/[^/]+\/([^/]+)\/(.+)$/),o=u?null:r.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);u?(a=u[1],r=u[2]):o&&(r=o[1])}return r?{path:r,sessionId:a}:null}const QS="orx:onboarded",SE="orx:panel-width",Vu=360,j$=10,L$=232,O$=380,B$=L$+56,I$=80;function Ag(){return Math.max(Vu,window.innerWidth-B$-O$)}function z$(){const e=Ag();try{const t=Number(localStorage.getItem(SE));if(Number.isFinite(t)&&t>=Vu)return Math.min(t,e)}catch{}return Math.max(Vu,Math.min(760,e,Math.round(window.innerWidth*.42)))}function fu(e,t){const n=e.findIndex(a=>a.id===t.id);if(n<0)return[...e,t];const r=e.slice();return r[n]=t,r}function H$(){var _e,ke;const[e,t]=G.useState(null),[n,r]=G.useState(null),[a,l]=G.useState([]),[u,o]=G.useState([]),[c,f]=G.useState(null),[p,d]=G.useState("tree"),[v,_]=G.useState(null),[C,w]=G.useState("experiments"),[S,y]=G.useState([]),[x,b]=G.useState([]),[E,R]=G.useState([]),[N,D]=G.useState(null),[T,j]=G.useState(!0),[B,z]=G.useState(!1),[V,F]=G.useState(z$),[P,Y]=G.useState(!0),[q,X]=G.useState(!1),[K,L]=G.useState("chat"),[M,O]=G.useState(()=>{try{return localStorage.getItem(QS)==="1"}catch{return!0}}),[U,$]=G.useState(!1),Q=G.useCallback(()=>{L("chat"),Y(!0),j(!0),z(!1),$(!0)},[]),re=G.useCallback(()=>{try{localStorage.setItem(Ub,"1")}catch{}$(!1)},[]);G.useEffect(()=>{if(!(!n||q||!M)){try{if(localStorage.getItem(Ub)==="1")return}catch{return}Q()}},[n,q,M,Q]);const se=G.useRef(n);se.current=n,G.useEffect(()=>{tT().then(he=>{t(he),r(be=>{var De;return be??((De=he[0])==null?void 0:De.id)??null})}).catch(()=>t([]))},[]),G.useEffect(()=>{const he=()=>F(be=>Math.min(be,Ag()));return window.addEventListener("resize",he),()=>window.removeEventListener("resize",he)},[]),G.useEffect(()=>{n&&(sT(n).catch(()=>{}),l([]),o([]),f(null),_(null),y([]),b([]),R([]),D(null),w("experiments"),oT(n).then(l).catch(()=>{}),lT(n).then(o).catch(()=>{}),Ky(n).then(f).catch(()=>{}))},[n]);const Z=G.useCallback(()=>{const he=se.current;he&&Ky(he).then(f).catch(()=>{})},[]);t3({onRun:he=>{he.projectId===se.current&&o(be=>fu(be,he))},onExperiment:he=>{he.projectId===se.current&&l(be=>fu(be,he))},onProject:he=>{t(be=>be?fu(be,he):[he])},onFiles:he=>{he===se.current&&Z()}});const H=G.useCallback((he,be="changes")=>{const De={id:he,view:be};y(Re=>Re.some($e=>uu($e,De))?Re:[...Re,De]),w(De),j(!0)},[]),ee=G.useCallback(he=>{const be=S.findIndex(Re=>uu(Re,he));if(be===-1)return;const De=S.filter((Re,$e)=>$e!==be);y(De),typeof C=="object"&&"view"in C&&uu(C,he)&&w(De[Math.min(be,De.length-1)]??"experiments")},[S,C]),ne=G.useCallback((he,be,De)=>{var rt;const Re=(rt=e==null?void 0:e.find(ct=>ct.id===n))==null?void 0:rt.repoPath,$e=M$(he,Re,be);$e&&(De&&($e.ref=De),b(ct=>ct.some(Ve=>hu(Ve,$e))?ct:[...ct,$e]),w($e),j(!0))},[e,n]),pe=G.useCallback(he=>{const be=x.findIndex(Re=>hu(Re,he));if(be===-1)return;const De=x.filter((Re,$e)=>$e!==be);b(De),typeof C=="object"&&"path"in C&&hu(C,he)&&w(De[Math.min(be,De.length-1)]??"experiments")},[x,C]),fe=G.useCallback((he,be,De)=>{const Re={kind:"plan",sessionId:be,promptId:De,plan:he};R($e=>{const rt=$e.findIndex(Ve=>Ve.promptId===De);if(rt===-1)return[...$e,Re];const ct=$e.slice();return ct[rt]=Re,ct}),w(Re),j(!0)},[]),ye=G.useCallback(he=>{const be=E.findIndex(Re=>Re.promptId===he.promptId);if(be===-1)return;const De=E.filter((Re,$e)=>$e!==be);R(De),typeof C=="object"&&"kind"in C&&C.promptId===he.promptId&&w(De[Math.min(be,De.length-1)]??"experiments")},[E,C]),Ce=G.useCallback(he=>{const be={code:!0,sel:he,toggled:new Set};D(De=>De?{...De,sel:he}:be),w(be),j(!0)},[]),Ee=G.useCallback(he=>{D(be=>be&&{...be,...he})},[]),Ne=G.useCallback(()=>{D(null),w(he=>typeof he=="object"&&"code"in he?"experiments":he)},[]),we=he=>{he.preventDefault(),he.currentTarget.setPointerCapture(he.pointerId);const be=document.body.style.userSelect;document.body.style.userSelect="none";const De=$e=>{const rt=Math.round(window.innerWidth-$e.clientX-j$),ct=Ag();if(rt>ct+I$){z(!0);return}z(!1);const Ve=Math.min(Math.max(rt,Vu),ct);F(Ve);try{localStorage.setItem(SE,String(Ve))}catch{}},Re=()=>{window.removeEventListener("pointermove",De),window.removeEventListener("pointerup",Re),window.removeEventListener("pointercancel",Re),document.body.style.userSelect=be};window.addEventListener("pointermove",De),window.addEventListener("pointerup",Re),window.addEventListener("pointercancel",Re)},ft=he=>{t(be=>be?fu(be,he):[he]),r(he.id),X(!1)},Ct=he=>{t(be=>be&&be.filter(De=>De.id!==he)),n===he&&r(null)},st=typeof C=="object"&&"view"in C?C:null,Ye=typeof C=="object"&&"path"in C?C:null,vt=typeof C=="object"&&"kind"in C?C:null,dt=typeof C=="object"&&"code"in C,qe=(e==null?void 0:e.find(he=>he.id===n))??null,Pe=st?a.find(he=>he.id===st.id)??null:null;if(e===null)return g.jsx("div",{className:"app",children:g.jsx("div",{className:"empty-state",children:g.jsx("span",{className:"spinner"})})});if(e.length===0)return g.jsx("div",{className:"app",children:M?g.jsx($b,{projects:e,onOpen:r,onCreated:ft,onDeleted:Ct}):g.jsx(XB,{onDone:()=>{try{localStorage.setItem(QS,"1")}catch{}O(!0)}})});const ue=g.jsx(WB,{projectName:((_e=e.find(he=>he.id===n))==null?void 0:_e.name)??"",onHome:()=>X(!0),onCollapse:()=>Y(!1)});return g.jsxs("div",{className:"app",children:[q?g.jsx($b,{projects:e,onOpen:he=>{r(he),X(!1)},onCreated:ft,onDeleted:Ct}):g.jsxs("div",{className:"app-body",children:[n&&g.jsx(iO,{projectId:n,paperId:(ke=e.find(he=>he.id===n))==null?void 0:ke.paperId,railHeader:ue,railOpen:P,onShowRail:()=>Y(!0),mainView:K,onSelectMainView:L,panelOpen:T,onTogglePanel:()=>{T&&z(!1),j(!T)},onOpenFile:ne,onOpenPlan:fe,onStartTour:Q,children:K==="files"?(()=>{const he=e.find(be=>be.id===n);return he?g.jsx(yO,{project:he,files:c,onChanged:Z,onOpenStorage:()=>L("storage")},he.id):null})():K!=="chat"?g.jsx($L,{tab:K}):null}),K==="chat"&&T&&g.jsxs("aside",{className:`right-pane floating-panel ${B?"max":""}`,style:B?void 0:{width:V},"data-onboarding":"experiments",children:[!B&&g.jsx("div",{className:"panel-resizer",onPointerDown:we}),g.jsxs("div",{className:"tabs",children:[g.jsxs("div",{className:"tab-strip",children:[g.jsx("button",{className:`tab ${C==="experiments"?"active":""}`,onClick:()=>w("experiments"),children:"Experiments"}),S.map(he=>{const be=a.find(De=>De.id===he.id);return g.jsx(Yc,{active:st!==null&&uu(st,he),label:be?be.title||be.slug:"…",icon:he.view==="terminal"?g.jsx(cx,{size:12,style:{flexShrink:0}}):g.jsx(Xu,{size:12,style:{flexShrink:0}}),onSelect:()=>w(he),onClose:()=>ee(he)},`${he.id}:${he.view}`)}),x.map(he=>g.jsx(Yc,{active:Ye!==null&&hu(Ye,he),label:he.path.split("/").pop()||he.path,icon:g.jsx(rx,{size:12,style:{flexShrink:0}}),onSelect:()=>w(he),onClose:()=>pe(he)},`file:${ZS(he)}`)),E.map(he=>g.jsx(Yc,{active:vt!==null&&vt.promptId===he.promptId,label:"Plan",icon:g.jsx(lx,{size:12,style:{flexShrink:0}}),onSelect:()=>w(he),onClose:()=>ye(he)},`plan:${he.promptId}`)),N&&g.jsx(Yc,{active:dt,label:"Code",icon:g.jsx(ax,{size:12,style:{flexShrink:0}}),onSelect:()=>w(N),onClose:Ne},"code")]}),g.jsxs("div",{className:"panel-controls",children:[g.jsx("button",{className:"icon-btn",title:B?"Restore panel":"Expand panel","aria-label":B?"Restore panel":"Expand panel",onClick:()=>z(he=>!he),children:B?g.jsx(IN,{size:14}):g.jsx(ON,{size:14})}),g.jsx("button",{className:"icon-btn",title:"Close panel","aria-label":"Close panel",onClick:()=>{j(!1),z(!1)},children:g.jsx(va,{size:14})})]})]}),C==="experiments"?g.jsxs("div",{className:"tab-body",children:[g.jsx("div",{className:"pane-toolbar",children:g.jsxs("div",{className:"seg",children:[g.jsx("button",{className:p==="tree"?"active":"",onClick:()=>d("tree"),children:"Tree"}),g.jsx("button",{className:p==="table"?"active":"",onClick:()=>d("table"),children:"Table"})]})}),g.jsx("div",{className:"pane-content",children:p==="tree"?qe&&g.jsx(D$,{experiments:a,runs:u,project:qe,onOpenView:H,onOpenCodeBranch:Ce}):g.jsx(sI,{runs:u,experiments:a,onOpen:he=>{_(he.id),H(he.experimentId,"terminal")},onOpenChanges:he=>H(he,"changes"),onCancel:he=>void hx(he).catch(()=>{})})})]}):Ye?g.jsx("div",{className:"tab-body",children:n&&g.jsx(YB,{projectId:n,path:Ye.path,sessionId:Ye.sessionId,gitRef:Ye.ref,onOpenFile:ne},ZS(Ye))}):vt?g.jsx("div",{className:"tab-body",children:g.jsx("div",{className:"pane-content plan-tab-content",children:g.jsx(Wo,{text:vt.plan,onOpenFile:he=>ne(he,vt.sessionId)})})}):dt?g.jsx("div",{className:"tab-body",children:n&&qe&&N&&g.jsx(aO,{projectId:n,project:qe,experiments:a,sel:N.sel,toggled:N.toggled,onSelChange:he=>Ee({sel:he}),onToggledChange:he=>Ee({toggled:he}),onOpenFile:ne},"code")}):g.jsx("div",{className:"tab-body",children:st&&Pe&&qe&&g.jsx(GB,{experiment:Pe,project:qe,view:st.view,runs:u,selectedRunId:v,onSelectRun:_},`${st.id}:${st.view}`)})]})]}),U&&!q&&n&&g.jsx(fI,{onClose:re})]})}HA.createRoot(document.getElementById("root")).render(g.jsx(G.StrictMode,{children:g.jsx(H$,{})})); +`)),p=f.reduce((d,v)=>d.concat(...v),[]);return[f,p]}return[[],[]]},[e]);return G.useEffect(()=>{const c=(t==null?void 0:t.target)??LS,f=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const p=_=>{var S,y;if(a.current=_.ctrlKey||_.metaKey||_.shiftKey||_.altKey,(!a.current||a.current&&!f)&&E2(_))return!1;const w=BS(_.code,o);if(l.current.add(_[w]),OS(u,l.current,!1)){const x=((y=(S=_.composedPath)==null?void 0:S.call(_))==null?void 0:y[0])||_.target,b=(x==null?void 0:x.nodeName)==="BUTTON"||(x==null?void 0:x.nodeName)==="A";t.preventDefault!==!1&&(a.current||!b)&&_.preventDefault(),r(!0)}},d=_=>{const C=BS(_.code,o);OS(u,l.current,!0)?(r(!1),l.current.clear()):l.current.delete(_[C]),_.key==="Meta"&&l.current.clear(),a.current=!1},v=()=>{l.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",p),c==null||c.addEventListener("keyup",d),window.addEventListener("blur",v),window.addEventListener("contextmenu",v),()=>{c==null||c.removeEventListener("keydown",p),c==null||c.removeEventListener("keyup",d),window.removeEventListener("blur",v),window.removeEventListener("contextmenu",v)}}},[e,r]),n}function OS(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function BS(e,t){return t.includes(e)?"code":"key"}const wF=()=>{const e=Dt();return G.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,a,l],panZoom:u}=e.getState();return u?(await u.setViewport({x:t.x??r,y:t.y??a,zoom:t.zoom??l},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:a,minZoom:l,maxZoom:u,panZoom:o}=e.getState(),c=Wm(t,r,a,l,u,(n==null?void 0:n.padding)??.1);return o?(await o.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:a,snapToGrid:l,domNode:u}=e.getState();if(!u)return t;const{x:o,y:c}=u.getBoundingClientRect(),f={x:t.x-o,y:t.y-c},p=n.snapGrid??a,d=n.snapToGrid??l;return xl(f,r,d,p)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:a,y:l}=r.getBoundingClientRect(),u=Ea(t,n);return{x:u.x+a,y:u.y+l}}}),[])};function W2(e,t){const n=[],r=new Map,a=[];for(const l of e)if(l.type==="add"){a.push(l);continue}else if(l.type==="remove"||l.type==="replace")r.set(l.id,[l]);else{const u=r.get(l.id);u?u.push(l):r.set(l.id,[l])}for(const l of t){const u=r.get(l.id);if(!u){n.push(l);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){n.push({...u[0].item});continue}const o={...l};for(const c of u)CF(c,o);n.push(o)}return a.length&&a.forEach(l=>{l.index!==void 0?n.splice(l.index,0,{...l.item}):n.push({...l.item})}),n}function CF(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function EF(e,t){return W2(e,t)}function kF(e,t){return W2(e,t)}function is(e,t){return{id:e,type:"select",selected:t}}function ga(e,t=new Set,n=!1){const r=[];for(const[a,l]of e){const u=t.has(a);!(l.selected===void 0&&!u)&&l.selected!==u&&(n&&(l.selected=u),r.push(is(l.id,u)))}return r}function IS({items:e=[],lookup:t}){var a;const n=[],r=new Map(e.map(l=>[l.id,l]));for(const[l,u]of e.entries()){const o=t.get(u.id),c=((a=o==null?void 0:o.internals)==null?void 0:a.userNode)??o;c!==void 0&&c!==u&&n.push({id:u.id,item:u,type:"replace"}),c===void 0&&n.push({item:u,type:"add",index:l})}for(const[l]of t)r.get(l)===void 0&&n.push({id:l,type:"remove"});return n}function zS(e){return{id:e.id,type:"remove"}}const AF=S2();function NF(e,t,n={}){return hH(e,t,{...n,onError:n.onError??AF})}const HS=e=>Kz(e),TF=e=>m2(e);function Y2(e){return G.forwardRef(e)}const DF=typeof window<"u"?G.useLayoutEffect:G.useEffect;function FS(e){const[t,n]=G.useState(BigInt(0)),[r]=G.useState(()=>RF(()=>n(a=>a+BigInt(1))));return DF(()=>{const a=r.get();a.length&&(e(a),r.reset())},[t]),r}function RF(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const X2=G.createContext(null);function MF({children:e}){const t=Dt(),n=G.useCallback(o=>{const{nodes:c=[],setNodes:f,hasDefaultNodes:p,onNodesChange:d,nodeLookup:v,fitViewQueued:_,onNodesChangeMiddlewareMap:C}=t.getState();let w=c;for(const y of o)w=typeof y=="function"?y(w):y;let S=IS({items:w,lookup:v});for(const y of C.values())S=y(S);p&&f(w),S.length>0?d==null||d(S):_&&window.requestAnimationFrame(()=>{const{fitViewQueued:y,nodes:x,setNodes:b}=t.getState();y&&b(x)})},[]),r=FS(n),a=G.useCallback(o=>{const{edges:c=[],setEdges:f,hasDefaultEdges:p,onEdgesChange:d,edgeLookup:v}=t.getState();let _=c;for(const C of o)_=typeof C=="function"?C(_):C;p?f(_):d&&d(IS({items:_,lookup:v}))},[]),l=FS(a),u=G.useMemo(()=>({nodeQueue:r,edgeQueue:l}),[]);return g.jsx(X2.Provider,{value:u,children:e})}function jF(){const e=G.useContext(X2);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const LF=e=>!!e.panZoom;function e0(){const e=wF(),t=Dt(),n=jF(),r=it(LF),a=G.useMemo(()=>{const l=d=>t.getState().nodeLookup.get(d),u=d=>{n.nodeQueue.push(d)},o=d=>{n.edgeQueue.push(d)},c=d=>{var y,x;const{nodeLookup:v,nodeOrigin:_}=t.getState(),C=HS(d)?d:v.get(d.id),w=C.parentId?w2(C.position,C.measured,C.parentId,v,_):C.position,S={...C,position:w,width:((y=C.measured)==null?void 0:y.width)??C.width,height:((x=C.measured)==null?void 0:x.height)??C.height};return ol(S)},f=(d,v,_={replace:!1})=>{u(C=>C.map(w=>{if(w.id===d){const S=typeof v=="function"?v(w):v;return _.replace&&HS(S)?S:{...w,...S}}return w}))},p=(d,v,_={replace:!1})=>{o(C=>C.map(w=>{if(w.id===d){const S=typeof v=="function"?v(w):v;return _.replace&&TF(S)?S:{...w,...S}}return w}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var v;return(v=l(d))==null?void 0:v.internals.userNode},getInternalNode:l,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(v=>({...v}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:u,setEdges:o,addNodes:d=>{const v=Array.isArray(d)?d:[d];n.nodeQueue.push(_=>[..._,...v])},addEdges:d=>{const v=Array.isArray(d)?d:[d];n.edgeQueue.push(_=>[..._,...v])},toObject:()=>{const{nodes:d=[],edges:v=[],transform:_}=t.getState(),[C,w,S]=_;return{nodes:d.map(y=>({...y})),edges:v.map(y=>({...y})),viewport:{x:C,y:w,zoom:S}}},deleteElements:async({nodes:d=[],edges:v=[]})=>{const{nodes:_,edges:C,onNodesDelete:w,onEdgesDelete:S,triggerNodeChanges:y,triggerEdgeChanges:x,onDelete:b,onBeforeDelete:E}=t.getState(),{nodes:D,edges:N}=await tH({nodesToRemove:d,edgesToRemove:v,nodes:_,edges:C,onBeforeDelete:E}),R=N.length>0,T=D.length>0;if(R){const j=N.map(zS);S==null||S(N),x(j)}if(T){const j=D.map(zS);w==null||w(D),y(j)}return(T||R)&&(b==null||b({nodes:D,edges:N})),{deletedNodes:D,deletedEdges:N}},getIntersectingNodes:(d,v=!0,_)=>{const C=uS(d),w=C?d:c(d),S=_!==void 0;return w?(_||t.getState().nodes).filter(y=>{const x=t.getState().nodeLookup.get(y.id);if(x&&!C&&(y.id===d.id||!x.internals.positionAbsolute))return!1;const b=ol(S?y:x),E=qu(b,w);return v&&E>0||E>=b.width*b.height||E>=w.width*w.height}):[]},isNodeIntersecting:(d,v,_=!0)=>{const w=uS(d)?d:c(d);if(!w)return!1;const S=qu(w,v);return _&&S>0||S>=v.width*v.height||S>=w.width*w.height},updateNode:f,updateNodeData:(d,v,_={replace:!1})=>{f(d,C=>{const w=typeof v=="function"?v(C):v;return _.replace?{...C,data:w}:{...C,data:{...C.data,...w}}},_)},updateEdge:p,updateEdgeData:(d,v,_={replace:!1})=>{p(d,C=>{const w=typeof v=="function"?v(C):v;return _.replace?{...C,data:w}:{...C,data:{...C.data,...w}}},_)},getNodesBounds:d=>{const{nodeLookup:v,nodeOrigin:_}=t.getState();return Zz(d,{nodeLookup:v,nodeOrigin:_})},getHandleConnections:({type:d,id:v,nodeId:_})=>{var C;return Array.from(((C=t.getState().connectionLookup.get(`${_}-${d}${v?`-${v}`:""}`))==null?void 0:C.values())??[])},getNodeConnections:({type:d,handleId:v,nodeId:_})=>{var C;return Array.from(((C=t.getState().connectionLookup.get(`${_}${d?v?`-${d}-${v}`:`-${d}`:""}`))==null?void 0:C.values())??[])},fitView:async d=>{const v=t.getState().fitViewResolver??rH();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:v}),n.nodeQueue.push(_=>[..._]),v.promise}}},[]);return G.useMemo(()=>({...a,...e,viewportInitialized:r}),[r])}const PS=e=>e.selected,OF=typeof window<"u"?window:void 0;function BF({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Dt(),{deleteElements:r}=e0(),a=cl(e,{actInsideInputWithModifier:!1}),l=cl(t,{target:OF});G.useEffect(()=>{if(a){const{edges:u,nodes:o}=n.getState();r({nodes:o.filter(PS),edges:u.filter(PS)}),n.setState({nodesSelectionActive:!1})}},[a]),G.useEffect(()=>{n.setState({multiSelectionActive:l})},[l])}function IF(e){const t=Dt();G.useEffect(()=>{const n=()=>{var a,l,u,o;if(!e.current||!(((l=(a=e.current).checkVisibility)==null?void 0:l.call(a))??!0))return!1;const r=Ym(e.current);(r.height===0||r.width===0)&&((o=(u=t.getState()).onError)==null||o.call(u,"004",ei.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const jh={position:"absolute",width:"100%",height:"100%",top:0,left:0},zF=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function HF({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:a=.5,panOnScrollMode:l=os.Free,zoomOnDoubleClick:u=!0,panOnDrag:o=!0,defaultViewport:c,translateExtent:f,minZoom:p,maxZoom:d,zoomActivationKeyCode:v,preventScrolling:_=!0,children:C,noWheelClassName:w,noPanClassName:S,onViewportChange:y,isControlledViewport:x,paneClickDistance:b,selectionOnDrag:E}){const D=Dt(),N=G.useRef(null),{userSelectionActive:R,lib:T,connectionInProgress:j}=it(zF,Tt),B=cl(v),z=G.useRef();IF(N);const V=G.useCallback(F=>{y==null||y({x:F[0],y:F[1],zoom:F[2]}),x||D.setState({transform:F})},[y,x]);return G.useEffect(()=>{if(N.current){z.current=PH({domNode:N.current,minZoom:p,maxZoom:d,translateExtent:f,viewport:c,onDraggingChange:q=>D.setState(X=>X.paneDragging===q?X:{paneDragging:q}),onPanZoomStart:(q,X)=>{const{onViewportChangeStart:K,onMoveStart:L}=D.getState();L==null||L(q,X),K==null||K(X)},onPanZoom:(q,X)=>{const{onViewportChange:K,onMove:L}=D.getState();L==null||L(q,X),K==null||K(X)},onPanZoomEnd:(q,X)=>{const{onViewportChangeEnd:K,onMoveEnd:L}=D.getState();L==null||L(q,X),K==null||K(X)}});const{x:F,y:P,zoom:W}=z.current.getViewport();return D.setState({panZoom:z.current,transform:[F,P,W],domNode:N.current.closest(".react-flow")}),()=>{var q;(q=z.current)==null||q.destroy()}}},[]),G.useEffect(()=>{var F;(F=z.current)==null||F.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:a,panOnScrollMode:l,zoomOnDoubleClick:u,panOnDrag:o,zoomActivationKeyPressed:B,preventScrolling:_,noPanClassName:S,userSelectionActive:R,noWheelClassName:w,lib:T,onTransformChange:V,connectionInProgress:j,selectionOnDrag:E,paneClickDistance:b})},[e,t,n,r,a,l,u,o,B,_,S,R,w,T,V,j,E,b]),g.jsx("div",{className:"react-flow__renderer",ref:N,style:jh,children:C})}const FF=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function PF(){const{userSelectionActive:e,userSelectionRect:t}=it(FF,Tt);return e&&t?g.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Mp=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},$F=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function UF({isSelecting:e,selectionKeyPressed:t,selectionMode:n=al.Full,panOnDrag:r,autoPanOnSelection:a,paneClickDistance:l,selectionOnDrag:u,onSelectionStart:o,onSelectionEnd:c,onPaneClick:f,onPaneContextMenu:p,onPaneScroll:d,onPaneMouseEnter:v,onPaneMouseMove:_,onPaneMouseLeave:C,children:w}){const S=G.useRef(0),y=Dt(),{userSelectionActive:x,elementsSelectable:b,dragging:E,panBy:D,autoPanSpeed:N}=it($F,Tt),R=b&&(e||x),T=G.useRef(null),j=G.useRef(),B=G.useRef(new Set),z=G.useRef(new Set),V=G.useRef(!1),F=G.useRef(!1),P=G.useRef({x:0,y:0}),W=G.useRef(!1),q=H=>{if(F.current||V.current||y.getState().connection.inProgress){F.current=!1,V.current=!1;return}f==null||f(H),y.getState().resetSelectedElements(),y.setState({nodesSelectionActive:!1})},X=H=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){H.preventDefault();return}p==null||p(H)},K=d?H=>d(H):void 0,L=H=>{F.current&&(H.stopPropagation(),F.current=!1)},M=H=>{var we,ft;const{domNode:ee,transform:ne}=y.getState();if(j.current=ee==null?void 0:ee.getBoundingClientRect(),!j.current)return;const pe=H.target===T.current;if(!pe&&!!H.target.closest(".nokey")||!e||!(u&&pe||t)||H.button!==0||!H.isPrimary)return;(ft=(we=H.target)==null?void 0:we.setPointerCapture)==null||ft.call(we,H.pointerId),F.current=!1;const{x:Ce,y:Ee}=Qn(H.nativeEvent,j.current),Ne=xl({x:Ce,y:Ee},ne);y.setState({userSelectionRect:{width:0,height:0,startX:Ne.x,startY:Ne.y,x:Ce,y:Ee}}),pe||(H.stopPropagation(),H.preventDefault())};function O(H,ee){const{userSelectionRect:ne}=y.getState();if(!ne)return;const{transform:pe,nodeLookup:fe,edgeLookup:ye,connectionLookup:Ce,triggerNodeChanges:Ee,triggerEdgeChanges:Ne,defaultEdgeOptions:we}=y.getState(),ft={x:ne.startX,y:ne.startY},{x:Ct,y:st}=Ea(ft,pe),We={startX:ft.x,startY:ft.y,x:HPe.id)),z.current=new Set;const qe=(we==null?void 0:we.selectable)??!0;for(const Pe of B.current){const ue=Ce.get(Pe);if(ue)for(const{edgeId:_e}of ue.values()){const ke=ye.get(_e);ke&&(ke.selectable??qe)&&z.current.add(_e)}}if(!hS(vt,B.current)){const Pe=ga(fe,B.current,!0);Ee(Pe)}if(!hS(dt,z.current)){const Pe=ga(ye,z.current);Ne(Pe)}y.setState({userSelectionRect:We,userSelectionActive:!0,nodesSelectionActive:!1})}function U(){if(!a||!j.current)return;const[H,ee]=Vm(P.current,j.current,N);D({x:H,y:ee}).then(ne=>{if(!F.current||!ne){S.current=requestAnimationFrame(U);return}const{x:pe,y:fe}=P.current;O(pe,fe),S.current=requestAnimationFrame(U)})}const $=()=>{cancelAnimationFrame(S.current),S.current=0,W.current=!1};G.useEffect(()=>()=>$(),[]);const Q=H=>{const{userSelectionRect:ee,transform:ne,resetSelectedElements:pe}=y.getState();if(!j.current||!ee)return;const{x:fe,y:ye}=Qn(H.nativeEvent,j.current);P.current={x:fe,y:ye};const Ce=Ea({x:ee.startX,y:ee.startY},ne);if(!F.current){const Ee=t?0:l;if(Math.hypot(fe-Ce.x,ye-Ce.y)<=Ee)return;pe(),o==null||o(H)}F.current=!0,W.current||(U(),W.current=!0),O(fe,ye)},re=H=>{var ee,ne;if(!R){H.target===T.current&&y.getState().connection.inProgress&&(V.current=!0);return}H.button===0&&((ne=(ee=H.target)==null?void 0:ee.releasePointerCapture)==null||ne.call(ee,H.pointerId),!x&&H.target===T.current&&y.getState().userSelectionRect&&(q==null||q(H)),y.setState({userSelectionActive:!1,userSelectionRect:null}),F.current&&(c==null||c(H),y.setState({nodesSelectionActive:B.current.size>0})),$())},se=H=>{var ee,ne;(ne=(ee=H.target)==null?void 0:ee.releasePointerCapture)==null||ne.call(ee,H.pointerId),$()},Z=r===!0||Array.isArray(r)&&r.includes(0);return g.jsxs("div",{className:$t(["react-flow__pane",{draggable:Z,dragging:E,selection:e}]),onClick:R?void 0:Mp(q,T),onContextMenu:Mp(X,T),onWheel:Mp(K,T),onPointerEnter:R?void 0:v,onPointerMove:R?Q:_,onPointerUp:re,onPointerCancel:R?se:void 0,onPointerDownCapture:R?M:void 0,onClickCapture:R?L:void 0,onPointerLeave:C,ref:T,style:jh,children:[w,g.jsx(PF,{})]})}function kg({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:a,unselectNodesAndEdges:l,multiSelectionActive:u,nodeLookup:o,onError:c}=t.getState(),f=o.get(e);if(!f){c==null||c("012",ei.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&u)&&(l({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var p;return(p=r==null?void 0:r.current)==null?void 0:p.blur()})):a([e])}function K2({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:a,isSelectable:l,nodeClickDistance:u}){const o=Dt(),[c,f]=G.useState(!1),p=G.useRef();return G.useEffect(()=>{p.current=AH({getStoreItems:()=>o.getState(),onNodeMouseDown:d=>{kg({id:d,store:o,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),G.useEffect(()=>{if(!(t||!e.current||!p.current))return p.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:l,nodeId:a,nodeClickDistance:u}),()=>{var d;(d=p.current)==null||d.destroy()}},[n,r,t,l,e,a,u]),c}const GF=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Z2(){const e=Dt();return G.useCallback(n=>{const{nodeExtent:r,snapToGrid:a,snapGrid:l,nodesDraggable:u,onError:o,updateNodePositions:c,nodeLookup:f,nodeOrigin:p}=e.getState(),d=new Map,v=GF(u),_=a?l[0]:5,C=a?l[1]:5,w=n.direction.x*_*n.factor,S=n.direction.y*C*n.factor;for(const[,y]of f){if(!v(y))continue;let x={x:y.internals.positionAbsolute.x+w,y:y.internals.positionAbsolute.y+S};a&&(x=Sl(x,l));const{position:b,positionAbsolute:E}=v2({nodeId:y.id,nextPosition:x,nodeLookup:f,nodeExtent:r,nodeOrigin:p,onError:o});y.position=b,y.internals.positionAbsolute=E,d.set(y.id,y)}c(d)},[])}const t0=G.createContext(null),qF=t0.Provider;t0.Consumer;const Q2=()=>G.useContext(t0),VF=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),J2=G.createContext(null);function WF({children:e}){const t=it(VF,Tt);return g.jsx(J2.Provider,{value:t,children:e})}function YF(){const e=G.useContext(J2);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const XF={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},KF=(e,t,n)=>r=>{const{connectionClickStartHandle:a,connectionMode:l,connection:u}=r,{fromHandle:o,toHandle:c,isValid:f}=u;if(!o&&!a)return XF;const p=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,connectingTo:p,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,isPossibleEndHandle:l===wa.Strict?(o==null?void 0:o.type)!==n:e!==(o==null?void 0:o.nodeId)||t!==(o==null?void 0:o.id),connectionInProcess:!!o,clickConnectionInProcess:!!a,valid:p&&f}};function ZF({type:e="source",position:t=je.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:l=!0,id:u,onConnect:o,children:c,className:f,onMouseDown:p,onTouchStart:d,...v},_){var W,q;const C=u||null,w=e==="target",S=Dt(),y=Q2(),{connectOnClick:x,noPanClassName:b,rfId:E}=YF(),{connectingFrom:D,connectingTo:N,clickConnecting:R,isPossibleEndHandle:T,connectionInProcess:j,clickConnectionInProcess:B,valid:z}=it(KF(y,C,e),Tt);y||(q=(W=S.getState()).onError)==null||q.call(W,"010",ei.error010());const V=X=>{const{defaultEdgeOptions:K,onConnect:L,hasDefaultEdges:M}=S.getState(),O={...K,...X};if(M){const{edges:U,setEdges:$,onError:Q}=S.getState();$(NF(O,U,{onError:Q}))}L==null||L(O),o==null||o(O)},F=X=>{if(!y)return;const K=k2(X.nativeEvent);if(a&&(K&&X.button===0||!K)){const L=S.getState();Eg.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:L.autoPanOnConnect,connectionMode:L.connectionMode,connectionRadius:L.connectionRadius,domNode:L.domNode,nodeLookup:L.nodeLookup,lib:L.lib,isTarget:w,handleId:C,nodeId:y,flowId:L.rfId,panBy:L.panBy,cancelConnection:L.cancelConnection,onConnectStart:L.onConnectStart,onConnectEnd:(...M)=>{var O,U;return(U=(O=S.getState()).onConnectEnd)==null?void 0:U.call(O,...M)},updateConnection:L.updateConnection,onConnect:V,isValidConnection:n||((...M)=>{var O,U;return((U=(O=S.getState()).isValidConnection)==null?void 0:U.call(O,...M))??!0}),getTransform:()=>S.getState().transform,getFromHandle:()=>S.getState().connection.fromHandle,autoPanSpeed:L.autoPanSpeed,dragThreshold:L.connectionDragThreshold})}K?p==null||p(X):d==null||d(X)},P=X=>{const{onClickConnectStart:K,onClickConnectEnd:L,connectionClickStartHandle:M,connectionMode:O,isValidConnection:U,lib:$,rfId:Q,nodeLookup:re,connection:se}=S.getState();if(!y||!M&&!a)return;if(!M){K==null||K(X.nativeEvent,{nodeId:y,handleId:C,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:y,type:e,id:C}});return}const Z=C2(X.target),H=n||U,{connection:ee,isValid:ne}=Eg.isValid(X.nativeEvent,{handle:{nodeId:y,id:C,type:e},connectionMode:O,fromNodeId:M.nodeId,fromHandleId:M.id||null,fromType:M.type,isValidConnection:H,flowId:Q,doc:Z,lib:$,nodeLookup:re});ne&&ee&&V(ee);const pe=structuredClone(se);delete pe.inProgress,pe.toPosition=pe.toHandle?pe.toHandle.position:null,L==null||L(X,pe),S.setState({connectionClickStartHandle:null})};return g.jsx("div",{"data-handleid":C,"data-nodeid":y,"data-handlepos":t,"data-id":`${E}-${y}-${C}-${e}`,className:$t(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",b,f,{source:!w,target:w,connectable:r,connectablestart:a,connectableend:l,clickconnecting:R,connectingfrom:D,connectingto:N,valid:z,connectionindicator:r&&(!j||T)&&(j||B?l:a)}]),onMouseDown:F,onTouchStart:F,onClick:x?P:void 0,ref:_,...v,children:c})}const Aa=G.memo(Y2(ZF));function QF({data:e,isConnectable:t,sourcePosition:n=je.Bottom}){return g.jsxs(g.Fragment,{children:[e==null?void 0:e.label,g.jsx(Aa,{type:"source",position:n,isConnectable:t})]})}function JF({data:e,isConnectable:t,targetPosition:n=je.Top,sourcePosition:r=je.Bottom}){return g.jsxs(g.Fragment,{children:[g.jsx(Aa,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,g.jsx(Aa,{type:"source",position:r,isConnectable:t})]})}function eP(){return null}function tP({data:e,isConnectable:t,targetPosition:n=je.Top}){return g.jsxs(g.Fragment,{children:[g.jsx(Aa,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Vu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},$S={input:QF,default:JF,output:tP,group:eP};function nP(e){var t,n,r,a;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((a=e.style)==null?void 0:a.height)}}const iP=e=>{const{width:t,height:n,x:r,y:a}=bl(e.nodeLookup,{filter:l=>!!l.selected});return{width:Zn(t)?t:null,height:Zn(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${a}px)`}};function rP({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Dt(),{width:a,height:l,transformString:u,userSelectionActive:o}=it(iP,Tt),c=Z2(),f=G.useRef(null);G.useEffect(()=>{var _;n||(_=f.current)==null||_.focus({preventScroll:!0})},[n]);const p=!o&&a!==null&&l!==null;if(K2({nodeRef:f,disabled:!p}),!p)return null;const d=e?_=>{const C=r.getState().nodes.filter(w=>w.selected);e(_,C)}:void 0,v=_=>{Object.prototype.hasOwnProperty.call(Vu,_.key)&&(_.preventDefault(),c({direction:Vu[_.key],factor:_.shiftKey?4:1}))};return g.jsx("div",{className:$t(["react-flow__nodesselection","react-flow__container",t]),style:{transform:u},children:g.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:v,style:{width:a,height:l}})})}const US=typeof window<"u"?window:void 0,sP=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function eE({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:u,paneClickDistance:o,deleteKeyCode:c,selectionKeyCode:f,selectionOnDrag:p,selectionMode:d,onSelectionStart:v,onSelectionEnd:_,multiSelectionKeyCode:C,panActivationKeyCode:w,zoomActivationKeyCode:S,elementsSelectable:y,zoomOnScroll:x,zoomOnPinch:b,panOnScroll:E,panOnScrollSpeed:D,panOnScrollMode:N,zoomOnDoubleClick:R,panOnDrag:T,autoPanOnSelection:j,defaultViewport:B,translateExtent:z,minZoom:V,maxZoom:F,preventScrolling:P,onSelectionContextMenu:W,noWheelClassName:q,noPanClassName:X,disableKeyboardA11y:K,onViewportChange:L,isControlledViewport:M}){const{nodesSelectionActive:O,userSelectionActive:U}=it(sP,Tt),$=cl(f,{target:US}),Q=cl(w,{target:US}),re=Q||T,se=Q||E,Z=p&&re!==!0,H=$||U||Z;return BF({deleteKeyCode:c,multiSelectionKeyCode:C}),g.jsx(HF,{onPaneContextMenu:l,elementsSelectable:y,zoomOnScroll:x,zoomOnPinch:b,panOnScroll:se,panOnScrollSpeed:D,panOnScrollMode:N,zoomOnDoubleClick:R,panOnDrag:!$&&re,defaultViewport:B,translateExtent:z,minZoom:V,maxZoom:F,zoomActivationKeyCode:S,preventScrolling:P,noWheelClassName:q,noPanClassName:X,onViewportChange:L,isControlledViewport:M,paneClickDistance:o,selectionOnDrag:Z,children:g.jsxs(UF,{onSelectionStart:v,onSelectionEnd:_,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:l,onPaneScroll:u,panOnDrag:re,autoPanOnSelection:j,isSelecting:!!H,selectionMode:d,selectionKeyPressed:$,paneClickDistance:o,selectionOnDrag:Z,children:[e,O&&g.jsx(rP,{onSelectionContextMenu:W,noPanClassName:X,disableKeyboardA11y:K})]})})}eE.displayName="FlowRenderer";const aP=G.memo(eE),oP=e=>t=>e?qm(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function lP(e){return it(G.useCallback(oP(e),[e]),Tt)}const cP=e=>e.updateNodeInternals;function uP(){const e=it(cP),[t]=G.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(a=>{const l=a.target.getAttribute("data-id");r.set(l,{id:l,nodeElement:a.target,force:!0})}),e(r)}));return G.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function hP({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const a=Dt(),l=G.useRef(null),u=G.useRef(null),o=G.useRef(e.sourcePosition),c=G.useRef(e.targetPosition),f=G.useRef(t),p=n&&!!e.internals.handleBounds;return G.useEffect(()=>{l.current&&!e.hidden&&(!p||u.current!==l.current)&&(u.current&&(r==null||r.unobserve(u.current)),r==null||r.observe(l.current),u.current=l.current)},[p,e.hidden]),G.useEffect(()=>()=>{u.current&&(r==null||r.unobserve(u.current),u.current=null)},[]),G.useEffect(()=>{if(l.current){const d=f.current!==t,v=o.current!==e.sourcePosition,_=c.current!==e.targetPosition;(d||v||_)&&(f.current=t,o.current=e.sourcePosition,c.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:l.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),l}function fP({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:a,onContextMenu:l,onDoubleClick:u,nodesDraggable:o,elementsSelectable:c,nodesConnectable:f,nodesFocusable:p,resizeObserver:d,noDragClassName:v,noPanClassName:_,disableKeyboardA11y:C,rfId:w,nodeTypes:S,nodeClickDistance:y,onError:x}){const{node:b,internals:E,isParent:D}=it(H=>{const ee=H.nodeLookup.get(e),ne=H.parentLookup.has(e);return{node:ee,internals:ee.internals,isParent:ne}},Tt);let N=b.type||"default",R=(S==null?void 0:S[N])||$S[N];R===void 0&&(x==null||x("003",ei.error003(N)),N="default",R=(S==null?void 0:S.default)||$S.default);const T=!!(b.draggable||o&&typeof b.draggable>"u"),j=!!(b.selectable||c&&typeof b.selectable>"u"),B=!!(b.connectable||f&&typeof b.connectable>"u"),z=!!(b.focusable||p&&typeof b.focusable>"u"),V=Dt(),F=x2(b),P=hP({node:b,nodeType:N,hasDimensions:F,resizeObserver:d}),W=K2({nodeRef:P,disabled:b.hidden||!T,noDragClassName:v,handleSelector:b.dragHandle,nodeId:e,isSelectable:j,nodeClickDistance:y}),q=Z2();if(b.hidden)return null;const X=Yi(b),K=nP(b),L=j||T||t||n||r||a,M=n?H=>n(H,{...E.userNode}):void 0,O=r?H=>r(H,{...E.userNode}):void 0,U=a?H=>a(H,{...E.userNode}):void 0,$=l?H=>l(H,{...E.userNode}):void 0,Q=u?H=>u(H,{...E.userNode}):void 0,re=H=>{const{selectNodesOnDrag:ee,nodeDragThreshold:ne}=V.getState();j&&(!ee||!T||ne>0)&&kg({id:e,store:V,nodeRef:P}),t&&t(H,{...E.userNode})},se=H=>{if(!(E2(H.nativeEvent)||C)){if(f2.includes(H.key)&&j){const ee=H.key==="Escape";kg({id:e,store:V,unselect:ee,nodeRef:P})}else if(T&&b.selected&&Object.prototype.hasOwnProperty.call(Vu,H.key)){H.preventDefault();const{ariaLabelConfig:ee}=V.getState();V.setState({ariaLiveMessage:ee["node.a11yDescription.ariaLiveMessage"]({direction:H.key.replace("Arrow","").toLowerCase(),x:~~E.positionAbsolute.x,y:~~E.positionAbsolute.y})}),q({direction:Vu[H.key],factor:H.shiftKey?4:1})}}},Z=()=>{var Ce;if(C||!((Ce=P.current)!=null&&Ce.matches(":focus-visible")))return;const{transform:H,width:ee,height:ne,autoPanOnNodeFocus:pe,setCenter:fe}=V.getState();if(!pe)return;qm(new Map([[e,b]]),{x:0,y:0,width:ee,height:ne},H,!0).length>0||fe(b.position.x+X.width/2,b.position.y+X.height/2,{zoom:H[2]})};return g.jsx("div",{className:$t(["react-flow__node",`react-flow__node-${N}`,{[_]:T},b.className,{selected:b.selected,selectable:j,parent:D,draggable:T,dragging:W}]),ref:P,style:{zIndex:E.z,transform:`translate(${E.positionAbsolute.x}px,${E.positionAbsolute.y}px)`,pointerEvents:L?"all":"none",visibility:F?"visible":"hidden",...b.style,...K},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:M,onMouseMove:O,onMouseLeave:U,onContextMenu:$,onClick:re,onDoubleClick:Q,onKeyDown:z?se:void 0,tabIndex:z?0:void 0,onFocus:z?Z:void 0,role:b.ariaRole??(z?"group":void 0),"aria-roledescription":"node","aria-describedby":C?void 0:`${G2}-${w}`,"aria-label":b.ariaLabel,...b.domAttributes,children:g.jsx(qF,{value:e,children:g.jsx(R,{id:e,data:b.data,type:N,positionAbsoluteX:E.positionAbsolute.x,positionAbsoluteY:E.positionAbsolute.y,selected:b.selected??!1,selectable:j,draggable:T,deletable:b.deletable??!0,isConnectable:B,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:W,dragHandle:b.dragHandle,zIndex:E.z,parentId:b.parentId,...X})})})}var dP=G.memo(fP);const pP=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function tE(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,onError:l}=it(pP,Tt),u=lP(e.onlyRenderVisibleElements),o=uP();return g.jsx("div",{className:"react-flow__nodes",style:jh,children:u.map(c=>g.jsx(dP,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:l},c))})}tE.displayName="NodeRenderer";const gP=G.memo(tE);function mP(e){return it(G.useCallback(n=>{if(!e)return n.edges.map(a=>a.id);const r=[];if(n.width&&n.height)for(const a of n.edges){const l=n.nodeLookup.get(a.source),u=n.nodeLookup.get(a.target);l&&u&&lH({sourceNode:l,targetNode:u,width:n.width,height:n.height,transform:n.transform})&&r.push(a.id)}return r},[e]),Tt)}const vP=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return g.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},_P=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return g.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},GS={[Uu.Arrow]:vP,[Uu.ArrowClosed]:_P};function yP(e){const t=Dt();return G.useMemo(()=>{var a,l;return Object.prototype.hasOwnProperty.call(GS,e)?GS[e]:((l=(a=t.getState()).onError)==null||l.call(a,"009",ei.error009(e)),null)},[e])}const bP=({id:e,type:t,color:n,width:r=12.5,height:a=12.5,markerUnits:l="strokeWidth",strokeWidth:u,orient:o="auto-start-reverse"})=>{const c=yP(t);return c?g.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:l,orient:o,refX:"0",refY:"0",children:g.jsx(c,{color:n,strokeWidth:u})}):null},nE=({defaultColor:e,rfId:t})=>{const n=it(l=>l.edges),r=it(l=>l.defaultEdgeOptions),a=G.useMemo(()=>mH(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return a.length?g.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:g.jsx("defs",{children:a.map(l=>g.jsx(bP,{id:l.id,type:l.type,color:l.color,width:l.width,height:l.height,markerUnits:l.markerUnits,strokeWidth:l.strokeWidth,orient:l.orient},l.id))})}):null};nE.displayName="MarkerDefinitions";var SP=G.memo(nE);function iE({x:e,y:t,label:n,labelStyle:r,labelShowBg:a=!0,labelBgStyle:l,labelBgPadding:u=[2,4],labelBgBorderRadius:o=2,children:c,className:f,...p}){const[d,v]=G.useState({x:1,y:0,width:0,height:0}),_=$t(["react-flow__edge-textwrapper",f]),C=G.useRef(null);return G.useEffect(()=>{if(C.current){const w=C.current.getBBox();v({x:w.x,y:w.y,width:w.width,height:w.height})}},[n]),n?g.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:_,visibility:d.width?"visible":"hidden",...p,children:[a&&g.jsx("rect",{width:d.width+2*u[0],x:-u[0],y:-u[1],height:d.height+2*u[1],className:"react-flow__edge-textbg",style:l,rx:o,ry:o}),g.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:C,style:r,children:n}),c]}):null}iE.displayName="EdgeText";const xP=G.memo(iE);function Lh({path:e,labelX:t,labelY:n,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:o,labelBgBorderRadius:c,interactionWidth:f=20,...p}){return g.jsxs(g.Fragment,{children:[g.jsx("path",{...p,d:e,fill:"none",className:$t(["react-flow__edge-path",p.className])}),f?g.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}):null,r&&Zn(t)&&Zn(n)?g.jsx(xP,{x:t,y:n,label:r,labelStyle:a,labelShowBg:l,labelBgStyle:u,labelBgPadding:o,labelBgBorderRadius:c}):null]})}function qS({pos:e,x1:t,y1:n,x2:r,y2:a}){return e===je.Left||e===je.Right?[.5*(t+r),n]:[t,.5*(n+a)]}function rE({sourceX:e,sourceY:t,sourcePosition:n=je.Bottom,targetX:r,targetY:a,targetPosition:l=je.Top}){const[u,o]=qS({pos:n,x1:e,y1:t,x2:r,y2:a}),[c,f]=qS({pos:l,x1:r,y1:a,x2:e,y2:t}),[p,d,v,_]=A2({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:u,sourceControlY:o,targetControlX:c,targetControlY:f});return[`M${e},${t} C${u},${o} ${c},${f} ${r},${a}`,p,d,v,_]}function sE(e){return G.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,sourcePosition:u,targetPosition:o,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:v,labelBgBorderRadius:_,style:C,markerEnd:w,markerStart:S,interactionWidth:y})=>{const[x,b,E]=rE({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:l,targetPosition:o}),D=e.isInternal?void 0:t;return g.jsx(Lh,{id:D,path:x,labelX:b,labelY:E,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:v,labelBgBorderRadius:_,style:C,markerEnd:w,markerStart:S,interactionWidth:y})})}const wP=sE({isInternal:!1}),aE=sE({isInternal:!0});wP.displayName="SimpleBezierEdge";aE.displayName="SimpleBezierEdgeInternal";function oE(e){return G.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:v,sourcePosition:_=je.Bottom,targetPosition:C=je.Top,markerEnd:w,markerStart:S,pathOptions:y,interactionWidth:x})=>{const[b,E,D]=xg({sourceX:n,sourceY:r,sourcePosition:_,targetX:a,targetY:l,targetPosition:C,borderRadius:y==null?void 0:y.borderRadius,offset:y==null?void 0:y.offset,stepPosition:y==null?void 0:y.stepPosition}),N=e.isInternal?void 0:t;return g.jsx(Lh,{id:N,path:b,labelX:E,labelY:D,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:v,markerEnd:w,markerStart:S,interactionWidth:x})})}const lE=oE({isInternal:!1}),cE=oE({isInternal:!0});lE.displayName="SmoothStepEdge";cE.displayName="SmoothStepEdgeInternal";function uE(e){return G.memo(({id:t,...n})=>{var a;const r=e.isInternal?void 0:t;return g.jsx(lE,{...n,id:r,pathOptions:G.useMemo(()=>{var l;return{borderRadius:0,offset:(l=n.pathOptions)==null?void 0:l.offset}},[(a=n.pathOptions)==null?void 0:a.offset])})})}const CP=uE({isInternal:!1}),hE=uE({isInternal:!0});CP.displayName="StepEdge";hE.displayName="StepEdgeInternal";function fE(e){return G.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:v,markerEnd:_,markerStart:C,interactionWidth:w})=>{const[S,y,x]=D2({sourceX:n,sourceY:r,targetX:a,targetY:l}),b=e.isInternal?void 0:t;return g.jsx(Lh,{id:b,path:S,labelX:y,labelY:x,label:u,labelStyle:o,labelShowBg:c,labelBgStyle:f,labelBgPadding:p,labelBgBorderRadius:d,style:v,markerEnd:_,markerStart:C,interactionWidth:w})})}const EP=fE({isInternal:!1}),dE=fE({isInternal:!0});EP.displayName="StraightEdge";dE.displayName="StraightEdgeInternal";function pE(e){return G.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:l,sourcePosition:u=je.Bottom,targetPosition:o=je.Top,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:v,labelBgBorderRadius:_,style:C,markerEnd:w,markerStart:S,pathOptions:y,interactionWidth:x})=>{const[b,E,D]=N2({sourceX:n,sourceY:r,sourcePosition:u,targetX:a,targetY:l,targetPosition:o,curvature:y==null?void 0:y.curvature}),N=e.isInternal?void 0:t;return g.jsx(Lh,{id:N,path:b,labelX:E,labelY:D,label:c,labelStyle:f,labelShowBg:p,labelBgStyle:d,labelBgPadding:v,labelBgBorderRadius:_,style:C,markerEnd:w,markerStart:S,interactionWidth:x})})}const kP=pE({isInternal:!1}),gE=pE({isInternal:!0});kP.displayName="BezierEdge";gE.displayName="BezierEdgeInternal";const VS={default:gE,straight:dE,step:hE,smoothstep:cE,simplebezier:aE},WS={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},AP=(e,t,n)=>n===je.Left?e-t:n===je.Right?e+t:e,NP=(e,t,n)=>n===je.Top?e-t:n===je.Bottom?e+t:e,YS="react-flow__edgeupdater";function XS({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:a,onMouseEnter:l,onMouseOut:u,type:o}){return g.jsx("circle",{onMouseDown:a,onMouseEnter:l,onMouseOut:u,className:$t([YS,`${YS}-${o}`]),cx:AP(t,r,e),cy:NP(n,r,e),r,stroke:"transparent",fill:"transparent"})}function TP({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:a,targetX:l,targetY:u,sourcePosition:o,targetPosition:c,onReconnect:f,onReconnectStart:p,onReconnectEnd:d,setReconnecting:v,setUpdateHover:_}){const C=Dt(),w=(E,D)=>{if(E.button!==0)return;const{autoPanOnConnect:N,domNode:R,connectionMode:T,connectionRadius:j,lib:B,onConnectStart:z,cancelConnection:V,nodeLookup:F,rfId:P,panBy:W,updateConnection:q}=C.getState(),X=D.type==="target",K=(O,U)=>{v(!1),d==null||d(O,n,D.type,U)},L=O=>f==null?void 0:f(n,O),M=(O,U)=>{v(!0),p==null||p(E,n,D.type),z==null||z(O,U)};Eg.onPointerDown(E.nativeEvent,{autoPanOnConnect:N,connectionMode:T,connectionRadius:j,domNode:R,handleId:D.id,nodeId:D.nodeId,nodeLookup:F,isTarget:X,edgeUpdaterType:D.type,lib:B,flowId:P,cancelConnection:V,panBy:W,isValidConnection:(...O)=>{var U,$;return(($=(U=C.getState()).isValidConnection)==null?void 0:$.call(U,...O))??!0},onConnect:L,onConnectStart:M,onConnectEnd:(...O)=>{var U,$;return($=(U=C.getState()).onConnectEnd)==null?void 0:$.call(U,...O)},onReconnectEnd:K,updateConnection:q,getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,dragThreshold:C.getState().connectionDragThreshold,handleDomNode:E.currentTarget})},S=E=>w(E,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),y=E=>w(E,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),x=()=>_(!0),b=()=>_(!1);return g.jsxs(g.Fragment,{children:[(e===!0||e==="source")&&g.jsx(XS,{position:o,centerX:r,centerY:a,radius:t,onMouseDown:S,onMouseEnter:x,onMouseOut:b,type:"source"}),(e===!0||e==="target")&&g.jsx(XS,{position:c,centerX:l,centerY:u,radius:t,onMouseDown:y,onMouseEnter:x,onMouseOut:b,type:"target"})]})}function DP({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:a,onDoubleClick:l,onContextMenu:u,onMouseEnter:o,onMouseMove:c,onMouseLeave:f,reconnectRadius:p,onReconnect:d,onReconnectStart:v,onReconnectEnd:_,rfId:C,edgeTypes:w,noPanClassName:S,onError:y,disableKeyboardA11y:x}){let b=it(fe=>fe.edgeLookup.get(e));const E=it(fe=>fe.defaultEdgeOptions);b=E?{...E,...b}:b;let D=b.type||"default",N=(w==null?void 0:w[D])||VS[D];N===void 0&&(y==null||y("011",ei.error011(D)),D="default",N=(w==null?void 0:w.default)||VS.default);const R=!!(b.focusable||t&&typeof b.focusable>"u"),T=typeof d<"u"&&(b.reconnectable||n&&typeof b.reconnectable>"u"),j=!!(b.selectable||r&&typeof b.selectable>"u"),B=G.useRef(null),[z,V]=G.useState(!1),[F,P]=G.useState(!1),W=Dt(),{zIndex:q=b.zIndex,sourceX:X,sourceY:K,targetX:L,targetY:M,sourcePosition:O,targetPosition:U}=it(G.useCallback(fe=>{const ye=fe.nodeLookup.get(b.source),Ce=fe.nodeLookup.get(b.target);if(!ye||!Ce)return WS;const Ee=gH({id:e,sourceNode:ye,targetNode:Ce,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:fe.connectionMode,onError:y}),Ne=oH({selected:b.selected,zIndex:b.zIndex,sourceNode:ye,targetNode:Ce,elevateOnSelect:fe.elevateEdgesOnSelect,zIndexMode:fe.zIndexMode});return{...Ee||WS,zIndex:Ne}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex]),Tt),$=G.useMemo(()=>b.markerStart?`url('#${wg(b.markerStart,C)}')`:void 0,[b.markerStart,C]),Q=G.useMemo(()=>b.markerEnd?`url('#${wg(b.markerEnd,C)}')`:void 0,[b.markerEnd,C]);if(b.hidden||X===null||K===null||L===null||M===null)return null;const re=fe=>{var Ne;const{addSelectedEdges:ye,unselectNodesAndEdges:Ce,multiSelectionActive:Ee}=W.getState();j&&(W.setState({nodesSelectionActive:!1}),b.selected&&Ee?(Ce({nodes:[],edges:[b]}),(Ne=B.current)==null||Ne.blur()):ye([e])),a&&a(fe,b)},se=l?fe=>{l(fe,{...b})}:void 0,Z=u?fe=>{u(fe,{...b})}:void 0,H=o?fe=>{o(fe,{...b})}:void 0,ee=c?fe=>{c(fe,{...b})}:void 0,ne=f?fe=>{f(fe,{...b})}:void 0,pe=fe=>{var ye;if(!x&&f2.includes(fe.key)&&j){const{unselectNodesAndEdges:Ce,addSelectedEdges:Ee}=W.getState();fe.key==="Escape"?((ye=B.current)==null||ye.blur(),Ce({edges:[b]})):Ee([e])}};return g.jsx("svg",{style:{zIndex:q},children:g.jsxs("g",{className:$t(["react-flow__edge",`react-flow__edge-${D}`,b.className,S,{selected:b.selected,animated:b.animated,inactive:!j&&!a,updating:z,selectable:j}]),onClick:re,onDoubleClick:se,onContextMenu:Z,onMouseEnter:H,onMouseMove:ee,onMouseLeave:ne,onKeyDown:R?pe:void 0,tabIndex:R?0:void 0,role:b.ariaRole??(R?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":b.ariaLabel===null?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":R?`${q2}-${C}`:void 0,ref:B,...b.domAttributes,children:[!F&&g.jsx(N,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:j,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:X,sourceY:K,targetX:L,targetY:M,sourcePosition:O,targetPosition:U,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:$,markerEnd:Q,pathOptions:"pathOptions"in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),T&&g.jsx(TP,{edge:b,isReconnectable:T,reconnectRadius:p,onReconnect:d,onReconnectStart:v,onReconnectEnd:_,sourceX:X,sourceY:K,targetX:L,targetY:M,sourcePosition:O,targetPosition:U,setUpdateHover:V,setReconnecting:P})]})})}var RP=G.memo(DP);const MP=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function mE({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:a,onReconnect:l,onEdgeContextMenu:u,onEdgeMouseEnter:o,onEdgeMouseMove:c,onEdgeMouseLeave:f,onEdgeClick:p,reconnectRadius:d,onEdgeDoubleClick:v,onReconnectStart:_,onReconnectEnd:C,disableKeyboardA11y:w}){const{edgesFocusable:S,edgesReconnectable:y,elementsSelectable:x,onError:b}=it(MP,Tt),E=mP(t);return g.jsxs("div",{className:"react-flow__edges",children:[g.jsx(SP,{defaultColor:e,rfId:n}),E.map(D=>g.jsx(RP,{id:D,edgesFocusable:S,edgesReconnectable:y,elementsSelectable:x,noPanClassName:a,onReconnect:l,onContextMenu:u,onMouseEnter:o,onMouseMove:c,onMouseLeave:f,onClick:p,reconnectRadius:d,onDoubleClick:v,onReconnectStart:_,onReconnectEnd:C,rfId:n,onError:b,edgeTypes:r,disableKeyboardA11y:w},D))]})}mE.displayName="EdgeRenderer";const jP=G.memo(mE),LP=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function OP({children:e}){const t=it(LP);return g.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function BP(e){const t=e0(),n=G.useRef(!1);G.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const IP=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function zP(e){const t=it(IP),n=Dt();return G.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function HP(e){return e.connection.inProgress?{...e.connection,to:xl(e.connection.to,e.transform)}:{...e.connection}}function FP(e){return HP}function PP(e){const t=FP();return it(t,Tt)}const $P=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function UP({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:a,width:l,height:u,isValid:o,inProgress:c}=it($P,Tt);return!(l&&a&&c)?null:g.jsx("svg",{style:e,width:l,height:u,className:"react-flow__connectionline react-flow__container",children:g.jsx("g",{className:$t(["react-flow__connection",g2(o)]),children:g.jsx(vE,{style:t,type:n,CustomComponent:r,isValid:o})})})}const vE=({style:e,type:t=Ar.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:a,from:l,fromNode:u,fromHandle:o,fromPosition:c,to:f,toNode:p,toHandle:d,toPosition:v,pointer:_}=PP();if(!a)return;if(n)return g.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:u,fromHandle:o,fromX:l.x,fromY:l.y,toX:f.x,toY:f.y,fromPosition:c,toPosition:v,connectionStatus:g2(r),toNode:p,toHandle:d,pointer:_});let C="";const w={sourceX:l.x,sourceY:l.y,sourcePosition:c,targetX:f.x,targetY:f.y,targetPosition:v};switch(t){case Ar.Bezier:[C]=N2(w);break;case Ar.SimpleBezier:[C]=rE(w);break;case Ar.Step:[C]=xg({...w,borderRadius:0});break;case Ar.SmoothStep:[C]=xg(w);break;default:[C]=D2(w)}return g.jsx("path",{d:C,fill:"none",className:"react-flow__connection-path",style:e})};vE.displayName="ConnectionLine";const GP={};function KS(e=GP){G.useRef(e),Dt(),G.useEffect(()=>{},[e])}function qP(){Dt(),G.useRef(!1),G.useEffect(()=>{},[])}function _E({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:a,onNodeDoubleClick:l,onEdgeDoubleClick:u,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:p,onSelectionContextMenu:d,onSelectionStart:v,onSelectionEnd:_,connectionLineType:C,connectionLineStyle:w,connectionLineComponent:S,connectionLineContainerStyle:y,selectionKeyCode:x,selectionOnDrag:b,selectionMode:E,multiSelectionKeyCode:D,panActivationKeyCode:N,zoomActivationKeyCode:R,deleteKeyCode:T,onlyRenderVisibleElements:j,elementsSelectable:B,defaultViewport:z,translateExtent:V,minZoom:F,maxZoom:P,preventScrolling:W,defaultMarkerColor:q,zoomOnScroll:X,zoomOnPinch:K,panOnScroll:L,panOnScrollSpeed:M,panOnScrollMode:O,zoomOnDoubleClick:U,panOnDrag:$,autoPanOnSelection:Q,onPaneClick:re,onPaneMouseEnter:se,onPaneMouseMove:Z,onPaneMouseLeave:H,onPaneScroll:ee,onPaneContextMenu:ne,paneClickDistance:pe,nodeClickDistance:fe,onEdgeContextMenu:ye,onEdgeMouseEnter:Ce,onEdgeMouseMove:Ee,onEdgeMouseLeave:Ne,reconnectRadius:we,onReconnect:ft,onReconnectStart:Ct,onReconnectEnd:st,noDragClassName:We,noWheelClassName:vt,noPanClassName:dt,disableKeyboardA11y:qe,nodeExtent:Pe,rfId:ue,viewport:_e,onViewportChange:ke}){return KS(e),KS(t),qP(),BP(n),zP(_e),g.jsx(aP,{onPaneClick:re,onPaneMouseEnter:se,onPaneMouseMove:Z,onPaneMouseLeave:H,onPaneContextMenu:ne,onPaneScroll:ee,paneClickDistance:pe,deleteKeyCode:T,selectionKeyCode:x,selectionOnDrag:b,selectionMode:E,onSelectionStart:v,onSelectionEnd:_,multiSelectionKeyCode:D,panActivationKeyCode:N,zoomActivationKeyCode:R,elementsSelectable:B,zoomOnScroll:X,zoomOnPinch:K,zoomOnDoubleClick:U,panOnScroll:L,panOnScrollSpeed:M,panOnScrollMode:O,panOnDrag:$,autoPanOnSelection:Q,defaultViewport:z,translateExtent:V,minZoom:F,maxZoom:P,onSelectionContextMenu:d,preventScrolling:W,noDragClassName:We,noWheelClassName:vt,noPanClassName:dt,disableKeyboardA11y:qe,onViewportChange:ke,isControlledViewport:!!_e,children:g.jsxs(OP,{children:[g.jsx(jP,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:u,onReconnect:ft,onReconnectStart:Ct,onReconnectEnd:st,onlyRenderVisibleElements:j,onEdgeContextMenu:ye,onEdgeMouseEnter:Ce,onEdgeMouseMove:Ee,onEdgeMouseLeave:Ne,reconnectRadius:we,defaultMarkerColor:q,noPanClassName:dt,disableKeyboardA11y:qe,rfId:ue}),g.jsx(UP,{style:w,type:C,component:S,containerStyle:y}),g.jsx("div",{className:"react-flow__edgelabel-renderer"}),g.jsx(gP,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:l,onNodeMouseEnter:o,onNodeMouseMove:c,onNodeMouseLeave:f,onNodeContextMenu:p,nodeClickDistance:fe,onlyRenderVisibleElements:j,noPanClassName:dt,noDragClassName:We,disableKeyboardA11y:qe,nodeExtent:Pe,rfId:ue}),g.jsx("div",{className:"react-flow__viewport-portal"})]})})}_E.displayName="GraphView";const VP=G.memo(_E),WP=S2(),ZS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:u,fitViewOptions:o,minZoom:c=.5,maxZoom:f=2,nodeOrigin:p,nodeExtent:d,zIndexMode:v="basic"}={})=>{const _=new Map,C=new Map,w=new Map,S=new Map,y=r??t??[],x=n??e??[],b=p??[0,0],E=d??sl;j2(w,S,y);const{nodesInitialized:D}=Cg(x,_,C,{nodeOrigin:b,nodeExtent:E,zIndexMode:v});let N=[0,0,1];if(u&&a&&l){const R=bl(_,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:T,y:j,zoom:B}=Wm(R,a,l,c,f,(o==null?void 0:o.padding)??.1);N=[T,j,B]}return{rfId:"1",width:a??0,height:l??0,transform:N,nodes:x,nodesInitialized:D,nodeLookup:_,parentLookup:C,edges:y,edgeLookup:S,connectionLookup:w,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:f,translateExtent:sl,nodeExtent:E,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:wa.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:b,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:u??!1,fitViewOptions:o,fitViewResolver:null,connection:{...p2},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:WP,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:d2,zIndexMode:v,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},YP=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:u,fitViewOptions:o,minZoom:c,maxZoom:f,nodeOrigin:p,nodeExtent:d,zIndexMode:v})=>rF((_,C)=>{async function w(){const{nodeLookup:S,panZoom:y,fitViewOptions:x,fitViewResolver:b,width:E,height:D,minZoom:N,maxZoom:R}=C();y&&(await eH({nodes:S,width:E,height:D,panZoom:y,minZoom:N,maxZoom:R},x),b==null||b.resolve(!0),_({fitViewResolver:null}))}return{...ZS({nodes:e,edges:t,width:a,height:l,fitView:u,fitViewOptions:o,minZoom:c,maxZoom:f,nodeOrigin:p,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:v}),setNodes:S=>{const{nodeLookup:y,parentLookup:x,nodeOrigin:b,elevateNodesOnSelect:E,fitViewQueued:D,zIndexMode:N,nodesSelectionActive:R}=C(),{nodesInitialized:T,hasSelectedNodes:j}=Cg(S,y,x,{nodeOrigin:b,nodeExtent:d,elevateNodesOnSelect:E,checkEquality:!0,zIndexMode:N}),B=R&&j;D&&T?(w(),_({nodes:S,nodesInitialized:T,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:B})):_({nodes:S,nodesInitialized:T,nodesSelectionActive:B})},setEdges:S=>{const{connectionLookup:y,edgeLookup:x}=C();j2(y,x,S),_({edges:S})},setDefaultNodesAndEdges:(S,y)=>{if(S){const{setNodes:x}=C();x(S),_({hasDefaultNodes:!0})}if(y){const{setEdges:x}=C();x(y),_({hasDefaultEdges:!0})}},updateNodeInternals:S=>{const{triggerNodeChanges:y,nodeLookup:x,parentLookup:b,domNode:E,nodeOrigin:D,nodeExtent:N,debug:R,fitViewQueued:T,zIndexMode:j}=C(),{changes:B,updatedInternals:z}=wH(S,x,b,E,D,N,j);z&&(yH(x,b,{nodeOrigin:D,nodeExtent:N,zIndexMode:j}),T?(w(),_({fitViewQueued:!1,fitViewOptions:void 0})):_({}),(B==null?void 0:B.length)>0&&(R&&console.log("React Flow: trigger node changes",B),y==null||y(B)))},updateNodePositions:(S,y=!1)=>{const x=[];let b=[];const{nodeLookup:E,triggerNodeChanges:D,connection:N,updateConnection:R,onNodesChangeMiddlewareMap:T}=C();for(const[j,B]of S){const z=E.get(j),V=!!(z!=null&&z.expandParent&&(z!=null&&z.parentId)&&(B!=null&&B.position)),F={id:j,type:"position",position:V?{x:Math.max(0,B.position.x),y:Math.max(0,B.position.y)}:B.position,dragging:y};if(z&&N.inProgress&&N.fromNode.id===z.id){const P=ps(z,N.fromHandle,je.Left,!0);R({...N,from:P})}V&&z.parentId&&x.push({id:j,parentId:z.parentId,rect:{...B.internals.positionAbsolute,width:B.measured.width??0,height:B.measured.height??0}}),b.push(F)}if(x.length>0){const{parentLookup:j,nodeOrigin:B}=C(),z=Jm(x,E,j,B);b.push(...z)}for(const j of T.values())b=j(b);D(b)},triggerNodeChanges:S=>{const{onNodesChange:y,setNodes:x,nodes:b,hasDefaultNodes:E,debug:D}=C();if(S!=null&&S.length){if(E){const N=EF(S,b);x(N)}D&&console.log("React Flow: trigger node changes",S),y==null||y(S)}},triggerEdgeChanges:S=>{const{onEdgesChange:y,setEdges:x,edges:b,hasDefaultEdges:E,debug:D}=C();if(S!=null&&S.length){if(E){const N=kF(S,b);x(N)}D&&console.log("React Flow: trigger edge changes",S),y==null||y(S)}},addSelectedNodes:S=>{const{multiSelectionActive:y,edgeLookup:x,nodeLookup:b,triggerNodeChanges:E,triggerEdgeChanges:D}=C();if(y){const N=S.map(R=>is(R,!0));E(N);return}E(ga(b,new Set([...S]),!0)),D(ga(x))},addSelectedEdges:S=>{const{multiSelectionActive:y,edgeLookup:x,nodeLookup:b,triggerNodeChanges:E,triggerEdgeChanges:D}=C();if(y){const N=S.map(R=>is(R,!0));D(N);return}D(ga(x,new Set([...S]))),E(ga(b,new Set,!0))},unselectNodesAndEdges:({nodes:S,edges:y}={})=>{const{edges:x,nodes:b,nodeLookup:E,triggerNodeChanges:D,triggerEdgeChanges:N}=C(),R=S||b,T=y||x,j=[];for(const z of R){if(!z.selected)continue;const V=E.get(z.id);V&&(V.selected=!1),j.push(is(z.id,!1))}const B=[];for(const z of T)z.selected&&B.push(is(z.id,!1));D(j),N(B)},setMinZoom:S=>{const{panZoom:y,maxZoom:x}=C();y==null||y.setScaleExtent([S,x]),_({minZoom:S})},setMaxZoom:S=>{const{panZoom:y,minZoom:x}=C();y==null||y.setScaleExtent([x,S]),_({maxZoom:S})},setTranslateExtent:S=>{var y;(y=C().panZoom)==null||y.setTranslateExtent(S),_({translateExtent:S})},resetSelectedElements:()=>{const{edges:S,nodes:y,triggerNodeChanges:x,triggerEdgeChanges:b,elementsSelectable:E}=C();if(!E)return;const D=y.reduce((R,T)=>T.selected?[...R,is(T.id,!1)]:R,[]),N=S.reduce((R,T)=>T.selected?[...R,is(T.id,!1)]:R,[]);x(D),b(N)},setNodeExtent:S=>{const{nodes:y,nodeLookup:x,parentLookup:b,nodeOrigin:E,elevateNodesOnSelect:D,nodeExtent:N,zIndexMode:R}=C();S[0][0]===N[0][0]&&S[0][1]===N[0][1]&&S[1][0]===N[1][0]&&S[1][1]===N[1][1]||(Cg(y,x,b,{nodeOrigin:E,nodeExtent:S,elevateNodesOnSelect:D,checkEquality:!1,zIndexMode:R}),_({nodeExtent:S}))},panBy:S=>{const{transform:y,width:x,height:b,panZoom:E,translateExtent:D}=C();return CH({delta:S,panZoom:E,transform:y,translateExtent:D,width:x,height:b})},setCenter:async(S,y,x)=>{const{width:b,height:E,maxZoom:D,panZoom:N}=C();if(!N)return!1;const R=typeof(x==null?void 0:x.zoom)<"u"?x.zoom:D;return await N.setViewport({x:b/2-S*R,y:E/2-y*R,zoom:R},{duration:x==null?void 0:x.duration,ease:x==null?void 0:x.ease,interpolate:x==null?void 0:x.interpolate}),!0},cancelConnection:()=>{_({connection:{...p2}})},updateConnection:S=>{_({connection:S})},reset:()=>_({...ZS()})}},Object.is);function XP({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:a,initialHeight:l,initialMinZoom:u,initialMaxZoom:o,initialFitViewOptions:c,fitView:f,nodeOrigin:p,nodeExtent:d,zIndexMode:v,children:_}){const[C]=G.useState(()=>YP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:l,fitView:f,minZoom:u,maxZoom:o,fitViewOptions:c,nodeOrigin:p,nodeExtent:d,zIndexMode:v}));return g.jsx(sF,{value:C,children:g.jsx(MF,{children:g.jsx(WF,{children:_})})})}function KP({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:a,width:l,height:u,fitView:o,fitViewOptions:c,minZoom:f,maxZoom:p,nodeOrigin:d,nodeExtent:v,zIndexMode:_}){return G.useContext(Rh)?g.jsx(g.Fragment,{children:e}):g.jsx(XP,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:a,initialWidth:l,initialHeight:u,fitView:o,initialFitViewOptions:c,initialMinZoom:f,initialMaxZoom:p,nodeOrigin:d,nodeExtent:v,zIndexMode:_,children:e})}const ZP={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function QP({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:a,nodeTypes:l,edgeTypes:u,onNodeClick:o,onEdgeClick:c,onInit:f,onMove:p,onMoveStart:d,onMoveEnd:v,onConnect:_,onConnectStart:C,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:y,onNodeMouseEnter:x,onNodeMouseMove:b,onNodeMouseLeave:E,onNodeContextMenu:D,onNodeDoubleClick:N,onNodeDragStart:R,onNodeDrag:T,onNodeDragStop:j,onNodesDelete:B,onEdgesDelete:z,onDelete:V,onSelectionChange:F,onSelectionDragStart:P,onSelectionDrag:W,onSelectionDragStop:q,onSelectionContextMenu:X,onSelectionStart:K,onSelectionEnd:L,onBeforeDelete:M,connectionMode:O,connectionLineType:U=Ar.Bezier,connectionLineStyle:$,connectionLineComponent:Q,connectionLineContainerStyle:re,deleteKeyCode:se="Backspace",selectionKeyCode:Z="Shift",selectionOnDrag:H=!1,selectionMode:ee=al.Full,panActivationKeyCode:ne="Space",multiSelectionKeyCode:pe=ll()?"Meta":"Control",zoomActivationKeyCode:fe=ll()?"Meta":"Control",snapToGrid:ye,snapGrid:Ce,onlyRenderVisibleElements:Ee=!1,selectNodesOnDrag:Ne,nodesDraggable:we,autoPanOnNodeFocus:ft,nodesConnectable:Ct,nodesFocusable:st,nodeOrigin:We=V2,edgesFocusable:vt,edgesReconnectable:dt,elementsSelectable:qe=!0,defaultViewport:Pe=_F,minZoom:ue=.5,maxZoom:_e=2,translateExtent:ke=sl,preventScrolling:he=!0,nodeExtent:be,defaultMarkerColor:Re="#b1b1b7",zoomOnScroll:De=!0,zoomOnPinch:$e=!0,panOnScroll:rt=!1,panOnScrollSpeed:ct=.5,panOnScrollMode:Ve=os.Free,zoomOnDoubleClick:Ln=!0,panOnDrag:tn=!0,onPaneClick:mi,onPaneMouseEnter:vi,onPaneMouseMove:_i,onPaneMouseLeave:yi,onPaneScroll:On,onPaneContextMenu:bi,paneClickDistance:ii=1,nodeClickDistance:bs=0,children:ae,onReconnect:xe,onReconnectStart:Ae,onReconnectEnd:tt,onEdgeContextMenu:at,onEdgeDoubleClick:Si,onEdgeMouseEnter:nn,onEdgeMouseMove:jr,onEdgeMouseLeave:ja,reconnectRadius:wl=10,onNodesChange:Cl,onEdgesChange:ri,noDragClassName:Ut="nodrag",noWheelClassName:Zt="nowheel",noPanClassName:xi="nopan",fitView:Ss,fitViewOptions:El,connectOnClick:Oh,attributionPosition:kl,proOptions:Lr,defaultEdgeOptions:La,elevateNodesOnSelect:Xi=!0,elevateEdgesOnSelect:Ki=!1,disableKeyboardA11y:Zi=!1,autoPanOnConnect:Qi,autoPanOnNodeDrag:Bt,autoPanOnSelection:Al=!0,autoPanSpeed:Nl,connectionRadius:wi,isValidConnection:Ji,onError:Bh,style:Tl,id:Oa,nodeDragThreshold:Ih,connectionDragThreshold:xs,viewport:ws,onViewportChange:qn,width:an,height:Dl,colorMode:zh="light",debug:Ba,onScroll:Or,ariaLabelConfig:Cs,zIndexMode:Rl="basic",...on},Ia){const Es=Oa||"1",za=xF(zh),er=G.useCallback(Ha=>{Ha.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Or==null||Or(Ha)},[Or]);return g.jsx("div",{"data-testid":"rf__wrapper",...on,onScroll:er,style:{...Tl,...ZP},ref:Ia,className:$t(["react-flow",a,za]),id:Oa,role:"application",children:g.jsxs(KP,{nodes:e,edges:t,width:an,height:Dl,fitView:Ss,fitViewOptions:El,minZoom:ue,maxZoom:_e,nodeOrigin:We,nodeExtent:be,zIndexMode:Rl,children:[g.jsx(SF,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:_,onConnectStart:C,onConnectEnd:w,onClickConnectStart:S,onClickConnectEnd:y,nodesDraggable:we,autoPanOnNodeFocus:ft,nodesConnectable:Ct,nodesFocusable:st,edgesFocusable:vt,edgesReconnectable:dt,elementsSelectable:qe,elevateNodesOnSelect:Xi,elevateEdgesOnSelect:Ki,minZoom:ue,maxZoom:_e,nodeExtent:be,onNodesChange:Cl,onEdgesChange:ri,snapToGrid:ye,snapGrid:Ce,connectionMode:O,translateExtent:ke,connectOnClick:Oh,defaultEdgeOptions:La,fitView:Ss,fitViewOptions:El,onNodesDelete:B,onEdgesDelete:z,onDelete:V,onNodeDragStart:R,onNodeDrag:T,onNodeDragStop:j,onSelectionDrag:W,onSelectionDragStart:P,onSelectionDragStop:q,onMove:p,onMoveStart:d,onMoveEnd:v,noPanClassName:xi,nodeOrigin:We,rfId:Es,autoPanOnConnect:Qi,autoPanOnNodeDrag:Bt,autoPanSpeed:Nl,onError:Bh,connectionRadius:wi,isValidConnection:Ji,selectNodesOnDrag:Ne,nodeDragThreshold:Ih,connectionDragThreshold:xs,onBeforeDelete:M,debug:Ba,ariaLabelConfig:Cs,zIndexMode:Rl}),g.jsx(VP,{onInit:f,onNodeClick:o,onEdgeClick:c,onNodeMouseEnter:x,onNodeMouseMove:b,onNodeMouseLeave:E,onNodeContextMenu:D,onNodeDoubleClick:N,nodeTypes:l,edgeTypes:u,connectionLineType:U,connectionLineStyle:$,connectionLineComponent:Q,connectionLineContainerStyle:re,selectionKeyCode:Z,selectionOnDrag:H,selectionMode:ee,deleteKeyCode:se,multiSelectionKeyCode:pe,panActivationKeyCode:ne,zoomActivationKeyCode:fe,onlyRenderVisibleElements:Ee,defaultViewport:Pe,translateExtent:ke,minZoom:ue,maxZoom:_e,preventScrolling:he,zoomOnScroll:De,zoomOnPinch:$e,zoomOnDoubleClick:Ln,panOnScroll:rt,panOnScrollSpeed:ct,panOnScrollMode:Ve,panOnDrag:tn,autoPanOnSelection:Al,onPaneClick:mi,onPaneMouseEnter:vi,onPaneMouseMove:_i,onPaneMouseLeave:yi,onPaneScroll:On,onPaneContextMenu:bi,paneClickDistance:ii,nodeClickDistance:bs,onSelectionContextMenu:X,onSelectionStart:K,onSelectionEnd:L,onReconnect:xe,onReconnectStart:Ae,onReconnectEnd:tt,onEdgeContextMenu:at,onEdgeDoubleClick:Si,onEdgeMouseEnter:nn,onEdgeMouseMove:jr,onEdgeMouseLeave:ja,reconnectRadius:wl,defaultMarkerColor:Re,noDragClassName:Ut,noWheelClassName:Zt,noPanClassName:xi,rfId:Es,disableKeyboardA11y:Zi,nodeExtent:be,viewport:ws,onViewportChange:qn}),g.jsx(vF,{onSelectionChange:F}),ae,g.jsx(fF,{proOptions:Lr,position:kl}),g.jsx(hF,{rfId:Es,disableKeyboardA11y:Zi})]})})}var JP=Y2(QP);function e$({dimensions:e,lineWidth:t,variant:n,className:r}){return g.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:$t(["react-flow__background-pattern",n,r])})}function t$({radius:e,className:t}){return g.jsx("circle",{cx:e,cy:e,r:e,className:$t(["react-flow__background-pattern","dots",t])})}var Ui;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ui||(Ui={}));const n$={[Ui.Dots]:1,[Ui.Lines]:1,[Ui.Cross]:6},i$=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function yE({id:e,variant:t=Ui.Dots,gap:n=20,size:r,lineWidth:a=1,offset:l=0,color:u,bgColor:o,style:c,className:f,patternClassName:p}){const d=G.useRef(null),{transform:v,patternId:_}=it(i$,Tt),C=r||n$[t],w=t===Ui.Dots,S=t===Ui.Cross,y=Array.isArray(n)?n:[n,n],x=[y[0]*v[2]||1,y[1]*v[2]||1],b=C*v[2],E=Array.isArray(l)?l:[l,l],D=S?[b,b]:x,N=[E[0]*v[2]||1+D[0]/2,E[1]*v[2]||1+D[1]/2],R=`${_}${e||""}`;return g.jsxs("svg",{className:$t(["react-flow__background",f]),style:{...c,...jh,"--xy-background-color-props":o,"--xy-background-pattern-color-props":u},ref:d,"data-testid":"rf__background",children:[g.jsx("pattern",{id:R,x:v[0]%x[0],y:v[1]%x[1],width:x[0],height:x[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:w?g.jsx(t$,{radius:b/2,className:p}):g.jsx(e$,{dimensions:D,lineWidth:a,variant:t,className:p})}),g.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${R})`})]})}yE.displayName="Background";const r$=G.memo(yE);function s$(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:g.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function a$(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:g.jsx("path",{d:"M0 0h32v4.2H0z"})})}function o$(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:g.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function l$(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:g.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function c$(){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:g.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function uu({children:e,className:t,...n}){return g.jsx("button",{type:"button",className:$t(["react-flow__controls-button",t]),...n,children:e})}const u$=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function bE({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:a,onZoomIn:l,onZoomOut:u,onFitView:o,onInteractiveChange:c,className:f,children:p,position:d="bottom-left",orientation:v="vertical","aria-label":_}){const C=Dt(),{isInteractive:w,minZoomReached:S,maxZoomReached:y,ariaLabelConfig:x}=it(u$,Tt),{zoomIn:b,zoomOut:E,fitView:D}=e0(),N=()=>{b(),l==null||l()},R=()=>{E(),u==null||u()},T=()=>{D(a),o==null||o()},j=()=>{C.setState({nodesDraggable:!w,nodesConnectable:!w,elementsSelectable:!w}),c==null||c(!w)},B=v==="horizontal"?"horizontal":"vertical";return g.jsxs(Mh,{className:$t(["react-flow__controls",B,f]),position:d,style:e,"data-testid":"rf__controls","aria-label":_??x["controls.ariaLabel"],children:[t&&g.jsxs(g.Fragment,{children:[g.jsx(uu,{onClick:N,className:"react-flow__controls-zoomin",title:x["controls.zoomIn.ariaLabel"],"aria-label":x["controls.zoomIn.ariaLabel"],disabled:y,children:g.jsx(s$,{})}),g.jsx(uu,{onClick:R,className:"react-flow__controls-zoomout",title:x["controls.zoomOut.ariaLabel"],"aria-label":x["controls.zoomOut.ariaLabel"],disabled:S,children:g.jsx(a$,{})})]}),n&&g.jsx(uu,{className:"react-flow__controls-fitview",onClick:T,title:x["controls.fitView.ariaLabel"],"aria-label":x["controls.fitView.ariaLabel"],children:g.jsx(o$,{})}),r&&g.jsx(uu,{className:"react-flow__controls-interactive",onClick:j,title:x["controls.interactive.ariaLabel"],"aria-label":x["controls.interactive.ariaLabel"],children:w?g.jsx(c$,{}):g.jsx(l$,{})}),p]})}bE.displayName="Controls";G.memo(bE);function h$({id:e,x:t,y:n,width:r,height:a,style:l,color:u,strokeColor:o,strokeWidth:c,className:f,borderRadius:p,shapeRendering:d,selected:v,onClick:_}){const{background:C,backgroundColor:w}=l||{},S=u||C||w;return g.jsx("rect",{className:$t(["react-flow__minimap-node",{selected:v},f]),x:t,y:n,rx:p,ry:p,width:r,height:a,style:{fill:S,stroke:o,strokeWidth:c},shapeRendering:d,onClick:_?y=>_(y,e):void 0})}const f$=G.memo(h$),d$=e=>e.nodes.map(t=>t.id),jp=e=>e instanceof Function?e:()=>e;function p$({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:l=f$,onClick:u}){const o=it(d$,Tt),c=jp(t),f=jp(e),p=jp(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return g.jsx(g.Fragment,{children:o.map(v=>g.jsx(m$,{id:v,nodeColorFunc:c,nodeStrokeColorFunc:f,nodeClassNameFunc:p,nodeBorderRadius:r,nodeStrokeWidth:a,NodeComponent:l,onClick:u,shapeRendering:d},v))})}function g$({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:a,nodeStrokeWidth:l,shapeRendering:u,NodeComponent:o,onClick:c}){const{node:f,x:p,y:d,width:v,height:_}=it(C=>{const w=C.nodeLookup.get(e);if(!w)return{node:void 0,x:0,y:0,width:0,height:0};const S=w.internals.userNode,{x:y,y:x}=w.internals.positionAbsolute,{width:b,height:E}=Yi(S);return{node:S,x:y,y:x,width:b,height:E}},Tt);return!f||f.hidden||!x2(f)?null:g.jsx(o,{x:p,y:d,width:v,height:_,style:f.style,selected:!!f.selected,className:r(f),color:t(f),borderRadius:a,strokeColor:n(f),strokeWidth:l,shapeRendering:u,onClick:c,id:f.id})}const m$=G.memo(g$);var v$=G.memo(p$);const _$=200,y$=150,b$=e=>!e.hidden,S$=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?y2(bl(e.nodeLookup,{filter:b$}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},x$="react-flow__minimap-desc";function SE({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:a="",nodeBorderRadius:l=5,nodeStrokeWidth:u,nodeComponent:o,bgColor:c,maskColor:f,maskStrokeColor:p,maskStrokeWidth:d,position:v="bottom-right",onClick:_,onNodeClick:C,pannable:w=!1,zoomable:S=!1,ariaLabel:y,inversePan:x,zoomStep:b=1,offsetScale:E=5}){const D=Dt(),N=G.useRef(null),{boundingRect:R,viewBB:T,rfId:j,panZoom:B,translateExtent:z,flowWidth:V,flowHeight:F,ariaLabelConfig:P}=it(S$,Tt),W=(e==null?void 0:e.width)??_$,q=(e==null?void 0:e.height)??y$,X=R.width/W,K=R.height/q,L=Math.max(X,K),M=L*W,O=L*q,U=E*L,$=R.x-(M-R.width)/2-U,Q=R.y-(O-R.height)/2-U,re=M+U*2,se=O+U*2,Z=`${x$}-${j}`,H=G.useRef(0),ee=G.useRef();H.current=L,G.useEffect(()=>{if(N.current&&B)return ee.current=jH({domNode:N.current,panZoom:B,getTransform:()=>D.getState().transform,getViewScale:()=>H.current}),()=>{var ye;(ye=ee.current)==null||ye.destroy()}},[B]),G.useEffect(()=>{var ye;(ye=ee.current)==null||ye.update({translateExtent:z,width:V,height:F,inversePan:x,pannable:w,zoomStep:b,zoomable:S})},[w,S,x,b,z,V,F]);const ne=_?ye=>{var Ne;const[Ce,Ee]=((Ne=ee.current)==null?void 0:Ne.pointer(ye))||[0,0];_(ye,{x:Ce,y:Ee})}:void 0,pe=C?G.useCallback((ye,Ce)=>{const Ee=D.getState().nodeLookup.get(Ce).internals.userNode;C(ye,Ee)},[]):void 0,fe=y??P["minimap.ariaLabel"];return g.jsx(Mh,{position:v,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*L:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:$t(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:g.jsxs("svg",{width:W,height:q,viewBox:`${$} ${Q} ${re} ${se}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Z,ref:N,onClick:ne,children:[fe&&g.jsx("title",{id:Z,children:fe}),g.jsx(v$,{onClick:pe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:l,nodeClassName:a,nodeStrokeWidth:u,nodeComponent:o}),g.jsx("path",{className:"react-flow__minimap-mask",d:`M${$-U},${Q-U}h${re+U*2}v${se+U*2}h${-re-U*2}z + M${T.x},${T.y}h${T.width}v${T.height}h${-T.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}SE.displayName="MiniMap";G.memo(SE);const w$=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,C$={[ka.Line]:"right",[ka.Handle]:"bottom-right"};function E$({nodeId:e,position:t,variant:n=ka.Handle,className:r,style:a=void 0,children:l,color:u,minWidth:o=10,minHeight:c=10,maxWidth:f=Number.MAX_VALUE,maxHeight:p=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:v,autoScale:_=!0,shouldResize:C,onResizeStart:w,onResize:S,onResizeEnd:y}){const x=Q2(),b=typeof e=="string"?e:x,E=Dt(),D=G.useRef(null),N=n===ka.Handle,R=it(G.useCallback(w$(N&&_),[N,_]),Tt),T=G.useRef(null),j=t??C$[n];G.useEffect(()=>{if(!(!D.current||!b))return T.current||(T.current=VH({domNode:D.current,nodeId:b,getStoreItems:()=>{const{nodeLookup:z,transform:V,snapGrid:F,snapToGrid:P,nodeOrigin:W,domNode:q}=E.getState();return{nodeLookup:z,transform:V,snapGrid:F,snapToGrid:P,nodeOrigin:W,paneDomNode:q}},onChange:(z,V)=>{const{triggerNodeChanges:F,nodeLookup:P,parentLookup:W,nodeOrigin:q}=E.getState(),X=[],K={x:z.x,y:z.y},L=P.get(b);if(L&&L.expandParent&&L.parentId){const M=L.origin??q,O=z.width??L.measured.width??0,U=z.height??L.measured.height??0,$={id:L.id,parentId:L.parentId,rect:{width:O,height:U,...w2({x:z.x??L.position.x,y:z.y??L.position.y},{width:O,height:U},L.parentId,P,M)}},Q=Jm([$],P,W,q);X.push(...Q),K.x=z.x?Math.max(M[0]*O,z.x):void 0,K.y=z.y?Math.max(M[1]*U,z.y):void 0}if(K.x!==void 0&&K.y!==void 0){const M={id:b,type:"position",position:{...K}};X.push(M)}if(z.width!==void 0&&z.height!==void 0){const O={id:b,type:"dimensions",resizing:!0,setAttributes:v?v==="horizontal"?"width":"height":!0,dimensions:{width:z.width,height:z.height}};X.push(O)}for(const M of V){const O={...M,type:"position"};X.push(O)}F(X)},onEnd:({width:z,height:V})=>{const F={id:b,type:"dimensions",resizing:!1,dimensions:{width:z,height:V}};E.getState().triggerNodeChanges([F])}})),T.current.update({controlPosition:j,boundaries:{minWidth:o,minHeight:c,maxWidth:f,maxHeight:p},keepAspectRatio:d,resizeDirection:v,onResizeStart:w,onResize:S,onResizeEnd:y,shouldResize:C}),()=>{var z;(z=T.current)==null||z.destroy()}},[j,o,c,f,p,d,w,S,y,C]);const B=j.split("-");return g.jsx("div",{className:$t(["react-flow__resize-control","nodrag",...B,n,r]),ref:D,style:{...a,scale:R,...u&&{[N?"backgroundColor":"borderColor"]:u}},children:l})}G.memo(E$);const Ag=264,k$=132,Eu=44,A$=72;function N$(e){const t=new Map(e.map(l=>[l.id,{exp:l,children:[]}])),n=[];for(const l of e){const u=t.get(l.id),o=l.parentExperimentId?t.get(l.parentExperimentId):void 0;o?o.children.push(u):n.push(u)}const r=(l,u)=>l.exp.createdAt-u.exp.createdAt,a=l=>{l.children.sort(r),l.children.forEach(a)};return n.sort(r),n.forEach(a),n}function ku(e){if(e.children.length===0)return Ag;const t=e.children.reduce((n,r)=>n+ku(r),0)+Eu*(e.children.length-1);return Math.max(Ag,t)}function T$(e){return e==="done"?"pass":e==="failed"?"fail":e==="running"||e==="starting"?"live":"other"}const D$=G.memo(function({data:t}){const{exp:n,latestRun:r,runs:a,isBaseline:l,githubOwner:u,githubRepo:o,onOpenView:c,onOpenCodeBranch:f}=t,p=r==null?void 0:r.status,d=p==="running"||p==="starting",v=l?"Baseline":d?"Running":"Experiment",_=a.slice(-8);return g.jsxs("div",{className:`exp-node ${d?"live":""}`,children:[g.jsx(Aa,{type:"target",position:je.Top}),g.jsxs("div",{className:"node-eyebrow",children:[g.jsx("span",{children:v}),g.jsx(Ko,{status:p??"idle"})]}),g.jsx("div",{className:"node-head",children:g.jsx("span",{className:"node-slug",children:n.slug})}),(n.title||n.description)&&g.jsx("div",{className:"node-title",children:n.title||n.description}),g.jsxs("div",{className:"node-meta",children:[g.jsx("span",{children:"Runs"}),_.length>0?g.jsx("span",{className:"run-squares",children:_.map(C=>g.jsx("span",{className:`run-sq ${T$(C.status)}`,title:C.status},C.id))}):g.jsx("span",{children:"no runs"}),g.jsx("span",{style:{flex:1}}),r&&g.jsx("span",{children:Na(r.createdAt)})]}),g.jsxs("div",{className:"node-actions",onClick:C=>C.stopPropagation(),children:[g.jsxs("button",{className:"node-action",title:"Open changes",onClick:()=>c(n.id,"changes"),children:[g.jsx(Ku,{size:13}),"Changes"]}),a.length>0&&g.jsxs("button",{className:"node-action",title:"Open logs",onClick:()=>c(n.id,"terminal"),children:[g.jsx(ux,{size:13}),"Logs"]}),g.jsxs("button",{className:"node-action",title:`Browse code on ${n.branchName}`,onClick:()=>f(n.branchName),children:[g.jsx(ox,{size:13}),"Code"]}),g.jsx("a",{className:"node-action node-action-ext",title:`Open ${n.branchName} on GitHub`,"aria-label":`Open ${n.branchName} on GitHub`,href:Lg(u,o,n.branchName),target:"_blank",rel:"noopener noreferrer",onClick:C=>C.stopPropagation(),children:g.jsx(km,{size:13})})]}),g.jsx(Aa,{type:"source",position:je.Bottom})]})}),R$={exp:D$},M$={type:"default",style:{stroke:"var(--text)",strokeWidth:1.5,opacity:.3}};function j$({experiments:e,runs:t,project:n,onOpenView:r,onOpenCodeBranch:a}){const{nodes:l,edges:u}=G.useMemo(()=>{const o=new Map;for(const _ of t){const C=o.get(_.experimentId);C?C.push(_):o.set(_.experimentId,[_])}for(const _ of o.values())_.sort((C,w)=>C.createdAt-w.createdAt);const c=[],f=[],p=N$(e);function d(_,C,w){const S=o.get(_.exp.id)??[];if(c.push({id:_.exp.id,type:"exp",position:{x:C-Ag/2,y:w},data:{exp:_.exp,latestRun:S[S.length-1]??null,runs:S,isBaseline:!_.exp.parentExperimentId,githubOwner:n.githubOwner,githubRepo:n.githubRepo,onOpenView:r,onOpenCodeBranch:a}}),_.children.length===0)return;const y=_.children.reduce((b,E)=>b+ku(E),0)+Eu*(_.children.length-1);let x=C-y/2;for(const b of _.children){const E=ku(b);f.push({id:`e-${_.exp.id}-${b.exp.id}`,source:_.exp.id,target:b.exp.id}),d(b,x+E/2,w+k$+A$),x+=E+Eu}}let v=0;for(const _ of p){const C=ku(_);d(_,v+C/2,0),v+=C+Eu}return{nodes:c,edges:f}},[e,t,r,a,n.githubOwner,n.githubRepo]);return e.length===0?g.jsxs("div",{className:"empty-state empty-state-cta",children:[g.jsx("p",{className:"empty-state-title",children:"No experiments yet"}),g.jsx("p",{className:"empty-state-hint",children:"Ask the agent in chat to create and run your first experiment."})]}):g.jsx(JP,{nodes:l,edges:u,nodeTypes:R$,defaultEdgeOptions:M$,nodesDraggable:!1,nodesConnectable:!1,nodesFocusable:!1,minZoom:.15,fitView:!0,fitViewOptions:{padding:.25,maxZoom:1},children:g.jsx(r$,{variant:Ui.Dots,color:"var(--dots-strong)",gap:28,size:1.6})})}const hu=(e,t)=>e.id===t.id&&e.view===t.view,fu=(e,t)=>e.path===t.path&&e.sessionId===t.sessionId&&e.ref===t.ref,QS=e=>`${e.sessionId??""}:${e.ref??""}:${e.path}`;function L$(e,t,n){let r=e,a;const l=t==null?void 0:t.replace(/\/+$/,"");if(!r.startsWith("/"))a=n;else if(l&&(r===l||r.startsWith(`${l}/`)))r=r.slice(l.length).replace(/^\/+/,"");else{const u=r.match(/\/openresearch\/worktrees\/[^/]+\/[^/]+\/([^/]+)\/(.+)$/),o=u?null:r.match(/\/openresearch\/repos\/[^/]+\/[^/]+\/(.+)$/);u?(a=u[1],r=u[2]):o&&(r=o[1])}return r?{path:r,sessionId:a}:null}const JS="orx:onboarded",xE="orx:panel-width",Wu=360,O$=10,B$=232,I$=380,z$=B$+56,H$=80;function Ng(){return Math.max(Wu,window.innerWidth-z$-I$)}function F$(){const e=Ng();try{const t=Number(localStorage.getItem(xE));if(Number.isFinite(t)&&t>=Wu)return Math.min(t,e)}catch{}return Math.max(Wu,Math.min(760,e,Math.round(window.innerWidth*.42)))}function du(e,t){const n=e.findIndex(a=>a.id===t.id);if(n<0)return[...e,t];const r=e.slice();return r[n]=t,r}function P$(){var _e,ke;const[e,t]=G.useState(null),[n,r]=G.useState(null),[a,l]=G.useState([]),[u,o]=G.useState([]),[c,f]=G.useState(null),[p,d]=G.useState("tree"),[v,_]=G.useState(null),[C,w]=G.useState("experiments"),[S,y]=G.useState([]),[x,b]=G.useState([]),[E,D]=G.useState([]),[N,R]=G.useState(null),[T,j]=G.useState(!0),[B,z]=G.useState(!1),[V,F]=G.useState(F$),[P,W]=G.useState(!0),[q,X]=G.useState(!1),[K,L]=G.useState("chat"),[M,O]=G.useState(()=>{try{return localStorage.getItem(JS)==="1"}catch{return!0}}),[U,$]=G.useState(!1),Q=G.useCallback(()=>{L("chat"),W(!0),j(!0),z(!1),$(!0)},[]),re=G.useCallback(()=>{try{localStorage.setItem(Gb,"1")}catch{}$(!1)},[]);G.useEffect(()=>{if(!(!n||q||!M)){try{if(localStorage.getItem(Gb)==="1")return}catch{return}Q()}},[n,q,M,Q]);const se=G.useRef(n);se.current=n,G.useEffect(()=>{nT().then(he=>{t(he),r(be=>{var Re;return be??((Re=he[0])==null?void 0:Re.id)??null})}).catch(()=>t([]))},[]),G.useEffect(()=>{const he=()=>F(be=>Math.min(be,Ng()));return window.addEventListener("resize",he),()=>window.removeEventListener("resize",he)},[]),G.useEffect(()=>{n&&(aT(n).catch(()=>{}),l([]),o([]),f(null),_(null),y([]),b([]),D([]),R(null),w("experiments"),lT(n).then(l).catch(()=>{}),cT(n).then(o).catch(()=>{}),Zy(n).then(f).catch(()=>{}))},[n]);const Z=G.useCallback(()=>{const he=se.current;he&&Zy(he).then(f).catch(()=>{})},[]);n3({onRun:he=>{he.projectId===se.current&&o(be=>du(be,he))},onExperiment:he=>{he.projectId===se.current&&l(be=>du(be,he))},onProject:he=>{t(be=>be?du(be,he):[he])},onFiles:he=>{he===se.current&&Z()}});const H=G.useCallback((he,be="changes")=>{const Re={id:he,view:be};y(De=>De.some($e=>hu($e,Re))?De:[...De,Re]),w(Re),j(!0)},[]),ee=G.useCallback(he=>{const be=S.findIndex(De=>hu(De,he));if(be===-1)return;const Re=S.filter((De,$e)=>$e!==be);y(Re),typeof C=="object"&&"view"in C&&hu(C,he)&&w(Re[Math.min(be,Re.length-1)]??"experiments")},[S,C]),ne=G.useCallback((he,be,Re)=>{var rt;const De=(rt=e==null?void 0:e.find(ct=>ct.id===n))==null?void 0:rt.repoPath,$e=L$(he,De,be);$e&&(Re&&($e.ref=Re),b(ct=>ct.some(Ve=>fu(Ve,$e))?ct:[...ct,$e]),w($e),j(!0))},[e,n]),pe=G.useCallback(he=>{const be=x.findIndex(De=>fu(De,he));if(be===-1)return;const Re=x.filter((De,$e)=>$e!==be);b(Re),typeof C=="object"&&"path"in C&&fu(C,he)&&w(Re[Math.min(be,Re.length-1)]??"experiments")},[x,C]),fe=G.useCallback((he,be,Re)=>{const De={kind:"plan",sessionId:be,promptId:Re,plan:he};D($e=>{const rt=$e.findIndex(Ve=>Ve.promptId===Re);if(rt===-1)return[...$e,De];const ct=$e.slice();return ct[rt]=De,ct}),w(De),j(!0)},[]),ye=G.useCallback(he=>{const be=E.findIndex(De=>De.promptId===he.promptId);if(be===-1)return;const Re=E.filter((De,$e)=>$e!==be);D(Re),typeof C=="object"&&"kind"in C&&C.promptId===he.promptId&&w(Re[Math.min(be,Re.length-1)]??"experiments")},[E,C]),Ce=G.useCallback(he=>{const be={code:!0,sel:he,toggled:new Set};R(Re=>Re?{...Re,sel:he}:be),w(be),j(!0)},[]),Ee=G.useCallback(he=>{R(be=>be&&{...be,...he})},[]),Ne=G.useCallback(()=>{R(null),w(he=>typeof he=="object"&&"code"in he?"experiments":he)},[]),we=he=>{he.preventDefault(),he.currentTarget.setPointerCapture(he.pointerId);const be=document.body.style.userSelect;document.body.style.userSelect="none";const Re=$e=>{const rt=Math.round(window.innerWidth-$e.clientX-O$),ct=Ng();if(rt>ct+H$){z(!0);return}z(!1);const Ve=Math.min(Math.max(rt,Wu),ct);F(Ve);try{localStorage.setItem(xE,String(Ve))}catch{}},De=()=>{window.removeEventListener("pointermove",Re),window.removeEventListener("pointerup",De),window.removeEventListener("pointercancel",De),document.body.style.userSelect=be};window.addEventListener("pointermove",Re),window.addEventListener("pointerup",De),window.addEventListener("pointercancel",De)},ft=he=>{t(be=>be?du(be,he):[he]),r(he.id),X(!1)},Ct=he=>{t(be=>be&&be.filter(Re=>Re.id!==he)),n===he&&r(null)},st=typeof C=="object"&&"view"in C?C:null,We=typeof C=="object"&&"path"in C?C:null,vt=typeof C=="object"&&"kind"in C?C:null,dt=typeof C=="object"&&"code"in C,qe=(e==null?void 0:e.find(he=>he.id===n))??null,Pe=st?a.find(he=>he.id===st.id)??null:null;if(e===null)return g.jsx("div",{className:"app",children:g.jsx("div",{className:"empty-state",children:g.jsx("span",{className:"spinner"})})});if(e.length===0)return g.jsx("div",{className:"app",children:M?g.jsx(Ub,{projects:e,onOpen:r,onCreated:ft,onDeleted:Ct}):g.jsx(ZB,{onDone:()=>{try{localStorage.setItem(JS,"1")}catch{}O(!0)}})});const ue=g.jsx(KB,{projectName:((_e=e.find(he=>he.id===n))==null?void 0:_e.name)??"",onHome:()=>X(!0),onCollapse:()=>W(!1)});return g.jsxs("div",{className:"app",children:[q?g.jsx(Ub,{projects:e,onOpen:he=>{r(he),X(!1)},onCreated:ft,onDeleted:Ct}):g.jsxs("div",{className:"app-body",children:[n&&g.jsx(sO,{projectId:n,paperId:(ke=e.find(he=>he.id===n))==null?void 0:ke.paperId,railHeader:ue,railOpen:P,onShowRail:()=>W(!0),mainView:K,onSelectMainView:L,panelOpen:T,onTogglePanel:()=>{T&&z(!1),j(!T)},onOpenFile:ne,onOpenPlan:fe,onStartTour:Q,children:K==="files"?(()=>{const he=e.find(be=>be.id===n);return he?g.jsx(SO,{project:he,files:c,onChanged:Z,onOpenStorage:()=>L("storage")},he.id):null})():K!=="chat"?g.jsx(GL,{tab:K}):null}),K==="chat"&&T&&g.jsxs("aside",{className:`right-pane floating-panel ${B?"max":""}`,style:B?void 0:{width:V},"data-onboarding":"experiments",children:[!B&&g.jsx("div",{className:"panel-resizer",onPointerDown:we}),g.jsxs("div",{className:"tabs",children:[g.jsxs("div",{className:"tab-strip",children:[g.jsx("button",{className:`tab ${C==="experiments"?"active":""}`,onClick:()=>w("experiments"),children:"Experiments"}),S.map(he=>{const be=a.find(Re=>Re.id===he.id);return g.jsx(Yc,{active:st!==null&&hu(st,he),label:be?be.title||be.slug:"…",icon:he.view==="terminal"?g.jsx(ux,{size:12,style:{flexShrink:0}}):g.jsx(Ku,{size:12,style:{flexShrink:0}}),onSelect:()=>w(he),onClose:()=>ee(he)},`${he.id}:${he.view}`)}),x.map(he=>g.jsx(Yc,{active:We!==null&&fu(We,he),label:he.path.split("/").pop()||he.path,icon:g.jsx(sx,{size:12,style:{flexShrink:0}}),onSelect:()=>w(he),onClose:()=>pe(he)},`file:${QS(he)}`)),E.map(he=>g.jsx(Yc,{active:vt!==null&&vt.promptId===he.promptId,label:"Plan",icon:g.jsx(cx,{size:12,style:{flexShrink:0}}),onSelect:()=>w(he),onClose:()=>ye(he)},`plan:${he.promptId}`)),N&&g.jsx(Yc,{active:dt,label:"Code",icon:g.jsx(ox,{size:12,style:{flexShrink:0}}),onSelect:()=>w(N),onClose:Ne},"code")]}),g.jsxs("div",{className:"panel-controls",children:[g.jsx("button",{className:"icon-btn",title:B?"Restore panel":"Expand panel","aria-label":B?"Restore panel":"Expand panel",onClick:()=>z(he=>!he),children:B?g.jsx(zN,{size:14}):g.jsx(BN,{size:14})}),g.jsx("button",{className:"icon-btn",title:"Close panel","aria-label":"Close panel",onClick:()=>{j(!1),z(!1)},children:g.jsx(_a,{size:14})})]})]}),C==="experiments"?g.jsxs("div",{className:"tab-body",children:[g.jsx("div",{className:"pane-toolbar",children:g.jsxs("div",{className:"seg",children:[g.jsx("button",{className:p==="tree"?"active":"",onClick:()=>d("tree"),children:"Tree"}),g.jsx("button",{className:p==="table"?"active":"",onClick:()=>d("table"),children:"Table"})]})}),g.jsx("div",{className:"pane-content",children:p==="tree"?qe&&g.jsx(j$,{experiments:a,runs:u,project:qe,onOpenView:H,onOpenCodeBranch:Ce}):g.jsx(oI,{runs:u,experiments:a,onOpen:he=>{_(he.id),H(he.experimentId,"terminal")},onOpenChanges:he=>H(he,"changes"),onCancel:he=>void fx(he).catch(()=>{})})})]}):We?g.jsx("div",{className:"tab-body",children:n&&g.jsx(XB,{projectId:n,path:We.path,sessionId:We.sessionId,gitRef:We.ref,onOpenFile:ne},QS(We))}):vt?g.jsx("div",{className:"tab-body",children:g.jsx("div",{className:"pane-content plan-tab-content",children:g.jsx(Xo,{text:vt.plan,onOpenFile:he=>ne(he,vt.sessionId)})})}):dt?g.jsx("div",{className:"tab-body",children:n&&qe&&N&&g.jsx(lO,{projectId:n,project:qe,experiments:a,sel:N.sel,toggled:N.toggled,onSelChange:he=>Ee({sel:he}),onToggledChange:he=>Ee({toggled:he}),onOpenFile:ne},"code")}):g.jsx("div",{className:"tab-body",children:st&&Pe&&qe&&g.jsx(VB,{experiment:Pe,project:qe,view:st.view,runs:u,selectedRunId:v,onSelectRun:_},`${st.id}:${st.view}`)})]})]}),U&&!q&&n&&g.jsx(pI,{onClose:re})]})}FA.createRoot(document.getElementById("root")).render(g.jsx(G.StrictMode,{children:g.jsx(P$,{})})); diff --git a/ui/dist/assets/index-FZ8l5lIQ.css b/ui/dist/assets/index-FZ8l5lIQ.css new file mode 100644 index 00000000..a4e1e681 --- /dev/null +++ b/ui/dist/assets/index-FZ8l5lIQ.css @@ -0,0 +1,32 @@ +:root{--diff-background-color:initial;--diff-text-color:initial;--diff-font-family:Consolas,Courier,monospace;--diff-selection-background-color:#b3d7ff;--diff-selection-text-color:var(--diff-text-color);--diff-gutter-insert-background-color:#d6fedb;--diff-gutter-insert-text-color:var(--diff-text-color);--diff-gutter-delete-background-color:#fadde0;--diff-gutter-delete-text-color:var(--diff-text-color);--diff-gutter-selected-background-color:#fffce0;--diff-gutter-selected-text-color:var(--diff-text-color);--diff-code-insert-background-color:#eaffee;--diff-code-insert-text-color:var(--diff-text-color);--diff-code-delete-background-color:#fdeff0;--diff-code-delete-text-color:var(--diff-text-color);--diff-code-insert-edit-background-color:#c0dc91;--diff-code-insert-edit-text-color:var(--diff-text-color);--diff-code-delete-edit-background-color:#f39ea2;--diff-code-delete-edit-text-color:var(--diff-text-color);--diff-code-selected-background-color:#fffce0;--diff-code-selected-text-color:var(--diff-text-color);--diff-omit-gutter-line-color:#cb2a1d}.diff{background-color:var(--diff-background-color);border-collapse:collapse;color:var(--diff-text-color);table-layout:fixed;width:100%}.diff::-moz-selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-text-color);color:var(--diff-selection-text-color)}.diff::selection{background-color:#b3d7ff;background-color:var(--diff-selection-background-color);color:var(--diff-text-color);color:var(--diff-selection-text-color)}.diff td{padding-bottom:0;padding-top:0;vertical-align:top}.diff-line{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);line-height:1.5}.diff-gutter>a{color:inherit;display:block}.diff-gutter{cursor:pointer;padding:0 1ch;text-align:right;-webkit-user-select:none;-moz-user-select:none;user-select:none}.diff-gutter-insert{background-color:#d6fedb;background-color:var(--diff-gutter-insert-background-color);color:var(--diff-text-color);color:var(--diff-gutter-insert-text-color)}.diff-gutter-delete{background-color:#fadde0;background-color:var(--diff-gutter-delete-background-color);color:var(--diff-text-color);color:var(--diff-gutter-delete-text-color)}.diff-gutter-omit{cursor:default}.diff-gutter-selected{background-color:#fffce0;background-color:var(--diff-gutter-selected-background-color);color:var(--diff-text-color);color:var(--diff-gutter-selected-text-color)}.diff-code{word-wrap:break-word;padding:0 0 0 .5em;white-space:pre-wrap;word-break:break-all}.diff-code-edit{color:inherit}.diff-code-insert{background-color:#eaffee;background-color:var(--diff-code-insert-background-color);color:var(--diff-text-color);color:var(--diff-code-insert-text-color)}.diff-code-insert .diff-code-edit{background-color:#c0dc91;background-color:var(--diff-code-insert-edit-background-color);color:var(--diff-text-color);color:var(--diff-code-insert-edit-text-color)}.diff-code-delete{background-color:#fdeff0;background-color:var(--diff-code-delete-background-color);color:var(--diff-text-color);color:var(--diff-code-delete-text-color)}.diff-code-delete .diff-code-edit{background-color:#f39ea2;background-color:var(--diff-code-delete-edit-background-color);color:var(--diff-text-color);color:var(--diff-code-delete-edit-text-color)}.diff-code-selected{background-color:#fffce0;background-color:var(--diff-code-selected-background-color);color:var(--diff-text-color);color:var(--diff-code-selected-text-color)}.diff-widget-content{vertical-align:top}.diff-gutter-col{width:7ch}.diff-gutter-omit{height:0}.diff-gutter-omit:before{background-color:#cb2a1d;background-color:var(--diff-omit-gutter-line-color);content:" ";display:block;height:100%;margin-left:4.6ch;overflow:hidden;white-space:pre;width:2px}.diff-decoration{line-height:1.5;-webkit-user-select:none;-moz-user-select:none;user-select:none}.diff-decoration-content{font-family:Consolas,Courier,monospace;font-family:var(--diff-font-family);padding:0}:root{--base: #ffffff;--canvas: #faf8f4;--panel: #f3f0ea;--surface: #faf7f2;--surface-bright: #fdfbfb;--highlight: #fdf3f1;--text: #1d1b1a;--subtext: #737373;--muted: #a1a1a1;--primary: #9a2036;--primary-subtle: #f7e9ec;--secondary: #4a90e2;--error: #e2a100;--border: #d4d4d4;--border-variant: #e5e5e5;--accent-orange: #da642c;--accent-red: #d94654;--accent-teal: #209a84;--accent-blue: #3a8dff;--accent-pink: #ff2b90;--accent-amber: #da9100;--accent-green: #5eb64c;--accent-purple: #9c5cff;--accent-green-subtle: #e7f4e5;--accent-amber-subtle: #fff3e1;--accent-teal-subtle: #e1f3f0;--accent-red-subtle: #fbe9ea;--accent-blue-subtle: #e5f0ff;--accent-purple-subtle: #f1e8ff;--dots-muted: #e3ded5;--dots-strong: #bdb6a8;--mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;--fs-2xs: 10px;--fs-xs: 11px;--fs-sm: 12px;--fs-md: 13px;--fs-base: 14px;--fs-lg: 15px;--fs-xl: 16px;--fs-2xl: 18px;--fs-3xl: 22px;--fs-4xl: 28px;--fs-5xl: 34px;--fw-regular: 400;--fw-medium: 500;--fw-semibold: 600;--fw-display: 700;--radius-xs: 4px;--radius-sm: 6px;--radius-md: 8px;--radius-lg: 10px;--radius-xl: 12px;--radius-full: 999px;--term-bg: #1a1a1a;--readable-col: 760px;--bg: var(--base);--bg-canvas: var(--canvas);--surface-2: var(--panel);--border-strong: var(--border);--accent: var(--primary);--teal: var(--accent-teal);--green: var(--accent-green);--red: var(--accent-red);--amber: var(--accent-amber);--purple: var(--accent-purple);color-scheme:light}@media(prefers-color-scheme:dark){:root{--base: #0e0c0c;--canvas: #141110;--panel: #221f1e;--surface: #1d1b1a;--surface-bright: #130f0f;--highlight: #393433;--text: #e6e1e0;--subtext: #a68e8b;--muted: #737373;--primary: #ffb3ad;--primary-subtle: #33191b;--secondary: #3e7fcf;--error: #ffb951;--border: #525252;--border-variant: #404040;--accent-amber: #e67e22;--accent-green-subtle: #1c2b18;--accent-amber-subtle: #33260f;--accent-teal-subtle: #12332d;--accent-red-subtle: #331418;--accent-blue-subtle: #10233a;--accent-purple-subtle: #251933;--dots-muted: #2a2523;--dots-strong: #555555;color-scheme:dark}}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--base);color:var(--text);font-family:var(--sans);font-size:var(--fs-base);line-height:1.45;overflow:hidden}::selection{background:var(--highlight)}button{font:inherit;color:inherit;background:none;border:none;cursor:pointer;padding:0}input,textarea,select{font:inherit;color:var(--text);background:var(--base);border:1px solid var(--border);border-radius:var(--radius-md);padding:6px 10px;outline:none}input:focus,textarea:focus,select:focus{border-color:var(--text)}input::placeholder,textarea::placeholder{color:var(--muted);opacity:1}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:var(--border);border-radius:var(--radius-sm);border:2px solid transparent;background-clip:padding-box}::-webkit-scrollbar-track{background:transparent}@keyframes pulse{50%{opacity:.35}}@keyframes spin{to{transform:rotate(360deg)}}.app{display:flex;flex-direction:column;height:100%}.app-body{display:flex;flex:1;min-height:0;padding:0 14px}.home{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges;background:var(--canvas)}.home-inner{max-width:620px;margin:0 auto;padding:48px 24px 64px}.wordmark{display:inline-flex;align-items:center;gap:.4em;color:var(--text)}.wordmark svg{width:1em;height:1em;flex-shrink:0}.home-brand{font-weight:var(--fw-display);font-size:var(--fs-4xl);letter-spacing:-.02em;margin-bottom:36px}.home-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.home-head h2{margin:0;font-size:var(--fs-2xl);letter-spacing:-.01em}.home-list{display:flex;flex-direction:column;gap:10px}.project-card{position:relative;display:flex;flex-direction:column;gap:4px;text-align:left;padding:14px 16px;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);cursor:pointer;transition:border-color .12s ease,box-shadow .12s ease}.project-card:hover{border-color:var(--text);box-shadow:0 2px 10px #0000000f}.project-delete{position:absolute;top:10px;right:10px;display:none;padding:5px;border-radius:var(--radius-sm);color:var(--muted);line-height:0}.project-card:hover .project-delete{display:block}.project-delete:hover{color:var(--danger, #d33);background:var(--overlay, rgba(0, 0, 0, .05))}.project-card .name{font-weight:var(--fw-semibold);font-size:var(--fs-base)}.project-card .repo{color:var(--text)}.project-card .paper,.project-card .time{font-size:var(--fs-xs);color:var(--muted)}.rail-brand{display:flex;align-items:center;gap:4px;height:48px;padding:0 8px 0 12px;border-bottom:1px solid var(--border);flex-shrink:0}.rail-brand .brand{display:flex;align-items:center;gap:8px;flex:1;min-width:0;font-weight:var(--fw-semibold);font-size:var(--fs-md);color:var(--text);padding:4px 6px 4px 0;border-radius:var(--radius-sm)}.rail-brand .brand:hover{color:var(--subtext)}.rail-brand .brand svg{flex-shrink:0}.rail-brand .brand .brand-project{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.icon-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;color:var(--subtext)}.icon-btn:hover{color:var(--text);background:var(--surface)}[data-tip]{position:relative}[data-tip]:after{content:attr(data-tip);position:absolute;top:calc(100% + 6px);right:-4px;background:var(--text);color:var(--base);font-size:var(--fs-xs);font-weight:var(--fw-medium);line-height:1;padding:5px 8px;border-radius:var(--radius-sm);white-space:nowrap;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .1s ease .3s,visibility 0s linear .4s;z-index:60}[data-tip]:hover:after{opacity:1;visibility:visible}.tip-up[data-tip]:after{top:auto;bottom:calc(100% + 6px)}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:6px 14px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base);color:var(--text);white-space:nowrap;transition:background .12s ease,border-color .12s ease,color .12s ease}.btn:hover:not(:disabled){background:var(--surface)}.btn:active:not(:disabled){background:var(--highlight)}.btn:disabled{opacity:.45;cursor:default}.btn.primary{background:var(--primary);border-color:var(--primary);color:var(--base)}.btn.primary:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text));border-color:color-mix(in oklab,var(--primary) 88%,var(--text))}.btn.primary:active:not(:disabled){background:color-mix(in oklab,var(--primary) 80%,var(--text));border-color:color-mix(in oklab,var(--primary) 80%,var(--text))}.btn.danger{color:var(--accent-red)}.btn.danger:hover:not(:disabled){background:color-mix(in oklab,var(--accent-red) 8%,transparent)}.btn.danger:active:not(:disabled){background:color-mix(in oklab,var(--accent-red) 14%,transparent)}.btn.ghost{border-color:transparent;color:var(--text)}.btn.ghost:hover:not(:disabled){color:var(--text);background:var(--surface)}.btn.sm{padding:3px 9px;font-size:var(--fs-xs);border-radius:var(--radius-sm)}.status-badge{display:inline-flex;align-items:center;gap:6px;font-size:var(--fs-sm);font-weight:var(--fw-medium);color:var(--text);white-space:nowrap}.status-badge .dot{width:7px;height:7px;border-radius:50%;background:currentColor;flex-shrink:0}.status-badge.live .dot{animation:pulse 1.2s ease-in-out infinite}.st-done .dot{color:var(--accent-green)}.st-failed .dot{color:var(--accent-red)}.st-running .dot{color:var(--accent-teal)}.st-starting .dot{color:var(--accent-amber)}.st-cancelled .dot{color:var(--accent-orange)}.st-editing .dot{color:var(--accent-purple)}.st-idle .dot{color:var(--muted)}.floating-panel{border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 6px 24px color-mix(in oklab,var(--text) 5%,transparent),0 1px 4px color-mix(in oklab,var(--text) 4%,transparent);overflow:hidden}.session-rail{width:232px;flex-shrink:0;display:flex;flex-direction:column;margin:10px 14px 10px 0;background:var(--base);min-height:0}.rail-nav{display:flex;flex-direction:column;gap:2px;padding:8px;flex-shrink:0}.rail-nav-item{display:flex;align-items:center;gap:10px;padding:7px 10px;font-size:var(--fs-md);color:var(--text);border-radius:var(--radius-md);text-align:left}.rail-nav-item:hover{background:var(--surface)}.rail-nav-item.active{background:var(--panel);font-weight:var(--fw-semibold)}.rail-section-label{padding:10px 10px 6px;font-size:var(--fs-sm);font-weight:var(--fw-medium);color:var(--subtext)}.rail-section-head{display:flex;align-items:center;justify-content:space-between}.rail-filter{position:relative;display:inline-flex;margin-right:2px}.rail-filter-btn{width:24px;height:24px;border-radius:var(--radius-sm)}.rail-empty{padding:6px 10px;font-size:var(--fs-sm);color:var(--muted)}.session-rail .rail-body{flex:1;min-height:0;overflow-y:auto;padding:4px 8px}.chat-pane{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--base);min-height:0}.right-pane{position:relative;flex-shrink:0;min-width:0;display:flex;flex-direction:column;margin:10px 0 10px 14px;background:var(--canvas)}.right-pane.max{position:fixed;top:10px;right:10px;bottom:10px;left:10px;margin:0;z-index:60;box-shadow:0 12px 40px color-mix(in oklab,var(--text) 22%,transparent)}.panel-resizer{position:absolute;left:0;top:0;bottom:0;width:6px;cursor:col-resize;z-index:30}.panel-resizer:hover,.panel-resizer:active{background:color-mix(in oklab,var(--text) 12%,transparent)}.panel-controls{display:inline-flex;align-items:center;gap:2px;flex-shrink:0}.tabs{display:flex;align-items:center;gap:4px;padding:0 10px;height:40px;border-bottom:1px solid var(--border);background:var(--base);flex-shrink:0}.tab-strip{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none}.tab-strip::-webkit-scrollbar{display:none}.tab.closable{max-width:176px;padding-right:4px}.tab .tab-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tab .tab-close{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:var(--radius-xs);color:var(--muted);flex-shrink:0}.tab .tab-close:hover{background:color-mix(in oklab,var(--text) 15%,transparent);color:var(--text)}.tab{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text);border-radius:var(--radius-sm);white-space:nowrap;flex-shrink:0}.tab.active{background:var(--surface)}.tab-body{flex:1;min-height:0;position:relative;display:flex;flex-direction:column}.pane-toolbar{display:flex;align-items:center;justify-content:flex-end;padding:10px 12px 0;flex-shrink:0}.pane-content{flex:1;min-height:0;position:relative}.plan-tab-content{overflow-y:auto;background:var(--base);padding:18px 24px}.plan-tab-content .md{max-width:var(--readable-col)}.seg{display:inline-flex;align-items:center;gap:2px;padding:3px;border-radius:var(--radius-md);background:color-mix(in oklab,var(--text) 10%,transparent)}.seg button{padding:3px 12px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text);border-radius:var(--radius-sm)}.seg button:hover{color:var(--text)}.seg button.active{background:var(--base);box-shadow:0 1px 3px color-mix(in oklab,var(--text) 25%,transparent)}.chat-header{display:flex;align-items:center;gap:8px;padding:0 16px;background:var(--base);flex-shrink:0;height:48px;position:relative;z-index:4;width:100%;max-width:var(--readable-col);margin:0 auto}.chat-header.rail-hidden{max-width:none;padding:0 2px}.chat-header.rail-hidden>.icon-btn:first-child{margin-right:12px}.chat-header:after{content:"";position:absolute;top:100%;left:0;right:0;height:24px;background:linear-gradient(to bottom,var(--base),transparent);pointer-events:none}.chat-header .title{font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row{position:relative;display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:7px 10px;border-radius:var(--radius-md);font-size:var(--fs-md);color:var(--text);cursor:pointer;-webkit-user-select:none;user-select:none}.session-row:hover{background:var(--surface)}.session-row.active{background:var(--surface);font-weight:var(--fw-medium)}.session-row .session-dot{width:14px;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0}.session-row .session-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-row .session-time{font-size:var(--fs-2xs);color:var(--muted);flex-shrink:0}.session-row .session-menu-btn{display:none;align-items:center;justify-content:center;width:18px;height:18px;margin:-2px 0;border-radius:var(--radius-sm);color:var(--muted);flex-shrink:0}.session-row .session-menu-btn:hover{color:var(--text);background:var(--panel)}.session-row:hover .session-menu-btn,.session-row:focus-within .session-menu-btn,.session-row.menu-open .session-menu-btn{display:inline-flex}.session-row:hover .session-time,.session-row:focus-within .session-time,.session-row.menu-open .session-time{display:none}.session-row .busy-dot{width:7px;height:7px;border-radius:50%;background:var(--primary);animation:pulse 1.2s infinite;flex-shrink:0}.session-row .busy-dot.waiting{animation:none}.session-row .session-title-input{flex:1;min-width:0;padding:1px 5px;margin:-2px 0;font:inherit;color:var(--text);background:var(--base);border:1px solid var(--primary);border-radius:var(--radius-sm);outline:none}.session-row.editing{background:var(--surface);cursor:default}.session-row.editing .session-menu-btn,.session-row.editing .session-time{display:none}.chat-thread{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.chat-thread-inner{max-width:var(--readable-col);margin:0 auto;padding:16px 16px 32px;display:flex;flex-direction:column;gap:16px}.chat-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:var(--text);padding:20px;text-align:center}.chat-empty h2{margin:0;font-size:var(--fs-5xl);font-weight:var(--fw-display);letter-spacing:-.02em;color:var(--text)}.chat-empty .chat-empty-hint{font-size:var(--fs-sm);color:var(--muted);max-width:340px;text-align:center}.chat-empty p{margin:0;font-size:var(--fs-md);max-width:320px}.chat-empty .chat-suggest{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-full);padding:6px 14px;cursor:pointer;transition:border-color .12s ease}.chat-empty .chat-suggest:hover{border-color:var(--text)}.msg-user{align-self:flex-end;max-width:88%;background:var(--surface);border-radius:16px;padding:10px 15px;font-size:var(--fs-md);white-space:pre-wrap;word-break:break-word}.msg-images{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.msg-images img{max-width:220px;max-height:160px;border:1px solid var(--border-variant);border-radius:var(--radius-xs);display:block}.msg-assistant{font-size:var(--fs-base);line-height:1.62;color:var(--text);min-width:0}.reasoning{color:var(--muted);font-size:var(--fs-sm);margin:2px 0}.reasoning summary{cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;font-weight:var(--fw-semibold)}.reasoning[open]{white-space:pre-wrap}.tool-group{margin:2px 0}.tool-group-summary{display:flex;align-items:center;gap:8px;width:100%;padding:3px 2px;cursor:pointer;color:var(--muted);font-size:var(--fs-md);text-align:left;border-radius:var(--radius-sm)}.tool-group-summary:hover{color:var(--subtext);background:var(--surface)}.tool-group.has-error .tool-group-summary{color:var(--accent-red)}.tool-chevron{flex-shrink:0;color:var(--muted);transition:transform .12s ease}.tool-chevron.open{transform:rotate(90deg)}.tool-group-rows{display:flex;flex-direction:column;gap:1px;margin:2px 0 4px 7px;padding-left:10px;border-left:1px solid var(--border-variant)}.tool-row{display:flex;flex-direction:column}.tool-row summary{display:flex;align-items:center;gap:8px;padding:3px 4px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none;min-width:0;border-radius:var(--radius-sm)}.tool-row summary:hover{background:var(--surface)}.tool-row summary::-webkit-details-marker{display:none}.tool-line{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--fs-md);color:var(--subtext)}.tool-open{flex-shrink:0;font-size:var(--fs-xs);color:var(--primary)}.tool-open:hover{text-decoration:underline}.tool-status{width:6px;height:6px;border-radius:50%;flex-shrink:0;background:var(--muted)}.tool-status.running{background:var(--accent-amber);animation:pulse 1.2s ease-in-out infinite}.tool-status.error{background:var(--accent-red)}.tool-detail{margin:2px 0 4px 14px}.tool-cmd-full{padding:6px 10px;font-family:var(--mono);font-size:var(--fs-xs);color:var(--text);background:var(--surface);border-radius:var(--radius-sm);white-space:pre-wrap;word-break:break-word}.tool-output{margin-top:3px;padding:6px 10px;font-family:var(--mono);font-size:var(--fs-xs);color:var(--subtext);white-space:pre-wrap;word-break:break-word;max-height:260px;overflow-y:auto;background:var(--base);border:1px solid var(--border-variant);border-radius:var(--radius-sm)}.working{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:var(--fs-md);padding:2px 0 8px}.working.awaiting{font-style:italic}.spinner{width:13px;height:13px;border:2px solid var(--border);border-top-color:var(--primary);border-radius:50%;animation:spin .8s linear infinite;flex-shrink:0}.composer{padding:0 12px 12px;flex-shrink:0;position:relative;z-index:4;background:var(--base);width:100%;max-width:var(--readable-col);margin:0 auto}.composer:before{content:"";position:absolute;bottom:100%;left:0;right:0;height:24px;background:linear-gradient(to top,var(--base),transparent);pointer-events:none}.composer-box{position:relative;display:flex;flex-direction:column;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base)}.composer textarea{border:none;background:none;resize:none;padding:10px 12px 4px;font-size:var(--fs-md);min-height:42px;max-height:180px}.composer-attachments{display:flex;flex-wrap:wrap;gap:6px;padding:8px 12px 0}.attachment-thumb{position:relative}.attachment-thumb img{width:52px;height:52px;object-fit:cover;border:1px solid var(--border);border-radius:var(--radius-sm);display:block}.attachment-thumb button{position:absolute;top:-5px;right:-5px;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:1px solid var(--border);border-radius:50%;background:var(--surface);color:var(--text);cursor:pointer}.attachment-thumb button:hover{background:var(--text);color:var(--base)}.composer-actions{display:flex;justify-content:flex-end;align-items:center;gap:8px;padding:6px 8px 8px}.send-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:var(--radius-md);background:var(--primary);color:var(--base);transition:background .1s ease,opacity .1s ease}.send-btn:hover:not(:disabled){background:color-mix(in oklab,var(--primary) 88%,var(--text))}.send-btn:disabled{opacity:.4;cursor:default}.send-btn.stop{background:var(--surface);color:var(--text)}.send-btn.stop:hover:not(:disabled){background:color-mix(in oklab,var(--surface) 88%,var(--text))}.md{min-width:0;word-break:break-word;color:var(--text);line-height:1.62}.md>*:first-child{margin-top:0}.md>*:last-child{margin-bottom:0}.md p{margin:10px 0}.md strong{color:var(--text);font-weight:var(--fw-semibold)}.md pre{background:var(--surface);border:1px solid color-mix(in oklab,var(--border) 50%,transparent);border-radius:var(--radius-md);padding:8px 12px;overflow-x:auto;font-size:var(--fs-sm);color:var(--text)}.md code{font-family:var(--mono);font-size:.9em;font-weight:var(--fw-medium);color:var(--primary);background:var(--panel);border:1px solid var(--border-variant);border-radius:var(--radius-xs);padding:1px 5px}.md .file-chip{display:inline-flex;align-items:center;gap:4px;max-width:100%;margin:0 1px;padding:0 6px;vertical-align:baseline;font-family:var(--mono);font-size:.9em;font-weight:var(--fw-medium);color:var(--text);background:var(--panel);border:1px solid var(--border-variant);border-radius:var(--radius-xs);cursor:pointer}.md .file-chip:hover:not(:disabled){background:var(--surface);color:var(--primary)}.md .file-chip svg{flex:none;opacity:.6}.md .file-chip-label{max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.md pre code{background:none;border:none;color:inherit;padding:0;font-weight:var(--fw-regular)}.md-code{position:relative;margin:10px 0}.md-code pre{margin:0}.md-code-copy{position:absolute;top:6px;right:6px;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;color:var(--muted);background:var(--base);border:1px solid var(--border-variant);border-radius:var(--radius-sm);opacity:0;transition:opacity .12s ease,color .12s ease}.md-code:hover .md-code-copy{opacity:1}.md-code-copy:hover{color:var(--text);border-color:var(--muted)}.md h1,.md h2,.md h3,.md h4{color:var(--text);font-size:1.05em;font-weight:var(--fw-semibold);margin:12px 0 6px}.md ul,.md ol{margin:6px 0;padding-left:22px}.md li::marker{color:var(--primary)}.md a{color:var(--primary)}.md table{border-collapse:collapse;width:100%;font-size:var(--fs-md);margin:10px 0;border:1px solid var(--border);border-radius:var(--radius-md);overflow:hidden}.md th,.md td{border-bottom:1px solid var(--border-variant);padding:8px 14px;text-align:left;color:var(--text)}.md tr:last-child td{border-bottom:none}.md thead th{background:var(--surface);font-weight:var(--fw-medium);color:var(--text);border-bottom:1px solid var(--border)}.md tbody tr:hover td{background:var(--surface-bright)}.md blockquote{margin:6px 0;padding:2px 0 2px 10px;border-left:3px solid var(--border);color:var(--subtext)}.react-flow__node.react-flow__node-exp.selectable{cursor:default}.exp-node{width:264px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base);padding:10px 12px;box-shadow:0 1px 2px #0000000a;font-size:var(--fs-md);transition:box-shadow .12s ease}.exp-node:hover{box-shadow:0 2px 8px #00000014}.exp-node.live{border-color:var(--accent-teal);box-shadow:0 2px 12px #209a8433}.exp-node .node-eyebrow{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px;font-size:var(--fs-2xs);font-weight:var(--fw-medium);color:var(--muted)}.exp-node .node-head{display:flex;align-items:center;gap:7px;min-width:0}.exp-node .node-status{width:8px;height:8px;border-radius:50%;flex-shrink:0}.exp-node .node-slug{font-family:var(--mono);font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.exp-node .node-title{margin-top:4px;color:var(--text);font-size:var(--fs-sm);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.exp-node .node-meta{margin-top:8px;display:flex;align-items:center;gap:8px;font-size:var(--fs-2xs);color:var(--muted)}.exp-node .node-actions{margin-top:8px;padding-top:6px;border-top:1px solid var(--border-variant);display:flex;align-items:center;gap:3px}.exp-node .node-action{display:inline-flex;align-items:center;gap:5px;padding:3px 6px;font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--text);border-radius:var(--radius-sm);text-decoration:none}.exp-node .node-action:hover{color:var(--text);background:var(--surface)}.exp-node .node-action-ext{margin-left:auto;padding:3px 5px}.run-squares{display:flex;align-items:center;gap:3px}.run-sq{width:9px;height:9px;flex-shrink:0}.run-sq.pass{background:var(--accent-green)}.run-sq.fail{border:1.5px solid color-mix(in oklab,var(--accent-red) 55%,transparent)}.run-sq.live{background:var(--accent-teal);animation:pulse 1.2s ease-in-out infinite}.run-sq.other{border:1.5px solid var(--border)}.react-flow__handle{opacity:0;pointer-events:none}.react-flow__attribution{display:none!important}.runs-table-wrap{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto;padding:12px}.runs-table{width:100%;border-collapse:separate;border-spacing:0;font-size:var(--fs-md);background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden}.runs-table th{text-align:left;color:var(--text);font-size:var(--fs-xs);font-weight:var(--fw-semibold);padding:8px 12px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--base);z-index:1}.runs-table td{padding:8px 12px;border-bottom:1px solid color-mix(in oklab,var(--text) 6%,transparent);white-space:nowrap}.runs-table tr:last-child td{border-bottom:none}.runs-table tr.clickable{cursor:pointer}.runs-table tr.clickable:hover td{background:var(--canvas)}.mono{font-family:var(--mono);font-size:var(--fs-sm)}.instances-section-title{display:flex;align-items:center;gap:8px;margin:22px 0 10px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.instances-section-title .count-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;border-radius:var(--radius-md);background:var(--canvas);border:1px solid var(--border);font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--text)}.instances-table-wrap{overflow-x:auto}.instances-empty{margin:0;padding:14px 16px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--base);color:var(--subtext);font-size:var(--fs-md)}.backend-cell{display:inline-flex;align-items:center;gap:2px}.backend-cell .icon-btn{width:22px;height:22px}.backend-badge{display:inline-flex;align-items:center;gap:7px}.backend-badge svg{flex:none;display:block}.backend-badge .backend-name{font-weight:var(--fw-medium)}.backend-badge .backend-detail,.backend-badge.muted{color:var(--muted)}.drawer{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--base);display:flex;flex-direction:column;z-index:20}.drawer-body{flex:1;min-height:0;overflow-y:auto;padding:0 16px 24px;display:flex;flex-direction:column;gap:22px}.drawer-body>:first-child{margin-top:18px}.drawer-section h3{margin:0 0 10px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.kv{display:grid;grid-template-columns:auto 1fr;gap:3px 14px;font-size:var(--fs-md)}.kv .k{color:var(--subtext)}.kv .v{font-family:var(--mono);font-size:var(--fs-sm);word-break:break-all}.term-view{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;background:var(--base);z-index:20}.term-bar{display:flex;align-items:center;gap:8px;height:40px;padding:0 10px;border-bottom:1px solid var(--border);flex-shrink:0}.term-title{min-width:0;font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.term-bar .error{font-size:var(--fs-sm);color:var(--accent-red)}.term-bar .btn{display:inline-flex;align-items:center;gap:5px}.term-fill{flex:1;min-height:0;background:var(--term-bg);padding:4px 0 4px 6px}.term-empty{height:100%;display:flex;align-items:center;justify-content:center;padding:24px;text-align:center;font-size:var(--fs-md);color:var(--muted)}.run-history{position:relative;flex-shrink:0}.run-picker{display:inline-flex;align-items:center;gap:8px;padding:4px 6px 4px 10px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base);color:var(--text)}.run-picker:hover{background:var(--surface)}.run-picker .run-label{font-size:var(--fs-sm);font-weight:var(--fw-semibold)}.run-picker-chev{color:var(--muted);flex-shrink:0}.history-menu{position:absolute;top:calc(100% + 6px);right:0;min-width:230px;max-height:320px;overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 12px 32px #0000002e;padding:5px;z-index:50}.history-item{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:var(--fs-sm);border-radius:var(--radius-sm)}.history-item:hover,.history-item.active{background:var(--surface)}.history-item .run-label{font-weight:var(--fw-semibold)}.history-item .when{margin-left:auto;font-size:var(--fs-xs);color:var(--muted)}.changes-branch{display:flex;align-items:center;gap:8px;margin-bottom:10px}.commit-picker{display:flex;align-items:center;gap:8px}.ctl-label{flex-shrink:0;font-size:var(--fs-2xs);font-weight:var(--fw-medium);color:var(--subtext)}.commit-picker select{flex:1;min-width:0;font-family:var(--mono);font-size:var(--fs-sm)}.uncommitted-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--accent-purple);flex-shrink:0}.changes-note{font-size:var(--fs-sm);color:var(--muted)}.empty-state{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:24px;text-align:center;color:var(--subtext)}.empty-state p{max-width:46ch;margin:0;font-size:var(--fs-md);line-height:1.5;text-wrap:balance}.empty-state-cta{gap:6px}.empty-state p.empty-state-title{font-size:var(--fs-2xl);font-weight:var(--fw-regular);color:var(--text)}.empty-state p.empty-state-hint{font-size:var(--fs-lg);color:var(--subtext)}.onboarding .home-inner{max-width:560px;padding-top:96px}.onb-eyebrow{font-size:var(--fs-2xs);font-weight:var(--fw-semibold);color:var(--muted);margin-bottom:14px}.onb-title{margin:0 0 6px;font-size:var(--fs-3xl);letter-spacing:-.01em}.onb-sub{color:var(--text);font-size:var(--fs-base);line-height:1.55;margin:0 0 22px;max-width:480px}.onb-cards{display:flex;flex-direction:column;gap:10px}.onb-card{display:flex;flex-direction:column;gap:5px;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);padding:18px 20px}.onb-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.onb-card-name{font-weight:var(--fw-semibold);font-size:var(--fs-base)}.onb-card-detail{font-size:var(--fs-sm)}.onb-card-meta{font-size:var(--fs-sm);color:var(--subtext)}.onb-card-meta code{font-family:var(--mono);font-size:var(--fs-xs)}.onb-card-row{display:grid;grid-template-columns:56px 1fr auto;align-items:baseline;gap:12px;padding:3px 0}.onb-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:var(--fs-md);padding:8px 0}.onb-gh-options{display:flex;flex-direction:column;gap:16px;margin-top:12px;padding-top:14px;border-top:1px solid var(--border-variant)}.onb-gh-option{display:flex;flex-direction:column;gap:8px}.onb-gh-option-label{font-size:var(--fs-xs);font-weight:var(--fw-semibold);color:var(--text)}.onb-gh-option-body{display:flex;align-items:center;flex-wrap:wrap;gap:10px}.onb-gh-cmd{font-family:var(--mono);font-size:var(--fs-sm);background:var(--panel);border:1px solid var(--border-variant);border-radius:var(--radius-sm);padding:3px 8px}.onb-gh-hint{font-size:var(--fs-sm);color:var(--subtext)}.onb-gh-hint code{font-family:var(--mono);font-size:var(--fs-xs)}.onb-gh-or{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:var(--fs-xs)}.onb-gh-or:before,.onb-gh-or:after{content:"";flex:1;height:1px;background:var(--border-variant)}.onb-gh-option .onb-token-form{flex:1;min-width:0;margin-top:0}.onb-token-form{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:8px}.onb-token-form input{flex:1;min-width:220px;font-family:var(--mono);font-size:var(--fs-sm)}.onb-token-form a{font-size:var(--fs-sm);color:var(--subtext);white-space:nowrap}.onb-token-form .error{flex-basis:100%;color:var(--accent-red);font-size:var(--fs-md);white-space:pre-wrap}.onb-actions{display:flex;align-items:center;gap:10px;margin-top:22px}.form .form-seg{align-self:flex-start;margin-bottom:2px}.form .form-seg button{padding:5px 12px}.form .repo-hint{font-family:var(--mono);font-weight:var(--fw-regular);font-size:var(--fs-xs);color:var(--muted)}.form .repo-hint.ok{color:var(--accent-teal)}.form .paper-results{display:flex;flex-direction:column;border:1px solid var(--border);border-radius:var(--radius-md);max-height:240px;overflow-y:auto}.form .paper-results button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:8px 10px;background:none;border:none;border-bottom:1px solid var(--border-variant);text-align:left;font:inherit;color:var(--text);cursor:pointer}.form .paper-results button:last-child{border-bottom:none}.form .paper-results button:hover{background:var(--surface)}.form .paper-results .title{font-size:var(--fs-md);font-weight:var(--fw-medium)}.form .paper-results .id,.form .paper-pick .id{font-family:var(--mono);font-size:var(--fs-xs);color:var(--muted)}.form .paper-pick{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface)}.form .paper-pick .meta{min-width:0}.form .paper-pick .title{font-size:var(--fs-md);font-weight:var(--fw-semibold)}.form{display:flex;flex-direction:column;gap:10px}.form label{display:flex;flex-direction:column;gap:4px;font-size:var(--fs-xs);color:var(--text);font-weight:var(--fw-medium)}.form .row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}.form .actions{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}.form .error,.settings-card>.error{color:var(--accent-red);font-size:var(--fs-md);white-space:pre-wrap}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#1d1b1a66;display:flex;align-items:center;justify-content:center;z-index:100}.modal{width:480px;max-width:94vw;max-height:88vh;overflow-y:auto;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-xl);box-shadow:0 24px 60px #00000038;padding:24px}.modal h2{margin:0 0 14px;font-size:var(--fs-xl)}.settings-section+.settings-section{margin-top:18px;padding-top:16px;border-top:1px solid var(--border)}.settings-section h3{margin:0 0 8px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.settings-loading{display:flex;align-items:center;gap:8px;color:var(--subtext);font-size:var(--fs-md);padding:4px 0}.settings-note{margin:10px 0 0;font-size:var(--fs-sm);padding:8px 10px;border:1px solid var(--accent-amber);border-radius:var(--radius-md);background:var(--accent-amber-subtle);color:var(--accent-amber);font-weight:var(--fw-medium)}.progress{margin:12px 0 4px}.progress-track{height:8px;border-radius:var(--radius-full);background:var(--surface);border:1px solid var(--border);overflow:hidden}.progress-fill{height:100%;background:var(--accent);border-radius:var(--radius-full);transition:width .2s ease}.progress-caption{display:flex;justify-content:space-between;margin-top:6px;font-size:var(--fs-sm);color:var(--muted)}.settings-form{margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}.badge{display:inline-flex;align-items:center;font-family:var(--sans);font-size:var(--fs-xs);font-weight:var(--fw-medium);padding:1px 7px;border:1px solid var(--border);border-radius:var(--radius-sm);color:var(--text)}.badge.ok{color:var(--accent-green);border-color:var(--accent-green);background:var(--accent-green-subtle)}.badge.err{color:var(--accent-red);border-color:var(--accent-red);background:var(--accent-red-subtle)}.badge.warn{color:var(--accent-amber);border-color:var(--accent-amber);background:var(--accent-amber-subtle)}.files-tab{height:100%;min-height:0;display:flex;background:var(--base)}.files-pill{display:inline-flex;align-items:center;gap:8px;min-width:0;border:1px solid var(--border);border-radius:var(--radius-md);padding:7px 11px;background:var(--base);color:var(--text);text-decoration:none}.files-pill code{font-family:var(--mono);font-size:var(--fs-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.files-pill>svg{flex-shrink:0;color:var(--muted)}a.files-pill:hover{border-color:var(--muted)}.ftree-pane{position:relative;flex-shrink:0;display:flex;flex-direction:column;min-height:0;border-left:1px solid var(--border-variant);border-right:1px solid var(--border-variant);background:var(--base)}.ftree-resizer{position:absolute;right:-3px;top:0;bottom:0;width:6px;cursor:col-resize;z-index:30}.ftree-resizer:hover,.ftree-resizer:active{background:color-mix(in oklab,var(--text) 12%,transparent)}.ftree-scroll{flex:1;min-height:0;overflow-y:auto;padding:10px 8px}.ft-row{display:flex;align-items:center;gap:6px;padding:5px 8px;border-radius:var(--radius-sm);cursor:pointer}.ft-row:hover{background:var(--surface)}.ft-row.selected,.ft-row.selected:hover{background:var(--panel)}.ft-chevron{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;flex-shrink:0;color:var(--muted);transition:transform .12s ease}.ft-chevron.open{transform:rotate(90deg)}.ft-chevron.spacer{visibility:hidden}.ft-title{flex:1;min-width:0;font-size:var(--fs-md);font-weight:var(--fw-medium);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ft-dirname,.ft-name{flex:1;min-width:0;font-family:var(--mono);font-size:var(--fs-sm);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ft-dirname{color:var(--text)}.ft-thumb{width:18px;height:18px;object-fit:cover;border-radius:var(--radius-xs);border:1px solid var(--border-variant);flex-shrink:0}.ft-divider{padding:12px 8px 4px;font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--muted)}.ftree-footer{flex-shrink:0;display:flex;align-items:center;gap:2px;padding:5px 8px;border-top:1px solid var(--border-variant)}.ftree-footer code{flex:1;min-width:0;direction:rtl;text-align:left;font-family:var(--mono);font-size:var(--fs-xs);color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ftree-footer .icon-btn{width:22px;height:22px}.fpreview{flex:1;min-width:0;display:flex;flex-direction:column;min-height:0;background:var(--base)}.fpreview-none{align-items:center;justify-content:center;gap:8px;font-size:var(--fs-md);color:var(--muted)}.fpreview-head{height:40px;display:flex;align-items:center;gap:8px;padding:0 14px;border-bottom:1px solid var(--border-variant);color:var(--subtext);flex-shrink:0}.fpreview-path{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fpreview-date,.fpreview-size{font-size:var(--fs-xs);color:var(--muted);white-space:nowrap;flex-shrink:0}.fpreview-body{flex:1;min-height:0;overflow:auto}.fpreview-body.doc{padding:18px 28px 48px}.fpreview-body.doc .report-md{max-width:var(--readable-col);margin:0 auto}.fpreview-image{display:flex;align-items:flex-start;justify-content:center;padding:24px}.fpreview-image img{max-width:100%;height:auto;border:1px solid var(--border);border-radius:var(--radius-sm)}.fpreview-pdf{display:block;width:100%;height:100%;border:0}.files-empty-state{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:24px;text-align:center;color:var(--muted)}.files-empty-state h3{margin:6px 0 0;font-size:var(--fs-base);font-weight:var(--fw-semibold);color:var(--text)}.files-empty-state p{margin:0;max-width:420px;font-size:var(--fs-md);line-height:1.55;color:var(--subtext)}.files-empty-state .ftree-footer{margin-top:10px;max-width:100%;border:1px solid var(--border);border-radius:var(--radius-md);padding:6px 10px;background:var(--base)}.files-empty-state .ftree-footer code{max-width:380px}.files-truncated{margin:0;padding:8px 14px;font-size:var(--fs-xs);color:var(--muted)}.report-md{font-size:var(--fs-lg)}.report-md h1{font-size:2em;line-height:1.18;margin:28px 0 14px}.report-md h2{font-size:1.5em;line-height:1.25;margin:28px 0 10px}.report-md h3{font-size:1.2em;line-height:1.35;margin:22px 0 8px}.report-md h4{font-size:1em;line-height:1.4;margin:18px 0 6px}.report-md table{display:block;width:max-content;max-width:100%;overflow-x:auto}.report-md .report-img{display:block;margin:12px 0}.report-md .report-img img{max-width:100%;height:auto;border:1px solid var(--border);border-radius:var(--radius-sm)}.report-md .report-img-caption{display:block;margin-top:4px;text-align:center;font-size:var(--fs-sm);color:var(--subtext)}.openresearch-diff{display:flex;flex-direction:column;gap:16px}.diff-file-card{border:1px solid var(--border);border-radius:var(--radius-md);background:var(--base)}.diff-file-header{position:sticky;top:0;z-index:10;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-1px -1px 0;width:calc(100% + 2px);text-align:left;padding:8px 12px;cursor:pointer}.diff-file-header:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-2;background:var(--base)}.diff-file-header:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1;background:var(--canvas);border:1px solid var(--border);border-radius:var(--radius-md) var(--radius-md) 0 0}.diff-file-header .chev{color:var(--muted);font-size:var(--fs-2xs);flex-shrink:0;width:12px}.diff-file-header .path{display:flex;align-items:center;gap:8px;min-width:0;flex:1}.diff-file-header .path code{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--mono);font-size:var(--fs-xs);font-weight:var(--fw-semibold);color:var(--text)}.diff-file-header .stats{display:flex;align-items:center;gap:8px;flex-shrink:0;font-family:var(--mono);font-size:var(--fs-2xs);font-weight:var(--fw-medium);font-variant-numeric:tabular-nums}.diff-stat-add{color:var(--accent-green)}.diff-stat-del{color:var(--accent-red)}.diff-empty{padding:8px 12px;color:var(--muted);font-size:var(--fs-md)}.truncated-notice{border:1px solid var(--accent-amber);border-radius:var(--radius-md);background:var(--accent-amber-subtle);padding:12px 14px;font-size:var(--fs-md)}.truncated-notice h4{margin:0 0 4px;font-size:var(--fs-md);color:var(--accent-amber)}.truncated-notice p{margin:0;color:var(--subtext)}.openresearch-diff .openresearch-diff-file{--openresearch-diff-selection-background-color: color-mix( in oklab, var(--surface) 76%, var(--primary) );--openresearch-diff-gutter-selection-background-color: color-mix( in oklab, var(--surface) 68%, var(--primary) );--openresearch-diff-insert-gutter-background-color: color-mix( in oklab, var(--base) 84%, var(--accent-green) );--openresearch-diff-delete-gutter-background-color: color-mix( in oklab, var(--base) 86%, var(--accent-red) );--openresearch-diff-insert-code-background-color: color-mix( in oklab, var(--base) 91%, var(--accent-green) );--openresearch-diff-delete-code-background-color: color-mix( in oklab, var(--base) 92%, var(--accent-red) );--openresearch-diff-insert-edit-background-color: color-mix( in oklab, var(--base) 72%, var(--accent-green) );--openresearch-diff-delete-edit-background-color: color-mix( in oklab, var(--base) 78%, var(--accent-red) );--openresearch-diff-divider-color: var(--border);--openresearch-diff-omit-gutter-line-color: color-mix(in oklab, var(--base) 86%, var(--text));--openresearch-diff-unified-gutter-text-color: color-mix(in oklab, var(--text) 45%, var(--base));--diff-background-color: var(--base);--diff-text-color: var(--text);--diff-font-family: var(--mono);--diff-selection-text-color: var(--primary);--diff-selection-background-color: var(--openresearch-diff-selection-background-color);--diff-gutter-selected-text-color: var(--diff-selection-text-color);--diff-gutter-selected-background-color: var( --openresearch-diff-gutter-selection-background-color );--diff-code-selected-text-color: var(--diff-selection-text-color);--diff-code-selected-background-color: var(--diff-selection-background-color);--diff-gutter-insert-text-color: var(--accent-green);--diff-gutter-insert-background-color: var(--openresearch-diff-insert-gutter-background-color);--diff-gutter-delete-text-color: var(--accent-red);--diff-gutter-delete-background-color: var(--openresearch-diff-delete-gutter-background-color);--diff-code-insert-text-color: var(--diff-text-color);--diff-code-insert-background-color: var(--openresearch-diff-insert-code-background-color);--diff-code-delete-text-color: var(--diff-text-color);--diff-code-delete-background-color: var(--openresearch-diff-delete-code-background-color);--diff-code-insert-edit-text-color: var(--diff-text-color);--diff-code-insert-edit-background-color: var(--openresearch-diff-insert-edit-background-color);--diff-code-delete-edit-text-color: var(--diff-text-color);--diff-code-delete-edit-background-color: var(--openresearch-diff-delete-edit-background-color);--diff-omit-gutter-line-color: var(--openresearch-diff-omit-gutter-line-color);width:100%;font-size:var(--fs-sm);line-height:1.5}.openresearch-diff .openresearch-diff-file.diff-unified{table-layout:auto}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:first-child{display:none}.openresearch-diff .openresearch-diff-file.diff-unified .diff-line>td:nth-child(2){width:0%;padding:0 .5rem 0 .625rem;white-space:nowrap;text-align:right;color:var(--openresearch-diff-unified-gutter-text-color);border-right:1px solid var(--openresearch-diff-divider-color);-webkit-user-select:none;user-select:none;cursor:default}.openresearch-diff .openresearch-diff-file .diff-line{line-height:1.5}.openresearch-diff .openresearch-diff-file .diff-hunk+.diff-hunk .diff-line:first-child>td{border-top:1px solid var(--openresearch-diff-divider-color)}:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#a0a1a7}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#383a42}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#986801}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#a626a4}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#4078f2}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#c18401}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#50a14f}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e45649}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#383a42}@media(prefers-color-scheme:dark){:is(.md,.openresearch-diff,.file-view) .token.comment,:is(.md,.openresearch-diff,.file-view) .token.prolog,:is(.md,.openresearch-diff,.file-view) .token.cdata{font-style:italic;color:#7f848e}:is(.md,.openresearch-diff,.file-view) .token.punctuation{color:#abb2bf}:is(.md,.openresearch-diff,.file-view) .token.property,:is(.md,.openresearch-diff,.file-view) .token.tag,:is(.md,.openresearch-diff,.file-view) .token.deleted{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.constant,:is(.md,.openresearch-diff,.file-view) .token.symbol,:is(.md,.openresearch-diff,.file-view) .token.boolean,:is(.md,.openresearch-diff,.file-view) .token.number{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.selector,:is(.md,.openresearch-diff,.file-view) .token.attr-name,:is(.md,.openresearch-diff,.file-view) .token.char,:is(.md,.openresearch-diff,.file-view) .token.inserted,:is(.md,.openresearch-diff,.file-view) .token.string{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.builtin{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.operator,:is(.md,.openresearch-diff,.file-view) .token.entity,:is(.md,.openresearch-diff,.file-view) .token.url{color:#56b6c2}:is(.md,.openresearch-diff,.file-view) .token.atrule,:is(.md,.openresearch-diff,.file-view) .token.attr-value{color:#d19a66}:is(.md,.openresearch-diff,.file-view) .token.keyword{color:#c678dd}:is(.md,.openresearch-diff,.file-view) .token.function,:is(.md,.openresearch-diff,.file-view) .token.decorator,:is(.md,.openresearch-diff,.file-view) .token.def{color:#61afef}:is(.md,.openresearch-diff,.file-view) .token.class-name,:is(.md,.openresearch-diff,.file-view) .token.namespace{color:#e5c07b}:is(.md,.openresearch-diff,.file-view) .token.regex{color:#98c379}:is(.md,.openresearch-diff,.file-view) .token.important,:is(.md,.openresearch-diff,.file-view) .token.variable{color:#e06c75}:is(.md,.openresearch-diff,.file-view) .token.parameter{color:#abb2bf}}.settings-view-scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable both-edges}.settings-view{max-width:var(--readable-col);margin:0 auto;padding:24px 32px 60px}.settings-view h1{margin:0 0 6px;font-size:var(--fs-3xl)}.settings-head-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.settings-head-row h1{margin:0}.settings-view>.error{color:var(--accent-red);font-size:var(--fs-md);white-space:pre-wrap;margin:0 0 12px}.settings-sub{margin:0 0 18px;color:var(--text);font-size:var(--fs-md)}.settings-card{background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);padding:16px 18px;margin-bottom:16px}.settings-card h3{margin:0 0 10px;font-size:var(--fs-sm);font-weight:var(--fw-semibold);color:var(--text)}.settings-card .settings-sub{margin-bottom:12px}.settings-card-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}.settings-card .kv{gap:6px 18px}.settings-empty{color:var(--muted);font-size:var(--fs-md);margin:4px 0 0}.muted{color:var(--muted)}.compute-list{display:flex;flex-direction:column;gap:10px;margin-bottom:14px}.compute-row{background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg)}.compute-row-head{display:flex;align-items:center;gap:10px;padding:12px 14px;cursor:pointer;-webkit-user-select:none;user-select:none}.compute-row-head:hover{background:var(--surface);border-radius:var(--radius-lg)}.compute-row.open .compute-row-head:hover{border-radius:var(--radius-lg) var(--radius-lg) 0 0}.compute-row-logo{display:inline-flex;align-items:center;flex:none}.compute-row-name{font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);flex:none}.compute-row-summary{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:var(--fs-sm)}.compute-row-head .badge,.compute-make-default,.compute-default-pill{flex:none}.compute-default-pill{color:var(--primary);border-color:var(--primary)}.compute-chevron-btn{flex:none;display:inline-flex;align-items:center;padding:2px;border-radius:var(--radius-sm)}.compute-chevron-btn:hover{background:var(--panel)}.compute-chevron{color:var(--muted);transition:transform .12s ease}.compute-row.open .compute-chevron{transform:rotate(180deg)}.compute-row-body{border-top:1px solid var(--border);padding:14px}.compute-row-body .settings-card{margin-bottom:0;margin-top:14px}.compute-default-note{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.compute-flavor-form{margin-bottom:14px}.compute-flavor-form label{max-width:320px}.compute-flavor-hint{font-size:var(--fs-sm)}.compute-footnote{display:flex;align-items:flex-start;gap:6px;margin:2px 0 0;font-size:var(--fs-sm);color:var(--muted)}.compute-footnote svg{flex:none;margin-top:1px}.harness-tabs{display:flex;gap:4px;margin-bottom:14px;border-bottom:1px solid var(--border-variant)}.harness-tabs button{display:inline-flex;align-items:center;gap:7px;padding:7px 12px;font-size:var(--fs-md);font-weight:var(--fw-semibold);color:var(--text);border-bottom:2px solid transparent;margin-bottom:-1px}.harness-tabs button:hover{color:var(--text)}.harness-tabs button.active{border-bottom-color:var(--primary)}.harness-dot{width:7px;height:7px;border-radius:50%;background:var(--muted)}.harness-dot.ok{background:var(--accent-green)}.harness-dot.err{background:var(--accent-red)}.harness-dot.warn{background:var(--accent-amber)}.env-table{width:100%;border-collapse:collapse;font-size:var(--fs-md);table-layout:fixed}.env-table td:first-child{width:32%;overflow-wrap:anywhere}.env-table .badge{margin-left:8px}.env-table input{width:100%;border:none;background:transparent;padding:0}.env-table input:focus{box-shadow:0 1px 0 0 var(--text)}.env-table td{height:36px;padding:0 10px 0 0;vertical-align:middle;border-bottom:1px solid var(--border-variant)}.env-table td:last-child{width:116px;white-space:nowrap;text-align:right}.env-table td[colspan]{white-space:normal;text-align:left}.env-table .icon-btn{margin-left:8px;vertical-align:middle}.env-table .icon-btn:hover{color:var(--accent-red)}.flavor-table{width:100%;border-collapse:collapse;font-size:var(--fs-md)}.flavor-table th{padding:5px 10px 5px 0;border-bottom:1px solid var(--border);text-align:left;font-weight:var(--fw-medium);color:var(--text)}.flavor-table td{padding:5px 10px 5px 0;border-bottom:1px solid var(--border-variant)}.ssh-table{table-layout:fixed}.ssh-table th:nth-child(1){width:20%}.ssh-table th:nth-child(2){width:26%}.ssh-table th:nth-child(4){width:108px}.ssh-table th:nth-child(5){width:52px}.ssh-table td{overflow-wrap:anywhere}.ssh-table td:last-child{padding-right:0;text-align:right}.ssh-tested-at{display:block;margin-top:2px;color:var(--muted);font-size:var(--fs-xs)}@keyframes settings-spin{to{transform:rotate(360deg)}}.spin{animation:settings-spin .9s linear infinite}.model-picker,.option-picker{position:relative;display:inline-flex}.composer-pill{display:inline-flex;align-items:center;gap:5px;font-size:var(--fs-sm);color:var(--text);padding:5px 8px;border-radius:var(--radius-sm)}.composer-pill:hover{background:var(--surface);color:var(--text)}.composer-bare{display:inline-flex;align-items:center;gap:3px;font-size:var(--fs-sm);color:var(--text);padding:5px 4px;border-radius:var(--radius-sm)}.composer-bare:hover{color:var(--text)}.model-menu,.option-menu{position:absolute;bottom:calc(100% + 8px);left:0;max-height:380px;display:flex;flex-direction:column;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 12px 32px #0000002e;z-index:50;overflow:hidden}.model-menu{width:320px}.option-menu{min-width:190px;padding:6px}.model-menu.align-right,.option-menu.align-right{left:auto;right:0}.option-menu.drop-down{bottom:auto;top:calc(100% + 4px)}.option-menu.session-menu{left:auto;right:6px;top:calc(100% - 2px);min-width:140px}.model-item.danger,.model-item.danger:hover{color:var(--accent-red)}.option-default{color:var(--muted);font-weight:var(--fw-regular)}.option-sep{height:1px;margin:5px 4px;background:var(--border-variant)}.option-num{color:var(--muted);font-size:var(--fs-xs);font-variant-numeric:tabular-nums}.model-menu input{border:none;border-bottom:1px solid var(--border-variant);background:none;padding:9px 12px;font-size:var(--fs-md);outline:none}.model-menu-list{overflow-y:auto;padding:6px}.model-group{font-size:var(--fs-xs);font-weight:var(--fw-medium);color:var(--muted);padding:8px 8px 4px}.model-item{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;text-align:left;padding:6px 8px;font-size:var(--fs-md);border-radius:var(--radius-sm)}.model-item:hover{background:var(--surface)}.model-item .model-id{display:block;font-family:var(--mono);font-size:var(--fs-2xs);color:var(--muted)}.model-more{padding:4px 8px 8px;font-size:var(--fs-xs);color:var(--muted)}.model-locked-note{display:flex;align-items:center;gap:6px;padding:7px 12px;font-size:var(--fs-xs);color:var(--muted);border-top:1px solid var(--border-variant)}.model-locked-note svg{flex-shrink:0}.skill-menu{position:absolute;bottom:calc(100% + 8px);left:0;min-width:340px;max-width:100%;padding:6px;background:var(--base);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:0 12px 32px #0000002e;z-index:50;overflow:hidden}.skill-item{display:flex;flex-direction:column;gap:2px;width:100%;text-align:left;padding:7px 8px;border-radius:var(--radius-sm)}.skill-item.active{background:var(--surface)}.skill-item .skill-name{font-size:var(--fs-sm)}.skill-item .skill-hint{color:var(--muted)}.skill-item .skill-desc{font-size:var(--fs-xs);color:var(--subtext)}.file-view{display:flex;flex-direction:column;height:100%;min-height:0}.file-view-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);color:var(--text);flex-shrink:0}.file-view-path{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text);flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-view-ref{font-family:var(--mono);font-size:var(--fs-xs);color:var(--muted);border:1px solid var(--border-variant);border-radius:var(--radius-sm);padding:1px 6px;max-width:180px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:0}.file-view-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.file-view-codewrap{display:flex;align-items:flex-start;min-width:max-content}.file-view-gutter,.file-view-code{margin:0;padding-top:14px;padding-bottom:14px;font-family:var(--mono);font-size:var(--fs-sm);line-height:1.55}.file-view-gutter{padding-left:14px;padding-right:10px;text-align:right;color:var(--muted);-webkit-user-select:none;user-select:none;position:sticky;left:0;background:var(--base);border-right:1px solid var(--border-variant);flex-shrink:0}.file-view-code{padding-left:16px;padding-right:16px;-moz-tab-size:4;tab-size:4;min-width:max-content}.file-view-note{padding:10px 16px;font-size:var(--fs-sm);color:var(--muted)}.file-view-md{max-width:var(--readable-col);padding:18px 20px 32px}.file-view-md .md{font-size:var(--fs-base)}.file-view-md .md h1{font-size:1.5em;margin:18px 0 8px}.file-view-md .md h2{font-size:1.25em;margin:16px 0 8px}.file-view-md .md h3{font-size:1.1em}.icon-btn.active{color:var(--primary);background:var(--surface)}.prompt-card{margin:8px 0;padding:12px 14px;border:1px solid var(--border);border-left:3px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);display:flex;flex-direction:column;gap:9px}.prompt-card.plan{border-left-color:var(--accent-blue)}.prompt-card.permission{border-left-color:var(--accent-amber)}.prompt-card.question{border-left-color:var(--accent-purple)}.prompt-card.readonly{opacity:.6}.prompt-head{font-size:var(--fs-xs);font-weight:var(--fw-semibold);color:var(--text)}.prompt-head code{font-family:var(--mono);font-size:var(--fs-sm);color:var(--text)}.prompt-sub{font-size:var(--fs-sm);color:var(--subtext);word-break:break-word}.prompt-q{font-size:var(--fs-base);font-weight:var(--fw-semibold);line-height:1.5;color:var(--text)}.prompt-plan{font-size:var(--fs-base);line-height:1.6;color:var(--text);max-height:340px;overflow-y:auto}.prompt-options{display:flex;flex-direction:column;gap:6px}.prompt-option{display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;padding:8px 11px;text-align:left;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--base);color:var(--text);cursor:pointer;transition:border-color 80ms ease,background 80ms ease}.prompt-option:hover:not(:disabled){border-color:var(--border-strong);background:var(--surface)}.prompt-option.sel{border-color:var(--primary);background:var(--primary-subtle)}.prompt-option:disabled{cursor:default}.prompt-option-label{display:block;font-size:var(--fs-md);font-weight:var(--fw-semibold)}.prompt-option-desc{display:block;font-size:var(--fs-sm);font-weight:var(--fw-regular);line-height:1.45;color:var(--subtext)}.prompt-actions{display:flex;flex-wrap:wrap;gap:8px}.prompt-actions .btn-primary,.prompt-actions .btn-ghost{display:inline-flex;align-items:center;gap:6px;padding:6px 13px;font-family:inherit;font-size:var(--fs-sm);font-weight:var(--fw-semibold);border:1px solid transparent;border-radius:var(--radius-sm);cursor:pointer;transition:background 80ms ease,border-color 80ms ease}.prompt-actions .btn-primary{background:var(--primary);color:var(--base)}.prompt-actions .btn-primary:hover:not(:disabled){opacity:.9}.prompt-actions .btn-ghost{background:transparent;border-color:var(--border);color:var(--subtext)}.prompt-actions .btn-ghost:hover:not(:disabled){border-color:var(--border-strong);color:var(--text);background:var(--surface)}.prompt-actions button:disabled{opacity:.5;cursor:default}.prompt-collapsed{color:var(--muted);font-size:var(--fs-md);margin:4px 0}.prompt-collapsed summary{display:flex;align-items:baseline;gap:8px;cursor:pointer;list-style:none;-webkit-user-select:none;user-select:none}.prompt-collapsed summary::-webkit-details-marker{display:none}.prompt-collapsed summary:after{content:"›";color:var(--muted);transition:transform 80ms ease}.prompt-collapsed[open] summary:after{transform:rotate(90deg)}.prompt-collapsed-title{font-weight:var(--fw-semibold);word-break:break-word}.prompt-outcome{font-size:var(--fs-sm);color:var(--subtext);word-break:break-word}.prompt-outcome.approved,.prompt-outcome.chosen{color:var(--accent-green)}.prompt-outcome.approved:before,.prompt-outcome.chosen:before{content:"✓ "}.prompt-outcome.revised,.prompt-outcome.rejected{color:var(--accent-amber)}.prompt-collapsed-body{margin-top:6px;padding-left:12px;border-left:2px solid var(--border);font-size:var(--fs-md);color:var(--subtext)}.prompt-collapsed-options{margin:6px 0 0;padding-left:18px}.prompt-collapsed-options .sel{color:var(--text);font-weight:var(--fw-semibold)}.prompt-collapsed-note{margin-top:6px;font-style:italic}.plan-strip{position:relative;width:100%;margin:0 0 10px;padding:11px 13px;display:flex;flex-direction:column;align-items:stretch;gap:10px;border:1px solid var(--border);border-left:3px solid var(--accent-blue);border-radius:var(--radius-md);background:var(--surface);box-shadow:0 2px 10px #0000000f}.plan-strip-info{display:flex;align-items:baseline;gap:8px;min-width:0}.plan-strip-open{margin-left:auto;padding:0;border:none;background:none;color:var(--accent-blue);font-size:var(--fs-md);cursor:pointer;white-space:nowrap;flex-shrink:0}.plan-strip-open:hover{text-decoration:underline}.plan-strip-spacer{flex:1}.plan-strip-revise-input{width:100%;resize:none;border:1px solid var(--border);border-radius:var(--radius-md);padding:9px 11px;font-size:var(--fs-md);font-family:inherit;background:var(--base);color:var(--text)}.plan-strip-revise-input:focus{border-color:var(--accent-blue)}.plan-strip-icon{color:var(--accent-blue);flex-shrink:0;align-self:center}.plan-strip-title{font-size:var(--fs-md);font-weight:var(--fw-semibold);white-space:nowrap}.plan-strip-actions{gap:6px 8px;justify-content:flex-end}.plan-strip-actions .btn-primary,.plan-strip-actions .btn-ghost{background:transparent;border:1px solid var(--text);color:var(--text)}.plan-strip-actions .btn-primary:hover:not(:disabled),.plan-strip-actions .btn-ghost:hover:not(:disabled){background:var(--surface-2, rgb(0 0 0 / 5%));border-color:var(--text);color:var(--text);opacity:1}.plan-strip-actions .plan-strip-primary{background:var(--text);border-color:var(--text);color:var(--base)}.plan-strip-actions .plan-strip-primary:hover:not(:disabled){background:color-mix(in oklab,var(--text) 85%,var(--base));border-color:var(--text);color:var(--base)}.plan-strip-approve{position:relative;display:flex}.plan-strip-approve .btn-primary:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.plan-strip-actions .plan-strip-caret{border-top-left-radius:0;border-bottom-left-radius:0;padding:0 6px;display:flex;align-items:center;border-left:1px solid color-mix(in oklab,var(--base) 35%,var(--text))}.plan-strip-menu{position:absolute;right:0;bottom:calc(100% + 4px);display:flex;flex-direction:column;min-width:190px;padding:4px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface);box-shadow:0 6px 20px #0000001f;z-index:6}.plan-strip-menu button{text-align:left;padding:7px 9px;border:none;border-radius:var(--radius-sm);background:transparent;color:var(--text);font-size:var(--fs-md);cursor:pointer}.plan-strip-menu button:hover{background:var(--surface-2, rgb(0 0 0 / 5%))}.prompt-plan.clamped{max-height:9.5em;overflow:hidden;position:relative}.prompt-plan.clamped:after{content:"";position:absolute;inset:auto 0 0 0;height:34px;background:linear-gradient(to bottom,transparent,var(--surface));pointer-events:none}.prompt-plan-open{align-self:flex-start;border:none;background:transparent;color:var(--accent-blue);font-size:var(--fs-sm);padding:0;cursor:pointer}.prompt-plan-open:hover{text-decoration:underline}.code-tab{display:flex;flex-direction:column;height:100%;min-height:0}.code-tab-header{display:flex;align-items:center;gap:8px;padding:4px 12px;border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-select{max-width:280px;min-width:0;padding:3px 8px;font-size:var(--fs-sm)}.code-tab-note{padding:8px 16px;font-size:var(--fs-sm);color:var(--muted);border-bottom:1px solid var(--border-variant);flex-shrink:0}.code-tab-body{flex:1;min-height:0;overflow:auto;background:var(--base)}.code-tree{padding:6px 0;font-size:var(--fs-md)}.code-tree-row{display:flex;align-items:center;gap:6px;width:100%;padding:3px 10px;border:none;background:transparent;color:var(--text);text-align:left;cursor:pointer;font-family:inherit;font-size:inherit}.code-tree-row:hover{background:var(--panel)}.code-tree-row>svg{flex-shrink:0;color:var(--subtext)}.code-tree-row>svg.code-tree-chev{color:var(--muted)}.code-tree-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tour-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:200}.tour-dim{position:absolute;top:0;right:0;bottom:0;left:0;background:#0000008c}.tour-spotlight{position:absolute;border-radius:var(--radius-lg);box-shadow:0 0 0 9999px #0000008c;transition:all .3s ease}.tour-ring{position:absolute;border-radius:var(--radius-lg);border:2px solid var(--primary);transition:all .3s ease}.tour-card{position:absolute;width:340px;max-width:calc(100vw - 32px);background:var(--base);border:1px solid var(--border);border-radius:var(--radius-xl);box-shadow:0 24px 60px #00000038;padding:18px 20px 0;transition:left .2s ease,top .2s ease}.tour-card.centered{left:50%;top:50%;transform:translate(-50%,-50%);transition:none}.tour-card h3{margin:0 24px 6px 0;font-size:var(--fs-base);font-weight:var(--fw-semibold)}.tour-card p{margin:0;font-size:var(--fs-md);line-height:1.5;color:var(--text)}.tour-card .tour-close{position:absolute;top:10px;right:10px}.tour-footer{display:flex;align-items:center;border-top:1px solid var(--border-variant);margin-top:14px;padding:10px 0}.tour-footer-side{flex:1;display:flex}.tour-footer-side.end{justify-content:flex-end}.tour-count{font-size:var(--fs-xs);color:var(--muted);font-variant-numeric:tabular-nums}.tour-arrow{position:absolute;width:12px;height:12px;background:var(--base);rotate:45deg;pointer-events:none}.tour-arrow.above{bottom:-6.5px;left:calc(50% - 6px);border-right:1px solid var(--border);border-bottom:1px solid var(--border)}.tour-arrow.below{top:-6.5px;left:calc(50% - 6px);border-left:1px solid var(--border);border-top:1px solid var(--border)}.tour-arrow.left{right:-6.5px;top:calc(50% - 6px);border-top:1px solid var(--border);border-right:1px solid var(--border)}.tour-arrow.right{left:-6.5px;top:calc(50% - 6px);border-bottom:1px solid var(--border);border-left:1px solid var(--border)}.react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #777;--xy-background-pattern-lines-color-default: #777;--xy-background-pattern-cross-color-default: #777;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}/** + * Copyright (c) 2014 The xterm.js authors. All rights reserved. + * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) + * https://github.com/chjj/term.js + * @license MIT + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * Originally forked from (with the author's permission): + * Fabrice Bellard's javascript vt100 for jslinux: + * http://bellard.org/jslinux/ + * Copyright (c) 2011 Fabrice Bellard + * The original design remains. The terminal itself + * has been extended to include xterm CSI codes, among + * other features. + */.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative} diff --git a/ui/dist/index.html b/ui/dist/index.html index 5de77c7a..811b284d 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -9,8 +9,8 @@ html { background: #ffffff; } @media (prefers-color-scheme: dark) { html { background: #0e0c0c; } } - - + +
diff --git a/ui/src/components/ChatPanel.tsx b/ui/src/components/ChatPanel.tsx index 037b515c..9402c42c 100644 --- a/ui/src/components/ChatPanel.tsx +++ b/ui/src/components/ChatPanel.tsx @@ -12,6 +12,7 @@ import { X, } from "lucide-react"; import { useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react"; +import { Wordmark } from "./Wordmark"; import { chatAttachmentUrl, createChatSession, @@ -1481,7 +1482,7 @@ export function ChatPanel({ {!threadMounted ? (

- OpenResearch +

Ask the agent to explore your codebase, create and run your baseline experiment, and diff --git a/ui/src/components/LogTerminal.tsx b/ui/src/components/LogTerminal.tsx index f4d4a829..f8fda212 100644 --- a/ui/src/components/LogTerminal.tsx +++ b/ui/src/components/LogTerminal.tsx @@ -28,9 +28,13 @@ export function LogTerminal({ runId }: { runId: string }) { convertEol: true, disableStdin: true, fontSize: 12, - fontFamily: 'ui-monospace, "SF Mono", Menlo, Consolas, monospace', + // xterm needs a resolved font string, so read --mono off the root element. + fontFamily: + getComputedStyle(document.documentElement).getPropertyValue("--mono").trim() || + "ui-monospace, Menlo, Consolas, monospace", scrollback: 20000, theme: { + // Matches --term-bg in styles.css (terminal stays dark in both themes). background: "#1a1a1a", foreground: "#e6e1e0", cursor: "#1a1a1a", diff --git a/ui/src/components/ModelPicker.tsx b/ui/src/components/ModelPicker.tsx index 07fa56fb..d399172f 100644 --- a/ui/src/components/ModelPicker.tsx +++ b/ui/src/components/ModelPicker.tsx @@ -220,7 +220,7 @@ export function OptionPicker({ /** The harness's default id — pinned at top of the menu and used when * `value` is null. */ defaultId?: string | null; - /** Uppercase group header (e.g. "Mode"). */ + /** Group header (e.g. "Mode"). */ header?: string; align?: "left" | "right"; /** `pill` = boxed (permission mode); `bare` = text-only (reasoning). */ diff --git a/ui/src/components/Onboarding.tsx b/ui/src/components/Onboarding.tsx index b90d86d1..d576d834 100644 --- a/ui/src/components/Onboarding.tsx +++ b/ui/src/components/Onboarding.tsx @@ -1,4 +1,5 @@ import { ArrowLeft, ArrowRight, Check, Copy, RefreshCw } from "lucide-react"; +import { Wordmark } from "./Wordmark"; import { useEffect, useState } from "react"; import { getDataDir, @@ -53,7 +54,7 @@ export function Onboarding({ onDone }: { onDone: () => void }) { {step === 0 ? ( <>

- OpenResearch · step 1 of 4 + · Step 1 of 4

Your coding agents

@@ -82,7 +83,7 @@ export function Onboarding({ onDone }: { onDone: () => void }) { ) : step === 1 ? ( <>

- OpenResearch · step 2 of 4 + · Step 2 of 4

Git & GitHub

@@ -109,7 +110,7 @@ export function Onboarding({ onDone }: { onDone: () => void }) { ) : step === 2 ? ( <>

- OpenResearch · step 3 of 4 + · Step 3 of 4

Where orx keeps your data

@@ -133,7 +134,7 @@ export function Onboarding({ onDone }: { onDone: () => void }) { ) : ( <>

- OpenResearch · step 4 of 4 + · Step 4 of 4

Usage analytics

@@ -161,9 +162,9 @@ export function Onboarding({ onDone }: { onDone: () => void }) { } function agentBadge(h: Harness): { cls: string; label: string } { - if (h.agentReady) return { cls: "st-done", label: "connected" }; - if (h.installed) return { cls: "st-starting", label: "not signed in" }; - return { cls: "st-idle", label: "not detected" }; + if (h.agentReady) return { cls: "st-done", label: "Connected" }; + if (h.installed) return { cls: "st-starting", label: "Not signed in" }; + return { cls: "st-idle", label: "Not detected" }; } function AgentCard({ h }: { h: Harness }) { @@ -260,10 +261,10 @@ function GitCard({ {git.githubTokenSource === "env" ? "token from GITHUB_TOKEN" : git.githubTokenSource === "stored" - ? "token saved in orx" + ? "Token saved in orx" : git.githubTokenSource === "gh" - ? "signed in via gh CLI" - : "not connected"} + ? "Signed in via gh CLI" + : "Not connected"} {git.githubTokenSource ? : } diff --git a/ui/src/components/ProjectsHome.tsx b/ui/src/components/ProjectsHome.tsx index 91508614..7fa7a748 100644 --- a/ui/src/components/ProjectsHome.tsx +++ b/ui/src/components/ProjectsHome.tsx @@ -1,4 +1,5 @@ import { Plus, Trash2 } from "lucide-react"; +import { Wordmark } from "./Wordmark"; import { useState } from "react"; import { deleteProject, timeAgo, type Project } from "../api"; import { NewProjectForm } from "./NewProjectForm"; @@ -38,7 +39,7 @@ export function ProjectsHome({

- OpenResearch +

Projects

diff --git a/ui/src/components/SettingsPage.tsx b/ui/src/components/SettingsPage.tsx index 9f0fdea6..474a5256 100644 --- a/ui/src/components/SettingsPage.tsx +++ b/ui/src/components/SettingsPage.tsx @@ -195,12 +195,12 @@ function HarnessesTab() { // --- compute (kubernetes) ------------------------------------------------------- function K8sHealthBadge({ s }: { s: K8sSettings }) { - if (!s.configured) return not configured; + if (!s.configured) return Not configured; const p = s.preflight; if (!p.kubectlFound) return kubectl not found; - if (!p.reachable) return cluster unreachable; - if (!p.canCreateJobs) return no job-create permission; - return connected; + if (!p.reachable) return Cluster unreachable; + if (!p.canCreateJobs) return No job-create permission; + return Connected; } function K8sSection() { @@ -332,12 +332,12 @@ const MODAL_TOKEN_LABELS: Record = { }; function ModalBadge({ s }: { s: ModalSettings }) { - if (s.ready) return connected; - if (!s.tokenConfigured && !s.modalImportable) return not set up; + if (s.ready) return Connected; + if (!s.tokenConfigured && !s.modalImportable) return Not set up; if (!s.modalImportable) - return {s.envProvisioned ? "env broken" : "env not built"}; - if (!s.tokenConfigured) return no token; - return unknown; + return {s.envProvisioned ? "Env broken" : "Env not built"}; + if (!s.tokenConfigured) return No token; + return Unknown; } function ModalSection() { @@ -388,14 +388,14 @@ function ModalSection() { Environment {s.modalImportable - ? "ready" + ? "Ready" : s.envProvisioned - ? "provisioned (modal import failing)" - : "not built yet"} + ? "Provisioned (modal import failing)" + : "Not built yet"} Token - {s.tokenSource ? MODAL_TOKEN_LABELS[s.tokenSource] : "not configured"} + {s.tokenSource ? MODAL_TOKEN_LABELS[s.tokenSource] : "Not configured"}
{!s.tokenConfigured && ( @@ -430,11 +430,11 @@ function HostTestCell({ test }: { test: HostTest | undefined }) { if (test === undefined) return never tested; if (test === "testing") return ; const badge = !test.reachable ? ( - unreachable + Unreachable ) : !test.gitFound ? ( - no git + No git ) : ( - ready + Ready ); return ( <> @@ -537,12 +537,12 @@ function SlurmTestBadge({ test }: { test: "testing" | SlurmPreflight | null }) { if (!test.reachable) return ( - unreachable + Unreachable ); - if (!test.slurmFound) return no slurm CLI; - if (!test.gitFound) return no git; - return ready; + if (!test.slurmFound) return No Slurm CLI; + if (!test.gitFound) return No git; + return Ready; } function SlurmSection() { @@ -818,18 +818,18 @@ function OpenResearchSection() {
Status - signed in + Signed in Orgs {s.orgs.length > 0 ? s.orgs.join(", ") : "—"} SSH key {s.sshKeyRegistered === true ? ( - registered + Registered ) : s.sshKeyRegistered === false ? ( - none registered + None registered ) : ( - unknown + Unknown )}
@@ -882,10 +882,10 @@ const FLAVOR_SUGGESTIONS: Partial> = { }; function TargetStatusBadge({ t, isDefault }: { t: ComputeTargetSummary; isDefault: boolean }) { - if (t.id === "local") return ready; - if (!t.configured && isDefault) return not configured; - if (!t.configured) return not set up; - return configured; + if (t.id === "local") return Ready; + if (!t.configured && isDefault) return Not configured; + if (!t.configured) return Not set up; + return Configured; } /** The default row's inline flavor editor (flavored backends only). */ @@ -1168,18 +1168,18 @@ const SOURCE_LABELS: Record = { }; function HfStatusBadge({ settings }: { settings: HfSettings }) { - if (!settings.configured) return not configured; - if (!settings.valid) return invalid token; - return connected; + if (!settings.configured) return Not configured; + if (!settings.valid) return Invalid token; + return Connected; } /** Jobs-permission detail only — configured/valid state is HfStatusBadge's job. */ function HfJobsBadge({ settings }: { settings: HfSettings }) { if (!settings.configured || !settings.valid) return null; - if (settings.jobsWrite === true) return jobs: write OK; + if (settings.jobsWrite === true) return Jobs: write OK; if (settings.jobsWrite === false) - return no job.write permission; - return jobs permission unknown; + return No job.write permission; + return Jobs permission unknown; } function HfSection() { @@ -1247,7 +1247,7 @@ function HfSection() { {settings.maskedToken ?? "—"} Source - {settings.source ? SOURCE_LABELS[settings.source] : "not configured"} + {settings.source ? SOURCE_LABELS[settings.source] : "Not configured"} Jobs @@ -1371,7 +1371,7 @@ function EnvRow({ {entry ? ( <> {entry.maskedValue} - {entry.inProcessEnv && overridden by env} + {entry.inProcessEnv && Overridden by env} ) : (

Data directory

- {settings.isDefault ? "default" : "custom"} + {settings.isDefault ? "Default" : "Custom"}
Current @@ -2016,7 +2016,7 @@ function InstancesTable({ instances, emptyLabel }: { instances: Instance[]; empt {timeAgo(inst.createdAt)} - {runtimeLabel(inst)} + {runtimeLabel(inst)} ); })} diff --git a/ui/src/components/StatusBadge.tsx b/ui/src/components/StatusBadge.tsx index 8e241600..84834667 100644 --- a/ui/src/components/StatusBadge.tsx +++ b/ui/src/components/StatusBadge.tsx @@ -1,4 +1,4 @@ -// Mirror of openresearch.sh StatusBadge: mono uppercase label + colored dot, +// Mirror of openresearch.sh StatusBadge: sentence-case label + colored dot, // live statuses pulse. STATUS_STYLES is the single source of truth for status // coloring across the table, graph and drawer. @@ -21,12 +21,16 @@ export function statusStyle(status: string): StatusStyle { return STATUS_STYLES[status] ?? STATUS_STYLES.idle; } +function sentenceCase(s: string): string { + return s.charAt(0).toUpperCase() + s.slice(1); +} + export function StatusBadge({ status, label }: { status: string; label?: string }) { const style = statusStyle(status); return ( - {label ?? status} + {label ?? sentenceCase(status)} ); } diff --git a/ui/src/components/TreeView.tsx b/ui/src/components/TreeView.tsx index 74c40410..1112c376 100644 --- a/ui/src/components/TreeView.tsx +++ b/ui/src/components/TreeView.tsx @@ -75,7 +75,7 @@ const ExpNode = memo(function ExpNode({ data }: NodeProps) { const { exp, latestRun, runs, isBaseline, githubOwner, githubRepo, onOpenView, onOpenCodeBranch } = data; const status = latestRun?.status; const live = status === "running" || status === "starting"; - const kind = isBaseline ? "BASELINE" : live ? "RUNNING" : "EXPERIMENT"; + const kind = isBaseline ? "Baseline" : live ? "Running" : "Experiment"; const squares = runs.slice(-MAX_SQUARES); return (
@@ -91,7 +91,7 @@ const ExpNode = memo(function ExpNode({ data }: NodeProps) {
{exp.title || exp.description}
)}
- RUNS + Runs {squares.length > 0 ? ( {squares.map((run) => ( diff --git a/ui/src/components/Wordmark.tsx b/ui/src/components/Wordmark.tsx new file mode 100644 index 00000000..091894ec --- /dev/null +++ b/ui/src/components/Wordmark.tsx @@ -0,0 +1,16 @@ +// OpenResearch wordmark: logo mark + name, sized by the parent's font-size. +// Single source for the brand lockup (home, chat empty state, onboarding). +export function Wordmark() { + return ( + + + OpenResearch + + ); +} diff --git a/ui/src/styles.css b/ui/src/styles.css index cb543091..45661418 100644 --- a/ui/src/styles.css +++ b/ui/src/styles.css @@ -40,6 +40,38 @@ --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; + + /* Type scale. Sizes are px steps; anything smaller than --fs-2xs is banned. */ + --fs-2xs: 10px; + --fs-xs: 11px; + --fs-sm: 12px; + --fs-md: 13px; + --fs-base: 14px; + --fs-lg: 15px; + --fs-xl: 16px; + --fs-2xl: 18px; + --fs-3xl: 22px; + --fs-4xl: 28px; + --fs-5xl: 34px; + + /* Weight scale. Display weight is for hero headings only; the brand + wordmark keeps a literal 800. */ + --fw-regular: 400; + --fw-medium: 500; + --fw-semibold: 600; + --fw-display: 700; + + /* Radius scale. True circles stay literal 50%. */ + --radius-xs: 4px; + --radius-sm: 6px; + --radius-md: 8px; + --radius-lg: 10px; + --radius-xl: 12px; + --radius-full: 999px; + + /* xterm surface — deliberately dark in both themes; keep in sync with the + terminal theme in LogTerminal.tsx. */ + --term-bg: #1a1a1a; /* Readable column cap shared by the chat header/thread/composer (which must stay in lockstep or the chat column misaligns) and the settings/doc views. */ --readable-col: 760px; @@ -108,7 +140,7 @@ body { background: var(--base); color: var(--text); font-family: var(--sans); - font-size: 14px; + font-size: var(--fs-base); line-height: 1.45; overflow: hidden; } @@ -133,7 +165,7 @@ select { color: var(--text); background: var(--base); border: 1px solid var(--border); - border-radius: 0; + border-radius: var(--radius-md); padding: 6px 10px; outline: none; } @@ -156,7 +188,7 @@ textarea::placeholder { } ::-webkit-scrollbar-thumb { background: var(--border); - border-radius: 5px; + border-radius: var(--radius-sm); border: 2px solid transparent; background-clip: padding-box; } @@ -208,15 +240,25 @@ textarea::placeholder { margin: 0 auto; padding: 48px 24px 64px; } +.wordmark { + display: inline-flex; + align-items: center; + gap: 0.4em; + color: var(--text); +} +.wordmark svg { + width: 1em; + height: 1em; + flex-shrink: 0; +} + .home-brand { - font-weight: 800; - font-size: 28px; + /* Matches the openresearch.sh landing wordmark (font-bold = 700). */ + font-weight: var(--fw-display); + font-size: var(--fs-4xl); letter-spacing: -0.02em; margin-bottom: 36px; } -.home-brand span { - color: var(--primary); -} .home-head { display: flex; align-items: center; @@ -226,7 +268,7 @@ textarea::placeholder { } .home-head h2 { margin: 0; - font-size: 18px; + font-size: var(--fs-2xl); letter-spacing: -0.01em; } .home-list { @@ -243,7 +285,7 @@ textarea::placeholder { padding: 14px 16px; background: var(--base); border: 1px solid var(--border); - border-radius: 10px; + border-radius: var(--radius-lg); cursor: pointer; transition: border-color 120ms ease, @@ -259,7 +301,7 @@ textarea::placeholder { right: 10px; display: none; padding: 5px; - border-radius: 6px; + border-radius: var(--radius-sm); color: var(--muted); line-height: 0; } @@ -271,18 +313,18 @@ textarea::placeholder { background: var(--overlay, rgba(0, 0, 0, 0.05)); } .project-card .name { - font-weight: 600; - font-size: 14px; + font-weight: var(--fw-semibold); + font-size: var(--fs-base); } .project-card .repo { - color: var(--subtext); + color: var(--text); } .project-card .paper { - font-size: 11px; + font-size: var(--fs-xs); color: var(--muted); } .project-card .time { - font-size: 11px; + font-size: var(--fs-xs); color: var(--muted); } @@ -306,11 +348,11 @@ textarea::placeholder { gap: 8px; flex: 1; min-width: 0; - font-weight: 600; - font-size: 13px; + font-weight: var(--fw-semibold); + font-size: var(--fs-md); color: var(--text); padding: 4px 6px 4px 0; - border-radius: 6px; + border-radius: var(--radius-sm); } .rail-brand .brand:hover { color: var(--subtext); @@ -352,11 +394,11 @@ textarea::placeholder { right: -4px; background: var(--text); color: var(--base); - font-size: 11px; - font-weight: 500; + font-size: var(--fs-xs); + font-weight: var(--fw-medium); line-height: 1; padding: 5px 8px; - border-radius: 6px; + border-radius: var(--radius-sm); white-space: nowrap; opacity: 0; visibility: hidden; @@ -381,10 +423,10 @@ textarea::placeholder { justify-content: center; gap: 6px; padding: 6px 14px; - font-size: 12px; - font-weight: 600; + font-size: var(--fs-sm); + font-weight: var(--fw-semibold); border: 1px solid var(--border); - border-radius: 8px; + border-radius: var(--radius-md); background: var(--base); color: var(--text); white-space: nowrap; @@ -427,7 +469,7 @@ textarea::placeholder { } .btn.ghost { border-color: transparent; - color: var(--subtext); + color: var(--text); } .btn.ghost:hover:not(:disabled) { color: var(--text); @@ -435,8 +477,8 @@ textarea::placeholder { } .btn.sm { padding: 3px 9px; - font-size: 11px; - border-radius: 6px; + font-size: var(--fs-xs); + border-radius: var(--radius-sm); } /* ---- status badge (colored dot + quiet label; live statuses pulse) ---- */ @@ -445,10 +487,9 @@ textarea::placeholder { display: inline-flex; align-items: center; gap: 6px; - font-size: 12px; - font-weight: 500; - color: var(--subtext); - text-transform: capitalize; + font-size: var(--fs-sm); + font-weight: var(--fw-medium); + color: var(--text); white-space: nowrap; } .status-badge .dot { @@ -491,7 +532,7 @@ textarea::placeholder { per-panel. */ .floating-panel { border: 1px solid var(--border); - border-radius: 10px; + border-radius: var(--radius-lg); box-shadow: 0 6px 24px color-mix(in oklab, var(--text) 5%, transparent), 0 1px 4px color-mix(in oklab, var(--text) 4%, transparent); @@ -523,26 +564,24 @@ textarea::placeholder { align-items: center; gap: 10px; padding: 7px 10px; - font-size: 12.5px; - color: var(--subtext); - border-radius: 8px; + font-size: var(--fs-md); + color: var(--text); + border-radius: var(--radius-md); text-align: left; } .rail-nav-item:hover { background: var(--surface); - color: var(--text); } .rail-nav-item.active { background: var(--panel); - color: var(--text); - font-weight: 600; + font-weight: var(--fw-semibold); } .rail-section-label { padding: 10px 10px 6px; - font-size: 12px; - font-weight: 500; - color: var(--muted); + font-size: var(--fs-sm); + font-weight: var(--fw-medium); + color: var(--subtext); } /* "Recents" label + the session filter button on one line. */ .rail-section-head { @@ -559,11 +598,11 @@ textarea::placeholder { .rail-filter-btn { width: 24px; height: 24px; - border-radius: 6px; + border-radius: var(--radius-sm); } .rail-empty { padding: 6px 10px; - font-size: 12px; + font-size: var(--fs-sm); color: var(--muted); } .session-rail .rail-body { @@ -676,7 +715,7 @@ textarea::placeholder { justify-content: center; width: 16px; height: 16px; - border-radius: 4px; + border-radius: var(--radius-xs); color: var(--muted); flex-shrink: 0; } @@ -691,26 +730,16 @@ textarea::placeholder { align-items: center; gap: 6px; padding: 5px 12px; - font-size: 12px; - font-weight: 600; - color: var(--subtext); - border-radius: 6px; + font-size: var(--fs-sm); + font-weight: var(--fw-semibold); + color: var(--text); + border-radius: var(--radius-sm); white-space: nowrap; flex-shrink: 0; } -.tab:hover { - color: var(--text); -} .tab.active { - color: var(--text); background: var(--surface); } -.tab .tab-count { - font-family: var(--mono); - font-weight: 400; - color: var(--muted); -} - .tab-body { flex: 1; min-height: 0; @@ -751,22 +780,21 @@ textarea::placeholder { align-items: center; gap: 2px; padding: 3px; - border-radius: 9px; + border-radius: var(--radius-md); background: color-mix(in oklab, var(--text) 10%, transparent); } .seg button { padding: 3px 12px; - font-size: 12px; - font-weight: 600; - color: var(--subtext); - border-radius: 6px; + font-size: var(--fs-sm); + font-weight: var(--fw-semibold); + color: var(--text); + border-radius: var(--radius-sm); } .seg button:hover { color: var(--text); } .seg button.active { background: var(--base); - color: var(--text); box-shadow: 0 1px 3px color-mix(in oklab, var(--text) 25%, transparent); } @@ -812,8 +840,8 @@ textarea::placeholder { .chat-header .title { - font-size: 13px; - font-weight: 600; + font-size: var(--fs-md); + font-weight: var(--fw-semibold); color: var(--text); flex: 1; min-width: 0; @@ -830,20 +858,18 @@ textarea::placeholder { width: 100%; text-align: left; padding: 7px 10px; - border-radius: 8px; - font-size: 12.5px; - color: var(--subtext); + border-radius: var(--radius-md); + font-size: var(--fs-md); + color: var(--text); cursor: pointer; user-select: none; } .session-row:hover { background: var(--surface); - color: var(--text); } .session-row.active { - color: var(--text); background: var(--surface); - font-weight: 500; + font-weight: var(--fw-medium); } /* Reserved status column so titles align whether or not a busy dot shows. */ .session-row .session-dot { @@ -861,8 +887,7 @@ textarea::placeholder { white-space: nowrap; } .session-row .session-time { - font-size: 10px; - font-family: var(--mono); + font-size: var(--fs-2xs); color: var(--muted); flex-shrink: 0; } @@ -874,7 +899,7 @@ textarea::placeholder { width: 18px; height: 18px; margin: -2px 0; - border-radius: 5px; + border-radius: var(--radius-sm); color: var(--muted); flex-shrink: 0; } @@ -918,7 +943,7 @@ textarea::placeholder { color: var(--text); background: var(--base); border: 1px solid var(--primary); - border-radius: 5px; + border-radius: var(--radius-sm); outline: none; } .session-row.editing { @@ -954,39 +979,36 @@ textarea::placeholder { align-items: center; justify-content: center; gap: 12px; - color: var(--subtext); + color: var(--text); padding: 20px; text-align: center; } .chat-empty h2 { margin: 0; - font-size: 34px; - font-weight: 700; + font-size: var(--fs-5xl); + font-weight: var(--fw-display); letter-spacing: -0.02em; color: var(--text); } -.chat-empty h2 span { - color: var(--primary); -} .chat-empty .chat-empty-hint { - font-size: 12px; + font-size: var(--fs-sm); color: var(--muted); max-width: 340px; text-align: center; } .chat-empty p { margin: 0; - font-size: 13px; + font-size: var(--fs-md); max-width: 320px; } /* one-click /reproduce-paper prefill for paper-born projects */ .chat-empty .chat-suggest { font-family: var(--mono); - font-size: 12px; + font-size: var(--fs-sm); color: var(--text); background: var(--surface); border: 1px solid var(--border); - border-radius: 999px; + border-radius: var(--radius-full); padding: 6px 14px; cursor: pointer; transition: border-color 120ms ease; @@ -1000,9 +1022,9 @@ textarea::placeholder { align-self: flex-end; max-width: 88%; background: var(--surface); - border-radius: 16px; + border-radius: 16px; /* chat bubble — deliberate outsized radius */ padding: 10px 15px; - font-size: 13px; + font-size: var(--fs-md); white-space: pre-wrap; word-break: break-word; } @@ -1016,12 +1038,12 @@ textarea::placeholder { max-width: 220px; max-height: 160px; border: 1px solid var(--border-variant); - border-radius: 4px; + border-radius: var(--radius-xs); display: block; } .msg-assistant { - font-size: 14px; + font-size: var(--fs-base); line-height: 1.62; color: var(--text); min-width: 0; @@ -1029,14 +1051,14 @@ textarea::placeholder { .reasoning { color: var(--muted); - font-size: 12px; + font-size: var(--fs-sm); margin: 2px 0; } .reasoning summary { cursor: pointer; list-style: none; user-select: none; - font-weight: 600; + font-weight: var(--fw-semibold); } .reasoning[open] { white-space: pre-wrap; @@ -1055,9 +1077,9 @@ textarea::placeholder { padding: 3px 2px; cursor: pointer; color: var(--muted); - font-size: 12.5px; + font-size: var(--fs-md); text-align: left; - border-radius: 6px; + border-radius: var(--radius-sm); } .tool-group-summary:hover { color: var(--subtext); @@ -1095,7 +1117,7 @@ textarea::placeholder { list-style: none; user-select: none; min-width: 0; - border-radius: 5px; + border-radius: var(--radius-sm); } .tool-row summary:hover { background: var(--surface); @@ -1109,12 +1131,12 @@ textarea::placeholder { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; - font-size: 12.5px; + font-size: var(--fs-md); color: var(--subtext); } .tool-open { flex-shrink: 0; - font-size: 11px; + font-size: var(--fs-xs); color: var(--primary); } .tool-open:hover { @@ -1140,10 +1162,10 @@ textarea::placeholder { .tool-cmd-full { padding: 6px 10px; font-family: var(--mono); - font-size: 11px; + font-size: var(--fs-xs); color: var(--text); background: var(--surface); - border-radius: 5px; + border-radius: var(--radius-sm); white-space: pre-wrap; word-break: break-word; } @@ -1151,7 +1173,7 @@ textarea::placeholder { margin-top: 3px; padding: 6px 10px; font-family: var(--mono); - font-size: 11px; + font-size: var(--fs-xs); color: var(--subtext); white-space: pre-wrap; word-break: break-word; @@ -1159,14 +1181,14 @@ textarea::placeholder { overflow-y: auto; background: var(--base); border: 1px solid var(--border-variant); - border-radius: 5px; + border-radius: var(--radius-sm); } .working { display: flex; align-items: center; gap: 8px; color: var(--subtext); - font-size: 12.5px; + font-size: var(--fs-md); padding: 2px 0 8px; } /* Turn held open on an unanswered card: waiting on the user, not the model. */ @@ -1212,7 +1234,7 @@ textarea::placeholder { display: flex; flex-direction: column; border: 1px solid var(--border); - border-radius: 8px; + border-radius: var(--radius-md); background: var(--base); } .composer textarea { @@ -1220,7 +1242,7 @@ textarea::placeholder { background: none; resize: none; padding: 10px 12px 4px; - font-size: 13px; + font-size: var(--fs-md); min-height: 42px; max-height: 180px; } @@ -1239,7 +1261,7 @@ textarea::placeholder { height: 52px; object-fit: cover; border: 1px solid var(--border); - border-radius: 6px; + border-radius: var(--radius-sm); display: block; } .attachment-thumb button { @@ -1275,7 +1297,7 @@ textarea::placeholder { justify-content: center; width: 32px; height: 32px; - border-radius: 8px; + border-radius: var(--radius-md); background: var(--primary); color: var(--base); transition: @@ -1316,24 +1338,25 @@ textarea::placeholder { } .md strong { color: var(--text); - font-weight: 600; + font-weight: var(--fw-semibold); } .md pre { background: var(--surface); border: 1px solid color-mix(in oklab, var(--border) 50%, transparent); - border-radius: 8px; + border-radius: var(--radius-md); padding: 8px 12px; overflow-x: auto; - font-size: 12px; + font-size: var(--fs-sm); color: var(--text); } .md code { font-family: var(--mono); font-size: 0.9em; - font-weight: 500; + font-weight: var(--fw-medium); color: var(--primary); background: var(--panel); border: 1px solid var(--border-variant); + border-radius: var(--radius-xs); padding: 1px 5px; } /* File mention chip — reads as clickable inline code (thin border, panel @@ -1348,10 +1371,11 @@ textarea::placeholder { vertical-align: baseline; font-family: var(--mono); font-size: 0.9em; - font-weight: 500; + font-weight: var(--fw-medium); color: var(--text); background: var(--panel); border: 1px solid var(--border-variant); + border-radius: var(--radius-xs); cursor: pointer; } .md .file-chip:hover:not(:disabled) { @@ -1373,7 +1397,7 @@ textarea::placeholder { border: none; color: inherit; padding: 0; - font-weight: 400; + font-weight: var(--fw-regular); } .md-code { @@ -1395,7 +1419,7 @@ textarea::placeholder { color: var(--muted); background: var(--base); border: 1px solid var(--border-variant); - border-radius: 6px; + border-radius: var(--radius-sm); opacity: 0; transition: opacity 0.12s ease, color 0.12s ease; } @@ -1413,7 +1437,7 @@ textarea::placeholder { .md h4 { color: var(--text); font-size: 1.05em; - font-weight: 600; + font-weight: var(--fw-semibold); margin: 12px 0 6px; } .md ul, @@ -1430,10 +1454,10 @@ textarea::placeholder { .md table { border-collapse: collapse; width: 100%; - font-size: 13px; + font-size: var(--fs-md); margin: 10px 0; border: 1px solid var(--border); - border-radius: 8px; + border-radius: var(--radius-md); overflow: hidden; } .md th, @@ -1448,8 +1472,8 @@ textarea::placeholder { } .md thead th { background: var(--surface); - font-weight: 500; - color: var(--subtext); + font-weight: var(--fw-medium); + color: var(--text); border-bottom: 1px solid var(--border); } .md tbody tr:hover td { @@ -1478,10 +1502,11 @@ textarea::placeholder { /* Keep in sync with NODE_W in TreeView.tsx (layout math uses it). */ width: 264px; border: 1px solid var(--border); + border-radius: var(--radius-md); background: var(--base); padding: 10px 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); - font-size: 12.5px; + font-size: var(--fs-md); transition: box-shadow 120ms ease; } .exp-node:hover { @@ -1497,11 +1522,8 @@ textarea::placeholder { justify-content: space-between; gap: 8px; margin-bottom: 6px; - font-family: var(--mono); - font-size: 9.5px; - font-weight: 700; - letter-spacing: 0.08em; - text-transform: uppercase; + font-size: var(--fs-2xs); + font-weight: var(--fw-medium); color: var(--muted); } .exp-node .node-head { @@ -1518,8 +1540,8 @@ textarea::placeholder { } .exp-node .node-slug { font-family: var(--mono); - font-size: 12px; - font-weight: 700; + font-size: var(--fs-sm); + font-weight: var(--fw-semibold); color: var(--text); flex: 1; min-width: 0; @@ -1529,8 +1551,8 @@ textarea::placeholder { } .exp-node .node-title { margin-top: 4px; - color: var(--subtext); - font-size: 11.5px; + color: var(--text); + font-size: var(--fs-sm); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; @@ -1541,21 +1563,8 @@ textarea::placeholder { display: flex; align-items: center; gap: 8px; - font-size: 10px; + font-size: var(--fs-2xs); color: var(--muted); - font-family: var(--mono); - text-transform: uppercase; - letter-spacing: 0.05em; -} -.exp-node .baseline-chip { - font-size: 9px; - font-weight: 700; - letter-spacing: 0.06em; - text-transform: uppercase; - color: var(--muted); - border: 1px solid var(--border); - padding: 0 4px; - flex-shrink: 0; } /* Direct view shortcuts (Changes / Logs) at the card's foot. */ .exp-node .node-actions { @@ -1572,10 +1581,10 @@ textarea::placeholder { gap: 5px; /* Tight: Changes + Logs + Code + the GitHub icon share one fixed-width row. */ padding: 3px 6px; - font-size: 10.5px; - font-weight: 700; - color: var(--subtext); - border-radius: 6px; + font-size: var(--fs-xs); + font-weight: var(--fw-medium); + color: var(--text); + border-radius: var(--radius-sm); /* The GitHub shortcut is an among sibling